#include "support/docstream.h"
#include "support/gettext.h"
+#include <QSettings>
#include <QTextCursor>
#include <QTextDocument>
+#include <QVariant>
using namespace std;
setEnabled(false);
return;
}
- if (autoUpdateCB->isChecked())
- document_->setPlainText(controller_.getContent(
- viewFullSourceCB->isChecked()));
+ document_->setPlainText(controller_.getContent(
+ viewFullSourceCB->isChecked()));
GuiViewSource::Row row = controller_.getRows();
QTextCursor c = QTextCursor(viewSourceTV->document());
void GuiViewSource::updateView()
{
- widget_->updateView();
+ if (widget_->autoUpdateCB->isChecked())
+ widget_->updateView();
}
}
+void GuiViewSource::saveSession() const
+{
+ Dialog::saveSession();
+ QSettings settings;
+ settings.setValue(
+ sessionKey() + "/fullsource", widget_->viewFullSourceCB->isChecked());
+ settings.setValue(
+ sessionKey() + "/autoupdate", widget_->autoUpdateCB->isChecked());
+}
+
+
+void GuiViewSource::restoreSession()
+{
+ Dialog::restoreSession();
+ QSettings settings;
+ widget_->viewFullSourceCB->setChecked(
+ settings.value(sessionKey() + "/fullsource", false).toBool());
+ widget_->autoUpdateCB->setChecked(
+ settings.value(sessionKey() + "/autoupdate", true).toBool());
+}
+
+
Dialog * createGuiViewSource(GuiView & lv)
{
return new GuiViewSource(lv);