Dim the "Insert Image" menu option when composing a message in plain
authorAlberto Garcia <agarcia@igalia.com>
Tue, 16 Oct 2007 14:00:15 +0000 (14:00 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Tue, 16 Oct 2007 14:00:15 +0000 (14:00 +0000)
text mode
Fixes NB#73392

pmo-trunk-r3513

src/maemo/modest-msg-edit-window-ui-dimming.h
src/modest-ui-dimming-rules.c
src/modest-ui-dimming-rules.h

index 8c8e1ec..11eb612 100644 (file)
@@ -23,6 +23,7 @@ static const ModestDimmingEntry modest_msg_edit_window_menu_dimming_entries [] =
        { "/MenuBar/EditMenu/RedoMenu", G_CALLBACK (modest_ui_dimming_rules_on_redo) }, 
        { "/MenuBar/EditMenu/PasteMenu", G_CALLBACK (modest_ui_dimming_rules_on_editor_paste) },        
        { "/MenuBar/AttachmentsMenu/RemoveAttachmentsMenu", G_CALLBACK (modest_ui_dimming_rules_on_editor_remove_attachment) }, 
+       { "/MenuBar/AttachmentsMenu/InsertImageMenu", G_CALLBACK (modest_ui_dimming_rules_on_insert_image) },
        { "/MenuBar/EmailMenu/SaveToDraftsMenu", G_CALLBACK (modest_ui_dimming_rules_on_save_to_drafts) },
 
 };
index 1771a6d..f990644 100644 (file)
@@ -2623,3 +2623,15 @@ modest_ui_dimming_rules_on_save_to_drafts (ModestWindow *win,
 
        return dimmed;  
 }
+
+gboolean
+modest_ui_dimming_rules_on_insert_image (ModestWindow *win,
+                                        gpointer user_data)
+{
+       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);
+}
index 1f3ab6e..57f5e7d 100644 (file)
@@ -82,6 +82,7 @@ gboolean modest_ui_dimming_rules_on_editor_remove_attachment (ModestWindow *win,
 gboolean modest_ui_dimming_rules_on_editor_paste (ModestWindow *win, gpointer user_data);
 gboolean modest_ui_dimming_rules_on_editor_paste_show_menu (ModestWindow *win, gpointer user_data);
 gboolean modest_ui_dimming_rules_on_save_to_drafts (ModestWindow *win, gpointer user_data);
+gboolean modest_ui_dimming_rules_on_insert_image (ModestWindow *win, gpointer user_data);
 
 G_END_DECLS
 #endif