VirtualBox

Changeset 43620 in vbox


Ignore:
Timestamp:
Oct 11, 2012 2:27:12 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM group feature UI: Moving some item naming stuff into corresponding place.

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  
    9393    virtual void updateToolTip() = 0;
    9494    virtual QString name() const = 0;
     95    virtual QString fullName() const = 0;
    9596    virtual QString definition() const = 0;
    9697    void setRoot(bool fRoot);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp

    r43619 r43620  
    185185{
    186186    return m_strName;
     187}
     188
     189QString 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();
    187200}
    188201
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h

    r43619 r43620  
    6868    /* API: Basic stuff: */
    6969    QString name() const;
     70    QString fullName() const;
    7071    QString definition() const;
    7172    void setName(const QString &strName);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r43619 r43620  
    134134}
    135135
     136QString 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
    136146QString UIGChooserItemMachine::definition() const
    137147{
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h

    r43619 r43620  
    5858    /* API: Basic stuff: */
    5959    QString name() const;
     60    QString fullName() const;
    6061    QString definition() const;
    6162    bool isLockedMachine() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r43619 r43620  
    821821    QString strGroupName;
    822822    if (pGroup)
    823         strGroupName = fullName(pGroup);
     823        strGroupName = pGroup->fullName();
    824824
    825825    /* Start the new vm wizard: */
     
    17121712{
    17131713    /* Prepare extra-data key for the parent-item: */
    1714     QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);
     1714    QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + pParentItem->fullName();
    17151715    /* Read group definitions: */
    17161716    QStringList definitions = vboxGlobal().virtualBox().GetExtraDataStringList(strExtraDataKey);
     
    17831783{
    17841784    /* Prepare extra-data key for the parent-item: */
    1785     QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);
     1785    QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + pParentItem->fullName();
    17861786    /* Read group definitions: */
    17871787    QStringList definitions = vboxGlobal().virtualBox().GetExtraDataStringList(strExtraDataKey);
     
    18811881        if (UIGChooserItemMachine *pMachineItem = pItem->toMachineItem())
    18821882            if (pMachineItem->accessible())
    1883                 groups[pMachineItem->id()] << fullName(pParentGroup);
     1883                groups[pMachineItem->id()] << pParentGroup->fullName();
    18841884    /* Iterate over all the group-items: */
    18851885    foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Group))
     
    18911891{
    18921892    /* Prepare extra-data key for current group: */
    1893     QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);
     1893    QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + pParentItem->fullName();
    18941894    /* Iterate over all the group-items: */
    18951895    foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Group))
     
    19031903        groups[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id());
    19041904}
    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 
    19191905
    19201906void UIGChooserModel::makeSureGroupDefinitionsSaveIsFinished()
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h

    r43619 r43620  
    271271    void gatherGroupDefinitions(QMap<QString, QStringList> &groups, UIGChooserItem *pParentGroup);
    272272    void gatherGroupOrders(QMap<QString, QStringList> &groups, UIGChooserItem *pParentItem);
    273     QString fullName(UIGChooserItem *pItem);
    274273    void makeSureGroupDefinitionsSaveIsFinished();
    275274    void makeSureGroupOrdersSaveIsFinished();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette