From caf7fa47549bd5e82771dae7352a3e9df54876a5 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Fri, 22 Apr 2005 01:53:33 +0000 Subject: [PATCH] 2005-04-21 Jim Evins * data/glade/template-designer.glade: * src/template-designer.c: (construct_pg_size_page), (pg_size_page_changed_cb), (build_template): Replaced the deprecated GtkCombo widget with the new GtkComboBox. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@526 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/ChangeLog | 8 + glabels2/data/glade/template-designer.glade | 366 ++++++++++++++++---- glabels2/src/template-designer.c | 18 +- 3 files changed, 322 insertions(+), 70 deletions(-) diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 2b108464..2984c064 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,11 @@ +2005-04-21 Jim Evins + + * data/glade/template-designer.glade: + * src/template-designer.c: (construct_pg_size_page), + (pg_size_page_changed_cb), (build_template): + Replaced the deprecated GtkCombo widget with the new + GtkComboBox. + 2005-04-20 Jim Evins * data/glade/prefs-dialog.glade: diff --git a/glabels2/data/glade/template-designer.glade b/glabels2/data/glade/template-designer.glade index 2f8a53d6..8066f296 100644 --- a/glabels2/data/glade/template-designer.glade +++ b/glabels2/data/glade/template-designer.glade @@ -12,6 +12,12 @@ False True False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True @@ -63,6 +69,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -93,6 +103,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -117,6 +131,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -143,7 +161,7 @@ This dialog will assist you in the creation of a custom gLabels template.0 True - * + * False @@ -166,6 +184,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -199,7 +221,7 @@ This dialog will assist you in the creation of a custom gLabels template.0 True - * + * False @@ -222,6 +244,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -253,6 +279,10 @@ This dialog will assist you in the creation of a custom gLabels template.0 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -273,7 +303,7 @@ This dialog will assist you in the creation of a custom gLabels template.0 True - * + * False @@ -298,6 +328,10 @@ This dialog will assist you in the creation of a custom gLabels template.0 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 1 @@ -358,6 +392,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -388,6 +426,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -412,6 +454,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -436,6 +482,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -454,34 +504,10 @@ This dialog will assist you in the creation of a custom gLabels template.0 - + True - False - True - False - True - False - - - - True - True - False - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - + False + True 0 @@ -513,7 +539,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -541,6 +567,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -569,7 +599,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -597,6 +627,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -664,6 +698,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -685,6 +723,7 @@ This dialog will assist you in the creation of a custom gLabels template.Rectangular or square (can have rounded corners) True GTK_RELIEF_NORMAL + True False False True @@ -703,6 +742,7 @@ This dialog will assist you in the creation of a custom gLabels template.Round True GTK_RELIEF_NORMAL + True False False True @@ -722,6 +762,7 @@ This dialog will assist you in the creation of a custom gLabels template.CD/DVD (including credit card CDs) True GTK_RELIEF_NORMAL + True False False True @@ -783,6 +824,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -819,6 +864,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -843,6 +892,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -867,6 +920,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -891,6 +948,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -915,6 +976,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -939,6 +1004,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -963,6 +1032,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -987,6 +1060,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1002,7 +1079,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1023,7 +1100,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1044,7 +1121,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1065,7 +1142,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1095,6 +1172,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1110,7 +1191,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1140,6 +1221,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1155,7 +1240,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1185,6 +1270,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1209,6 +1298,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1291,6 +1384,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1327,6 +1424,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1351,6 +1452,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1366,7 +1471,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1387,7 +1492,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1417,6 +1522,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1441,6 +1550,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1465,6 +1578,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1489,6 +1606,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1504,7 +1625,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1592,6 +1713,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1628,6 +1753,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1652,6 +1781,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1676,6 +1809,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1700,6 +1837,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1724,6 +1865,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1739,7 +1884,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1760,7 +1905,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1781,7 +1926,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1802,7 +1947,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1823,7 +1968,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -1853,6 +1998,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1877,6 +2026,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1901,6 +2054,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1925,6 +2082,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1949,6 +2110,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1973,6 +2138,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1997,6 +2166,10 @@ This dialog will assist you in the creation of a custom gLabels template.0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -2012,7 +2185,7 @@ This dialog will assist you in the creation of a custom gLabels template. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2104,6 +2277,10 @@ The second example illustrates when two layouts are needed. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2153,6 +2330,10 @@ one layout. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2203,6 +2384,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2244,6 +2429,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2256,7 +2445,7 @@ two layouts. True True - 0.1 + 0.10000000149 0 False GTK_UPDATE_ALWAYS @@ -2320,6 +2509,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2356,6 +2549,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 1 @@ -2380,6 +2577,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -2404,6 +2605,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2428,6 +2633,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2452,6 +2661,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2476,6 +2689,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2500,6 +2717,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2524,6 +2745,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2548,6 +2773,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 3 @@ -2572,6 +2801,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 3 @@ -2596,6 +2829,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 3 @@ -2620,6 +2857,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 3 @@ -2635,7 +2876,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2656,7 +2897,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2677,7 +2918,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2698,7 +2939,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2719,7 +2960,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2740,7 +2981,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2761,7 +3002,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2782,7 +3023,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2803,7 +3044,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2824,7 +3065,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2845,7 +3086,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2866,7 +3107,7 @@ two layouts. True True - 0.01 + 0.00999999977648 0 False GTK_UPDATE_ALWAYS @@ -2909,6 +3150,10 @@ two layouts. 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2946,6 +3191,7 @@ two layouts. Print test sheet True GTK_RELIEF_NORMAL + True 0 diff --git a/glabels2/src/template-designer.c b/glabels2/src/template-designer.c index e2740db6..e3292680 100644 --- a/glabels2/src/template-designer.c +++ b/glabels2/src/template-designer.c @@ -31,8 +31,7 @@ #include #include #include -#include -#include +#include #include #include "prefs.h" @@ -122,7 +121,6 @@ struct _glTemplateDesignerPrivate /* Page size page controls */ GtkWidget *pg_size_combo; - GtkWidget *pg_size_entry; GtkWidget *pg_w_spin; GtkWidget *pg_h_spin; GtkWidget *pg_w_units_label; @@ -508,8 +506,6 @@ construct_pg_size_page (glTemplateDesigner *dlg, /* Page Size Page Widgets */ dlg->priv->pg_size_combo = glade_xml_get_widget (dlg->priv->gui, "pg_size_combo"); - dlg->priv->pg_size_entry = - glade_xml_get_widget (dlg->priv->gui, "pg_size_entry"); dlg->priv->pg_w_spin = glade_xml_get_widget (dlg->priv->gui, "pg_w_spin"); dlg->priv->pg_h_spin = @@ -519,13 +515,15 @@ construct_pg_size_page (glTemplateDesigner *dlg, dlg->priv->pg_h_units_label = glade_xml_get_widget (dlg->priv->gui, "pg_h_units_label"); + gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dlg->priv->pg_size_combo)); + /* Load page size combo */ page_sizes = gl_paper_get_name_list (); - gtk_combo_set_popdown_strings (GTK_COMBO(dlg->priv->pg_size_combo), page_sizes); + gl_util_combo_box_set_strings (GTK_COMBO_BOX (dlg->priv->pg_size_combo), page_sizes); gl_paper_free_name_list (page_sizes); default_page_size_id = gl_prefs_get_page_size (); default_page_size_name = gl_paper_lookup_name_from_id (default_page_size_id); - gtk_entry_set_text (GTK_ENTRY(dlg->priv->pg_size_entry), default_page_size_name); + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dlg->priv->pg_size_combo), default_page_size_name); g_free (default_page_size_name); /* Apply units to spinbuttons and units labels. */ @@ -548,7 +546,7 @@ construct_pg_size_page (glTemplateDesigner *dlg, /* Connect a handler that listens for changes in these widgets */ /* This controls sensitivity of related widgets. */ - g_signal_connect_swapped (G_OBJECT(dlg->priv->pg_size_entry), "changed", + g_signal_connect_swapped (G_OBJECT(dlg->priv->pg_size_combo), "changed", G_CALLBACK(pg_size_page_changed_cb), dlg); /* Use this same handler to prepare the page. */ @@ -1130,7 +1128,7 @@ pg_size_page_changed_cb (glTemplateDesigner *dlg) page_size_name = - gtk_editable_get_chars (GTK_EDITABLE(dlg->priv->pg_size_entry), 0, -1); + gtk_combo_box_get_active_text (GTK_COMBO_BOX (dlg->priv->pg_size_combo)); if (page_size_name && strlen(page_size_name)) { @@ -1551,7 +1549,7 @@ build_template (glTemplateDesigner *dlg) desc = gtk_editable_get_chars (GTK_EDITABLE(dlg->priv->description_entry), 0, -1); page_size_name = - gtk_editable_get_chars (GTK_EDITABLE(dlg->priv->pg_size_entry), 0, -1); + gtk_combo_box_get_active_text (GTK_COMBO_BOX (dlg->priv->pg_size_combo)); paper = gl_paper_from_name (page_size_name); if ( g_strcasecmp (paper->id, "Other") == 0 ) { paper->width = -- 2.39.5