X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-account-view.c;h=fd9f115f44c2e4454d3a1612521e13f24dd7c98f;hb=cdfa49be23f8f02e602b4780bd0e1dd485624b86;hp=b5bed2c761c285cac071e0fd7058898809315ce2;hpb=97b8abd58253731cfab9e6eba29a126a2fcc6df1;p=modest diff --git a/src/widgets/modest-account-view.c b/src/widgets/modest-account-view.c index b5bed2c..fd9f115 100644 --- a/src/widgets/modest-account-view.c +++ b/src/widgets/modest-account-view.c @@ -74,7 +74,7 @@ static void on_account_updated (ModestAccountMgr* mgr, gchar* account_name, gpointer user_data); static void update_account_view (ModestAccountMgr *account_mgr, ModestAccountView *view); static void on_notify_style (GObject *obj, GParamSpec *spec, gpointer userdata); -static void update_picker_mode (ModestAccountView *self); +static void update_display_mode (ModestAccountView *self); typedef enum { MODEST_ACCOUNT_VIEW_NAME_COLUMN, @@ -93,6 +93,7 @@ struct _ModestAccountViewPrivate { ModestDatetimeFormatter *datetime_formatter; gboolean picker_mode; + gboolean show_last_updated; /* Signal handlers */ GSList *sig_handlers; @@ -160,6 +161,7 @@ modest_account_view_init (ModestAccountView *obj) priv->datetime_formatter = modest_datetime_formatter_new (); priv->picker_mode = FALSE; + priv->show_last_updated = TRUE; g_signal_connect (G_OBJECT (priv->datetime_formatter), "format-changed", G_CALLBACK (datetime_format_changed), (gpointer) obj); #ifdef MODEST_TOOLKIT_HILDON2 @@ -234,7 +236,9 @@ update_account_view (ModestAccountMgr *account_mgr, ModestAccountView *view) { GSList *account_names, *cursor; GtkListStore *model; - + ModestAccountViewPrivate *priv; + + priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE(view); model = GTK_LIST_STORE(gtk_tree_view_get_model (GTK_TREE_VIEW(view))); /* Get the ID of the currently-selected account, @@ -286,9 +290,13 @@ update_account_view (ModestAccountMgr *account_mgr, ModestAccountView *view) #ifdef MODEST_TOOLKIT_HILDON2 gchar *last_updated_hildon2; - last_updated_hildon2 = g_strconcat (_("mcen_ti_lastupdated"), "\n", - last_updated_string, - NULL); + if (priv->show_last_updated) { + last_updated_hildon2 = g_strconcat (_("mcen_ti_lastupdated"), "\n", + last_updated_string, + NULL); + } else { + last_updated_hildon2 = g_strconcat (_("mcen_ti_lastupdated"), "\n", NULL); + } #endif protocol_registry = modest_runtime_get_protocol_registry (); protocol_type = modest_server_account_settings_get_protocol (store_settings); @@ -658,7 +666,7 @@ init_view (ModestAccountView *self) gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(self), TRUE); #endif - update_picker_mode (self); + update_display_mode (self); priv->sig_handlers = modest_signal_mgr_connect (priv->sig_handlers, @@ -886,7 +894,7 @@ on_notify_style (GObject *obj, GParamSpec *spec, gpointer userdata) } static void -update_picker_mode (ModestAccountView *self) +update_display_mode (ModestAccountView *self) { ModestAccountViewPrivate *priv; GtkTreeViewColumn *column; @@ -920,7 +928,7 @@ modest_account_view_set_picker_mode (ModestAccountView *self, gboolean enable) priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE(self); priv->picker_mode = enable; - update_picker_mode (self); + update_display_mode (self); } gboolean @@ -933,3 +941,27 @@ modest_account_view_get_picker_mode (ModestAccountView *self) return priv->picker_mode; } + +void +modest_account_view_set_show_last_update (ModestAccountView *self, + gboolean show) +{ + ModestAccountViewPrivate *priv; + + g_return_if_fail (MODEST_IS_ACCOUNT_VIEW (self)); + priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE(self); + + priv->show_last_updated = show; + update_account_view (priv->account_mgr, self); +} + +gboolean +modest_account_view_get_show_last_updated (ModestAccountView *self) +{ + ModestAccountViewPrivate *priv; + + g_return_val_if_fail (MODEST_IS_ACCOUNT_VIEW (self), FALSE); + priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE(self); + + return priv->show_last_updated; +}