Changeset 45040 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 14, 2013 1:46:26 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84288
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
r45035 r45040 60 60 const char* UIDefs::GUI_SaveMountedAtRuntime = "GUI/SaveMountedAtRuntime"; 61 61 const char* UIDefs::GUI_PassCAD = "GUI/PassCAD"; 62 const char* UIDefs::GUI_HideFromManager = "GUI/HideFromManager";63 62 64 63 /* Mini tool-bar definitions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r45035 r45040 137 137 extern const char* GUI_SaveMountedAtRuntime; 138 138 extern const char* GUI_PassCAD; 139 extern const char* GUI_HideFromManager;140 139 141 140 /* Mini tool-bar declarations: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r45035 r45040 597 597 void UIGChooserModel::sltMachineRegistered(QString strId, bool fRegistered) 598 598 { 599 /* New machineregistered? */599 /* New VM registered? */ 600 600 if (fRegistered) 601 601 { 602 602 /* Search for corresponding machine: */ 603 603 CMachine machine = vboxGlobal().virtualBox().FindMachine(strId); 604 /* Should we show this machine? */605 if ( shouldWeShowMachine(machine))604 /* Machine was found? */ 605 if (!machine.isNull()) 606 606 { 607 607 /* Add new machine-item: */ … … 615 615 } 616 616 } 617 /* Existing machineunregistered? */617 /* Existing VM unregistered? */ 618 618 else 619 619 { … … 884 884 /* Remove all the items first: */ 885 885 mainRoot()->removeAll(strId); 886 /* Update model: */ 886 887 /* Check if such machine still present: */ 888 CMachine machine = vboxGlobal().virtualBox().FindMachine(strId); 889 if (machine.isNull()) 890 return; 891 892 /* Add machine into the tree: */ 893 addMachineIntoTheTree(machine); 894 895 /* And update model: */ 887 896 cleanupGroupTree(); 888 889 /* Should we show this machine? */890 CMachine machine = vboxGlobal().virtualBox().FindMachine(strId);891 if (shouldWeShowMachine(machine))892 addMachineIntoTheTree(machine);893 894 /* Update model: */895 897 updateNavigation(); 896 898 updateLayout(); … … 1614 1616 void UIGChooserModel::loadGroupTree() 1615 1617 { 1616 /* Add all the approvedmachines we have into the group-tree: */1618 /* Add all the machines we have into the group-tree: */ 1617 1619 LogRel(("Loading VMs started...\n")); 1618 foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines()) 1619 if (shouldWeShowMachine(machine)) 1620 addMachineIntoTheTree(machine); 1620 foreach (const CMachine &machine, vboxGlobal().virtualBox().GetMachines()) 1621 addMachineIntoTheTree(machine); 1621 1622 LogRel(("Loading VMs finished.\n")); 1622 1623 } … … 1834 1835 } 1835 1836 1836 /* static */1837 bool UIGChooserModel::shouldWeShowMachine(CMachine &machine)1838 {1839 /* False for null machines: */1840 if (machine.isNull())1841 return false;1842 1843 /* Check corresponding extra-data flag: */1844 QString strMachineIgnored(machine.GetExtraData(GUI_HideFromManager));1845 return strMachineIgnored.compare("true", Qt::CaseInsensitive) != 01846 && strMachineIgnored.compare("yes", Qt::CaseInsensitive) != 01847 && strMachineIgnored != "1";1848 }1849 1850 1837 void UIGChooserModel::saveGroupDefinitions() 1851 1838 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r45035 r45040 266 266 int positionFromDefinitions(UIGChooserItem *pParentItem, UIGChooserItemType type, const QString &strName); 267 267 void createMachineItem(const CMachine &machine, UIGChooserItem *pParentItem); 268 static bool shouldWeShowMachine(CMachine &machine);269 268 270 269 /* Helpers: Saving stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.