+2007-06-11 Johannes Schmid <johannes.schmid@openismus.com>
+
+ * src/maemo/modest-maemo-utils.c:
+ (modest_maemo_utils_get_supported_secure_authentication_methods):
+ Added label to dialog instead of unreadable title
+
+ * src/maemo/modest-main-window.c: (sync_accounts_cb),
+ (modest_main_window_new):
+ Fixed projects.maemo.org bug NB#58576 by moving previous fix out of
+ dead code.
+
+ * src/modest-account-mgr.c: (modest_account_mgr_has_accounts):
+ * src/modest-account-mgr.h:
+ Added method to avoid code duplication
+
+ * src/modest-ui-actions.c: (modest_ui_actions_on_accounts),
+ (modest_ui_actions_on_send_receive):
+ Use modest_account_mgr_has_accounts
+
2007-06-11 Murray Cumming <murrayc@murrayc.com>
* src/maemo/easysetup/modest-presets.c:
info->result = NULL;
info->cancel = FALSE;
info->progress = gtk_progress_bar_new();
- info->dialog = gtk_dialog_new_with_buttons(_("Checking for supported authentication types"),
+ info->dialog = gtk_dialog_new_with_buttons(_("Authentication"),
parent_window, GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
NULL);
+ //gtk_window_set_default_size(GTK_WINDOW(info->dialog), 300, 100);
g_signal_connect(G_OBJECT(info->dialog), "response", G_CALLBACK(on_secure_auth_cancel), info);
+ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(info->dialog)->vbox),
+ gtk_label_new("Checking for supported authentication types..."));
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(info->dialog)->vbox), info->progress);
- gtk_widget_show(info->progress);
- gtk_widget_show(info->dialog);
+ gtk_widget_show_all(info->dialog);
gtk_progress_bar_pulse(GTK_PROGRESS_BAR(info->progress));
printf ("DEBUG: %s: STARTING.\n", __FUNCTION__);
gboolean
sync_accounts_cb (ModestMainWindow *win)
{
- modest_ui_actions_on_send_receive (NULL, MODEST_WINDOW (win));
+ modest_ui_actions_do_send_receive (NULL, MODEST_WINDOW (win));
return FALSE; /* Do not call this idle handler again. */
}
#endif
tny_account_store_view_set_account_store (TNY_ACCOUNT_STORE_VIEW (priv->folder_view),
TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()));
+ /* 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));
+ }
+
/* Do send & receive when we are idle */
/* TODO: Enable this again. I have commented it out because,
* at least in scratchbox, this can cause us to start a second
return retval;
}
+
+gboolean
+modest_account_mgr_has_accounts (ModestAccountMgr* self, gboolean enabled)
+{
+ /* Check that at least one account exists: */
+ GSList *account_names = modest_account_mgr_account_names (self,
+ enabled);
+ gboolean accounts_exist = account_names != NULL;
+ g_slist_free (account_names);
+
+ return accounts_exist;
+}
const gchar *key,
gboolean server_account);
+/**
+ * modest_account_mgr_has_accounts:
+ * @self: a ModestAccountMgr instance
+ * @enabled: TRUE to search for enabled accounts only
+ *
+ * Checks if any accounts exist
+ *
+ * Returns: TRUE if accounts exist, FALSE otherwise
+ */
+
+gboolean modest_account_mgr_has_accounts (ModestAccountMgr* self, gboolean enabled);
+
G_END_DECLS
#endif /* __MODEST_ACCOUNT_MGR_H__ */
* because it requires a providers preset file which is not publically available.
*/
#ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */
- GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr(),
- TRUE /* enabled accounts only */);
- gboolean accounts_exist = account_names != NULL;
- g_slist_free (account_names);
+ gboolean accounts_exist = modest_account_mgr_has_accounts(
+ modest_runtime_get_account_mgr(), TRUE);
if (!accounts_exist) {
/* If there are no accounts yet, just show the easy-setup wizard, as per the UI spec: */
void
modest_ui_actions_on_send_receive (GtkAction *action, ModestWindow *win)
{
- /* Check that at least one account exists: */
- GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr(),
- TRUE /* enabled accounts only */);
- gboolean accounts_exist = account_names != NULL;
- g_slist_free (account_names);
+ /* Check if accounts exist */
+ gboolean accounts_exist =
+ modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(), TRUE);
/* If not, allow the user to create an account before trying to send/receive. */
if (!accounts_exist)