X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-window.c;h=b45e13a310861088dc9c31390a1fd6490b095bf0;hb=41c33d2e51bef2ae3d750c2848ab13cb4bb8d392;hp=246994157b51b36f92d3adec098b2b2b2cf640cd;hpb=89e6b2e07630f0a135113c3f69e1185a2154c29c;p=modest diff --git a/src/widgets/modest-window.c b/src/widgets/modest-window.c index 2469941..b45e13a 100644 --- a/src/widgets/modest-window.c +++ b/src/widgets/modest-window.c @@ -33,6 +33,8 @@ #include "modest-tny-platform-factory.h" #include "modest-runtime.h" #include "modest-window-mgr.h" +#include /* for strcmp */ +#include /* 'private'/'protected' functions */ static void modest_window_class_init (ModestWindowClass *klass); @@ -166,17 +168,32 @@ const gchar* modest_window_get_active_account (ModestWindow *self) { g_return_val_if_fail (self, NULL); - + //g_warning ("%s: %s", __FUNCTION__, MODEST_WINDOW_GET_PRIVATE(self)->active_account); return MODEST_WINDOW_GET_PRIVATE(self)->active_account; } void modest_window_set_active_account (ModestWindow *self, const gchar *active_account) { - ModestWindowPrivate *priv; + ModestWindowPrivate *priv; + g_return_if_fail (self); priv = MODEST_WINDOW_GET_PRIVATE(self); + //g_warning ("%s: %s", __FUNCTION__, active_account); + + /* only 'real' account should be set here; for example the email signature + * depends on the current account, so if you reply to a message in your + * archive, it should take the signature from the real active account, + * not the non-existing one from your mmc-pseudo-account + */ + if (active_account && ((strcmp (active_account, MODEST_LOCAL_FOLDERS_ACCOUNT_ID) == 0) || + (strcmp (active_account, MODEST_MMC_ACCOUNT_ID) == 0))) { + g_warning ("%s: %s is not a valid active account", + __FUNCTION__, active_account); + return; + } + if (active_account == priv->active_account) return; else { @@ -407,7 +424,7 @@ on_key_pressed (GtkWidget *self, case GDK_Escape: if (modest_window_mgr_get_fullscreen_mode (mgr)) modest_ui_actions_on_change_fullscreen (NULL, MODEST_WINDOW(self)); - else if (MODEST_IS_MSG_VIEW_WINDOW (self)||MODEST_IS_MSG_EDIT_WINDOW (self)) + else if (MODEST_IS_MSG_VIEW_WINDOW (self)) modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (self)); break; }