VirtualBox

Changeset 89594 in vbox


Ignore:
Timestamp:
Jun 10, 2021 10:19:23 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9930. Some connection stuff

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

Legend:

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

    r89586 r89594  
    6060const ULONG uAllowedLogSize = _256M;
    6161
    62 class UILabelTab : public UIVMLogPage
     62class UILabelTab : public UIVMLogTab
    6363{
    6464
     
    6868
    6969    UILabelTab(QWidget *pParent, const QUuid &uMachineId, const QString &strMachineName)
    70         : UIVMLogPage(pParent, uMachineId, strMachineName)
    71     {
    72     }
     70        : UIVMLogTab(pParent, uMachineId, strMachineName)
     71    {
     72    }
     73
     74protected:
     75    void retranslateUi(){}
    7376};
    7477
     
    603606    if (m_pTabWidget && m_pTabWidget->tabBar())
    604607    {
     608        int iIndex = m_pTabWidget->tabBar()->tabAt(pos);
     609        if (iIndex == -1)
     610            return;
     611        UIVMLogTab *pTab = qobject_cast<UIVMLogTab*>(m_pTabWidget->widget(iIndex));
     612        if (!pTab)
     613            return;
    605614        QMenu menu;
    606         menu.addAction(tr("Close Other Tabs"));
     615
     616        QAction *pCloseAction = menu.addAction(QString("%1 %2").arg(tr("Close Logs of")).arg(pTab->machineName()));
     617        pCloseAction->setData(pTab->machineId());
     618        connect(pCloseAction, &QAction::triggered, this, &UIVMLogViewerWidget::sltCloseMachineLogs);
    607619        menu.exec(m_pTabWidget->tabBar()->mapToGlobal(pos));
    608620    }
     621}
     622
     623void UIVMLogViewerWidget::sltCloseMachineLogs()
     624{
     625    QAction *pAction = qobject_cast<QAction*>(sender());
     626    if (!pAction)
     627        return;
     628    QUuid machineId = pAction->data().toUuid();
     629    if (machineId.isNull())
     630        return;
     631
    609632}
    610633
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r89586 r89594  
    142142    /** @} */
    143143    void sltShowTabBarContextMenu(const QPoint &pos);
     144    void sltCloseMachineLogs();
    144145
    145146private:
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