~ubuntu-branches/ubuntu/precise/empathy/precise-proposed-201205180810

« back to all changes in this revision

Viewing changes to debian/patches/40_unity_launcher_count.patch

  • Committer: Bazaar Package Importer
  • Author(s): Brian Curtis, Brian Curtis, Ken VanDine
  • Date: 2011-06-01 10:35:24 UTC
  • mfrom: (1.1.70 upstream) (6.3.44 experimental)
  • Revision ID: james.westby@ubuntu.com-20110601103524-wx3wgp71394730jt
Tags: 3.1.1-1ubuntu1
[ Brian Curtis ]
* Merge with Debian experimental, remaining Ubuntu changes:
* debian/control:
  - Drop geoclue/mapping build-depends (they are in Universe)
  - Add Vcz-Bzr link
  - Add Suggests on telepathy-idle
  - Bump telepathy-butterfly, telepathy-haze to recommends
  - Don't recommend the freedesktop sound theme we have an ubuntu one
  - Add build depend for libunity-dev
* debian/rules:
  - Use autoreconf.mk
  - Disable map and location
* debian/empathy.install:
  - Install message indicator configuration
* debian/indicators/empathy:
  - Message indicator configuration
* debian/patches/01_lpi.patch:
  - Add Launchpad integration
* debian/patches/10_use_notify_osd_icons.patch:
  - Use the notify-osd image for new messages
* debian/patches/34_start_raised_execpt_in_session.patch
  - If not started with the session, we should always raise
* debian/patches/36_chat_window_default_size.patch:
  - Make the default chat window size larger
* debian/patches/37_facebook_default.patch:
  - Make facebook the default chat account type
* debian/patches/38_lp_569289.patch
  - Set freenode as default IRC network for new IRC accounts 
* debian/patches/41_unity_launcher_progress.patch
  - Display file transfer progress in the unity launcher

[ Ken VanDine ]
* debian/control
  - build depend on libgcr-3-dev instead of libgcr-dev
  - dropped build depends for libindicate, we will use telepathy-indicator
  - Depend on dconf-gsettings-backend | gsettings-backend
  - Added a Recommends for telepathy-indicator
* +debian/empathy.gsettings-override
  - Added an override for notifications-focus
* debian/patches/series
  - commented out 23_idomessagedialog_for_voip_and_ft.patch, until ido has 
    been ported to gtk3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=== modified file 'configure.ac'
2
 
--- old/configure.ac    2011-02-24 17:06:45 +0000
3
 
+++ new/configure.ac    2011-02-24 17:09:26 +0000
4
 
@@ -58,6 +58,7 @@
5
 
 GNOME_CONTROL_CENTER_GTK3_REQUIRED=2.31.4
6
 
 INDICATE_REQUIRED=0.4.91
7
 
 INDICATE_GTK_REQUIRED=0.4.91
8
 
+UNITY_REQUIRED=3.4.0
9
 
 
10
 
 # telepathy-yell
11
 
 prev_top_build_prefix=$ac_top_build_prefix
12
 
@@ -506,12 +507,41 @@
13
 
 fi
14
 
 
15
 
 if test "x$enable_libindicate" = "xyes" -a "x$have_libindicate" != "xyes"; then
16
 
-   AC_MSG_ERROR([Couldn't find libindicate.])
17
 
+   AC_MSG_ERROR([Could not find libindicate.])
18
 
 fi
19
 
 
20
 
 AM_CONDITIONAL(HAVE_LIBINDICATE, test "x$have_libindicate" = "xyes")
21
 
 
22
 
 # -----------------------------------------------------------
23
 
+# libunity
24
 
+# -----------------------------------------------------------
25
 
+AC_ARG_ENABLE(libunity,
26
 
+               AS_HELP_STRING([--enable-libunity=@<:@no/yes/auto@:>@],
27
 
+                       [build libunity support]), ,
28
 
+                       enable_libunity=auto)
29
 
+
30
 
+if test "x$enable_unity" != "xno"; then
31
 
+   PKG_CHECK_MODULES(UNITY,
32
 
+   [
33
 
+     unity >= $UNITY_REQUIRED
34
 
+   ], have_unity="yes", have_unity="no")
35
 
+
36
 
+   if test "x$have_unity" = "xyes"; then
37
 
+      AC_DEFINE(HAVE_UNITY, 1, [Define if you have unity])
38
 
+   fi
39
 
+else
40
 
+   have_unity=no
41
 
+fi
42
 
+
43
 
+if test "x$enable_unity" = "xyes" -a "x$have_unity" != "xyes"; then
44
 
+   AC_MSG_ERROR([Could not find libunity.])
45
 
+fi
46
 
+
47
 
+AM_CONDITIONAL(HAVE_UNITY, test "x$have_unity" = "xyes")
48
 
+AC_SUBST([UNITY_CFLAGS])
49
 
+AC_SUBST([UNITY_LIBS])
50
 
+
51
 
+# -----------------------------------------------------------
52
 
 # nautilus-sendto
53
 
 # -----------------------------------------------------------
54
 
 AC_ARG_ENABLE(nautilus-sendto,
55
 
@@ -614,6 +644,7 @@
56
 
 
57
 
     Features:
58
 
        Message indicator support (libindicate):  ${have_libindicate}
59
 
+       Unity panel support (unity).:  ${have_unity}
60
 
        Spell checking (enchant)....:  ${have_enchant}
61
 
        Display maps (libchamplain).:  ${have_libchamplain}
62
 
        Location awareness (Geoclue):  ${have_geoclue}
63
 
 
64
 
=== modified file 'src/Makefile.am'
65
 
--- old/src/Makefile.am 2011-02-24 17:04:31 +0000
66
 
+++ new/src/Makefile.am 2011-02-24 17:09:26 +0000
67
 
@@ -19,6 +19,7 @@
68
 
        $(CPPFLAGS_COMMON)                              \
69
 
        $(LIBNOTIFY_CFLAGS)                             \
70
 
        $(INDICATE_CFLAGS)                              \
71
 
+       $(UNITY_CFLAGS)                                 \
72
 
        $(UNIQUE_CFLAGS) \
73
 
        $(LIBCHAMPLAIN_CFLAGS)                          \
74
 
        $(WEBKIT_CFLAGS)                                \
75
 
@@ -30,6 +31,7 @@
76
 
        $(top_builddir)/extensions/libemp-extensions.la         \
77
 
        $(LIBNOTIFY_LIBS)                                       \
78
 
        $(INDICATE_LIBS)                                        \
79
 
+       $(UNITY_LIBS)                                           \
80
 
        $(UNIQUE_LIBS)                                          \
81
 
        $(EMPATHY_LIBS)                                         \
82
 
        $(GTK_LIBS)                                             \
83
 
@@ -203,6 +205,7 @@
84
 
         $(UNIQUE_LIBS)                                         \
85
 
         $(EMPATHY_LIBS)                                                        \
86
 
        $(INDICATE_LIBS)                                                \
87
 
+       $(UNITY_LIBS)                                                   \
88
 
         $(LIBCHAMPLAIN_LIBS)                                           \
89
 
         $(WEBKIT_LIBS)                                                 \
90
 
        $(NULL)
91
 
 
92
 
=== modified file 'src/empathy-chat-window.c'
93
 
--- old/src/empathy-chat-window.c       2011-02-24 17:04:31 +0000
94
 
+++ new/src/empathy-chat-window.c       2011-02-24 17:09:26 +0000
95
 
@@ -71,6 +71,10 @@
96
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CHAT
97
 
 #include <libempathy/empathy-debug.h>
98
 
 
99
 
+#ifdef HAVE_UNITY
100
 
+#include <unity.h>
101
 
+#endif
102
 
+
103
 
 /* Macro to compare guint32 X timestamps, while accounting for wrapping around
104
 
  */
105
 
 #define X_EARLIER_OR_EQL(t1, t2) \
106
 
@@ -96,6 +100,9 @@
107
 
        /* EmpathyChat -> EmpathyIndicator for that chat, if any */
108
 
        GHashTable  *indicators;
109
 
 #endif
110
 
+#ifdef HAVE_UNITY
111
 
+       UnityLauncherEntry *launcher;
112
 
+#endif
113
 
        GtkTargetList *contact_targets;
114
 
        GtkTargetList *file_targets;
115
 
 
116
 
@@ -1308,8 +1315,19 @@
117
 
                        sender, body);
118
 
                g_signal_connect (indicator, "activate",
119
 
                                  G_CALLBACK (chat_window_indicator_activate_cb), chat);
120
 
-
121
 
                g_hash_table_insert (priv->indicators, chat, indicator);
122
 
+#ifdef HAVE_UNITY
123
 
+               if (priv->launcher != NULL)
124
 
+               {
125
 
+                       gint count = g_hash_table_size (priv->indicators);
126
 
+                       DEBUG ("unity launcher: count is now %d", count);
127
 
+                       if (count > 0)
128
 
+                       {
129
 
+                               unity_launcher_entry_set_count (priv->launcher, count);
130
 
+                               unity_launcher_entry_set_count_visible (priv->launcher, TRUE);
131
 
+                       }
132
 
+               }
133
 
+#endif
134
 
        }
135
 
        empathy_indicator_show (indicator);
136
 
 }
137
 
@@ -1326,6 +1344,25 @@
138
 
                DEBUG ("indicator is %p", indicator);
139
 
                empathy_indicator_hide (indicator);
140
 
                g_hash_table_remove (priv->indicators, chat);
141
 
+#ifdef HAVE_UNITY
142
 
+        if (priv->launcher != NULL)
143
 
+        {
144
 
+               gint count = g_hash_table_size (priv->indicators);
145
 
+               DEBUG ("unity launcher: count is %d", count);
146
 
+               if (count > 0)
147
 
+               {
148
 
+                       DEBUG ("unity launcher: setting count to %d", count);
149
 
+                       unity_launcher_entry_set_count (priv->launcher, count);
150
 
+                       unity_launcher_entry_set_count_visible (priv->launcher, TRUE);
151
 
+               } else {
152
 
+                       unity_launcher_entry_set_count (priv->launcher, count);
153
 
+                       DEBUG ("unity launcher: hiding count");
154
 
+                       unity_launcher_entry_set_count_visible (priv->launcher, FALSE);
155
 
+               }
156
 
+       }
157
 
+#endif
158
 
+
159
 
+
160
 
        } else {
161
 
                DEBUG ("indicator is NULL, nothing to remove");
162
 
        }
163
 
@@ -1959,6 +1996,11 @@
164
 
                priv->chat_manager = NULL;
165
 
        }
166
 
 
167
 
+       if (priv->launcher) {
168
 
+               g_object_unref (priv->launcher);
169
 
+               priv->launcher = NULL;
170
 
+       }
171
 
+
172
 
        chat_windows = g_list_remove (chat_windows, window);
173
 
        gtk_widget_destroy (priv->dialog);
174
 
 
175
 
@@ -2057,6 +2099,9 @@
176
 
        priv->indicators = g_hash_table_new_full (g_direct_hash, g_direct_equal,
177
 
                              NULL, g_object_unref);
178
 
 #endif
179
 
+#ifdef HAVE_UNITY
180
 
+       priv->launcher = unity_launcher_entry_get_for_desktop_id ("empathy.desktop");
181
 
+#endif
182
 
 
183
 
        priv->notebook = gtk_notebook_new ();
184
 
        gtk_notebook_set_group (GTK_NOTEBOOK (priv->notebook), "EmpathyChatWindow");
185
 
 
186
 
=== modified file 'src/empathy-indicator-manager.c'
187
 
--- old/src/empathy-indicator-manager.c 2011-02-24 17:06:45 +0000
188
 
+++ new/src/empathy-indicator-manager.c 2011-02-24 17:09:26 +0000
189
 
@@ -45,6 +45,10 @@
190
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
191
 
 #include <libempathy/empathy-debug.h>
192
 
 
193
 
+#ifdef HAVE_UNITY
194
 
+#include <unity.h>
195
 
+#endif
196
 
+
197
 
 #define INDICATOR_LOGIN_TIMEOUT 15
198
 
 #define EMPATHY_DESKTOP_PATH DESKTOPDIR "/empathy.desktop"
199
 
 
200
 
@@ -62,6 +66,9 @@
201
 
   IndicateServer      *indicate_server;
202
 
   GSList              *indicator_events;
203
 
   GHashTable          *login_timeouts;
204
 
+#ifdef HAVE_UNITY
205
 
+  UnityLauncherEntry  *launcher;
206
 
+#endif
207
 
 } EmpathyIndicatorManagerPriv;
208
 
 
209
 
 typedef struct {
210
 
@@ -172,6 +179,20 @@
211
 
   g_object_unref (indicator);
212
 
   priv->indicator_events = g_slist_prepend (priv->indicator_events,
213
 
       indicator_event);
214
 
+#ifdef HAVE_UNITY
215
 
+  if (priv->launcher == NULL)
216
 
+  {
217
 
+          return;
218
 
+  }
219
 
+  gint count = g_slist_length (priv->indicator_events);
220
 
+  DEBUG ("unity launcher: count is %d", count);
221
 
+  if (count > 0)
222
 
+  {
223
 
+          unity_launcher_entry_set_count (priv->launcher, count);
224
 
+          unity_launcher_entry_set_count_visible (priv->launcher, TRUE);
225
 
+  }
226
 
+#endif
227
 
+
228
 
 }
229
 
 
230
 
 static void
231
 
@@ -195,6 +216,26 @@
232
 
       priv->indicator_events = g_slist_remove (priv->indicator_events,
233
 
           indicator_event);
234
 
       empathy_indicator_hide (indicator_event->indicator);
235
 
+#ifdef HAVE_UNITY
236
 
+        if (priv->launcher == NULL)
237
 
+        {
238
 
+                DEBUG ("unity launcher: launcher is NULL");
239
 
+                return;
240
 
+        }
241
 
+
242
 
+        gint count = g_slist_length (priv->indicator_events);
243
 
+        DEBUG ("unity launcher: count is %d", count);
244
 
+        if (count > 0)
245
 
+        {
246
 
+                DEBUG ("unity launcher: setting count to %d", count);
247
 
+                unity_launcher_entry_set_count (priv->launcher, count);
248
 
+                unity_launcher_entry_set_count_visible (priv->launcher, TRUE);
249
 
+        } else {
250
 
+                unity_launcher_entry_set_count (priv->launcher, count);
251
 
+                DEBUG ("unity launcher: hiding count");
252
 
+                unity_launcher_entry_set_count_visible (priv->launcher, FALSE);
253
 
+        }
254
 
+#endif
255
 
       return;
256
 
     }
257
 
   }
258
 
@@ -211,6 +252,8 @@
259
 
 
260
 
   priv = GET_PRIV (manager);
261
 
 
262
 
+  DEBUG ("Event updated");
263
 
+
264
 
   for (l = priv->indicator_events; l; l = l->next)
265
 
   {
266
 
     IndicatorEvent *indicator_event;
267
 
@@ -305,6 +348,10 @@
268
 
     g_object_unref (priv->indicate_server);
269
 
     priv->indicate_server = NULL;
270
 
   }
271
 
+  if (priv->launcher) {
272
 
+    g_object_unref (priv->launcher);
273
 
+    priv->launcher = NULL;
274
 
+  }
275
 
   if (priv->login_timeouts) {
276
 
     g_hash_table_unref (priv->login_timeouts);
277
 
     priv->login_timeouts = NULL;
278
 
@@ -379,6 +426,10 @@
279
 
       G_CALLBACK (indicate_server_activate),
280
 
       manager);
281
 
 
282
 
+#ifdef HAVE_UNITY
283
 
+  priv->launcher = unity_launcher_entry_get_for_desktop_id ("empathy.desktop");
284
 
+#endif
285
 
+
286
 
   g_signal_connect (priv->event_manager, "event-added",
287
 
       G_CALLBACK (indicator_manager_event_added_cb),
288
 
       manager);
289