Changeset 87608 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 4, 2021 2:54:27 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142643
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIDefaultMachineFolderEditor.cpp
r86097 r87608 93 93 if (m_pLabel) 94 94 m_pLabel->setBuddy(m_pSelector); 95 m_pSelector->set HomeDir(uiCommon().homeFolder());95 m_pSelector->setInitialPath(uiCommon().homeFolder()); 96 96 connect(m_pSelector, &UIFilePathSelector::pathChanged, 97 97 this, &UIDefaultMachineFolderEditor::sltHandleSelectorPathChanged); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVRDEAuthLibraryEditor.cpp
r86097 r87608 93 93 if (m_pLabel) 94 94 m_pLabel->setBuddy(m_pSelector); 95 m_pSelector->set HomeDir(uiCommon().homeFolder());95 m_pSelector->setInitialPath(uiCommon().homeFolder()); 96 96 m_pSelector->setMode(UIFilePathSelector::Mode_File_Open); 97 97 connect(m_pSelector, &UIFilePathSelector::pathChanged, -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r87251 r87608 528 528 /* Load old 'Recording' data from the cache: */ 529 529 m_pCheckboxRecording->setChecked(oldDisplayData.m_fRecordingEnabled); 530 m_pEditorRecordingFilePath->set HomeDir(oldDisplayData.m_strRecordingFolder);530 m_pEditorRecordingFilePath->setInitialPath(oldDisplayData.m_strRecordingFolder); 531 531 m_pEditorRecordingFilePath->setPath(oldDisplayData.m_strRecordingFilePath); 532 532 m_pSpinboxRecordingFrameWidth->setValue(oldDisplayData.m_iRecordingVideoFrameWidth); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r87251 r87608 277 277 AssertPtrReturnVoid(m_pComboDragAndDrop); 278 278 m_pEditorSnapshotFolder->setPath(oldGeneralData.m_strSnapshotsFolder); 279 m_pEditorSnapshotFolder->set HomeDir(oldGeneralData.m_strSnapshotsHomeDir);279 m_pEditorSnapshotFolder->setInitialPath(oldGeneralData.m_strSnapshotsHomeDir); 280 280 const int iClipboardModePosition = m_pComboClipboard->findData(oldGeneralData.m_clipboardMode); 281 281 m_pComboClipboard->setCurrentIndex(iClipboardModePosition == -1 ? 0 : iClipboardModePosition); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp
r86045 r87608 225 225 { 226 226 m_pSelectorPath->setResetEnabled(false); 227 m_pSelectorPath->set HomeDir(QDir::homePath());227 m_pSelectorPath->setInitialPath(QDir::homePath()); 228 228 229 229 pLayoutMain->addWidget(m_pSelectorPath, 0, 1); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
r87317 r87608 58 58 : QIWithRetranslateUI<QIComboBox>(pParent) 59 59 , m_enmMode(Mode_Folder) 60 , m_str HomeDir(QDir::current().absolutePath())60 , m_strInitialPath(QDir::current().absolutePath()) 61 61 , m_fEditable(true) 62 62 , m_fModified(false) … … 379 379 { 380 380 /* Prepare initial directory: */ 381 QString strInit Dir;381 QString strInitPath; 382 382 /* If something already chosen: */ 383 383 if (!m_strPath.isEmpty()) … … 387 387 if (strObjectName == m_strPath) 388 388 { 389 /* Use the home directory: */390 strInit Dir = m_strHomeDir;389 /* Use the initial path: */ 390 strInitPath = m_strInitialPath; 391 391 } 392 392 /* If that is full file/folder (object) path: */ … … 394 394 { 395 395 /* Use the first existing dir of m_strPath: */ 396 strInit Dir= QIFileDialog::getFirstExistingDir(m_strPath);396 strInitPath = QIFileDialog::getFirstExistingDir(m_strPath); 397 397 } 398 398 /* Finally, append object name itself: */ 399 strInit Dir = QDir(strInitDir).absoluteFilePath(strObjectName);400 } 401 /* Use the home directoryby default: */402 if (strInit Dir.isNull())403 strInit Dir = m_strHomeDir;399 strInitPath = QDir(strInitPath).absoluteFilePath(strObjectName); 400 } 401 /* Use the initial path by default: */ 402 if (strInitPath.isNull()) 403 strInitPath = m_strInitialPath; 404 404 405 405 /* Open the choose-file/folder dialog: */ … … 408 408 { 409 409 case Mode_File_Open: 410 strSelPath = QIFileDialog::getOpenFileName(strInit Dir, m_strFileDialogFilters, parentWidget(), m_strFileDialogTitle); break;410 strSelPath = QIFileDialog::getOpenFileName(strInitPath, m_strFileDialogFilters, parentWidget(), m_strFileDialogTitle); break; 411 411 case Mode_File_Save: 412 412 { 413 strSelPath = QIFileDialog::getSaveFileName(strInit Dir, m_strFileDialogFilters, parentWidget(), m_strFileDialogTitle);413 strSelPath = QIFileDialog::getSaveFileName(strInitPath, m_strFileDialogFilters, parentWidget(), m_strFileDialogTitle); 414 414 if (!strSelPath.isEmpty() && QFileInfo(strSelPath).suffix().isEmpty()) 415 415 { … … 422 422 } 423 423 case Mode_Folder: 424 strSelPath = QIFileDialog::getExistingDirectory(strInit Dir, parentWidget(), m_strFileDialogTitle); break;424 strSelPath = QIFileDialog::getExistingDirectory(strInitPath, parentWidget(), m_strFileDialogTitle); break; 425 425 } 426 426 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h
r87317 r87608 126 126 void setPath(const QString &strPath, bool fRefreshText = true); 127 127 128 /** Defines the @a str HomeDir. */129 void set HomeDir(const QString &strHomeDir) { m_strHomeDir = strHomeDir; }128 /** Defines the @a strInitialPath. */ 129 void setInitialPath(const QString &strInitialPath) { m_strInitialPath = strInitialPath; } 130 130 131 131 protected: … … 181 181 /** Holds the path. */ 182 182 QString m_strPath; 183 /** Holds the home dir. */184 QString m_str HomeDir;183 /** Holds the path which we pass to QFileDialog as initial path. */ 184 QString m_strInitialPath; 185 185 186 186 /** Holds the file-dialog title. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r87607 r87608 449 449 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 450 450 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 451 m_pISOFilePathSelector->set HomeDir(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD));451 m_pISOFilePathSelector->setInitialPath(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD)); 452 452 pISOSelectorLayout->addWidget(m_pISOFilePathSelector); 453 453 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87607 r87608 330 330 m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 331 331 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 332 m_pISOFilePathSelector->set HomeDir(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD));332 m_pISOFilePathSelector->setInitialPath(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD)); 333 333 pInstallationISOContainerLayout->addWidget(m_pISOFilePathSelector); 334 334 }
Note:
See TracChangeset
for help on using the changeset viewer.