Sun, 08 Mar 2009 06:24:15 +0000
propagate from branch 'im.pidgin.pidgin' (head 168b66075e088f3baaa85ebba520e37d42aa3d0c)
to branch 'im.pidgin.soc.2008.yahoo' (head 9124a345ed3a0154f0c4f10fe2b2c67e9b49215f)
| 14286 | 1 | /* |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
2 | * pidgin - Windows Pidgin Options Plugin |
| 14286 | 3 | * |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
4 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 14286 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * 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:
19381
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 14286 | 21 | * |
| 22 | */ | |
| 23 | #include <gtk/gtk.h> | |
| 24 | #include <gdk/gdkwin32.h> | |
| 25 | ||
| 26 | #include "internal.h" | |
| 27 | ||
| 28 | #include "gtkwin32dep.h" | |
| 29 | ||
| 30 | #include "core.h" | |
| 31 | #include "debug.h" | |
| 32 | #include "prefs.h" | |
| 33 | #include "signals.h" | |
| 34 | #include "version.h" | |
| 35 | ||
| 36 | #include "gtkappbar.h" | |
| 37 | #include "gtkblist.h" | |
| 38 | #include "gtkconv.h" | |
| 39 | #include "gtkplugin.h" | |
| 40 | #include "gtkprefs.h" | |
| 41 | #include "gtkutils.h" | |
| 42 | ||
| 43 | /* | |
| 44 | * MACROS & DEFINES | |
| 45 | */ | |
| 46 | #define WINPREFS_PLUGIN_ID "gtk-win-prefs" | |
| 47 | ||
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
48 | #define RUNKEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run" |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
49 | |
| 14286 | 50 | /* |
| 51 | * LOCALS | |
| 52 | */ | |
| 53 | static const char *PREF_DBLIST_DOCKABLE = "/plugins/gtk/win32/winprefs/dblist_dockable"; | |
| 54 | static const char *PREF_DBLIST_DOCKED = "/plugins/gtk/win32/winprefs/dblist_docked"; | |
| 55 | static const char *PREF_DBLIST_HEIGHT = "/plugins/gtk/win32/winprefs/dblist_height"; | |
| 56 | static const char *PREF_DBLIST_SIDE = "/plugins/gtk/win32/winprefs/dblist_side"; | |
| 57 | static const char *PREF_BLIST_ON_TOP = "/plugins/gtk/win32/winprefs/blist_on_top"; | |
|
25544
afa0851cca1e
Remove the "Flash window when chat messages are received" pref from the winprefs
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
58 | /* Deprecated */ |
| 14286 | 59 | static const char *PREF_CHAT_BLINK = "/plugins/gtk/win32/winprefs/chat_blink"; |
| 60 | static const char *PREF_DBLIST_ON_TOP = "/plugins/gtk/win32/winprefs/dblist_on_top"; | |
| 61 | ||
| 15884 | 62 | static PurplePlugin *handle = NULL; |
| 14286 | 63 | static GtkAppBar *blist_ab = NULL; |
| 64 | static GtkWidget *blist = NULL; | |
| 65 | static guint blist_visible_cb_id = 0; | |
| 66 | ||
| 67 | enum { | |
| 68 | BLIST_TOP_NEVER = 0, | |
| 69 | BLIST_TOP_ALWAYS, | |
| 70 | BLIST_TOP_DOCKED, | |
| 71 | }; | |
| 72 | ||
| 73 | /* | |
| 74 | * CODE | |
| 75 | */ | |
| 76 | ||
| 77 | /* BLIST DOCKING */ | |
| 78 | ||
| 79 | static void blist_save_state() { | |
| 80 | if(blist_ab) { | |
| 15884 | 81 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE) && blist_ab->docked) { |
| 82 | purple_prefs_set_int(PREF_DBLIST_HEIGHT, blist_ab->undocked_height); | |
| 83 | purple_prefs_set_int(PREF_DBLIST_SIDE, blist_ab->side); | |
| 84 | purple_prefs_set_bool(PREF_DBLIST_DOCKED, blist_ab->docked); | |
| 14286 | 85 | } else |
| 15884 | 86 | purple_prefs_set_bool(PREF_DBLIST_DOCKED, FALSE); |
| 14286 | 87 | } |
| 88 | } | |
| 89 | ||
| 90 | static void blist_set_ontop(gboolean val) { | |
| 91 | if(!blist) | |
| 92 | return; | |
| 93 | ||
|
19381
498deac80549
Use gtk's functionality to keep window on top. Think this fixes #1743
Daniel Atallah <datallah@pidgin.im>
parents:
16792
diff
changeset
|
94 | gtk_window_set_keep_above(GTK_WINDOW(PIDGIN_BLIST(purple_get_blist())->window), val); |
| 14286 | 95 | } |
| 96 | ||
| 97 | static void blist_dock_cb(gboolean val) { | |
| 98 | if(val) { | |
| 15884 | 99 | purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Docking...\n"); |
| 100 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) != BLIST_TOP_NEVER) | |
| 14286 | 101 | blist_set_ontop(TRUE); |
| 102 | } else { | |
| 15884 | 103 | purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Undocking...\n"); |
| 104 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) | |
| 14286 | 105 | blist_set_ontop(TRUE); |
| 106 | else | |
| 107 | blist_set_ontop(FALSE); | |
| 108 | } | |
| 109 | } | |
| 110 | ||
| 111 | static void blist_set_dockable(gboolean val) { | |
| 112 | if(val) { | |
| 113 | if(blist_ab == NULL && blist != NULL) { | |
| 114 | blist_ab = gtk_appbar_add(blist); | |
| 115 | gtk_appbar_add_dock_cb(blist_ab, blist_dock_cb); | |
| 116 | } | |
| 117 | } else { | |
| 118 | if(blist_ab != NULL) { | |
| 119 | gtk_appbar_remove(blist_ab); | |
| 120 | blist_ab = NULL; | |
| 121 | } | |
| 122 | ||
| 15884 | 123 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) |
| 14286 | 124 | blist_set_ontop(TRUE); |
| 125 | else | |
| 126 | blist_set_ontop(FALSE); | |
| 127 | } | |
| 128 | } | |
| 129 | ||
| 130 | /* PLUGIN CALLBACKS */ | |
| 131 | ||
| 132 | /* We need this because the blist destroy cb won't be called before the | |
| 133 | plugin is unloaded, when quitting */ | |
| 15884 | 134 | static void purple_quit_cb() { |
| 135 | purple_debug_info(WINPREFS_PLUGIN_ID, "purple_quit_cb: removing appbar\n"); | |
| 14286 | 136 | blist_save_state(); |
| 137 | blist_set_dockable(FALSE); | |
| 138 | } | |
| 139 | ||
| 140 | /* Listen for the first time the window stops being withdrawn */ | |
| 15884 | 141 | static void blist_visible_cb(const char *pref, PurplePrefType type, |
| 14286 | 142 | gconstpointer value, gpointer user_data) { |
| 15884 | 143 | if(purple_prefs_get_bool(pref)) { |
| 14286 | 144 | gtk_appbar_dock(blist_ab, |
| 15884 | 145 | purple_prefs_get_int(PREF_DBLIST_SIDE)); |
| 14286 | 146 | |
| 15884 | 147 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) |
| 14286 | 148 | == BLIST_TOP_DOCKED) |
| 149 | blist_set_ontop(TRUE); | |
| 150 | ||
| 151 | /* We only need to be notified about this once */ | |
| 15884 | 152 | purple_prefs_disconnect_callback(blist_visible_cb_id); |
| 14286 | 153 | } |
| 154 | } | |
| 155 | ||
| 156 | /* This needs to be delayed otherwise, when the blist is originally created and | |
| 157 | * hidden, it'll trigger the blist_visible_cb */ | |
| 158 | static gboolean listen_for_blist_visible_cb(gpointer data) { | |
| 159 | if (handle != NULL) | |
| 160 | blist_visible_cb_id = | |
| 15884 | 161 | purple_prefs_connect_callback(handle, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16073
diff
changeset
|
162 | PIDGIN_PREFS_ROOT "/blist/list_visible", |
| 14286 | 163 | blist_visible_cb, NULL); |
| 164 | ||
| 165 | return FALSE; | |
| 166 | } | |
| 167 | ||
| 15884 | 168 | static void blist_create_cb(PurpleBuddyList *purple_blist, void *data) { |
| 169 | purple_debug_info(WINPREFS_PLUGIN_ID, "buddy list created\n"); | |
| 14286 | 170 | |
| 15884 | 171 | blist = PIDGIN_BLIST(purple_blist)->window; |
| 14286 | 172 | |
| 15884 | 173 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE)) { |
| 14286 | 174 | blist_set_dockable(TRUE); |
| 15884 | 175 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKED)) { |
| 176 | blist_ab->undocked_height = purple_prefs_get_int(PREF_DBLIST_HEIGHT); | |
| 14286 | 177 | if(!(gdk_window_get_state(blist->window) |
| 178 | & GDK_WINDOW_STATE_WITHDRAWN)) { | |
| 179 | gtk_appbar_dock(blist_ab, | |
| 15884 | 180 | purple_prefs_get_int(PREF_DBLIST_SIDE)); |
| 181 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) | |
| 14286 | 182 | == BLIST_TOP_DOCKED) |
| 183 | blist_set_ontop(TRUE); | |
| 184 | } else { | |
| 185 | g_idle_add(listen_for_blist_visible_cb, NULL); | |
| 186 | } | |
| 187 | } | |
| 188 | } | |
| 189 | ||
| 15884 | 190 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) |
| 14286 | 191 | blist_set_ontop(TRUE); |
| 192 | ||
| 193 | } | |
| 194 | ||
| 195 | /* WIN PREFS GENERAL */ | |
| 196 | ||
| 197 | static void | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
198 | winprefs_set_autostart(GtkWidget *w) { |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
199 | char *runval = NULL; |
| 14286 | 200 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
201 | if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
202 | runval = g_strdup_printf("%s" G_DIR_SEPARATOR_S "pidgin.exe", wpurple_install_dir()); |
| 14286 | 203 | |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
204 | if(!wpurple_write_reg_string(HKEY_CURRENT_USER, RUNKEY, "Pidgin", runval) |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
205 | /* For Win98 */ |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
206 | && !wpurple_write_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Pidgin", runval)) |
| 15884 | 207 | purple_debug_error(WINPREFS_PLUGIN_ID, "Could not set registry key value\n"); |
| 14286 | 208 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
209 | g_free(runval); |
| 14286 | 210 | } |
| 211 | ||
| 212 | static void | |
| 15884 | 213 | winprefs_set_blist_dockable(const char *pref, PurplePrefType type, |
| 14286 | 214 | gconstpointer value, gpointer user_data) |
| 215 | { | |
| 216 | blist_set_dockable(GPOINTER_TO_INT(value)); | |
| 217 | } | |
| 218 | ||
| 219 | static void | |
| 15884 | 220 | winprefs_set_blist_ontop(const char *pref, PurplePrefType type, |
| 14286 | 221 | gconstpointer value, gpointer user_data) |
| 222 | { | |
| 15884 | 223 | gint setting = purple_prefs_get_int(PREF_BLIST_ON_TOP); |
| 14286 | 224 | if((setting == BLIST_TOP_DOCKED && blist_ab && blist_ab->docked) |
| 225 | || setting == BLIST_TOP_ALWAYS) | |
| 226 | blist_set_ontop(TRUE); | |
| 227 | else | |
| 228 | blist_set_ontop(FALSE); | |
| 229 | } | |
| 230 | ||
| 231 | /* | |
| 232 | * EXPORTED FUNCTIONS | |
| 233 | */ | |
| 234 | ||
| 15884 | 235 | static gboolean plugin_load(PurplePlugin *plugin) { |
| 14286 | 236 | handle = plugin; |
| 237 | ||
| 238 | /* blist docking init */ | |
| 15884 | 239 | if(purple_get_blist() && PIDGIN_BLIST(purple_get_blist()) |
| 240 | && PIDGIN_BLIST(purple_get_blist())->window) { | |
| 241 | blist_create_cb(purple_get_blist(), NULL); | |
| 14286 | 242 | } |
| 243 | ||
| 244 | /* This really shouldn't happen anymore generally, but if for some strange | |
| 245 | reason, the blist is recreated, we need to set it up again. */ | |
| 15884 | 246 | purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", |
| 247 | plugin, PURPLE_CALLBACK(blist_create_cb), NULL); | |
| 14286 | 248 | |
| 15884 | 249 | purple_signal_connect((void*)purple_get_core(), "quitting", plugin, |
| 250 | PURPLE_CALLBACK(purple_quit_cb), NULL); | |
| 14286 | 251 | |
| 15884 | 252 | purple_prefs_connect_callback(handle, PREF_BLIST_ON_TOP, |
| 14286 | 253 | winprefs_set_blist_ontop, NULL); |
| 15884 | 254 | purple_prefs_connect_callback(handle, PREF_DBLIST_DOCKABLE, |
| 14286 | 255 | winprefs_set_blist_dockable, NULL); |
| 256 | ||
| 257 | return TRUE; | |
| 258 | } | |
| 259 | ||
| 15884 | 260 | static gboolean plugin_unload(PurplePlugin *plugin) { |
| 14286 | 261 | blist_set_dockable(FALSE); |
| 262 | blist_set_ontop(FALSE); | |
| 263 | ||
| 264 | handle = NULL; | |
| 265 | ||
| 266 | return TRUE; | |
| 267 | } | |
| 268 | ||
| 15884 | 269 | static GtkWidget* get_config_frame(PurplePlugin *plugin) { |
| 14286 | 270 | GtkWidget *ret; |
| 271 | GtkWidget *vbox; | |
| 272 | GtkWidget *button; | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
273 | char *gtk_version = NULL; |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
274 | char *run_key_val; |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
275 | char *tmp; |
| 14286 | 276 | |
| 277 | ret = gtk_vbox_new(FALSE, 18); | |
| 278 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 279 | ||
| 280 | gtk_version = g_strdup_printf("GTK+\t%u.%u.%u\nGlib\t%u.%u.%u", | |
| 281 | gtk_major_version, gtk_minor_version, gtk_micro_version, | |
| 282 | glib_major_version, glib_minor_version, glib_micro_version); | |
| 283 | ||
| 284 | /* Display Installed GTK+ Runtime Version */ | |
| 285 | if(gtk_version) { | |
| 286 | GtkWidget *label; | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
287 | vbox = pidgin_make_frame(ret, _("GTK+ Runtime Version")); |
| 14286 | 288 | label = gtk_label_new(gtk_version); |
| 289 | gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
| 290 | gtk_widget_show(label); | |
| 291 | g_free(gtk_version); | |
| 292 | } | |
| 293 | ||
| 294 | /* Autostart */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
295 | vbox = pidgin_make_frame(ret, _("Startup")); |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
296 | tmp = g_strdup_printf(_("_Start %s on Windows startup"), PIDGIN_NAME); |
|
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
297 | button = gtk_check_button_new_with_mnemonic(tmp); |
|
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
298 | g_free(tmp); |
| 14286 | 299 | gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
300 | |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
301 | if ((run_key_val = wpurple_read_reg_string(HKEY_CURRENT_USER, RUNKEY, "Pidgin")) |
|
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
302 | || (run_key_val = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Pidgin"))) { |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
303 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
304 | g_free(run_key_val); |
| 14286 | 305 | } |
| 306 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_autostart), NULL); | |
| 307 | gtk_widget_show(button); | |
| 308 | ||
| 309 | /* Buddy List */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
310 | vbox = pidgin_make_frame(ret, _("Buddy List")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
311 | pidgin_prefs_checkbox(_("_Dockable Buddy List"), |
| 14286 | 312 | PREF_DBLIST_DOCKABLE, vbox); |
| 313 | ||
| 314 | /* Blist On Top */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
315 | pidgin_prefs_dropdown(vbox, _("_Keep Buddy List window on top:"), |
| 15884 | 316 | PURPLE_PREF_INT, PREF_BLIST_ON_TOP, |
| 14286 | 317 | _("Never"), BLIST_TOP_NEVER, |
| 318 | _("Always"), BLIST_TOP_ALWAYS, | |
| 319 | /* XXX: Did this ever work? */ | |
| 320 | _("Only when docked"), BLIST_TOP_DOCKED, | |
| 321 | NULL); | |
| 322 | ||
| 323 | gtk_widget_show_all(ret); | |
| 324 | return ret; | |
| 325 | } | |
| 326 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
327 | static PidginPluginUiInfo ui_info = |
| 14286 | 328 | { |
| 329 | get_config_frame, | |
|
16751
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
330 | 0, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
331 | |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
332 | /* padding */ |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
333 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
334 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
335 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
336 | NULL |
| 14286 | 337 | }; |
| 338 | ||
| 15884 | 339 | static PurplePluginInfo info = |
| 14286 | 340 | { |
| 15884 | 341 | PURPLE_PLUGIN_MAGIC, |
| 342 | PURPLE_MAJOR_VERSION, | |
| 343 | PURPLE_MINOR_VERSION, | |
| 344 | PURPLE_PLUGIN_STANDARD, | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
345 | PIDGIN_PLUGIN_TYPE, |
| 14286 | 346 | 0, |
| 347 | NULL, | |
| 15884 | 348 | PURPLE_PRIORITY_DEFAULT, |
| 14286 | 349 | WINPREFS_PLUGIN_ID, |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
350 | N_("Windows Pidgin Options"), |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
351 | DISPLAY_VERSION, |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
352 | N_("Options specific to Pidgin for Windows."), |
|
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
353 | N_("Provides options specific to Pidgin for Windows , such as buddy list docking."), |
| 14286 | 354 | "Herman Bloggs <hermanator12002@yahoo.com>", |
| 15884 | 355 | PURPLE_WEBSITE, |
| 14286 | 356 | plugin_load, |
| 357 | plugin_unload, | |
| 358 | NULL, | |
| 359 | &ui_info, | |
| 360 | NULL, | |
| 361 | NULL, | |
|
16751
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
362 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
363 | |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
364 | /* padding */ |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
365 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
366 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
367 | NULL, |
| 14286 | 368 | NULL |
| 369 | }; | |
| 370 | ||
| 371 | static void | |
| 15884 | 372 | init_plugin(PurplePlugin *plugin) |
| 14286 | 373 | { |
| 15884 | 374 | purple_prefs_add_none("/plugins/gtk"); |
| 375 | purple_prefs_add_none("/plugins/gtk/win32"); | |
| 376 | purple_prefs_add_none("/plugins/gtk/win32/winprefs"); | |
| 377 | purple_prefs_add_bool(PREF_DBLIST_DOCKABLE, FALSE); | |
| 378 | purple_prefs_add_bool(PREF_DBLIST_DOCKED, FALSE); | |
| 379 | purple_prefs_add_int(PREF_DBLIST_HEIGHT, 0); | |
| 380 | purple_prefs_add_int(PREF_DBLIST_SIDE, 0); | |
| 14286 | 381 | |
| 382 | /* Convert old preferences */ | |
| 15884 | 383 | if(purple_prefs_exists(PREF_DBLIST_ON_TOP)) { |
| 14286 | 384 | gint blist_top = BLIST_TOP_NEVER; |
| 15884 | 385 | if(purple_prefs_get_bool(PREF_BLIST_ON_TOP)) |
| 14286 | 386 | blist_top = BLIST_TOP_ALWAYS; |
| 15884 | 387 | else if(purple_prefs_get_bool(PREF_DBLIST_ON_TOP)) |
| 14286 | 388 | blist_top = BLIST_TOP_DOCKED; |
| 15884 | 389 | purple_prefs_remove(PREF_BLIST_ON_TOP); |
| 390 | purple_prefs_remove(PREF_DBLIST_ON_TOP); | |
| 391 | purple_prefs_add_int(PREF_BLIST_ON_TOP, blist_top); | |
| 14286 | 392 | } else |
| 15884 | 393 | purple_prefs_add_int(PREF_BLIST_ON_TOP, BLIST_TOP_NEVER); |
|
25544
afa0851cca1e
Remove the "Flash window when chat messages are received" pref from the winprefs
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
394 | purple_prefs_remove(PREF_CHAT_BLINK); |
| 14286 | 395 | } |
| 396 | ||
| 15884 | 397 | PURPLE_INIT_PLUGIN(winprefs, init_plugin, info) |
| 14286 | 398 |