Merge lp:~xnox/ubuntu/raring/liferea/messaging-menu into lp:~xnox/ubuntu/raring/liferea/original
- Raring (13.04)
- messaging-menu
- Merge into original
Status: | Needs review | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~xnox/ubuntu/raring/liferea/messaging-menu | ||||
Merge into: | lp:~xnox/ubuntu/raring/liferea/original | ||||
Diff against target: |
1218 lines (+895/-101) 14 files modified
.pc/applied-patches (+1/-0) .pc/port-to-messaging-menu.patch/configure.ac (+181/-0) .pc/port-to-messaging-menu.patch/src/Makefile.am (+90/-0) .pc/port-to-messaging-menu.patch/src/ui/Makefile.am (+37/-0) .pc/port-to-messaging-menu.patch/src/ui/ui_indicator.c (+236/-0) configure.ac (+15/-15) debian/changelog (+6/-0) debian/control (+1/-2) debian/patches/port-to-messaging-menu.patch (+289/-0) debian/patches/series (+1/-0) debian/rules (+1/-1) src/Makefile.am (+2/-2) src/ui/Makefile.am (+1/-1) src/ui/ui_indicator.c (+34/-80) |
||||
To merge this branch: | bzr merge lp:~xnox/ubuntu/raring/liferea/messaging-menu | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lars Karlitski (community) | Needs Fixing | ||
Dimitri John Ledkov | Pending | ||
Review via email: mp+155161@code.launchpad.net |
Commit message
Description of the change
Dimitri John Ledkov (xnox) wrote : | # |
"the meat portion of this mess" =)
- 3. By Dimitri John Ledkov
-
use correct sprintf
Lars Karlitski (larsu) wrote : | # |
It is roughly correct, but only very roughly ;)
You don't get a callback when the user clicks the application name any more. Instead, the app is launched again through its desktop file. This means that all applications that support the messaging menu must be single instance (which liferea is). Thus, on_indicator_
I recommend against hooking on_indicator_
The arguments to on_indicator_
static void
on_indicator_
What did you intend to do here:
messaging_
Casting the MessagingMenuApp pointer to a string?! You probably want 'source_id' in there.
Dimitri John Ledkov (xnox) wrote : | # |
> It is roughly correct, but only very roughly ;)
>
> You don't get a callback when the user clicks the application name any more.
> Instead, the app is launched again through its desktop file. This means that
> all applications that support the messaging menu must be single instance
> (which liferea is). Thus, on_indicator_
>
Dead code -> gone! thanks.
> I recommend against hooking on_indicator_
> only to pass the node as user data (if you're doing it like that, you would
> also need to disconnect the signals in the handler). Instead, hook the
> function up once, and lookup the node through its id in on_indicator_
>
I see, makes sense. Will switch to using one handler to rule them all.
> The arguments to on_indicator_
>
> static void
> on_indicator_
> gpointer user_data)
>
Missing const added.
> What did you intend to do here:
>
> messaging_
> *)(indicator));
>
> Casting the MessagingMenuApp pointer to a string?! You probably want
> 'source_id' in there.
I can see how the terminology is confusing. So there is indicator_priv which has a GPtrArray of node->id's. Confusingly that GPtrArray is called "indicators" and the pointers to node->id's are "indicator", thus it actually is casting 'source_id' from a gpointer to char.
Does messaging menu "rate-limit" at the moment? Cause that indicator_priv is mostly to keep track of how many source_ids are displayed (no more than 6 at the moment)
Unmerged revisions
- 3. By Dimitri John Ledkov
-
use correct sprintf
- 2. By Dimitri John Ledkov
-
Port to messaging-menu. (LP: #1040259)
Preview Diff
1 | === modified file '.pc/applied-patches' | |||
2 | --- .pc/applied-patches 2013-03-25 02:10:13 +0000 | |||
3 | +++ .pc/applied-patches 2013-03-25 03:54:20 +0000 | |||
4 | @@ -5,3 +5,4 @@ | |||
5 | 5 | add_X-Ubuntu-Gettext-Domain | 5 | add_X-Ubuntu-Gettext-Domain |
6 | 6 | libunity.patch | 6 | libunity.patch |
7 | 7 | port-to-libindicate-0.7.patch | 7 | port-to-libindicate-0.7.patch |
8 | 8 | port-to-messaging-menu.patch | ||
9 | 8 | 9 | ||
10 | === added directory '.pc/port-to-messaging-menu.patch' | |||
11 | === added file '.pc/port-to-messaging-menu.patch/configure.ac' | |||
12 | --- .pc/port-to-messaging-menu.patch/configure.ac 1970-01-01 00:00:00 +0000 | |||
13 | +++ .pc/port-to-messaging-menu.patch/configure.ac 2013-03-25 03:54:20 +0000 | |||
14 | @@ -0,0 +1,181 @@ | |||
15 | 1 | dnl Process this file with autoconf to produce a configure script. | ||
16 | 2 | |||
17 | 3 | AC_INIT([liferea],[1.8.10],[liferea-devel@lists.sourceforge.net]) | ||
18 | 4 | AC_CANONICAL_HOST | ||
19 | 5 | AC_CONFIG_SRCDIR([src/feedlist.c]) | ||
20 | 6 | |||
21 | 7 | AC_CONFIG_HEADERS([config.h]) | ||
22 | 8 | AM_INIT_AUTOMAKE([1.11 foreign std-options -Wall -Werror]) | ||
23 | 9 | AM_SILENT_RULES([yes]) | ||
24 | 10 | |||
25 | 11 | dnl Needed for automake 1.12 | ||
26 | 12 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) | ||
27 | 13 | |||
28 | 14 | AC_PREREQ(2.59) | ||
29 | 15 | |||
30 | 16 | LT_INIT | ||
31 | 17 | IT_PROG_INTLTOOL([0.35.0]) | ||
32 | 18 | |||
33 | 19 | AC_PROG_CC | ||
34 | 20 | AM_PROG_CC_C_O | ||
35 | 21 | AC_HEADER_STDC | ||
36 | 22 | AC_PROG_INSTALL | ||
37 | 23 | AC_PROG_MAKE_SET | ||
38 | 24 | AC_SYS_LARGEFILE | ||
39 | 25 | |||
40 | 26 | AC_ARG_ENABLE(sm, AS_HELP_STRING([--disable-sm],[compile without X session management support]),,enable_sm=yes) | ||
41 | 27 | AC_ARG_ENABLE(libnotify, AS_HELP_STRING([--disable-libnotify],[compile without libnotify support]),,enable_libnotify=yes) | ||
42 | 28 | AC_ARG_ENABLE(libindicate, AS_HELP_STRING([--disable-libindicate],[compile without libindicate support]),,enable_libindicate=yes) | ||
43 | 29 | AC_ARG_ENABLE(libunity, AS_HELP_STRING([--disable-libunity],[compile without libunity support]),,enable_libunity=yes) | ||
44 | 30 | |||
45 | 31 | AC_CHECK_FUNCS([strsep]) | ||
46 | 32 | |||
47 | 33 | PKG_PROG_PKG_CONFIG() | ||
48 | 34 | |||
49 | 35 | dnl ####################################################################### | ||
50 | 36 | dnl # Check for X session management libs | ||
51 | 37 | dnl ####################################################################### | ||
52 | 38 | |||
53 | 39 | if test "x$enable_sm" = "xyes"; then | ||
54 | 40 | PKG_CHECK_MODULES([SM], [sm ice], [AC_DEFINE(USE_SM, 1, [Define if we're using X Session Management.])],[enable_sm=no]) | ||
55 | 41 | fi | ||
56 | 42 | |||
57 | 43 | dnl ********* | ||
58 | 44 | dnl libnotify | ||
59 | 45 | dnl ********* | ||
60 | 46 | |||
61 | 47 | if test "x$enable_libnotify" = "xyes"; then | ||
62 | 48 | PKG_CHECK_MODULES([LIBNOTIFY], libnotify >= 0.7,enable_libnotify=yes,enable_libnotify=no) | ||
63 | 49 | if test "x$enable_libnotify" = "xyes"; then | ||
64 | 50 | AC_DEFINE(HAVE_LIBNOTIFY, 4, [Define if libnotify.so.4 support is enabled]) | ||
65 | 51 | fi | ||
66 | 52 | if test "x$enable_libnotify" = "xno"; then | ||
67 | 53 | PKG_CHECK_MODULES([LIBNOTIFY], libnotify >= 0.3.2,enable_libnotify=yes,enable_libnotify=no) | ||
68 | 54 | if test "x$enable_libnotify" = "xyes"; then | ||
69 | 55 | AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if libnotify.so.1 support is enabled]) | ||
70 | 56 | fi | ||
71 | 57 | fi | ||
72 | 58 | AC_SUBST(LIBNOTIFY_CFLAGS) | ||
73 | 59 | AC_SUBST(LIBNOTIFY_LIBS) | ||
74 | 60 | else | ||
75 | 61 | enable_libnotify=no | ||
76 | 62 | fi | ||
77 | 63 | |||
78 | 64 | AM_CONDITIONAL(WITH_LIBNOTIFY, test "x$enable_libnotify" = "xyes") | ||
79 | 65 | |||
80 | 66 | dnl ********* | ||
81 | 67 | dnl libindicate | ||
82 | 68 | dnl ********* | ||
83 | 69 | |||
84 | 70 | if test "x$enable_libindicate" = "xyes"; then | ||
85 | 71 | PKG_CHECK_MODULES([LIBINDICATE], indicate-0.7 indicate-gtk-0.7,enable_libindicate=yes,enable_libindicate=no) | ||
86 | 72 | AC_SUBST(LIBINDICATE_CFLAGS) | ||
87 | 73 | AC_SUBST(LIBINDICATE_LIBS) | ||
88 | 74 | else | ||
89 | 75 | enable_libindicate=no | ||
90 | 76 | fi | ||
91 | 77 | |||
92 | 78 | if test "x$enable_libindicate" = "xyes"; then | ||
93 | 79 | AC_DEFINE(HAVE_LIBINDICATE, 1, [Define if libindicate support is enabled]) | ||
94 | 80 | fi | ||
95 | 81 | |||
96 | 82 | AM_CONDITIONAL(WITH_LIBINDICATE, test "x$enable_libindicate" = "xyes") | ||
97 | 83 | |||
98 | 84 | dnl ********* | ||
99 | 85 | dnl libunity | ||
100 | 86 | dnl ********* | ||
101 | 87 | |||
102 | 88 | if test "x$enable_libunity" = "xyes"; then | ||
103 | 89 | PKG_CHECK_MODULES([LIBUNITY], unity >= 3.4.2,enable_libunity=yes,enable_libunity=no) | ||
104 | 90 | AC_SUBST(LIBUNITY_CFLAGS) | ||
105 | 91 | AC_SUBST(LIBUNITY_LIBS) | ||
106 | 92 | else | ||
107 | 93 | enable_libunity=no | ||
108 | 94 | fi | ||
109 | 95 | |||
110 | 96 | if test "x$enable_libunity" = "xyes"; then | ||
111 | 97 | AC_DEFINE(HAVE_LIBUNITY, 1, [Define if libunity support is enabled]) | ||
112 | 98 | fi | ||
113 | 99 | |||
114 | 100 | AM_CONDITIONAL(WITH_LIBUNITY, test "x$enable_libunity" = "xyes") | ||
115 | 101 | |||
116 | 102 | dnl Checking for gconftool-2 | ||
117 | 103 | AC_PATH_PROG(GCONFTOOL, gconftool-2, no) | ||
118 | 104 | |||
119 | 105 | if test "x$GCONFTOOL" = xno; then | ||
120 | 106 | AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf]) | ||
121 | 107 | fi | ||
122 | 108 | |||
123 | 109 | AM_GCONF_SOURCE_2 | ||
124 | 110 | |||
125 | 111 | pkg_modules=" gtk+-2.0 >= 2.18.0 | ||
126 | 112 | glib-2.0 >= 2.24.0 | ||
127 | 113 | gio-2.0 >= 2.26.0 | ||
128 | 114 | pango >= 1.4.0 | ||
129 | 115 | gconf-2.0 >= 1.1.9 | ||
130 | 116 | libxml-2.0 >= 2.6.27 | ||
131 | 117 | libxslt >= 1.1.19 | ||
132 | 118 | sqlite3 >= 3.7.0 | ||
133 | 119 | gmodule-2.0 >= 2.0.0 | ||
134 | 120 | gthread-2.0 | ||
135 | 121 | libsoup-2.4 >= 2.28.2 | ||
136 | 122 | unique-1.0 | ||
137 | 123 | webkit-1.0 >= 1.2.2 | ||
138 | 124 | json-glib-1.0" | ||
139 | 125 | |||
140 | 126 | PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) | ||
141 | 127 | |||
142 | 128 | AC_SUBST(PACKAGE_CFLAGS) | ||
143 | 129 | AC_SUBST(PACKAGE_LIBS) | ||
144 | 130 | |||
145 | 131 | uname=`uname` | ||
146 | 132 | AC_DEFINE_UNQUOTED(OS, $uname, [defines a OS version string, used for OS specific code]) | ||
147 | 133 | AC_DEFINE_UNQUOTED(OSNAME, "$uname", [defines a OS version string, used for the user agent string]) | ||
148 | 134 | AC_MSG_RESULT(user agent OS = $uname) | ||
149 | 135 | |||
150 | 136 | AM_GLIB_GNU_GETTEXT | ||
151 | 137 | |||
152 | 138 | GETTEXT_PACKAGE=liferea | ||
153 | 139 | AC_SUBST(GETTEXT_PACKAGE) | ||
154 | 140 | AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["${GETTEXT_PACKAGE}"], [gettext domain]) | ||
155 | 141 | |||
156 | 142 | |||
157 | 143 | AC_CONFIG_FILES([ | ||
158 | 144 | Makefile | ||
159 | 145 | src/Makefile | ||
160 | 146 | src/webkit/Makefile | ||
161 | 147 | src/parsers/Makefile | ||
162 | 148 | src/fl_sources/Makefile | ||
163 | 149 | src/notification/Makefile | ||
164 | 150 | src/ui/Makefile | ||
165 | 151 | doc/Makefile | ||
166 | 152 | doc/html/Makefile | ||
167 | 153 | xslt/Makefile | ||
168 | 154 | man/Makefile | ||
169 | 155 | man/pl/Makefile | ||
170 | 156 | pixmaps/Makefile | ||
171 | 157 | pixmaps/16x16/Makefile | ||
172 | 158 | pixmaps/22x22/Makefile | ||
173 | 159 | pixmaps/24x24/Makefile | ||
174 | 160 | pixmaps/32x32/Makefile | ||
175 | 161 | pixmaps/48x48/Makefile | ||
176 | 162 | pixmaps/scalable/Makefile | ||
177 | 163 | opml/Makefile | ||
178 | 164 | glade/Makefile | ||
179 | 165 | po/Makefile.in | ||
180 | 166 | src/liferea-add-feed | ||
181 | 167 | ]) | ||
182 | 168 | AC_OUTPUT | ||
183 | 169 | |||
184 | 170 | echo | ||
185 | 171 | echo "$PACKAGE $VERSION" | ||
186 | 172 | echo | ||
187 | 173 | echo "Use X Session Management........ : $enable_sm" | ||
188 | 174 | echo "Use libnotify................... : $enable_libnotify" | ||
189 | 175 | echo "Use libindicate................. : $enable_libindicate" | ||
190 | 176 | echo "Use libunity.................... : $enable_libunity" | ||
191 | 177 | echo | ||
192 | 178 | eval eval echo Liferea will be installed in $bindir. | ||
193 | 179 | echo | ||
194 | 180 | echo configure complete, now type \'make\' | ||
195 | 181 | echo | ||
196 | 0 | 182 | ||
197 | === added directory '.pc/port-to-messaging-menu.patch/src' | |||
198 | === added file '.pc/port-to-messaging-menu.patch/src/Makefile.am' | |||
199 | --- .pc/port-to-messaging-menu.patch/src/Makefile.am 1970-01-01 00:00:00 +0000 | |||
200 | +++ .pc/port-to-messaging-menu.patch/src/Makefile.am 2013-03-25 03:54:20 +0000 | |||
201 | @@ -0,0 +1,90 @@ | |||
202 | 1 | ## Process this file with automake to produce Makefile.in | ||
203 | 2 | |||
204 | 3 | SUBDIRS = parsers notification ui fl_sources webkit . | ||
205 | 4 | |||
206 | 5 | AM_CPPFLAGS = \ | ||
207 | 6 | -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ | ||
208 | 7 | -DPACKAGE_LIB_DIR=\""$(pkglibdir)"\" \ | ||
209 | 8 | -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ | ||
210 | 9 | -DBIN_DIR=\""$(bindir)"\" \ | ||
211 | 10 | -I$(top_srcdir)/src \ | ||
212 | 11 | $(PACKAGE_CFLAGS) \ | ||
213 | 12 | $(SM_CFLAGS) | ||
214 | 13 | |||
215 | 14 | bin_PROGRAMS = liferea | ||
216 | 15 | bin_SCRIPTS = liferea-add-feed | ||
217 | 16 | |||
218 | 17 | liferea_SOURCES = \ | ||
219 | 18 | browser.c browser.h \ | ||
220 | 19 | comments.c comments.h \ | ||
221 | 20 | common.c common.h \ | ||
222 | 21 | conf.c conf.h \ | ||
223 | 22 | date.c date.h \ | ||
224 | 23 | db.c db.h \ | ||
225 | 24 | dbus.c dbus.h \ | ||
226 | 25 | debug.c debug.h \ | ||
227 | 26 | e-date.c e-date.h \ | ||
228 | 27 | enclosure.c enclosure.h \ | ||
229 | 28 | export.c export.h \ | ||
230 | 29 | favicon.c favicon.h \ | ||
231 | 30 | feed.c feed.h \ | ||
232 | 31 | feed_parser.c feed_parser.h \ | ||
233 | 32 | feedlist.c feedlist.h \ | ||
234 | 33 | folder.c folder.h \ | ||
235 | 34 | html.c html.h \ | ||
236 | 35 | htmlview.c htmlview.h \ | ||
237 | 36 | item.c item.h \ | ||
238 | 37 | item_loader.c item_loader.h \ | ||
239 | 38 | item_state.c item_state.h \ | ||
240 | 39 | itemset.c itemset.h \ | ||
241 | 40 | itemlist.c itemlist.h \ | ||
242 | 41 | json.c json.h \ | ||
243 | 42 | metadata.c metadata.h \ | ||
244 | 43 | migrate.c migrate.h \ | ||
245 | 44 | net.c net.h \ | ||
246 | 45 | net_monitor.c net_monitor.h \ | ||
247 | 46 | newsbin.c newsbin.h \ | ||
248 | 47 | node.c node.h \ | ||
249 | 48 | node_type.c node_type.h \ | ||
250 | 49 | node_view.h \ | ||
251 | 50 | render.c render.h \ | ||
252 | 51 | rule.c rule.h \ | ||
253 | 52 | social.c social.h \ | ||
254 | 53 | subscription.c subscription.h \ | ||
255 | 54 | subscription_type.h \ | ||
256 | 55 | update.c update.h \ | ||
257 | 56 | main.c \ | ||
258 | 57 | vfolder.c vfolder.h \ | ||
259 | 58 | vfolder_loader.c vfolder_loader.h \ | ||
260 | 59 | xml.c xml.h | ||
261 | 60 | |||
262 | 61 | liferea_LDADD = parsers/libliparsers.a \ | ||
263 | 62 | fl_sources/libliflsources.a \ | ||
264 | 63 | ui/libliui.a \ | ||
265 | 64 | webkit/libwebkit.a \ | ||
266 | 65 | $(SYNC_LIB) \ | ||
267 | 66 | $(PACKAGE_LIBS) $(SM_LIBS) \ | ||
268 | 67 | $(INTLLIBS) $(AVAHI_LIBS) \ | ||
269 | 68 | $(WEBKIT_LIBS) $(LIBNOTIFY_LIBS) | ||
270 | 69 | |||
271 | 70 | EXTRA_DIST = $(srcdir)/liferea-add-feed.in | ||
272 | 71 | DISTCLEANFILES = $(srcdir)/liferea-add-feed | ||
273 | 72 | AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = liferea-add-feed | ||
274 | 73 | |||
275 | 74 | if WITH_LIBNOTIFY | ||
276 | 75 | |||
277 | 76 | liferea_LDADD += notification/libnotify.a $(LIBNOTIFY_LIBS) | ||
278 | 77 | |||
279 | 78 | endif | ||
280 | 79 | |||
281 | 80 | if WITH_LIBINDICATE | ||
282 | 81 | |||
283 | 82 | liferea_LDADD += $(LIBINDICATE_LIBS) | ||
284 | 83 | |||
285 | 84 | endif | ||
286 | 85 | |||
287 | 86 | if WITH_LIBUNITY | ||
288 | 87 | |||
289 | 88 | liferea_LDADD += $(LIBUNITY_LIBS) | ||
290 | 89 | |||
291 | 90 | endif | ||
292 | 0 | 91 | ||
293 | === added directory '.pc/port-to-messaging-menu.patch/src/ui' | |||
294 | === added file '.pc/port-to-messaging-menu.patch/src/ui/Makefile.am' | |||
295 | --- .pc/port-to-messaging-menu.patch/src/ui/Makefile.am 1970-01-01 00:00:00 +0000 | |||
296 | +++ .pc/port-to-messaging-menu.patch/src/ui/Makefile.am 2013-03-25 03:54:20 +0000 | |||
297 | @@ -0,0 +1,37 @@ | |||
298 | 1 | ## Process this file with automake to produce Makefile.in | ||
299 | 2 | |||
300 | 3 | AM_CPPFLAGS = \ | ||
301 | 4 | -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ | ||
302 | 5 | -DPACKAGE_LIB_DIR=\""$(pkglibdir)"\" \ | ||
303 | 6 | -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ | ||
304 | 7 | -I$(top_srcdir)/src | ||
305 | 8 | |||
306 | 9 | noinst_LIBRARIES = libliui.a | ||
307 | 10 | |||
308 | 11 | libliui_a_CFLAGS = $(PACKAGE_CFLAGS) $(LIBINDICATE_CFLAGS) $(LIBUNITY_CFLAGS) | ||
309 | 12 | libliui_a_SOURCES = \ | ||
310 | 13 | auth_dialog.c auth_dialog.h \ | ||
311 | 14 | browser_tabs.c browser_tabs.h \ | ||
312 | 15 | enclosure_list_view.c enclosure_list_view.h \ | ||
313 | 16 | feed_list_view.c feed_list_view.h \ | ||
314 | 17 | icons.c icons.h \ | ||
315 | 18 | item_list_view.c item_list_view.h \ | ||
316 | 19 | itemview.c itemview.h \ | ||
317 | 20 | liferea_dialog.c liferea_dialog.h \ | ||
318 | 21 | liferea_htmlview.c liferea_htmlview.h \ | ||
319 | 22 | liferea_shell.c liferea_shell.h \ | ||
320 | 23 | popup_menu.c popup_menu.h \ | ||
321 | 24 | rule_editor.c rule_editor.h \ | ||
322 | 25 | search_dialog.c search_dialog.h \ | ||
323 | 26 | search_folder_dialog.c search_folder_dialog.h \ | ||
324 | 27 | subscription_dialog.c subscription_dialog.h \ | ||
325 | 28 | ui_common.c ui_common.h \ | ||
326 | 29 | ui_dnd.c ui_dnd.h \ | ||
327 | 30 | ui_folder.c ui_folder.h \ | ||
328 | 31 | ui_indicator.c ui_indicator.h \ | ||
329 | 32 | ui_node.c ui_node.h \ | ||
330 | 33 | ui_prefs.c ui_prefs.h \ | ||
331 | 34 | ui_session.c ui_session.h \ | ||
332 | 35 | ui_tray.c ui_tray.h \ | ||
333 | 36 | ui_unity.c ui_unity.h \ | ||
334 | 37 | ui_update.c ui_update.h | ||
335 | 0 | 38 | ||
336 | === added file '.pc/port-to-messaging-menu.patch/src/ui/ui_indicator.c' | |||
337 | --- .pc/port-to-messaging-menu.patch/src/ui/ui_indicator.c 1970-01-01 00:00:00 +0000 | |||
338 | +++ .pc/port-to-messaging-menu.patch/src/ui/ui_indicator.c 2013-03-25 03:54:20 +0000 | |||
339 | @@ -0,0 +1,236 @@ | |||
340 | 1 | /* | ||
341 | 2 | * @file ui_indicator.c libindicate support | ||
342 | 3 | * | ||
343 | 4 | * Copyright (C) 2010-2011 Maia Kozheva <sikon@ubuntu.com> | ||
344 | 5 | * | ||
345 | 6 | * This program is free software; you can redistribute it and/or modify | ||
346 | 7 | * it under the terms of the GNU General Public License as published by | ||
347 | 8 | * the Free Software Foundation; either version 2 of the License, or | ||
348 | 9 | * (at your option) any later version. | ||
349 | 10 | * | ||
350 | 11 | * This program is distributed in the hope that it will be useful, | ||
351 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
352 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
353 | 14 | * GNU Library General Public License for more details. | ||
354 | 15 | * | ||
355 | 16 | * You should have received a copy of the GNU General Public License | ||
356 | 17 | * along with this program; if not, write to the Free Software | ||
357 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA | ||
358 | 19 | */ | ||
359 | 20 | |||
360 | 21 | #ifdef HAVE_CONFIG_H | ||
361 | 22 | # include <config.h> | ||
362 | 23 | #endif | ||
363 | 24 | |||
364 | 25 | #include "ui_indicator.h" | ||
365 | 26 | |||
366 | 27 | #ifdef HAVE_LIBINDICATE | ||
367 | 28 | |||
368 | 29 | #include <gtk/gtk.h> | ||
369 | 30 | #include <libindicate/server.h> | ||
370 | 31 | #include <libindicate/indicator.h> | ||
371 | 32 | #include <libindicate-gtk/indicator.h> | ||
372 | 33 | #include <libindicate/interests.h> | ||
373 | 34 | #include "feedlist.h" | ||
374 | 35 | #include "feed_list_view.h" | ||
375 | 36 | #include "liferea_shell.h" | ||
376 | 37 | #include "ui_tray.h" | ||
377 | 38 | #include "vfolder.h" | ||
378 | 39 | |||
379 | 40 | /* The maximum number of feeds to display in the indicator menu. */ | ||
380 | 41 | #define MAX_INDICATORS 6 | ||
381 | 42 | /* Whether Liferea should set the indicator menu to attention | ||
382 | 43 | status whenever new feed items are downloaded. Since news feeds | ||
383 | 44 | do not typically require the user's urgent attention, unlike | ||
384 | 45 | mail and IM messages, this is set to false by default. */ | ||
385 | 46 | #define SET_DRAW_ATTENTION FALSE | ||
386 | 47 | |||
387 | 48 | static struct indicator_priv { | ||
388 | 49 | IndicateServer *server; | ||
389 | 50 | gboolean visible; | ||
390 | 51 | GPtrArray *indicators; | ||
391 | 52 | } *indicator_priv = NULL; | ||
392 | 53 | |||
393 | 54 | /* | ||
394 | 55 | The desktop file to initialize the indicator menu with. Resolves to | ||
395 | 56 | a string like "/usr/share/applications/liferea.desktop". | ||
396 | 57 | */ | ||
397 | 58 | static const char *DESKTOP_FILE = PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "applications" G_DIR_SEPARATOR_S "liferea.desktop"; | ||
398 | 59 | |||
399 | 60 | static void | ||
400 | 61 | remove_all_indicators () { | ||
401 | 62 | g_ptr_array_set_size (indicator_priv->indicators, 0); | ||
402 | 63 | } | ||
403 | 64 | |||
404 | 65 | /* | ||
405 | 66 | Called when the main "Liferea" entry in the indicator menu is clicked. | ||
406 | 67 | */ | ||
407 | 68 | static void | ||
408 | 69 | on_indicator_server_clicked (IndicateServer *server, gchar *type, gpointer user_data) | ||
409 | 70 | { | ||
410 | 71 | liferea_shell_present (); | ||
411 | 72 | remove_all_indicators (); | ||
412 | 73 | } | ||
413 | 74 | |||
414 | 75 | /* | ||
415 | 76 | Called when the indicator container applet is shown. | ||
416 | 77 | */ | ||
417 | 78 | static void | ||
418 | 79 | on_indicator_interest_added (IndicateServer *server, guint interest, gpointer user_data) | ||
419 | 80 | { | ||
420 | 81 | if (interest != INDICATE_INTEREST_SERVER_SIGNAL) | ||
421 | 82 | return; | ||
422 | 83 | |||
423 | 84 | indicator_priv->visible = TRUE; | ||
424 | 85 | ui_tray_update (); | ||
425 | 86 | } | ||
426 | 87 | |||
427 | 88 | /* | ||
428 | 89 | Called when the indicator container applet is hidden. | ||
429 | 90 | */ | ||
430 | 91 | static void | ||
431 | 92 | on_indicator_interest_removed (IndicateServer *server, guint interest, gpointer user_data) | ||
432 | 93 | { | ||
433 | 94 | if (interest != INDICATE_INTEREST_SERVER_SIGNAL) | ||
434 | 95 | return; | ||
435 | 96 | |||
436 | 97 | indicator_priv->visible = FALSE; | ||
437 | 98 | ui_tray_update (); | ||
438 | 99 | } | ||
439 | 100 | |||
440 | 101 | /* | ||
441 | 102 | Called when the indicator menu entry for a specific feed | ||
442 | 103 | is clicked, meaning Liferea should switch to that feed. | ||
443 | 104 | */ | ||
444 | 105 | static void | ||
445 | 106 | on_indicator_clicked (IndicateIndicator *indicator, guint timestamp, gpointer user_data) | ||
446 | 107 | { | ||
447 | 108 | feed_list_view_select ((nodePtr) user_data); | ||
448 | 109 | liferea_shell_present (); | ||
449 | 110 | remove_all_indicators (); | ||
450 | 111 | } | ||
451 | 112 | |||
452 | 113 | static void | ||
453 | 114 | destroy_indicator (gpointer indicator) | ||
454 | 115 | { | ||
455 | 116 | if (indicator_priv->server == NULL || indicator == NULL) | ||
456 | 117 | return; | ||
457 | 118 | |||
458 | 119 | indicate_server_remove_indicator (indicator_priv->server, INDICATE_INDICATOR(indicator)); | ||
459 | 120 | g_object_unref (G_OBJECT (indicator)); | ||
460 | 121 | } | ||
461 | 122 | |||
462 | 123 | void | ||
463 | 124 | ui_indicator_init () | ||
464 | 125 | { | ||
465 | 126 | if (indicator_priv != NULL) | ||
466 | 127 | return; | ||
467 | 128 | |||
468 | 129 | indicator_priv = g_new0 (struct indicator_priv, 1); | ||
469 | 130 | indicator_priv->visible = FALSE; | ||
470 | 131 | indicator_priv->indicators = g_ptr_array_new_with_free_func (destroy_indicator); | ||
471 | 132 | |||
472 | 133 | indicator_priv->server = indicate_server_ref_default(); | ||
473 | 134 | indicate_server_set_type (indicator_priv->server, "message.im"); | ||
474 | 135 | indicate_server_set_desktop_file (indicator_priv->server, DESKTOP_FILE); | ||
475 | 136 | |||
476 | 137 | g_signal_connect (G_OBJECT (indicator_priv->server), "server-display", G_CALLBACK (on_indicator_server_clicked), NULL); | ||
477 | 138 | g_signal_connect (G_OBJECT (indicator_priv->server), "interest-added", G_CALLBACK (on_indicator_interest_added), NULL); | ||
478 | 139 | g_signal_connect (G_OBJECT (indicator_priv->server), "interest-removed", G_CALLBACK (on_indicator_interest_removed), NULL); | ||
479 | 140 | |||
480 | 141 | indicate_server_show (indicator_priv->server); | ||
481 | 142 | ui_indicator_update (); | ||
482 | 143 | } | ||
483 | 144 | |||
484 | 145 | void | ||
485 | 146 | ui_indicator_destroy () | ||
486 | 147 | { | ||
487 | 148 | if (indicator_priv == NULL) | ||
488 | 149 | return; | ||
489 | 150 | |||
490 | 151 | remove_all_indicators (); | ||
491 | 152 | g_object_unref (indicator_priv->server); | ||
492 | 153 | indicator_priv->server = NULL; | ||
493 | 154 | g_ptr_array_free (indicator_priv->indicators, TRUE); | ||
494 | 155 | g_free (indicator_priv); | ||
495 | 156 | indicator_priv = NULL; | ||
496 | 157 | } | ||
497 | 158 | |||
498 | 159 | static void | ||
499 | 160 | add_node_indicator (nodePtr node) | ||
500 | 161 | { | ||
501 | 162 | IndicateIndicator *indicator; | ||
502 | 163 | GdkPixbuf *pixbuf; | ||
503 | 164 | gchar count[10]; | ||
504 | 165 | |||
505 | 166 | if (indicator_priv->indicators->len >= MAX_INDICATORS) | ||
506 | 167 | return; | ||
507 | 168 | |||
508 | 169 | if (IS_VFOLDER(node) || g_slist_length (node->children) > 0) { | ||
509 | 170 | /* Not a feed - walk children and do nothing more */ | ||
510 | 171 | node_foreach_child (node, add_node_indicator); | ||
511 | 172 | return; | ||
512 | 173 | } | ||
513 | 174 | |||
514 | 175 | /* Skip feeds with no unread items */ | ||
515 | 176 | if (node->unreadCount == 0) | ||
516 | 177 | return; | ||
517 | 178 | |||
518 | 179 | indicator = indicate_indicator_new_with_server (indicator_priv->server); | ||
519 | 180 | g_signal_connect (indicator, "user-display", G_CALLBACK (on_indicator_clicked), node); | ||
520 | 181 | |||
521 | 182 | /* load favicon */ | ||
522 | 183 | pixbuf = gdk_pixbuf_new_from_file (node->iconFile, NULL); | ||
523 | 184 | |||
524 | 185 | /* display favicon */ | ||
525 | 186 | indicate_gtk_indicator_set_property_icon (indicator, "icon", pixbuf); | ||
526 | 187 | gdk_pixbuf_unref (pixbuf); | ||
527 | 188 | |||
528 | 189 | sprintf (count, "%u", node->unreadCount); | ||
529 | 190 | indicate_indicator_set_property (indicator, "name", node->title); | ||
530 | 191 | indicate_indicator_set_property (indicator, "count", count); | ||
531 | 192 | #if SET_DRAW_ATTENTION | ||
532 | 193 | indicate_indicator_set_property_bool (indicator, "draw-attention", TRUE); | ||
533 | 194 | #endif | ||
534 | 195 | g_ptr_array_add (indicator_priv->indicators, indicator); | ||
535 | 196 | } | ||
536 | 197 | |||
537 | 198 | void | ||
538 | 199 | ui_indicator_update () | ||
539 | 200 | { | ||
540 | 201 | guint index; | ||
541 | 202 | |||
542 | 203 | /* Do not update indicators if the user is interacting with the main window */ | ||
543 | 204 | if (!indicator_priv || gtk_window_is_active (GTK_WINDOW (liferea_shell_get_window ()))) | ||
544 | 205 | return; | ||
545 | 206 | |||
546 | 207 | /* Remove all previous indicators from the menu */ | ||
547 | 208 | remove_all_indicators (); | ||
548 | 209 | /* ...then walk the tree and add an indicator for each unread feed */ | ||
549 | 210 | feedlist_foreach (add_node_indicator); | ||
550 | 211 | |||
551 | 212 | /* revert order of items */ | ||
552 | 213 | for (index = indicator_priv->indicators->len; index > 0; index--) | ||
553 | 214 | indicate_indicator_show (g_ptr_array_index (indicator_priv->indicators, index - 1)); | ||
554 | 215 | } | ||
555 | 216 | |||
556 | 217 | gboolean | ||
557 | 218 | ui_indicator_is_visible () | ||
558 | 219 | { | ||
559 | 220 | return indicator_priv && indicator_priv->visible; | ||
560 | 221 | } | ||
561 | 222 | |||
562 | 223 | #else | ||
563 | 224 | |||
564 | 225 | /* | ||
565 | 226 | If Liferea is compiled without libindicate support, all indicator | ||
566 | 227 | support functions do nothing. The application behaves as if there | ||
567 | 228 | is no indicator applet present. | ||
568 | 229 | */ | ||
569 | 230 | |||
570 | 231 | void ui_indicator_init () {} | ||
571 | 232 | void ui_indicator_destroy () {} | ||
572 | 233 | void ui_indicator_update () {} | ||
573 | 234 | gboolean ui_indicator_is_visible () { return FALSE; } | ||
574 | 235 | |||
575 | 236 | #endif /* HAVE_LIBINDICATE */ | ||
576 | 0 | 237 | ||
577 | === modified file 'configure.ac' | |||
578 | --- configure.ac 2013-03-25 02:10:13 +0000 | |||
579 | +++ configure.ac 2013-03-25 03:54:20 +0000 | |||
580 | @@ -25,7 +25,7 @@ | |||
581 | 25 | 25 | ||
582 | 26 | AC_ARG_ENABLE(sm, AS_HELP_STRING([--disable-sm],[compile without X session management support]),,enable_sm=yes) | 26 | AC_ARG_ENABLE(sm, AS_HELP_STRING([--disable-sm],[compile without X session management support]),,enable_sm=yes) |
583 | 27 | AC_ARG_ENABLE(libnotify, AS_HELP_STRING([--disable-libnotify],[compile without libnotify support]),,enable_libnotify=yes) | 27 | AC_ARG_ENABLE(libnotify, AS_HELP_STRING([--disable-libnotify],[compile without libnotify support]),,enable_libnotify=yes) |
585 | 28 | AC_ARG_ENABLE(libindicate, AS_HELP_STRING([--disable-libindicate],[compile without libindicate support]),,enable_libindicate=yes) | 28 | AC_ARG_ENABLE(messaging-menu, AS_HELP_STRING([--disable-messaging-menu],[compile without messaging-menu support]),,enable_messaging_menu=yes) |
586 | 29 | AC_ARG_ENABLE(libunity, AS_HELP_STRING([--disable-libunity],[compile without libunity support]),,enable_libunity=yes) | 29 | AC_ARG_ENABLE(libunity, AS_HELP_STRING([--disable-libunity],[compile without libunity support]),,enable_libunity=yes) |
587 | 30 | 30 | ||
588 | 31 | AC_CHECK_FUNCS([strsep]) | 31 | AC_CHECK_FUNCS([strsep]) |
589 | @@ -64,22 +64,22 @@ | |||
590 | 64 | AM_CONDITIONAL(WITH_LIBNOTIFY, test "x$enable_libnotify" = "xyes") | 64 | AM_CONDITIONAL(WITH_LIBNOTIFY, test "x$enable_libnotify" = "xyes") |
591 | 65 | 65 | ||
592 | 66 | dnl ********* | 66 | dnl ********* |
594 | 67 | dnl libindicate | 67 | dnl messaging-menu |
595 | 68 | dnl ********* | 68 | dnl ********* |
596 | 69 | 69 | ||
601 | 70 | if test "x$enable_libindicate" = "xyes"; then | 70 | if test "x$enable_messaging_menu" = "xyes"; then |
602 | 71 | PKG_CHECK_MODULES([LIBINDICATE], indicate-0.7 indicate-gtk-0.7,enable_libindicate=yes,enable_libindicate=no) | 71 | PKG_CHECK_MODULES([MESSAGING_MENU], messaging-menu,enable_messaging_menu=yes,enable_messaging_menu=no) |
603 | 72 | AC_SUBST(LIBINDICATE_CFLAGS) | 72 | AC_SUBST(MESSAGING_MENU_CFLAGS) |
604 | 73 | AC_SUBST(LIBINDICATE_LIBS) | 73 | AC_SUBST(MESSAGING_MENU_LIBS) |
605 | 74 | else | 74 | else |
614 | 75 | enable_libindicate=no | 75 | enable_messaging_menu=no |
615 | 76 | fi | 76 | fi |
616 | 77 | 77 | ||
617 | 78 | if test "x$enable_libindicate" = "xyes"; then | 78 | if test "x$enable_messaging_menu" = "xyes"; then |
618 | 79 | AC_DEFINE(HAVE_LIBINDICATE, 1, [Define if libindicate support is enabled]) | 79 | AC_DEFINE(HAVE_MESSAGING_MENU, 1, [Define if messaging-menu support is enabled]) |
619 | 80 | fi | 80 | fi |
620 | 81 | 81 | ||
621 | 82 | AM_CONDITIONAL(WITH_LIBINDICATE, test "x$enable_libindicate" = "xyes") | 82 | AM_CONDITIONAL(WITH_MESSAGING_MENU, test "x$enable_messaging_menu" = "xyes") |
622 | 83 | 83 | ||
623 | 84 | dnl ********* | 84 | dnl ********* |
624 | 85 | dnl libunity | 85 | dnl libunity |
625 | @@ -172,7 +172,7 @@ | |||
626 | 172 | echo | 172 | echo |
627 | 173 | echo "Use X Session Management........ : $enable_sm" | 173 | echo "Use X Session Management........ : $enable_sm" |
628 | 174 | echo "Use libnotify................... : $enable_libnotify" | 174 | echo "Use libnotify................... : $enable_libnotify" |
630 | 175 | echo "Use libindicate................. : $enable_libindicate" | 175 | echo "Use messaging-menu.............. : $enable_messaging_menu" |
631 | 176 | echo "Use libunity.................... : $enable_libunity" | 176 | echo "Use libunity.................... : $enable_libunity" |
632 | 177 | echo | 177 | echo |
633 | 178 | eval eval echo Liferea will be installed in $bindir. | 178 | eval eval echo Liferea will be installed in $bindir. |
634 | 179 | 179 | ||
635 | === modified file 'debian/changelog' | |||
636 | --- debian/changelog 2013-03-25 02:10:13 +0000 | |||
637 | +++ debian/changelog 2013-03-25 03:54:20 +0000 | |||
638 | @@ -1,3 +1,9 @@ | |||
639 | 1 | liferea (1.8.10-0ubuntu2) UNRELEASED; urgency=low | ||
640 | 2 | |||
641 | 3 | * Port to messaging-menu. (LP: #1040259) | ||
642 | 4 | |||
643 | 5 | -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> Mon, 25 Mar 2013 02:41:34 +0000 | ||
644 | 6 | |||
645 | 1 | liferea (1.8.10-0ubuntu1) raring; urgency=low | 7 | liferea (1.8.10-0ubuntu1) raring; urgency=low |
646 | 2 | 8 | ||
647 | 3 | * New upstream release. | 9 | * New upstream release. |
648 | 4 | 10 | ||
649 | === modified file 'debian/control' | |||
650 | --- debian/control 2013-03-25 02:10:13 +0000 | |||
651 | +++ debian/control 2013-03-25 03:54:20 +0000 | |||
652 | @@ -21,8 +21,7 @@ | |||
653 | 21 | intltool, | 21 | intltool, |
654 | 22 | libicu-dev, | 22 | libicu-dev, |
655 | 23 | libx11-dev, | 23 | libx11-dev, |
658 | 24 | libindicate-dev (>= 0.6.90), | 24 | libmessaging-menu-dev, |
657 | 25 | libindicate-gtk-dev (>= 0.6.90), | ||
659 | 26 | dh-autoreconf, | 25 | dh-autoreconf, |
660 | 27 | libunity-dev (>= 5.0.0), | 26 | libunity-dev (>= 5.0.0), |
661 | 28 | libice-dev, | 27 | libice-dev, |
662 | 29 | 28 | ||
663 | === added file 'debian/patches/port-to-messaging-menu.patch' | |||
664 | --- debian/patches/port-to-messaging-menu.patch 1970-01-01 00:00:00 +0000 | |||
665 | +++ debian/patches/port-to-messaging-menu.patch 2013-03-25 03:54:20 +0000 | |||
666 | @@ -0,0 +1,289 @@ | |||
667 | 1 | Description: port to messaging menu | ||
668 | 2 | Author: Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> | ||
669 | 3 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/1040259 | ||
670 | 4 | |||
671 | 5 | --- a/configure.ac | ||
672 | 6 | +++ b/configure.ac | ||
673 | 7 | @@ -25,7 +25,7 @@ | ||
674 | 8 | |||
675 | 9 | AC_ARG_ENABLE(sm, AS_HELP_STRING([--disable-sm],[compile without X session management support]),,enable_sm=yes) | ||
676 | 10 | AC_ARG_ENABLE(libnotify, AS_HELP_STRING([--disable-libnotify],[compile without libnotify support]),,enable_libnotify=yes) | ||
677 | 11 | -AC_ARG_ENABLE(libindicate, AS_HELP_STRING([--disable-libindicate],[compile without libindicate support]),,enable_libindicate=yes) | ||
678 | 12 | +AC_ARG_ENABLE(messaging-menu, AS_HELP_STRING([--disable-messaging-menu],[compile without messaging-menu support]),,enable_messaging_menu=yes) | ||
679 | 13 | AC_ARG_ENABLE(libunity, AS_HELP_STRING([--disable-libunity],[compile without libunity support]),,enable_libunity=yes) | ||
680 | 14 | |||
681 | 15 | AC_CHECK_FUNCS([strsep]) | ||
682 | 16 | @@ -64,22 +64,22 @@ | ||
683 | 17 | AM_CONDITIONAL(WITH_LIBNOTIFY, test "x$enable_libnotify" = "xyes") | ||
684 | 18 | |||
685 | 19 | dnl ********* | ||
686 | 20 | -dnl libindicate | ||
687 | 21 | +dnl messaging-menu | ||
688 | 22 | dnl ********* | ||
689 | 23 | |||
690 | 24 | -if test "x$enable_libindicate" = "xyes"; then | ||
691 | 25 | - PKG_CHECK_MODULES([LIBINDICATE], indicate-0.7 indicate-gtk-0.7,enable_libindicate=yes,enable_libindicate=no) | ||
692 | 26 | - AC_SUBST(LIBINDICATE_CFLAGS) | ||
693 | 27 | - AC_SUBST(LIBINDICATE_LIBS) | ||
694 | 28 | +if test "x$enable_messaging_menu" = "xyes"; then | ||
695 | 29 | + PKG_CHECK_MODULES([MESSAGING_MENU], messaging-menu,enable_messaging_menu=yes,enable_messaging_menu=no) | ||
696 | 30 | + AC_SUBST(MESSAGING_MENU_CFLAGS) | ||
697 | 31 | + AC_SUBST(MESSAGING_MENU_LIBS) | ||
698 | 32 | else | ||
699 | 33 | - enable_libindicate=no | ||
700 | 34 | + enable_messaging_menu=no | ||
701 | 35 | fi | ||
702 | 36 | |||
703 | 37 | -if test "x$enable_libindicate" = "xyes"; then | ||
704 | 38 | - AC_DEFINE(HAVE_LIBINDICATE, 1, [Define if libindicate support is enabled]) | ||
705 | 39 | +if test "x$enable_messaging_menu" = "xyes"; then | ||
706 | 40 | + AC_DEFINE(HAVE_MESSAGING_MENU, 1, [Define if messaging-menu support is enabled]) | ||
707 | 41 | fi | ||
708 | 42 | |||
709 | 43 | -AM_CONDITIONAL(WITH_LIBINDICATE, test "x$enable_libindicate" = "xyes") | ||
710 | 44 | +AM_CONDITIONAL(WITH_MESSAGING_MENU, test "x$enable_messaging_menu" = "xyes") | ||
711 | 45 | |||
712 | 46 | dnl ********* | ||
713 | 47 | dnl libunity | ||
714 | 48 | @@ -172,7 +172,7 @@ | ||
715 | 49 | echo | ||
716 | 50 | echo "Use X Session Management........ : $enable_sm" | ||
717 | 51 | echo "Use libnotify................... : $enable_libnotify" | ||
718 | 52 | -echo "Use libindicate................. : $enable_libindicate" | ||
719 | 53 | +echo "Use messaging-menu.............. : $enable_messaging_menu" | ||
720 | 54 | echo "Use libunity.................... : $enable_libunity" | ||
721 | 55 | echo | ||
722 | 56 | eval eval echo Liferea will be installed in $bindir. | ||
723 | 57 | --- a/src/Makefile.am | ||
724 | 58 | +++ b/src/Makefile.am | ||
725 | 59 | @@ -77,9 +77,9 @@ | ||
726 | 60 | |||
727 | 61 | endif | ||
728 | 62 | |||
729 | 63 | -if WITH_LIBINDICATE | ||
730 | 64 | +if WITH_MESSAGING_MENU | ||
731 | 65 | |||
732 | 66 | -liferea_LDADD += $(LIBINDICATE_LIBS) | ||
733 | 67 | +liferea_LDADD += $(MESSAGING_MENU_LIBS) | ||
734 | 68 | |||
735 | 69 | endif | ||
736 | 70 | |||
737 | 71 | --- a/src/ui/Makefile.am | ||
738 | 72 | +++ b/src/ui/Makefile.am | ||
739 | 73 | @@ -8,7 +8,7 @@ | ||
740 | 74 | |||
741 | 75 | noinst_LIBRARIES = libliui.a | ||
742 | 76 | |||
743 | 77 | -libliui_a_CFLAGS = $(PACKAGE_CFLAGS) $(LIBINDICATE_CFLAGS) $(LIBUNITY_CFLAGS) | ||
744 | 78 | +libliui_a_CFLAGS = $(PACKAGE_CFLAGS) $(MESSAGING_MENU_CFLAGS) $(LIBUNITY_CFLAGS) | ||
745 | 79 | libliui_a_SOURCES = \ | ||
746 | 80 | auth_dialog.c auth_dialog.h \ | ||
747 | 81 | browser_tabs.c browser_tabs.h \ | ||
748 | 82 | --- a/src/ui/ui_indicator.c | ||
749 | 83 | +++ b/src/ui/ui_indicator.c | ||
750 | 84 | @@ -24,13 +24,10 @@ | ||
751 | 85 | |||
752 | 86 | #include "ui_indicator.h" | ||
753 | 87 | |||
754 | 88 | -#ifdef HAVE_LIBINDICATE | ||
755 | 89 | +#ifdef HAVE_MESSAGING_MENU | ||
756 | 90 | |||
757 | 91 | #include <gtk/gtk.h> | ||
758 | 92 | -#include <libindicate/server.h> | ||
759 | 93 | -#include <libindicate/indicator.h> | ||
760 | 94 | -#include <libindicate-gtk/indicator.h> | ||
761 | 95 | -#include <libindicate/interests.h> | ||
762 | 96 | +#include <messaging-menu.h> | ||
763 | 97 | #include "feedlist.h" | ||
764 | 98 | #include "feed_list_view.h" | ||
765 | 99 | #include "liferea_shell.h" | ||
766 | 100 | @@ -39,15 +36,9 @@ | ||
767 | 101 | |||
768 | 102 | /* The maximum number of feeds to display in the indicator menu. */ | ||
769 | 103 | #define MAX_INDICATORS 6 | ||
770 | 104 | -/* Whether Liferea should set the indicator menu to attention | ||
771 | 105 | - status whenever new feed items are downloaded. Since news feeds | ||
772 | 106 | - do not typically require the user's urgent attention, unlike | ||
773 | 107 | - mail and IM messages, this is set to false by default. */ | ||
774 | 108 | -#define SET_DRAW_ATTENTION FALSE | ||
775 | 109 | |||
776 | 110 | static struct indicator_priv { | ||
777 | 111 | - IndicateServer *server; | ||
778 | 112 | - gboolean visible; | ||
779 | 113 | + MessagingMenuApp *server; | ||
780 | 114 | GPtrArray *indicators; | ||
781 | 115 | } *indicator_priv = NULL; | ||
782 | 116 | |||
783 | 117 | @@ -55,7 +46,7 @@ | ||
784 | 118 | The desktop file to initialize the indicator menu with. Resolves to | ||
785 | 119 | a string like "/usr/share/applications/liferea.desktop". | ||
786 | 120 | */ | ||
787 | 121 | -static const char *DESKTOP_FILE = PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "applications" G_DIR_SEPARATOR_S "liferea.desktop"; | ||
788 | 122 | +static const char *DESKTOP_FILE = "liferea.desktop"; | ||
789 | 123 | |||
790 | 124 | static void | ||
791 | 125 | remove_all_indicators () { | ||
792 | 126 | @@ -66,44 +57,18 @@ | ||
793 | 127 | Called when the main "Liferea" entry in the indicator menu is clicked. | ||
794 | 128 | */ | ||
795 | 129 | static void | ||
796 | 130 | -on_indicator_server_clicked (IndicateServer *server, gchar *type, gpointer user_data) | ||
797 | 131 | +on_indicator_server_clicked (MessagingMenuApp *server, gchar *source_id, gpointer user_data) | ||
798 | 132 | { | ||
799 | 133 | liferea_shell_present (); | ||
800 | 134 | remove_all_indicators (); | ||
801 | 135 | } | ||
802 | 136 | |||
803 | 137 | /* | ||
804 | 138 | - Called when the indicator container applet is shown. | ||
805 | 139 | -*/ | ||
806 | 140 | -static void | ||
807 | 141 | -on_indicator_interest_added (IndicateServer *server, guint interest, gpointer user_data) | ||
808 | 142 | -{ | ||
809 | 143 | - if (interest != INDICATE_INTEREST_SERVER_SIGNAL) | ||
810 | 144 | - return; | ||
811 | 145 | - | ||
812 | 146 | - indicator_priv->visible = TRUE; | ||
813 | 147 | - ui_tray_update (); | ||
814 | 148 | -} | ||
815 | 149 | - | ||
816 | 150 | -/* | ||
817 | 151 | - Called when the indicator container applet is hidden. | ||
818 | 152 | -*/ | ||
819 | 153 | -static void | ||
820 | 154 | -on_indicator_interest_removed (IndicateServer *server, guint interest, gpointer user_data) | ||
821 | 155 | -{ | ||
822 | 156 | - if (interest != INDICATE_INTEREST_SERVER_SIGNAL) | ||
823 | 157 | - return; | ||
824 | 158 | - | ||
825 | 159 | - indicator_priv->visible = FALSE; | ||
826 | 160 | - ui_tray_update (); | ||
827 | 161 | -} | ||
828 | 162 | - | ||
829 | 163 | -/* | ||
830 | 164 | Called when the indicator menu entry for a specific feed | ||
831 | 165 | is clicked, meaning Liferea should switch to that feed. | ||
832 | 166 | */ | ||
833 | 167 | static void | ||
834 | 168 | -on_indicator_clicked (IndicateIndicator *indicator, guint timestamp, gpointer user_data) | ||
835 | 169 | +on_indicator_clicked (MessagingMenuApp *indicator, gchar *source_id, gpointer user_data) | ||
836 | 170 | { | ||
837 | 171 | feed_list_view_select ((nodePtr) user_data); | ||
838 | 172 | liferea_shell_present (); | ||
839 | 173 | @@ -116,8 +81,7 @@ | ||
840 | 174 | if (indicator_priv->server == NULL || indicator == NULL) | ||
841 | 175 | return; | ||
842 | 176 | |||
843 | 177 | - indicate_server_remove_indicator (indicator_priv->server, INDICATE_INDICATOR(indicator)); | ||
844 | 178 | - g_object_unref (G_OBJECT (indicator)); | ||
845 | 179 | + messaging_menu_app_remove_source (indicator_priv->server, (char *)(indicator)); | ||
846 | 180 | } | ||
847 | 181 | |||
848 | 182 | void | ||
849 | 183 | @@ -127,18 +91,13 @@ | ||
850 | 184 | return; | ||
851 | 185 | |||
852 | 186 | indicator_priv = g_new0 (struct indicator_priv, 1); | ||
853 | 187 | - indicator_priv->visible = FALSE; | ||
854 | 188 | indicator_priv->indicators = g_ptr_array_new_with_free_func (destroy_indicator); | ||
855 | 189 | |||
856 | 190 | - indicator_priv->server = indicate_server_ref_default(); | ||
857 | 191 | - indicate_server_set_type (indicator_priv->server, "message.im"); | ||
858 | 192 | - indicate_server_set_desktop_file (indicator_priv->server, DESKTOP_FILE); | ||
859 | 193 | - | ||
860 | 194 | - g_signal_connect (G_OBJECT (indicator_priv->server), "server-display", G_CALLBACK (on_indicator_server_clicked), NULL); | ||
861 | 195 | - g_signal_connect (G_OBJECT (indicator_priv->server), "interest-added", G_CALLBACK (on_indicator_interest_added), NULL); | ||
862 | 196 | - g_signal_connect (G_OBJECT (indicator_priv->server), "interest-removed", G_CALLBACK (on_indicator_interest_removed), NULL); | ||
863 | 197 | + indicator_priv->server = messaging_menu_app_new (DESKTOP_FILE); | ||
864 | 198 | + messaging_menu_app_register (indicator_priv->server); | ||
865 | 199 | + | ||
866 | 200 | + g_signal_connect (G_OBJECT (indicator_priv->server), "activate-source", G_CALLBACK (on_indicator_server_clicked), NULL); | ||
867 | 201 | |||
868 | 202 | - indicate_server_show (indicator_priv->server); | ||
869 | 203 | ui_indicator_update (); | ||
870 | 204 | } | ||
871 | 205 | |||
872 | 206 | @@ -159,9 +118,10 @@ | ||
873 | 207 | static void | ||
874 | 208 | add_node_indicator (nodePtr node) | ||
875 | 209 | { | ||
876 | 210 | - IndicateIndicator *indicator; | ||
877 | 211 | - GdkPixbuf *pixbuf; | ||
878 | 212 | + GFile *file; | ||
879 | 213 | + GIcon *icon; | ||
880 | 214 | gchar count[10]; | ||
881 | 215 | + gchar *signal; | ||
882 | 216 | |||
883 | 217 | if (indicator_priv->indicators->len >= MAX_INDICATORS) | ||
884 | 218 | return; | ||
885 | 219 | @@ -176,30 +136,28 @@ | ||
886 | 220 | if (node->unreadCount == 0) | ||
887 | 221 | return; | ||
888 | 222 | |||
889 | 223 | - indicator = indicate_indicator_new_with_server (indicator_priv->server); | ||
890 | 224 | - g_signal_connect (indicator, "user-display", G_CALLBACK (on_indicator_clicked), node); | ||
891 | 225 | - | ||
892 | 226 | - /* load favicon */ | ||
893 | 227 | - pixbuf = gdk_pixbuf_new_from_file (node->iconFile, NULL); | ||
894 | 228 | + file = g_file_new_for_path (node->iconFile); | ||
895 | 229 | + icon = g_file_icon_new (file); | ||
896 | 230 | |||
897 | 231 | - /* display favicon */ | ||
898 | 232 | - indicate_gtk_indicator_set_property_icon (indicator, "icon", pixbuf); | ||
899 | 233 | - gdk_pixbuf_unref (pixbuf); | ||
900 | 234 | - | ||
901 | 235 | - sprintf (count, "%u", node->unreadCount); | ||
902 | 236 | - indicate_indicator_set_property (indicator, "name", node->title); | ||
903 | 237 | - indicate_indicator_set_property (indicator, "count", count); | ||
904 | 238 | -#if SET_DRAW_ATTENTION | ||
905 | 239 | - indicate_indicator_set_property_bool (indicator, "draw-attention", TRUE); | ||
906 | 240 | -#endif | ||
907 | 241 | - g_ptr_array_add (indicator_priv->indicators, indicator); | ||
908 | 242 | + messaging_menu_app_append_source_with_count( | ||
909 | 243 | + indicator_priv->server, | ||
910 | 244 | + node->id, | ||
911 | 245 | + icon, | ||
912 | 246 | + node->title, | ||
913 | 247 | + node->unreadCount); | ||
914 | 248 | + | ||
915 | 249 | + signal = g_strdup_printf("activate-source::%s", node->id); | ||
916 | 250 | + g_signal_connect (indicator_priv->server, signal, G_CALLBACK (on_indicator_clicked), node); | ||
917 | 251 | + g_ptr_array_add (indicator_priv->indicators, node->id); | ||
918 | 252 | + | ||
919 | 253 | + g_object_unref(icon); | ||
920 | 254 | + g_object_unref(file); | ||
921 | 255 | + g_free(signal); | ||
922 | 256 | } | ||
923 | 257 | |||
924 | 258 | void | ||
925 | 259 | ui_indicator_update () | ||
926 | 260 | { | ||
927 | 261 | - guint index; | ||
928 | 262 | - | ||
929 | 263 | /* Do not update indicators if the user is interacting with the main window */ | ||
930 | 264 | if (!indicator_priv || gtk_window_is_active (GTK_WINDOW (liferea_shell_get_window ()))) | ||
931 | 265 | return; | ||
932 | 266 | @@ -208,16 +166,12 @@ | ||
933 | 267 | remove_all_indicators (); | ||
934 | 268 | /* ...then walk the tree and add an indicator for each unread feed */ | ||
935 | 269 | feedlist_foreach (add_node_indicator); | ||
936 | 270 | - | ||
937 | 271 | - /* revert order of items */ | ||
938 | 272 | - for (index = indicator_priv->indicators->len; index > 0; index--) | ||
939 | 273 | - indicate_indicator_show (g_ptr_array_index (indicator_priv->indicators, index - 1)); | ||
940 | 274 | } | ||
941 | 275 | |||
942 | 276 | gboolean | ||
943 | 277 | ui_indicator_is_visible () | ||
944 | 278 | { | ||
945 | 279 | - return indicator_priv && indicator_priv->visible; | ||
946 | 280 | + return TRUE; | ||
947 | 281 | } | ||
948 | 282 | |||
949 | 283 | #else | ||
950 | 284 | @@ -233,4 +187,4 @@ | ||
951 | 285 | void ui_indicator_update () {} | ||
952 | 286 | gboolean ui_indicator_is_visible () { return FALSE; } | ||
953 | 287 | |||
954 | 288 | -#endif /* HAVE_LIBINDICATE */ | ||
955 | 289 | +#endif /* HAVE_MESSAGING_MENU */ | ||
956 | 0 | 290 | ||
957 | === modified file 'debian/patches/series' | |||
958 | --- debian/patches/series 2013-03-25 02:10:13 +0000 | |||
959 | +++ debian/patches/series 2013-03-25 03:54:20 +0000 | |||
960 | @@ -5,3 +5,4 @@ | |||
961 | 5 | add_X-Ubuntu-Gettext-Domain | 5 | add_X-Ubuntu-Gettext-Domain |
962 | 6 | libunity.patch | 6 | libunity.patch |
963 | 7 | port-to-libindicate-0.7.patch | 7 | port-to-libindicate-0.7.patch |
964 | 8 | port-to-messaging-menu.patch | ||
965 | 8 | 9 | ||
966 | === modified file 'debian/rules' | |||
967 | --- debian/rules 2013-03-25 02:10:13 +0000 | |||
968 | +++ debian/rules 2013-03-25 03:54:20 +0000 | |||
969 | @@ -48,7 +48,7 @@ | |||
970 | 48 | ./configure $(SYSTEM) --prefix=/usr \ | 48 | ./configure $(SYSTEM) --prefix=/usr \ |
971 | 49 | --mandir=\$${prefix}/share/man --sysconfdir=/etc \ | 49 | --mandir=\$${prefix}/share/man --sysconfdir=/etc \ |
972 | 50 | --enable-sm --enable-gnutls --enable-lua --enable-libnotify \ | 50 | --enable-sm --enable-gnutls --enable-lua --enable-libnotify \ |
974 | 51 | --enable-libindicate \ | 51 | --enable-messaging-menu \ |
975 | 52 | $(ENABLE_NM) | 52 | $(ENABLE_NM) |
976 | 53 | ln -s $(CURDIR)/man/liferea.1 $(CURDIR)/debian/liferea-add-feed.1 | 53 | ln -s $(CURDIR)/man/liferea.1 $(CURDIR)/debian/liferea-add-feed.1 |
977 | 54 | 54 | ||
978 | 55 | 55 | ||
979 | === modified file 'src/Makefile.am' | |||
980 | --- src/Makefile.am 2013-03-25 02:10:13 +0000 | |||
981 | +++ src/Makefile.am 2013-03-25 03:54:20 +0000 | |||
982 | @@ -77,9 +77,9 @@ | |||
983 | 77 | 77 | ||
984 | 78 | endif | 78 | endif |
985 | 79 | 79 | ||
987 | 80 | if WITH_LIBINDICATE | 80 | if WITH_MESSAGING_MENU |
988 | 81 | 81 | ||
990 | 82 | liferea_LDADD += $(LIBINDICATE_LIBS) | 82 | liferea_LDADD += $(MESSAGING_MENU_LIBS) |
991 | 83 | 83 | ||
992 | 84 | endif | 84 | endif |
993 | 85 | 85 | ||
994 | 86 | 86 | ||
995 | === modified file 'src/ui/Makefile.am' | |||
996 | --- src/ui/Makefile.am 2013-03-25 02:10:13 +0000 | |||
997 | +++ src/ui/Makefile.am 2013-03-25 03:54:20 +0000 | |||
998 | @@ -8,7 +8,7 @@ | |||
999 | 8 | 8 | ||
1000 | 9 | noinst_LIBRARIES = libliui.a | 9 | noinst_LIBRARIES = libliui.a |
1001 | 10 | 10 | ||
1003 | 11 | libliui_a_CFLAGS = $(PACKAGE_CFLAGS) $(LIBINDICATE_CFLAGS) $(LIBUNITY_CFLAGS) | 11 | libliui_a_CFLAGS = $(PACKAGE_CFLAGS) $(MESSAGING_MENU_CFLAGS) $(LIBUNITY_CFLAGS) |
1004 | 12 | libliui_a_SOURCES = \ | 12 | libliui_a_SOURCES = \ |
1005 | 13 | auth_dialog.c auth_dialog.h \ | 13 | auth_dialog.c auth_dialog.h \ |
1006 | 14 | browser_tabs.c browser_tabs.h \ | 14 | browser_tabs.c browser_tabs.h \ |
1007 | 15 | 15 | ||
1008 | === modified file 'src/ui/ui_indicator.c' | |||
1009 | --- src/ui/ui_indicator.c 2013-03-25 02:10:13 +0000 | |||
1010 | +++ src/ui/ui_indicator.c 2013-03-25 03:54:20 +0000 | |||
1011 | @@ -24,13 +24,10 @@ | |||
1012 | 24 | 24 | ||
1013 | 25 | #include "ui_indicator.h" | 25 | #include "ui_indicator.h" |
1014 | 26 | 26 | ||
1016 | 27 | #ifdef HAVE_LIBINDICATE | 27 | #ifdef HAVE_MESSAGING_MENU |
1017 | 28 | 28 | ||
1018 | 29 | #include <gtk/gtk.h> | 29 | #include <gtk/gtk.h> |
1023 | 30 | #include <libindicate/server.h> | 30 | #include <messaging-menu.h> |
1020 | 31 | #include <libindicate/indicator.h> | ||
1021 | 32 | #include <libindicate-gtk/indicator.h> | ||
1022 | 33 | #include <libindicate/interests.h> | ||
1024 | 34 | #include "feedlist.h" | 31 | #include "feedlist.h" |
1025 | 35 | #include "feed_list_view.h" | 32 | #include "feed_list_view.h" |
1026 | 36 | #include "liferea_shell.h" | 33 | #include "liferea_shell.h" |
1027 | @@ -39,15 +36,9 @@ | |||
1028 | 39 | 36 | ||
1029 | 40 | /* The maximum number of feeds to display in the indicator menu. */ | 37 | /* The maximum number of feeds to display in the indicator menu. */ |
1030 | 41 | #define MAX_INDICATORS 6 | 38 | #define MAX_INDICATORS 6 |
1031 | 42 | /* Whether Liferea should set the indicator menu to attention | ||
1032 | 43 | status whenever new feed items are downloaded. Since news feeds | ||
1033 | 44 | do not typically require the user's urgent attention, unlike | ||
1034 | 45 | mail and IM messages, this is set to false by default. */ | ||
1035 | 46 | #define SET_DRAW_ATTENTION FALSE | ||
1036 | 47 | 39 | ||
1037 | 48 | static struct indicator_priv { | 40 | static struct indicator_priv { |
1040 | 49 | IndicateServer *server; | 41 | MessagingMenuApp *server; |
1039 | 50 | gboolean visible; | ||
1041 | 51 | GPtrArray *indicators; | 42 | GPtrArray *indicators; |
1042 | 52 | } *indicator_priv = NULL; | 43 | } *indicator_priv = NULL; |
1043 | 53 | 44 | ||
1044 | @@ -55,7 +46,7 @@ | |||
1045 | 55 | The desktop file to initialize the indicator menu with. Resolves to | 46 | The desktop file to initialize the indicator menu with. Resolves to |
1046 | 56 | a string like "/usr/share/applications/liferea.desktop". | 47 | a string like "/usr/share/applications/liferea.desktop". |
1047 | 57 | */ | 48 | */ |
1049 | 58 | static const char *DESKTOP_FILE = PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "applications" G_DIR_SEPARATOR_S "liferea.desktop"; | 49 | static const char *DESKTOP_FILE = "liferea.desktop"; |
1050 | 59 | 50 | ||
1051 | 60 | static void | 51 | static void |
1052 | 61 | remove_all_indicators () { | 52 | remove_all_indicators () { |
1053 | @@ -66,44 +57,18 @@ | |||
1054 | 66 | Called when the main "Liferea" entry in the indicator menu is clicked. | 57 | Called when the main "Liferea" entry in the indicator menu is clicked. |
1055 | 67 | */ | 58 | */ |
1056 | 68 | static void | 59 | static void |
1058 | 69 | on_indicator_server_clicked (IndicateServer *server, gchar *type, gpointer user_data) | 60 | on_indicator_server_clicked (MessagingMenuApp *server, gchar *source_id, gpointer user_data) |
1059 | 70 | { | 61 | { |
1060 | 71 | liferea_shell_present (); | 62 | liferea_shell_present (); |
1061 | 72 | remove_all_indicators (); | 63 | remove_all_indicators (); |
1062 | 73 | } | 64 | } |
1063 | 74 | 65 | ||
1064 | 75 | /* | 66 | /* |
1065 | 76 | Called when the indicator container applet is shown. | ||
1066 | 77 | */ | ||
1067 | 78 | static void | ||
1068 | 79 | on_indicator_interest_added (IndicateServer *server, guint interest, gpointer user_data) | ||
1069 | 80 | { | ||
1070 | 81 | if (interest != INDICATE_INTEREST_SERVER_SIGNAL) | ||
1071 | 82 | return; | ||
1072 | 83 | |||
1073 | 84 | indicator_priv->visible = TRUE; | ||
1074 | 85 | ui_tray_update (); | ||
1075 | 86 | } | ||
1076 | 87 | |||
1077 | 88 | /* | ||
1078 | 89 | Called when the indicator container applet is hidden. | ||
1079 | 90 | */ | ||
1080 | 91 | static void | ||
1081 | 92 | on_indicator_interest_removed (IndicateServer *server, guint interest, gpointer user_data) | ||
1082 | 93 | { | ||
1083 | 94 | if (interest != INDICATE_INTEREST_SERVER_SIGNAL) | ||
1084 | 95 | return; | ||
1085 | 96 | |||
1086 | 97 | indicator_priv->visible = FALSE; | ||
1087 | 98 | ui_tray_update (); | ||
1088 | 99 | } | ||
1089 | 100 | |||
1090 | 101 | /* | ||
1091 | 102 | Called when the indicator menu entry for a specific feed | 67 | Called when the indicator menu entry for a specific feed |
1092 | 103 | is clicked, meaning Liferea should switch to that feed. | 68 | is clicked, meaning Liferea should switch to that feed. |
1093 | 104 | */ | 69 | */ |
1094 | 105 | static void | 70 | static void |
1096 | 106 | on_indicator_clicked (IndicateIndicator *indicator, guint timestamp, gpointer user_data) | 71 | on_indicator_clicked (MessagingMenuApp *indicator, gchar *source_id, gpointer user_data) |
1097 | 107 | { | 72 | { |
1098 | 108 | feed_list_view_select ((nodePtr) user_data); | 73 | feed_list_view_select ((nodePtr) user_data); |
1099 | 109 | liferea_shell_present (); | 74 | liferea_shell_present (); |
1100 | @@ -116,8 +81,7 @@ | |||
1101 | 116 | if (indicator_priv->server == NULL || indicator == NULL) | 81 | if (indicator_priv->server == NULL || indicator == NULL) |
1102 | 117 | return; | 82 | return; |
1103 | 118 | 83 | ||
1106 | 119 | indicate_server_remove_indicator (indicator_priv->server, INDICATE_INDICATOR(indicator)); | 84 | messaging_menu_app_remove_source (indicator_priv->server, (char *)(indicator)); |
1105 | 120 | g_object_unref (G_OBJECT (indicator)); | ||
1107 | 121 | } | 85 | } |
1108 | 122 | 86 | ||
1109 | 123 | void | 87 | void |
1110 | @@ -127,18 +91,13 @@ | |||
1111 | 127 | return; | 91 | return; |
1112 | 128 | 92 | ||
1113 | 129 | indicator_priv = g_new0 (struct indicator_priv, 1); | 93 | indicator_priv = g_new0 (struct indicator_priv, 1); |
1114 | 130 | indicator_priv->visible = FALSE; | ||
1115 | 131 | indicator_priv->indicators = g_ptr_array_new_with_free_func (destroy_indicator); | 94 | indicator_priv->indicators = g_ptr_array_new_with_free_func (destroy_indicator); |
1116 | 132 | 95 | ||
1126 | 133 | indicator_priv->server = indicate_server_ref_default(); | 96 | indicator_priv->server = messaging_menu_app_new (DESKTOP_FILE); |
1127 | 134 | indicate_server_set_type (indicator_priv->server, "message.im"); | 97 | messaging_menu_app_register (indicator_priv->server); |
1128 | 135 | indicate_server_set_desktop_file (indicator_priv->server, DESKTOP_FILE); | 98 | |
1129 | 136 | 99 | g_signal_connect (G_OBJECT (indicator_priv->server), "activate-source", G_CALLBACK (on_indicator_server_clicked), NULL); | |
1130 | 137 | g_signal_connect (G_OBJECT (indicator_priv->server), "server-display", G_CALLBACK (on_indicator_server_clicked), NULL); | 100 | |
1122 | 138 | g_signal_connect (G_OBJECT (indicator_priv->server), "interest-added", G_CALLBACK (on_indicator_interest_added), NULL); | ||
1123 | 139 | g_signal_connect (G_OBJECT (indicator_priv->server), "interest-removed", G_CALLBACK (on_indicator_interest_removed), NULL); | ||
1124 | 140 | |||
1125 | 141 | indicate_server_show (indicator_priv->server); | ||
1131 | 142 | ui_indicator_update (); | 101 | ui_indicator_update (); |
1132 | 143 | } | 102 | } |
1133 | 144 | 103 | ||
1134 | @@ -159,9 +118,10 @@ | |||
1135 | 159 | static void | 118 | static void |
1136 | 160 | add_node_indicator (nodePtr node) | 119 | add_node_indicator (nodePtr node) |
1137 | 161 | { | 120 | { |
1140 | 162 | IndicateIndicator *indicator; | 121 | GFile *file; |
1141 | 163 | GdkPixbuf *pixbuf; | 122 | GIcon *icon; |
1142 | 164 | gchar count[10]; | 123 | gchar count[10]; |
1143 | 124 | gchar *signal; | ||
1144 | 165 | 125 | ||
1145 | 166 | if (indicator_priv->indicators->len >= MAX_INDICATORS) | 126 | if (indicator_priv->indicators->len >= MAX_INDICATORS) |
1146 | 167 | return; | 127 | return; |
1147 | @@ -176,30 +136,28 @@ | |||
1148 | 176 | if (node->unreadCount == 0) | 136 | if (node->unreadCount == 0) |
1149 | 177 | return; | 137 | return; |
1150 | 178 | 138 | ||
1168 | 179 | indicator = indicate_indicator_new_with_server (indicator_priv->server); | 139 | file = g_file_new_for_path (node->iconFile); |
1169 | 180 | g_signal_connect (indicator, "user-display", G_CALLBACK (on_indicator_clicked), node); | 140 | icon = g_file_icon_new (file); |
1170 | 181 | 141 | ||
1171 | 182 | /* load favicon */ | 142 | messaging_menu_app_append_source_with_count( |
1172 | 183 | pixbuf = gdk_pixbuf_new_from_file (node->iconFile, NULL); | 143 | indicator_priv->server, |
1173 | 184 | 144 | node->id, | |
1174 | 185 | /* display favicon */ | 145 | icon, |
1175 | 186 | indicate_gtk_indicator_set_property_icon (indicator, "icon", pixbuf); | 146 | node->title, |
1176 | 187 | gdk_pixbuf_unref (pixbuf); | 147 | node->unreadCount); |
1177 | 188 | 148 | ||
1178 | 189 | sprintf (count, "%u", node->unreadCount); | 149 | signal = g_strdup_printf("activate-source::%s", node->id); |
1179 | 190 | indicate_indicator_set_property (indicator, "name", node->title); | 150 | g_signal_connect (indicator_priv->server, signal, G_CALLBACK (on_indicator_clicked), node); |
1180 | 191 | indicate_indicator_set_property (indicator, "count", count); | 151 | g_ptr_array_add (indicator_priv->indicators, node->id); |
1181 | 192 | #if SET_DRAW_ATTENTION | 152 | |
1182 | 193 | indicate_indicator_set_property_bool (indicator, "draw-attention", TRUE); | 153 | g_object_unref(icon); |
1183 | 194 | #endif | 154 | g_object_unref(file); |
1184 | 195 | g_ptr_array_add (indicator_priv->indicators, indicator); | 155 | g_free(signal); |
1185 | 196 | } | 156 | } |
1186 | 197 | 157 | ||
1187 | 198 | void | 158 | void |
1188 | 199 | ui_indicator_update () | 159 | ui_indicator_update () |
1189 | 200 | { | 160 | { |
1190 | 201 | guint index; | ||
1191 | 202 | |||
1192 | 203 | /* Do not update indicators if the user is interacting with the main window */ | 161 | /* Do not update indicators if the user is interacting with the main window */ |
1193 | 204 | if (!indicator_priv || gtk_window_is_active (GTK_WINDOW (liferea_shell_get_window ()))) | 162 | if (!indicator_priv || gtk_window_is_active (GTK_WINDOW (liferea_shell_get_window ()))) |
1194 | 205 | return; | 163 | return; |
1195 | @@ -208,16 +166,12 @@ | |||
1196 | 208 | remove_all_indicators (); | 166 | remove_all_indicators (); |
1197 | 209 | /* ...then walk the tree and add an indicator for each unread feed */ | 167 | /* ...then walk the tree and add an indicator for each unread feed */ |
1198 | 210 | feedlist_foreach (add_node_indicator); | 168 | feedlist_foreach (add_node_indicator); |
1199 | 211 | |||
1200 | 212 | /* revert order of items */ | ||
1201 | 213 | for (index = indicator_priv->indicators->len; index > 0; index--) | ||
1202 | 214 | indicate_indicator_show (g_ptr_array_index (indicator_priv->indicators, index - 1)); | ||
1203 | 215 | } | 169 | } |
1204 | 216 | 170 | ||
1205 | 217 | gboolean | 171 | gboolean |
1206 | 218 | ui_indicator_is_visible () | 172 | ui_indicator_is_visible () |
1207 | 219 | { | 173 | { |
1209 | 220 | return indicator_priv && indicator_priv->visible; | 174 | return TRUE; |
1210 | 221 | } | 175 | } |
1211 | 222 | 176 | ||
1212 | 223 | #else | 177 | #else |
1213 | @@ -233,4 +187,4 @@ | |||
1214 | 233 | void ui_indicator_update () {} | 187 | void ui_indicator_update () {} |
1215 | 234 | gboolean ui_indicator_is_visible () { return FALSE; } | 188 | gboolean ui_indicator_is_visible () { return FALSE; } |
1216 | 235 | 189 | ||
1218 | 236 | #endif /* HAVE_LIBINDICATE */ | 190 | #endif /* HAVE_MESSAGING_MENU */ |
Seems to work, but have no idea if this is roughly correct or not.
Also package branches are out of date, hence this crazy merge-proposal, if it looks ok I'll just upload it into raring.