~ubuntu-branches/ubuntu/trusty/banshee/trusty

« back to all changes in this revision

Viewing changes to src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2014-02-09 23:06:03 UTC
  • mfrom: (1.2.26) (150.1.2 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140209230603-7dhbveo058j96ea0
Tags: 2.9.0+really2.6.1-0ubuntu1
* [fbf05ca] Imported Upstream version 2.9.0+really2.6.1:
  Downgrade to 2.6.1 -- 2.9.x is unstable and 3.0 won't arrive in time for
  release
* [22de440] Revert packaging to 2.6.1-2ubuntu1
* [7357b73] Merge changes from 2.6.1-5
* [a7156c0] Filter out libgpod-cil-dev versions built against gtk#3
* [e7c634d] Update dversionmangle for extracting +really version out

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
        private InterfaceActionService action_service;
63
63
        private ActionGroup configure_browser_actions;
64
 
        private static readonly string name = "albumartist";
65
 
 
66
 
        public static readonly SchemaEntry<int> PaneTopPosition = new SchemaEntry<int> (
67
 
            String.Format ("{0}.{1}.browser.top", PersistentPaneController.NamespacePrefix, name),
68
 
            "position",
69
 
            DEFAULT_PANE_TOP_POSITION,
70
 
            "Artist/Album Browser Container Top Position",
71
 
            "The position of the Artist/Album browser pane container, when placed at the top"
72
 
        );
73
 
 
74
 
        public static readonly SchemaEntry<int> PaneLeftPosition = new SchemaEntry<int> (
75
 
            String.Format ("{0}.{1}.browser.left", PersistentPaneController.NamespacePrefix, name),
76
 
            "position",
77
 
            DEFAULT_PANE_LEFT_POSITION,
78
 
            "Artist/Album Browser Container Left Position",
79
 
            "The position of the Artist/Album browser pane container, when placed on the left"
80
 
        );
81
64
 
82
65
        private static string menu_xml = @"
83
66
            <ui>
100
83
            </ui>
101
84
        ";
102
85
 
103
 
        public CompositeTrackSourceContents () : base (name, PaneTopPosition, PaneLeftPosition)
 
86
        public CompositeTrackSourceContents () : base ("albumartist")
104
87
        {
105
88
            if (ServiceManager.Contains ("InterfaceActionService")) {
106
89
                action_service = ServiceManager.Get<InterfaceActionService> ();
200
183
 
201
184
        private void OnArtistFilterChanged (object o, ChangedArgs args)
202
185
        {
203
 
            var new_artist_view = args.Current.Value == 0 ? artist_view : albumartist_view;
204
 
            var old_artist_view = args.Current.Value == 1 ? artist_view : albumartist_view;
205
 
 
206
 
            SwapView (old_artist_view, new_artist_view);
207
 
            ArtistFilterType.Set (args.Current.Value == 1 ? "albumartist" : "artist");
208
 
        }
209
 
 
210
 
        private void SwapView<T> (ListView<T> oldView, ListView<T> newView)
211
 
        {
 
186
            Widget new_artist_view = args.Current.Value == 0 ? artist_view : albumartist_view;
 
187
            Widget old_artist_view = args.Current.Value == 1 ? artist_view : albumartist_view;
 
188
 
212
189
            List<ScrolledWindow> new_filter_list = new List<ScrolledWindow> ();
213
190
            List<ScrolledWindow> old_filter_list = new List<ScrolledWindow> (filter_scrolled_windows);
214
191
 
216
193
            {
217
194
                bool contains = false;
218
195
                foreach (Widget child in fw.AllChildren) {
219
 
                    if (child == oldView) {
 
196
                    if (child == old_artist_view) {
220
197
                        contains = true;
221
198
                    }
222
199
                }
223
200
 
224
201
                if (contains) {
225
 
                    Widget view_widget = (Widget)newView;
 
202
                    Widget view_widget = (Widget)new_artist_view;
226
203
                    if (view_widget.Parent == null) {
227
 
                        SetupFilterView (newView);
 
204
                        SetupFilterView (new_artist_view as ArtistListView);
228
205
                    }
229
206
 
230
207
                    ScrolledWindow win = (ScrolledWindow)view_widget.Parent;
240
217
            ClearFilterSelections ();
241
218
 
242
219
            Layout ();
 
220
 
 
221
            ArtistFilterType.Set (args.Current.Value == 1 ? "albumartist" : "artist");
243
222
        }
244
223
 
245
224
        protected override void InitializeViews ()
252
231
                genre_view_widget.Parent.Visible = GenreFilterVisible.Get ();
253
232
            };
254
233
 
255
 
            artist_view = new ArtistListView ();
256
 
            albumartist_view = new ArtistListView ();
257
234
            if (ArtistFilterType.Get ().Equals ("artist")) {
258
 
                SetupFilterView (artist_view);
 
235
                SetupFilterView (artist_view = new ArtistListView ());
259
236
                artist_view.Parent.Shown += delegate {
260
237
                    artist_view.Parent.Visible = ArtistFilterVisible.Get ();
261
238
                };
 
239
                albumartist_view = new ArtistListView ();
262
240
            } else {
263
 
                SetupFilterView (albumartist_view);
 
241
                SetupFilterView (albumartist_view = new ArtistListView ());
264
242
                albumartist_view.Parent.Shown += delegate {
265
243
                    albumartist_view.Parent.Visible = ArtistFilterVisible.Get ();
266
244
                };
 
245
                artist_view = new ArtistListView ();
267
246
            }
268
247
 
269
248
            SetupFilterView (year_view = new YearListView ());