]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCharacter.cpp
Compil fix.
[lyx.git] / src / frontends / qt4 / GuiCharacter.cpp
index 2d3770e06a615453a2140757772413ad691feb80..f2885b1fc102a7c3f7b2989ea406b6539911dde1 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <QAbstractItemModel>
 #include <QModelIndex>
+#include <QSettings>
 #include <QVariant>
 
 using namespace std;
@@ -175,13 +176,6 @@ GuiCharacter::GuiCharacter(GuiView & lv)
        connect(autoapplyCB, SIGNAL(stateChanged(int)), this,
                SLOT(change_adaptor()));
 
-#ifdef Q_WS_MACX
-       // On Mac it's common to have tool windows which are always in the
-       // foreground and are hidden when the main window is not focused.
-       setWindowFlags(Qt::Tool);
-       autoapplyCB->setChecked(true);
-#endif
-
        family = familyData();
        series = seriesData();
        shape  = shapeData();
@@ -215,6 +209,13 @@ GuiCharacter::GuiCharacter(GuiView & lv)
        bc().addReadOnly(toggleallCB);
        bc().addReadOnly(autoapplyCB);
 
+#ifdef Q_WS_MACX
+       // On Mac it's common to have tool windows which are always in the
+       // foreground and are hidden when the main window is not focused.
+       setWindowFlags(Qt::Tool);
+       autoapplyCB->setChecked(true);
+#endif
+
 // FIXME: hack to work around resizing bug in Qt >= 4.2
 // bug verified with Qt 4.2.{0-3} (JSpitzm)
 #if QT_VERSION >= 0x040200
@@ -378,6 +379,26 @@ void GuiCharacter::dispatchParams()
 }
 
 
+void GuiCharacter::saveSession() const
+{
+       Dialog::saveSession();
+       QSettings settings;
+       settings.setValue(sessionKey() + "/toggleall", toggleallCB->isChecked());
+       settings.setValue(sessionKey() + "/autoapply", autoapplyCB->isChecked());
+}
+
+
+void GuiCharacter::restoreSession()
+{
+       Dialog::restoreSession();
+       QSettings settings;
+       toggleallCB->setChecked(
+               settings.value(sessionKey() + "/toggleall").toBool());
+       autoapplyCB->setChecked(
+               settings.value(sessionKey() + "/autoapply").toBool());
+}
+
+
 Dialog * createGuiCharacter(GuiView & lv) { return new GuiCharacter(lv); }