comparison pidgin/gtkprefs.c @ 26132:ae3d25465d0f

Run an asynchronous DNS lookup for the STUN server IP (to set as a property to the nice transmitter for media). Also update the IP when the preference changes and when NetworkManager support is present, when NM reports connected. TODO: add code to run DNS lookup on Win32 when the network connection is ready
author Marcus Lundblad <ml@update.uu.se>
date Sat, 17 Jan 2009 01:38:44 +0000
parents ade5b2c51047
children c56e8826fed0
comparison
equal deleted inserted replaced
26131:6eeb500ce9a2 26132:ae3d25465d0f
1140 * and a green background when the IP address is valid. 1140 * and a green background when the IP address is valid.
1141 */ 1141 */
1142 purple_network_set_public_ip(gtk_entry_get_text(entry)); 1142 purple_network_set_public_ip(gtk_entry_get_text(entry));
1143 } 1143 }
1144 1144
1145 static gboolean network_stun_server_changed_cb(GtkWidget *widget,
1146 GdkEventFocus *event, gpointer data)
1147 {
1148 GtkEntry *entry = GTK_ENTRY(widget);
1149 purple_prefs_set_string("/purple/network/stun_server",
1150 gtk_entry_get_text(entry));
1151 purple_network_set_stun_server(gtk_entry_get_text(entry));
1152
1153 return FALSE;
1154 }
1155
1145 static void 1156 static void
1146 proxy_changed_cb(const char *name, PurplePrefType type, 1157 proxy_changed_cb(const char *name, PurplePrefType type,
1147 gconstpointer value, gpointer data) 1158 gconstpointer value, gpointer data)
1148 { 1159 {
1149 GtkWidget *frame = data; 1160 GtkWidget *frame = data;
1204 1215
1205 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); 1216 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
1206 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); 1217 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
1207 1218
1208 vbox = pidgin_make_frame (ret, _("IP Address")); 1219 vbox = pidgin_make_frame (ret, _("IP Address"));
1220
1221 table = gtk_table_new(2, 2, FALSE);
1222 gtk_container_set_border_width(GTK_CONTAINER(table), 0);
1223 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
1224 gtk_table_set_row_spacings(GTK_TABLE(table), 10);
1225 gtk_container_add(GTK_CONTAINER(vbox), table);
1226
1209 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 1227 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1210 pidgin_prefs_labeled_entry(vbox,_("ST_UN server:"), 1228 label = gtk_label_new_with_mnemonic(_("ST_UN server:"));
1211 "/purple/network/stun_server", sg); 1229 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
1212 1230 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
1231 gtk_size_group_add_widget(sg, label);
1232
1233 entry = gtk_entry_new();
1234 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
1235 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
1236 g_signal_connect(G_OBJECT(entry), "focus-out-event",
1237 G_CALLBACK(network_stun_server_changed_cb), NULL);
1238 gtk_entry_set_text(GTK_ENTRY(entry),
1239 purple_prefs_get_string("/purple/network/stun_server"));
1240
1213 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1241 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1214 gtk_container_add(GTK_CONTAINER(vbox), hbox); 1242 gtk_container_add(GTK_CONTAINER(vbox), hbox);
1215 1243
1216 label = gtk_label_new(NULL); 1244 label = gtk_label_new(NULL);
1217 gtk_container_add(GTK_CONTAINER(hbox), label); 1245 gtk_container_add(GTK_CONTAINER(hbox), label);