Mercurial > pidgin
comparison src/gtkprefs.c @ 7976:8e5a21b1efa6
[gaim-migrate @ 8653]
Daniel (not David) Atallah sent me this, which is useful for the plugin writing folk
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 03 Jan 2004 06:25:24 +0000 |
parents | 83df8ad35446 |
children | fc6b362f9c26 |
comparison
equal
deleted
inserted
replaced
7975:2311532f9036 | 7976:8e5a21b1efa6 |
---|---|
82 * PROTOTYPES | 82 * PROTOTYPES |
83 */ | 83 */ |
84 static GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*, | 84 static GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*, |
85 GtkWidget*, GtkTreeIter*, | 85 GtkWidget*, GtkTreeIter*, |
86 GtkTreeIter*, int); | 86 GtkTreeIter*, int); |
87 static GtkWidget *prefs_checkbox(const char *, const char *, GtkWidget *); | |
88 static GtkWidget *prefs_labeled_spin_button(GtkWidget *, const gchar *, | |
89 char *key, int, int, | |
90 GtkSizeGroup *); | |
91 static GtkWidget *prefs_dropdown(GtkWidget *, const gchar *, GaimPrefType type, | |
92 const char *, ...); | |
93 static GtkWidget *prefs_dropdown_from_list(GtkWidget *, const gchar *, | |
94 GaimPrefType type, | |
95 const char *, GList *); | |
96 static GtkWidget *show_color_pref(GtkWidget *, gboolean); | 87 static GtkWidget *show_color_pref(GtkWidget *, gboolean); |
97 static void delete_prefs(GtkWidget *, void *); | 88 static void delete_prefs(GtkWidget *, void *); |
98 static void update_plugin_list(void *data); | 89 static void update_plugin_list(void *data); |
99 | 90 |
100 static void set_default_away(GtkWidget *, gpointer); | 91 static void set_default_away(GtkWidget *, gpointer); |
108 value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | 99 value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
109 | 100 |
110 gaim_prefs_set_int(key, value); | 101 gaim_prefs_set_int(key, value); |
111 } | 102 } |
112 | 103 |
113 static GtkWidget * | 104 GtkWidget * |
114 prefs_labeled_spin_button(GtkWidget *box, const gchar *title, char *key, | 105 prefs_labeled_spin_button(GtkWidget *box, const gchar *title, char *key, |
115 int min, int max, GtkSizeGroup *sg) | 106 int min, int max, GtkSizeGroup *sg) |
116 { | 107 { |
117 GtkWidget *hbox; | 108 GtkWidget *hbox; |
118 GtkWidget *label; | 109 GtkWidget *label; |
178 gaim_prefs_set_bool(key, FALSE); | 169 gaim_prefs_set_bool(key, FALSE); |
179 gaim_prefs_set_bool(bool_key, TRUE); | 170 gaim_prefs_set_bool(bool_key, TRUE); |
180 } | 171 } |
181 } | 172 } |
182 | 173 |
183 static GtkWidget * | 174 GtkWidget * |
184 prefs_dropdown_from_list(GtkWidget *box, const gchar *title, GaimPrefType type, | 175 prefs_dropdown_from_list(GtkWidget *box, const gchar *title, GaimPrefType type, |
185 const char *key, GList *menuitems) | 176 const char *key, GList *menuitems) |
186 { | 177 { |
187 GtkWidget *dropdown, *opt, *menu; | 178 GtkWidget *dropdown, *opt, *menu; |
188 GtkWidget *label; | 179 GtkWidget *label; |
263 gtk_widget_show(dropdown); | 254 gtk_widget_show(dropdown); |
264 | 255 |
265 return label; | 256 return label; |
266 } | 257 } |
267 | 258 |
268 static GtkWidget * | 259 GtkWidget * |
269 prefs_dropdown(GtkWidget *box, const gchar *title, GaimPrefType type, | 260 prefs_dropdown(GtkWidget *box, const gchar *title, GaimPrefType type, |
270 const char *key, ...) | 261 const char *key, ...) |
271 { | 262 { |
272 va_list ap; | 263 va_list ap; |
273 GList *menuitems = NULL; | 264 GList *menuitems = NULL; |
2487 { | 2478 { |
2488 gaim_prefs_set_bool(key, | 2479 gaim_prefs_set_bool(key, |
2489 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); | 2480 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
2490 } | 2481 } |
2491 | 2482 |
2492 static GtkWidget * | 2483 GtkWidget * |
2493 prefs_checkbox(const char *text, const char *key, GtkWidget *page) | 2484 prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
2494 { | 2485 { |
2495 GtkWidget *button; | 2486 GtkWidget *button; |
2496 | 2487 |
2497 button = gtk_check_button_new_with_mnemonic(text); | 2488 button = gtk_check_button_new_with_mnemonic(text); |