Changeset 88585 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 19, 2021 4:35:03 PM (4 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
r88411 r88585 2788 2788 } 2789 2789 2790 void UIExtraDataManager::clearSelectorWindowGroupsDefinitions() 2791 { 2792 /* Wipe-out each the group definition record: */ 2790 QStringList UIExtraDataManager::knownMachineGroupDefinitionKeys() 2791 { 2792 /* Acquire a list of known group definition keys: */ 2793 QStringList result; 2793 2794 foreach (const QString &strKey, m_data.value(GlobalID).keys()) 2794 2795 if (strKey.startsWith(GUI_GroupDefinitions)) 2795 setExtraDataString(strKey, QString()); 2796 } 2797 2798 QStringList UIExtraDataManager::selectorWindowGroupsDefinitions(const QString &strGroupID) 2796 { 2797 QString strGroupID = strKey; 2798 strGroupID.remove(GUI_GroupDefinitions); 2799 result << strGroupID; 2800 } 2801 2802 /* Return result: */ 2803 return result; 2804 } 2805 2806 QStringList UIExtraDataManager::machineGroupDefinitions(const QString &strGroupID) 2799 2807 { 2800 2808 return extraDataStringList(GUI_GroupDefinitions + strGroupID); 2801 2809 } 2802 2810 2803 void UIExtraDataManager::set SelectorWindowGroupsDefinitions(const QString &strGroupID, const QStringList &definitions)2811 void UIExtraDataManager::setMachineGroupDefinitions(const QString &strGroupID, const QStringList &definitions) 2804 2812 { 2805 2813 setExtraDataStringList(GUI_GroupDefinitions + strGroupID, definitions); -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r88411 r88585 344 344 void setSelectorWindowStatusBarVisible(bool fVisible); 345 345 346 /** Clears all the existing selector-window chooser-pane' group definitions. */347 void clearSelectorWindowGroupsDefinitions();348 /** Returns selector-window chooser-pane' group sdefinitions for passed @a strGroupID. */349 QStringList selectorWindowGroupsDefinitions(const QString &strGroupID);350 /** Defines selector-window chooser-pane' group s@a definitions for passed @a strGroupID. */351 void set SelectorWindowGroupsDefinitions(const QString &strGroupID, const QStringList &definitions);346 /** Returns all the existing selector-window chooser-pane' group definition keys. */ 347 QStringList knownMachineGroupDefinitionKeys(); 348 /** Returns selector-window chooser-pane' group definitions for passed @a strGroupID. */ 349 QStringList machineGroupDefinitions(const QString &strGroupID); 350 /** Defines selector-window chooser-pane' group @a definitions for passed @a strGroupID. */ 351 void setMachineGroupDefinitions(const QString &strGroupID, const QStringList &definitions); 352 352 353 353 /** Returns last-item ID of the item chosen in selector-window chooser-pane. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r86910 r88585 334 334 COMBase::InitializeCOM(false); 335 335 336 /* Clear all the extra-data records related to group definitions: */337 gEDataManager->clearSelectorWindowGroupsDefinitions();338 /* For every particular group definition: */336 /* Acquire a list of known group definition keys: */ 337 QStringList knownKeys = gEDataManager->knownMachineGroupDefinitionKeys(); 338 /* For every group definition to be saved: */ 339 339 foreach (const QString &strId, m_lists.keys()) 340 gEDataManager->setSelectorWindowGroupsDefinitions(strId, m_lists.value(strId)); 340 { 341 /* Save definition only if there is a change: */ 342 if (gEDataManager->machineGroupDefinitions(strId) != m_lists.value(strId)) 343 gEDataManager->setMachineGroupDefinitions(strId, m_lists.value(strId)); 344 /* Remove it from known keys: */ 345 knownKeys.removeAll(strId); 346 } 347 /* Wipe out rest of known group definitions: */ 348 foreach (const QString strId, knownKeys) 349 gEDataManager->setMachineGroupDefinitions(strId, QStringList()); 341 350 342 351 /* Notify listeners about completeness: */ … … 1397 1406 { 1398 1407 /* Read group definitions: */ 1399 const QStringList definitions = gEDataManager-> selectorWindowGroupsDefinitions(pParentNode->fullName());1408 const QStringList definitions = gEDataManager->machineGroupDefinitions(pParentNode->fullName()); 1400 1409 /* Return 'false' if no definitions found: */ 1401 1410 if (definitions.isEmpty()) … … 1427 1436 { 1428 1437 /* Read group definitions: */ 1429 const QStringList definitions = gEDataManager-> selectorWindowGroupsDefinitions(pParentNode->fullName());1438 const QStringList definitions = gEDataManager->machineGroupDefinitions(pParentNode->fullName()); 1430 1439 /* Return 'false' if no definitions found: */ 1431 1440 if (definitions.isEmpty()) … … 1548 1557 { 1549 1558 /* Read group definitions: */ 1550 const QStringList definitions = gEDataManager-> selectorWindowGroupsDefinitions(pParentNode->fullName());1559 const QStringList definitions = gEDataManager->machineGroupDefinitions(pParentNode->fullName()); 1551 1560 /* Return 'false' if no definitions found: */ 1552 1561 if (definitions.isEmpty())
Note:
See TracChangeset
for help on using the changeset viewer.