From b915850d41f5f4912cff1f36c5d96e4e00093d93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sergio=20Villar=20Sen=C3=ADn?= Date: Mon, 25 Jan 2010 14:07:54 +0100 Subject: [PATCH 1/1] Fixes NB#153926, "insert image" button moved from app menu to toolbar --- src/gtk/modest-icon-names.h | 1 + src/hildon2/modest-icon-names.h | 1 + src/modest-ui-dimming-rules.c | 5 +---- src/widgets/modest-msg-edit-window-ui-dimming.h | 1 + src/widgets/modest-msg-edit-window-ui.h | 2 ++ src/widgets/modest-msg-edit-window.c | 5 ++++- src/widgets/ui/modest-msg-edit-window-ui.xml | 1 + 7 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gtk/modest-icon-names.h b/src/gtk/modest-icon-names.h index 1851b38..5b95486 100644 --- a/src/gtk/modest-icon-names.h +++ b/src/gtk/modest-icon-names.h @@ -100,6 +100,7 @@ #define MODEST_TOOLBAR_ICON_ITALIC GTK_STOCK_ITALIC #define MODEST_TOOLBAR_ICON_FIND GTK_STOCK_FIND #define MODEST_TOOLBAR_ICON_DOWNLOAD_IMAGES GTK_STOCK_MISSING_IMAGE +#define MODEST_TOOLBAR_ICON_INSERT_IMAGES GTK_STOCK_ORIENTATION_PORTRAIT /* Stock icon names */ #define MODEST_STOCK_MAIL_SEND "modest-stock-mail-send" diff --git a/src/hildon2/modest-icon-names.h b/src/hildon2/modest-icon-names.h index c9b7bd6..10a70f6 100644 --- a/src/hildon2/modest-icon-names.h +++ b/src/hildon2/modest-icon-names.h @@ -96,6 +96,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/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index 8a84e85..0bbde7f 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -1703,10 +1703,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-dimming.h b/src/widgets/modest-msg-edit-window-ui-dimming.h index acf94d2..eb1fd22 100644 --- a/src/widgets/modest-msg-edit-window-ui-dimming.h +++ b/src/widgets/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/widgets/modest-msg-edit-window-ui.h b/src/widgets/modest-msg-edit-window-ui.h index 4da4746..269b3f6 100644 --- a/src/widgets/modest-msg-edit-window-ui.h +++ b/src/widgets/modest-msg-edit-window-ui.h @@ -103,11 +103,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 }; diff --git a/src/widgets/modest-msg-edit-window.c b/src/widgets/modest-msg-edit-window.c index 910379e..e042b8d 100644 --- a/src/widgets/modest-msg-edit-window.c +++ b/src/widgets/modest-msg-edit-window.c @@ -1765,6 +1765,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) */ @@ -1772,7 +1775,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); } diff --git a/src/widgets/ui/modest-msg-edit-window-ui.xml b/src/widgets/ui/modest-msg-edit-window-ui.xml index e563c99..51b590e 100644 --- a/src/widgets/ui/modest-msg-edit-window-ui.xml +++ b/src/widgets/ui/modest-msg-edit-window-ui.xml @@ -82,6 +82,7 @@ + -- 1.7.9.5