← Back to team overview

deja-dup-team team mailing list archive

[Merge] lp:~kaie/deja-dup/deja-dup into lp:deja-dup

 

Kai Engert has proposed merging lp:~kaie/deja-dup/deja-dup into lp:deja-dup.

Requested reviews:
  Déjà Dup Developers (deja-dup-hackers)

For more details, see:
https://code.launchpad.net/~kaie/deja-dup/deja-dup/+merge/153656

Show status icon in Cinnamon.
See https://bugs.launchpad.net/deja-dup/+bug/1155929

-- 
https://code.launchpad.net/~kaie/deja-dup/deja-dup/+merge/153656
Your team Déjà Dup Developers is requested to review the proposed merge of lp:~kaie/deja-dup/deja-dup into lp:deja-dup.
=== modified file 'widgets/WidgetUtils.vala'
--- widgets/WidgetUtils.vala	2011-10-08 19:57:36 +0000
+++ widgets/WidgetUtils.vala	2013-03-16 12:40:29 +0000
@@ -41,6 +41,11 @@
   LEGACY
 }
 
+[DBus (name = "org.Cinnamon")]
+public interface Cinnamon : GLib.Object {
+    public abstract string CinnamonVersion { owned get; }
+}
+
 protected ShellEnv shell = ShellEnv.NONE;
 public ShellEnv get_shell()
 {
@@ -61,8 +66,19 @@
         else if (cap == "actions")
           actions = true;
       }
-      if (persistence && actions)
-        shell = ShellEnv.GNOME;
+      if (persistence && actions) {
+	string cv = null;
+	try {
+	    Cinnamon c = GLib.Bus.get_proxy_sync (BusType.SESSION, "org.Cinnamon", "/org/Cinnamon");
+	    cv = c.CinnamonVersion;
+	} catch (Error e) {}
+	if (cv != null) {
+	  // Detected Cinnamon which should get the Legacy behaviour.
+	  shell = ShellEnv.LEGACY;
+	}
+	else
+	  shell = ShellEnv.GNOME;
+      }
       else
         shell = ShellEnv.LEGACY;
     }


Follow ups