From: Sergio Villar Senin Date: Tue, 11 Dec 2007 12:51:43 +0000 (+0000) Subject: * Fixes NB#78470, the account name is now properly updated in the menus when changed X-Git-Tag: git_migration_finished~1941 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=1cd428f3398e4c64b287a691ad03fb2f841212fe * Fixes NB#78470, the account name is now properly updated in the menus when changed pmo-trunk-r3897 --- diff --git a/src/maemo/modest-main-window.c b/src/maemo/modest-main-window.c index a687ecd..8350c5e 100644 --- a/src/maemo/modest-main-window.c +++ b/src/maemo/modest-main-window.c @@ -106,15 +106,17 @@ static void on_queue_changed (ModestMailOperationQueue *queue, static gboolean on_zoom_minus_plus_not_implemented (ModestWindow *window); -static void -on_account_inserted (TnyAccountStore *accoust_store, - TnyAccount *account, - gpointer user_data); +static void on_account_inserted (TnyAccountStore *accoust_store, + TnyAccount *account, + gpointer user_data); -static void -on_account_removed (TnyAccountStore *accoust_store, - TnyAccount *account, - gpointer user_data); +static void on_account_removed (TnyAccountStore *accoust_store, + TnyAccount *account, + gpointer user_data); + +static void on_account_changed (TnyAccountStore *account_store, + TnyAccount *account, + gpointer user_data); static void on_default_account_changed (ModestAccountMgr* mgr, gpointer user_data); @@ -140,9 +142,6 @@ static void on_show_account_action_toggled (GtkToggleAction *action, static void on_refresh_account_action_activated (GtkAction *action, gpointer user_data); -static void on_account_updated (ModestAccountMgr* mgr, gchar* account_name, - gpointer user_data); - static void on_send_receive_csm_activated (GtkMenuItem *item, gpointer user_data); @@ -970,15 +969,16 @@ connect_signals (ModestMainWindow *self) G_CALLBACK (on_default_account_changed), self); - priv->sighandlers = - modest_signal_mgr_connect (priv->sighandlers, - G_OBJECT (modest_runtime_get_account_mgr ()), - "account_updated", - G_CALLBACK (on_account_updated), - self); /* Account store */ priv->sighandlers = modest_signal_mgr_connect (priv->sighandlers, + G_OBJECT (modest_runtime_get_account_store ()), + "account_changed", + G_CALLBACK (on_account_changed), + self); + + priv->sighandlers = + modest_signal_mgr_connect (priv->sighandlers, G_OBJECT (modest_runtime_get_account_store()), "password_requested", G_CALLBACK (modest_ui_actions_on_password_requested), @@ -1489,15 +1489,19 @@ on_account_removed (TnyAccountStore *accoust_store, } static void -on_account_updated (ModestAccountMgr* mgr, - gchar* account_name, +on_account_changed (TnyAccountStore *account_store, + TnyAccount *account, gpointer user_data) { ModestMainWindow *win = MODEST_MAIN_WINDOW (user_data); + /* We need to refresh the details widget because it could have changed */ if (modest_main_window_get_contents_style(win) == MODEST_MAIN_WINDOW_CONTENTS_STYLE_DETAILS) { modest_main_window_set_contents_style (win, MODEST_MAIN_WINDOW_CONTENTS_STYLE_DETAILS); } + + /* Update the menus as well, the account name could be changed */ + update_menus (MODEST_MAIN_WINDOW (user_data)); } /*