Mercurial > pidgin.yaz
annotate pidgin/gtkdocklet.c @ 32396:e9ea77904829
Rather access PurpleBuddy->proto_data using the accessor functions.
author | andrew.victor@mxit.com |
---|---|
date | Tue, 23 Aug 2011 20:57:19 +0000 |
parents | e304b1a0b516 |
children | 7b794ddea945 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15823 | 2 * System tray icon (aka docklet) plugin for Purple |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4 * Copyright (C) 2002-3 Robert McQueen <robot101@debian.org> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6 * Inspired by a similar plugin by: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * John (J5) Palmieri <johnp@martianrock.com> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * This program is free software; you can redistribute it and/or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * modify it under the terms of the GNU General Public License as |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * published by the Free Software Foundation; either version 2 of the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * License, or (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * This program is distributed in the hope that it will be useful, but |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18853
diff
changeset
|
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18853
diff
changeset
|
22 * 02111-1301, USA. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 #include "internal.h" |
15514 | 25 #include "pidgin.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "core.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 #include "conversation.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "prefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #include "signals.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "sound.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "gtkaccount.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "gtkblist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "gtkconv.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "gtkplugin.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "gtkprefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "gtksavedstatuses.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 #include "gtksound.h" |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
41 #include "gtkstatusbox.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 #include "gtkutils.h" |
15822
84b0f9b23ede
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@gmail.com>
parents:
15821
diff
changeset
|
43 #include "pidginstock.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "gtkdocklet.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "gtkdialogs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 #ifndef DOCKLET_TOOLTIP_LINE_LIMIT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 #define DOCKLET_TOOLTIP_LINE_LIMIT 5 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 /* globals */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 static struct docklet_ui_ops *ui_ops = NULL; |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
53 static PurpleStatusPrimitive status = PURPLE_STATUS_OFFLINE; |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
54 static gboolean pending = FALSE; |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
55 static gboolean connecting = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 static gboolean enable_join_chat = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 static guint docklet_blinking_timer = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 static gboolean visible = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 static gboolean visibility_manager = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 * docklet status and utility functions |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 static gboolean |
22011
76e0463db3aa
Squash some compiler warnings, some from my -Wstrict-prototypes fixing.
Richard Laager <rlaager@wiktel.com>
parents:
22007
diff
changeset
|
65 docklet_blink_icon(gpointer data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 static gboolean blinked = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 gboolean ret = FALSE; /* by default, don't keep blinking */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 blinked = !blinked; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
72 if(pending && !connecting) { |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
73 if (blinked) { |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
74 if (ui_ops && ui_ops->blank_icon) |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
75 ui_ops->blank_icon(); |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
76 } else { |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
77 pidgin_docklet_update_icon(); |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
78 } |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
79 ret = TRUE; /* keep blinking */ |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
80 } else { |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
81 docklet_blinking_timer = 0; |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
82 blinked = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 static GList * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 get_pending_list(guint max) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 { |
25077
9ee0cb95a252
This small optimization has been sitting in my tree for a long time.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25076
diff
changeset
|
91 GList *l_im, *l_chat; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 |
15823 | 93 l_im = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM, |
15505
762b6547adf9
GAIM_UNSEEN to PIDGIN_UNSEEN
Sean Egan <seanegan@gmail.com>
parents:
15502
diff
changeset
|
94 PIDGIN_UNSEEN_TEXT, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 FALSE, max); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 |
25077
9ee0cb95a252
This small optimization has been sitting in my tree for a long time.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25076
diff
changeset
|
97 /* Short circuit if we have our information already */ |
9ee0cb95a252
This small optimization has been sitting in my tree for a long time.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25076
diff
changeset
|
98 if (max == 1 && l_im != NULL) |
9ee0cb95a252
This small optimization has been sitting in my tree for a long time.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25076
diff
changeset
|
99 return l_im; |
9ee0cb95a252
This small optimization has been sitting in my tree for a long time.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
25076
diff
changeset
|
100 |
15823 | 101 l_chat = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_CHAT, |
15505
762b6547adf9
GAIM_UNSEEN to PIDGIN_UNSEEN
Sean Egan <seanegan@gmail.com>
parents:
15502
diff
changeset
|
102 PIDGIN_UNSEEN_NICK, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 FALSE, max); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 if (l_im != NULL && l_chat != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 return g_list_concat(l_im, l_chat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 else if (l_im != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 return l_im; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 return l_chat; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 static gboolean |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21284
diff
changeset
|
114 docklet_update_status(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 GList *convs, *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 int count; |
15823 | 118 PurpleSavedStatus *saved_status; |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
119 PurpleStatusPrimitive newstatus = PURPLE_STATUS_OFFLINE; |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
120 gboolean newpending = FALSE, newconnecting = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 |
16630
112fa61799f4
Patch from charkins in ticket #198 to fulfill a feature request by hbons:
Richard Laager <rlaager@wiktel.com>
parents:
16202
diff
changeset
|
122 /* get the current savedstatus */ |
112fa61799f4
Patch from charkins in ticket #198 to fulfill a feature request by hbons:
Richard Laager <rlaager@wiktel.com>
parents:
16202
diff
changeset
|
123 saved_status = purple_savedstatus_get_current(); |
112fa61799f4
Patch from charkins in ticket #198 to fulfill a feature request by hbons:
Richard Laager <rlaager@wiktel.com>
parents:
16202
diff
changeset
|
124 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
125 /* determine if any ims have unseen messages */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 convs = get_pending_list(DOCKLET_TOOLTIP_LINE_LIMIT); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 |
18853
fab096e7b804
reverting the show docklet preference the correct way
Ka-Hing Cheung <khc@hxbc.us>
parents:
18833
diff
changeset
|
128 if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/docklet/show"), "pending")) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 if (convs && ui_ops->create && !visible) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 ui_ops->create(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 } else if (!convs && ui_ops->destroy && visible) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 ui_ops->destroy(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 if (!visible) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 if (convs != NULL) { |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
145 newpending = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 /* set tooltip if messages are pending */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 if (ui_ops->set_tooltip) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 GString *tooltip_text = g_string_new(""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 for (l = convs, count = 0 ; l != NULL ; l = l->next, count++) { |
20951
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
151 PurpleConversation *conv = (PurpleConversation *)l->data; |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
152 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
153 |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
154 if (count == DOCKLET_TOOLTIP_LINE_LIMIT - 1) { |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
155 g_string_append(tooltip_text, _("Right-click for more unread messages...\n")); |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
156 } else if(gtkconv) { |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
157 g_string_append_printf(tooltip_text, |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
158 ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count), |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
159 gtkconv->unseen_count, |
20980
2ba0963b5bdc
Use the conversation title for unread message tooltips. Fixes #3557.
Casey Harkins <charkins@pidgin.im>
parents:
20951
diff
changeset
|
160 purple_conversation_get_title(conv)); |
20951
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
161 } else { |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
162 g_string_append_printf(tooltip_text, |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
163 ngettext("%d unread message from %s\n", "%d unread messages from %s\n", |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
164 GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count"))), |
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
165 GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count")), |
20980
2ba0963b5bdc
Use the conversation title for unread message tooltips. Fixes #3557.
Casey Harkins <charkins@pidgin.im>
parents:
20951
diff
changeset
|
166 purple_conversation_get_title(conv)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 /* get rid of the last newline */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 if (tooltip_text->len > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 tooltip_text = g_string_truncate(tooltip_text, tooltip_text->len - 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 ui_ops->set_tooltip(tooltip_text->str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 g_string_free(tooltip_text, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 } else if (ui_ops->set_tooltip) { |
16932
b668951121d8
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@wiktel.com>
parents:
16922
diff
changeset
|
182 char *tooltip_text = g_strconcat(PIDGIN_NAME, " - ", |
16630
112fa61799f4
Patch from charkins in ticket #198 to fulfill a feature request by hbons:
Richard Laager <rlaager@wiktel.com>
parents:
16202
diff
changeset
|
183 purple_savedstatus_get_title(saved_status), NULL); |
112fa61799f4
Patch from charkins in ticket #198 to fulfill a feature request by hbons:
Richard Laager <rlaager@wiktel.com>
parents:
16202
diff
changeset
|
184 ui_ops->set_tooltip(tooltip_text); |
112fa61799f4
Patch from charkins in ticket #198 to fulfill a feature request by hbons:
Richard Laager <rlaager@wiktel.com>
parents:
16202
diff
changeset
|
185 g_free(tooltip_text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 |
15823 | 188 for(l = purple_accounts_get_all(); l != NULL; l = l->next) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 |
15823 | 190 PurpleAccount *account = (PurpleAccount*)l->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 |
15823 | 192 if (!purple_account_get_enabled(account, PIDGIN_UI)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 |
15823 | 195 if (purple_account_is_disconnected(account)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 |
15823 | 198 if (purple_account_is_connecting(account)) |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
199 newconnecting = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 } |
15701
4a331e8d01df
Fix win32 docklet. This is pretty ugly - we'll force GTK+ 2.10 at some point and use GtkStatusIcon to avoid converting the stock images to HICONs directly.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15699
diff
changeset
|
201 |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
202 newstatus = purple_savedstatus_get_type(saved_status); |
15701
4a331e8d01df
Fix win32 docklet. This is pretty ugly - we'll force GTK+ 2.10 at some point and use GtkStatusIcon to avoid converting the stock images to HICONs directly.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15699
diff
changeset
|
203 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 /* update the icon if we changed status */ |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
205 if (status != newstatus || pending!=newpending || connecting!=newconnecting) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 status = newstatus; |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
207 pending = newpending; |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
208 connecting = newconnecting; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
210 pidgin_docklet_update_icon(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 /* and schedule the blinker function if messages are pending */ |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
213 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/blink") |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
214 && pending && !connecting && docklet_blinking_timer == 0) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 docklet_blinking_timer = g_timeout_add(500, docklet_blink_icon, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 return FALSE; /* for when we're called by the glib idle handler */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 static gboolean |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21284
diff
changeset
|
223 online_account_supports_chat(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 GList *c = NULL; |
15823 | 226 c = purple_connections_get_all(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 while(c != NULL) { |
15823 | 229 PurpleConnection *gc = c->data; |
230 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 if (prpl_info != NULL && prpl_info->chat_info != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 c = c->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 * callbacks and signal handlers |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 static void |
15821 | 244 pidgin_quit_cb() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 /* TODO: confirm quit while pending */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 docklet_update_status_cb(void *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 docklet_update_status(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 static void |
15823 | 257 docklet_conv_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 { |
15823 | 259 if (type == PURPLE_CONV_UPDATE_UNSEEN) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 docklet_update_status(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 static void |
15823 | 264 docklet_signed_on_cb(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 if (!enable_join_chat) { |
15823 | 267 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 enable_join_chat = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 docklet_update_status(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 static void |
15823 | 274 docklet_signed_off_cb(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 if (enable_join_chat) { |
15823 | 277 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 enable_join_chat = online_account_supports_chat(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 docklet_update_status(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 static void |
15823 | 284 docklet_show_pref_changed_cb(const char *name, PurplePrefType type, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 gconstpointer value, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 const char *val = value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 if (!strcmp(val, "always")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 if (ui_ops->create) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 if (!visible) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 ui_ops->create(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 else if (!visibility_manager) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
293 pidgin_blist_visibility_manager_add(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 visibility_manager = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 } else if (!strcmp(val, "never")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 if (visible && ui_ops->destroy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 ui_ops->destroy(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 if (visibility_manager) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
302 pidgin_blist_visibility_manager_remove(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 visibility_manager = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 docklet_update_status(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 * docklet pop-up menu |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
312 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
314 docklet_toggle_mute(GtkWidget *toggle, void *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
316 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", GTK_CHECK_MENU_ITEM(toggle)->active); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 docklet_toggle_blink(GtkWidget *toggle, void *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
322 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/blink", GTK_CHECK_MENU_ITEM(toggle)->active); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 docklet_toggle_blist(GtkWidget *toggle, void *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 { |
15823 | 328 purple_blist_set_visible(GTK_CHECK_MENU_ITEM(toggle)->active); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 #ifdef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 /* This is a workaround for a bug in windows GTK+. Clicking outside of the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 menu does not get rid of it, so instead we get rid of it as soon as the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 pointer leaves the menu. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 hide_docklet_menu(gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 if (data != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 gtk_menu_popdown(GTK_MENU(data)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 docklet_menu_leave_enter(GtkWidget *menu, GdkEventCrossing *event, void *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 static guint hide_docklet_timer = 0; |
25076
008f186c7bc7
Fix from "oopepe" to make menus more reliably responsive.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23581
diff
changeset
|
348 |
008f186c7bc7
Fix from "oopepe" to make menus more reliably responsive.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23581
diff
changeset
|
349 if (event->type == GDK_LEAVE_NOTIFY && (event->detail == GDK_NOTIFY_ANCESTOR || |
008f186c7bc7
Fix from "oopepe" to make menus more reliably responsive.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23581
diff
changeset
|
350 event->detail == GDK_NOTIFY_UNKNOWN)) { |
15823 | 351 purple_debug(PURPLE_DEBUG_INFO, "docklet", "menu leave-notify-event\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 /* Add some slop so that the menu doesn't annoyingly disappear when mousing around */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 if (hide_docklet_timer == 0) { |
15823 | 354 hide_docklet_timer = purple_timeout_add(500, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 hide_docklet_menu, menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 } else if (event->type == GDK_ENTER_NOTIFY && event->detail == GDK_NOTIFY_ANCESTOR) { |
15823 | 358 purple_debug(PURPLE_DEBUG_INFO, "docklet", "menu enter-notify-event\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 if (hide_docklet_timer != 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 /* Cancel the hiding if we reenter */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 |
15823 | 362 purple_timeout_remove(hide_docklet_timer); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
363 hide_docklet_timer = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
364 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
370 /* There is a lot of code here for handling the status submenu, much of |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
371 * which is duplicated from the gtkstatusbox. It'd be nice to add API |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
372 * somewhere to simplify this (either in the statusbox, or in libpurple). |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
373 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
374 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
375 show_custom_status_editor_cb(GtkMenuItem *menuitem, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 { |
15823 | 377 PurpleSavedStatus *saved_status; |
378 saved_status = purple_savedstatus_get_current(); | |
16119
e57d9d5e5c86
sf patch #1622581, from Greg Taeger
Mark Doliner <mark@kingant.net>
parents:
16070
diff
changeset
|
379 |
e57d9d5e5c86
sf patch #1622581, from Greg Taeger
Mark Doliner <mark@kingant.net>
parents:
16070
diff
changeset
|
380 if (purple_savedstatus_get_type(saved_status) == PURPLE_STATUS_AVAILABLE) |
e57d9d5e5c86
sf patch #1622581, from Greg Taeger
Mark Doliner <mark@kingant.net>
parents:
16070
diff
changeset
|
381 saved_status = purple_savedstatus_new(NULL, PURPLE_STATUS_AWAY); |
e57d9d5e5c86
sf patch #1622581, from Greg Taeger
Mark Doliner <mark@kingant.net>
parents:
16070
diff
changeset
|
382 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
383 pidgin_status_editor_show(FALSE, |
15823 | 384 purple_savedstatus_is_transient(saved_status) ? saved_status : NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
385 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
387 static PurpleSavedStatus * |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
388 create_transient_status(PurpleStatusPrimitive primitive, PurpleStatusType *status_type) |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
389 { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
390 PurpleSavedStatus *saved_status = purple_savedstatus_new(NULL, primitive); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
391 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
392 if(status_type != NULL) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
393 GList *tmp, *active_accts = purple_accounts_get_all_active(); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
394 for (tmp = active_accts; tmp != NULL; tmp = tmp->next) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
395 purple_savedstatus_set_substatus(saved_status, |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
396 (PurpleAccount*) tmp->data, status_type, NULL); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
397 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
398 g_list_free(active_accts); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
399 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
400 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
401 return saved_status; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
402 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
403 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
404 static void |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
405 activate_status_account_cb(GtkMenuItem *menuitem, gpointer user_data) |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
406 { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
407 PurpleStatusType *status_type; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
408 PurpleStatusPrimitive primitive; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
409 PurpleSavedStatus *saved_status = NULL; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
410 GList *iter = purple_savedstatuses_get_all(); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
411 GList *tmp, *active_accts = purple_accounts_get_all_active(); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
412 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
413 status_type = (PurpleStatusType *)user_data; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
414 primitive = purple_status_type_get_primitive(status_type); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
415 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
416 for (; iter != NULL; iter = iter->next) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
417 PurpleSavedStatus *ss = iter->data; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
418 if ((purple_savedstatus_get_type(ss) == primitive) && purple_savedstatus_is_transient(ss) && |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
419 purple_savedstatus_has_substatuses(ss)) |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
420 { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
421 gboolean found = FALSE; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
422 /* The currently enabled accounts must have substatuses for all the active accts */ |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
423 for(tmp = active_accts; tmp != NULL; tmp = tmp->next) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
424 PurpleAccount *acct = tmp->data; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
425 PurpleSavedStatusSub *sub = purple_savedstatus_get_substatus(ss, acct); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
426 if (sub) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
427 const PurpleStatusType *sub_type = purple_savedstatus_substatus_get_type(sub); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
428 const char *subtype_status_id = purple_status_type_get_id(sub_type); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
429 if (subtype_status_id && !strcmp(subtype_status_id, |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
430 purple_status_type_get_id(status_type))) |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
431 found = TRUE; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
432 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
433 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
434 if (!found) |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
435 continue; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
436 saved_status = ss; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
437 break; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
438 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
439 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
440 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
441 g_list_free(active_accts); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
442 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
443 /* Create a new transient saved status if we weren't able to find one */ |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
444 if (saved_status == NULL) |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
445 saved_status = create_transient_status(primitive, status_type); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
446 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
447 /* Set the status for each account */ |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
448 purple_savedstatus_activate(saved_status); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
449 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
450 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
451 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 activate_status_primitive_cb(GtkMenuItem *menuitem, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 { |
15823 | 454 PurpleStatusPrimitive primitive; |
455 PurpleSavedStatus *saved_status; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 primitive = GPOINTER_TO_INT(user_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
459 /* Try to lookup an already existing transient saved status */ |
15823 | 460 saved_status = purple_savedstatus_find_transient_by_type_and_message(primitive, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
461 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
462 /* Create a new transient saved status if we weren't able to find one */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 if (saved_status == NULL) |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
464 saved_status = create_transient_status(primitive, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 /* Set the status for each account */ |
15823 | 467 purple_savedstatus_activate(saved_status); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
471 activate_saved_status_cb(GtkMenuItem *menuitem, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 time_t creation_time; |
15823 | 474 PurpleSavedStatus *saved_status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 creation_time = GPOINTER_TO_INT(user_data); |
15823 | 477 saved_status = purple_savedstatus_find_by_creation_time(creation_time); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 if (saved_status != NULL) |
15823 | 479 purple_savedstatus_activate(saved_status); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 static GtkWidget * |
26706
4aa5400b1b99
Replace the deprecated GtkSignalFunc and GTK_SIGNAL_FUNC with GCallback and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25077
diff
changeset
|
483 new_menu_item_with_status_icon(GtkWidget *menu, const char *str, PurpleStatusPrimitive primitive, GCallback cb, gpointer data, guint accel_key, guint accel_mods, char *mod) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
484 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 GtkWidget *menuitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 GdkPixbuf *pixbuf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
487 GtkWidget *image; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 |
20894
39a793dcb9df
Patch from QuLogic to not use underscores in saved-statuses as mnemonics
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20153
diff
changeset
|
489 menuitem = gtk_image_menu_item_new_with_label(str); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 if (menu) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 |
26706
4aa5400b1b99
Replace the deprecated GtkSignalFunc and GTK_SIGNAL_FUNC with GCallback and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25077
diff
changeset
|
494 if (cb) |
4aa5400b1b99
Replace the deprecated GtkSignalFunc and GTK_SIGNAL_FUNC with GCallback and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25077
diff
changeset
|
495 g_signal_connect(G_OBJECT(menuitem), "activate", cb, data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 |
15738
20225df32b7e
Change some old, busted status icon stuff to use the new hotness
Sean Egan <seanegan@gmail.com>
parents:
15702
diff
changeset
|
497 pixbuf = pidgin_create_status_icon(primitive, menu, PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 image = gtk_image_new_from_pixbuf(pixbuf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 g_object_unref(pixbuf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 gtk_widget_show_all(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 return menuitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
507 static void |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
508 add_account_statuses(GtkWidget *menu, PurpleAccount *account) |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
509 { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
510 GList *l; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
511 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
512 for (l = purple_account_get_status_types(account); l != NULL; l = l->next) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
513 PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
514 PurpleStatusPrimitive prim; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
515 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
516 if (!purple_status_type_is_user_settable(status_type)) |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
517 continue; |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
518 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
519 prim = purple_status_type_get_primitive(status_type); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
520 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
521 new_menu_item_with_status_icon(menu, |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
522 purple_status_type_get_name(status_type), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
523 prim, G_CALLBACK(activate_status_account_cb), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
524 status_type, 0, 0, NULL); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
525 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
526 } |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
527 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 static GtkWidget * |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21284
diff
changeset
|
529 docklet_status_submenu(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 GtkWidget *submenu, *menuitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 GList *popular_statuses, *cur; |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
533 PidginStatusBox *statusbox = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 submenu = gtk_menu_new(); |
23200
3353ac89ccb1
A patch from Kevin Wu Won to add mnemonics to the docklet menu.
Kevin Wu Won <exclipy@gmail.com>
parents:
22011
diff
changeset
|
536 menuitem = gtk_menu_item_new_with_mnemonic(_("_Change Status")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
537 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
539 if(pidgin_blist_get_default_gtk_blist() != NULL) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
540 statusbox = PIDGIN_STATUS_BOX(pidgin_blist_get_default_gtk_blist()->statusbox); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
541 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
542 |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
543 if(statusbox && statusbox->account != NULL) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
544 add_account_statuses(submenu, statusbox->account); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
545 } else if(statusbox && statusbox->token_status_account != NULL) { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
546 add_account_statuses(submenu, statusbox->token_status_account); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
547 } else { |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
548 new_menu_item_with_status_icon(submenu, _("Available"), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
549 PURPLE_STATUS_AVAILABLE, G_CALLBACK(activate_status_primitive_cb), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
550 GINT_TO_POINTER(PURPLE_STATUS_AVAILABLE), 0, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
552 new_menu_item_with_status_icon(submenu, _("Away"), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
553 PURPLE_STATUS_AWAY, G_CALLBACK(activate_status_primitive_cb), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
554 GINT_TO_POINTER(PURPLE_STATUS_AWAY), 0, 0, NULL); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
555 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
556 new_menu_item_with_status_icon(submenu, _("Do not disturb"), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
557 PURPLE_STATUS_UNAVAILABLE, G_CALLBACK(activate_status_primitive_cb), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
558 GINT_TO_POINTER(PURPLE_STATUS_UNAVAILABLE), 0, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 |
20936
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
560 new_menu_item_with_status_icon(submenu, _("Invisible"), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
561 PURPLE_STATUS_INVISIBLE, G_CALLBACK(activate_status_primitive_cb), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
562 GINT_TO_POINTER(PURPLE_STATUS_INVISIBLE), 0, 0, NULL); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
563 |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
564 new_menu_item_with_status_icon(submenu, _("Offline"), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
565 PURPLE_STATUS_OFFLINE, G_CALLBACK(activate_status_primitive_cb), |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
566 GINT_TO_POINTER(PURPLE_STATUS_OFFLINE), 0, 0, NULL); |
1d8969748cd9
Make sure that the "Change Status" submenu in the docklet context menu
Casey Harkins <charkins@pidgin.im>
parents:
20895
diff
changeset
|
567 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 |
15823 | 569 popular_statuses = purple_savedstatuses_get_popular(6); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 if (popular_statuses != NULL) |
15507 | 571 pidgin_separator(submenu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 for (cur = popular_statuses; cur != NULL; cur = cur->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 { |
15823 | 574 PurpleSavedStatus *saved_status = cur->data; |
575 time_t creation_time = purple_savedstatus_get_creation_time(saved_status); | |
15821 | 576 new_menu_item_with_status_icon(submenu, |
15823 | 577 purple_savedstatus_get_title(saved_status), |
578 purple_savedstatus_get_type(saved_status), G_CALLBACK(activate_saved_status_cb), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
579 GINT_TO_POINTER(creation_time), 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 g_list_free(popular_statuses); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
582 |
15507 | 583 pidgin_separator(submenu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
584 |
16922
0aa5e1e5c937
Telcontar on #pidgin-win32 pointed out that the "New..." and "Saved..."
Casey Harkins <charkins@pidgin.im>
parents:
16872
diff
changeset
|
585 pidgin_new_item_from_stock(submenu, _("New..."), NULL, G_CALLBACK(show_custom_status_editor_cb), NULL, 0, 0, NULL); |
0aa5e1e5c937
Telcontar on #pidgin-win32 pointed out that the "New..." and "Saved..."
Casey Harkins <charkins@pidgin.im>
parents:
16872
diff
changeset
|
586 pidgin_new_item_from_stock(submenu, _("Saved..."), NULL, G_CALLBACK(pidgin_status_window_show), NULL, 0, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
587 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 return menuitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 |
20881
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
591 |
20895
dc94a669bbf6
merge of '0799c401a032f2fe66af5bbf14c1269fa11fe738'
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
592 |
20881
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
593 static void |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
594 plugin_act(GtkObject *obj, PurplePluginAction *pam) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
595 { |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
596 if (pam && pam->callback) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
597 pam->callback(pam); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
598 } |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
599 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
600 static void |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
601 build_plugin_actions(GtkWidget *menu, PurplePlugin *plugin, |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
602 gpointer context) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
603 { |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
604 GtkWidget *menuitem; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
605 PurplePluginAction *action = NULL; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
606 GList *actions, *l; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
607 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
608 actions = PURPLE_PLUGIN_ACTIONS(plugin, context); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
609 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
610 for (l = actions; l != NULL; l = l->next) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
611 { |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
612 if (l->data) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
613 { |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
614 action = (PurplePluginAction *) l->data; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
615 action->plugin = plugin; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
616 action->context = context; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
617 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
618 menuitem = gtk_menu_item_new_with_label(action->label); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
619 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
620 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
621 g_signal_connect(G_OBJECT(menuitem), "activate", |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
622 G_CALLBACK(plugin_act), action); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
623 g_object_set_data_full(G_OBJECT(menuitem), "plugin_action", |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
624 action, |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
625 (GDestroyNotify)purple_plugin_action_free); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
626 gtk_widget_show(menuitem); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
627 } |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
628 else |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
629 pidgin_separator(menu); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
630 } |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
631 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
632 g_list_free(actions); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
633 } |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
634 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
635 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
636 static void |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
637 docklet_plugin_actions(GtkWidget *menu) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
638 { |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
639 GtkWidget *menuitem, *submenu; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
640 PurplePlugin *plugin = NULL; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
641 GList *l; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
642 int c = 0; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
643 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
644 g_return_if_fail(menu != NULL); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
645 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
646 /* Add a submenu for each plugin with custom actions */ |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
647 for (l = purple_plugins_get_loaded(); l; l = l->next) { |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
648 plugin = (PurplePlugin *) l->data; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
649 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
650 if (PURPLE_IS_PROTOCOL_PLUGIN(plugin)) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
651 continue; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
652 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
653 if (!PURPLE_PLUGIN_HAS_ACTIONS(plugin)) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
654 continue; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
655 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
656 menuitem = gtk_image_menu_item_new_with_label(_(plugin->info->name)); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
657 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
658 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
659 submenu = gtk_menu_new(); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
660 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
661 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
662 build_plugin_actions(submenu, plugin, NULL); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
663 |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
664 c++; |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
665 } |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
666 if(c>0) |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
667 pidgin_separator(menu); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
668 } |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
669 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 static void |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21284
diff
changeset
|
671 docklet_menu(void) |
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21284
diff
changeset
|
672 { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 static GtkWidget *menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
674 GtkWidget *menuitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
676 if (menu) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 gtk_widget_destroy(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
680 menu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 |
23201
326b1b389a88
Changes to the docklet mnemonics patch to make them more consistent with
Richard Laager <rlaager@wiktel.com>
parents:
23200
diff
changeset
|
682 menuitem = gtk_check_menu_item_new_with_mnemonic(_("Show Buddy _List")); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
683 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_visible")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
684 g_signal_connect(G_OBJECT(menuitem), "toggled", G_CALLBACK(docklet_toggle_blist), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
685 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 |
23200
3353ac89ccb1
A patch from Kevin Wu Won to add mnemonics to the docklet menu.
Kevin Wu Won <exclipy@gmail.com>
parents:
22011
diff
changeset
|
687 menuitem = gtk_menu_item_new_with_mnemonic(_("_Unread Messages")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
689 if (pending) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 GtkWidget *submenu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
691 GList *l = get_pending_list(0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
692 if (l == NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
693 gtk_widget_set_sensitive(menuitem, FALSE); |
15823 | 694 purple_debug_warning("docklet", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
695 "status indicates messages pending, but no conversations with unseen messages were found."); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 } else { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
697 pidgin_conversations_fill_menu(submenu, l); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 g_list_free(l); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
701 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 gtk_widget_set_sensitive(menuitem, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 |
15507 | 706 pidgin_separator(menu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 |
23201
326b1b389a88
Changes to the docklet mnemonics patch to make them more consistent with
Richard Laager <rlaager@wiktel.com>
parents:
23200
diff
changeset
|
708 menuitem = pidgin_new_item_from_stock(menu, _("New _Message..."), PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, G_CALLBACK(pidgin_dialogs_im), NULL, 0, 0, NULL); |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
709 if (status == PURPLE_STATUS_OFFLINE) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 gtk_widget_set_sensitive(menuitem, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 |
23581
8553e5e19bd2
Add menuitem for 'join chat' in the docklet menu. Closes #3623.
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
23201
diff
changeset
|
712 menuitem = pidgin_new_item_from_stock(menu, _("Join Chat..."), PIDGIN_STOCK_CHAT, |
8553e5e19bd2
Add menuitem for 'join chat' in the docklet menu. Closes #3623.
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
23201
diff
changeset
|
713 G_CALLBACK(pidgin_blist_joinchat_show), NULL, 0, 0, NULL); |
8553e5e19bd2
Add menuitem for 'join chat' in the docklet menu. Closes #3623.
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
23201
diff
changeset
|
714 if (status == PURPLE_STATUS_OFFLINE) |
8553e5e19bd2
Add menuitem for 'join chat' in the docklet menu. Closes #3623.
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
23201
diff
changeset
|
715 gtk_widget_set_sensitive(menuitem, FALSE); |
8553e5e19bd2
Add menuitem for 'join chat' in the docklet menu. Closes #3623.
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
23201
diff
changeset
|
716 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
717 menuitem = docklet_status_submenu(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 |
15507 | 720 pidgin_separator(menu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 |
23200
3353ac89ccb1
A patch from Kevin Wu Won to add mnemonics to the docklet menu.
Kevin Wu Won <exclipy@gmail.com>
parents:
22011
diff
changeset
|
722 pidgin_new_item_from_stock(menu, _("_Accounts"), NULL, G_CALLBACK(pidgin_accounts_window_show), NULL, 0, 0, NULL); |
3353ac89ccb1
A patch from Kevin Wu Won to add mnemonics to the docklet menu.
Kevin Wu Won <exclipy@gmail.com>
parents:
22011
diff
changeset
|
723 pidgin_new_item_from_stock(menu, _("Plu_gins"), PIDGIN_STOCK_TOOLBAR_PLUGINS, G_CALLBACK(pidgin_plugin_dialog_show), NULL, 0, 0, NULL); |
23201
326b1b389a88
Changes to the docklet mnemonics patch to make them more consistent with
Richard Laager <rlaager@wiktel.com>
parents:
23200
diff
changeset
|
724 pidgin_new_item_from_stock(menu, _("Pr_eferences"), GTK_STOCK_PREFERENCES, G_CALLBACK(pidgin_prefs_show), NULL, 0, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 |
15507 | 726 pidgin_separator(menu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
727 |
23201
326b1b389a88
Changes to the docklet mnemonics patch to make them more consistent with
Richard Laager <rlaager@wiktel.com>
parents:
23200
diff
changeset
|
728 menuitem = gtk_check_menu_item_new_with_mnemonic(_("Mute _Sounds")); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
729 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute")); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
730 if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
731 gtk_widget_set_sensitive(GTK_WIDGET(menuitem), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
732 g_signal_connect(G_OBJECT(menuitem), "toggled", G_CALLBACK(docklet_toggle_mute), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
734 |
23200
3353ac89ccb1
A patch from Kevin Wu Won to add mnemonics to the docklet menu.
Kevin Wu Won <exclipy@gmail.com>
parents:
22011
diff
changeset
|
735 menuitem = gtk_check_menu_item_new_with_mnemonic(_("_Blink on New Message")); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
736 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/blink")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
737 g_signal_connect(G_OBJECT(menuitem), "toggled", G_CALLBACK(docklet_toggle_blink), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
738 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 |
15507 | 740 pidgin_separator(menu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 |
20881
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
742 /* add plugin actions */ |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
743 docklet_plugin_actions(menu); |
c7b20abc3885
Add plugin actions to the docklet context menu. These are the same actions
Casey Harkins <charkins@pidgin.im>
parents:
20153
diff
changeset
|
744 |
23200
3353ac89ccb1
A patch from Kevin Wu Won to add mnemonics to the docklet menu.
Kevin Wu Won <exclipy@gmail.com>
parents:
22011
diff
changeset
|
745 pidgin_new_item_from_stock(menu, _("_Quit"), GTK_STOCK_QUIT, G_CALLBACK(purple_core_quit), NULL, 0, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 #ifdef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
748 g_signal_connect(menu, "leave-notify-event", G_CALLBACK(docklet_menu_leave_enter), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 g_signal_connect(menu, "enter-notify-event", G_CALLBACK(docklet_menu_leave_enter), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
750 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
751 gtk_widget_show_all(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 ui_ops->position_menu, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
754 NULL, 0, gtk_get_current_event_time()); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
755 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
756 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
757 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
758 * public api for ui_ops |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
759 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
760 void |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
761 pidgin_docklet_update_icon() |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
762 { |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
763 if (ui_ops && ui_ops->update_icon) |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
764 ui_ops->update_icon(status, connecting, pending); |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
765 } |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
766 |
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
767 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
768 pidgin_docklet_clicked(int button_type) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
770 switch (button_type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
771 case 1: |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
772 if (pending) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
773 GList *l = get_pending_list(1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
774 if (l != NULL) { |
20951
508a06e834dc
Handle unattached conversations appropriately when drawing tooltip for
Casey Harkins <charkins@pidgin.im>
parents:
20939
diff
changeset
|
775 pidgin_conv_present_conversation((PurpleConversation *)l->data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
776 g_list_free(l); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
777 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
778 } else { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
779 pidgin_blist_toggle_visibility(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
782 case 3: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
783 docklet_menu(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
784 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
786 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
788 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
789 pidgin_docklet_embedded() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
791 if (!visibility_manager |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
792 && strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/docklet/show"), "pending")) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
793 pidgin_blist_visibility_manager_add(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
794 visibility_manager = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
795 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
796 visible = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
797 docklet_update_status(); |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
798 pidgin_docklet_update_icon(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
799 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
800 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
801 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
802 pidgin_docklet_remove() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
803 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
804 if (visible) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
805 if (visibility_manager) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
806 pidgin_blist_visibility_manager_remove(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
807 visibility_manager = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
808 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
809 if (docklet_blinking_timer) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
810 g_source_remove(docklet_blinking_timer); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
811 docklet_blinking_timer = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
812 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
813 visible = FALSE; |
16949
06f6768b6e29
Now that the docklet icon is based on the status from status selector, it
Casey Harkins <charkins@pidgin.im>
parents:
16932
diff
changeset
|
814 status = PURPLE_STATUS_OFFLINE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
815 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
816 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
817 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
818 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
819 pidgin_docklet_set_ui_ops(struct docklet_ui_ops *ops) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
821 ui_ops = ops; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
822 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
824 void* |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
825 pidgin_docklet_get_handle() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
827 static int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 return &i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
830 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
831 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
832 pidgin_docklet_init() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 { |
15823 | 834 void *conn_handle = purple_connections_get_handle(); |
835 void *conv_handle = purple_conversations_get_handle(); | |
836 void *accounts_handle = purple_accounts_get_handle(); | |
16872
38b3ca4b353d
Docklet icon is now tied to the saved status, so listen to the
Casey Harkins <charkins@pidgin.im>
parents:
16763
diff
changeset
|
837 void *status_handle = purple_savedstatuses_get_handle(); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
838 void *docklet_handle = pidgin_docklet_get_handle(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
840 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/docklet"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
841 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/blink", FALSE); |
18853
fab096e7b804
reverting the show docklet preference the correct way
Ka-Hing Cheung <khc@hxbc.us>
parents:
18833
diff
changeset
|
842 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/docklet/show", "always"); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
843 purple_prefs_connect_callback(docklet_handle, PIDGIN_PREFS_ROOT "/docklet/show", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 docklet_show_pref_changed_cb, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 docklet_ui_init(); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
847 if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/docklet/show"), "always") && ui_ops && ui_ops->create) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 ui_ops->create(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 |
15823 | 850 purple_signal_connect(conn_handle, "signed-on", |
851 docklet_handle, PURPLE_CALLBACK(docklet_signed_on_cb), NULL); | |
852 purple_signal_connect(conn_handle, "signed-off", | |
853 docklet_handle, PURPLE_CALLBACK(docklet_signed_off_cb), NULL); | |
16872
38b3ca4b353d
Docklet icon is now tied to the saved status, so listen to the
Casey Harkins <charkins@pidgin.im>
parents:
16763
diff
changeset
|
854 purple_signal_connect(accounts_handle, "account-connecting", |
15823 | 855 docklet_handle, PURPLE_CALLBACK(docklet_update_status_cb), NULL); |
856 purple_signal_connect(conv_handle, "received-im-msg", | |
857 docklet_handle, PURPLE_CALLBACK(docklet_update_status_cb), NULL); | |
858 purple_signal_connect(conv_handle, "conversation-created", | |
859 docklet_handle, PURPLE_CALLBACK(docklet_update_status_cb), NULL); | |
860 purple_signal_connect(conv_handle, "deleting-conversation", | |
861 docklet_handle, PURPLE_CALLBACK(docklet_update_status_cb), NULL); | |
862 purple_signal_connect(conv_handle, "conversation-updated", | |
863 docklet_handle, PURPLE_CALLBACK(docklet_conv_updated_cb), NULL); | |
16872
38b3ca4b353d
Docklet icon is now tied to the saved status, so listen to the
Casey Harkins <charkins@pidgin.im>
parents:
16763
diff
changeset
|
864 purple_signal_connect(status_handle, "savedstatus-changed", |
38b3ca4b353d
Docklet icon is now tied to the saved status, so listen to the
Casey Harkins <charkins@pidgin.im>
parents:
16763
diff
changeset
|
865 docklet_handle, PURPLE_CALLBACK(docklet_update_status_cb), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 #if 0 |
15823 | 867 purple_signal_connect(purple_get_core(), "quitting", |
868 docklet_handle, PURPLE_CALLBACK(purple_quit_cb), NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
870 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 enable_join_chat = online_account_supports_chat(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
875 pidgin_docklet_uninit() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
876 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 if (visible && ui_ops && ui_ops->destroy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 ui_ops->destroy(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 } |