Make windows inherit from ModestShellWindow in gtk
authorJose Dapena Paz <jdapena@igalia.com>
Tue, 1 Dec 2009 09:39:29 +0000 (10:39 +0100)
committerJose Dapena Paz <jdapena@igalia.com>
Tue, 1 Dec 2009 09:39:30 +0000 (10:39 +0100)
17 files changed:
src/gtk/Makefile.am
src/gtk/modest-shell-window.c
src/gtk/modest-shell-window.h
src/gtk/modest-shell.c
src/gtk/modest-shell.h
src/widgets/modest-accounts-window.c
src/widgets/modest-accounts-window.h
src/widgets/modest-folder-window.c
src/widgets/modest-folder-window.h
src/widgets/modest-header-window.c
src/widgets/modest-header-window.h
src/widgets/modest-mailboxes-window.c
src/widgets/modest-mailboxes-window.h
src/widgets/modest-msg-edit-window.c
src/widgets/modest-msg-edit-window.h
src/widgets/modest-msg-view-window.c
src/widgets/modest-msg-view-window.h

index e04983c..385159e 100644 (file)
@@ -42,7 +42,8 @@ libmodest_ui_la_SOURCES= \
        modest-icon-names.h \
        modest-gtk-window-mgr.h modest-gtk-window-mgr.c \
        modest-platform.c \
        modest-icon-names.h \
        modest-gtk-window-mgr.h modest-gtk-window-mgr.c \
        modest-platform.c \
-       modest-shell.h modest-shell.c
+       modest-shell.h modest-shell.c \
+       modest-shell-window.h modest-shell-window.c
 
 libmodest_ui_la_LIBADD = \
        $(MODEST_GSTUFF_LIBS) \
 
 libmodest_ui_la_LIBADD = \
        $(MODEST_GSTUFF_LIBS) \
index 3148611..23cb285 100644 (file)
@@ -45,8 +45,6 @@ static void modest_shell_window_dispose     (GObject *obj);
 static gboolean on_zoom_minus_plus_not_implemented (ModestWindow *window);
 static void modest_shell_window_show_progress (ModestWindow *window,
                                                 gboolean show);
 static gboolean on_zoom_minus_plus_not_implemented (ModestWindow *window);
 static void modest_shell_window_show_progress (ModestWindow *window,
                                                 gboolean show);
-static void setup_menu (ModestShellWindow *self);
-
 static void modest_shell_window_show_toolbar (ModestWindow *self,
                                                 gboolean show_toolbar);
 static void modest_shell_window_add_toolbar (ModestWindow *self,
 static void modest_shell_window_show_toolbar (ModestWindow *self,
                                                 gboolean show_toolbar);
 static void modest_shell_window_add_toolbar (ModestWindow *self,
@@ -80,7 +78,7 @@ struct _ModestShellWindowPrivate {
 static GtkWindowClass *parent_class = NULL;
 
 /* uncomment the following if you have defined any signals */
 static GtkWindowClass *parent_class = NULL;
 
 /* uncomment the following if you have defined any signals */
-static guint signals[LAST_SIGNAL] = {0};
+/* static guint signals[LAST_SIGNAL] = {0}; */
 
 /************************************************************************/
 
 
 /************************************************************************/
 
@@ -114,7 +112,6 @@ modest_shell_window_class_init (gpointer klass, gpointer class_data)
        GObjectClass *gobject_class;
        gobject_class = (GObjectClass*) klass;
        ModestWindowClass *modest_window_class = (ModestWindowClass *) klass;
        GObjectClass *gobject_class;
        gobject_class = (GObjectClass*) klass;
        ModestWindowClass *modest_window_class = (ModestWindowClass *) klass;
-       HildonWindowClass *hildon_window_class = (HildonWindowClass *) klass;
 
        parent_class            = g_type_class_peek_parent (klass);
        gobject_class->dispose  = modest_shell_window_dispose;
 
        parent_class            = g_type_class_peek_parent (klass);
        gobject_class->dispose  = modest_shell_window_dispose;
@@ -194,7 +191,6 @@ modest_shell_window_add_item_to_menu (ModestWindow *self,
                                        ModestDimmingCallback dimming_callback)
 {
        ModestShellWindowPrivate *priv;
                                        ModestDimmingCallback dimming_callback)
 {
        ModestShellWindowPrivate *priv;
-       GtkWidget *menu;
 
        g_return_if_fail (MODEST_IS_SHELL_WINDOW(self));
        g_return_if_fail (GTK_IS_BUTTON (button));
 
        g_return_if_fail (MODEST_IS_SHELL_WINDOW(self));
        g_return_if_fail (GTK_IS_BUTTON (button));
@@ -226,7 +222,6 @@ modest_shell_window_add_to_menu (ModestWindow *self,
 {
        ModestShellWindowPrivate *priv = NULL;
        GtkWidget *menu_item;
 {
        ModestShellWindowPrivate *priv = NULL;
        GtkWidget *menu_item;
-       GtkWidget *menu;
 
        g_return_if_fail (MODEST_IS_SHELL_WINDOW(self));
        g_return_if_fail (label && label[0] != '\0');
 
        g_return_if_fail (MODEST_IS_SHELL_WINDOW(self));
        g_return_if_fail (label && label[0] != '\0');
@@ -235,7 +230,7 @@ modest_shell_window_add_to_menu (ModestWindow *self,
        priv = MODEST_SHELL_WINDOW_GET_PRIVATE (self);
 
        menu_item = gtk_menu_item_new_with_label (label);
        priv = MODEST_SHELL_WINDOW_GET_PRIVATE (self);
 
        menu_item = gtk_menu_item_new_with_label (label);
-       g_signal_connect_after (G_OBJECT (button), "activate-item",
+       g_signal_connect_after (G_OBJECT (menu_item), "activate-item",
                                G_CALLBACK (callback), (gpointer) self);
 
        if (accelerator != NULL) {
                                G_CALLBACK (callback), (gpointer) self);
 
        if (accelerator != NULL) {
@@ -248,7 +243,7 @@ modest_shell_window_add_to_menu (ModestWindow *self,
        }
 
        if (priv->menu) {
        }
 
        if (priv->menu) {
-               gtk_menu_shell_append (GTK_MENU (priv->menu), menu_item);
+               gtk_menu_shell_append (GTK_MENU_SHELL (priv->menu), menu_item);
        } else {
                gtk_widget_destroy (menu_item);
        }
        } else {
                gtk_widget_destroy (menu_item);
        }
@@ -264,9 +259,9 @@ modest_shell_window_show_toolbar (ModestWindow *self,
 
 static void
 modest_shell_window_add_toolbar (ModestWindow *self,
 
 static void
 modest_shell_window_add_toolbar (ModestWindow *self,
-                                  GtkToolbar *toolbar)
+                                GtkToolbar *toolbar)
 {
 {
-       gtk_box_pack_end (GTK_BOX (self), toolbar, FALSE, FALSE, 0);
+       gtk_box_pack_end (GTK_BOX (self), GTK_WIDGET (toolbar), FALSE, FALSE, 0);
 }
 
 static void
 }
 
 static void
@@ -285,6 +280,9 @@ static void
 modest_shell_window_show_progress (ModestWindow *self,
                                     gboolean show)
 {
 modest_shell_window_show_progress (ModestWindow *self,
                                     gboolean show)
 {
+       ModestShellWindowPrivate *priv = NULL;
+
+       priv = MODEST_SHELL_WINDOW_GET_PRIVATE (self);
        modest_shell_show_progress (MODEST_SHELL (priv->shell),
                                    self,
                                    show);
        modest_shell_show_progress (MODEST_SHELL (priv->shell),
                                    self,
                                    show);
index 6899f1a..bd24da8 100644 (file)
@@ -33,6 +33,7 @@
 #include <widgets/modest-window.h>
 #include <widgets/modest-account-view.h>
 #include <modest-dimming-rule.h>
 #include <widgets/modest-window.h>
 #include <widgets/modest-account-view.h>
 #include <modest-dimming-rule.h>
+#include <modest-shell.h>
 
 G_BEGIN_DECLS
 
 
 G_BEGIN_DECLS
 
index 98d9dac..8762843 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <string.h>
 #include <modest-shell.h>
 
 #include <string.h>
 #include <modest-shell.h>
+#include <modest-shell-window.h>
 
 /* 'private'/'protected' functions */
 static void modest_shell_class_init (ModestShellClass *klass);
 
 /* 'private'/'protected' functions */
 static void modest_shell_class_init (ModestShellClass *klass);
@@ -169,7 +170,7 @@ modest_shell_count_windows (ModestShell *shell)
 }
 
 void
 }
 
 void
-modest_shell_set_title (ModestShell *shell, ModestShellWindow *window, const gchar *title)
+modest_shell_set_title (ModestShell *shell, ModestWindow *window, const gchar *title)
 {
        ModestShellPrivate *priv;
 
 {
        ModestShellPrivate *priv;
 
@@ -179,7 +180,7 @@ modest_shell_set_title (ModestShell *shell, ModestShellWindow *window, const gch
 }
 
 void
 }
 
 void
-modest_shell_show_progress (ModestShell *shell, ModestShellWindow *window, gboolean show)
+modest_shell_show_progress (ModestShell *shell, ModestWindow *window, gboolean show)
 {
 }
 
 {
 }
 
index ce758ee..750ade9 100644 (file)
@@ -67,8 +67,8 @@ gboolean modest_shell_delete_window (ModestShell *shell, ModestWindow *window);
 void modest_shell_add_window (ModestShell *shell, ModestWindow *window);
 gint modest_shell_count_windows (ModestShell *shell);
 
 void modest_shell_add_window (ModestShell *shell, ModestWindow *window);
 gint modest_shell_count_windows (ModestShell *shell);
 
-void modest_shell_set_title (ModestShell *shell, ModestShellWindow *window, const gchar *title);
-void modest_shell_show_progress (ModestShell *shell, ModestShellWindow *window, gboolean show);
+void modest_shell_set_title (ModestShell *shell, ModestWindow *window, const gchar *title);
+void modest_shell_show_progress (ModestShell *shell, ModestWindow *window, gboolean show);
 
 
 G_END_DECLS
 
 
 G_END_DECLS
index 56fec30..3b90a35 100644 (file)
@@ -136,7 +136,7 @@ modest_accounts_window_get_type (void)
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
-                                                 MODEST_TYPE_WINDOW,
+                                                 MODEST_TYPE_SHELL_WINDOW,
 #endif
                                                  "ModestAccountsWindow",
                                                  &my_info, 0);
 #endif
                                                  "ModestAccountsWindow",
                                                  &my_info, 0);
index d027f53..71943a7 100644 (file)
@@ -32,6 +32,8 @@
 
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
 
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
+#else
+#include <modest-shell-window.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-account-view.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-account-view.h>
@@ -54,7 +56,7 @@ struct _ModestAccountsWindow {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
-       ModestWindow parent;
+       ModestShellWindow parent;
 #endif
 };
 
 #endif
 };
 
@@ -62,7 +64,7 @@ struct _ModestAccountsWindowClass {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
-       ModestWindowClass parent_class;
+       ModestShellWindowClass parent_class;
 #endif
 };
 
 #endif
 };
 
index edbd791..4f5c77b 100644 (file)
@@ -163,7 +163,7 @@ modest_folder_window_get_type (void)
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
-                                                 MODEST_TYPE_WINDOW,
+                                                 MODEST_TYPE_SHELL_WINDOW,
 #endif
                                                  "ModestFolderWindow",
                                                  &my_info, 0);
 #endif
                                                  "ModestFolderWindow",
                                                  &my_info, 0);
index 4994d0f..1495310 100644 (file)
@@ -32,6 +32,8 @@
 
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
 
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
+#else
+#include <modest-shell-window.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-folder-view.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-folder-view.h>
@@ -55,7 +57,7 @@ struct _ModestFolderWindow {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
-       ModestWindow parent;
+       ModestShellWindow parent;
 #endif
 };
 
 #endif
 };
 
@@ -63,7 +65,7 @@ struct _ModestFolderWindowClass {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
-       ModestWindowClass parent_class;
+       ModestShellWindowClass parent_class;
 #endif
 };
 
 #endif
 };
 
index 9dcd552..45b8838 100644 (file)
@@ -213,7 +213,7 @@ modest_header_window_get_type (void)
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
-                                                 MODEST_TYPE_WINDOW,
+                                                 MODEST_TYPE_SHELL_WINDOW,
 #endif
                                                  "ModestHeaderWindow",
                                                  &my_info, 0);
 #endif
                                                  "ModestHeaderWindow",
                                                  &my_info, 0);
index bbe3cf5..db7cf4a 100644 (file)
@@ -32,6 +32,8 @@
 
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
 
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
+#else
+#include <modest-shell-window.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-header-view.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-header-view.h>
@@ -54,7 +56,7 @@ struct _ModestHeaderWindow {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
-       ModestWindow parent;
+       ModestShellWindow parent;
 #endif
 };
 
 #endif
 };
 
@@ -62,7 +64,7 @@ struct _ModestHeaderWindowClass {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
-       ModestWindowClass parent_class;
+       ModestShellWindowClass parent_class;
 #endif
 };
 
 #endif
 };
 
index a0424e4..3c4b846 100644 (file)
@@ -128,7 +128,7 @@ modest_mailboxes_window_get_type (void)
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
-                                                 MODEST_TYPE_WINDOW,
+                                                 MODEST_TYPE_SHELL_WINDOW,
 #endif
                                                  "ModestMailboxesWindow",
                                                  &my_info, 0);
 #endif
                                                  "ModestMailboxesWindow",
                                                  &my_info, 0);
index f933f90..90820ce 100644 (file)
@@ -32,6 +32,8 @@
 
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
 
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
+#else
+#include <modest-shell-window.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-folder-view.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-folder-view.h>
@@ -62,7 +64,7 @@ struct _ModestMailboxesWindowClass {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
-       ModestWindowClass parent_class;
+       ModestShellWindowClass parent_class;
 #endif
 };
 
 #endif
 };
 
index 151c13d..f7f644f 100644 (file)
@@ -363,7 +363,7 @@ modest_msg_edit_window_get_type (void)
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
                                                  MODEST_TYPE_HILDON2_WINDOW,
 #else
-                                                 MODEST_TYPE_WINDOW,
+                                                 MODEST_TYPE_SHELL_WINDOW,
 #endif
                                                  "ModestMsgEditWindow",
                                                  &my_info, 0);
 #endif
                                                  "ModestMsgEditWindow",
                                                  &my_info, 0);
index c12c9da..b8e49d1 100644 (file)
@@ -34,6 +34,8 @@
 #include <tny-vfs-stream.h>
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
 #include <tny-vfs-stream.h>
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
+#else
+#include <modest-shell-window.h>
 #endif
 #include <widgets/modest-window.h>
 
 #endif
 #include <widgets/modest-window.h>
 
@@ -54,7 +56,7 @@ struct _ModestMsgEditWindow {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
-        ModestWindow parent;
+       ModestShellWindow parent;
 #endif
        /* insert public members, if any */
 };
 #endif
        /* insert public members, if any */
 };
@@ -63,7 +65,7 @@ struct _ModestMsgEditWindowClass {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
-       ModestWindowClass parent_class;
+       ModestShellWindowClass parent_class;
 #endif
        /* insert signal callback declarations, eg. */
        /* void (* my_event) (ModestMsgEditWindow* obj); */
 #endif
        /* insert signal callback declarations, eg. */
        /* void (* my_event) (ModestMsgEditWindow* obj); */
index 52a394d..7be874e 100644 (file)
@@ -287,8 +287,8 @@ modest_msg_view_window_get_type (void)
                        (GInstanceInitFunc) modest_msg_view_window_init,
                        NULL
                };
                        (GInstanceInitFunc) modest_msg_view_window_init,
                        NULL
                };
-#ifdef MODEST_TOOLKIT_GTK
-               my_type = g_type_register_static (MODEST_TYPE_WINDOW,
+#ifndef MODEST_TOOLKIT_HILDON2
+               my_type = g_type_register_static (MODEST_TYPE_SHELL_WINDOW,
                                                  "ModestMsgViewWindow",
                                                  &my_info, 0);
 #else
                                                  "ModestMsgViewWindow",
                                                  &my_info, 0);
 #else
index 8f3efd5..9e41421 100644 (file)
@@ -34,6 +34,8 @@
 #include <tny-folder.h>
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
 #include <tny-folder.h>
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-hildon2-window.h>
+#else
+#include <modest-shell-window.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-header-view.h>
 #endif
 #include <widgets/modest-window.h>
 #include <widgets/modest-header-view.h>
@@ -54,7 +56,7 @@ typedef struct {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2Window parent;
 #else
-       ModestWindow parent;
+       ModestShellWindow parent;
 #endif
 } ModestMsgViewWindow;
        
 #endif
 } ModestMsgViewWindow;
        
@@ -62,7 +64,7 @@ typedef struct {
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
 #ifdef MODEST_TOOLKIT_HILDON2
        ModestHildon2WindowClass parent_class;
 #else
-       ModestWindowClass parent_class;
+       ModestShellWindowClass parent_class;
 #endif
 
        void (*msg_changed) (ModestMsgViewWindow *self,
 #endif
 
        void (*msg_changed) (ModestMsgViewWindow *self,