refs #887, skip copy steps if there is no other swift version to copy from

* pages as enum
* buttons to copy/select/deselect (when UI component is used detached from wizard)
* avoid crash when there is no other swift version (->empty model)
This commit is contained in:
Klaus Basan
2017-02-25 19:19:27 +01:00
committed by Mathew Sutcliffe
parent cb024b0245
commit 1076eb2b29
5 changed files with 70 additions and 10 deletions

View File

@@ -19,6 +19,12 @@ namespace BlackGui
ui(new Ui::CConfigurationWizard)
{
ui->setupUi(this);
// no other versions, skip copy pages
if (!ui->comp_CopySettings->hasOtherVersionData())
{
this->setStartId(ConfigSimulator);
}
ui->wp_CopyCaches->setConfigComponent(ui->comp_CopyCaches);
ui->wp_CopySettings->setConfigComponent(ui->comp_CopySettings);
ui->wp_Simulator->setConfigComponent(ui->comp_Simulator);
@@ -30,7 +36,11 @@ namespace BlackGui
void CConfigurationWizard::wizardCurrentIdChanged(int id)
{
Q_UNUSED(id);
const int lastId = m_lastId;
m_lastId = id; // update
const bool backward = id < lastId;
Q_UNUSED(backward);
const QWizardPage *page = this->currentPage();
if (page == ui->wp_CopyCaches)
{