From 07ff682cb420c1ee458f2115d7693d2861f40db6 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 23 Sep 2011 11:54:47 +0200 Subject: empathy-account: add a --assistant option to force having assistant This makes easier to test it https://bugzilla.gnome.org/show_bug.cgi?id=646630 --- src/empathy-accounts-common.c | 3 ++- src/empathy-accounts-common.h | 1 + src/empathy-accounts.c | 11 ++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/empathy-accounts-common.c b/src/empathy-accounts-common.c index 8932fdbbc..23ea5f508 100644 --- a/src/empathy-accounts-common.c +++ b/src/empathy-accounts-common.c @@ -132,12 +132,13 @@ out: void empathy_accounts_show_accounts_ui (TpAccountManager *manager, TpAccount *account, + gboolean assistant, GCallback window_destroyed_cb) { g_return_if_fail (TP_IS_ACCOUNT_MANAGER (manager)); g_return_if_fail (!account || TP_IS_ACCOUNT (account)); - if (empathy_accounts_has_non_salut_accounts (manager)) + if (empathy_accounts_has_non_salut_accounts (manager) && !assistant) { do_show_accounts_ui (manager, account, window_destroyed_cb); } diff --git a/src/empathy-accounts-common.h b/src/empathy-accounts-common.h index c7f36661b..002d78323 100644 --- a/src/empathy-accounts-common.h +++ b/src/empathy-accounts-common.h @@ -28,6 +28,7 @@ gboolean empathy_accounts_has_accounts (TpAccountManager *manager); void empathy_accounts_show_accounts_ui (TpAccountManager *manager, TpAccount *account, + gboolean assistant, GCallback window_destroyed_cb); #endif /* __EMPATHY_ACCOUNTS_COMMON_H__ */ diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c index 165dd052f..3cad96744 100644 --- a/src/empathy-accounts.c +++ b/src/empathy-accounts.c @@ -55,6 +55,7 @@ static gboolean only_if_needed = FALSE; static gboolean hidden = FALSE; static gchar *selected_account_name = NULL; static gboolean account_manager_prepared = FALSE; +static gboolean assistant = FALSE; static void account_prepare_cb (GObject *source_object, @@ -73,7 +74,7 @@ account_prepare_cb (GObject *source_object, account = NULL; } - empathy_accounts_show_accounts_ui (manager, account, + empathy_accounts_show_accounts_ui (manager, account, assistant, G_CALLBACK (gtk_main_quit)); } @@ -84,7 +85,7 @@ maybe_show_accounts_ui (TpAccountManager *manager) (only_if_needed && empathy_accounts_has_non_salut_accounts (manager))) gtk_main_quit (); else - empathy_accounts_show_accounts_ui (manager, NULL, gtk_main_quit); + empathy_accounts_show_accounts_ui (manager, NULL, assistant, gtk_main_quit); } static void @@ -156,7 +157,7 @@ app_command_line_cb (GApplication *app, TpAccountManager *account_manager; account_manager = tp_account_manager_dup (); - empathy_accounts_show_accounts_ui (account_manager, NULL, + empathy_accounts_show_accounts_ui (account_manager, NULL, assistant, G_CALLBACK (gtk_main_quit)); g_object_unref (account_manager); @@ -191,6 +192,10 @@ local_cmdline (GApplication *app, N_("Initially select given account (eg, " "gabble/jabber/foo_40example_2eorg0)"), N_("") }, + { "assistant", 'a', + 0, G_OPTION_ARG_NONE, &assistant, + N_("Show account assistant"), + NULL }, { NULL } }; -- cgit v1.2.3