diff options
-rw-r--r-- | shell/ChangeLog | 8 | ||||
-rw-r--r-- | shell/e-user-creatable-items-handler.c | 78 | ||||
-rw-r--r-- | widgets/ChangeLog | 6 | ||||
-rw-r--r-- | widgets/misc/e-combo-button.c | 1 |
4 files changed, 44 insertions, 49 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index a8c795902a..60ee8719d2 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,11 @@ +2006-07-12 Hiroyuki Ikezoe <poincare@ikezoe.net> + + ** Fixes bug #347182 + * e-user-creatable-items-handlers.c: + (set_combo_button_style): New function. + (new_button_change): Call set_combo_button_style. + (setup_toolbar_button): Call set_combo_button_style. + 2006-07-07 Li Yuan <li.yuan@sun.com> * e-shell-window.c: (setup_widgets): diff --git a/shell/e-user-creatable-items-handler.c b/shell/e-user-creatable-items-handler.c index 0382ce9330..bbd22e8a61 100644 --- a/shell/e-user-creatable-items-handler.c +++ b/shell/e-user-creatable-items-handler.c @@ -671,6 +671,31 @@ gtk_separator_func (EUserCreatableItemsHandler *handler, gpointer menu, int nth) } static void +set_combo_button_style (EComboButton *button, const gchar *style, GdkPixbuf *icon) +{ + if(!g_ascii_strcasecmp (style,"both")){ + e_combo_button_pack_vbox (button); + e_combo_button_set_icon (button, icon); + e_combo_button_set_label (button, _(" New ")); + } + else if(!g_ascii_strcasecmp (style,"both-horiz")){ + e_combo_button_pack_hbox (button); + e_combo_button_set_label (button, _("New")); + e_combo_button_set_icon (button, icon); + } + else if(!g_ascii_strcasecmp (style,"icons")){ + e_combo_button_pack_hbox (button); + e_combo_button_set_icon (button, icon); + e_combo_button_set_label (button, ""); + } + else if(!g_ascii_strcasecmp(style,"text")){ + e_combo_button_pack_hbox (button); + e_combo_button_set_label (button, _("New")); + e_combo_button_set_icon (button, NULL); + } +} + +static void new_button_change (GConfClient *gconf, unsigned int connection_id, GConfEntry *entry, @@ -682,30 +707,9 @@ new_button_change (GConfClient *gconf, priv = handler->priv; val = gconf_client_get_string (gconf, "/desktop/gnome/interface/toolbar_style", NULL); - if(!g_ascii_strcasecmp (val,"both")){ - e_combo_button_pack_vbox (E_COMBO_BUTTON (priv->new_button)); - e_combo_button_set_icon (E_COMBO_BUTTON (priv->new_button), - priv->default_menu_item->icon); - e_combo_button_set_label (E_COMBO_BUTTON (priv->new_button), _(" New ")); - } - else if(!g_ascii_strcasecmp (val,"both-horiz")){ - e_combo_button_pack_hbox (E_COMBO_BUTTON (priv->new_button)); - e_combo_button_set_label (E_COMBO_BUTTON (priv->new_button), _("New")); - e_combo_button_set_icon (E_COMBO_BUTTON (priv->new_button), - priv->default_menu_item->icon); - } - else if(!g_ascii_strcasecmp (val,"icons")){ - e_combo_button_pack_hbox (E_COMBO_BUTTON (priv->new_button)); - e_combo_button_set_icon (E_COMBO_BUTTON (priv->new_button), - priv->default_menu_item->icon); - e_combo_button_set_label (E_COMBO_BUTTON (priv->new_button),_("")); - } - else if(!g_ascii_strcasecmp(val,"text")){ - e_combo_button_pack_hbox (E_COMBO_BUTTON (priv->new_button)); - e_combo_button_set_label (E_COMBO_BUTTON (priv->new_button), _("New")); - e_combo_button_set_icon (E_COMBO_BUTTON (priv->new_button), - NULL); - } + set_combo_button_style (E_COMBO_BUTTON (priv->new_button), + val, priv->default_menu_item->icon); + gtk_widget_show (priv->new_button); } @@ -741,30 +745,8 @@ setup_toolbar_button (EUserCreatableItemsHandler *handler) gtk_widget_set_sensitive (priv->new_button, TRUE); - if(!g_ascii_strcasecmp (val,"both")){ - e_combo_button_pack_vbox (E_COMBO_BUTTON (priv->new_button)); - e_combo_button_set_icon (E_COMBO_BUTTON (priv->new_button), - priv->default_menu_item->icon); - e_combo_button_set_label (E_COMBO_BUTTON (priv->new_button), _(" New ")); - } - else if(!g_ascii_strcasecmp (val,"both-horiz")){ - e_combo_button_pack_hbox (E_COMBO_BUTTON (priv->new_button)); - e_combo_button_set_label (E_COMBO_BUTTON (priv->new_button), _("New")); - e_combo_button_set_icon (E_COMBO_BUTTON (priv->new_button), - priv->default_menu_item->icon); - } - else if(!g_ascii_strcasecmp (val,"icons")){ - e_combo_button_pack_hbox (E_COMBO_BUTTON (priv->new_button)); - e_combo_button_set_icon (E_COMBO_BUTTON (priv->new_button), - priv->default_menu_item->icon); - e_combo_button_set_label (E_COMBO_BUTTON (priv->new_button), NULL); - } - else if(!g_ascii_strcasecmp(val,"text")){ - e_combo_button_pack_hbox (E_COMBO_BUTTON (priv->new_button)); - e_combo_button_set_label (E_COMBO_BUTTON (priv->new_button), _("New")); - e_combo_button_set_icon (E_COMBO_BUTTON (priv->new_button), - NULL); - } + set_combo_button_style (E_COMBO_BUTTON (priv->new_button), + val, priv->default_menu_item->icon); gconf_client_notify_add(gconf,"/desktop/gnome/interface/toolbar_style", (GConfClientNotifyFunc)new_button_change, handler, NULL, NULL); diff --git a/widgets/ChangeLog b/widgets/ChangeLog index 36cbd14354..2c7061c408 100644 --- a/widgets/ChangeLog +++ b/widgets/ChangeLog @@ -1,3 +1,9 @@ +2006-07-12 Hiroyuki Ikezoe <poincare@ikezoe.net> + + ** Fixes bug #347182. + * misc/e-combo-button.c: (e_combo_button_set_label): + Removed needless g_return_if_fail(). + 2006-07-10 Harish Krishnaswamy <kharish@novell.com> * table/e-cell-text.c: (ect_unrealize), (build_layout): diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index 1986c594fc..6a8bebb8ee 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -567,7 +567,6 @@ e_combo_button_set_label (EComboButton *combo_button, g_return_if_fail (combo_button != NULL); g_return_if_fail (E_IS_COMBO_BUTTON (combo_button)); - g_return_if_fail (label != NULL); priv = combo_button->priv; |