diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-10-16 07:19:50 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-10-19 18:06:33 +0800 |
commit | 395532bc9175deaac84c5ebbea9e6fc2b215286f (patch) | |
tree | caeeb506a167be4b58c896ace5acf969ca580bd2 /src/empathy.c | |
parent | 990d6cd96616a31eaa7adc4325f86c16538c8e7f (diff) | |
download | gsoc2013-empathy-395532bc9175deaac84c5ebbea9e6fc2b215286f.tar gsoc2013-empathy-395532bc9175deaac84c5ebbea9e6fc2b215286f.tar.gz gsoc2013-empathy-395532bc9175deaac84c5ebbea9e6fc2b215286f.tar.bz2 gsoc2013-empathy-395532bc9175deaac84c5ebbea9e6fc2b215286f.tar.lz gsoc2013-empathy-395532bc9175deaac84c5ebbea9e6fc2b215286f.tar.xz gsoc2013-empathy-395532bc9175deaac84c5ebbea9e6fc2b215286f.tar.zst gsoc2013-empathy-395532bc9175deaac84c5ebbea9e6fc2b215286f.zip |
Make calling empathy without options idempotent
When empathy is started without any accounts the account assistant shows up,
but if empathy is already running and is called again nothing happens. Fixed
by always showing the account assistant if empathy is called and there are
no non-salut accounts
Diffstat (limited to 'src/empathy.c')
-rw-r--r-- | src/empathy.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/empathy.c b/src/empathy.c index c12a20bd5..93d0994a2 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -442,7 +442,8 @@ migrate_config_to_xdg_dir (void) } static void -do_show_accounts_ui (GtkWindow *window, EmpathyAccountManager *manager) +do_show_accounts_ui (GtkWindow *window, + EmpathyAccountManager *manager) { GtkWidget *ui; @@ -469,17 +470,24 @@ account_manager_ready_for_accounts_cb (EmpathyAccountManager *manager, } static void -show_accounts_ui (GtkWindow *window) +show_accounts_ui (GtkWindow *window, + gboolean force) { EmpathyAccountManager *manager; manager = empathy_account_manager_dup_singleton (); if (empathy_account_manager_is_ready (manager)) { - do_show_accounts_ui (window, manager); + if (force) + do_show_accounts_ui (window, manager); + else + maybe_show_account_assistant (); } - else + else if (force) { + /* Only if we we're forced to show the widget connect to ready, otherwise + * the initial readyness will cause the accounts ui to be shown when + * needed */ g_signal_connect (manager, "notify::ready", G_CALLBACK (account_manager_ready_for_accounts_cb), window); } @@ -501,10 +509,17 @@ unique_app_message_cb (UniqueApp *unique_app, if (command == COMMAND_ACCOUNTS_DIALOG) { - show_accounts_ui (window); + show_accounts_ui (window, TRUE); } else { + /* We're requested to show stuff again, disable the start hidden global + * in case the accounts wizard wants to pop up. + */ + start_hidden = FALSE; + + show_accounts_ui (window, FALSE); + gtk_window_set_screen (GTK_WINDOW (window), unique_message_data_get_screen (data)); gtk_window_set_startup_id (GTK_WINDOW (window), @@ -902,7 +917,7 @@ main (int argc, char *argv[]) if (account_dialog_only) { account_manager = empathy_account_manager_dup_singleton (); - show_accounts_ui (NULL); + show_accounts_ui (NULL, TRUE); gtk_main (); |