Mercurial > pidgin.yaz
comparison src/prefs.c @ 4288:a723d060620a
[gaim-migrate @ 4541]
Here. Now you can like have lots of themes and like make your own and like
switch them and stuff. It's kidna neat, I suppose.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 11 Jan 2003 04:48:10 +0000 |
parents | cc14954cc399 |
children | 8406c518b879 |
comparison
equal
deleted
inserted
replaced
4287:f98e27e2cb10 | 4288:a723d060620a |
---|---|
190 /* This shouldn't have to wait for user to click OK or APPLY or whatnot */ | 190 /* This shouldn't have to wait for user to click OK or APPLY or whatnot */ |
191 /* This really shouldn't be in preferences at all */ | 191 /* This really shouldn't be in preferences at all */ |
192 debugbutton = gaim_button(_("Show _debug window"), &misc_options, OPT_MISC_DEBUG, vbox); | 192 debugbutton = gaim_button(_("Show _debug window"), &misc_options, OPT_MISC_DEBUG, vbox); |
193 | 193 |
194 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); | 194 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); |
195 | |
196 | |
197 gtk_widget_show_all(ret); | |
198 return ret; | |
199 } | |
200 | |
201 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
202 GtkTreeIter iter; | |
203 char *filename; | |
204 GValue val = { 0, }; | |
205 | |
206 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
207 return; | |
208 gtk_tree_model_get_value (model, &iter, 2, &val); | |
209 filename = g_value_get_string(&val); | |
210 load_smiley_theme(filename, TRUE); | |
211 g_value_unset (&val); | |
212 } | |
213 | |
214 GtkWidget *theme_page() { | |
215 GtkWidget *ret; | |
216 GtkWidget *sw; | |
217 GSList *themes = smiley_themes; | |
218 GtkTreeIter iter; | |
219 GtkWidget *view; | |
220 GtkListStore *ls; | |
221 GtkCellRenderer *rend; | |
222 GtkTreeViewColumn *col; | |
223 GtkTreeSelection *sel; | |
224 GtkTreePath *path; | |
225 GtkListStore *store; | |
226 GdkPixbuf *pixbuf; | |
227 int ind =0; | |
228 | |
229 ret = gtk_vbox_new(FALSE, 18); | |
230 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
231 | |
232 sw = gtk_scrolled_window_new(NULL,NULL); | |
233 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
234 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
235 | |
236 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
237 store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
238 while (themes) { | |
239 struct smiley_theme *theme = themes->data; | |
240 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
241 "<span size='smaller' foreground='gray'>%s</span>", | |
242 theme->name, theme->author, theme->desc);; | |
243 gtk_list_store_append (store, &iter); | |
244 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); | |
245 | |
246 gtk_list_store_set(store, &iter, | |
247 0, pixbuf, | |
248 1, description, | |
249 2, theme->path, | |
250 -1); | |
251 g_free(description); | |
252 themes = themes->next; | |
253 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
254 /* path = gtk_tree_path_new_from_indices(ind); */ | |
255 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
256 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
257 g_free(iwishihadgtk2_2); | |
258 } | |
259 ind++; | |
260 } | |
261 | |
262 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store)); | |
263 | |
264 rend = gtk_cell_renderer_pixbuf_new(); | |
265 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
266 | |
267 gtk_tree_selection_select_path(sel, path); | |
268 gtk_tree_path_free(path); | |
269 | |
270 col = gtk_tree_view_column_new_with_attributes ("Icon", | |
271 rend, | |
272 "pixbuf", 0, | |
273 NULL); | |
274 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
275 | |
276 rend = gtk_cell_renderer_text_new(); | |
277 col = gtk_tree_view_column_new_with_attributes ("Description", | |
278 rend, | |
279 "markup", 1, | |
280 NULL); | |
281 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
282 g_object_unref(G_OBJECT(store)); | |
283 gtk_container_add(GTK_CONTAINER(sw), view); | |
284 | |
285 g_signal_connect (G_OBJECT (sel), "changed", | |
286 G_CALLBACK (smiley_sel), | |
287 NULL); | |
195 | 288 |
196 | 289 |
197 gtk_widget_show_all(ret); | 290 gtk_widget_show_all(ret); |
198 return ret; | 291 return ret; |
199 } | 292 } |
1398 GtkWidget *(*config)(); | 1491 GtkWidget *(*config)(); |
1399 GList *l = plugins; | 1492 GList *l = plugins; |
1400 struct gaim_plugin *plug; | 1493 struct gaim_plugin *plug; |
1401 #endif | 1494 #endif |
1402 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | 1495 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); |
1496 prefs_notebook_add_page(_("Themes"), NULL, theme_page(), &c, &p, notebook_page++); | |
1403 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | 1497 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); |
1404 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | 1498 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); |
1405 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | 1499 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); |
1406 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | 1500 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); |
1407 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++); | 1501 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++); |