mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 18:55:38 +08:00
refs #887, added QWizardPage derived class to call dependent functions
(QWizardPage provides virtual functions for that)
This commit is contained in:
@@ -181,5 +181,18 @@ namespace BlackGui
|
|||||||
const int width = this->width() * 0.45;
|
const int width = this->width() * 0.45;
|
||||||
ui->cb_OtherVersions->setFixedWidth(width);
|
ui->cb_OtherVersions->setFixedWidth(width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCopyConfigurationWizardPage::initializePage()
|
||||||
|
{
|
||||||
|
Q_ASSERT_X(m_config, Q_FUNC_INFO, "Missing config");
|
||||||
|
m_config->initCurrentDirectories();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCopyConfigurationWizardPage::validatePage()
|
||||||
|
{
|
||||||
|
Q_ASSERT_X(m_config, Q_FUNC_INFO, "Missing config");
|
||||||
|
m_config->copySelectedFiles();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
|
#include <QWizardPage>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
namespace Ui { class CCopyConfigurationComponent; }
|
namespace Ui { class CCopyConfigurationComponent; }
|
||||||
@@ -69,6 +70,28 @@ namespace BlackGui
|
|||||||
QStringList m_versionDirs;
|
QStringList m_versionDirs;
|
||||||
QScopedPointer<Ui::CCopyConfigurationComponent> ui;
|
QScopedPointer<Ui::CCopyConfigurationComponent> ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wizard page for CCopyConfigurationComponent
|
||||||
|
*/
|
||||||
|
class CCopyConfigurationWizardPage : public QWizardPage
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//! Constructors
|
||||||
|
using QWizardPage::QWizardPage;
|
||||||
|
|
||||||
|
//! Set config
|
||||||
|
void setConfigComponent(CCopyConfigurationComponent *config) { m_config = config; }
|
||||||
|
|
||||||
|
//! \copydoc QWizardPage::initializePage
|
||||||
|
virtual void initializePage() override;
|
||||||
|
|
||||||
|
//! \copydoc QWizardPage::validatePage
|
||||||
|
virtual bool validatePage() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
CCopyConfigurationComponent *m_config = nullptr;
|
||||||
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user