VirtualBox

Changeset 70474 in vbox


Ignore:
Timestamp:
Jan 7, 2018 9:10:41 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: Adding some comments and coding style corrections.

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

Legend:

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

    r70147 r70474  
    195195void QIManagerDialog::prepareToolBar()
    196196{
    197     if(!m_pWidgetToolbar)
     197    if (!m_pWidgetToolbar)
    198198        return;
    199199    /* Enable unified toolbar on macOS: */
     
    247247        showMaximized();
    248248}
    249 
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QISplitter.cpp

    r69500 r70474  
    221221                            }
    222222                        }
    223                         else if(pEvent->type() == QEvent::MouseMove)
     223                        else if (pEvent->type() == QEvent::MouseMove)
    224224                        {
    225225                            /* If we are in the near of the handle or currently
     
    291291
    292292#include "QISplitter.moc"
    293 
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r69553 r70474  
    427427
    428428#endif // __UIMessageCenter_h__
    429 
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp

    r70473 r70474  
    9191protected:
    9292
    93     /* Overload the mouseXXXEvent to control how selection is made: */
     93    /* Overload the mouseXXXEvent to control how selection is done: */
    9494    virtual void        mouseDoubleClickEvent(QMouseEvent *){}
    9595    virtual void        mouseMoveEvent(QMouseEvent *){}
    9696    virtual void        mousePressEvent(QMouseEvent * event)
    9797    {
    98         /* Simulate double mouse click to select a word with a single click. */
     98        /* Simulate double mouse click to select a word with a single click: */
    9999        QLineEdit::mouseDoubleClickEvent(event);
    100100    }
     101
    101102    virtual void        mouseReleaseEvent(QMouseEvent *){}
    102103    virtual void paintEvent(QPaintEvent *event)
     
    105106        int clearButtonSize = height();
    106107        m_pClearAllButton->setGeometry(width() - clearButtonSize, 0, clearButtonSize, clearButtonSize);
     108        /* If we have a selected term move the m_pRemoveTermButton to the end of the
     109           or start of the word (depending on the location of the word within line edit itself: */
    107110        if (hasSelectedText())
    108111        {
     
    111114            int buttonSize = 16;
    112115            int charWidth = fontMetrics().width('x');
    113 
    114116            int buttonLeft = cursorRect().right() - 0.5 * charWidth;
    115 
     117            /* If buttonLeft is in far left of the line edit, move the
     118               button to left side of the selected word: */
    116119            if (buttonLeft + buttonSize  >=  width() - clearButtonSize)
    117120            {
     
    119122                buttonLeft -= (selectionWidth + buttonSize);
    120123            }
    121 
    122124            m_pRemoveTermButton->setGeometry(buttonLeft, buttonY, buttonSize, buttonSize);
    123125        }
     
    128130private slots:
    129131
    130     /* Nofifies the listeners that selected word (filter term) has been removed. */
     132    /* Nofifies the listeners that selected word (filter term) has been removed: */
    131133    void sltRemoveFilterTerm()
    132134    {
    133         if(!hasSelectedText())
     135        if (!hasSelectedText())
    134136            return;
    135137        emit sigFilterTermRemoved(selectedText());
     
    138140    }
    139141
    140     /* The whole content is removed. Listeners are notified. */
     142    /* The whole content is removed. Listeners are notified: */
    141143    void sltClearAll()
    142144    {
    143         if(text().isEmpty())
     145        /* Check if we have some text to avoid recursive calls: */
     146        if (text().isEmpty())
    144147            return;
    145148
     
    278281void UIVMLogViewerFilterPanel::sltAddFilterTerm()
    279282{
    280     if(!m_pFilterComboBox)
    281         return;
    282     if(m_pFilterComboBox->currentText().isEmpty())
     283    if (!m_pFilterComboBox)
     284        return;
     285    if (m_pFilterComboBox->currentText().isEmpty())
    283286        return;
    284287
     
    299302void UIVMLogViewerFilterPanel::sltClearFilterTerms()
    300303{
    301     if(m_filterTermList.empty())
     304    if (m_filterTermList.empty())
    302305        return;
    303306    m_filterTermList.clear();
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.h

    r70473 r70474  
    6868    /** Clear all the filter terms and reset the filtering. */
    6969    void sltClearFilterTerms();
     70    /** Executes the necessary code to handle filter's boolean operator change ('And', 'Or'). */
    7071    void sltOperatorButtonChanged(int buttonId);
    7172    void sltRemoveFilterTerm(const QString &termString);
    7273
    7374private:
     75
    7476    enum FilterOperatorButton{
    7577        AndButton = 0,
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.cpp

    r70185 r70474  
    222222{
    223223    /* Update snapshots pane is it is open: */
    224     if(isToolOpened(ToolTypeMachine_Snapshots))
     224    if (isToolOpened(ToolTypeMachine_Snapshots))
    225225    {
    226226        AssertPtrReturnVoid(m_pPaneSnapshots);
     
    228228    }
    229229    /* Update logviewer pane is it is open: */
    230     if(isToolOpened(ToolTypeMachine_LogViewer))
     230    if (isToolOpened(ToolTypeMachine_LogViewer))
    231231    {
    232232        AssertPtrReturnVoid(m_pPaneLogViewer);
     
    320320    }
    321321}
    322 
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.cpp

    r69500 r70474  
    128128
    129129    /* Details-pane: */
    130     if(m_pDetailsPane->isVisible())
     130    if (m_pDetailsPane->isVisible())
    131131    {
    132132        m_pDetailsPane->move(m_iLayoutMargin,
     
    537537    }
    538538}
    539 
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneDetails.cpp

    r69500 r70474  
    219219        int iNewHeight = m_iMaximumPaneHeight;
    220220        QTextDocument *pTextDocument = m_pTextEdit->document();
    221         if(pTextDocument)
     221        if (pTextDocument)
    222222        {
    223223            /* Adjust text-edit size: */
     
    255255    return font;
    256256}
    257 
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp

    r69500 r70474  
    342342            /* Search for existing status-bar child: */
    343343            if (QStatusBar *pStatusBar = pMainWindow->findChild<QStatusBar*>())
    344                 if(pStatusBar->isVisible())
     344                if (pStatusBar->isVisible())
    345345                    return pStatusBar->height();
    346346
     
    350350    return 0;
    351351}
    352 
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