Skip to content
Snippets Groups Projects
Commit 549e57ef authored by Mike Kremer's avatar Mike Kremer
Browse files

Gave snapshot dialog a memory to remember what the user has checked the last time.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10194 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 94074f13
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,9 @@ SnapshotDialog::SnapshotDialog(QString _suggest, bool _captureViewers, int _w, i
snapWidth->setValue(_w);
snapHeight->setValue(_h);
// Load button states
loadStates();
connect(snapWidth, SIGNAL(valueChanged(int)), this, SLOT(snapWidthChanged(int)) );
connect(snapHeight, SIGNAL(valueChanged(int)), this, SLOT(snapHeightChanged(int)) );
......@@ -79,6 +82,28 @@ SnapshotDialog::SnapshotDialog(QString _suggest, bool _captureViewers, int _w, i
connect(okButton, SIGNAL(clicked()), this, SLOT(slotOk()) );
}
void SnapshotDialog::saveStates() {
OpenFlipperSettings().setValue( "Viewer/SnapshotDialog/SnapWidth", snapWidth->value());
OpenFlipperSettings().setValue( "Viewer/SnapshotDialog/SnapHeight", snapHeight->value());
OpenFlipperSettings().setValue( "Viewer/SnapshotDialog/KeepAspect", keepAspect->isChecked());
OpenFlipperSettings().setValue( "Viewer/SnapshotDialog/Transparent", transparent->isChecked());
OpenFlipperSettings().setValue( "Viewer/SnapshotDialog/HideCoordsys", hideCoordsys->isChecked());
OpenFlipperSettings().setValue( "Viewer/SnapshotDialog/Multisampling", multisampling->isChecked());
OpenFlipperSettings().setValue( "Viewer/SnapshotDialog/NumSamples", num_samples->value());
}
void SnapshotDialog::loadStates() {
snapWidth->setValue( OpenFlipperSettings().value( "Viewer/SnapshotDialog/SnapWidth", snapWidth->value()).toInt());
snapHeight->setValue( OpenFlipperSettings().value( "Viewer/SnapshotDialog/SnapHeight", snapHeight->value()).toInt());
keepAspect->setChecked( OpenFlipperSettings().value( "Viewer/SnapshotDialog/KeepAspect", false).toBool());
transparent->setChecked( OpenFlipperSettings().value( "Viewer/SnapshotDialog/Transparent", false).toBool());
hideCoordsys->setChecked( OpenFlipperSettings().value( "Viewer/SnapshotDialog/HideCoordsys", false).toBool());
multisampling->setChecked( OpenFlipperSettings().value( "Viewer/SnapshotDialog/Multisampling", true).toBool());
num_samples->setValue( OpenFlipperSettings().value( "Viewer/SnapshotDialog/NumSamples", 16).toInt());
}
void SnapshotDialog::snapWidthChanged(int _w) {
if(blockSpinBox_) return;
......@@ -120,6 +145,9 @@ void SnapshotDialog::slotOk()
if ( !captureViewers_ )
emit resizeApplication(snapWidth->value(), snapHeight->value());
// Remember button states for next time...
saveStates();
accept();
}
......
......@@ -64,6 +64,9 @@ class SnapshotDialog : public QDialog, public Ui::SnapshotDialog
void snapWidthChanged(int _w);
void snapHeightChanged(int _h);
void saveStates();
void loadStates();
signals:
void resizeApplication(int _width, int _height);
};
......
......@@ -51,7 +51,7 @@
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="1">
<widget class="QSpinBox" name="snapWidth">
<widget class="QSpinBox" name="snapHeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -74,7 +74,7 @@
<number>8192</number>
</property>
<property name="value">
<number>800</number>
<number>600</number>
</property>
</widget>
</item>
......@@ -93,7 +93,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="snapHeight">
<widget class="QSpinBox" name="snapWidth">
<property name="minimumSize">
<size>
<width>80</width>
......@@ -110,7 +110,7 @@
<number>8192</number>
</property>
<property name="value">
<number>600</number>
<number>800</number>
</property>
</widget>
</item>
......@@ -249,6 +249,20 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>filename</tabstop>
<tabstop>findButton</tabstop>
<tabstop>snapWidth</tabstop>
<tabstop>snapHeight</tabstop>
<tabstop>keepAspect</tabstop>
<tabstop>resButton</tabstop>
<tabstop>transparent</tabstop>
<tabstop>hideCoordsys</tabstop>
<tabstop>multisampling</tabstop>
<tabstop>num_samples</tabstop>
<tabstop>cancelButton</tabstop>
<tabstop>okButton</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment