comparison pidgin/gtkprefs.c @ 28929:be170630d071

Move the status icon and blist theme comboboxes to the Themes tab. This looks ridiculously ugly thus far.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Wed, 11 Nov 2009 16:14:34 +0000
parents 7cf246c9a863
children c967e6d63da9
comparison
equal deleted inserted replaced
28928:7cf246c9a863 28929:be170630d071
1102 1102
1103 g_free(theme_file); 1103 g_free(theme_file);
1104 g_free(theme_name); 1104 g_free(theme_name);
1105 } 1105 }
1106 1106
1107 /* sets the current buddy list theme */
1108 static void
1109 prefs_set_blist_theme_cb(GtkComboBox *combo_box, gpointer user_data)
1110 {
1111 PidginBlistTheme *theme = NULL;
1112 GtkTreeIter iter;
1113 gchar *name = NULL;
1114
1115 if(gtk_combo_box_get_active_iter(combo_box, &iter)) {
1116
1117 gtk_tree_model_get(GTK_TREE_MODEL(prefs_blist_themes), &iter, 2, &name, -1);
1118
1119 if(!name || !g_str_equal(name, ""))
1120 theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(name, "blist"));
1121
1122 g_free(name);
1123
1124 pidgin_blist_set_theme(theme);
1125 }
1126 }
1127
1128 /* sets the current icon theme */
1129 static void
1130 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data)
1131 {
1132 PidginStatusIconTheme *theme = NULL;
1133 GtkTreeIter iter;
1134 gchar *name = NULL;
1135
1136 if(gtk_combo_box_get_active_iter(combo_box, &iter)) {
1137
1138 gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1);
1139
1140 if(!name || !g_str_equal(name, ""))
1141 theme = PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(name, "status-icon"));
1142
1143 g_free(name);
1144
1145 pidgin_stock_load_status_icon_theme(theme);
1146 pidgin_blist_refresh(purple_get_blist());
1147 }
1148 }
1149
1107 static GtkWidget * 1150 static GtkWidget *
1108 theme_page(void) 1151 theme_page(void)
1109 { 1152 {
1110 GtkWidget *add_button, *remove_button; 1153 GtkWidget *add_button, *remove_button;
1111 GtkWidget *hbox_buttons; 1154 GtkWidget *hbox_buttons;
1121 GtkTargetEntry te[3] = { 1164 GtkTargetEntry te[3] = {
1122 {"text/plain", 0, 0}, 1165 {"text/plain", 0, 0},
1123 {"text/uri-list", 0, 1}, 1166 {"text/uri-list", 0, 1},
1124 {"STRING", 0, 2} 1167 {"STRING", 0, 2}
1125 }; 1168 };
1169 GtkWidget *themesel_hbox;
1126 1170
1127 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); 1171 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
1128 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); 1172 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
1129 1173
1174 /* Buddy List Themes */
1175 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1176
1177 label = gtk_label_new(_("Buddy List Theme:"));
1178 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
1179
1180 prefs_blist_themes_combo_box = prefs_build_theme_combo_box(prefs_blist_themes,
1181 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"),
1182 "blist");
1183
1184 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_blist_themes_combo_box, FALSE, FALSE, 0);
1185 g_signal_connect(G_OBJECT(prefs_blist_themes_combo_box), "changed", (GCallback)prefs_set_blist_theme_cb, NULL);
1186
1187 gtk_box_pack_start(GTK_BOX(ret), themesel_hbox, FALSE, FALSE, 0);
1188
1189 /* Status Icon Themes */
1190 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1191
1192 label = gtk_label_new(_("Status Icon Theme:"));
1193 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
1194
1195 prefs_status_themes_combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes,
1196 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"),
1197 "icon");
1198
1199 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_status_themes_combo_box, FALSE, FALSE, 0);
1200 g_signal_connect(G_OBJECT(prefs_status_themes_combo_box), "changed", (GCallback)prefs_set_status_icon_theme_cb, NULL);
1201
1202 gtk_box_pack_start(GTK_BOX(ret), themesel_hbox, FALSE, FALSE, 0);
1203
1204 /* Smiley Themes */
1130 label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below." 1205 label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below."
1131 " New themes can be installed by dragging and dropping them onto the theme list.")); 1206 " New themes can be installed by dragging and dropping them onto the theme list."));
1132 1207
1133 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); 1208 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
1134 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 1209 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
1405 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0); 1480 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0);
1406 1481
1407 gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0); 1482 gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0);
1408 } 1483 }
1409 1484
1410 /* sets the current buddy list theme */
1411 static void
1412 prefs_set_blist_theme_cb(GtkComboBox *combo_box, gpointer user_data)
1413 {
1414 PidginBlistTheme *theme = NULL;
1415 GtkTreeIter iter;
1416 gchar *name = NULL;
1417
1418 if(gtk_combo_box_get_active_iter(combo_box, &iter)) {
1419
1420 gtk_tree_model_get(GTK_TREE_MODEL(prefs_blist_themes), &iter, 2, &name, -1);
1421
1422 if(!name || !g_str_equal(name, ""))
1423 theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(name, "blist"));
1424
1425 g_free(name);
1426
1427 pidgin_blist_set_theme(theme);
1428 }
1429 }
1430
1431 /* sets the current icon theme */
1432 static void
1433 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data)
1434 {
1435 PidginStatusIconTheme *theme = NULL;
1436 GtkTreeIter iter;
1437 gchar *name = NULL;
1438
1439 if(gtk_combo_box_get_active_iter(combo_box, &iter)) {
1440
1441 gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1);
1442
1443 if(!name || !g_str_equal(name, ""))
1444 theme = PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(name, "status-icon"));
1445
1446 g_free(name);
1447
1448 pidgin_stock_load_status_icon_theme(theme);
1449 pidgin_blist_refresh(purple_get_blist());
1450 }
1451 }
1452
1453 static GtkWidget * 1485 static GtkWidget *
1454 interface_page(void) 1486 interface_page(void)
1455 { 1487 {
1456 GtkWidget *ret; 1488 GtkWidget *ret;
1457 GtkWidget *vbox; 1489 GtkWidget *vbox;
1462 1494
1463 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); 1495 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
1464 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); 1496 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
1465 1497
1466 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 1498 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1467
1468 /* Buddy List Themes */
1469 vbox = pidgin_make_frame(ret, _("Buddy List Theme"));
1470
1471 prefs_blist_themes_combo_box = prefs_build_theme_combo_box(prefs_blist_themes,
1472 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"),
1473 "blist");
1474
1475 gtk_box_pack_start(GTK_BOX (vbox), prefs_blist_themes_combo_box, FALSE, FALSE, 0);
1476 g_signal_connect(G_OBJECT(prefs_blist_themes_combo_box), "changed", (GCallback)prefs_set_blist_theme_cb, NULL);
1477
1478 /* Status Icon Themes */
1479 prefs_status_themes_combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes,
1480 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"),
1481 "icon");
1482
1483 gtk_box_pack_start(GTK_BOX (vbox), prefs_status_themes_combo_box, FALSE, FALSE, 0);
1484 g_signal_connect(G_OBJECT(prefs_status_themes_combo_box), "changed", (GCallback)prefs_set_status_icon_theme_cb, NULL);
1485 1499
1486 /* System Tray */ 1500 /* System Tray */
1487 vbox = pidgin_make_frame(ret, _("System Tray Icon")); 1501 vbox = pidgin_make_frame(ret, _("System Tray Icon"));
1488 label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING, 1502 label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING,
1489 PIDGIN_PREFS_ROOT "/docklet/show", 1503 PIDGIN_PREFS_ROOT "/docklet/show",