~ubuntu-branches/ubuntu/raring/banshee/raring

« back to all changes in this revision

Viewing changes to debian/patches/0004-Enable-switching-between-the-2-interfaces.patch

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2012-01-23 23:16:49 UTC
  • mfrom: (6.3.22 experimental)
  • Revision ID: package-import@ubuntu.com-20120123231649-safm1f8eycltcgsf
Tags: 2.3.4.ds-1ubuntu1
* Merge from Debian Experimental, remaining changes:
  + Enable and recommend SoundMenu and Disable NotificationArea by default
  + Disable boo and karma extensions
  + Enable and suggest u1ms
  + Move desktop file for Meego UI to /usr/share/une/applications
  + Change the url for the Amazon store redirector
  + [08dea2c] Revert "Fix invalid cast causing ftbfs with libgpod"
* [b617fe0] Convert Ubuntu-specific patches to gbp-pq patches
* Also fixes Launchpad bugs:
  - Fixes race condition while starting (LP: #766303)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Didier Roche <didrocks@ubuntu.com>
 
2
Date: Mon, 5 Jul 2010 13:15:27 +0200
 
3
Subject: Enable switching between the 2 interfaces
 
4
 
 
5
This enables switching between the 2 interfaces, even when the classic interface
 
6
is started.
 
7
---
 
8
 .../Resources/core-ui-actions-layout.xml           |    1 +
 
9
 .../Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs      |    9 ++++
 
10
 .../Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs    |   42 ++++++++++++++++++-
 
11
 3 files changed, 49 insertions(+), 3 deletions(-)
 
12
 
 
13
diff --git a/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml b/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml
 
14
index 7908e13..0b8edb0 100644
 
15
--- a/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml
 
16
+++ b/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml
 
17
@@ -5,6 +5,7 @@
 
18
     <placeholder name="NextArrowButton"/>
 
19
     <placeholder name="SeekSlider"/>
 
20
     <placeholder name="TrackInfoDisplay"/>
 
21
+    <placeholder name="ExtensionToolBarPlaceHolder"/>
 
22
     <placeholder name="SourceActions">
 
23
         <toolitem name="RefreshSmartPlaylist" action="RefreshSmartPlaylistAction"/>
 
24
     </placeholder>
 
25
diff --git a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
 
26
index 6fad319..9f16ba7 100644
 
27
--- a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
 
28
+++ b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoPanel.cs
 
29
@@ -105,9 +105,18 @@ namespace Banshee.MeeGo
 
30
 
 
31
         public void Hide ()
 
32
         {
 
33
+            window_panel.Hide ();
 
34
             if (embedded_panel != null) {
 
35
                 embedded_panel.Hide ();
 
36
             }
 
37
         }
 
38
+
 
39
+        public void Show ()
 
40
+        {
 
41
+            window_panel.Show ();
 
42
+            if (embedded_panel != null) {
 
43
+                embedded_panel.Show ();
 
44
+            }
 
45
+        }
 
46
     }
 
47
 }
 
48
diff --git a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
 
49
index 5aae94e..d615b4e 100644
 
50
--- a/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
 
51
+++ b/src/Extensions/Banshee.MeeGo/Banshee.MeeGo/MeeGoService.cs
 
52
@@ -26,6 +26,7 @@
 
53
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
54
 //
 
55
 
 
56
+using Mono.Unix;
 
57
 using System;
 
58
 using Gtk;
 
59
 using MeeGo.Panel;
 
60
@@ -38,6 +39,7 @@ using Banshee.Sources;
 
61
 using Banshee.ServiceStack;
 
62
 using Banshee.MediaEngine;
 
63
 using Banshee.Gui;
 
64
+using Banshee.Gui.Widgets;
 
65
 
 
66
 namespace Banshee.MeeGo
 
67
 {
 
68
@@ -84,6 +86,7 @@ namespace Banshee.MeeGo
 
69
             }
 
70
 
 
71
             Initialize ();
 
72
+            AddSwitchToPrimaryInterface ();
 
73
 
 
74
             ServiceManager.ServiceStarted -= OnServiceStarted;
 
75
 
 
76
@@ -100,12 +103,12 @@ namespace Banshee.MeeGo
 
77
             panel = MeeGoPanel.Instance;
 
78
 
 
79
             if (panel == null) {
 
80
-                Log.Warning ("Netbook extension initialized without a panel");
 
81
+                Log.Information ("Netbook extension initialized with hidden panel");
 
82
+                //AddSwitchToPrimaryInterface ();
 
83
                 return;
 
84
-            } else {
 
85
-                elements_service.PrimaryWindow.Hide ();
 
86
             }
 
87
 
 
88
+            elements_service.PrimaryWindow.Hide ();
 
89
             panel.BuildContents ();
 
90
 
 
91
             elements_service.PrimaryWindowClose = () => {
 
92
@@ -115,8 +118,30 @@ namespace Banshee.MeeGo
 
93
 
 
94
         }
 
95
 
 
96
+        private void AddSwitchToPrimaryInterface ()
 
97
+        {
 
98
+            // Add switcher to primary interface:
 
99
+            var app_button = new Button (new Image () {
 
100
+                IconSize = (int)IconSize.LargeToolbar,
 
101
+                IconName = "media-player-banshee"
 
102
+            }) {
 
103
+                TooltipText = Catalog.GetString ("Show the Netbook interface")
 
104
+            };
 
105
+            app_button.Clicked += (o, e) => {
 
106
+                //ServiceManager.SourceManager.SetActiveSource (ServiceManager.SourceManager.MusicLibrary);
 
107
+                ServiceManager.Get<MeeGoService> ().PresentNetbookInterface ();
 
108
+            };
 
109
+            Toolbar header_toolbar;
 
110
+            InterfaceActionService action_service;
 
111
+            action_service = ServiceManager.Get<InterfaceActionService> ();
 
112
+            header_toolbar = (Toolbar)action_service.UIManager.GetWidget ("/HeaderToolbar");
 
113
+            app_button.ShowAll ();
 
114
+            action_service.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ExtensionToolBarPlaceHolder", app_button);
 
115
+        }
 
116
+
 
117
         public void PresentPrimaryInterface ()
 
118
         {
 
119
+            Log.Information ("Switch to traditional interface");
 
120
             elements_service.PrimaryWindow.Maximize ();
 
121
             elements_service.PrimaryWindow.Present ();
 
122
             if (panel != null) {
 
123
@@ -124,6 +149,17 @@ namespace Banshee.MeeGo
 
124
             }
 
125
         }
 
126
 
 
127
+        public void PresentNetbookInterface ()
 
128
+        {
 
129
+            Log.Information ("Switch to Netbook interface");
 
130
+            if (panel == null) {
 
131
+                panel = new MeeGoPanel ();
 
132
+                Initialize ();
 
133
+            }
 
134
+            panel.Show ();
 
135
+            elements_service.PrimaryWindow.Hide ();
 
136
+        }
 
137
+
 
138
         public void Dispose ()
 
139
         {
 
140
             if (panel != null) {
 
141
--