public CS_ComposerModel(CueSheetsSource s) { MySource = s; _nullComposer = new CS_ComposerInfo(null); _composers = new List <CS_ComposerInfo>(); Selection = new Hyena.Collections.Selection(); }
public SampleModel(string condition, Database db, string aggregates) { Selection = new Hyena.Collections.Selection(); ReloadFragment = String.Format("FROM Samples {0}", condition); SelectAggregates = aggregates; Cache = new SqliteModelCache <MultiUserSample> (db, (id++).ToString(), this, db.SampleProvider); }
public CS_GenreModel(CueSheetsSource s) { MySource = s; _nullGenre = new CS_GenreInfo("<All Genres>"); _genres = new List <CS_GenreInfo>(); Selection = new Hyena.Collections.Selection(); }
public CS_ArtistModel(CueSheetsSource s) { MySource = s; _nullArtist = new CS_ArtistInfo(null); _artists = new List <CS_ArtistInfo>(); Selection = new Hyena.Collections.Selection(); }
public CS_AlbumModel(CueSheetsSource s) { MySource = s; _filteredList = new List <CS_AlbumInfo>(); Selection = new Hyena.Collections.Selection(); _genre = null; Reload(); }
public ProblemModel() { instance = this; Selection = new Hyena.Collections.Selection(); Problem.Initialize(); AddSolvers(); }
public AudiobookModel(AudiobookLibrarySource source, DatabaseTrackListModel trackModel, BansheeDbConnection connection, string uuid) : base(source, trackModel, connection, uuid) { Selection = new Hyena.Collections.Selection(); HasSelectAllItem = false; ReloadFragmentFormat = String.Format(@" FROM CoreAlbums WHERE CoreAlbums.AlbumID IN (SELECT AlbumID FROM CoreTracks WHERE PrimarySourceID = {0}) ORDER BY CoreAlbums.TitleSortKey, CoreAlbums.ArtistNameSortKey", source.DbId); }
public AudiobookModel(AudiobookLibrarySource source, DatabaseTrackListModel trackModel, BansheeDbConnection connection, string uuid) : base(source, trackModel, connection, uuid) { Selection = new Hyena.Collections.Selection (); HasSelectAllItem = false; ReloadFragmentFormat = String.Format (@" FROM CoreAlbums WHERE CoreAlbums.AlbumID IN (SELECT AlbumID FROM CoreTracks WHERE PrimarySourceID = {0}) ORDER BY CoreAlbums.TitleSortKey, CoreAlbums.ArtistNameSortKey", source.DbId); }
private void UpdateActions() { Source source = ServiceManager.SourceManager.ActiveSource; bool in_database = source is DatabaseSource; PrimarySource primary_source = (source as PrimarySource) ?? (source.Parent as PrimarySource); Hyena.Collections.Selection selection = (source is ITrackModelSource) ? (source as ITrackModelSource).TrackModel.Selection : null; if (selection != null) { Sensitive = Visible = true; bool has_selection = selection.Count > 0; foreach (string action in require_selection_actions) { this[action].Sensitive = has_selection; } bool has_single_selection = selection.Count == 1; this["SelectAllAction"].Sensitive = !selection.AllSelected; if (source != null) { ITrackModelSource track_source = source as ITrackModelSource; bool is_track_source = track_source != null; UpdateActions(is_track_source && source.CanSearch, has_single_selection, "SearchMenuAction", "SearchForSameArtistAction", "SearchForSameAlbumAction" ); UpdateAction("RemoveTracksAction", is_track_source && track_source.CanRemoveTracks, has_selection, source); UpdateAction("DeleteTracksFromDriveAction", is_track_source && track_source.CanDeleteTracks, has_selection, source); UpdateAction("RemoveTracksFromLibraryAction", source.Parent is LibrarySource, has_selection, null); UpdateAction("TrackPropertiesAction", source.HasViewableTrackProperties, has_selection, source); UpdateAction("TrackEditorAction", source.HasEditableTrackProperties, has_selection, source); UpdateAction("RateTracksAction", in_database, has_selection, null); UpdateAction("AddToPlaylistAction", in_database && primary_source != null && primary_source.SupportsPlaylists && !primary_source.PlaylistsReadOnly, has_selection, null); if (primary_source != null && !(primary_source is LibrarySource)) { this["DeleteTracksFromDriveAction"].Label = String.Format( Catalog.GetString("_Delete From \"{0}\""), primary_source.StorageName); } } } else { Sensitive = Visible = false; } }
private TrackEditorDialog(TrackListModel model, Selection selection, EditorMode mode, bool readonlyTabs) : base( mode == EditorMode.Edit ? Catalog.GetString("Track Editor") : Catalog.GetString("Track Properties")) { readonly_tabs = readonlyTabs; this.mode = mode; LoadTrackModel(model, selection); if (mode == EditorMode.Edit || readonly_tabs) { WidthRequest = 525; if (mode == EditorMode.Edit) { AddStockButton(Stock.Cancel, ResponseType.Cancel); AddStockButton(Stock.Save, ResponseType.Ok); } } else { SetSizeRequest(400, 500); } if (mode == EditorMode.View) { AddStockButton(Stock.Close, ResponseType.Close, true); } tooltip_host = TooltipSetter.CreateHost(); AddNavigationButtons(); main_vbox = new VBox(); main_vbox.Spacing = 12; main_vbox.BorderWidth = 0; main_vbox.Show(); VBox.PackStart(main_vbox, true, true, 0); BuildHeader(); BuildNotebook(); BuildFooter(); LoadModifiers(); LoadTrackToEditor(); HideSingleTab(); }
protected virtual void OnBrowserViewSelectionChanged(object o, EventArgs args) { // If the All item is now selected, scroll to the top Hyena.Collections.Selection selection = (Hyena.Collections.Selection)o; if (selection.AllSelected) { // Find the view associated with this selection; a bit yuck; pass view in args? foreach (IListView view in filter_views) { if (view.Selection == selection) { view.ScrollTo(0); break; } } } }
protected void LoadTrackModel(TrackListModel model, Selection selection) { DatabaseTrackListModel db_model = model as DatabaseTrackListModel; if (db_model != null) { db_selection = CachedList <DatabaseTrackInfo> .CreateFromModelAndSelection(db_model, selection); } else { memory_selection = new List <TrackInfo> (); var items = new ModelSelection <TrackInfo> (model, selection); foreach (TrackInfo track in items) { memory_selection.Add(track); } } }
private void OnDeletePlayingTrackFromDrive(object o, EventArgs args) { var playback_src = ServiceManager.PlaybackController.Source as DatabaseSource; var track = ServiceManager.PlayerEngine.CurrentTrack as DatabaseTrackInfo; if (playback_src != null && track != null) { if (!ConfirmRemove(playback_src, true, 1)) { return; } if (playback_src != null && playback_src.CanDeleteTracks) { var selection = new Hyena.Collections.Selection(); selection.Select(playback_src.TrackModel.IndexOf(track)); playback_src.DeleteTracks(selection); } } }
public void DeleteTracks(Selection selection) { throw new Exception ("Should not call DeleteSelectedTracks on StationSource"); }
public void RemoveTracks(Selection selection) { }
public SampleModel(string condition, Database db, string aggregates) { Selection = new Hyena.Collections.Selection (); ReloadFragment = String.Format ("FROM Samples {0}", condition); SelectAggregates = aggregates; Cache = new SqliteModelCache<MultiUserSample> (db, (id++).ToString (), this, db.SampleProvider); }
public void DeleteTracks (Selection selection) { }
private TrackEditorDialog(TrackListModel model, Selection selection, EditorMode mode) : this(model, selection, mode, false) { }
public CS_TrackListModel() { Selection = new Hyena.Collections.Selection(); store = new List <CueSheetEntry>(); }
private static void Run(TrackListModel model, Selection selection, EditorMode mode, bool readonlyTabs) { Run(new TrackEditorDialog(model, selection, mode, readonlyTabs)); }
public CS_PlayListModel() { _pls = null; Selection = new Hyena.Collections.Selection(); }
public void RemoveTracks(Selection selection) { }
private void OnDeletePlayingTrackFromDrive(object o, EventArgs args) { var playback_src = ServiceManager.PlaybackController.Source as DatabaseSource; var track = ServiceManager.PlayerEngine.CurrentTrack as DatabaseTrackInfo; if (playback_src != null && track != null) { if (!ConfirmRemove (playback_src, true, 1)) { return; } if (playback_src != null && playback_src.CanDeleteTracks) { var selection = new Hyena.Collections.Selection (); selection.Select (playback_src.TrackModel.IndexOf (track)); playback_src.DeleteTracks (selection); } } }
public void DeleteTracks(Selection selection) { throw new Exception("Should not call DeleteSelectedTracks on StationSource"); }
private void HandleActiveSourceChanged(SourceEventArgs args) { FilterFocused = false; if (current_source != null && current_source.TrackModel != null) { current_source.TrackModel.Reloaded -= OnReloaded; current_source.TrackModel.Selection.Changed -= HandleSelectionChanged; current_source = null; } ITrackModelSource new_source = ActiveSource as ITrackModelSource; if (new_source != null) { new_source.TrackModel.Selection.Changed += HandleSelectionChanged; new_source.TrackModel.Reloaded += OnReloaded; current_source = new_source; Selection = new_source.TrackModel.Selection; } ThreadAssist.ProxyToMain (UpdateActions); }
public static void RunEdit(TrackListModel model, Selection selection) { Run(model, selection, EditorMode.Edit); }
public static void RunView(TrackListModel model, Selection selection, bool readonlyTabs) { Run(model, selection, EditorMode.View, readonlyTabs); }
public static void Run(TrackListModel model, Selection selection, EditorMode mode) { Run(new TrackEditorDialog(model, selection, mode)); }
public void DeleteTracks(Selection selection) { }
public SortableMemoryListModel() : base() { Selection = new Hyena.Collections.Selection(); CanReorder = true; }