Changeset 60839 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 4, 2016 3:52:33 PM (9 years ago)
- 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 104 104 if (!m_strGroup.isEmpty()) 105 105 groups << m_strGroup; 106 m_machine = vbox.CreateMachine( QString() /* no file-path for now */,106 m_machine = vbox.CreateMachine(field("machineFilePath").toString(), 107 107 field("machineBaseName").toString(), 108 108 groups, strTypeId, QString()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r60837 r60839 222 222 /* Get default machine folder: */ 223 223 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; 224 229 /* 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 */, 227 232 QString(), 228 strDefaultMachineFolder);233 fUseDefaultPath ? strDefaultMachineFolder : strUserMachineFolder); 229 234 /* Compose machine folder/basename: */ 230 235 const QFileInfo fileInfo(strMachineFilePath); … … 250 255 m_strMachineFolder = strMachineFolder; 251 256 m_strMachineBaseName = strMachineBaseName; 257 m_strMachineFilePath = strMachineFilePath; 252 258 return true; 253 259 } … … 274 280 { 275 281 m_pLabel = new QIRichTextLabel(this); 276 m_pNameAndSystemEditor = new UINameAndSystemEditor(this );282 m_pNameAndSystemEditor = new UINameAndSystemEditor(this, true); 277 283 pMainLayout->addWidget(m_pLabel); 278 284 pMainLayout->addWidget(m_pNameAndSystemEditor); … … 289 295 registerField("machineFolder", this, "machineFolder"); 290 296 registerField("machineBaseName", this, "machineBaseName"); 297 registerField("machineFilePath", this, "machineFilePath"); 291 298 } 292 299 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r60837 r60839 53 53 void setMachineBaseName(const QString &strMachineBaseName) { m_strMachineBaseName = strMachineBaseName; } 54 54 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 55 60 /** Holds the machine folder value. */ 56 61 QString m_strMachineFolder; 57 62 /** Holds the machine base-name value. */ 58 63 QString m_strMachineBaseName; 64 /** Holds the machine file-path value. */ 65 QString m_strMachineFilePath; 59 66 60 67 /* Widgets: */ … … 73 80 Q_PROPERTY(QString machineFolder READ machineFolder WRITE setMachineFolder); 74 81 Q_PROPERTY(QString machineBaseName READ machineBaseName WRITE setMachineBaseName); 82 Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath); 75 83 76 84 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r56180 r60839 57 57 QHBoxLayout *pNameAndSystemCntLayout = new QHBoxLayout(m_pNameAndSystemCnt); 58 58 { 59 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt );59 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt, true); 60 60 pNameAndSystemCntLayout->addWidget(m_pNameAndSystemEditor); 61 61 } … … 155 155 registerField("machineFolder", this, "machineFolder"); 156 156 registerField("machineBaseName", this, "machineBaseName"); 157 registerField("machineFilePath", this, "machineFilePath"); 157 158 registerField("ram", m_pRamSlider, "value", SIGNAL(valueChanged(int))); 158 159 registerField("virtualDisk", this, "virtualDisk"); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r55401 r60839 36 36 Q_PROPERTY(QString machineFolder READ machineFolder WRITE setMachineFolder); 37 37 Q_PROPERTY(QString machineBaseName READ machineBaseName WRITE setMachineBaseName); 38 Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath); 38 39 Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk); 39 40 Q_PROPERTY(QString virtualDiskId READ virtualDiskId WRITE setVirtualDiskId);
Note:
See TracChangeset
for help on using the changeset viewer.