Changeset 91349 in vbox
- Timestamp:
- Sep 23, 2021 12:01:00 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 147016
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/medium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.cpp
r90564 r91349 110 110 m_pSizeLabel->setText(tr("Size:")); 111 111 if (m_pButtonBox) 112 m_pButtonBox->button(QDialogButtonBox::Ok)->setText("C reate");112 m_pButtonBox->button(QDialogButtonBox::Ok)->setText("C&reate"); 113 113 if (m_pCheckBoxFormat) 114 114 m_pCheckBoxFormat->setText(tr("Format disk as FAT12")); … … 123 123 } 124 124 125 void UIFDCreationDialog::sltPathChanged(const QString &strPath) 126 { 127 bool fIsFileUnique = checkFilePath(strPath); 128 m_pFilePathSelector->mark(!fIsFileUnique, tr("File already exists")); 129 130 if (m_pButtonBox && m_pButtonBox->button(QDialogButtonBox::Ok)) 131 m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(fIsFileUnique); 132 } 133 134 bool UIFDCreationDialog::checkFilePath(const QString &strPath) const 135 { 136 return !QFileInfo(strPath).exists(); 137 } 138 125 139 void UIFDCreationDialog::sltHandleMediumCreated(const CMedium &comMedium) 126 140 { … … 162 176 163 177 pLayoutMain->addWidget(m_pFilePathSelector, 0, 1, 1, 3); 178 connect(m_pFilePathSelector, &UIFilePathSelector::pathChanged, 179 this, &UIFDCreationDialog::sltPathChanged); 164 180 } 165 181 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.h
r90453 r91349 68 68 /** Handles signal about @a comMedium was created. */ 69 69 void sltHandleMediumCreated(const CMedium &comMedium); 70 void sltPathChanged(const QString &strPath); 70 71 71 72 private: … … 86 87 /** Returns default file-path. */ 87 88 QString getDefaultFilePath() const; 89 /** Returns false if the file is already exists. */ 90 bool checkFilePath(const QString &strPath) const; 88 91 89 92 /** Holds the default folder. */
Note:
See TracChangeset
for help on using the changeset viewer.