aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorHiroyuki Ikezoe <hiikezoe@src.gnome.org>2006-07-12 14:49:14 +0800
committerHiroyuki Ikezoe <hiikezoe@src.gnome.org>2006-07-12 14:49:14 +0800
commit2fb0e7f837cdd452bb61b5d6ccacd45a0767f6f7 (patch)
treeee1882ec0126d05a7d34de6903d5c72b442f3d3e /shell
parent65d77ad3ef1556702102ef9a830241ef4bc73c1d (diff)
downloadgsoc2013-evolution-2fb0e7f837cdd452bb61b5d6ccacd45a0767f6f7.tar
gsoc2013-evolution-2fb0e7f837cdd452bb61b5d6ccacd45a0767f6f7.tar.gz
gsoc2013-evolution-2fb0e7f837cdd452bb61b5d6ccacd45a0767f6f7.tar.bz2
gsoc2013-evolution-2fb0e7f837cdd452bb61b5d6ccacd45a0767f6f7.tar.lz
gsoc2013-evolution-2fb0e7f837cdd452bb61b5d6ccacd45a0767f6f7.tar.xz
gsoc2013-evolution-2fb0e7f837cdd452bb61b5d6ccacd45a0767f6f7.tar.zst
gsoc2013-evolution-2fb0e7f837cdd452bb61b5d6ccacd45a0767f6f7.zip
** 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. * misc/e-combo-button.c: (e_combo_button_set_label): Removed needless g_return_if_fail(). svn path=/trunk/; revision=32294
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog8
-rw-r--r--shell/e-user-creatable-items-handler.c78
2 files changed, 38 insertions, 48 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);