Mercurial > pidgin
comparison pidgin/gtkaccount.c @ 32702:381033b07bb1
Remove and replace the Default Domain UI hack.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Thu, 29 Dec 2011 01:43:31 +0000 |
parents | 59b0cf585038 |
children | b43b8b93ea28 |
comparison
equal
deleted
inserted
replaced
32701:498ededa58cb | 32702:381033b07bb1 |
---|---|
164 static void add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent); | 164 static void add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
165 static void add_protocol_options(AccountPrefsDialog *dialog); | 165 static void add_protocol_options(AccountPrefsDialog *dialog); |
166 static void add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent); | 166 static void add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
167 static void add_voice_options(AccountPrefsDialog *dialog); | 167 static void add_voice_options(AccountPrefsDialog *dialog); |
168 | 168 |
169 static const char * | |
170 google_talk_default_domain_hackery(GtkWidget *protocol_combo, const char *value_if_gtalk) | |
171 { | |
172 GtkTreeModel *model; | |
173 GtkTreeIter iter; | |
174 const char *value = NULL; | |
175 | |
176 model = gtk_combo_box_get_model(GTK_COMBO_BOX(protocol_combo)); | |
177 if (model != NULL && gtk_combo_box_get_active_iter(GTK_COMBO_BOX(protocol_combo), &iter)) { | |
178 char *protocol = NULL; | |
179 | |
180 /* protocol is not stored as G_TYPE_STRING in the model so no g_free necessary */ | |
181 gtk_tree_model_get(model, &iter, 2, &protocol, -1); | |
182 if (protocol && !strcmp("prpl-jabber", protocol)) { | |
183 char *item_name = NULL; | |
184 | |
185 gtk_tree_model_get(model, &iter, 1, &item_name, -1); | |
186 if (item_name) { | |
187 if (!strcmp(item_name, _("Google Talk"))) | |
188 value = value_if_gtalk; | |
189 g_free(item_name); | |
190 } | |
191 /* If it's not GTalk, but still Jabber then the value is not NULL, it's empty */ | |
192 if (NULL == value) | |
193 value = ""; | |
194 } | |
195 } | |
196 | |
197 return value; | |
198 } | |
199 | |
200 static GtkWidget * | 169 static GtkWidget * |
201 add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent, | 170 add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent, |
202 const char *text, GtkWidget *widget) | 171 const char *text, GtkWidget *widget) |
203 { | 172 { |
204 return pidgin_add_widget_to_vbox(GTK_BOX(parent), text, dialog->sg, widget, TRUE, NULL); | 173 return pidgin_add_widget_to_vbox(GTK_BOX(parent), text, dialog->sg, widget, TRUE, NULL); |
588 value = c; | 557 value = c; |
589 } | 558 } |
590 } | 559 } |
591 if (value == NULL) | 560 if (value == NULL) |
592 value = purple_account_user_split_get_default_value(split); | 561 value = purple_account_user_split_get_default_value(split); |
593 | |
594 /* Google Talk default domain hackery! */ | |
595 if (!strcmp(_("Domain"), purple_account_user_split_get_text(split)) && !value) | |
596 value = google_talk_default_domain_hackery(dialog->protocol_menu, "gmail.com"); | |
597 | 562 |
598 if (value != NULL) | 563 if (value != NULL) |
599 gtk_entry_set_text(GTK_ENTRY(entry), value); | 564 gtk_entry_set_text(GTK_ENTRY(entry), value); |
600 } | 565 } |
601 | 566 |