From: Jose Dapena Paz Date: Tue, 1 Dec 2009 09:39:29 +0000 (+0100) Subject: Make windows inherit from ModestShellWindow in gtk X-Git-Tag: jdapena-ppa-3.90.4-modest0~186 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=bb689ad1521fee8d0500f81fef16a08b3400579c Make windows inherit from ModestShellWindow in gtk --- diff --git a/src/gtk/Makefile.am b/src/gtk/Makefile.am index e04983c..385159e 100644 --- a/src/gtk/Makefile.am +++ b/src/gtk/Makefile.am @@ -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-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) \ diff --git a/src/gtk/modest-shell-window.c b/src/gtk/modest-shell-window.c index 3148611..23cb285 100644 --- a/src/gtk/modest-shell-window.c +++ b/src/gtk/modest-shell-window.c @@ -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 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, @@ -80,7 +78,7 @@ struct _ModestShellWindowPrivate { 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; - HildonWindowClass *hildon_window_class = (HildonWindowClass *) klass; 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; - GtkWidget *menu; 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; - GtkWidget *menu; 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); - 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) { @@ -248,7 +243,7 @@ modest_shell_window_add_to_menu (ModestWindow *self, } 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); } @@ -264,9 +259,9 @@ modest_shell_window_show_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 @@ -285,6 +280,9 @@ static void 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); diff --git a/src/gtk/modest-shell-window.h b/src/gtk/modest-shell-window.h index 6899f1a..bd24da8 100644 --- a/src/gtk/modest-shell-window.h +++ b/src/gtk/modest-shell-window.h @@ -33,6 +33,7 @@ #include #include #include +#include G_BEGIN_DECLS diff --git a/src/gtk/modest-shell.c b/src/gtk/modest-shell.c index 98d9dac..8762843 100644 --- a/src/gtk/modest-shell.c +++ b/src/gtk/modest-shell.c @@ -29,6 +29,7 @@ #include #include +#include /* 'private'/'protected' functions */ static void modest_shell_class_init (ModestShellClass *klass); @@ -169,7 +170,7 @@ modest_shell_count_windows (ModestShell *shell) } 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; @@ -179,7 +180,7 @@ modest_shell_set_title (ModestShell *shell, ModestShellWindow *window, const gch } void -modest_shell_show_progress (ModestShell *shell, ModestShellWindow *window, gboolean show) +modest_shell_show_progress (ModestShell *shell, ModestWindow *window, gboolean show) { } diff --git a/src/gtk/modest-shell.h b/src/gtk/modest-shell.h index ce758ee..750ade9 100644 --- a/src/gtk/modest-shell.h +++ b/src/gtk/modest-shell.h @@ -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_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 diff --git a/src/widgets/modest-accounts-window.c b/src/widgets/modest-accounts-window.c index 56fec30..3b90a35 100644 --- a/src/widgets/modest-accounts-window.c +++ b/src/widgets/modest-accounts-window.c @@ -136,7 +136,7 @@ modest_accounts_window_get_type (void) #ifdef MODEST_TOOLKIT_HILDON2 MODEST_TYPE_HILDON2_WINDOW, #else - MODEST_TYPE_WINDOW, + MODEST_TYPE_SHELL_WINDOW, #endif "ModestAccountsWindow", &my_info, 0); diff --git a/src/widgets/modest-accounts-window.h b/src/widgets/modest-accounts-window.h index d027f53..71943a7 100644 --- a/src/widgets/modest-accounts-window.h +++ b/src/widgets/modest-accounts-window.h @@ -32,6 +32,8 @@ #ifdef MODEST_TOOLKIT_HILDON2 #include +#else +#include #endif #include #include @@ -54,7 +56,7 @@ struct _ModestAccountsWindow { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2Window parent; #else - ModestWindow parent; + ModestShellWindow parent; #endif }; @@ -62,7 +64,7 @@ struct _ModestAccountsWindowClass { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2WindowClass parent_class; #else - ModestWindowClass parent_class; + ModestShellWindowClass parent_class; #endif }; diff --git a/src/widgets/modest-folder-window.c b/src/widgets/modest-folder-window.c index edbd791..4f5c77b 100644 --- a/src/widgets/modest-folder-window.c +++ b/src/widgets/modest-folder-window.c @@ -163,7 +163,7 @@ modest_folder_window_get_type (void) #ifdef MODEST_TOOLKIT_HILDON2 MODEST_TYPE_HILDON2_WINDOW, #else - MODEST_TYPE_WINDOW, + MODEST_TYPE_SHELL_WINDOW, #endif "ModestFolderWindow", &my_info, 0); diff --git a/src/widgets/modest-folder-window.h b/src/widgets/modest-folder-window.h index 4994d0f..1495310 100644 --- a/src/widgets/modest-folder-window.h +++ b/src/widgets/modest-folder-window.h @@ -32,6 +32,8 @@ #ifdef MODEST_TOOLKIT_HILDON2 #include +#else +#include #endif #include #include @@ -55,7 +57,7 @@ struct _ModestFolderWindow { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2Window parent; #else - ModestWindow parent; + ModestShellWindow parent; #endif }; @@ -63,7 +65,7 @@ struct _ModestFolderWindowClass { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2WindowClass parent_class; #else - ModestWindowClass parent_class; + ModestShellWindowClass parent_class; #endif }; diff --git a/src/widgets/modest-header-window.c b/src/widgets/modest-header-window.c index 9dcd552..45b8838 100644 --- a/src/widgets/modest-header-window.c +++ b/src/widgets/modest-header-window.c @@ -213,7 +213,7 @@ modest_header_window_get_type (void) #ifdef MODEST_TOOLKIT_HILDON2 MODEST_TYPE_HILDON2_WINDOW, #else - MODEST_TYPE_WINDOW, + MODEST_TYPE_SHELL_WINDOW, #endif "ModestHeaderWindow", &my_info, 0); diff --git a/src/widgets/modest-header-window.h b/src/widgets/modest-header-window.h index bbe3cf5..db7cf4a 100644 --- a/src/widgets/modest-header-window.h +++ b/src/widgets/modest-header-window.h @@ -32,6 +32,8 @@ #ifdef MODEST_TOOLKIT_HILDON2 #include +#else +#include #endif #include #include @@ -54,7 +56,7 @@ struct _ModestHeaderWindow { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2Window parent; #else - ModestWindow parent; + ModestShellWindow parent; #endif }; @@ -62,7 +64,7 @@ struct _ModestHeaderWindowClass { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2WindowClass parent_class; #else - ModestWindowClass parent_class; + ModestShellWindowClass parent_class; #endif }; diff --git a/src/widgets/modest-mailboxes-window.c b/src/widgets/modest-mailboxes-window.c index a0424e4..3c4b846 100644 --- a/src/widgets/modest-mailboxes-window.c +++ b/src/widgets/modest-mailboxes-window.c @@ -128,7 +128,7 @@ modest_mailboxes_window_get_type (void) #ifdef MODEST_TOOLKIT_HILDON2 MODEST_TYPE_HILDON2_WINDOW, #else - MODEST_TYPE_WINDOW, + MODEST_TYPE_SHELL_WINDOW, #endif "ModestMailboxesWindow", &my_info, 0); diff --git a/src/widgets/modest-mailboxes-window.h b/src/widgets/modest-mailboxes-window.h index f933f90..90820ce 100644 --- a/src/widgets/modest-mailboxes-window.h +++ b/src/widgets/modest-mailboxes-window.h @@ -32,6 +32,8 @@ #ifdef MODEST_TOOLKIT_HILDON2 #include +#else +#include #endif #include #include @@ -62,7 +64,7 @@ struct _ModestMailboxesWindowClass { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2WindowClass parent_class; #else - ModestWindowClass parent_class; + ModestShellWindowClass parent_class; #endif }; diff --git a/src/widgets/modest-msg-edit-window.c b/src/widgets/modest-msg-edit-window.c index 151c13d..f7f644f 100644 --- a/src/widgets/modest-msg-edit-window.c +++ b/src/widgets/modest-msg-edit-window.c @@ -363,7 +363,7 @@ modest_msg_edit_window_get_type (void) #ifdef MODEST_TOOLKIT_HILDON2 MODEST_TYPE_HILDON2_WINDOW, #else - MODEST_TYPE_WINDOW, + MODEST_TYPE_SHELL_WINDOW, #endif "ModestMsgEditWindow", &my_info, 0); diff --git a/src/widgets/modest-msg-edit-window.h b/src/widgets/modest-msg-edit-window.h index c12c9da..b8e49d1 100644 --- a/src/widgets/modest-msg-edit-window.h +++ b/src/widgets/modest-msg-edit-window.h @@ -34,6 +34,8 @@ #include #ifdef MODEST_TOOLKIT_HILDON2 #include +#else +#include #endif #include @@ -54,7 +56,7 @@ struct _ModestMsgEditWindow { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2Window parent; #else - ModestWindow parent; + ModestShellWindow parent; #endif /* insert public members, if any */ }; @@ -63,7 +65,7 @@ struct _ModestMsgEditWindowClass { #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); */ diff --git a/src/widgets/modest-msg-view-window.c b/src/widgets/modest-msg-view-window.c index 52a394d..7be874e 100644 --- a/src/widgets/modest-msg-view-window.c +++ b/src/widgets/modest-msg-view-window.c @@ -287,8 +287,8 @@ modest_msg_view_window_get_type (void) (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 diff --git a/src/widgets/modest-msg-view-window.h b/src/widgets/modest-msg-view-window.h index 8f3efd5..9e41421 100644 --- a/src/widgets/modest-msg-view-window.h +++ b/src/widgets/modest-msg-view-window.h @@ -34,6 +34,8 @@ #include #ifdef MODEST_TOOLKIT_HILDON2 #include +#else +#include #endif #include #include @@ -54,7 +56,7 @@ typedef struct { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2Window parent; #else - ModestWindow parent; + ModestShellWindow parent; #endif } ModestMsgViewWindow; @@ -62,7 +64,7 @@ typedef struct { #ifdef MODEST_TOOLKIT_HILDON2 ModestHildon2WindowClass parent_class; #else - ModestWindowClass parent_class; + ModestShellWindowClass parent_class; #endif void (*msg_changed) (ModestMsgViewWindow *self,