summaryrefslogtreecommitdiff
path: root/src/preview/PreviewModel.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-17 18:14:05 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-17 18:14:05 (GMT)
commit2479b8664d5c4cdd47208bdbca970828ba1a2520 (patch)
treed453fa8de5272d83d03a4a72f776c6808c5f641e /src/preview/PreviewModel.cpp
parent2329f98f0af9dffda5375aca7b05f9e76a84d06a (diff)
downloadpowder-2479b8664d5c4cdd47208bdbca970828ba1a2520.zip
powder-2479b8664d5c4cdd47208bdbca970828ba1a2520.tar.gz
Add comment box to save preview - doesn't work yet
Diffstat (limited to 'src/preview/PreviewModel.cpp')
-rw-r--r--src/preview/PreviewModel.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/preview/PreviewModel.cpp b/src/preview/PreviewModel.cpp
index f62e3f5..59c1c0b 100644
--- a/src/preview/PreviewModel.cpp
+++ b/src/preview/PreviewModel.cpp
@@ -21,7 +21,8 @@ PreviewModel::PreviewModel():
updateSaveCommentsWorking(false),
updateSaveCommentsFinished(false),
commentsTotal(0),
- commentsPageNumber(1)
+ commentsPageNumber(1),
+ commentBoxEnabled(false)
{
// TODO Auto-generated constructor stub
@@ -77,6 +78,20 @@ void PreviewModel::SetFavourite(bool favourite)
}
}
+bool PreviewModel::GetCommentBoxEnabled()
+{
+ return commentBoxEnabled;
+}
+
+void PreviewModel::SetCommentBoxEnabled(bool enabledState)
+{
+ if(enabledState != commentBoxEnabled)
+ {
+ commentBoxEnabled = enabledState;
+ notifyCommentBoxEnabledChanged();
+ }
+}
+
void PreviewModel::UpdateSave(int saveID, int saveDate)
{
this->tSaveID = saveID;
@@ -189,6 +204,14 @@ void PreviewModel::notifySaveChanged()
}
}
+void PreviewModel::notifyCommentBoxEnabledChanged()
+{
+ for(int i = 0; i < observers.size(); i++)
+ {
+ observers[i]->NotifyCommentBoxEnabledChanged(this);
+ }
+}
+
void PreviewModel::notifyCommentsPageChanged()
{
for(int i = 0; i < observers.size(); i++)
@@ -210,6 +233,7 @@ void PreviewModel::AddObserver(PreviewView * observer) {
observer->NotifySaveChanged(this);
observer->NotifyCommentsChanged(this);
observer->NotifyCommentsPageChanged(this);
+ observer->NotifyCommentBoxEnabledChanged(this);
}
void PreviewModel::Update()