Mercurial > pidgin.yaz
annotate pidgin/plugins/themeedit.c @ 26657:37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
| author | Sadrul Habib Chowdhury <imadil@gmail.com> |
|---|---|
| date | Fri, 17 Apr 2009 23:50:36 +0000 |
| parents | |
| children | 4fca203e33be |
| rev | line source |
|---|---|
|
26657
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 /* Pidgin |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 * |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
3 * Pidgin is the legal property of its developers, whose names are too numerous |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 * to list here. Please refer to the COPYRIGHT file distributed with this |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 * source distribution. |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 * |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 * (at your option) any later version. |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 * |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 * GNU General Public License for more details. |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 * |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
18 * along with this program; if not, write to the Free Software |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
21 #include "internal.h" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
22 #include "pidgin.h" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
23 #include "version.h" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
24 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
25 #include "theme-manager.h" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
26 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
27 #include "gtkblist.h" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
28 #include "gtkblist-theme.h" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
29 #include "gtkutils.h" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
30 #include "gtkplugin.h" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
31 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
32 #define PLUGIN_ID "gtk-blist-theme-editor" |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
33 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
34 static gboolean |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
35 prop_type_is_color(PidginBlistTheme *theme, const char *prop) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
36 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
37 PidginBlistThemeClass *klass = PIDGIN_BLIST_THEME_GET_CLASS(theme); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
38 GParamSpec *spec = g_object_class_find_property(G_OBJECT_CLASS(klass), prop); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
39 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
40 return G_IS_PARAM_SPEC_BOXED(spec); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
41 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
42 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
43 static void |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
44 save_blist_theme(GtkWidget *w, GtkWidget *window) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
45 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
46 /* TODO: SAVE! */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
47 gtk_widget_destroy(window); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
48 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
49 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
50 static void |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
51 theme_color_selected(GtkDialog *dialog, gint response, const char *prop) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
52 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
53 if (response == GTK_RESPONSE_OK) { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
54 GdkColor color; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
55 PidginBlistTheme *theme; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
56 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
57 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel), &color); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
58 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
59 theme = pidgin_blist_get_theme(); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
60 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
61 if (prop_type_is_color(theme, prop)) { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
62 g_object_set(G_OBJECT(theme), prop, &color, NULL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
63 } else { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
64 PidginThemeFont *font = NULL; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
65 g_object_get(G_OBJECT(theme), prop, &font, NULL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
66 pidgin_theme_font_set_color(font, &color); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
67 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
68 pidgin_blist_set_theme(theme); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
69 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
70 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
71 gtk_widget_destroy(GTK_WIDGET(dialog)); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
72 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
73 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
74 static void |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
75 theme_font_face_selected(GtkWidget *dialog, gint response, gpointer font) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
76 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
77 if (response == GTK_RESPONSE_OK || response == GTK_RESPONSE_APPLY) { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
78 const char *fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(dialog)); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
79 pidgin_theme_font_set_font_face(font, fontname); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
80 pidgin_blist_refresh(purple_get_blist()); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
81 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
82 gtk_widget_destroy(dialog); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
83 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
84 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
85 static void |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
86 theme_font_select_face(GtkWidget *widget, gpointer prop) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
87 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
88 GtkWidget *dialog; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
89 PidginBlistTheme *theme; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
90 PidginThemeFont *font = NULL; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
91 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
92 theme = pidgin_blist_get_theme(); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
93 g_object_get(G_OBJECT(theme), prop, &font, NULL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
94 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
95 dialog = gtk_font_selection_dialog_new(_("Select Font")); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
96 gtk_font_selection_set_font_name(GTK_FONT_SELECTION(GTK_FONT_SELECTION_DIALOG(dialog)->fontsel), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
97 pidgin_theme_font_get_font_face(font)); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
98 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_font_face_selected), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
99 font); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
100 gtk_widget_show_all(dialog); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
101 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
102 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
103 static void |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
104 theme_color_select(GtkWidget *widget, gpointer prop) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
105 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
106 GtkWidget *dialog; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
107 PidginBlistTheme *theme; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
108 const GdkColor *color = NULL; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
109 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
110 theme = pidgin_blist_get_theme(); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
111 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
112 if (prop_type_is_color(theme, prop)) { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
113 g_object_get(G_OBJECT(theme), prop, &color, NULL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
114 } else { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
115 PidginThemeFont *pair = NULL; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
116 g_object_get(G_OBJECT(theme), prop, &pair, NULL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
117 color = pidgin_theme_font_get_color(pair); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
118 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
119 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
120 dialog = gtk_color_selection_dialog_new(_("Select Color")); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
121 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
122 color); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
123 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_color_selected), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
124 prop); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
125 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
126 gtk_widget_show_all(dialog); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
127 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
128 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
129 static GtkWidget * |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
130 pidgin_theme_create_color_selector(const char *text, const char *prop, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
131 GtkSizeGroup *sizegroup) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
132 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
133 GtkWidget *color; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
134 GtkWidget *hbox, *label; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
135 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
136 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
137 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
138 label = gtk_label_new(_(text)); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
139 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
140 gtk_size_group_add_widget(sizegroup, label); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
141 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
142 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
143 color = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_COLOR, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
144 PIDGIN_BUTTON_HORIZONTAL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
145 g_signal_connect(G_OBJECT(color), "clicked", G_CALLBACK(theme_color_select), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
146 (gpointer)prop); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
147 gtk_box_pack_start(GTK_BOX(hbox), color, FALSE, FALSE, 0); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
148 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
149 return hbox; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
150 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
151 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
152 static GtkWidget * |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
153 pidgin_theme_create_font_selector(const char *text, const char *prop, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
154 GtkSizeGroup *sizegroup) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
155 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
156 GtkWidget *color, *font; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
157 GtkWidget *hbox, *label; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
158 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
159 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
160 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
161 label = gtk_label_new(_(text)); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
162 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
163 gtk_size_group_add_widget(sizegroup, label); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
164 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
165 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
166 font = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_FONT, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
167 PIDGIN_BUTTON_HORIZONTAL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
168 g_signal_connect(G_OBJECT(font), "clicked", G_CALLBACK(theme_font_select_face), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
169 (gpointer)prop); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
170 gtk_box_pack_start(GTK_BOX(hbox), font, FALSE, FALSE, 0); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
171 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
172 color = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_COLOR, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
173 PIDGIN_BUTTON_HORIZONTAL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
174 g_signal_connect(G_OBJECT(color), "clicked", G_CALLBACK(theme_color_select), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
175 (gpointer)prop); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
176 gtk_box_pack_start(GTK_BOX(hbox), color, FALSE, FALSE, 0); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
177 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
178 return hbox; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
179 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
180 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
181 static void |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
182 pidgin_blist_theme_edit(void) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
183 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
184 GtkWidget *dialog; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
185 GtkWidget *box; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
186 GtkSizeGroup *group; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
187 PidginBlistTheme *theme; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
188 GObjectClass *klass; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
189 int i, j; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
190 static struct { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
191 const char *header; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
192 const char *props[12]; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
193 } sections[] = { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
194 {N_("Contact"), { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
195 "contact-color", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
196 "contact", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
197 "online", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
198 "away", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
199 "offline", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
200 "idle", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
201 "message", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
202 "message_nick_said", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
203 "status", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
204 NULL |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
205 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
206 }, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
207 {N_("Group"), { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
208 "expanded-color", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
209 "expanded-text", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
210 "collapsed-color", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
211 "collapsed-text", |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
212 NULL |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
213 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
214 }, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
215 { NULL, { } } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
216 }; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
217 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
218 dialog = pidgin_create_dialog(_("Pidgin Buddylist Theme Editor"), 0, "theme-editor", FALSE); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
219 box = pidgin_dialog_get_vbox(GTK_DIALOG(dialog)); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
220 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
221 theme = pidgin_blist_get_theme(); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
222 if (!theme) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
223 return; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
224 klass = G_OBJECT_CLASS(PIDGIN_BLIST_THEME_GET_CLASS(theme)); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
225 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
226 group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
227 for (i = 0; sections[i].header; i++) { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
228 GtkWidget *vbox; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
229 GtkWidget *hbox; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
230 GParamSpec *spec; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
231 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
232 vbox = pidgin_make_frame(box, _(sections[i].header)); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
233 for (j = 0; sections[i].props[j]; j++) { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
234 const char *label; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
235 spec = g_object_class_find_property(klass, sections[i].props[j]); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
236 label = g_param_spec_get_nick(spec); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
237 if (G_IS_PARAM_SPEC_BOXED(spec)) { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
238 hbox = pidgin_theme_create_color_selector(label, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
239 sections[i].props[j], group); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
240 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
241 } else { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
242 hbox = pidgin_theme_create_font_selector(label, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
243 sections[i].props[j], group); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
244 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
245 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
246 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
247 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
248 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
249 pidgin_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_SAVE, G_CALLBACK(save_blist_theme), dialog); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
250 gtk_widget_show_all(dialog); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
251 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
252 g_object_unref(group); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
253 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
254 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
255 static gboolean |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
256 plugin_load(PurplePlugin *plugin) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
257 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
258 return TRUE; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
259 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
260 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
261 static GList * |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
262 actions(PurplePlugin *plugin, gpointer context) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
263 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
264 GList *l = NULL; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
265 PurplePluginAction *act = NULL; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
266 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
267 act = purple_plugin_action_new(_("Edit"), pidgin_blist_theme_edit); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
268 l = g_list_append(l, act); |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
269 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
270 return l; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
271 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
272 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
273 static PurplePluginInfo info = |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
274 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
275 PURPLE_PLUGIN_MAGIC, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
276 PURPLE_MAJOR_VERSION, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
277 PURPLE_MINOR_VERSION, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
278 PURPLE_PLUGIN_STANDARD, /**< type */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
279 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
280 0, /**< flags */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
281 NULL, /**< dependencies */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
282 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
283 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
284 PLUGIN_ID, /**< id */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
285 N_("Pidgin Buddylist Theme Editor"), /**< name */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
286 DISPLAY_VERSION, /**< version */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
287 /** summary */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
288 N_("Pidgin Buddylist Theme Editor. Enjoy, motherfucker!!"), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
289 /** description */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
290 N_("Pidgin Buddylist Theme Editor"), |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
291 "Sadrul Habib Chowdhury <imadil@gmail.com>", /**< author */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
292 PURPLE_WEBSITE, /**< homepage */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
293 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
294 plugin_load, /**< load */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
295 NULL, /**< unload */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
296 NULL, /**< destroy */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
297 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
298 NULL, /**< ui_info */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
299 NULL, /**< extra_info */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
300 NULL, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
301 actions, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
302 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
303 /* padding */ |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
304 NULL, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
305 NULL, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
306 NULL, |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
307 NULL |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
308 }; |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
309 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
310 static void |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
311 init_plugin(PurplePlugin *plugin) |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
312 { |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
313 } |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
314 |
|
37aca5864715
Theme editor plugin (of sorts) for buddylist themes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
315 PURPLE_INIT_PLUGIN(themeeditor, init_plugin, info) |
