VirtualBox

Changeset 76977 in vbox


Ignore:
Timestamp:
Jan 24, 2019 2:43:37 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128368
Message:

FE/Qt: bugref:9072. Save/load opened panel list to/from extra data

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp

    r76626 r76977  
    223223const char *UIExtraDataDefs::GUI_LogViewerShowLineNumbersDisabled = "showLineNumbersDisabled";
    224224const char *UIExtraDataDefs::GUI_LogViewerNoFontStyleName = "noFontStyleName";
     225const char *UIExtraDataDefs::GUI_GuestControl_LogViewerVisiblePanels = "GUI/LogViewerVisiblePanels";
    225226
    226227
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r76626 r76977  
    411411        SHARED_LIBRARY_STUFF extern const char *GUI_LogViewerShowLineNumbersDisabled;
    412412        SHARED_LIBRARY_STUFF extern const char *GUI_LogViewerNoFontStyleName;
     413        SHARED_LIBRARY_STUFF extern const char *GUI_GuestControl_LogViewerVisiblePanels;
    413414    /** @} */
    414415
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r76825 r76977  
    46534653}
    46544654
     4655void UIExtraDataManager::setLogViewerVisiblePanels(const QStringList &panelNameList)
     4656{
     4657    setExtraDataStringList(GUI_GuestControl_LogViewerVisiblePanels, panelNameList);
     4658}
     4659
     4660QStringList UIExtraDataManager::logViewerVisiblePanels()
     4661{
     4662    return extraDataStringList(GUI_GuestControl_LogViewerVisiblePanels);
     4663}
     4664
    46554665void UIExtraDataManager::sltExtraDataChange(const QUuid &uMachineID, const QString &strKey, const QString &strValue)
    46564666{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r76626 r76977  
    723723        /** Tries to find system font by searching by family and style strings within the font database. */
    724724        QFont logViewerFont();
     725        void setLogViewerVisiblePanels(const QStringList &panelNameList);
     726        QStringList logViewerVisiblePanels();
    725727    /** @} */
    726728
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r76950 r76977  
    101101 UIFileManagerOptions::~UIFileManagerOptions()
    102102{
    103 
    104103}
    105104
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r76961 r76977  
    4949/* COM includes: */
    5050#include "CSystemProperties.h"
    51 
    52 
    5351
    5452UIVMLogViewerWidget::UIVMLogViewerWidget(EmbedTo enmEmbedding,
     
    7674    /* Prepare VM Log-Viewer: */
    7775    prepare();
     76    restorePanelVisibility();
    7877}
    7978
     
    607606}
    608607
     608void UIVMLogViewerWidget::restorePanelVisibility()
     609{
     610    /** Reset the action states first: */
     611    foreach(QAction* pAction, m_panelActionMap.values())
     612    {
     613        pAction->blockSignals(true);
     614        pAction->setChecked(false);
     615        pAction->blockSignals(false);
     616    }
     617
     618    /* Load the visible panel list and show them: */
     619    QStringList strNameList = gEDataManager->logViewerVisiblePanels();
     620    foreach(const QString strName, strNameList)
     621    {
     622        foreach(UIDialogPanel* pPanel, m_panelActionMap.keys())
     623        {
     624            if (strName == pPanel->panelName())
     625            {
     626                showPanel(pPanel);
     627                break;
     628            }
     629        }
     630    }
     631}
     632
    609633void UIVMLogViewerWidget::saveOptions()
    610634{
     635    /* Save a list of currently visible panels: */
     636    QStringList strNameList;
     637    foreach(UIDialogPanel* pPanel, m_visiblePanelsList)
     638        strNameList.append(pPanel->panelName());
     639    gEDataManager->setLogViewerVisiblePanels(strNameList);
     640
    611641    gEDataManager->setLogViweverOptions(m_font, m_bWrapLines, m_bShowLineNumbers);
    612642}
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r76961 r76977  
    147147        /** Loads options.  */
    148148        void loadOptions();
     149        /** Shows the panels that have been visible the last time logviewer is closed. */
     150        void restorePanelVisibility();
    149151
    150152        /** Saves options.  */
Note: See TracChangeset for help on using the changeset viewer.

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