#include "maemo/modest-osso-state-saving.h"
#include "modest-text-utils.h"
#include "modest-signal-mgr.h"
+#ifdef MODEST_USE_LIBTIME
+#include <clockd/libtime.h>
+#endif
#define MODEST_MAIN_WINDOW_ACTION_GROUP_ADDITIONS "ModestMainWindowActionAdditions"
ShowHelper *helper = (ShowHelper *) user_data;
GtkWidget *folder_win = helper->folder_win;
ModestMainWindowPrivate *priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
-
+ ModestAccountMgr *mgr;
+
priv->folder_view = MODEST_FOLDER_VIEW (modest_platform_create_folder_view (NULL));
wrap_in_scrolled_window (folder_win, GTK_WIDGET(priv->folder_view));
restore_settings (MODEST_MAIN_WINDOW(self), TRUE);
priv->wait_for_settings = FALSE;
- /* Check if accounts exist and show the account wizard if not */
- gboolean accounts_exist =
- modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(), TRUE);
-
- if (!accounts_exist) {
- /* This is necessary to have the main window shown behind the dialog
- It's an ugly hack... jschmid */
- gtk_widget_show_all(GTK_WIDGET(self));
- modest_ui_actions_on_accounts (NULL, MODEST_WINDOW(self));
- } else {
+ /* Update the menus if there are accounts */
+ mgr = modest_runtime_get_account_mgr();
+ if (modest_account_mgr_has_accounts(mgr, TRUE))
update_menus (MODEST_MAIN_WINDOW (self));
- }
/* Never call this function again (NOTE that it could happen
as we hide the main window instead of closing it while
last_updated = modest_account_mgr_get_last_updated (modest_runtime_get_account_mgr (),
tny_account_get_id (account));
+#ifdef MODEST_USE_LIBTIME
+ /* If we use libtime, we are storing the time in UTC so we have to convert to currently
+ * selected time */
+ time_t now;
+ struct tm *localtime_tm;
+ time (&now);
+ localtime_tm = localtime (&now);
+ last_updated -= time_get_utc_offset (localtime_tm->tm_zone);
+#endif
+
if (last_updated > 0)
last_updated_string = modest_text_utils_get_display_date(last_updated);
else
/* Show */
gtk_widget_show_all (priv->contents_widget);
+
+ /* Recompute dimming rules */
+ modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (self));
+ modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));
}
ModestMainWindowContentsStyle
{
g_return_val_if_fail (MODEST_IS_MAIN_WINDOW (window), FALSE);
- hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ckct_ib_cannot_zoom_here"));
+ hildon_banner_show_information (NULL, NULL,
+ _CS("ckct_ib_cannot_zoom_here"));
return FALSE;
}