Changeset 58726 in vbox
- Timestamp:
- Nov 17, 2015 4:37:24 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104158
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformation.cpp
r58616 r58726 25 25 26 26 /* GUI includes: */ 27 # include "UIExtraDataManager.h" 27 28 # include "UIGInformation.h" 28 29 # include "UIGInformationModel.h" … … 81 82 /* Setup details-model: */ 82 83 m_pDetailsModel = new UIGInformationModel(this); 84 m_pDetailsModel->setInformationWindowElements(gEDataManager->informationWindowElements()); 83 85 } 84 86 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationElement.cpp
r58616 r58726 42 42 43 43 44 UIGInformationElement::UIGInformationElement(UIGInformationSet *pParent, DetailsElementType type, bool fOpened)44 UIGInformationElement::UIGInformationElement(UIGInformationSet *pParent, InformationElementType type, bool fOpened) 45 45 : UIGInformationItem(pParent) 46 46 , m_pSet(pParent) … … 438 438 m_pHighlightMachine->start(); 439 439 440 connect(this, SIGNAL(sigToggleElement( DetailsElementType, bool)), model(), SLOT(sltToggleElements(DetailsElementType, bool)));440 connect(this, SIGNAL(sigToggleElement(InformationElementType, bool)), model(), SLOT(sltToggleElements(InformationElementType, bool))); 441 441 connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)), 442 442 model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&))); … … 458 458 /* Create text-pane: */ 459 459 m_pTextPane = new UIGraphicsTextPane(this, model()->paintDevice()); 460 /* Make sure item text is selectable: */ 461 m_pTextPane->setFlag(QGraphicsItem::ItemIsSelectable); 460 462 connect(m_pTextPane, SIGNAL(sigGeometryChanged()), this, SLOT(sltUpdateGeometry())); 461 463 connect(m_pTextPane, SIGNAL(sigAnchorClicked(const QString&)), this, SLOT(sltHandleAnchorClicked(const QString&))); … … 621 623 pEvent->accept(); 622 624 QString strCategory; 623 if (m_type >= DetailsElementType_General &&624 m_type < DetailsElementType_Description)625 if (m_type >= InformationElementType_General && 626 m_type < InformationElementType_Description) 625 627 strCategory = QString("#%1").arg(gpConverter->toInternalString(m_type)); 626 else if (m_type == DetailsElementType_Description)628 else if (m_type == InformationElementType_Description) 627 629 strCategory = QString("#%1%%mTeDescription").arg(gpConverter->toInternalString(m_type)); 630 else if (m_type >= InformationElementType_RuntimeAttributes && 631 m_type < InformationElementType_NetworkStatistics) 632 strCategory = QString("#%1").arg(gpConverter->toInternalString(m_type)); 628 633 emit sigLinkClicked(strCategory, QString(), machine().GetId()); 629 634 } … … 650 655 { 651 656 /* Not for 'preview' element type: */ 652 if (m_type == DetailsElementType_Preview)657 if (m_type == InformationElementType_Preview) 653 658 return; 654 659 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationElement.h
r58616 r58726 54 54 55 55 /* Notifiers: Toggle stuff: */ 56 void sigToggleElement( DetailsElementType type, bool fToggled);56 void sigToggleElement(InformationElementType type, bool fToggled); 57 57 void sigToggleElementFinished(); 58 58 … … 67 67 68 68 /* Constructor/destructor: */ 69 UIGInformationElement(UIGInformationSet *pParent, DetailsElementType type, bool fOpened);69 UIGInformationElement(UIGInformationSet *pParent, InformationElementType type, bool fOpened); 70 70 ~UIGInformationElement(); 71 71 72 72 /* API: Element type: */ 73 DetailsElementType elementType() const { return m_type; }73 InformationElementType elementType() const { return m_type; } 74 74 75 75 /* API: Open/close stuff: */ … … 189 189 /* Variables: */ 190 190 UIGInformationSet *m_pSet; 191 DetailsElementType m_type;191 InformationElementType m_type; 192 192 QPixmap m_pixmap; 193 193 QString m_strName; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationElements.cpp
r58616 r58726 63 63 } 64 64 65 UIGInformationElementInterface::UIGInformationElementInterface(UIGInformationSet *pParent, DetailsElementType type, bool fOpened)65 UIGInformationElementInterface::UIGInformationElementInterface(UIGInformationSet *pParent, InformationElementType type, bool fOpened) 66 66 : UIGInformationElement(pParent, type, fOpened) 67 67 , m_pTask(0) … … 123 123 124 124 UIGInformationElementPreview::UIGInformationElementPreview(UIGInformationSet *pParent, bool fOpened) 125 : UIGInformationElement(pParent, DetailsElementType_Preview, fOpened)125 : UIGInformationElement(pParent, InformationElementType_Preview, fOpened) 126 126 { 127 127 /* Assign corresponding icon: */ … … 958 958 } 959 959 960 void UIGInformationUpdateTaskRuntimeAttributes::run() 961 { 962 963 } 964 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationElements.h
r58616 r58726 50 50 * @param type brings the details-element type this element belongs to. 51 51 * @param fOpened brings whether the details-element should be visually opened. */ 52 UIGInformationElementInterface(UIGInformationSet *pParent, DetailsElementType type, bool fOpened);52 UIGInformationElementInterface(UIGInformationSet *pParent, InformationElementType type, bool fOpened); 53 53 54 54 protected: … … 140 140 * @param fOpened brings whether the details-element should be visually opened. */ 141 141 UIGInformationElementGeneral(UIGInformationSet *pParent, bool fOpened) 142 : UIGInformationElementInterface(pParent, DetailsElementType_General, fOpened) {}142 : UIGInformationElementInterface(pParent, InformationElementType_General, fOpened) {} 143 143 144 144 private: … … 176 176 * @param fOpened brings whether the details-element should be visually opened. */ 177 177 UIGInformationElementSystem(UIGInformationSet *pParent, bool fOpened) 178 : UIGInformationElementInterface(pParent, DetailsElementType_System, fOpened) {}178 : UIGInformationElementInterface(pParent, InformationElementType_System, fOpened) {} 179 179 180 180 private: … … 212 212 * @param fOpened brings whether the details-element should be visually opened. */ 213 213 UIGInformationElementDisplay(UIGInformationSet *pParent, bool fOpened) 214 : UIGInformationElementInterface(pParent, DetailsElementType_Display, fOpened) {}214 : UIGInformationElementInterface(pParent, InformationElementType_Display, fOpened) {} 215 215 216 216 private: … … 248 248 * @param fOpened brings whether the details-element should be visually opened. */ 249 249 UIGInformationElementStorage(UIGInformationSet *pParent, bool fOpened) 250 : UIGInformationElementInterface(pParent, DetailsElementType_Storage, fOpened) {}250 : UIGInformationElementInterface(pParent, InformationElementType_Storage, fOpened) {} 251 251 252 252 private: … … 284 284 * @param fOpened brings whether the details-element should be visually opened. */ 285 285 UIGInformationElementAudio(UIGInformationSet *pParent, bool fOpened) 286 : UIGInformationElementInterface(pParent, DetailsElementType_Audio, fOpened) {}286 : UIGInformationElementInterface(pParent, InformationElementType_Audio, fOpened) {} 287 287 288 288 private: … … 323 323 * @param fOpened brings whether the details-element should be visually opened. */ 324 324 UIGInformationElementNetwork(UIGInformationSet *pParent, bool fOpened) 325 : UIGInformationElementInterface(pParent, DetailsElementType_Network, fOpened) {}325 : UIGInformationElementInterface(pParent, InformationElementType_Network, fOpened) {} 326 326 327 327 private: … … 359 359 * @param fOpened brings whether the details-element should be visually opened. */ 360 360 UIGInformationElementSerial(UIGInformationSet *pParent, bool fOpened) 361 : UIGInformationElementInterface(pParent, DetailsElementType_Serial, fOpened) {}361 : UIGInformationElementInterface(pParent, InformationElementType_Serial, fOpened) {} 362 362 363 363 private: … … 396 396 * @param fOpened brings whether the details-element should be visually opened. */ 397 397 UIGInformationElementParallel(UIGInformationSet *pParent, bool fOpened) 398 : UIGInformationElementInterface(pParent, DetailsElementType_Parallel, fOpened) {}398 : UIGInformationElementInterface(pParent, InformationElementType_Parallel, fOpened) {} 399 399 400 400 private: … … 433 433 * @param fOpened brings whether the details-element should be visually opened. */ 434 434 UIGInformationElementUSB(UIGInformationSet *pParent, bool fOpened) 435 : UIGInformationElementInterface(pParent, DetailsElementType_USB, fOpened) {}435 : UIGInformationElementInterface(pParent, InformationElementType_USB, fOpened) {} 436 436 437 437 private: … … 469 469 * @param fOpened brings whether the details-element should be visually opened. */ 470 470 UIGInformationElementSF(UIGInformationSet *pParent, bool fOpened) 471 : UIGInformationElementInterface(pParent, DetailsElementType_SF, fOpened) {}471 : UIGInformationElementInterface(pParent, InformationElementType_SF, fOpened) {} 472 472 473 473 private: … … 505 505 * @param fOpened brings whether the details-element should be visually opened. */ 506 506 UIGInformationElementUI(UIGInformationSet *pParent, bool fOpened) 507 : UIGInformationElementInterface(pParent, DetailsElementType_UI, fOpened) {}507 : UIGInformationElementInterface(pParent, InformationElementType_UI, fOpened) {} 508 508 509 509 private: … … 541 541 * @param fOpened brings whether the details-element should be visually opened. */ 542 542 UIGInformationElementDescription(UIGInformationSet *pParent, bool fOpened) 543 : UIGInformationElementInterface(pParent, DetailsElementType_Description, fOpened) {}543 : UIGInformationElementInterface(pParent, InformationElementType_Description, fOpened) {} 544 544 545 545 private: … … 549 549 }; 550 550 551 /** UITask extension used as update task for the details-element type 'Description'. */ 552 class UIGInformationUpdateTaskRuntimeAttributes : public UIGInformationUpdateTask 553 { 554 Q_OBJECT; 555 556 public: 557 558 /** Constructs update task passing @a machine to the base-class. */ 559 UIGInformationUpdateTaskRuntimeAttributes(const CMachine &machine) 560 : UIGInformationUpdateTask(machine) {} 561 562 private: 563 564 /** Contains update task body. */ 565 void run(); 566 }; 567 568 /** UIGInformationElementInterface extension for the details-element type 'Description'. */ 569 class UIGInformationElementRuntimeAttributes : public UIGInformationElementInterface 570 { 571 Q_OBJECT; 572 573 public: 574 575 /** Constructs details-element object for passed @a pParent set. 576 * @param fOpened brings whether the details-element should be visually opened. */ 577 UIGInformationElementRuntimeAttributes(UIGInformationSet *pParent, bool fOpened) 578 : UIGInformationElementInterface(pParent, InformationElementType_RuntimeAttributes, fOpened) {} 579 580 private: 581 582 /** Creates update task for this element. */ 583 UITask* createUpdateTask() { return new UIGInformationUpdateTaskRuntimeAttributes(machine()); } 584 }; 585 551 586 #endif /* !___UIGInformationElements_h___ */ 552 587 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationGroup.cpp
r58616 r58726 113 113 114 114 /* Build set: */ 115 pSet->buildSet(m_machineItems[iStepNumber], m_machineItems.size() == 1, model()-> settings());115 pSet->buildSet(m_machineItems[iStepNumber], m_machineItems.size() == 1, model()->informationWindowElements()); 116 116 } 117 117 else -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationModel.cpp
r58616 r58726 52 52 53 53 /* Register meta-type: */ 54 qRegisterMetaType< DetailsElementType>();54 qRegisterMetaType<InformationElementType>(); 55 55 } 56 56 … … 105 105 } 106 106 107 QMap<InformationElementType, bool> UIGInformationModel::informationWindowElements() 108 { 109 return m_settings; 110 } 111 112 void UIGInformationModel::setInformationWindowElements(const QMap<InformationElementType, bool> &elements) 113 { 114 //m_settings = elements; 115 } 116 107 117 void UIGInformationModel::sltHandleViewResize() 108 118 { … … 111 121 } 112 122 113 void UIGInformationModel::sltToggleElements( DetailsElementType type, bool fToggled)123 void UIGInformationModel::sltToggleElements(InformationElementType type, bool fToggled) 114 124 { 115 125 /* Make sure it is not started yet: */ … … 119 129 /* Prepare/configure animation callback: */ 120 130 m_pAnimationCallback = new UIGInformationElementAnimationCallback(this, type, fToggled); 121 connect(m_pAnimationCallback, SIGNAL(sigAllAnimationFinished( DetailsElementType, bool)),122 this, SLOT(sltToggleAnimationFinished( DetailsElementType, bool)), Qt::QueuedConnection);131 connect(m_pAnimationCallback, SIGNAL(sigAllAnimationFinished(InformationElementType, bool)), 132 this, SLOT(sltToggleAnimationFinished(InformationElementType, bool)), Qt::QueuedConnection); 123 133 /* For each the set of the group: */ 124 134 foreach (UIGInformationItem *pSetItem, m_pRoot->items()) … … 149 159 } 150 160 151 void UIGInformationModel::sltToggleAnimationFinished( DetailsElementType type, bool fToggled)161 void UIGInformationModel::sltToggleAnimationFinished(InformationElementType type, bool fToggled) 152 162 { 153 163 /* Cleanup animation callback: */ … … 177 187 /* Which item was toggled? */ 178 188 QAction *pAction = qobject_cast<QAction*>(sender()); 179 DetailsElementType type = pAction->data().value<DetailsElementType>();189 InformationElementType type = pAction->data().value<InformationElementType>(); 180 190 181 191 /* Toggle element visibility status: */ … … 227 237 void UIGInformationModel::loadSettings() 228 238 { 229 /* Load settings: */230 m_settings = gEDataManager->selectorWindowDetailsElements();231 239 /* If settings are empty: */ 232 if (m_settings.isEmpty())240 //if (m_settings.isEmpty()) 233 241 { 234 242 /* Propose the defaults: */ 235 m_settings[ DetailsElementType_General] = true;236 m_settings[ DetailsElementType_Preview] = true;237 m_settings[ DetailsElementType_System] = true;238 m_settings[ DetailsElementType_Display] = true;239 m_settings[ DetailsElementType_Storage] = true;240 m_settings[ DetailsElementType_Audio] = true;241 m_settings[ DetailsElementType_Network] = true;242 m_settings[ DetailsElementType_USB] = true;243 m_settings[ DetailsElementType_SF] = true;244 m_settings[ DetailsElementType_Description] = true;243 m_settings[InformationElementType_General] = true; 244 m_settings[InformationElementType_System] = true; 245 m_settings[InformationElementType_Display] = true; 246 m_settings[InformationElementType_Storage] = true; 247 m_settings[InformationElementType_Audio] = true; 248 m_settings[InformationElementType_Network] = true; 249 m_settings[InformationElementType_USB] = true; 250 m_settings[InformationElementType_SF] = true; 251 m_settings[InformationElementType_Description] = true; 252 m_settings[InformationElementType_RuntimeAttributes] = true; 245 253 } 246 254 } … … 249 257 { 250 258 /* Save settings: */ 251 gEDataManager->setSelectorWindowDetailsElements(m_settings);259 //gEDataManager->setInformationWindowElements(m_settings); 252 260 } 253 261 … … 288 296 QMenu contextMenu; 289 297 /* Enumerate elements settings: */ 290 for (int iType = DetailsElementType_General; iType <= DetailsElementType_Description; ++iType)291 { 292 DetailsElementType currentElementType = (DetailsElementType)iType;298 for (int iType = InformationElementType_General; iType <= InformationElementType_RuntimeAttributes; ++iType) 299 { 300 InformationElementType currentElementType = (InformationElementType)iType; 293 301 QAction *pAction = contextMenu.addAction(gpConverter->toString(currentElementType), this, SLOT(sltElementTypeToggled())); 294 302 pAction->setCheckable(true); … … 303 311 } 304 312 305 UIGInformationElementAnimationCallback::UIGInformationElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled)313 UIGInformationElementAnimationCallback::UIGInformationElementAnimationCallback(QObject *pParent, InformationElementType type, bool fToggled) 306 314 : QObject(pParent) 307 315 , m_type(type) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationModel.h
r58616 r58726 72 72 void setItems(const QList<UIVMItem*> &items); 73 73 74 /** Returns the details settings. */ 75 const QMap<DetailsElementType, bool>& settings() const { return m_settings; } 74 /** Returns information-window elements. */ 75 QMap<InformationElementType, bool> informationWindowElements(); 76 /** Defines information-window @a elements. */ 77 void setInformationWindowElements(const QMap<InformationElementType, bool> &elements); 76 78 77 79 private slots: … … 81 83 82 84 /* Handlers: Element-items stuff: */ 83 void sltToggleElements( DetailsElementType type, bool fToggled);84 void sltToggleAnimationFinished( DetailsElementType type, bool fToggled);85 void sltToggleElements(InformationElementType type, bool fToggled); 86 void sltToggleAnimationFinished(InformationElementType type, bool fToggled); 85 87 void sltElementTypeToggled(); 86 88 … … 123 125 UIGInformationElementAnimationCallback *m_pAnimationCallback; 124 126 /** Holds the details settings. */ 125 QMap< DetailsElementType, bool> m_settings;127 QMap<InformationElementType, bool> m_settings; 126 128 }; 127 129 … … 134 136 135 137 /* Notifier: Complete stuff: */ 136 void sigAllAnimationFinished( DetailsElementType type, bool fToggled);138 void sigAllAnimationFinished(InformationElementType type, bool fToggled); 137 139 138 140 public: 139 141 140 142 /* Constructor: */ 141 UIGInformationElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled);143 UIGInformationElementAnimationCallback(QObject *pParent, InformationElementType type, bool fToggled); 142 144 143 145 /* API: Notifiers stuff: */ … … 153 155 /* Variables: */ 154 156 QList<UIGInformationItem*> m_notifiers; 155 DetailsElementType m_type;157 InformationElementType m_type; 156 158 bool m_fToggled; 157 159 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationSet.cpp
r58616 r58726 63 63 } 64 64 65 void UIGInformationSet::buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap< DetailsElementType, bool> &settings)65 void UIGInformationSet::buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap<InformationElementType, bool> &settings) 66 66 { 67 67 /* Remember passed arguments: */ … … 75 75 if (!m_fFullSet || !m_fHasDetails) 76 76 { 77 int iFirstItem = m_fHasDetails ? DetailsElementType_Display : DetailsElementType_General;78 int iLastItem = DetailsElementType_Description;77 int iFirstItem = m_fHasDetails ? InformationElementType_Display : InformationElementType_General; 78 int iLastItem = InformationElementType_RuntimeAttributes; 79 79 bool fCleanupPerformed = false; 80 80 for (int i = iFirstItem; i <= iLastItem; ++i) … … 99 99 100 100 /* Choose last-step number: */ 101 m_iLastStepNumber = m_fFullSet ? DetailsElementType_Description : DetailsElementType_Preview;101 m_iLastStepNumber = m_fFullSet ? InformationElementType_Description : InformationElementType_Preview; 102 102 103 103 /* Fetch USB controller restrictions: */ 104 104 const CUSBDeviceFilters &filters = m_machine.GetUSBDeviceFilters(); 105 105 if (filters.isNull() || !m_machine.GetUSBProxyAvailable()) 106 m_settings.remove( DetailsElementType_USB);106 m_settings.remove(InformationElementType_USB); 107 107 108 108 /* Start building set: */ … … 124 124 { 125 125 /* Load details settings: */ 126 DetailsElementType elementType = (DetailsElementType)iStepNumber;126 InformationElementType elementType = (InformationElementType)iStepNumber; 127 127 /* Should the element be visible? */ 128 128 bool fVisible = m_settings.contains(elementType); … … 242 242 { 243 243 UIGInformationElement *pElement = pItem->toElement(); 244 DetailsElementType type = pElement->elementType();244 InformationElementType type = pElement->elementType(); 245 245 AssertMsg(!m_elements.contains(type), ("Element already added!")); 246 246 m_elements.insert(type, pItem); … … 262 262 { 263 263 UIGInformationElement *pElement = pItem->toElement(); 264 DetailsElementType type = pElement->elementType();264 InformationElementType type = pElement->elementType(); 265 265 AssertMsg(m_elements.contains(type), ("Element do not present (type = %d)!", (int)type)); 266 266 m_elements.remove(type); … … 321 321 } 322 322 323 UIGInformationElement* UIGInformationSet::element( DetailsElementType elementType) const323 UIGInformationElement* UIGInformationSet::element(InformationElementType elementType) const 324 324 { 325 325 UIGInformationItem *pItem = m_elements.value(elementType, 0); … … 373 373 switch (pElement->elementType()) 374 374 { 375 case DetailsElementType_General:376 case DetailsElementType_System:377 case DetailsElementType_Display:378 case DetailsElementType_Storage:379 case DetailsElementType_Audio:380 case DetailsElementType_Network:381 case DetailsElementType_Serial:375 case InformationElementType_General: 376 case InformationElementType_System: 377 case InformationElementType_Display: 378 case InformationElementType_Storage: 379 case InformationElementType_Audio: 380 case InformationElementType_Network: 381 case InformationElementType_Serial: 382 382 #ifdef VBOX_WITH_PARALLEL_PORTS 383 case DetailsElementType_Parallel:383 case InformationElementType_Parallel: 384 384 #endif /* VBOX_WITH_PARALLEL_PORTS */ 385 case DetailsElementType_USB: 386 case DetailsElementType_SF: 387 case DetailsElementType_UI: 388 case DetailsElementType_Description: 385 case InformationElementType_USB: 386 case InformationElementType_SF: 387 case InformationElementType_UI: 388 case InformationElementType_Description: 389 case InformationElementType_RuntimeAttributes: 389 390 { 390 391 iMinimumWidthHint = qMax(iMinimumWidthHint, pItem->minimumWidthHint()); 391 392 break; 392 393 } 393 case DetailsElementType_Preview:394 case InformationElementType_Preview: 394 395 { 395 UIGInformationItem *pGeneralItem = element( DetailsElementType_General);396 UIGInformationItem *pSystemItem = element( DetailsElementType_System);396 UIGInformationItem *pGeneralItem = element(InformationElementType_General); 397 UIGInformationItem *pSystemItem = element(InformationElementType_System); 397 398 int iGeneralElementWidth = pGeneralItem ? pGeneralItem->minimumWidthHint() : 0; 398 399 int iSystemElementWidth = pSystemItem ? pSystemItem->minimumWidthHint() : 0; … … 433 434 switch (pElement->elementType()) 434 435 { 435 case DetailsElementType_General:436 case DetailsElementType_System:437 case DetailsElementType_Display:438 case DetailsElementType_Storage:439 case DetailsElementType_Audio:440 case DetailsElementType_Network:441 case DetailsElementType_Serial:436 case InformationElementType_General: 437 case InformationElementType_System: 438 case InformationElementType_Display: 439 case InformationElementType_Storage: 440 case InformationElementType_Audio: 441 case InformationElementType_Network: 442 case InformationElementType_Serial: 442 443 #ifdef VBOX_WITH_PARALLEL_PORTS 443 case DetailsElementType_Parallel:444 case InformationElementType_Parallel: 444 445 #endif /* VBOX_WITH_PARALLEL_PORTS */ 445 case DetailsElementType_USB: 446 case DetailsElementType_SF: 447 case DetailsElementType_UI: 448 case DetailsElementType_Description: 446 case InformationElementType_USB: 447 case InformationElementType_SF: 448 case InformationElementType_UI: 449 case InformationElementType_Description: 450 case InformationElementType_RuntimeAttributes: 449 451 { 450 452 iMinimumHeightHint += (pItem->minimumHeightHint() + iSpacing); 451 453 break; 452 454 } 453 case DetailsElementType_Preview:455 case InformationElementType_Preview: 454 456 { 455 457 iMinimumHeightHint = qMax(iMinimumHeightHint, pItem->minimumHeightHint() + iSpacing); … … 488 490 switch (pElement->elementType()) 489 491 { 490 case DetailsElementType_General:491 case DetailsElementType_System:492 case DetailsElementType_Display:493 case DetailsElementType_Storage:494 case DetailsElementType_Audio:495 case DetailsElementType_Network:496 case DetailsElementType_Serial:492 case InformationElementType_General: 493 case InformationElementType_System: 494 case InformationElementType_Display: 495 case InformationElementType_Storage: 496 case InformationElementType_Audio: 497 case InformationElementType_Network: 498 case InformationElementType_Serial: 497 499 #ifdef VBOX_WITH_PARALLEL_PORTS 498 case DetailsElementType_Parallel:500 case InformationElementType_Parallel: 499 501 #endif /* VBOX_WITH_PARALLEL_PORTS */ 500 case DetailsElementType_USB: 501 case DetailsElementType_SF: 502 case DetailsElementType_UI: 503 case DetailsElementType_Description: 502 case InformationElementType_USB: 503 case InformationElementType_SF: 504 case InformationElementType_UI: 505 case InformationElementType_Description: 506 case InformationElementType_RuntimeAttributes: 504 507 { 505 508 /* Move element: */ … … 507 510 /* Calculate required width: */ 508 511 int iWidth = iMaximumWidth - 2 * iMargin; 509 if (pElement->elementType() == DetailsElementType_General ||510 pElement->elementType() == DetailsElementType_System)511 if (UIGInformationElement *pPreviewElement = element( DetailsElementType_Preview))512 if (pElement->elementType() == InformationElementType_General || 513 pElement->elementType() == InformationElementType_System) 514 if (UIGInformationElement *pPreviewElement = element(InformationElementType_Preview)) 512 515 if (pPreviewElement->isVisible()) 513 516 iWidth -= (iSpacing + pPreviewElement->minimumWidthHint()); … … 532 535 break; 533 536 } 534 case DetailsElementType_Preview:537 case InformationElementType_Preview: 535 538 { 536 539 /* Prepare variables: */ … … 568 571 569 572 /* Request to build first step: */ 570 emit sigBuildStep(m_strSetId, DetailsElementType_General);571 } 572 573 UIGInformationElement* UIGInformationSet::createElement( DetailsElementType elementType, bool fOpen)573 emit sigBuildStep(m_strSetId, InformationElementType_General); 574 } 575 576 UIGInformationElement* UIGInformationSet::createElement(InformationElementType elementType, bool fOpen) 574 577 { 575 578 /* Element factory: */ 576 579 switch (elementType) 577 580 { 578 case DetailsElementType_General: return new UIGInformationElementGeneral(this, fOpen);579 case DetailsElementType_System: return new UIGInformationElementSystem(this, fOpen);580 case DetailsElementType_Preview: return new UIGInformationElementPreview(this, fOpen);581 case DetailsElementType_Display: return new UIGInformationElementDisplay(this, fOpen);582 case DetailsElementType_Storage: return new UIGInformationElementStorage(this, fOpen);583 case DetailsElementType_Audio: return new UIGInformationElementAudio(this, fOpen);584 case DetailsElementType_Network: return new UIGInformationElementNetwork(this, fOpen);585 case DetailsElementType_Serial: return new UIGInformationElementSerial(this, fOpen);581 case InformationElementType_General: return new UIGInformationElementGeneral(this, fOpen); 582 case InformationElementType_System: return new UIGInformationElementSystem(this, fOpen); 583 case InformationElementType_Preview: return new UIGInformationElementPreview(this, fOpen); 584 case InformationElementType_Display: return new UIGInformationElementDisplay(this, fOpen); 585 case InformationElementType_Storage: return new UIGInformationElementStorage(this, fOpen); 586 case InformationElementType_Audio: return new UIGInformationElementAudio(this, fOpen); 587 case InformationElementType_Network: return new UIGInformationElementNetwork(this, fOpen); 588 case InformationElementType_Serial: return new UIGInformationElementSerial(this, fOpen); 586 589 #ifdef VBOX_WITH_PARALLEL_PORTS 587 case DetailsElementType_Parallel: return new UIGInformationElementParallel(this, fOpen);590 case InformationElementType_Parallel: return new UIGInformationElementParallel(this, fOpen); 588 591 #endif /* VBOX_WITH_PARALLEL_PORTS */ 589 case DetailsElementType_USB: return new UIGInformationElementUSB(this, fOpen); 590 case DetailsElementType_SF: return new UIGInformationElementSF(this, fOpen); 591 case DetailsElementType_UI: return new UIGInformationElementUI(this, fOpen); 592 case DetailsElementType_Description: return new UIGInformationElementDescription(this, fOpen); 592 case InformationElementType_USB: return new UIGInformationElementUSB(this, fOpen); 593 case InformationElementType_SF: return new UIGInformationElementSF(this, fOpen); 594 case InformationElementType_UI: return new UIGInformationElementUI(this, fOpen); 595 case InformationElementType_Description: return new UIGInformationElementDescription(this, fOpen); 596 case InformationElementType_RuntimeAttributes: return new UIGInformationElementRuntimeAttributes(this, fOpen); 593 597 } 594 598 return 0; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationSet.h
r58616 r58726 51 51 52 52 /* API: Build stuff: */ 53 void buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap< DetailsElementType, bool> &settings);53 void buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap<InformationElementType, bool> &settings); 54 54 55 55 /* API: Machine stuff: */ … … 91 91 bool hasItems(UIGInformationItemType type = UIGInformationItemType_Element) const; 92 92 void clearItems(UIGInformationItemType type = UIGInformationItemType_Element); 93 UIGInformationElement* element( DetailsElementType elementType) const;93 UIGInformationElement* element(InformationElementType elementType) const; 94 94 95 95 /* Helpers: Prepare stuff: */ … … 104 104 /* Helpers: Build stuff: */ 105 105 void rebuildSet(); 106 UIGInformationElement* createElement( DetailsElementType elementType, bool fOpen);106 UIGInformationElement* createElement(InformationElementType elementType, bool fOpen); 107 107 108 108 /** Machine-item this set built for. */ … … 122 122 int m_iLastStepNumber; 123 123 QString m_strSetId; 124 QMap< DetailsElementType, bool> m_settings;124 QMap<InformationElementType, bool> m_settings; 125 125 }; 126 126 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGRuntimeInformation.cpp
r58690 r58726 81 81 /* Setup details-model: */ 82 82 m_pDetailsModel = new UIGInformationModel(this); 83 QMap<InformationElementType, bool> settings; 84 settings.insert(InformationElementType_RuntimeAttributes, true); 85 m_pDetailsModel->setInformationWindowElements(settings); 83 86 } 84 87 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r58616 r58726 41 41 # include "UIMachine.h" 42 42 # include "UIVMItem.h" 43 # include "UIGRuntimeInformation.h" 43 44 44 45 /* COM includes: */ … … 269 270 270 271 /* Statistics page update: */ 271 refreshStatistics();272 //refreshStatistics(); 272 273 } 273 274 … … 331 332 332 333 /* Update VM statistics page: */ 333 refreshStatistics();334 //refreshStatistics(); 334 335 } 335 336 … … 406 407 void UIVMInformationDialog::prepareTabWidget() 407 408 { 409 /* List of VM items: */ 410 QList<UIVMItem*> items; 411 items << new UIVMItem(gpMachine->uisession()->machine()); 412 408 413 /* Create tab-widget: */ 409 414 m_pTabWidget = new QITabWidget; 410 415 AssertPtrReturnVoid(m_pTabWidget); 411 416 { 412 /* Create tabs: */ 413 /* Create Configuration details tab: */ 414 415 UIGInformation *pInformationWidget = new UIGInformation(this); 416 QList<UIVMItem*> items; 417 items << new UIVMItem(gpMachine->uisession()->machine()); 418 pInformationWidget->setItems(items); 419 m_tabs.insert(0, pInformationWidget); 420 421 m_pTabWidget->addTab(m_tabs.value(0), QString()); 422 423 for (int iTabIndex = 1; iTabIndex < 2; ++iTabIndex) 424 prepareTab(iTabIndex); 425 /* Configure tab-widget: */ 417 /* Prepare tab-widget: */ 426 418 m_pTabWidget->setTabIcon(0, UIIconPool::iconSet(":/session_info_details_16px.png")); 427 419 m_pTabWidget->setTabIcon(1, UIIconPool::iconSet(":/session_info_runtime_16px.png")); … … 429 421 /* Add tab-widget into main-layout: */ 430 422 centralWidget()->layout()->addWidget(m_pTabWidget); 431 } 432 } 433 434 void UIVMInformationDialog::prepareTab(int iTabIndex) 435 { 436 /* Create tab: */ 437 m_tabs.insert(iTabIndex, new QWidget); 438 AssertPtrReturnVoid(m_tabs.value(iTabIndex)); 439 { 440 /* Create tab-layout: */ 441 QVBoxLayout *pLayout = new QVBoxLayout(m_tabs.value(iTabIndex)); 442 { 443 /* Configure tab-layout: */ 444 pLayout->setContentsMargins(0, 0, 0, 0); 445 /* Create browser: */ 446 m_browsers.insert(iTabIndex, new QRichTextEdit); 447 AssertPtrReturnVoid(m_browsers.value(iTabIndex)); 448 { 449 /* Configure browser: */ 450 m_browsers[iTabIndex]->setReadOnly(true); 451 m_browsers[iTabIndex]->setFrameShadow(QFrame::Plain); 452 m_browsers[iTabIndex]->setFrameShape(QFrame::NoFrame); 453 m_browsers[iTabIndex]->setViewportMargins(5, 5, 5, 5); 454 m_browsers[iTabIndex]->viewport()->setAutoFillBackground(false); 455 m_tabs[iTabIndex]->setFocusProxy(m_browsers.value(iTabIndex)); 456 /* Add browser into tab-layout: */ 457 pLayout->addWidget(m_browsers.value(iTabIndex)); 458 } 459 } 460 /* Add tab into tab-widget: */ 461 m_pTabWidget->addTab(m_tabs.value(iTabIndex), QString()); 423 424 /* Create tabs: */ 425 /* Create Configuration details tab: */ 426 UIGInformation *pInformationWidget = new UIGInformation(this); 427 AssertPtrReturnVoid(pInformationWidget); 428 { 429 pInformationWidget->setItems(items); 430 m_tabs.insert(0, pInformationWidget); 431 m_pTabWidget->addTab(m_tabs.value(0), QString()); 432 } 433 434 /* Create Runtime information tab: */ 435 UIGRuntimeInformation *pRuntimeInformationWidget = new UIGRuntimeInformation(this); 436 AssertPtrReturnVoid(pRuntimeInformationWidget); 437 { 438 pRuntimeInformationWidget->setItems(items); 439 m_tabs.insert(1, pRuntimeInformationWidget); 440 m_pTabWidget->addTab(m_tabs.value(1), QString()); 441 } 462 442 } 463 443 }
Note:
See TracChangeset
for help on using the changeset viewer.