VirtualBox

Changeset 43424 in vbox


Ignore:
Timestamp:
Sep 25, 2012 9:01:47 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6380: Double-clicking .ova/.ovf file should propose to import the
appliance.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r41689 r43424  
    10971097
    10981098    /* Show Clone VD wizard: */
    1099     UIWizardCloneVD wizard(this, pItem->medium().medium());
    1100     wizard.exec();
     1099    UISafePointerWizard pWizard = new UIWizardCloneVD(this, pItem->medium().medium());
     1100    pWizard->prepare();
     1101    pWizard->exec();
     1102    if (pWizard)
     1103        delete pWizard;
    11011104}
    11021105
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r43396 r43424  
    11361136             && machine.GetTeleporterEnabled()))
    11371137    {
    1138         UIWizardFirstRun wzd(mainMachineWindow(), session().GetMachine());
    1139         wzd.exec();
     1138        UISafePointerWizard pWizard = new UIWizardFirstRun(mainMachineWindow(), session().GetMachine());
     1139        pWizard->prepare();
     1140        pWizard->exec();
     1141        if (pWizard)
     1142            delete pWizard;
    11401143    }
    11411144
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r43242 r43424  
    278278    QString strTmpFile = strFileName;
    279279#endif /* !Q_WS_MAC */
    280     UIWizardImportApp wizard(this, strTmpFile);
    281     if (strFileName.isEmpty() || wizard.isValid())
    282         wizard.exec();
     280    UISafePointerWizardImportApp pWizard = new UIWizardImportApp(this, strTmpFile);
     281    pWizard->prepare();
     282    if (strFileName.isEmpty() || pWizard->isValid())
     283        pWizard->exec();
     284    if (pWizard)
     285        delete pWizard;
    283286}
    284287
     
    294297        names << items[i]->name();
    295298    /* Show Export Appliance wizard: */
    296     UIWizardExportApp wizard(this, names);
    297     wizard.exec();
     299    UISafePointerWizard pWizard = new UIWizardExportApp(this, names);
     300    pWizard->prepare();
     301    pWizard->exec();
     302    if (pWizard)
     303        delete pWizard;
    298304}
    299305
     
    416422
    417423    /* Show Clone VM wizard: */
    418     UIWizardCloneVM wizard(this, pItem->machine());
    419     wizard.exec();
     424    UISafePointerWizard pWizard = new UIWizardCloneVM(this, pItem->machine());
     425    pWizard->prepare();
     426    pWizard->exec();
     427    if (pWizard)
     428        delete pWizard;
    420429}
    421430
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp

    r42925 r43424  
    705705
    706706    /* Show Clone VM wizard: */
    707     UIWizardCloneVM wzd(this, machine, snapshot);
    708     wzd.exec();
     707    UISafePointerWizard pWizard = new UIWizardCloneVM(this, machine, snapshot);
     708    pWizard->prepare();
     709    pWizard->exec();
     710    if (pWizard)
     711        delete pWizard;
    709712}
    710713
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r43155 r43424  
    899899    else if (!selectionList().isEmpty())
    900900        pGroup = selectionList().first()->parentItem();
     901    QString strGroupName;
    901902    if (pGroup)
    902     {
    903         UIWizardNewVM wizard(&vboxGlobal().selectorWnd(), fullName(pGroup));
    904         wizard.exec();
    905     }
    906     else
    907     {
    908         UIWizardNewVM wizard(&vboxGlobal().selectorWnd());
    909         wizard.exec();
    910     }
     903        strGroupName = fullName(pGroup);
     904    UISafePointerWizard pWizard = new UIWizardNewVM(&vboxGlobal().selectorWnd(), strGroupName);
     905    pWizard->prepare();
     906    pWizard->exec();
     907    if (pWizard)
     908        delete pWizard;
    911909}
    912910
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r43132 r43424  
    30883088    QFileInfo fileInfo(m_strMachineSettingsFilePath);
    30893089    /* Show New VD wizard: */
    3090     UIWizardNewVD dlg(this, QString(), fileInfo.absolutePath(), guestOSType.GetRecommendedHDD());
    3091     return dlg.exec() == QDialog::Accepted ? dlg.virtualDisk().GetId() : QString();
     3090    UISafePointerWizardNewVD pWizard = new UIWizardNewVD(this, QString(), fileInfo.absolutePath(), guestOSType.GetRecommendedHDD());
     3091    pWizard->prepare();
     3092    QString strResult = pWizard->exec() == QDialog::Accepted ? pWizard->virtualDisk().GetId() : QString();
     3093    if (pWizard)
     3094        delete pWizard;
     3095    return strResult;
    30923096}
    30933097
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.cpp

    r41689 r43424  
    2828#include "VBoxGlobal.h"
    2929#include "QIRichTextLabel.h"
    30 
    31 int     UIWizard::exec()
    32 {
    33     /* Prepare wizard: */
    34     prepare();
    35     /* Call to base-class: */
    36     return QWizard::exec();
    37 }
    3830
    3931void UIWizard::sltCurrentIdChanged(int iId)
     
    243235
    244236        /* Get some (first) of those pages: */
    245         UIWizardPage *pPage = qobject_cast<UIWizardPage*>(page(0));
     237        QList<int> pids = pageIds();
     238        UIWizardPage *pPage = qobject_cast<UIWizardPage*>(page(pids.first()));
    246239        /* Calculate actual label width: */
    247240        int iPageWidth = pPage->minimumWidth();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.h

    r41415 r43424  
    2020#define __UIWizard_h__
    2121
    22 /* Global includes: */
     22/* Qt includes: */
    2323#include <QWizard>
     24#include <QPointer>
    2425
    2526/* Local includes: */
     
    5455    Q_OBJECT;
    5556
    56 public slots:
    57 
    58     /* Exec slot: */
    59     int exec();
    60 
    6157public:
    6258
    6359    /* Mode related stuff: */
    6460    UIWizardMode mode() { return m_mode; }
     61
     62    /* Page related methods: */
     63    virtual void prepare();
    6564
    6665protected slots:
     
    8281    /* Page related methods: */
    8382    void setPage(int iId, UIWizardPage *pPage);
    84     virtual void prepare();
    8583    void cleanup();
    8684
     
    119117};
    120118
     119typedef QPointer<UIWizard> UISafePointerWizard;
     120
    121121#endif // __UIWizard_h__
    122122
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.h

    r41021 r43424  
    4646    UIWizardImportApp(QWidget *pParent, const QString &strFileName);
    4747
     48    /* Pages related stuff: */
     49    void prepare();
     50
    4851    /* Is appliance valid? */
    4952    bool isValid() const;
     
    7073    void retranslateUi();
    7174
    72     /* Pages related stuff: */
    73     void prepare();
    74 
    7575    /* Variables: */
    7676    QString m_strFileName;
    7777};
    7878
     79typedef QPointer<UIWizardImportApp> UISafePointerWizardImportApp;
     80
    7981#endif /* __UIWizardImportApp_h__ */
    8082
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.h

    r41587 r43424  
    5454                  UIWizardMode mode = UIWizardMode_Auto);
    5555
     56    /* Pages related stuff: */
     57    void prepare();
     58
    5659    /* Returns virtual-disk: */
    5760    CMedium virtualDisk() const { return m_virtualDisk; }
     
    7174    void retranslateUi();
    7275
    73     /* Pages related stuff: */
    74     void prepare();
    75 
    7676    /* Variables: */
    7777    QString m_strDefaultName;
     
    8181};
    8282
     83typedef QPointer<UIWizardNewVD> UISafePointerWizardNewVD;
     84
    8385#endif // __UIWizardNewVD_h__
    8486
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp

    r42950 r43424  
    7777{
    7878    /* Create New Virtual Hard Drive wizard: */
    79     UIWizardNewVD dlg(thisImp(),
    80                       fieldImp("machineBaseName").toString(),
    81                       fieldImp("machineFolder").toString(),
    82                       fieldImp("type").value<CGuestOSType>().GetRecommendedHDD(),
    83                       wizardImp()->mode());
    84     if (dlg.exec() == QDialog::Accepted)
    85     {
    86         m_virtualDisk = dlg.virtualDisk();
     79    UISafePointerWizardNewVD pWizard = new UIWizardNewVD(thisImp(),
     80                                                         fieldImp("machineBaseName").toString(),
     81                                                         fieldImp("machineFolder").toString(),
     82                                                         fieldImp("type").value<CGuestOSType>().GetRecommendedHDD(),
     83                                                         wizardImp()->mode());
     84    pWizard->prepare();
     85    bool fResult = false;
     86    if (pWizard->exec() == QDialog::Accepted)
     87    {
     88        fResult = true;
     89        m_virtualDisk = pWizard->virtualDisk();
    8790        m_pDiskSelector->setCurrentItem(m_virtualDisk.GetId());
    8891        m_pDiskPresent->click();
    89         return true;
    90     }
    91     return false;
     92    }
     93    if (pWizard)
     94        delete pWizard;
     95    return fResult;
    9296}
    9397
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