+void ContentWindow::toggleStarred() {
+ starred->toggle();
+ if(starred->isChecked()) {
+ QMaemo5InformationBox::information(this, "Starred",
+ QMaemo5InformationBox::DefaultTimeout);
+ }
+ else {
+ QMaemo5InformationBox::information(this, "Star removed",
+ QMaemo5InformationBox::DefaultTimeout);
+ }
+}
+
+void ContentWindow::toggleShared() {
+ shared->toggle();
+ if(shared->isChecked()) {
+ QMaemo5InformationBox::information(this, "Shared",
+ QMaemo5InformationBox::DefaultTimeout);
+ }
+ else {
+ QMaemo5InformationBox::information(this, "Unshared",
+ QMaemo5InformationBox::DefaultTimeout);
+ }
+}
+
+void ContentWindow::toggleRead() {
+ if(!keepUnread->isEnabled()) {
+ QMaemo5InformationBox::information(this, "Read state locked",
+ QMaemo5InformationBox::DefaultTimeout);
+ return;
+ }
+
+ keepUnread->toggle();
+ if(keepUnread->isChecked()) {
+ QMaemo5InformationBox::information(this, "Marked unread",
+ QMaemo5InformationBox::DefaultTimeout);
+ }
+ else {
+ QMaemo5InformationBox::information(this, "Marked read",
+ QMaemo5InformationBox::DefaultTimeout);
+ }
+}
+
+void ContentWindow::showEntry(Entry *e) {
+ if(entry) {
+ /* Store settings of previously shown entry */
+ entry->markRead(!keepUnread->isChecked());
+ entry->markStar(starred->isChecked());
+ entry->markShared(shared->isChecked());
+ }
+
+ entry = e;
+
+ starred->setChecked((entry->flags & ENTRY_FLAG_STARRED));
+ shared->setChecked((entry->flags & ENTRY_FLAG_SHARED));
+ keepUnread->setChecked(false);
+ keepUnread->setEnabled((entry->flags & ENTRY_FLAG_LOCKED) == 0);
+
+ setWindowTitle(entry->title);
+
+ webview->setHtml(entry->content);
+}
+