diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-03-19 06:15:07 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-03-19 06:15:07 +0000 |
commit | 94674c860c08f88199217e2cbe0bdc539038f022 (patch) | |
tree | 475d2998875a1d46d4e410f63f8aee1ad72746e8 /src | |
parent | a68df591f791ccbabe308c673efa7073cce352c6 (diff) |
update account and folder config files after creating new accounts.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2525 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 5 | ||||
-rw-r--r-- | src/mainwindow.c | 6 | ||||
-rw-r--r-- | src/setup.c | 4 |
3 files changed, 13 insertions, 2 deletions
@@ -212,6 +212,7 @@ int main(int argc, char *argv[]) GList *iconlist = NULL; #endif GObject *syl_app; + PrefsAccount *new_account = NULL; app_init(); parse_cmd_opt(argc, argv); @@ -334,7 +335,7 @@ int main(int argc, char *argv[]) folder_write_list(); } if (!account_get_list()) { - setup_account(); + new_account = setup_account(); } account_set_menu(); @@ -343,6 +344,8 @@ int main(int argc, char *argv[]) account_set_missing_folder(); folder_set_missing_folders(); folderview_set(folderview); + if (new_account && new_account->folder) + folder_write_list(); addressbook_read_file(); diff --git a/src/mainwindow.c b/src/mainwindow.c index d488b187..c74dd928 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -3897,17 +3897,21 @@ static void prefs_account_open_cb(MainWindow *mainwin, guint action, static void new_account_cb(MainWindow *mainwin, guint action, GtkWidget *widget) { + PrefsAccount *ac; + if (compose_get_compose_list()) { alertpanel_notice(_("Some composing windows are open.\n" "Please close all the composing windows before editing the accounts.")); return; } - if (setup_account()) { + if ((ac = setup_account())) { account_set_menu(); main_window_reflect_prefs_all(); account_set_missing_folder(); folderview_set(mainwin->folderview); + if (ac->folder) + folder_write_list(); } } diff --git a/src/setup.c b/src/setup.c index ac00b737..51df4378 100644 --- a/src/setup.c +++ b/src/setup.c @@ -1005,7 +1005,11 @@ PrefsAccount *setup_account(void) g_free(ac->sig_text); ac->sig_text = g_strdup_printf("%s <%s>\\n", ac->name, ac->address); + account_update_lock(); account_append(ac); + account_write_config_all(); + account_update_unlock(); + account_updated(); g_free(setupac.name); g_free(setupac.addr); |