Commit ff57dddd authored by Mike Kremer's avatar Mike Kremer

Fixed some issues with the options widget:

- Adjusted size of some input boxes
- Corrected setting of frame rate restriction
- Deleted grid option (this is now a plugin)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10259 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5fcdb8e0
...@@ -155,10 +155,10 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB ...@@ -155,10 +155,10 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
void OptionsWidget::getBackgroundColor(){ void OptionsWidget::getBackgroundColor(){
QColor newColor = QColorDialog::getColor ( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() ); QColor newColor = QColorDialog::getColor ( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() );
OpenFlipperSettings().setValue("Core/Gui/glViewer/defaultBackgroundColor", newColor); backgroundColor_ = newColor;
QPixmap color(16,16); QPixmap color(16,16);
color.fill( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() ); color.fill( newColor );
backgroundButton->setIcon( QIcon(color) ); backgroundButton->setIcon( QIcon(color) );
} }
...@@ -368,8 +368,8 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) { ...@@ -368,8 +368,8 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
//Init Viewer Settings //Init Viewer Settings
wZoomFactor->setText( QString::number(OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactor").toDouble(), 'f') ); wZoomFactor->setValue( OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactor").toDouble() );
wZoomFactorShift->setText( QString::number(OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactorShift").toDouble(), 'f') ); wZoomFactorShift->setValue( OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactorShift").toDouble() );
wheelBox->setChecked( OpenFlipperSettings().value("Core/Gui/glViewer/showControlWheels").toBool() ); wheelBox->setChecked( OpenFlipperSettings().value("Core/Gui/glViewer/showControlWheels").toBool() );
...@@ -378,6 +378,7 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) { ...@@ -378,6 +378,7 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
QPixmap color(16,16); QPixmap color(16,16);
color.fill( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() ); color.fill( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() );
backgroundColor_ = OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>();
backgroundButton->setIcon( QIcon(color) ); backgroundButton->setIcon( QIcon(color) );
color.fill( OpenFlipper::Options::defaultBaseColor() ); color.fill( OpenFlipper::Options::defaultBaseColor() );
...@@ -397,8 +398,6 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) { ...@@ -397,8 +398,6 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
viewerLayout->setCurrentIndex( OpenFlipper::Options::defaultViewerLayout() ); viewerLayout->setCurrentIndex( OpenFlipper::Options::defaultViewerLayout() );
gridVisible->setChecked (OpenFlipper::Options::gridVisible());
if (OpenFlipper::Options::translation() == "en_US") if (OpenFlipper::Options::translation() == "en_US")
translation->setCurrentIndex(0); translation->setCurrentIndex(0);
else if (OpenFlipper::Options::translation() == "de_DE") else if (OpenFlipper::Options::translation() == "de_DE")
...@@ -670,7 +669,23 @@ void OptionsWidget::slotApply() { ...@@ -670,7 +669,23 @@ void OptionsWidget::slotApply() {
} }
OpenFlipper::Options::defaultViewerLayout( viewerLayout->currentIndex() ); OpenFlipper::Options::defaultViewerLayout( viewerLayout->currentIndex() );
OpenFlipper::Options::gridVisible( gridVisible->isChecked() );
// Restrict fps if desired
if(restrictFPS->isChecked()) {
OpenFlipperSettings().setValue("Core/Gui/glViewer/restrictFrameRate", true);
OpenFlipperSettings().setValue("Core/Gui/glViewer/maxFrameRate",FPS->value());
} else {
OpenFlipperSettings().setValue("Core/Gui/glViewer/restrictFrameRate", false);
}
// Set background color
OpenFlipperSettings().setValue("Core/Gui/glViewer/defaultBackgroundColor", backgroundColor_);
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i )
PluginFunctions::viewerProperties(i).backgroundColor(ACG::Vec4f(((double) backgroundColor_.redF()),
((double) backgroundColor_.greenF()),
((double) backgroundColor_.blueF()),
1.0));
// Show warning message that restart is required if language has been changed... // Show warning message that restart is required if language has been changed...
if(translationIndexChanged_) { if(translationIndexChanged_) {
......
...@@ -178,6 +178,9 @@ private: ...@@ -178,6 +178,9 @@ private:
std::vector< int > defaultViewingDirections_; std::vector< int > defaultViewingDirections_;
bool updatingViewerSettings_; bool updatingViewerSettings_;
// Store current background color
QColor backgroundColor_;
private: private:
/// Starts the download of the given file /// Starts the download of the given file
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<string/> <string/>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>2</number>
</property> </property>
<property name="usesScrollButtons"> <property name="usesScrollButtons">
<bool>true</bool> <bool>true</bool>
...@@ -260,48 +260,48 @@ ...@@ -260,48 +260,48 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>MouseWheel Zoom Sensitivity (shift):</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="wZoomFactor"> <widget class="QDoubleSpinBox" name="wZoomFactor">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>70</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip"> <property name="maximum">
<string>Set the factor to control the zooming with the mouse-wheel</string> <double>10.000000000000000</double>
</property> </property>
<property name="statusTip"> <property name="singleStep">
<string>Set the factor to control the zooming with the mouse-wheel</string> <double>0.200000000000000</double>
</property> </property>
<property name="inputMask"> <property name="value">
<string>9.99; </string> <double>1.000000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="3" column="1">
<widget class="QLabel" name="label_3"> <widget class="QDoubleSpinBox" name="wZoomFactorShift">
<property name="text">
<string>MouseWheel Zoom Sensitivity (shift):</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="wZoomFactorShift">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>70</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip"> <property name="maximum">
<string>Set the factor to control the zooming with the mouse-wheel while the shift key is pressed</string> <double>5.000000000000000</double>
</property> </property>
<property name="statusTip"> <property name="singleStep">
<string>Set the factor to control the zooming with the mouse-wheel while the shift key is pressed</string> <double>0.100000000000000</double>
</property> </property>
<property name="inputMask"> <property name="value">
<string>9.99; </string> <double>0.200000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -319,10 +319,10 @@ ...@@ -319,10 +319,10 @@
<item> <item>
<widget class="QCheckBox" name="restrictFPS"> <widget class="QCheckBox" name="restrictFPS">
<property name="toolTip"> <property name="toolTip">
<string>restrict maximum framerate</string> <string>Restrict maximum framerate, note that this won't work if in animation mode.</string>
</property> </property>
<property name="statusTip"> <property name="statusTip">
<string>restrict maximum framerate</string> <string>Restrict maximum framerate, note that this won't work if in animation mode.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Restrict Framerate</string> <string>Restrict Framerate</string>
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
<item> <item>
<widget class="QPushButton" name="backgroundButton"> <widget class="QPushButton" name="backgroundButton">
<property name="text"> <property name="text">
<string>Default background color</string> <string>Background color</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
<item> <item>
<widget class="QCheckBox" name="randomBaseColor"> <widget class="QCheckBox" name="randomBaseColor">
<property name="text"> <property name="text">
<string>use random base color</string> <string>Use random base color</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -418,16 +418,6 @@ ...@@ -418,16 +418,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="gridVisible">
<property name="toolTip">
<string>show a grid in the back of every viewer</string>
</property>
<property name="text">
<string>Show grid</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="nativeMouse"> <widget class="QCheckBox" name="nativeMouse">
<property name="toolTip"> <property name="toolTip">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment