comparison pidgin/gtkprefs.c @ 30909:25e200cb3532

propagate from branch 'im.pidgin.pidgin' (head dca20e09164518b0f7a773edd7e9649f41d8873d) to branch 'im.pidgin.cpw.malu.xmpp.google_refactor' (head 7823c556f2d1bbca43f5ef9f0fea30cabc5d313f)
author Marcus Lundblad <ml@update.uu.se>
date Tue, 31 Aug 2010 18:28:10 +0000
parents 195d034b6cfe
children 0dc6c4be763d
comparison
equal deleted inserted replaced
30908:c44ec533a48c 30909:25e200cb3532
1040 pidgin_blist_refresh(purple_get_blist()); 1040 pidgin_blist_refresh(purple_get_blist());
1041 } 1041 }
1042 } 1042 }
1043 1043
1044 static GtkWidget * 1044 static GtkWidget *
1045 add_theme_prefs_combo(GtkWidget *vbox,
1046 GtkSizeGroup *combo_sg, GtkSizeGroup *label_sg,
1047 GtkListStore *theme_store,
1048 GCallback combo_box_cb, gpointer combo_box_cb_user_data,
1049 const char *label_str, const char *prefs_path,
1050 const char *theme_type)
1051 {
1052 GtkWidget *label;
1053 GtkWidget *combo_box = NULL;
1054 GtkWidget *themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1055
1056 label = gtk_label_new(label_str);
1057 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
1058 gtk_size_group_add_widget(label_sg, label);
1059 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
1060
1061 combo_box = prefs_build_theme_combo_box(theme_store,
1062 purple_prefs_get_string(prefs_path),
1063 theme_type);
1064 g_signal_connect(G_OBJECT(combo_box), "changed",
1065 (GCallback)combo_box_cb, combo_box_cb_user_data);
1066 gtk_size_group_add_widget(combo_sg, combo_box);
1067 gtk_box_pack_start(GTK_BOX(themesel_hbox), combo_box, TRUE, TRUE, 0);
1068
1069 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1070
1071 return combo_box;
1072 }
1073
1074 static GtkWidget *
1045 theme_page(void) 1075 theme_page(void)
1046 { 1076 {
1077 GtkWidget *label;
1047 GtkWidget *ret, *vbox; 1078 GtkWidget *ret, *vbox;
1048 GtkWidget *label;
1049 GtkWidget *themesel_hbox;
1050 GtkSizeGroup *label_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 1079 GtkSizeGroup *label_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1051 GtkSizeGroup *combo_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 1080 GtkSizeGroup *combo_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1052 1081
1053 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); 1082 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
1054 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); 1083 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
1065 1094
1066 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 0); 1095 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 0);
1067 gtk_widget_show(label); 1096 gtk_widget_show(label);
1068 1097
1069 /* Buddy List Themes */ 1098 /* Buddy List Themes */
1070 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1099 prefs_blist_themes_combo_box = add_theme_prefs_combo(
1071 1100 vbox, combo_sg, label_sg, prefs_blist_themes,
1072 label = gtk_label_new(_("Buddy List Theme:")); 1101 (GCallback)prefs_set_blist_theme_cb, NULL,
1073 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 1102 _("Buddy List Theme:"), PIDGIN_PREFS_ROOT "/blist/theme", "blist");
1074 gtk_size_group_add_widget(label_sg, label);
1075 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
1076
1077 prefs_blist_themes_combo_box = prefs_build_theme_combo_box(prefs_blist_themes,
1078 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"),
1079 "blist");
1080 g_signal_connect(G_OBJECT(prefs_blist_themes_combo_box), "changed",
1081 (GCallback)prefs_set_blist_theme_cb, NULL);
1082 gtk_size_group_add_widget(combo_sg, prefs_blist_themes_combo_box);
1083 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_blist_themes_combo_box, TRUE, TRUE, 0);
1084
1085 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1086 1103
1087 /* Status Icon Themes */ 1104 /* Status Icon Themes */
1088 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1105 prefs_status_themes_combo_box = add_theme_prefs_combo(
1089 1106 vbox, combo_sg, label_sg, prefs_status_icon_themes,
1090 label = gtk_label_new(_("Status Icon Theme:")); 1107 (GCallback)prefs_set_status_icon_theme_cb, NULL,
1091 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 1108 _("Status Icon Theme:"), PIDGIN_PREFS_ROOT "/status/icon-theme", "icon");
1092 gtk_size_group_add_widget(label_sg, label);
1093 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
1094
1095 prefs_status_themes_combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes,
1096 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"),
1097 "icon");
1098 g_signal_connect(G_OBJECT(prefs_status_themes_combo_box), "changed",
1099 (GCallback)prefs_set_status_icon_theme_cb, NULL);
1100 gtk_size_group_add_widget(combo_sg, prefs_status_themes_combo_box);
1101 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_status_themes_combo_box, TRUE, TRUE, 0);
1102
1103 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1104 1109
1105 /* Sound Themes */ 1110 /* Sound Themes */
1106 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1111 prefs_sound_themes_combo_box = add_theme_prefs_combo(
1107 1112 vbox, combo_sg, label_sg, prefs_sound_themes,
1108 label = gtk_label_new(_("Sound Theme:")); 1113 (GCallback)prefs_set_sound_theme_cb, NULL,
1109 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 1114 _("Sound Theme:"), PIDGIN_PREFS_ROOT "/sound/theme", "sound");
1110 gtk_size_group_add_widget(label_sg, label);
1111 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
1112
1113 prefs_sound_themes_combo_box = prefs_build_theme_combo_box(prefs_sound_themes,
1114 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"),
1115 "sound");
1116 g_signal_connect(G_OBJECT(prefs_sound_themes_combo_box), "changed",
1117 (GCallback)prefs_set_sound_theme_cb, NULL);
1118 gtk_size_group_add_widget(combo_sg, prefs_sound_themes_combo_box);
1119 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_sound_themes_combo_box, TRUE, TRUE, 0);
1120
1121 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1122 1115
1123 /* Smiley Themes */ 1116 /* Smiley Themes */
1124 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1117 prefs_smiley_themes_combo_box = add_theme_prefs_combo(
1125 1118 vbox, combo_sg, label_sg, prefs_smiley_themes,
1126 label = gtk_label_new(_("Smiley Theme:")); 1119 (GCallback)prefs_set_smiley_theme_cb, NULL,
1127 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 1120 _("Smiley Theme:"), PIDGIN_PREFS_ROOT "/smileys/theme", "smiley");
1128 gtk_size_group_add_widget(label_sg, label);
1129 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
1130
1131 prefs_smiley_themes_combo_box = prefs_build_theme_combo_box(prefs_smiley_themes,
1132 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme"),
1133 "smiley");
1134 g_signal_connect(G_OBJECT(prefs_smiley_themes_combo_box), "changed",
1135 (GCallback)prefs_set_smiley_theme_cb, NULL);
1136 gtk_size_group_add_widget(combo_sg, prefs_smiley_themes_combo_box);
1137 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_smiley_themes_combo_box, TRUE, TRUE, 0);
1138
1139 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1140 1121
1141 /* Custom sort so "none" theme is at top of list */ 1122 /* Custom sort so "none" theme is at top of list */
1142 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(prefs_smiley_themes), 1123 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(prefs_smiley_themes),
1143 2, pidgin_sort_smileys, NULL, NULL); 1124 2, pidgin_sort_smileys, NULL, NULL);
1144 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(prefs_smiley_themes), 1125 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(prefs_smiley_themes),
1807 G_CALLBACK(network_turn_server_changed_cb), NULL); 1788 G_CALLBACK(network_turn_server_changed_cb), NULL);
1808 gtk_widget_show(entry); 1789 gtk_widget_show(entry);
1809 1790
1810 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_TURN server:"), 1791 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_TURN server:"),
1811 sg, entry, TRUE, NULL); 1792 sg, entry, TRUE, NULL);
1812 1793
1813 pidgin_prefs_labeled_spin_button(hbox, _("_Port:"), 1794 pidgin_prefs_labeled_spin_button(hbox, _("_UDP Port:"),
1814 "/purple/network/turn_port", 0, 65535, NULL); 1795 "/purple/network/turn_port", 0, 65535, NULL);
1796
1815 hbox = pidgin_prefs_labeled_entry(vbox, _("Use_rname:"), 1797 hbox = pidgin_prefs_labeled_entry(vbox, _("Use_rname:"),
1816 "/purple/network/turn_username", sg); 1798 "/purple/network/turn_username", sg);
1817 pidgin_prefs_labeled_password(hbox, _("Pass_word:"), 1799 pidgin_prefs_labeled_password(hbox, _("Pass_word:"),
1818 "/purple/network/turn_password", NULL); 1800 "/purple/network/turn_password", NULL);
1819 1801
2221 GtkWidget *hbox = data; 2203 GtkWidget *hbox = data;
2222 const char *method = value; 2204 const char *method = value;
2223 2205
2224 gtk_widget_set_sensitive(hbox, 2206 gtk_widget_set_sensitive(hbox,
2225 !strcmp(method, "automatic") || 2207 !strcmp(method, "automatic") ||
2208 !strcmp(method, "alsa") ||
2226 !strcmp(method, "esd")); 2209 !strcmp(method, "esd"));
2227 } 2210 }
2228 #endif /* USE_GSTREAMER */ 2211 #endif /* USE_GSTREAMER */
2229 2212
2230 2213