VirtualBox

Changeset 89111 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 17, 2021 4:19:16 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8161. Saving options in file manager immediately not during dtor

Location:
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r89109 r89111  
    127127    , m_pSessionPanel(0)
    128128    , m_pOperationsPanel(0)
     129    , m_fDialogBeingClosed(false)
    129130{
    130131    loadOptions();
     
    141142UIFileManager::~UIFileManager()
    142143{
    143     saveOptions();
    144144    UIFileManagerOptions::destroy();
     145}
     146
     147void UIFileManager::setDialogBeingClosed(bool fFlag)
     148{
     149    m_fDialogBeingClosed = fFlag;
    145150}
    146151
     
    523528    if (m_pHostFileTable)
    524529        m_pHostFileTable->optionsUpdated();
     530    saveOptions();
    525531}
    526532
     
    679685void UIFileManager::saveOptions()
    680686{
    681     /* Save a list of currently visible panels: */
    682     QStringList strNameList;
    683     foreach(UIDialogPanel* pPanel, m_visiblePanelsList)
    684         strNameList.append(pPanel->panelName());
    685     gEDataManager->setFileManagerVisiblePanels(strNameList);
    686687    /* Save the options: */
    687688    UIFileManagerOptions *pOptions = UIFileManagerOptions::instance();
     
    751752    m_visiblePanelsList.removeAll(panel);
    752753    manageEscapeShortCut();
     754    savePanelVisibility();
    753755}
    754756
     
    766768        m_visiblePanelsList.push_back(panel);
    767769    manageEscapeShortCut();
     770    savePanelVisibility();
    768771}
    769772
     
    794797}
    795798
     799void UIFileManager::savePanelVisibility()
     800{
     801    if (m_fDialogBeingClosed)
     802        return;
     803    /* Save a list of currently visible panels: */
     804    QStringList strNameList;
     805    foreach(UIDialogPanel* pPanel, m_visiblePanelsList)
     806        strNameList.append(pPanel->panelName());
     807    gEDataManager->setFileManagerVisiblePanels(strNameList);
     808}
     809
    796810#include "UIFileManager.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h

    r89109 r89111  
    9595    ~UIFileManager();
    9696    QMenu *menu() const;
     97
     98    void setDialogBeingClosed(bool fFlag);
    9799
    98100#ifdef VBOX_WS_MAC
     
    167169    QStringList               getFsObjInfoStringList(const T &fsObjectInfo) const;
    168170    void                      appendLog(const QString &strLog, FileManagerLogType eLogType);
     171    void                      savePanelVisibility();
    169172    CGuest                    m_comGuest;
    170173    CGuestSession             m_comGuestSession;
     
    190193    UIFileManagerSessionPanel          *m_pSessionPanel;
    191194    UIFileManagerOperationsPanel       *m_pOperationsPanel;
     195    bool                                m_fDialogBeingClosed;
    192196    friend class UIFileManagerOptionsPanel;
    193197    friend class UIFileManagerDialog;
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.cpp

    r88873 r89111  
    6464    , m_strMachineName(strMachineName)
    6565{
     66}
     67
     68UIFileManagerDialog::~UIFileManagerDialog()
     69{
     70    UIFileManager *pWidget = qobject_cast<UIFileManager*>(widget());
     71    if (pWidget)
     72        pWidget->setDialogBeingClosed(true);
    6673}
    6774
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.h

    r86986 r89111  
    7171      * @param  comGuest       Passes the com-guest reference. */
    7272    UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CGuest &comGuest, const QString &strMachineName = QString());
     73    ~UIFileManagerDialog();
    7374
    7475protected:
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