diff options
| author | jacob1 <jfu614@gmail.com> | 2013-07-25 23:43:25 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-07-25 23:43:25 (GMT) |
| commit | bfc1cf99cabd5b75f70a8de39cc4b00c408fc6b8 (patch) | |
| tree | 644bbe8435b3f31c738325cf55419860dd9fa6f4 /src/gui/search | |
| parent | beff3db8d291b00b47fc13a1b936fa4419e3d78d (diff) | |
| download | powder-bfc1cf99cabd5b75f70a8de39cc4b00c408fc6b8.zip powder-bfc1cf99cabd5b75f70a8de39cc4b00c408fc6b8.tar.gz | |
instant save option option, hold ctrl when clicking a save in the save preview to skip the entire preview and not load the comments
Diffstat (limited to 'src/gui/search')
| -rw-r--r-- | src/gui/search/SearchController.cpp | 13 | ||||
| -rw-r--r-- | src/gui/search/SearchController.h | 2 | ||||
| -rw-r--r-- | src/gui/search/SearchView.cpp | 4 |
3 files changed, 13 insertions, 6 deletions
diff --git a/src/gui/search/SearchController.cpp b/src/gui/search/SearchController.cpp index 0a8ad9e..bd3e4d8 100644 --- a/src/gui/search/SearchController.cpp +++ b/src/gui/search/SearchController.cpp @@ -36,6 +36,7 @@ SearchController::SearchController(ControllerCallback * callback): HasExited(false), nextQueryTime(0.0f), nextQueryDone(true), + instantOpen(false), searchModel(NULL) { searchModel = new SearchModel(); @@ -46,9 +47,6 @@ SearchController::SearchController(ControllerCallback * callback): searchModel->UpdateSaveList(1, ""); this->callback = callback; - - //Set up interface - //windowPanel.AddChild(); } SaveInfo * SearchController::GetLoadedSave() @@ -180,13 +178,18 @@ void SearchController::Selected(int saveID, bool selected) searchModel->DeselectSave(saveID); } +void SearchController::InstantOpen(bool instant) +{ + instantOpen = instant; +} + void SearchController::OpenSave(int saveID) { if(activePreview) delete activePreview; Graphics * g = ui::Engine::Ref().g; g->fillrect(XRES/3, YRES+MENUSIZE-20, XRES/3, 20, 0, 0, 0, 150); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable - activePreview = new PreviewController(saveID, new OpenCallback(this)); + activePreview = new PreviewController(saveID, instantOpen, new OpenCallback(this)); ui::Engine::Ref().ShowWindow(activePreview->GetView()); } @@ -196,7 +199,7 @@ void SearchController::OpenSave(int saveID, int saveDate) delete activePreview; Graphics * g = ui::Engine::Ref().g; g->fillrect(XRES/3, YRES+MENUSIZE-20, XRES/3, 20, 0, 0, 0, 150); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable - activePreview = new PreviewController(saveID, saveDate, new OpenCallback(this)); + activePreview = new PreviewController(saveID, saveDate, instantOpen, new OpenCallback(this)); ui::Engine::Ref().ShowWindow(activePreview->GetView()); } diff --git a/src/gui/search/SearchController.h b/src/gui/search/SearchController.h index 8d811ab..40e0b4a 100644 --- a/src/gui/search/SearchController.h +++ b/src/gui/search/SearchController.h @@ -21,6 +21,7 @@ private: double nextQueryTime; std::string nextQuery; bool nextQueryDone; + bool instantOpen; void removeSelectedC(); void unpublishSelectedC(); public: @@ -37,6 +38,7 @@ public: void ShowOwn(bool show); void ShowFavourite(bool show); void Selected(int saveID, bool selected); + void InstantOpen(bool instant); void OpenSave(int saveID); void OpenSave(int saveID, int saveDate); void Update(); diff --git a/src/gui/search/SearchView.cpp b/src/gui/search/SearchView.cpp index cfa1a3b..662e756 100644 --- a/src/gui/search/SearchView.cpp +++ b/src/gui/search/SearchView.cpp @@ -712,7 +712,9 @@ void SearchView::OnMouseWheel(int x, int y, int d) } void SearchView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) { - if(key==KEY_ESCAPE) + if (key == KEY_ESCAPE) c->Exit(); + if (ctrl) + c->InstantOpen(ctrl); } |
