VirtualBox

Changeset 88659 in vbox for trunk/src


Ignore:
Timestamp:
Apr 22, 2021 3:59:04 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8161: Rework Log Viewer a bit; Save options on corresponding signal instead of call from destructor.

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

Legend:

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

    r88658 r88659  
    184184}
    185185
    186 UIVMLogViewerWidget::~UIVMLogViewerWidget()
    187 {
    188     /* Cleanup VM Log-Viewer: */
    189     cleanup();
    190 }
    191 
    192186int UIVMLogViewerWidget::defaultLogPageWidth() const
    193187{
     
    253247    if (m_pMachineSelectionMenu)
    254248        m_pMachineSelectionMenu->move(0, 40);
     249}
     250
     251void UIVMLogViewerWidget::sltSaveOptions()
     252{
     253    /* Save a list of currently visible panels: */
     254    QStringList strNameList;
     255    foreach(UIDialogPanel* pPanel, m_visiblePanelsList)
     256        strNameList.append(pPanel->panelName());
     257    gEDataManager->setLogViewerVisiblePanels(strNameList);
     258    gEDataManager->setLogViweverOptions(m_font, m_bWrapLines, m_bShowLineNumbers);
    255259}
    256260
     
    766770    if (loadedFont != QFont())
    767771        m_font = loadedFont;
     772    connect(&uiCommon(), &UICommon::sigAskToCommitData,
     773            this, &UIVMLogViewerWidget::sltSaveOptions);
    768774}
    769775
     
    791797        }
    792798    }
    793 }
    794 
    795 void UIVMLogViewerWidget::saveOptions()
    796 {
    797     /* Save a list of currently visible panels: */
    798     QStringList strNameList;
    799     foreach(UIDialogPanel* pPanel, m_visiblePanelsList)
    800         strNameList.append(pPanel->panelName());
    801     gEDataManager->setLogViewerVisiblePanels(strNameList);
    802     gEDataManager->setLogViweverOptions(m_font, m_bWrapLines, m_bShowLineNumbers);
    803 }
    804 
    805 void UIVMLogViewerWidget::cleanup()
    806 {
    807     /* Save options: */
    808     saveOptions();
    809799}
    810800
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r88658 r88659  
    7373    UIVMLogViewerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    7474                        bool fShowToolbar = true, const CMachine &comMachine = CMachine(), QWidget *pParent = 0);
    75     /** Destructs the VM Log-Viewer. */
    76     ~UIVMLogViewerWidget();
    7775    /** Returns the width of the current log page. return 0 if there is no current log page: */
    7876    int defaultLogPageWidth() const;
     
    9896
    9997private slots:
     98
     99    /** Saves options.  */
     100    void sltSaveOptions();
    100101
    101102    /** Handles refresh action triggering. */
     
    162163        /** Shows the panels that have been visible the last time logviewer is closed. */
    163164        void restorePanelVisibility();
    164 
    165         /** Saves options.  */
    166         void saveOptions();
    167         /** Cleanups VM Log-Viewer. */
    168         void cleanup();
    169165    /** @} */
    170166
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