Changeset 45035 in vbox
- Timestamp:
- Mar 14, 2013 11:08:06 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84283
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
r42526 r45035 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"; 62 63 63 64 /* Mini tool-bar definitions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r42526 r45035 137 137 extern const char* GUI_SaveMountedAtRuntime; 138 138 extern const char* GUI_PassCAD; 139 extern const char* GUI_HideFromManager; 139 140 140 141 /* Mini tool-bar declarations: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r44051 r45035 597 597 void UIGChooserModel::sltMachineRegistered(QString strId, bool fRegistered) 598 598 { 599 /* New VMregistered? */599 /* New machine registered? */ 600 600 if (fRegistered) 601 601 { 602 602 /* Search for corresponding machine: */ 603 603 CMachine machine = vboxGlobal().virtualBox().FindMachine(strId); 604 /* Machine was found? */605 if ( !machine.isNull())604 /* Should we show this machine? */ 605 if (shouldWeShowMachine(machine)) 606 606 { 607 607 /* Add new machine-item: */ … … 615 615 } 616 616 } 617 /* Existing VMunregistered? */617 /* Existing machine unregistered? */ 618 618 else 619 619 { … … 884 884 /* Remove all the items first: */ 885 885 mainRoot()->removeAll(strId); 886 887 /* Check if such machine still present: */ 886 /* Update model: */ 887 cleanupGroupTree(); 888 889 /* Should we show this machine? */ 888 890 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: */ 896 cleanupGroupTree(); 891 if (shouldWeShowMachine(machine)) 892 addMachineIntoTheTree(machine); 893 894 /* Update model: */ 897 895 updateNavigation(); 898 896 updateLayout(); … … 1616 1614 void UIGChooserModel::loadGroupTree() 1617 1615 { 1618 /* Add all the machines we have into the group-tree: */1616 /* Add all the approved machines we have into the group-tree: */ 1619 1617 LogRel(("Loading VMs started...\n")); 1620 foreach (const CMachine &machine, vboxGlobal().virtualBox().GetMachines()) 1621 addMachineIntoTheTree(machine); 1618 foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines()) 1619 if (shouldWeShowMachine(machine)) 1620 addMachineIntoTheTree(machine); 1622 1621 LogRel(("Loading VMs finished.\n")); 1623 1622 } … … 1835 1834 } 1836 1835 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) != 0 1846 && strMachineIgnored.compare("yes", Qt::CaseInsensitive) != 0 1847 && strMachineIgnored != "1"; 1848 } 1849 1837 1850 void UIGChooserModel::saveGroupDefinitions() 1838 1851 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r44051 r45035 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); 268 269 269 270 /* Helpers: Saving stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.