[gtk+] Add a GtkPrinterOptionWidget type of INFO to just show informational text from the print backend
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add a GtkPrinterOptionWidget type of INFO to just show informational text from the print backend
- Date: Wed, 8 Jun 2011 15:38:45 +0000 (UTC)
commit 93957459d8613eeb9413b4e5a32d4ccec6036160
Author: Richard Hughes <richard hughsie com>
Date: Wed Jun 8 12:02:39 2011 +0100
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
gtk/gtkprinteroption.h | 3 ++-
gtk/gtkprinteroptionwidget.c | 26 ++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkprinteroption.h b/gtk/gtkprinteroption.h
index 50e7ddf..9138fd6 100644
--- a/gtk/gtkprinteroption.h
+++ b/gtk/gtkprinteroption.h
@@ -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
diff --git a/gtk/gtkprinteroptionwidget.c b/gtk/gtkprinteroptionwidget.c
index 08f69fe..24e20b2 100644
--- a/gtk/gtkprinteroptionwidget.c
+++ b/gtk/gtkprinteroptionwidget.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]