~prateek.karandikar/ubuntu/precise/pidgin/add_quicklist

« back to all changes in this revision

Viewing changes to pidgin/gtkdocklet-gtk.c

  • Committer: Bazaar Package Importer
  • Author(s): Micah Gersten
  • Date: 2011-04-11 03:27:22 UTC
  • mfrom: (2.3.17 sid)
  • Revision ID: james.westby@ubuntu.com-20110411032722-farsw08i6ouj5dnd
Tags: 1:2.7.11-1ubuntu1
* Merge from Debian unstable (LP: #757146), remaining changes:
  + debian/control:
    - Add libtool and liblaunchpad-integration-dev build depends
    - Bump standards version
    - Relax binary depends on pidgin versions
    - Add pidgin-libnotify as Recommends for pidgin binary
    - Fix description of pidgin binary
    - Don't have libpurple-bin depend on libpurple0
  + debian/libpurple0.symbols: add epoch to appropriate symbols
  + Add debian/patches:
    - 02_lpi.patch
    - 04_let_crasher_for_apport.patch
    - 05_default_to_irc_ubuntu_com.patch
    - 10_docklet_default_off.patch
    - 11_buddy_list_really_show.patch
    - 13_sounds_and_timers.patch
    - 60_1024x600_gtkpounce.c.patch
    - 60_1024x600_gtkprefs.c.patch
  + debian/prefs.xml: add notification prefs
  + debian/rules:
    - Add translation domain to desktop file with gettext
    - Add the launcher for pidgin

* Add configure check for launchpad integration attached to the gtk check since 
  upstream dropped the startup notification check which is where this check was 
  previously
  - update debian/patches/02_lpi.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * System tray icon (aka docklet) plugin for Purple
3
3
 *
4
4
 * Copyright (C) 2007 Anders Hasselqvist
5
 
 * 
 
5
 *
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.
15
 
 * 
 
15
 *
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
47
47
static gboolean
48
48
docklet_gtk_embed_timeout_cb(gpointer data)
49
49
{
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.
54
 
         */
55
 
        purple_debug_info("docklet", "failed to embed within timeout\n");
56
 
        pidgin_docklet_remove();
57
 
 
 
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");
 
55
 
 
56
                pidgin_docklet_embedded();
 
57
                purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", TRUE);
 
58
        }
 
59
        else
 
60
#endif
 
61
        {
 
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.
 
66
                 */
 
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);
 
70
        }
 
71
 
 
72
#if GTK_CHECK_VERSION(2,12,0)
58
73
        embed_timeout = 0;
59
74
        return FALSE;
 
75
#else
 
76
        return TRUE;
 
77
#endif
60
78
}
61
79
 
 
80
#if GTK_CHECK_VERSION(2,12,0)
62
81
static gboolean
63
82
docklet_gtk_embedded_cb(GtkWidget *widget, gpointer data)
64
83
{
81
100
 
82
101
        return TRUE;
83
102
}
 
103
#endif
84
104
 
85
105
static void
86
106
docklet_gtk_destroyed_cb(GtkWidget *widget, gpointer data)
98
118
static void
99
119
docklet_gtk_status_activated_cb(GtkStatusIcon *status_icon, gpointer user_data)
100
120
{
101
 
        pidgin_docklet_clicked(1); 
 
121
        pidgin_docklet_clicked(1);
102
122
}
103
123
 
104
124
static void
205
225
 
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);
 
230
#endif
209
231
        g_signal_connect(G_OBJECT(docklet), "destroy", G_CALLBACK(docklet_gtk_destroyed_cb), NULL);
210
232
 
211
233
        gtk_status_icon_set_visible(docklet, TRUE);
225
247
         */
226
248
        if (!recreate) {
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);
230
253
                } else {
231
254
                        embed_timeout = purple_timeout_add_seconds(SHORT_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
232
255
                }
 
256
#else
 
257
                embed_timeout = purple_timeout_add_seconds(SHORT_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
 
258
#endif
233
259
        }
234
260
 
235
261
        purple_debug_info("docklet", "GTK+ created\n");
255
281
docklet_ui_init(void)
256
282
{
257
283
        pidgin_docklet_set_ui_ops(&ui_ops);
 
284
 
 
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");
 
289
        } else {
 
290
                purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", FALSE);
 
291
        }
 
292
 
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");
260
295
}
 
296