Commit 86f25af3 authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Option to hide the wizard on startup.

parent c8752cf6
...@@ -112,7 +112,9 @@ MainWindow::MainWindow( QWidget *parent ) : ...@@ -112,7 +112,9 @@ MainWindow::MainWindow( QWidget *parent ) :
m_pWizard = new ProjectWizard( this ); m_pWizard = new ProjectWizard( this );
m_pWizard->setModal( true ); m_pWizard->setModal( true );
if ( restoreSession() == false ) QSettings s;
if ( s.value( "ShowWizardStartup", true ).toBool() &&
restoreSession() == false )
{ {
m_pWizard->show(); m_pWizard->show();
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QMessageBox> #include <QMessageBox>
#include <QFileInfo> #include <QFileInfo>
#include <QSettings>
#include <QDebug> #include <QDebug>
#include "WelcomePage.h" #include "WelcomePage.h"
...@@ -44,6 +45,8 @@ WelcomePage::WelcomePage( QWidget* parent ) ...@@ -44,6 +45,8 @@ WelcomePage::WelcomePage( QWidget* parent )
this, SLOT( selectOpenRadio() ) ); this, SLOT( selectOpenRadio() ) );
connect( m_ui.projectsListWidget, SIGNAL( itemDoubleClicked(QListWidgetItem*) ), connect( m_ui.projectsListWidget, SIGNAL( itemDoubleClicked(QListWidgetItem*) ),
this, SLOT( projectDoubleClicked(QListWidgetItem*) ) ); this, SLOT( projectDoubleClicked(QListWidgetItem*) ) );
connect( m_ui.hideStartupCheckBox, SIGNAL( clicked(bool) ),
this, SLOT( hideWizardAtStartup(bool) ) );
registerField( "loadProject", m_ui.projectsListWidget ); registerField( "loadProject", m_ui.projectsListWidget );
m_projectPath = new QString(); m_projectPath = new QString();
...@@ -76,6 +79,9 @@ int WelcomePage::nextId() const ...@@ -76,6 +79,9 @@ int WelcomePage::nextId() const
void WelcomePage::initializePage() void WelcomePage::initializePage()
{ {
QSettings s;
m_ui.hideStartupCheckBox->setChecked( !s.value( "ShowWizardStartup", true ).toBool() );
m_ui.createRadioButton->setChecked( true ); m_ui.createRadioButton->setChecked( true );
loadRecentsProjects(); loadRecentsProjects();
} }
...@@ -172,3 +178,9 @@ void WelcomePage::setProjectPath( const QString& path ) ...@@ -172,3 +178,9 @@ void WelcomePage::setProjectPath( const QString& path )
m_projectPath->clear(); m_projectPath->clear();
m_projectPath->append( path ); m_projectPath->append( path );
} }
void WelcomePage::hideWizardAtStartup( bool hidden )
{
QSettings s;
s.setValue( "ShowWizardStartup", !hidden );
}
...@@ -54,6 +54,7 @@ class WelcomePage : public QWizardPage ...@@ -54,6 +54,7 @@ class WelcomePage : public QWizardPage
void loadRecentsProjects(); void loadRecentsProjects();
void projectDoubleClicked( QListWidgetItem* item ); void projectDoubleClicked( QListWidgetItem* item );
void selectOpenRadio(); void selectOpenRadio();
void hideWizardAtStartup( bool hidden );
private: private:
Ui::WelcomePage m_ui; Ui::WelcomePage m_ui;
......
...@@ -142,6 +142,16 @@ p, li { white-space: pre-wrap; } ...@@ -142,6 +142,16 @@ p, li { white-space: pre-wrap; }
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="7" column="0" colspan="4">
<widget class="QCheckBox" name="hideStartupCheckBox">
<property name="text">
<string>Do not show at startup.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
......
Supports Markdown
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