Commit f7b89e44 authored by Jan Möbius's avatar Jan Möbius

Moved more flags to QSettings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8853 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 762ac31a
...@@ -879,7 +879,7 @@ void Core::showToolbox( bool _state ) { ...@@ -879,7 +879,7 @@ void Core::showToolbox( bool _state ) {
} }
void Core::multiViewMode( int _mode ) { void Core::multiViewMode( int _mode ) {
if ( !OpenFlipper::Options::gui() || !OpenFlipper::Options::multiView() ) if ( !OpenFlipper::Options::gui() || !OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() )
return; return;
switch (_mode) switch (_mode)
......
...@@ -208,20 +208,6 @@ void Core::readApplicationOptions(INIFile& _ini) { ...@@ -208,20 +208,6 @@ void Core::readApplicationOptions(INIFile& _ini) {
OpenFlipper::Options::anaglyphRightEyeColorMatrix(set); OpenFlipper::Options::anaglyphRightEyeColorMatrix(set);
} }
//============================================================================
// Load the setting for the toolbox window
//============================================================================
bool hideToolbox = false;
if ( _ini.get_entry( hideToolbox, "Options" , "HideToolbox") )
OpenFlipper::Options::hideToolbox(hideToolbox);
//============================================================================
// Load the setting for the fullscreen option
//============================================================================
bool fullScreen = false;
if ( _ini.get_entry( fullScreen, "Options" , "FullScreen") )
OpenFlipper::Options::fullScreen(fullScreen);
//============================================================================ //============================================================================
// Load the setting for the object color option // Load the setting for the object color option
//============================================================================ //============================================================================
...@@ -286,10 +272,6 @@ void Core::readApplicationOptions(INIFile& _ini) { ...@@ -286,10 +272,6 @@ void Core::readApplicationOptions(INIFile& _ini) {
// ViewerProperties // ViewerProperties
//============================================================================ //============================================================================
bool multiView = false;
if( _ini.get_entry(multiView, "Options", "MultiView") )
OpenFlipper::Options::multiView(multiView);
uint viewerCount = 0; uint viewerCount = 0;
if( _ini.get_entry(viewerCount, "Options", "ViewerCount") ){ if( _ini.get_entry(viewerCount, "Options", "ViewerCount") ){
} }
...@@ -486,7 +468,6 @@ void Core::writeApplicationOptions(INIFile& _ini) { ...@@ -486,7 +468,6 @@ void Core::writeApplicationOptions(INIFile& _ini) {
_ini.add_entry("Options","Translation", OpenFlipper::Options::translation() ); _ini.add_entry("Options","Translation", OpenFlipper::Options::translation() );
_ini.add_entry("Options","GridVisible", OpenFlipper::Options::gridVisible() ); _ini.add_entry("Options","GridVisible", OpenFlipper::Options::gridVisible() );
_ini.add_entry("Options","MultiView", OpenFlipper::Options::multiView() );
_ini.add_entry("Options","ViewerCount", OpenFlipper::Options::examinerWidgets() ); _ini.add_entry("Options","ViewerCount", OpenFlipper::Options::examinerWidgets() );
if ( !_ini.section_exists("ViewerProperties") ) if ( !_ini.section_exists("ViewerProperties") )
...@@ -514,12 +495,6 @@ void Core::writeApplicationOptions(INIFile& _ini) { ...@@ -514,12 +495,6 @@ void Core::writeApplicationOptions(INIFile& _ini) {
_ini.add_entry("Options","DefaultViewingDirection" + QString::number(i), OpenFlipper::Options::defaultViewingDirection(i) ); _ini.add_entry("Options","DefaultViewingDirection" + QString::number(i), OpenFlipper::Options::defaultViewingDirection(i) );
} }
_ini.add_entry("Options","HideToolbox", OpenFlipper::Options::hideToolbox() );
// check if we are in fullscreen mode:
_ini.add_entry("Options","FullScreen", OpenFlipper::Options::fullScreen() );
_ini.add_entry("Options","DefaultBaseColor", (uint)OpenFlipper::Options::defaultBaseColor().rgba () ); _ini.add_entry("Options","DefaultBaseColor", (uint)OpenFlipper::Options::defaultBaseColor().rgba () );
_ini.add_entry("Options", "StereoMode",OpenFlipper::Options::stereoMode() ); _ini.add_entry("Options", "StereoMode",OpenFlipper::Options::stereoMode() );
......
...@@ -77,7 +77,7 @@ void Core::applyOptions(){ ...@@ -77,7 +77,7 @@ void Core::applyOptions(){
if (OpenFlipper::Options::defaultToolboxMode() != "") if (OpenFlipper::Options::defaultToolboxMode() != "")
coreWidget_->slotChangeView(OpenFlipper::Options::defaultToolboxMode(), QStringList(), QStringList()); coreWidget_->slotChangeView(OpenFlipper::Options::defaultToolboxMode(), QStringList(), QStringList());
//Set Fullscreen //Set Fullscreen
if ( OpenFlipper::Options::fullScreen() ) if ( OpenFlipperSettings().value("Core/Gui/fullscreen",false).toBool() )
coreWidget_->setWindowState( coreWidget_->windowState() | Qt::WindowFullScreen); coreWidget_->setWindowState( coreWidget_->windowState() | Qt::WindowFullScreen);
else else
coreWidget_->setWindowState( (coreWidget_->windowState() | Qt::WindowFullScreen) ^ Qt::WindowFullScreen); coreWidget_->setWindowState( (coreWidget_->windowState() | Qt::WindowFullScreen) ^ Qt::WindowFullScreen);
...@@ -134,7 +134,7 @@ void Core::applyOptions(){ ...@@ -134,7 +134,7 @@ void Core::applyOptions(){
} }
} }
if ( OpenFlipper::Options::multiView() ) if ( OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() )
coreWidget_->setViewerLayout( OpenFlipper::Options::defaultViewerLayout() ); coreWidget_->setViewerLayout( OpenFlipper::Options::defaultViewerLayout() );
// if ( OpenFlipper::Options::gridVisible() ) // if ( OpenFlipper::Options::gridVisible() )
...@@ -155,10 +155,8 @@ void Core::applyOptions(){ ...@@ -155,10 +155,8 @@ void Core::applyOptions(){
} }
//hideToolbox //hideToolbox
if (OpenFlipper::Options::hideToolbox()) { if ( OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() )
coreWidget_->showToolbox (false); coreWidget_->showToolbox (false);
}
//setup logFile //setup logFile
if (logFile_ != 0){ if (logFile_ != 0){
......
...@@ -231,13 +231,13 @@ bool parseCommandLineOptions(CSimpleOpt& args){ ...@@ -231,13 +231,13 @@ bool parseCommandLineOptions(CSimpleOpt& args){
OpenFlipper::Options::stereo(false); OpenFlipper::Options::stereo(false);
break; break;
case OPT_HIDDDEN_TOOLBOX: case OPT_HIDDDEN_TOOLBOX:
OpenFlipper::Options::hideToolbox(true); OpenFlipperSettings().setValue("Core/Gui/ToolBoxes/hidden",true);
break; break;
case OPT_HIDDDEN_LOGGER: case OPT_HIDDDEN_LOGGER:
OpenFlipper::Options::loggerState(OpenFlipper::Options::Hidden); OpenFlipper::Options::loggerState(OpenFlipper::Options::Hidden);
break; break;
case OPT_FULLSCREEN: case OPT_FULLSCREEN:
OpenFlipper::Options::fullScreen(true); OpenFlipperSettings().setValue("Core/Gui/fullscreen",false);
break; break;
case OPT_LOAD_POLYMESHES: case OPT_LOAD_POLYMESHES:
openPolyMeshes = true; openPolyMeshes = true;
......
...@@ -162,15 +162,6 @@ static bool drawModesInContextMenu_ = true; ...@@ -162,15 +162,6 @@ static bool drawModesInContextMenu_ = true;
/// Set if a grid should be drawn in every viewer /// Set if a grid should be drawn in every viewer
static bool gridVisible_ = false; static bool gridVisible_ = false;
/// Store the toolbox gui Mode mode
static bool hideToolbox_ = false;
/// Store if we should go into multiview Mode
static bool multiView_ = true;
/// Start in Fullscreen Mode?
static bool fullScreen_ = false;
static QString defaultToolboxMode_ = ""; static QString defaultToolboxMode_ = "";
static QString title_ = "OpenFlipper v?"; static QString title_ = "OpenFlipper v?";
...@@ -530,16 +521,8 @@ void gridVisible(bool _visible) { ...@@ -530,16 +521,8 @@ void gridVisible(bool _visible) {
gridVisible_ = _visible; gridVisible_ = _visible;
} }
void multiView( bool _multiView) {
multiView_ = _multiView;
}
bool multiView() {
return multiView_;
}
unsigned int examinerWidgets() { unsigned int examinerWidgets() {
if ( multiView_) if ( OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() )
return 4; return 4;
else else
return 1; return 1;
...@@ -555,26 +538,6 @@ LoggerState loggerState( ) { ...@@ -555,26 +538,6 @@ LoggerState loggerState( ) {
return static_cast<OpenFlipper::Options::LoggerState> (OpenFlipperSettings().value("Core/Gui/LogWindow/LogWindowMode",0).toInt() ); return static_cast<OpenFlipper::Options::LoggerState> (OpenFlipperSettings().value("Core/Gui/LogWindow/LogWindowMode",0).toInt() );
} }
/// Set if we start the toolbox widget closed
void hideToolbox( bool _hide) {
hideToolbox_ = _hide;
}
/// Start the toolbox widget closed?
bool hideToolbox( ) {
return hideToolbox_;
}
/// Start fullscreen Mode?
void fullScreen( bool _fs ) {
fullScreen_ = _fs;
}
/// Start fullscreen Mode?
bool fullScreen( ) {
return fullScreen_;
}
/// Which mode should be the default for the toolbar? /// Which mode should be the default for the toolbar?
QString defaultToolboxMode( ) { QString defaultToolboxMode( ) {
return defaultToolboxMode_; return defaultToolboxMode_;
......
...@@ -92,8 +92,11 @@ ...@@ -92,8 +92,11 @@
* * Core/Gui/glViewer/stereoMousePick This setting controls if the mouse depth is picked in stereo mode(bool)\n * * Core/Gui/glViewer/stereoMousePick This setting controls if the mouse depth is picked in stereo mode(bool)\n
* * Core/Gui/glViewer/restrictFrameRate This setting controls if the maximum frame rate should be restricted (bool)\n * * Core/Gui/glViewer/restrictFrameRate This setting controls if the maximum frame rate should be restricted (bool)\n
* * Core/Gui/glViewer/maxFrameRate If restrictFrameRate is set to yes, this setting controls the maximum frameRate used (unsigned int)\n * * Core/Gui/glViewer/maxFrameRate If restrictFrameRate is set to yes, this setting controls the maximum frameRate used (unsigned int)\n
* * Core/Gui/glViewer/useMultipleViewers Use only one viewer or automatically generate multiple viewers (bool)\n
* * Core/Gui/ToolBoxes/hidden Hide the toolbox sidebar (bool)\n
* * Core/Gui/LogWindow/LogWindowMode Log Window Mode .. 0 InScene, 1 Window, 2 Hidden (int)\n * * Core/Gui/LogWindow/LogWindowMode Log Window Mode .. 0 InScene, 1 Window, 2 Hidden (int)\n
* * Core/Gui/splash This setting controls if the splash screen is shown at startup(bool)\n * * Core/Gui/splash This setting controls if the splash screen is shown at startup(bool)\n
* * Core/Gui/fullscreen Show OpenFlipper in Fullscreen Mode(bool)\n
* *
* <b>File Handling</b>\n * <b>File Handling</b>\n
* * Core/CurrentDir The current Directory of the Application \n * * Core/CurrentDir The current Directory of the Application \n
...@@ -485,14 +488,6 @@ QString helpDirStr(); ...@@ -485,14 +488,6 @@ QString helpDirStr();
* @{ */ * @{ */
//=========================================================================== //===========================================================================
/// Use multiview Mode?
DLLEXPORT
void multiView( bool _multiView);
/// Use multiview Mode?
DLLEXPORT
bool multiView();
/// Number of examiner widgets /// Number of examiner widgets
DLLEXPORT DLLEXPORT
unsigned int examinerWidgets(); unsigned int examinerWidgets();
...@@ -512,22 +507,6 @@ QString helpDirStr(); ...@@ -512,22 +507,6 @@ QString helpDirStr();
DLLEXPORT DLLEXPORT
LoggerState loggerState( ); LoggerState loggerState( );
/// Set if we start the toolbox widget closed
DLLEXPORT
void hideToolbox( bool _hide);
/// Start the toolbox widget closed?
DLLEXPORT
bool hideToolbox( );
/// Start fullscreen Mode?
DLLEXPORT
void fullScreen( bool _fs );
/// Start fullscreen Mode?
DLLEXPORT
bool fullScreen( );
/// Which mode should be the default for the toolbar? /// Which mode should be the default for the toolbar?
DLLEXPORT DLLEXPORT
QString defaultToolboxMode( ); QString defaultToolboxMode( );
......
...@@ -240,7 +240,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -240,7 +240,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
// Create examiner // Create examiner
// ====================================================================== // ======================================================================
if ( !OpenFlipper::Options::multiView() ) { if ( !OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() ) {
glViewer* examinerWidget = new glViewer(glScene_, glViewer* examinerWidget = new glViewer(glScene_,
glWidget_, glWidget_,
...@@ -622,8 +622,8 @@ CoreWidget::toggleFullscreen() { ...@@ -622,8 +622,8 @@ CoreWidget::toggleFullscreen() {
} }
fullscreenState_ = (fullscreenState_ + 1) % 3; fullscreenState_ = (fullscreenState_ + 1) % 3;
OpenFlipper::Options::fullScreen( bool( windowState() & Qt::WindowFullScreen) ); OpenFlipperSettings().setValue("Core/Gui/fullscreen", bool( windowState() & Qt::WindowFullScreen) );
show(); show();
} }
...@@ -643,7 +643,7 @@ CoreWidget::setFullscreen(bool _state ) { ...@@ -643,7 +643,7 @@ CoreWidget::setFullscreen(bool _state ) {
fullscreenState_ = (uint) _state; fullscreenState_ = (uint) _state;
OpenFlipper::Options::fullScreen( bool( windowState() & Qt::WindowFullScreen) ); OpenFlipperSettings().setValue("Core/Gui/fullscreen", bool( windowState() & Qt::WindowFullScreen) );
show(); show();
} }
...@@ -802,7 +802,7 @@ void ...@@ -802,7 +802,7 @@ void
CoreWidget::toggleToolbox() { CoreWidget::toggleToolbox() {
//toggle //toggle
showToolbox( OpenFlipper::Options::hideToolbox() ); showToolbox( OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -813,9 +813,9 @@ void ...@@ -813,9 +813,9 @@ void
CoreWidget::showToolbox( bool _state ) { CoreWidget::showToolbox( bool _state ) {
//toggle //toggle
OpenFlipper::Options::hideToolbox( !_state ); OpenFlipperSettings().setValue("Core/Gui/ToolBoxes/hidden",!_state);
if ( OpenFlipper::Options::hideToolbox() ){ if ( OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() ){
//hide ViewMode Selection Widget //hide ViewMode Selection Widget
toolBoxArea_->setVisible(false); toolBoxArea_->setVisible(false);
...@@ -904,57 +904,57 @@ void CoreWidget::showOptionsWidget() { ...@@ -904,57 +904,57 @@ void CoreWidget::showOptionsWidget() {
void CoreWidget::nextViewerLayout() { void CoreWidget::nextViewerLayout() {
if (OpenFlipper::Options::multiView()) { if ( OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() ) {
switch (baseLayout_->mode()) { switch (baseLayout_->mode()) {
case QtMultiViewLayout::SingleView: case QtMultiViewLayout::SingleView:
baseLayout_->setPrimary (PluginFunctions::activeExaminer ()); baseLayout_->setPrimary (PluginFunctions::activeExaminer ());
baseLayout_->setMode(QtMultiViewLayout::Grid); baseLayout_->setMode(QtMultiViewLayout::Grid);
// Update combo box in the toolbar // Update combo box in the toolbar
viewerLayoutBox_->setCurrentIndex(1); viewerLayoutBox_->setCurrentIndex(1);
break; break;
case QtMultiViewLayout::Grid: case QtMultiViewLayout::Grid:
baseLayout_->setPrimary (PluginFunctions::activeExaminer ()); baseLayout_->setPrimary (PluginFunctions::activeExaminer ());
baseLayout_->setMode(QtMultiViewLayout::HSplit); baseLayout_->setMode(QtMultiViewLayout::HSplit);
// Update combo box in the toolbar // Update combo box in the toolbar
viewerLayoutBox_->setCurrentIndex(2); viewerLayoutBox_->setCurrentIndex(2);
break; break;
case QtMultiViewLayout::HSplit: case QtMultiViewLayout::HSplit:
baseLayout_->setPrimary (PluginFunctions::activeExaminer ()); baseLayout_->setPrimary (PluginFunctions::activeExaminer ());
baseLayout_->setMode(QtMultiViewLayout::SingleView); baseLayout_->setMode(QtMultiViewLayout::SingleView);
// Update combo box in the toolbar // Update combo box in the toolbar
viewerLayoutBox_->setCurrentIndex(0); viewerLayoutBox_->setCurrentIndex(0);
break; break;
} }
} }
} }
void void
CoreWidget::setViewerLayout(int _idx) { CoreWidget::setViewerLayout(int _idx) {
if (OpenFlipper::Options::multiView()) { if ( OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() ) {
switch (_idx) { switch (_idx) {
case 0: case 0:
baseLayout_->setPrimary (PluginFunctions::activeExaminer ()); baseLayout_->setPrimary (PluginFunctions::activeExaminer ());
baseLayout_->setMode(QtMultiViewLayout::SingleView); baseLayout_->setMode(QtMultiViewLayout::SingleView);
break; break;
case 1: case 1:
baseLayout_->setPrimary (PluginFunctions::activeExaminer ()); baseLayout_->setPrimary (PluginFunctions::activeExaminer ());
baseLayout_->setMode(QtMultiViewLayout::Grid); baseLayout_->setMode(QtMultiViewLayout::Grid);
break; break;
case 2: case 2:
baseLayout_->setPrimary (PluginFunctions::activeExaminer ()); baseLayout_->setPrimary (PluginFunctions::activeExaminer ());
baseLayout_->setMode(QtMultiViewLayout::HSplit); baseLayout_->setMode(QtMultiViewLayout::HSplit);
break; break;
} }
viewerLayoutBox_->setCurrentIndex(_idx); viewerLayoutBox_->setCurrentIndex(_idx);
} }
} }
void void
......
...@@ -232,10 +232,10 @@ void OptionsWidget::updateViewerSettings(int _row){ ...@@ -232,10 +232,10 @@ void OptionsWidget::updateViewerSettings(int _row){
void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) { void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
//general //general
fullscreen->setChecked( OpenFlipper::Options::fullScreen() ); fullscreen->setChecked( OpenFlipperSettings().value("Core/Gui/fullscreen",false).toBool() );
splash->setChecked( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ); splash->setChecked( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() );
toolbox->setChecked( !OpenFlipper::Options::hideToolbox() ); toolbox->setChecked( !OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() );
iconSmall->setChecked(false); iconSmall->setChecked(false);
iconNormal->setChecked(false); iconNormal->setChecked(false);
iconDefault->setChecked(false); iconDefault->setChecked(false);
...@@ -552,9 +552,10 @@ void OptionsWidget::slotShowPluginOptions(const QString& _pluginName ){ ...@@ -552,9 +552,10 @@ void OptionsWidget::slotShowPluginOptions(const QString& _pluginName ){
void OptionsWidget::slotApply() { void OptionsWidget::slotApply() {
//general //general
OpenFlipper::Options::fullScreen( fullscreen->isChecked() ); OpenFlipperSettings().setValue("Core/Gui/fullscreen",fullscreen->isChecked());
OpenFlipperSettings().setValue("Core/Gui/splash",splash->isChecked()); OpenFlipperSettings().setValue("Core/Gui/splash",splash->isChecked());
OpenFlipper::Options::hideToolbox( !toolbox->isChecked() ); OpenFlipperSettings().setValue("Core/Gui/ToolBoxes/hidden",!toolbox->isChecked());
if (loggerHidden->isChecked()) if (loggerHidden->isChecked())
OpenFlipper::Options::loggerState( OpenFlipper::Options::Hidden ); OpenFlipper::Options::loggerState( OpenFlipper::Options::Hidden );
else if (loggerInScene->isChecked()) else if (loggerInScene->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