Sun, 15 Apr 2007 03:43:17 +0000
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
to branch 'im.pidgin.rlaager.merging.msnp13-and-pidgin' (head 198222e01a7dc9f8795f68ec618a48c3478e04a8)
| 15884 | 1 | /* purple |
| 9791 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 9791 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 20 | */ | |
| 21 | #include "internal.h" | |
| 15577 | 22 | #include "pidgin.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
23 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
24 | #include "conversation.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
25 | #include "signals.h" |
| 9943 | 26 | #include "version.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
27 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
28 | #include "gtkconv.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
29 | #include "gtkplugin.h" |
|
4202
8b92de3b1c07
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
30 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
31 | #define ICONAWAY_PLUGIN_ID "gtk-iconaway" |
| 133 | 32 | |
|
12665
a370bc0f3c92
[gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11964
diff
changeset
|
33 | static void |
| 15884 | 34 | iconify_windows(PurpleAccount *account, PurpleStatus *old, PurpleStatus *newstatus) |
|
12665
a370bc0f3c92
[gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11964
diff
changeset
|
35 | { |
| 15884 | 36 | PurplePresence *presence; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
37 | PidginWindow *win; |
|
12665
a370bc0f3c92
[gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11964
diff
changeset
|
38 | GList *windows; |
| 133 | 39 | |
| 15884 | 40 | presence = purple_status_get_presence(newstatus); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
41 | |
| 15884 | 42 | if (purple_presence_is_available(presence)) |
|
1406
45a8e718dd86
[gaim-migrate @ 1416]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1405
diff
changeset
|
43 | return; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
44 | |
| 15884 | 45 | purple_blist_set_visible(FALSE); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
46 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
47 | for (windows = pidgin_conv_windows_get_list(); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
48 | windows != NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
49 | windows = windows->next) { |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
50 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
51 | win = (PidginWindow *)windows->data; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
52 | |
|
12665
a370bc0f3c92
[gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11964
diff
changeset
|
53 | gtk_window_iconify(GTK_WINDOW(win->window)); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
54 | } |
| 133 | 55 | } |
| 56 | ||
| 3630 | 57 | /* |
| 58 | * EXPORTED FUNCTIONS | |
| 59 | */ | |
| 60 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
61 | static gboolean |
| 15884 | 62 | plugin_load(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
63 | { |
| 15884 | 64 | purple_signal_connect(purple_accounts_get_handle(), "account-status-changed", |
| 65 | plugin, PURPLE_CALLBACK(iconify_windows), NULL); | |
| 133 | 66 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
67 | return TRUE; |
| 133 | 68 | } |
| 69 | ||
| 15884 | 70 | static PurplePluginInfo info = |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
71 | { |
| 15884 | 72 | PURPLE_PLUGIN_MAGIC, |
| 73 | PURPLE_MAJOR_VERSION, | |
| 74 | PURPLE_MINOR_VERSION, | |
| 75 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
76 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
77 | 0, /**< flags */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
78 | NULL, /**< dependencies */ |
| 15884 | 79 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
80 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
81 | ICONAWAY_PLUGIN_ID, /**< id */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
82 | N_("Iconify on Away"), /**< name */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
83 | VERSION, /**< version */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
84 | /** summary */ |
|
5598
4b30a063a33b
[gaim-migrate @ 6002]
Robert McQueen <robot101@debian.org>
parents:
5587
diff
changeset
|
85 | N_("Iconifies the buddy list and your conversations when you go away."), |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
86 | /** description */ |
|
5598
4b30a063a33b
[gaim-migrate @ 6002]
Robert McQueen <robot101@debian.org>
parents:
5587
diff
changeset
|
87 | N_("Iconifies the buddy list and your conversations when you go away."), |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
88 | "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */ |
| 15884 | 89 | PURPLE_WEBSITE, /**< homepage */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
90 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
91 | plugin_load, /**< load */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
92 | NULL, /**< unload */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
93 | NULL, /**< destroy */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
94 | |
|
11318
13fa1d5134f3
[gaim-migrate @ 13521]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10142
diff
changeset
|
95 | NULL, /**< ui_info */ |
| 8993 | 96 | NULL, /**< extra_info */ |
| 97 | NULL, | |
| 98 | NULL | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
99 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
100 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
101 | static void |
| 15884 | 102 | init_plugin(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
103 | { |
| 133 | 104 | } |
| 105 | ||
| 15884 | 106 | PURPLE_INIT_PLUGIN(iconaway, init_plugin, info) |