pidgin/plugins/pidginrc.c

Tue, 17 Sep 2013 18:27:05 +0530

author
Ankit Vani <a@nevitus.org>
date
Tue, 17 Sep 2013 18:27:05 +0530
branch
soc.2013.gobjectification.plugins
changeset 36757
2e04586cf6e8
parent 34307
398577183905
child 36926
d2c0c68a9816
permissions
-rw-r--r--

Refactored some pidgin plugins to use the new plugin API

10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
1 /**
27598
92eb3a61465b Correct the doxygen documentation in the pidginrc plugin and swap out a
Etan Reisner <deryni@pidgin.im>
parents: 27307
diff changeset
2 * @file pidginrc.c Pidgin GTK+ resource control plugin.
92eb3a61465b Correct the doxygen documentation in the pidginrc plugin and swap out a
Etan Reisner <deryni@pidgin.im>
parents: 27307
diff changeset
3 * @ingroup pidgin
92eb3a61465b Correct the doxygen documentation in the pidginrc plugin and swap out a
Etan Reisner <deryni@pidgin.im>
parents: 27307
diff changeset
4 */
92eb3a61465b Correct the doxygen documentation in the pidginrc plugin and swap out a
Etan Reisner <deryni@pidgin.im>
parents: 27307
diff changeset
5
92eb3a61465b Correct the doxygen documentation in the pidginrc plugin and swap out a
Etan Reisner <deryni@pidgin.im>
parents: 27307
diff changeset
6 /* pidgin
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
7 *
27598
92eb3a61465b Correct the doxygen documentation in the pidginrc plugin and swap out a
Etan Reisner <deryni@pidgin.im>
parents: 27307
diff changeset
8 * Pidgin is the legal property of its developers, whose names are too numerous
92eb3a61465b Correct the doxygen documentation in the pidginrc plugin and swap out a
Etan Reisner <deryni@pidgin.im>
parents: 27307
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
92eb3a61465b Correct the doxygen documentation in the pidginrc plugin and swap out a
Etan Reisner <deryni@pidgin.im>
parents: 27307
diff changeset
10 * source distribution.
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
11 *
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
16 *
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
21 *
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18242
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
25 */
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
26
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
27 #include "internal.h"
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
28 #include "gtkplugin.h"
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
29 #include "gtkprefs.h"
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
30 #include "gtkutils.h"
12044
e49179a1496a [gaim-migrate @ 14339]
Richard Laager <rlaager@pidgin.im>
parents: 12042
diff changeset
31 #include "util.h"
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
32 #include "version.h"
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
33
33275
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30010
diff changeset
34 #include "gtk3compat.h"
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30010
diff changeset
35
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
36 static guint pref_callback;
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
37
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
38 static const gchar *color_prefs[] = {
21955
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
39 "/plugins/gtk/purplerc/color/GtkIMHtml::hyperlink-color",
24328
7be2af5c9129 Show visited links in a different color. This also plugs a memory leak
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22104
diff changeset
40 "/plugins/gtk/purplerc/color/GtkIMHtml::hyperlink-visited-color",
21955
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
41 "/plugins/gtk/purplerc/color/GtkIMHtml::send-name-color",
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
42 "/plugins/gtk/purplerc/color/GtkIMHtml::receive-name-color",
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
43 "/plugins/gtk/purplerc/color/GtkIMHtml::highlight-name-color",
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
44 "/plugins/gtk/purplerc/color/GtkIMHtml::action-name-color",
27307
65906c6de115 Fix a typo caught by Geoffrey Antos.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27269
diff changeset
45 "/plugins/gtk/purplerc/color/GtkIMHtml::typing-notification-color"
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
46 };
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
47 static const gchar *color_prefs_set[] = {
21955
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
48 "/plugins/gtk/purplerc/set/color/GtkIMHtml::hyperlink-color",
24328
7be2af5c9129 Show visited links in a different color. This also plugs a memory leak
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22104
diff changeset
49 "/plugins/gtk/purplerc/set/color/GtkIMHtml::hyperlink-visited-color",
21955
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
50 "/plugins/gtk/purplerc/set/color/GtkIMHtml::send-name-color",
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
51 "/plugins/gtk/purplerc/set/color/GtkIMHtml::receive-name-color",
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
52 "/plugins/gtk/purplerc/set/color/GtkIMHtml::highlight-name-color",
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
53 "/plugins/gtk/purplerc/set/color/GtkIMHtml::action-name-color",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
54 "/plugins/gtk/purplerc/set/color/GtkIMHtml::typing-notification-color"
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
55 };
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
56 static const gchar *color_names[] = {
21955
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
57 N_("Hyperlink Color"),
24328
7be2af5c9129 Show visited links in a different color. This also plugs a memory leak
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22104
diff changeset
58 N_("Visited Hyperlink Color"),
21955
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
59 N_("Sent Message Name Color"),
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
60 N_("Received Message Name Color"),
4014918b95fc Another patch from DHowett. This one adds conversation nick colors to gtkrc
Sean Egan <seanegan@pidgin.im>
parents: 21720
diff changeset
61 N_("Highlighted Message Name Color"),
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
62 N_("Action Message Name Color"),
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
63 N_("Typing Notification Color")
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
64 };
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
65 static GtkWidget *color_widgets[G_N_ELEMENTS(color_prefs)];
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
66
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
67 static const gchar *widget_size_prefs[] = {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
68 "/plugins/gtk/purplerc/size/GtkTreeView::horizontal_separator"
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
69 };
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
70 static const gchar *widget_size_prefs_set[] = {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
71 "/plugins/gtk/purplerc/set/size/GtkTreeView::horizontal_separator"
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
72 };
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
73 static const gchar *widget_size_names[] = {
12201
7e1227b42822 [gaim-migrate @ 14503]
Etan Reisner <deryni@pidgin.im>
parents: 12048
diff changeset
74 N_("GtkTreeView Horizontal Separation")
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
75 };
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
76 static GtkWidget *widget_size_widgets[G_N_ELEMENTS(widget_size_prefs)];
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
77
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
78 static const gchar *font_prefs[] = {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
79 "/plugins/gtk/purplerc/font/*pidgin_conv_entry",
28896
050c7c1f8e5f Add a font pref to the pidginrc plugin to control the conversation history
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27598
diff changeset
80 "/plugins/gtk/purplerc/font/*pidgin_conv_imhtml",
17096
b38e5c5c934e Fix incorrect widget names in pidginrc plugin. Also, fix spacing - I'm not sure if this actually matters. Fixes #874.
Daniel Atallah <datallah@pidgin.im>
parents: 16749
diff changeset
81 "/plugins/gtk/purplerc/font/*pidgin_request_imhtml",
b38e5c5c934e Fix incorrect widget names in pidginrc plugin. Also, fix spacing - I'm not sure if this actually matters. Fixes #874.
Daniel Atallah <datallah@pidgin.im>
parents: 16749
diff changeset
82 "/plugins/gtk/purplerc/font/*pidgin_notify_imhtml",
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
83 };
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
84 static const gchar *font_prefs_set[] = {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
85 "/plugins/gtk/purplerc/set/font/*pidgin_conv_entry",
28896
050c7c1f8e5f Add a font pref to the pidginrc plugin to control the conversation history
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27598
diff changeset
86 "/plugins/gtk/purplerc/set/font/*pidgin_conv_imhtml",
17096
b38e5c5c934e Fix incorrect widget names in pidginrc plugin. Also, fix spacing - I'm not sure if this actually matters. Fixes #874.
Daniel Atallah <datallah@pidgin.im>
parents: 16749
diff changeset
87 "/plugins/gtk/purplerc/set/font/*pidgin_request_imhtml",
b38e5c5c934e Fix incorrect widget names in pidginrc plugin. Also, fix spacing - I'm not sure if this actually matters. Fixes #874.
Daniel Atallah <datallah@pidgin.im>
parents: 16749
diff changeset
88 "/plugins/gtk/purplerc/set/font/*pidgin_notify_imhtml",
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
89 };
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
90 static const gchar *font_names[] = {
10585
42d99375d8d0 [gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents: 10584
diff changeset
91 N_("Conversation Entry"),
28896
050c7c1f8e5f Add a font pref to the pidginrc plugin to control the conversation history
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27598
diff changeset
92 N_("Conversation History"),
10585
42d99375d8d0 [gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents: 10584
diff changeset
93 N_("Request Dialog"),
42d99375d8d0 [gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents: 10584
diff changeset
94 N_("Notify Dialog")
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
95 };
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
96 static GtkWidget *font_widgets[G_N_ELEMENTS(font_prefs)];
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
97
17209
bfccb73d3ea1 Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents: 17096
diff changeset
98 /*
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
99 static const gchar *widget_bool_prefs[] = {
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
100 };
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
101 static const gchar *widget_bool_prefs_set[] = {
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
102 };
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
103 static const gchar *widget_bool_names[] = {
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
104 };
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
105 static GtkWidget *widget_bool_widgets[G_N_ELEMENTS(widget_bool_prefs)];
17209
bfccb73d3ea1 Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents: 17096
diff changeset
106 */
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
107
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
108 static GString *
22104
56970903b8e9 Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents: 21955
diff changeset
109 make_gtkrc_string(void)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
110 {
34307
398577183905 Fix Pidgin's plugins warnings about -Wsign-compare
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33955
diff changeset
111 gsize i;
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
112 gchar *prefbase = NULL;
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
113 GString *style_string = g_string_new("");
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
114
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
115 if (purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-font-name")) {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
116 const gchar *pref = purple_prefs_get_string("/plugins/gtk/purplerc/gtk-font-name");
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
117
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
118 if (pref != NULL && strcmp(pref, "")) {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
119 g_string_append_printf(style_string,
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
120 "gtk-font-name = \"%s\"\n",
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
121 pref);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
122 }
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
123 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
124
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
125 if (purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name")) {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
126 const gchar *pref = purple_prefs_get_string("/plugins/gtk/purplerc/gtk-key-theme-name");
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
127
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
128 if (pref != NULL && strcmp(pref, "")) {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
129 g_string_append_printf(style_string,
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
130 "gtk-key-theme-name = \"%s\"\n",
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
131 pref);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
132 }
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
133 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
134
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
135 g_string_append(style_string, "style \"purplerc_style\"\n{");
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
136
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
137 if(purple_prefs_get_bool("/plugins/gtk/purplerc/set/disable-typing-notification")) {
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
138 g_string_append(style_string, "\tGtkIMHtml::typing-notification-enable = 0\n");
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
139 }
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
140
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
141 for (i = 0; i < G_N_ELEMENTS(color_prefs); i++) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
142 if (purple_prefs_get_bool(color_prefs_set[i])) {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
143 const gchar *pref;
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
144
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
145 pref = purple_prefs_get_string(color_prefs[i]);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
146 if (pref != NULL && strcmp(pref, "")) {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
147 prefbase = g_path_get_basename(color_prefs[i]);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
148 g_string_append_printf(style_string,
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
149 "\n\t%s = \"%s\"",
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
150 prefbase, pref);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
151 g_free(prefbase);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
152 }
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
153 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
154 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
155
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
156 for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
157 if (purple_prefs_get_bool(widget_size_prefs_set[i])) {
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
158 prefbase = g_path_get_basename(widget_size_prefs[i]);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
159 g_string_append_printf(style_string,
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
160 "\n\t%s = %d", prefbase,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
161 purple_prefs_get_int(widget_size_prefs[i]));
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
162 g_free(prefbase);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
163 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
164 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
165
17209
bfccb73d3ea1 Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents: 17096
diff changeset
166 /*
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
167 for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
168 if (purple_prefs_get_bool(widget_bool_prefs_set[i])) {
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
169 prefbase = g_path_get_basename(widget_bool_prefs[i]);
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
170 g_string_append_printf(style_string,
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
171 "\t%s = %d\n", prefbase,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
172 purple_prefs_get_bool(widget_bool_prefs[i]));
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
173 g_free(prefbase);
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
174 }
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
175 }
17209
bfccb73d3ea1 Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents: 17096
diff changeset
176 */
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
177
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
178 g_string_append(style_string, "\n}\nwidget_class \"*\" style \"purplerc_style\"\n");
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
179
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
180 for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
181 if (purple_prefs_get_bool(font_prefs_set[i])) {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
182 const gchar *pref;
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
183
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
184 pref = purple_prefs_get_string(font_prefs[i]);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
185 if (pref != NULL && strcmp(pref, "")) {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
186 prefbase = g_path_get_basename(font_prefs[i]);
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
187 g_string_append_printf(style_string,
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
188 "style \"%s_style\"\n{\n"
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
189 "\tfont_name = \"%s\"\n}"
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
190 "\nwidget \"%s\" "
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
191 "style \"%s_style\"\n",
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
192 prefbase, pref,
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
193 prefbase, prefbase);
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
194 g_free(prefbase);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
195 }
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
196 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
197 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
198
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
199 return style_string;
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
200 }
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
201
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
202 static void
22104
56970903b8e9 Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents: 21955
diff changeset
203 purplerc_make_changes(void)
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
204 {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
205 GString *str = make_gtkrc_string();
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
206 GtkSettings *setting = NULL;
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
207
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
208 gtk_rc_parse_string(str->str);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
209 g_string_free(str, TRUE);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
210
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
211 setting = gtk_settings_get_default();
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
212 gtk_rc_reset_styles(setting);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
213 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
214
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
215 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
216 purplerc_write(GtkWidget *widget, gpointer data)
11940
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
217 {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
218 GString *str = make_gtkrc_string();
33955
55aa58076485 Use https URLs for pidgin.im and developer.pidgin.im.
Mark Doliner <mark@kingant.net>
parents: 33683
diff changeset
219 str = g_string_prepend(str, "# This file automatically written by the Pidgin GTK+ Theme Control plugin.\n# Any changes to this file will be overwritten by the plugin when told to\n# write the settings again.\n# The FAQ (https://developer.pidgin.im/wiki/FAQ) contains some further examples\n# of possible pidgin gtkrc settings.\n");
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
220 purple_util_write_data_to_file("gtkrc-2.0", str->str, -1);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
221 g_string_free(str, TRUE);
11940
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
222 }
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
223
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
224 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
225 purplerc_reread(GtkWidget *widget, gpointer data)
11940
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
226 {
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
227 gtk_rc_reparse_all();
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
228 /* I don't know if this is necessary but if not it shouldn't hurt. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
229 purplerc_make_changes();
11940
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
230 }
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
231
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
232 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
233 purplerc_pref_changed_cb(const char *name, PurplePrefType type,
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
234 gconstpointer value, gpointer data)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
235 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
236 purplerc_make_changes();
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
237 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
238
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
239 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
240 purplerc_color_response(GtkDialog *color_dialog, gint response, gpointer data)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
241 {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
242 gint subscript = GPOINTER_TO_INT(data);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
243
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
244 if (response == GTK_RESPONSE_OK) {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
245 GdkColor color;
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
246 gchar colorstr[8];
30010
2b3e5bbd0492 Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29655
diff changeset
247 GtkWidget *colorsel =
2b3e5bbd0492 Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29655
diff changeset
248 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog));
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
249
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
250 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
251
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
252 g_snprintf(colorstr, sizeof(colorstr), "#%02X%02X%02X",
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
253 color.red/256, color.green/256, color.blue/256);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
254
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
255 purple_prefs_set_string(color_prefs[subscript], colorstr);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
256 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
257 gtk_widget_destroy(GTK_WIDGET(color_dialog));
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
258 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
259
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
260 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
261 purplerc_set_color(GtkWidget *widget, gpointer data)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
262 {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
263 GdkColor color;
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
264 gchar title[128];
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
265 const gchar *pref = NULL;
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
266 GtkWidget *color_dialog = NULL;
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
267 gint subscript = GPOINTER_TO_INT(data);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
268
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
269 g_snprintf(title, sizeof(title), _("Select Color for %s"),
10586
fd1399d550fc [gaim-migrate @ 11990]
Nathan Fredrickson <nathan@silverorange.com>
parents: 10585
diff changeset
270 _(color_names[GPOINTER_TO_INT(data)]));
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
271 color_dialog = gtk_color_selection_dialog_new(_("Select Color"));
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
272 g_signal_connect(G_OBJECT(color_dialog), "response",
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
273 G_CALLBACK(purplerc_color_response), data);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
274
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
275 pref = purple_prefs_get_string(color_prefs[subscript]);
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
276
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
277 if (pref != NULL && strcmp(pref, "")) {
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
278 if (gdk_color_parse(pref, &color)) {
30010
2b3e5bbd0492 Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29655
diff changeset
279 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(
2b3e5bbd0492 Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29655
diff changeset
280 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))),
2b3e5bbd0492 Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29655
diff changeset
281 &color);
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
282 }
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
283 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
284
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
285 gtk_window_present(GTK_WINDOW(color_dialog));
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
286 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
287
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
288 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
289 purplerc_font_response(GtkDialog *font_dialog, gint response, gpointer data)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
290 {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
291 const gchar *prefpath;
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
292 gint subscript = GPOINTER_TO_INT(data);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
293
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
294 if (response == GTK_RESPONSE_OK) {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
295 gchar *fontname = NULL;
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
296
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
297 if (subscript == -1) {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
298 prefpath = "/plugins/gtk/purplerc/gtk-font-name";
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
299 } else {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
300 prefpath = font_prefs[subscript];
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
301 }
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
302
33275
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30010
diff changeset
303 fontname = gtk_font_chooser_get_font(GTK_FONT_CHOOSER(font_dialog));
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
304
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
305 purple_prefs_set_string(prefpath, fontname);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
306 g_free(fontname);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
307 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
308 gtk_widget_destroy(GTK_WIDGET(font_dialog));
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
309 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
310
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
311 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
312 purplerc_set_font(GtkWidget *widget, gpointer data)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
313 {
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
314 gchar title[128];
33275
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30010
diff changeset
315 GtkWindow *window;
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
316 GtkWidget *font_dialog = NULL;
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
317 gint subscript = GPOINTER_TO_INT(data);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
318 const gchar *pref = NULL, *prefpath = NULL;
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
319
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
320 if (subscript == -1) {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
321 g_snprintf(title, sizeof(title), _("Select Interface Font"));
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
322 prefpath = "/plugins/gtk/purplerc/gtk-font-name";
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
323 } else {
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
324 g_snprintf(title, sizeof(title), _("Select Font for %s"),
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
325 _(font_names[subscript]));
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
326 prefpath = font_prefs[subscript];
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
327 }
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
328
33275
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30010
diff changeset
329 window = GTK_WINDOW(gtk_widget_get_toplevel(widget));
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30010
diff changeset
330 font_dialog = gtk_font_chooser_dialog_new(title, window);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
331 g_signal_connect(G_OBJECT(font_dialog), "response",
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
332 G_CALLBACK(purplerc_font_response), data);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
333
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
334 pref = purple_prefs_get_string(prefpath);
14391
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
335
2f28b56b3839 [gaim-migrate @ 17024]
Etan Reisner <deryni@pidgin.im>
parents: 14253
diff changeset
336 if (pref != NULL && strcmp(pref, "")) {
33275
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30010
diff changeset
337 gtk_font_chooser_set_font(GTK_FONT_CHOOSER(font_dialog), pref);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
338 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
339
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
340 gtk_window_present(GTK_WINDOW(font_dialog));
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
341 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
342
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
343 static GtkWidget *
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
344 purplerc_make_interface_vbox(void)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
345 {
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
346 GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
347 GtkSizeGroup *labelsg = NULL;
34307
398577183905 Fix Pidgin's plugins warnings about -Wsign-compare
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33955
diff changeset
348 gsize i;
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
349
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
350 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
351 labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
352
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
353 gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER);
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
354
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
355 for (i = 0; i < G_N_ELEMENTS(color_prefs); i++) {
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15568
diff changeset
356 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
357 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
358
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15442
diff changeset
359 check = pidgin_prefs_checkbox(_(color_names[i]),
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
360 color_prefs_set[i], hbox);
12546
05bcd24d088b [gaim-migrate @ 14864]
Etan Reisner <deryni@pidgin.im>
parents: 12202
diff changeset
361 gtk_size_group_add_widget(labelsg, check);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
362
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
363 color_widgets[i] = pidgin_pixbuf_button_from_stock("",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
364 GTK_STOCK_SELECT_COLOR, PIDGIN_BUTTON_HORIZONTAL);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
365 gtk_box_pack_start(GTK_BOX(hbox), color_widgets[i], FALSE,
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
366 FALSE, 0);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
367 gtk_widget_set_sensitive(color_widgets[i],
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
368 purple_prefs_get_bool(color_prefs_set[i]));
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
369 g_signal_connect(G_OBJECT(check), "toggled",
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15442
diff changeset
370 G_CALLBACK(pidgin_toggle_sensitive),
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
371 color_widgets[i]);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
372 g_signal_connect(G_OBJECT(color_widgets[i]), "clicked",
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
373 G_CALLBACK(purplerc_set_color),
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
374 GINT_TO_POINTER(i));
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
375 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
376
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
377 g_object_unref(labelsg);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
378
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
379 return vbox;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
380 }
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
381
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
382 static GtkWidget *
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
383 purplerc_make_fonts_vbox(void)
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
384 {
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
385 GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
386 GtkSizeGroup *labelsg = NULL;
34307
398577183905 Fix Pidgin's plugins warnings about -Wsign-compare
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33955
diff changeset
387 gsize i;
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
388
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
389 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
390 labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
391
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
392 gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
393
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
394 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
395 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
396
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
397 check = pidgin_prefs_checkbox(_("GTK+ Interface Font"),
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
398 "/plugins/gtk/purplerc/set/gtk-font-name",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
399 hbox);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
400 gtk_size_group_add_widget(labelsg, check);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
401
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
402 widget = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_FONT,
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
403 PIDGIN_BUTTON_HORIZONTAL);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
404 gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
405 gtk_widget_set_sensitive(widget,
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
406 purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-font-name"));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
407 g_signal_connect(G_OBJECT(check), "toggled",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
408 G_CALLBACK(pidgin_toggle_sensitive), widget);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
409 g_signal_connect(G_OBJECT(widget), "clicked",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
410 G_CALLBACK(purplerc_set_font), GINT_TO_POINTER(-1));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
411
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
412 for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) {
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15568
diff changeset
413 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
414 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
415
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15442
diff changeset
416 check = pidgin_prefs_checkbox(_(font_names[i]),
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
417 font_prefs_set[i], hbox);
12546
05bcd24d088b [gaim-migrate @ 14864]
Etan Reisner <deryni@pidgin.im>
parents: 12202
diff changeset
418 gtk_size_group_add_widget(labelsg, check);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
419
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
420 font_widgets[i] = pidgin_pixbuf_button_from_stock("",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
421 GTK_STOCK_SELECT_FONT, PIDGIN_BUTTON_HORIZONTAL);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
422 gtk_box_pack_start(GTK_BOX(hbox), font_widgets[i], FALSE,
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
423 FALSE, 0);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
424 gtk_widget_set_sensitive(font_widgets[i],
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
425 purple_prefs_get_bool(font_prefs_set[i]));
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
426 g_signal_connect(G_OBJECT(check), "toggled",
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15442
diff changeset
427 G_CALLBACK(pidgin_toggle_sensitive),
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
428 font_widgets[i]);
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
429 g_signal_connect(G_OBJECT(font_widgets[i]), "clicked",
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
430 G_CALLBACK(purplerc_set_font),
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
431 GINT_TO_POINTER(i));
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
432 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
433
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
434 g_object_unref(labelsg);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
435
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
436 return vbox;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
437 }
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
438
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
439 static GtkWidget *
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
440 purplerc_make_misc_vbox(void)
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
441 {
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
442 /* Note: Intentionally not using the size group argument to the
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
443 * pidgin_prefs_labeled_* functions they only add the text label to
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
444 * the size group not the whole thing, which isn't what I want. */
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
445 GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
446 GtkSizeGroup *labelsg = NULL;
34307
398577183905 Fix Pidgin's plugins warnings about -Wsign-compare
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33955
diff changeset
447 gsize i;
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
448
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
449 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
450 labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
451
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
452 gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
453
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
454 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
455 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
456
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
457 check = pidgin_prefs_checkbox(_("GTK+ Text Shortcut Theme"),
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
458 "/plugins/gtk/purplerc/set/gtk-key-theme-name",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
459 hbox);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
460 gtk_size_group_add_widget(labelsg, check);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
461
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
462 widget = pidgin_prefs_labeled_entry(hbox, "",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
463 "/plugins/gtk/purplerc/gtk-key-theme-name",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
464 NULL);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
465 gtk_widget_set_sensitive(widget,
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
466 purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name"));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
467 g_signal_connect(G_OBJECT(check), "toggled",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
468 G_CALLBACK(pidgin_toggle_sensitive), widget);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
469
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
470 for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) {
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
471 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
472 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
473
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
474 check = pidgin_prefs_checkbox(_(widget_size_names[i]),
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
475 widget_size_prefs_set[i], hbox);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
476 gtk_size_group_add_widget(labelsg, check);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
477
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
478 widget_size_widgets[i] = pidgin_prefs_labeled_spin_button(hbox, "", widget_size_prefs[i], 0, 50, NULL);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
479 gtk_widget_set_sensitive(widget_size_widgets[i],
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
480 purple_prefs_get_bool(widget_size_prefs_set[i]));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
481 g_signal_connect(G_OBJECT(check), "toggled",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
482 G_CALLBACK(pidgin_toggle_sensitive),
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
483 widget_size_widgets[i]);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
484 }
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
485
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
486 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
487 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
488
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
489 check = pidgin_prefs_checkbox(_("Disable Typing Notification Text"),
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
490 "/plugins/gtk/purplerc/set/disable-typing-notification", hbox);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
491
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
492 /* Widget boolean stuff */
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
493 /*
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
494 for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) {
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
495 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
496 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
497
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
498 check = pidgin_prefs_checkbox(_(widget_bool_names[i]),
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
499 widget_bool_prefs_set[i], hbox);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
500 gtk_size_group_add_widget(labelsg, check);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
501
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
502 widget_bool_widgets[i] = pidgin_prefs_checkbox("", widget_bool_prefs[i], hbox);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
503
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
504 gtk_widget_set_sensitive(widget_bool_widgets[i],
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
505 purple_prefs_get_bool(widget_bool_prefs_set[i]));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
506 g_signal_connect(G_OBJECT(check), "toggled",
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
507 G_CALLBACK(pidgin_toggle_sensitive),
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
508 widget_bool_widgets[i]);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
509 }
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
510 */
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
511
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
512 g_object_unref(labelsg);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
513
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
514 return vbox;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
515 }
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
516
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
517 static GtkWidget *
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
518 purplerc_get_config_frame(PurplePlugin *plugin)
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
519 {
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
520 gchar *tmp;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
521 GtkWidget *check = NULL, *label = NULL;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
522 GtkWidget *ret = NULL, *hbox = NULL, *frame = NULL, *note = NULL;
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
523 #ifndef _WIN32
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
524 const gchar *homepath = "$HOME";
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
525 #else
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
526 const gchar *homepath = "\%APPDATA\%";
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
527 #endif
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
528
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
529 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
530 note = gtk_notebook_new();
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
531 label = gtk_label_new(NULL);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
532 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
533
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
534 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
535
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
536 tmp = g_strdup_printf("<span weight=\"bold\">%s</span>", _("GTK+ Theme Control Settings"));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
537 gtk_label_set_markup(GTK_LABEL(label), tmp);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
538 g_free(tmp);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
539
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
540 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
541 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
542 gtk_box_pack_start(GTK_BOX(ret), note, FALSE, FALSE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
543
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
544 label = gtk_label_new(_("Colors"));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
545 gtk_notebook_insert_page(GTK_NOTEBOOK(note), purplerc_make_interface_vbox(), label, -1);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
546
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
547 label = gtk_label_new(_("Fonts"));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
548 gtk_notebook_insert_page(GTK_NOTEBOOK(note), purplerc_make_fonts_vbox(), label, -1);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
549
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
550 label = gtk_label_new(_("Miscellaneous"));
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
551 gtk_notebook_insert_page(GTK_NOTEBOOK(note), purplerc_make_misc_vbox(), label, -1);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
552
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
553 gtk_box_pack_start(GTK_BOX(ret), gtk_hseparator_new(), TRUE, TRUE, 0);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
554
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
555 frame = pidgin_make_frame(ret, _("Gtkrc File Tools"));
11940
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
556
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
557 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
558 gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0);
11940
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
559
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
560 tmp = g_strdup_printf(_("Write settings to %s%sgtkrc-2.0"),
21720
235394d5c7f4 Pull a bunch of bugfix only changes to im.pidgin.pidgin.2.3.1,
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21127
diff changeset
561 homepath, G_DIR_SEPARATOR_S ".purple" G_DIR_SEPARATOR_S);
12042
b90399880391 [gaim-migrate @ 14337]
Richard Laager <rlaager@pidgin.im>
parents: 11941
diff changeset
562 check = gtk_button_new_with_label(tmp);
b90399880391 [gaim-migrate @ 14337]
Richard Laager <rlaager@pidgin.im>
parents: 11941
diff changeset
563 g_free(tmp);
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
564 gtk_box_pack_start(GTK_BOX(hbox), check, TRUE, TRUE, 0);
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
565 g_signal_connect(G_OBJECT(check), "clicked",
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
566 G_CALLBACK(purplerc_write), NULL);
11940
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
567
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
568 check = gtk_button_new_with_label(_("Re-read gtkrc files"));
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
569 gtk_box_pack_start(GTK_BOX(hbox), check, TRUE, TRUE, 0);
18242
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
570 g_signal_connect(G_OBJECT(check), "clicked",
899ccffe6c26 Some general cleanup of the pidginrc plugin that I did while working on my
Etan Reisner <deryni@pidgin.im>
parents: 17247
diff changeset
571 G_CALLBACK(purplerc_reread), NULL);
11940
e6a5c1439512 [gaim-migrate @ 14231]
Etan Reisner <deryni@pidgin.im>
parents: 11862
diff changeset
572
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
573 gtk_widget_show_all(ret);
21127
c6347aed1fb0 Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents: 21106
diff changeset
574
c6347aed1fb0 Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents: 21106
diff changeset
575
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
576 return ret;
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
577 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
578
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
579 static PidginPluginInfo *
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
580 purplerc_plugin_query(GError **error)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
581 {
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
582 const gchar * const authors[] = {
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
583 "Etan Reisner <deryni@pidgin.im>",
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
584 NULL
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
585 };
16749
14a3fdc0aed7 Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16073
diff changeset
586
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
587 return pidgin_plugin_info_new(
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
588 "id", "purplerc",
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
589 "name", N_("Pidgin GTK+ Theme Control"),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
590 "version", DISPLAY_VERSION,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
591 "category", N_("Theming"),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
592 "summary", N_("Provides access to commonly used gtkrc "
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
593 "settings."),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
594 "description", N_("Provides access to commonly used gtkrc "
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
595 "settings."),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
596 "authors", authors,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
597 "website", PURPLE_WEBSITE,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
598 "abi-version", PURPLE_ABI_VERSION,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
599 "pidgin-config-frame", purplerc_get_config_frame,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
600 NULL
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
601 );
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
602 }
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
603
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
604 static gboolean
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
605 purplerc_plugin_load(PurplePlugin *plugin, GError **error)
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
606 {
34307
398577183905 Fix Pidgin's plugins warnings about -Wsign-compare
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33955
diff changeset
607 gsize i;
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
608
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
609 purple_prefs_add_none("/plugins");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
610 purple_prefs_add_none("/plugins/gtk");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
611 purple_prefs_add_none("/plugins/gtk/purplerc");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
612 purple_prefs_add_none("/plugins/gtk/purplerc/set");
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
613
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
614 purple_prefs_add_string("/plugins/gtk/purplerc/gtk-font-name", "");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
615 purple_prefs_add_bool("/plugins/gtk/purplerc/set/gtk-font-name", FALSE);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
616
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
617 purple_prefs_add_string("/plugins/gtk/purplerc/gtk-key-theme-name", "");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
618 purple_prefs_add_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name", FALSE);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
619
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
620 purple_prefs_add_none("/plugins/gtk/purplerc/color");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
621 purple_prefs_add_none("/plugins/gtk/purplerc/set/color");
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
622 for (i = 0; i < G_N_ELEMENTS(color_prefs); i++) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
623 purple_prefs_add_string(color_prefs[i], "");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
624 purple_prefs_add_bool(color_prefs_set[i], FALSE);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
625 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
626
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
627 purple_prefs_add_none("/plugins/gtk/purplerc/size");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
628 purple_prefs_add_none("/plugins/gtk/purplerc/set/size");
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
629 for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
630 purple_prefs_add_int(widget_size_prefs[i], 0);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
631 purple_prefs_add_bool(widget_size_prefs_set[i], FALSE);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
632 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
633
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
634 purple_prefs_add_none("/plugins/gtk/purplerc/font");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
635 purple_prefs_add_none("/plugins/gtk/purplerc/set/font");
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
636 for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
637 purple_prefs_add_string(font_prefs[i], "");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
638 purple_prefs_add_bool(font_prefs_set[i], FALSE);
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
639 }
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
640
17209
bfccb73d3ea1 Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents: 17096
diff changeset
641 /*
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
642 purple_prefs_add_none("/plugins/gtk/purplerc/bool");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
643 purple_prefs_add_none("/plugins/gtk/purplerc/set/bool");
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
644 for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
645 purple_prefs_add_bool(widget_bool_prefs[i], TRUE);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15882
diff changeset
646 purple_prefs_add_bool(widget_bool_prefs_set[i], FALSE);
12973
2691b5621836 [gaim-migrate @ 15326]
Etan Reisner <deryni@pidgin.im>
parents: 12816
diff changeset
647 }
17209
bfccb73d3ea1 Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents: 17096
diff changeset
648 */
27269
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
649
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
650 purple_prefs_add_bool("/plugins/gtk/purplerc/disable-typing-notification", FALSE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
651 purple_prefs_add_bool("/plugins/gtk/purplerc/set/disable-typing-notification", FALSE);
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
652
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
653 /* remove old cursor color prefs */
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
654 purple_prefs_remove("/plugins/gtk/purplerc/color/GtkWidget::cursor-color");
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
655 purple_prefs_remove("/plugins/gtk/purplerc/color/GtkWidget::secondary-cursor-color");
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
656 purple_prefs_remove("/plugins/gtk/purplerc/set/color/GtkWidget::cursor-color");
77c9c61baf6e This change is probably going to spark some debate about the pidginrc plugin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 24328
diff changeset
657 purple_prefs_remove("/plugins/gtk/purplerc/set/color/GtkWidget::secondary-cursor-color");
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
658
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
659 purplerc_make_changes();
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
660
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
661 pref_callback = purple_prefs_connect_callback(plugin,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
662 "/plugins/gtk/purplerc",
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
663 purplerc_pref_changed_cb,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
664 NULL);
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
665
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
666 return TRUE;
10584
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
667 }
ffa83a43a77d [gaim-migrate @ 11988]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
668
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
669 static gboolean
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
670 purplerc_plugin_unload(PurplePlugin *plugin, GError **error)
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
671 {
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
672 purple_prefs_disconnect_callback(pref_callback);
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
673
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
674 return TRUE;
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
675 }
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
676
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34307
diff changeset
677 PURPLE_PLUGIN_INIT(purplerc, purplerc_plugin_query, purplerc_plugin_load, purplerc_plugin_unload);

mercurial