diff options
Diffstat (limited to 'src/preview/PreviewModel.cpp')
| -rw-r--r-- | src/preview/PreviewModel.cpp | 26 |
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() |
