- Timestamp:
- Dec 3, 2012 2:31:54 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 82425
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.cpp
r43991 r44013 37 37 , m_iLastStep(-1) 38 38 { 39 /* Setup size-policy: */ 40 setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 41 42 /* Add item to the parent: */ 39 /* Add set to the parent group: */ 43 40 parentItem()->addItem(this); 44 41 42 /* Prepare set: */ 43 prepareSet(); 44 45 45 /* Prepare connections: */ 46 connect(this, SIGNAL(sigStartFirstStep(QString)), this, SLOT(sltFirstStep(QString)), Qt::QueuedConnection); 47 connect(this, SIGNAL(sigSetPrepared()), this, SLOT(sltSetPrepared()), Qt::QueuedConnection); 48 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltMachineStateChange(QString))); 49 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)), this, SLOT(sltMachineAttributesChange(QString))); 50 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)), this, SLOT(sltMachineAttributesChange(QString))); 51 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltMachineAttributesChange(QString))); 52 connect(&vboxGlobal(), SIGNAL(mediumEnumStarted()), this, SLOT(sltUpdateAppearance())); 53 connect(&vboxGlobal(), SIGNAL(mediumEnumFinished(const VBoxMediaList &)), this, SLOT(sltUpdateAppearance())); 46 prepareConnections(); 54 47 } 55 48 56 49 UIGDetailsSet::~UIGDetailsSet() 57 50 { 58 /* Delete all theitems: */51 /* Cleanup items: */ 59 52 clearItems(); 60 53 61 /* Remove item from the parent: */54 /* Remove set from the parent group: */ 62 55 parentItem()->removeItem(this); 63 56 } … … 66 59 { 67 60 /* Assign settings: */ 61 m_machine = pItem->machine(); 68 62 m_fFullSet = fFullSet; 69 m_machine = pItem->machine();70 63 m_settings = settings; 71 64 … … 74 67 } 75 68 76 const CMachine& UIGDetailsSet::machine() const77 {78 return m_machine;79 }80 81 69 void UIGDetailsSet::sltFirstStep(QString strSetId) 82 70 { 83 /* Clea rstep: */71 /* Cleanup step: */ 84 72 delete m_pStep; 85 73 m_pStep = 0; 86 74 87 /* Was that a requested set? */75 /* Is step id valid? */ 88 76 if (strSetId != m_strSetId) 89 77 return; … … 120 108 { 121 109 /* Is this our VM changed? */ 122 if (m achine().GetId() != strId)110 if (m_machine.GetId() != strId) 123 111 return; 124 112 … … 134 122 { 135 123 /* Is this our VM changed? */ 136 if (m achine().GetId() != strId)124 if (m_machine.GetId() != strId) 137 125 return; 138 126 … … 205 193 switch (type) 206 194 { 195 case UIGDetailsItemType_Element: return m_elements.values(); 207 196 case UIGDetailsItemType_Any: return items(UIGDetailsItemType_Element); 208 case UIGDetailsItemType_Element: return m_elements.values();209 197 default: AssertMsgFailed(("Invalid item type!")); break; 210 198 } … … 216 204 switch (type) 217 205 { 206 case UIGDetailsItemType_Element: return !m_elements.isEmpty(); 218 207 case UIGDetailsItemType_Any: return hasItems(UIGDetailsItemType_Element); 219 case UIGDetailsItemType_Element: return !m_elements.isEmpty();220 208 default: AssertMsgFailed(("Invalid item type!")); break; 221 209 } … … 227 215 switch (type) 228 216 { 229 case UIGDetailsItemType_Any:230 {231 clearItems(UIGDetailsItemType_Element);232 break;233 }234 217 case UIGDetailsItemType_Element: 235 218 { … … 237 220 delete m_elements[iKey]; 238 221 AssertMsg(m_elements.isEmpty(), ("Set items cleanup failed!")); 222 break; 223 } 224 case UIGDetailsItemType_Any: 225 { 226 clearItems(UIGDetailsItemType_Element); 239 227 break; 240 228 } … … 253 241 return pItem->toElement(); 254 242 return 0; 243 } 244 245 void UIGDetailsSet::prepareSet() 246 { 247 /* Setup size-policy: */ 248 setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 249 } 250 251 void UIGDetailsSet::prepareConnections() 252 { 253 /* Build connections: */ 254 connect(this, SIGNAL(sigStartFirstStep(QString)), this, SLOT(sltFirstStep(QString)), Qt::QueuedConnection); 255 connect(this, SIGNAL(sigSetPrepared()), this, SLOT(sltSetPrepared()), Qt::QueuedConnection); 256 257 /* Global-events connections: */ 258 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltMachineStateChange(QString))); 259 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)), this, SLOT(sltMachineAttributesChange(QString))); 260 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)), this, SLOT(sltMachineAttributesChange(QString))); 261 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltMachineAttributesChange(QString))); 262 263 /* Meidum-enumeration connections: */ 264 connect(&vboxGlobal(), SIGNAL(mediumEnumStarted()), this, SLOT(sltUpdateAppearance())); 265 connect(&vboxGlobal(), SIGNAL(mediumEnumFinished(const VBoxMediaList &)), this, SLOT(sltUpdateAppearance())); 255 266 } 256 267 … … 380 391 foreach (UIGDetailsItem *pItem, items()) 381 392 { 382 /* Get particular element: */ 393 /* Skip hidden: */ 394 if (!pItem->isVisible()) 395 continue; 396 397 /* For each particular element: */ 383 398 UIGDetailsElement *pElement = pItem->toElement(); 384 if (!pElement->isVisible())385 continue;386 387 /* For each particular element: */388 399 switch (pElement->elementType()) 389 400 { … … 467 478 } 468 479 469 /* Clea rstep: */480 /* Cleanup step: */ 470 481 delete m_pStep; 471 482 m_pStep = 0; 472 483 473 /* Prepare first element: */484 /* Generate new set-id: */ 474 485 m_strSetId = QUuid::createUuid().toString(); 486 487 /* Request to prepare first step: */ 475 488 emit sigStartFirstStep(m_strSetId); 476 489 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.h
r43989 r44013 58 58 59 59 /* API: Machine stuff: */ 60 const CMachine& machine() const ;60 const CMachine& machine() const { return m_machine; } 61 61 62 62 private slots: … … 87 87 QVariant data(int iKey) const; 88 88 89 /* Children stuff: */89 /* Hidden API: Children stuff: */ 90 90 void addItem(UIGDetailsItem *pItem); 91 91 void removeItem(UIGDetailsItem *pItem); … … 94 94 void clearItems(UIGDetailsItemType type = UIGDetailsItemType_Element); 95 95 UIGDetailsElement* element(DetailsElementType elementType) const; 96 97 /* Helpers: Prepare stuff: */ 98 void prepareSet(); 99 void prepareConnections(); 96 100 97 101 /* Helpers: Layout stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.