2
2
* System tray icon (aka docklet) plugin for Purple
4
4
* Copyright (C) 2007 Anders Hasselqvist
6
6
* This program is free software; you can redistribute it and/or
7
7
* modify it under the terms of the GNU General Public License as
8
8
* published by the Free Software Foundation; either version 2 of the
12
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
14
* General Public License for more details.
16
16
* You should have received a copy of the GNU General Public License
17
17
* along with this program; if not, write to the Free Software
18
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
48
48
docklet_gtk_embed_timeout_cb(gpointer data)
50
/* The docklet was not embedded within the timeout.
51
* Remove it as a visibility manager, but leave the plugin
52
* loaded so that it can embed automatically if/when a notification
53
* area becomes available.
55
purple_debug_info("docklet", "failed to embed within timeout\n");
56
pidgin_docklet_remove();
50
#if !GTK_CHECK_VERSION(2,12,0)
51
if (gtk_status_icon_is_embedded(docklet)) {
52
/* Older GTK+ (<2.12) don't implement the embedded signal, but the
53
information is still accessable through the above function. */
54
purple_debug_info("docklet", "embedded\n");
56
pidgin_docklet_embedded();
57
purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", TRUE);
62
/* The docklet was not embedded within the timeout.
63
* Remove it as a visibility manager, but leave the plugin
64
* loaded so that it can embed automatically if/when a notification
65
* area becomes available.
67
purple_debug_info("docklet", "failed to embed within timeout\n");
68
pidgin_docklet_remove();
69
purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", FALSE);
72
#if GTK_CHECK_VERSION(2,12,0)
80
#if GTK_CHECK_VERSION(2,12,0)
63
82
docklet_gtk_embedded_cb(GtkWidget *widget, gpointer data)
206
226
g_signal_connect(G_OBJECT(docklet), "activate", G_CALLBACK(docklet_gtk_status_activated_cb), NULL);
207
227
g_signal_connect(G_OBJECT(docklet), "popup-menu", G_CALLBACK(docklet_gtk_status_clicked_cb), NULL);
228
#if GTK_CHECK_VERSION(2,12,0)
208
229
g_signal_connect(G_OBJECT(docklet), "notify::embedded", G_CALLBACK(docklet_gtk_embedded_cb), NULL);
209
231
g_signal_connect(G_OBJECT(docklet), "destroy", G_CALLBACK(docklet_gtk_destroyed_cb), NULL);
211
233
gtk_status_icon_set_visible(docklet, TRUE);
227
249
pidgin_docklet_embedded();
250
#if GTK_CHECK_VERSION(2,12,0)
228
251
if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded")) {
229
252
embed_timeout = purple_timeout_add_seconds(LONG_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
231
254
embed_timeout = purple_timeout_add_seconds(SHORT_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
257
embed_timeout = purple_timeout_add_seconds(SHORT_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
235
261
purple_debug_info("docklet", "GTK+ created\n");
255
281
docklet_ui_init(void)
257
283
pidgin_docklet_set_ui_ops(&ui_ops);
285
purple_prefs_add_none(PIDGIN_PREFS_ROOT "/docklet/gtk");
286
if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded")) {
287
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", TRUE);
288
purple_prefs_remove(PIDGIN_PREFS_ROOT "/docklet/x11/embedded");
290
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", FALSE);
258
293
gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
259
294
DATADIR G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S "pidgin" G_DIR_SEPARATOR_S "tray");