diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2009-08-28 20:42:42 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-08-31 23:40:15 +0800 |
commit | 75d28a9ddb083210eddf98e40b420c366fc1d805 (patch) | |
tree | 66de50bfe0650dcfdc7608f9ca952c36bf86139e /src | |
parent | 2a59b87c17d5bc66a72d3509247a3e2650559a67 (diff) | |
download | gsoc2013-empathy-75d28a9ddb083210eddf98e40b420c366fc1d805.tar gsoc2013-empathy-75d28a9ddb083210eddf98e40b420c366fc1d805.tar.gz gsoc2013-empathy-75d28a9ddb083210eddf98e40b420c366fc1d805.tar.bz2 gsoc2013-empathy-75d28a9ddb083210eddf98e40b420c366fc1d805.tar.lz gsoc2013-empathy-75d28a9ddb083210eddf98e40b420c366fc1d805.tar.xz gsoc2013-empathy-75d28a9ddb083210eddf98e40b420c366fc1d805.tar.zst gsoc2013-empathy-75d28a9ddb083210eddf98e40b420c366fc1d805.zip |
Use the new APIs in the assistant and the dialog
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-account-assistant.c | 10 | ||||
-rw-r--r-- | src/empathy-accounts-dialog.c | 25 |
2 files changed, 25 insertions, 10 deletions
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c index c8379ae02..9c55b3654 100644 --- a/src/empathy-account-assistant.c +++ b/src/empathy-account-assistant.c @@ -305,11 +305,12 @@ account_assistant_protocol_changed_cb (GtkComboBox *chooser, char *str; GtkWidget *account_widget; EmpathyAccountWidget *widget_object = NULL; + gboolean is_gtalk; priv = GET_PRIV (self); cm = empathy_protocol_chooser_dup_selected ( - EMPATHY_PROTOCOL_CHOOSER (chooser), &proto); + EMPATHY_PROTOCOL_CHOOSER (chooser), &proto, &is_gtalk); if (cm == NULL || proto == NULL) /* we are not ready yet */ @@ -317,10 +318,15 @@ account_assistant_protocol_changed_cb (GtkComboBox *chooser, /* Create account */ /* To translator: %s is the protocol name */ - str = g_strdup_printf (_("New %s account"), proto->name); + str = g_strdup_printf (_("New %s account"), + empathy_protocol_name_to_display_name ( + is_gtalk ? "gtalk" : proto->name)); settings = empathy_account_settings_new (cm->name, proto->name, str); + empathy_account_settings_set_icon_name_async (settings, "im-google-talk", + NULL, NULL); + if (priv->first_resp == RESPONSE_CREATE_ACCOUNT) empathy_account_settings_set_boolean (settings, "register", TRUE); diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index a00c1b5eb..f7d6fa263 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -170,7 +170,8 @@ accounts_dialog_update_name_label (EmpathyAccountsDialog *dialog, } static void -empathy_account_dialog_widget_cancelled_cb (EmpathyAccountWidget *widget_object, +empathy_account_dialog_widget_cancelled_cb ( + EmpathyAccountWidget *widget_object, EmpathyAccountsDialog *dialog) { GtkTreeView *view; @@ -369,10 +370,11 @@ accounts_dialog_protocol_changed_cb (GtkWidget *widget, { TpConnectionManager *cm; TpConnectionManagerProtocol *proto; + gboolean is_gtalk; EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); cm = empathy_protocol_chooser_dup_selected ( - EMPATHY_PROTOCOL_CHOOSER (priv->combobox_protocol), &proto); + EMPATHY_PROTOCOL_CHOOSER (priv->combobox_protocol), &proto, &is_gtalk); if (cm == NULL) return; @@ -383,7 +385,7 @@ accounts_dialog_protocol_changed_cb (GtkWidget *widget, return; } - if (tp_connection_manager_protocol_can_register (proto)) + if (tp_connection_manager_protocol_can_register (proto) && !is_gtalk) { gtk_widget_show (priv->radiobutton_register); gtk_widget_show (priv->radiobutton_reuse); @@ -1222,11 +1224,11 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog, name = empathy_account_get_display_name (account); enabled = empathy_account_is_enabled (account); + settings = empathy_account_settings_new_for_account (account); + if (!accounts_dialog_get_account_iter (dialog, account, &iter)) gtk_list_store_append (GTK_LIST_STORE (model), &iter); - settings = empathy_account_settings_new_for_account (account); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_NAME, name, COL_STATUS, status, @@ -1379,10 +1381,13 @@ accounts_dialog_button_create_clicked_cb (GtkWidget *button, TpConnectionManager *cm; TpConnectionManagerProtocol *proto; EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); + gboolean is_gtalk; cm = empathy_protocol_chooser_dup_selected ( - EMPATHY_PROTOCOL_CHOOSER (priv->combobox_protocol), &proto); - display_name = empathy_protocol_name_to_display_name (proto->name); + EMPATHY_PROTOCOL_CHOOSER (priv->combobox_protocol), &proto, &is_gtalk); + + display_name = empathy_protocol_name_to_display_name ( + is_gtalk ? "gtalk" : proto->name); if (display_name == NULL) display_name = proto->name; @@ -1401,11 +1406,15 @@ accounts_dialog_button_create_clicked_cb (GtkWidget *button, gboolean active; active = gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (priv->radiobutton_register)); + (GTK_TOGGLE_BUTTON (priv->radiobutton_register)); if (active) empathy_account_settings_set_boolean (settings, "register", TRUE); } + if (is_gtalk) + empathy_account_settings_set_icon_name_async (settings, "im-google-talk", + NULL, NULL); + accounts_dialog_add (dialog, settings); accounts_dialog_model_set_selected (dialog, settings); |