Commit 7737c2f5 authored by Jan Möbius's avatar Jan Möbius

Use QSettings for splash screen settings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8090 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fce338ec
...@@ -231,7 +231,7 @@ Core::init() { ...@@ -231,7 +231,7 @@ Core::init() {
redrawTime_ = new QTime(); redrawTime_ = new QTime();
redrawTime_->start (); redrawTime_->start ();
if ( OpenFlipper::Options::splash() ) { if ( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
QPixmap splashPixmap(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "splash.png"); QPixmap splashPixmap(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "splash.png");
splash_ = new QSplashScreen(splashPixmap); splash_ = new QSplashScreen(splashPixmap);
...@@ -509,7 +509,7 @@ Core::init() { ...@@ -509,7 +509,7 @@ Core::init() {
QStringList optionFiles = OpenFlipper::Options::optionFiles(); QStringList optionFiles = OpenFlipper::Options::optionFiles();
for ( int i = 0 ; i < (int)optionFiles.size(); ++i) { for ( int i = 0 ; i < (int)optionFiles.size(); ++i) {
if ( OpenFlipper::Options::gui() && OpenFlipper::Options::splash() ) { if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
splash_->showMessage(tr("Loading Configuration File ") + QString::number(i) + "/" + QString::number(optionFiles.size()) , splash_->showMessage(tr("Loading Configuration File ") + QString::number(i) + "/" + QString::number(optionFiles.size()) ,
Qt::AlignBottom | Qt::AlignLeft , Qt::white); Qt::AlignBottom | Qt::AlignLeft , Qt::white);
QApplication::processEvents(); QApplication::processEvents();
...@@ -560,7 +560,7 @@ Core::init() { ...@@ -560,7 +560,7 @@ Core::init() {
coreWidget_->toolBox_->restoreState (windowStates); coreWidget_->toolBox_->restoreState (windowStates);
windowStates.endGroup (); windowStates.endGroup ();
if ( OpenFlipper::Options::splash() ) { if ( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
splash_->finish(coreWidget_); splash_->finish(coreWidget_);
} }
......
...@@ -130,13 +130,6 @@ void Core::readApplicationOptions(INIFile& _ini) { ...@@ -130,13 +130,6 @@ void Core::readApplicationOptions(INIFile& _ini) {
if (_ini.get_entry(type, "Options" , "default_DataType" )) if (_ini.get_entry(type, "Options" , "default_DataType" ))
OpenFlipper::Options::lastDataType(type); OpenFlipper::Options::lastDataType(type);
//============================================================================
// Splash Screen
//============================================================================
bool splash;
if( _ini.get_entry(splash, "Options", "Splash") )
OpenFlipper::Options::splash(splash);
//============================================================================ //============================================================================
// Load the startup dir for file dialogs // Load the startup dir for file dialogs
//============================================================================ //============================================================================
...@@ -510,11 +503,6 @@ void Core::writeApplicationOptions(INIFile& _ini) { ...@@ -510,11 +503,6 @@ void Core::writeApplicationOptions(INIFile& _ini) {
if ( OpenFlipper::Options::gui() ) if ( OpenFlipper::Options::gui() )
coreWidget_->saveKeyBindings(_ini); coreWidget_->saveKeyBindings(_ini);
//============================================================================
// Splash Screen
//============================================================================
_ini.add_entry( "Options" , "Splash" , OpenFlipper::Options::splash() );
//write default dataType to INI //write default dataType to INI
_ini.add_entry( "Options" , "default_DataType" , OpenFlipper::Options::lastDataType() ); _ini.add_entry( "Options" , "default_DataType" , OpenFlipper::Options::lastDataType() );
......
...@@ -184,7 +184,7 @@ void Core::loadPlugins() ...@@ -184,7 +184,7 @@ void Core::loadPlugins()
// Try to load each file as a plugin // Try to load each file as a plugin
for ( int i = 0 ; i < pluginlist.size() ; ++i) { for ( int i = 0 ; i < pluginlist.size() ; ++i) {
if ( OpenFlipper::Options::gui() && OpenFlipper::Options::splash() ) { if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
splashMessage_ = tr("Loading Plugin %1/%2").arg(i).arg(pluginlist.size()) ; splashMessage_ = tr("Loading Plugin %1/%2").arg(i).arg(pluginlist.size()) ;
splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white); splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white);
QApplication::processEvents(); QApplication::processEvents();
...@@ -359,7 +359,7 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -359,7 +359,7 @@ void Core::loadPlugin(QString filename, bool silent){
if ( basePlugin ) { if ( basePlugin ) {
emit log(LOGOUT,tr("Found Plugin :\t\t %1 at %2.").arg(basePlugin->name()).arg( filename)); emit log(LOGOUT,tr("Found Plugin :\t\t %1 at %2.").arg(basePlugin->name()).arg( filename));
if ( OpenFlipper::Options::gui() && OpenFlipper::Options::splash() ) { if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
splashMessage_ = splashMessage_ + " " + basePlugin->name() ; splashMessage_ = splashMessage_ + " " + basePlugin->name() ;
splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white); splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white);
QApplication::processEvents(); QApplication::processEvents();
......
...@@ -243,7 +243,7 @@ bool parseCommandLineOptions(CSimpleOpt& args){ ...@@ -243,7 +243,7 @@ bool parseCommandLineOptions(CSimpleOpt& args){
openPolyMeshes = true; openPolyMeshes = true;
break; break;
case OPT_NOSPLASH: case OPT_NOSPLASH:
OpenFlipper::Options::splash(false); OpenFlipperSettings().setValue("Core/Gui/splash",false);
break; break;
case OPT_REMOTE: case OPT_REMOTE:
OpenFlipper::Options::remoteControl(true); OpenFlipper::Options::remoteControl(true);
......
...@@ -187,9 +187,6 @@ static QString defaultToolboxMode_ = ""; ...@@ -187,9 +187,6 @@ static QString defaultToolboxMode_ = "";
static QString title_ = "OpenFlipper v?"; static QString title_ = "OpenFlipper v?";
/// Show a splash screen on init?
static bool splash_ = true;
/// default base color /// default base color
static QColor defaultBaseColor_ = QColor("white"); static QColor defaultBaseColor_ = QColor("white");
...@@ -667,14 +664,6 @@ void windowTitle( QString _titel ) { ...@@ -667,14 +664,6 @@ void windowTitle( QString _titel ) {
title_ = _titel; title_ = _titel;
} }
void splash( bool _splash ) {
splash_ = _splash;
}
bool splash( ) {
return splash_;
}
void defaultBaseColor( QColor _color ) { void defaultBaseColor( QColor _color ) {
defaultBaseColor_ = _color; defaultBaseColor_ = _color;
} }
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
* <b>User Interface Settings</b> * <b>User Interface Settings</b>
* * Core/Gui/glViewer/defaultBackgroundColor This controls the default background color of the glViewer (QColor) * * Core/Gui/glViewer/defaultBackgroundColor This controls the default background color of the glViewer (QColor)
* * Core/Gui/glViewer/showControlWheels This setting controls if the control wheels should be visible in the glViewer (bool) * * Core/Gui/glViewer/showControlWheels This setting controls if the control wheels should be visible in the glViewer (bool)
* * Core/Gui/splash This setting controls if the splash screen is shown at startup(bool)
* *
* <b>Mouse Controls<b>\n * <b>Mouse Controls<b>\n
* * Core/Mouse/Wheel/ZoomFactor Zoom factor used when turning the mouse wheel (double)\n * * Core/Mouse/Wheel/ZoomFactor Zoom factor used when turning the mouse wheel (double)\n
...@@ -590,14 +591,6 @@ QString helpDirStr(); ...@@ -590,14 +591,6 @@ QString helpDirStr();
DLLEXPORT DLLEXPORT
void windowTitle( QString _titel ); void windowTitle( QString _titel );
/// Display splash screen?
DLLEXPORT
void splash( bool _splash );
/// Display splash screen?
DLLEXPORT
bool splash( );
/// Default base color /// Default base color
DLLEXPORT DLLEXPORT
void defaultBaseColor( QColor _color ); void defaultBaseColor( QColor _color );
......
...@@ -143,7 +143,7 @@ void PluginDialog::slotUnload() ...@@ -143,7 +143,7 @@ void PluginDialog::slotUnload()
QMessageBox::No); QMessageBox::No);
} }
// Store the new setting // Store the new setting and remove plugin from all lists
if (buttonState == QMessageBox::Yes || buttonState == QMessageBox::YesToAll) { if (buttonState == QMessageBox::Yes || buttonState == QMessageBox::YesToAll) {
QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames").toStringList(); QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames").toStringList();
if ( !dontLoadPlugins.contains(name) ){ if ( !dontLoadPlugins.contains(name) ){
......
...@@ -233,7 +233,7 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) { ...@@ -233,7 +233,7 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
//general //general
fullscreen->setChecked( OpenFlipper::Options::fullScreen() ); fullscreen->setChecked( OpenFlipper::Options::fullScreen() );
splash->setChecked( OpenFlipper::Options::splash() ); splash->setChecked( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() );
toolbox->setChecked( !OpenFlipper::Options::hideToolbox() ); toolbox->setChecked( !OpenFlipper::Options::hideToolbox() );
loggerHidden->setChecked( OpenFlipper::Options::loggerState() == OpenFlipper::Options::Hidden); loggerHidden->setChecked( OpenFlipper::Options::loggerState() == OpenFlipper::Options::Hidden);
...@@ -544,7 +544,7 @@ void OptionsWidget::slotApply() { ...@@ -544,7 +544,7 @@ void OptionsWidget::slotApply() {
//general //general
OpenFlipper::Options::fullScreen( fullscreen->isChecked() ); OpenFlipper::Options::fullScreen( fullscreen->isChecked() );
OpenFlipper::Options::splash( splash->isChecked() ); OpenFlipperSettings().setValue("Core/Gui/splash",splash->isChecked());
OpenFlipper::Options::hideToolbox( !toolbox->isChecked() ); OpenFlipper::Options::hideToolbox( !toolbox->isChecked() );
if (loggerHidden->isChecked()) if (loggerHidden->isChecked())
OpenFlipper::Options::loggerState( OpenFlipper::Options::Hidden ); OpenFlipper::Options::loggerState( OpenFlipper::Options::Hidden );
......
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