mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 11:20:12 +00:00
Add a GtkPrinterOptionWidget type of INFO to just show informational text from the print backend
This fixes https://bugzilla.gnome.org/show_bug.cgi?id=652103
This commit is contained in:
parent
a1ce49c30e
commit
93957459d8
@ -53,7 +53,8 @@ typedef enum {
|
||||
GTK_PRINTER_OPTION_TYPE_PICKONE_STRING,
|
||||
GTK_PRINTER_OPTION_TYPE_ALTERNATIVE,
|
||||
GTK_PRINTER_OPTION_TYPE_STRING,
|
||||
GTK_PRINTER_OPTION_TYPE_FILESAVE
|
||||
GTK_PRINTER_OPTION_TYPE_FILESAVE,
|
||||
GTK_PRINTER_OPTION_TYPE_INFO
|
||||
} GtkPrinterOptionType;
|
||||
|
||||
struct _GtkPrinterOption
|
||||
|
@ -60,6 +60,7 @@ struct GtkPrinterOptionWidgetPrivate
|
||||
GtkWidget *entry;
|
||||
GtkWidget *image;
|
||||
GtkWidget *label;
|
||||
GtkWidget *info_label;
|
||||
GtkWidget *filechooser;
|
||||
GtkWidget *box;
|
||||
};
|
||||
@ -424,6 +425,11 @@ deconstruct_widgets (GtkPrinterOptionWidget *widget)
|
||||
gtk_widget_destroy (priv->label);
|
||||
priv->label = NULL;
|
||||
}
|
||||
if (priv->info_label)
|
||||
{
|
||||
gtk_widget_destroy (priv->info_label);
|
||||
priv->info_label = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -673,6 +679,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
|
||||
char *text;
|
||||
int i;
|
||||
GSList *group;
|
||||
GtkWidget *hbox;
|
||||
|
||||
source = priv->source;
|
||||
|
||||
@ -822,6 +829,22 @@ construct_widgets (GtkPrinterOptionWidget *widget)
|
||||
g_signal_connect (priv->combo, "selection-changed", G_CALLBACK (filesave_changed_cb), widget);
|
||||
}
|
||||
break;
|
||||
|
||||
case GTK_PRINTER_OPTION_TYPE_INFO:
|
||||
priv->info_label = gtk_label_new (NULL);
|
||||
gtk_label_set_selectable (GTK_LABEL (priv->info_label), TRUE);
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), priv->info_label, FALSE, TRUE, 0);
|
||||
gtk_widget_show_all (hbox);
|
||||
gtk_box_pack_start (GTK_BOX (widget), hbox, TRUE, 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;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -886,6 +909,9 @@ update_widgets (GtkPrinterOptionWidget *widget)
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->entry), source->value);
|
||||
break;
|
||||
}
|
||||
case GTK_PRINTER_OPTION_TYPE_INFO:
|
||||
gtk_label_set_text (GTK_LABEL (priv->info_label), source->value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user