VirtualBox

Changeset 90009 in vbox


Ignore:
Timestamp:
Jul 3, 2021 6:58:17 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996: Working on the name and os type page functionality. not complete.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r90003 r90009  
    957957void UIVirtualBoxManager::sltOpenNewMachineWizard()
    958958{
    959 #if 0
    960959    /* Lock the actions preventing cascade calls: */
    961960    UIQObjectPropertySetter guardBlock(QList<QObject*>() << actionPool()->action(UIActionIndexMN_M_Welcome_S_New)
     
    10141013        delete pWizard;
    10151014    }
    1016 #endif
    10171015}
    10181016
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r90003 r90009  
    5151}
    5252
    53 UIWizardNewVM::UIWizardNewVM(QWidget *pParent, const QString &strGroup /* = QString() */,
     53UIWizardNewVM::UIWizardNewVM(QWidget *pParent, const QString &strMachineGroup /* = QString() */,
    5454                             WizardMode enmMode /* = WizardMode_Auto */)
    5555    : UINativeWizard(pParent, WizardType_NewCloudVM, enmMode)
    56     , m_strGroup(strGroup)
     56    , m_strMachineGroup(strMachineGroup)
    5757    , m_iIDECount(0)
    5858    , m_iSATACount(0)
     
    8383    //     case WizardMode_Basic:
    8484    //     {
    85     //         // setPage(Page1, new UIWizardNewVMPageNameOSType(m_strGroup));
     85    //         // setPage(Page1, new UIWizardNewVMPageNameOSType(m_strMachineGroup));
    8686    //         // setPage(Page2, new UIWizardNewVMPageUnattended);
    8787    //         // setPage(Page3, new UIWizardNewVMPageHardware);
     
    9393    //     case WizardMode_Expert:
    9494    //     {
    95     //         setPage(PageExpert, new UIWizardNewVMPageExpert(m_strGroup));
     95    //         setPage(PageExpert, new UIWizardNewVMPageExpert(m_strMachineGroup));
    9696    //         break;
    9797    //     }
     
    112112        case WizardMode_Basic:
    113113        {
    114             addPage(new UIWizardNewVMNameOSTypePageBasic(m_strGroup));
     114            addPage(new UIWizardNewVMNameOSTypePageBasic);
    115115            addPage(new UIWizardNewVMUnattendedPageBasic);
    116116            addPage(new UIWizardNewVMHardwarePageBasic);
     
    144144//     {
    145145//         QVector<QString> groups;
    146 //         if (!m_strGroup.isEmpty())
    147 //             groups << m_strGroup;
     146//         if (!m_strMachineGroup.isEmpty())
     147//             groups << m_strMachineGroup;
    148148//         m_machine = vbox.CreateMachine(field("machineFilePath").toString(),
    149149//                                        field("name").toString(),
     
    697697}
    698698
     699const QString &UIWizardNewVM::machineGroup() const
     700{
     701    return m_strMachineGroup;
     702}
     703
     704const QString &UIWizardNewVM::machineFilePath() const
     705{
     706    return m_strMachineFilePath;
     707}
     708
     709void UIWizardNewVM::setMachineFilePath(const QString &strMachineFilePath)
     710{
     711    m_strMachineFilePath = strMachineFilePath;
     712}
     713
     714const QString &UIWizardNewVM::machineFolder() const
     715{
     716    return m_strMachineFolder;
     717}
     718
     719void UIWizardNewVM::setMachineFolder(const QString &strMachineFolder)
     720{
     721    m_strMachineFolder = strMachineFolder;
     722}
     723
     724const QString &UIWizardNewVM::machineBaseName() const
     725{
     726    return m_strMachineBaseName;
     727}
     728
     729void UIWizardNewVM::setMachineBaseName(const QString &strMachineBaseName)
     730{
     731    m_strMachineBaseName = strMachineBaseName;
     732}
     733
     734const QString &UIWizardNewVM::detectedOSTypeId() const
     735{
     736    return m_strDetectedOSTypeId;
     737}
     738
     739void UIWizardNewVM::setDetectedOSTypeId(const QString &strDetectedOSTypeId)
     740{
     741    m_strDetectedOSTypeId = strDetectedOSTypeId;
     742}
     743
    699744const UIUnattendedInstallData &UIWizardNewVM::unattendedInstallData() const
    700745{
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r90003 r90009  
    5151};
    5252
     53
     54
     55
    5356enum SelectedDiskSource
    5457{
     
    6871public:
    6972
    70     /* Page IDs: */
    71     enum
    72     {
    73         Page1,
    74         Page2,
    75         Page3,
    76         Page4,
    77         PageMax
    78     };
    79 
    80     /* Page IDs: */
    81     enum
    82     {
    83         PageExpert
    84     };
    8573
    8674    /** Constructor: */
    87     UIWizardNewVM(QWidget *pParent, const QString &strGroup = QString(), WizardMode enmMode = WizardMode_Auto);
     75    UIWizardNewVM(QWidget *pParent, const QString &strMachineGroup = QString(), WizardMode enmMode = WizardMode_Auto);
    8876
    8977    /** Prepare routine. */
     
    9987    void setVirtualDisk(const CMedium &medium);
    10088    void setVirtualDisk(const QUuid &mediumId);
     89
     90    const QString &machineGroup() const;
     91
     92    const QString &machineFilePath() const;
     93    void setMachineFilePath(const QString &strMachineFilePath);
     94
     95    const QString &machineFolder() const;
     96    void setMachineFolder(const QString &strMachineFolder);
     97
     98    const QString &machineBaseName() const;
     99    void setMachineBaseName(const QString &strMachineBaseName);
     100
     101    const QString &detectedOSTypeId() const;
     102    void setDetectedOSTypeId(const QString &strDetectedOSTypeId);
    101103
    102104protected:
     
    140142       CMedium m_virtualDisk;
    141143       CMachine m_machine;
    142        QString m_strGroup;
     144       QString m_strMachineGroup;
    143145       int m_iIDECount;
    144146       int m_iSATACount;
     
    149151       mutable UIUnattendedInstallData m_unattendedInstallData;
    150152    /** @} */
     153
     154    /** Path of the folder created by this wizard page. Used to remove previously created
     155     *  folder. see cleanupMachineFolder();*/
     156    QString m_strCreatedFolder;
     157
     158    /** Full path (including the file name) of the machine's configuration file. */
     159    QString m_strMachineFilePath;
     160    /** Path of the folder hosting the machine's configuration file. Generated from m_strMachineFilePath. */
     161    QString m_strMachineFolder;
     162    /** Base name of the machine is generated from the m_strMachineFilePath. */
     163    QString m_strMachineBaseName;
     164
     165    /** Type Id od the OS detected from the ISO file by IUnattended. */
     166    QString m_strDetectedOSTypeId;
    151167};
    152168
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.cpp

    r90003 r90009  
    178178};
    179179
    180 // UIWizardNewVMNameOSTypePage::UIWizardNewVMNameOSTypePage(const QString &strGroup)
    181 //     : m_pNameAndSystemEditor(0)
    182 //     , m_pSkipUnattendedCheckBox(0)
    183 //     , m_strGroup(strGroup)
    184 // {
    185 //     CHost host = uiCommon().host();
    186 //     m_fSupportsHWVirtEx = host.GetProcessorFeature(KProcessorFeature_HWVirtEx);
    187 //     m_fSupportsLongMode = host.GetProcessorFeature(KProcessorFeature_LongMode);
    188 // }
    189 
    190 // void UIWizardNewVMNameOSTypePage::onNameChanged(QString strNewName)
    191 // {
    192 //     /* Do not forget about achitecture bits, if not yet specified: */
    193 //     if (!strNewName.contains("32") && !strNewName.contains("64"))
    194 //         strNewName += ARCH_BITS == 64 && m_fSupportsHWVirtEx && m_fSupportsLongMode ? "64" : "32";
    195 
    196 //     /* Search for a matching OS type based on the string the user typed already. */
    197 //     for (size_t i = 0; i < RT_ELEMENTS(gs_OSTypePattern); ++i)
    198 //         if (strNewName.contains(gs_OSTypePattern[i].pattern))
    199 //         {
    200 //             if (m_pNameAndSystemEditor)
    201 //                 m_pNameAndSystemEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId));
    202 //             break;
    203 //         }
    204 // }
    205 
    206 // void UIWizardNewVMNameOSTypePage::onOsTypeChanged()
    207 // {
    208 //     /* If the user manually edited the OS type, we didn't want our automatic OS type guessing anymore.
    209 //      * So simply disconnect the text-edit signal. */
    210 //     if (m_pNameAndSystemEditor)
    211 //         m_pNameAndSystemEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &)));
    212 // }
    213 
    214 // void UIWizardNewVMNameOSTypePage::composeMachineFilePath()
    215 // {
    216 //     if (!m_pNameAndSystemEditor)
    217 //         return;
    218 //     if (m_pNameAndSystemEditor->name().isEmpty() || m_pNameAndSystemEditor->path().isEmpty())
    219 //         return;
    220 //     /* Get VBox: */
    221 //     CVirtualBox vbox = uiCommon().virtualBox();
    222 
    223 //     /* Compose machine filename: */
    224 //     m_strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(),
    225 //                                                        m_strGroup,
    226 //                                                        QString(),
    227 //                                                        m_pNameAndSystemEditor->path());
    228 //     /* Compose machine folder/basename: */
    229 //     const QFileInfo fileInfo(m_strMachineFilePath);
    230 //     m_strMachineFolder = fileInfo.absolutePath();
    231 //     m_strMachineBaseName = fileInfo.completeBaseName();
    232 // }
    233 
    234 
    235 // bool UIWizardNewVMNameOSTypePage::createMachineFolder()
    236 // {
    237 //     if (!m_pNameAndSystemEditor)
    238 //         return false;
    239 //     /* Cleanup previosly created folder if any: */
    240 //     if (!cleanupMachineFolder())
    241 //     {
    242 //         msgCenter().cannotRemoveMachineFolder(m_strMachineFolder, thisImp());
    243 //         return false;
    244 //     }
    245 
    246 //     composeMachineFilePath();
    247 
    248 //     /* Check if the folder already exists and check if it has been created by this wizard */
    249 //     if (QDir(m_strMachineFolder).exists())
    250 //     {
    251 //         /* Looks like we have already created this folder for this run of the wizard. Just return */
    252 //         if (m_strCreatedFolder == m_strMachineFolder)
    253 //             return true;
    254 //         /* The folder is there but not because of this wizard. Avoid overwriting a existing machine's folder */
    255 //         else
    256 //         {
    257 //             msgCenter().cannotRewriteMachineFolder(m_strMachineFolder, thisImp());
    258 //             return false;
    259 //         }
    260 //     }
    261 
    262 //     /* Try to create new folder (and it's predecessors): */
    263 //     bool fMachineFolderCreated = QDir().mkpath(m_strMachineFolder);
    264 //     if (!fMachineFolderCreated)
    265 //     {
    266 //         msgCenter().cannotCreateMachineFolder(m_strMachineFolder, thisImp());
    267 //         return false;
    268 //     }
    269 //     m_strCreatedFolder = m_strMachineFolder;
    270 //     return true;
    271 // }
    272 
    273 // bool UIWizardNewVMNameOSTypePage::cleanupMachineFolder(bool fWizardCancel /* = false */)
    274 // {
    275 //     /* Make sure folder was previosly created: */
    276 //     if (m_strCreatedFolder.isEmpty())
    277 //         return true;
    278 //     /* Clean this folder if the machine folder has been changed by the user or we are cancelling the wizard: */
    279 //     if (m_strCreatedFolder != m_strMachineFolder || fWizardCancel)
    280 //     {
    281 //         /* Try to cleanup folder (and it's predecessors): */
    282 //         bool fMachineFolderRemoved = QDir().rmpath(m_strCreatedFolder);
    283 //         /* Reset machine folder value: */
    284 //         if (fMachineFolderRemoved)
    285 //             m_strCreatedFolder = QString();
    286 //         /* Return cleanup result: */
    287 //         return fMachineFolderRemoved;
    288 //     }
    289 //     return true;
    290 // }
     180void UIWizardNewVMNameOSTypePage::onNameChanged(UINameAndSystemEditor *pNameAndSystemEditor, QString strNewName)
     181{
     182    CHost host = uiCommon().host();
     183    bool fSupportsHWVirtEx = host.GetProcessorFeature(KProcessorFeature_HWVirtEx);
     184    bool fSupportsLongMode = host.GetProcessorFeature(KProcessorFeature_LongMode);
     185
     186    /* Do not forget about achitecture bits, if not yet specified: */
     187    if (!strNewName.contains("32") && !strNewName.contains("64"))
     188        strNewName += ARCH_BITS == 64 && fSupportsHWVirtEx && fSupportsLongMode ? "64" : "32";
     189
     190    /* Search for a matching OS type based on the string the user typed already. */
     191    for (size_t i = 0; i < RT_ELEMENTS(gs_OSTypePattern); ++i)
     192        if (strNewName.contains(gs_OSTypePattern[i].pattern))
     193        {
     194            if (pNameAndSystemEditor)
     195                pNameAndSystemEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId));
     196            break;
     197        }
     198}
     199
     200void UIWizardNewVMNameOSTypePage::composeMachineFilePath(UINameAndSystemEditor *pNameAndSystemEditor,
     201                                                         UINativeWizard *pWizard)
     202{
     203    UIWizardNewVM *pNewVMWizard = qobject_cast<UIWizardNewVM*>(pWizard);
     204    if (!pNameAndSystemEditor || !pNewVMWizard)
     205        return;
     206    if (pNameAndSystemEditor->name().isEmpty() || pNameAndSystemEditor->path().isEmpty())
     207        return;
     208     /* Get VBox: */
     209    CVirtualBox vbox = uiCommon().virtualBox();
     210
     211    /* Compose machine filename: */
     212    pNewVMWizard->setMachineFilePath(vbox.ComposeMachineFilename(pNameAndSystemEditor->name(),
     213                                                                 pNewVMWizard->machineGroup(),
     214                                                                 QString(),
     215                                                                 pNameAndSystemEditor->path()));
     216    /* Compose machine folder/basename: */
     217    const QFileInfo fileInfo(pNewVMWizard->machineFilePath());
     218    pNewVMWizard->setMachineFolder(fileInfo.absolutePath());
     219    pNewVMWizard->setMachineBaseName(fileInfo.completeBaseName());
     220}
     221
     222bool UIWizardNewVMNameOSTypePage::createMachineFolder(UINameAndSystemEditor *pNameAndSystemEditor,
     223                                                      UINativeWizardPage *pCaller,
     224                                                      const QString &strMachineFolder,
     225                                                      QString &strCreatedFolder)
     226{
     227    if (!pNameAndSystemEditor)
     228        return false;
     229    /* Cleanup previosly created folder if any: */
     230    if (!cleanupMachineFolder(strMachineFolder, strCreatedFolder))
     231    {
     232        msgCenter().cannotRemoveMachineFolder(strMachineFolder, pCaller);
     233        return false;
     234    }
     235
     236    /* Check if the folder already exists and check if it has been created by this wizard */
     237    if (QDir(strMachineFolder).exists())
     238    {
     239        /* Looks like we have already created this folder for this run of the wizard. Just return */
     240        if (strCreatedFolder == strMachineFolder)
     241            return true;
     242        /* The folder is there but not because of this wizard. Avoid overwriting a existing machine's folder */
     243        else
     244        {
     245            msgCenter().cannotRewriteMachineFolder(strMachineFolder, pCaller);
     246            return false;
     247        }
     248    }
     249
     250    /* Try to create new folder (and it's predecessors): */
     251    bool fMachineFolderCreated = QDir().mkpath(strMachineFolder);
     252    if (!fMachineFolderCreated)
     253    {
     254        msgCenter().cannotCreateMachineFolder(strMachineFolder, pCaller);
     255        return false;
     256    }
     257    strCreatedFolder = strMachineFolder;
     258    return true;
     259}
     260
     261bool UIWizardNewVMNameOSTypePage::cleanupMachineFolder(const QString &strMachineFolder,
     262                                                       QString &strCreatedFolder, bool fWizardCancel /* = false */)
     263{
     264    /* Make sure folder was previosly created: */
     265    if (strCreatedFolder.isEmpty())
     266        return true;
     267    /* Clean this folder if the machine folder has been changed by the user or we are cancelling the wizard: */
     268    if (strCreatedFolder != strMachineFolder || fWizardCancel)
     269    {
     270        /* Try to cleanup folder (and it's predecessors): */
     271        bool fMachineFolderRemoved = QDir().rmpath(strCreatedFolder);
     272        /* Reset machine folder value: */
     273        if (fMachineFolderRemoved)
     274            strCreatedFolder = QString();
     275        /* Return cleanup result: */
     276        return fMachineFolderRemoved;
     277    }
     278    return true;
     279}
    291280
    292281// QString UIWizardNewVMNameOSTypePage::machineFilePath() const
     
    361350// }
    362351
    363 // bool UIWizardNewVMNameOSTypePage::determineOSType(const QString &strISOPath)
    364 // {
    365 //     QFileInfo isoFileInfo(strISOPath);
    366 //     if (!isoFileInfo.exists())
    367 //     {
    368 //         m_strDetectedOSTypeId.clear();
    369 //         return false;
    370 //     }
    371 
    372 //     CUnattended comUnatteded = uiCommon().virtualBox().CreateUnattendedInstaller();
    373 //     comUnatteded.SetIsoPath(strISOPath);
    374 //     comUnatteded.DetectIsoOS();
    375 
    376 //     m_strDetectedOSTypeId = comUnatteded.GetDetectedOSTypeId();
    377 //     return true;
    378 // }
     352void UIWizardNewVMNameOSTypePage::determineOSType(const QString &strISOPath, UINativeWizard *pWizard)
     353{
     354    UIWizardNewVM *pNewVMWizard = qobject_cast<UIWizardNewVM*>(pWizard);
     355    if (!pNewVMWizard)
     356        return;
     357
     358    QFileInfo isoFileInfo(strISOPath);
     359    if (!isoFileInfo.exists())
     360    {
     361        pNewVMWizard->setDetectedOSTypeId(QString());
     362        return;
     363    }
     364
     365    CUnattended comUnatteded = uiCommon().virtualBox().CreateUnattendedInstaller();
     366    comUnatteded.SetIsoPath(strISOPath);
     367    comUnatteded.DetectIsoOS();
     368    pNewVMWizard->setDetectedOSTypeId(comUnatteded.GetDetectedOSTypeId());
     369}
    379370
    380371// bool UIWizardNewVMNameOSTypePage::skipUnattendedInstall() const
     
    415406
    416407
    417 UIWizardNewVMNameOSTypePageBasic::UIWizardNewVMNameOSTypePageBasic(const QString &strGroup)
     408UIWizardNewVMNameOSTypePageBasic::UIWizardNewVMNameOSTypePageBasic()
    418409    : m_pNameAndSystemLayout(0)
    419410    , m_pNameAndSystemEditor(0)
     
    421412    , m_pNameOSTypeLabel(0)
    422413{
    423     Q_UNUSED(strGroup);
    424414    prepare();
    425415}
     
    440430    }
    441431
    442     // createConnections();
     432    createConnections();
    443433    // /* Register fields: */
    444434    // registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));
     
    456446void UIWizardNewVMNameOSTypePageBasic::createConnections()
    457447{
    458     // if (m_pNameAndSystemEditor)
    459     // {
    460     //     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltNameChanged);
    461     //     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltPathChanged);
    462     //     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltOsTypeChanged);
    463     //     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigImageChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltISOPathChanged);
    464     // }
     448    if (m_pNameAndSystemEditor)
     449    {
     450        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltNameChanged);
     451        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltPathChanged);
     452        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltOsTypeChanged);
     453        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigImageChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltISOPathChanged);
     454    }
    465455}
    466456
     
    474464}
    475465
    476 int UIWizardNewVMNameOSTypePageBasic::nextId() const
    477 {
    478     // if (isUnattendedEnabled())
    479     //     return UIWizardNewVM::Page2;
    480     // return UIWizardNewVM::Page3;
    481     return 0;
    482 }
    483 
    484466void UIWizardNewVMNameOSTypePageBasic::sltNameChanged(const QString &strNewName)
    485467{
    486468    Q_UNUSED(strNewName);
    487     // onNameChanged(strNewName);
    488     // composeMachineFilePath();
     469    UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, strNewName);
     470    UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, wizard());
    489471}
    490472
     
    492474{
    493475    Q_UNUSED(strNewPath);
    494     //composeMachineFilePath();
     476    UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, wizard());
    495477}
    496478
    497479void UIWizardNewVMNameOSTypePageBasic::sltOsTypeChanged()
    498480{
    499     /* Call to base-class: */
    500     //onOsTypeChanged();
     481    /* If the user manually edited the OS type, we didn't want our automatic OS type guessing anymore.
     482     * So simply disconnect the text-edit signal. */
     483    if (m_pNameAndSystemEditor)
     484        m_pNameAndSystemEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), this, SLOT(sltNameChanged(const QString &)));
    501485}
    502486
    503487void UIWizardNewVMNameOSTypePageBasic::retranslateUi()
    504488{
    505     // retranslateWidgets();
    506489    setTitle(UIWizardNewVM::tr("Virtual machine Name and Operating System"));
    507490
     
    526509{
    527510    /* Translate page: */
    528     // retranslateUi();
    529     // if (m_pNameAndSystemEditor)
    530     //     m_pNameAndSystemEditor->setFocus();
    531     // setSkipCheckBoxEnable();
     511    retranslateUi();
     512    if (m_pNameAndSystemEditor)
     513        m_pNameAndSystemEditor->setFocus();
     514    //setSkipCheckBoxEnable();
    532515}
    533516
     
    543526{
    544527    /* Try to create machine folder: */
     528    //composeMachineFilePath
    545529    //return createMachineFolder();
    546530    return true;
     
    549533void UIWizardNewVMNameOSTypePageBasic::sltISOPathChanged(const QString &strPath)
    550534{
    551     Q_UNUSED(strPath);
    552     // determineOSType(strPath);
     535    UIWizardNewVMNameOSTypePage::determineOSType(strPath, wizard());
    553536    // setTypeByISODetectedOSType(m_strDetectedOSTypeId);
    554537    // /* Update the global recent ISO path: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.h

    r90003 r90009  
    3636class UIFilePathSelector;
    3737class UINameAndSystemEditor;
     38class UINativeWizard;
    3839
    39 // /** 1st page of the New Virtual Machine wizard (base part): */
    40 // class UIWizardNewVMNameOSTypePage  : public UIWizardPageBase
    41 // {
    42 // protected:
     40namespace UIWizardNewVMNameOSTypePage
     41{
     42    void onNameChanged(UINameAndSystemEditor *pNameAndSystemEditor, QString strNewName);
     43    bool createMachineFolder(UINameAndSystemEditor *pNameAndSystemEditor,
     44                             UINativeWizardPage *pCaller,
     45                             const QString &strMachineFolder,
     46                             QString &strCreatedFolder);
    4347
    44 //     /** Constructor. */
    45 //     UIWizardNewVMNameOSTypePage(const QString &strGroup);
    46 
    47 //     /** Handlers. */
    48 //     void onNameChanged(QString strNewName);
    49 //     void onOsTypeChanged();
    50 
    51 //     bool createMachineFolder();
    52 //     /** Removes a previously created folder (if exists) before creating a new one.
    53 //      *  used during page cleanup and new folder creation. Called upon page Next/Back and
    54 //      *  wizard cancel */
    55 //     bool cleanupMachineFolder(bool fWizardCancel = false);
     48    /** Removes a previously created folder (if exists) before creating a new one.
     49     *  used during page cleanup and new folder creation. Called upon page Next/Back and
     50     *  wizard cancel */
     51    bool cleanupMachineFolder(const QString &strMachineFolder,
     52                              QString &strCreatedFolder,bool fWizardCancel = false);
     53    void composeMachineFilePath(UINameAndSystemEditor *pNameAndSystemEditor, UINativeWizard *pWizard);
     54    void determineOSType(const QString &strISOPath, UINativeWizard *pWizard);
    5655
    5756//     /** @name Property getters/setters
     
    7473//     /** @} */
    7574
    76 //     /** calls CVirtualBox::ComposeMachineFilename(...) and sets related member variables */
    77 //     void composeMachineFilePath();
    7875
    7976//     /** Colors the widgets red if they cause isComplete to fail. */
     
    8178//     void retranslateWidgets();
    8279//     QString ISOFilePath() const;
    83 //     bool determineOSType(const QString &strISOPath);
     80
    8481//     void setTypeByISODetectedOSType(const QString &strDetectedOSType);
    8582//     /** Return false if ISO path is not empty but points to an missing or unreadable file. */
     
    8784//     void setSkipCheckBoxEnable();
    8885
    89 //     QString m_strDetectedOSTypeId;
     86//
    9087
    9188// private:
    9289
    93 //     /** Full path (including the file name) of the machine's configuration file. */
    94 //     QString m_strMachineFilePath;
    95 //     /** Path of the folder hosting the machine's configuration file. Generated from m_strMachineFilePath. */
    96 //     QString m_strMachineFolder;
    97 //     /** Path of the folder created by this wizard page. Used to remove previously created
    98 //      *  folder. see cleanupMachineFolder();*/
    99 //     QString m_strCreatedFolder;
    100 //     /** Base name of the machine is generated from the m_strMachineFilePath. */
    101 //     QString m_strMachineBaseName;
    10290
    103 //     QString m_strGroup;
    104 //     bool m_fSupportsHWVirtEx;
    105 //     bool m_fSupportsLongMode;
    106 
    107 //     friend class UIWizardNewVM;
    10891// };
     92}
    10993
    11094/** 1st page of the New Virtual Machine wizard (basic extension). */
     
    117101
    118102    /** Constructor. */
    119     UIWizardNewVMNameOSTypePageBasic(const QString &strGroup);
    120     virtual bool isComplete() const; /* override */
    121     virtual int nextId() const /* override */;
     103    UIWizardNewVMNameOSTypePageBasic();
     104
    122105
    123106protected:
     107
     108    virtual bool isComplete() const; /* override final */
     109    /** Validation stuff. */
     110    virtual bool validatePage() /* override */;
    124111
    125112private slots:
     
    141128    void initializePage();
    142129    void cleanupPage();
    143 
    144130    QWidget *createNameOSTypeWidgets();
    145 
    146     /** Validation stuff. */
    147     virtual bool validatePage() /* override */;
    148131
    149132
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette