diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-08-19 05:36:52 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-08-19 05:36:52 +0800 |
commit | 30f2b4cfa51e63328cf3cbf76aa5b5b53b0dfde3 (patch) | |
tree | 12068fd727b37efbf27f527f9273e64f7e49468f /src | |
parent | 285850cfb9368eaf25cfc8373882aa721a222bbc (diff) | |
download | gsoc2013-empathy-30f2b4cfa51e63328cf3cbf76aa5b5b53b0dfde3.tar gsoc2013-empathy-30f2b4cfa51e63328cf3cbf76aa5b5b53b0dfde3.tar.gz gsoc2013-empathy-30f2b4cfa51e63328cf3cbf76aa5b5b53b0dfde3.tar.bz2 gsoc2013-empathy-30f2b4cfa51e63328cf3cbf76aa5b5b53b0dfde3.tar.lz gsoc2013-empathy-30f2b4cfa51e63328cf3cbf76aa5b5b53b0dfde3.tar.xz gsoc2013-empathy-30f2b4cfa51e63328cf3cbf76aa5b5b53b0dfde3.tar.zst gsoc2013-empathy-30f2b4cfa51e63328cf3cbf76aa5b5b53b0dfde3.zip |
When creating an account set its display name to "New Jabber account", when the account get completed change it to "Jabber (user@jabber.org)". Fixes
bug #546445.
svn path=/trunk/; revision=1348
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-accounts-dialog.c | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index a2a8c36dc..33d824c11 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -635,11 +635,41 @@ accounts_dialog_account_added_cb (McAccountMonitor *monitor, gchar *unique_name, EmpathyAccountsDialog *dialog) { - McAccount *account; + McAccount *account; + const gchar *current_name; + gchar *account_param = NULL; account = mc_account_lookup (unique_name); accounts_dialog_add_or_update_account (dialog, account); - g_object_unref (account); + + /* Change the display name to "%s (%s)" % (protocol, account). + * - The protocol is the display name of the profile. + * - The account should be the normalized name of the McAccount but + * it's not set until first connection, so we get the "account" + * parameter for CM that have it. */ + current_name = mc_account_get_display_name (account); + mc_account_get_param_string (account, "account", &account_param); + if (!G_STR_EMPTY (account_param)) { + McProfile *profile; + const gchar *profile_name; + gchar *new_name; + + profile = mc_account_get_profile (account); + profile_name = mc_profile_get_display_name (profile); + new_name = g_strdup_printf ("%s (%s)", profile_name, + account_param); + + DEBUG ("Setting new display name for account %s: '%s'", + unique_name, new_name); + + mc_account_set_display_name (account, new_name); + g_free (new_name); + g_object_unref (profile); + } else { + /* FIXME: This CM has no account parameter, what can be done? */ + } + g_free (account_param); + g_object_unref (account); } static void @@ -789,17 +819,20 @@ static void accounts_dialog_button_create_clicked_cb (GtkWidget *button, EmpathyAccountsDialog *dialog) { - McProfile *profile; - McAccount *account; - const gchar *str; + McProfile *profile; + McAccount *account; + gchar *str; McProfileCapabilityFlags cap; profile = empathy_profile_chooser_get_selected (dialog->combobox_profile); /* Create account */ account = mc_account_create (profile); - str = mc_account_get_unique_name (account); + /* To translator: %s is the protocol name */ + str = g_strdup_printf (_("New %s account"), + mc_profile_get_display_name (profile)); mc_account_set_display_name (account, str); + g_free (str); cap = mc_profile_get_capabilities (profile); if (cap & MC_PROFILE_CAPABILITY_REGISTRATION_UI) { |