Changeset 51213 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 8, 2014 12:56:38 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r51209 r51213 241 241 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 242 242 243 bool UIExtraDataManager::isDescriptionHiddenForWizard(const QString &strWizardName) 244 { 245 /* True if wizard-name among the others: */ 246 return extraDataStringList(GUI_HideDescriptionForWizards).contains(strWizardName); 247 } 248 249 void UIExtraDataManager::setDescriptionHiddenForWizard(const QString &strWizardName, bool fHidden) 250 { 251 /* Get current value: */ 252 QStringList oldValue = extraDataStringList(GUI_HideDescriptionForWizards); 253 QStringList newValue = oldValue; 254 /* Include wizard-name if necessary: */ 255 if (fHidden && !newValue.contains(strWizardName)) 256 newValue << strWizardName; 257 /* Exclude wizard-name if necessary: */ 258 else if (!fHidden && newValue.contains(strWizardName)) 259 newValue.removeAll(strWizardName); 260 /* Update extra-data if necessary: */ 261 if (newValue != oldValue) 262 setExtraDataStringList(GUI_HideDescriptionForWizards, newValue); 263 } 264 243 265 bool UIExtraDataManager::isFirstRun(const QString &strId) const 244 266 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r51209 r51213 114 114 bool shouldWeAllowApplicationUpdate() const; 115 115 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 116 117 /** Returns whether description should be hidden for wizard @a strWizardName. */ 118 bool isDescriptionHiddenForWizard(const QString &strWizardName); 119 /** Defines whether description should be @a fHidden for wizard @a strWizardName. */ 120 void setDescriptionHiddenForWizard(const QString &strWizardName, bool fHidden); 116 121 117 122 /** Returns whether this machine started for the first time. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.cpp
r45060 r51213 28 28 #include "VBoxGlobal.h" 29 29 #include "QIRichTextLabel.h" 30 #include "UIExtraDataManager.h" 30 31 31 32 void UIWizard::sltCurrentIdChanged(int iId) … … 51 52 cleanup(); 52 53 53 /* Compose wizard's name: */54 QString strWizardName = nameForType(m_type);55 /* Load mode settings: */56 QStringList wizards = vboxGlobal().virtualBox().GetExtraDataStringList(GUI_HideDescriptionForWizards);57 58 54 /* Switch mode: */ 59 55 switch (m_mode) 60 56 { 61 case UIWizardMode_Basic: 62 { 63 m_mode = UIWizardMode_Expert; 64 if (!wizards.contains(strWizardName)) 65 wizards << strWizardName; 66 break; 67 } 68 case UIWizardMode_Expert: 69 { 70 m_mode = UIWizardMode_Basic; 71 if (wizards.contains(strWizardName)) 72 wizards.removeAll(strWizardName); 73 break; 74 } 75 default: 76 { 77 AssertMsgFailed(("Invalid mode: %d", m_mode)); 78 break; 79 } 57 case UIWizardMode_Basic: m_mode = UIWizardMode_Expert; break; 58 case UIWizardMode_Expert: m_mode = UIWizardMode_Basic; break; 59 default: AssertMsgFailed(("Invalid mode: %d", m_mode)); break; 80 60 } 81 61 82 62 /* Save mode settings: */ 83 vboxGlobal().virtualBox().SetExtraDataStringList(GUI_HideDescriptionForWizards, wizards);63 gEDataManager->setDescriptionHiddenForWizard(nameForType(m_type), m_mode == UIWizardMode_Expert); 84 64 85 65 /* Prepare: */ … … 547 527 if (type == UIWizardType_FirstRun) 548 528 return UIWizardMode_Basic; 549 /* Get mode from extra-data: */ 550 QStringList wizards = vboxGlobal().virtualBox().GetExtraDataStringList(GUI_HideDescriptionForWizards); 551 if (wizards.contains(nameForType(type))) 552 return UIWizardMode_Expert; 553 /* Return mode: */ 554 return UIWizardMode_Basic; 555 } 556 529 /* Otherwise get mode from extra-data manager: */ 530 return gEDataManager->isDescriptionHiddenForWizard(nameForType(type)) 531 ? UIWizardMode_Expert : UIWizardMode_Basic; 532 } 533
Note:
See TracChangeset
for help on using the changeset viewer.