diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-04 15:39:24 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-04 15:39:24 (GMT) |
| commit | f2f4278932e0752c22d15185ce70198077d0b5fd (patch) | |
| tree | d53cc28ba9a9020fc851fb3d89803a52a7d06436 /src/search/SearchController.cpp | |
| parent | 055832270979cdb027c0c30a74cf82c23df13689 (diff) | |
| download | powder-f2f4278932e0752c22d15185ce70198077d0b5fd.zip powder-f2f4278932e0752c22d15185ce70198077d0b5fd.tar.gz | |
Better exiting from windows (Escape and Enter) and 'q' for exit, fixes #35 and #60
Diffstat (limited to 'src/search/SearchController.cpp')
| -rw-r--r-- | src/search/SearchController.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/search/SearchController.cpp b/src/search/SearchController.cpp index 13a252a..f127354 100644 --- a/src/search/SearchController.cpp +++ b/src/search/SearchController.cpp @@ -20,8 +20,13 @@ public: { if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSave()) { - cc->searchModel->SetLoadedSave(new SaveInfo(*(cc->activePreview->GetSave()))); + cc->searchModel->SetLoadedSave(cc->activePreview->GetSave()); } + else + { + cc->searchModel->SetLoadedSave(NULL); + } + } }; @@ -161,6 +166,8 @@ void SearchController::Selected(int saveID, bool selected) void SearchController::OpenSave(int saveID) { + if(activePreview) + delete activePreview; activePreview = new PreviewController(saveID, new OpenCallback(this)); ui::Engine::Ref().ShowWindow(activePreview->GetView()); } |
