Mercurial > pidgin.yaz
annotate plugins/win32/winprefs/winprefs.c @ 7776:1389574c5d9b
[gaim-migrate @ 8421]
Note added
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Sat, 06 Dec 2003 20:02:59 +0000 |
parents | bf630f7dfdcd |
children | d7b8eb1f0a18 |
rev | line source |
---|---|
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
1 /* |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
2 * gaim - WinGaim Options Plugin |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
3 * |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
4 * File: winprefs.c |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
5 * Date: December 12, 2002 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
6 * Description: Gaim Plugin interface |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
7 * |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
8 * copyright (c) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com> |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
9 * |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
10 * this program is free software; you can redistribute it and/or modify |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
11 * it under the terms of the gnu general public license as published by |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
12 * the free software foundation; either version 2 of the license, or |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
13 * (at your option) any later version. |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
14 * |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
15 * this program is distributed in the hope that it will be useful, |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
16 * but without any warranty; without even the implied warranty of |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
17 * merchantability or fitness for a particular purpose. see the |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
18 * gnu general public license for more details. |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
19 * |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
20 * you should have received a copy of the gnu general public license |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
21 * along with this program; if not, write to the free software |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
22 * foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
23 * |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
24 */ |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
25 #include <windows.h> |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
26 #include <winreg.h> |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
27 #include <winerror.h> |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
28 #include <gdk/gdkwin32.h> |
5912
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5854
diff
changeset
|
29 |
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5854
diff
changeset
|
30 #include "internal.h" |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
31 #include "gtkinternal.h" |
5912
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5854
diff
changeset
|
32 |
6494
4f93f10ddc75
[gaim-migrate @ 7009]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6436
diff
changeset
|
33 #include "core.h" |
5912
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5854
diff
changeset
|
34 #include "prefs.h" |
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5854
diff
changeset
|
35 #include "debug.h" |
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5854
diff
changeset
|
36 |
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
37 #include "gtkplugin.h" |
5912
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5854
diff
changeset
|
38 #include "gtkutils.h" |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
39 #include "gtkblist.h" |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
40 #include "gtkappbar.h" |
6494
4f93f10ddc75
[gaim-migrate @ 7009]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6436
diff
changeset
|
41 #include "signals.h" |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
42 |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
43 /* |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
44 * MACROS & DEFINES |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
45 */ |
5854
14891982dbee
[gaim-migrate @ 6285]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5798
diff
changeset
|
46 #define WINPREFS_PLUGIN_ID "gtk-win-prefs" |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
47 |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
48 /* |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
49 * LOCALS |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
50 */ |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
51 static const char *OPT_WINPREFS_DBLIST_DOCKABLE = "/plugins/gtk/win32/winprefs/dblist_dockable"; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
52 static const char *OPT_WINPREFS_DBLIST_DOCKED = "/plugins/gtk/win32/winprefs/dblist_docked"; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
53 static const char *OPT_WINPREFS_DBLIST_HEIGHT = "/plugins/gtk/win32/winprefs/dblist_height"; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
54 static const char *OPT_WINPREFS_DBLIST_SIDE = "/plugins/gtk/win32/winprefs/dblist_side"; |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
55 static const char *OPT_WINPREFS_DBLIST_ON_TOP = "/plugins/gtk/win32/winprefs/dblist_on_top"; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
56 static const char *OPT_WINPREFS_BLIST_ON_TOP = "/plugins/gtk/win32/winprefs/blist_on_top"; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
57 static const char *OPT_WINPREFS_IM_BLINK = "/plugins/gtk/win32/winprefs/im_blink"; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
58 |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
59 static GaimPlugin *plugin_id = NULL; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
60 static GtkAppBar *blist_ab = NULL; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
61 static GtkWidget *blist = NULL; |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
62 |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
63 /* |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
64 * PROTOS |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
65 */ |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
66 static void blist_create_cb(); |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
67 |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
68 /* |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
69 * CODE |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
70 */ |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
71 |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
72 /* UTIL */ |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
73 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
74 static GtkWidget *wgaim_button(const char *text, GtkWidget *page) { |
5795
0efc365eed6d
[gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents:
5749
diff
changeset
|
75 GtkWidget *button; |
5749
6d6ae91c5de7
[gaim-migrate @ 6174]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5224
diff
changeset
|
76 button = gtk_check_button_new_with_mnemonic(text); |
5795
0efc365eed6d
[gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents:
5749
diff
changeset
|
77 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
5749
6d6ae91c5de7
[gaim-migrate @ 6174]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5224
diff
changeset
|
78 gtk_widget_show(button); |
5795
0efc365eed6d
[gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents:
5749
diff
changeset
|
79 return button; |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
80 } |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
81 |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
82 /* BLIST DOCKING */ |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
83 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
84 static void blist_save_state() { |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
85 if(blist_ab) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
86 if(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_DOCKABLE) && blist_ab->docked) { |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
87 gaim_prefs_set_int(OPT_WINPREFS_DBLIST_HEIGHT, blist_ab->undocked_height); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
88 gaim_prefs_set_int(OPT_WINPREFS_DBLIST_SIDE, blist_ab->side); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
89 gaim_prefs_set_bool(OPT_WINPREFS_DBLIST_DOCKED, blist_ab->docked); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
90 } |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
91 else |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
92 gaim_prefs_set_bool(OPT_WINPREFS_DBLIST_DOCKED, FALSE); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
93 } |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
94 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
95 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
96 static void blist_set_ontop(gboolean val) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
97 if(!blist) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
98 return; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
99 if(val) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
100 SetWindowPos(GDK_WINDOW_HWND(blist->window), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
101 else |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
102 SetWindowPos(GDK_WINDOW_HWND(blist->window), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
103 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
104 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
105 static void blist_dock_cb(gboolean val) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
106 if(val) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
107 gaim_debug(GAIM_DEBUG_INFO, "winprefs", "Blist Docking..\n"); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
108 if(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_ON_TOP)) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
109 blist_set_ontop(TRUE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
110 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
111 else { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
112 gaim_debug(GAIM_DEBUG_INFO, "winprefs", "Blist Undocking..\n"); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
113 if(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_ON_TOP) && |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
114 !gaim_prefs_get_bool(OPT_WINPREFS_BLIST_ON_TOP)) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
115 blist_set_ontop(FALSE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
116 } |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
117 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
118 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
119 static void blist_set_dockable(gboolean val) { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
120 if(val) { |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
121 if(!blist_ab && blist) { |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
122 blist_ab = gtk_appbar_add(blist); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
123 gtk_appbar_add_dock_cb(blist_ab, blist_dock_cb); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
124 } |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
125 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
126 else { |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
127 if(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_ON_TOP) && |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
128 !gaim_prefs_get_bool(OPT_WINPREFS_BLIST_ON_TOP)) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
129 blist_set_ontop(FALSE); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
130 gtk_appbar_remove(blist_ab); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
131 blist_ab = NULL; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
132 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
133 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
134 |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
135 /* PLUGIN CALLBACKS */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
136 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
137 /* We need this because the blist destroy cb won't be called before the |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
138 plugin is unloaded, when quitting */ |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
139 static void gaim_quit_cb() { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
140 gaim_debug(GAIM_DEBUG_INFO, WINPREFS_PLUGIN_ID, "gaim_quit_cb: removing appbar\n"); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
141 blist_save_state(); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
142 blist_set_dockable(FALSE); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
143 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
144 |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
145 /* Needed when the last account is signed off.. and we get the login window */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
146 static void blist_destroy_cb() { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
147 gaim_debug(GAIM_DEBUG_INFO, "winprefs", "blist_destroy_cb\n"); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
148 blist_save_state(); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
149 blist_set_dockable(FALSE); |
6494
4f93f10ddc75
[gaim-migrate @ 7009]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6436
diff
changeset
|
150 gaim_signal_connect((void*)gaim_connections_get_handle(), "signed-on", plugin_id, GAIM_CALLBACK(blist_create_cb), NULL); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
151 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
152 |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
153 static gboolean blist_create_cb_remove(gpointer data) { |
6494
4f93f10ddc75
[gaim-migrate @ 7009]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6436
diff
changeset
|
154 gaim_signal_disconnect(gaim_connections_get_handle(), "signed-on", plugin_id, GAIM_CALLBACK(blist_create_cb)); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
155 return FALSE; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
156 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
157 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
158 static void blist_create_cb() { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
159 gaim_debug(GAIM_DEBUG_INFO, WINPREFS_PLUGIN_ID, "event_signon\n"); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
160 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
161 blist = GAIM_GTK_BLIST(gaim_get_blist())->window; |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
162 g_signal_connect(blist, "destroy", blist_destroy_cb, NULL); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
163 |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
164 if(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_DOCKABLE)) { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
165 blist_set_dockable(TRUE); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
166 if(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_DOCKED)) { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
167 blist_ab->undocked_height = gaim_prefs_get_int(OPT_WINPREFS_DBLIST_HEIGHT); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
168 gtk_appbar_dock(blist_ab, |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
169 gaim_prefs_get_int(OPT_WINPREFS_DBLIST_SIDE)); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
170 if(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_ON_TOP)) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
171 blist_set_ontop(TRUE); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
172 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
173 } |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
174 if(gaim_prefs_get_bool(OPT_WINPREFS_BLIST_ON_TOP)) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
175 blist_set_ontop(TRUE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
176 } |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
177 /* removing here will cause a crash when going to next cb |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
178 in the gaim signal cb loop.. so process delayed. */ |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
179 g_idle_add(blist_create_cb_remove, NULL); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
180 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
181 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
182 /* AUTOSTART */ |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
183 |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
184 static int open_run_key(PHKEY phKey, REGSAM samDesired) { |
5795
0efc365eed6d
[gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents:
5749
diff
changeset
|
185 /* First try current user key (for WinNT & Win2k +), fall back to local machine */ |
0efc365eed6d
[gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents:
5749
diff
changeset
|
186 if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CURRENT_USER, |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
187 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
188 0, samDesired, phKey)); |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
189 else if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
190 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
191 0, samDesired, phKey)); |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
192 else { |
5854
14891982dbee
[gaim-migrate @ 6285]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5798
diff
changeset
|
193 gaim_debug(GAIM_DEBUG_ERROR, WINPREFS_PLUGIN_ID, "open_run_key: Could not open key for writing value\n"); |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
194 return 0; |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
195 } |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
196 return 1; |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
197 } |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
198 |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
199 /* WIN PREFS GENERAL */ |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
200 |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
201 static void winprefs_set_autostart(GtkWidget *w) { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
202 HKEY hKey; |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
203 |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
204 if(!open_run_key(&hKey, KEY_SET_VALUE)) |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
205 return; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
206 if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
207 char buffer[1024]; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
208 DWORD size; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
209 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
210 if((size = GetModuleFileName(wgaim_hinstance(), |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
211 (LPBYTE)buffer, |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
212 sizeof(buffer)))==0) { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
213 gaim_debug(GAIM_DEBUG_ERROR, WINPREFS_PLUGIN_ID, "GetModuleFileName Error.. Could not set Gaim autostart.\n"); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
214 RegCloseKey(hKey); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
215 return; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
216 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
217 /* Now set value of new key */ |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
218 if(ERROR_SUCCESS != RegSetValueEx(hKey, |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
219 "Gaim", |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
220 0, |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
221 REG_SZ, |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
222 buffer, |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
223 size)) |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
224 gaim_debug(GAIM_DEBUG_ERROR, WINPREFS_PLUGIN_ID, "Could not set registry key value\n"); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
225 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
226 else { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
227 if(ERROR_SUCCESS != RegDeleteValue(hKey, "Gaim")) |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
228 gaim_debug(GAIM_DEBUG_ERROR, WINPREFS_PLUGIN_ID, "Could not delete registry key value\n"); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
229 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
230 RegCloseKey(hKey); |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
231 } |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
232 |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
233 static void winprefs_set_blist_dockable(GtkWidget *w, GtkWidget *w1) { |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
234 gaim_prefs_set_bool(OPT_WINPREFS_DBLIST_DOCKABLE, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
235 if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
236 blist_set_dockable(TRUE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
237 gtk_widget_set_sensitive(w1, TRUE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
238 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
239 else { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
240 blist_set_dockable(FALSE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
241 gtk_widget_set_sensitive(w1, FALSE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
242 } |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
243 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
244 |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
245 static void winprefs_set_blist_ontop(GtkWidget *w) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
246 gaim_prefs_set_bool(OPT_WINPREFS_BLIST_ON_TOP, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
247 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
248 if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
249 blist_set_ontop(TRUE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
250 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
251 else { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
252 if(!(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_DOCKABLE) && |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
253 gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_ON_TOP) && |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
254 (blist_ab && blist_ab->docked))) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
255 blist_set_ontop(FALSE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
256 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
257 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
258 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
259 static void winprefs_set_dblist_ontop(GtkWidget *w) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
260 gaim_prefs_set_bool(OPT_WINPREFS_DBLIST_ON_TOP, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
261 if(blist && blist_ab) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
262 if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
263 if(blist_ab->docked) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
264 blist_set_ontop(TRUE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
265 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
266 else if(!gaim_prefs_get_bool(OPT_WINPREFS_BLIST_ON_TOP)) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
267 blist_set_ontop(FALSE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
268 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
269 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
270 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
271 static void winprefs_set_im_blink(GtkWidget *w) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
272 gaim_prefs_set_bool(OPT_WINPREFS_IM_BLINK, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6494
diff
changeset
|
273 wgaim_conv_im_blink_state(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
274 } |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
275 |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
276 /* |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
277 * EXPORTED FUNCTIONS |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
278 */ |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
279 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
280 gboolean plugin_load(GaimPlugin *plugin) { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
281 plugin_id = plugin; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
282 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
283 /* blist docking init */ |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
284 if(gaim_get_blist() && GAIM_GTK_BLIST(gaim_get_blist())) { |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
285 blist = GAIM_GTK_BLIST(gaim_get_blist())->window; |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
286 /* Set Dockable */ |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
287 if(gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_DOCKABLE)) |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
288 blist_set_dockable(TRUE); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
289 /* Set On top */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
290 if(gaim_prefs_get_bool(OPT_WINPREFS_BLIST_ON_TOP)) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
291 blist_set_ontop(TRUE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
292 g_signal_connect(blist, "destroy", blist_destroy_cb, NULL); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
293 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
294 else |
6494
4f93f10ddc75
[gaim-migrate @ 7009]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6436
diff
changeset
|
295 gaim_signal_connect((void*)gaim_connections_get_handle(), "signed-on", plugin_id, GAIM_CALLBACK(blist_create_cb), NULL); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
296 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6494
diff
changeset
|
297 wgaim_conv_im_blink_state(gaim_prefs_get_bool(OPT_WINPREFS_IM_BLINK)); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
298 |
6494
4f93f10ddc75
[gaim-migrate @ 7009]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6436
diff
changeset
|
299 gaim_signal_connect((void*)gaim_get_core(), "quitting", plugin, GAIM_CALLBACK(gaim_quit_cb), NULL); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
300 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
301 return TRUE; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
302 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
303 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
304 gboolean plugin_unload(GaimPlugin *plugin) { |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
305 blist_set_dockable(FALSE); |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6494
diff
changeset
|
306 wgaim_conv_im_blink_state(TRUE); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
307 return TRUE; |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
308 } |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
309 |
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
310 static GtkWidget* get_config_frame(GaimPlugin *plugin) { |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
311 GtkWidget *ret; |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
312 GtkWidget *button; |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
313 GtkWidget *dbutton; |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
314 GtkWidget *vbox; |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
315 char* gtk_version = NULL; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
316 HKEY hKey = HKEY_CURRENT_USER; |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
317 |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
318 ret = gtk_vbox_new(FALSE, 18); |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
319 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
320 |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
321 while(hKey) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
322 char version[25]; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
323 DWORD vlen = 25; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
324 if(wgaim_read_reg_string(hKey, "SOFTWARE\\GTK\\2.0", "Version", (LPBYTE)&version, &vlen)) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
325 char revision[25]; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
326 DWORD rlen = 25; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
327 gboolean gotrev = FALSE; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
328 if(wgaim_read_reg_string(hKey, "SOFTWARE\\GTK\\2.0", "Revision", (LPBYTE)&revision, &rlen)) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
329 revision[0] = g_ascii_toupper(revision[0]); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
330 revision[1] = '\0'; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
331 gotrev = TRUE; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
332 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
333 gtk_version = g_strdup_printf("%s%s%s", |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
334 version, |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
335 gotrev?" Revision ":"", |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
336 gotrev?revision:""); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
337 hKey = 0; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
338 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
339 if(hKey == HKEY_CURRENT_USER) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
340 hKey = HKEY_LOCAL_MACHINE; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
341 else if(hKey == HKEY_LOCAL_MACHINE) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
342 hKey = 0; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
343 } |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
344 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
345 /* Display Installed GTK+ Runtime Version */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
346 if(gtk_version) { |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
347 GtkWidget *label; |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
348 vbox = gaim_gtk_make_frame(ret, _("GTK+ Runtime Version")); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
349 label = gtk_label_new(gtk_version); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
350 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
351 gtk_widget_show(label); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
352 g_free(gtk_version); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
353 } |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
354 |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
355 /* Autostart */ |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
356 vbox = gaim_gtk_make_frame (ret, _("Startup")); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
357 button = wgaim_button(_("_Start Gaim on Windows startup"), vbox); |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
358 if(open_run_key(&hKey, KEY_QUERY_VALUE)) { |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
359 if(ERROR_SUCCESS == RegQueryValueEx(hKey, "Gaim", 0, NULL, NULL, NULL)) { |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
360 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
361 } |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
362 } |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
363 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(winprefs_set_autostart), NULL); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
364 |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
365 /* Buddy List */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
366 vbox = gaim_gtk_make_frame (ret, _("Buddy List")); |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
367 button = wgaim_button(_("_Dockable Buddy List"), vbox); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
368 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_DOCKABLE)); |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
369 |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
370 /* Docked Blist On Top */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
371 dbutton = wgaim_button(_("Docked _Buddy List is always on top"), vbox); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
372 gtk_signal_connect(GTK_OBJECT(dbutton), "clicked", GTK_SIGNAL_FUNC(winprefs_set_dblist_ontop), NULL); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
373 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dbutton), gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_ON_TOP)); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
374 if(!gaim_prefs_get_bool(OPT_WINPREFS_DBLIST_DOCKABLE)) |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
375 gtk_widget_set_sensitive(GTK_WIDGET(dbutton), FALSE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
376 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
377 /* Connect cb for Dockable option.. passing dblist on top button */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
378 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(winprefs_set_blist_dockable), dbutton); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
379 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
380 /* Blist On Top */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
381 button = wgaim_button(_("_Keep Buddy List window on top"), vbox); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
382 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(winprefs_set_blist_ontop), NULL); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
383 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), gaim_prefs_get_bool(OPT_WINPREFS_BLIST_ON_TOP)); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
384 |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
385 /* Conversations */ |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
386 vbox = gaim_gtk_make_frame (ret, _("Conversations")); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
387 button = wgaim_button(_("_Flash Window when messages are received"), vbox); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
388 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(winprefs_set_im_blink), NULL); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
389 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), gaim_prefs_get_bool(OPT_WINPREFS_IM_BLINK)); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
390 |
4134
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
391 gtk_widget_show_all(ret); |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
392 return ret; |
c0f4c664e3ba
[gaim-migrate @ 4352]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
393 } |
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
394 |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
395 static GaimGtkPluginUiInfo ui_info = |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
396 { |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
397 get_config_frame |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
398 }; |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
399 |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
400 static GaimPluginInfo info = |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
401 { |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
402 2, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
403 GAIM_PLUGIN_STANDARD, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
404 GAIM_GTK_PLUGIN_TYPE, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
405 0, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
406 NULL, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
407 GAIM_PRIORITY_DEFAULT, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
408 WINPREFS_PLUGIN_ID, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
409 N_("WinGaim Options"), |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
410 VERSION, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
411 N_("Options specific to Windows Gaim."), |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
412 N_("Options specific to Windows Gaim."), |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
413 "Herman Bloggs <hermanator12002@yahoo.com>", |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
414 GAIM_WEBSITE, |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
415 plugin_load, |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
416 plugin_unload, |
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
417 NULL, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
418 &ui_info, |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
419 NULL |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
420 }; |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
421 |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
422 static void |
5798
217d24d11b6e
[gaim-migrate @ 6223]
Christian Hammond <chipx86@chipx86.com>
parents:
5795
diff
changeset
|
423 init_plugin(GaimPlugin *plugin) |
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
424 { |
6409
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
425 gaim_prefs_add_none("/plugins/gtk/win32"); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
426 gaim_prefs_add_none("/plugins/gtk/win32/winprefs"); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
427 gaim_prefs_add_bool(OPT_WINPREFS_DBLIST_DOCKABLE, FALSE); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
428 gaim_prefs_add_bool(OPT_WINPREFS_DBLIST_DOCKED, FALSE); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
429 gaim_prefs_add_int(OPT_WINPREFS_DBLIST_HEIGHT, 0); |
752d0600b514
[gaim-migrate @ 6915]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
430 gaim_prefs_add_int(OPT_WINPREFS_DBLIST_SIDE, 0); |
6436
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
431 gaim_prefs_add_bool(OPT_WINPREFS_DBLIST_ON_TOP, FALSE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
432 gaim_prefs_add_bool(OPT_WINPREFS_BLIST_ON_TOP, FALSE); |
759a81390b36
[gaim-migrate @ 6944]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6409
diff
changeset
|
433 gaim_prefs_add_bool(OPT_WINPREFS_IM_BLINK, TRUE); |
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
434 } |
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4606
diff
changeset
|
435 |
6063 | 436 GAIM_INIT_PLUGIN(winprefs, init_plugin, info) |