summaryrefslogtreecommitdiff
path: root/src/preview/PreviewController.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-26 01:13:33 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-26 01:13:33 (GMT)
commit9e1be78bc21d1fb76a19ce12ef36193aea6e2b93 (patch)
tree081b67d551bb44fecbf6deb99b6c44ea9789614c /src/preview/PreviewController.cpp
parentb2d3257ae944a3ea3b57dc8ee4171b1b2f85483e (diff)
downloadpowder-9e1be78bc21d1fb76a19ce12ef36193aea6e2b93.zip
powder-9e1be78bc21d1fb76a19ce12ef36193aea6e2b93.tar.gz
I've got to a point where I can no longer be bothered to think of a proper commit comment
Diffstat (limited to 'src/preview/PreviewController.cpp')
-rw-r--r--src/preview/PreviewController.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/preview/PreviewController.cpp b/src/preview/PreviewController.cpp
index ef5da4e..db3cdee 100644
--- a/src/preview/PreviewController.cpp
+++ b/src/preview/PreviewController.cpp
@@ -8,8 +8,11 @@
#include "PreviewController.h"
#include "PreviewView.h"
#include "PreviewModel.h"
+#include "Controller.h"
-PreviewController::PreviewController(int saveID) {
+PreviewController::PreviewController(int saveID, ControllerCallback * callback):
+ HasExited(false)
+{
// TODO Auto-generated constructor stub
previewModel = new PreviewModel();
previewView = new PreviewView();
@@ -17,6 +20,34 @@ PreviewController::PreviewController(int saveID) {
previewView->AttachController(this);
previewModel->UpdateSave(saveID, 0);
+
+ this->callback = callback;
+}
+
+Save * PreviewController::GetSave()
+{
+ return previewModel->GetSave();
+}
+
+bool PreviewController::GetDoOpen()
+{
+ return previewModel->GetDoOpen();
+}
+
+void PreviewController::DoOpen()
+{
+ previewModel->SetDoOpen(true);
+}
+
+void PreviewController::Exit()
+{
+ if(ui::Engine::Ref().GetWindow() == previewView)
+ {
+ ui::Engine::Ref().CloseWindow();
+ }
+ if(callback)
+ callback->ControllerExit();
+ HasExited = true;
}
PreviewController::~PreviewController() {