summaryrefslogtreecommitdiff
path: root/src/preview/PreviewModel.cpp
diff options
context:
space:
mode:
authorbuild.powdertoy.co.uk <admin@powdertoy.co.uk>2012-07-19 17:08:34 (GMT)
committer build.powdertoy.co.uk <admin@powdertoy.co.uk>2012-07-19 17:08:34 (GMT)
commitd328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01 (patch)
treedb311c7849270ddd2510cbd65a192b059f8a3c77 /src/preview/PreviewModel.cpp
parentd71af3706a7a14e8ae65523e1a062417818b8fe2 (diff)
parent4d961117bde4398ae4d72f2db96eef381371e2df (diff)
downloadpowder-d328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01.zip
powder-d328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01.tar.gz
Merge branch 'master' of github.com:FacialTurd/PowderToypp
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()