Mercurial > pidgin.yaz
comparison src/prefs.c @ 4324:561316116cd8
[gaim-migrate @ 4579]
I'm sooo slow.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Fri, 17 Jan 2003 08:25:58 +0000 |
parents | 8a932c488afc |
children | 7fd57453e6fc |
comparison
equal
deleted
inserted
replaced
4323:8a932c488afc | 4324:561316116cd8 |
---|---|
56 | 56 |
57 static GtkWidget *sounddialog = NULL; | 57 static GtkWidget *sounddialog = NULL; |
58 static GtkWidget *browser_entry = NULL; | 58 static GtkWidget *browser_entry = NULL; |
59 static GtkWidget *sound_entry = NULL; | 59 static GtkWidget *sound_entry = NULL; |
60 static GtkWidget *away_text = NULL; | 60 static GtkWidget *away_text = NULL; |
61 static GtkListStore *smiley_theme_store = NULL; | |
61 GtkCTreeNode *general_node = NULL; | 62 GtkCTreeNode *general_node = NULL; |
62 GtkCTreeNode *deny_node = NULL; | 63 GtkCTreeNode *deny_node = NULL; |
63 GtkWidget *prefs_proxy_frame = NULL; | 64 GtkWidget *prefs_proxy_frame = NULL; |
64 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); | 65 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
65 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); | 66 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
89 sound_entry = NULL; | 90 sound_entry = NULL; |
90 browser_entry = NULL; | 91 browser_entry = NULL; |
91 debugbutton = NULL; | 92 debugbutton = NULL; |
92 prefs_away_menu = NULL; | 93 prefs_away_menu = NULL; |
93 notebook_page = 0; | 94 notebook_page = 0; |
95 smiley_theme_store = NULL; | |
94 if(sounddialog) | 96 if(sounddialog) |
95 gtk_widget_destroy(sounddialog); | 97 gtk_widget_destroy(sounddialog); |
96 g_object_unref(G_OBJECT(prefs_away_store)); | 98 g_object_unref(G_OBJECT(prefs_away_store)); |
97 while(l) { | 99 while(l) { |
98 plug = l->data; | 100 plug = l->data; |
210 load_smiley_theme(filename, TRUE); | 212 load_smiley_theme(filename, TRUE); |
211 g_value_unset (&val); | 213 g_value_unset (&val); |
212 save_prefs(); | 214 save_prefs(); |
213 } | 215 } |
214 | 216 |
215 GtkWidget *theme_page() { | 217 GtkTreePath *theme_refresh_theme_list() |
216 GtkWidget *ret; | 218 { |
217 GtkWidget *sw; | 219 GdkPixbuf *pixbuf; |
218 GSList *themes; | 220 GSList *themes; |
219 GtkTreeIter iter; | 221 GtkTreeIter iter; |
220 GtkWidget *view; | 222 GtkTreePath *path; |
221 GtkCellRenderer *rend; | 223 int ind; |
222 GtkTreeViewColumn *col; | |
223 GtkTreeSelection *sel; | |
224 GtkTreePath *path = NULL; | |
225 GtkListStore *store; | |
226 GdkPixbuf *pixbuf; | |
227 int ind =0; | |
228 | 224 |
229 smiley_theme_probe(); | 225 smiley_theme_probe(); |
230 if (!smiley_themes) | 226 if (!smiley_themes) |
231 return; | 227 return; |
232 themes = smiley_themes; | 228 themes = smiley_themes; |
233 | |
234 ret = gtk_vbox_new(FALSE, 18); | |
235 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
236 | |
237 sw = gtk_scrolled_window_new(NULL,NULL); | |
238 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
239 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
240 | |
241 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
242 store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
243 while (themes) { | 229 while (themes) { |
244 struct smiley_theme *theme = themes->data; | 230 struct smiley_theme *theme = themes->data; |
245 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | 231 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
246 "<span size='smaller' foreground='gray'>%s</span>", | 232 "<span size='smaller' foreground='gray'>%s</span>", |
247 theme->name, theme->author, theme->desc);; | 233 theme->name, theme->author, theme->desc);; |
248 gtk_list_store_append (store, &iter); | 234 gtk_list_store_append (smiley_theme_store, &iter); |
249 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); | 235 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); |
250 | 236 |
251 gtk_list_store_set(store, &iter, | 237 gtk_list_store_set(smiley_theme_store, &iter, |
252 0, pixbuf, | 238 0, pixbuf, |
253 1, description, | 239 1, description, |
254 2, theme->path, | 240 2, theme->path, |
255 -1); | 241 -1); |
256 g_free(description); | 242 g_free(description); |
261 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | 247 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); |
262 g_free(iwishihadgtk2_2); | 248 g_free(iwishihadgtk2_2); |
263 } | 249 } |
264 ind++; | 250 ind++; |
265 } | 251 } |
252 return path; | |
253 } | |
254 GtkWidget *theme_page() { | |
255 GtkWidget *ret; | |
256 GtkWidget *sw; | |
257 GSList *themes; | |
258 GtkTreeIter iter; | |
259 GtkWidget *view; | |
260 GtkCellRenderer *rend; | |
261 GtkTreeViewColumn *col; | |
262 GtkTreeSelection *sel; | |
263 GtkTreePath *path = NULL; | |
264 GdkPixbuf *pixbuf; | |
265 int ind =0; | |
266 | |
267 ret = gtk_vbox_new(FALSE, 18); | |
268 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
269 | |
270 sw = gtk_scrolled_window_new(NULL,NULL); | |
271 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
272 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
273 | |
274 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
275 smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
276 | |
277 path = theme_refresh_theme_list(); | |
266 | 278 |
267 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store)); | 279 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
268 | 280 |
269 rend = gtk_cell_renderer_pixbuf_new(); | 281 rend = gtk_cell_renderer_pixbuf_new(); |
270 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | 282 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); |
271 | 283 |
272 gtk_tree_selection_select_path(sel, path); | 284 gtk_tree_selection_select_path(sel, path); |
282 col = gtk_tree_view_column_new_with_attributes ("Description", | 294 col = gtk_tree_view_column_new_with_attributes ("Description", |
283 rend, | 295 rend, |
284 "markup", 1, | 296 "markup", 1, |
285 NULL); | 297 NULL); |
286 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | 298 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); |
287 g_object_unref(G_OBJECT(store)); | 299 g_object_unref(G_OBJECT(smiley_theme_store)); |
288 gtk_container_add(GTK_CONTAINER(sw), view); | 300 gtk_container_add(GTK_CONTAINER(sw), view); |
289 | 301 |
290 g_signal_connect (G_OBJECT (sel), "changed", | 302 g_signal_connect (G_OBJECT (sel), "changed", |
291 G_CALLBACK (smiley_sel), | 303 G_CALLBACK (smiley_sel), |
292 NULL); | 304 NULL); |