diff --git a/src/client/spark/uicore/Shell/Favorites/FavoritesModel.cs b/src/client/spark/uicore/Shell/Favorites/FavoritesModel.cs deleted file mode 100644 index 84a1391fc..000000000 --- a/src/client/spark/uicore/Shell/Favorites/FavoritesModel.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; - -namespace mbts.ui.shell -{ - public interface IFavorites - { - void add_favorite(IShellWindow window); - void remove_favorite(IShellWindow window); - bool is_favorite(IShellWindow window); - } - - [Export(typeof(IFavorites))] - public class FavoritesModel : IFavorites - { - private const string WORKSPACE_NAMESPACE = "shell_saved_windows"; - [ImportingConstructor] - public FavoritesModel() { - FavoriteWindows = new ObservableCollection(); - } - - public ObservableCollection FavoriteWindows { get; set; } - - public void add_favorite(IShellWindow window) { - throw new NotImplementedException(); - } - - public void remove_favorite(IShellWindow window) { - throw new NotImplementedException(); - } - - public bool is_favorite(IShellWindow window) { - throw new NotImplementedException(); - } - - public ICommand restore_favorite { - get { - return new DelegateCommand(name => { - throw new NotImplementedException(); - }); - } - } - } - -} diff --git a/src/client/spark/uicore/Shell/ShellMetaModule/MetaShellMenuModule.cs b/src/client/spark/uicore/Shell/ShellMetaModule/MetaShellMenuModule.cs index ad2ed8b44..7a8d6279b 100644 --- a/src/client/spark/uicore/Shell/ShellMetaModule/MetaShellMenuModule.cs +++ b/src/client/spark/uicore/Shell/ShellMetaModule/MetaShellMenuModule.cs @@ -30,7 +30,7 @@ namespace mbts.ui.shell public MetaShellMenuModule(IViewLocator view, WorkspacesModel model, [Import("workspace")]string initial_workspace, IUndoActions undo, IBrowserWindowManager ibwm) { _viewfinder = view; - _viewmodel = new MetaShellMenuViewModel(model, null, undo as UndoModel, ibwm); + _viewmodel = new MetaShellMenuViewModel(model, undo as UndoModel, ibwm); model.init(initial_workspace).ignore(); _bwm = ibwm; } diff --git a/src/client/spark/uicore/Shell/ShellMetaModule/MetaShellMenuViewModel.cs b/src/client/spark/uicore/Shell/ShellMetaModule/MetaShellMenuViewModel.cs index 4423372a2..23980b25f 100644 --- a/src/client/spark/uicore/Shell/ShellMetaModule/MetaShellMenuViewModel.cs +++ b/src/client/spark/uicore/Shell/ShellMetaModule/MetaShellMenuViewModel.cs @@ -13,12 +13,10 @@ namespace mbts.ui.shell public class MetaShellMenuViewModel : ViewModelBaseWithValidation { private WorkspacesModel _work_model; - private FavoritesModel _fav_model; private UndoModel _undo_model; - public MetaShellMenuViewModel(WorkspacesModel wmodel, FavoritesModel fmodel, UndoModel umodel, IBrowserWindowManager browser) { + public MetaShellMenuViewModel(WorkspacesModel wmodel, UndoModel umodel, IBrowserWindowManager browser) { _work_model = wmodel; - _fav_model = fmodel; _undo_model = umodel; ShowWorkspaces = true; ShowUndo = true; @@ -60,12 +58,6 @@ namespace mbts.ui.shell public ICommand manual_command { get; private set; } - - public FavoritesModel Favorites { get; private set; } - #region Favorites - #endregion - - public ObservableCollection UndoItems { get { return _undo_model == null ? null : _undo_model.Items; } } public bool ShowUndo { get; set; } } diff --git a/src/client/spark/view/Shell/ViewModels/ShellWindowVM.cs b/src/client/spark/view/Shell/ViewModels/ShellWindowVM.cs index f7138c930..94531cf3c 100644 --- a/src/client/spark/view/Shell/ViewModels/ShellWindowVM.cs +++ b/src/client/spark/view/Shell/ViewModels/ShellWindowVM.cs @@ -21,17 +21,15 @@ namespace mbts.ui.shell IShellWindow _model; UIElement _ui; IWindowManager _wm; - IFavorites _favorites; Dispatcher _dispatcher; HwndContentHost _hwnd_host; - public ShellWindowVM(IShellWindow model, IWindowManager wm, IFavorites favorites, IShellThreadFactory threads, string host = "") { + public ShellWindowVM(IShellWindow model, IWindowManager wm, IShellThreadFactory threads, string host = "") { Logger.assert(model != null); _model = model; _model.TitleChanged += () => RaisePropertyChanged("Title"); _model.IconChanged += () => { _icon = null; RaisePropertyChanged("Icon"); }; _wm = wm; - _favorites = favorites; host_id = host; ShellThreadFactory stf = (ShellThreadFactory)threads; diff --git a/src/client/spark/view/Shell/WindowManager.cs b/src/client/spark/view/Shell/WindowManager.cs index 5f7ec6363..78bb92fd1 100644 --- a/src/client/spark/view/Shell/WindowManager.cs +++ b/src/client/spark/view/Shell/WindowManager.cs @@ -28,7 +28,6 @@ namespace mbts.ui.shell { ObservableCollection _documents; Dictionary _windows = new Dictionary(); - IFavorites _favorites; IShellThreadFactory _threads; Lazy _window_settings; ISavedWindowFactory _window_factory; @@ -37,10 +36,9 @@ namespace mbts.ui.shell [ImportingConstructor] public WindowManager(ObservableCollection windows, - IShellThreadFactory threads, IFavorites favorites, Lazy settings, + IShellThreadFactory threads, Lazy settings, ISavedWindowFactory factory, IUndoActions undo, IBus bus) { Windows = windows; - _favorites = favorites; _threads = threads; _window_settings = settings; _window_factory = factory; @@ -61,7 +59,7 @@ namespace mbts.ui.shell if (!Application.Current.Dispatcher.CheckAccess()) { return Application.Current.Dispatcher.Invoke(() => { return OnNewDocument(model); }); } - var viewmodel = new ShellWindowVM(model, this, _favorites, _threads); + var viewmodel = new ShellWindowVM(model, this, _threads); var content = new TabDocument(this, viewmodel); var state = model.start_position(); if (state != null) { diff --git a/src/client/spark/view/Tests/TestFavorites.cs b/src/client/spark/view/Tests/TestFavorites.cs deleted file mode 100644 index 18133fc15..000000000 --- a/src/client/spark/view/Tests/TestFavorites.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using mbts.ui.shell; - -namespace mbts.ui.tests -{ - class TestFavorites : IFavorites - { - public void add_favorite(IShellWindow window) { - } - - public void remove_favorite(IShellWindow window) { - } - - public bool is_favorite(IShellWindow window) { - return true; - } - } -} diff --git a/src/client/spark/view/Tests/WindowManagementTests.cs b/src/client/spark/view/Tests/WindowManagementTests.cs index 9af6de7b2..7d225a595 100644 --- a/src/client/spark/view/Tests/WindowManagementTests.cs +++ b/src/client/spark/view/Tests/WindowManagementTests.cs @@ -76,7 +76,7 @@ namespace mbts.ui.tests // Make sure that an IShellWindow and ISlowWindow added to the Windows collection is eventually disposed ObservableCollection windows = new ObservableCollection(); var thread_factory = new ShellThreadFactory(); - IWindowManager wm = new WindowManager(windows, thread_factory, new TestFavorites(), new Lazy(() => new TestSettingsCollector()), new TestSavedWindowFactory(), new TestUndo(), new SingletonBus()); + IWindowManager wm = new WindowManager(windows, thread_factory, new Lazy(() => new TestSettingsCollector()), new TestSavedWindowFactory(), new TestUndo(), new SingletonBus()); Assert.IsNotNull(Application.Current); Assert.IsNotNull(Application.Current.Windows); Assert.AreEqual(Application.Current.Windows.Count, 0); @@ -102,7 +102,7 @@ namespace mbts.ui.tests // Make sure that an IShellWindow and ISlowWindow added to the Windows collection is eventually disposed ObservableCollection windows = new ObservableCollection(); var thread_factory = new ShellThreadFactory(); - IWindowManager wm = new WindowManager(windows, thread_factory, new TestFavorites(), new Lazy(() => new TestSettingsCollector()), new TestSavedWindowFactory(), new TestUndo(), new SingletonBus()); + IWindowManager wm = new WindowManager(windows, thread_factory, new Lazy(() => new TestSettingsCollector()), new TestSavedWindowFactory(), new TestUndo(), new SingletonBus()); Assert.AreEqual(Application.Current.Windows.Count, 0); // an ISlowWindow gets its own thread