VirtualBox

Changeset 58726 in vbox


Ignore:
Timestamp:
Nov 17, 2015 4:37:24 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104158
Message:

FE/Qt: ​​bugref:8088: Rework session-information window: Using new enum InformationElementType and basic implementation of new UI.

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  
    2525
    2626/* GUI includes: */
     27# include "UIExtraDataManager.h"
    2728# include "UIGInformation.h"
    2829# include "UIGInformationModel.h"
     
    8182    /* Setup details-model: */
    8283    m_pDetailsModel = new UIGInformationModel(this);
     84    m_pDetailsModel->setInformationWindowElements(gEDataManager->informationWindowElements());
    8385}
    8486
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationElement.cpp

    r58616 r58726  
    4242
    4343
    44 UIGInformationElement::UIGInformationElement(UIGInformationSet *pParent, DetailsElementType type, bool fOpened)
     44UIGInformationElement::UIGInformationElement(UIGInformationSet *pParent, InformationElementType type, bool fOpened)
    4545    : UIGInformationItem(pParent)
    4646    , m_pSet(pParent)
     
    438438    m_pHighlightMachine->start();
    439439
    440     connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)), model(), SLOT(sltToggleElements(DetailsElementType, bool)));
     440    connect(this, SIGNAL(sigToggleElement(InformationElementType, bool)), model(), SLOT(sltToggleElements(InformationElementType, bool)));
    441441    connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)),
    442442            model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)));
     
    458458    /* Create text-pane: */
    459459    m_pTextPane = new UIGraphicsTextPane(this, model()->paintDevice());
     460    /* Make sure item text is selectable: */
     461    m_pTextPane->setFlag(QGraphicsItem::ItemIsSelectable);
    460462    connect(m_pTextPane, SIGNAL(sigGeometryChanged()), this, SLOT(sltUpdateGeometry()));
    461463    connect(m_pTextPane, SIGNAL(sigAnchorClicked(const QString&)), this, SLOT(sltHandleAnchorClicked(const QString&)));
     
    621623    pEvent->accept();
    622624    QString strCategory;
    623     if (m_type >= DetailsElementType_General &&
    624         m_type < DetailsElementType_Description)
     625    if (m_type >= InformationElementType_General &&
     626        m_type < InformationElementType_Description)
    625627        strCategory = QString("#%1").arg(gpConverter->toInternalString(m_type));
    626     else if (m_type == DetailsElementType_Description)
     628    else if (m_type == InformationElementType_Description)
    627629        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));
    628633    emit sigLinkClicked(strCategory, QString(), machine().GetId());
    629634}
     
    650655{
    651656    /* Not for 'preview' element type: */
    652     if (m_type == DetailsElementType_Preview)
     657    if (m_type == InformationElementType_Preview)
    653658        return;
    654659
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationElement.h

    r58616 r58726  
    5454
    5555    /* Notifiers: Toggle stuff: */
    56     void sigToggleElement(DetailsElementType type, bool fToggled);
     56    void sigToggleElement(InformationElementType type, bool fToggled);
    5757    void sigToggleElementFinished();
    5858
     
    6767
    6868    /* Constructor/destructor: */
    69     UIGInformationElement(UIGInformationSet *pParent, DetailsElementType type, bool fOpened);
     69    UIGInformationElement(UIGInformationSet *pParent, InformationElementType type, bool fOpened);
    7070    ~UIGInformationElement();
    7171
    7272    /* API: Element type: */
    73     DetailsElementType elementType() const { return m_type; }
     73    InformationElementType elementType() const { return m_type; }
    7474
    7575    /* API: Open/close stuff: */
     
    189189    /* Variables: */
    190190    UIGInformationSet *m_pSet;
    191     DetailsElementType m_type;
     191    InformationElementType m_type;
    192192    QPixmap m_pixmap;
    193193    QString m_strName;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationElements.cpp

    r58616 r58726  
    6363}
    6464
    65 UIGInformationElementInterface::UIGInformationElementInterface(UIGInformationSet *pParent, DetailsElementType type, bool fOpened)
     65UIGInformationElementInterface::UIGInformationElementInterface(UIGInformationSet *pParent, InformationElementType type, bool fOpened)
    6666    : UIGInformationElement(pParent, type, fOpened)
    6767    , m_pTask(0)
     
    123123
    124124UIGInformationElementPreview::UIGInformationElementPreview(UIGInformationSet *pParent, bool fOpened)
    125     : UIGInformationElement(pParent, DetailsElementType_Preview, fOpened)
     125    : UIGInformationElement(pParent, InformationElementType_Preview, fOpened)
    126126{
    127127    /* Assign corresponding icon: */
     
    958958}
    959959
     960void UIGInformationUpdateTaskRuntimeAttributes::run()
     961{
     962
     963}
     964
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationElements.h

    r58616 r58726  
    5050      * @param type    brings the details-element type this element belongs to.
    5151      * @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);
    5353
    5454protected:
     
    140140      * @param fOpened brings whether the details-element should be visually opened. */
    141141    UIGInformationElementGeneral(UIGInformationSet *pParent, bool fOpened)
    142         : UIGInformationElementInterface(pParent, DetailsElementType_General, fOpened) {}
     142        : UIGInformationElementInterface(pParent, InformationElementType_General, fOpened) {}
    143143
    144144private:
     
    176176      * @param fOpened brings whether the details-element should be visually opened. */
    177177    UIGInformationElementSystem(UIGInformationSet *pParent, bool fOpened)
    178         : UIGInformationElementInterface(pParent, DetailsElementType_System, fOpened) {}
     178        : UIGInformationElementInterface(pParent, InformationElementType_System, fOpened) {}
    179179
    180180private:
     
    212212      * @param fOpened brings whether the details-element should be visually opened. */
    213213    UIGInformationElementDisplay(UIGInformationSet *pParent, bool fOpened)
    214         : UIGInformationElementInterface(pParent, DetailsElementType_Display, fOpened) {}
     214        : UIGInformationElementInterface(pParent, InformationElementType_Display, fOpened) {}
    215215
    216216private:
     
    248248      * @param fOpened brings whether the details-element should be visually opened. */
    249249    UIGInformationElementStorage(UIGInformationSet *pParent, bool fOpened)
    250         : UIGInformationElementInterface(pParent, DetailsElementType_Storage, fOpened) {}
     250        : UIGInformationElementInterface(pParent, InformationElementType_Storage, fOpened) {}
    251251
    252252private:
     
    284284      * @param fOpened brings whether the details-element should be visually opened. */
    285285    UIGInformationElementAudio(UIGInformationSet *pParent, bool fOpened)
    286         : UIGInformationElementInterface(pParent, DetailsElementType_Audio, fOpened) {}
     286        : UIGInformationElementInterface(pParent, InformationElementType_Audio, fOpened) {}
    287287
    288288private:
     
    323323      * @param fOpened brings whether the details-element should be visually opened. */
    324324    UIGInformationElementNetwork(UIGInformationSet *pParent, bool fOpened)
    325         : UIGInformationElementInterface(pParent, DetailsElementType_Network, fOpened) {}
     325        : UIGInformationElementInterface(pParent, InformationElementType_Network, fOpened) {}
    326326
    327327private:
     
    359359      * @param fOpened brings whether the details-element should be visually opened. */
    360360    UIGInformationElementSerial(UIGInformationSet *pParent, bool fOpened)
    361         : UIGInformationElementInterface(pParent, DetailsElementType_Serial, fOpened) {}
     361        : UIGInformationElementInterface(pParent, InformationElementType_Serial, fOpened) {}
    362362
    363363private:
     
    396396      * @param fOpened brings whether the details-element should be visually opened. */
    397397    UIGInformationElementParallel(UIGInformationSet *pParent, bool fOpened)
    398         : UIGInformationElementInterface(pParent, DetailsElementType_Parallel, fOpened) {}
     398        : UIGInformationElementInterface(pParent, InformationElementType_Parallel, fOpened) {}
    399399
    400400private:
     
    433433      * @param fOpened brings whether the details-element should be visually opened. */
    434434    UIGInformationElementUSB(UIGInformationSet *pParent, bool fOpened)
    435         : UIGInformationElementInterface(pParent, DetailsElementType_USB, fOpened) {}
     435        : UIGInformationElementInterface(pParent, InformationElementType_USB, fOpened) {}
    436436
    437437private:
     
    469469      * @param fOpened brings whether the details-element should be visually opened. */
    470470    UIGInformationElementSF(UIGInformationSet *pParent, bool fOpened)
    471         : UIGInformationElementInterface(pParent, DetailsElementType_SF, fOpened) {}
     471        : UIGInformationElementInterface(pParent, InformationElementType_SF, fOpened) {}
    472472
    473473private:
     
    505505      * @param fOpened brings whether the details-element should be visually opened. */
    506506    UIGInformationElementUI(UIGInformationSet *pParent, bool fOpened)
    507         : UIGInformationElementInterface(pParent, DetailsElementType_UI, fOpened) {}
     507        : UIGInformationElementInterface(pParent, InformationElementType_UI, fOpened) {}
    508508
    509509private:
     
    541541      * @param fOpened brings whether the details-element should be visually opened. */
    542542    UIGInformationElementDescription(UIGInformationSet *pParent, bool fOpened)
    543         : UIGInformationElementInterface(pParent, DetailsElementType_Description, fOpened) {}
     543        : UIGInformationElementInterface(pParent, InformationElementType_Description, fOpened) {}
    544544
    545545private:
     
    549549};
    550550
     551/** UITask extension used as update task for the details-element type 'Description'. */
     552class UIGInformationUpdateTaskRuntimeAttributes : public UIGInformationUpdateTask
     553{
     554    Q_OBJECT;
     555
     556public:
     557
     558    /** Constructs update task passing @a machine to the base-class. */
     559    UIGInformationUpdateTaskRuntimeAttributes(const CMachine &machine)
     560        : UIGInformationUpdateTask(machine) {}
     561
     562private:
     563
     564    /** Contains update task body. */
     565    void run();
     566};
     567
     568/** UIGInformationElementInterface extension for the details-element type 'Description'. */
     569class UIGInformationElementRuntimeAttributes : public UIGInformationElementInterface
     570{
     571    Q_OBJECT;
     572
     573public:
     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
     580private:
     581
     582    /** Creates update task for this element. */
     583    UITask* createUpdateTask() { return new UIGInformationUpdateTaskRuntimeAttributes(machine()); }
     584};
     585
    551586#endif /* !___UIGInformationElements_h___ */
    552587
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationGroup.cpp

    r58616 r58726  
    113113
    114114        /* 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());
    116116    }
    117117    else
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationModel.cpp

    r58616 r58726  
    5252
    5353    /* Register meta-type: */
    54     qRegisterMetaType<DetailsElementType>();
     54    qRegisterMetaType<InformationElementType>();
    5555}
    5656
     
    105105}
    106106
     107QMap<InformationElementType, bool> UIGInformationModel::informationWindowElements()
     108{
     109    return m_settings;
     110}
     111
     112void UIGInformationModel::setInformationWindowElements(const QMap<InformationElementType, bool> &elements)
     113{
     114    //m_settings = elements;
     115}
     116
    107117void UIGInformationModel::sltHandleViewResize()
    108118{
     
    111121}
    112122
    113 void UIGInformationModel::sltToggleElements(DetailsElementType type, bool fToggled)
     123void UIGInformationModel::sltToggleElements(InformationElementType type, bool fToggled)
    114124{
    115125    /* Make sure it is not started yet: */
     
    119129    /* Prepare/configure animation callback: */
    120130    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);
    123133    /* For each the set of the group: */
    124134    foreach (UIGInformationItem *pSetItem, m_pRoot->items())
     
    149159}
    150160
    151 void UIGInformationModel::sltToggleAnimationFinished(DetailsElementType type, bool fToggled)
     161void UIGInformationModel::sltToggleAnimationFinished(InformationElementType type, bool fToggled)
    152162{
    153163    /* Cleanup animation callback: */
     
    177187    /* Which item was toggled? */
    178188    QAction *pAction = qobject_cast<QAction*>(sender());
    179     DetailsElementType type = pAction->data().value<DetailsElementType>();
     189    InformationElementType type = pAction->data().value<InformationElementType>();
    180190
    181191    /* Toggle element visibility status: */
     
    227237void UIGInformationModel::loadSettings()
    228238{
    229     /* Load settings: */
    230     m_settings = gEDataManager->selectorWindowDetailsElements();
    231239    /* If settings are empty: */
    232     if (m_settings.isEmpty())
     240    //if (m_settings.isEmpty())
    233241    {
    234242        /* 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;
    245253    }
    246254}
     
    249257{
    250258    /* Save settings: */
    251     gEDataManager->setSelectorWindowDetailsElements(m_settings);
     259    //gEDataManager->setInformationWindowElements(m_settings);
    252260}
    253261
     
    288296    QMenu contextMenu;
    289297    /* 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;
    293301        QAction *pAction = contextMenu.addAction(gpConverter->toString(currentElementType), this, SLOT(sltElementTypeToggled()));
    294302        pAction->setCheckable(true);
     
    303311}
    304312
    305 UIGInformationElementAnimationCallback::UIGInformationElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled)
     313UIGInformationElementAnimationCallback::UIGInformationElementAnimationCallback(QObject *pParent, InformationElementType type, bool fToggled)
    306314    : QObject(pParent)
    307315    , m_type(type)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationModel.h

    r58616 r58726  
    7272    void setItems(const QList<UIVMItem*> &items);
    7373
    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);
    7678
    7779private slots:
     
    8183
    8284    /* 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);
    8587    void sltElementTypeToggled();
    8688
     
    123125    UIGInformationElementAnimationCallback *m_pAnimationCallback;
    124126    /** Holds the details settings. */
    125     QMap<DetailsElementType, bool> m_settings;
     127    QMap<InformationElementType, bool> m_settings;
    126128};
    127129
     
    134136
    135137    /* Notifier: Complete stuff: */
    136     void sigAllAnimationFinished(DetailsElementType type, bool fToggled);
     138    void sigAllAnimationFinished(InformationElementType type, bool fToggled);
    137139
    138140public:
    139141
    140142    /* Constructor: */
    141     UIGInformationElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled);
     143    UIGInformationElementAnimationCallback(QObject *pParent, InformationElementType type, bool fToggled);
    142144
    143145    /* API: Notifiers stuff: */
     
    153155    /* Variables: */
    154156    QList<UIGInformationItem*> m_notifiers;
    155     DetailsElementType m_type;
     157    InformationElementType m_type;
    156158    bool m_fToggled;
    157159};
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationSet.cpp

    r58616 r58726  
    6363}
    6464
    65 void UIGInformationSet::buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings)
     65void UIGInformationSet::buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap<InformationElementType, bool> &settings)
    6666{
    6767    /* Remember passed arguments: */
     
    7575    if (!m_fFullSet || !m_fHasDetails)
    7676    {
    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;
    7979        bool fCleanupPerformed = false;
    8080        for (int i = iFirstItem; i <= iLastItem; ++i)
     
    9999
    100100    /* Choose last-step number: */
    101     m_iLastStepNumber = m_fFullSet ? DetailsElementType_Description : DetailsElementType_Preview;
     101    m_iLastStepNumber = m_fFullSet ? InformationElementType_Description : InformationElementType_Preview;
    102102
    103103    /* Fetch USB controller restrictions: */
    104104    const CUSBDeviceFilters &filters = m_machine.GetUSBDeviceFilters();
    105105    if (filters.isNull() || !m_machine.GetUSBProxyAvailable())
    106         m_settings.remove(DetailsElementType_USB);
     106        m_settings.remove(InformationElementType_USB);
    107107
    108108    /* Start building set: */
     
    124124    {
    125125        /* Load details settings: */
    126         DetailsElementType elementType = (DetailsElementType)iStepNumber;
     126        InformationElementType elementType = (InformationElementType)iStepNumber;
    127127        /* Should the element be visible? */
    128128        bool fVisible = m_settings.contains(elementType);
     
    242242        {
    243243            UIGInformationElement *pElement = pItem->toElement();
    244             DetailsElementType type = pElement->elementType();
     244            InformationElementType type = pElement->elementType();
    245245            AssertMsg(!m_elements.contains(type), ("Element already added!"));
    246246            m_elements.insert(type, pItem);
     
    262262        {
    263263            UIGInformationElement *pElement = pItem->toElement();
    264             DetailsElementType type = pElement->elementType();
     264            InformationElementType type = pElement->elementType();
    265265            AssertMsg(m_elements.contains(type), ("Element do not present (type = %d)!", (int)type));
    266266            m_elements.remove(type);
     
    321321}
    322322
    323 UIGInformationElement* UIGInformationSet::element(DetailsElementType elementType) const
     323UIGInformationElement* UIGInformationSet::element(InformationElementType elementType) const
    324324{
    325325    UIGInformationItem *pItem = m_elements.value(elementType, 0);
     
    373373        switch (pElement->elementType())
    374374        {
    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:
    382382#ifdef VBOX_WITH_PARALLEL_PORTS
    383             case DetailsElementType_Parallel:
     383            case InformationElementType_Parallel:
    384384#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:
    389390            {
    390391                iMinimumWidthHint = qMax(iMinimumWidthHint, pItem->minimumWidthHint());
    391392                break;
    392393            }
    393             case DetailsElementType_Preview:
     394            case InformationElementType_Preview:
    394395            {
    395                 UIGInformationItem *pGeneralItem = element(DetailsElementType_General);
    396                 UIGInformationItem *pSystemItem = element(DetailsElementType_System);
     396                UIGInformationItem *pGeneralItem = element(InformationElementType_General);
     397                UIGInformationItem *pSystemItem = element(InformationElementType_System);
    397398                int iGeneralElementWidth = pGeneralItem ? pGeneralItem->minimumWidthHint() : 0;
    398399                int iSystemElementWidth = pSystemItem ? pSystemItem->minimumWidthHint() : 0;
     
    433434        switch (pElement->elementType())
    434435        {
    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:
    442443#ifdef VBOX_WITH_PARALLEL_PORTS
    443             case DetailsElementType_Parallel:
     444            case InformationElementType_Parallel:
    444445#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:
    449451            {
    450452                iMinimumHeightHint += (pItem->minimumHeightHint() + iSpacing);
    451453                break;
    452454            }
    453             case DetailsElementType_Preview:
     455            case InformationElementType_Preview:
    454456            {
    455457                iMinimumHeightHint = qMax(iMinimumHeightHint, pItem->minimumHeightHint() + iSpacing);
     
    488490        switch (pElement->elementType())
    489491        {
    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:
    497499#ifdef VBOX_WITH_PARALLEL_PORTS
    498             case DetailsElementType_Parallel:
     500            case InformationElementType_Parallel:
    499501#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:
    504507            {
    505508                /* Move element: */
     
    507510                /* Calculate required width: */
    508511                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))
    512515                        if (pPreviewElement->isVisible())
    513516                            iWidth -= (iSpacing + pPreviewElement->minimumWidthHint());
     
    532535                break;
    533536            }
    534             case DetailsElementType_Preview:
     537            case InformationElementType_Preview:
    535538            {
    536539                /* Prepare variables: */
     
    568571
    569572    /* 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
     576UIGInformationElement* UIGInformationSet::createElement(InformationElementType elementType, bool fOpen)
    574577{
    575578    /* Element factory: */
    576579    switch (elementType)
    577580    {
    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);
    586589#ifdef VBOX_WITH_PARALLEL_PORTS
    587         case DetailsElementType_Parallel:    return new UIGInformationElementParallel(this, fOpen);
     590        case InformationElementType_Parallel:    return new UIGInformationElementParallel(this, fOpen);
    588591#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);
    593597    }
    594598    return 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGInformationSet.h

    r58616 r58726  
    5151
    5252    /* 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);
    5454
    5555    /* API: Machine stuff: */
     
    9191    bool hasItems(UIGInformationItemType type = UIGInformationItemType_Element) const;
    9292    void clearItems(UIGInformationItemType type = UIGInformationItemType_Element);
    93     UIGInformationElement* element(DetailsElementType elementType) const;
     93    UIGInformationElement* element(InformationElementType elementType) const;
    9494
    9595    /* Helpers: Prepare stuff: */
     
    104104    /* Helpers: Build stuff: */
    105105    void rebuildSet();
    106     UIGInformationElement* createElement(DetailsElementType elementType, bool fOpen);
     106    UIGInformationElement* createElement(InformationElementType elementType, bool fOpen);
    107107
    108108    /** Machine-item this set built for. */
     
    122122    int m_iLastStepNumber;
    123123    QString m_strSetId;
    124     QMap<DetailsElementType, bool> m_settings;
     124    QMap<InformationElementType, bool> m_settings;
    125125};
    126126
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIGRuntimeInformation.cpp

    r58690 r58726  
    8181    /* Setup details-model: */
    8282    m_pDetailsModel = new UIGInformationModel(this);
     83    QMap<InformationElementType, bool> settings;
     84    settings.insert(InformationElementType_RuntimeAttributes, true);
     85    m_pDetailsModel->setInformationWindowElements(settings);
    8386}
    8487
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r58616 r58726  
    4141# include "UIMachine.h"
    4242# include "UIVMItem.h"
     43# include "UIGRuntimeInformation.h"
    4344
    4445/* COM includes: */
     
    269270
    270271    /* Statistics page update: */
    271     refreshStatistics();
     272    //refreshStatistics();
    272273}
    273274
     
    331332
    332333    /* Update VM statistics page: */
    333     refreshStatistics();
     334    //refreshStatistics();
    334335}
    335336
     
    406407void UIVMInformationDialog::prepareTabWidget()
    407408{
     409    /* List of VM items: */
     410    QList<UIVMItem*> items;
     411    items << new UIVMItem(gpMachine->uisession()->machine());
     412
    408413    /* Create tab-widget: */
    409414    m_pTabWidget = new QITabWidget;
    410415    AssertPtrReturnVoid(m_pTabWidget);
    411416    {
    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: */
    426418        m_pTabWidget->setTabIcon(0, UIIconPool::iconSet(":/session_info_details_16px.png"));
    427419        m_pTabWidget->setTabIcon(1, UIIconPool::iconSet(":/session_info_runtime_16px.png"));
     
    429421        /* Add tab-widget into main-layout: */
    430422        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        }
    462442    }
    463443}
Note: See TracChangeset for help on using the changeset viewer.

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