VirtualBox

Ignore:
Timestamp:
May 4, 2016 3:52:33 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​​​​​​​​​bugref:6769: Rework for New VM wizard (part 02): Initial implementation for the user's VM location control.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r60837 r60839  
    104104        if (!m_strGroup.isEmpty())
    105105            groups << m_strGroup;
    106         m_machine = vbox.CreateMachine(QString() /* no file-path for now */,
     106        m_machine = vbox.CreateMachine(field("machineFilePath").toString(),
    107107                                       field("machineBaseName").toString(),
    108108                                       groups, strTypeId, QString());
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r60837 r60839  
    222222    /* Get default machine folder: */
    223223    const QString strDefaultMachineFolder = vbox.GetSystemProperties().GetDefaultMachineFolder();
     224    /* Fetch user's machine location: */
     225    const QString strUserMachineLocation = m_pNameAndSystemEditor->name();
     226    const QString strUserMachineFolder = QFileInfo(strUserMachineLocation).absolutePath();
     227    const QString strUserMachineBaseName = QFileInfo(strUserMachineLocation).fileName();
     228    const bool fUseDefaultPath = strUserMachineLocation == strUserMachineBaseName;
    224229    /* Compose machine filename: */
    225     const QString strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(),
    226                                                                    m_strGroup,
     230    const QString strMachineFilePath = vbox.ComposeMachineFilename(strUserMachineBaseName,
     231                                                                   fUseDefaultPath ? m_strGroup : QString() /* no group in that case */,
    227232                                                                   QString(),
    228                                                                    strDefaultMachineFolder);
     233                                                                   fUseDefaultPath ? strDefaultMachineFolder : strUserMachineFolder);
    229234    /* Compose machine folder/basename: */
    230235    const QFileInfo fileInfo(strMachineFilePath);
     
    250255    m_strMachineFolder = strMachineFolder;
    251256    m_strMachineBaseName = strMachineBaseName;
     257    m_strMachineFilePath = strMachineFilePath;
    252258    return true;
    253259}
     
    274280    {
    275281        m_pLabel = new QIRichTextLabel(this);
    276         m_pNameAndSystemEditor = new UINameAndSystemEditor(this);
     282        m_pNameAndSystemEditor = new UINameAndSystemEditor(this, true);
    277283        pMainLayout->addWidget(m_pLabel);
    278284        pMainLayout->addWidget(m_pNameAndSystemEditor);
     
    289295    registerField("machineFolder", this, "machineFolder");
    290296    registerField("machineBaseName", this, "machineBaseName");
     297    registerField("machineFilePath", this, "machineFilePath");
    291298}
    292299
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r60837 r60839  
    5353    void setMachineBaseName(const QString &strMachineBaseName) { m_strMachineBaseName = strMachineBaseName; }
    5454
     55    /** Returns the machine file-path value. */
     56    QString machineFilePath() const { return m_strMachineFilePath; }
     57    /** Defines the @a strMachineFilePath value. */
     58    void setMachineFilePath(const QString &strMachineFilePath) { m_strMachineFilePath = strMachineFilePath; }
     59
    5560    /** Holds the machine folder value. */
    5661    QString m_strMachineFolder;
    5762    /** Holds the machine base-name value. */
    5863    QString m_strMachineBaseName;
     64    /** Holds the machine file-path value. */
     65    QString m_strMachineFilePath;
    5966
    6067    /* Widgets: */
     
    7380    Q_PROPERTY(QString machineFolder READ machineFolder WRITE setMachineFolder);
    7481    Q_PROPERTY(QString machineBaseName READ machineBaseName WRITE setMachineBaseName);
     82    Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath);
    7583
    7684public:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r56180 r60839  
    5757            QHBoxLayout *pNameAndSystemCntLayout = new QHBoxLayout(m_pNameAndSystemCnt);
    5858            {
    59                 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt);
     59                m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt, true);
    6060                pNameAndSystemCntLayout->addWidget(m_pNameAndSystemEditor);
    6161            }
     
    155155    registerField("machineFolder", this, "machineFolder");
    156156    registerField("machineBaseName", this, "machineBaseName");
     157    registerField("machineFilePath", this, "machineFilePath");
    157158    registerField("ram", m_pRamSlider, "value", SIGNAL(valueChanged(int)));
    158159    registerField("virtualDisk", this, "virtualDisk");
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r55401 r60839  
    3636    Q_PROPERTY(QString machineFolder READ machineFolder WRITE setMachineFolder);
    3737    Q_PROPERTY(QString machineBaseName READ machineBaseName WRITE setMachineBaseName);
     38    Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath);
    3839    Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk);
    3940    Q_PROPERTY(QString virtualDiskId READ virtualDiskId WRITE setVirtualDiskId);
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