VirtualBox

Changeset 71370 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 16, 2018 3:20:58 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9072: Adding new icons to logviewer panels + some improvements

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc

    r70055 r71370  
    11<RCC>
    2     <qresource prefix="/">
     2    <qresource suffix="/">
    33        <file alias="add_host_iface_16px.png">images/add_host_iface_16px.png</file>
    44        <file alias="add_host_iface_22px.png">images/add_host_iface_22px.png</file>
     
    230230        <file alias="log_viewer_bookmark_24px.png">images/log_viewer_bookmark_24px.png</file>
    231231        <file alias="log_viewer_bookmark_disabled_24px.png">images/log_viewer_bookmark_disabled_24px.png</file>
     232        <file alias="log_viewer_bookmark_off_16px.png">images/log_viewer_bookmark_off_16px.png</file>
     233        <file alias="log_viewer_bookmark_on_16px.png">images/log_viewer_bookmark_on_16px.png</file>
     234        <file alias="log_viewer_delete_all_bookmarks_16px.png">images/log_viewer_delete_all_bookmarks_16px.png</file>
     235        <file alias="log_viewer_delete_current_bookmark_16px.png">images/log_viewer_delete_current_bookmark_16px.png</file>
    232236        <file alias="log_viewer_filter_24px.png">images/log_viewer_filter_24px.png</file>
     237        <file alias="log_viewer_filter_add_16px.png">images/log_viewer_filter_add_16px.png</file>
    233238        <file alias="log_viewer_filter_disabled_24px.png">images/log_viewer_filter_disabled_24px.png</file>
    234239        <file alias="log_viewer_find_24px.png">images/log_viewer_find_24px.png</file>
    235240        <file alias="log_viewer_find_disabled_24px.png">images/log_viewer_find_disabled_24px.png</file>
     241        <file alias="log_viewer_goto_next_bookmark_16px.png">images/log_viewer_goto_next_bookmark_16px.png</file>
     242        <file alias="log_viewer_goto_previous_bookmark_16px.png">images/log_viewer_goto_previous_bookmark_16px.png</file>
     243        <file alias="log_viewer_goto_selected_bookmark_16px.png">images/log_viewer_goto_selected_bookmark_16px.png</file>
    236244        <file alias="log_viewer_refresh_24px.png">images/log_viewer_refresh_24px.png</file>
    237245        <file alias="log_viewer_refresh_disabled_24px.png">images/log_viewer_refresh_disabled_24px.png</file>
    238246        <file alias="log_viewer_save_24px.png">images/log_viewer_save_24px.png</file>
    239247        <file alias="log_viewer_save_disabled_24px.png">images/log_viewer_save_disabled_24px.png</file>
     248        <file alias="log_viewer_search_backward_16px.png">images/log_viewer_search_backward_16px.png</file>
     249        <file alias="log_viewer_search_forward_16px.png">images/log_viewer_search_forward_16px.png</file>
     250        <file alias="log_viewer_settings_16px.png">images/log_viewer_settings_16px.png</file>
     251        <file alias="log_viewer_settings_22px.png">images/log_viewer_settings_22px.png</file>
     252        <file alias="log_viewer_settings_disabled_16px.png">images/log_viewer_settings_disabled_16px.png</file>
     253        <file alias="log_viewer_settings_disabled_22px.png">images/log_viewer_settings_disabled_22px.png</file>
    240254        <file alias="machine_16px.png">images/machine_16px.png</file>
    241255        <file alias="machine_24px.png">images/machine_24px.png</file>
     
    306320        <file alias="os_netbsd.png">images/os_netbsd.png</file>
    307321        <file alias="os_netware.png">images/os_netware.png</file>
    308         <file alias="os_openbsd_64.png">images/os_openbsd_64.png</file>
    309         <file alias="os_openbsd.png">images/os_openbsd.png</file>
    310         <file alias="os_opensuse_64.png">images/os_opensuse_64.png</file>
    311         <file alias="os_opensuse.png">images/os_opensuse.png</file>
    312         <file alias="os_oracle_64.png">images/os_oracle_64.png</file>
    313         <file alias="os_oracle.png">images/os_oracle.png</file>
    314         <file alias="os_oraclesolaris_64.png">images/os_oraclesolaris_64.png</file>
    315322    </qresource>
    316323</RCC>
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox2.qrc

    r70055 r71370  
    11<RCC>
    2     <qresource prefix="/">
     2    <qresource suffix="/">
     3        <file alias="os_openbsd_64.png">images/os_openbsd_64.png</file>
     4        <file alias="os_openbsd.png">images/os_openbsd.png</file>
     5        <file alias="os_opensuse_64.png">images/os_opensuse_64.png</file>
     6        <file alias="os_opensuse.png">images/os_opensuse.png</file>
     7        <file alias="os_oracle_64.png">images/os_oracle_64.png</file>
     8        <file alias="os_oracle.png">images/os_oracle.png</file>
     9        <file alias="os_oraclesolaris_64.png">images/os_oraclesolaris_64.png</file>
    310        <file alias="os_oraclesolaris.png">images/os_oraclesolaris.png</file>
    411        <file alias="os_os2ecs.png">images/os_os2ecs.png</file>
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp

    r71355 r71370  
    116116    {
    117117        mainLayout()->addWidget(m_pGotoSelectedBookmark, 0);
    118         m_pGotoSelectedBookmark->setIcon(UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
     118        m_pGotoSelectedBookmark->setIcon(UIIconPool::iconSet(":/log_viewer_goto_selected_bookmark_16px.png"));
    119119    }
    120120
     
    138138    {
    139139        pContainerLayout->addWidget(m_pPreviousButton);
    140         m_pPreviousButton->setIcon(UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowBack, this));
     140        m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_goto_previous_bookmark_16px.png"));
    141141    }
    142142
     
    144144    if (m_pNextButton){
    145145        pContainerLayout->addWidget(m_pNextButton);
    146         m_pNextButton->setIcon(UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
     146        m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_goto_next_bookmark_16px.png"));
    147147    }
    148148    }
     
    152152    {
    153153        mainLayout()->addWidget(m_pDeleteCurrentButton, 0);
    154         m_pDeleteCurrentButton->setIcon(m_pDeleteCurrentButton->style()->standardIcon(QStyle::SP_TitleBarCloseButton));
     154        m_pDeleteCurrentButton->setIcon(UIIconPool::iconSet(":/log_viewer_delete_current_bookmark_16px.png"));
    155155    }
    156156
     
    159159    {
    160160        mainLayout()->addWidget(m_pDeleteAllButton, 2);
     161        m_pDeleteAllButton->setIcon(UIIconPool::iconSet(":/log_viewer_delete_all_bookmarks_16px.png"));
    161162    }
    162163
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp

    r70745 r71370  
    6565        :QLineEdit(parent)
    6666        , m_pRemoveTermButton(0)
     67        , m_iRemoveTermButtonSize(16)
     68        , m_iTrailingSpaceCount(1)
    6769    {
    6870        setReadOnly(true);
    6971        home(false);
    7072        createButtons();
     73       /** Try to guess the width of the space between filter terms so that remove button
     74                we display when a term is selected does not hide the next/previous word: */
     75        int spaceWidth = fontMetrics().width(' ');
     76        if (spaceWidth != 0)
     77            m_iTrailingSpaceCount = (m_iRemoveTermButtonSize / spaceWidth) + 1;
    7178    }
    7279
     
    7885        {
    7986            QString newString(filterTermString);
    80             insert(newString.prepend(' '));
     87            QString space(m_iTrailingSpaceCount, QChar(' '));
     88            insert(newString.prepend(space));
    8189        }
    8290    }
     
    112120            m_pRemoveTermButton->show();
    113121            int buttonY = 0.5 * (height() - 16);
    114             int buttonSize = 16;
     122            int buttonSize = m_iRemoveTermButtonSize;
    115123            int charWidth = fontMetrics().width('x');
    116124            int buttonLeft = cursorRect().right() - 0.5 * charWidth;
     
    137145        emit sigFilterTermRemoved(selectedText());
    138146        /* Remove the string from text() including the trailing space: */
    139         setText(text().remove(selectionStart(), selectedText().length()+1));
     147        setText(text().remove(selectionStart(), selectedText().length() + m_iTrailingSpaceCount));
    140148    }
    141149
     
    173181    QToolButton *m_pRemoveTermButton;
    174182    QToolButton *m_pClearAllButton;
     183    const int    m_iRemoveTermButtonSize;
     184    int          m_iTrailingSpaceCount;
    175185};
    176186
     
    372382    if (m_pAddFilterTermButton)
    373383    {
    374         m_pAddFilterTermButton->setIcon(UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
     384        m_pAddFilterTermButton->setIcon(UIIconPool::iconSet(":/log_viewer_filter_add_16px.png"));
    375385        mainLayout()->addWidget(m_pAddFilterTermButton,0);
    376386    }
     
    484494    UIVMLogViewerPanel::retranslateUi();
    485495    m_pFilterComboBox->setToolTip(UIVMLogViewerWidget::tr("Enter filtering string here."));
    486     m_pAddFilterTermButton->setToolTip(UIVMLogViewerWidget::tr("Add filter term. (Enter"));
     496    m_pAddFilterTermButton->setToolTip(UIVMLogViewerWidget::tr("Add filter term. (Enter)"));
    487497    m_pResultLabel->setText(UIVMLogViewerWidget::tr("Showing %1/%2").arg(m_iFilteredLineCount).arg(m_iUnfilteredLineCount));
    488498    m_pFilterTermsLineEdit->setToolTip(UIVMLogViewerWidget::tr("The filter terms list. Select one to remove or click the button on the right side to remove them all."));
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp

    r70750 r71370  
    8888    if (m_pCloseButton)
    8989    {
    90         m_pCloseButton->setIcon(m_pCloseButton->style()->standardIcon(QStyle::SP_TitleBarCloseButton));
     90        //m_pCloseButton->setIcon(UIIconPool::iconSet(":/log_viewer_close_16px.png"));
     91        m_pCloseButton->setIcon(UIIconPool::iconSet(":/close_16px.png"));
    9192        m_pMainLayout->addWidget(m_pCloseButton, 0, Qt::AlignLeft);
    9293    }
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp

    r70745 r71370  
    255255       {
    256256           pContainerLayout->addWidget(m_pPreviousButton);
    257            m_pPreviousButton->setIcon(UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowBack, this));
     257           m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_backward_16px.png"));
    258258       }
    259259
     
    261261       if (m_pNextButton){
    262262           pContainerLayout->addWidget(m_pNextButton);
    263            m_pNextButton->setIcon(UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
     263           m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_forward_16px.png"));
    264264       }
    265265    }
     
    360360
    361361    if (m_pNextButton)
    362         m_pNextButton->setToolTip(UIVMLogViewerWidget::tr("Search for the previous occurrence of the string (F3)"));
     362        m_pNextButton->setToolTip(UIVMLogViewerWidget::tr("Search for the next occurrence of the string (F3)"));
    363363
    364364    if (m_pPreviousButton)
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp

    r71050 r71370  
    3232
    3333/* GUI includes: */
     34# include "UIIconPool.h"
    3435# include "UIVMLogViewerTextEdit.h"
    3536# include "UIVMLogViewerWidget.h"
     
    9091    {
    9192        QScrollBar::paintEvent(pEvent);
    92         /* Put a red line to marking position: */
     93        /* Put a red line to mark the bookmark positions: */
    9394        for (int i = 0; i < m_markingsVector.size(); ++i)
    9495        {
     
    160161    , m_bShowLineNumbers(true)
    161162    , m_bWrapLines(false)
     163    , m_bHasContextMenu(false)
    162164{
    163165    setMouseTracking(true);
     
    245247                painter.drawPath(path);
    246248            }
    247             if ((blockNumber + 1) == m_mouseCursorLine && underMouse())
     249            /* Draw a unfilled red rectangled around the line number to indicate line the mouse cursor is currently
     250               hovering on. Do this only if mouse is over the ext edit or the context menu is around: */
     251            if ((blockNumber + 1) == m_mouseCursorLine && (underMouse() || m_bHasContextMenu))
    248252            {
    249253                painter.setPen(Qt::red);
     
    317321        return;
    318322    }
    319 
     323    m_bHasContextMenu = true;
    320324    QMenu *menu = createStandardContextMenu();
     325
     326
    321327    QAction *pAction = menu->addAction(UIVMLogViewerWidget::tr("Bookmark"));
    322     m_iContextMenuBookmark = bookmarkForPos(pEvent->pos());
    323328    if (pAction)
     329    {
     330        pAction->setCheckable(true);
     331        QPair<int, QString> menuBookmark = bookmarkForPos(pEvent->pos());
     332        pAction->setChecked(m_bookmarkLineSet.contains(menuBookmark.first));
     333        if (pAction->isChecked())
     334            pAction->setIcon(UIIconPool::iconSet(":/log_viewer_bookmark_on_16px.png"));
     335        else
     336            pAction->setIcon(UIIconPool::iconSet(":/log_viewer_bookmark_off_16px.png"));
     337
     338        m_iContextMenuBookmark = menuBookmark;
    324339        connect(pAction, &QAction::triggered, this, &UIVMLogViewerTextEdit::sltBookmark);
    325340
     341    }
    326342    menu->exec(pEvent->globalPos());
    327343
     
    330346
    331347    delete menu;
     348    m_bHasContextMenu = false;
    332349}
    333350
     
    376393void UIVMLogViewerTextEdit::sltBookmark()
    377394{
    378     emit sigAddBookmark(m_iContextMenuBookmark);
     395    toggleBookmark(m_iContextMenuBookmark);
    379396}
    380397
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.h

    r70792 r71370  
    109109    QString              m_strBackgroungText;
    110110    friend class UILineNumberArea;
     111    bool                 m_bHasContextMenu;
    111112};
    112113
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r71355 r71370  
    525525        m_pActionFind->setIcon(UIIconPool::iconSet(QString(":/%1_find_24px.png").arg(strPrefix),
    526526                                                       QString(":/%1_find_disabled_24px.png").arg(strPrefix)));
    527 
    528527    if (m_pActionFilter)
    529528        m_pActionFilter->setIcon(UIIconPool::iconSet(QString(":/%1_filter_24px.png").arg(strPrefix),
    530529                                                         QString(":/%1_filter_disabled_24px.png").arg(strPrefix)));
    531 
    532 
    533530    if (m_pActionRefresh)
    534531        m_pActionRefresh->setIcon(UIIconPool::iconSet(QString(":/%1_refresh_24px.png").arg(strPrefix),
    535532                                                          QString(":/%1_refresh_disabled_24px.png").arg(strPrefix)));
    536 
    537 
    538533    if (m_pActionSave)
    539534        m_pActionSave->setIcon(UIIconPool::iconSet(QString(":/%1_save_24px.png").arg(strPrefix),
    540535                                                       QString(":/%1_save_disabled_24px.png").arg(strPrefix)));
    541 
    542536    if (m_pActionBookmarks)
    543537        m_pActionBookmarks->setIcon(UIIconPool::iconSet(QString(":/%1_bookmark_24px.png").arg(strPrefix),
    544538                                                       QString(":/%1_bookmark_disabled_24px.png").arg(strPrefix)));
    545 
    546539    if (m_pActionSettings)
    547         m_pActionSettings->setIcon(UIIconPool::iconSet(QString(":/%1_bookmark_24px.png").arg(strPrefix),
    548                                                        QString(":/%1_bookmark_disabled_24px.png").arg(strPrefix)));
     540        m_pActionSettings->setIcon(UIIconPool::iconSet(QString(":/%1_settings_22px.png").arg(strPrefix),
     541                                                       QString(":/%1_settings_disabled_22px.png").arg(strPrefix)));
    549542}
    550543
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