Commit 9327616e authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Wizard: auto-select the open radio button when needed

parent bccc1bc4
...@@ -37,6 +37,8 @@ WelcomePage::WelcomePage( QWidget* parent ) ...@@ -37,6 +37,8 @@ WelcomePage::WelcomePage( QWidget* parent )
connect( m_ui.openPushButton, SIGNAL( clicked() ), connect( m_ui.openPushButton, SIGNAL( clicked() ),
this, SLOT( loadProject() ) ); this, SLOT( loadProject() ) );
connect( m_ui.projectsListWidget, SIGNAL( itemActivated(QListWidgetItem*) ),
this, SLOT( selectOpenRadio() ) );
loadRecentsProjects(); loadRecentsProjects();
} }
...@@ -99,6 +101,8 @@ void WelcomePage::loadProject() ...@@ -99,6 +101,8 @@ void WelcomePage::loadProject()
ProjectManager* pm = ProjectManager::getInstance(); ProjectManager* pm = ProjectManager::getInstance();
QString projectPath = pm->loadProjectFile(); QString projectPath = pm->loadProjectFile();
if ( projectPath.isEmpty() ) return;
QListWidgetItem* item = NULL; QListWidgetItem* item = NULL;
for ( int i = 0; i < m_ui.projectsListWidget->count(); ++i ) for ( int i = 0; i < m_ui.projectsListWidget->count(); ++i )
{ {
...@@ -118,4 +122,10 @@ void WelcomePage::loadProject() ...@@ -118,4 +122,10 @@ void WelcomePage::loadProject()
} }
item->setSelected( true ); item->setSelected( true );
selectOpenRadio();
}
void WelcomePage::selectOpenRadio()
{
m_ui.openRadioButton->setChecked( true );
} }
...@@ -49,6 +49,7 @@ class WelcomePage : public QWizardPage ...@@ -49,6 +49,7 @@ class WelcomePage : public QWizardPage
private slots: private slots:
void loadProject(); void loadProject();
void loadRecentsProjects(); void loadRecentsProjects();
void selectOpenRadio();
private: private:
Ui::WelcomePage m_ui; Ui::WelcomePage m_ui;
......
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