[rygel] ui: Fix starting Rygel after enabling DLNA



commit 06ab84672cecad523b9494dc732ef8207ac1e00f
Author: Jens Georg <jensg openismus com>
Date:   Tue Apr 30 05:09:01 2013 +0200

    ui: Fix starting Rygel after enabling DLNA

 src/ui/rygel-preferences-dialog.vala   |    1 +
 src/ui/rygel-writable-user-config.vala |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/ui/rygel-preferences-dialog.vala b/src/ui/rygel-preferences-dialog.vala
index 970deef..184e456 100644
--- a/src/ui/rygel-preferences-dialog.vala
+++ b/src/ui/rygel-preferences-dialog.vala
@@ -69,6 +69,7 @@ public class Rygel.PreferencesDialog : GLib.Object {
 
     public void run () {
         this.dialog.run ();
+        this.dialog.hide ();
 
         this.config.set_upnp_enabled (this.upnp_check.active);
         foreach (var section in this.sections) {
diff --git a/src/ui/rygel-writable-user-config.vala b/src/ui/rygel-writable-user-config.vala
index cec92a6..ab5b01f 100644
--- a/src/ui/rygel-writable-user-config.vala
+++ b/src/ui/rygel-writable-user-config.vala
@@ -176,10 +176,15 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig {
             var dest = this.get_autostart_file ();
 
             if (enable) {
+                var loop = new MainLoop (null, false);
                 // Creating the proxy starts the service
                 Bus.watch_name (BusType.SESSION,
                                 DBusInterface.SERVICE_NAME,
-                                BusNameWatcherFlags.AUTO_START);
+                                BusNameWatcherFlags.AUTO_START,
+                                () => { loop.quit (); },
+                                () => { loop.quit (); });
+
+                loop.run ();
 
                 // Then symlink the desktop file to user's autostart dir
                 var source_path = Path.build_filename (BuildConfig.DESKTOP_DIR,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]