From: Jim Evins Date: Wed, 10 Nov 2010 00:19:43 +0000 (-0500) Subject: Use GtkComboBoxText X-Git-Tag: glabels-2_3_1~141^2~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c57137558f60775a8a2205e127c2079f286d4625;p=glabels Use GtkComboBoxText --- diff --git a/data/ui/media-select.ui b/data/ui/media-select.ui index f64c6f3d..9cb0ab75 100644 --- a/data/ui/media-select.ui +++ b/data/ui/media-select.ui @@ -1,4 +1,4 @@ - + @@ -17,11 +17,9 @@ 320 True 6 - vertical True - vertical @@ -47,6 +45,8 @@ + True + True 1 @@ -66,7 +66,6 @@ True 6 - vertical True @@ -87,12 +86,15 @@ - + True - False + + + False + False 1 @@ -119,18 +121,22 @@ - + True - False + + + False + False 1 False + True 1 @@ -150,24 +156,29 @@ - + True - False + + + False + False 1 False + True 2 False + True 6 0 @@ -175,7 +186,6 @@ True - vertical @@ -201,6 +211,8 @@ + True + True 2 @@ -225,11 +237,9 @@ 320 True 6 - vertical True - vertical @@ -256,6 +266,8 @@ + True + True 1 @@ -287,6 +299,7 @@ False + True 1 @@ -331,6 +344,8 @@ + True + True 0 diff --git a/data/ui/merge-properties-dialog.ui b/data/ui/merge-properties-dialog.ui index c030c387..40609895 100644 --- a/data/ui/merge-properties-dialog.ui +++ b/data/ui/merge-properties-dialog.ui @@ -1,4 +1,4 @@ - + @@ -6,13 +6,11 @@ True - vertical 6 True 3 - vertical 6 @@ -42,21 +40,9 @@ - - - True - False - - - 1 - 2 - GTK_FILL - - True - vertical @@ -83,6 +69,18 @@ + + + True + + + + + + 1 + 2 + + @@ -99,6 +97,7 @@ False + True 0 @@ -114,7 +113,6 @@ True - vertical 6 @@ -134,6 +132,8 @@ + True + True 0 @@ -175,6 +175,7 @@ False + True 1 @@ -193,11 +194,15 @@ + True + True 1 + True + True 0 diff --git a/data/ui/object-editor.ui b/data/ui/object-editor.ui index 0bf509f9..9fde5f1f 100644 --- a/data/ui/object-editor.ui +++ b/data/ui/object-editor.ui @@ -1,7 +1,105 @@ - + + + + + + + + + both + + + + + + + + + + + + + + + 1 + 100 + 1 + 1 + 10 + + + 100 + 1 + 1 + 10 + + + 100 + 0.01 + 1 + + + 100 + 0.01 + 1 + + + 100 + 0.01 + 1 + + + 100 + 0.01 + 1 + + + -180 + 180 + 0.10000000000000001 + 5 + + + 100 + 1 + 0.01 + 0.10000000000000001 + + + 100 + 1 + 0.01 + 0.10000000000000001 + + + 100 + 1 + 0.01 + 0.10000000000000001 + + + 0.25 + 10 + 1 + 0.25 + 1 + + + 5 + 1 + 0.01 + 0.10000000000000001 + + + 1 + 250 + 1 + 1 + 10 + True 6 @@ -10,12 +108,10 @@ True - vertical True 6 - vertical 12 @@ -27,6 +123,7 @@ False + True 0 @@ -58,7 +155,6 @@ True 12 - vertical 6 @@ -76,11 +172,15 @@ + True + True 0 + True + True 0 @@ -91,12 +191,12 @@ True - vertical + True False 0 @@ -126,7 +226,6 @@ True 12 - vertical 12 @@ -152,6 +251,8 @@ + True + True 1 @@ -198,6 +299,8 @@ + True + True 1 @@ -266,6 +369,8 @@ + True + True 1 @@ -296,7 +401,6 @@ True - vertical 6 @@ -326,11 +430,15 @@ + True + True 1 + True + True 0 @@ -364,16 +472,22 @@ + True + True 1 + True + True 1 + True + True 1 @@ -460,6 +574,8 @@ + True + True 1 @@ -506,6 +622,8 @@ + True + True 1 @@ -551,7 +669,6 @@ True 12 - vertical 12 @@ -601,6 +718,8 @@ + True + True 1 @@ -631,7 +750,6 @@ True - vertical 6 @@ -661,11 +779,15 @@ + True + True 1 + True + True 0 @@ -699,16 +821,22 @@ + True + True 1 + True + True 1 + True + True 1 @@ -738,7 +866,6 @@ True 12 - vertical True @@ -759,7 +886,6 @@ True - vertical 6 @@ -790,11 +916,15 @@ + True + True 1 + True + True 0 @@ -828,16 +958,22 @@ + True + True 1 + True + True 1 + True + True 1 @@ -867,7 +1003,6 @@ True 12 - vertical 12 @@ -895,6 +1030,8 @@ True + True + True 1 @@ -935,6 +1072,8 @@ + True + True 1 @@ -964,7 +1103,6 @@ True 12 - vertical 12 @@ -991,6 +1129,8 @@ True + True + True 1 @@ -1029,6 +1169,8 @@ + True + True 1 @@ -1127,6 +1269,8 @@ + True + True 1 @@ -1156,7 +1300,6 @@ True 12 - vertical 12 @@ -1190,27 +1333,29 @@ - + True - on + + + 1 2 - 1 - 2 - - + True - on + + + 1 2 - + 1 + 2 @@ -1270,7 +1415,6 @@ True - vertical 6 @@ -1301,11 +1445,15 @@ + True + True 1 + True + True 0 @@ -1339,16 +1487,22 @@ + True + True 1 + True + True 1 + True + True 1 @@ -1426,6 +1580,7 @@ False + True 0 @@ -1493,6 +1648,7 @@ False + True 0 @@ -1535,6 +1691,8 @@ + True + True 0 @@ -1557,7 +1715,6 @@ True 12 - vertical 12 @@ -1606,6 +1763,7 @@ False + True 0 @@ -1643,6 +1801,7 @@ False + True 0 @@ -1669,6 +1828,8 @@ + True + True 0 @@ -1790,6 +1951,8 @@ + True + True 0 @@ -1812,7 +1975,6 @@ True 12 - vertical 12 @@ -1832,7 +1994,6 @@ True - vertical 12 @@ -1866,6 +2027,7 @@ False + True 0 @@ -1882,11 +2044,15 @@ + True + True 1 + True + True 0 @@ -1922,6 +2088,7 @@ False + True 0 @@ -1938,11 +2105,15 @@ + True + True 1 + True + True 1 @@ -1966,7 +2137,6 @@ True - vertical 6 @@ -2003,6 +2173,8 @@ + True + True 0 @@ -2036,21 +2208,29 @@ + True + True 1 + True + True 1 + True + True 1 + True + True 2 @@ -2083,6 +2263,7 @@ False + True 0 @@ -2099,11 +2280,15 @@ + True + True 1 + True + True 3 @@ -2152,11 +2337,15 @@ + True + True 1 + True + True 2 @@ -2182,6 +2371,7 @@ False + True end 0 @@ -2192,102 +2382,4 @@ closebutton1 - - 1 - 1 - 250 - 1 - 10 - - - 1 - 5 - 0.01 - 0.10000000000000001 - - - 1 - 0.25 - 10 - 0.25 - 1 - - - 1 - 100 - 0.01 - 0.10000000000000001 - - - 1 - 100 - 0.01 - 0.10000000000000001 - - - 1 - 100 - 0.01 - 0.10000000000000001 - - - -180 - 180 - 0.10000000000000001 - 5 - - - 100 - 0.01 - 1 - - - 100 - 0.01 - 1 - - - 100 - 0.01 - 1 - - - 100 - 0.01 - 1 - - - 1 - 100 - 1 - 10 - - - 1 - 1 - 100 - 1 - 10 - - - both - - - - - - - - - - - - - - - - - - - diff --git a/data/ui/template-designer.ui b/data/ui/template-designer.ui index 751edcf3..7cf4371b 100644 --- a/data/ui/template-designer.ui +++ b/data/ui/template-designer.ui @@ -1,7 +1,161 @@ - + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 1 + 2 + 1 + 1 + 1 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 1 + 10 + + + 100 + 1 + 1 + 10 + True window1 @@ -212,6 +366,7 @@ This dialog will assist you in the creation of a custom gLabels template. False + True 1 @@ -239,6 +394,8 @@ This dialog will assist you in the creation of a custom gLabels template. + True + True 1 @@ -322,8 +479,11 @@ This dialog will assist you in the creation of a custom gLabels template. True - + True + + + False @@ -511,6 +671,8 @@ This dialog will assist you in the creation of a custom gLabels template. + True + True 1 @@ -823,6 +985,8 @@ This dialog will assist you in the creation of a custom gLabels template.0 + True + True 1 @@ -1013,6 +1177,8 @@ This dialog will assist you in the creation of a custom gLabels template.0 + True + True 1 @@ -1332,6 +1498,8 @@ This dialog will assist you in the creation of a custom gLabels template.0 + True + True 1 @@ -1390,6 +1558,8 @@ The second example illustrates when two layouts are needed. True + True + True 0 @@ -1408,6 +1578,8 @@ one layout. + True + True 0 @@ -1419,6 +1591,8 @@ one layout. True + True + True 0 @@ -1437,6 +1611,8 @@ two layouts. + True + True 1 @@ -1900,6 +2076,8 @@ two layouts. + True + True 0 @@ -1915,6 +2093,8 @@ two layouts. + True + True 0 @@ -1942,6 +2122,8 @@ two layouts. + True + True 1 @@ -1995,158 +2177,4 @@ or "Back" to continue editing this design. - - 1 - 100 - 1 - 10 - - - 1 - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 1 - 1 - 2 - 1 - 1 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 100 - 1 - 10 - diff --git a/src/combo-util.c b/src/combo-util.c index b0e3ffa5..2ed67711 100644 --- a/src/combo-util.c +++ b/src/combo-util.c @@ -31,20 +31,18 @@ /* Convienience function to set strings in a text combo_box from a GList */ /****************************************************************************/ void -gl_combo_util_set_strings (GtkComboBox *combo, +gl_combo_util_set_strings (GtkComboBoxText *combo, GList *list) { - GtkTreeModel *model; GList *p; g_return_if_fail (list); - model = gtk_combo_box_get_model(combo); - gtk_list_store_clear (GTK_LIST_STORE (model)); + gtk_combo_box_text_remove_all (combo); for (p=list; p!=NULL; p=p->next) { if (p->data) { - gtk_combo_box_append_text (combo, p->data); + gtk_combo_box_text_append_text (combo, p->data); } } } @@ -116,29 +114,6 @@ gl_combo_util_set_active_text (GtkComboBox *combo, } -/****************************************************************************/ -/* Convienience function to add a simple text model to an existing */ -/* combo_box. This is needed since combo_boxes created with glade do not */ -/* use the gtk_combo_box_new_text() constructor. */ -/****************************************************************************/ -void -gl_combo_util_add_text_model (GtkComboBox *combo) -{ - GtkCellRenderer *cell; - GtkListStore *store; - - store = gtk_list_store_new (1, G_TYPE_STRING); - gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); - g_object_unref (store); - - cell = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, - "text", 0, - NULL); -} - - /* * Local Variables: -- emacs diff --git a/src/combo-util.h b/src/combo-util.h index 2205b6f2..5560c05e 100644 --- a/src/combo-util.h +++ b/src/combo-util.h @@ -26,14 +26,12 @@ G_BEGIN_DECLS -void gl_combo_util_set_strings (GtkComboBox *combo, +void gl_combo_util_set_strings (GtkComboBoxText *combo, GList *list); void gl_combo_util_set_active_text (GtkComboBox *combo, const gchar *text); -void gl_combo_util_add_text_model (GtkComboBox *combo); - G_END_DECLS #endif /* __COMBO_UTIL_H__ */ diff --git a/src/media-select.c b/src/media-select.c index 4391d3c0..af71d972 100644 --- a/src/media-select.c +++ b/src/media-select.c @@ -76,8 +76,11 @@ struct _glMediaSelectPrivate { GtkWidget *search_all_tab_vbox; GtkWidget *search_all_info_vbox; GtkWidget *search_all_info_bar; + GtkWidget *brand_combo_hbox; GtkWidget *brand_combo; + GtkWidget *page_size_combo_hbox; GtkWidget *page_size_combo; + GtkWidget *category_combo_hbox; GtkWidget *category_combo; GtkWidget *search_all_treeview; GtkListStore *search_all_store; @@ -290,9 +293,9 @@ gl_media_select_construct (glMediaSelect *this) "recent_info_vbox", &this->priv->recent_info_vbox, "recent_treeview", &this->priv->recent_treeview, "search_all_tab_vbox", &this->priv->search_all_tab_vbox, - "brand_combo", &this->priv->brand_combo, - "page_size_combo", &this->priv->page_size_combo, - "category_combo", &this->priv->category_combo, + "brand_combo_hbox", &this->priv->brand_combo_hbox, + "page_size_combo_hbox", &this->priv->page_size_combo_hbox, + "category_combo_hbox", &this->priv->category_combo_hbox, "search_all_info_vbox", &this->priv->search_all_info_vbox, "search_all_treeview", &this->priv->search_all_treeview, "custom_tab_vbox", &this->priv->custom_tab_vbox, @@ -316,6 +319,13 @@ gl_media_select_construct (glMediaSelect *this) gtk_notebook_page_num (GTK_NOTEBOOK (this->priv->notebook), this->priv->custom_tab_vbox); + this->priv->brand_combo = gtk_combo_box_text_new (); + gtk_box_pack_start (GTK_BOX (this->priv->brand_combo_hbox), this->priv->brand_combo, FALSE, FALSE, 0); + this->priv->page_size_combo = gtk_combo_box_text_new (); + gtk_box_pack_start (GTK_BOX (this->priv->page_size_combo_hbox), this->priv->page_size_combo, FALSE, FALSE, 0); + this->priv->category_combo = gtk_combo_box_text_new (); + gtk_box_pack_start (GTK_BOX (this->priv->category_combo_hbox), this->priv->category_combo, FALSE, FALSE, 0); + gtk_widget_show_all (GTK_WIDGET (this)); /* Recent templates treeview */ @@ -344,31 +354,25 @@ gl_media_select_construct (glMediaSelect *this) page_size_name = lgl_db_lookup_paper_name_from_id (page_size_id); /* Brand selection control */ - gl_combo_util_add_text_model (GTK_COMBO_BOX (this->priv->brand_combo)); brands = lgl_db_get_brand_list (NULL, NULL); brands = g_list_prepend (brands, g_strdup (C_("Brand", "Any"))); - gl_combo_util_set_strings (GTK_COMBO_BOX (this->priv->brand_combo), brands); + gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT (this->priv->brand_combo), brands); lgl_db_free_brand_list (brands); - gl_combo_util_set_active_text (GTK_COMBO_BOX (this->priv->brand_combo), - C_("Brand", "Any")); + gl_combo_util_set_active_text (GTK_COMBO_BOX (this->priv->brand_combo), C_("Brand", "Any")); /* Page size selection control */ - gl_combo_util_add_text_model (GTK_COMBO_BOX (this->priv->page_size_combo)); page_sizes = lgl_db_get_paper_name_list (); page_sizes = g_list_prepend (page_sizes, g_strdup (C_("Page size", "Any"))); - gl_combo_util_set_strings (GTK_COMBO_BOX (this->priv->page_size_combo), page_sizes); + gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT (this->priv->page_size_combo), page_sizes); lgl_db_free_paper_name_list (page_sizes); - gl_combo_util_set_active_text (GTK_COMBO_BOX (this->priv->page_size_combo), - page_size_name); + gl_combo_util_set_active_text (GTK_COMBO_BOX (this->priv->page_size_combo), page_size_name); /* Category selection control */ - gl_combo_util_add_text_model (GTK_COMBO_BOX (this->priv->category_combo)); categories = lgl_db_get_category_name_list (); categories = g_list_prepend (categories, g_strdup (C_("Category", "Any"))); - gl_combo_util_set_strings (GTK_COMBO_BOX (this->priv->category_combo), categories); - gl_combo_util_set_active_text (GTK_COMBO_BOX (this->priv->category_combo), - C_("Category", "Any")); + gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT (this->priv->category_combo), categories); lgl_db_free_category_name_list (categories); + gl_combo_util_set_active_text (GTK_COMBO_BOX (this->priv->category_combo), C_("Category", "Any")); /* Search all treeview */ this->priv->search_all_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING); @@ -489,9 +493,9 @@ filter_changed_cb (glMediaSelect *this) this->priv->stop_signals = TRUE; /* Update template selections for new filter settings */ - brand = gtk_combo_box_get_active_text (GTK_COMBO_BOX (this->priv->brand_combo)); - page_size_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (this->priv->page_size_combo)); - category_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (this->priv->category_combo)); + brand = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (this->priv->brand_combo)); + page_size_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (this->priv->page_size_combo)); + category_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (this->priv->category_combo)); if ( brand && strlen(brand) && page_size_name && strlen(page_size_name) && category_name && strlen(category_name) ) @@ -691,9 +695,9 @@ db_changed_cb (glMediaSelect *this) lgl_db_free_template_name_list (list); /* Update search all page. */ - brand = gtk_combo_box_get_active_text (GTK_COMBO_BOX (this->priv->brand_combo)); - page_size_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (this->priv->page_size_combo)); - category_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (this->priv->category_combo)); + brand = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (this->priv->brand_combo)); + page_size_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (this->priv->page_size_combo)); + category_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (this->priv->category_combo)); if ( brand && strlen(brand) && page_size_name && strlen(page_size_name) && category_name && strlen(category_name) ) @@ -838,12 +842,12 @@ gl_media_select_get_filter_parameters (glMediaSelect *this, g_free (*category_id); page_size_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (this->priv->page_size_combo)); + gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (this->priv->page_size_combo)); *page_size_id = lgl_db_lookup_paper_id_from_name (page_size_name); category_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (this->priv->category_combo)); + gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (this->priv->category_combo)); *category_id = lgl_db_lookup_category_id_from_name (category_name); diff --git a/src/merge-properties-dialog.c b/src/merge-properties-dialog.c index e6f3d69c..90d93e2a 100644 --- a/src/merge-properties-dialog.c +++ b/src/merge-properties-dialog.c @@ -45,6 +45,7 @@ struct _glMergePropertiesDialogPrivate { GtkBuilder *builder; + GtkWidget *type_combo_hbox; GtkWidget *type_combo; GtkWidget *location_vbox; GtkWidget *src_entry; @@ -173,7 +174,7 @@ gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog) gl_builder_util_get_widgets (builder, "merge_properties_vbox", &merge_properties_vbox, - "type_combo", &dialog->priv->type_combo, + "type_combo_hbox", &dialog->priv->type_combo_hbox, "location_vbox", &dialog->priv->location_vbox, "treeview", &dialog->priv->treeview, "select_all_button", &dialog->priv->select_all_button, @@ -183,8 +184,8 @@ gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog) gtk_container_add (GTK_CONTAINER (vbox), merge_properties_vbox); dialog->priv->builder = builder; - gl_combo_util_add_text_model (GTK_COMBO_BOX (dialog->priv->type_combo)); - + dialog->priv->type_combo = gtk_combo_box_text_new (); + gtk_box_pack_start (GTK_BOX (dialog->priv->type_combo_hbox), dialog->priv->type_combo, TRUE, TRUE, 0); gl_debug (DEBUG_MERGE, "END"); } @@ -289,11 +290,9 @@ gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, gl_debug (DEBUG_MERGE, " \"%s\"", p->data); } } - gl_combo_util_set_strings (GTK_COMBO_BOX (dialog->priv->type_combo), - texts); + gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT (dialog->priv->type_combo), texts); gl_merge_free_descriptions (&texts); - gl_combo_util_set_active_text (GTK_COMBO_BOX (dialog->priv->type_combo), - description); + gl_combo_util_set_active_text (GTK_COMBO_BOX (dialog->priv->type_combo), description); g_signal_connect (G_OBJECT (dialog->priv->type_combo), "changed", G_CALLBACK (type_changed_cb), dialog); @@ -397,7 +396,7 @@ type_changed_cb (GtkWidget *widget, gl_debug (DEBUG_MERGE, "START"); - description = gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->type_combo)); + description = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (dialog->priv->type_combo)); name = gl_merge_description_to_name (description); src = gl_merge_get_src (dialog->priv->merge); /* keep current src if possible */ diff --git a/src/object-editor-bc-page.c b/src/object-editor-bc-page.c index f6d55573..06a7c57a 100644 --- a/src/object-editor-bc-page.c +++ b/src/object-editor-bc-page.c @@ -77,19 +77,19 @@ gl_object_editor_prepare_bc_page (glObjectEditor *editor) /* Extract widgets from XML tree. */ gl_builder_util_get_widgets (editor->priv->builder, - "bc_page_vbox", &editor->priv->bc_page_vbox, - "bc_backend_combo", &editor->priv->bc_backend_combo, - "bc_style_combo", &editor->priv->bc_style_combo, - "bc_text_check", &editor->priv->bc_text_check, - "bc_cs_check", &editor->priv->bc_cs_check, - "bc_color_hbox", &editor->priv->bc_color_hbox, - "bc_key_hbox", &editor->priv->bc_key_hbox, - "bc_key_radio", &editor->priv->bc_key_radio, - "bc_color_radio", &editor->priv->bc_color_radio, - "data_format_label", &editor->priv->data_format_label, - "data_ex_label", &editor->priv->data_ex_label, - "data_digits_label", &editor->priv->data_digits_label, - "data_digits_spin", &editor->priv->data_digits_spin, + "bc_page_vbox", &editor->priv->bc_page_vbox, + "bc_backend_combo_hbox", &editor->priv->bc_backend_combo_hbox, + "bc_style_combo_hbox", &editor->priv->bc_style_combo_hbox, + "bc_text_check", &editor->priv->bc_text_check, + "bc_cs_check", &editor->priv->bc_cs_check, + "bc_color_hbox", &editor->priv->bc_color_hbox, + "bc_key_hbox", &editor->priv->bc_key_hbox, + "bc_key_radio", &editor->priv->bc_key_radio, + "bc_color_radio", &editor->priv->bc_color_radio, + "data_format_label", &editor->priv->data_format_label, + "data_ex_label", &editor->priv->data_ex_label, + "data_digits_label", &editor->priv->data_digits_label, + "data_digits_spin", &editor->priv->data_digits_spin, NULL); editor->priv->data_format_fixed_flag = FALSE; @@ -106,12 +106,19 @@ gl_object_editor_prepare_bc_page (glObjectEditor *editor) editor->priv->bc_key_combo, TRUE, TRUE, 0); - gl_combo_util_add_text_model ( GTK_COMBO_BOX(editor->priv->bc_backend_combo)); - gl_combo_util_add_text_model ( GTK_COMBO_BOX(editor->priv->bc_style_combo)); + editor->priv->bc_backend_combo = gtk_combo_box_text_new (); + gtk_box_pack_start (GTK_BOX (editor->priv->bc_backend_combo_hbox), + editor->priv->bc_backend_combo, + TRUE, TRUE, 0); + + editor->priv->bc_style_combo = gtk_combo_box_text_new (); + gtk_box_pack_start (GTK_BOX (editor->priv->bc_style_combo_hbox), + editor->priv->bc_style_combo, + TRUE, TRUE, 0); /* Load barcode backends */ backends = gl_barcode_backends_get_backend_list (); - gl_combo_util_set_strings (GTK_COMBO_BOX(editor->priv->bc_backend_combo), + gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT(editor->priv->bc_backend_combo), backends); /* Kludge: Load styles for each backend once, so that when they are loaded for real the size of @@ -186,7 +193,7 @@ backend_changed_cb (glObjectEditor *editor) if (editor->priv->stop_signals) return; backend_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_backend_combo)); + gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo)); backend_id = gl_barcode_backends_backend_name_to_id (backend_name); @@ -216,12 +223,12 @@ style_changed_cb (glObjectEditor *editor) if (editor->priv->stop_signals) return; backend_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_backend_combo)); + gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo)); backend_id = gl_barcode_backends_backend_name_to_id (backend_name); style_string = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo)); + gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_style_combo)); /* Don't emit if entry is empty. */ if ( style_string && *style_string != 0 ) { @@ -280,7 +287,7 @@ gl_object_editor_load_bc_styles (glObjectEditor *editor, editor->priv->stop_signals = TRUE; styles = gl_barcode_backends_get_styles_list (backend_id); - gl_combo_util_set_strings (GTK_COMBO_BOX(editor->priv->bc_style_combo), styles); + gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT(editor->priv->bc_style_combo), styles); gl_barcode_backends_free_styles_list (styles); editor->priv->stop_signals = FALSE; @@ -372,10 +379,10 @@ gl_object_editor_get_bc_style (glObjectEditor *editor) gl_debug (DEBUG_EDITOR, "START"); - backend_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_backend_combo)); + backend_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo)); backend_id = gl_barcode_backends_backend_name_to_id (backend_name); - style_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo)); + style_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_style_combo)); id = gl_barcode_backends_style_name_to_id (backend_id, style_name); bc_style = gl_label_barcode_style_new (); @@ -518,21 +525,21 @@ data_digits_spin_changed_cb (glObjectEditor *editor) if (editor->priv->stop_signals) return; - backend_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_backend_combo)); + backend_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo)); backend_id = gl_barcode_backends_backend_name_to_id (backend_name); - style_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo)); - if ( *style_name != 0 ) { + style_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_style_combo)); + if ( style_name && *style_name != '\0' ) { id = gl_barcode_backends_style_name_to_id (backend_id, style_name); digits = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->data_digits_spin)); ex_string = gl_barcode_backends_style_default_digits (backend_id, id, digits); gtk_label_set_text (GTK_LABEL(editor->priv->data_ex_label), ex_string); + g_free (ex_string); } g_free (backend_name); g_free (style_name); - g_free (ex_string); gl_object_editor_changed_cb (editor); } diff --git a/src/object-editor-private.h b/src/object-editor-private.h index 957251af..5bfdbc2d 100644 --- a/src/object-editor-private.h +++ b/src/object-editor-private.h @@ -123,7 +123,9 @@ struct _glObjectEditorPrivate { GtkWidget *edit_insert_field_button; GtkWidget *bc_page_vbox; + GtkWidget *bc_backend_combo_hbox; GtkWidget *bc_backend_combo; + GtkWidget *bc_style_combo_hbox; GtkWidget *bc_style_combo; GtkWidget *bc_text_check; GtkWidget *bc_cs_check; diff --git a/src/object-editor.c b/src/object-editor.c index c0290e56..f7030dde 100644 --- a/src/object-editor.c +++ b/src/object-editor.c @@ -164,7 +164,7 @@ gl_object_editor_init (glObjectEditor *editor) gtk_widget_set_sensitive (editor->priv->title_label, FALSE); /* Hide all notebook pages to start with. */ - gtk_widget_hide_all (editor->priv->notebook); + gtk_widget_hide (editor->priv->notebook); gtk_widget_set_no_show_all (editor->priv->notebook, TRUE); gl_debug (DEBUG_EDITOR, "END"); diff --git a/src/print-op-dialog.c b/src/print-op-dialog.c index dea9ff60..412bf17a 100644 --- a/src/print-op-dialog.c +++ b/src/print-op-dialog.c @@ -322,7 +322,7 @@ create_custom_widget_cb (GtkPrintOperation *operation, op->priv->labels_per_sheet); gtk_widget_show_all (op->priv->simple_frame); - gtk_widget_hide_all (op->priv->merge_frame); + gtk_widget_hide (op->priv->merge_frame); g_signal_connect (G_OBJECT (op->priv->simple_sheets_radio), "toggled", G_CALLBACK (simple_sheets_radio_cb), op); @@ -377,7 +377,7 @@ create_custom_widget_cb (GtkPrintOperation *operation, gl_print_op_get_collate_flag (GL_PRINT_OP(op))); - gtk_widget_hide_all (op->priv->simple_frame); + gtk_widget_hide (op->priv->simple_frame); gtk_widget_show_all (op->priv->merge_frame); g_signal_connect (G_OBJECT (op->priv->merge_first_spin), "changed", diff --git a/src/template-designer.c b/src/template-designer.c index a7a4572b..ef74ac69 100644 --- a/src/template-designer.c +++ b/src/template-designer.c @@ -92,6 +92,7 @@ struct _glTemplateDesignerPrivate GtkWidget *description_entry; /* Page size page controls */ + GtkWidget *pg_size_combo_hbox; GtkWidget *pg_size_combo; GtkWidget *pg_w_spin; GtkWidget *pg_h_spin; @@ -529,16 +530,17 @@ construct_pg_size_page (glTemplateDesigner *dialog, gl_debug (DEBUG_TEMPLATE, "START"); gl_builder_util_get_widgets (dialog->priv->builder, - "pg_size_page", &dialog->priv->pg_size_page, - "pg_size_combo", &dialog->priv->pg_size_combo, - "pg_w_spin", &dialog->priv->pg_w_spin, - "pg_h_spin", &dialog->priv->pg_h_spin, - "pg_w_units_label", &dialog->priv->pg_w_units_label, - "pg_h_units_label", &dialog->priv->pg_h_units_label, + "pg_size_page", &dialog->priv->pg_size_page, + "pg_size_combo_combo", &dialog->priv->pg_size_combo_hbox, + "pg_w_spin", &dialog->priv->pg_w_spin, + "pg_h_spin", &dialog->priv->pg_h_spin, + "pg_w_units_label", &dialog->priv->pg_w_units_label, + "pg_h_units_label", &dialog->priv->pg_h_units_label, NULL); - gl_combo_util_add_text_model (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); + dialog->priv->pg_size_combo = gtk_combo_box_text_new (); + gtk_box_pack_start (GTK_BOX (dialog->priv->pg_size_combo_hbox), dialog->priv->pg_size_combo, FALSE, FALSE, 0); gtk_assistant_append_page (GTK_ASSISTANT (dialog), dialog->priv->pg_size_page); @@ -555,7 +557,7 @@ construct_pg_size_page (glTemplateDesigner *dialog, /* Load page size combo */ page_sizes = lgl_db_get_paper_name_list (); - gl_combo_util_set_strings (GTK_COMBO_BOX (dialog->priv->pg_size_combo), page_sizes); + gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT (dialog->priv->pg_size_combo), page_sizes); lgl_db_free_paper_name_list (page_sizes); default_page_size_id = gl_prefs_model_get_default_page_size (gl_prefs); default_page_size_name = lgl_db_lookup_paper_name_from_id (default_page_size_id); @@ -1454,7 +1456,7 @@ pg_size_page_changed_cb (glTemplateDesigner *dialog) page_size_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); + gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (dialog->priv->pg_size_combo)); if (page_size_name && strlen(page_size_name)) { @@ -1810,7 +1812,7 @@ build_template (glTemplateDesigner *dialog) desc = gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->description_entry), 0, -1); page_size_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); + gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (dialog->priv->pg_size_combo)); paper = lgl_db_lookup_paper_from_name (page_size_name); if ( g_ascii_strcasecmp (paper->id, "Other") == 0 ) { paper->width =