VirtualBox

Changeset 100915 in vbox for trunk


Ignore:
Timestamp:
Aug 21, 2023 5:17:31 AM (20 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158852
Message:

FE/Qt: bugref:10496, bugref:9072. Moving log viewer's search panel. First part.

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

Legend:

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

    r98844 r100915  
    5151    , m_pPreviousButton(0)
    5252{
    53     prepare();
     53    prepareWidgets();
     54    prepareConnections();
    5455}
    5556
     
    9192}
    9293
    93 QString UIVMLogViewerBookmarksPanel::panelName() const
    94 {
    95     return "BookmarksPanel";
    96 }
    97 
    9894void UIVMLogViewerBookmarksPanel::setBookmarkIndex(int index)
    9995{
     
    112108void UIVMLogViewerBookmarksPanel::prepareWidgets()
    113109{
    114     if (!mainLayout())
    115         return;
     110    QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    116111
    117112    /* Create bookmark combo/button layout: */
     
    196191        }
    197192
    198         mainLayout()->addLayout(pComboButtonLayout);
     193        pMainLayout->addLayout(pComboButtonLayout);
    199194    }
    200195}
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h

    r98103 r100915  
    6060    /** Disable/enable all the widget except the close button */
    6161    void disableEnableBookmarking(bool flag);
    62     virtual QString panelName() const RT_OVERRIDE;
    6362
    6463signals:
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp

    r100108 r100915  
    272272    , m_iUnfilteredLineCount(0)
    273273    , m_iFilteredLineCount(0)
    274 {
    275     prepare();
    276 }
    277 
    278 QString UIVMLogViewerFilterPanel::panelName() const
    279 {
    280     return "FilterPanel";
     274    , m_pMainLayout(0)
     275{
     276    prepareWidgets();
     277    prepareConnections();
    281278}
    282279
     
    434431void UIVMLogViewerFilterPanel::prepareWidgets()
    435432{
    436     if (!mainLayout())
    437         return;
     433    m_pMainLayout = new QHBoxLayout;
     434    AssertReturnVoid(m_pMainLayout);
    438435
    439436    prepareRadioButtonGroup();
     
    472469        }
    473470
    474         mainLayout()->addLayout(pComboButtonLayout, 1);
     471        m_pMainLayout->addLayout(pComboButtonLayout, 1);
    475472    }
    476473
     
    480477    {
    481478        m_pFilterTermsLineEdit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    482         mainLayout()->addWidget(m_pFilterTermsLineEdit, 3);
     479        m_pMainLayout->addWidget(m_pFilterTermsLineEdit, 3);
    483480    }
    484481
     
    488485    {
    489486        m_pResultLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    490         mainLayout()->addWidget(m_pResultLabel, 0);
     487        m_pMainLayout->addWidget(m_pResultLabel, 0);
    491488    }
    492489}
     
    548545
    549546        /* Add into layout: */
    550         mainLayout()->addWidget(m_pRadioButtonContainer);
     547        m_pMainLayout->addWidget(m_pRadioButtonContainer);
    551548    }
    552549
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.h

    r98103 r100915  
    6565      * @param  pViewer  Specifies reference to the VM Log-Viewer this filter-panel belongs to. */
    6666    UIVMLogViewerFilterPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer);
    67     virtual QString panelName() const RT_OVERRIDE;
    6867
    6968public slots:
     
    121120    int                  m_iUnfilteredLineCount;
    122121    int                  m_iFilteredLineCount;
     122    QHBoxLayout         *m_pMainLayout;
    123123};
    124124
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerOptionsPanel.cpp

    r98844 r100915  
    5151    , m_iDefaultFontSize(9)
    5252{
    53     prepare();
     53    prepareWidgets();
     54    prepareConnections();
    5455}
    5556
     
    8182}
    8283
    83 QString UIVMLogViewerOptionsPanel::panelName() const
    84 {
    85     return "OptionsPanel";
    86 }
    87 
    8884void UIVMLogViewerOptionsPanel::prepareWidgets()
    8985{
    90     if (!mainLayout())
    91         return;
     86    QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    9287
    9388    /* Create line-number check-box: */
     
    9691    {
    9792        m_pLineNumberCheckBox->setChecked(true);
    98         mainLayout()->addWidget(m_pLineNumberCheckBox, 0, Qt::AlignLeft);
     93        pMainLayout->addWidget(m_pLineNumberCheckBox, 0, Qt::AlignLeft);
    9994    }
    10095
     
    10499    {
    105100        m_pWrapLinesCheckBox->setChecked(false);
    106         mainLayout()->addWidget(m_pWrapLinesCheckBox, 0, Qt::AlignLeft);
     101        pMainLayout->addWidget(m_pWrapLinesCheckBox, 0, Qt::AlignLeft);
    107102    }
    108103
     
    111106    if (m_pFontSizeSpinBox)
    112107    {
    113         mainLayout()->addWidget(m_pFontSizeSpinBox, 0, Qt::AlignLeft);
     108        pMainLayout->addWidget(m_pFontSizeSpinBox, 0, Qt::AlignLeft);
    114109        m_pFontSizeSpinBox->setValue(m_iDefaultFontSize);
    115110        m_pFontSizeSpinBox->setMaximum(44);
     
    121116    if (m_pFontSizeLabel)
    122117    {
    123         mainLayout()->addWidget(m_pFontSizeLabel, 0, Qt::AlignLeft);
     118        pMainLayout->addWidget(m_pFontSizeLabel, 0, Qt::AlignLeft);
    124119        if (m_pFontSizeSpinBox)
    125120            m_pFontSizeLabel->setBuddy(m_pFontSizeSpinBox);
     
    149144        }
    150145
    151         mainLayout()->addLayout(pButtonLayout);
     146        pMainLayout->addLayout(pButtonLayout);
    152147    }
    153148
    154     mainLayout()->addStretch(2);
     149    pMainLayout->addStretch(2);
    155150}
    156151
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerOptionsPanel.h

    r98103 r100915  
    6262    void setWrapLines(bool bWrapLines);
    6363    void setFontSizeInPoints(int fontSizeInPoints);
    64     virtual QString panelName() const RT_OVERRIDE;
    6564
    6665public slots:
     
    6968protected:
    7069
    71     virtual void prepareWidgets() RT_OVERRIDE;
    72     virtual void prepareConnections() RT_OVERRIDE;
     70    virtual void prepareWidgets();
     71    virtual void prepareConnections();
    7372
    7473    /** Handles the translation event. */
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp

    r98844 r100915  
    2929#include <QHBoxLayout>
    3030#include <QPlainTextEdit>
     31#include <QPushButton>
    3132
    3233/* GUI includes: */
     
    3536#include "UIVMLogViewerPanel.h"
    3637#include "UIVMLogViewerWidget.h"
     38#include "UIVMLogViewerSearchPanel.h"
    3739#ifdef VBOX_WS_MAC
    3840# include "VBoxUtils-darwin.h"
    3941#endif
    4042
     43UIVMLogViewerPanelNew::UIVMLogViewerPanelNew(QWidget *pParent, UIVMLogViewerWidget *pViewer)
     44    : QIWithRetranslateUI<UIDialogPanelBase>(pParent)
     45    , m_pSearchWidget(0)
     46    , m_pViewer(pViewer)
     47{
     48    prepare();
     49}
     50
     51void UIVMLogViewerPanelNew::prepare()
     52{
     53    prepareSearchTab();
     54    retranslateUi();
     55}
     56
     57void UIVMLogViewerPanelNew::prepareSearchTab()
     58{
     59    //insertTab(0, new QPushButton("asdasda"));
     60    m_pSearchWidget = new UIVMLogViewerSearchPanel(0, m_pViewer);
     61    insertTab(0, m_pSearchWidget);
     62}
     63
     64void UIVMLogViewerPanelNew::retranslateUi()
     65{
     66    setTabText(0, "Find");
     67}
     68
     69
     70/*********************************************************************************************************************************
     71*   UIVMLogViewerPanel implementation.                                                                                           *
     72*********************************************************************************************************************************/
    4173
    4274UIVMLogViewerPanel::UIVMLogViewerPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer)
    43     : UIDialogPanel(pParent)
     75    : QIWithRetranslateUI<QWidget>(pParent)
    4476    , m_pViewer(pViewer)
    4577{
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.h

    r98844 r100915  
    3939class QTextDocument;
    4040class UIVMLogViewerWidget;
     41class UIVMLogViewerSearchPanel;
    4142
     43class UIVMLogViewerPanelNew : public QIWithRetranslateUI<UIDialogPanelBase>
     44{
     45    Q_OBJECT;
     46
     47public:
     48
     49    UIVMLogViewerPanelNew(QWidget *pParent, UIVMLogViewerWidget *pViewer);
     50
     51private:
     52
     53    void retranslateUi() override;
     54    void prepare();
     55    void prepareSearchTab();
     56
     57    UIVMLogViewerSearchPanel *m_pSearchWidget;
     58    UIVMLogViewerWidget *m_pViewer;
     59
     60};
    4261
    4362/** UIDialonPanel extension acting as the base class for UIVMLogViewerXXXPanel widgets. */
    44 class UIVMLogViewerPanel : public UIDialogPanel
     63class UIVMLogViewerPanel : public QIWithRetranslateUI<QWidget>
    4564{
    4665    Q_OBJECT;
     
    5372
    5473    virtual void retranslateUi() RT_OVERRIDE;
     74
     75    virtual void prepareWidgets() = 0;
     76    virtual void prepareConnections()  = 0;
    5577
    5678    /* Access functions for children classes. */
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp

    r98844 r100915  
    3333#endif
    3434#include <QHBoxLayout>
     35#include <QVBoxLayout>
    3536#include <QLabel>
    3637#include <QLineEdit>
     
    4950#endif
    5051
     52/* Other VBox includes: */
     53#include <iprt/assert.h>
    5154
    5255UIVMLogViewerSearchPanel::UIVMLogViewerSearchPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer)
     
    6063{
    6164    /* Prepare: */
    62     prepare();
     65    prepareWidgets();
     66    prepareConnections();
     67    retranslateUi();
    6368}
    6469
     
    8792{
    8893    return m_matchLocationVector;
    89 }
    90 
    91 QString UIVMLogViewerSearchPanel::panelName() const
    92 {
    93     return "SearchPanel";
    9494}
    9595
     
    187187void UIVMLogViewerSearchPanel::prepareWidgets()
    188188{
    189     if (!mainLayout())
    190         return;
     189    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     190    AssertReturnVoid(pMainLayout);
    191191
    192192    /* Create search field layout: */
    193193    QHBoxLayout *pSearchFieldLayout = new QHBoxLayout;
    194     if (pSearchFieldLayout)
    195     {
    196         pSearchFieldLayout->setContentsMargins(0, 0, 0, 0);
     194    AssertReturnVoid(pSearchFieldLayout);
     195    pSearchFieldLayout->setContentsMargins(0, 0, 0, 0);
    197196#ifdef VBOX_WS_MAC
    198         pSearchFieldLayout->setSpacing(5);
     197    pSearchFieldLayout->setSpacing(5);
    199198#else
    200         pSearchFieldLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2);
     199    pSearchFieldLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2);
    201200#endif
    202201
    203         /* Create search-editor: */
    204         m_pSearchEditor = new UISearchLineEdit(0 /* parent */);
    205         if (m_pSearchEditor)
    206         {
    207             m_pSearchEditor->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    208             pSearchFieldLayout->addWidget(m_pSearchEditor);
    209         }
    210 
    211         /* Create search button layout: */
    212         QHBoxLayout *pSearchButtonsLayout = new QHBoxLayout;
    213         if (pSearchButtonsLayout)
    214         {
    215             pSearchButtonsLayout->setContentsMargins(0, 0, 0, 0);
    216             pSearchButtonsLayout->setSpacing(0);
    217 
    218             /* Create Previous button: */
    219             m_pPreviousButton = new QIToolButton;
    220             if (m_pPreviousButton)
    221             {
    222                 m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_backward_16px.png"));
    223                 pSearchButtonsLayout->addWidget(m_pPreviousButton);
    224             }
    225 
    226             /* Create Next button: */
    227             m_pNextButton = new QIToolButton;
    228             if (m_pNextButton)
    229             {
    230                 m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_forward_16px.png"));
    231                 pSearchButtonsLayout->addWidget(m_pNextButton);
    232             }
    233 
    234             pSearchFieldLayout->addLayout(pSearchButtonsLayout);
    235         }
    236 
    237         mainLayout()->addLayout(pSearchFieldLayout);
    238     }
     202    /* Create search-editor: */
     203    m_pSearchEditor = new UISearchLineEdit(0 /* parent */);
     204    AssertReturnVoid(m_pSearchEditor);
     205    m_pSearchEditor->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
     206    pSearchFieldLayout->addWidget(m_pSearchEditor);
     207
     208    /* Create search button layout: */
     209    QHBoxLayout *pSearchButtonsLayout = new QHBoxLayout;
     210    AssertReturnVoid(pSearchButtonsLayout);
     211
     212    pSearchButtonsLayout->setContentsMargins(0, 0, 0, 0);
     213    pSearchButtonsLayout->setSpacing(0);
     214
     215    /* Create Previous button: */
     216    m_pPreviousButton = new QIToolButton;
     217    AssertReturnVoid(m_pPreviousButton);
     218    m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_backward_16px.png"));
     219    pSearchButtonsLayout->addWidget(m_pPreviousButton);
     220
     221    /* Create Next button: */
     222    m_pNextButton = new QIToolButton;
     223    AssertReturnVoid(m_pNextButton);
     224    m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_forward_16px.png"));
     225    pSearchButtonsLayout->addWidget(m_pNextButton);
     226
     227    pSearchFieldLayout->addLayout(pSearchButtonsLayout);
     228
     229    pMainLayout->addLayout(pSearchFieldLayout);
    239230
    240231    /* Create case-sensitive check-box: */
    241232    m_pCaseSensitiveCheckBox = new QCheckBox;
    242     if (m_pCaseSensitiveCheckBox)
    243     {
    244         mainLayout()->addWidget(m_pCaseSensitiveCheckBox);
    245     }
     233    AssertReturnVoid(m_pCaseSensitiveCheckBox);
     234    pMainLayout->addWidget(m_pCaseSensitiveCheckBox);
    246235
    247236    /* Create whole-word check-box: */
    248237    m_pMatchWholeWordCheckBox = new QCheckBox;
    249     if (m_pMatchWholeWordCheckBox)
    250     {
    251         setFocusProxy(m_pMatchWholeWordCheckBox);
    252         mainLayout()->addWidget(m_pMatchWholeWordCheckBox);
    253     }
     238    AssertReturnVoid(m_pMatchWholeWordCheckBox);
     239    setFocusProxy(m_pMatchWholeWordCheckBox);
     240    pMainLayout->addWidget(m_pMatchWholeWordCheckBox);
    254241
    255242    /* Create highlight-all check-box: */
    256243    m_pHighlightAllCheckBox = new QCheckBox;
    257     if (m_pHighlightAllCheckBox)
    258     {
    259         mainLayout()->addWidget(m_pHighlightAllCheckBox);
    260     }
     244    AssertReturnVoid(m_pHighlightAllCheckBox);
     245    pMainLayout->addWidget(m_pHighlightAllCheckBox);
     246
     247    pMainLayout->addStretch(1);
    261248}
    262249
     
    356343            {
    357344                /* Make sure current log-page is visible: */
    358                 emit sigShowPanel(this);
     345                //emit sigShowPanel(this);
    359346                /* Set focus on search-editor: */
    360347                m_pSearchEditor->setFocus();
     
    366353            {
    367354                /* Make sure current log-page is visible: */
    368                 emit sigShowPanel(this);
     355                //emit sigShowPanel(this);
    369356                /* Set focus on search-editor: */
    370357                m_pSearchEditor->setFocus();
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h

    r98103 r100915  
    6666    void refresh();
    6767    const QVector<float> &matchLocationVector() const;
    68     virtual QString panelName() const RT_OVERRIDE;
    6968    /** Returns the number of the matches to the current search. */
    7069    int matchCount() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r98854 r100915  
    6161#include "UIVMLogViewerBookmarksPanel.h"
    6262#include "UIVMLogViewerFilterPanel.h"
    63 #include "UIVMLogViewerSearchPanel.h"
    6463#include "UIVMLogViewerOptionsPanel.h"
    6564
     
    6867#include "CMachine.h"
    6968#include "CSystemProperties.h"
     69
     70/* Other VBox includes: */
     71#include <iprt/assert.h>
    7072
    7173/** Limit the read string size to avoid bloated log viewer pages. */
     
    211213    , m_fIsPolished(false)
    212214    , m_pTabWidget(0)
    213     , m_pSearchPanel(0)
    214215    , m_pFilterPanel(0)
    215216    , m_pBookmarksPanel(0)
     
    224225    , m_fCommitDataSignalReceived(false)
    225226    , m_pPreviousLogPage(0)
     227    , m_pPanel(0)
    226228{
    227229    /* Prepare VM Log-Viewer: */
     
    397399void UIVMLogViewerWidget::savePanelVisibility()
    398400{
    399     if (m_fCommitDataSignalReceived)
    400         return;
    401     /* Save a list of currently visible panels: */
    402     QStringList strNameList;
    403     foreach(UIDialogPanel* pPanel, m_visiblePanelsList)
    404         strNameList.append(pPanel->panelName());
    405     gEDataManager->setLogViewerVisiblePanels(strNameList);
     401    // if (m_fCommitDataSignalReceived)
     402    //     return;
     403    // /* Save a list of currently visible panels: */
     404    // QStringList strNameList;
     405    // foreach(UIDialogPanel* pPanel, m_visiblePanelsList)
     406    //     strNameList.append(pPanel->panelName());
     407    // gEDataManager->setLogViewerVisiblePanels(strNameList);
    406408}
    407409
     
    422424    pCurrentPage->setLogContent(strLogContent, false);
    423425
    424     if (m_pSearchPanel && m_pSearchPanel->isVisible())
    425         m_pSearchPanel->refresh();
     426    // if (m_pSearchPanel && m_pSearchPanel->isVisible())
     427    //     m_pSearchPanel->refresh();
    426428
    427429    /* Re-Apply the filter settings: */
     
    546548void UIVMLogViewerWidget::sltSearchResultHighLigting()
    547549{
    548     if (!m_pSearchPanel || !currentLogPage())
    549         return;
    550     currentLogPage()->setScrollBarMarkingsVector(m_pSearchPanel->matchLocationVector());
     550    // if (!m_pSearchPanel || !currentLogPage())
     551    //     return;
     552    // currentLogPage()->setScrollBarMarkingsVector(m_pSearchPanel->matchLocationVector());
    551553}
    552554
    553555void UIVMLogViewerWidget::sltHandleSearchUpdated()
    554556{
    555     if (!m_pSearchPanel || !currentLogPage())
    556         return;
     557    // if (!m_pSearchPanel || !currentLogPage())
     558    //     return;
    557559}
    558560
     
    583585{
    584586    /* Reapply the search to get highlighting etc. correctly */
    585     if (m_pSearchPanel)
    586         m_pSearchPanel->refresh();
     587    // if (m_pSearchPanel)
     588    //     m_pSearchPanel->refresh();
    587589}
    588590
     
    759761    /* Create main layout: */
    760762    m_pMainLayout = new QVBoxLayout(this);
    761     if (m_pMainLayout)
    762     {
    763         /* Configure layout: */
    764         m_pMainLayout->setContentsMargins(0, 0, 0, 0);
     763    AssertReturnVoid(m_pMainLayout);
     764
     765    /* Configure layout: */
     766    m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    765767#ifdef VBOX_WS_MAC
    766         m_pMainLayout->setSpacing(10);
     768    m_pMainLayout->setSpacing(10);
    767769#else
    768         m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     770    m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
    769771#endif
    770772
    771         /* Prepare toolbar, if requested: */
    772         if (m_fShowToolbar)
    773             prepareToolBar();
    774 
    775         /* Create VM Log-Viewer container: */
    776         m_pTabWidget = new UITabWidget;
    777         if (m_pTabWidget)
    778         {
    779             /* Add into layout: */
    780             m_pMainLayout->addWidget(m_pTabWidget);
    781             connect(m_pTabWidget, &QITabWidget::currentChanged, this, &UIVMLogViewerWidget::sltCurrentTabChanged);
    782         }
    783 
    784         /* Create VM Log-Viewer search-panel: */
    785         m_pSearchPanel = new UIVMLogViewerSearchPanel(0, this);
    786         if (m_pSearchPanel)
    787         {
    788             /* Configure panel: */
    789             installEventFilter(m_pSearchPanel);
    790             m_pSearchPanel->hide();
    791             connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHighlightingUpdated,
    792                     this, &UIVMLogViewerWidget::sltSearchResultHighLigting);
    793             connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigSearchUpdated,
    794                     this, &UIVMLogViewerWidget::sltHandleSearchUpdated);
    795             connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHidePanel,
    796                     this, &UIVMLogViewerWidget::sltHandleHidePanel);
    797             connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigShowPanel,
    798                     this, &UIVMLogViewerWidget::sltHandleShowPanel);
    799             m_panelActionMap.insert(m_pSearchPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Find));
    800 
    801             /* Add into layout: */
    802             m_pMainLayout->addWidget(m_pSearchPanel);
    803         }
    804 
    805         /* Create VM Log-Viewer filter-panel: */
    806         m_pFilterPanel = new UIVMLogViewerFilterPanel(0, this);
    807         if (m_pFilterPanel)
    808         {
    809             /* Configure panel: */
    810             installEventFilter(m_pFilterPanel);
    811             m_pFilterPanel->hide();
    812             connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigFilterApplied,
    813                     this, &UIVMLogViewerWidget::sltFilterApplied);
    814             connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigHidePanel,
    815                     this, &UIVMLogViewerWidget::sltHandleHidePanel);
    816            connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigShowPanel,
    817                     this, &UIVMLogViewerWidget::sltHandleShowPanel);
    818             m_panelActionMap.insert(m_pFilterPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Filter));
    819 
    820             /* Add into layout: */
    821             m_pMainLayout->addWidget(m_pFilterPanel);
    822         }
    823 
    824         /* Create VM Log-Viewer bookmarks-panel: */
    825         m_pBookmarksPanel = new UIVMLogViewerBookmarksPanel(0, this);
    826         if (m_pBookmarksPanel)
    827         {
    828             /* Configure panel: */
    829             m_pBookmarksPanel->hide();
    830             connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteBookmarkByIndex,
    831                     this, &UIVMLogViewerWidget::sltDeleteBookmarkByIndex);
    832             connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteAllBookmarks,
    833                     this, &UIVMLogViewerWidget::sltDeleteAllBookmarks);
    834             connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigBookmarkSelected,
    835                     this, &UIVMLogViewerWidget::gotoBookmark);
    836             m_panelActionMap.insert(m_pBookmarksPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Bookmark));
    837             connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigHidePanel,
    838                     this, &UIVMLogViewerWidget::sltHandleHidePanel);
    839             connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigShowPanel,
    840                     this, &UIVMLogViewerWidget::sltHandleShowPanel);
    841             /* Add into layout: */
    842             m_pMainLayout->addWidget(m_pBookmarksPanel);
    843         }
    844 
    845         /* Create VM Log-Viewer options-panel: */
    846         m_pOptionsPanel = new UIVMLogViewerOptionsPanel(0, this);
    847         if (m_pOptionsPanel)
    848         {
    849             /* Configure panel: */
    850             m_pOptionsPanel->hide();
    851             m_pOptionsPanel->setShowLineNumbers(m_bShowLineNumbers);
    852             m_pOptionsPanel->setWrapLines(m_bWrapLines);
    853             m_pOptionsPanel->setFontSizeInPoints(m_font.pointSize());
    854             connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigShowLineNumbers, this, &UIVMLogViewerWidget::sltShowLineNumbers);
    855             connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigWrapLines, this, &UIVMLogViewerWidget::sltWrapLines);
    856             connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigChangeFontSizeInPoints, this, &UIVMLogViewerWidget::sltFontSizeChanged);
    857             connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigChangeFont, this, &UIVMLogViewerWidget::sltChangeFont);
    858             connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigResetToDefaults, this, &UIVMLogViewerWidget::sltResetOptionsToDefault);
    859             connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigHidePanel, this, &UIVMLogViewerWidget::sltHandleHidePanel);
    860             connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigShowPanel, this, &UIVMLogViewerWidget::sltHandleShowPanel);
    861 
    862             m_panelActionMap.insert(m_pOptionsPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Options));
    863 
    864             /* Add into layout: */
    865             m_pMainLayout->addWidget(m_pOptionsPanel);
    866         }
    867     }
     773    /* Prepare toolbar, if requested: */
     774    if (m_fShowToolbar)
     775        prepareToolBar();
     776
     777    /* Create VM Log-Viewer container: */
     778    m_pTabWidget = new UITabWidget;
     779    if (m_pTabWidget)
     780    {
     781        /* Add into layout: */
     782        m_pMainLayout->addWidget(m_pTabWidget);
     783        connect(m_pTabWidget, &QITabWidget::currentChanged, this, &UIVMLogViewerWidget::sltCurrentTabChanged);
     784    }
     785
     786    /* Create VM Log-Viewer search-panel: */
     787    // m_pSearchPanel = new UIVMLogViewerSearchPanel(0, this);
     788    // if (m_pSearchPanel)
     789    // {
     790    //     /* Configure panel: */
     791    //     installEventFilter(m_pSearchPanel);
     792    //     m_pSearchPanel->hide();
     793    //     connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHighlightingUpdated,
     794    //             this, &UIVMLogViewerWidget::sltSearchResultHighLigting);
     795    //     connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigSearchUpdated,
     796    //             this, &UIVMLogViewerWidget::sltHandleSearchUpdated);
     797    //     // connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHidePanel,
     798    //     //         this, &UIVMLogViewerWidget::sltHandleHidePanel);
     799    //     // connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigShowPanel,
     800    //     //         this, &UIVMLogViewerWidget::sltHandleShowPanel);
     801    //     //m_panelActionMap.insert(m_pSearchPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Find));
     802
     803    //     /* Add into layout: */
     804    //     m_pMainLayout->addWidget(m_pSearchPanel);
     805    // }
     806
     807    /* Create VM Log-Viewer filter-panel: */
     808    m_pFilterPanel = new UIVMLogViewerFilterPanel(0, this);
     809    if (m_pFilterPanel)
     810    {
     811        /* Configure panel: */
     812        installEventFilter(m_pFilterPanel);
     813        m_pFilterPanel->hide();
     814        connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigFilterApplied,
     815                this, &UIVMLogViewerWidget::sltFilterApplied);
     816        // connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigHidePanel,
     817        //         this, &UIVMLogViewerWidget::sltHandleHidePanel);
     818        // connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigShowPanel,
     819        //         this, &UIVMLogViewerWidget::sltHandleShowPanel);
     820        // m_panelActionMap.insert(m_pFilterPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Filter));
     821
     822        /* Add into layout: */
     823        m_pMainLayout->addWidget(m_pFilterPanel);
     824    }
     825
     826    /* Create VM Log-Viewer bookmarks-panel: */
     827    m_pBookmarksPanel = new UIVMLogViewerBookmarksPanel(0, this);
     828    if (m_pBookmarksPanel)
     829    {
     830        /* Configure panel: */
     831        m_pBookmarksPanel->hide();
     832        connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteBookmarkByIndex,
     833                this, &UIVMLogViewerWidget::sltDeleteBookmarkByIndex);
     834        connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteAllBookmarks,
     835                this, &UIVMLogViewerWidget::sltDeleteAllBookmarks);
     836        connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigBookmarkSelected,
     837                this, &UIVMLogViewerWidget::gotoBookmark);
     838        //m_panelActionMap.insert(m_pBookmarksPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Bookmark));
     839        // connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigHidePanel,
     840        //         this, &UIVMLogViewerWidget::sltHandleHidePanel);
     841        // connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigShowPanel,
     842        //         this, &UIVMLogViewerWidget::sltHandleShowPanel);
     843        /* Add into layout: */
     844        m_pMainLayout->addWidget(m_pBookmarksPanel);
     845    }
     846
     847    /* Create VM Log-Viewer options-panel: */
     848    m_pOptionsPanel = new UIVMLogViewerOptionsPanel(0, this);
     849    if (m_pOptionsPanel)
     850    {
     851        /* Configure panel: */
     852        m_pOptionsPanel->hide();
     853        m_pOptionsPanel->setShowLineNumbers(m_bShowLineNumbers);
     854        m_pOptionsPanel->setWrapLines(m_bWrapLines);
     855        m_pOptionsPanel->setFontSizeInPoints(m_font.pointSize());
     856        connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigShowLineNumbers, this, &UIVMLogViewerWidget::sltShowLineNumbers);
     857        connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigWrapLines, this, &UIVMLogViewerWidget::sltWrapLines);
     858        connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigChangeFontSizeInPoints, this, &UIVMLogViewerWidget::sltFontSizeChanged);
     859        connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigChangeFont, this, &UIVMLogViewerWidget::sltChangeFont);
     860        connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigResetToDefaults, this, &UIVMLogViewerWidget::sltResetOptionsToDefault);
     861        // connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigHidePanel, this, &UIVMLogViewerWidget::sltHandleHidePanel);
     862        // connect(m_pOptionsPanel, &UIVMLogViewerOptionsPanel::sigShowPanel, this, &UIVMLogViewerWidget::sltHandleShowPanel);
     863
     864        //m_panelActionMap.insert(m_pOptionsPanel, m_pActionPool->action(UIActionIndex_M_Log_T_Options));
     865
     866        /* Add into layout: */
     867        m_pMainLayout->addWidget(m_pOptionsPanel);
     868    }
     869
     870    m_pPanel = new UIVMLogViewerPanelNew(0, this);
     871    AssertReturnVoid(m_pPanel);
     872    m_pMainLayout->addWidget(m_pPanel);
     873
    868874}
    869875
     
    10441050
    10451051        pLogPage->setLogContent(strLogContent, noLogsToShow);
    1046         pLogPage->setScrollBarMarkingsVector(m_pSearchPanel->matchLocationVector());
     1052        //pLogPage->setScrollBarMarkingsVector(m_pSearchPanel->matchLocationVector());
    10471053    }
    10481054}
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r98856 r100915  
    5555class UIVMLogTab;
    5656class UIVMLogViewerBookmarksPanel;
     57class UIVMLogViewerPanelNew;
    5758class UIVMLogViewerFilterPanel;
    5859class UIVMLogViewerOptionsPanel;
    5960class UIVMLogViewerPanel;
    60 class UIVMLogViewerSearchPanel;
    6161class CMachine;
    6262
     
    231231    /** @name Panel instances and a QMap for mapping panel instances to related actions.
    232232      * @{ */
    233         UIVMLogViewerSearchPanel    *m_pSearchPanel;
    234233        UIVMLogViewerFilterPanel    *m_pFilterPanel;
    235234        UIVMLogViewerBookmarksPanel *m_pBookmarksPanel;
     
    259258    bool m_fCommitDataSignalReceived;
    260259    QPointer<UIVMLogPage> m_pPreviousLogPage;
     260    UIVMLogViewerPanelNew *m_pPanel;
    261261
    262262    friend class UIVMLogViewerFilterPanel;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette