| 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); |
| 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, FALSE); |
| 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 /* TODO: We need to force a size or something, or each theme dropdown ends |
| 914 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
906 up as just "..." */ |
| 915 #endif*/ |
907 #if 0 && GTK_CHECK_VERSION(2,6,0) |
| |
908 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
| |
909 #endif |
| 916 |
910 |
| 917 gtk_drag_dest_set(combo_box, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, |
911 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); |
912 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); |
| 919 |
913 |
| 920 g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), (gpointer) type); |
914 g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), (gpointer) type); |