Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 70500)
@@ -338,4 +338,5 @@
 	src/logviewer/UIVMLogViewerDialog.h \
 	src/logviewer/UIVMLogViewerFilterPanel.h \
+	src/logviewer/UIVMLogViewerPanel.h \
 	src/logviewer/UIVMLogViewerSearchPanel.h \
 	src/logviewer/UIVMLogViewerWidget.h \
@@ -655,4 +656,5 @@
 	src/logviewer/UIVMLogViewerDialog.cpp \
 	src/logviewer/UIVMLogViewerFilterPanel.cpp \
+	src/logviewer/UIVMLogViewerPanel.cpp \
 	src/logviewer/UIVMLogViewerSearchPanel.cpp \
 	src/logviewer/UIVMLogViewerWidget.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp	(revision 70500)
@@ -46,9 +46,6 @@
 
 UIVMLogViewerBookmarksPanel::UIVMLogViewerBookmarksPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer)
-    : QIWithRetranslateUI<QWidget>(pParent)
+: UIVMLogViewerPanel(pParent, pViewer)
     , m_iMaxBookmarkTextLength(60)
-    , m_pViewer(pViewer)
-    , m_pMainLayout(0)
-    , m_pCloseButton(0)
     , m_pBookmarksComboBox(0)
     , m_clearAllButton(0)
@@ -58,10 +55,10 @@
 }
 
-void UIVMLogViewerBookmarksPanel::update()
+void UIVMLogViewerBookmarksPanel::updateBookmarkList()
 {
-    if(!m_pBookmarksComboBox)
+    if (!m_pBookmarksComboBox || !viewer())
         return;
-    const QVector<QPair<int, QString> > *bookmarkVector = m_pViewer->currentBookmarkVector();
-    if(!bookmarkVector)
+    const QVector<QPair<int, QString> > *bookmarkVector = viewer()->currentBookmarkVector();
+    if (!bookmarkVector)
         return;
 
@@ -73,5 +70,5 @@
             arg(QString::number(bookmarkVector->at(i).first)).arg(bookmarkVector->at(i).second);
 
-        if(strItem.length() > m_iMaxBookmarkTextLength)
+        if (strItem.length() > m_iMaxBookmarkTextLength)
         {
             strItem.resize(m_iMaxBookmarkTextLength);
@@ -92,21 +89,8 @@
 }
 
-void UIVMLogViewerBookmarksPanel::prepare()
-{
-    prepareWidgets();
-    prepareConnections();
-    retranslateUi();
-}
-
 void UIVMLogViewerBookmarksPanel::prepareWidgets()
 {
-    m_pMainLayout = new QHBoxLayout(this);
-    AssertPtrReturnVoid(m_pMainLayout);
-    m_pMainLayout->setContentsMargins(0, 0, 0, 0);
-    m_pMainLayout->setSpacing(4);
-
-    m_pCloseButton = new UIMiniCancelButton(this);
-    AssertPtrReturnVoid(m_pCloseButton);
-    m_pMainLayout->addWidget(m_pCloseButton, 0, Qt::AlignLeft);
+    if (!mainLayout())
+        return;
 
     m_pBookmarksComboBox = new QComboBox(this);
@@ -115,11 +99,9 @@
     m_pBookmarksComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
     m_pBookmarksComboBox->setMaximumWidth(fontMetrics.width('a') * (m_iMaxBookmarkTextLength + 2));
-    m_pMainLayout->addWidget(m_pBookmarksComboBox, 2, Qt::AlignLeft);
+    mainLayout()->addWidget(m_pBookmarksComboBox, 2, Qt::AlignLeft);
 }
 
 void UIVMLogViewerBookmarksPanel::prepareConnections()
 {
-    connect(m_pCloseButton, &UIMiniCancelButton::clicked, this, &UIVMLogViewerBookmarksPanel::hide);
-
 }
 
@@ -127,41 +109,4 @@
 void UIVMLogViewerBookmarksPanel::retranslateUi()
 {
-    m_pCloseButton->setToolTip(UIVMLogViewerWidget::tr("Close the search panel."));
+    UIVMLogViewerPanel::retranslateUi();
 }
-
-bool UIVMLogViewerBookmarksPanel::eventFilter(QObject *pObject, QEvent *pEvent)
-{
-    /* Depending on event-type: */
-    switch (pEvent->type())
-    {
-        /* Process key press only: */
-    case QEvent::KeyPress:
-        {
-            break;
-        }
-    default:
-        break;
-    }
-    /* Call to base-class: */
-    return QWidget::eventFilter(pObject, pEvent);
-}
-
-/** Handles the Qt show @a pEvent. */
-void UIVMLogViewerBookmarksPanel::showEvent(QShowEvent *pEvent)
-{
-    /* Call to base-class: */
-    QWidget::showEvent(pEvent);
-}
-
-/** Handles the Qt hide @a pEvent. */
-void UIVMLogViewerBookmarksPanel::hideEvent(QHideEvent *pEvent)
-{
-    /* Get focused widget: */
-    QWidget *pFocus = QApplication::focusWidget();
-    /* If focus-widget is valid and child-widget of search-panel,
-     * focus next child-widget in line: */
-    if (pFocus && pFocus->parent() == this)
-        focusNextPrevChild(true);
-    /* Call to base-class: */
-    QWidget::hideEvent(pEvent);
-}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h	(revision 70500)
@@ -19,25 +19,17 @@
 #define ___UIVMLogViewerBookmarksPanel_h___
 
-/* Qt includes: */
-#include <QWidget>
-
 /* GUI includes: */
-#include "QIWithRetranslateUI.h"
+#include "UIVMLogViewerPanel.h"
 
 /* Forward declarations: */
 class QComboBox;
-class QHBoxLayout;
-class QLabel;
-class QLineEdit;
 class QPushButton;
-class UIVMFilterLineEdit;
-class UIMiniCancelButton;
-class UIVMLogViewerWidget;
 
 
-/** QWidget extension
-  * providing GUI for bookmark management. Show a list of bookmarks currently set
+
+
+/** UIVMLogViewerPanel extension providing GUI for bookmark management. Show a list of bookmarks currently set
   for displayed log page. It has controls to navigate and clear bookmarks. */
-class UIVMLogViewerBookmarksPanel : public QIWithRetranslateUI<QWidget>
+class UIVMLogViewerBookmarksPanel : public UIVMLogViewerPanel
 {
     Q_OBJECT;
@@ -55,5 +47,5 @@
        user switches to another log page tab etc. */
     void setBookmarksList(const QVector<QPair<int, QString> > &bookmarkList);
-    void update();
+    void updateBookmarkList();
     /* @a index is the index of the curent bookmark. */
     void setBookmarkIndex(int index);
@@ -61,34 +53,20 @@
 public slots:
 
+protected:
 
-private slots:
-
-
-private:
-
-    void prepare();
-    void prepareWidgets();
-    void prepareConnections();
+    virtual void prepareWidgets() /* override */;
+    virtual void prepareConnections() /* override */;
 
     /** Handles the translation event. */
     void retranslateUi();
 
-    /** Handles Qt @a pEvent, used for keyboard processing. */
-    bool eventFilter(QObject *pObject, QEvent *pEvent);
-    /** Handles the Qt show @a pEvent. */
-    void showEvent(QShowEvent *pEvent);
-    /** Handles the Qt hide @a pEvent. */
-    void hideEvent(QHideEvent *pEvent);
+private slots:
 
-    const int m_iMaxBookmarkTextLength;
-    /** Holds the reference to VM Log-Viewer this panel belongs to. */
-    UIVMLogViewerWidget *m_pViewer;
-    /** Holds the instance of main-layout we create. */
-    QHBoxLayout         *m_pMainLayout;
-    /** Holds the instance of close-button we create. */
-    UIMiniCancelButton  *m_pCloseButton;
-    QComboBox           *m_pBookmarksComboBox;
-    QPushButton         *m_clearAllButton;
-    QPushButton         *m_clearCurrentButton;
+private:
+
+    const int     m_iMaxBookmarkTextLength;
+    QComboBox    *m_pBookmarksComboBox;
+    QPushButton  *m_clearAllButton;
+    QPushButton  *m_clearCurrentButton;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp	(revision 70500)
@@ -173,8 +173,5 @@
 
 UIVMLogViewerFilterPanel::UIVMLogViewerFilterPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer)
-    : QIWithRetranslateUI<QWidget>(pParent)
-    , m_pViewer(pViewer)
-    , m_pMainLayout(0)
-    , m_pCloseButton(0)
+    : UIVMLogViewerPanel(pParent, pViewer)
     , m_pFilterLabel(0)
     , m_pFilterComboBox(0)
@@ -202,7 +199,7 @@
 void UIVMLogViewerFilterPanel::filter()
 {
-    QPlainTextEdit *pCurrentPage = m_pViewer->currentLogPage();
+    QPlainTextEdit *pCurrentPage = viewer()->currentLogPage();
     AssertReturnVoid(pCurrentPage);
-    const QString* strInputText = m_pViewer->currentLog();
+    const QString* strInputText = viewer()->currentLog();
     m_iUnfilteredLineCount = 0;
     m_iFilteredLineCount = 0;
@@ -331,21 +328,8 @@
 }
 
-void UIVMLogViewerFilterPanel::prepare()
-{
-    prepareWidgets();
-    prepareConnections();
-    retranslateUi();
-}
-
 void UIVMLogViewerFilterPanel::prepareWidgets()
 {
-    m_pMainLayout = new QHBoxLayout(this);
-    AssertPtrReturnVoid(m_pMainLayout);
-    m_pMainLayout->setContentsMargins(0, 0, 0, 0);
-    m_pMainLayout->setSpacing(4);
-
-    m_pCloseButton = new UIMiniCancelButton(this);
-    AssertPtrReturnVoid(m_pCloseButton);
-    m_pMainLayout->addWidget(m_pCloseButton);
+    if (!mainLayout())
+        return;
 
     prepareRadioButtonGroup();
@@ -360,5 +344,5 @@
         strFilterPresets.sort();
         m_pFilterComboBox->addItems(strFilterPresets);
-        m_pMainLayout->addWidget(m_pFilterComboBox,1);
+        mainLayout()->addWidget(m_pFilterComboBox,1);
     }
 
@@ -367,5 +351,5 @@
     {
         m_pAddFilterTermButton->setIcon(UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
-        m_pMainLayout->addWidget(m_pAddFilterTermButton,0);
+        mainLayout()->addWidget(m_pAddFilterTermButton,0);
     }
 
@@ -373,5 +357,5 @@
     AssertPtrReturnVoid(m_pFilterTermsLineEdit);
     {
-        m_pMainLayout->addWidget(m_pFilterTermsLineEdit, 4);
+        mainLayout()->addWidget(m_pFilterTermsLineEdit, 4);
         m_pFilterTermsLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum /*vertical */);
     }
@@ -380,5 +364,5 @@
     AssertPtrReturnVoid(m_pResultLabel);
     {
-        m_pMainLayout->addWidget(m_pResultLabel,0);
+        mainLayout()->addWidget(m_pResultLabel,0);
     }
         /* Create filter-label: */
@@ -394,5 +378,5 @@
 // #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
 //             /* Add filter-label to main-layout: */
-//             m_pMainLayout->addWidget(m_pFilterLabel);
+//             mainLayout()->addWidget(m_pFilterLabel);
 //         }
 }
@@ -426,10 +410,9 @@
     containerLayout->addWidget(m_pOrRadioButton);
     containerLayout->addWidget(m_pAndRadioButton);
-    m_pMainLayout->addWidget(m_pRadioButtonContainer);
+    mainLayout()->addWidget(m_pRadioButtonContainer);
 }
 
 void UIVMLogViewerFilterPanel::prepareConnections()
 {
-    connect(m_pCloseButton, &UIMiniCancelButton::clicked, this, &UIVMLogViewerFilterPanel::hide);
     connect(m_pAddFilterTermButton, &QPushButton::clicked, this,  &UIVMLogViewerFilterPanel::sltAddFilterTerm);
     connect(m_pButtonGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
@@ -446,5 +429,5 @@
 void UIVMLogViewerFilterPanel::retranslateUi()
 {
-    m_pCloseButton->setToolTip(UIVMLogViewerWidget::tr("Close the search panel."));
+    UIVMLogViewerPanel::retranslateUi();
     m_pFilterComboBox->setToolTip(UIVMLogViewerWidget::tr("Enter filtering string here."));
     m_pAddFilterTermButton->setToolTip(UIVMLogViewerWidget::tr("Add filter term."));
@@ -469,5 +452,5 @@
                 pKeyEvent->key() == Qt::Key_T)
             {
-                if (m_pViewer->currentLogPage())
+                if (viewer()->currentLogPage())
                 {
                     if (isHidden())
@@ -486,5 +469,5 @@
     }
     /* Call to base-class: */
-    return QWidget::eventFilter(pObject, pEvent);
+    return UIVMLogViewerPanel::eventFilter(pObject, pEvent);
 }
 
@@ -492,22 +475,8 @@
 void UIVMLogViewerFilterPanel::showEvent(QShowEvent *pEvent)
 {
-    /* Call to base-class: */
-    QWidget::showEvent(pEvent);
+    UIVMLogViewerPanel::showEvent(pEvent);
     /* Set focus to combo-box: */
     m_pFilterComboBox->setFocus();
 }
 
-/** Handles the Qt hide @a pEvent. */
-void UIVMLogViewerFilterPanel::hideEvent(QHideEvent *pEvent)
-{
-    /* Get focused widget: */
-    QWidget *pFocus = QApplication::focusWidget();
-    /* If focus-widget is valid and child-widget of search-panel,
-     * focus next child-widget in line: */
-    if (pFocus && pFocus->parent() == this)
-        focusNextPrevChild(true);
-    /* Call to base-class: */
-    QWidget::hideEvent(pEvent);
-}
-
 #include "UIVMLogViewerFilterPanel.moc"
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.h	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.h	(revision 70500)
@@ -19,9 +19,7 @@
 #define ___UIVMLogViewerFilterPanel_h___
 
-/* Qt includes: */
-#include <QWidget>
 
 /* GUI includes: */
-#include "QIWithRetranslateUI.h"
+#include "UIVMLogViewerPanel.h"
 
 /* Forward declarations: */
@@ -29,5 +27,4 @@
 class QComboBox;
 class QFrame;
-class QHBoxLayout;
 class QLabel;
 class QLineEdit;
@@ -35,11 +32,9 @@
 class QRadioButton;
 class UIVMFilterLineEdit;
-class UIMiniCancelButton;
-class UIVMLogViewerWidget;
 
 
 /** QWidget extension
   * providing GUI for filter panel in VM Log Viewer. */
-class UIVMLogViewerFilterPanel : public QIWithRetranslateUI<QWidget>
+class UIVMLogViewerFilterPanel : public UIVMLogViewerPanel
 {
     Q_OBJECT;
@@ -62,4 +57,16 @@
     void applyFilter(const int iCurrentIndex = 0);
 
+protected:
+
+    virtual void prepareWidgets() /* override */;
+    virtual void prepareConnections() /* override */;
+
+    /** Handles the translation event. */
+    void retranslateUi() /* override */;
+    /** Handles Qt @a pEvent, used for keyboard processing. */
+    bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */;
+    /** Handles the Qt show @a pEvent. */
+    void showEvent(QShowEvent *pEvent) /* override */;
+
 private slots:
 
@@ -80,34 +87,11 @@
     };
 
-    /** Prepares filter-panel. */
-    void prepare();
-    void prepareWidgets();
     void prepareRadioButtonGroup();
-    void prepareConnections();
-
-    /** Handles the translation event. */
-    void retranslateUi();
-
-    /** Handles Qt @a pEvent, used for keyboard processing. */
-    bool eventFilter(QObject *pObject, QEvent *pEvent);
-    /** Handles the Qt show @a pEvent. */
-    void showEvent(QShowEvent *pEvent);
-    /** Handles the Qt hide @a pEvent. */
-    void hideEvent(QHideEvent *pEvent);
 
     bool applyFilterTermsToString(const QString& string);
     void filter();
 
-    /** Holds the reference to VM Log-Viewer this filter-panel belongs to. */
-    UIVMLogViewerWidget *m_pViewer;
-    /** Holds the instance of main-layout we create. */
-    QHBoxLayout         *m_pMainLayout;
-    /** Holds the instance of close-button we create. */
-    UIMiniCancelButton  *m_pCloseButton;
-    /** Holds the instance of filter-label we create. */
     QLabel              *m_pFilterLabel;
-    /** Holds instance of filter combo-box we create. */
     QComboBox           *m_pFilterComboBox;
-
     QButtonGroup        *m_pButtonGroup;
     QRadioButton        *m_pAndRadioButton;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp	(revision 70500)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp	(revision 70500)
@@ -0,0 +1,125 @@
+/* $Id$ */
+/** @file
+ * VBox Qt GUI - UIVMLogViewer class implementation.
+ */
+
+/*
+ * Copyright (C) 2010-2017 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifdef VBOX_WITH_PRECOMPILED_HEADERS
+# include <precomp.h>
+#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
+/* Qt includes: */
+# include <QComboBox>
+# include <QHBoxLayout>
+# if defined(RT_OS_SOLARIS)
+#  include <QFontDatabase>
+# endif
+# include <QLabel>
+# include <QLineEdit>
+# include <QPlainTextEdit>
+# include <QPushButton>
+# include <QTextCursor>
+# include <QToolButton>
+# include <QScrollArea>
+
+/* GUI includes: */
+# include "UIIconPool.h"
+# include "UISpecialControls.h"
+# include "UIVMLogViewerPanel.h"
+# include "UIVMLogViewerWidget.h"
+# ifdef VBOX_WS_MAC
+#  include "VBoxUtils-darwin.h"
+# endif
+#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
+
+UIVMLogViewerPanel::UIVMLogViewerPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer)
+    : QIWithRetranslateUI<QWidget>(pParent)
+    , m_pViewer(pViewer)
+    , m_pMainLayout(0)
+    , m_pCloseButton(0)
+{
+    prepare();
+}
+
+UIVMLogViewerWidget* UIVMLogViewerPanel::viewer()
+{
+    return m_pViewer;
+}
+
+const UIVMLogViewerWidget* UIVMLogViewerPanel::viewer() const
+{
+    return m_pViewer;
+}
+
+QHBoxLayout* UIVMLogViewerPanel::mainLayout()
+{
+    return m_pMainLayout;
+}
+
+void UIVMLogViewerPanel::prepare()
+{
+    prepareWidgets();
+    prepareConnections();
+    retranslateUi();
+}
+
+void UIVMLogViewerPanel::prepareWidgets()
+{
+    m_pMainLayout = new QHBoxLayout(this);
+    AssertPtrReturnVoid(m_pMainLayout);
+    m_pMainLayout->setContentsMargins(0, 0, 0, 0);
+    m_pMainLayout->setSpacing(2);
+
+    m_pCloseButton = new UIMiniCancelButton(this);
+    AssertPtrReturnVoid(m_pCloseButton);
+    m_pMainLayout->addWidget(m_pCloseButton, 0, Qt::AlignLeft);
+}
+
+void UIVMLogViewerPanel::prepareConnections()
+{
+    if (m_pCloseButton)
+        connect(m_pCloseButton, &UIMiniCancelButton::clicked, this, &UIVMLogViewerPanel::hide);
+
+}
+
+
+void UIVMLogViewerPanel::retranslateUi()
+{
+    if (m_pCloseButton)
+        m_pCloseButton->setToolTip(UIVMLogViewerWidget::tr("Close the search panel."));
+}
+
+bool UIVMLogViewerPanel::eventFilter(QObject *pObject, QEvent *pEvent)
+{
+    return QWidget::eventFilter(pObject, pEvent);
+}
+
+void UIVMLogViewerPanel::showEvent(QShowEvent *pEvent)
+{
+    QWidget::showEvent(pEvent);
+}
+
+void UIVMLogViewerPanel::hideEvent(QHideEvent *pEvent)
+{
+    /* Get focused widget: */
+    QWidget *pFocus = QApplication::focusWidget();
+    /* If focus-widget is valid and child-widget of search-panel,
+     * focus next child-widget in line: */
+    if (pFocus && pFocus->parent() == this)
+        focusNextPrevChild(true);
+
+    QWidget::hideEvent(pEvent);
+    emit sigHide();
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.h	(revision 70500)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.h	(revision 70500)
@@ -0,0 +1,89 @@
+/* $Id$ */
+/** @file
+ * VBox Qt GUI - UIVMLogViewer class declaration.
+ */
+
+/*
+ * Copyright (C) 2010-2017 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef ___UIVMLogViewerPanel_h___
+#define ___UIVMLogViewerPanel_h___
+
+/* Qt includes: */
+#include <QWidget>
+
+/* GUI includes: */
+#include "QIWithRetranslateUI.h"
+
+/* Forward declarations: */
+class QComboBox;
+class QHBoxLayout;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class UIVMFilterLineEdit;
+class UIMiniCancelButton;
+class UIVMLogViewerWidget;
+
+
+/** QWidget extension acting as the base class for UIVMLogViewerXXXPanel widgets. */
+class UIVMLogViewerPanel : public QIWithRetranslateUI<QWidget>
+{
+    Q_OBJECT;
+
+signals:
+
+    void sigHide();
+
+public:
+
+    UIVMLogViewerPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer);
+
+
+public slots:
+
+protected:
+
+    virtual void prepare();
+    virtual void prepareWidgets();
+    virtual void prepareConnections();
+
+    /* Access functions for children classes. */
+    UIVMLogViewerWidget*       viewer();
+    const UIVMLogViewerWidget* viewer() const;
+    QHBoxLayout*               mainLayout();
+
+    /** Handles the translation event. */
+    void retranslateUi();
+
+    /** Handles Qt @a pEvent, used for keyboard processing. */
+    bool eventFilter(QObject *pObject, QEvent *pEvent);
+    /** Handles the Qt show @a pEvent. */
+    void showEvent(QShowEvent *pEvent);
+    /** Handles the Qt hide @a pEvent. */
+    void hideEvent(QHideEvent *pEvent);
+
+private slots:
+
+
+private:
+
+
+    /** Holds the reference to VM Log-Viewer this panel belongs to. */
+    UIVMLogViewerWidget *m_pViewer;
+    /** Holds the instance of main-layout we create. */
+    QHBoxLayout         *m_pMainLayout;
+    /** Holds the instance of close-button we create. */
+    UIMiniCancelButton  *m_pCloseButton;
+};
+
+#endif /* !___UIVMLogViewerPanel!_h___ */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp	(revision 70500)
@@ -44,9 +44,7 @@
 
 UIVMLogViewerSearchPanel::UIVMLogViewerSearchPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer)
-: QIWithRetranslateUI<QWidget>(pParent)
-    , m_pViewer(pViewer)
-    , m_pMainLayout(0)
-    , m_pCloseButton(0)
-    , m_pSearchLabel(0), m_pSearchEditor(0)
+    : UIVMLogViewerPanel(pParent, pViewer)
+    , m_pSearchLabel(0)
+    , m_pSearchEditor(0)
     , m_pNextPrevButtons(0)
     , m_pCaseSensitiveCheckBox(0)
@@ -96,5 +94,5 @@
         focusNextPrevChild(true);
     /* Call to base-class: */
-    QWidget::hideEvent(pEvent);
+    UIVMLogViewerPanel::hideEvent(pEvent);
     reset();
 }
@@ -127,16 +125,19 @@
     else
     {
-        /* Get current log-page: */
-        QPlainTextEdit *pBrowser = m_pViewer->currentLogPage();
-        /* If current log-page is valid and cursor has selection: */
-        if (pBrowser && pBrowser->textCursor().hasSelection())
+        if (viewer())
         {
-            /* Get cursor and reset position: */
-            QTextCursor cursor = pBrowser->textCursor();
-            cursor.setPosition(cursor.anchor());
-            pBrowser->setTextCursor(cursor);
+            /* Get current log-page: */
+            QPlainTextEdit *pBrowser = viewer()->currentLogPage();
+            /* If current log-page is valid and cursor has selection: */
+            if (pBrowser && pBrowser->textCursor().hasSelection())
+            {
+                /* Get cursor and reset position: */
+                QTextCursor cursor = pBrowser->textCursor();
+                cursor.setPosition(cursor.anchor());
+                pBrowser->setTextCursor(cursor);
+            }
+            m_iSearchPosition = -1;
+            clearHighlighting(-1);
         }
-        m_iSearchPosition = -1;
-        clearHighlighting(-1);
     }
 }
@@ -144,5 +145,7 @@
 void UIVMLogViewerSearchPanel::sltHighlightAllCheckBox()
 {
-    QPlainTextEdit *pTextEdit = m_pViewer->currentLogPage();
+    if (!viewer())
+        return;
+    QPlainTextEdit *pTextEdit = viewer()->currentLogPage();
     if (!pTextEdit)
         return;
@@ -181,161 +184,133 @@
 }
 
-void UIVMLogViewerSearchPanel::prepare()
-{
-    /* Prepare widgets: */
-    prepareWidgets();
-
-    /* Prepare connections: */
-    prepareConnections();
-
-    /* Retranslate finally: */
-    retranslateUi();
-}
-
 void UIVMLogViewerSearchPanel::prepareWidgets()
 {
-    /* Create main-layout: */
-    m_pMainLayout = new QHBoxLayout(this);
-    AssertPtrReturnVoid(m_pMainLayout);
-    {
-        /* Configure main-layout: */
-        m_pMainLayout->setContentsMargins(0, 0, 0, 0);
-        m_pMainLayout->setSpacing(4);
-
-        /* Create close-button: */
-        m_pCloseButton = new UIMiniCancelButton(this);
-        AssertPtrReturnVoid(m_pCloseButton);
-        {
-            /* Add close-button to main-layout: */
-            m_pMainLayout->addWidget(m_pCloseButton);
-        }
-
-        /* Create search-editor: */
-        m_pSearchEditor = new UISearchField(this);
-        AssertPtrReturnVoid(m_pSearchEditor);
-        {
-            /* Configure search-editor: */
-            m_pSearchEditor->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
-            /* Add search-editor to main-layout: */
-            m_pMainLayout->addWidget(m_pSearchEditor);
-        }
-
-        /* Create search-label: */
-        m_pSearchLabel = new QLabel(this);
-        AssertPtrReturnVoid(m_pSearchLabel);
-        {
-            /* Configure search-label: */
-            m_pSearchLabel->setBuddy(m_pSearchEditor);
-            /* Prepare font: */
+    if (!mainLayout())
+        return;
+
+    /* Create search-editor: */
+    m_pSearchEditor = new UISearchField(this);
+    AssertPtrReturnVoid(m_pSearchEditor);
+    {
+        /* Configure search-editor: */
+        m_pSearchEditor->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+        /* Add search-editor to main-layout: */
+        mainLayout()->addWidget(m_pSearchEditor);
+    }
+
+    /* Create search-label: */
+    m_pSearchLabel = new QLabel(this);
+    AssertPtrReturnVoid(m_pSearchLabel);
+    {
+        /* Configure search-label: */
+        m_pSearchLabel->setBuddy(m_pSearchEditor);
+        /* Prepare font: */
 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
-            QFont font = m_pSearchLabel->font();
-            font.setPointSize(::darwinSmallFontSize());
-            m_pSearchLabel->setFont(font);
+        QFont font = m_pSearchLabel->font();
+        font.setPointSize(::darwinSmallFontSize());
+        m_pSearchLabel->setFont(font);
 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
-            /* Add search-label to main-layout: */
-            m_pMainLayout->addWidget(m_pSearchLabel);
-        }
-
-        /* Create Next/Prev button-box: */
-        m_pNextPrevButtons = new UIRoundRectSegmentedButton(this, 2);
-        AssertPtrReturnVoid(m_pNextPrevButtons);
-        {
-            /* Configure Next/Prev button-box: */
-            m_pNextPrevButtons->setEnabled(0, false);
-            m_pNextPrevButtons->setEnabled(1, false);
+        /* Add search-label to main-layout: */
+        mainLayout()->addWidget(m_pSearchLabel);
+    }
+
+    /* Create Next/Prev button-box: */
+    m_pNextPrevButtons = new UIRoundRectSegmentedButton(this, 2);
+    AssertPtrReturnVoid(m_pNextPrevButtons);
+    {
+        /* Configure Next/Prev button-box: */
+        m_pNextPrevButtons->setEnabled(0, false);
+        m_pNextPrevButtons->setEnabled(1, false);
 #ifndef VBOX_WS_MAC
-            /* No icons on the Mac: */
-            m_pNextPrevButtons->setIcon(0, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowBack, this));
-            m_pNextPrevButtons->setIcon(1, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
+        /* No icons on the Mac: */
+        m_pNextPrevButtons->setIcon(0, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowBack, this));
+        m_pNextPrevButtons->setIcon(1, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));
 #endif /* !VBOX_WS_MAC */
-            /* Add Next/Prev button-box to main-layout: */
-            m_pMainLayout->addWidget(m_pNextPrevButtons);
-        }
-
-        /* Create case-sensitive checkbox: */
-        m_pCaseSensitiveCheckBox = new QCheckBox;
-        AssertPtrReturnVoid(m_pCaseSensitiveCheckBox);
-        {
-            /* Configure font: */
+        /* Add Next/Prev button-box to main-layout: */
+        mainLayout()->addWidget(m_pNextPrevButtons);
+    }
+
+    /* Create case-sensitive checkbox: */
+    m_pCaseSensitiveCheckBox = new QCheckBox;
+    AssertPtrReturnVoid(m_pCaseSensitiveCheckBox);
+    {
+        /* Configure font: */
 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
-            QFont font = m_pCaseSensitiveCheckBox->font();
-            font.setPointSize(::darwinSmallFontSize());
-            m_pCaseSensitiveCheckBox->setFont(font);
+        QFont font = m_pCaseSensitiveCheckBox->font();
+        font.setPointSize(::darwinSmallFontSize());
+        m_pCaseSensitiveCheckBox->setFont(font);
 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
-            /* Add case-sensitive checkbox to main-layout: */
-            m_pMainLayout->addWidget(m_pCaseSensitiveCheckBox);
-        }
-
-        m_pMatchWholeWordCheckBox = new QCheckBox(this);
-        AssertPtrReturnVoid(m_pMatchWholeWordCheckBox);
-        {
-            /* Configure focus for case-sensitive checkbox: */
-            setFocusProxy(m_pMatchWholeWordCheckBox);
-            /* Configure font: */
+        /* Add case-sensitive checkbox to main-layout: */
+        mainLayout()->addWidget(m_pCaseSensitiveCheckBox);
+    }
+
+    m_pMatchWholeWordCheckBox = new QCheckBox(this);
+    AssertPtrReturnVoid(m_pMatchWholeWordCheckBox);
+    {
+        /* Configure focus for case-sensitive checkbox: */
+        setFocusProxy(m_pMatchWholeWordCheckBox);
+        /* Configure font: */
 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
-            QFont font = m_pMatchWholeWordCheckBox->font();
-            font.setPointSize(::darwinSmallFontSize());
-            m_pMatchWholeWordCheckBox->setFont(font);
+        QFont font = m_pMatchWholeWordCheckBox->font();
+        font.setPointSize(::darwinSmallFontSize());
+        m_pMatchWholeWordCheckBox->setFont(font);
 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
-            m_pMainLayout->addWidget(m_pMatchWholeWordCheckBox);
-        }
-
-        m_pHighlightAllCheckBox = new QCheckBox(this);
-        AssertPtrReturnVoid(m_pHighlightAllCheckBox);
-        {
-            /* Configure font: */
+        mainLayout()->addWidget(m_pMatchWholeWordCheckBox);
+    }
+
+    m_pHighlightAllCheckBox = new QCheckBox(this);
+    AssertPtrReturnVoid(m_pHighlightAllCheckBox);
+    {
+        /* Configure font: */
 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
-            QFont font = m_pHighlightAllCheckBox->font();
-            font.setPointSize(::darwinSmallFontSize());
-            m_pHighlightAllCheckBox->setFont(font);
+        QFont font = m_pHighlightAllCheckBox->font();
+        font.setPointSize(::darwinSmallFontSize());
+        m_pHighlightAllCheckBox->setFont(font);
 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
-            /* Add case-sensitive checkbox to main-layout: */
-            m_pMainLayout->addWidget(m_pHighlightAllCheckBox);
-        }
-
-        /* Create warning-spacer: */
-        m_pWarningSpacer = new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Minimum);
-        AssertPtrReturnVoid(m_pWarningSpacer);
-        {
-            /* Add warning-spacer to main-layout: */
-            m_pMainLayout->addItem(m_pWarningSpacer);
-        }
-
-        /* Create warning-icon: */
-        m_pWarningIcon = new QLabel(this);
-        AssertPtrReturnVoid(m_pWarningIcon);
-        {
-            /* Confifure warning-icon: */
-            m_pWarningIcon->hide();
-            QIcon icon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning, this);
-            if (!icon.isNull())
-                m_pWarningIcon->setPixmap(icon.pixmap(16, 16));
-            /* Add warning-icon to main-layout: */
-            m_pMainLayout->addWidget(m_pWarningIcon);
-        }
-
-        /* Create warning-label: */
-        m_pInfoLabel = new QLabel(this);
-        AssertPtrReturnVoid(m_pInfoLabel);
-        {
-            /* Configure warning-label: */
-            m_pInfoLabel->hide();
-            /* Prepare font: */
+        /* Add case-sensitive checkbox to main-layout: */
+        mainLayout()->addWidget(m_pHighlightAllCheckBox);
+    }
+
+    /* Create warning-spacer: */
+    m_pWarningSpacer = new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Minimum);
+    AssertPtrReturnVoid(m_pWarningSpacer);
+    {
+        /* Add warning-spacer to main-layout: */
+        mainLayout()->addItem(m_pWarningSpacer);
+    }
+
+    /* Create warning-icon: */
+    m_pWarningIcon = new QLabel(this);
+    AssertPtrReturnVoid(m_pWarningIcon);
+    {
+        /* Confifure warning-icon: */
+        m_pWarningIcon->hide();
+        QIcon icon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning, this);
+        if (!icon.isNull())
+            m_pWarningIcon->setPixmap(icon.pixmap(16, 16));
+        /* Add warning-icon to main-layout: */
+        mainLayout()->addWidget(m_pWarningIcon);
+    }
+
+    /* Create warning-label: */
+    m_pInfoLabel = new QLabel(this);
+    AssertPtrReturnVoid(m_pInfoLabel);
+    {
+        /* Configure warning-label: */
+        m_pInfoLabel->hide();
+        /* Prepare font: */
 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS
-            QFont font = m_pInfoLabel->font();
-            font.setPointSize(::darwinSmallFontSize());
-            m_pInfoLabel->setFont(font);
+        QFont font = m_pInfoLabel->font();
+        font.setPointSize(::darwinSmallFontSize());
+        m_pInfoLabel->setFont(font);
 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
-            /* Add warning-label to main-layout: */
-            m_pMainLayout->addWidget(m_pInfoLabel);
-        }
-
-        /* Create spacer-item: */
-        m_pSpacerItem = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-        AssertPtrReturnVoid(m_pSpacerItem);
-        {
-            /* Add spacer-item to main-layout: */
-            m_pMainLayout->addItem(m_pSpacerItem);
-        }
+        /* Add warning-label to main-layout: */
+        mainLayout()->addWidget(m_pInfoLabel);
+    }
+
+    m_pSpacerItem = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
+    AssertPtrReturnVoid(m_pSpacerItem);
+    {
+        mainLayout()->addItem(m_pSpacerItem);
     }
 }
@@ -343,6 +318,4 @@
 void UIVMLogViewerSearchPanel::prepareConnections()
 {
-    /* Prepare connections: */
-    connect(m_pCloseButton, &UIMiniCancelButton::clicked, this, &UIVMLogViewerSearchPanel::hide);
     connect(m_pSearchEditor, &UISearchField::textChanged, this, &UIVMLogViewerSearchPanel::sltSearchTextChanged);
     connect(m_pNextPrevButtons, &UIRoundRectSegmentedButton::clicked, this, &UIVMLogViewerSearchPanel::find);
@@ -357,6 +330,4 @@
 void UIVMLogViewerSearchPanel::retranslateUi()
 {
-    m_pCloseButton->setToolTip(UIVMLogViewerWidget::tr("Close the search panel"));
-
     m_pSearchLabel->setText(QString("%1 ").arg(UIVMLogViewerWidget::tr("&Find")));
     m_pSearchEditor->setToolTip(UIVMLogViewerWidget::tr("Enter a search string here"));
@@ -402,5 +373,5 @@
     }
     /* Call to base-class: */
-    QWidget::keyPressEvent(pEvent);
+    UIVMLogViewerPanel::keyPressEvent(pEvent);
 }
 
@@ -439,5 +410,5 @@
                      pKeyEvent->key() == Qt::Key_F)
             {
-                if (m_pViewer->currentLogPage())
+                if (viewer() && viewer()->currentLogPage())
                 {
                     /* Make sure current log-page is visible: */
@@ -454,5 +425,5 @@
             {
                 /* Make sure current log-page is visible: */
-                if (m_pViewer->currentLogPage())
+                if (viewer() && viewer()->currentLogPage())
                 {
                     if (isHidden())
@@ -471,5 +442,5 @@
     }
     /* Call to base-class: */
-    return QWidget::eventFilter(pObject, pEvent);
+    return UIVMLogViewerPanel::eventFilter(pObject, pEvent);
 }
 
@@ -477,5 +448,5 @@
 {
     /* Call to base-class: */
-    QWidget::showEvent(pEvent);
+    UIVMLogViewerPanel::showEvent(pEvent);
     /* Set focus on search-editor: */
     m_pSearchEditor->setFocus();
@@ -486,67 +457,69 @@
 void UIVMLogViewerSearchPanel::search(SearchDirection direction, bool highlight)
 {
-   QPlainTextEdit *pTextEdit = m_pViewer->currentLogPage();
-   if (!pTextEdit) return;
-   QTextDocument *pDocument = pTextEdit->document();
-   if (!pDocument)
-       return;
-
-   const QString &searchString = m_pSearchEditor->text();
-   if (searchString.isEmpty())
-       return;
-
-   QTextCursor endCursor(pDocument);
-   endCursor.movePosition(QTextCursor::End);
-   QTextCursor startCursor(pDocument);
-
-   if (m_pHighlightAllCheckBox->isChecked())
-   {
-       if (highlight)
-           highlightAll(pDocument, searchString);
-   }
-   else
-   {
-       m_iMatchCount = -1;
-       m_matchLocationVector.clear();
-   }
-
-   QTextCursor resultCursor(pDocument);
-   int startPosition = m_iSearchPosition;
-   if (direction == BackwardSearch)
-       startPosition -= searchString.length();
-   resultCursor = pDocument->find(searchString, startPosition, constructFindFlags(direction));
-
-   /* Decide whether to wrap around or to end the search */
-   if (resultCursor.isNull())
-   {
-       /* End the search if we search the whole document with no find: */
-       if ((direction == ForwardSearch && startPosition == startCursor.position()) ||
-           (direction == BackwardSearch && startPosition == endCursor.position()))
-       {
-           /* Set the match count 0 here since we did not call highLightAll function: */
-           if (!m_pHighlightAllCheckBox->isChecked())
-               m_iMatchCount = 0;
-           configureInfoLabels();
-           return;
-       }
-       /* Wrap the search */
-       if (direction == ForwardSearch)
-       {
-           m_iSearchPosition = startCursor.position();
-           search(ForwardSearch, false);
-           return;
-       }
-       else
-       {
-           /* Set the search position away from the end position to be
-              able to find the string at the end of the document: */
-           m_iSearchPosition = endCursor.position() + searchString.length();
-           search(BackwardSearch, false);
-           return;
-       }
-   }
-   pTextEdit->setTextCursor(resultCursor);
-   m_iSearchPosition = resultCursor.position();
-   configureInfoLabels();
+    if (!viewer())
+        return;
+    QPlainTextEdit *pTextEdit = viewer()->currentLogPage();
+    if (!pTextEdit) return;
+    QTextDocument *pDocument = pTextEdit->document();
+    if (!pDocument)
+        return;
+
+    const QString &searchString = m_pSearchEditor->text();
+    if (searchString.isEmpty())
+        return;
+
+    QTextCursor endCursor(pDocument);
+    endCursor.movePosition(QTextCursor::End);
+    QTextCursor startCursor(pDocument);
+
+    if (m_pHighlightAllCheckBox->isChecked())
+    {
+        if (highlight)
+            highlightAll(pDocument, searchString);
+    }
+    else
+    {
+        m_iMatchCount = -1;
+        m_matchLocationVector.clear();
+    }
+
+    QTextCursor resultCursor(pDocument);
+    int startPosition = m_iSearchPosition;
+    if (direction == BackwardSearch)
+        startPosition -= searchString.length();
+    resultCursor = pDocument->find(searchString, startPosition, constructFindFlags(direction));
+
+    /* Decide whether to wrap around or to end the search */
+    if (resultCursor.isNull())
+    {
+        /* End the search if we search the whole document with no find: */
+        if ((direction == ForwardSearch && startPosition == startCursor.position()) ||
+            (direction == BackwardSearch && startPosition == endCursor.position()))
+        {
+            /* Set the match count 0 here since we did not call highLightAll function: */
+            if (!m_pHighlightAllCheckBox->isChecked())
+                m_iMatchCount = 0;
+            configureInfoLabels();
+            return;
+        }
+        /* Wrap the search */
+        if (direction == ForwardSearch)
+        {
+            m_iSearchPosition = startCursor.position();
+            search(ForwardSearch, false);
+            return;
+        }
+        else
+        {
+            /* Set the search position away from the end position to be
+               able to find the string at the end of the document: */
+            m_iSearchPosition = endCursor.position() + searchString.length();
+            search(BackwardSearch, false);
+            return;
+        }
+    }
+    pTextEdit->setTextCursor(resultCursor);
+    m_iSearchPosition = resultCursor.position();
+    configureInfoLabels();
 }
 
@@ -563,12 +536,14 @@
 void UIVMLogViewerSearchPanel::clearHighlighting(int count)
 {
+    if (!viewer())
+        return;
     m_iMatchCount = count;
     m_matchLocationVector.clear();
 
-    QPlainTextEdit *pBrowser = m_pViewer->currentLogPage();
-    if(pBrowser)
+    QPlainTextEdit *pBrowser = viewer()->currentLogPage();
+    if (pBrowser)
     {
         QTextDocument* pDocument = pBrowser->document();
-        if(pDocument)
+        if (pDocument)
             pDocument->undo();
     }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h	(revision 70500)
@@ -21,8 +21,7 @@
 /* Qt includes: */
 #include <QTextDocument>
-#include <QWidget>
 
 /* GUI includes: */
-#include "QIWithRetranslateUI.h"
+#include "UIVMLogViewerPanel.h"
 
 /* Forward declarations: */
@@ -38,5 +37,5 @@
 /** QWidget extension
   * providing GUI for search-panel in VM Log-Viewer. */
-class UIVMLogViewerSearchPanel : public QIWithRetranslateUI<QWidget>
+class UIVMLogViewerSearchPanel : public UIVMLogViewerPanel
 {
     Q_OBJECT;
@@ -58,4 +57,16 @@
 protected:
 
+
+    /** Prepares widgets. */
+    virtual void prepareWidgets() /* override */;
+    virtual void prepareConnections() /* override */;
+    /** Handles translation event. */
+    virtual void retranslateUi() /* override */;
+    /** Handles Qt key-press @a pEevent. */
+    virtual void keyPressEvent(QKeyEvent *pEvent) /* override */;
+    /** Handles Qt @a pEvent, used for keyboard processing. */
+    virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */;
+    /** Handles Qt show @a pEvent. */
+    virtual void showEvent(QShowEvent *pEvent) /* override */;
     virtual void hideEvent(QHideEvent* pEvent) /* override */;
 
@@ -75,19 +86,5 @@
 
     enum SearchDirection { ForwardSearch, BackwardSearch };
-    /** Prepares search-panel. */
-    void prepare();
-    /** Prepares widgets. */
-    void prepareWidgets();
-    void prepareConnections();
 
-    /** Handles translation event. */
-    void retranslateUi();
-
-    /** Handles Qt key-press @a pEevent. */
-    void keyPressEvent(QKeyEvent *pEvent);
-    /** Handles Qt @a pEvent, used for keyboard processing. */
-    bool eventFilter(QObject *pObject, QEvent *pEvent);
-    /** Handles Qt show @a pEvent. */
-    void showEvent(QShowEvent *pEvent);
     /** Clear the result of highlight */
     void clearHighlight();
@@ -110,10 +107,4 @@
     QTextDocument::FindFlags constructFindFlags(SearchDirection eDirection);
 
-    /** Holds the reference to the VM Log-Viewer this search-panel belongs to. */
-    UIVMLogViewerWidget *m_pViewer;
-    /** Holds the instance of main-layout we create. */
-    QHBoxLayout *m_pMainLayout;
-    /** Holds the instance of close-button we create. */
-    UIMiniCancelButton *m_pCloseButton;
     /** Holds the instance of search-label we create. */
     QLabel *m_pSearchLabel;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp	(revision 70500)
@@ -151,10 +151,10 @@
         m_iContextMenuBookmark.second = block.text();
 
-        if(pAction)
+        if (pAction)
             connect(pAction, &QAction::triggered, this, &UIVMLogViewerTextEdit::sltBookmark);
 
         menu->exec(pEvent->globalPos());
 
-        if(pAction)
+        if (pAction)
             disconnect(pAction, &QAction::triggered, this, &UIVMLogViewerTextEdit::sltBookmark);
 
@@ -236,7 +236,21 @@
 }
 
+void UIVMLogViewerWidget::sltPanelActionTriggered(bool checked)
+{
+    QAction *pSenderAction = qobject_cast<QAction*>(sender());
+    if(!pSenderAction)
+        return;
+    /* Look for the sender() within the m_panelActionMap's values: */
+    for(QMap<UIVMLogViewerPanel**, QAction**>::const_iterator iterator = m_panelActionMap.begin();
+        iterator != m_panelActionMap.end(); ++iterator)
+    {
+        if(iterator.value() == &pSenderAction)
+            continue;
+    }
+}
+
 void UIVMLogViewerWidget::sltShowHideSearchPanel()
 {
-    if(!m_pSearchPanel)
+    if (!m_pSearchPanel)
         return;
     /* Show/hide search-panel: */
@@ -296,5 +310,5 @@
 
     /* Apply the filter settings: */
-    if(m_pFilterPanel)
+    if (m_pFilterPanel)
         m_pFilterPanel->applyFilter();
 
@@ -321,5 +335,5 @@
         return;
     UIVMLogViewerTextEdit *logPage = qobject_cast<UIVMLogViewerTextEdit*>(currentLogPage());
-    if(!logPage)
+    if (!logPage)
         return;
     /* Prepare "save as" dialog: */
@@ -351,5 +365,5 @@
 void UIVMLogViewerWidget::sltShowHideFilterPanel()
 {
-    if(!m_pFilterPanel)
+    if (!m_pFilterPanel)
         return;
     /* Show/hide filter-panel: */
@@ -391,5 +405,5 @@
 void UIVMLogViewerWidget::sltShowHideBookmarkPanel()
 {
-    if(!m_pBookmarksPanel)
+    if (!m_pBookmarksPanel)
         return;
     m_pBookmarksPanel->isHidden() ? m_pBookmarksPanel->show() : m_pBookmarksPanel->hide();
@@ -398,5 +412,5 @@
 void UIVMLogViewerWidget::sltCreateBookmarkAtCurrent()
 {
-    if(!currentLogPage())
+    if (!currentLogPage())
         return;
     QWidget* viewport = currentLogPage()->viewport();
@@ -414,10 +428,10 @@
 {
     QVector<LogBookmark> *pBookmarkVector = currentBookmarkVector();
-    if(!pBookmarkVector)
+    if (!pBookmarkVector)
         return;
     pBookmarkVector->push_back(bookmark);
-    if(m_pBookmarksPanel)
-    {
-        m_pBookmarksPanel->update();
+    if (m_pBookmarksPanel)
+    {
+        m_pBookmarksPanel->updateBookmarkList();
         m_pBookmarksPanel->setBookmarkIndex(pBookmarkVector->size() - 1);
     }
@@ -499,4 +513,7 @@
     AssertPtrReturnVoid(m_pBookmarksPanel);
     {
+        //QMap<UIVMLogViewerPanel*&, QAction*&> m_panelActionMap;
+        m_panelActionMap.insert(reinterpret_cast<UIVMLogViewerPanel**>(&m_pBookmarksPanel), &m_pActionBookmark);
+        //connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigHide, this, &UIVMLogViewerWidget::sltHidePanel);
         installEventFilter(m_pBookmarksPanel);
         m_pBookmarksPanel->hide();
@@ -764,5 +781,5 @@
 const QString* UIVMLogViewerWidget::currentLog()
 {
-    if(!currentLogPage())
+    if (!currentLogPage())
         return 0;
     return &(m_logMap[currentLogPage()]);
@@ -787,8 +804,8 @@
 {
     UIVMLogViewerTextEdit *logPage = qobject_cast<UIVMLogViewerTextEdit*>(currentLogPage());
-    if(!logPage)
+    if (!logPage)
         return 0;
     QString logFileName = logPage->logFileName();
-    if(logFileName.isEmpty())
+    if (logFileName.isEmpty())
         return 0;
 
@@ -799,8 +816,8 @@
 {
     UIVMLogViewerTextEdit *logPage = qobject_cast<UIVMLogViewerTextEdit*>(currentLogPage());
-    if(!logPage)
+    if (!logPage)
         return 0;
     QString logFileName = logPage->logFileName();
-    if(logFileName.isEmpty())
+    if (logFileName.isEmpty())
         return 0;
 
@@ -808,4 +825,17 @@
 }
 
+void UIVMLogViewerWidget::hidePanel(UIVMLogViewerPanel* panel)
+{
+    if (!panel || panel->isHidden())
+        return;
+    panel->setVisible(false);
+}
+
+void UIVMLogViewerWidget::showPanel(UIVMLogViewerPanel* panel)
+{
+    if (!panel || panel->isVisible())
+        return;
+    panel->setVisible(true);
+}
 
 QPlainTextEdit* UIVMLogViewerWidget::logPage(int pIndex) const
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h	(revision 70499)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h	(revision 70500)
@@ -39,4 +39,5 @@
 class UIVMLogViewerBookmarksPanel;
 class UIVMLogViewerFilterPanel;
+class UIVMLogViewerPanel;
 class UIVMLogViewerSearchPanel;
 
@@ -88,7 +89,10 @@
     void sltSave();
 
+    void sltPanelActionTriggered(bool checked);
     void sltShowHideFilterPanel();
     void sltShowHideSearchPanel();
     void sltShowHideBookmarkPanel();
+    /* Handles QAction sync. when a panel is closed (hidden) by panel's own close button */
+    //void sltPanelCloseButton();
 
     /** Handles the search result highlight changes. */
@@ -150,4 +154,7 @@
     const QVector<LogBookmark>* currentBookmarkVector() const;
 
+    void hidePanel(UIVMLogViewerPanel* panel);
+    void showPanel(UIVMLogViewerPanel* panel);
+
     /** Holds whether the dialog is polished. */
     bool m_fIsPolished;
@@ -163,8 +170,9 @@
 
     /** Holds the instance of search-panel. */
-    UIVMLogViewerSearchPanel *m_pSearchPanel;
+    UIVMLogViewerSearchPanel    *m_pSearchPanel;
     /** Holds the instance of filter panel. */
-    UIVMLogViewerFilterPanel *m_pFilterPanel;
+    UIVMLogViewerFilterPanel    *m_pFilterPanel;
     UIVMLogViewerBookmarksPanel *m_pBookmarksPanel;
+    QMap<UIVMLogViewerPanel**, QAction**> m_panelActionMap;
 
     /** Holds the list of log file content. */
