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

Option to hide the wizard on startup.

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