From 29675b14cbc6a762e020b92ee39f47ad3d8e7a1c Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 29 Jan 2007 10:28:53 +0000 Subject: [PATCH] * maemo/, modest-runtime.c: - update maemo/ things to use modest_runtime - fix bug in hildon_init in modest_runtime pmo-trunk-r751 --- src/maemo/modest-account-view-window.c | 17 +------------- src/maemo/modest-edit-msg-window.c | 36 +++++++---------------------- src/maemo/modest-main-window.c | 39 ++++++++++++-------------------- src/modest-runtime.c | 1 + 4 files changed, 24 insertions(+), 69 deletions(-) diff --git a/src/maemo/modest-account-view-window.c b/src/maemo/modest-account-view-window.c index cb8313e..b103f31 100644 --- a/src/maemo/modest-account-view-window.c +++ b/src/maemo/modest-account-view-window.c @@ -162,22 +162,7 @@ on_edit_button_clicked (GtkWidget *button, ModestAccountViewWindow *self) static void on_add_button_clicked (GtkWidget *button, ModestAccountViewWindow *self) { -/* GtkWidget *assistant; */ - ModestAccountViewWindowPrivate *priv; - ModestTnyPlatformFactory *fact; - ModestAccountMgr *account_mgr; - - priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self); - fact = MODEST_TNY_PLATFORM_FACTORY (modest_tny_platform_factory_get_instance ()); - account_mgr = modest_tny_platform_factory_get_account_mgr_instance (fact); -/* FIXME: - assistant = modest_account_assistant_new (account_mgr, - priv->widget_factory); - gtk_window_set_transient_for (GTK_WINDOW(assistant), - GTK_WINDOW(self)); - - gtk_widget_show (GTK_WIDGET(assistant)); -*/ + g_message (__FUNCTION__); } diff --git a/src/maemo/modest-edit-msg-window.c b/src/maemo/modest-edit-msg-window.c index d17a27e..26515cc 100644 --- a/src/maemo/modest-edit-msg-window.c +++ b/src/maemo/modest-edit-msg-window.c @@ -33,6 +33,8 @@ #include #include +#include + #include "modest-edit-msg-window-ui.h" #include "modest-icon-names.h" #include "modest-icon-factory.h" @@ -56,7 +58,6 @@ enum { typedef struct _ModestEditMsgWindowPrivate ModestEditMsgWindowPrivate; struct _ModestEditMsgWindowPrivate { - GtkWidget *msg_body; GtkWidget *from_field; GtkWidget *to_field; @@ -129,28 +130,17 @@ modest_edit_msg_window_init (ModestEditMsgWindow *obj) static void save_settings (ModestEditMsgWindow *self) { - ModestWindowPrivate *parent_priv; - ModestConf *conf; - - parent_priv = MODEST_WINDOW_GET_PRIVATE (self); - conf = modest_tny_platform_factory_get_conf_instance - (MODEST_TNY_PLATFORM_FACTORY(parent_priv->plat_factory)); - - modest_widget_memory_save (conf, G_OBJECT(self), "modest-edit-msg-window"); + modest_widget_memory_save (modest_runtime_get_conf(), + G_OBJECT(self), "modest-edit-msg-window"); } static void restore_settings (ModestEditMsgWindow *self) { - ModestWindowPrivate *parent_priv; - ModestConf *conf; - - parent_priv = MODEST_WINDOW_GET_PRIVATE (self); - conf = modest_tny_platform_factory_get_conf_instance - (MODEST_TNY_PLATFORM_FACTORY(parent_priv->plat_factory)); - modest_widget_memory_restore (conf, G_OBJECT(self), "modest-edit-msg-window"); + modest_widget_memory_restore (modest_runtime_get_conf(), + G_OBJECT(self), "modest-edit-msg-window"); } @@ -160,17 +150,15 @@ init_window (ModestEditMsgWindow *obj) GtkWidget *to_button, *cc_button, *bcc_button; GtkWidget *header_table; GtkWidget *main_vbox; - ModestWindowPrivate *parent_priv; ModestEditMsgWindowPrivate *priv; priv = MODEST_EDIT_MSG_WINDOW_GET_PRIVATE(obj); - parent_priv = MODEST_WINDOW_GET_PRIVATE(obj); to_button = gtk_button_new_with_label (_("To...")); cc_button = gtk_button_new_with_label (_("Cc...")); bcc_button = gtk_button_new_with_label (_("Bcc...")); - priv->from_field = modest_widget_factory_get_combo_box (parent_priv->widget_factory, + priv->from_field = modest_widget_factory_get_combo_box (modest_runtime_get_widget_factory(), MODEST_COMBO_BOX_TYPE_TRANSPORTS); priv->to_field = gtk_entry_new_with_max_length (80); priv->cc_field = gtk_entry_new_with_max_length (80); @@ -197,8 +185,6 @@ init_window (ModestEditMsgWindow *obj) main_vbox = gtk_vbox_new (FALSE, 6); -/* gtk_box_pack_start (GTK_BOX(main_vbox), priv->menubar, FALSE, FALSE, 0); */ -/* gtk_box_pack_start (GTK_BOX(main_vbox), priv->toolbar, FALSE, FALSE, 0); */ gtk_box_pack_start (GTK_BOX(main_vbox), header_table, FALSE, FALSE, 6); gtk_box_pack_start (GTK_BOX(main_vbox), priv->msg_body, TRUE, TRUE, 6); @@ -249,9 +235,7 @@ menubar_to_menu (GtkUIManager *ui_manager) } ModestWindow* -modest_edit_msg_window_new (ModestWidgetFactory *factory, - TnyAccountStore *account_store, - ModestEditType type) +modest_edit_msg_window_new (ModestEditType type) { GObject *obj; ModestWindowPrivate *parent_priv; @@ -259,7 +243,6 @@ modest_edit_msg_window_new (ModestWidgetFactory *factory, GtkActionGroup *action_group; GError *error = NULL; - g_return_val_if_fail (factory, NULL); g_return_val_if_fail (type < MODEST_EDIT_TYPE_NUM, NULL); obj = g_object_new(MODEST_TYPE_EDIT_MSG_WINDOW, NULL); @@ -267,9 +250,6 @@ modest_edit_msg_window_new (ModestWidgetFactory *factory, priv = MODEST_EDIT_MSG_WINDOW_GET_PRIVATE (obj); parent_priv = MODEST_WINDOW_GET_PRIVATE (obj); - parent_priv->widget_factory = g_object_ref (factory); - parent_priv->account_store = g_object_ref (account_store); - parent_priv->ui_manager = gtk_ui_manager_new(); action_group = gtk_action_group_new ("ModestEditMsgWindowActions"); diff --git a/src/maemo/modest-main-window.c b/src/maemo/modest-main-window.c index fabfc47..1aa75d8 100644 --- a/src/maemo/modest-main-window.c +++ b/src/maemo/modest-main-window.c @@ -31,7 +31,7 @@ #include #include - +#include #include #include #include @@ -156,12 +156,11 @@ static ModestHeaderView* header_view_new (ModestMainWindow *self) { ModestHeaderView *header_view; - ModestWindowPrivate *parent_priv; - parent_priv = MODEST_WINDOW_GET_PRIVATE(self); - header_view = modest_widget_factory_get_header_view (parent_priv->widget_factory); + header_view = modest_widget_factory_get_header_view + (modest_runtime_get_widget_factory()); modest_header_view_set_style (header_view, 0); /* don't show headers */ - + return header_view; } @@ -171,14 +170,11 @@ restore_sizes (ModestMainWindow *self) { ModestConf *conf; ModestMainWindowPrivate *priv; - ModestWindowPrivate *parent_priv; - - priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self); - parent_priv = MODEST_WINDOW_GET_PRIVATE(self); - conf = modest_tny_platform_factory_get_conf_instance - (MODEST_TNY_PLATFORM_FACTORY(parent_priv->plat_factory)); + priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self); + conf = modest_runtime_get_conf (); + modest_widget_memory_restore (conf,G_OBJECT(self), "modest-main-window"); modest_widget_memory_restore (conf, G_OBJECT(priv->main_paned), @@ -191,15 +187,11 @@ restore_sizes (ModestMainWindow *self) static void save_sizes (ModestMainWindow *self) { - ModestMainWindowPrivate *priv; - ModestWindowPrivate *parent_priv; ModestConf *conf; - + ModestMainWindowPrivate *priv; + priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self); - parent_priv = MODEST_WINDOW_GET_PRIVATE(self); - - conf = modest_tny_platform_factory_get_conf_instance - (MODEST_TNY_PLATFORM_FACTORY (parent_priv->plat_factory)); + conf = modest_runtime_get_conf (); modest_widget_memory_save (conf,G_OBJECT(self), "modest-main-window"); modest_widget_memory_save (conf, G_OBJECT(priv->main_paned), @@ -261,28 +253,25 @@ menubar_to_menu (GtkUIManager *ui_manager) } ModestWindow* -modest_main_window_new (ModestWidgetFactory *widget_factory, - TnyAccountStore *account_store) +modest_main_window_new (void) { GObject *obj; ModestMainWindowPrivate *priv; + ModestWidgetFactory *widget_factory; ModestWindowPrivate *parent_priv; GtkWidget *main_vbox; GtkWidget *status_hbox; GtkWidget *header_win, *folder_win; GtkActionGroup *action_group; GError *error = NULL; - - g_return_val_if_fail (widget_factory, NULL); obj = g_object_new(MODEST_TYPE_MAIN_WINDOW, NULL); priv = MODEST_MAIN_WINDOW_GET_PRIVATE(obj); parent_priv = MODEST_WINDOW_GET_PRIVATE(obj); - parent_priv->widget_factory = g_object_ref (widget_factory); - parent_priv->account_store = g_object_ref (account_store); - + widget_factory = modest_runtime_get_widget_factory (); + parent_priv->ui_manager = gtk_ui_manager_new(); action_group = gtk_action_group_new ("ModestMainWindowActions"); diff --git a/src/modest-runtime.c b/src/modest-runtime.c index 15824f1..c51fbd6 100644 --- a/src/modest-runtime.c +++ b/src/modest-runtime.c @@ -500,4 +500,5 @@ hildon_init (void) g_printerr ("modest: failed to acquire osso context\n"); return FALSE; } +} #endif /* MODEST_PLATFORM_ID==2 */ -- 1.7.9.5