VirtualBox

Changeset 73693 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 15, 2018 2:33:09 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: Log Viewer: A bit of cleanup/rework required for integration into new VirtualBox Manager UI.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
7 edited

Legend:

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

    r72713 r73693  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVMLogViewer class implementation.
     3 * VBox Qt GUI - UIVMLogViewerDialog class implementation.
    44 */
    55
    66/*
    7  * Copyright (C) 2010-2017 Oracle Corporation
     7 * Copyright (C) 2010-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2727# include <QKeyEvent>
    2828# include <QLabel>
    29 # include <QScrollBar>
    3029# include <QPlainTextEdit>
    3130# include <QPushButton>
     31# include <QScrollBar>
    3232# include <QVBoxLayout>
    3333
     
    4141# ifdef VBOX_WS_MAC
    4242#  include "VBoxUtils-darwin.h"
    43 # endif /* VBOX_WS_MAC */
     43# endif
    4444
    4545#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    4646
    47 UIVMLogViewerDialogFactory::UIVMLogViewerDialogFactory(const CMachine &machine)
    48     :m_comMachine(machine)
     47
     48/*********************************************************************************************************************************
     49*   Class UIVMLogViewerDialogFactory implementation.                                                                             *
     50*********************************************************************************************************************************/
     51
     52UIVMLogViewerDialogFactory::UIVMLogViewerDialogFactory(const CMachine &comMachine /* = CMachine() */)
     53    : m_comMachine(comMachine)
    4954{
    5055}
     
    5560}
    5661
    57 UIVMLogViewerDialog::UIVMLogViewerDialog(QWidget *pCenterWidget, const CMachine &machine)
     62
     63/*********************************************************************************************************************************
     64*   Class UIVMLogViewerDialog implementation.                                                                                    *
     65*********************************************************************************************************************************/
     66
     67UIVMLogViewerDialog::UIVMLogViewerDialog(QWidget *pCenterWidget, const CMachine &comMachine)
    5868    : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
    59     , m_comMachine(machine)
     69    , m_comMachine(comMachine)
    6070{
    6171}
     
    6373void UIVMLogViewerDialog::retranslateUi()
    6474{
    65     button(ButtonType_Close)->setText(UIVMLogViewerWidget::tr("Close"));
    66     /* Setup a dialog caption: */
     75    /* Translate window title: */
    6776    if (!m_comMachine.isNull())
    6877        setWindowTitle(tr("%1 - Log Viewer").arg(m_comMachine.GetName()));
    6978    else
    7079        setWindowTitle(UIVMLogViewerWidget::tr("Log Viewer"));
     80
     81    /* Translate buttons: */
     82    button(ButtonType_Close)->setText(UIVMLogViewerWidget::tr("Close"));
     83}
     84
     85void UIVMLogViewerDialog::configure()
     86{
     87    /* Apply window icons: */
     88    setWindowIcon(UIIconPool::iconSetFull(":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png"));
    7189}
    7290
     
    7492{
    7593    /* Create widget: */
    76     UIVMLogViewerWidget *pWidget = new UIVMLogViewerWidget(EmbedTo_Dialog, this, m_comMachine);
     94    UIVMLogViewerWidget *pWidget = new UIVMLogViewerWidget(EmbedTo_Dialog, m_comMachine, this);
    7795    if (pWidget)
    7896    {
     
    83101        setWidgetToolbar(pWidget->toolbar());
    84102#endif
     103        connect(pWidget, &UIVMLogViewerWidget::sigSetCloseButtonShortCut,
     104                this, &UIVMLogViewerDialog::sltSetCloseButtonShortCut);
     105
    85106        /* Add into layout: */
    86107        centralWidget()->layout()->addWidget(pWidget);
    87         connect(pWidget, &UIVMLogViewerWidget::sigSetCloseButtonShortCut,
    88                 this, &UIVMLogViewerDialog::sltSetCloseButtonShortCut);
    89108    }
    90 }
    91 
    92 void UIVMLogViewerDialog::configure()
    93 {
    94     /* Apply window icons: */
    95     setWindowIcon(UIIconPool::iconSetFull(":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png"));
    96109}
    97110
    98111void UIVMLogViewerDialog::finalize()
    99112{
     113    /* Apply language settings: */
    100114    retranslateUi();
     115
     116    // WTF? Why here?
    101117    button(ButtonType_Close)->setShortcut(Qt::Key_Escape);
    102118}
     
    104120void UIVMLogViewerDialog::loadSettings()
    105121{
    106     const UIVMLogViewerWidget *pWidget = qobject_cast<const UIVMLogViewerWidget *>(widget());
     122    /* Acquire widget: */
     123    const UIVMLogViewerWidget *pWidget = qobject_cast<const UIVMLogViewerWidget*>(widget());
    107124
    108125    /* Restore window geometry: */
    109     /* Getting available geometry to calculate default geometry: */
    110126    const QRect desktopRect = gpDesktop->availableGeometry(this);
    111127    int iDefaultWidth = desktopRect.width() / 2;
    112128    int iDefaultHeight = desktopRect.height() * 3 / 4;
    113129
    114     /* Try obtain the default width of the current logviewer */
     130    /* Try obtain the default width of the current logviewer: */
    115131    if (pWidget)
    116132    {
    117         int width =  pWidget->defaultLogPageWidth();
    118         if (width != 0)
    119             iDefaultWidth = width;
     133        int iWidth =  pWidget->defaultLogPageWidth();
     134        if (iWidth != 0)
     135            iDefaultWidth = iWidth;
    120136    }
    121137
     
    153169}
    154170
    155 void UIVMLogViewerDialog::sltSetCloseButtonShortCut(QKeySequence shortCut)
     171void UIVMLogViewerDialog::sltSetCloseButtonShortCut(QKeySequence shortcut)
    156172{
    157173    if (button(ButtonType_Close))
    158         button(ButtonType_Close)->setShortcut(shortCut);
     174        button(ButtonType_Close)->setShortcut(shortcut);
    159175}
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h

    r72713 r73693  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVMLogViewer class declaration.
     3 * VBox Qt GUI - UIVMLogViewerDialog class declaration.
    44 */
    55
    66/*
    7  * Copyright (C) 2010-2017 Oracle Corporation
     7 * Copyright (C) 2010-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3939
    4040
    41 /** QIManagerDialogFactory  used as a factory for Virtual Media Manager dialog. */
     41/** QIManagerDialogFactory extension used as a factory for Log Viewer dialog. */
    4242class SHARED_LIBRARY_STUFF UIVMLogViewerDialogFactory : public QIManagerDialogFactory
    4343{
    4444public:
    45     UIVMLogViewerDialogFactory(const CMachine &machine);
     45
     46    /** Constructs Log Viewer factory acquiring additional arguments.
     47      * @param  comMachine  Brings the machine for which VM Log-Viewer is requested. */
     48    UIVMLogViewerDialogFactory(const CMachine &comMachine = CMachine());
    4649
    4750protected:
     51
    4852    /** Creates derived @a pDialog instance.
    4953      * @param  pCenterWidget  Brings the widget to center wrt. pCenterWidget. */
    5054    virtual void create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) /* override */;
    51     CMachine m_comMachine;
     55
     56    /** Holds the machine reference. */
     57    CMachine      m_comMachine;
    5258};
    5359
    5460
    55 /** A QIDialog to display machine logs. */
     61/** QIManagerDialog extension providing GUI with the dialog displaying machine logs. */
    5662class SHARED_LIBRARY_STUFF UIVMLogViewerDialog : public QIWithRetranslateUI<QIManagerDialog>
    5763{
     
    6066public:
    6167
    62     UIVMLogViewerDialog(QWidget *pCenterWidget, const CMachine &machine);
     68    /** Constructs Log Viewer dialog.
     69      * @param  pCenterWidget  Brings the widget reference to center according to.
     70      * @param  comMachine     Brings the machine reference. */
     71    UIVMLogViewerDialog(QWidget *pCenterWidget, const CMachine &comMachine);
    6372
    6473protected:
    6574
     75    /** @name Event-handling stuff.
     76      * @{ */
     77        /** Handles translation event. */
     78        virtual void retranslateUi() /* override */;
     79    /** @} */
     80
    6681    /** @name Prepare/cleanup cascade.
    6782     * @{ */
     83        /** Configures all. */
    6884        virtual void configure() /* override */;
     85        /** Configures central-widget. */
    6986        virtual void configureCentralWidget() /* override */;
     87        /** Perform final preparations. */
    7088        virtual void finalize() /* override */;
     89        /** Loads dialog setting such as geometry from extradata. */
     90        virtual void loadSettings() /* override */;
     91
     92        /** Saves dialog setting into extradata. */
    7193        virtual void saveSettings() const /* override */;
    72         virtual void loadSettings() /* override */;
    7394    /** @} */
    74     /* Reads the related extradata to determine if the dialog should be maximized. */
    75     virtual bool shouldBeMaximized() const /* override */;
     95
     96    /** @name Functions related to geometry restoration.
     97     * @{ */
     98        /** Returns whether the window should be maximized when geometry being restored. */
     99        virtual bool shouldBeMaximized() const /* override */;
     100    /** @} */
    76101
    77102private slots:
    78103
    79     void sltSetCloseButtonShortCut(QKeySequence shortCut);
     104    /** Must be handles soemthing related to close @a shortcut. */
     105    void sltSetCloseButtonShortCut(QKeySequence shortcut);
    80106
    81107private:
    82108
    83     void retranslateUi();
    84     CMachine m_comMachine;
     109    /** Holds the machine reference. */
     110    CMachine  m_comMachine;
    85111};
    86112
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r72724 r73693  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVMLogViewer class implementation.
     3 * VBox Qt GUI - UIVMLogViewerWidget class implementation.
    44 */
    55
    66/*
    7  * Copyright (C) 2010-2017 Oracle Corporation
     7 * Copyright (C) 2010-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5757
    5858
    59 UIVMLogViewerWidget::UIVMLogViewerWidget(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */, const CMachine &machine /* = CMachine() */)
     59UIVMLogViewerWidget::UIVMLogViewerWidget(EmbedTo enmEmbedding,
     60                                         const CMachine &comMachine /* = CMachine() */,
     61                                         QWidget *pParent /* = 0 */)
    6062    : QIWithRetranslateUI<QWidget>(pParent)
     63    , m_enmEmbedding(enmEmbedding)
     64    , m_comMachine(comMachine)
    6165    , m_fIsPolished(false)
    62     , m_comMachine(machine)
    6366    , m_pTabWidget(0)
    6467    , m_pSearchPanel(0)
     
    6770    , m_pSettingsPanel(0)
    6871    , m_pMainLayout(0)
    69     , m_enmEmbedding(enmEmbedding)
    7072    , m_pToolBar(0)
    7173    , m_pActionFind(0)
     
    8688UIVMLogViewerWidget::~UIVMLogViewerWidget()
    8789{
    88     saveSettings();
    8990    /* Cleanup VM Log-Viewer: */
    9091    cleanup();
    91 }
    92 
    93 void UIVMLogViewerWidget::loadSettings()
    94 {
    95     m_bWrapLines = gEDataManager->logViewerWrapLines();
    96     m_bShowLineNumbers = gEDataManager->logViewerShowLineNumbers();
    97     QFont loadedFont = gEDataManager->logViewerFont();
    98     if (loadedFont != QFont())
    99         m_font = loadedFont;
    100 }
    101 
    102 void UIVMLogViewerWidget::saveSettings()
    103 {
    104     gEDataManager->setLogViweverSettings(m_font, m_bWrapLines, m_bShowLineNumbers);
    10592}
    10693
     
    125112}
    126113
     114void UIVMLogViewerWidget::setMachine(const CMachine &comMachine)
     115{
     116    if (comMachine == m_comMachine)
     117        return;
     118    m_comMachine = comMachine;
     119    sltRefresh();
     120}
     121
     122QFont UIVMLogViewerWidget::currentFont() const
     123{
     124    const UIVMLogPage* logPage = currentLogPage();
     125    if (!logPage)
     126        return QFont();
     127    return logPage->currentFont();
     128}
     129
    127130bool UIVMLogViewerWidget::shouldBeMaximized() const
    128131{
    129132    return gEDataManager->logWindowShouldBeMaximized();
    130 }
    131 
    132 void UIVMLogViewerWidget::sltDeleteBookmark(int index)
    133 {
    134     UIVMLogPage* logPage = currentLogPage();
    135     if (!logPage)
    136         return;
    137     logPage->deleteBookmark(index);
    138     if (m_pBookmarksPanel)
    139         m_pBookmarksPanel->updateBookmarkList(logPage->bookmarkVector());
    140 }
    141 
    142 void UIVMLogViewerWidget::sltDeleteAllBookmarks()
    143 {
    144     UIVMLogPage* logPage = currentLogPage();
    145     if (!logPage)
    146         return;
    147     logPage->deleteAllBookmarks();
    148 
    149     if (m_pBookmarksPanel)
    150         m_pBookmarksPanel->updateBookmarkList(logPage->bookmarkVector());
    151 }
    152 
    153 void UIVMLogViewerWidget::sltUpdateBookmarkPanel()
    154 {
    155     if (!currentLogPage() || !m_pBookmarksPanel)
    156         return;
    157     m_pBookmarksPanel->updateBookmarkList(currentLogPage()->bookmarkVector());
    158 }
    159 
    160 void UIVMLogViewerWidget::gotoBookmark(int bookmarkIndex)
    161 {
    162     if (!currentLogPage())
    163         return;
    164     currentLogPage()->scrollToBookmark(bookmarkIndex);
    165 }
    166 
    167 void UIVMLogViewerWidget::sltPanelActionTriggered(bool checked)
    168 {
    169     QAction *pSenderAction = qobject_cast<QAction*>(sender());
    170     if (!pSenderAction)
    171         return;
    172     UIVMLogViewerPanel* pPanel = 0;
    173     /* Look for the sender() within the m_panelActionMap's values: */
    174     for (QMap<UIVMLogViewerPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin();
    175         iterator != m_panelActionMap.end(); ++iterator)
    176     {
    177         if (iterator.value() == pSenderAction)
    178             pPanel = iterator.key();
    179     }
    180     if (!pPanel)
    181         return;
    182     if (checked)
    183         showPanel(pPanel);
    184     else
    185         hidePanel(pPanel);
    186133}
    187134
     
    238185    m_pTabWidget->setCurrentIndex(tabIndex);
    239186    sltTabIndexChange(tabIndex);
     187
    240188    /* Enable/Disable toolbar actions (except Refresh) & tab widget according log presence: */
    241189    if (m_pActionFind)
     
    247195    if (m_pActionBookmarks)
    248196        m_pActionBookmarks->setEnabled(!noLogsToShow);
    249 
    250197    if (m_pActionSettings)
    251198        m_pActionSettings->setEnabled(!noLogsToShow);
     199
    252200    m_pTabWidget->show();
    253201    if (m_pSearchPanel && m_pSearchPanel->isVisible())
     
    304252}
    305253
     254void UIVMLogViewerWidget::sltDeleteBookmark(int index)
     255{
     256    UIVMLogPage* logPage = currentLogPage();
     257    if (!logPage)
     258        return;
     259    logPage->deleteBookmark(index);
     260    if (m_pBookmarksPanel)
     261        m_pBookmarksPanel->updateBookmarkList(logPage->bookmarkVector());
     262}
     263
     264void UIVMLogViewerWidget::sltDeleteAllBookmarks()
     265{
     266    UIVMLogPage* logPage = currentLogPage();
     267    if (!logPage)
     268        return;
     269    logPage->deleteAllBookmarks();
     270
     271    if (m_pBookmarksPanel)
     272        m_pBookmarksPanel->updateBookmarkList(logPage->bookmarkVector());
     273}
     274
     275void UIVMLogViewerWidget::sltUpdateBookmarkPanel()
     276{
     277    if (!currentLogPage() || !m_pBookmarksPanel)
     278        return;
     279    m_pBookmarksPanel->updateBookmarkList(currentLogPage()->bookmarkVector());
     280}
     281
     282void UIVMLogViewerWidget::gotoBookmark(int bookmarkIndex)
     283{
     284    if (!currentLogPage())
     285        return;
     286    currentLogPage()->scrollToBookmark(bookmarkIndex);
     287}
     288
     289void UIVMLogViewerWidget::sltPanelActionToggled(bool fChecked)
     290{
     291    QAction *pSenderAction = qobject_cast<QAction*>(sender());
     292    if (!pSenderAction)
     293        return;
     294    UIVMLogViewerPanel* pPanel = 0;
     295    /* Look for the sender() within the m_panelActionMap's values: */
     296    for (QMap<UIVMLogViewerPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin();
     297        iterator != m_panelActionMap.end(); ++iterator)
     298    {
     299        if (iterator.value() == pSenderAction)
     300            pPanel = iterator.key();
     301    }
     302    if (!pPanel)
     303        return;
     304    if (fChecked)
     305        showPanel(pPanel);
     306    else
     307        hidePanel(pPanel);
     308}
     309
    306310void UIVMLogViewerWidget::sltSearchResultHighLigting()
    307311{
     
    399403    }
    400404}
     405
    401406void UIVMLogViewerWidget::sltResetSettingsToDefault()
    402407{
     
    413418}
    414419
    415 void UIVMLogViewerWidget::setMachine(const CMachine &machine)
    416 {
    417     if (machine == m_comMachine)
    418         return;
    419     m_comMachine = machine;
    420     sltRefresh();
    421 }
    422 
    423420void UIVMLogViewerWidget::prepare()
    424421{
    425     loadSettings();
     422    /* Create main layout: */
    426423    m_pMainLayout = new QVBoxLayout(this);
    427424
     425    /* Prepare stuff: */
    428426    prepareActions();
    429427    prepareToolBar();
    430 
    431428    prepareMenu();
    432429    prepareWidgets();
    433 
     430    /* Load settings: */
     431    loadSettings();
    434432
    435433    /* Reading log files: */
     
    439437    retranslateUi();
    440438
    441     m_panelActionMap.insert(m_pBookmarksPanel, m_pActionBookmarks);
    442     m_panelActionMap.insert(m_pSearchPanel, m_pActionFind);
    443     m_panelActionMap.insert(m_pFilterPanel, m_pActionFilter);
    444     m_panelActionMap.insert(m_pSettingsPanel, m_pActionSettings);
    445439    manageEscapeShortCut();
    446 }
    447 
    448 void UIVMLogViewerWidget::prepareWidgets()
    449 {
    450     /* Configure layout: */
    451     layout()->setContentsMargins(0, 0, 0, 0);
    452 #ifdef VBOX_WS_MAC
    453     layout()->setSpacing(10);
    454 #else
    455     layout()->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
    456 #endif
    457 
    458     /* Create VM Log-Viewer container: */
    459     m_pTabWidget = new QITabWidget;
    460     if (m_pTabWidget)
    461     {
    462         /* Add VM Log-Viewer container to main-layout: */
    463         m_pMainLayout->addWidget(m_pTabWidget);
    464     }
    465 
    466     /* Create VM Log-Viewer search-panel: */
    467     m_pSearchPanel = new UIVMLogViewerSearchPanel(0, this);
    468     if (m_pSearchPanel)
    469     {
    470         /* Configure VM Log-Viewer search-panel: */
    471         installEventFilter(m_pSearchPanel);
    472         m_pSearchPanel->hide();
    473         /* Add VM Log-Viewer search-panel to main-layout: */
    474         m_pMainLayout->addWidget(m_pSearchPanel);
    475         connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHighlightingUpdated,
    476                 this, &UIVMLogViewerWidget::sltSearchResultHighLigting);
    477     }
    478 
    479     /* Create VM Log-Viewer filter-panel: */
    480     m_pFilterPanel = new UIVMLogViewerFilterPanel(0, this);
    481     if (m_pFilterPanel)
    482     {
    483         /* Configure VM Log-Viewer filter-panel: */
    484         installEventFilter(m_pFilterPanel);
    485         m_pFilterPanel->hide();
    486         /* Add VM Log-Viewer filter-panel to main-layout: */
    487         m_pMainLayout->addWidget(m_pFilterPanel);
    488         connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigFilterApplied,
    489                 this, &UIVMLogViewerWidget::sltFilterApplied);
    490     }
    491 
    492     m_pBookmarksPanel = new UIVMLogViewerBookmarksPanel(0, this);
    493     if (m_pBookmarksPanel)
    494     {
    495         m_pBookmarksPanel->hide();
    496         m_pMainLayout->addWidget(m_pBookmarksPanel);
    497         connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteBookmark,
    498                 this, &UIVMLogViewerWidget::sltDeleteBookmark);
    499         connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteAllBookmarks,
    500                 this, &UIVMLogViewerWidget::sltDeleteAllBookmarks);
    501         connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigBookmarkSelected,
    502                 this, &UIVMLogViewerWidget::gotoBookmark);
    503     }
    504 
    505     m_pSettingsPanel = new UIVMLogViewerSettingsPanel(0, this);
    506     if (m_pSettingsPanel)
    507     {
    508         m_pSettingsPanel->hide();
    509         /* Initialize settings' panel checkboxes and input fields: */
    510         m_pSettingsPanel->setShowLineNumbers(m_bShowLineNumbers);
    511         m_pSettingsPanel->setWrapLines(m_bWrapLines);
    512         m_pSettingsPanel->setFontSizeInPoints(m_font.pointSize());
    513 
    514         m_pMainLayout->addWidget(m_pSettingsPanel);
    515         connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigShowLineNumbers, this, &UIVMLogViewerWidget::sltShowLineNumbers);
    516         connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigWrapLines, this, &UIVMLogViewerWidget::sltWrapLines);
    517         connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigChangeFontSizeInPoints, this, &UIVMLogViewerWidget::sltFontSizeChanged);
    518         connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigChangeFont, this, &UIVMLogViewerWidget::sltChangeFont);
    519         connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigResetToDefaults, this, &UIVMLogViewerWidget::sltResetSettingsToDefault);
    520     }
    521440}
    522441
     
    529448        m_pActionFind->setShortcut(QKeySequence("Ctrl+F"));
    530449        m_pActionFind->setCheckable(true);
    531         connect(m_pActionFind, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionTriggered);
     450        connect(m_pActionFind, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionToggled);
    532451    }
    533452
     
    538457        m_pActionFilter->setShortcut(QKeySequence("Ctrl+T"));
    539458        m_pActionFilter->setCheckable(true);
    540         connect(m_pActionFilter, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionTriggered);
     459        connect(m_pActionFilter, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionToggled);
    541460    }
    542461    /* Create and configure 'Bookmark' action: */
     
    549468            m_pActionBookmarks->setShortcut(QKeySequence("Ctrl+D"));
    550469        m_pActionBookmarks->setCheckable(true);
    551         connect(m_pActionBookmarks, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionTriggered);
     470        connect(m_pActionBookmarks, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionToggled);
    552471    }
    553472
     
    558477        m_pActionSettings->setShortcut(QKeySequence("Ctrl+P"));
    559478        m_pActionSettings->setCheckable(true);
    560         connect(m_pActionSettings, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionTriggered);
     479        connect(m_pActionSettings, &QAction::triggered, this, &UIVMLogViewerWidget::sltPanelActionToggled);
    561480    }
    562481
     
    586505void UIVMLogViewerWidget::prepareActionIcons()
    587506{
    588     QString strPrefix = "log_viewer";
    589 
    590507    if (m_pActionFind)
    591         m_pActionFind->setIcon(UIIconPool::iconSet(QString(":/%1_find_22px.png").arg(strPrefix),
    592                                                        QString(":/%1_find_disabled_22px.png").arg(strPrefix)));
     508        m_pActionFind->setIcon(UIIconPool::iconSet(QString(":/log_viewer_find_22px.png"),
     509                                                   QString(":/log_viewer_find_disabled_22px.png")));
    593510    if (m_pActionFilter)
    594         m_pActionFilter->setIcon(UIIconPool::iconSet(QString(":/%1_filter_22px.png").arg(strPrefix),
    595                                                          QString(":/%1_filter_disabled_22px.png").arg(strPrefix)));
     511        m_pActionFilter->setIcon(UIIconPool::iconSet(QString(":/log_viewer_filter_22px.png"),
     512                                                     QString(":/log_viewer_filter_disabled_22px.png")));
    596513    if (m_pActionRefresh)
    597         m_pActionRefresh->setIcon(UIIconPool::iconSet(QString(":/%1_refresh_22px.png").arg(strPrefix),
    598                                                           QString(":/%1_refresh_disabled_22px.png").arg(strPrefix)));
     514        m_pActionRefresh->setIcon(UIIconPool::iconSet(QString(":/log_viewer_refresh_22px.png"),
     515                                                      QString(":/log_viewer_refresh_disabled_22px.png")));
    599516    if (m_pActionSave)
    600         m_pActionSave->setIcon(UIIconPool::iconSet(QString(":/%1_save_22px.png").arg(strPrefix),
    601                                                        QString(":/%1_save_disabled_22px.png").arg(strPrefix)));
     517        m_pActionSave->setIcon(UIIconPool::iconSet(QString(":/log_viewer_save_22px.png"),
     518                                                   QString(":/log_viewer_save_disabled_22px.png")));
    602519    if (m_pActionBookmarks)
    603         m_pActionBookmarks->setIcon(UIIconPool::iconSet(QString(":/%1_bookmark_22px.png").arg(strPrefix),
    604                                                        QString(":/%1_bookmark_disabled_22px.png").arg(strPrefix)));
     520        m_pActionBookmarks->setIcon(UIIconPool::iconSet(QString(":/log_viewer_bookmark_22px.png"),
     521                                                        QString(":/log_viewer_bookmark_disabled_22px.png")));
    605522    if (m_pActionSettings)
    606         m_pActionSettings->setIcon(UIIconPool::iconSet(QString(":/%1_settings_22px.png").arg(strPrefix),
    607                                                        QString(":/%1_settings_disabled_22px.png").arg(strPrefix)));
     523        m_pActionSettings->setIcon(UIIconPool::iconSet(QString(":/log_viewer_settings_22px.png"),
     524                                                       QString(":/log_viewer_settings_disabled_22px.png")));
    608525}
    609526
     
    618535        m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric));
    619536        m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
     537
    620538        /* Add toolbar actions: */
    621539        if (m_pActionSave)
     
    679597}
    680598
     599void UIVMLogViewerWidget::prepareWidgets()
     600{
     601    /* Configure layout: */
     602    layout()->setContentsMargins(0, 0, 0, 0);
     603#ifdef VBOX_WS_MAC
     604    layout()->setSpacing(10);
     605#else
     606    layout()->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     607#endif
     608
     609    /* Create VM Log-Viewer container: */
     610    m_pTabWidget = new QITabWidget;
     611    if (m_pTabWidget)
     612    {
     613        /* Add into layout: */
     614        m_pMainLayout->addWidget(m_pTabWidget);
     615    }
     616
     617    /* Create VM Log-Viewer search-panel: */
     618    m_pSearchPanel = new UIVMLogViewerSearchPanel(0, this);
     619    if (m_pSearchPanel)
     620    {
     621        /* Configure VM Log-Viewer search-panel: */
     622        installEventFilter(m_pSearchPanel);
     623        m_pSearchPanel->hide();
     624        connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHighlightingUpdated,
     625                this, &UIVMLogViewerWidget::sltSearchResultHighLigting);
     626        m_panelActionMap.insert(m_pSearchPanel, m_pActionFind);
     627
     628        /* Add into layout: */
     629        m_pMainLayout->addWidget(m_pSearchPanel);
     630    }
     631
     632    /* Create VM Log-Viewer filter-panel: */
     633    m_pFilterPanel = new UIVMLogViewerFilterPanel(0, this);
     634    if (m_pFilterPanel)
     635    {
     636        /* Configure VM Log-Viewer filter-panel: */
     637        installEventFilter(m_pFilterPanel);
     638        m_pFilterPanel->hide();
     639        connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigFilterApplied,
     640                this, &UIVMLogViewerWidget::sltFilterApplied);
     641        m_panelActionMap.insert(m_pFilterPanel, m_pActionFilter);
     642
     643        /* Add into layout: */
     644        m_pMainLayout->addWidget(m_pFilterPanel);
     645    }
     646
     647    m_pBookmarksPanel = new UIVMLogViewerBookmarksPanel(0, this);
     648    if (m_pBookmarksPanel)
     649    {
     650        /* Configure VM Log-Viewer bookmarks-panel: */
     651        m_pBookmarksPanel->hide();
     652        connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteBookmark,
     653                this, &UIVMLogViewerWidget::sltDeleteBookmark);
     654        connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteAllBookmarks,
     655                this, &UIVMLogViewerWidget::sltDeleteAllBookmarks);
     656        connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigBookmarkSelected,
     657                this, &UIVMLogViewerWidget::gotoBookmark);
     658        m_panelActionMap.insert(m_pBookmarksPanel, m_pActionBookmarks);
     659
     660        /* Add into layout: */
     661        m_pMainLayout->addWidget(m_pBookmarksPanel);
     662    }
     663
     664    m_pSettingsPanel = new UIVMLogViewerSettingsPanel(0, this);
     665    if (m_pSettingsPanel)
     666    {
     667        /* Configure VM Log-Viewer settings-panel: */
     668        m_pSettingsPanel->hide();
     669        m_pSettingsPanel->setShowLineNumbers(m_bShowLineNumbers);
     670        m_pSettingsPanel->setWrapLines(m_bWrapLines);
     671        m_pSettingsPanel->setFontSizeInPoints(m_font.pointSize());
     672        connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigShowLineNumbers, this, &UIVMLogViewerWidget::sltShowLineNumbers);
     673        connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigWrapLines, this, &UIVMLogViewerWidget::sltWrapLines);
     674        connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigChangeFontSizeInPoints, this, &UIVMLogViewerWidget::sltFontSizeChanged);
     675        connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigChangeFont, this, &UIVMLogViewerWidget::sltChangeFont);
     676        connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigResetToDefaults, this, &UIVMLogViewerWidget::sltResetSettingsToDefault);
     677        m_panelActionMap.insert(m_pSettingsPanel, m_pActionSettings);
     678
     679        /* Add into layout: */
     680        m_pMainLayout->addWidget(m_pSettingsPanel);
     681    }
     682}
     683
     684void UIVMLogViewerWidget::loadSettings()
     685{
     686    m_bWrapLines = gEDataManager->logViewerWrapLines();
     687    m_bShowLineNumbers = gEDataManager->logViewerShowLineNumbers();
     688    QFont loadedFont = gEDataManager->logViewerFont();
     689    if (loadedFont != QFont())
     690        m_font = loadedFont;
     691}
     692
     693void UIVMLogViewerWidget::saveSettings()
     694{
     695    gEDataManager->setLogViweverSettings(m_font, m_bWrapLines, m_bShowLineNumbers);
     696}
     697
    681698void UIVMLogViewerWidget::cleanup()
    682699{
     700    /* Save settings: */
     701    saveSettings();
    683702}
    684703
     
    807826}
    808827
    809 const UIVMLogPage *UIVMLogViewerWidget::currentLogPage() const
    810 {
    811     int currentTabIndex = m_pTabWidget->currentIndex();
    812     if (currentTabIndex >= m_logPageList.size())
    813         return 0;
    814     return qobject_cast<const UIVMLogPage*>(m_logPageList.at(currentTabIndex));
    815 }
    816 UIVMLogPage *UIVMLogViewerWidget::currentLogPage()
    817 {
    818     int currentTabIndex = m_pTabWidget->currentIndex();
    819     if (currentTabIndex >= m_logPageList.size() || currentTabIndex == -1)
    820         return 0;
    821 
    822     return qobject_cast<UIVMLogPage*>(m_logPageList.at(currentTabIndex));
    823 }
    824 
    825 void UIVMLogViewerWidget::hidePanel(UIVMLogViewerPanel* panel)
    826 {
    827     if (panel && panel->isVisible())
    828         panel->setVisible(false);
    829     QMap<UIVMLogViewerPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
    830     if (iterator != m_panelActionMap.end())
    831     {
    832         if (iterator.value() && iterator.value()->isChecked())
    833             iterator.value()->setChecked(false);
    834     }
    835     m_visiblePanelsList.removeOne(panel);
    836     manageEscapeShortCut();
    837 }
    838 
    839 void UIVMLogViewerWidget::showPanel(UIVMLogViewerPanel* panel)
    840 {
    841     if (panel && panel->isHidden())
    842         panel->setVisible(true);
    843     QMap<UIVMLogViewerPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
    844     if (iterator != m_panelActionMap.end())
    845     {
    846         if (!iterator.value()->isChecked())
    847             iterator.value()->setChecked(true);
    848     }
    849     m_visiblePanelsList.push_back(panel);
    850     manageEscapeShortCut();
    851 }
    852 
    853 void UIVMLogViewerWidget::manageEscapeShortCut()
    854 {
    855     /* if there is no visible panels give the escape shortcut to parent dialog: */
    856     if (m_visiblePanelsList.isEmpty())
    857     {
    858         emit sigSetCloseButtonShortCut(QKeySequence(Qt::Key_Escape));
    859         return;
    860     }
    861     /* Take the escape shortcut from the dialog: */
    862     emit sigSetCloseButtonShortCut(QKeySequence());
    863     /* Just loop thru the visible panel list and set the esc key to the
    864        panel which made visible latest */
    865     for (int i = 0; i < m_visiblePanelsList.size() - 1; ++i)
    866     {
    867         m_visiblePanelsList[i]->setCloseButtonShortCut(QKeySequence());
    868     }
    869     m_visiblePanelsList.back()->setCloseButtonShortCut(QKeySequence(Qt::Key_Escape));
    870 }
    871 
    872828QPlainTextEdit* UIVMLogViewerWidget::logPage(int pIndex) const
    873829{
     
    879835    QPlainTextEdit *pBrowser = pContainer->findChild<QPlainTextEdit*>();
    880836    return pBrowser;
     837}
     838
     839void UIVMLogViewerWidget::createLogPage(const QString &strFileName, const QString &strLogContent, bool noLogsToShow /* = false */)
     840{
     841    if (!m_pTabWidget)
     842        return;
     843
     844    /* Create page-container: */
     845    UIVMLogPage* pLogPage = new UIVMLogPage();
     846    if (pLogPage)
     847    {
     848        connect(pLogPage, &UIVMLogPage::sigBookmarksUpdated, this, &UIVMLogViewerWidget::sltUpdateBookmarkPanel);
     849        connect(pLogPage, &UIVMLogPage::sigLogPageFilteredChanged, this, &UIVMLogViewerWidget::sltLogPageFilteredChanged);
     850        /* Initialize setting for this log page */
     851        pLogPage->setShowLineNumbers(m_bShowLineNumbers);
     852        pLogPage->setWrapLines(m_bWrapLines);
     853        pLogPage->setCurrentFont(m_font);
     854
     855        /* Set the file name only if we really have log file to read. */
     856        if (!noLogsToShow)
     857            pLogPage->setLogFileName(strFileName);
     858
     859        /* Add page-container to viewer-container: */
     860        int tabIndex = m_pTabWidget->insertTab(m_pTabWidget->count(), pLogPage, QFileInfo(strFileName).fileName());
     861
     862        pLogPage->setTabIndex(tabIndex);
     863        m_logPageList.resize(m_pTabWidget->count());
     864        m_logPageList[tabIndex] = pLogPage;
     865
     866        /* Set text edit since we want to display this text: */
     867        if (!noLogsToShow)
     868        {
     869            pLogPage->setTextEditText(strLogContent);
     870            /* Set the log string of the UIVMLogPage: */
     871            pLogPage->setLogString(strLogContent);
     872        }
     873        /* In case there are some errors append the error text as html: */
     874        else
     875        {
     876            pLogPage->setTextEditTextAsHtml(strLogContent);
     877            pLogPage->markForError();
     878        }
     879    }
     880}
     881
     882const UIVMLogPage *UIVMLogViewerWidget::currentLogPage() const
     883{
     884    int currentTabIndex = m_pTabWidget->currentIndex();
     885    if (currentTabIndex >= m_logPageList.size())
     886        return 0;
     887    return qobject_cast<const UIVMLogPage*>(m_logPageList.at(currentTabIndex));
     888}
     889
     890UIVMLogPage *UIVMLogViewerWidget::currentLogPage()
     891{
     892    int currentTabIndex = m_pTabWidget->currentIndex();
     893    if (currentTabIndex >= m_logPageList.size() || currentTabIndex == -1)
     894        return 0;
     895
     896    return qobject_cast<UIVMLogPage*>(m_logPageList.at(currentTabIndex));
    881897}
    882898
     
    939955}
    940956
    941 void UIVMLogViewerWidget::createLogPage(const QString &strFileName, const QString &strLogContent, bool noLogsToShow /* = false */)
    942 {
    943     if (!m_pTabWidget)
    944         return;
    945 
    946     /* Create page-container: */
    947     UIVMLogPage* pLogPage = new UIVMLogPage();
    948     if (pLogPage)
    949     {
    950         connect(pLogPage, &UIVMLogPage::sigBookmarksUpdated, this, &UIVMLogViewerWidget::sltUpdateBookmarkPanel);
    951         connect(pLogPage, &UIVMLogPage::sigLogPageFilteredChanged, this, &UIVMLogViewerWidget::sltLogPageFilteredChanged);
    952         /* Initialize setting for this log page */
    953         pLogPage->setShowLineNumbers(m_bShowLineNumbers);
    954         pLogPage->setWrapLines(m_bWrapLines);
    955         pLogPage->setCurrentFont(m_font);
    956 
    957         /* Set the file name only if we really have log file to read. */
    958         if (!noLogsToShow)
    959             pLogPage->setLogFileName(strFileName);
    960 
    961         /* Add page-container to viewer-container: */
    962         int tabIndex = m_pTabWidget->insertTab(m_pTabWidget->count(), pLogPage, QFileInfo(strFileName).fileName());
    963 
    964         pLogPage->setTabIndex(tabIndex);
    965         m_logPageList.resize(m_pTabWidget->count());
    966         m_logPageList[tabIndex] = pLogPage;
    967 
    968         /* Set text edit since we want to display this text: */
    969         if (!noLogsToShow)
    970         {
    971             pLogPage->setTextEditText(strLogContent);
    972             /* Set the log string of the UIVMLogPage: */
    973             pLogPage->setLogString(strLogContent);
    974         }
    975         /* In case there are some errors append the error text as html: */
    976         else
    977         {
    978             pLogPage->setTextEditTextAsHtml(strLogContent);
    979             pLogPage->markForError();
    980         }
    981     }
    982 }
    983 
    984957void UIVMLogViewerWidget::resetHighlighthing()
    985958{
     
    992965}
    993966
    994 QFont UIVMLogViewerWidget::currentFont() const
    995 {
    996     const UIVMLogPage* logPage = currentLogPage();
    997     if (!logPage)
    998         return QFont();
    999     return logPage->currentFont();
    1000 }
     967void UIVMLogViewerWidget::hidePanel(UIVMLogViewerPanel* panel)
     968{
     969    if (panel && panel->isVisible())
     970        panel->setVisible(false);
     971    QMap<UIVMLogViewerPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
     972    if (iterator != m_panelActionMap.end())
     973    {
     974        if (iterator.value() && iterator.value()->isChecked())
     975            iterator.value()->setChecked(false);
     976    }
     977    m_visiblePanelsList.removeOne(panel);
     978    manageEscapeShortCut();
     979}
     980
     981void UIVMLogViewerWidget::showPanel(UIVMLogViewerPanel* panel)
     982{
     983    if (panel && panel->isHidden())
     984        panel->setVisible(true);
     985    QMap<UIVMLogViewerPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
     986    if (iterator != m_panelActionMap.end())
     987    {
     988        if (!iterator.value()->isChecked())
     989            iterator.value()->setChecked(true);
     990    }
     991    m_visiblePanelsList.push_back(panel);
     992    manageEscapeShortCut();
     993}
     994
     995void UIVMLogViewerWidget::manageEscapeShortCut()
     996{
     997    /* if there is no visible panels give the escape shortcut to parent dialog: */
     998    if (m_visiblePanelsList.isEmpty())
     999    {
     1000        emit sigSetCloseButtonShortCut(QKeySequence(Qt::Key_Escape));
     1001        return;
     1002    }
     1003    /* Take the escape shortcut from the dialog: */
     1004    emit sigSetCloseButtonShortCut(QKeySequence());
     1005    /* Just loop thru the visible panel list and set the esc key to the
     1006       panel which made visible latest */
     1007    for (int i = 0; i < m_visiblePanelsList.size() - 1; ++i)
     1008    {
     1009        m_visiblePanelsList[i]->setCloseButtonShortCut(QKeySequence());
     1010    }
     1011    m_visiblePanelsList.back()->setCloseButtonShortCut(QKeySequence(Qt::Key_Escape));
     1012}
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r72713 r73693  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVMLogViewer class declaration.
     3 * VBox Qt GUI - UIVMLogViewerWidget class declaration.
    44 */
    55
    66/*
    7  * Copyright (C) 2010-2017 Oracle Corporation
     7 * Copyright (C) 2010-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5757
    5858public:
     59
    5960    /** Constructs the VM Log-Viewer by passing @a pParent to QWidget base-class constructor.
    60       * @param  machine  Specifies the machine for which VM Log-Viewer is requested. */
    61     UIVMLogViewerWidget(EmbedTo enmEmbedding, QWidget *pParent = 0, const CMachine &machine = CMachine());
     61      * @param  enmEmbedding  Brings the type of widget embedding.
     62      * @param  comMachine    Brings the machine for which VM Log-Viewer is requested. */
     63    UIVMLogViewerWidget(EmbedTo enmEmbedding,
     64                        const CMachine &comMachine = CMachine(), QWidget *pParent = 0);
    6265    /** Destructs the VM Log-Viewer. */
    6366    ~UIVMLogViewerWidget();
     
    7376#endif
    7477
    75     /** Sets the machine whose logs to show. */
    76     void setMachine(const CMachine &machine);
     78    /** Defines the @a comMachine whose logs to show. */
     79    void setMachine(const CMachine &comMachine);
    7780    QFont currentFont() const;
    7881
     
    9598        /** Receives delete all signal from the bookmark panel and notifies UIVMLogPage. */
    9699        void sltDeleteAllBookmarks();
    97         /** Manages bookmark panel update when bookmark vector is updated */
     100        /** Manages bookmark panel update when bookmark vector is updated. */
    98101        void sltUpdateBookmarkPanel();
    99         /* Makes the current UIVMLogPage to goto (scroll) its bookmark with index @a index. */
     102        /** Makes the current UIVMLogPage to goto (scroll) its bookmark with index @a index. */
    100103        void gotoBookmark(int bookmarkIndex);
    101104    /** @} */
    102105
    103     void sltPanelActionTriggered(bool checked);
     106    void sltPanelActionToggled(bool fChecked);
    104107    /** Handles the search result highlight changes. */
    105108    void sltSearchResultHighLigting();
     
    128131        /** Prepares VM Log-Viewer. */
    129132        void prepare();
     133        /** Prepares actions. */
     134        void prepareActions();
     135        /** Prepares action icons. */
     136        void prepareActionIcons();
     137        /** Prepares toolbar. */
     138        void prepareToolBar();
     139        /** Prepares menu. */
     140        void prepareMenu();
    130141        /** Prepares widgets. */
    131142        void prepareWidgets();
    132         void prepareActions();
    133         void prepareActionIcons();
    134         void prepareToolBar();
    135         void prepareMenu();
    136 
     143        /** Loads settings.  */
     144        void loadSettings();
     145
     146        /** Saves settings.  */
     147        void saveSettings();
    137148        /** Cleanups VM Log-Viewer. */
    138149        void cleanup();
     
    142153      * @{ */
    143154        /** Handles translation event. */
    144         void retranslateUi();
     155        virtual void retranslateUi() /* override */;
    145156
    146157        /** Handles Qt show @a pEvent. */
    147         void showEvent(QShowEvent *pEvent);
     158        virtual void showEvent(QShowEvent *pEvent) /* override */;
    148159        /** Handles Qt key-press @a pEvent. */
    149         void keyPressEvent(QKeyEvent *pEvent);
     160        virtual void keyPressEvent(QKeyEvent *pEvent) /* override */;
    150161    /** @} */
    151162
     
    156167    void createLogPage(const QString &strFileName, const QString &strLogContent, bool noLogsToShow = false);
    157168
    158 
     169    const UIVMLogPage *currentLogPage() const;
    159170    UIVMLogPage *currentLogPage();
    160     const UIVMLogPage *currentLogPage() const;
    161171
    162172    /** Attempts to read the logs through the API, returns true if there exists any logs, false otherwise. */
     
    176186    void manageEscapeShortCut();
    177187
    178     /** @name Load/save some settings from/to extra data
    179       * @{ */
    180         void loadSettings();
    181         void saveSettings();
    182     /** @} */
     188    /** Holds the widget's embedding type. */
     189    const EmbedTo m_enmEmbedding;
     190    /** Holds the machine instance. */
     191    CMachine      m_comMachine;
    183192
    184193    /** Holds whether the dialog is polished. */
    185194    bool m_fIsPolished;
    186 
    187     /** Holds the machine instance. */
    188     CMachine m_comMachine;
    189195
    190196    /** Holds container for log-pages. */
     
    204210    /** @} */
    205211    QVBoxLayout         *m_pMainLayout;
    206 
    207     /** Holds the widget's embedding type. */
    208     const EmbedTo m_enmEmbedding;
    209212
    210213    /** @name Toolbar and menu variables.
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r73691 r73693  
    10771077     * a second call to this function and result in double delete!!!: */
    10781078    m_logViewers.erase(sendersIterator);
    1079     UIVMLogViewerDialogFactory(CMachine()).cleanup(pDialog);
     1079    UIVMLogViewerDialogFactory().cleanup(pDialog);
    10801080}
    10811081
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r72813 r73693  
    24132413    m_pLogViewerDialog = 0;
    24142414    pDialog->close();
    2415     UIVMLogViewerDialogFactory(CMachine()).cleanup(pDialog);
     2415    UIVMLogViewerDialogFactory().cleanup(pDialog);
    24162416}
    24172417
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r73533 r73693  
    11311131       this function and result in double delete!!!: */
    11321132    m_logViewers.erase(sendersIterator);
    1133     UIVMLogViewerDialogFactory(CMachine()).cleanup(pDialog);
     1133    UIVMLogViewerDialogFactory().cleanup(pDialog);
    11341134}
    11351135
Note: See TracChangeset for help on using the changeset viewer.

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