Merge lp:~muktupavels/indicator-applet/libpanel-applet-3.10+ into lp:indicator-applet

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Iain Lane
Approved revision: 433
Merged at revision: 430
Proposed branch: lp:~muktupavels/indicator-applet/libpanel-applet-3.10+
Merge into: lp:indicator-applet
Diff against target: 136 lines (+51/-3)
3 files modified
configure.ac (+15/-1)
debian/control (+1/-1)
src/applet-main.c (+35/-1)
To merge this branch: bzr merge lp:~muktupavels/indicator-applet/libpanel-applet-3.10+
Reviewer Review Type Date Requested Status
Iain Lane Approve
Dmitry Shachnev Approve
Review via email: mp+230851@code.launchpad.net

Commit message

Update for new libpanel-applet version.

Description of the change

Update for new libpanel-applet version.

To post a comment you must log in.
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Can you use some preprocessor magic to make it work with both old and new gnome-panel?

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

> Can you use some preprocessor magic to make it work with both old and new
> gnome-panel?

Why? I think it is not worth to spend time trying to achieve it.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I thought it is just a couple of #if/#else/#endif blocks, no? If you do that, it will ease a transition for us in Ubuntu (if there will be a transition), which is quite important as we are approaching the freeze.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

It would be that simple for changes in applet-main.c, but what about configure.ac?

I guess first we would need to detected what gnome-panel version we have. Then depending on that choose which package applet should require - libpanel-applet (new) or libpanelapplet-4.0 (old).

How about with debian/control? Depends packages will change too...

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Ok, let's leave it as is. But it won't be merged until I have working 3.10 packages (I am still waiting for some kind of tarballs, at least for gnome-flashback & gnome-applets).

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Can I do something like this?
Build-Deps: libpanel-applet-4-dev (<< 3.10) | libpanel-applet-dev (>= 3.10)

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Tested and seems that it works. :)

1. with pbuilder
bzr builddeb -- -S -us -uc
pbuilder-dist utopic build ../indicator-applet_12.10.2+14.04.20140403-0ubuntu1.dsc

2. localy
./autogen.sh
make

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

One minor issue and it will be fine.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

> One minor issue and it will be fine.
But when new gnome-panel will be uploaded then libpanel-applet-4-dev will be replaced by new package. There won't be both packages.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

If there are no file conflicts, then technically old and new packages can co-exist. Also, the order has not only technical meaning, but also a semantic one.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

> If there are no file conflicts, then technically old and new packages can co-
> exist. Also, the order has not only technical meaning, but also a semantic
> one.

Ok, I changed order. :)

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks, looks fine to me now (though I don't have rights to merge this).

Also, please change the status from "Work in Progress" to "Needs Review", to mark it as ready for merging.

review: Approve
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

> Thanks, looks fine to me now (though I don't have rights to merge this).
>
> Also, please change the status from "Work in Progress" to "Needs Review", to
> mark it as ready for merging.

Should not we wait until we will know for sure that we will have 3.10+ release?

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

You made it work with the old version, so I don't see why we should wait. Now when/if we get the new version, we'll need to just rebuild indicator-applet in Ubuntu.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Ok, changed status to "Needs Review"

Revision history for this message
Iain Lane (laney) wrote :

HAVE_LIBPANEL_APPLET is a confusing name given what it means here. :)

But, seems fine - approving.

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 2013-07-11 16:25:20 +0000
3+++ configure.ac 2014-08-18 15:45:47 +0000
4@@ -22,13 +22,24 @@
5 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
6
7 ###########################
8+# libpanel-applet version
9+###########################
10+
11+PKG_CHECK_MODULES(LIBPANEL_APPLET_TEST, [libpanel-applet >= 3.10], [have_libpanel_applet=yes], [have_libpanel_applet=no])
12+if test "$have_libpanel_applet" = "yes"; then
13+ APPLET_PKG=libpanel-applet
14+ AC_DEFINE([HAVE_LIBPANEL_APPLET], 1, [Define to use new libpanel-applet])
15+else
16+ APPLET_PKG=libpanelapplet-4.0
17+fi
18+
19+###########################
20 # Dependencies
21 ###########################
22
23 GTK_REQUIRED_VERSION=3.1
24 INDICATOR_REQUIRED_VERSION=0.3.92
25 INDICATOR_PKG=indicator3-0.4
26-APPLET_PKG=libpanelapplet-4.0
27
28 PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK_REQUIRED_VERSION
29 x11
30@@ -59,6 +70,8 @@
31 INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir $INDICATOR_PKG`
32 fi
33
34+LIBPANEL_APPLET_API_VERSION=`$PKG_CONFIG --variable=libpanel_applet_api_version $APPLET_PKG`
35+
36 AC_SUBST(APPLETDIR)
37 AC_SUBST(INDICATORDIR)
38 AC_SUBST(INDICATORICONSDIR)
39@@ -141,4 +154,5 @@
40 Indicator Applet Configuration:
41
42 Prefix: $prefix
43+ libpanel-applet API: $LIBPANEL_APPLET_API_VERSION
44 ])
45
46=== modified file 'debian/control'
47--- debian/control 2014-04-02 15:21:08 +0000
48+++ debian/control 2014-08-18 15:45:47 +0000
49@@ -11,7 +11,7 @@
50 gnome-doc-utils,
51 gtk-doc-tools,
52 libgtk-3-dev,
53- libpanel-applet-4-dev,
54+ libpanel-applet-dev | libpanel-applet-4-dev,
55 libxml2-dev,
56 libindicator3-dev,
57 libido3-0.1-dev (>= 13.10.0),
58
59=== modified file 'src/applet-main.c'
60--- src/applet-main.c 2014-04-02 16:15:55 +0000
61+++ src/applet-main.c 2014-08-18 15:45:47 +0000
62@@ -813,8 +813,14 @@
63 }
64
65 static void
66+#ifdef HAVE_LIBPANEL_APPLET
67+about_cb (GSimpleAction *action G_GNUC_UNUSED,
68+ GVariant *parameter G_GNUC_UNUSED,
69+ gpointer data G_GNUC_UNUSED)
70+#else
71 about_cb (GtkAction *action G_GNUC_UNUSED,
72 gpointer data G_GNUC_UNUSED)
73+#endif
74 {
75 static const gchar *authors[] = {
76 "Ted Gould <ted@canonical.com>",
77@@ -993,16 +999,33 @@
78 gpointer data G_GNUC_UNUSED)
79 {
80 ido_init();
81-
82+
83+#ifdef HAVE_LIBPANEL_APPLET
84+ static const GActionEntry menu_actions[] = {
85+ {"about", about_cb }
86+ };
87+ static const gchar *menu_xml = ""
88+ "<section>"
89+ "<item>"
90+ "<attribute name=\"label\" translatable=\"yes\">_About</attribute>"
91+ "<attribute name=\"action\">indicator-applet.about</attribute>"
92+ "</item>"
93+ "</section>";
94+#else
95 static const GtkActionEntry menu_actions[] = {
96 {"About", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL, G_CALLBACK(about_cb)}
97 };
98 static const gchar *menu_xml = "<menuitem name=\"About\" action=\"About\"/>";
99+#endif
100
101 static gboolean first_time = FALSE;
102 GtkWidget *menubar;
103 gint indicators_loaded = 0;
104+#ifdef HAVE_LIBPANEL_APPLET
105+ GSimpleActionGroup *action_group;
106+#else
107 GtkActionGroup *action_group;
108+#endif
109
110 #ifdef INDICATOR_APPLET_SESSION
111 /* check if we are running stracciatella session */
112@@ -1037,6 +1060,15 @@
113 gtk_container_set_border_width(GTK_CONTAINER (applet), 0);
114 panel_applet_set_flags(applet, PANEL_APPLET_EXPAND_MINOR);
115 menubar = gtk_menu_bar_new();
116+
117+#ifdef HAVE_LIBPANEL_APPLET
118+ action_group = g_simple_action_group_new ();
119+ g_action_map_add_action_entries (G_ACTION_MAP (action_group), menu_actions,
120+ G_N_ELEMENTS (menu_actions), menubar);
121+ panel_applet_setup_menu(applet, menu_xml, action_group, GETTEXT_PACKAGE);
122+ gtk_widget_insert_action_group (GTK_WIDGET (applet), "indicator-applet", G_ACTION_GROUP (action_group));
123+ g_object_unref(action_group);
124+#else
125 action_group = gtk_action_group_new ("Indicator Applet Actions");
126 gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
127 gtk_action_group_add_actions (action_group, menu_actions,
128@@ -1044,6 +1076,8 @@
129 menubar);
130 panel_applet_setup_menu(applet, menu_xml, action_group);
131 g_object_unref(action_group);
132+#endif
133+
134 #ifdef INDICATOR_APPLET
135 atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (applet)),
136 "indicator-applet");

Subscribers

People subscribed via source and target branches