X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-account-view.c;h=cf8fcb4cdc095d8b141b1ec3e21aa11f922d052c;hp=46c70489e73bbc81d72e5554ed898a165751de7f;hb=f6d386ff93e929092ba105385a29d760aeba9ff7;hpb=d78fabb494c3d68ab56d89f8acb5f3175aed8b13 diff --git a/src/widgets/modest-account-view.c b/src/widgets/modest-account-view.c index 46c7048..cf8fcb4 100644 --- a/src/widgets/modest-account-view.c +++ b/src/widgets/modest-account-view.c @@ -174,7 +174,6 @@ get_last_updated_string(ModestAccountMgr* account_mgr, ModestAccountSettings *se else last_updated_string = _("mcen_va_never"); } else { - /* FIXME: There should be a logical name in the UI specs */ last_updated_string = _("mcen_va_refreshing"); } @@ -230,10 +229,15 @@ update_account_view (ModestAccountMgr *account_mgr, ModestAccountView *view) const gchar *last_updated_string = get_last_updated_string(account_mgr, settings); if (modest_account_settings_get_enabled (settings)) { + ModestProtocolType protocol_type; + ModestProtocolRegistry *protocol_registry; + ModestProtocol *protocol; const gchar *proto_name; - proto_name = modest_protocol_info_get_transport_store_protocol_name - (modest_server_account_settings_get_protocol (store_settings)); + protocol_registry = modest_runtime_get_protocol_registry (); + protocol_type = modest_server_account_settings_get_protocol (store_settings); + protocol = modest_protocol_registry_get_protocol_by_type (protocol_registry, protocol_type); + proto_name = modest_protocol_get_name (protocol); gtk_list_store_insert_with_values ( model, &iter, 0, MODEST_ACCOUNT_VIEW_NAME_COLUMN, account_name, @@ -261,6 +265,8 @@ update_account_view (ModestAccountMgr *account_mgr, ModestAccountView *view) if (selected_name) { modest_account_view_select_account (view, selected_name); g_free (selected_name); + } else { + modest_account_view_select_first_account (view); } } @@ -327,13 +333,18 @@ on_account_removed (TnyAccountStore *account_store, { ModestAccountView *self; ModestAccountViewPrivate *priv; + gchar *selected_name; g_return_if_fail (MODEST_IS_ACCOUNT_VIEW (user_data)); self = MODEST_ACCOUNT_VIEW (user_data); priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE (self); + + /* Do not refresh the view with transport accounts */ + if (!TNY_IS_STORE_ACCOUNT (account)) + return; - gchar *selected_name = modest_account_view_get_selected_account (self); + selected_name = modest_account_view_get_selected_account (self); if (selected_name == NULL) { /* we select the first account if none is selected */ modest_account_view_select_first_account (self); @@ -346,25 +357,6 @@ on_account_removed (TnyAccountStore *account_store, static void -on_account_changed (TnyAccountStore *account_store, - TnyAccount *account, - gpointer user_data) -{ - ModestAccountView *self = NULL; - ModestAccountViewPrivate *priv = NULL; - - g_return_if_fail (MODEST_IS_ACCOUNT_VIEW (user_data)); - g_return_if_fail (account); - g_return_if_fail (TNY_IS_ACCOUNT (account)); - - self = MODEST_ACCOUNT_VIEW (user_data); - priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE (self); - - /* Update account view */ -/* update_account_view (priv->account_mgr, self); */ -} - -static void on_account_default_toggled (GtkCellRendererToggle *cell_renderer, gchar *path, ModestAccountView *self) @@ -515,12 +507,6 @@ init_view (ModestAccountView *self) self); priv->sig_handlers = modest_signal_mgr_connect (priv->sig_handlers, - G_OBJECT (modest_runtime_get_account_store ()), - "account_changed", - G_CALLBACK(on_account_changed), - self); - priv->sig_handlers = - modest_signal_mgr_connect (priv->sig_handlers, G_OBJECT(priv->account_mgr), "account_busy_changed", G_CALLBACK(on_account_busy_changed),