VirtualBox

Changeset 58859 in vbox


Ignore:
Timestamp:
Nov 25, 2015 1:57:50 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104340
Message:

FE/Qt: bugref:8069: Code-style/cleanup changes for log-viewer.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp

    r58815 r58859  
    5757
    5858    /** Constructs search-panel by passing @a pParent to the QWidget base-class constructor.
    59       * @a pViewer is the instance of VM Log-Viewer. */
     59      * @param  pViewer  Specifies instance of VM Log-Viewer. */
    6060    UIVMLogViewerSearchPanel(QWidget *pParent, UIVMLogViewer *pViewer)
    6161        : QIWithRetranslateUI<QWidget>(pParent)
    6262        , m_pViewer(pViewer)
     63        , m_pMainLayout(0)
    6364        , m_pCloseButton(0)
    6465        , m_pSearchLabel(0), m_pSearchEditor(0)
     
    7475
    7576    /** Handles find next/back action triggering.
    76       * @a iButton specifies id of next/back button. */
     77      * @param  iButton  Specifies id of next/back button. */
    7778    void find(int iButton)
    7879    {
     
    8485
    8586    /** Handles textchanged event from search-editor.
    86       * @a strSearchString specifies the search-string. */
     87      * @param  strSearchString  Specifies search-string. */
    8788    void findCurrent(const QString &strSearchString)
    8889    {
     
    109110    void prepare()
    110111    {
     112        /* Prepare main-layout: */
     113        prepareMainLayout();
     114
    111115        /* Prepare widgets: */
    112116        prepareWidgets();
    113117
    114         /* Prepare main-layout: */
    115         prepareMainLayout();
    116 
    117118        /* Prepare connections: */
    118119        prepareConnections();
     
    120121        /* Retranslate finally: */
    121122        retranslateUi();
     123    }
     124
     125    /** Prepares main-layout. */
     126    void prepareMainLayout()
     127    {
     128        /* Create main-layout: */
     129        m_pMainLayout = new QHBoxLayout(this);
     130        AssertPtrReturnVoid(m_pMainLayout);
     131        {
     132            /* Prepare main-layout: */
     133            m_pMainLayout->setSpacing(5);
     134            /* Not sure 0 margins are default, but just to be safe: */
     135            m_pMainLayout->setContentsMargins(0, 0, 0, 0);
     136        }
    122137    }
    123138
     
    128143        m_pCloseButton = new UIMiniCancelButton(this);
    129144        AssertPtrReturnVoid(m_pCloseButton);
     145        {
     146            /* Add close-button to main-layout: */
     147            m_pMainLayout->addWidget(m_pCloseButton);
     148        }
    130149
    131150        /* Create search-editor: */
    132151        m_pSearchEditor = new UISearchField(this);
    133152        AssertPtrReturnVoid(m_pSearchEditor);
    134         /* Prepare search-editor: */
    135         m_pSearchEditor->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
     153        {
     154            /* Configure search-editor: */
     155            m_pSearchEditor->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
     156            /* Add search-editor to main-layout: */
     157            m_pMainLayout->addWidget(m_pSearchEditor);
     158        }
    136159
    137160        /* Create search-label: */
    138161        m_pSearchLabel = new QLabel(this);
    139162        AssertPtrReturnVoid(m_pSearchLabel);
    140         /* Prepare search-label: */
    141         m_pSearchLabel->setBuddy(m_pSearchEditor);
     163        {
     164            /* Configure search-label: */
     165            m_pSearchLabel->setBuddy(m_pSearchEditor);
     166            /* Prepare font: */
     167#ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
     168            QFont font = m_pSearchLabel->font();
     169            font.setPointSize(::darwinSmallFontSize());
     170            m_pSearchLabel->setFont(font);
     171#endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
     172            /* Add search-label to main-layout: */
     173            m_pMainLayout->addWidget(m_pSearchLabel);
     174        }
    142175
    143176        /* Create Next/Prev button-box: */
    144177        m_pNextPrevButtons = new UIRoundRectSegmentedButton(this, 2);
    145178        AssertPtrReturnVoid(m_pNextPrevButtons);
    146         /* Prepare Next/Prev button-box: */
    147         m_pNextPrevButtons->setEnabled(0, false);
    148         m_pNextPrevButtons->setEnabled(1, false);
     179        {
     180            /* Prepare Next/Prev button-box: */
     181            m_pNextPrevButtons->setEnabled(0, false);
     182            m_pNextPrevButtons->setEnabled(1, false);
    149183#ifndef Q_WS_MAC
    150         /* No icons on the Mac: */
    151         m_pNextPrevButtons->setIcon(0, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowBack, this));
    152         m_pNextPrevButtons->setIcon(1, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
     184            /* No icons on the Mac: */
     185            m_pNextPrevButtons->setIcon(0, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowBack, this));
     186            m_pNextPrevButtons->setIcon(1, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
    153187#endif /* !Q_WS_MAC */
     188            /* Add Next/Prev button-box to main-layout: */
     189            m_pMainLayout->addWidget(m_pNextPrevButtons);
     190        }
    154191
    155192        /* Create case-sensitive checkbox: */
    156193        m_pCaseSensitiveCheckBox = new QCheckBox(this);
    157194        AssertPtrReturnVoid(m_pCaseSensitiveCheckBox);
    158         /* Setup focus proxy: */
    159         setFocusProxy(m_pCaseSensitiveCheckBox);
     195        {
     196            /* Configure focus for case-sensitive checkbox: */
     197            setFocusProxy(m_pCaseSensitiveCheckBox);
     198            /* Prepare font: */
     199#ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
     200            QFont font = m_pCaseSensitiveCheckBox->font();
     201            font.setPointSize(::darwinSmallFontSize());
     202            m_pCaseSensitiveCheckBox->setFont(font);
     203#endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
     204            /* Add case-sensitive checkbox to main-layout: */
     205            m_pMainLayout->addWidget(m_pCaseSensitiveCheckBox);
     206        }
    160207
    161208        /* Create warning-spacer: */
    162209        m_pWarningSpacer = new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Minimum);
    163210        AssertPtrReturnVoid(m_pWarningSpacer);
     211        {
     212            /* Add warning-spacer to main-layout: */
     213            m_pMainLayout->addItem(m_pWarningSpacer);
     214        }
    164215
    165216        /* Create warning-icon: */
    166217        m_pWarningIcon = new QLabel(this);
    167218        AssertPtrReturnVoid(m_pWarningIcon);
    168         /* Prepare warning-icon: */
    169         m_pWarningIcon->hide();
    170         QIcon icon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning, this);
    171         if (!icon.isNull())
    172             m_pWarningIcon->setPixmap(icon.pixmap(16, 16));
     219        {
     220            /* Confifure warning-icon: */
     221            m_pWarningIcon->hide();
     222            QIcon icon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning, this);
     223            if (!icon.isNull())
     224                m_pWarningIcon->setPixmap(icon.pixmap(16, 16));
     225            /* Add warning-icon to main-layout: */
     226            m_pMainLayout->addWidget(m_pWarningIcon);
     227        }
    173228
    174229        /* Create warning-label: */
    175230        m_pWarningLabel = new QLabel(this);
    176231        AssertPtrReturnVoid(m_pWarningLabel);
    177         /* Prepare warning-label: */
    178         m_pWarningLabel->hide();
     232        {
     233            /* Configure warning-label: */
     234            m_pWarningLabel->hide();
     235            /* Prepare font: */
     236#ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
     237            QFont font = m_pWarningLabel->font();
     238            font.setPointSize(::darwinSmallFontSize());
     239            m_pWarningLabel->setFont(font);
     240#endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
     241            /* Add warning-label to main-layout: */
     242            m_pMainLayout->addWidget(m_pWarningLabel);
     243        }
    179244
    180245        /* Create spacer-item: */
    181246        m_pSpacerItem = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
    182247        AssertPtrReturnVoid(m_pSpacerItem);
    183 
    184         /* Prepare fonts: */
    185 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
    186         QFont font = m_pSearchLabel->font();
    187         font.setPointSize(::darwinSmallFontSize());
    188         m_pSearchLabel->setFont(font);
    189         m_pCaseSensitiveCheckBox->setFont(font);
    190         m_pWarningLabel->setFont(font);
    191 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
    192     }
    193 
    194     /** Prepares main-layout. */
    195     void prepareMainLayout()
    196     {
    197         /* Create main-layout: */
    198         QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    199         AssertPtrReturnVoid(pMainLayout);
    200         {
    201             /* Prepare main-layout: */
    202             pMainLayout->setSpacing(5);
    203             pMainLayout->setContentsMargins(0, 0, 0, 0);
    204             pMainLayout->addWidget(m_pCloseButton);
    205             pMainLayout->addWidget(m_pSearchLabel);
    206             pMainLayout->addWidget(m_pSearchEditor);
    207             pMainLayout->addWidget(m_pNextPrevButtons);
    208             pMainLayout->addWidget(m_pCaseSensitiveCheckBox);
    209             pMainLayout->addItem(m_pWarningSpacer);
    210             pMainLayout->addWidget(m_pWarningIcon);
    211             pMainLayout->addWidget(m_pWarningLabel);
    212             pMainLayout->addItem(m_pSpacerItem);
     248        {
     249            /* Add spacer-item to main-layout: */
     250            m_pMainLayout->addItem(m_pSpacerItem);
    213251        }
    214252    }
     
    217255    void prepareConnections()
    218256    {
     257        /* Prepare connections: */
    219258        connect(m_pCloseButton, SIGNAL(clicked()), this, SLOT(hide()));
    220259        connect(m_pSearchEditor, SIGNAL(textChanged(const QString &)),
     
    344383
    345384    /** Search routine.
    346       * @a fForward specifies the direction of search.
    347       * @a fStartCurrent specifies if the search should start from beginning of log. */
     385      * @param  fForward       Specifies the direction of search.
     386      * @param  fStartCurrent  Specifies whether search should start from beginning of the log. */
    348387    void search(bool fForward, bool fStartCurrent = false)
    349388    {
     
    411450    /** Holds the reference to the VM Log-Viewer this search-panel belongs to. */
    412451    UIVMLogViewer *m_pViewer;
     452    /** Holds the instance of main-layout we create. */
     453    QHBoxLayout *m_pMainLayout;
    413454    /** Holds the instance of close-button we create. */
    414455    UIMiniCancelButton *m_pCloseButton;
     
    440481
    441482    /** Constructs the filter-panel by passing @a pParent to the QWidget base-class constructor.
    442       * @a pViewer specifies the reference to the VM Log-Viewer this filter-panel belongs to. */
     483      * @param  pViewer  Specifies reference to the VM Log-Viewer this filter-panel belongs to. */
    443484    UIVMLogViewerFilterPanel(QWidget *pParent, UIVMLogViewer *pViewer)
    444485        : QIWithRetranslateUI<QWidget>(pParent)
    445486        , m_pViewer(pViewer)
     487        , m_pMainLayout(0)
    446488        , m_pCloseButton(0)
    447489        , m_pFilterLabel(0), m_pFilterComboBox(0)
     
    454496
    455497    /** Applies filter settings and filters the current log-page.
    456       * @a iCurrentIndex specifies index of current log-page, but it is actually not used in the method. */
     498      * @param  iCurrentIndex  Specifies index of current log-page, but it is actually not used in the method. */
    457499    void applyFilter(const int iCurrentIndex = 0)
    458500    {
     
    510552    void prepare()
    511553    {
     554        /* Prepare main-layout: */
     555        prepareMainLayout();
     556
    512557        /* Prepare widgets: */
    513558        prepareWidgets();
    514559
    515         /* Prepare main-layout: */
    516         prepareMainLayout();
    517 
    518560        /* Prepare connections: */
    519561        prepareConnections();
     
    521563        /* Retranslate finally: */
    522564        retranslateUi();
     565    }
     566
     567    /** Prepares main-layout. */
     568    void prepareMainLayout()
     569    {
     570        /* Create main-layout: */
     571        m_pMainLayout = new QHBoxLayout(this);
     572        AssertPtrReturnVoid(m_pMainLayout);
     573        {
     574            /* Prepare main-layout: */
     575            m_pMainLayout->setSpacing(5);
     576            /* Not sure 0 margins are default, but just to be safe: */
     577            m_pMainLayout->setContentsMargins(0, 0, 0, 0);
     578        }
    523579    }
    524580
     
    529585        m_pCloseButton = new UIMiniCancelButton(this);
    530586        AssertPtrReturnVoid(m_pCloseButton);
     587        {
     588            /* Add close-button to main-layout: */
     589            m_pMainLayout->addWidget(m_pCloseButton);
     590        }
    531591
    532592        /* Create filter-combobox: */
    533593        m_pFilterComboBox = new QComboBox(this);
    534594        AssertPtrReturnVoid(m_pFilterComboBox);
    535         /* Prepare filter-combobox: */
    536         m_pFilterComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    537         m_pFilterComboBox->setEditable(true);
    538         QStringList strFilterPresets;
    539         strFilterPresets << "" << "GUI" << "NAT" << "AHCI" << "VD" << "Audio" << "VUSB" << "SUP" << "PGM" << "HDA"
    540                          << "HM" << "VMM" << "GIM" << "CPUM";
    541         strFilterPresets.sort();
    542         m_pFilterComboBox->addItems(strFilterPresets);
     595        {
     596            /* Configure filter-combobox: */
     597            m_pFilterComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     598            m_pFilterComboBox->setEditable(true);
     599            QStringList strFilterPresets;
     600            strFilterPresets << "" << "GUI" << "NAT" << "AHCI" << "VD" << "Audio" << "VUSB" << "SUP" << "PGM" << "HDA"
     601                             << "HM" << "VMM" << "GIM" << "CPUM";
     602            strFilterPresets.sort();
     603            m_pFilterComboBox->addItems(strFilterPresets);
     604            /* Add filter-combobox to main-layout: */
     605            m_pMainLayout->addWidget(m_pFilterComboBox);
     606        }
    543607
    544608        /* Create filter-label: */
    545609        m_pFilterLabel = new QLabel(this);
    546610        AssertPtrReturnVoid(m_pFilterLabel);
    547         /* Prepare filter-label: */
    548         m_pFilterLabel->setBuddy(m_pFilterComboBox);
     611        {
     612            /* Configure filter-label: */
     613            m_pFilterLabel->setBuddy(m_pFilterComboBox);
    549614#ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
    550         QFont font = m_pFilterLabel->font();
    551         font.setPointSize(::darwinSmallFontSize());
    552         m_pFilterLabel->setFont(font);
     615            QFont font = m_pFilterLabel->font();
     616            font.setPointSize(::darwinSmallFontSize());
     617            m_pFilterLabel->setFont(font);
    553618#endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
    554     }
    555 
    556     /** Prepares main-layout. */
    557     void prepareMainLayout()
    558     {
    559         /* Create main-layout: */
    560         QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    561         AssertPtrReturnVoid(pMainLayout);
    562         {
    563             /* Prepare main-layout: */
    564             pMainLayout->setSpacing(5);
    565             pMainLayout->setContentsMargins(0, 0, 0, 0);
    566             pMainLayout->addWidget(m_pCloseButton);
    567             pMainLayout->addWidget(m_pFilterLabel);
    568             pMainLayout->addWidget(m_pFilterComboBox);
     619            /* Add filter-label to main-layout: */
     620            m_pMainLayout->addWidget(m_pFilterLabel);
    569621        }
    570622    }
     
    573625    void prepareConnections()
    574626    {
     627        /* Prepare connections: */
    575628        connect(m_pCloseButton, SIGNAL(clicked()), this, SLOT(hide()));
    576629        connect(m_pFilterComboBox, SIGNAL(editTextChanged(const QString &)),
     
    637690    /** Holds the reference to VM Log-Viewer this filter-panel belongs to. */
    638691    UIVMLogViewer *m_pViewer;
     692    /** Holds the instance of main-layout we create. */
     693    QHBoxLayout *m_pMainLayout;
    639694    /** Holds the instance of close-button we create. */
    640695    UIMiniCancelButton *m_pCloseButton;
     
    652707void UIVMLogViewer::showLogViewerFor(QWidget *pCenterWidget, const CMachine &machine)
    653708{
    654     /* If there is no corresponding VM Log Viewer created: */
     709    /* If there is no corresponding VM Log-Viewer created: */
    655710    if (!m_viewers.contains(machine.GetName()))
    656711    {
    657         /* Creating new VM Log Viewer: */
     712        /* Create new VM Log-Viewer: */
    658713        UIVMLogViewer *pLogViewer = new UIVMLogViewer(pCenterWidget, Qt::Window, machine);
    659         pLogViewer->setAttribute(Qt::WA_DeleteOnClose);
    660         m_viewers[machine.GetName()] = pLogViewer;
     714        AssertPtrReturnVoid(pLogViewer);
     715        {
     716            /* Configure VM Log-Viewer: */
     717            pLogViewer->setAttribute(Qt::WA_DeleteOnClose);
     718            m_viewers[machine.GetName()] = pLogViewer;
     719        }
    661720    }
    662721
     
    686745void UIVMLogViewer::search()
    687746{
     747    /* Show/hide search-panel: */
    688748    m_pSearchPanel->isHidden() ? m_pSearchPanel->show() : m_pSearchPanel->hide();
    689749}
     
    784844bool UIVMLogViewer::close()
    785845{
     846    /* Close search-panel: */
    786847    m_pSearchPanel->hide();
     848    /* Close filter-panel: */
     849    m_pFilterPanel->hide();
     850    /* Call to base-class: */
    787851    return QMainWindow::close();
    788852}
     
    818882void UIVMLogViewer::filter()
    819883{
     884    /* Show/hide filter-panel: */
    820885    m_pFilterPanel->isHidden() ? m_pFilterPanel->show() : m_pFilterPanel->hide();
    821886}
     
    850915    m_pViewerContainer = new QITabWidget(centralWidget());
    851916    AssertPtrReturnVoid(m_pViewerContainer);
    852     /* Layout VM Log-Viewer container: */
    853     m_pMainLayout->insertWidget(0, m_pViewerContainer);
     917    {
     918        /* Layout VM Log-Viewer container: */
     919        m_pMainLayout->insertWidget(0, m_pViewerContainer);
     920    }
    854921
    855922    /* Create VM Log-Viewer search-panel: */
    856923    m_pSearchPanel = new UIVMLogViewerSearchPanel(centralWidget(), this);
    857924    AssertPtrReturnVoid(m_pSearchPanel);
    858     /* Prepare VM Log-Viewer search-panel: */
    859     centralWidget()->installEventFilter(m_pSearchPanel);
    860     m_pSearchPanel->hide();
    861     /* Layout VM Log-Viewer search-panel: */
    862     m_pMainLayout->insertWidget(1, m_pSearchPanel);
     925    {
     926        /* Configure VM Log-Viewer search-panel: */
     927        centralWidget()->installEventFilter(m_pSearchPanel);
     928        m_pSearchPanel->hide();
     929        /* Layout VM Log-Viewer search-panel: */
     930        m_pMainLayout->insertWidget(1, m_pSearchPanel);
     931    }
    863932
    864933    /* Create VM Log-Viewer filter-panel: */
    865934    m_pFilterPanel = new UIVMLogViewerFilterPanel(centralWidget(), this);
    866935    AssertPtrReturnVoid(m_pFilterPanel);
    867     /* Prepare VM Log-Viewer filter-panel: */
    868     centralWidget()->installEventFilter(m_pFilterPanel);
    869     m_pFilterPanel->hide();
    870     /* Layout VM Log-Viewer filter-panel: */
    871     m_pMainLayout->insertWidget(2, m_pFilterPanel);
    872 
    873     /* Create/Prepare standard buttons from button-box: */
     936    {
     937        /* Configure VM Log-Viewer filter-panel: */
     938        centralWidget()->installEventFilter(m_pFilterPanel);
     939        m_pFilterPanel->hide();
     940        /* Layout VM Log-Viewer filter-panel: */
     941        m_pMainLayout->insertWidget(2, m_pFilterPanel);
     942    }
     943
     944    /* Get help-button: */
    874945    m_pButtonHelp = m_pButtonBox->button(QDialogButtonBox::Help);
    875946    AssertPtrReturnVoid(m_pButtonHelp);
     947    /* Create find-button: */
    876948    m_pButtonFind = m_pButtonBox->addButton(QString::null, QDialogButtonBox::ActionRole);
    877949    AssertPtrReturnVoid(m_pButtonFind);
     950    /* Create filter-button: */
    878951    m_pButtonFilter = m_pButtonBox->addButton(QString::null, QDialogButtonBox::ActionRole);
    879952    AssertPtrReturnVoid(m_pButtonFilter);
     953    /* Create close-button: */
    880954    m_pButtonClose = m_pButtonBox->button(QDialogButtonBox::Close);
    881955    AssertPtrReturnVoid(m_pButtonClose);
     956    /* Create save-button: */
    882957    m_pButtonSave = m_pButtonBox->button(QDialogButtonBox::Save);
    883958    AssertPtrReturnVoid(m_pButtonSave);
     959    /* Create refresh-button: */
    884960    m_pButtonRefresh = m_pButtonBox->addButton(QString::null, QDialogButtonBox::ActionRole);
    885961    AssertPtrReturnVoid(m_pButtonRefresh);
     
    910986    }
    911987
     988    /* Remove log-viewer: */
    912989    if (!m_machine.isNull())
    913990        m_viewers.remove(m_machine.GetName());
     
    10041081QTextEdit* UIVMLogViewer::createLogPage(const QString &strName)
    10051082{
     1083    /* Create page-container: */
    10061084    QWidget *pPageContainer = new QWidget;
    1007     QVBoxLayout *pPageLayout = new QVBoxLayout(pPageContainer);
    1008     QTextEdit *pLogViewer = new QTextEdit(pPageContainer);
    1009     pPageLayout->addWidget(pLogViewer);
    1010     pPageLayout->setContentsMargins(10, 10, 10, 10);
    1011 
    1012     QFont font = pLogViewer->currentFont();
    1013     font.setFamily("Courier New,courier");
    1014     pLogViewer->setFont(font);
    1015     pLogViewer->setWordWrapMode(QTextOption::NoWrap);
    1016     pLogViewer->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    1017     pLogViewer->setReadOnly(true);
    1018 
    1019     m_pViewerContainer->addTab(pPageContainer, strName);
    1020     return pLogViewer;
     1085    AssertPtrReturn(pPageContainer, 0);
     1086    {
     1087        /* Create page-layout: */
     1088        QVBoxLayout *pPageLayout = new QVBoxLayout(pPageContainer);
     1089        AssertPtrReturn(pPageLayout, 0);
     1090        {
     1091            pPageLayout->setContentsMargins(10, 10, 10, 10);
     1092        }
     1093        /* Create Log-Viewer: */
     1094        QTextEdit *pLogViewer = new QTextEdit(pPageContainer);
     1095        AssertPtrReturn(pLogViewer, 0);
     1096        {
     1097            /* Configure Log-Viewer: */
     1098            QFont font = pLogViewer->currentFont();
     1099            font.setFamily("Courier New,courier");
     1100            pLogViewer->setFont(font);
     1101            pLogViewer->setWordWrapMode(QTextOption::NoWrap);
     1102            pLogViewer->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
     1103            pLogViewer->setReadOnly(true);
     1104            /* Add Log-Viewer to page-layout: */
     1105            pPageLayout->addWidget(pLogViewer);
     1106        }
     1107        /* Add page-container to viewer-container: */
     1108        m_pViewerContainer->addTab(pPageContainer, strName);
     1109        return pLogViewer;
     1110    }
    10211111}
    10221112
  • trunk/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.h

    r58267 r58859  
    5757
    5858    /** Static method to create/show VM Log Viewer by passing @a pParent to QWidget base-class constructor.
    59       * @a machine specifies the machine for which VM Log-Viewer is requested. */
     59      * @param  machine  Specifies the machine for which VM Log-Viewer is requested. */
    6060    static void showLogViewerFor(QWidget *pParent, const CMachine &machine);
    6161
     
    6363
    6464    /** Constructs the VM Log-Viewer by passing @a pParent to QWidget base-class constructor.
    65       * @a flags specifies Qt window flags.
    66       * @a machine specifies the machine for which VM Log-Viewer is requested. */
     65      * @param  flags    Specifies Qt window flags.
     66      * @param  machine  Specifies the machine for which VM Log-Viewer is requested. */
    6767    UIVMLogViewer(QWidget *pParent, Qt::WindowFlags flags, const CMachine &machine);
    6868    /** Destructs the VM Log-Viewer. */
     
    130130    QITabWidget *m_pViewerContainer;
    131131
    132     /** Holds the instance of search panel. */
     132    /** Holds the instance of search-panel. */
    133133    UIVMLogViewerSearchPanel *m_pSearchPanel;
    134134
Note: See TracChangeset for help on using the changeset viewer.

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