patch for NB#73896
[modest] / src / gnome / modest-main-window.c
index 1214d95..09a7541 100644 (file)
@@ -230,23 +230,23 @@ modest_main_window_finalize (GObject *obj)
 
 GtkWidget*
 modest_main_window_get_child_widget (ModestMainWindow *self,
-                                    ModestWidgetType widget_type)
+                                    ModestMainWindowWidgetType widget_type)
 {
        ModestMainWindowPrivate *priv;
        GtkWidget *widget;
        
        g_return_val_if_fail (self, NULL);
-       g_return_val_if_fail (widget_type >= 0 && widget_type < MODEST_WIDGET_TYPE_NUM,
+       g_return_val_if_fail (widget_type >= 0 && widget_type < MODEST_MAIN_WINDOW_WIDGET_TYPE_NUM,
                              NULL);
                                
        priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
 
        switch (widget_type) {
-       case MODEST_WIDGET_TYPE_HEADER_VIEW:
+       case MODEST_MAIN_WINDOW_WIDGET_TYPE_HEADER_VIEW:
                widget = (GtkWidget*)priv->header_view; break;
-       case MODEST_WIDGET_TYPE_FOLDER_VIEW:
+       case MODEST_MAIN_WINDOW_WIDGET_TYPE_FOLDER_VIEW:
                widget = (GtkWidget*)priv->folder_view; break;
-       case MODEST_WIDGET_TYPE_MSG_PREVIEW:
+       case MODEST_MAIN_WINDOW_WIDGET_TYPE_MSG_PREVIEW:
                widget = (GtkWidget*)priv->msg_preview; break;
        default:
                g_return_val_if_reached (NULL);
@@ -308,8 +308,10 @@ save_sizes (ModestMainWindow *self)
 
 
 static void
-on_connection_changed (TnyDevice *device, gboolean online, ModestMainWindow *self)
+on_account_store_connecting_finished (TnyAccountStore *store, ModestMainWindow *self)
 {
+       const gboolean online = TRUE;
+
        GtkWidget *icon;
        const gchar *icon_name;
        ModestMainWindowPrivate *priv;
@@ -332,7 +334,7 @@ on_connection_changed (TnyDevice *device, gboolean online, ModestMainWindow *sel
        
        /* If Modest has became online and the header view has a
           header selected then show it */
-       /* FIXME: there is a race condition if some account needs to
+       /* TODO: FIXME: there is a race condition if some account needs to
           ask the user for a password */
 
 /*     if (online) { */
@@ -417,12 +419,14 @@ connect_signals (ModestMainWindow *self)
                          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(modest_runtime_get_device()), "connection_changed",
-                         G_CALLBACK(on_connection_changed), self);
+       g_signal_connect (G_OBJECT(modest_runtime_get_account_store()), "connecting-finished",
+                         G_CALLBACK(on_account_store_connecting_finished), self);
        g_signal_connect (G_OBJECT(priv->online_toggle), "toggled",
                          G_CALLBACK(on_online_toggle_toggled), self);
 
@@ -688,14 +692,6 @@ on_header_status_update (ModestHeaderView *header_view,
        modest_gnome_info_bar_set_message (MODEST_GNOME_INFO_BAR (priv->main_bar), msg);
 }
 
-gboolean 
-modest_main_window_close_all (ModestMainWindow *self)
-{
-       /* TODO: show a dialog to ask the user for permission to close
-          all */
-       return TRUE;
-}
-
 void 
 modest_main_window_set_style (ModestMainWindow *self, 
                              ModestMainWindowStyle style)
@@ -718,8 +714,17 @@ modest_main_window_set_contents_style (ModestMainWindow *self,
        /* TODO */
 }
 
+ModestMainWindowContentsStyle
+modest_main_window_get_contents_style (ModestMainWindow *self)
+{
+       /* TODO */
+       return MODEST_MAIN_WINDOW_CONTENTS_STYLE_HEADERS;
+}
+
+
 static void
 get_msg_callback (TnyFolder *folder, 
+                 gboolean cancelled,
                  TnyMsg *msg, 
                  GError **err, 
                  gpointer user_data)