annotate plugins/docklet/docklet.c @ 6179:16e384bb7fbf

[gaim-migrate @ 6664] Core/UI split the core initialization and shutdown. I think I got all the bugs worked out. It's looking nice and stable here, but if it causes CVS to go to hell for everyone.. er, try to fix it or let me know :) I don't have this in patch form. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 17 Jul 2003 10:35:43 +0000
parents 1894de5f7fbd
children 3e3ee3cba192
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4093
987624dcece4 [gaim-migrate @ 4308]
Luke Schierer <lschiere@pidgin.im>
parents: 3939
diff changeset
1 /* System tray icon (aka docklet) plugin for Gaim
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * Copyright (C) 2002 Robert McQueen <robot101@debian.org>
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
3 * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com>
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4 * Inspired by a similar plugin by:
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 * John (J5) Palmieri <johnp@martianrock.com>
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 *
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation; either version 2 of the
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 *
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * General Public License for more details.
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 *
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * 02111-1307, USA.
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 */
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 /* todo (in order of importance):
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
24 - unify the queue so we can have a global away without the dialog
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
25 - handle and update tooltips to show your current accounts/queued messages?
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
26 - show a count of queued messages in the unified queue
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 - dernyi's account status menu in the right click
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
28 - optional pop up notices when GNOME2's system-tray-applet supports it */
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 /* includes */
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
31 #include "internal.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
32
6179
16e384bb7fbf [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6138
diff changeset
33 #include "core.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
34 #include "debug.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
35 #include "prefs.h"
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4491
diff changeset
36 #include "sound.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
37
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
38 #include "gtkaccount.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
39 #include "gtkblist.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
40 #include "gtkft.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
41 #include "gtkplugin.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
42 #include "gtkprefs.h"
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5669
diff changeset
43 #include "gtksound.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
44 #include "gtkutils.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
45 #include "stock.h"
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
46 #include "docklet.h"
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
48 #include "gaim.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
49 #include "ui.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
50
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
51 #define DOCKLET_PLUGIN_ID "gtk-docklet"
3867
43e396e94095 [gaim-migrate @ 4019]
Rob Flynn <gaim@robflynn.com>
parents: 3773
diff changeset
52
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
53 /* globals */
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
54 static struct gaim_tray_ops *tray_ops = NULL;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
55 static enum docklet_status status=offline;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
56 static enum docklet_status icon=offline;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
57 #ifdef _WIN32
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
58 __declspec(dllimport) GSList *unread_message_queue;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
59 __declspec(dllimport) GSList *away_messages;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
60 __declspec(dllimport) struct away_message *awaymessage;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
61 __declspec(dllimport) GSList *message_queue;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
62 #endif
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 /* functions */
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
65 extern void trayicon_init();
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
66 static gboolean docklet_update_status();
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
67 static gboolean plugin_unload(GaimPlugin *plugin);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68
3554
cf00549c53d7 [gaim-migrate @ 3644]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
69 static void docklet_toggle_mute(GtkWidget *toggle, void *data) {
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5669
diff changeset
70 gaim_gtk_sound_set_mute(GTK_CHECK_MENU_ITEM(toggle)->active);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72
5554
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
73 static void docklet_set_bool(GtkWidget *widget, const char *key) {
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
74 gaim_prefs_set_bool(key, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75 }
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
76
5905
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
77 static void docklet_auto_login() {
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
78 gaim_accounts_auto_login(GAIM_GTK_UI);
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
79 }
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
80
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
81 #ifdef _WIN32
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
82 /* This is a workaround for a bug in windows GTK+.. Clicking outside of the
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
83 menu does not get rid of it, so instead we get rid of it as soon as the
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
84 pointer leaves the menu. */
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
85 static gboolean menu_leave(GtkWidget *menu,
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
86 GdkEventCrossing *event,
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
87 gpointer user_data) {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
88 if(event->detail == GDK_NOTIFY_ANCESTOR) {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
89 gaim_debug(GAIM_DEBUG_INFO, "docklet", "leave-notify-event\n");
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
90 gtk_menu_popdown(GTK_MENU(menu));
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
91 }
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
92 return FALSE;
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 }
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
94 #endif
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
96 static void docklet_menu() {
3513
ab939e746bdd [gaim-migrate @ 3585]
Luke Schierer <lschiere@pidgin.im>
parents: 3512
diff changeset
97 static GtkWidget *menu = NULL;
3512
1ea341091de8 [gaim-migrate @ 3584]
Luke Schierer <lschiere@pidgin.im>
parents: 3510
diff changeset
98 GtkWidget *entry;
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 if (menu) {
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 gtk_widget_destroy(menu);
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104 menu = gtk_menu_new();
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
105 #ifdef _WIN32
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
106 g_signal_connect(menu, "leave-notify-event", G_CALLBACK(menu_leave), NULL);
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
107 #endif
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
108 switch (status) {
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
109 case offline:
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
110 case offline_connecting:
5905
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
111 gaim_new_item_from_stock(menu, _("Auto-login"), GAIM_STOCK_SIGN_ON, G_CALLBACK(docklet_auto_login), NULL, 0, 0, NULL);
4567
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
112 break;
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
113 default:
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4840
diff changeset
114 gaim_new_item_from_stock(menu, _("New Message.."), GAIM_STOCK_IM, G_CALLBACK(show_im_dialog), NULL, 0, 0, NULL);
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4840
diff changeset
115 gaim_new_item_from_stock(menu, _("Join A Chat..."), GAIM_STOCK_CHAT, G_CALLBACK(join_chat), NULL, 0, 0, NULL);
4567
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
116 break;
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
117 }
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
118
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
119 switch (status) {
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
120 case offline:
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
121 case offline_connecting:
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
122 break;
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
123 case online:
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
124 case online_connecting:
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
125 case online_pending: {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126 GtkWidget *docklet_awaymenu;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127 GSList *awy = NULL;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 struct away_message *a = NULL;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 docklet_awaymenu = gtk_menu_new();
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 awy = away_messages;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133 while (awy) {
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 a = (struct away_message *)awy->data;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 entry = gtk_menu_item_new_with_label(a->name);
3554
cf00549c53d7 [gaim-migrate @ 3644]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
137 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(do_away_message), a);
4635
42d53c416bb9 [gaim-migrate @ 4942]
Nathan Walp <nwalp@pidgin.im>
parents: 4606
diff changeset
138 gtk_menu_shell_append(GTK_MENU_SHELL(docklet_awaymenu), entry);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140 awy = g_slist_next(awy);
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
143 if (away_messages)
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
144 gaim_separator(docklet_awaymenu);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 entry = gtk_menu_item_new_with_label(_("New..."));
3554
cf00549c53d7 [gaim-migrate @ 3644]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
147 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(create_away_mess), NULL);
4635
42d53c416bb9 [gaim-migrate @ 4942]
Nathan Walp <nwalp@pidgin.im>
parents: 4606
diff changeset
148 gtk_menu_shell_append(GTK_MENU_SHELL(docklet_awaymenu), entry);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 entry = gtk_menu_item_new_with_label(_("Away"));
3512
1ea341091de8 [gaim-migrate @ 3584]
Luke Schierer <lschiere@pidgin.im>
parents: 3510
diff changeset
151 gtk_menu_item_set_submenu(GTK_MENU_ITEM(entry), docklet_awaymenu);
4635
42d53c416bb9 [gaim-migrate @ 4942]
Nathan Walp <nwalp@pidgin.im>
parents: 4606
diff changeset
152 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry);
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
153 } break;
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
154 case away:
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
155 case away_pending:
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 entry = gtk_menu_item_new_with_label(_("Back"));
3554
cf00549c53d7 [gaim-migrate @ 3644]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
157 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(do_im_back), NULL);
4635
42d53c416bb9 [gaim-migrate @ 4942]
Nathan Walp <nwalp@pidgin.im>
parents: 4606
diff changeset
158 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry);
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
159 break;
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161
4567
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
162 gaim_separator(menu);
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
163
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
164 entry = gtk_check_menu_item_new_with_label(_("Mute Sounds"));
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5669
diff changeset
165 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(entry), gaim_gtk_sound_get_mute());
4567
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
166 g_signal_connect(G_OBJECT(entry), "toggled", G_CALLBACK(docklet_toggle_mute), NULL);
4635
42d53c416bb9 [gaim-migrate @ 4942]
Nathan Walp <nwalp@pidgin.im>
parents: 4606
diff changeset
167 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry);
4567
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
168
5669
9e7f8ffb0404 [gaim-migrate @ 6086]
Sean Egan <seanegan@gmail.com>
parents: 5609
diff changeset
169 gaim_new_item_from_stock(menu, _("File Transfers"), GAIM_STOCK_FILE_TRANSFER, G_CALLBACK(gaim_show_xfer_dialog), NULL, 0, 0, NULL);
6138
1894de5f7fbd [gaim-migrate @ 6612]
Nathan Walp <nwalp@pidgin.im>
parents: 6077
diff changeset
170 gaim_new_item_from_stock(menu, _("Accounts"), GAIM_STOCK_ACCOUNTS, G_CALLBACK(gaim_gtk_accounts_window_show), NULL, 0, 0, NULL);
5669
9e7f8ffb0404 [gaim-migrate @ 6086]
Sean Egan <seanegan@gmail.com>
parents: 5609
diff changeset
171 gaim_new_item_from_stock(menu, _("Preferences"), GTK_STOCK_PREFERENCES, G_CALLBACK(gaim_gtk_prefs_show), NULL, 0, 0, NULL);
4567
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
172
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
173 gaim_separator(menu);
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
174
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
175 switch (status) {
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
176 case offline:
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
177 case offline_connecting:
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
178 break;
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
179 default:
5607
eeba9205dd0f [gaim-migrate @ 6011]
Nathan Walp <nwalp@pidgin.im>
parents: 5584
diff changeset
180 gaim_new_item_from_stock(menu, _("Signoff"), GTK_STOCK_CLOSE, G_CALLBACK(gaim_connections_disconnect_all), NULL, 0, 0, 0);
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
181 break;
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
182 }
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
183
6179
16e384bb7fbf [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6138
diff changeset
184 gaim_new_item_from_stock(menu, _("Quit"), GTK_STOCK_QUIT, G_CALLBACK(gaim_core_quit), NULL, 0, 0, 0);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 gtk_widget_show_all(menu);
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
187 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time());
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
188 }
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
190 static gboolean docklet_blink_icon() {
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
191 if (status == online_pending) {
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
192 if (status == icon) {
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
193 /* last icon was the right one... let's change it */
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
194 icon = online;
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
195 } else {
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
196 /* last icon was the wrong one, change it back */
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
197 icon = online_pending;
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
198 }
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
199 } else if (status == away_pending) {
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
200 if (status == icon) {
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
201 /* last icon was the right one... let's change it */
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
202 icon = away;
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
203 } else {
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
204 /* last icon was the wrong one, change it back */
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
205 icon = away_pending;
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
206 }
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
207 } else {
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
208 /* no messages, stop blinking */
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
209 return FALSE;
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
210 }
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
211
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
212 if(tray_ops->update_icon)
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
213 tray_ops->update_icon(icon);
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
214
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
215 return TRUE; /* keep blinking */
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
218 static gboolean docklet_update_status() {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 enum docklet_status oldstatus;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 oldstatus = status;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
223 if (gaim_connections_get_all()) {
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3514
diff changeset
224 if (unread_message_queue) {
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
225 status = online_pending;
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3514
diff changeset
226 } else if (awaymessage) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 if (message_queue) {
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 status = away_pending;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
229 } else {
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 status = away;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
231 }
5905
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
232 } else if (gaim_connections_get_connecting()) {
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
233 status = online_connecting;
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 } else {
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235 status = online;
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 } else {
5905
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
238 if (gaim_connections_get_connecting()) {
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
239 status = offline_connecting;
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3514
diff changeset
240 } else {
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3514
diff changeset
241 status = offline;
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3514
diff changeset
242 }
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
245 /* update the icon if we changed status */
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246 if (status != oldstatus) {
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
247 icon = status;
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
248 if(tray_ops->update_icon)
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
249 tray_ops->update_icon(icon);
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
250
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
251 /* and schedule the blinker function if messages are pending */
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
252 if (status == online_pending || status == away_pending) {
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
253 g_timeout_add(500, docklet_blink_icon, NULL);
4261
e252238f99df [gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents: 4250
diff changeset
254 }
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 }
4093
987624dcece4 [gaim-migrate @ 4308]
Luke Schierer <lschiere@pidgin.im>
parents: 3939
diff changeset
256 return FALSE; /* for when we're called by the glib idle handler */
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
259 static void gaim_signon(GaimConnection *gc, void *data) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 docklet_update_status();
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
263 static void gaim_signoff(GaimConnection *gc, void *data) {
4157
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
264 /* do this when idle so that if the prpl was connecting
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
265 and was cancelled, we register that connecting_count
9c31ddae80a1 [gaim-migrate @ 4385]
Rob Flynn <gaim@robflynn.com>
parents: 4108
diff changeset
266 has returned to 0 */
5905
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
267 /* no longer necessary because Chip decided that us plugins
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
268 * didn't need to know if an account was connecting or not
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
269 * g_idle_add(docklet_update_status, &docklet); */
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
270 docklet_update_status();
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
273 static void gaim_connecting(GaimAccount *account, void *data) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274 docklet_update_status();
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
277 static void gaim_away(GaimConnection *gc, char *state, char *message, void *data) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278 /* we only support global away. this is the way it is, ok? */
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279 docklet_update_status();
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
282 static void gaim_im_recv(GaimConnection *gc, char **who, char **what, void *data) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
283 /* if message queuing while away is enabled, this event could be the first
4274
906f61f27479 [gaim-migrate @ 4525]
Luke Schierer <lschiere@pidgin.im>
parents: 4261
diff changeset
284 message so we need to see if the status (and hence icon) needs changing.
906f61f27479 [gaim-migrate @ 4525]
Luke Schierer <lschiere@pidgin.im>
parents: 4261
diff changeset
285 do this when idle so that all message processing is completed, queuing
906f61f27479 [gaim-migrate @ 4525]
Luke Schierer <lschiere@pidgin.im>
parents: 4261
diff changeset
286 etc, before we run. */
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
287 g_idle_add(docklet_update_status, NULL);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
290 /* static void gaim_buddy_signon(GaimConnection *gc, char *who, void *data) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
293 static void gaim_buddy_signoff(GaimConnection *gc, char *who, void *data) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
295
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
296 static void gaim_buddy_away(GaimConnection *gc, char *who, void *data) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298
5584
cade2082f760 [gaim-migrate @ 5988]
Luke Schierer <lschiere@pidgin.im>
parents: 5554
diff changeset
299 static void gaim_buddy_back(GaimConnection *gc, char *who, void *data) {
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302 static void gaim_new_conversation(char *who, void *data) {
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
303 } */
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
305 /*
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
306 * Public Code
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
307 */
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
308 void docklet_clicked(int button_type) {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
309 switch (button_type) {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
310 case 1:
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
311 if (unread_message_queue) {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
312 docklet_flush_queue();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
313 docklet_update_status();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
314 } else {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
315 gaim_gtk_blist_docklet_toggle();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
316 }
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
317 break;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
318 case 2:
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
319 switch (status) {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
320 case offline:
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
321 case offline_connecting:
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
322 docklet_auto_login();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
323 break;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
324 default:
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
325 break;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
326 }
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
327 break;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
328 case 3:
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
329 docklet_menu();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
330 break;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
331 }
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
332 }
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
333
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
334 void docklet_embedded() {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
335 gaim_debug(GAIM_DEBUG_INFO, "docklet", "Tray Icon: embedded\n");
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
336 gaim_gtk_blist_docklet_add();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
337 }
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
338
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
339 void docklet_flush_queue() {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
340 if (unread_message_queue) {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
341 purge_away_queue(&unread_message_queue);
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
342 }
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
343 }
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
344
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
345
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
346 /* Set Platform Dependent Code */
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
347 void docklet_set_tray_ops(struct gaim_tray_ops *ops) {
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
348 tray_ops = ops;
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
349 }
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
350
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
351
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
352 /*
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
353 * PLUGIN CODE
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
354 */
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
355
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
356 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
357 plugin_load(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
358 {
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
359 trayicon_init();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
360 if(tray_ops->create)
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
361 tray_ops->create();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
362
5554
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
363 gaim_prefs_add_none("/plugins/gtk/docklet");
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
364 gaim_prefs_add_bool("/plugins/gtk/docklet/queue_messages", FALSE);
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
365
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
366 docklet_update_status();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
367 if(tray_ops->update_icon)
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
368 tray_ops->update_icon(icon);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
370 gaim_signal_connect(plugin, event_signon, gaim_signon, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
371 gaim_signal_connect(plugin, event_signoff, gaim_signoff, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
372 gaim_signal_connect(plugin, event_connecting, gaim_connecting, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
373 gaim_signal_connect(plugin, event_away, gaim_away, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
374 gaim_signal_connect(plugin, event_im_recv, gaim_im_recv, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
375 /* gaim_signal_connect(plugin, event_buddy_signon, gaim_buddy_signon, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
376 gaim_signal_connect(plugin, event_buddy_signoff, gaim_buddy_signoff, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
377 gaim_signal_connect(plugin, event_buddy_away, gaim_buddy_away, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
378 gaim_signal_connect(plugin, event_buddy_back, gaim_buddy_back, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
379 gaim_signal_connect(plugin, event_new_conversation, gaim_new_conversation, NULL); */
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
381 gaim_debug(GAIM_DEBUG_INFO, "docklet", "Plugin loaded\n");
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
382
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
383 return TRUE;
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384 }
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
385
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
386 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
387 plugin_unload(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
388 {
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
389 gaim_gtk_blist_docklet_remove();
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
390 docklet_flush_queue();
5905
dbe2a2174be9 [gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
391 /* XXX: do this while gaim has no other way to toggle the global mute */
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5669
diff changeset
392 gaim_gtk_sound_set_mute(FALSE);
4567
493f050dc11a [gaim-migrate @ 4848]
Sean Egan <seanegan@gmail.com>
parents: 4561
diff changeset
393
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
394 if(tray_ops->destroy)
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
395 tray_ops->destroy();
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
396
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
397 gaim_debug(GAIM_DEBUG_INFO, "docklet", "Plugin unloaded\n");
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
398
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
399 return TRUE;
3554
cf00549c53d7 [gaim-migrate @ 3644]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
400 }
cf00549c53d7 [gaim-migrate @ 3644]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
401
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
402 static GtkWidget *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
403 get_config_frame(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
404 {
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
405 GtkWidget *frame;
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
406 GtkWidget *vbox, *hbox;
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
407 GtkWidget *toggle;
5554
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
408 static const char *qmpref = "/plugins/gtk/docklet/queue_messages";
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3514
diff changeset
409
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
410 frame = gtk_vbox_new(FALSE, 18);
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
411 gtk_container_set_border_width(GTK_CONTAINER(frame), 12);
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
412
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5234
diff changeset
413 vbox = gaim_gtk_make_frame(frame, _("Tray Icon Configuration"));
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
414 hbox = gtk_hbox_new(FALSE, 18);
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
415 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3514
diff changeset
416
4093
987624dcece4 [gaim-migrate @ 4308]
Luke Schierer <lschiere@pidgin.im>
parents: 3939
diff changeset
417 toggle = gtk_check_button_new_with_mnemonic(_("_Hide new messages until tray icon is clicked"));
5554
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
418 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), gaim_prefs_get_bool(qmpref));
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5530
diff changeset
419 g_signal_connect(G_OBJECT(toggle), "clicked", G_CALLBACK(docklet_set_bool), (void *)qmpref);
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
420 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
421
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
422 gtk_widget_show_all(frame);
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
423 return frame;
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3514
diff changeset
424 }
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
425
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
426 static GaimGtkPluginUiInfo ui_info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
427 {
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
428 get_config_frame
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
429 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
430
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
431 static GaimPluginInfo info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
432 {
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
433 2, /**< api_version */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
434 GAIM_PLUGIN_STANDARD, /**< type */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
435 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
436 0, /**< flags */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
437 NULL, /**< dependencies */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
438 GAIM_PRIORITY_DEFAULT, /**< priority */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
439
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
440 DOCKLET_PLUGIN_ID, /**< id */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
441 N_("System Tray Icon"), /**< name */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
442 VERSION, /**< version */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
443 /** summary */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
444 N_("Displays an icon for Gaim in the system tray."),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
445 /** description */
6077
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
446 N_("Interacts with a Notification Area applet (in GNOME, KDE or "
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
447 "Windows for example) to display the current status of Gaim, allow "
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
448 "fast access to commonly used functions, and to toggle display of "
b2c8e08508af [gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6063
diff changeset
449 "the buddy list or login window. Also allows messages to be queued "
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
450 "until the icon is clicked, similar to ICQ."),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
451 "Robert McQueen <robot101@debian.org>", /**< author */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
452 WEBSITE, /**< homepage */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
453
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
454 plugin_load, /**< load */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
455 plugin_unload, /**< unload */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
456 NULL, /**< destroy */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
457
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
458 &ui_info, /**< ui_info */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
459 NULL /**< extra_info */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
460 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
461
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
462 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5905
diff changeset
463 init_plugin(GaimPlugin *plugin)
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
464 {
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3550
diff changeset
465 }
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
466
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 5920
diff changeset
467 GAIM_INIT_PLUGIN(docklet, init_plugin, info)