GNOME Bugzilla – Bug 652103
Add a GtkPrinterOptionWidget type of label to just show informational text from the print backend
Last modified: 2011-06-08 17:23:34 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.
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.
(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.
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
(In reply to comment #3) > do you really need the hbox there? Couldn't it look like this: Agreed, pushed to master, thanks.