Sat, 19 May 2007 21:38:47 +0000
merge of '1442df274a24edc9a31194327bd00dfbcf478720'
and 'ce02548a6b6a545d97fb3f371506bcf1b5cc5131'
| 10584 | 1 | /** |
| 15884 | 2 | * @file purplerc.c Purple gtk resource control plugin. |
| 10584 | 3 | * |
| 4 | * Copyright (C) 2005 Etan Reisner <deryni@eden.rutgers.edu> | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 19 | */ | |
| 20 | ||
| 21 | #include "internal.h" | |
| 22 | #include "gtkplugin.h" | |
| 23 | #include "gtkprefs.h" | |
| 24 | #include "gtkutils.h" | |
|
12044
e49179a1496a
[gaim-migrate @ 14339]
Richard Laager <rlaager@pidgin.im>
parents:
12042
diff
changeset
|
25 | #include "util.h" |
| 10584 | 26 | #include "version.h" |
| 27 | ||
| 28 | static guint pref_callback; | |
| 29 | ||
| 30 | static const char *color_prefs[] = { | |
| 15884 | 31 | "/plugins/gtk/purplerc/color/GtkWidget::cursor-color", |
| 32 | "/plugins/gtk/purplerc/color/GtkWidget::secondary-cursor-color", | |
| 33 | "/plugins/gtk/purplerc/color/GtkIMHtml::hyperlink-color" | |
| 10584 | 34 | }; |
| 35 | static const char *color_prefs_set[] = { | |
| 15884 | 36 | "/plugins/gtk/purplerc/set/color/GtkWidget::cursor-color", |
| 37 | "/plugins/gtk/purplerc/set/color/GtkWidget::secondary-cursor-color", | |
| 38 | "/plugins/gtk/purplerc/set/color/GtkIMHtml::hyperlink-color" | |
| 10584 | 39 | }; |
| 40 | static const char *color_names[] = { | |
|
10585
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
41 | N_("Cursor Color"), |
|
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
42 | N_("Secondary Cursor Color"), |
|
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
43 | N_("Hyperlink Color") |
| 10584 | 44 | }; |
| 45 | static GtkWidget *color_widgets[G_N_ELEMENTS(color_prefs)]; | |
| 46 | ||
| 47 | static const char *widget_size_prefs[] = { | |
| 15884 | 48 | "/plugins/gtk/purplerc/size/GtkTreeView::expander_size", |
| 49 | "/plugins/gtk/purplerc/size/GtkTreeView::horizontal_separator" | |
| 10584 | 50 | }; |
| 51 | static const char *widget_size_prefs_set[] = { | |
| 15884 | 52 | "/plugins/gtk/purplerc/set/size/GtkTreeView::expander_size", |
| 53 | "/plugins/gtk/purplerc/set/size/GtkTreeView::horizontal_separator" | |
| 10584 | 54 | }; |
| 55 | static const char *widget_size_names[] = { | |
| 12201 | 56 | N_("GtkTreeView Expander Size"), |
| 57 | N_("GtkTreeView Horizontal Separation") | |
| 10584 | 58 | }; |
| 59 | static GtkWidget *widget_size_widgets[G_N_ELEMENTS(widget_size_prefs)]; | |
| 60 | ||
| 61 | static const char *font_prefs[] = { | |
| 15884 | 62 | "/plugins/gtk/purplerc/font/*pidgin_conv_entry", |
| 63 | "/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
|
64 | "/plugins/gtk/purplerc/font/*pidgin_log_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
|
65 | "/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
|
66 | "/plugins/gtk/purplerc/font/*pidgin_notify_imhtml", |
| 10584 | 67 | }; |
| 68 | static const char *font_prefs_set[] = { | |
| 15884 | 69 | "/plugins/gtk/purplerc/set/font/*pidgin_conv_entry", |
| 70 | "/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
|
71 | "/plugins/gtk/purplerc/set/font/*pidgin_log_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
|
72 | "/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
|
73 | "/plugins/gtk/purplerc/set/font/*pidgin_notify_imhtml", |
| 10584 | 74 | }; |
| 75 | static const char *font_names[] = { | |
|
10585
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
76 | N_("Conversation Entry"), |
|
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
77 | N_("Conversation History"), |
|
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
78 | N_("Log Viewer"), |
|
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
79 | N_("Request Dialog"), |
|
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
80 | N_("Notify Dialog") |
| 10584 | 81 | }; |
| 82 | static GtkWidget *font_widgets[G_N_ELEMENTS(font_prefs)]; | |
| 83 | ||
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
84 | /* |
| 12973 | 85 | static const char *widget_bool_prefs[] = { |
| 86 | }; | |
| 87 | static const char *widget_bool_prefs_set[] = { | |
| 88 | }; | |
| 89 | static const char *widget_bool_names[] = { | |
| 90 | }; | |
| 91 | 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
|
92 | */ |
| 12973 | 93 | |
| 10584 | 94 | static void |
| 15884 | 95 | purplerc_make_changes() |
| 10584 | 96 | { |
| 97 | int i; | |
| 12973 | 98 | char *prefbase = NULL; |
| 99 | #if GTK_CHECK_VERSION(2,4,0) | |
| 100 | GtkSettings *setting = NULL; | |
| 101 | #endif | |
| 10584 | 102 | GString *style_string = g_string_new(""); |
| 103 | ||
| 15884 | 104 | if (purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-font-name")) { |
| 105 | const char *pref = purple_prefs_get_string("/plugins/gtk/purplerc/gtk-font-name"); | |
| 14391 | 106 | |
| 107 | if (pref != NULL && strcmp(pref, "")) | |
| 108 | g_string_append_printf(style_string, "gtk-font-name = \"%s\"\n", pref); | |
| 10584 | 109 | } |
| 110 | ||
| 15884 | 111 | if (purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name")) { |
| 112 | const char *pref = purple_prefs_get_string("/plugins/gtk/purplerc/gtk-key-theme-name"); | |
| 14391 | 113 | |
| 114 | if (pref != NULL && strcmp(pref, "")) | |
| 115 | g_string_append_printf(style_string, "gtk-key-theme-name = \"%s\"\n", pref); | |
| 10584 | 116 | } |
| 117 | ||
| 15884 | 118 | g_string_append(style_string, "style \"purplerc_style\" {\n"); |
| 10584 | 119 | |
| 120 | for (i = 0; i < G_N_ELEMENTS(color_prefs); i++) { | |
| 15884 | 121 | if (purple_prefs_get_bool(color_prefs_set[i])) { |
| 14391 | 122 | const char *pref; |
| 123 | ||
| 10584 | 124 | prefbase = g_path_get_basename(color_prefs[i]); |
| 15884 | 125 | pref = purple_prefs_get_string(color_prefs[i]); |
| 14391 | 126 | |
| 127 | if (pref != NULL && strcmp(pref, "")) | |
| 128 | g_string_append_printf(style_string, | |
| 129 | "%s = \"%s\"\n", | |
| 130 | prefbase, pref); | |
| 10584 | 131 | g_free(prefbase); |
| 132 | } | |
| 133 | } | |
| 134 | ||
| 135 | for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) { | |
| 15884 | 136 | if (purple_prefs_get_bool(widget_size_prefs_set[i])) { |
| 10584 | 137 | prefbase = g_path_get_basename(widget_size_prefs[i]); |
| 138 | g_string_append_printf(style_string, | |
|
11862
5d4bc6d54688
[gaim-migrate @ 14153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10814
diff
changeset
|
139 | "%s = %d\n", prefbase, |
| 15884 | 140 | purple_prefs_get_int(widget_size_prefs[i])); |
| 10584 | 141 | g_free(prefbase); |
| 142 | } | |
| 143 | } | |
| 144 | ||
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
145 | /* |
| 12973 | 146 | for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) { |
| 15884 | 147 | if (purple_prefs_get_bool(widget_bool_prefs_set[i])) { |
| 12973 | 148 | prefbase = g_path_get_basename(widget_bool_prefs[i]); |
| 149 | g_string_append_printf(style_string, | |
| 150 | "%s = %d\n", prefbase, | |
| 15884 | 151 | purple_prefs_get_bool(widget_bool_prefs[i])); |
| 12973 | 152 | g_free(prefbase); |
| 153 | } | |
| 154 | } | |
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
155 | */ |
| 12973 | 156 | |
| 10584 | 157 | g_string_append(style_string, "}"); |
| 15884 | 158 | g_string_append(style_string, "widget_class \"*\" style \"purplerc_style\"\n"); |
| 10584 | 159 | |
| 160 | for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) { | |
| 15884 | 161 | if (purple_prefs_get_bool(font_prefs_set[i])) { |
| 14391 | 162 | const char *pref; |
| 163 | ||
| 10584 | 164 | prefbase = g_path_get_basename(font_prefs[i]); |
| 15884 | 165 | pref = purple_prefs_get_string(font_prefs[i]); |
| 14391 | 166 | |
| 167 | if (pref != NULL && strcmp(pref, "")) | |
| 168 | g_string_append_printf(style_string, | |
| 169 | "style \"%s_style\"\n" | |
| 170 | "{font_name = \"%s\"}\n" | |
|
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
|
171 | "widget \"%s\" " |
| 14391 | 172 | "style \"%s_style\"\n", |
| 173 | prefbase, pref, | |
| 174 | prefbase, prefbase); | |
| 10584 | 175 | g_free(prefbase); |
| 176 | } | |
| 177 | } | |
| 178 | ||
| 179 | gtk_rc_parse_string(style_string->str); | |
| 12973 | 180 | g_string_free(style_string, TRUE); |
| 10584 | 181 | |
| 12973 | 182 | #if GTK_CHECK_VERSION(2,4,0) |
| 183 | setting = gtk_settings_get_default(); | |
| 184 | gtk_rc_reset_styles(setting); | |
| 185 | #endif | |
| 10584 | 186 | } |
| 187 | ||
| 188 | static void | |
| 15884 | 189 | purplerc_write(GtkWidget *widget, gpointer data) |
| 11940 | 190 | { |
| 191 | int i; | |
| 192 | GString *style_string = g_string_new(""); | |
| 193 | char *prefbase = NULL; | |
| 194 | ||
| 15884 | 195 | if (purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-font-name")) { |
| 196 | const char *pref = purple_prefs_get_string("/plugins/gtk/purplerc/gtk-font-name"); | |
| 14391 | 197 | |
| 198 | if (pref != NULL && strcmp(pref, "")) | |
| 199 | g_string_append_printf(style_string, | |
| 200 | "gtk-font-name = \"%s\"\n", | |
| 201 | pref); | |
| 11940 | 202 | } |
| 203 | ||
| 15884 | 204 | if (purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name")) { |
| 205 | const char *pref = purple_prefs_get_string("/plugins/gtk/purplerc/gtk-key-theme-name"); | |
| 14391 | 206 | |
| 207 | if (pref != NULL && strcmp(pref, "")) | |
| 208 | g_string_append_printf(style_string, | |
| 209 | "gtk-key-theme-name = \"%s\"\n", | |
| 210 | pref); | |
| 11940 | 211 | } |
| 212 | ||
| 15884 | 213 | g_string_append(style_string, "style \"purplerc_style\" {\n"); |
| 11940 | 214 | |
| 215 | for (i = 0; i < G_N_ELEMENTS(color_prefs); i++) { | |
| 15884 | 216 | if (purple_prefs_get_bool(color_prefs_set[i])) { |
| 14391 | 217 | const char *pref; |
| 218 | ||
| 11940 | 219 | prefbase = g_path_get_basename(color_prefs[i]); |
| 15884 | 220 | pref = purple_prefs_get_string(color_prefs[i]); |
| 14391 | 221 | |
| 222 | if (pref != NULL && strcmp(pref, "")) | |
| 223 | g_string_append_printf(style_string, | |
| 224 | "%s = \"%s\"\n", | |
| 225 | prefbase, pref); | |
| 11940 | 226 | g_free(prefbase); |
| 227 | } | |
| 228 | } | |
| 229 | ||
| 230 | for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) { | |
| 15884 | 231 | if (purple_prefs_get_bool(widget_size_prefs_set[i])) { |
| 11940 | 232 | prefbase = g_path_get_basename(widget_size_prefs[i]); |
| 233 | g_string_append_printf(style_string, | |
| 234 | "%s = %d\n", prefbase, | |
| 15884 | 235 | purple_prefs_get_int(widget_size_prefs[i])); |
| 11940 | 236 | g_free(prefbase); |
| 237 | } | |
| 238 | } | |
| 239 | ||
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
240 | /* |
| 12973 | 241 | for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) { |
| 15884 | 242 | if (purple_prefs_get_bool(widget_bool_prefs_set[i])) { |
| 12973 | 243 | prefbase = g_path_get_basename(widget_bool_prefs[i]); |
| 244 | g_string_append_printf(style_string, | |
| 245 | "%s = %d\n", prefbase, | |
| 15884 | 246 | purple_prefs_get_bool(widget_bool_prefs[i])); |
| 12973 | 247 | g_free(prefbase); |
| 248 | } | |
| 249 | } | |
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
250 | */ |
| 12973 | 251 | |
| 11940 | 252 | g_string_append(style_string, "}"); |
| 15884 | 253 | g_string_append(style_string, "widget_class \"*\" style \"purplerc_style\"\n"); |
| 11940 | 254 | |
| 255 | for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) { | |
| 15884 | 256 | if (purple_prefs_get_bool(font_prefs_set[i])) { |
| 14391 | 257 | const char *pref; |
| 258 | ||
| 11940 | 259 | prefbase = g_path_get_basename(font_prefs[i]); |
| 15884 | 260 | pref = purple_prefs_get_string(font_prefs[i]); |
| 14391 | 261 | |
| 262 | if (pref != NULL && strcmp(pref, "")) | |
| 263 | g_string_append_printf(style_string, | |
| 264 | "style \"%s_style\"\n" | |
| 265 | "{font_name = \"%s\"}\n" | |
|
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
|
266 | "widget \"%s\" " |
| 14391 | 267 | "style \"%s_style\"\n", |
| 268 | prefbase, pref, | |
| 269 | prefbase, prefbase); | |
| 11940 | 270 | g_free(prefbase); |
| 271 | } | |
| 272 | } | |
| 273 | ||
| 15884 | 274 | purple_util_write_data_to_file("gtkrc-2.0", style_string->str, -1); |
| 11940 | 275 | |
| 276 | g_string_free(style_string, TRUE); | |
| 277 | } | |
| 278 | ||
| 279 | static void | |
| 15884 | 280 | purplerc_reread(GtkWidget *widget, gpointer data) |
| 11940 | 281 | { |
| 282 | gtk_rc_reparse_all(); | |
| 12973 | 283 | /* I don't know if this is necessary but if not it shouldn't hurt. */ |
| 15884 | 284 | purplerc_make_changes(); |
| 11940 | 285 | } |
| 286 | ||
| 287 | static void | |
| 15884 | 288 | purplerc_pref_changed_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12600
diff
changeset
|
289 | gconstpointer value, gpointer data) |
| 10584 | 290 | { |
| 15884 | 291 | purplerc_make_changes(); |
| 10584 | 292 | } |
| 293 | ||
| 294 | static void | |
| 15884 | 295 | purplerc_color_response(GtkDialog *color_dialog, gint response, gpointer data) |
| 10584 | 296 | { |
| 297 | int subscript = GPOINTER_TO_INT(data); | |
| 298 | ||
| 299 | if (response == GTK_RESPONSE_OK) { | |
| 300 | GtkWidget *colorsel = GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel; | |
| 301 | GdkColor color; | |
| 302 | char colorstr[8]; | |
| 303 | ||
| 304 | gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color); | |
| 305 | ||
| 306 | g_snprintf(colorstr, sizeof(colorstr), "#%02X%02X%02X", | |
| 307 | color.red/256, color.green/256, color.blue/256); | |
| 308 | ||
| 15884 | 309 | purple_prefs_set_string(color_prefs[subscript], colorstr); |
| 10584 | 310 | } |
| 311 | gtk_widget_destroy(GTK_WIDGET(color_dialog)); | |
| 312 | } | |
| 313 | ||
| 314 | static void | |
| 15884 | 315 | purplerc_set_color(GtkWidget *widget, gpointer data) |
| 10584 | 316 | { |
| 317 | GtkWidget *color_dialog = NULL; | |
| 318 | GdkColor color; | |
| 319 | char title[128]; | |
| 14391 | 320 | const char *pref = NULL; |
| 10584 | 321 | int subscript = GPOINTER_TO_INT(data); |
| 322 | ||
| 323 | g_snprintf(title, sizeof(title), _("Select Color for %s"), | |
|
10586
fd1399d550fc
[gaim-migrate @ 11990]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10585
diff
changeset
|
324 | _(color_names[GPOINTER_TO_INT(data)])); |
| 10584 | 325 | color_dialog = gtk_color_selection_dialog_new(_("Select Color")); |
| 326 | g_signal_connect(G_OBJECT(color_dialog), "response", | |
| 15884 | 327 | G_CALLBACK(purplerc_color_response), data); |
| 10584 | 328 | |
| 15884 | 329 | pref = purple_prefs_get_string(color_prefs[subscript]); |
| 14391 | 330 | |
| 331 | if (pref != NULL && strcmp(pref, "")) { | |
| 332 | if (gdk_color_parse(pref, &color)) { | |
| 333 | gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &color); | |
| 334 | } | |
| 10584 | 335 | } |
| 336 | ||
| 337 | gtk_window_present(GTK_WINDOW(color_dialog)); | |
| 338 | } | |
| 339 | ||
| 340 | static void | |
| 15884 | 341 | purplerc_font_response(GtkDialog *font_dialog, gint response, gpointer data) |
| 10584 | 342 | { |
| 343 | int subscript = GPOINTER_TO_INT(data); | |
| 344 | ||
| 345 | if (response == GTK_RESPONSE_OK) { | |
| 346 | char *fontname = NULL; | |
| 347 | ||
| 348 | fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(font_dialog)); | |
| 349 | ||
| 15884 | 350 | purple_prefs_set_string(font_prefs[subscript], fontname); |
| 10584 | 351 | g_free(fontname); |
| 352 | } | |
| 353 | gtk_widget_destroy(GTK_WIDGET(font_dialog)); | |
| 354 | } | |
| 355 | ||
| 356 | static void | |
| 15884 | 357 | purplerc_set_font(GtkWidget *widget, gpointer data) |
| 10584 | 358 | { |
| 359 | GtkWidget *font_dialog = NULL; | |
| 360 | char title[128]; | |
| 14391 | 361 | const char *pref = NULL; |
| 10584 | 362 | int subscript = GPOINTER_TO_INT(data); |
| 363 | ||
| 364 | g_snprintf(title, sizeof(title), _("Select Font for %s"), | |
|
10586
fd1399d550fc
[gaim-migrate @ 11990]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10585
diff
changeset
|
365 | _(font_names[subscript])); |
| 10584 | 366 | font_dialog = gtk_font_selection_dialog_new(title); |
| 367 | g_signal_connect(G_OBJECT(font_dialog), "response", | |
| 15884 | 368 | G_CALLBACK(purplerc_font_response), data); |
| 10584 | 369 | |
| 15884 | 370 | pref = purple_prefs_get_string(font_prefs[subscript]); |
| 14391 | 371 | |
| 372 | if (pref != NULL && strcmp(pref, "")) { | |
| 373 | gtk_font_selection_set_font_name(GTK_FONT_SELECTION(GTK_FONT_SELECTION_DIALOG(font_dialog)->fontsel), pref); | |
| 10584 | 374 | } |
| 375 | ||
| 376 | gtk_window_present(GTK_WINDOW(font_dialog)); | |
| 377 | } | |
| 378 | ||
| 379 | static void | |
| 15884 | 380 | purplerc_font_response_special(GtkDialog *font_dialog, gint response, |
| 10584 | 381 | gpointer data) |
| 382 | { | |
| 383 | if (response == GTK_RESPONSE_OK) { | |
| 384 | char *fontname = NULL; | |
| 385 | ||
| 386 | fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(font_dialog)); | |
| 387 | ||
| 15884 | 388 | purple_prefs_set_string("/plugins/gtk/purplerc/gtk-font-name", |
| 10584 | 389 | fontname); |
| 390 | g_free(fontname); | |
| 391 | } | |
| 392 | gtk_widget_destroy(GTK_WIDGET(font_dialog)); | |
| 393 | } | |
| 394 | ||
| 395 | static void | |
| 15884 | 396 | purplerc_set_font_special(GtkWidget *widget, gpointer data) |
| 10584 | 397 | { |
| 398 | GtkWidget *font_dialog = NULL; | |
| 14391 | 399 | const char *pref = NULL; |
| 10584 | 400 | |
| 401 | font_dialog = gtk_font_selection_dialog_new(_("Select Interface Font")); | |
| 402 | g_signal_connect(G_OBJECT(font_dialog), "response", | |
| 15884 | 403 | G_CALLBACK(purplerc_font_response_special), NULL); |
| 10584 | 404 | |
| 15884 | 405 | pref = purple_prefs_get_string("/plugins/gtk/purplerc/gtk-font-name"); |
| 14391 | 406 | |
| 407 | if (pref != NULL && strcmp(pref, "")) { | |
| 408 | gtk_font_selection_set_font_name(GTK_FONT_SELECTION(GTK_FONT_SELECTION_DIALOG(font_dialog)->fontsel), pref); | |
| 10584 | 409 | } |
| 410 | ||
| 411 | gtk_window_present(GTK_WINDOW(font_dialog)); | |
| 412 | } | |
| 413 | ||
| 414 | static gboolean | |
| 15884 | 415 | purplerc_plugin_load(PurplePlugin *plugin) |
| 10584 | 416 | { |
| 15884 | 417 | purplerc_make_changes(); |
| 10584 | 418 | |
| 15884 | 419 | pref_callback = purple_prefs_connect_callback(plugin, "/plugins/gtk/purplerc", |
| 420 | purplerc_pref_changed_cb, NULL); | |
| 10584 | 421 | |
| 422 | return TRUE; | |
| 423 | } | |
| 424 | ||
| 425 | static gboolean | |
| 15884 | 426 | purplerc_plugin_unload(PurplePlugin *plugin) |
| 10584 | 427 | { |
| 15884 | 428 | purple_prefs_disconnect_callback(pref_callback); |
| 10584 | 429 | |
| 430 | return TRUE; | |
| 431 | } | |
| 432 | ||
| 433 | static GtkWidget * | |
| 15884 | 434 | purplerc_get_config_frame(PurplePlugin *plugin) |
| 10584 | 435 | { |
| 12546 | 436 | /* Note: Intentionally not using the size group argument to the |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
437 | * pidgin_prefs_labeled_* functions they only add the text label to |
| 12546 | 438 | * the size group not the whole thing, which isn't what I want. */ |
| 10584 | 439 | int i; |
|
12042
b90399880391
[gaim-migrate @ 14337]
Richard Laager <rlaager@pidgin.im>
parents:
11941
diff
changeset
|
440 | char *tmp; |
| 12546 | 441 | GtkWidget *check = NULL, *widget = NULL; |
| 442 | GtkSizeGroup *labelsg = NULL, *widgetsg = NULL; | |
| 443 | GtkWidget *ret = NULL, *frame = NULL, *hbox = NULL, *vbox = NULL; | |
| 10584 | 444 | |
| 15882 | 445 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 446 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); | |
| 10584 | 447 | |
| 12546 | 448 | labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 449 | widgetsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 10584 | 450 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
451 | frame = pidgin_make_frame(ret, _("General")); |
| 10584 | 452 | /* interface font */ |
| 15882 | 453 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 10584 | 454 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 455 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
456 | check = pidgin_prefs_checkbox(_("GTK+ Interface Font"), |
| 15884 | 457 | "/plugins/gtk/purplerc/set/gtk-font-name", |
| 10584 | 458 | hbox); |
| 12546 | 459 | gtk_size_group_add_widget(labelsg, check); |
| 10584 | 460 | |
| 15568 | 461 | widget = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_FONT, |
| 462 | PIDGIN_BUTTON_HORIZONTAL); | |
| 10584 | 463 | gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0); |
| 12546 | 464 | gtk_size_group_add_widget(widgetsg, widget); |
| 10584 | 465 | gtk_widget_set_sensitive(widget, |
| 15884 | 466 | purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-font-name")); |
| 10584 | 467 | g_signal_connect(G_OBJECT(check), "toggled", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
468 | G_CALLBACK(pidgin_toggle_sensitive), widget); |
| 10584 | 469 | g_signal_connect(G_OBJECT(widget), "clicked", |
| 15884 | 470 | G_CALLBACK(purplerc_set_font_special), NULL); |
| 10584 | 471 | |
| 472 | /* key theme name */ | |
| 15882 | 473 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 10584 | 474 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 475 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
476 | check = pidgin_prefs_checkbox(_("GTK+ Text Shortcut Theme"), |
| 15884 | 477 | "/plugins/gtk/purplerc/set/gtk-key-theme-name", |
| 10584 | 478 | hbox); |
| 12546 | 479 | gtk_size_group_add_widget(labelsg, check); |
| 10584 | 480 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
481 | widget = pidgin_prefs_labeled_entry(hbox, "", |
| 15884 | 482 | "/plugins/gtk/purplerc/gtk-key-theme-name", |
| 10584 | 483 | NULL); |
| 12546 | 484 | /* |
| 485 | gtk_size_group_add_widget(widgetsg, widget); | |
| 486 | */ | |
| 10584 | 487 | gtk_widget_set_sensitive(widget, |
| 15884 | 488 | purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name")); |
| 10584 | 489 | g_signal_connect(G_OBJECT(check), "toggled", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
490 | G_CALLBACK(pidgin_toggle_sensitive), widget); |
| 10584 | 491 | |
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
492 | /* |
| 12973 | 493 | for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) { |
| 15882 | 494 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 12973 | 495 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 496 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
497 | check = pidgin_prefs_checkbox(_(widget_bool_names[i]), |
| 12973 | 498 | widget_bool_prefs_set[i], hbox); |
| 499 | gtk_size_group_add_widget(labelsg, check); | |
| 500 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
501 | widget_bool_widgets[i] = pidgin_prefs_checkbox("", widget_bool_prefs[i], hbox); |
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
502 | * |
| 12973 | 503 | gtk_size_group_add_widget(widgetsb, widget_bool_widgets[i]); |
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
504 | * |
| 12973 | 505 | gtk_widget_set_sensitive(widget_bool_widgets[i], |
| 15884 | 506 | purple_prefs_get_bool(widget_bool_prefs_set[i])); |
| 12973 | 507 | g_signal_connect(G_OBJECT(check), "toggled", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
508 | G_CALLBACK(pidgin_toggle_sensitive), |
| 12973 | 509 | widget_bool_widgets[i]); |
| 510 | } | |
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
511 | */ |
| 12973 | 512 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
513 | frame = pidgin_make_frame(ret, _("Interface colors")); |
| 10584 | 514 | /* imhtml stuff */ |
| 515 | for (i = 0; i < G_N_ELEMENTS(color_prefs); i++) { | |
| 15882 | 516 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 10584 | 517 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 518 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
519 | check = pidgin_prefs_checkbox(_(color_names[i]), |
| 10584 | 520 | color_prefs_set[i], hbox); |
| 12546 | 521 | gtk_size_group_add_widget(labelsg, check); |
| 10584 | 522 | |
| 15568 | 523 | color_widgets[i] = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_COLOR, PIDGIN_BUTTON_HORIZONTAL); |
| 12546 | 524 | gtk_size_group_add_widget(widgetsg, color_widgets[i]); |
| 10584 | 525 | gtk_box_pack_start(GTK_BOX(hbox), color_widgets[i], FALSE, |
| 526 | FALSE, 0); | |
| 527 | gtk_widget_set_sensitive(color_widgets[i], | |
| 15884 | 528 | purple_prefs_get_bool(color_prefs_set[i])); |
| 10584 | 529 | g_signal_connect(G_OBJECT(check), "toggled", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
530 | G_CALLBACK(pidgin_toggle_sensitive), |
| 10584 | 531 | color_widgets[i]); |
| 532 | g_signal_connect(G_OBJECT(color_widgets[i]), "clicked", | |
| 15884 | 533 | G_CALLBACK(purplerc_set_color), |
| 10584 | 534 | GINT_TO_POINTER(i)); |
| 535 | } | |
| 536 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
537 | frame = pidgin_make_frame(ret, _("Widget Sizes")); |
|
10585
42d99375d8d0
[gaim-migrate @ 11989]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10584
diff
changeset
|
538 | /* widget size stuff */ |
| 10584 | 539 | for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) { |
| 15882 | 540 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 10584 | 541 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 542 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
543 | check = pidgin_prefs_checkbox(_(widget_size_names[i]), |
| 10584 | 544 | widget_size_prefs_set[i], hbox); |
| 12546 | 545 | gtk_size_group_add_widget(labelsg, check); |
| 10584 | 546 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
547 | widget_size_widgets[i] = pidgin_prefs_labeled_spin_button(hbox, "", widget_size_prefs[i], 0, 50, NULL); |
| 12546 | 548 | /* |
| 549 | gtk_size_group_add_widget(widgetsg, widget_size_widgets[i]); | |
| 550 | */ | |
| 10584 | 551 | gtk_widget_set_sensitive(widget_size_widgets[i], |
| 15884 | 552 | purple_prefs_get_bool(widget_size_prefs_set[i])); |
| 10584 | 553 | g_signal_connect(G_OBJECT(check), "toggled", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
554 | G_CALLBACK(pidgin_toggle_sensitive), |
| 10584 | 555 | widget_size_widgets[i]); |
| 556 | } | |
| 557 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
558 | frame = pidgin_make_frame(ret, _("Fonts")); |
| 10584 | 559 | /* imhtml font stuff */ |
| 560 | for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) { | |
| 15882 | 561 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 10584 | 562 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 563 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
564 | check = pidgin_prefs_checkbox(_(font_names[i]), |
| 10584 | 565 | font_prefs_set[i], hbox); |
| 12546 | 566 | gtk_size_group_add_widget(labelsg, check); |
| 10584 | 567 | |
| 15568 | 568 | font_widgets[i] = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_FONT, PIDGIN_BUTTON_HORIZONTAL); |
| 12546 | 569 | gtk_size_group_add_widget(widgetsg, font_widgets[i]); |
| 10584 | 570 | gtk_box_pack_start(GTK_BOX(hbox), font_widgets[i], FALSE, |
| 571 | FALSE, 0); | |
| 572 | gtk_widget_set_sensitive(font_widgets[i], | |
| 15884 | 573 | purple_prefs_get_bool(font_prefs_set[i])); |
| 10584 | 574 | g_signal_connect(G_OBJECT(check), "toggled", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
575 | G_CALLBACK(pidgin_toggle_sensitive), |
| 10584 | 576 | font_widgets[i]); |
| 577 | g_signal_connect(G_OBJECT(font_widgets[i]), "clicked", | |
| 15884 | 578 | G_CALLBACK(purplerc_set_font), GINT_TO_POINTER(i)); |
| 10584 | 579 | } |
| 580 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
581 | frame = pidgin_make_frame(ret, _("Tools")); |
| 11940 | 582 | |
| 15882 | 583 | vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 11940 | 584 | gtk_box_pack_start(GTK_BOX(frame), vbox, FALSE, FALSE, 0); |
| 585 | ||
| 15884 | 586 | tmp = g_strdup_printf(_("Write settings to %s%sgtkrc-2.0"), purple_user_dir(), G_DIR_SEPARATOR_S); |
|
12042
b90399880391
[gaim-migrate @ 14337]
Richard Laager <rlaager@pidgin.im>
parents:
11941
diff
changeset
|
587 | check = gtk_button_new_with_label(tmp); |
|
b90399880391
[gaim-migrate @ 14337]
Richard Laager <rlaager@pidgin.im>
parents:
11941
diff
changeset
|
588 | g_free(tmp); |
| 11940 | 589 | gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); |
| 12546 | 590 | gtk_size_group_add_widget(labelsg, check); |
| 15884 | 591 | g_signal_connect(G_OBJECT(check), "clicked", G_CALLBACK(purplerc_write), |
| 11940 | 592 | NULL); |
| 593 | ||
| 594 | check = gtk_button_new_with_label(_("Re-read gtkrc files")); | |
| 595 | gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); | |
| 12546 | 596 | gtk_size_group_add_widget(labelsg, check); |
| 15884 | 597 | g_signal_connect(G_OBJECT(check), "clicked", G_CALLBACK(purplerc_reread), |
| 11940 | 598 | NULL); |
| 599 | ||
| 10584 | 600 | gtk_widget_show_all(ret); |
| 601 | return ret; | |
| 602 | } | |
| 603 | ||
| 15884 | 604 | static PidginPluginUiInfo purplerc_ui_info = |
| 10584 | 605 | { |
| 15884 | 606 | purplerc_get_config_frame, |
|
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
|
607 | 0, /* page_num (Reserved) */ |
|
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
|
608 | |
|
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
|
609 | /* padding */ |
|
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
|
610 | NULL, |
|
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
|
611 | NULL, |
|
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
|
612 | NULL, |
|
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
|
613 | NULL |
| 10584 | 614 | }; |
| 615 | ||
| 15884 | 616 | static PurplePluginInfo purplerc_info = |
| 10584 | 617 | { |
| 15884 | 618 | PURPLE_PLUGIN_MAGIC, |
| 619 | PURPLE_MAJOR_VERSION, | |
| 620 | PURPLE_MINOR_VERSION, | |
| 621 | PURPLE_PLUGIN_STANDARD, | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
622 | PIDGIN_PLUGIN_TYPE, |
| 10584 | 623 | 0, |
| 624 | NULL, | |
| 15884 | 625 | PURPLE_PRIORITY_DEFAULT, |
| 626 | "purplerc", | |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15987
diff
changeset
|
627 | N_("Pidgin GTK+ Theme Control"), |
| 10584 | 628 | VERSION, |
| 629 | N_("Provides access to commonly used gtkrc settings."), | |
| 630 | N_("Provides access to commonly used gtkrc settings."), | |
| 631 | "Etan Reisner <deryni@eden.rutgers.edu>", | |
| 15884 | 632 | PURPLE_WEBSITE, |
| 633 | purplerc_plugin_load, | |
| 634 | purplerc_plugin_unload, | |
| 10584 | 635 | NULL, |
| 15884 | 636 | &purplerc_ui_info, |
| 10584 | 637 | NULL, |
| 638 | NULL, | |
|
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
|
639 | NULL, |
|
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
|
640 | |
|
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
|
641 | /* padding */ |
|
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
|
642 | NULL, |
|
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
|
643 | NULL, |
|
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
|
644 | NULL, |
| 10584 | 645 | NULL |
| 646 | }; | |
| 647 | ||
| 648 | static void | |
| 15884 | 649 | purplerc_init(PurplePlugin *plugin) |
| 10584 | 650 | { |
| 651 | int i; | |
| 652 | ||
| 15884 | 653 | purple_prefs_add_none("/plugins"); |
| 654 | purple_prefs_add_none("/plugins/gtk"); | |
| 655 | purple_prefs_add_none("/plugins/gtk/purplerc"); | |
| 656 | purple_prefs_add_none("/plugins/gtk/purplerc/set"); | |
| 10584 | 657 | |
| 15884 | 658 | purple_prefs_add_string("/plugins/gtk/purplerc/gtk-font-name", ""); |
| 659 | purple_prefs_add_bool("/plugins/gtk/purplerc/set/gtk-font-name", FALSE); | |
| 10584 | 660 | |
| 15884 | 661 | purple_prefs_add_string("/plugins/gtk/purplerc/gtk-key-theme-name", ""); |
| 662 | purple_prefs_add_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name", FALSE); | |
| 10584 | 663 | |
| 15884 | 664 | purple_prefs_add_none("/plugins/gtk/purplerc/color"); |
| 665 | purple_prefs_add_none("/plugins/gtk/purplerc/set/color"); | |
| 10584 | 666 | for (i = 0; i < G_N_ELEMENTS(color_prefs); i++) { |
| 15884 | 667 | purple_prefs_add_string(color_prefs[i], ""); |
| 668 | purple_prefs_add_bool(color_prefs_set[i], FALSE); | |
| 10584 | 669 | } |
| 670 | ||
| 15884 | 671 | purple_prefs_add_none("/plugins/gtk/purplerc/size"); |
| 672 | purple_prefs_add_none("/plugins/gtk/purplerc/set/size"); | |
| 10584 | 673 | for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) { |
| 15884 | 674 | purple_prefs_add_int(widget_size_prefs[i], 0); |
| 675 | purple_prefs_add_bool(widget_size_prefs_set[i], FALSE); | |
| 10584 | 676 | } |
| 677 | ||
| 15884 | 678 | purple_prefs_add_none("/plugins/gtk/purplerc/font"); |
| 679 | purple_prefs_add_none("/plugins/gtk/purplerc/set/font"); | |
| 10584 | 680 | for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) { |
| 15884 | 681 | purple_prefs_add_string(font_prefs[i], ""); |
| 682 | purple_prefs_add_bool(font_prefs_set[i], FALSE); | |
| 10584 | 683 | } |
| 12973 | 684 | |
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
685 | /* |
| 15884 | 686 | purple_prefs_add_none("/plugins/gtk/purplerc/bool"); |
| 687 | purple_prefs_add_none("/plugins/gtk/purplerc/set/bool"); | |
| 12973 | 688 | for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) { |
| 15884 | 689 | purple_prefs_add_bool(widget_bool_prefs[i], TRUE); |
| 690 | purple_prefs_add_bool(widget_bool_prefs_set[i], FALSE); | |
| 12973 | 691 | } |
|
17209
bfccb73d3ea1
Remove the "GtkTreeView Indent Expanders" boolean preference, because the
Etan Reisner <deryni@pidgin.im>
parents:
17096
diff
changeset
|
692 | */ |
| 10584 | 693 | } |
| 694 | ||
| 15884 | 695 | PURPLE_INIT_PLUGIN(purplerc, purplerc_init, purplerc_info) |