From: Sergio Villar SenĂ­n Date: Mon, 25 Jan 2010 13:07:54 +0000 (+0100) Subject: Fixes NB#153926, "insert image" button moved from app menu to toolbar X-Git-Tag: 3.2.11-1~14 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=1302fa30913d305f060c63991dc24aa381e17124 Fixes NB#153926, "insert image" button moved from app menu to toolbar --- diff --git a/src/hildon2/modest-icon-names.h b/src/hildon2/modest-icon-names.h index e30fc0a..86b67fc 100644 --- a/src/hildon2/modest-icon-names.h +++ b/src/hildon2/modest-icon-names.h @@ -97,6 +97,7 @@ #define MODEST_TOOLBAR_ICON_PREV "general_back" #define MODEST_TOOLBAR_ICON_FIND "general_search" #define MODEST_TOOLBAR_ICON_DOWNLOAD_IMAGES "email_download_external_images" +#define MODEST_TOOLBAR_ICON_INSERT_IMAGES "general_toolbar_images" /* Stock icon names */ #define MODEST_STOCK_MAIL_SEND "modest-stock-mail-send" diff --git a/src/hildon2/modest-msg-edit-window-ui-dimming.h b/src/hildon2/modest-msg-edit-window-ui-dimming.h index acf94d2..eb1fd22 100644 --- a/src/hildon2/modest-msg-edit-window-ui-dimming.h +++ b/src/hildon2/modest-msg-edit-window-ui-dimming.h @@ -31,6 +31,7 @@ static const ModestDimmingEntry modest_msg_edit_window_toolbar_dimming_entries [ { "/ToolBar/ToolbarSend", G_CALLBACK(modest_ui_dimming_rules_on_send) }, { "/ToolBar/ActionsBold", G_CALLBACK(modest_ui_dimming_rules_on_set_style) }, { "/ToolBar/ActionsItalics", G_CALLBACK(modest_ui_dimming_rules_on_set_style) }, + { "/ToolBar/ActionsInsertImage", G_CALLBACK(modest_ui_dimming_rules_on_insert_image) }, }; G_END_DECLS diff --git a/src/hildon2/modest-msg-edit-window.c b/src/hildon2/modest-msg-edit-window.c index 3131eb5..9f9a6ec 100644 --- a/src/hildon2/modest-msg-edit-window.c +++ b/src/hildon2/modest-msg-edit-window.c @@ -1612,6 +1612,9 @@ modest_msg_edit_window_setup_toolbar (ModestMsgEditWindow *window) tool_item = gtk_ui_manager_get_widget (parent_priv->ui_manager, "/ToolBar/ActionsItalics"); gtk_tool_item_set_expand (GTK_TOOL_ITEM (tool_item), TRUE); gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (tool_item), TRUE); + tool_item = gtk_ui_manager_get_widget (parent_priv->ui_manager, "/ToolBar/ActionsInsertImage"); + gtk_tool_item_set_expand (GTK_TOOL_ITEM (tool_item), TRUE); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (tool_item), TRUE); /* Explicitelly show all the toolbar (a normal gtk_widget_show will not show the tool items added to the placeholders) */ @@ -1619,7 +1622,7 @@ modest_msg_edit_window_setup_toolbar (ModestMsgEditWindow *window) /* Set the no show all *after* showing all items. We do not want the toolbar to be shown with a show all because it - could go agains the gconf setting regarding showing or not + could go against the gconf setting regarding showing or not the toolbar of the editor window */ gtk_widget_set_no_show_all (parent_priv->toolbar, TRUE); } @@ -4447,9 +4450,6 @@ setup_menu (ModestMsgEditWindow *self) gtk_button_set_alignment (GTK_BUTTON (priv->bcc_button), 0.5, 0.5); gtk_button_set_alignment (GTK_BUTTON (priv->bcc_button), 0.5, 0.5); - modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_editor_attach_inlineimage"), NULL, - APP_MENU_CALLBACK (modest_ui_actions_on_insert_image), - MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_set_style)); modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_editor_add_attachment"), NULL, APP_MENU_CALLBACK (modest_msg_edit_window_add_attachment_clicked), NULL); diff --git a/src/hildon2/ui/modest-msg-edit-window-ui.xml b/src/hildon2/ui/modest-msg-edit-window-ui.xml index e563c99..51b590e 100644 --- a/src/hildon2/ui/modest-msg-edit-window-ui.xml +++ b/src/hildon2/ui/modest-msg-edit-window-ui.xml @@ -82,6 +82,7 @@ + diff --git a/src/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index 7ea5d72..a640b99 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -3141,10 +3141,7 @@ modest_ui_dimming_rules_on_insert_image (ModestWindow *win, { g_return_val_if_fail (MODEST_MSG_EDIT_WINDOW (win), FALSE); - ModestMsgEditFormat format = - modest_msg_edit_window_get_format (MODEST_MSG_EDIT_WINDOW (win)); - - return (format != MODEST_MSG_EDIT_FORMAT_HTML); + return modest_ui_dimming_rules_on_set_style (win, user_data); } static gboolean diff --git a/src/widgets/modest-msg-edit-window-ui.h b/src/widgets/modest-msg-edit-window-ui.h index 006d3f9..87b4b8c 100644 --- a/src/widgets/modest-msg-edit-window-ui.h +++ b/src/widgets/modest-msg-edit-window-ui.h @@ -105,11 +105,13 @@ static const GtkActionEntry modest_msg_edit_action_entries [] = { { "CloseWindowShortcut", NULL, NULL, "Escape", NULL, NULL }, /* TOOLBAR ACTIONS */ + { "ActionsInsertImage", MODEST_TOOLBAR_ICON_INSERT_IMAGES, NULL, NULL, NULL, G_CALLBACK (modest_ui_actions_on_insert_image) }, #ifndef MODEST_TOOLKIT_HILDON2 { "ToolbarSend", MODEST_TOOLBAR_ICON_MAIL_SEND, N_("mcen_me_editor_send"), "Return", NULL, G_CALLBACK (modest_ui_actions_on_send) }, #endif #ifdef MODEST_TOOLKIT_GTK { "ToolbarAttach", "stock_attach", N_("mcen_me_editor_attachfile"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_attach_file) }, + #endif };