Mercurial > pidgin
annotate plugins/docklet/docklet.c @ 9962:499a71d5d20f
[gaim-migrate @ 10870]
#if 0 some things so other things will compile and Gaim can be
fixed once piece at a time
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Tue, 07 Sep 2004 05:24:25 +0000 |
| parents | de25b23933fa |
| children | bdec08a8fc5b |
| rev | line source |
|---|---|
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
1 /* |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
2 * System tray icon (aka docklet) plugin for Gaim |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
3 * |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
4 * Copyright (C) 2002-3 Robert McQueen <robot101@debian.org> |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
5 * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com> |
| 3510 | 6 * Inspired by a similar plugin by: |
| 7 * John (J5) Palmieri <johnp@martianrock.com> | |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
8 * |
| 3510 | 9 * This program is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU General Public License as | |
| 11 * published by the Free Software Foundation; either version 2 of the | |
| 12 * License, or (at your option) any later version. | |
| 13 * | |
| 14 * This program is distributed in the hope that it will be useful, but | |
| 15 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 17 * General Public License for more details. | |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
18 * |
| 3510 | 19 * You should have received a copy of the GNU General Public License |
| 20 * along with this program; if not, write to the Free Software | |
| 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
| 22 * 02111-1307, USA. | |
| 23 */ | |
| 24 | |
| 9962 | 25 /* TODO (in order of importance): |
| 26 * - unify the queue so we can have a global away without the dialog | |
| 27 * - handle and update tooltips to show your current accounts/queued messages? | |
| 28 * - show a count of queued messages in the unified queue | |
| 29 * - dernyi's account status menu in the right click | |
| 30 * - optional pop up notices when GNOME2's system-tray-applet supports it | |
| 31 */ | |
| 3510 | 32 |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
33 #include "internal.h" |
| 9791 | 34 #include "gtkgaim.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
35 |
|
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6138
diff
changeset
|
36 #include "core.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
37 #include "debug.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
38 #include "prefs.h" |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
39 #include "signals.h" |
| 4561 | 40 #include "sound.h" |
| 9943 | 41 #include "version.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
42 |
| 9730 | 43 #include "away.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
44 #include "gtkaccount.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
45 #include "gtkblist.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
46 #include "gtkft.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
47 #include "gtkplugin.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
48 #include "gtkprefs.h" |
| 5684 | 49 #include "gtksound.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
50 #include "gtkutils.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
51 #include "stock.h" |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
52 #include "docklet.h" |
| 3510 | 53 |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
54 #include "gaim.h" |
| 9709 | 55 #include "gtkdialogs.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
56 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
57 /* globals */ |
| 3867 | 58 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
59 GaimPlugin *handle = NULL; |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
60 static struct docklet_ui_ops *ui_ops = NULL; |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
61 static enum docklet_status status = offline; |
| 9958 | 62 #if 0 /* XXX CUI */ |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
63 #ifdef _WIN32 |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
64 __declspec(dllimport) GSList *unread_message_queue; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
65 __declspec(dllimport) GSList *away_messages; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
66 __declspec(dllimport) struct away_message *awaymessage; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
67 __declspec(dllimport) GSList *message_queue; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
68 #endif |
| 9958 | 69 #endif |
| 3510 | 70 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
71 /* private functions */ |
| 3510 | 72 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
73 static void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
74 docklet_toggle_mute(GtkWidget *toggle, void *data) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
75 { |
| 5684 | 76 gaim_gtk_sound_set_mute(GTK_CHECK_MENU_ITEM(toggle)->active); |
| 3510 | 77 } |
| 78 | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
79 static void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
80 docklet_set_bool(GtkWidget *widget, const char *key) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
81 { |
|
5554
7b36d02031a2
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
82 gaim_prefs_set_bool(key, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); |
| 3510 | 83 } |
| 3570 | 84 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
85 static void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
86 docklet_auto_login() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
87 { |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
88 gaim_accounts_auto_login(GAIM_GTK_UI); |
|
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
89 } |
|
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
90 |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
91 #ifdef _WIN32 |
| 9958 | 92 #if 0 /* XXX NEW STATUS */ |
| 9813 | 93 /* This is workaround for a bug in windows GTK+. Clicking outside of the |
| 94 parent menu (including on a submenu-item) close the whole menu before | |
| 95 the "activate" event is thrown for the given submenu-item. Fixed by | |
| 96 replacing "activate" by "button-release-event". */ | |
| 97 static gboolean | |
| 98 docklet_menu_do_away_message(GtkWidget *widget, GdkEventButton *event, gpointer user_data) | |
| 99 { | |
| 100 do_away_message(widget, user_data); | |
| 101 return FALSE; | |
| 102 } | |
| 103 | |
| 104 static gboolean | |
| 105 docklet_menu_create_away_mess(GtkWidget *widget, GdkEventButton *event, gpointer user_data) | |
| 106 { | |
| 107 create_away_mess(widget, user_data); | |
| 108 return FALSE; | |
| 109 } | |
| 9958 | 110 #endif |
| 9813 | 111 |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
112 /* This is a workaround for a bug in windows GTK+. Clicking outside of the |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
113 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
|
114 pointer leaves the menu. */ |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
115 static gboolean |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
116 docklet_menu_leave(GtkWidget *menu, GdkEventCrossing *event, void *data) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
117 { |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
118 if(event->detail == GDK_NOTIFY_ANCESTOR) { |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
119 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "menu leave-notify-event\n"); |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
120 gtk_menu_popdown(GTK_MENU(menu)); |
| 3570 | 121 } |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
122 return FALSE; |
| 3510 | 123 } |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
124 #endif |
| 3510 | 125 |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
126 static void docklet_menu() { |
| 3513 | 127 static GtkWidget *menu = NULL; |
| 3512 | 128 GtkWidget *entry; |
| 3510 | 129 |
| 130 if (menu) { | |
| 131 gtk_widget_destroy(menu); | |
| 132 } | |
| 133 | |
| 134 menu = gtk_menu_new(); | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
135 |
| 4157 | 136 switch (status) { |
| 137 case offline: | |
| 138 case offline_connecting: | |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
139 gaim_new_item_from_stock(menu, _("Auto-login"), GAIM_STOCK_SIGN_ON, G_CALLBACK(docklet_auto_login), NULL, 0, 0, NULL); |
| 4567 | 140 break; |
| 141 default: | |
| 9714 | 142 gaim_new_item_from_stock(menu, _("New Message..."), GAIM_STOCK_IM, G_CALLBACK(gaim_gtkdialogs_im), NULL, 0, 0, NULL); |
| 8940 | 143 gaim_new_item_from_stock(menu, _("Join A Chat..."), GAIM_STOCK_CHAT, G_CALLBACK(gaim_gtk_blist_joinchat_show), NULL, 0, 0, NULL); |
| 4567 | 144 break; |
| 145 } | |
| 146 | |
| 147 switch (status) { | |
| 148 case offline: | |
| 149 case offline_connecting: | |
| 4157 | 150 break; |
| 151 case online: | |
| 152 case online_connecting: | |
| 153 case online_pending: { | |
| 9958 | 154 #if 0 /* XXX NEW STATUS */ |
| 3510 | 155 GtkWidget *docklet_awaymenu; |
| 156 GSList *awy = NULL; | |
| 157 struct away_message *a = NULL; | |
| 158 | |
| 159 docklet_awaymenu = gtk_menu_new(); | |
| 160 awy = away_messages; | |
| 161 | |
| 162 while (awy) { | |
| 163 a = (struct away_message *)awy->data; | |
| 164 | |
| 165 entry = gtk_menu_item_new_with_label(a->name); | |
| 9813 | 166 #ifdef _WIN32 |
| 167 g_signal_connect(G_OBJECT(entry), "button-release-event", G_CALLBACK(docklet_menu_do_away_message), a); | |
| 168 #else | |
| 3554 | 169 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(do_away_message), a); |
| 9813 | 170 #endif |
| 4635 | 171 gtk_menu_shell_append(GTK_MENU_SHELL(docklet_awaymenu), entry); |
| 3510 | 172 |
| 173 awy = g_slist_next(awy); | |
| 174 } | |
| 175 | |
| 4157 | 176 if (away_messages) |
| 177 gaim_separator(docklet_awaymenu); | |
| 3510 | 178 |
| 179 entry = gtk_menu_item_new_with_label(_("New...")); | |
| 9813 | 180 #ifdef _WIN32 |
| 181 g_signal_connect(G_OBJECT(entry), "button-release-event", G_CALLBACK(docklet_menu_create_away_mess), NULL); | |
| 182 #else | |
| 3554 | 183 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(create_away_mess), NULL); |
| 9813 | 184 #endif |
| 4635 | 185 gtk_menu_shell_append(GTK_MENU_SHELL(docklet_awaymenu), entry); |
| 3510 | 186 |
| 187 entry = gtk_menu_item_new_with_label(_("Away")); | |
| 3512 | 188 gtk_menu_item_set_submenu(GTK_MENU_ITEM(entry), docklet_awaymenu); |
| 4635 | 189 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry); |
| 9958 | 190 #endif |
| 4157 | 191 } break; |
| 192 case away: | |
| 193 case away_pending: | |
| 9958 | 194 #if 0 /* XXX NEW STATUS */ |
| 3510 | 195 entry = gtk_menu_item_new_with_label(_("Back")); |
| 3554 | 196 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(do_im_back), NULL); |
| 4635 | 197 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry); |
| 9958 | 198 #endif |
| 4157 | 199 break; |
| 3510 | 200 } |
| 201 | |
| 4567 | 202 gaim_separator(menu); |
| 203 | |
| 204 entry = gtk_check_menu_item_new_with_label(_("Mute Sounds")); | |
| 5684 | 205 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(entry), gaim_gtk_sound_get_mute()); |
| 4567 | 206 g_signal_connect(G_OBJECT(entry), "toggled", G_CALLBACK(docklet_toggle_mute), NULL); |
| 4635 | 207 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry); |
| 4567 | 208 |
| 5669 | 209 gaim_new_item_from_stock(menu, _("File Transfers"), GAIM_STOCK_FILE_TRANSFER, G_CALLBACK(gaim_show_xfer_dialog), NULL, 0, 0, NULL); |
| 6138 | 210 gaim_new_item_from_stock(menu, _("Accounts"), GAIM_STOCK_ACCOUNTS, G_CALLBACK(gaim_gtk_accounts_window_show), NULL, 0, 0, NULL); |
| 5669 | 211 gaim_new_item_from_stock(menu, _("Preferences"), GTK_STOCK_PREFERENCES, G_CALLBACK(gaim_gtk_prefs_show), NULL, 0, 0, NULL); |
| 4567 | 212 |
| 213 gaim_separator(menu); | |
| 214 | |
| 4157 | 215 switch (status) { |
| 216 case offline: | |
| 217 case offline_connecting: | |
| 218 break; | |
| 219 default: | |
| 5607 | 220 gaim_new_item_from_stock(menu, _("Signoff"), GTK_STOCK_CLOSE, G_CALLBACK(gaim_connections_disconnect_all), NULL, 0, 0, 0); |
| 4157 | 221 break; |
| 222 } | |
| 223 | |
|
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6138
diff
changeset
|
224 gaim_new_item_from_stock(menu, _("Quit"), GTK_STOCK_QUIT, G_CALLBACK(gaim_core_quit), NULL, 0, 0, 0); |
| 3510 | 225 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
226 #ifdef _WIN32 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
227 g_signal_connect(menu, "leave-notify-event", G_CALLBACK(docklet_menu_leave), NULL); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
228 #endif |
| 3510 | 229 gtk_widget_show_all(menu); |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
230 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
|
231 } |
| 3510 | 232 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
233 static gboolean |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
234 docklet_blink_icon() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
235 { |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
236 static gboolean blinked = FALSE; |
| 6910 | 237 gboolean ret = FALSE; /* by default, don't keep blinking */ |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
238 |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
239 blinked = !blinked; |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
240 |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
241 switch (status) { |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
242 case online_pending: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
243 case away_pending: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
244 if (blinked) { |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
245 if (ui_ops && ui_ops->blank_icon) |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
246 ui_ops->blank_icon(); |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
247 } else { |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
248 if (ui_ops && ui_ops->update_icon) |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
249 ui_ops->update_icon(status); |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
250 } |
| 6910 | 251 ret = TRUE; /* keep blinking */ |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
252 break; |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
253 case offline: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
254 case offline_connecting: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
255 case online: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
256 case online_connecting: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
257 case away: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
258 blinked = FALSE; |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
259 break; |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
260 } |
| 6906 | 261 |
| 6910 | 262 return ret; |
| 3510 | 263 } |
| 264 | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
265 static gboolean |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
266 docklet_update_status() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
267 { |
| 3510 | 268 enum docklet_status oldstatus; |
| 269 | |
| 270 oldstatus = status; | |
| 271 | |
| 5584 | 272 if (gaim_connections_get_all()) { |
| 9958 | 273 #if 0 /* XXX NEW STATUS */ |
| 3517 | 274 if (unread_message_queue) { |
| 4157 | 275 status = online_pending; |
| 3517 | 276 } else if (awaymessage) { |
| 3510 | 277 if (message_queue) { |
| 278 status = away_pending; | |
| 279 } else { | |
| 280 status = away; | |
| 281 } | |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
282 } else if (gaim_connections_get_connecting()) { |
| 9958 | 283 #else |
| 284 if (gaim_connections_get_connecting()) { | |
| 285 #endif | |
| 4157 | 286 status = online_connecting; |
| 3510 | 287 } else { |
| 288 status = online; | |
| 289 } | |
| 290 } else { | |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
291 if (gaim_connections_get_connecting()) { |
| 4157 | 292 status = offline_connecting; |
| 3517 | 293 } else { |
| 294 status = offline; | |
| 295 } | |
| 3510 | 296 } |
| 297 | |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
298 /* update the icon if we changed status */ |
| 3510 | 299 if (status != oldstatus) { |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
300 if (ui_ops && ui_ops->update_icon) |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
301 ui_ops->update_icon(status); |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
302 |
|
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
303 /* and schedule the blinker function if messages are pending */ |
|
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
304 if (status == online_pending || status == away_pending) { |
| 6310 | 305 g_timeout_add(500, docklet_blink_icon, &handle); |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
306 } |
| 3510 | 307 } |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
308 |
| 4093 | 309 return FALSE; /* for when we're called by the glib idle handler */ |
| 3510 | 310 } |
| 311 | |
| 9958 | 312 #if 0 /* XXX CUI */ |
| 313 static void | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
314 docklet_flush_queue() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
315 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
316 if (unread_message_queue) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
317 purge_away_queue(&unread_message_queue); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
318 } |
| 3510 | 319 } |
| 9958 | 320 #endif |
| 3510 | 321 |
| 9958 | 322 static void |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
323 docklet_remove_callbacks() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
324 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
325 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "removing callbacks"); |
| 3510 | 326 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
327 while (g_source_remove_by_user_data(&handle)) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
328 gaim_debug(GAIM_DEBUG_INFO, NULL, "."); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
329 } |
| 3510 | 330 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
331 gaim_debug(GAIM_DEBUG_INFO, NULL, "\n"); |
| 3510 | 332 } |
| 333 | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
334 /* public code */ |
| 3510 | 335 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
336 void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
337 docklet_clicked(int button_type) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
338 { |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
339 switch (button_type) { |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
340 case 1: |
| 9958 | 341 #if 0 /* XXX CUI */ |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
342 if (unread_message_queue) { |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
343 docklet_flush_queue(); |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
344 } else { |
| 9958 | 345 #endif |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
346 gaim_gtk_blist_docklet_toggle(); |
| 9958 | 347 #if 0 /* XXX CUI */ |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
348 } |
| 9958 | 349 #endif |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
350 break; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
351 case 2: |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
352 switch (status) { |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
353 case offline: |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
354 case offline_connecting: |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
355 docklet_auto_login(); |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
356 break; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
357 default: |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
358 break; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
359 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
360 break; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
361 case 3: |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
362 docklet_menu(); |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
363 break; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
364 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
365 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
366 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
367 void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
368 docklet_embedded() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
369 { |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
370 gaim_gtk_blist_docklet_add(); |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
371 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
372 docklet_update_status(); |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
373 if (ui_ops && ui_ops->update_icon) |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
374 ui_ops->update_icon(status); |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
375 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
376 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
377 void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
378 docklet_remove(gboolean visible) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
379 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
380 if (visible) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
381 gaim_gtk_blist_docklet_remove(); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
382 |
| 9958 | 383 #if 0 /* XXX CUI */ |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
384 docklet_flush_queue(); |
| 9958 | 385 #endif |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
386 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
387 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
388 void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
389 docklet_set_ui_ops(struct docklet_ui_ops *ops) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
390 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
391 ui_ops = ops; |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
392 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
393 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
394 /* callbacks */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
395 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
396 static void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
397 gaim_signon(GaimConnection *gc, void *data) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
398 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
399 docklet_update_status(); |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
400 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
401 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
402 static void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
403 gaim_signoff(GaimConnection *gc, void *data) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
404 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
405 /* do this when idle so that if the prpl was connecting |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
406 and was cancelled, we register that connecting_count |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
407 has returned to 0 */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
408 /* no longer necessary because Chip decided that us plugins |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
409 didn't need to know if an account was connecting or not |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
410 g_idle_add(docklet_update_status, &docklet); */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
411 docklet_update_status(); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
412 } |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
413 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
414 static void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
415 gaim_connecting(GaimAccount *account, void *data) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
416 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
417 docklet_update_status(); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
418 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
419 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
420 static void |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
421 gaim_away(GaimAccount *account, char *state, char *message, void *data) |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
422 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
423 /* we only support global away. this is the way it is, ok? */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
424 docklet_update_status(); |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
425 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
426 |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
427 static gboolean |
| 8999 | 428 gaim_conv_im_recv(GaimAccount *account, char *sender, |
| 429 char *message, int flags, void *data) | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
430 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
431 /* if message queuing while away is enabled, this event could be the first |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
432 message so we need to see if the status (and hence icon) needs changing. |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
433 do this when idle so that all message processing is completed, queuing |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
434 etc, before we run. */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
435 g_idle_add(docklet_update_status, &handle); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
436 |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
437 return FALSE; |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
438 } |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
439 |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
440 static void |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
441 gaim_new_conversation(GaimConversation *conv, void *data) |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
442 { |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
443 /* queue a callback here so if the queue is being |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
444 flushed, we stop flashing. thanks javabsp. */ |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
445 g_idle_add(docklet_update_status, &handle); |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
446 } |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
447 |
| 9893 | 448 /* We need this because the blist purge_away_queue cb won't be called before the |
| 449 plugin is unloaded, when quitting */ | |
| 450 static void gaim_quit_cb() { | |
| 451 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "dealing with queued messages on exit\n"); | |
| 9958 | 452 #if 0 /* XXX CUI */ |
| 9893 | 453 docklet_flush_queue(); |
| 9958 | 454 #endif |
| 9893 | 455 } |
| 456 | |
| 457 | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
458 /* static void gaim_buddy_signon(GaimConnection *gc, char *who, void *data) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
459 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
460 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
461 static void gaim_buddy_signoff(GaimConnection *gc, char *who, void *data) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
462 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
463 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
464 static void gaim_buddy_away(GaimConnection *gc, char *who, void *data) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
465 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
466 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
467 static void gaim_buddy_back(GaimConnection *gc, char *who, void *data) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
468 } */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
469 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
470 /* plugin glue */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
471 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
472 #define DOCKLET_PLUGIN_ID "gtk-docklet" |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
473 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
474 static gboolean |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
475 plugin_load(GaimPlugin *plugin) |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
476 { |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
477 void *conn_handle = gaim_connections_get_handle(); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
478 void *conv_handle = gaim_conversations_get_handle(); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
479 void *accounts_handle = gaim_accounts_get_handle(); |
| 9893 | 480 void *core_handle = gaim_get_core(); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
481 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
482 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "plugin loaded\n"); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
483 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
484 handle = plugin; |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
485 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
486 docklet_ui_init(); |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
487 if (ui_ops && ui_ops->create) |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
488 ui_ops->create(); |
| 3510 | 489 |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
490 gaim_signal_connect(conn_handle, "signed-on", |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
491 plugin, GAIM_CALLBACK(gaim_signon), NULL); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
492 gaim_signal_connect(conn_handle, "signed-off", |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
493 plugin, GAIM_CALLBACK(gaim_signoff), NULL); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
494 gaim_signal_connect(accounts_handle, "account-connecting", |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
495 plugin, GAIM_CALLBACK(gaim_connecting), NULL); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
496 gaim_signal_connect(accounts_handle, "account-away", |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
497 plugin, GAIM_CALLBACK(gaim_away), NULL); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
498 gaim_signal_connect(conv_handle, "received-im-msg", |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6979
diff
changeset
|
499 plugin, GAIM_CALLBACK(gaim_conv_im_recv), NULL); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
500 gaim_signal_connect(conv_handle, "conversation-created", |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
501 plugin, GAIM_CALLBACK(gaim_new_conversation), NULL); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
502 |
| 9893 | 503 gaim_signal_connect(core_handle, "quitting", |
| 504 plugin, GAIM_CALLBACK(gaim_quit_cb), NULL); | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
505 /* gaim_signal_connect(plugin, event_buddy_signon, gaim_buddy_signon, NULL); |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
506 gaim_signal_connect(plugin, event_buddy_signoff, gaim_buddy_signoff, NULL); |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
507 gaim_signal_connect(plugin, event_buddy_away, gaim_buddy_away, NULL); |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
508 gaim_signal_connect(plugin, event_buddy_back, gaim_buddy_back, NULL); */ |
| 3510 | 509 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
510 return TRUE; |
| 3510 | 511 } |
| 512 | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
513 static gboolean |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
514 plugin_unload(GaimPlugin *plugin) |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
515 { |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
516 if (ui_ops && ui_ops->destroy) |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
517 ui_ops->destroy(); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
518 |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
519 /* XXX: do this while gaim has no other way to toggle the global mute */ |
| 5684 | 520 gaim_gtk_sound_set_mute(FALSE); |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
521 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
522 docklet_remove_callbacks(); |
| 4567 | 523 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
524 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "plugin unloaded\n"); |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
525 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
526 return TRUE; |
| 3554 | 527 } |
| 528 | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
529 static GtkWidget * |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
530 plugin_config_frame(GaimPlugin *plugin) |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
531 { |
| 3570 | 532 GtkWidget *frame; |
| 533 GtkWidget *vbox, *hbox; | |
| 534 GtkWidget *toggle; | |
|
5554
7b36d02031a2
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
535 static const char *qmpref = "/plugins/gtk/docklet/queue_messages"; |
| 3517 | 536 |
| 3570 | 537 frame = gtk_vbox_new(FALSE, 18); |
| 538 gtk_container_set_border_width(GTK_CONTAINER(frame), 12); | |
| 539 | |
|
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
540 vbox = gaim_gtk_make_frame(frame, _("Tray Icon Configuration")); |
| 3570 | 541 hbox = gtk_hbox_new(FALSE, 18); |
| 542 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 3517 | 543 |
| 4093 | 544 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
|
545 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
|
546 g_signal_connect(G_OBJECT(toggle), "clicked", G_CALLBACK(docklet_set_bool), (void *)qmpref); |
| 3570 | 547 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 548 | |
| 549 gtk_widget_show_all(frame); | |
| 550 return frame; | |
| 3517 | 551 } |
| 3570 | 552 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
553 static GaimGtkPluginUiInfo ui_info = |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
554 { |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
555 plugin_config_frame |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
556 }; |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
557 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
558 static GaimPluginInfo info = |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
559 { |
| 9943 | 560 GAIM_PLUGIN_MAGIC, |
| 561 GAIM_MAJOR_VERSION, | |
| 562 GAIM_MINOR_VERSION, | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
563 GAIM_PLUGIN_STANDARD, /**< type */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
564 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
565 0, /**< flags */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
566 NULL, /**< dependencies */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
567 GAIM_PRIORITY_DEFAULT, /**< priority */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
568 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
569 DOCKLET_PLUGIN_ID, /**< id */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
570 N_("System Tray Icon"), /**< name */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
571 VERSION, /**< version */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
572 /** summary */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
573 N_("Displays an icon for Gaim in the system tray."), |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
574 /** description */ |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
575 N_("Displays a system tray icon (in GNOME, KDE or Windows for example) " |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
576 "to show the current status of Gaim, allow fast access to commonly " |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
577 "used functions, and to toggle display of the buddy list or login " |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
578 "window. Also allows messages to be queued until the icon is " |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
579 "clicked, similar to ICQ."), |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
580 "Robert McQueen <robot101@debian.org>", /**< author */ |
|
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6310
diff
changeset
|
581 GAIM_WEBSITE, /**< homepage */ |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
582 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
583 plugin_load, /**< load */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
584 plugin_unload, /**< unload */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
585 NULL, /**< destroy */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
586 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
587 &ui_info, /**< ui_info */ |
| 8993 | 588 NULL, /**< extra_info */ |
| 589 NULL, | |
| 590 NULL | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
591 }; |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
592 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
593 static void |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
594 plugin_init(GaimPlugin *plugin) |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
595 { |
|
6226
6b95da075de9
[gaim-migrate @ 6719]
Christian Hammond <chipx86@chipx86.com>
parents:
6211
diff
changeset
|
596 gaim_prefs_add_none("/plugins/gtk/docklet"); |
|
6b95da075de9
[gaim-migrate @ 6719]
Christian Hammond <chipx86@chipx86.com>
parents:
6211
diff
changeset
|
597 gaim_prefs_add_bool("/plugins/gtk/docklet/queue_messages", FALSE); |
| 3551 | 598 } |
| 3510 | 599 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
600 GAIM_INIT_PLUGIN(docklet, plugin_init, info) |
