2007-05-07 Murray Cumming <murrayc@murrayc.com>
[modest] / src / gnome / modest-msg-view-window.c
index 5ccd731..ffbb0e7 100644 (file)
@@ -123,6 +123,23 @@ modest_msg_view_window_get_type (void)
 }
 
 static void
+save_state (ModestWindow *self)
+{
+       modest_widget_memory_save (modest_runtime_get_conf (),
+                                  G_OBJECT(self), 
+                                  MODEST_CONF_MSG_VIEW_WINDOW_KEY);
+}
+
+
+static void
+restore_settings (ModestWindow *self)
+{
+       modest_widget_memory_restore (modest_runtime_get_conf (),
+                                     G_OBJECT(self), 
+                                     MODEST_CONF_MSG_VIEW_WINDOW_KEY);
+}
+
+static void
 modest_msg_view_window_class_init (ModestMsgViewWindowClass *klass)
 {
        GObjectClass *gobject_class;
@@ -132,6 +149,9 @@ modest_msg_view_window_class_init (ModestMsgViewWindowClass *klass)
        gobject_class->finalize = modest_msg_view_window_finalize;
 
        g_type_class_add_private (gobject_class, sizeof(ModestMsgViewWindowPrivate));
+
+       ModestWindowClass *modest_window_class = (ModestWindowClass *) klass;
+       modest_window_class->save_state_func = save_state;
 }
 
 static void
@@ -145,23 +165,6 @@ modest_msg_view_window_init (ModestMsgViewWindow *obj)
        priv->msg_view      = NULL;
 }
 
-static void
-save_settings (ModestMsgViewWindow *self)
-{
-       modest_widget_memory_save (modest_runtime_get_conf (),
-                                  G_OBJECT(self), 
-                                  MODEST_CONF_MSG_VIEW_WINDOW_KEY);
-}
-
-
-static void
-restore_settings (ModestMsgViewWindow *self)
-{
-       modest_widget_memory_restore (modest_runtime_get_conf (),
-                                     G_OBJECT(self), 
-                                     MODEST_CONF_MSG_VIEW_WINDOW_KEY);
-}
-
 
 static void
 init_window (ModestMsgViewWindow *obj, TnyMsg *msg)
@@ -201,7 +204,7 @@ modest_msg_view_window_finalize (GObject *obj)
 static gboolean
 on_delete_event (GtkWidget *widget, GdkEvent *event, ModestMsgViewWindow *self)
 {
-       save_settings (self);
+       modest_window_save_state (MODEST_WINDOW(self));
        return FALSE;
 }