ui: Fix starting Rygel after enabling DLNA
authorJens Georg <jensg@openismus.com>
Tue, 30 Apr 2013 03:09:01 +0000 (05:09 +0200)
committerJens Georg <jensg@openismus.com>
Tue, 30 Apr 2013 08:39:23 +0000 (10:39 +0200)
src/ui/rygel-preferences-dialog.vala
src/ui/rygel-writable-user-config.vala

index 970deef..184e456 100644 (file)
@@ -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) {
index cec92a6..ab5b01f 100644 (file)
@@ -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,