[banshee] [MeeGo] Enforce --mutter-panel option better



commit 8941eb023d34dd7467ff4123cbac53dbee361a5d
Author: Aaron Bockover <abockover novell com>
Date:   Wed Mar 31 13:40:44 2010 -0400

    [MeeGo] Enforce --mutter-panel option better

 .../Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs      |   13 +++++++++++++
 .../Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs    |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
index f24ffd1..320c646 100644
--- a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
+++ b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
@@ -42,6 +42,7 @@ namespace Banshee.MeeGo
         private Window window_panel;
 
         public MediaPanelContents Contents { get; private set; }
+        public bool Enabled { get; private set; }
 
         public MeeGoPanel ()
         {
@@ -51,6 +52,14 @@ namespace Banshee.MeeGo
 
             Instance = this;
 
+            if (!ApplicationContext.CommandLine.Contains ("mutter-panel")) {
+                Log.Debug ("MeeGo extension enabled, but --mutter-panel not " +
+                    "passed to command line; disabling panel integration.");
+                return;
+            }
+
+            Enabled = true;
+
             var timer = Log.DebugTimerStart ();
 
             try {
@@ -75,6 +84,10 @@ namespace Banshee.MeeGo
 
         public void BuildContents ()
         {
+            if (!Enabled) {
+                return;
+            }
+
             var timer = Log.DebugTimerStart ();
             Contents = new MediaPanelContents ();
             Contents.ShowAll ();
diff --git a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
index 8194c58..c46c4bf 100644
--- a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
+++ b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
@@ -56,7 +56,7 @@ namespace Banshee.MeeGo
             // We need to create the MeeGo panel connection as soon as possible
             // to keep mutter-moblin's toolbar from thinking we crashed (timing out).
             // The contents of the panel will be constructed later on.
-            if (ApplicationContext.CommandLine.Contains ("mutter-panel")) {
+            if (MeeGoPanel.Instance.Enabled) {
                 panel = MeeGoPanel.Instance;
             }
 



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