Fixes NB#153926, "insert image" button moved from app menu to toolbar
authorSergio Villar Senín <svillar@igalia.com>
Mon, 25 Jan 2010 13:07:54 +0000 (14:07 +0100)
committerSergio Villar Senín <svillar@igalia.com>
Mon, 25 Jan 2010 13:18:09 +0000 (14:18 +0100)
src/hildon2/modest-icon-names.h
src/hildon2/modest-msg-edit-window-ui-dimming.h
src/hildon2/modest-msg-edit-window.c
src/hildon2/ui/modest-msg-edit-window-ui.xml
src/modest-ui-dimming-rules.c
src/widgets/modest-msg-edit-window-ui.h

index e30fc0a..86b67fc 100644 (file)
@@ -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"
index acf94d2..eb1fd22 100644 (file)
@@ -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
index 3131eb5..9f9a6ec 100644 (file)
@@ -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);
index e563c99..51b590e 100644 (file)
@@ -82,6 +82,7 @@
     <toolitem action="ActionsBold"/>
     <toolitem action="ActionsItalics"/>
     <placeholder name="FontColor" />
+    <toolitem action="ActionsInsertImage"/>
   </toolbar>
 
   <accelerator name="AccelToggleFullscreen" action="ToggleFullscreen"/>
index 7ea5d72..a640b99 100644 (file)
@@ -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 
index 006d3f9..87b4b8c 100644 (file)
@@ -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"),  "<Control>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
 };