From c5c65daee4e96439250d38d69257714391571c62 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 14 May 2008 14:24:55 +0000 Subject: [PATCH] Add session to view-source dialog. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24767 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiViewSource.cpp | 24 ++++++++++++++++++++++++ src/frontends/qt4/GuiViewSource.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp index 97536d734e..fc46a49f36 100644 --- a/src/frontends/qt4/GuiViewSource.cpp +++ b/src/frontends/qt4/GuiViewSource.cpp @@ -27,8 +27,10 @@ #include "support/docstream.h" #include "support/gettext.h" +#include #include #include +#include using namespace std; @@ -182,6 +184,28 @@ QString GuiViewSource::title() const } +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").toBool()); + widget_->autoUpdateCB->setChecked( + settings.value(sessionKey() + "/autoupdate").toBool()); +} + + Dialog * createGuiViewSource(GuiView & lv) { return new GuiViewSource(lv); diff --git a/src/frontends/qt4/GuiViewSource.h b/src/frontends/qt4/GuiViewSource.h index c409f7cff8..1b2add4ad9 100644 --- a/src/frontends/qt4/GuiViewSource.h +++ b/src/frontends/qt4/GuiViewSource.h @@ -77,6 +77,8 @@ public: bool canApplyToReadOnly() const { return true; } void updateView(); void enableView(bool enable); + void saveSession() const; + void restoreSession(); ///@} /// The title displayed by the dialog reflects source type.