UICloneVMWizard::UICloneVMWizard(QWidget *pParent, CMachine machine, CSnapshot snapshot /* = CSnapshot() */)
    : QIWizard(pParent)
    , m_machine(machine)
    , m_snapshot(snapshot)
{
    /* Create & add pages: */
    setPage(PageIntro, new UICloneVMWizardPage1(machine.GetName()));
    /* If we are having a snapshot we can show the "Linked" option. */
    setPage(PageType, new UICloneVMWizardPage2(snapshot.isNull()));
    /* If the machine has no snapshots, we don't bother the user about options
     * for it. */
    if (machine.GetSnapshotCount() > 0)
        setPage(PageMode, new UICloneVMWizardPage3(snapshot.isNull() ? false : snapshot.GetChildrenCount() > 0));

    /* Translate wizard: */
    retranslateUi();

    /* Translate wizard pages: */
    retranslateAllPages();

    /* Resize wizard to 'golden ratio': */
    resizeToGoldenRatio();

#ifdef Q_WS_MAC
    setMinimumSize(QSize(600, 400));
    /* Assign background image: */
    assignBackground(":/vmw_clone_bg.png");
#else /* Q_WS_MAC */
    /* Assign watermark: */
    assignWatermark(":/vmw_clone.png");
#endif /* Q_WS_MAC */
}
Example #2
0
void UIWizard::prepare()
{
    /* Translate wizard: */
    retranslateUi();
    /* Translate wizard pages: */
    retranslatePages();

    /* Resize wizard to 'golden ratio': */
    resizeToGoldenRatio();

    /* Notify pages they are ready: */
    QList<int> ids = pageIds();
    for (int i = 0; i < ids.size(); ++i)
        qobject_cast<UIWizardPage*>(page(ids[i]))->markReady();

    /* Make sure custom buttons shown even if final page is first to show: */
    sltCurrentIdChanged(startId());
}
UIFirstRunWzd::UIFirstRunWzd(QWidget *pParent, const CMachine &machine) : QIWizard(pParent)
{
    /* Create & add pages */
    UIFirstRunWzdPage1 *pPage1 = new UIFirstRunWzdPage1;
    UIFirstRunWzdPage2 *pPage2 = new UIFirstRunWzdPage2;
    UIFirstRunWzdPage3 *pPage3 = new UIFirstRunWzdPage3;

    addPage(pPage1);
    addPage(pPage2);
    addPage(pPage3);

    /* Set 'machine' field value for page 3 */
    setField("machine", QVariant::fromValue(machine));

    /* Init pages basing on machine set */
    pPage1->init();
    pPage2->init();
    pPage3->init();

    /* Initial translate */
    retranslateUi();

    /* Initial translate all pages */
    retranslateAllPages();

    /* Resize to 'golden ratio' */
    resizeToGoldenRatio();

#ifdef Q_WS_MAC
    /* Assign background image */
    assignBackground(":/vmw_first_run_bg.png");
#else /* Q_WS_MAC */
    /* Assign watermark */
    assignWatermark(":/vmw_first_run.png");
#endif /* Q_WS_MAC */
}