Open an explorer.exe window at the location of the file when clicking
[pidgin-git.git] / pidgin / plugins / iconaway.c
blobe3721813631633a13ed35a98d2e6a3d8f904fb26
1 /* purple
3 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
21 #include "internal.h"
22 #include "pidgin.h"
24 #include "conversation.h"
25 #include "signals.h"
26 #include "version.h"
28 #include "gtkconv.h"
29 #include "gtkplugin.h"
31 #define ICONAWAY_PLUGIN_ID "gtk-iconaway"
33 static void
34 iconify_windows(PurpleAccount *account, PurpleStatus *old, PurpleStatus *newstatus)
36 PurplePresence *presence;
37 PidginWindow *win;
38 GList *windows;
40 presence = purple_status_get_presence(newstatus);
42 if (purple_presence_is_available(presence))
43 return;
45 purple_blist_set_visible(FALSE);
47 for (windows = pidgin_conv_windows_get_list();
48 windows != NULL;
49 windows = windows->next) {
51 win = (PidginWindow *)windows->data;
53 gtk_window_iconify(GTK_WINDOW(win->window));
58 * EXPORTED FUNCTIONS
61 static gboolean
62 plugin_load(PurplePlugin *plugin)
64 purple_signal_connect(purple_accounts_get_handle(), "account-status-changed",
65 plugin, PURPLE_CALLBACK(iconify_windows), NULL);
67 return TRUE;
70 static PurplePluginInfo info =
72 PURPLE_PLUGIN_MAGIC,
73 PURPLE_MAJOR_VERSION,
74 PURPLE_MINOR_VERSION,
75 PURPLE_PLUGIN_STANDARD, /**< type */
76 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */
77 0, /**< flags */
78 NULL, /**< dependencies */
79 PURPLE_PRIORITY_DEFAULT, /**< priority */
81 ICONAWAY_PLUGIN_ID, /**< id */
82 N_("Iconify on Away"), /**< name */
83 DISPLAY_VERSION, /**< version */
84 /** summary */
85 N_("Iconifies the buddy list and your conversations when you go away."),
86 /** description */
87 N_("Iconifies the buddy list and your conversations when you go away."),
88 "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */
89 PURPLE_WEBSITE, /**< homepage */
91 plugin_load, /**< load */
92 NULL, /**< unload */
93 NULL, /**< destroy */
95 NULL, /**< ui_info */
96 NULL, /**< extra_info */
97 NULL,
98 NULL,
100 /* padding */
101 NULL,
102 NULL,
103 NULL,
104 NULL
107 static void
108 init_plugin(PurplePlugin *plugin)
112 PURPLE_INIT_PLUGIN(iconaway, init_plugin, info)