| 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); |