Changeset 43777 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 30, 2012 1:03:49 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 81712
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43776 r43777 40 40 41 41 UIGChooserItemGroup::UIGChooserItemGroup(QGraphicsScene *pScene) 42 : UIGChooserItem(0, false )42 : UIGChooserItem(0, false /* temporary? */) 43 43 , m_fClosed(false) 44 , m_pToggleButton(0)45 , m_pEnterButton(0)46 , m_pExitButton(0)47 , m_pNameEditorWidget(0)48 , m_pNameEditor(0)49 , m_iAdditionalHeight(0)50 , m_iCornerRadius(10)51 44 , m_fMainRoot(true) 52 , m_iBlackoutDarkness(110)53 45 { 54 46 /* Prepare: */ … … 66 58 UIGChooserItemGroup *pCopyFrom, 67 59 bool fMainRoot) 68 : UIGChooserItem(0, true )60 : UIGChooserItem(0, true /* temporary? */) 69 61 , m_strName(pCopyFrom->name()) 70 62 , m_fClosed(pCopyFrom->closed()) 71 , m_pToggleButton(0)72 , m_pEnterButton(0)73 , m_pExitButton(0)74 , m_pNameEditorWidget(0)75 , m_pNameEditor(0)76 , m_iAdditionalHeight(0)77 , m_iCornerRadius(10)78 63 , m_fMainRoot(fMainRoot) 79 , m_iBlackoutDarkness(110)80 64 { 81 65 /* Prepare: */ … … 100 84 , m_strName(strName) 101 85 , m_fClosed(!fOpened) 102 , m_pToggleButton(0)103 , m_pEnterButton(0)104 , m_pExitButton(0)105 , m_pNameEditorWidget(0)106 , m_pNameEditor(0)107 , m_iAdditionalHeight(0)108 , m_iCornerRadius(10)109 86 , m_fMainRoot(false) 110 , m_iBlackoutDarkness(110)111 87 { 112 88 /* Prepare: */ … … 130 106 , m_strName(pCopyFrom->name()) 131 107 , m_fClosed(pCopyFrom->closed()) 132 , m_pToggleButton(0)133 , m_pEnterButton(0)134 , m_pExitButton(0)135 , m_pNameEditorWidget(0)136 , m_pNameEditor(0)137 , m_iAdditionalHeight(0)138 , m_iCornerRadius(10)139 108 , m_fMainRoot(false) 140 , m_iBlackoutDarkness(110)141 109 { 142 110 /* Prepare: */ … … 168 136 model()->setFocusItem(0); 169 137 } 170 /* If that item is selected: */138 /* If that item is in selection list: */ 171 139 if (model()->currentItems().contains(this)) 172 140 { … … 174 142 model()->removeFromCurrentItems(this); 175 143 } 176 /* Remove item from the navigation list: */ 177 model()->removeFromNavigationList(this); 144 /* If that item is in navigation list: */ 145 if (model()->navigationList().contains(this)) 146 { 147 /* Remove item from the navigation list: */ 148 model()->removeFromNavigationList(this); 149 } 178 150 179 151 /* Remove item from the parent: */ … … 232 204 } 233 205 234 bool UIGChooserItemGroup::contains(const QString &strId , bool fRecursively /* = false */) const206 bool UIGChooserItemGroup::contains(const QString &strId) const 235 207 { 236 208 /* Check machine items: */ … … 238 210 if (pItem->toMachineItem()->id() == strId) 239 211 return true; 240 /* If recursively => check group items: */241 if (fRecursively)242 foreach (UIGChooserItem *pItem, m_groupItems)243 if (pItem->toGroupItem()->contains(strId, fRecursively))244 return true;245 212 return false; 246 213 } … … 520 487 void UIGChooserItemGroup::prepare() 521 488 { 489 /* Buttons: */ 490 m_pToggleButton = 0; 491 m_pEnterButton = 0; 492 m_pExitButton = 0; 493 /* Name editor: */ 494 m_pNameEditorWidget = 0; 495 m_pNameEditor = 0; 496 /* Painting stuff: */ 497 m_iAdditionalHeight = 0; 498 m_iCornerRadius = 10; 499 m_iBlackoutDarkness = 110; 500 522 501 /* Non root item only: */ 523 502 if (!isRoot()) -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
r43776 r43777 56 56 int type() const { return Type; } 57 57 58 /* Constructor /destructor: */58 /* Constructor (main-root-item): */ 59 59 UIGChooserItemGroup(QGraphicsScene *pScene); 60 UIGChooserItemGroup(QGraphicsScene *pScene, UIGChooserItemGroup *pCopyFrom, 61 bool fMainRoot); 62 UIGChooserItemGroup(UIGChooserItem *pParent, const QString &strName, 63 bool fOpened = false, int iPosition = -1); 64 UIGChooserItemGroup(UIGChooserItem *pParent, UIGChooserItemGroup *pCopyFrom, 65 int iPosition = -1); 60 /* Constructor (temporary main-root-item/root-item copy): */ 61 UIGChooserItemGroup(QGraphicsScene *pScene, UIGChooserItemGroup *pCopyFrom, bool fMainRoot); 62 /* Constructor (new non-root-item): */ 63 UIGChooserItemGroup(UIGChooserItem *pParent, const QString &strName, bool fOpened = false, int iPosition = -1); 64 /* Constructor (new non-root-item copy): */ 65 UIGChooserItemGroup(UIGChooserItem *pParent, UIGChooserItemGroup *pCopyFrom, int iPosition = -1); 66 /* Destructor: */ 66 67 ~UIGChooserItemGroup(); 67 68 … … 77 78 78 79 /* API: Children stuff: */ 79 bool contains(const QString &strId , bool fRecursively = false) const;80 bool contains(const QString &strId) const; 80 81 bool isContainsLockedMachine(); 81 82
Note:
See TracChangeset
for help on using the changeset viewer.