VirtualBox

Changeset 70837 in vbox


Ignore:
Timestamp:
Jan 31, 2018 2:59:02 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120645
Message:

FE/Qt bugref:6699 Adding a new class to contain 'guest session control' related widget

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r70706 r70837  
    506506        src/runtime/information/UIInformationConfiguration.h \
    507507        src/runtime/information/UIInformationDataItem.h \
     508        src/runtime/information/UIInformationGuestSession.h \
    508509        src/runtime/information/UIInformationItem.h \
    509510        src/runtime/information/UIInformationModel.h \
     
    833834        src/runtime/information/UIInformationConfiguration.cpp \
    834835        src/runtime/information/UIInformationDataItem.cpp \
     836        src/runtime/information/UIInformationGuestSession.cpp \
    835837        src/runtime/information/UIInformationItem.cpp \
    836838        src/runtime/information/UIInformationModel.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationGuestSession.cpp

    r70833 r70837  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIInformationConfiguration class implementation.
     3 * VBox Qt GUI - UIInformationGuestSession class implementation.
    44 */
    55
     
    2525
    2626/* GUI includes: */
    27 # include "UIInformationConfiguration.h"
     27# include "UIInformationGuestSession.h"
    2828# include "UIInformationDataItem.h"
    2929# include "UIInformationItem.h"
     
    3535
    3636
    37 UIInformationConfiguration::UIInformationConfiguration(QWidget *pParent, const CMachine &machine, const CConsole &console)
     37UIInformationGuestSession::UIInformationGuestSession(QWidget *pParent, const CMachine &machine, const CConsole &console)
    3838    : QWidget(pParent)
    3939    , m_machine(machine)
    4040    , m_console(console)
    4141    , m_pMainLayout(0)
    42     , m_pModel(0)
    43     , m_pView(0)
    4442{
    45     /* Prepare layout: */
    4643    prepareLayout();
    47 
    48     /* Prepare model: */
    49     prepareModel();
    50 
    51     /* Prepare view: */
    52     prepareView();
    5344}
    5445
    55 void UIInformationConfiguration::prepareLayout()
     46void UIInformationGuestSession::prepareLayout()
    5647{
    5748    /* Create layout: */
    5849    m_pMainLayout = new QVBoxLayout(this);
    59     AssertPtrReturnVoid(m_pMainLayout);
     50    if (m_pMainLayout)
    6051    {
    6152        /* Configure layout: */
     
    6354    }
    6455}
    65 
    66 void UIInformationConfiguration::prepareModel()
    67 {
    68     /* Create information-model: */
    69     m_pModel = new UIInformationModel(this, m_machine, m_console);
    70     AssertPtrReturnVoid(m_pModel);
    71     {
    72         /* Create general data-item: */
    73         UIInformationDataItem *pGeneral = new UIInformationDataGeneral(m_machine, m_console, m_pModel);
    74         AssertPtrReturnVoid(pGeneral);
    75         {
    76             /* Add general data-item to model: */
    77             m_pModel->addItem(pGeneral);
    78         }
    79 
    80         /* Create system data-item: */
    81         UIInformationDataItem *pSystem = new UIInformationDataSystem(m_machine, m_console, m_pModel);
    82         AssertPtrReturnVoid(pSystem);
    83         {
    84             /* Add system data-item to model: */
    85             m_pModel->addItem(pSystem);
    86         }
    87 
    88         /* Create display data-item: */
    89         UIInformationDataItem *pDisplay = new UIInformationDataDisplay(m_machine, m_console, m_pModel);
    90         AssertPtrReturnVoid(pDisplay);
    91         {
    92             /* Add display data-item to model: */
    93             m_pModel->addItem(pDisplay);
    94         }
    95 
    96         /* Create storage data-item: */
    97         UIInformationDataItem *pStorage = new UIInformationDataStorage(m_machine, m_console, m_pModel);
    98         AssertPtrReturnVoid(pStorage);
    99         {
    100             /* Add storage data-item to model: */
    101             m_pModel->addItem(pStorage);
    102         }
    103 
    104         /* Create audio data-item: */
    105         UIInformationDataItem *pAudio = new UIInformationDataAudio(m_machine, m_console, m_pModel);
    106         AssertPtrReturnVoid(pAudio);
    107         {
    108             /* Add audio data-item to model: */
    109             m_pModel->addItem(pAudio);
    110         }
    111 
    112         /* Create network data-item: */
    113         UIInformationDataItem *pNetwork = new UIInformationDataNetwork(m_machine, m_console, m_pModel);
    114         AssertPtrReturnVoid(pNetwork);
    115         {
    116             /* Add network data-item to model: */
    117             m_pModel->addItem(pNetwork);
    118         }
    119 
    120         /* Create serial-ports data-item: */
    121         UIInformationDataItem *pSerialPorts = new UIInformationDataSerialPorts(m_machine, m_console, m_pModel);
    122         AssertPtrReturnVoid(pSerialPorts);
    123         {
    124             /* Add serial-ports data-item to model: */
    125             m_pModel->addItem(pSerialPorts);
    126         }
    127 
    128         /* Create usb data-item: */
    129         UIInformationDataItem *pUSB = new UIInformationDataUSB(m_machine, m_console, m_pModel);
    130         AssertPtrReturnVoid(pUSB);
    131         {
    132             /* Add usb data-item to model: */
    133             m_pModel->addItem(pUSB);
    134         }
    135 
    136         /* Create shared-folders data-item: */
    137         UIInformationDataItem *pSharedFolders = new UIInformationDataSharedFolders(m_machine, m_console, m_pModel);
    138         AssertPtrReturnVoid(pSharedFolders);
    139         {
    140             /* Add shared-folders data-item to model: */
    141             m_pModel->addItem(pSharedFolders);
    142         }
    143     }
    144 }
    145 
    146 void UIInformationConfiguration::prepareView()
    147 {
    148     /* Create information-view: */
    149     m_pView = new UIInformationView;
    150     AssertPtrReturnVoid(m_pView);
    151     {
    152         /* Configure information-view: */
    153         m_pView->setResizeMode(QListView::Adjust);
    154 
    155         /* Create information-delegate item: */
    156         UIInformationItem *pItem = new UIInformationItem(m_pView);
    157         AssertPtrReturnVoid(pItem);
    158         {
    159             /* Set item-delegate for information-view: */
    160             m_pView->setItemDelegate(pItem);
    161         }
    162         /* Connect data changed signal: */
    163         connect(m_pModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
    164                 m_pView, SLOT(updateData(const QModelIndex &, const QModelIndex &)));
    165 
    166         /* Set model for view: */
    167         m_pView->setModel(m_pModel);
    168         /* Add information-view to the layout: */
    169         m_pMainLayout->addWidget(m_pView);
    170     }
    171 }
    172 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationGuestSession.h

    r70833 r70837  
    1616 */
    1717
    18 #ifndef ___UIInformationConfiguration_h___
    19 #define ___UIInformationConfiguration_h___
     18#ifndef ___UIInformationGuestSession_h___
     19#define ___UIInformationGuestSession_h___
    2020
    2121/* Qt includes: */
     
    3434
    3535/** QWidget extension
    36   * providing GUI with configuration-information tab in session-information window. */
    37 class UIInformationConfiguration : public QWidget
     36  * providing GUI with guest session information and control tab in session-information window. */
     37class UIInformationGuestSession : public QWidget
    3838{
    3939    Q_OBJECT;
     
    4141public:
    4242
    43     /** Constructs information-tab passing @a pParent to the QWidget base-class constructor.
    44       * @param machine is machine reference.
    45       * @param console is machine console reference. */
    46     UIInformationConfiguration(QWidget *pParent, const CMachine &machine, const CConsole &console);
     43    UIInformationGuestSession(QWidget *pParent, const CMachine &machine, const CConsole &console);
    4744
    4845private:
    4946
    50     /** Prepares layout. */
    5147    void prepareLayout();
    5248
    53     /** Prepares model. */
    54     void prepareModel();
    55 
    56     /** Prepares view. */
    57     void prepareView();
    58 
    59     /** Holds the machine instance. */
    60     CMachine m_machine;
    61     /** Holds the console instance. */
    62     CConsole m_console;
    63     /** Holds the instance of layout we create. */
    64     QVBoxLayout *m_pMainLayout;
    65     /** Holds the instance of model we create. */
    66     UIInformationModel *m_pModel;
    67     /** Holds the instance of view we create. */
    68     UIInformationView *m_pView;
     49    CMachine      m_machine;
     50    CConsole      m_console;
     51    QVBoxLayout * m_pMainLayout;
    6952};
    7053
    71 #endif /* !___UIInformationConfiguration_h___ */
    72 
     54#endif /* !___UIInformationGuestSession_h___ */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r69500 r70837  
    227227        UIInformationConfiguration *pInformationConfigurationWidget =
    228228            new UIInformationConfiguration(this, m_pMachineWindow->machine(), m_pMachineWindow->console());
    229         AssertPtrReturnVoid(pInformationConfigurationWidget);
     229        if (pInformationConfigurationWidget)
    230230        {
    231231            m_tabs.insert(0, pInformationConfigurationWidget);
     
    236236        UIInformationRuntime *pInformationRuntimeWidget =
    237237            new UIInformationRuntime(this, m_pMachineWindow->machine(), m_pMachineWindow->console());
    238         AssertPtrReturnVoid(pInformationRuntimeWidget);
     238        if (pInformationRuntimeWidget)
    239239        {
    240240            m_tabs.insert(1, pInformationRuntimeWidget);
     
    302302    saveSettings();
    303303}
    304 
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