Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 70581)
@@ -341,4 +341,5 @@
 	src/logviewer/UIVMLogViewerPanel.h \
 	src/logviewer/UIVMLogViewerSearchPanel.h \
+	src/logviewer/UIVMLogViewerSettingsPanel.h \
 	src/logviewer/UIVMLogViewerTextEdit.h \
 	src/logviewer/UIVMLogViewerWidget.h \
@@ -661,4 +662,5 @@
 	src/logviewer/UIVMLogViewerPanel.cpp \
 	src/logviewer/UIVMLogViewerSearchPanel.cpp \
+	src/logviewer/UIVMLogViewerSettingsPanel.cpp \
 	src/logviewer/UIVMLogViewerTextEdit.cpp \
 	src/logviewer/UIVMLogViewerWidget.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.cpp	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.cpp	(revision 70581)
@@ -44,4 +44,6 @@
     , m_tabIndex(tabIndex)
     , m_bFiltered(false)
+    , m_bShowLineNumbers(true)
+    , m_bWrapLines(false)
 {
     prepare();
@@ -192,7 +194,7 @@
 {
     int index = -1;
-    for(int i = 0; i < m_bookmarkVector.size(); ++i)
+    for (int i = 0; i < m_bookmarkVector.size(); ++i)
     {
-        if(m_bookmarkVector.at(i).first == bookmark.first)
+        if (m_bookmarkVector.at(i).first == bookmark.first)
         {
             index = i;
@@ -200,5 +202,5 @@
         }
     }
-    if(index != -1)
+    if (index != -1)
         deleteBookmark(index);
 }
@@ -213,5 +215,5 @@
 void UIVMLogPage::scrollToBookmark(int bookmarkIndex)
 {
-    if(!m_pTextEdit)
+    if (!m_pTextEdit)
         return;
     if (bookmarkIndex >= m_bookmarkVector.size())
@@ -243,8 +245,8 @@
 void UIVMLogPage::updateTextEditBookmarkLineSet()
 {
-    if(!m_pTextEdit)
+    if (!m_pTextEdit)
         return;
     QSet<int> bookmarkLinesSet;
-    for(int i = 0; i < m_bookmarkVector.size(); ++i)
+    for (int i = 0; i < m_bookmarkVector.size(); ++i)
     {
         bookmarkLinesSet.insert(m_bookmarkVector.at(i).first);
@@ -260,8 +262,8 @@
 void UIVMLogPage::setFiltered(bool filtered)
 {
-    if(m_bFiltered == filtered)
+    if (m_bFiltered == filtered)
         return;
     m_bFiltered = filtered;
-    if(m_pTextEdit)
+    if (m_pTextEdit)
     {
         m_pTextEdit->setShownTextIsFiltered(m_bFiltered);
@@ -270,2 +272,22 @@
     emit sigLogPageFilteredChanged(m_bFiltered);
 }
+
+void UIVMLogPage::setShowLineNumbers(bool bShowLineNumbers)
+{
+    if(m_bShowLineNumbers == bShowLineNumbers)
+        return;
+    m_bShowLineNumbers = bShowLineNumbers;
+    if(m_pTextEdit)
+        m_pTextEdit->setShowLineNumbers(m_bShowLineNumbers);
+    update();
+}
+
+void UIVMLogPage::setWrapLines(bool bWrapLines)
+{
+    if(m_bWrapLines == bWrapLines)
+        return;
+    m_bWrapLines = bWrapLines;
+    if(m_pTextEdit)
+        m_pTextEdit->setWrapLines(m_bWrapLines);
+    update();
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.h	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.h	(revision 70581)
@@ -92,4 +92,7 @@
     void setFiltered(bool filtered);
 
+    void setShowLineNumbers(bool bShowLineNumbers);
+    void setWrapLines(bool bWrapLines);
+
 private slots:
 
@@ -119,4 +122,6 @@
         if m_bFiltered is false than (m_strLog == m_pTextEdit->text()). */
     bool m_bFiltered;
+    bool m_bShowLineNumbers;
+    bool m_bWrapLines;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp	(revision 70581)
@@ -28,5 +28,5 @@
 # include <QLabel>
 # include <QPushButton>
-# include <QSpacerItem>
+
 /* GUI includes: */
 # include "QIToolButton.h"
@@ -43,5 +43,4 @@
     , m_pDeleteAllButton(0)
     , m_pDeleteCurrentButton(0)
-    , m_pSpacerItem(0)
 {
     prepare();
@@ -56,5 +55,5 @@
     QStringList bList;
     bList << "Bookmarks List";
-    for(int i = 0; i < bookmarkVector.size(); ++i)
+    for (int i = 0; i < bookmarkVector.size(); ++i)
     {
         QString strItem = QString("BookMark %1 at Line %2: %3").arg(QString::number(i)).
@@ -113,8 +112,5 @@
     mainLayout()->addWidget(m_pDeleteAllButton, 0);
 
-
-    m_pSpacerItem = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-    AssertPtrReturnVoid(m_pSpacerItem);
-    mainLayout()->addItem(m_pSpacerItem);
+    mainLayout()->addStretch(4);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h	(revision 70581)
@@ -25,5 +25,4 @@
 class QComboBox;
 class QPushButton;
-class QSpacerItem;
 class QIToolButton;
 
@@ -76,5 +75,4 @@
     QPushButton  *m_pDeleteAllButton;
     QIToolButton *m_pDeleteCurrentButton;
-    QSpacerItem  *m_pSpacerItem;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp	(revision 70581)
@@ -52,5 +52,6 @@
     , m_pMatchWholeWordCheckBox(0)
     , m_pHighlightAllCheckBox(0)
-    , m_pWarningSpacer(0), m_pWarningIcon(0), m_pInfoLabel(0)
+    , m_pWarningIcon(0)
+    , m_pInfoLabel(0)
     , m_iSearchPosition(0)
     , m_iMatchCount(-1)
@@ -270,12 +271,4 @@
     }
 
-    /* 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);
@@ -306,10 +299,5 @@
         mainLayout()->addWidget(m_pInfoLabel);
     }
-
-    m_pSpacerItem = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-    AssertPtrReturnVoid(m_pSpacerItem);
-    {
-        mainLayout()->addItem(m_pSpacerItem);
-    }
+    mainLayout()->addStretch(2);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h	(revision 70581)
@@ -29,5 +29,4 @@
 class QHBoxLayout;
 class QLabel;
-class QSpacerItem;
 class UIMiniCancelButton;
 class UIRoundRectSegmentedButton;
@@ -118,12 +117,10 @@
     QCheckBox   *m_pMatchWholeWordCheckBox;
     QCheckBox   *m_pHighlightAllCheckBox;
-    /** Holds the instance of warning spacer-item we create. */
-    QSpacerItem *m_pWarningSpacer;
+
     /** Holds the instance of warning icon we create. */
     QLabel      *m_pWarningIcon;
     /** Holds the instance of info label we create. */
     QLabel      *m_pInfoLabel;
-    /** Holds the instance of spacer item we create. */
-    QSpacerItem *m_pSpacerItem;
+
     /** Holds the position where we start the next search. */
     int          m_iSearchPosition;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSettingsPanel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSettingsPanel.cpp	(revision 70581)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSettingsPanel.cpp	(revision 70581)
@@ -0,0 +1,99 @@
+/* $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 <QCheckBox>
+
+/* GUI includes: */
+# include "QIToolButton.h"
+# include "UIVMLogViewerSettingsPanel.h"
+# include "UIVMLogViewerWidget.h"
+
+#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
+
+UIVMLogViewerSettingsPanel::UIVMLogViewerSettingsPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer)
+    : UIVMLogViewerPanel(pParent, pViewer)
+    , m_pLineNumberCheckBox(0)
+    , m_pWrapLinesCheckBox(0)
+{
+    prepare();
+}
+
+void UIVMLogViewerSettingsPanel::setShowLineNumbers(bool bShowLineNumbers)
+{
+    if(!m_pLineNumberCheckBox)
+        return;
+    if(m_pLineNumberCheckBox->isChecked() == bShowLineNumbers)
+        return;
+    m_pLineNumberCheckBox->setChecked(bShowLineNumbers);
+}
+
+void UIVMLogViewerSettingsPanel::setWrapLines(bool bWrapLines)
+{
+    if(!m_pWrapLinesCheckBox)
+        return;
+    if(m_pWrapLinesCheckBox->isChecked() == bWrapLines)
+        return;
+    m_pWrapLinesCheckBox->setChecked(bWrapLines);
+}
+
+
+void UIVMLogViewerSettingsPanel::prepareWidgets()
+{
+    if (!mainLayout())
+        return;
+
+    m_pLineNumberCheckBox = new QCheckBox(this);
+    AssertPtrReturnVoid(m_pLineNumberCheckBox);
+    m_pLineNumberCheckBox->setChecked(true);
+    mainLayout()->addWidget(m_pLineNumberCheckBox, 0, Qt::AlignLeft);
+
+    m_pWrapLinesCheckBox = new QCheckBox(this);
+    AssertPtrReturnVoid(m_pWrapLinesCheckBox);
+    m_pWrapLinesCheckBox->setChecked(false);
+    mainLayout()->addWidget(m_pWrapLinesCheckBox, 0, Qt::AlignLeft);
+
+    mainLayout()->addStretch(2);
+}
+
+void UIVMLogViewerSettingsPanel::prepareConnections()
+{
+    if (m_pLineNumberCheckBox)
+        connect(m_pLineNumberCheckBox, &QCheckBox::toggled, this, &UIVMLogViewerSettingsPanel::sigShowLineNumbers);
+    if (m_pWrapLinesCheckBox)
+        connect(m_pWrapLinesCheckBox, &QCheckBox::toggled, this, &UIVMLogViewerSettingsPanel::sigWrapLines);
+}
+
+void UIVMLogViewerSettingsPanel::retranslateUi()
+{
+    UIVMLogViewerPanel::retranslateUi();
+    m_pLineNumberCheckBox->setText(UIVMLogViewerWidget::tr("Show Line Numbers"));
+    m_pLineNumberCheckBox->setToolTip(UIVMLogViewerWidget::tr("Show Line Numbers"));
+
+    m_pWrapLinesCheckBox->setText(UIVMLogViewerWidget::tr("Wrap Lines"));
+    m_pWrapLinesCheckBox->setToolTip(UIVMLogViewerWidget::tr("Wrap Lines"));
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSettingsPanel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSettingsPanel.h	(revision 70581)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSettingsPanel.h	(revision 70581)
@@ -0,0 +1,64 @@
+/* $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 ___UIVMLogViewerSettingssPanel_h___
+#define ___UIVMLogViewerSettingssPanel_h___
+
+/* GUI includes: */
+#include "UIVMLogViewerPanel.h"
+
+/* Forward declarations: */
+class QCheckBox;
+class UIVMLogViewerWidget;
+
+/** UIVMLogViewerPanel extension providing GUI to manage logviewer settings. */
+class UIVMLogViewerSettingsPanel : public UIVMLogViewerPanel
+{
+    Q_OBJECT;
+
+signals:
+
+    void sigShowLineNumbers(bool show);
+    void sigWrapLines(bool show);
+
+public:
+
+    UIVMLogViewerSettingsPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer);
+
+    void setShowLineNumbers(bool bShowLineNumbers);
+    void setWrapLines(bool bWrapLines);
+
+public slots:
+
+
+protected:
+
+    virtual void prepareWidgets() /* override */;
+    virtual void prepareConnections() /* override */;
+
+    /** Handles the translation event. */
+    void retranslateUi();
+
+private slots:
+
+private:
+
+    QCheckBox   *m_pLineNumberCheckBox;
+    QCheckBox   *m_pWrapLinesCheckBox;
+};
+
+#endif /* !___UIVMLogViewerSettingsPanel_h___ */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp	(revision 70581)
@@ -120,5 +120,5 @@
     QSize sizeHint() const
     {
-        if(!m_pTextEdit)
+        if (!m_pTextEdit)
             return QSize();
         return QSize(m_pTextEdit->lineNumberAreaWidth(), 0);
@@ -129,5 +129,5 @@
     void paintEvent(QPaintEvent *event)
     {
-        if(m_pTextEdit)
+        if (m_pTextEdit)
             m_pTextEdit->lineNumberAreaPaintEvent(event);
     }
@@ -154,4 +154,6 @@
     , m_mouseCursorLine(-1)
     , m_bShownTextIsFiltered(false)
+    , m_bShowLineNumbers(true)
+    , m_bWrapLines(false)
 {
     setMouseTracking(true);
@@ -190,5 +192,5 @@
     setWordWrapMode(QTextOption::NoWrap);
     setReadOnly(true);
-    if(m_pLineNumberArea)
+    if (m_pLineNumberArea)
         m_pLineNumberArea->setFont(font);
 
@@ -197,4 +199,7 @@
 int UIVMLogViewerTextEdit::lineNumberAreaWidth()
 {
+    if(!m_bShowLineNumbers)
+        return 0;
+
     int digits = 1;
     int max = qMax(1, blockCount());
@@ -211,4 +216,6 @@
 void UIVMLogViewerTextEdit::lineNumberAreaPaintEvent(QPaintEvent *event)
 {
+    if(!m_bShowLineNumbers)
+        return;
     QPainter painter(m_pLineNumberArea);
     painter.fillRect(event->rect(), Qt::lightGray);
@@ -228,5 +235,5 @@
                 painter.drawPath(path);
             }
-            if((blockNumber + 1) == m_mouseCursorLine)
+            if ((blockNumber + 1) == m_mouseCursorLine && underMouse())
             {
                 painter.setPen(Qt::red);
@@ -249,5 +256,5 @@
     /* If shown text is filtered, do not create Bookmark action since
        we disable all bookmarking related functionalities in this case. */
-    if(m_bShownTextIsFiltered)
+    if (m_bShownTextIsFiltered)
     {
         QPlainTextEdit::contextMenuEvent(pEvent);
@@ -278,5 +285,5 @@
         int rectX = viewport()->width() - rectWidth;
         int rectMargin = 4;
-        if(verticalScrollBar())
+        if (verticalScrollBar())
             rectX -= verticalScrollBar()->width();
         QPainter painter(viewport());
@@ -306,4 +313,11 @@
 }
 
+void UIVMLogViewerTextEdit::leaveEvent(QEvent * pEvent)
+{
+    QPlainTextEdit::leaveEvent(pEvent);
+    /* Force a redraw as mouse leaves this to remove the mouse
+       cursor track rectangle (the red rectangle we draw on the line number area. */
+    update();
+}
 
 void UIVMLogViewerTextEdit::sltUpdateLineNumberAreaWidth(int /* newBlockCount */)
@@ -331,5 +345,5 @@
 {
     UIIndicatorScrollBar* vScrollBar = qobject_cast<UIIndicatorScrollBar*>(verticalScrollBar());
-    if(vScrollBar)
+    if (vScrollBar)
         vScrollBar->setMarkingsVector(vector);
 }
@@ -338,5 +352,5 @@
 {
     UIIndicatorScrollBar* vScrollBar = qobject_cast<UIIndicatorScrollBar*>(verticalScrollBar());
-    if(vScrollBar)
+    if (vScrollBar)
         vScrollBar->clearMarkingsVector();
 }
@@ -345,5 +359,5 @@
 {
     QTextDocument* pDocument = document();
-    if(!pDocument)
+    if (!pDocument)
         return;
 
@@ -357,10 +371,10 @@
 {
     int height = 0;
-    if(viewport())
+    if (viewport())
         height = viewport()->height();
-    if(verticalScrollBar() && verticalScrollBar()->isVisible())
+    if (verticalScrollBar() && verticalScrollBar()->isVisible())
         height -= horizontalScrollBar()->height();
     int singleLineHeight = fontMetrics().lineSpacing();
-    if(singleLineHeight == 0)
+    if (singleLineHeight == 0)
         return 0;
     return height / singleLineHeight;
@@ -392,10 +406,10 @@
 void UIVMLogViewerTextEdit::toggleBookmark(const QPair<int, QString>& bookmark)
 {
-    if(m_bShownTextIsFiltered)
+    if (m_bShownTextIsFiltered)
         return;
 
     int lineNumber = bookmark.first;
 
-    if(m_bookmarkLineSet.contains(lineNumber))
+    if (m_bookmarkLineSet.contains(lineNumber))
         emit sigDeleteBookmark(bookmark);
     else
@@ -405,8 +419,25 @@
 void UIVMLogViewerTextEdit::setShownTextIsFiltered(bool warning)
 {
-    if(m_bShownTextIsFiltered == warning)
+    if (m_bShownTextIsFiltered == warning)
         return;
     m_bShownTextIsFiltered = warning;
 }
 
+void UIVMLogViewerTextEdit::setShowLineNumbers(bool bShowLineNumbers)
+{
+    if(m_bShowLineNumbers == bShowLineNumbers)
+        return;
+    m_bShowLineNumbers = bShowLineNumbers;
+    emit updateRequest(viewport()->rect(), 0);
+}
+
+void UIVMLogViewerTextEdit::setWrapLines(bool bWrapLines)
+{
+    if(m_bWrapLines == bWrapLines)
+        return;
+    m_bWrapLines = bWrapLines;
+    update();
+}
+
+
 #include "UIVMLogViewerTextEdit.moc"
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.h	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.h	(revision 70581)
@@ -49,4 +49,7 @@
     void setShownTextIsFiltered(bool warning);
 
+    void setShowLineNumbers(bool bShowLineNumbers);
+    void setWrapLines(bool bWrapLines);
+
 protected:
 
@@ -55,4 +58,5 @@
     virtual void resizeEvent(QResizeEvent *pEvent) /* override */;
     virtual void mouseMoveEvent(QMouseEvent *pEvent) /* override */;
+    virtual void leaveEvent(QEvent * event) /* override */;
 
 private slots:
@@ -84,4 +88,7 @@
         And we dont display bookmarks and adding/deleting bookmarks are disabled. */
     bool                 m_bShownTextIsFiltered;
+    bool                 m_bShowLineNumbers;
+    bool                 m_bWrapLines;
+
     friend class UILineNumberArea;
 };
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp	(revision 70581)
@@ -43,4 +43,5 @@
 # include "UIVMLogViewerFilterPanel.h"
 # include "UIVMLogViewerSearchPanel.h"
+# include "UIVMLogViewerSettingsPanel.h"
 # include "UIToolBar.h"
 
@@ -61,4 +62,5 @@
     , m_pFilterPanel(0)
     , m_pBookmarksPanel(0)
+    , m_pSettingsPanel(0)
     , m_pMainLayout(0)
     , m_enmEmbedding(enmEmbedding)
@@ -70,5 +72,7 @@
     , m_pActionBookmark(0)
     , m_pMenu(0)
-    , m_bMarkBookmarkLines(0)
+    , m_bShowLineNumbers(true)
+    , m_bWrapLines(false)
+
 {
     /* Prepare VM Log-Viewer: */
@@ -110,5 +114,5 @@
 {
     UIVMLogPage* logPage = currentLogPage();
-    if(!logPage)
+    if (!logPage)
         return;
     logPage->deleteBookmark(index);
@@ -120,5 +124,5 @@
 {
     UIVMLogPage* logPage = currentLogPage();
-    if(!logPage)
+    if (!logPage)
         return;
     logPage->deleteAllBookmarks();
@@ -130,5 +134,5 @@
 void UIVMLogViewerWidget::sltUpdateBookmarkPanel()
 {
-    if(!currentLogPage() || !m_pBookmarksPanel)
+    if (!currentLogPage() || !m_pBookmarksPanel)
         return;
     disconnect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigBookmarkSelected,
@@ -141,5 +145,5 @@
 void UIVMLogViewerWidget::gotoBookmark(int bookmarkIndex)
 {
-    if(!currentLogPage())
+    if (!currentLogPage())
         return;
     currentLogPage()->scrollToBookmark(bookmarkIndex);
@@ -277,5 +281,5 @@
 void UIVMLogViewerWidget::sltFilterApplied(bool isOriginal)
 {
-    if(currentLogPage())
+    if (currentLogPage())
         currentLogPage()->setFiltered(!isOriginal);
     /* Reapply the search to get highlighting etc. correctly */
@@ -288,7 +292,7 @@
     /* Disable bookmark panel since bookmarks are stored as line numbers within
        the original log text and does not mean much in a reduced/filtered one. */
-    if(m_pBookmarksPanel)
-    {
-        if(isFiltered)
+    if (m_pBookmarksPanel)
+    {
+        if (isFiltered)
         {
             m_pBookmarksPanel->setEnabled(false);
@@ -300,4 +304,35 @@
 }
 
+void UIVMLogViewerWidget::sltShowLineNumbers(bool bShowLineNumbers)
+{
+    if (m_bShowLineNumbers == bShowLineNumbers)
+        return;
+
+    m_bShowLineNumbers = bShowLineNumbers;
+    /* Set all log page instances. */
+    for (int i = 0; i < m_logPageList.size(); ++i)
+    {
+        UIVMLogPage* pLogPage = qobject_cast<UIVMLogPage*>(m_logPageList[i]);
+        if (pLogPage)
+            pLogPage->setShowLineNumbers(m_bShowLineNumbers);
+    }
+}
+
+void UIVMLogViewerWidget::sltWrapLines(bool bWrapLines)
+{
+    if (m_bWrapLines == bWrapLines)
+        return;
+
+    m_bWrapLines = bWrapLines;
+    /* Set all log page instances. */
+    for (int i = 0; i < m_logPageList.size(); ++i)
+    {
+        UIVMLogPage* pLogPage = qobject_cast<UIVMLogPage*>(m_logPageList[i]);
+        if (pLogPage)
+            pLogPage->setWrapLines(m_bWrapLines);
+    }
+}
+
+
 void UIVMLogViewerWidget::setMachine(const CMachine &machine)
 {
@@ -330,4 +365,5 @@
     m_panelActionMap.insert(m_pSearchPanel, m_pActionFind);
     m_panelActionMap.insert(m_pFilterPanel, m_pActionFilter);
+    m_panelActionMap.insert(m_pSettingsPanel, m_pActionSettings);
 }
 
@@ -389,4 +425,18 @@
                 this, &UIVMLogViewerWidget::gotoBookmark);
     }
+
+    m_pSettingsPanel = new UIVMLogViewerSettingsPanel(this, this);
+    AssertPtrReturnVoid(m_pSettingsPanel);
+    {
+        installEventFilter(m_pSettingsPanel);
+        m_pSettingsPanel->hide();
+        /* Initialize settings' panel checkboxes: */
+        m_pSettingsPanel->setShowLineNumbers(m_bShowLineNumbers);
+        m_pSettingsPanel->setWrapLines(m_bWrapLines);
+
+        m_pMainLayout->insertWidget(5, m_pSettingsPanel);
+        connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigShowLineNumbers, this, &UIVMLogViewerWidget::sltShowLineNumbers);
+        connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigWrapLines, this, &UIVMLogViewerWidget::sltWrapLines);
+    }
 }
 
@@ -422,4 +472,13 @@
     }
 
+    /* Create and configure 'Settings' action: */
+    m_pActionSettings = new QAction(this);
+    AssertPtrReturnVoid(m_pActionSettings);
+    {
+        m_pActionSettings->setCheckable(true);
+        connect(m_pActionSettings, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionTriggered);
+    }
+
+
     /* Create and configure 'Refresh' action: */
     m_pActionRefresh = new QAction(this);
@@ -469,4 +528,8 @@
     if (m_pActionBookmark)
         m_pActionBookmark->setIcon(UIIconPool::iconSet(QString(":/%1_bookmark_24px.png").arg(strPrefix),
+                                                       QString(":/%1_bookmark_disabled_24px.png").arg(strPrefix)));
+
+    if (m_pActionSettings)
+        m_pActionSettings->setIcon(UIIconPool::iconSet(QString(":/%1_bookmark_24px.png").arg(strPrefix),
                                                        QString(":/%1_bookmark_disabled_24px.png").arg(strPrefix)));
 }
@@ -497,4 +560,7 @@
         if (m_pActionBookmark)
             m_pToolBar->addAction(m_pActionBookmark);
+
+        if (m_pActionSettings)
+            m_pToolBar->addAction(m_pActionSettings);
 
 #ifdef VBOX_WS_MAC
@@ -528,5 +594,6 @@
         if (m_pActionBookmark)
             m_pMenu->addAction(m_pActionBookmark);
-
+        if (m_pActionSettings)
+            m_pMenu->addAction(m_pActionSettings);
     }
 }
@@ -576,4 +643,11 @@
         m_pActionBookmark->setToolTip(tr("Bookmark the line"));
         m_pActionBookmark->setStatusTip(tr("Bookmark the line"));
+    }
+
+    if (m_pActionSettings)
+    {
+        m_pActionSettings->setText(tr("&Settings"));
+        m_pActionSettings->setToolTip(tr("LogViewer Settings"));
+        m_pActionSettings->setStatusTip(tr("LogViewer Settings"));
     }
 
@@ -606,5 +680,5 @@
 
     /* Make sure the log view widget has the focus: */
-    if(currentLogPage())
+    if (currentLogPage())
         currentLogPage()->setFocus();
 }
@@ -761,7 +835,11 @@
     /* Create page-container: */
     UIVMLogPage* pLogPage = new UIVMLogPage(this);
+    AssertPtrReturnVoid(pLogPage);
+
     connect(pLogPage, &UIVMLogPage::sigBookmarksUpdated, this, &UIVMLogViewerWidget::sltUpdateBookmarkPanel);
     connect(pLogPage, &UIVMLogPage::sigLogPageFilteredChanged, this, &UIVMLogViewerWidget::sltLogPageFilteredChanged);
-    AssertPtrReturnVoid(pLogPage);
+    /* Initialize setting for this log page */
+    pLogPage->setShowLineNumbers(m_bShowLineNumbers);
+    pLogPage->setWrapLines(m_bWrapLines);
     /* Set the file name only if we really have log file to read. */
     if (!noLogsToShow)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h	(revision 70580)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h	(revision 70581)
@@ -42,4 +42,5 @@
 class UIVMLogViewerPanel;
 class UIVMLogViewerSearchPanel;
+class UIVMLogViewerSettingsPanel;
 
 /* Type definitions: */
@@ -115,4 +116,7 @@
     void sltLogPageFilteredChanged(bool isFiltered);
 
+    void sltShowLineNumbers(bool bShowLineNumbers);
+    void sltWrapLines(bool bWrapLine);
+
 private:
 
@@ -174,17 +178,12 @@
     QVector<QWidget*>  m_logPageList;
 
-    /** Holds the index to the current tab: */
-    //int          m_iCurrentTabIndex;
-
-    /** Holds the instance of search-panel. */
-    UIVMLogViewerSearchPanel    *m_pSearchPanel;
-    /** Holds the instance of filter panel. */
-    UIVMLogViewerFilterPanel    *m_pFilterPanel;
-    UIVMLogViewerBookmarksPanel *m_pBookmarksPanel;
-    QMap<UIVMLogViewerPanel*, QAction*> m_panelActionMap;
-
-    /** Holds the list of log file content. */
-    // VMLogMap             m_logMap;
-    // mutable BookmarkMap  m_bookmarkMap;
+    /** @name Panel instances and a QMap for mapping panel instances to related actions.
+      * @{ */
+        UIVMLogViewerSearchPanel    *m_pSearchPanel;
+        UIVMLogViewerFilterPanel    *m_pFilterPanel;
+        UIVMLogViewerBookmarksPanel *m_pBookmarksPanel;
+        UIVMLogViewerSettingsPanel  *m_pSettingsPanel;
+        QMap<UIVMLogViewerPanel*, QAction*> m_panelActionMap;
+    /** @} */
     QVBoxLayout         *m_pMainLayout;
 
@@ -194,23 +193,26 @@
     /** @name Toolbar and menu variables.
       * @{ */
-        /** Holds the toolbar widget instance. */
         UIToolBar *m_pToolBar;
-        /** Holds the Find action instance. */
         QAction   *m_pActionFind;
-        /** Holds the Filter action instance. */
         QAction   *m_pActionFilter;
-        /** Holds the Refresh action instance. */
         QAction   *m_pActionRefresh;
-        /** Holds the Save action instance. */
         QAction   *m_pActionSave;
-        /** Holds the Bookmark action instance. */
         QAction   *m_pActionBookmark;
-        /** Holds the menu object instance. */
+        QAction   *m_pActionSettings;
         QMenu     *m_pMenu;
     /** @} */
-    const bool     m_bMarkBookmarkLines;
+
+    /** @name Toolbar and menu variables.
+     * @{ */
+        /** Showing/hiding line numbers and line wraping settings are set per
+            UIVMLogViewerWidget and applies to all log pages (all tabs) */
+        bool m_bShowLineNumbers;
+        bool m_bWrapLines;
+    /** @} */
+
     friend class UIVMLogViewerBookmarksPanel;
     friend class UIVMLogViewerFilterPanel;
     friend class UIVMLogViewerSearchPanel;
+    friend class UIVMLogViewerSettingsPanel;
     friend class UIVMLogViewerPanel;
 };
