Mercurial > pidgin.yaz
comparison pidgin/gtkprefs.c @ 23697:0bbfb20bad19
Clean up status icon themes a bit
author | Justin Rodriguez <ffdragon@soc.pidgin.im> |
---|---|
date | Fri, 08 Aug 2008 20:47:15 +0000 |
parents | 2d419a0fc0e4 |
children | 2d436084d866 |
comparison
equal
deleted
inserted
replaced
23696:2753d96ed2bb | 23697:0bbfb20bad19 |
---|---|
42 | 42 |
43 #include "gtkblist.h" | 43 #include "gtkblist.h" |
44 #include "gtkconv.h" | 44 #include "gtkconv.h" |
45 #include "gtkdebug.h" | 45 #include "gtkdebug.h" |
46 #include "gtkdialogs.h" | 46 #include "gtkdialogs.h" |
47 #include "gtkicon-theme.h" | |
48 #include "gtkimhtml.h" | 47 #include "gtkimhtml.h" |
49 #include "gtkimhtmltoolbar.h" | 48 #include "gtkimhtmltoolbar.h" |
50 #include "gtkprefs.h" | 49 #include "gtkprefs.h" |
51 #include "gtksavedstatuses.h" | 50 #include "gtksavedstatuses.h" |
52 #include "gtksound.h" | 51 #include "gtksound.h" |
52 #include "gtkstatus-icon-theme.h" | |
53 #include "gtkthemes.h" | 53 #include "gtkthemes.h" |
54 #include "gtkutils.h" | 54 #include "gtkutils.h" |
55 #include "pidginstock.h" | 55 #include "pidginstock.h" |
56 | 56 |
57 #define PROXYHOST 0 | 57 #define PROXYHOST 0 |
612 if (image_full != NULL){ | 612 if (image_full != NULL){ |
613 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); | 613 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
614 g_free(image_full); | 614 g_free(image_full); |
615 } else pixbuf = NULL; | 615 } else pixbuf = NULL; |
616 | 616 |
617 gtk_list_store_append (prefs_sound_themes, &iter); | 617 gtk_list_store_append(prefs_sound_themes, &iter); |
618 gtk_list_store_set (prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1); | 618 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1); |
619 | 619 |
620 if (pixbuf != NULL) | 620 if (pixbuf != NULL) |
621 gdk_pixbuf_unref(pixbuf); | 621 gdk_pixbuf_unref(pixbuf); |
622 | 622 |
623 } else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_ICON_THEME(theme)){ | 623 } else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_STATUS_ICON_THEME(theme)){ |
624 GtkListStore *store; | 624 GtkListStore *store; |
625 | 625 |
626 if (PIDGIN_IS_BLIST_THEME(theme)) | 626 if (PIDGIN_IS_BLIST_THEME(theme)) |
627 store = prefs_blist_themes; | 627 store = prefs_blist_themes; |
628 else store = prefs_status_icon_themes; | 628 else store = prefs_status_icon_themes; |
638 description = purple_theme_get_description(theme); | 638 description = purple_theme_get_description(theme); |
639 | 639 |
640 markup = g_strdup_printf("<b>%s</b>%s%s\n<span foreground='dim grey'>%s</span>", name, author != NULL ? " - " : "", | 640 markup = g_strdup_printf("<b>%s</b>%s%s\n<span foreground='dim grey'>%s</span>", name, author != NULL ? " - " : "", |
641 author != NULL ? author : "", description != NULL ? description : ""); | 641 author != NULL ? author : "", description != NULL ? description : ""); |
642 | 642 |
643 gtk_list_store_append (store, &iter); | 643 gtk_list_store_append(store, &iter); |
644 gtk_list_store_set (store, &iter, 0, pixbuf, 1, markup, 2, name, -1); | 644 gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1); |
645 | 645 |
646 g_free(markup); | 646 g_free(markup); |
647 if (pixbuf != NULL) | 647 if (pixbuf != NULL) |
648 gdk_pixbuf_unref(pixbuf); | 648 gdk_pixbuf_unref(pixbuf); |
649 } | 649 } |
1150 | 1150 |
1151 /* sets the current icon theme */ | 1151 /* sets the current icon theme */ |
1152 static void | 1152 static void |
1153 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) | 1153 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
1154 { | 1154 { |
1155 PidginIconTheme *theme; | 1155 PidginStatusIconTheme *theme; |
1156 GtkTreeIter iter; | 1156 GtkTreeIter iter; |
1157 gchar *name = NULL; | 1157 gchar *name = NULL; |
1158 | 1158 |
1159 g_return_if_fail(gtk_combo_box_get_active_iter(combo_box, &iter)); | 1159 g_return_if_fail(gtk_combo_box_get_active_iter(combo_box, &iter)); |
1160 gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1); | 1160 gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1); |
1161 | 1161 |
1162 theme = PIDGIN_ICON_THEME(purple_theme_manager_find_theme(name, "icon")); | 1162 theme = PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(name, "status-icon")); |
1163 g_free(name); | 1163 g_free(name); |
1164 | 1164 |
1165 pidgin_stock_load_status_icon_theme(theme); | 1165 pidgin_stock_load_status_icon_theme(theme); |
1166 } | 1166 } |
1167 | 1167 |
1187 combo_box = prefs_build_theme_combo_box(prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); | 1187 combo_box = prefs_build_theme_combo_box(prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); |
1188 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); | 1188 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); |
1189 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_blist_theme_cb, NULL); | 1189 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_blist_theme_cb, NULL); |
1190 | 1190 |
1191 /* Status Icon Themes */ | 1191 /* Status Icon Themes */ |
1192 combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/icon/theme")); | 1192 combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/icon/status/theme")); |
1193 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); | 1193 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); |
1194 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_status_icon_theme_cb, NULL); | 1194 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_status_icon_theme_cb, NULL); |
1195 | 1195 |
1196 /* System Tray */ | 1196 /* System Tray */ |
1197 vbox = pidgin_make_frame(ret, _("System Tray Icon")); | 1197 vbox = pidgin_make_frame(ret, _("System Tray Icon")); |