* Fixes NB#59717 that was reopened
authorSergio Villar Senin <svillar@igalia.com>
Fri, 15 Jun 2007 13:00:46 +0000 (13:00 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Fri, 15 Jun 2007 13:00:46 +0000 (13:00 +0000)
* Added modest_main_window_get_contents_style
* Fixed a problem with the empty view when moving messages to an empty folder

pmo-trunk-r2259

src/gnome/modest-main-window.c
src/maemo/modest-main-window.c
src/modest-ui-actions.c
src/widgets/modest-main-window.h

index 8756204..5d07395 100644 (file)
@@ -722,6 +722,14 @@ 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,
index f70dab8..174caca 100644 (file)
@@ -1538,6 +1538,18 @@ modest_main_window_set_contents_style (ModestMainWindow *self,
        gtk_widget_show_all (priv->contents_widget);
 }
 
+ModestMainWindowContentsStyle
+modest_main_window_get_contents_style (ModestMainWindow *self)
+{
+       ModestMainWindowPrivate *priv;
+
+       g_return_val_if_fail (MODEST_IS_MAIN_WINDOW (self), -1);
+
+       priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
+       return priv->contents_style;
+}
+
+
 static void 
 on_configuration_key_changed (ModestConf* conf, 
                              const gchar *key, 
index b640bde..0af6fe9 100644 (file)
@@ -1272,6 +1272,15 @@ folder_refreshed_cb (const GObject *obj,
                                                       MODEST_MAIN_WINDOW_CONTENTS_STYLE_EMPTY);
        } else {
                printf ("DEBUG: %s: tny_folder_get_all_count() returned >0.\n", __FUNCTION__);
+
+               /* Set the header view, we could change it to
+                  the empty view after the refresh. We do not
+                  need to save the configuration because we
+                  have already done that when unselecting the
+                  folder */
+               modest_main_window_set_contents_style (win, 
+                                                      MODEST_MAIN_WINDOW_CONTENTS_STYLE_HEADERS);
+
                /* Restore configuration. There is no need to set the
                   contents style to headers because it was already
                   being done in folder_selection_changed */
@@ -1314,15 +1323,6 @@ modest_ui_actions_on_folder_selection_changed (ModestFolderView *folder_view,
                                g_object_unref (account);
                        }
 
-                       /* Set the header view, we could change it to
-                          the empty view after the refresh */
-                       modest_main_window_set_contents_style (main_window, 
-                                                              MODEST_MAIN_WINDOW_CONTENTS_STYLE_HEADERS);
-                       
-                       modest_widget_memory_save (modest_runtime_get_conf(),
-                                                  G_OBJECT(header_view),
-                                                  MODEST_CONF_HEADER_VIEW_KEY);
-
                        /* Set folder on header view. This function
                           will call tny_folder_refresh_async so we
                           pass a callback that will be called when
index 64e15a3..3f4d162 100644 (file)
@@ -175,6 +175,18 @@ void       modest_main_window_set_contents_style       (ModestMainWindow *self,
                                                        ModestMainWindowContentsStyle style);
 
 /**
+ * modest_main_window_get_contents_style:
+ * @self: the #ModestMainWindow
+ * 
+ * Gets the currently selected #ModestMainWindowContentsStyle
+ * 
+ * Returns: the #ModestMainWindowContentsStyle of the main window
+ **/
+ModestMainWindowContentsStyle modest_main_window_get_contents_style (ModestMainWindow *self);
+
+
+
+/**
  * modest_main_window_notify_send_receive_initied:
  * @self: the #ModestMainWindow
  *