Commit 06e3ae2a authored by Mike Kremer's avatar Mike Kremer

Option "Show wheels at startup" is now written to options ini and will be parsed on startup.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6058 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cb2d6325
......@@ -298,6 +298,13 @@ void Core::readApplicationOptions(INIFile& _ini) {
if( _ini.get_entry(restrictFrameRate, "Options", "RestrictFrameRate") )
OpenFlipper::Options::restrictFrameRate(restrictFrameRate);
//============================================================================
// Load showWheelsAtStartup
//============================================================================
bool showWheelsAtStartup = false;
if( _ini.get_entry(showWheelsAtStartup, "Options", "ShowWheelsAtStartup") )
OpenFlipper::Options::showWheelsAtStartup(showWheelsAtStartup);
//============================================================================
// Load maxFrameRate
//============================================================================
......@@ -452,6 +459,8 @@ void Core::writeApplicationOptions(INIFile& _ini) {
_ini.add_entry("Options","WheelZoomFactorShift", OpenFlipper::Options::wheelZoomFactorShift() );
// restrict Framerate
_ini.add_entry("Options","RestrictFrameRate",OpenFlipper::Options::restrictFrameRate() );
// Show wheels on startup
_ini.add_entry("Options","ShowWheelsAtStartup",OpenFlipper::Options::showWheelsAtStartup() );
// max Framerate
_ini.add_entry("Options","MaxFrameRate",OpenFlipper::Options::maxFrameRate() );
......
......@@ -125,6 +125,9 @@ static double wheelZoomFactorShift_ = 0.2;
/// Store the restrictFrameRate_ mode
static bool restrictFrameRate_ = false;
/// Store the wheel settings
static bool showWheelsAtStartup_ = false;
/// Store the maxFrameRate_ mode
static int maxFrameRate_ = 35;
......@@ -561,10 +564,18 @@ void restrictFrameRate( bool _enable ){
restrictFrameRate_ = _enable;
}
void showWheelsAtStartup( bool _show ){
showWheelsAtStartup_ = _show;
}
bool restrictFrameRate( ){
return restrictFrameRate_;
}
bool showWheelsAtStartup( ){
return showWheelsAtStartup_;
}
void maxFrameRate( int _fps ){
maxFrameRate_ = _fps;
}
......
......@@ -436,6 +436,14 @@ void helpDir(QDir _dir);
DLLEXPORT
bool restrictFrameRate( );
/// set wheel appearance setting
DLLEXPORT
void showWheelsAtStartup( bool _show );
/// get wheel appearance setting
DLLEXPORT
bool showWheelsAtStartup( );
/// Store maxFrameRate setting
DLLEXPORT
void maxFrameRate( int _fps );
......
......@@ -354,6 +354,9 @@ void CoreWidget::setupMenuBar()
wheelSwitchAction->setWhatsThis( "Show / hide navigation wheels in viewer widget.<br><br>"
" These wheels appear in the corners of the viewports. "
" Use wheels to rotate scene.");
if(OpenFlipper::Options::showWheelsAtStartup()) {
wheelSwitchAction->setChecked(true);
}
connect( wheelSwitchAction,SIGNAL( toggled(bool) ), this, SLOT( slotSwitchWheels(bool) ) );
viewMenu_->addAction( wheelSwitchAction);
......
......@@ -1128,8 +1128,11 @@ glViewer::createWidgets(QStatusBar* _sb)
wheelX_->setToolTip("Rotate around <b>x-axis</b>.");
wheelX_->setWhatsThis( "Rotate around <b>x-axis</b>.");
// Hide wheels per default
slotHideWheels();
// Hide or show wheels (depending on ini option)
if(!OpenFlipper::Options::showWheelsAtStartup()) {
slotHideWheels();
}
QGraphicsWidget *wheelX = glScene_->addWidget (wheelX_);
QGraphicsWidget *wheelY = glScene_->addWidget (wheelY_);
......
......@@ -140,6 +140,7 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
wZoomFactor->setText( QString::number(OpenFlipper::Options::wheelZoomFactor(), 'f') );
wZoomFactorShift->setText( QString::number(OpenFlipper::Options::wheelZoomFactorShift(), 'f') );
wheelBox->setChecked( OpenFlipper::Options::showWheelsAtStartup() );
restrictFPS->setChecked( OpenFlipper::Options::restrictFrameRate() );
FPS->setValue( OpenFlipper::Options::maxFrameRate() );
......@@ -408,6 +409,8 @@ void OptionsWidget::slotApply() {
OpenFlipper::Options::wheelZoomFactorShift( wZoomFactorShift->text().toDouble() );
OpenFlipper::Options::restrictFrameRate( restrictFPS->isChecked() );
OpenFlipper::Options::showWheelsAtStartup( wheelBox->isChecked() );
OpenFlipper::Options::maxFrameRate( FPS->value() );
OpenFlipper::Options::randomBaseColor( randomBaseColor->isChecked() );
......
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