Changeset 46684 in vbox
- Timestamp:
- Jun 19, 2013 5:38:27 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/converter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r42526 r46684 57 57 template<> bool canConvert<StorageSlot>(); 58 58 template<> bool canConvert<DetailsElementType>(); 59 template<> bool canConvert<IndicatorType>(); 59 60 60 61 /* Declare COM canConvert specializations: */ … … 87 88 template<> QString toInternalString(const DetailsElementType &detailsElementType); 88 89 template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType); 90 template<> QString toInternalString(const IndicatorType &indicatorType); 91 template<> IndicatorType fromInternalString<IndicatorType>(const QString &strIndicatorType); 89 92 90 93 /* Declare COM conversion specializations: */ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r42526 r46684 33 33 template<> bool canConvert<StorageSlot>() { return true; } 34 34 template<> bool canConvert<DetailsElementType>() { return true; } 35 template<> bool canConvert<IndicatorType>() { return true; } 35 36 36 37 /* QString <= StorageSlot: */ … … 370 371 } 371 372 373 /* QString <= IndicatorType: */ 374 template<> QString toInternalString(const IndicatorType &indicatorType) 375 { 376 QString strResult; 377 switch (indicatorType) 378 { 379 case IndicatorType_HardDisks: strResult = "HardDisks"; break; 380 case IndicatorType_OpticalDisks: strResult = "OpticalDisks"; break; 381 case IndicatorType_FloppyDisks: strResult = "FloppyDisks"; break; 382 case IndicatorType_Network: strResult = "Network"; break; 383 case IndicatorType_USB: strResult = "USB"; break; 384 case IndicatorType_SharedFolders: strResult = "SharedFolders"; break; 385 case IndicatorType_VideoCapture: strResult = "VideoCapture"; break; 386 case IndicatorType_Features: strResult = "Features"; break; 387 case IndicatorType_Mouse: strResult = "Mouse"; break; 388 case IndicatorType_Keyboard: strResult = "Keyboard"; break; 389 default: 390 { 391 AssertMsgFailed(("No text for indicator type=%d", indicatorType)); 392 break; 393 } 394 } 395 return strResult; 396 } 397 398 /* IndicatorType <= QString: */ 399 template<> IndicatorType fromInternalString<IndicatorType>(const QString &strIndicatorType) 400 { 401 QHash<QString, IndicatorType> list; 402 list.insert("HardDisks", IndicatorType_HardDisks); 403 list.insert("OpticalDisks", IndicatorType_OpticalDisks); 404 list.insert("FloppyDisks", IndicatorType_FloppyDisks); 405 list.insert("Network", IndicatorType_Network); 406 list.insert("USB", IndicatorType_USB); 407 list.insert("SharedFolders", IndicatorType_SharedFolders); 408 list.insert("VideoCapture", IndicatorType_VideoCapture); 409 list.insert("Features", IndicatorType_Features); 410 list.insert("Mouse", IndicatorType_Mouse); 411 list.insert("Keyboard", IndicatorType_Keyboard); 412 if (!list.contains(strIndicatorType)) 413 { 414 AssertMsgFailed(("No value for '%s'", strIndicatorType.toAscii().constData())); 415 } 416 return list.value(strIndicatorType); 417 } 418
Note:
See TracChangeset
for help on using the changeset viewer.