Changeset 43620 in vbox
- Timestamp:
- Oct 11, 2012 2:27:12 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h
r43619 r43620 93 93 virtual void updateToolTip() = 0; 94 94 virtual QString name() const = 0; 95 virtual QString fullName() const = 0; 95 96 virtual QString definition() const = 0; 96 97 void setRoot(bool fRoot); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43619 r43620 185 185 { 186 186 return m_strName; 187 } 188 189 QString UIGChooserItemGroup::fullName() const 190 { 191 /* Return "/" for root-group: */ 192 if (!parentItem()) 193 return "/"; 194 /* Get full parent name, append with '/' if not yet appended: */ 195 QString strParentFullName = parentItem()->fullName(); 196 if (!strParentFullName.endsWith('/')) 197 strParentFullName.append('/'); 198 /* Return full item name based on parent prefix: */ 199 return strParentFullName + name(); 187 200 } 188 201 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
r43619 r43620 68 68 /* API: Basic stuff: */ 69 69 QString name() const; 70 QString fullName() const; 70 71 QString definition() const; 71 72 void setName(const QString &strName); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp
r43619 r43620 134 134 } 135 135 136 QString UIGChooserItemMachine::fullName() const 137 { 138 /* Get full parent name, append with '/' if not yet appended: */ 139 QString strParentFullName = parentItem()->fullName(); 140 if (!strParentFullName.endsWith('/')) 141 strParentFullName.append('/'); 142 /* Return full item name based on parent prefix: */ 143 return strParentFullName + name(); 144 } 145 136 146 QString UIGChooserItemMachine::definition() const 137 147 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h
r43619 r43620 58 58 /* API: Basic stuff: */ 59 59 QString name() const; 60 QString fullName() const; 60 61 QString definition() const; 61 62 bool isLockedMachine() const; -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r43619 r43620 821 821 QString strGroupName; 822 822 if (pGroup) 823 strGroupName = fullName(pGroup);823 strGroupName = pGroup->fullName(); 824 824 825 825 /* Start the new vm wizard: */ … … 1712 1712 { 1713 1713 /* Prepare extra-data key for the parent-item: */ 1714 QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);1714 QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + pParentItem->fullName(); 1715 1715 /* Read group definitions: */ 1716 1716 QStringList definitions = vboxGlobal().virtualBox().GetExtraDataStringList(strExtraDataKey); … … 1783 1783 { 1784 1784 /* Prepare extra-data key for the parent-item: */ 1785 QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);1785 QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + pParentItem->fullName(); 1786 1786 /* Read group definitions: */ 1787 1787 QStringList definitions = vboxGlobal().virtualBox().GetExtraDataStringList(strExtraDataKey); … … 1881 1881 if (UIGChooserItemMachine *pMachineItem = pItem->toMachineItem()) 1882 1882 if (pMachineItem->accessible()) 1883 groups[pMachineItem->id()] << fullName(pParentGroup);1883 groups[pMachineItem->id()] << pParentGroup->fullName(); 1884 1884 /* Iterate over all the group-items: */ 1885 1885 foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Group)) … … 1891 1891 { 1892 1892 /* Prepare extra-data key for current group: */ 1893 QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);1893 QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + pParentItem->fullName(); 1894 1894 /* Iterate over all the group-items: */ 1895 1895 foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Group)) … … 1903 1903 groups[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id()); 1904 1904 } 1905 1906 QString UIGChooserModel::fullName(UIGChooserItem *pItem)1907 {1908 /* Return '/' for root-group: */1909 if (!pItem->parentItem())1910 return QString("/");1911 /* Get full parent name, append with '/' if not yet appended: */1912 QString strParentFullName = fullName(pItem->parentItem());1913 if (!strParentFullName.endsWith("/"))1914 strParentFullName += QString("/");1915 /* Return full item name based on parent prefix: */1916 return strParentFullName + pItem->name();1917 }1918 1919 1905 1920 1906 void UIGChooserModel::makeSureGroupDefinitionsSaveIsFinished() -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r43619 r43620 271 271 void gatherGroupDefinitions(QMap<QString, QStringList> &groups, UIGChooserItem *pParentGroup); 272 272 void gatherGroupOrders(QMap<QString, QStringList> &groups, UIGChooserItem *pParentItem); 273 QString fullName(UIGChooserItem *pItem);274 273 void makeSureGroupDefinitionsSaveIsFinished(); 275 274 void makeSureGroupOrdersSaveIsFinished();
Note:
See TracChangeset
for help on using the changeset viewer.