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