2007-06-20 Murray Cumming <murrayc@murrayc-desktop>
[modest] / src / maemo / modest-main-window.c
index 8d88a75..8fd643c 100644 (file)
@@ -135,10 +135,6 @@ modest_main_window_cleanup_queue_error_signals (ModestMainWindow *self);
 
 static GtkWidget * create_empty_view (void);
 
-static gchar * 
-translate_func (const gchar *msgid,
-               const gchar *domain_name);
-
 
 /* list my signals */
 enum {
@@ -216,7 +212,7 @@ 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, NULL },
+       { "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_help) },
@@ -290,6 +286,7 @@ modest_main_window_init (ModestMainWindow *obj)
 
        priv = MODEST_MAIN_WINDOW_GET_PRIVATE(obj);
 
+       priv->queue_err_signals = NULL;
        priv->msg_paned    = NULL;
        priv->main_paned   = NULL;      
        priv->main_vbox    = NULL;
@@ -512,6 +509,8 @@ on_account_store_connecting_finished (TnyAccountStore *store, ModestMainWindow *
         * (without the check for >0 accounts, though that is not specified): */
 
        TnyDevice *device = tny_account_store_get_device (store);
+
+       modest_folder_view_update_model (MODEST_FOLDER_VIEW (priv->folder_view), store);
        
        /* Check that we are really online.
         * This signal should not be emitted when we are not connected, 
@@ -559,9 +558,9 @@ on_account_store_connecting_finished (TnyAccountStore *store, ModestMainWindow *
                
                iter = g_slist_next (iter);
        }
-       
-       g_slist_free (account_names);
-       
+
+       modest_account_mgr_free_account_names (account_names);
+       account_names = NULL;
        
        modest_ui_actions_do_send_receive (NULL, MODEST_WINDOW (self));
 }
@@ -749,22 +748,6 @@ modest_main_window_on_show (GtkWidget *self, gpointer user_data)
        }
 }
 
-/* Debugging */
-/* static void  */
-/* on_window_destroy (ModestWindow *window,  */
-/*                ModestWindowMgr *self) */
-/* { */
-/*     ModestMainWindow *mw = NULL;     */
-/*     ModestMainWindowPrivate *priv = NULL; */
-
-/*     mw  = MODEST_MAIN_WINDOW (window); */
-/*     priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self); */
-
-/*     g_print ("\tMW: %d\n", ((GObject*)mw)->ref_count); */
-/*     g_print ("\tHV: %d\n", ((GObject*)priv->header_view)->ref_count); */
-/*     g_print ("\tFV: %d\n", ((GObject*)priv->folder_view)->ref_count); */
-/* } */
-
 ModestWindow *
 modest_main_window_new (void)
 {
@@ -789,7 +772,6 @@ modest_main_window_new (void)
 
        action_group = gtk_action_group_new ("ModestMainWindowActions");
        gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
-       gtk_action_group_set_translate_func (action_group, (GtkTranslateFunc) translate_func, GETTEXT_PACKAGE, g_free);
 
        menu_rules_group = modest_dimming_rules_group_new ("ModestMenuDimmingRules");
        toolbar_rules_group = modest_dimming_rules_group_new ("ModestToolbarDimmingRules");
@@ -918,11 +900,6 @@ modest_main_window_new (void)
 
        restore_settings (MODEST_MAIN_WINDOW(self), FALSE);
 
-/*     { */
-/*             g_signal_connect (self, "destroy",  */
-/*                               G_CALLBACK (on_window_destroy), self); */
-/*     } */
-
        return MODEST_WINDOW(self);
 }
 
@@ -1178,7 +1155,8 @@ on_account_update (TnyAccountStore *account_store,
 
                iter = iter->next;
        }
-       g_slist_free (account_names);
+       modest_account_mgr_free_account_names (account_names);
+       account_names = NULL;
 
        /* Order the list of accounts by its display name */
        accounts = g_slist_sort (accounts, (GCompareFunc) compare_display_names);
@@ -1919,6 +1897,7 @@ refresh_account (const gchar *account_name)
                modest_ui_actions_do_send_receive_all (win);
        else
                modest_ui_actions_do_send_receive (account_name, win);
+       
 }
 
 static void 
@@ -1935,9 +1914,3 @@ on_send_receive_csm_activated (GtkMenuItem *item,
        refresh_account ((const gchar*) user_data);
 }
 
-static gchar * 
-translate_func (const gchar *msgid,
-               const gchar *domain_name)
-{
-       return _(msgid);
-}