Mercurial > pidgin
annotate plugins/docklet/docklet.c @ 11684:c1906dc6257c
[gaim-migrate @ 13970]
"This patch fixes the tab-color change prob (hopefully
this is the last one in the series). Bleeter also
thinks I have nailed it this time." -- Sadrul Habib Chowdhury
This also seems to fix a case of it I was having this morning.
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Mon, 17 Oct 2005 16:42:10 +0000 |
| parents | bb0d7b719af2 |
| children | cae2fb7e8594 |
| 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 |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
43 #include "gtkaccount.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
44 #include "gtkblist.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
45 #include "gtkft.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
46 #include "gtkplugin.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
47 #include "gtkprefs.h" |
| 5684 | 48 #include "gtksound.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
49 #include "gtkutils.h" |
|
10297
ec140184437b
[gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents:
10272
diff
changeset
|
50 #include "gtkstock.h" |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
51 #include "docklet.h" |
| 3510 | 52 |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
53 #include "gaim.h" |
| 9709 | 54 #include "gtkdialogs.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
55 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
56 /* globals */ |
| 3867 | 57 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
58 GaimPlugin *handle = NULL; |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
59 static struct docklet_ui_ops *ui_ops = NULL; |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
60 static enum docklet_status status = offline; |
| 10127 | 61 gboolean online_account_supports_chat = FALSE; |
| 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 { |
| 10074 | 76 gaim_prefs_set_bool("/gaim/gtk/sound/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 |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
85 #ifdef _WIN32 |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
86 /* 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
|
87 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
|
88 pointer leaves the menu. */ |
|
10910
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
89 static gboolean hide_docklet_menu(gpointer data) |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
90 { |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
91 if (data != NULL) { |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
92 gtk_menu_popdown(GTK_MENU(data)); |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
93 } |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
94 return FALSE; |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
95 } |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
96 static gboolean |
|
10910
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
97 docklet_menu_leave_enter(GtkWidget *menu, GdkEventCrossing *event, void *data) |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
98 { |
|
10910
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
99 static guint hide_docklet_timer = 0; |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
100 if (event->type == GDK_LEAVE_NOTIFY && event->detail == GDK_NOTIFY_ANCESTOR) { |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
101 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "menu leave-notify-event\n"); |
|
10910
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
102 /* Add some slop so that the menu doesn't annoyingly disappear when mousing around */ |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
103 if (hide_docklet_timer == 0) { |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
104 hide_docklet_timer = gaim_timeout_add(500, |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
105 hide_docklet_menu, menu); |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
106 } |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
107 } else if (event->type == GDK_ENTER_NOTIFY && event->detail == GDK_NOTIFY_ANCESTOR) { |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
108 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "menu enter-notify-event\n"); |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
109 if (hide_docklet_timer != 0) { |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
110 /* Cancel the hiding if we reenter */ |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
111 gaim_timeout_remove(hide_docklet_timer); |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
112 hide_docklet_timer = 0; |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
113 } |
| 3570 | 114 } |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
115 return FALSE; |
| 3510 | 116 } |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
117 #endif |
| 3510 | 118 |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
119 static void docklet_menu() { |
| 3513 | 120 static GtkWidget *menu = NULL; |
| 3512 | 121 GtkWidget *entry; |
| 10127 | 122 GtkWidget *menuitem; |
| 3510 | 123 |
| 124 if (menu) { | |
| 125 gtk_widget_destroy(menu); | |
| 126 } | |
| 127 | |
| 128 menu = gtk_menu_new(); | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
129 |
| 4157 | 130 switch (status) { |
| 131 case offline: | |
| 132 case offline_connecting: | |
| 10738 | 133 /* No special menu items right now */ |
| 4567 | 134 break; |
| 135 default: | |
| 9714 | 136 gaim_new_item_from_stock(menu, _("New Message..."), GAIM_STOCK_IM, G_CALLBACK(gaim_gtkdialogs_im), NULL, 0, 0, NULL); |
| 10127 | 137 menuitem = gaim_new_item_from_stock(menu, _("Join A Chat..."), GAIM_STOCK_CHAT, G_CALLBACK(gaim_gtk_blist_joinchat_show), NULL, 0, 0, NULL); |
| 138 gtk_widget_set_sensitive(menuitem, online_account_supports_chat); | |
|
11226
1e65b7d442ca
[gaim-migrate @ 13364]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
139 |
|
1e65b7d442ca
[gaim-migrate @ 13364]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
140 gaim_separator(menu); |
| 4567 | 141 break; |
| 142 } | |
| 143 | |
| 144 switch (status) { | |
| 145 case offline: | |
| 146 case offline_connecting: | |
| 4157 | 147 break; |
| 148 case online: | |
| 149 case online_connecting: | |
| 150 case online_pending: { | |
| 9958 | 151 #if 0 /* XXX NEW STATUS */ |
| 3510 | 152 GtkWidget *docklet_awaymenu; |
| 153 GSList *awy = NULL; | |
| 154 struct away_message *a = NULL; | |
| 155 | |
| 156 docklet_awaymenu = gtk_menu_new(); | |
| 157 awy = away_messages; | |
| 158 | |
| 159 while (awy) { | |
| 160 a = (struct away_message *)awy->data; | |
| 161 | |
| 162 entry = gtk_menu_item_new_with_label(a->name); | |
| 3554 | 163 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(do_away_message), a); |
| 4635 | 164 gtk_menu_shell_append(GTK_MENU_SHELL(docklet_awaymenu), entry); |
| 3510 | 165 |
| 166 awy = g_slist_next(awy); | |
| 167 } | |
| 168 | |
| 4157 | 169 if (away_messages) |
| 170 gaim_separator(docklet_awaymenu); | |
| 3510 | 171 |
| 172 entry = gtk_menu_item_new_with_label(_("New...")); | |
| 3554 | 173 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(create_away_mess), NULL); |
| 4635 | 174 gtk_menu_shell_append(GTK_MENU_SHELL(docklet_awaymenu), entry); |
| 3510 | 175 |
| 176 entry = gtk_menu_item_new_with_label(_("Away")); | |
| 3512 | 177 gtk_menu_item_set_submenu(GTK_MENU_ITEM(entry), docklet_awaymenu); |
| 4635 | 178 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry); |
| 9958 | 179 #endif |
| 4157 | 180 } break; |
| 181 case away: | |
| 182 case away_pending: | |
| 9958 | 183 #if 0 /* XXX NEW STATUS */ |
| 3510 | 184 entry = gtk_menu_item_new_with_label(_("Back")); |
| 3554 | 185 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(do_im_back), NULL); |
| 4635 | 186 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry); |
| 9958 | 187 #endif |
| 4157 | 188 break; |
| 3510 | 189 } |
| 190 | |
| 4567 | 191 entry = gtk_check_menu_item_new_with_label(_("Mute Sounds")); |
| 10074 | 192 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(entry), gaim_prefs_get_bool("/gaim/gtk/sound/mute")); |
| 193 if (!strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), "none")) | |
| 194 gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE); | |
| 4567 | 195 g_signal_connect(G_OBJECT(entry), "toggled", G_CALLBACK(docklet_toggle_mute), NULL); |
| 4635 | 196 gtk_menu_shell_append(GTK_MENU_SHELL(menu), entry); |
| 4567 | 197 |
| 5669 | 198 gaim_new_item_from_stock(menu, _("File Transfers"), GAIM_STOCK_FILE_TRANSFER, G_CALLBACK(gaim_show_xfer_dialog), NULL, 0, 0, NULL); |
| 6138 | 199 gaim_new_item_from_stock(menu, _("Accounts"), GAIM_STOCK_ACCOUNTS, G_CALLBACK(gaim_gtk_accounts_window_show), NULL, 0, 0, NULL); |
| 5669 | 200 gaim_new_item_from_stock(menu, _("Preferences"), GTK_STOCK_PREFERENCES, G_CALLBACK(gaim_gtk_prefs_show), NULL, 0, 0, NULL); |
| 4567 | 201 |
| 202 gaim_separator(menu); | |
| 203 | |
| 9994 | 204 gaim_new_item_from_stock(menu, _("Quit"), GTK_STOCK_QUIT, G_CALLBACK(gaim_core_quit), NULL, 0, 0, NULL); |
| 3510 | 205 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
206 #ifdef _WIN32 |
|
10910
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
207 g_signal_connect(menu, "leave-notify-event", G_CALLBACK(docklet_menu_leave_enter), NULL); |
|
d8b0b9c5ffd7
[gaim-migrate @ 12663]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10738
diff
changeset
|
208 g_signal_connect(menu, "enter-notify-event", G_CALLBACK(docklet_menu_leave_enter), NULL); |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
209 #endif |
| 3510 | 210 gtk_widget_show_all(menu); |
|
10268
d082b2a71ee7
[gaim-migrate @ 11414]
Christian Hammond <chipx86@chipx86.com>
parents:
10127
diff
changeset
|
211 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, |
|
d082b2a71ee7
[gaim-migrate @ 11414]
Christian Hammond <chipx86@chipx86.com>
parents:
10127
diff
changeset
|
212 ui_ops->position_menu, |
|
d082b2a71ee7
[gaim-migrate @ 11414]
Christian Hammond <chipx86@chipx86.com>
parents:
10127
diff
changeset
|
213 NULL, 0, gtk_get_current_event_time()); |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
214 } |
| 3510 | 215 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
216 static gboolean |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
217 docklet_blink_icon() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
218 { |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
219 static gboolean blinked = FALSE; |
| 6910 | 220 gboolean ret = FALSE; /* by default, don't keep blinking */ |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
221 |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
222 blinked = !blinked; |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
223 |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
224 switch (status) { |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
225 case online_pending: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
226 case away_pending: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
227 if (blinked) { |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
228 if (ui_ops && ui_ops->blank_icon) |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
229 ui_ops->blank_icon(); |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
230 } else { |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
231 if (ui_ops && ui_ops->update_icon) |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
232 ui_ops->update_icon(status); |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
233 } |
| 6910 | 234 ret = TRUE; /* keep blinking */ |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
235 break; |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
236 case offline: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
237 case offline_connecting: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
238 case online: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
239 case online_connecting: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
240 case away: |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
241 blinked = FALSE; |
|
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
242 break; |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
243 } |
| 6906 | 244 |
| 6910 | 245 return ret; |
| 3510 | 246 } |
| 247 | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
248 static gboolean |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
249 docklet_update_status() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
250 { |
| 10127 | 251 GList *c; |
| 3510 | 252 enum docklet_status oldstatus; |
| 253 | |
| 254 oldstatus = status; | |
| 255 | |
| 10127 | 256 if ((c = gaim_connections_get_all())) { |
| 9958 | 257 #if 0 /* XXX NEW STATUS */ |
| 3517 | 258 if (unread_message_queue) { |
| 4157 | 259 status = online_pending; |
| 3517 | 260 } else if (awaymessage) { |
| 3510 | 261 if (message_queue) { |
| 262 status = away_pending; | |
| 263 } else { | |
| 264 status = away; | |
| 265 } | |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
266 } else if (gaim_connections_get_connecting()) { |
| 9958 | 267 #else |
| 268 if (gaim_connections_get_connecting()) { | |
| 269 #endif | |
| 4157 | 270 status = online_connecting; |
| 3510 | 271 } else { |
| 272 status = online; | |
| 273 } | |
| 10127 | 274 /* Check if any online accounts support chats */ |
| 275 while (c != NULL) { | |
| 276 GaimConnection *gc = c->data; | |
| 277 if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL) { | |
| 278 online_account_supports_chat = TRUE; | |
| 279 break; | |
| 280 } | |
| 281 c = c->next; | |
| 282 } | |
| 3510 | 283 } else { |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
284 if (gaim_connections_get_connecting()) { |
| 4157 | 285 status = offline_connecting; |
| 3517 | 286 } else { |
| 287 status = offline; | |
| 288 } | |
| 3510 | 289 } |
| 290 | |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
291 /* update the icon if we changed status */ |
| 3510 | 292 if (status != oldstatus) { |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
293 if (ui_ops && ui_ops->update_icon) |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
294 ui_ops->update_icon(status); |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
295 |
|
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
296 /* and schedule the blinker function if messages are pending */ |
|
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
297 if (status == online_pending || status == away_pending) { |
| 6310 | 298 g_timeout_add(500, docklet_blink_icon, &handle); |
|
4261
e252238f99df
[gaim-migrate @ 4512]
Christian Hammond <chipx86@chipx86.com>
parents:
4250
diff
changeset
|
299 } |
| 3510 | 300 } |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
301 |
| 4093 | 302 return FALSE; /* for when we're called by the glib idle handler */ |
| 3510 | 303 } |
| 304 | |
| 9958 | 305 #if 0 /* XXX CUI */ |
| 306 static void | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
307 docklet_flush_queue() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
308 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
309 if (unread_message_queue) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
310 purge_away_queue(&unread_message_queue); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
311 } |
| 3510 | 312 } |
| 9958 | 313 #endif |
| 3510 | 314 |
| 9958 | 315 static void |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
316 docklet_remove_callbacks() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
317 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
318 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "removing callbacks"); |
| 3510 | 319 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
320 while (g_source_remove_by_user_data(&handle)) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
321 gaim_debug(GAIM_DEBUG_INFO, NULL, "."); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
322 } |
| 3510 | 323 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
324 gaim_debug(GAIM_DEBUG_INFO, NULL, "\n"); |
| 3510 | 325 } |
| 326 | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
327 /* public code */ |
| 3510 | 328 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
329 void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
330 docklet_clicked(int button_type) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
331 { |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
332 switch (button_type) { |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
333 case 1: |
| 9958 | 334 #if 0 /* XXX CUI */ |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
335 if (unread_message_queue) { |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
336 docklet_flush_queue(); |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
337 } else { |
| 9958 | 338 #endif |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
339 gaim_gtk_blist_docklet_toggle(); |
| 9958 | 340 #if 0 /* XXX CUI */ |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
341 } |
| 9958 | 342 #endif |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
343 break; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
344 case 2: |
| 10738 | 345 /* Don't do anything for middle click */ |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
346 break; |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
347 case 3: |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
348 docklet_menu(); |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
349 break; |
|
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 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
353 void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
354 docklet_embedded() |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
355 { |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
356 gaim_gtk_blist_docklet_add(); |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
357 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
358 docklet_update_status(); |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
359 if (ui_ops && ui_ops->update_icon) |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
360 ui_ops->update_icon(status); |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
361 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
362 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
363 void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
364 docklet_remove(gboolean visible) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
365 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
366 if (visible) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
367 gaim_gtk_blist_docklet_remove(); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
368 |
| 9958 | 369 #if 0 /* XXX CUI */ |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
370 docklet_flush_queue(); |
| 9958 | 371 #endif |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
372 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
373 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
374 void |
| 10504 | 375 docklet_unload() |
| 376 { | |
| 377 gaim_plugin_unload(handle); | |
| 378 } | |
| 379 | |
| 380 void | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
381 docklet_set_ui_ops(struct docklet_ui_ops *ops) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
382 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
383 ui_ops = ops; |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
384 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
385 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
386 /* callbacks */ |
|
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 static void |
| 10272 | 389 gaim_login(GaimConnection *gc, void *data) |
|
6208
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 docklet_update_status(); |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
392 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
393 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
394 static void |
| 10272 | 395 gaim_logout(GaimConnection *gc, void *data) |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
396 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
397 /* do this when idle so that if the prpl was connecting |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
398 and was cancelled, we register that connecting_count |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
399 has returned to 0 */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
400 /* no longer necessary because Chip decided that us plugins |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
401 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
|
402 g_idle_add(docklet_update_status, &docklet); */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
403 docklet_update_status(); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
404 } |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
405 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
406 static void |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
407 gaim_connecting(GaimAccount *account, void *data) |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
408 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
409 docklet_update_status(); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
410 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
411 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
412 static void |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
413 gaim_away(GaimAccount *account, char *state, char *message, void *data) |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
414 { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
415 /* 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
|
416 docklet_update_status(); |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
417 } |
|
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
418 |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
419 static gboolean |
| 10104 | 420 gaim_conv_im_recv(GaimAccount *account, char *sender, char *message, |
| 421 GaimConversation *conv, int flags, 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 /* 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
|
424 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
|
425 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
|
426 etc, before we run. */ |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
427 g_idle_add(docklet_update_status, &handle); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
428 |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
429 return FALSE; |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
430 } |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
431 |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
432 static void |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
433 gaim_new_conversation(GaimConversation *conv, void *data) |
|
6211
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
434 { |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
435 /* queue a callback here so if the queue is being |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
436 flushed, we stop flashing. thanks javabsp. */ |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
437 g_idle_add(docklet_update_status, &handle); |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
438 } |
|
9fd7716068d9
[gaim-migrate @ 6697]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6208
diff
changeset
|
439 |
| 9893 | 440 /* We need this because the blist purge_away_queue cb won't be called before the |
| 441 plugin is unloaded, when quitting */ | |
| 442 static void gaim_quit_cb() { | |
| 443 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "dealing with queued messages on exit\n"); | |
| 9958 | 444 #if 0 /* XXX CUI */ |
| 9893 | 445 docklet_flush_queue(); |
| 9958 | 446 #endif |
| 9893 | 447 } |
| 448 | |
| 449 | |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
450 /* static void gaim_buddy_signon(GaimConnection *gc, char *who, void *data) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
451 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
452 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
453 static void gaim_buddy_signoff(GaimConnection *gc, char *who, void *data) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
454 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
455 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
456 static void gaim_buddy_away(GaimConnection *gc, char *who, void *data) { |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
457 } |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
458 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
459 static void gaim_buddy_back(GaimConnection *gc, char *who, void *data) { |
|
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 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
462 /* plugin glue */ |
|
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 #define DOCKLET_PLUGIN_ID "gtk-docklet" |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
465 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
466 static gboolean |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
467 plugin_load(GaimPlugin *plugin) |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
468 { |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
469 void *conn_handle = gaim_connections_get_handle(); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
470 void *conv_handle = gaim_conversations_get_handle(); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
471 void *accounts_handle = gaim_accounts_get_handle(); |
| 9893 | 472 void *core_handle = gaim_get_core(); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
473 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
474 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "plugin loaded\n"); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
475 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
476 handle = plugin; |
|
6077
b2c8e08508af
[gaim-migrate @ 6536]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6063
diff
changeset
|
477 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
478 docklet_ui_init(); |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
479 if (ui_ops && ui_ops->create) |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
480 ui_ops->create(); |
| 3510 | 481 |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
482 gaim_signal_connect(conn_handle, "signed-on", |
| 10272 | 483 plugin, GAIM_CALLBACK(gaim_login), NULL); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
484 gaim_signal_connect(conn_handle, "signed-off", |
| 10272 | 485 plugin, GAIM_CALLBACK(gaim_logout), NULL); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
486 gaim_signal_connect(accounts_handle, "account-connecting", |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
487 plugin, GAIM_CALLBACK(gaim_connecting), NULL); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
488 gaim_signal_connect(accounts_handle, "account-away", |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
489 plugin, GAIM_CALLBACK(gaim_away), NULL); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
490 gaim_signal_connect(conv_handle, "received-im-msg", |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6979
diff
changeset
|
491 plugin, GAIM_CALLBACK(gaim_conv_im_recv), NULL); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
492 gaim_signal_connect(conv_handle, "conversation-created", |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
493 plugin, GAIM_CALLBACK(gaim_new_conversation), NULL); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
494 |
| 9893 | 495 gaim_signal_connect(core_handle, "quitting", |
| 496 plugin, GAIM_CALLBACK(gaim_quit_cb), NULL); | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
497 /* gaim_signal_connect(plugin, event_buddy_signon, gaim_buddy_signon, NULL); |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
498 gaim_signal_connect(plugin, event_buddy_signoff, gaim_buddy_signoff, NULL); |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
499 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
|
500 gaim_signal_connect(plugin, event_buddy_back, gaim_buddy_back, NULL); */ |
| 3510 | 501 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
502 return TRUE; |
| 3510 | 503 } |
| 504 | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
505 static gboolean |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
506 plugin_unload(GaimPlugin *plugin) |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
507 { |
|
6894
c2fb9192377b
[gaim-migrate @ 7441]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6485
diff
changeset
|
508 if (ui_ops && ui_ops->destroy) |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
509 ui_ops->destroy(); |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
510 |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
511 docklet_remove_callbacks(); |
| 4567 | 512 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
513 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "plugin unloaded\n"); |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
514 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
515 return TRUE; |
| 3554 | 516 } |
| 517 | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
518 static GtkWidget * |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
519 plugin_config_frame(GaimPlugin *plugin) |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
520 { |
| 3570 | 521 GtkWidget *frame; |
| 522 GtkWidget *vbox, *hbox; | |
| 523 GtkWidget *toggle; | |
|
5554
7b36d02031a2
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
524 static const char *qmpref = "/plugins/gtk/docklet/queue_messages"; |
| 3517 | 525 |
| 3570 | 526 frame = gtk_vbox_new(FALSE, 18); |
| 527 gtk_container_set_border_width(GTK_CONTAINER(frame), 12); | |
| 528 | |
|
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
529 vbox = gaim_gtk_make_frame(frame, _("Tray Icon Configuration")); |
| 3570 | 530 hbox = gtk_hbox_new(FALSE, 18); |
| 531 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 3517 | 532 |
| 4093 | 533 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
|
534 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
|
535 g_signal_connect(G_OBJECT(toggle), "clicked", G_CALLBACK(docklet_set_bool), (void *)qmpref); |
| 3570 | 536 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 537 | |
| 538 gtk_widget_show_all(frame); | |
| 539 return frame; | |
| 3517 | 540 } |
| 3570 | 541 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
542 static GaimGtkPluginUiInfo ui_info = |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
543 { |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
544 plugin_config_frame |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
545 }; |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
546 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
547 static GaimPluginInfo info = |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
548 { |
| 9943 | 549 GAIM_PLUGIN_MAGIC, |
| 550 GAIM_MAJOR_VERSION, | |
| 551 GAIM_MINOR_VERSION, | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
552 GAIM_PLUGIN_STANDARD, /**< type */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
553 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
554 0, /**< flags */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
555 NULL, /**< dependencies */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
556 GAIM_PRIORITY_DEFAULT, /**< priority */ |
|
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 DOCKLET_PLUGIN_ID, /**< id */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
559 N_("System Tray Icon"), /**< name */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
560 VERSION, /**< version */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
561 /** summary */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
562 N_("Displays an icon for Gaim in the system tray."), |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
563 /** description */ |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
564 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
|
565 "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
|
566 "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
|
567 "window. Also allows messages to be queued until the icon is " |
|
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
568 "clicked, similar to ICQ."), |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
569 "Robert McQueen <robot101@debian.org>", /**< author */ |
|
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6310
diff
changeset
|
570 GAIM_WEBSITE, /**< homepage */ |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
571 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
572 plugin_load, /**< load */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
573 plugin_unload, /**< unload */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
574 NULL, /**< destroy */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
575 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
576 &ui_info, /**< ui_info */ |
| 8993 | 577 NULL, /**< extra_info */ |
| 578 NULL, | |
| 579 NULL | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
580 }; |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
581 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
582 static void |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
583 plugin_init(GaimPlugin *plugin) |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
584 { |
|
6226
6b95da075de9
[gaim-migrate @ 6719]
Christian Hammond <chipx86@chipx86.com>
parents:
6211
diff
changeset
|
585 gaim_prefs_add_none("/plugins/gtk/docklet"); |
|
6b95da075de9
[gaim-migrate @ 6719]
Christian Hammond <chipx86@chipx86.com>
parents:
6211
diff
changeset
|
586 gaim_prefs_add_bool("/plugins/gtk/docklet/queue_messages", FALSE); |
| 3551 | 587 } |
| 3510 | 588 |
|
6208
3e3ee3cba192
[gaim-migrate @ 6694]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6179
diff
changeset
|
589 GAIM_INIT_PLUGIN(docklet, plugin_init, info) |
