+void
+_modest_ui_actions_toggle_view (GtkWidget *widget,
+ ModestMainWindow *main_window)
+{
+ ModestHeaderView *header_view;
+ ModestWidgetFactory *widget_factory;
+ ModestConf *conf;
+ TnyPlatformFactory *plat_factory;
+
+ /* Get ModestConf */
+ plat_factory = modest_tny_platform_factory_get_instance ();
+ conf = modest_tny_platform_factory_get_conf_instance
+ (MODEST_TNY_PLATFORM_FACTORY(plat_factory));
+ widget_factory = modest_main_window_get_widget_factory (main_window);
+ header_view = modest_widget_factory_get_header_view (widget_factory);
+ g_object_unref (G_OBJECT(widget_factory));
+
+ /* what is saved/restored is depending on the style; thus; we save with
+ * old style, then update the style, and restore for this new style*/
+ modest_widget_memory_save (conf, G_OBJECT(header_view), "header-view");
+
+ if (modest_header_view_get_style (header_view) == MODEST_HEADER_VIEW_STYLE_DETAILS)
+ modest_header_view_set_style (header_view, MODEST_HEADER_VIEW_STYLE_TWOLINES);
+ else
+ modest_header_view_set_style (header_view, MODEST_HEADER_VIEW_STYLE_DETAILS);
+
+ modest_widget_memory_restore (conf, G_OBJECT(header_view), "header-view");
+}
+
+