Merge lp:~larsu/unity-greeter/indicator-ng into lp:unity-greeter

Proposed by Lars Karlitski
Status: Merged
Approved by: Lars Karlitski
Approved revision: 900
Merged at revision: 907
Proposed branch: lp:~larsu/unity-greeter/indicator-ng
Merge into: lp:unity-greeter
Diff against target: 212 lines (+82/-16)
6 files modified
configure.ac (+3/-0)
debian/control (+1/-0)
src/config.vapi (+1/-0)
src/indicator.vapi (+11/-4)
src/menubar.vala (+65/-12)
src/unity-greeter.vala (+1/-0)
To merge this branch: bzr merge lp:~larsu/unity-greeter/indicator-ng
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sebastien Bacher Approve
Review via email: mp+173082@code.launchpad.net

Commit message

Support new indicator services

Indicator files are read from /usr/share/unity/indicators. They're shown in the greeter's panel if export a menu for the 'desktop_greeter' profile.

Description of the change

Support new indicator services

Indicator files are read from /usr/share/unity/indicators. They're shown in the greeter's panel if export a menu for the 'desktop_greeter' profile.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Lars, the code looks fine to me but:
- it seems to not work (and I built indicator-session-ng and indicator-datetime which both use gmenu and have a desktop_greeter profile)
- how does the new indicators play with the gsettings indicators list added in https://code.launchpad.net/~mterry/unity-greeter/indicator-gsettings/+merge/151573 ?

Revision history for this message
Lars Karlitski (larsu) wrote :

> Thanks Lars, the code looks fine to me but:
> - it seems to not work (and I built indicator-session-ng and indicator-
> datetime which both use gmenu and have a desktop_greeter profile)

Oops :) Fixed in r899.

> - how does the new indicators play with the gsettings indicators list added in
> https://code.launchpad.net/~mterry/unity-greeter/indicator-
> gsettings/+merge/151573 ?

Fixed in r900, as discussed on irc. I didn't test it yet, because I couldn't figure out how to change settings for the lightdm user.

Thanks for testing!

Revision history for this message
Sebastien Bacher (seb128) wrote :

> Fixed in r900, as discussed on irc. I didn't test it yet, because I couldn't figure out how to change settings for the lightdm user.

usually I just change the system default, e.g edit the schemas or add a .override and run glib-compile-schemas. If you want to edit the lightdm user config, you need to do something around the lines of "sudo su lightdm -s /bin/sh gsettings set..."

Revision history for this message
Sebastien Bacher (seb128) wrote :

I've been running that for some days and it works fine for me, code looks fine as well

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
No commit message was specified in the merge proposal. Hit 'Add commit message' on the merge proposal web page or follow the link below. You can approve the merge proposal yourself to rerun.
https://code.launchpad.net/~larsu/unity-greeter/indicator-ng/+merge/173082/+edit-commit-message

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2013-06-20 18:17:28 +0000
+++ configure.ac 2013-07-05 22:43:22 +0000
@@ -21,6 +21,7 @@
21 gtk+-3.021 gtk+-3.0
22 gdk-x11-3.022 gdk-x11-3.0
23 indicator3-0.423 indicator3-0.4
24 libido3-0.1 >= 13.10.0
24 liblightdm-gobject-1 >= 1.4.025 liblightdm-gobject-1 >= 1.4.0
25 freetype226 freetype2
26 cairo-ft27 cairo-ft
@@ -28,6 +29,8 @@
28 x1129 x11
29])30])
3031
32AC_DEFINE_UNQUOTED([INDICATOR_FILE_DIR], ["${prefix}/share/unity/indicators"], [Indicator files are searched for in this directory])
33
31INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4`34INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4`
32AC_SUBST(INDICATORDIR)35AC_SUBST(INDICATORDIR)
3336
3437
=== modified file 'debian/control'
--- debian/control 2013-02-20 16:35:10 +0000
+++ debian/control 2013-07-05 22:43:22 +0000
@@ -13,6 +13,7 @@
13 libcanberra-dev,13 libcanberra-dev,
14 libgtk-3-dev,14 libgtk-3-dev,
15 libindicator3-dev,15 libindicator3-dev,
16 libido3-0.1-dev (>= 13.10.0),
16 liblightdm-gobject-1-dev (>= 1.4.0),17 liblightdm-gobject-1-dev (>= 1.4.0),
17 valac-0.16,18 valac-0.16,
18 xvfb,19 xvfb,
1920
=== modified file 'src/config.vapi'
--- src/config.vapi 2013-01-30 20:31:38 +0000
+++ src/config.vapi 2013-07-05 22:43:22 +0000
@@ -5,6 +5,7 @@
5 public const string LOCALEDIR;5 public const string LOCALEDIR;
6 public const string VERSION;6 public const string VERSION;
7 public const string CONFIG_FILE;7 public const string CONFIG_FILE;
8 public const string INDICATOR_FILE_DIR;
8 public const string PKGDATADIR;9 public const string PKGDATADIR;
9 public const string INDICATORDIR;10 public const string INDICATORDIR;
10 public const string GSD_BINARY;11 public const string GSD_BINARY;
1112
=== modified file 'src/indicator.vapi'
--- src/indicator.vapi 2011-07-08 01:08:52 +0000
+++ src/indicator.vapi 2013-07-05 22:43:22 +0000
@@ -1,5 +1,3 @@
1/* indicator3.vapi generated by vapigen, do not modify. */
2
3[CCode (cprefix = "Indicator", lower_case_cprefix = "indicator_")]1[CCode (cprefix = "Indicator", lower_case_cprefix = "indicator_")]
4namespace Indicator {2namespace Indicator {
5 [CCode (cheader_filename = "gtk/gtk.h,libindicator/indicator.h,libindicator/indicator-desktop-shortcuts.h,libindicator/indicator-image-helper.h,libindicator/indicator-object.h,libindicator/indicator-service.h,libindicator/indicator-service-manager.h")]3 [CCode (cheader_filename = "gtk/gtk.h,libindicator/indicator.h,libindicator/indicator-desktop-shortcuts.h,libindicator/indicator-image-helper.h,libindicator/indicator-object.h,libindicator/indicator-service.h,libindicator/indicator-service-manager.h")]
@@ -38,6 +36,7 @@
38 [NoWrapper]36 [NoWrapper]
39 public virtual unowned string get_name_hint ();37 public virtual unowned string get_name_hint ();
40 public virtual bool get_show_now (Indicator.ObjectEntry entry);38 public virtual bool get_show_now (Indicator.ObjectEntry entry);
39 public virtual int get_position ();
41 [NoWrapper]40 [NoWrapper]
42 public virtual void reserved1 ();41 public virtual void reserved1 ();
43 [NoWrapper]42 [NoWrapper]
@@ -48,8 +47,6 @@
48 public virtual void reserved4 ();47 public virtual void reserved4 ();
49 [NoWrapper]48 [NoWrapper]
50 public virtual void reserved5 ();49 public virtual void reserved5 ();
51 [NoWrapper]
52 public virtual void reserved6 ();
53 public void set_environment (string[] env);50 public void set_environment (string[] env);
54 public virtual signal void accessible_desc_update (Indicator.ObjectEntry entry);51 public virtual signal void accessible_desc_update (Indicator.ObjectEntry entry);
55 public virtual signal void entry_added (Indicator.ObjectEntry entry);52 public virtual signal void entry_added (Indicator.ObjectEntry entry);
@@ -59,6 +56,11 @@
59 public virtual signal void menu_show (Indicator.ObjectEntry entry, uint timestamp);56 public virtual signal void menu_show (Indicator.ObjectEntry entry, uint timestamp);
60 public virtual signal void show_now_changed (Indicator.ObjectEntry entry, bool show_now_state);57 public virtual signal void show_now_changed (Indicator.ObjectEntry entry, bool show_now_state);
61 }58 }
59 [CCode (cheader_filename = "libindicator/indicator-ng.h")]
60 public class Ng : Object {
61 [CCode (has_construct_function = false)]
62 public Ng.for_profile (string filename, string profile) throws GLib.Error;
63 }
62 [Compact]64 [Compact]
63 [CCode (cheader_filename = "gtk/gtk.h,libindicator/indicator.h,libindicator/indicator-desktop-shortcuts.h,libindicator/indicator-image-helper.h,libindicator/indicator-object.h,libindicator/indicator-service.h,libindicator/indicator-service-manager.h")]65 [CCode (cheader_filename = "gtk/gtk.h,libindicator/indicator.h,libindicator/indicator-desktop-shortcuts.h,libindicator/indicator-image-helper.h,libindicator/indicator-object.h,libindicator/indicator-service.h,libindicator/indicator-service-manager.h")]
64 public class ObjectEntry {66 public class ObjectEntry {
@@ -156,3 +158,8 @@
156 [CCode (cheader_filename = "gtk/gtk.h,libindicator/indicator.h,libindicator/indicator-desktop-shortcuts.h,libindicator/indicator-image-helper.h,libindicator/indicator-object.h,libindicator/indicator-service.h,libindicator/indicator-service-manager.h")]158 [CCode (cheader_filename = "gtk/gtk.h,libindicator/indicator.h,libindicator/indicator-desktop-shortcuts.h,libindicator/indicator-image-helper.h,libindicator/indicator-object.h,libindicator/indicator-service.h,libindicator/indicator-service-manager.h")]
157 public static void image_helper_update (Gtk.Image image, string name);159 public static void image_helper_update (Gtk.Image image, string name);
158}160}
161
162[CCode (cheader_filename="libido/libido.h", lower_case_cprefix = "ido_")]
163namespace Ido {
164 public void init ();
165}
159166
=== modified file 'src/menubar.vala'
--- src/menubar.vala 2013-03-04 19:10:23 +0000
+++ src/menubar.vala 2013-07-05 22:43:22 +0000
@@ -322,6 +322,53 @@
322 return keyboard_item;322 return keyboard_item;
323 }323 }
324324
325 private Indicator.Object? load_indicator_file (string indicator_name)
326 {
327 string dir = Config.INDICATOR_FILE_DIR;
328 string path;
329 Indicator.Object io;
330
331 /* To stay backwards compatible, use com.canonical.indicator as the default prefix */
332 if (indicator_name.index_of_char ('.') < 0)
333 path = @"$dir/com.canonical.indicator.$indicator_name";
334 else
335 path = @"$dir/$indicator_name";
336
337 try
338 {
339 io = new Indicator.Ng.for_profile (path, "desktop_greeter");
340 }
341 catch (FileError error)
342 {
343 /* the calling code handles file-not-found; don't warn here */
344 return null;
345 }
346 catch (Error error)
347 {
348 warning ("unable to load %s: %s", indicator_name, error.message);
349 return null;
350 }
351
352 return io;
353 }
354
355 private Indicator.Object? load_indicator_library (string indicator_name)
356 {
357 // Find file, if it exists
358 string[] names_to_try = {"lib" + indicator_name + ".so",
359 indicator_name + ".so",
360 indicator_name};
361 foreach (var filename in names_to_try)
362 {
363 var full_path = Path.build_filename (Config.INDICATORDIR, filename);
364 var io = new Indicator.Object.from_file (full_path);
365 if (io != null)
366 return io;
367 }
368
369 return null;
370 }
371
325 private void load_indicator (string indicator_name)372 private void load_indicator (string indicator_name)
326 {373 {
327 if (indicator_name == "ug-keyboard")374 if (indicator_name == "ug-keyboard")
@@ -336,24 +383,18 @@
336 }383 }
337 else384 else
338 {385 {
339 // Find file, if it exists386 var io = load_indicator_file (indicator_name);
340 string[] names_to_try = {"lib" + indicator_name + ".so",387
341 indicator_name + ".so",388 if (io == null)
342 indicator_name};389 io = load_indicator_library (indicator_name);
343 foreach (var filename in names_to_try)390
391 if (io != null)
344 {392 {
345 var full_path = Path.build_filename (Config.INDICATORDIR, filename);
346 var io = new Indicator.Object.from_file (full_path);
347 if (io == null)
348 continue;
349
350 indicator_objects.append (io);393 indicator_objects.append (io);
351 io.entry_added.connect (indicator_added_cb);394 io.entry_added.connect (indicator_added_cb);
352 io.entry_removed.connect (indicator_removed_cb);395 io.entry_removed.connect (indicator_removed_cb);
353 foreach (var entry in io.get_entries ())396 foreach (var entry in io.get_entries ())
354 indicator_added_cb (io, entry);397 indicator_added_cb (io, entry);
355
356 break;
357 }398 }
358 }399 }
359 }400 }
@@ -387,6 +428,18 @@
387 foreach (var indicator in indicator_list)428 foreach (var indicator in indicator_list)
388 load_indicator(indicator);429 load_indicator(indicator);
389430
431 indicator_objects.sort((a, b) => {
432 int pos_a = a.get_position ();
433 int pos_b = b.get_position ();
434
435 if (pos_a < 0)
436 pos_a = 1000;
437 if (pos_b < 0)
438 pos_b = 1000;
439
440 return pos_a - pos_b;
441 });
442
390 debug ("LANG=%s LANGUAGE=%s", Environment.get_variable ("LANG"), Environment.get_variable ("LANGUAGE"));443 debug ("LANG=%s LANGUAGE=%s", Environment.get_variable ("LANG"), Environment.get_variable ("LANGUAGE"));
391 }444 }
392445
393446
=== modified file 'src/unity-greeter.vala'
--- src/unity-greeter.vala 2013-02-20 16:17:42 +0000
+++ src/unity-greeter.vala 2013-07-05 22:43:22 +0000
@@ -434,6 +434,7 @@
434 }434 }
435435
436 Gtk.init (ref args);436 Gtk.init (ref args);
437 Ido.init ();
437438
438 log_timer = new Timer ();439 log_timer = new Timer ();
439 Log.set_default_handler (log_cb);440 Log.set_default_handler (log_cb);

Subscribers

People subscribed via source and target branches