Merge lp:~mterry/indicator-messages/gtk3 into lp:indicator-messages/0.5

Proposed by Michael Terry
Status: Merged
Approved by: Ted Gould
Approved revision: 213
Merged at revision: 213
Proposed branch: lp:~mterry/indicator-messages/gtk3
Merge into: lp:indicator-messages/0.5
Diff against target: 77 lines (+33/-6)
2 files modified
configure.ac (+27/-6)
src/indicator-messages.c (+6/-0)
To merge this branch: bzr merge lp:~mterry/indicator-messages/gtk3
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+62527@code.launchpad.net

Description of the change

Builds with gtk3 by default, adds a configure flag to build with gtk2 if desired.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Code looks fine. Worried about the dbusmenu-gtk3 includes though :-/ (see last review's comment).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2011-04-07 17:10:43 +0000
3+++ configure.ac 2011-05-26 17:27:55 +0000
4@@ -36,17 +36,35 @@
5 ###########################
6
7 GTK_REQUIRED_VERSION=2.12
8+GTK3_REQUIRED_VERSION=3.0
9 GIO_UNIX_REQUIRED_VERSION=2.18
10 PANEL_REQUIRED_VERSION=2.0.0
11 INDICATE_REQUIRED_VERSION=0.4.90
12 INDICATOR_REQUIRED_VERSION=0.3.19
13 DBUSMENUGTK_REQUIRED_VERSION=0.3.94
14
15-PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
16- gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
17- indicator >= $INDICATOR_REQUIRED_VERSION
18- indicate-0.5 >= $INDICATE_REQUIRED_VERSION
19- dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
20+AC_ARG_WITH([indicator-gtk],
21+ [AS_HELP_STRING([--with-indicator-gtk],
22+ [Which version of gtk to use for the indicator @<:@default=3@:>@])],
23+ [],
24+ [with_indicator_gtk=3])
25+
26+AS_IF([test "x$with_indicator_gtk" = x3],
27+ [PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
28+ gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
29+ indicator3 >= $INDICATOR_REQUIRED_VERSION
30+ indicate-0.5 >= $INDICATE_REQUIRED_VERSION
31+ dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
32+ ],
33+ [test "x$with_indicator_gtk" = x2],
34+ [PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
35+ gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
36+ indicator >= $INDICATOR_REQUIRED_VERSION
37+ indicate-0.5 >= $INDICATE_REQUIRED_VERSION
38+ dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
39+ ],
40+ [AC_MSG_FAILURE([Value for --with-indicator-gtk was neither 2 nor 3])]
41+)
42 AC_SUBST(APPLET_CFLAGS)
43 AC_SUBST(APPLET_LIBS)
44
45@@ -64,9 +82,12 @@
46 if test "x$with_localinstall" = "xyes"; then
47 INDICATORDIR="${libdir}/indicators/2/"
48 INDICATORICONSDIR="${datadir}/libindicate/icons/"
49-else
50+elif test "x$with_indicator_gtk" = x2; then
51 INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator`
52 INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator`
53+else
54+ INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3`
55+ INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3`
56 fi
57 AC_SUBST(INDICATORDIR)
58 AC_SUBST(INDICATORICONSDIR)
59
60=== modified file 'src/indicator-messages.c'
61--- src/indicator-messages.c 2011-02-17 18:04:32 +0000
62+++ src/indicator-messages.c 2011-05-26 17:27:55 +0000
63@@ -25,8 +25,14 @@
64 #include <glib-object.h>
65 #include <glib/gi18n.h>
66 #include <gtk/gtk.h>
67+
68+#if GTK_CHECK_VERSION(3, 0, 0)
69+#include <libdbusmenu-gtk3/menu.h>
70+#include <libdbusmenu-gtk3/menuitem.h>
71+#else
72 #include <libdbusmenu-gtk/menu.h>
73 #include <libdbusmenu-gtk/menuitem.h>
74+#endif
75
76 #include <libindicator/indicator.h>
77 #include <libindicator/indicator-object.h>

Subscribers

People subscribed via source and target branches