comparison src/gtkprefs.c @ 6007:3750fc0325ac

[gaim-migrate @ 6455] Get rid of some unneeded global vars in gtkprefs.c. "We're making things less global and more personal, one step at a time." committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 03 Jul 2003 22:46:14 +0000
parents 0aeb4fd0fc65
children 1e4a574bb46d
comparison
equal deleted inserted replaced
6006:0aeb4fd0fc65 6007:3750fc0325ac
64 static GtkWidget *prefsnotebook; 64 static GtkWidget *prefsnotebook;
65 static GtkTreeStore *prefstree; 65 static GtkTreeStore *prefstree;
66 66
67 67
68 static GtkWidget *sounddialog = NULL; 68 static GtkWidget *sounddialog = NULL;
69 static GtkWidget *browser_entry = NULL;
70 static GtkWidget *sound_entry = NULL; 69 static GtkWidget *sound_entry = NULL;
71 static GtkWidget *away_text = NULL; 70 static GtkWidget *away_text = NULL;
72 static GtkListStore *smiley_theme_store = NULL; 71 static GtkListStore *smiley_theme_store = NULL;
73 static GtkWidget *prefs_proxy_frame = NULL; 72 static GtkWidget *prefs_proxy_frame = NULL;
74 73
319 gaim_plugins_unregister_probe_notify_cb(update_plugin_list); 318 gaim_plugins_unregister_probe_notify_cb(update_plugin_list);
320 319
321 prefs = NULL; 320 prefs = NULL;
322 tree_v = NULL; 321 tree_v = NULL;
323 sound_entry = NULL; 322 sound_entry = NULL;
324 browser_entry = NULL;
325 debugbutton = NULL; 323 debugbutton = NULL;
326 prefs_away_menu = NULL; 324 prefs_away_menu = NULL;
327 notebook_page = 0; 325 notebook_page = 0;
328 smiley_theme_store = NULL; 326 smiley_theme_store = NULL;
329 if(sounddialog) 327 if(sounddialog)
1266 GtkWidget *browser_page() { 1264 GtkWidget *browser_page() {
1267 GtkWidget *ret; 1265 GtkWidget *ret;
1268 GtkWidget *vbox; 1266 GtkWidget *vbox;
1269 GtkWidget *hbox; 1267 GtkWidget *hbox;
1270 GtkWidget *label; 1268 GtkWidget *label;
1269 GtkWidget *entry;
1271 GtkSizeGroup *sg; 1270 GtkSizeGroup *sg;
1272 GList *browsers = NULL; 1271 GList *browsers = NULL;
1273 1272
1274 ret = gtk_vbox_new(FALSE, 18); 1273 ret = gtk_vbox_new(FALSE, 18);
1275 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); 1274 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
1277 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 1276 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1278 vbox = gaim_gtk_make_frame (ret, _("Browser Selection")); 1277 vbox = gaim_gtk_make_frame (ret, _("Browser Selection"));
1279 1278
1280 browsers = get_available_browsers(); 1279 browsers = get_available_browsers();
1281 if (browsers != NULL) { 1280 if (browsers != NULL) {
1282 label = prefs_dropdown_from_list(vbox,_("_Browser"), GAIM_PREF_STRING, 1281 label = prefs_dropdown_from_list(vbox,_("_Browser:"), GAIM_PREF_STRING,
1283 "/gaim/gtk/browsers/browser", 1282 "/gaim/gtk/browsers/browser",
1284 browsers); 1283 browsers);
1285 1284
1286 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 1285 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
1287 gtk_size_group_add_widget(sg, label); 1286 gtk_size_group_add_widget(sg, label);
1292 label = gtk_label_new_with_mnemonic(_("_Manual: ")); 1291 label = gtk_label_new_with_mnemonic(_("_Manual: "));
1293 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); 1292 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
1294 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 1293 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
1295 gtk_size_group_add_widget(sg, label); 1294 gtk_size_group_add_widget(sg, label);
1296 1295
1297 browser_entry = gtk_entry_new(); 1296 entry = gtk_entry_new();
1298 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); 1297 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
1299 1298
1300 if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) 1299 if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom"))
1301 gtk_widget_set_sensitive(hbox, FALSE); 1300 gtk_widget_set_sensitive(hbox, FALSE);
1302 browser_pref_id = gaim_prefs_connect_callback("/gaim/gtk/browsers/browser", 1301 browser_pref_id = gaim_prefs_connect_callback("/gaim/gtk/browsers/browser",
1303 browser_changed_cb, hbox); 1302 browser_changed_cb, hbox);
1304 1303
1305 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); 1304 gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
1306 1305
1307 gtk_entry_set_text(GTK_ENTRY(browser_entry), 1306 gtk_entry_set_text(GTK_ENTRY(entry),
1308 gaim_prefs_get_string("/gaim/gtk/browsers/command")); 1307 gaim_prefs_get_string("/gaim/gtk/browsers/command"));
1309 g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", 1308 g_signal_connect(G_OBJECT(entry), "focus-out-event",
1310 G_CALLBACK(manual_browser_set), NULL); 1309 G_CALLBACK(manual_browser_set), NULL);
1311 1310
1312 if (browsers != NULL) { 1311 if (browsers != NULL) {
1313 vbox = gaim_gtk_make_frame (ret, _("Browser Options")); 1312 vbox = gaim_gtk_make_frame (ret, _("Browser Options"));
1314 label = prefs_checkbox(_("Open new _window by default"), 1313 label = prefs_checkbox(_("Open new _window by default"),
1348 1347
1349 gtk_widget_show_all(ret); 1348 gtk_widget_show_all(ret);
1350 return ret; 1349 return ret;
1351 } 1350 }
1352 1351
1353 static GtkWidget *sndcmd = NULL;
1354
1355 #ifndef _WIN32 1352 #ifndef _WIN32
1356 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) 1353 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d)
1357 { 1354 {
1358 gaim_prefs_set_string("/gaim/gtk/sound/command", 1355 gaim_prefs_set_string("/gaim/gtk/sound/command",
1359 gtk_entry_get_text(GTK_ENTRY(sndcmd))); 1356 gtk_entry_get_text(GTK_ENTRY(entry)));
1360 return TRUE; 1357 return TRUE;
1361 } 1358 }
1362 1359
1363 static void 1360 static void
1364 sound_changed_cb(const char *name, GaimPrefType type, gpointer value, 1361 sound_changed_cb(const char *name, GaimPrefType type, gpointer value,
1377 GtkSizeGroup *sg; 1374 GtkSizeGroup *sg;
1378 #ifndef _WIN32 1375 #ifndef _WIN32
1379 GtkWidget *dd; 1376 GtkWidget *dd;
1380 GtkWidget *hbox; 1377 GtkWidget *hbox;
1381 GtkWidget *label; 1378 GtkWidget *label;
1379 GtkWidget *entry;
1382 const char *cmd; 1380 const char *cmd;
1383 #endif 1381 #endif
1384 1382
1385 ret = gtk_vbox_new(FALSE, 18); 1383 ret = gtk_vbox_new(FALSE, 18);
1386 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); 1384 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
1419 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); 1417 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)"));
1420 gtk_size_group_add_widget(sg, label); 1418 gtk_size_group_add_widget(sg, label);
1421 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 1419 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
1422 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); 1420 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
1423 1421
1424 sndcmd = gtk_entry_new(); 1422 entry = gtk_entry_new();
1425 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); 1423 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
1426 1424
1427 gtk_editable_set_editable(GTK_EDITABLE(sndcmd), TRUE); 1425 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
1428 cmd = gaim_prefs_get_string("/gaim/gtk/sound/command"); 1426 cmd = gaim_prefs_get_string("/gaim/gtk/sound/command");
1429 if(cmd) 1427 if(cmd)
1430 gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd); 1428 gtk_entry_set_text(GTK_ENTRY(entry), cmd);
1431 gtk_widget_set_size_request(sndcmd, 75, -1); 1429 gtk_widget_set_size_request(entry, 75, -1);
1432 1430
1433 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); 1431 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 5);
1434 g_signal_connect(G_OBJECT(sndcmd), "changed", 1432 g_signal_connect(G_OBJECT(entry), "changed",
1435 G_CALLBACK(sound_cmd_yeah), NULL); 1433 G_CALLBACK(sound_cmd_yeah), NULL);
1436 1434
1437 gtk_widget_set_sensitive(hbox, 1435 gtk_widget_set_sensitive(hbox,
1438 !strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), 1436 !strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"),
1439 "custom")); 1437 "custom"));