Tue, 14 Aug 2007 04:32:32 +0000
Use gtk's functionality to keep window on top. Think this fixes #1743
| 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 | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 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"; | |
| 58 | static const char *PREF_CHAT_BLINK = "/plugins/gtk/win32/winprefs/chat_blink"; | |
| 59 | ||
| 60 | /* Deprecated */ | |
| 61 | static const char *PREF_DBLIST_ON_TOP = "/plugins/gtk/win32/winprefs/dblist_on_top"; | |
| 62 | ||
| 15884 | 63 | static PurplePlugin *handle = NULL; |
| 14286 | 64 | static GtkAppBar *blist_ab = NULL; |
| 65 | static GtkWidget *blist = NULL; | |
| 66 | static guint blist_visible_cb_id = 0; | |
| 67 | ||
| 68 | enum { | |
| 69 | BLIST_TOP_NEVER = 0, | |
| 70 | BLIST_TOP_ALWAYS, | |
| 71 | BLIST_TOP_DOCKED, | |
| 72 | }; | |
| 73 | ||
| 74 | /* | |
| 75 | * CODE | |
| 76 | */ | |
| 77 | ||
| 78 | /* BLIST DOCKING */ | |
| 79 | ||
| 80 | static void blist_save_state() { | |
| 81 | if(blist_ab) { | |
| 15884 | 82 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE) && blist_ab->docked) { |
| 83 | purple_prefs_set_int(PREF_DBLIST_HEIGHT, blist_ab->undocked_height); | |
| 84 | purple_prefs_set_int(PREF_DBLIST_SIDE, blist_ab->side); | |
| 85 | purple_prefs_set_bool(PREF_DBLIST_DOCKED, blist_ab->docked); | |
| 14286 | 86 | } else |
| 15884 | 87 | purple_prefs_set_bool(PREF_DBLIST_DOCKED, FALSE); |
| 14286 | 88 | } |
| 89 | } | |
| 90 | ||
| 91 | static void blist_set_ontop(gboolean val) { | |
| 92 | if(!blist) | |
| 93 | return; | |
| 94 | ||
|
19381
498deac80549
Use gtk's functionality to keep window on top. Think this fixes #1743
Daniel Atallah <datallah@pidgin.im>
parents:
16792
diff
changeset
|
95 | gtk_window_set_keep_above(GTK_WINDOW(PIDGIN_BLIST(purple_get_blist())->window), val); |
| 14286 | 96 | } |
| 97 | ||
| 98 | static void blist_dock_cb(gboolean val) { | |
| 99 | if(val) { | |
| 15884 | 100 | purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Docking...\n"); |
| 101 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) != BLIST_TOP_NEVER) | |
| 14286 | 102 | blist_set_ontop(TRUE); |
| 103 | } else { | |
| 15884 | 104 | purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Undocking...\n"); |
| 105 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) | |
| 14286 | 106 | blist_set_ontop(TRUE); |
| 107 | else | |
| 108 | blist_set_ontop(FALSE); | |
| 109 | } | |
| 110 | } | |
| 111 | ||
| 112 | static void blist_set_dockable(gboolean val) { | |
| 113 | if(val) { | |
| 114 | if(blist_ab == NULL && blist != NULL) { | |
| 115 | blist_ab = gtk_appbar_add(blist); | |
| 116 | gtk_appbar_add_dock_cb(blist_ab, blist_dock_cb); | |
| 117 | } | |
| 118 | } else { | |
| 119 | if(blist_ab != NULL) { | |
| 120 | gtk_appbar_remove(blist_ab); | |
| 121 | blist_ab = NULL; | |
| 122 | } | |
| 123 | ||
| 15884 | 124 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) |
| 14286 | 125 | blist_set_ontop(TRUE); |
| 126 | else | |
| 127 | blist_set_ontop(FALSE); | |
| 128 | } | |
| 129 | } | |
| 130 | ||
| 131 | /* PLUGIN CALLBACKS */ | |
| 132 | ||
| 133 | /* We need this because the blist destroy cb won't be called before the | |
| 134 | plugin is unloaded, when quitting */ | |
| 15884 | 135 | static void purple_quit_cb() { |
| 136 | purple_debug_info(WINPREFS_PLUGIN_ID, "purple_quit_cb: removing appbar\n"); | |
| 14286 | 137 | blist_save_state(); |
| 138 | blist_set_dockable(FALSE); | |
| 139 | } | |
| 140 | ||
| 141 | /* Listen for the first time the window stops being withdrawn */ | |
| 15884 | 142 | static void blist_visible_cb(const char *pref, PurplePrefType type, |
| 14286 | 143 | gconstpointer value, gpointer user_data) { |
| 15884 | 144 | if(purple_prefs_get_bool(pref)) { |
| 14286 | 145 | gtk_appbar_dock(blist_ab, |
| 15884 | 146 | purple_prefs_get_int(PREF_DBLIST_SIDE)); |
| 14286 | 147 | |
| 15884 | 148 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) |
| 14286 | 149 | == BLIST_TOP_DOCKED) |
| 150 | blist_set_ontop(TRUE); | |
| 151 | ||
| 152 | /* We only need to be notified about this once */ | |
| 15884 | 153 | purple_prefs_disconnect_callback(blist_visible_cb_id); |
| 14286 | 154 | } |
| 155 | } | |
| 156 | ||
| 157 | /* This needs to be delayed otherwise, when the blist is originally created and | |
| 158 | * hidden, it'll trigger the blist_visible_cb */ | |
| 159 | static gboolean listen_for_blist_visible_cb(gpointer data) { | |
| 160 | if (handle != NULL) | |
| 161 | blist_visible_cb_id = | |
| 15884 | 162 | 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
|
163 | PIDGIN_PREFS_ROOT "/blist/list_visible", |
| 14286 | 164 | blist_visible_cb, NULL); |
| 165 | ||
| 166 | return FALSE; | |
| 167 | } | |
| 168 | ||
| 15884 | 169 | static void blist_create_cb(PurpleBuddyList *purple_blist, void *data) { |
| 170 | purple_debug_info(WINPREFS_PLUGIN_ID, "buddy list created\n"); | |
| 14286 | 171 | |
| 15884 | 172 | blist = PIDGIN_BLIST(purple_blist)->window; |
| 14286 | 173 | |
| 15884 | 174 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE)) { |
| 14286 | 175 | blist_set_dockable(TRUE); |
| 15884 | 176 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKED)) { |
| 177 | blist_ab->undocked_height = purple_prefs_get_int(PREF_DBLIST_HEIGHT); | |
| 14286 | 178 | if(!(gdk_window_get_state(blist->window) |
| 179 | & GDK_WINDOW_STATE_WITHDRAWN)) { | |
| 180 | gtk_appbar_dock(blist_ab, | |
| 15884 | 181 | purple_prefs_get_int(PREF_DBLIST_SIDE)); |
| 182 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) | |
| 14286 | 183 | == BLIST_TOP_DOCKED) |
| 184 | blist_set_ontop(TRUE); | |
| 185 | } else { | |
| 186 | g_idle_add(listen_for_blist_visible_cb, NULL); | |
| 187 | } | |
| 188 | } | |
| 189 | } | |
| 190 | ||
| 15884 | 191 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) |
| 14286 | 192 | blist_set_ontop(TRUE); |
| 193 | ||
| 194 | } | |
| 195 | ||
| 196 | /* WIN PREFS GENERAL */ | |
| 197 | ||
| 198 | static void | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
199 | winprefs_set_autostart(GtkWidget *w) { |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
200 | char *runval = NULL; |
| 14286 | 201 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
202 | 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
|
203 | runval = g_strdup_printf("%s" G_DIR_SEPARATOR_S "pidgin.exe", wpurple_install_dir()); |
| 14286 | 204 | |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
205 | 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
|
206 | /* For Win98 */ |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
207 | && !wpurple_write_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Pidgin", runval)) |
| 15884 | 208 | purple_debug_error(WINPREFS_PLUGIN_ID, "Could not set registry key value\n"); |
| 14286 | 209 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
210 | g_free(runval); |
| 14286 | 211 | } |
| 212 | ||
| 213 | static void | |
| 15884 | 214 | winprefs_set_blist_dockable(const char *pref, PurplePrefType type, |
| 14286 | 215 | gconstpointer value, gpointer user_data) |
| 216 | { | |
| 217 | blist_set_dockable(GPOINTER_TO_INT(value)); | |
| 218 | } | |
| 219 | ||
| 220 | static void | |
| 15884 | 221 | winprefs_set_blist_ontop(const char *pref, PurplePrefType type, |
| 14286 | 222 | gconstpointer value, gpointer user_data) |
| 223 | { | |
| 15884 | 224 | gint setting = purple_prefs_get_int(PREF_BLIST_ON_TOP); |
| 14286 | 225 | if((setting == BLIST_TOP_DOCKED && blist_ab && blist_ab->docked) |
| 226 | || setting == BLIST_TOP_ALWAYS) | |
| 227 | blist_set_ontop(TRUE); | |
| 228 | else | |
| 229 | blist_set_ontop(FALSE); | |
| 230 | } | |
| 231 | ||
|
14762
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14334
diff
changeset
|
232 | static gboolean |
| 15884 | 233 | winpidgin_conv_chat_blink(PurpleAccount *account, const char *who, char **message, |
| 234 | PurpleConversation *conv, PurpleMessageFlags flags, void *data) | |
| 14286 | 235 | { |
| 15884 | 236 | if(purple_prefs_get_bool(PREF_CHAT_BLINK)) |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15562
diff
changeset
|
237 | winpidgin_conv_blink(conv, flags); |
| 14286 | 238 | |
| 239 | return FALSE; | |
| 240 | } | |
| 241 | ||
| 242 | ||
| 243 | /* | |
| 244 | * EXPORTED FUNCTIONS | |
| 245 | */ | |
| 246 | ||
| 15884 | 247 | static gboolean plugin_load(PurplePlugin *plugin) { |
| 14286 | 248 | handle = plugin; |
| 249 | ||
| 250 | /* blist docking init */ | |
| 15884 | 251 | if(purple_get_blist() && PIDGIN_BLIST(purple_get_blist()) |
| 252 | && PIDGIN_BLIST(purple_get_blist())->window) { | |
| 253 | blist_create_cb(purple_get_blist(), NULL); | |
| 14286 | 254 | } |
| 255 | ||
| 256 | /* This really shouldn't happen anymore generally, but if for some strange | |
| 257 | reason, the blist is recreated, we need to set it up again. */ | |
| 15884 | 258 | purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", |
| 259 | plugin, PURPLE_CALLBACK(blist_create_cb), NULL); | |
| 14286 | 260 | |
| 15884 | 261 | purple_signal_connect(pidgin_conversations_get_handle(), |
| 262 | "displaying-chat-msg", plugin, PURPLE_CALLBACK(winpidgin_conv_chat_blink), | |
| 14286 | 263 | NULL); |
| 264 | ||
| 15884 | 265 | purple_signal_connect((void*)purple_get_core(), "quitting", plugin, |
| 266 | PURPLE_CALLBACK(purple_quit_cb), NULL); | |
| 14286 | 267 | |
| 15884 | 268 | purple_prefs_connect_callback(handle, PREF_BLIST_ON_TOP, |
| 14286 | 269 | winprefs_set_blist_ontop, NULL); |
| 15884 | 270 | purple_prefs_connect_callback(handle, PREF_DBLIST_DOCKABLE, |
| 14286 | 271 | winprefs_set_blist_dockable, NULL); |
| 272 | ||
| 273 | return TRUE; | |
| 274 | } | |
| 275 | ||
| 15884 | 276 | static gboolean plugin_unload(PurplePlugin *plugin) { |
| 14286 | 277 | blist_set_dockable(FALSE); |
| 278 | blist_set_ontop(FALSE); | |
| 279 | ||
| 280 | handle = NULL; | |
| 281 | ||
| 282 | return TRUE; | |
| 283 | } | |
| 284 | ||
| 15884 | 285 | static GtkWidget* get_config_frame(PurplePlugin *plugin) { |
| 14286 | 286 | GtkWidget *ret; |
| 287 | GtkWidget *vbox; | |
| 288 | GtkWidget *button; | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
289 | char *gtk_version = NULL; |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
290 | 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
|
291 | char *tmp; |
| 14286 | 292 | |
| 293 | ret = gtk_vbox_new(FALSE, 18); | |
| 294 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 295 | ||
| 296 | gtk_version = g_strdup_printf("GTK+\t%u.%u.%u\nGlib\t%u.%u.%u", | |
| 297 | gtk_major_version, gtk_minor_version, gtk_micro_version, | |
| 298 | glib_major_version, glib_minor_version, glib_micro_version); | |
| 299 | ||
| 300 | /* Display Installed GTK+ Runtime Version */ | |
| 301 | if(gtk_version) { | |
| 302 | GtkWidget *label; | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
303 | vbox = pidgin_make_frame(ret, _("GTK+ Runtime Version")); |
| 14286 | 304 | label = gtk_label_new(gtk_version); |
| 305 | gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
| 306 | gtk_widget_show(label); | |
| 307 | g_free(gtk_version); | |
| 308 | } | |
| 309 | ||
| 310 | /* Autostart */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
311 | 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
|
312 | 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
|
313 | 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
|
314 | g_free(tmp); |
| 14286 | 315 | 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
|
316 | |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
317 | 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
|
318 | || (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
|
319 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
320 | g_free(run_key_val); |
| 14286 | 321 | } |
| 322 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_autostart), NULL); | |
| 323 | gtk_widget_show(button); | |
| 324 | ||
| 325 | /* Buddy List */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
326 | vbox = pidgin_make_frame(ret, _("Buddy List")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
327 | pidgin_prefs_checkbox(_("_Dockable Buddy List"), |
| 14286 | 328 | PREF_DBLIST_DOCKABLE, vbox); |
| 329 | ||
| 330 | /* Blist On Top */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
331 | pidgin_prefs_dropdown(vbox, _("_Keep Buddy List window on top:"), |
| 15884 | 332 | PURPLE_PREF_INT, PREF_BLIST_ON_TOP, |
| 14286 | 333 | _("Never"), BLIST_TOP_NEVER, |
| 334 | _("Always"), BLIST_TOP_ALWAYS, | |
| 335 | /* XXX: Did this ever work? */ | |
| 336 | _("Only when docked"), BLIST_TOP_DOCKED, | |
| 337 | NULL); | |
| 338 | ||
| 339 | /* Conversations */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
340 | vbox = pidgin_make_frame(ret, _("Conversations")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
341 | pidgin_prefs_checkbox(_("_Flash window when chat messages are received"), |
| 14286 | 342 | PREF_CHAT_BLINK, vbox); |
| 343 | ||
| 344 | gtk_widget_show_all(ret); | |
| 345 | return ret; | |
| 346 | } | |
| 347 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
348 | static PidginPluginUiInfo ui_info = |
| 14286 | 349 | { |
| 350 | 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
|
351 | 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
|
352 | |
|
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
|
353 | /* 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
|
354 | 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
|
355 | 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
|
356 | 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
|
357 | NULL |
| 14286 | 358 | }; |
| 359 | ||
| 15884 | 360 | static PurplePluginInfo info = |
| 14286 | 361 | { |
| 15884 | 362 | PURPLE_PLUGIN_MAGIC, |
| 363 | PURPLE_MAJOR_VERSION, | |
| 364 | PURPLE_MINOR_VERSION, | |
| 365 | PURPLE_PLUGIN_STANDARD, | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
366 | PIDGIN_PLUGIN_TYPE, |
| 14286 | 367 | 0, |
| 368 | NULL, | |
| 15884 | 369 | PURPLE_PRIORITY_DEFAULT, |
| 14286 | 370 | WINPREFS_PLUGIN_ID, |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
371 | N_("Windows Pidgin Options"), |
| 14286 | 372 | VERSION, |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
373 | 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
|
374 | N_("Provides options specific to Pidgin for Windows , such as buddy list docking."), |
| 14286 | 375 | "Herman Bloggs <hermanator12002@yahoo.com>", |
| 15884 | 376 | PURPLE_WEBSITE, |
| 14286 | 377 | plugin_load, |
| 378 | plugin_unload, | |
| 379 | NULL, | |
| 380 | &ui_info, | |
| 381 | NULL, | |
| 382 | 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
|
383 | 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
|
384 | |
|
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
|
385 | /* 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
|
386 | 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
|
387 | 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
|
388 | NULL, |
| 14286 | 389 | NULL |
| 390 | }; | |
| 391 | ||
| 392 | static void | |
| 15884 | 393 | init_plugin(PurplePlugin *plugin) |
| 14286 | 394 | { |
| 15884 | 395 | purple_prefs_add_none("/plugins/gtk"); |
| 396 | purple_prefs_add_none("/plugins/gtk/win32"); | |
| 397 | purple_prefs_add_none("/plugins/gtk/win32/winprefs"); | |
| 398 | purple_prefs_add_bool(PREF_DBLIST_DOCKABLE, FALSE); | |
| 399 | purple_prefs_add_bool(PREF_DBLIST_DOCKED, FALSE); | |
| 400 | purple_prefs_add_int(PREF_DBLIST_HEIGHT, 0); | |
| 401 | purple_prefs_add_int(PREF_DBLIST_SIDE, 0); | |
| 402 | purple_prefs_add_bool(PREF_CHAT_BLINK, FALSE); | |
| 14286 | 403 | |
| 404 | /* Convert old preferences */ | |
| 15884 | 405 | if(purple_prefs_exists(PREF_DBLIST_ON_TOP)) { |
| 14286 | 406 | gint blist_top = BLIST_TOP_NEVER; |
| 15884 | 407 | if(purple_prefs_get_bool(PREF_BLIST_ON_TOP)) |
| 14286 | 408 | blist_top = BLIST_TOP_ALWAYS; |
| 15884 | 409 | else if(purple_prefs_get_bool(PREF_DBLIST_ON_TOP)) |
| 14286 | 410 | blist_top = BLIST_TOP_DOCKED; |
| 15884 | 411 | purple_prefs_remove(PREF_BLIST_ON_TOP); |
| 412 | purple_prefs_remove(PREF_DBLIST_ON_TOP); | |
| 413 | purple_prefs_add_int(PREF_BLIST_ON_TOP, blist_top); | |
| 14286 | 414 | } else |
| 15884 | 415 | purple_prefs_add_int(PREF_BLIST_ON_TOP, BLIST_TOP_NEVER); |
| 14286 | 416 | } |
| 417 | ||
| 15884 | 418 | PURPLE_INIT_PLUGIN(winprefs, init_plugin, info) |
| 14286 | 419 |