- Timestamp:
- May 8, 2014 1:23:04 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93613
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r51187 r51214 76 76 template<> bool canConvert<GlobalSettingsPageType>(); 77 77 template<> bool canConvert<MachineSettingsPageType>(); 78 template<> bool canConvert<WizardType>(); 78 79 template<> bool canConvert<IndicatorType>(); 79 80 template<> bool canConvert<MachineCloseAction>(); … … 139 140 template<> MachineSettingsPageType fromInternalString<MachineSettingsPageType>(const QString &strMachineSettingsPageType); 140 141 template<> QPixmap toWarningPixmap(const MachineSettingsPageType &machineSettingsPageType); 142 template<> QString toInternalString(const WizardType &wizardType); 143 template<> WizardType fromInternalString<WizardType>(const QString &strWizardType); 141 144 template<> QString toInternalString(const IndicatorType &indicatorType); 142 145 template<> IndicatorType fromInternalString<IndicatorType>(const QString &strIndicatorType); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r51149 r51214 48 48 template<> bool canConvert<GlobalSettingsPageType>() { return true; } 49 49 template<> bool canConvert<MachineSettingsPageType>() { return true; } 50 template<> bool canConvert<WizardType>() { return true; } 50 51 template<> bool canConvert<IndicatorType>() { return true; } 51 52 template<> bool canConvert<MachineCloseAction>() { return true; } … … 963 964 } 964 965 966 /* QString <= WizardType: */ 967 template<> QString toInternalString(const WizardType &wizardType) 968 { 969 QString strResult; 970 switch (wizardType) 971 { 972 case WizardType_NewVM: strResult = "NewVM"; break; 973 case WizardType_CloneVM: strResult = "CloneVM"; break; 974 case WizardType_ExportAppliance: strResult = "ExportAppliance"; break; 975 case WizardType_ImportAppliance: strResult = "ImportAppliance"; break; 976 case WizardType_FirstRun: strResult = "FirstRun"; break; 977 case WizardType_NewVD: strResult = "NewVD"; break; 978 case WizardType_CloneVD: strResult = "CloneVD"; break; 979 default: 980 { 981 AssertMsgFailed(("No text for wizard type=%d", wizardType)); 982 break; 983 } 984 } 985 return strResult; 986 } 987 988 /* WizardType <= QString: */ 989 template<> WizardType fromInternalString<WizardType>(const QString &strWizardType) 990 { 991 /* Here we have some fancy stuff allowing us 992 * to search through the keys using 'case-insensitive' rule: */ 993 QStringList keys; QList<WizardType> values; 994 keys << "NewVM"; values << WizardType_NewVM; 995 keys << "CloneVM"; values << WizardType_CloneVM; 996 keys << "ExportAppliance"; values << WizardType_ExportAppliance; 997 keys << "ImportAppliance"; values << WizardType_ImportAppliance; 998 keys << "FirstRun"; values << WizardType_FirstRun; 999 keys << "NewVD"; values << WizardType_NewVD; 1000 keys << "CloneVD"; values << WizardType_CloneVD; 1001 /* Invalid type for unknown words: */ 1002 if (!keys.contains(strWizardType, Qt::CaseInsensitive)) 1003 return WizardType_Invalid; 1004 /* Corresponding type for known words: */ 1005 return values.at(keys.indexOf(QRegExp(strWizardType, Qt::CaseInsensitive))); 1006 } 1007 965 1008 /* QString <= IndicatorType: */ 966 1009 template<> QString toInternalString(const IndicatorType &indicatorType) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r51189 r51214 190 190 Q_DECLARE_METATYPE(MachineSettingsPageType); 191 191 192 /** Common UI: Wizard types. */ 193 enum WizardType 194 { 195 WizardType_Invalid, 196 WizardType_NewVM, 197 WizardType_CloneVM, 198 WizardType_ExportAppliance, 199 WizardType_ImportAppliance, 200 WizardType_FirstRun, 201 WizardType_NewVD, 202 WizardType_CloneVD 203 }; 204 192 205 193 206 /** Selector UI: Details-element types. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.cpp
r51213 r51214 29 29 #include "QIRichTextLabel.h" 30 30 #include "UIExtraDataManager.h" 31 #include "UIConverter.h" 31 32 32 33 void UIWizard::sltCurrentIdChanged(int iId) … … 38 39 fIsHideShowDescriptionButtonAvailable = true; 39 40 /* But first-run wizard has no such button anyway: */ 40 if (m_type == UIWizardType_FirstRun)41 if (m_type == WizardType_FirstRun) 41 42 fIsHideShowDescriptionButtonAvailable = false; 42 43 /* Set a flag for hide/show description button finally: */ … … 61 62 62 63 /* Save mode settings: */ 63 gEDataManager->setDescriptionHiddenForWizard( nameForType(m_type), m_mode == UIWizardMode_Expert);64 gEDataManager->setDescriptionHiddenForWizard(gpConverter->toInternalString(m_type), m_mode == UIWizardMode_Expert); 64 65 65 66 /* Prepare: */ … … 68 69 } 69 70 70 UIWizard::UIWizard(QWidget *pParent, UIWizardType type, UIWizardMode mode)71 UIWizard::UIWizard(QWidget *pParent, WizardType type, UIWizardMode mode) 71 72 : QIWithRetranslateUI<QWizard>(pParent) 72 73 , m_type(type) 73 , m_mode(mode == UIWizardMode_Auto ? loadModeForType(m_type) : mode)74 , m_mode(mode == UIWizardMode_Auto ? modeForType(m_type) : mode) 74 75 { 75 76 #ifdef Q_WS_WIN … … 382 383 switch (m_type) 383 384 { 384 case UIWizardType_CloneVM:385 case WizardType_CloneVM: 385 386 dRatio -= 0.4; 386 387 break; 387 case UIWizardType_NewVD:388 case UIWizardType_CloneVD:388 case WizardType_NewVD: 389 case WizardType_CloneVD: 389 390 dRatio += 0.1; 390 391 break; 391 case UIWizardType_ExportAppliance:392 case WizardType_ExportAppliance: 392 393 dRatio += 0.3; 393 394 break; 394 case UIWizardType_FirstRun:395 case WizardType_FirstRun: 395 396 dRatio += 0.3; 396 397 break; … … 505 506 506 507 /* static */ 507 QString UIWizard::nameForType(UIWizardType type) 508 { 509 QString strName; 510 switch (type) 511 { 512 case UIWizardType_NewVM: strName = "NewVM"; break; 513 case UIWizardType_CloneVM: strName = "CloneVM"; break; 514 case UIWizardType_ExportAppliance: strName = "ExportAppliance"; break; 515 case UIWizardType_ImportAppliance: strName = "ImportAppliance"; break; 516 case UIWizardType_FirstRun: strName = "FirstRun"; break; 517 case UIWizardType_NewVD: strName = "NewVD"; break; 518 case UIWizardType_CloneVD: strName = "CloneVD"; break; 519 } 520 return strName; 521 } 522 523 /* static */ 524 UIWizardMode UIWizard::loadModeForType(UIWizardType type) 508 UIWizardMode UIWizard::modeForType(WizardType type) 525 509 { 526 510 /* Some wizard use only basic mode: */ 527 if (type == UIWizardType_FirstRun)511 if (type == WizardType_FirstRun) 528 512 return UIWizardMode_Basic; 529 513 /* Otherwise get mode from extra-data manager: */ 530 return gEDataManager->isDescriptionHiddenForWizard( nameForType(type))514 return gEDataManager->isDescriptionHiddenForWizard(gpConverter->toInternalString(type)) 531 515 ? UIWizardMode_Expert : UIWizardMode_Basic; 532 516 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.h
r43424 r51214 26 26 /* Local includes: */ 27 27 #include "QIWithRetranslateUI.h" 28 #include "UIExtraDataDefs.h" 28 29 29 30 /* Forward declarations: */ 30 31 class UIWizardPage; 31 32 /* Wizard type: */33 enum UIWizardType34 {35 UIWizardType_NewVM,36 UIWizardType_CloneVM,37 UIWizardType_ExportAppliance,38 UIWizardType_ImportAppliance,39 UIWizardType_FirstRun,40 UIWizardType_NewVD,41 UIWizardType_CloneVD42 };43 32 44 33 /* Wizard mode: */ … … 73 62 74 63 /* Constructor: */ 75 UIWizard(QWidget *pParent, UIWizardType type, UIWizardMode mode = UIWizardMode_Auto);64 UIWizard(QWidget *pParent, WizardType type, UIWizardMode mode = UIWizardMode_Auto); 76 65 77 66 /* Translation stuff: */ … … 106 95 void assignWatermarkHelper(); 107 96 #endif /* !Q_WS_MAC */ 108 static QString nameForType(UIWizardType type); 109 static UIWizardMode loadModeForType(UIWizardType type); 97 static UIWizardMode modeForType(WizardType type); 110 98 111 99 /* Variables: */ 112 UIWizardType m_type;100 WizardType m_type; 113 101 UIWizardMode m_mode; 114 102 #ifndef Q_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVD.cpp
r47431 r51214 35 35 36 36 UIWizardCloneVD::UIWizardCloneVD(QWidget *pParent, const CMedium &sourceVirtualDisk) 37 : UIWizard(pParent, UIWizardType_CloneVD)37 : UIWizard(pParent, WizardType_CloneVD) 38 38 , m_sourceVirtualDisk(sourceVirtualDisk) 39 39 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp
r45328 r51214 31 31 32 32 UIWizardCloneVM::UIWizardCloneVM(QWidget *pParent, const CMachine &machine, CSnapshot snapshot /* = CSnapshot() */) 33 : UIWizard(pParent, UIWizardType_CloneVM)33 : UIWizard(pParent, WizardType_CloneVM) 34 34 , m_machine(machine) 35 35 , m_snapshot(snapshot) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r50882 r51214 37 37 38 38 UIWizardExportApp::UIWizardExportApp(QWidget *pParent, const QStringList &selectedVMNames) 39 : UIWizard(pParent, UIWizardType_ExportAppliance)39 : UIWizard(pParent, WizardType_ExportAppliance) 40 40 , m_selectedVMNames(selectedVMNames) 41 41 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRun.cpp
r48314 r51214 30 30 31 31 UIWizardFirstRun::UIWizardFirstRun(QWidget *pParent, const CMachine &machine) 32 : UIWizard(pParent, UIWizardType_FirstRun)32 : UIWizard(pParent, WizardType_FirstRun) 33 33 , m_machine(machine) 34 34 , m_fHardDiskWasSet(isBootHardDiskAttached(m_machine)) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.cpp
r47007 r51214 136 136 137 137 UIWizardImportApp::UIWizardImportApp(QWidget *pParent, const QString &strFileName) 138 : UIWizard(pParent, UIWizardType_ImportAppliance)138 : UIWizard(pParent, WizardType_ImportAppliance) 139 139 , m_strFileName(strFileName) 140 140 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r48314 r51214 38 38 qulonglong uDefaultSize, 39 39 UIWizardMode mode) 40 : UIWizard(pParent, UIWizardType_NewVD, mode)40 : UIWizard(pParent, WizardType_NewVD, mode) 41 41 , m_strDefaultName(strDefaultName) 42 42 , m_strDefaultPath(strDefaultPath) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r51209 r51214 36 36 37 37 UIWizardNewVM::UIWizardNewVM(QWidget *pParent, const QString &strGroup /* = QString() */) 38 : UIWizard(pParent, UIWizardType_NewVM)38 : UIWizard(pParent, WizardType_NewVM) 39 39 , m_strGroup(strGroup) 40 40 , m_iIDECount(0)
Note:
See TracChangeset
for help on using the changeset viewer.