X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodest-ui-dimming-rules.c;h=9090c235a921a015002e5ffe47a254278a80ded7;hb=8d9fe597cc27dab628e0e7ff18d08e11c58f45ec;hp=715e90706009f1386aa8acd922b7d29172b89b8d;hpb=5661bfe0408f4b2753a2a91aa28826e62e5e590b;p=modest diff --git a/src/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index 715e907..9090c23 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -567,14 +567,34 @@ modest_ui_dimming_rules_on_move_to (ModestWindow *win, gpointer user_data) static gboolean _forbid_outgoing_xfers (ModestWindow *window) { - const gchar *account_name; - TnyAccount *account; + const gchar *account_name = NULL; + TnyAccount *account = NULL; gboolean dimmed = FALSE; - account_name = modest_window_get_active_account (window); - account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store (), - account_name, - TNY_ACCOUNT_TYPE_STORE); +#ifdef MODEST_TOOLKIT_HILDON2 + /* We cannot just get the active account because the active + account of a header window that shows the headers of a + local account is the ID of the remote account */ + if (MODEST_IS_HEADER_WINDOW (window)) { + ModestHeaderView *header_view; + TnyFolder *folder; + + header_view = modest_header_window_get_header_view ((ModestHeaderWindow *) window); + folder = modest_header_view_get_folder (header_view); + + if (folder) { + account = modest_tny_folder_get_account (folder); + g_object_unref (folder); + } + } +#endif + + if (!account) { + account_name = modest_window_get_active_account (window); + account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store (), + account_name, + TNY_ACCOUNT_TYPE_STORE); + } if (account) { ModestProtocolType protocol_type;