Esempio n. 1
0
void WDWizardPage::showEvent(QShowEvent *event) {
    if (wizard()->currentPage() == this) {
        setupDialogSize();
    }
    QAbstractButton *runButton = getRunButton(wizard());
    if (NULL != runButton) {
        runButton->setVisible(isFinalPage());
    }
    QWizardPage::showEvent(event);
}
bool UICloneVMWizardPage1::validatePage()
{
    if (isFinalPage())
    {
        /* Start performing long-time operation: */
        startProcessing();
        /* Try to create the clone: */
        bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(cloneName(), KCloneMode_MachineState, isReinitMACsChecked());
        /* Finish performing long-time operation: */
        endProcessing();
        /* Return operation result: */
        return fResult;
    }else
        return true;
}
bool UICloneVMWizardPage2::validatePage()
{
    if (isFinalPage())
    {
        /* Start performing long-time operation: */
        startProcessing();
        /* Try to create the clone: */
        QString strName = field("cloneName").toString();
        bool fReinitMACs = field("reinitMACs").toBool();
        bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(strName, KCloneMode_MachineState, fReinitMACs, m_pLinkedCloneRadio->isChecked());
        /* Finish performing long-time operation: */
        endProcessing();
        /* Return operation result: */
        return fResult;
    }
    else
        return true;
}
Esempio n. 4
0
bool UIWizardCloneVMPageBasic2::validatePage()
{
    /* This page could be final: */
    if (isFinalPage())
    {
        /* Initial result: */
        bool fResult = true;

        /* Lock finish button: */
        startProcessing();

        /* Trying to clone VM: */
        if (fResult)
            fResult = qobject_cast<UIWizardCloneVM*>(wizard())->cloneVM();

        /* Unlock finish button: */
        endProcessing();

        /* Return result: */
        return fResult;
    }
    else
        return true;
}
Esempio n. 5
0
void UIWizardPage::endProcessing()
{
    if (isFinalPage())
        wizard()->button(QWizard::FinishButton)->setEnabled(true);
}
Esempio n. 6
0
void UIWizardPage::startProcessing()
{
    if (isFinalPage())
        wizard()->button(QWizard::FinishButton)->setEnabled(false);
}