comparison pidgin/gtkprefs.c @ 29869:f44718de8b06

merged with im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 22 Feb 2010 16:05:25 +0900
parents d77ecfe2b2c9 5434f768917b
children 810a6be1920f
comparison
equal deleted inserted replaced
29445:d74e3cd6cbb5 29869:f44718de8b06
221 const char *str_value = NULL; 221 const char *str_value = NULL;
222 int o = 0; 222 int o = 0;
223 223
224 g_return_val_if_fail(menuitems != NULL, NULL); 224 g_return_val_if_fail(menuitems != NULL, NULL);
225 225
226 #if 0 /* GTK_CHECK_VERSION(2,4,0) */
227 if(type == PURPLE_PREF_INT)
228 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
229 else if(type == PURPLE_PREF_STRING)
230 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
231 dropdown = gtk_combo_box_new_with_model(model);
232 #else
233 dropdown = gtk_option_menu_new(); 226 dropdown = gtk_option_menu_new();
234 menu = gtk_menu_new(); 227 menu = gtk_menu_new();
235 #endif
236 228
237 if (type == PURPLE_PREF_INT) 229 if (type == PURPLE_PREF_INT)
238 stored_int = purple_prefs_get_int(key); 230 stored_int = purple_prefs_get_int(key);
239 else if (type == PURPLE_PREF_STRING) 231 else if (type == PURPLE_PREF_STRING)
240 stored_str = purple_prefs_get_string(key); 232 stored_str = purple_prefs_get_string(key);
906 gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE); 898 gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE);
907 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); 899 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE);
908 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL); 900 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL);
909 901
910 cell_rend = gtk_cell_renderer_text_new(); 902 cell_rend = gtk_cell_renderer_text_new();
911 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); 903 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, TRUE);
912 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL); 904 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL);
913 /*#if GTK_CHECK_VERSION(2,6,0) 905 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
914 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
915 #endif*/
916 906
917 gtk_drag_dest_set(combo_box, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, 907 gtk_drag_dest_set(combo_box, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te,
918 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); 908 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE);
919 909
920 g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), (gpointer) type); 910 g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), (gpointer) type);
1088 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"), 1078 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"),
1089 "blist"); 1079 "blist");
1090 g_signal_connect(G_OBJECT(prefs_blist_themes_combo_box), "changed", 1080 g_signal_connect(G_OBJECT(prefs_blist_themes_combo_box), "changed",
1091 (GCallback)prefs_set_blist_theme_cb, NULL); 1081 (GCallback)prefs_set_blist_theme_cb, NULL);
1092 gtk_size_group_add_widget(combo_sg, prefs_blist_themes_combo_box); 1082 gtk_size_group_add_widget(combo_sg, prefs_blist_themes_combo_box);
1093 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_blist_themes_combo_box, FALSE, FALSE, 0); 1083 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_blist_themes_combo_box, TRUE, TRUE, 0);
1094 1084
1095 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0); 1085 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1096 1086
1097 /* Status Icon Themes */ 1087 /* Status Icon Themes */
1098 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1088 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1106 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"), 1096 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"),
1107 "icon"); 1097 "icon");
1108 g_signal_connect(G_OBJECT(prefs_status_themes_combo_box), "changed", 1098 g_signal_connect(G_OBJECT(prefs_status_themes_combo_box), "changed",
1109 (GCallback)prefs_set_status_icon_theme_cb, NULL); 1099 (GCallback)prefs_set_status_icon_theme_cb, NULL);
1110 gtk_size_group_add_widget(combo_sg, prefs_status_themes_combo_box); 1100 gtk_size_group_add_widget(combo_sg, prefs_status_themes_combo_box);
1111 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_status_themes_combo_box, FALSE, FALSE, 0); 1101 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_status_themes_combo_box, TRUE, TRUE, 0);
1112 1102
1113 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0); 1103 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1114 1104
1115 /* Sound Themes */ 1105 /* Sound Themes */
1116 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1106 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1124 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"), 1114 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"),
1125 "sound"); 1115 "sound");
1126 g_signal_connect(G_OBJECT(prefs_sound_themes_combo_box), "changed", 1116 g_signal_connect(G_OBJECT(prefs_sound_themes_combo_box), "changed",
1127 (GCallback)prefs_set_sound_theme_cb, NULL); 1117 (GCallback)prefs_set_sound_theme_cb, NULL);
1128 gtk_size_group_add_widget(combo_sg, prefs_sound_themes_combo_box); 1118 gtk_size_group_add_widget(combo_sg, prefs_sound_themes_combo_box);
1129 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_sound_themes_combo_box, FALSE, FALSE, 0); 1119 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_sound_themes_combo_box, TRUE, TRUE, 0);
1130 1120
1131 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0); 1121 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1132 1122
1133 /* Smiley Themes */ 1123 /* Smiley Themes */
1134 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1124 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1142 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme"), 1132 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme"),
1143 "smiley"); 1133 "smiley");
1144 g_signal_connect(G_OBJECT(prefs_smiley_themes_combo_box), "changed", 1134 g_signal_connect(G_OBJECT(prefs_smiley_themes_combo_box), "changed",
1145 (GCallback)prefs_set_smiley_theme_cb, NULL); 1135 (GCallback)prefs_set_smiley_theme_cb, NULL);
1146 gtk_size_group_add_widget(combo_sg, prefs_smiley_themes_combo_box); 1136 gtk_size_group_add_widget(combo_sg, prefs_smiley_themes_combo_box);
1147 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_smiley_themes_combo_box, FALSE, FALSE, 0); 1137 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_smiley_themes_combo_box, TRUE, TRUE, 0);
1148 1138
1149 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0); 1139 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
1150 1140
1151 /* Custom sort so "none" theme is at top of list */ 1141 /* Custom sort so "none" theme is at top of list */
1152 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(prefs_smiley_themes), 1142 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(prefs_smiley_themes),
1420 PIDGIN_PREFS_ROOT "/conversations/tab_side", 1410 PIDGIN_PREFS_ROOT "/conversations/tab_side",
1421 _("Top"), GTK_POS_TOP, 1411 _("Top"), GTK_POS_TOP,
1422 _("Bottom"), GTK_POS_BOTTOM, 1412 _("Bottom"), GTK_POS_BOTTOM,
1423 _("Left"), GTK_POS_LEFT, 1413 _("Left"), GTK_POS_LEFT,
1424 _("Right"), GTK_POS_RIGHT, 1414 _("Right"), GTK_POS_RIGHT,
1425 #if GTK_CHECK_VERSION(2,6,0)
1426 _("Left Vertical"), GTK_POS_LEFT|8, 1415 _("Left Vertical"), GTK_POS_LEFT|8,
1427 _("Right Vertical"), GTK_POS_RIGHT|8, 1416 _("Right Vertical"), GTK_POS_RIGHT|8,
1428 #endif
1429 NULL); 1417 NULL);
1430 gtk_size_group_add_widget(sg, label); 1418 gtk_size_group_add_widget(sg, label);
1431 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); 1419 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
1432 1420
1433 names = pidgin_conv_placement_get_options(); 1421 names = pidgin_conv_placement_get_options();
1518 pidgin_prefs_labeled_spin_button(vbox, 1506 pidgin_prefs_labeled_spin_button(vbox,
1519 _("Minimum input area height in lines:"), 1507 _("Minimum input area height in lines:"),
1520 PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", 1508 PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines",
1521 1, 8, NULL); 1509 1, 8, NULL);
1522 1510
1523 #if GTK_CHECK_VERSION(2,4,0) && defined _WIN32 1511 #ifdef _WIN32
1524 { 1512 {
1525 GtkWidget *fontpref, *font_button, *hbox; 1513 GtkWidget *fontpref, *font_button, *hbox;
1526 const char *font_name; 1514 const char *font_name;
1527 vbox = pidgin_make_frame(ret, _("Font")); 1515 vbox = pidgin_make_frame(ret, _("Font"));
1528 1516
2730 } 2718 }
2731 2719
2732 static int 2720 static int
2733 prefs_notebook_add_page(const char *text, GtkWidget *page, int ind) 2721 prefs_notebook_add_page(const char *text, GtkWidget *page, int ind)
2734 { 2722 {
2735 #if GTK_CHECK_VERSION(2,4,0)
2736 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); 2723 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text));
2737 #else
2738 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text));
2739 return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page);
2740 #endif
2741 } 2724 }
2742 2725
2743 static void 2726 static void
2744 prefs_notebook_init(void) 2727 prefs_notebook_init(void)
2745 { 2728 {