Add session to view-source dialog.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24767 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-14 14:24:55 +00:00
parent a7b54c0d12
commit c5c65daee4
2 changed files with 26 additions and 0 deletions

View File

@ -27,8 +27,10 @@
#include "support/docstream.h"
#include "support/gettext.h"
#include <QSettings>
#include <QTextCursor>
#include <QTextDocument>
#include <QVariant>
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);

View File

@ -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.