VirtualBox

Changeset 89605 in vbox


Ignore:
Timestamp:
Jun 10, 2021 2:39:35 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9930. Adding the clse button to label tab

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

Legend:

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

    r89599 r89605  
    6060const ULONG uAllowedLogSize = _256M;
    6161
     62class UILogTabCloseButton : public QIToolButton
     63{
     64    Q_OBJECT;
     65
     66public:
     67
     68    //UILogTabCloseButton(QWidget *pParent, const QUuid &uMachineId, const QString &strMachineName);
     69    UILogTabCloseButton(QWidget *pParent = 0)
     70        : QIToolButton(pParent)
     71    {
     72        setAutoRaise(true);
     73        setIcon(UIIconPool::iconSet(":/close_16px.png"));
     74    }
     75
     76protected:
     77
     78};
     79/*********************************************************************************************************************************
     80*   UILabelTab definition.                                                                                        *
     81*********************************************************************************************************************************/
     82
    6283class UILabelTab : public UIVMLogTab
    6384{
     
    6788public:
    6889
    69     UILabelTab(QWidget *pParent, const QUuid &uMachineId, const QString &strMachineName)
    70         : UIVMLogTab(pParent, uMachineId, strMachineName)
    71     {
    72     }
     90    UILabelTab(QWidget *pParent, const QUuid &uMachineId, const QString &strMachineName);
    7391
    7492protected:
    75     void retranslateUi(){}
     93
     94    void retranslateUi();
    7695};
    7796
     
    108127    UITabWidget(QWidget *pParent = 0);
    109128};
     129
     130/*********************************************************************************************************************************
     131*   UILabelTab implementation.                                                                                        *
     132*********************************************************************************************************************************/
     133
     134UILabelTab::UILabelTab(QWidget *pParent, const QUuid &uMachineId, const QString &strMachineName)
     135    : UIVMLogTab(pParent, uMachineId, strMachineName)
     136{
     137}
     138
     139void UILabelTab::retranslateUi()
     140{
     141}
    110142
    111143/*********************************************************************************************************************************
     
    271303    {
    272304        if (qobject_cast<UILabelTab*>(m_pTabWidget->widget(i)))
     305        {
    273306            pTabBar->setTabData(i, true);
     307            UILogTabCloseButton *pCloseButton = new UILogTabCloseButton;
     308            pCloseButton->setIcon(UIIconPool::iconSet(":/close_16px.png"));
     309
     310            pTabBar->setTabButton(i, QTabBar::RightSide, pCloseButton);
     311            connect(pCloseButton, &UILogTabCloseButton::clicked, this, &UIVMLogViewerWidget::sltTabCloseButtonClick);
     312        }
    274313        else
     314        {
    275315            pTabBar->setTabData(i, false);
     316        }
     317
    276318    }
    277319}
     
    630672    machineList << machineId;
    631673    removeLogViewerPages(machineList);
     674}
     675
     676void UIVMLogViewerWidget::sltTabCloseButtonClick()
     677{
     678    printf("UIVMLogViewerWidget::sltTabCloseButtonClick\n");
    632679}
    633680
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r89599 r89605  
    144144    void sltShowTabBarContextMenu(const QPoint &pos);
    145145    void sltCloseMachineLogs();
     146    void sltTabCloseButtonClick();
    146147
    147148private:
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