After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652103 - Add a GtkPrinterOptionWidget type of label to just show informational text from the print backend
Add a GtkPrinterOptionWidget type of label to just show informational text f...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
3.1.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
Depends on:
Blocks: 651972
 
 
Reported: 2011-06-08 11:06 UTC by Richard Hughes
Modified: 2011-06-08 17:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for initial comments (2.71 KB, patch)
2011-06-08 11:06 UTC, Richard Hughes
accepted-commit_now Details | Review

Description Richard Hughes 2011-06-08 11:06:23 UTC
Created attachment 189461 [details] [review]
patch for initial comments

I need this so I can push out information-only labels to the print dialogs. This will be used to fix https://bugzilla.gnome.org/show_bug.cgi?id=651972

Please review, thanks.
Comment 1 Matthias Clasen 2011-06-08 15:15:42 UTC
Review of attachment 189461 [details] [review]:

With those two changes, looks good to go.

::: gtk/gtkprinteroption.h
@@ +55,3 @@
   GTK_PRINTER_OPTION_TYPE_STRING,
+  GTK_PRINTER_OPTION_TYPE_FILESAVE,
+  GTK_PRINTER_OPTION_TYPE_LABEL

I think INFO would be slightly clearer than LABEL here. Its not labelling anything really, even if it uses a GtkLabel to show the information...

::: gtk/gtkprinteroptionwidget.c
@@ +832,3 @@
+
+    case GTK_PRINTER_OPTION_TYPE_LABEL:
+      priv->info_label = gtk_label_new (NULL);

Should make the label selectable, so users can copy-paste the information.
Comment 2 Richard Hughes 2011-06-08 15:39:01 UTC
(In reply to comment #1)
> Review of attachment 189461 [details] [review]:
> 
> With those two changes, looks good to go.
> 
> ::: gtk/gtkprinteroption.h
> @@ +55,3 @@
>    GTK_PRINTER_OPTION_TYPE_STRING,
> +  GTK_PRINTER_OPTION_TYPE_FILESAVE,
> +  GTK_PRINTER_OPTION_TYPE_LABEL
> 
> I think INFO would be slightly clearer than LABEL here. Its not labelling
> anything really, even if it uses a GtkLabel to show the information...

Fixed.

> ::: gtk/gtkprinteroptionwidget.c
> @@ +832,3 @@
> +
> +    case GTK_PRINTER_OPTION_TYPE_LABEL:
> +      priv->info_label = gtk_label_new (NULL);
> 
> Should make the label selectable, so users can copy-paste the information.

Done, thanks.
Comment 3 Marek Kašík 2011-06-08 16:44:12 UTC
Hi Richard,

do you really need the hbox there? Couldn't it look like this:

+
+    case GTK_PRINTER_OPTION_TYPE_INFO:
+      priv->info_label = gtk_label_new (NULL);
+      gtk_label_set_selectable (GTK_LABEL (priv->info_label), TRUE);
+      gtk_widget_show (priv->info_label);
+      gtk_box_pack_start (GTK_BOX (widget), priv->info_label, FALSE, TRUE, 0);
+
+      text = g_strdup_printf ("%s:", source->display_text);
+      priv->label = gtk_label_new_with_mnemonic (text);
+      g_free (text);
+      gtk_widget_show (priv->label);
+
+      break;
+

Regards

Marek
Comment 4 Richard Hughes 2011-06-08 17:23:34 UTC
(In reply to comment #3)
> do you really need the hbox there? Couldn't it look like this:

Agreed, pushed to master, thanks.