* Added toggle actions for show toolbars
authorSergio Villar Senin <svillar@igalia.com>
Thu, 12 Apr 2007 17:55:36 +0000 (17:55 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Thu, 12 Apr 2007 17:55:36 +0000 (17:55 +0000)
* Replaced some action names

pmo-trunk-r1554

src/maemo/modest-main-window-ui.h
src/maemo/modest-main-window.c
src/maemo/modest-msg-edit-window.c
src/maemo/modest-msg-view-window.c
src/maemo/ui/modest-main-window-ui.xml
src/maemo/ui/modest-msg-edit-window-ui.xml
src/maemo/ui/modest-msg-view-window-ui.xml
src/modest-ui-actions.c
src/modest-ui-actions.h
src/widgets/modest-msg-edit-window-ui.h

index 4d2af3f..e543c7b 100644 (file)
@@ -85,8 +85,6 @@ static const GtkActionEntry modest_action_entries [] = {
        /* View */
        { "ViewSort",            NULL,        N_("mcen_me_inbox_sort"),     NULL,      NULL,  NULL },
        { "ViewShowToolbar", NULL, N_("mcen_me_inbox_toolbar") }, /* submenu */
-       { "ViewShowToolbarNormalScreen",         NULL,        N_("mcen_me_inbox_normalview"),     NULL,     NULL,  NULL },
-       { "ViewShowToolbarFullScreen",      NULL,        N_("mcen_me_inbox_optimizedview"),  NULL,     NULL,  NULL },
        { "ViewPreviousMessage", NULL,    N_("qgn_toolb_gene_back"),         NULL, NULL, G_CALLBACK (modest_ui_actions_on_prev) },
        { "ViewNextMessage", NULL, N_("qgn_toolb_gene_forward"),      NULL, NULL, G_CALLBACK (modest_ui_actions_on_next) },
        
@@ -116,7 +114,7 @@ static const GtkActionEntry modest_action_entries [] = {
        { "ToolbarMessageReplyAll",   MODEST_STOCK_REPLY_ALL,     N_("qgn_toolb_messagin_replyall"),         NULL, NULL,  G_CALLBACK (modest_ui_actions_on_reply_all) },
        { "ToolbarMessageForward",    MODEST_STOCK_FORWARD,     N_("qgn_toolb_messagin_forward"),      NULL, NULL,  G_CALLBACK (modest_ui_actions_on_forward) },
        { "ToolbarSendReceive",       MODEST_STOCK_REFRESH,   N_("qgn_toolb_gene_refresh"),      NULL, NULL,  G_CALLBACK (modest_ui_actions_on_send_receive) },
-       { "ToolbarToggleView",        MODEST_STOCK_SPLIT_VIEW,      N_("gqn_toolb_rss_fldonoff"),                "<CTRL>t", NULL,  G_CALLBACK (modest_ui_actions_toggle_main_view) },
+       { "ToolbarToggleView",        MODEST_STOCK_SPLIT_VIEW,      N_("gqn_toolb_rss_fldonoff"),                "<CTRL>t", NULL,  G_CALLBACK (modest_ui_actions_toggle_folders_view) },
        { "ToolbarDeleteMessage",     MODEST_STOCK_DELETE,     N_("qgn_toolb_gene_deletebutton"),             NULL, NULL,  G_CALLBACK (modest_ui_actions_on_delete) },
        { "ToolbarSort",     MODEST_STOCK_SORT,     N_("qgn_list_sort"),             NULL, NULL, NULL },
        { "ToolbarFindInMessage",     GTK_STOCK_FIND,       N_("qgn_toolb_gene_find"),         NULL, NULL, NULL },
@@ -126,7 +124,10 @@ static const GtkActionEntry modest_action_entries [] = {
 };
 
 static const GtkToggleActionEntry modest_toggle_action_entries [] = {
-       { "ShowToggleFullscreen",     GTK_STOCK_FULLSCREEN, N_("Full screen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen), FALSE },
+       { "ViewToggleFolders",     NULL, N_("mcen_me_inbox_hidefolders"), NULL, NULL, G_CALLBACK (modest_ui_actions_toggle_folders_view), TRUE },
+       { "ViewToggleFullscreen",     GTK_STOCK_FULLSCREEN, N_("mcen_me_inbox_fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen), FALSE },
+       { "ViewShowToolbarNormalScreen", NULL, N_("mcen_me_inbox_normalview"), NULL, NULL, NULL, TRUE },
+       { "ViewShowToolbarFullScreen", NULL, N_("mcen_me_inbox_optimizedview"), NULL, NULL, NULL, TRUE },
 };
 
 G_END_DECLS
index d7f9263..b8ba75e 100644 (file)
@@ -576,7 +576,7 @@ modest_main_window_window_state_event (GtkWidget *widget, GdkEventWindowState *e
 
                parent_priv = MODEST_WINDOW_GET_PRIVATE (widget);
                
-               fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ShowToggleFullscreenMenu");
+               fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ViewToggleFullscreenMenu");
                active = (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (fs_toggle_action)))?1:0;
                if (is_fullscreen != active) {
                        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (fs_toggle_action), is_fullscreen);
index 2edb100..3da318a 100644 (file)
@@ -1176,7 +1176,7 @@ modest_msg_edit_window_window_state_event (GtkWidget *widget, GdkEventWindowStat
 
                parent_priv = MODEST_WINDOW_GET_PRIVATE (widget);
                
-               fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ShowToggleFullscreenMenu");
+               fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ViewToggleFullscreenMenu");
                active = (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (fs_toggle_action)))?1:0;
                if (is_fullscreen != active)
                        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (fs_toggle_action), is_fullscreen);
@@ -1195,7 +1195,7 @@ modest_msg_edit_window_toggle_fullscreen (ModestMsgEditWindow *window)
 
        parent_priv = MODEST_WINDOW_GET_PRIVATE (window);
 
-       fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ShowToggleFullscreenMenu");
+       fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ViewToggleFullscreenMenu");
        active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (fs_toggle_action));
        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (fs_toggle_action), !active);
 }
index db51502..e636708 100644 (file)
@@ -952,7 +952,7 @@ modest_msg_view_window_window_state_event (GtkWidget *widget, GdkEventWindowStat
 
                parent_priv = MODEST_WINDOW_GET_PRIVATE (widget);
                
-               fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ShowToggleFullscreenMenu");
+               fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ViewToggleFullscreenMenu");
                active = (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (fs_toggle_action)))?1:0;
                if (is_fullscreen != active) {
                        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (fs_toggle_action), is_fullscreen);
@@ -970,7 +970,7 @@ modest_msg_view_window_toggle_fullscreen (ModestMsgViewWindow *window)
                GtkAction *fs_toggle_action;
                parent_priv = MODEST_WINDOW_GET_PRIVATE (window);
                
-               fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ShowToggleFullscreenMenu");
+               fs_toggle_action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/ViewMenu/ViewToggleFullscreenMenu");
                gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (fs_toggle_action),
                                              !gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (fs_toggle_action)));
 }
index 0840a08..2b739c9 100644 (file)
@@ -68,8 +68,8 @@
     <menu name="ViewMenu" action="View">
       <menuitem name="ViewSortMenu" action="ViewSort"/>
       <separator/>
-      <menuitem name="ViewFoldersMenu" action="ViewFolders"/>
-      <menuitem name="ShowToggleFullscreenMenu" action="ShowToggleFullscreen"/>
+      <menuitem name="ViewToggleFoldersMenu" action="ViewToggleFolders"/>
+      <menuitem name="ViewToggleFullscreenMenu" action="ViewToggleFullscreen"/>
       <separator/>
       <menu name="ViewShowToolbarMainMenu" action="ViewShowToolbar">
         <menuitem name="ViewShowToolbarNormalScreenMenu" action="ViewShowToolbarNormalScreen"/>
index 255248c..9dcd5c6 100644 (file)
@@ -48,7 +48,7 @@
        <menuitem name="Zoom200Menu" action="Zoom200"/>
       </menu>
       <separator/>
-      <menuitem name="ShowToggleFullscreenMenu" action="ShowToggleFullscreen"/>
+      <menuitem name="ViewToggleFullscreenMenu" action="ViewToggleFullscreen"/>
       <separator/>
       <menuitem name="ViewCcFieldMenu" action="ViewCcField"/>
       <menuitem name="ViewBccFieldMenu" action="ViewBccField"/>
index f360aa2..388c3aa 100644 (file)
@@ -64,7 +64,7 @@
        <menuitem name="Zoom200Menu" action="Zoom200"/>
       </menu>
       <separator/>
-      <menuitem name="ShowToggleFullscreenMenu" action="ShowToggleFullscreen"/>
+      <menuitem name="ViewToggleFullscreenMenu" action="ViewToggleFullscreen"/>
       <separator/>
       <menuitem name="ViewPreviousMessageMenu" action="ViewPreviousMessage"/>
       <menuitem name="ViewNextMessageMenu" action="ViewNextMessage"/>
index e9f1a63..d524a25 100644 (file)
@@ -196,9 +196,6 @@ modest_ui_actions_on_delete (GtkAction *action, ModestWindow *win)
 void
 modest_ui_actions_on_quit (GtkAction *action, ModestWindow *win)
 {
-       /* FIXME: save size of main window */
-/*     save_sizes (main_window); */
-/*     gtk_widget_destroy (GTK_WIDGET (win)); */
        gtk_main_quit ();
 }
 
@@ -822,7 +819,7 @@ void
 modest_ui_actions_on_header_activated (ModestHeaderView *folder_view, TnyHeader *header,
                                       ModestMainWindow *main_window)
 {
-       ModestWindow *win;
+       ModestWindow *win = NULL;
        TnyFolder *folder = NULL;
        TnyMsg    *msg    = NULL;
        ModestWindowMgr *mgr;
@@ -835,7 +832,7 @@ modest_ui_actions_on_header_activated (ModestHeaderView *folder_view, TnyHeader
        folder = tny_header_get_folder (header);
        if (!folder) {
                g_printerr ("modest: cannot get folder for header\n");
-               goto cleanup;
+               return;
        }
 
        /* FIXME: make async?; check error  */
@@ -862,17 +859,14 @@ modest_ui_actions_on_header_activated (ModestHeaderView *folder_view, TnyHeader
 
                gtk_window_set_transient_for (GTK_WINDOW (win),
                                              GTK_WINDOW (main_window));
-
-               g_free (account);
        }
 
        gtk_widget_show_all (GTK_WIDGET(win));
+
+       g_object_unref (G_OBJECT (msg));
        
 cleanup:
-       if (folder)
-               g_object_unref (G_OBJECT (folder));
-       if (msg)
-               g_object_unref (G_OBJECT (msg));
+       g_object_unref (G_OBJECT (folder));
 }
 
 void 
@@ -1635,8 +1629,8 @@ modest_ui_actions_on_toggle_show_bcc (GtkToggleAction *toggle,
 }
 
 void
-modest_ui_actions_toggle_main_view (GtkAction *action, 
-                                   ModestMainWindow *main_window)
+modest_ui_actions_toggle_folders_view (GtkAction *action, 
+                                      ModestMainWindow *main_window)
 {
        ModestConf *conf;
        
@@ -1644,13 +1638,8 @@ modest_ui_actions_toggle_main_view (GtkAction *action,
 
        conf = modest_runtime_get_conf ();
        
-/*     modest_widget_memory_save (conf, G_OBJECT(header_view), "header-view"); */
-       
        if (modest_main_window_get_style (main_window) == MODEST_MAIN_WINDOW_STYLE_SPLIT)
                modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SIMPLE);
        else
                modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SPLIT);
-
-/*     modest_widget_memory_restore (conf, G_OBJECT(header_view), */
-/*                                   "header-view"); */
 }
index 1b98700..9cfe252 100644 (file)
@@ -69,7 +69,7 @@ void     modest_ui_actions_on_message_details (GtkAction *action, ModestWindow *
 
 
 /**
- * modest_ui_actions_toggle_main_view:
+ * modest_ui_actions_toggle_folders_view:
  * @action: the #GtkAction
  * @main_window: the #ModestMainWindow
  * 
@@ -78,11 +78,11 @@ void     modest_ui_actions_on_message_details (GtkAction *action, ModestWindow *
  * accounts. Maybe it's only useful for Maemo code, but as it uses
  * generic code could be used also by the GNOME UI
  **/
-void    modest_ui_actions_toggle_main_view          (GtkAction *action, 
+void    modest_ui_actions_toggle_folders_view       (GtkAction *action, 
                                                      ModestMainWindow *main_window);
 
 /**
- * modest_ui_actions_toggle_header_list_view:
+ * modest_ui_actions_toggle_folders_view:
  * @action: the #GtkAction
  * @main_window: the #ModestMainWindow
  * 
index de9a903..c7b97ec 100644 (file)
@@ -72,7 +72,7 @@ static const GtkToggleActionEntry modest_msg_edit_toggle_action_entries [] = {
        { "ViewBccField",  NULL,    N_("Bcc: filed"), NULL, N_("Shows the Bcc: field"), G_CALLBACK (modest_ui_actions_on_toggle_show_bcc), TRUE },
 
        /* Fullscreen toggle */
-       { "ShowToggleFullscreen", GTK_STOCK_FULLSCREEN, N_("Show fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen), FALSE},
+       { "ViewToggleFullscreen", GTK_STOCK_FULLSCREEN, N_("Show fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen), FALSE},
 
        /* Rich text editor functions */
        { "ActionsBold", GTK_STOCK_BOLD, N_("Bold"), NULL, N_("Use bold"), G_CALLBACK (modest_ui_actions_on_toggle_bold), FALSE },