VirtualBox

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


Ignore:
Timestamp:
Aug 22, 2023 5:19:28 PM (16 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10496, bugref:9072. Connecting panel actions to panel tabs.

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

Legend:

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

    r100943 r100946  
    523523void UIVMLogViewerWidget::sltPanelActionToggled(bool fChecked)
    524524{
    525     Q_UNUSED(fChecked);
     525    if (!m_pPanel)
     526        return;
     527    QAction *pAction = qobject_cast<QAction*>(sender());
     528
     529    if (!m_panelActions.contains(pAction))
     530        return;
     531
     532    foreach (QAction *pOther, m_panelActions)
     533    {
     534        if (pOther == pAction)
     535            continue;
     536        pOther->blockSignals(true);
     537        pOther->setChecked(false);
     538        pOther->blockSignals(false);
     539    }
     540
     541    m_pPanel->setVisible(fChecked);
     542    if (fChecked)
     543        m_pPanel->setCurrentIndex(pAction->data().toInt());
    526544}
    527545
     
    707725    addAction(m_pActionPool->action(UIActionIndex_M_Log_S_Refresh));
    708726    addAction(m_pActionPool->action(UIActionIndex_M_Log_S_Save));
     727
     728    m_panelActions.insert(m_pActionPool->action(UIActionIndex_M_Log_T_Find));
     729    m_panelActions.insert(m_pActionPool->action(UIActionIndex_M_Log_T_Filter));
     730    m_panelActions.insert(m_pActionPool->action(UIActionIndex_M_Log_T_Bookmark));
     731    m_panelActions.insert(m_pActionPool->action(UIActionIndex_M_Log_T_Preferences));
     732
     733    m_pActionPool->action(UIActionIndex_M_Log_T_Find)->setData((int)UIVMLogViewerPanelNew::Page_Search);
     734    m_pActionPool->action(UIActionIndex_M_Log_T_Filter)->setData((int)UIVMLogViewerPanelNew::Page_Filter);
     735    m_pActionPool->action(UIActionIndex_M_Log_T_Bookmark)->setData((int)UIVMLogViewerPanelNew::Page_Bookmark);
     736    m_pActionPool->action(UIActionIndex_M_Log_T_Preferences)->setData((int)UIVMLogViewerPanelNew::Page_Preferences);
    709737
    710738    /* Connect actions: */
     
    751779    connect(m_pTabWidget, &QITabWidget::currentChanged, this, &UIVMLogViewerWidget::sltCurrentTabChanged);
    752780
    753     /* Create VM Log-Viewer options-panel: */
    754     // m_pOptionsPanel = new UIVMLogViewerOptionsPanel(0, this);
    755     // AssertReturnVoid(m_pOptionsPanel);
    756     // /* Configure panel: */
    757     // m_pOptionsPanel->hide();
    758 
    759     // m_pMainLayout->addWidget(m_pOptionsPanel);
    760 
    761781    m_pPanel = new UIVMLogViewerPanelNew(0, this);
    762782    AssertReturnVoid(m_pPanel);
     
    766786    m_pPanel->setWrapLines(m_bWrapLines);
    767787    m_pPanel->setFontSizeInPoints(m_font.pointSize());
    768     // connect(m_pPanel, &UIVMLogViewerPanelNew::sigShowLineNumbers, this, &UIVMLogViewerWidget::sltShowLineNumbers);
    769     // connect(m_pPanel, &UIVMLogViewerPanelNew::sigWrapLines, this, &UIVMLogViewerWidget::sltWrapLines);
    770     // connect(m_pPanel, &UIVMLogViewerPanelNew::sigChangeFontSizeInPoints, this, &UIVMLogViewerWidget::sltFontSizeChanged);
    771     // connect(m_pPanel, &UIVMLogViewerPanelNew::sigChangeFont, this, &UIVMLogViewerWidget::sltChangeFont);
    772     // connect(m_pPanel, &UIVMLogViewerPanelNew::sigResetToDefaults, this, &UIVMLogViewerWidget::sltResetOptionsToDefault);
    773 
     788    m_pPanel->setVisible(false);
    774789    connect(m_pPanel, &UIVMLogViewerPanelNew::sigHighlightingUpdated,
    775790            this, &UIVMLogViewerWidget::sltSearchResultHighLigting);
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r100936 r100946  
    3636#include <QPair>
    3737#include <QPointer>
     38#include <QSet>
    3839#include <QWidget>
    3940#include <QUuid>
     
    250251    QPointer<UIVMLogPage> m_pPreviousLogPage;
    251252    UIVMLogViewerPanelNew *m_pPanel;
    252 
     253    QSet<QAction*> m_panelActions;
    253254    friend class UIVMLogViewerFilterWidget;
    254255    friend class UIVMLogViewerPanel;
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