VirtualBox

Changeset 76961 in vbox


Ignore:
Timestamp:
Jan 24, 2019 8:28:35 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9072. Some corrections and cleanups

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

Legend:

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

    r76606 r76961  
    197197    if (noLogsToShow)
    198198    {
    199         for (QMap<UIVMLogViewerPanel*, QAction*>::iterator iterator = m_panelActionMap.begin();
     199        for (QMap<UIDialogPanel*, QAction*>::iterator iterator = m_panelActionMap.begin();
    200200            iterator != m_panelActionMap.end(); ++iterator)
    201201        {
     
    284284    if (!pSenderAction)
    285285        return;
    286     UIVMLogViewerPanel* pPanel = 0;
     286    UIDialogPanel* pPanel = 0;
    287287    /* Look for the sender() within the m_panelActionMap's values: */
    288     for (QMap<UIVMLogViewerPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin();
     288    for (QMap<UIDialogPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin();
    289289        iterator != m_panelActionMap.end(); ++iterator)
    290290    {
     
    338338    if (m_pBookmarksPanel)
    339339        m_pBookmarksPanel->disableEnableBookmarking(!isFiltered);
     340}
     341
     342void UIVMLogViewerWidget::sltHandleHidePanel(UIDialogPanel *pPanel)
     343{
     344    hidePanel(pPanel);
    340345}
    341346
     
    489494            connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHighlightingUpdated,
    490495                    this, &UIVMLogViewerWidget::sltSearchResultHighLigting);
     496            connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHidePanel,
     497                    this, &UIVMLogViewerWidget::sltHandleHidePanel);
    491498            m_panelActionMap.insert(m_pSearchPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Find));
    492499
     
    504511            connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigFilterApplied,
    505512                    this, &UIVMLogViewerWidget::sltFilterApplied);
     513            connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigHidePanel,
     514                    this, &UIVMLogViewerWidget::sltHandleHidePanel);
    506515            m_panelActionMap.insert(m_pFilterPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Filter));
    507516
     
    523532                    this, &UIVMLogViewerWidget::gotoBookmark);
    524533            m_panelActionMap.insert(m_pBookmarksPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Bookmark));
     534            connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigHidePanel,
     535                    this, &UIVMLogViewerWidget::sltHandleHidePanel);
    525536
    526537            /* Add into layout: */
     
    542553            connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigChangeFont, this, &UIVMLogViewerWidget::sltChangeFont);
    543554            connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigResetToDefaults, this, &UIVMLogViewerWidget::sltResetOptionsToDefault);
     555            connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigHidePanel, this, &UIVMLogViewerWidget::sltHandleHidePanel);
     556
    544557            m_panelActionMap.insert(m_pOptionsPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Options));
    545558
     
    805818}
    806819
    807 void UIVMLogViewerWidget::hidePanel(UIVMLogViewerPanel* panel)
    808 {
    809     if (panel && panel->isVisible())
     820void UIVMLogViewerWidget::hidePanel(UIDialogPanel* panel)
     821{
     822    if (!panel)
     823        return;
     824    if (panel->isVisible())
    810825        panel->setVisible(false);
    811     QMap<UIVMLogViewerPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
     826    QMap<UIDialogPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
    812827    if (iterator != m_panelActionMap.end())
    813828    {
     
    819834}
    820835
    821 void UIVMLogViewerWidget::showPanel(UIVMLogViewerPanel* panel)
     836void UIVMLogViewerWidget::showPanel(UIDialogPanel* panel)
    822837{
    823838    if (panel && panel->isHidden())
    824839        panel->setVisible(true);
    825     QMap<UIVMLogViewerPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
     840    QMap<UIDialogPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
    826841    if (iterator != m_panelActionMap.end())
    827842    {
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r76581 r76961  
    4141class QVBoxLayout;
    4242class UIActionPool;
     43class UIDialogPanel;
    4344class UIToolBar;
    4445class UIVMLogPage;
     
    121122       of UIVMLogPage is changed. */
    122123    void sltLogPageFilteredChanged(bool isFiltered);
     124    void sltHandleHidePanel(UIDialogPanel *pPanel);
    123125
    124126    /** @name Slots to handle signals from settings panel
     
    178180    void resetHighlighthing();
    179181
    180     void hidePanel(UIVMLogViewerPanel* panel);
    181     void showPanel(UIVMLogViewerPanel* panel);
     182    void hidePanel(UIDialogPanel* panel);
     183    void showPanel(UIDialogPanel* panel);
    182184
    183185    /** Make sure escape key is assigned to only a single widget. This is done by checking
     
    211213        UIVMLogViewerFilterPanel    *m_pFilterPanel;
    212214        UIVMLogViewerBookmarksPanel *m_pBookmarksPanel;
    213         UIVMLogViewerOptionsPanel  *m_pOptionsPanel;
    214         QMap<UIVMLogViewerPanel*, QAction*> m_panelActionMap;
    215         QList<UIVMLogViewerPanel*>          m_visiblePanelsList;
     215        UIVMLogViewerOptionsPanel   *m_pOptionsPanel;
     216        QMap<UIDialogPanel*, QAction*> m_panelActionMap;
     217        QList<UIDialogPanel*>          m_visiblePanelsList;
    216218    /** @} */
    217219    QVBoxLayout         *m_pMainLayout;
     
    230232        QFont m_font;
    231233    /** @} */
    232     friend class UIVMLogViewerBookmarksPanel;
    233234    friend class UIVMLogViewerFilterPanel;
    234     friend class UIVMLogViewerSearchPanel;
    235     friend class UIVMLogViewerOptionsPanel;
    236235    friend class UIVMLogViewerPanel;
    237236    friend class UIVMLogViewerDialog;
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