Changeset 25091 in vbox
- Timestamp:
- Nov 30, 2009 9:19:48 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55452
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r24557 r25091 245 245 int confirmRunNewHDWzdOrVDM (KDeviceType aDeviceType); 246 246 247 int confirmRemovingOfLastDVDDevice() const; 248 247 249 void cannotCreateHardDiskStorage (QWidget *aParent, const CVirtualBox &aVBox, 248 250 const QString &aLocaiton, -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsHD.h
r24419 r25091 582 582 QString generateUniqueName (const QString &aTemplate) const; 583 583 584 uint32_t deviceCount (KDeviceType aType) const; 585 584 586 CMachine mMachine; 585 587 QIWidgetValidator *mValidator; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r24775 r25091 1144 1144 } 1145 1145 1146 int VBoxProblemReporter::confirmRemovingOfLastDVDDevice() const 1147 { 1148 return messageOkCancel (QApplication::activeWindow(), Info, 1149 tr ("<p>Are you sure you want to delete the CDROM device? " 1150 "You will not be able to mount any CDs or ISO images " 1151 "without it.</p>"), 1152 0, /* aAutoConfirmId */ 1153 tr ("&Remove", "medium")); 1154 } 1155 1146 1156 void VBoxProblemReporter::cannotCreateHardDiskStorage ( 1147 1157 QWidget *aParent, const CVirtualBox &aVBox, const QString &aLocation, -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp
r24811 r25091 1984 1984 { 1985 1985 QModelIndex index = mTwStorageTree->currentIndex(); 1986 1987 KDeviceType device = mStorageModel->data (index, StorageModel::R_AttDevice).value <KDeviceType>(); 1988 /* Check if this would be the last DVD. If so let the user confirm this again. */ 1989 if ( device == KDeviceType_DVD 1990 && deviceCount (KDeviceType_DVD) == 1) 1991 { 1992 if (vboxProblem().confirmRemovingOfLastDVDDevice() != QIMessageBox::Ok) 1993 return; 1994 } 1995 1986 1996 QModelIndex parent = index.parent(); 1987 1997 if (!index.isValid() || !parent.isValid() || … … 2540 2550 } 2541 2551 2552 uint32_t VBoxVMSettingsHD::deviceCount (KDeviceType aType) const 2553 { 2554 uint32_t cDevices = 0; 2555 QModelIndex rootIndex = mStorageModel->root(); 2556 for (int i = 0; i < mStorageModel->rowCount (rootIndex); ++ i) 2557 { 2558 QModelIndex ctrIndex = rootIndex.child (i, 0); 2559 for (int j = 0; j < mStorageModel->rowCount (ctrIndex); ++ j) 2560 { 2561 QModelIndex attIndex = ctrIndex.child (j, 0); 2562 KDeviceType attDevice = mStorageModel->data (attIndex, StorageModel::R_AttDevice).value <KDeviceType>(); 2563 if (attDevice == aType) 2564 ++cDevices; 2565 } 2566 } 2567 2568 return cDevices; 2569 } 2570
Note:
See TracChangeset
for help on using the changeset viewer.