Changeset 34947 in vbox
- Timestamp:
- Dec 10, 2010 1:14:00 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r34822 r34947 2392 2392 2393 2393 mMediaEnumThread->start(); 2394 } 2395 2396 VBoxDefs::MediumType VBoxGlobal::mediumTypeToLocal(KDeviceType globalType) 2397 { 2398 switch (globalType) 2399 { 2400 case KDeviceType_HardDisk: 2401 return VBoxDefs::MediumType_HardDisk; 2402 case KDeviceType_DVD: 2403 return VBoxDefs::MediumType_DVD; 2404 case KDeviceType_Floppy: 2405 return VBoxDefs::MediumType_Floppy; 2406 default: 2407 break; 2408 } 2409 return VBoxDefs::MediumType_Invalid; 2410 } 2411 2412 KDeviceType VBoxGlobal::mediumTypeToGlobal(VBoxDefs::MediumType localType) 2413 { 2414 switch (localType) 2415 { 2416 case VBoxDefs::MediumType_HardDisk: 2417 return KDeviceType_HardDisk; 2418 case VBoxDefs::MediumType_DVD: 2419 return KDeviceType_DVD; 2420 case VBoxDefs::MediumType_Floppy: 2421 return KDeviceType_Floppy; 2422 default: 2423 break; 2424 } 2425 return KDeviceType_Null; 2394 2426 } 2395 2427 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r34822 r34947 574 574 bool isMediaEnumerationStarted() const { return mMediaEnumThread != NULL; } 575 575 576 VBoxDefs::MediumType mediumTypeToLocal(KDeviceType globalType); 577 KDeviceType mediumTypeToGlobal(VBoxDefs::MediumType localType); 578 576 579 void addMedium (const VBoxMedium &); 577 580 void updateMedium (const VBoxMedium &); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r34936 r34947 1088 1088 QMenu *pFloppyDevicesMenu = actionsPool()->action(UIActionIndex_Menu_FloppyDevices)->menu(); 1089 1089 1090 /* Determine device type: */ 1091 KDeviceType deviceType = pMenu == pOpticalDevicesMenu ? KDeviceType_DVD : 1092 pMenu == pFloppyDevicesMenu ? KDeviceType_Floppy : 1093 KDeviceType_Null; 1094 AssertMsg(deviceType != KDeviceType_Null, ("Incorrect storage device type!\n")); 1095 1096 /* Determine medium type: */ 1090 /* Determine medium & device types: */ 1097 1091 VBoxDefs::MediumType mediumType = pMenu == pOpticalDevicesMenu ? VBoxDefs::MediumType_DVD : 1098 1092 pMenu == pFloppyDevicesMenu ? VBoxDefs::MediumType_Floppy : 1099 1093 VBoxDefs::MediumType_Invalid; 1094 KDeviceType deviceType = vboxGlobal().mediumTypeToGlobal(mediumType); 1100 1095 AssertMsg(mediumType != VBoxDefs::MediumType_Invalid, ("Incorrect storage medium type!\n")); 1096 AssertMsg(deviceType != KDeviceType_Null, ("Incorrect storage device type!\n")); 1101 1097 1102 1098 /* Fill attachments menu: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r34946 r34947 36 36 #include <QTimer> 37 37 #include <QCommonStyle> 38 39 /* Type converters */40 VBoxDefs::MediumType typeToLocal (KDeviceType aType)41 {42 VBoxDefs::MediumType result = VBoxDefs::MediumType_Invalid;43 switch (aType)44 {45 case KDeviceType_HardDisk:46 result = VBoxDefs::MediumType_HardDisk;47 break;48 case KDeviceType_DVD:49 result = VBoxDefs::MediumType_DVD;50 break;51 case KDeviceType_Floppy:52 result = VBoxDefs::MediumType_Floppy;53 break;54 default:55 AssertMsgFailed (("Incorrect medium type!\n"));56 break;57 }58 return result;59 }60 61 38 62 39 QString compressText (const QString &aText) … … 2321 2298 break; 2322 2299 } 2323 m_pMediumIdHolder->setType( typeToLocal(device));2300 m_pMediumIdHolder->setType(vboxGlobal().mediumTypeToLocal(device)); 2324 2301 m_pMediumIdHolder->setId(mStorageModel->data(index, StorageModel::R_AttMediumId).toString()); 2325 2302
Note:
See TracChangeset
for help on using the changeset viewer.