Query activesync for addressbooks too (if available).
[modest] / src / gnome / modest-main-window.c
index 1174933..16510e7 100644 (file)
@@ -45,7 +45,7 @@
 #include "modest-main-window-ui.h"
 #include "modest-main-window-ui-dimming.h"
 #include "modest-account-mgr.h"
-#include "modest-conf.h"
+#include "modest-defs.h"
 #include <modest-tny-msg.h>
 #include "modest-mail-operation.h"
 #include "modest-icon-names.h"
@@ -124,6 +124,32 @@ struct _ModestMainWindowPrivate {
 /* globals */
 static GtkWindowClass *parent_class = NULL;
 
+static const GtkActionEntry modest_folder_view_action_entries [] = {
+
+       /* Folder View CSM actions */
+       { "FolderViewCSMNewFolder", NULL, N_("mcen_ti_new_folder"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_new_folder) },
+       { "FolderViewCSMRenameFolder", NULL, N_("mcen_me_user_renamefolder"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_rename_folder) },
+       { "FolderViewCSMPasteMsgs", NULL, N_("mcen_me_inbox_paste"), NULL, NULL,  G_CALLBACK (modest_ui_actions_on_paste)},
+       { "FolderViewCSMDeleteFolder", NULL, N_("mcen_me_inbox_delete"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_delete_folder) },
+       { "FolderViewCSMSearchMessages", NULL, N_("mcen_me_inbox_search"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_search_messages) },
+       { "FolderViewCSMHelp", NULL, N_("mcen_me_inbox_help"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_csm_help) },
+};
+
+static const GtkActionEntry modest_header_view_action_entries [] = {
+
+       /* Header View CSM actions */
+       { "HeaderViewCSMOpen",          NULL,  N_("mcen_me_inbox_open"),        NULL,       NULL, G_CALLBACK (modest_ui_actions_on_open) },
+       { "HeaderViewCSMReply",         NULL,  N_("mcen_me_inbox_reply"),       NULL,      NULL, G_CALLBACK (modest_ui_actions_on_reply) },
+       { "HeaderViewCSMReplyAll",      NULL,  N_("mcen_me_inbox_replytoall"),  NULL,      NULL, G_CALLBACK (modest_ui_actions_on_reply_all) },
+       { "HeaderViewCSMForward",       NULL,  N_("mcen_me_inbox_forward"),     NULL,      NULL, G_CALLBACK (modest_ui_actions_on_forward) },
+       { "HeaderViewCSMCut",           NULL,  N_("mcen_me_inbox_cut"),         "<CTRL>X", NULL, G_CALLBACK (modest_ui_actions_on_cut) },
+       { "HeaderViewCSMCopy",          NULL,  N_("mcen_me_inbox_copy"),        "<CTRL>C", NULL, G_CALLBACK (modest_ui_actions_on_copy) },
+       { "HeaderViewCSMPaste",         NULL,  N_("mcen_me_inbox_paste"),       "<CTRL>V", NULL, G_CALLBACK (modest_ui_actions_on_paste) },
+       { "HeaderViewCSMDelete",        NULL,  N_("mcen_me_inbox_delete"),      NULL,      NULL, G_CALLBACK (modest_ui_actions_on_delete_message) },
+       { "HeaderViewCSMCancelSending", NULL,  N_("mcen_me_outbox_cancelsend"), NULL,      NULL, G_CALLBACK (modest_ui_actions_cancel_send) },
+       { "HeaderViewCSMHelp",          NULL,  N_("mcen_me_inbox_help"),        NULL,      NULL, G_CALLBACK (modest_ui_actions_on_help) },
+};
+
 static const GtkToggleActionEntry modest_main_window_toggle_action_entries [] = {
        { "ToggleFolders",     MODEST_STOCK_SPLIT_VIEW, N_("mcen_me_inbox_hidefolders"), "<CTRL>t", NULL, G_CALLBACK (modest_ui_actions_toggle_folders_view), TRUE },
 };
@@ -181,11 +207,6 @@ create_main_bar (GtkWidget *progress_bar)
         status_bar = gtk_statusbar_new ();
         gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (status_bar), FALSE);
 
-        /* Progress bar */
-        gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), 1.0);
-        gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR (progress_bar),
-                                        PANGO_ELLIPSIZE_END);
-
         /* Pack */
         gtk_box_pack_start (GTK_BOX (main_bar), status_bar, TRUE, TRUE, 0);
         gtk_box_pack_start (GTK_BOX (main_bar), progress_bar, FALSE, FALSE, 0);
@@ -394,12 +415,6 @@ connect_signals (ModestMainWindow *self)
        g_signal_connect (G_OBJECT(priv->msg_preview), "recpt-activated",
                          G_CALLBACK(modest_ui_actions_on_msg_recpt_activated), self);
 
-       /* Account store */
-       /* Emmitted by our TnyAccountStore::get_password_func() implementation,
-        * This is not a normal part of tinymail: */
-       g_signal_connect (G_OBJECT (modest_runtime_get_account_store()), "password_requested",
-                         G_CALLBACK (modest_ui_actions_on_password_requested), self);
-       
        /* Device */
        g_signal_connect (G_OBJECT(priv->online_toggle), "toggled",
                          G_CALLBACK(on_online_toggle_toggled), self);
@@ -489,6 +504,17 @@ modest_main_window_new (void)
                                      modest_action_entries,
                                      G_N_ELEMENTS (modest_action_entries),
                                      obj);
+
+       gtk_action_group_add_actions (action_group,
+                                     modest_header_view_action_entries,
+                                     G_N_ELEMENTS (modest_header_view_action_entries),
+                                     self);
+
+       gtk_action_group_add_actions (action_group,
+                                     modest_folder_view_action_entries,
+                                     G_N_ELEMENTS (modest_folder_view_action_entries),
+                                     self);
+
        gtk_action_group_add_toggle_actions (action_group,
                                             modest_toggle_action_entries,
                                             G_N_ELEMENTS (modest_toggle_action_entries),
@@ -824,18 +850,18 @@ on_header_selected (ModestHeaderView *header_view,
 void      
 modest_main_window_notify_send_receive_initied    (ModestMainWindow *self)
 {
-       g_message("NOT IMPLEMENTED %s", __FUNCTION__);
+       g_warning("NOT IMPLEMENTED %s", __FUNCTION__);
 }
 void      
 modest_main_window_notify_send_receive_completed    (ModestMainWindow *self)
 {
-       g_message("NOT IMPLEMENTED %s", __FUNCTION__);
+       g_warning("NOT IMPLEMENTED %s", __FUNCTION__);
 }
 
 gboolean
 modest_main_window_transfer_mode_enabled (ModestMainWindow *self)
 {
-       g_message("NOT IMPLEMENTED %s", __FUNCTION__);
+       g_warning("NOT IMPLEMENTED %s", __FUNCTION__);
        return FALSE;
 }
 
@@ -845,14 +871,14 @@ modest_main_window_on_msg_view_window_msg_changed (ModestMsgViewWindow *view_win
                                                   GtkTreeRowReference *row_reference,
                                                   ModestMainWindow *self)
 {
-       g_message("NOT IMPLEMENTED %s", __FUNCTION__);
+       g_warning("NOT IMPLEMENTED %s", __FUNCTION__);
        return FALSE;
 }
 
 gboolean  
 modest_main_window_screen_is_on (ModestMainWindow *self)
 {
-       g_message("NOT IMPLEMENTED %s", __FUNCTION__);
+       g_warning("NOT IMPLEMENTED %s", __FUNCTION__);
        return TRUE;
 }
 
@@ -870,6 +896,8 @@ save_state (ModestWindow *window)
                                   MODEST_CONF_MAIN_WINDOW_KEY);
        modest_widget_memory_save (conf, G_OBJECT(priv->main_paned), 
                                   MODEST_CONF_MAIN_PANED_KEY);
+       modest_widget_memory_save (conf, G_OBJECT(priv->msg_paned), 
+                                  MODEST_CONF_MSG_PANED_KEY);
        modest_widget_memory_save (conf, G_OBJECT(priv->folder_view), 
                                   MODEST_CONF_FOLDER_VIEW_KEY);
 }