VirtualBox

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


Ignore:
Timestamp:
Nov 2, 2018 12:45:59 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Save/load a list of visible file manager panels to/from extra data

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

Legend:

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

    r75221 r75224  
    195195const char *UIExtraDataDefs::GUI_InformationWindowGeometry = "GUI/InformationWindowGeometry";
    196196const char *UIExtraDataDefs::GUI_InformationWindowElements = "GUI/InformationWindowElements";
     197
     198/* Guest control UI: */
     199const char *UIExtraDataDefs::GUI_GuestControl_FileManagerDialogGeometry = "GUI/GuestControl/FileManagerDialogGeometry";
     200const char *UIExtraDataDefs::GUI_GuestControl_FileManagerVisiblePanels = "GUI/GuestControl/FileManagerVisiblePanels";
    197201const char *UIExtraDataDefs::GUI_GuestControl_ProcessControlSplitterHints = "GUI/GuestControl/ProcessControlSplitterHints";
    198 const char *UIExtraDataDefs::GUI_GuestControl_FileManagerDialogGeometry = "GUI/GuestControl/FileManagerDialogGeometry";
    199202const char *UIExtraDataDefs::GUI_GuestControl_ProcessControlDialogGeometry = "GUI/GuestControl/ProcessControlDialogGeometry";
    200203
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r75221 r75224  
    348348        /** Holds information-window elements. */
    349349        SHARED_LIBRARY_STUFF extern const char *GUI_InformationWindowElements;
     350    /** @} */
     351
     352    /** @name Guest Control UI related data
     353      * @{ */
     354        extern const char *GUI_GuestControl_FileManagerDialogGeometry;
     355        extern const char *GUI_GuestControl_FileManagerVisiblePanels;
    350356        extern const char *GUI_GuestControl_ProcessControlSplitterHints;
    351357        extern const char *GUI_GuestControl_ProcessControlDialogGeometry;
    352     /** @} */
    353 
    354     /** @name Guest Control UI related data
    355       * @{ */
    356         extern const char *GUI_GuestControl_FileManagerDialogGeometry;
    357358    /** @} */
    358359
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r75221 r75224  
    41324132}
    41334133
     4134void UIExtraDataManager::setGuestControlFileManagerVisiblePanels(const QStringList &panelNameList)
     4135{
     4136    setExtraDataStringList(GUI_GuestControl_FileManagerVisiblePanels, panelNameList);
     4137}
     4138
     4139QStringList UIExtraDataManager::guestControlFileManagerVisiblePanels()
     4140{
     4141    return extraDataStringList(GUI_GuestControl_FileManagerVisiblePanels);
     4142}
     4143
    41344144QRect UIExtraDataManager::guestProcessControlDialogGeometry(QWidget *pWidget, const QRect &defaultGeometry)
    41354145{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r75087 r75224  
    627627      * @{ */
    628628        void setGuestControlProcessControlSplitterHints(const QList<int> &hints);
    629         void setGuestControlFileManagerSplitterHints(const QList<int> &hints);
    630629        QList<int> guestControlProcessControlSplitterHints();
    631         QList<int> guestControlFileManagerSplitterHints();
    632630        QRect guestControlFileManagerDialogGeometry(QWidget *pWidget, const QRect &defaultGeometry);
    633631        bool guestControlFileManagerDialogShouldBeMaximized();
     
    636634        bool guestProcessControlDialogShouldBeMaximized();
    637635        void setGuestProcessControlDialogGeometry(const QRect &geometry, bool fMaximized);
     636        void setGuestControlFileManagerVisiblePanels(const QStringList &panelNameList);
     637        QStringList guestControlFileManagerVisiblePanels();
    638638    /** @} */
    639639
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.cpp

    r75220 r75224  
    615615void UIGuestControlFileManager::saveSettings()
    616616{
     617    /* Save a list of currently visible panels: */
     618    QStringList strNameList;
     619    foreach(UIGuestControlFileManagerPanel* pPanel, m_visiblePanelsList)
     620        strNameList.append(pPanel->panelName());
     621    gEDataManager->setGuestControlFileManagerVisiblePanels(strNameList);
    617622}
    618623
    619624void UIGuestControlFileManager::loadSettings()
    620625{
     626    /* Load the visible panel list and show them: */
     627    QStringList strNameList = gEDataManager->guestControlFileManagerVisiblePanels();
     628    foreach(const QString strName, strNameList)
     629    {
     630        foreach(UIGuestControlFileManagerPanel* pPanel, m_panelActionMap.keys())
     631        {
     632            if (strName == pPanel->panelName())
     633            {
     634                showPanel(pPanel);
     635                break;
     636            }
     637        }
     638    }
    621639}
    622640
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.h

    r75220 r75224  
    155155    UIGuestControlConsole      *m_pConsole;
    156156    UIGuestControlInterface    *m_pControlInterface;
    157     // /* m_pSessionCreateWidget is a QWidget extension enabling user to start/stop
    158     //  * a Guest Control session with password/username fields etc.. */
    159     // UIGuestSessionCreateWidget *m_pSessionCreateWidget;
    160157    UIGuestFileTable           *m_pGuestFileTable;
    161158    UIHostFileTable            *m_pHostFileTable;
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerLogPanel.cpp

    r75220 r75224  
    9494}
    9595
     96void UIGuestControlFileManagerLogPanel::appendLog(const QString &strLog)
     97{
     98    if (!m_pLogTextEdit)
     99        return;
     100    m_pLogTextEdit->append(strLog);
     101}
     102
     103QString UIGuestControlFileManagerLogPanel::panelName() const
     104{
     105    return "LogPanel";
     106}
     107
    96108void UIGuestControlFileManagerLogPanel::prepareWidgets()
    97109{
     
    116128}
    117129
    118 void UIGuestControlFileManagerLogPanel::appendLog(const QString &strLog)
    119 {
    120     if (!m_pLogTextEdit)
    121         return;
    122     m_pLogTextEdit->append(strLog);
    123 }
    124130
    125131#include "UIGuestControlFileManagerLogPanel.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerLogPanel.h

    r75220 r75224  
    3434
    3535    UIGuestControlFileManagerLogPanel(UIGuestControlFileManager *pManagerWidget, QWidget *pParent);
    36 
    3736    void appendLog(const QString &str);
     37    virtual QString panelName() const /* override */;
    3838
    3939signals:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerPanel.h

    r75220 r75224  
    4141    UIGuestControlFileManagerPanel(UIGuestControlFileManager *pManagerWidget, QWidget *pParent);
    4242    void setCloseButtonShortCut(QKeySequence shortCut);
     43    virtual QString panelName() const = 0;
    4344
    4445protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerSessionPanel.cpp

    r75220 r75224  
    238238}
    239239
     240QString UIGuestControlFileManagerSessionPanel::panelName() const
     241{
     242    return "SessionPanel";
     243}
     244
    240245void UIGuestControlFileManagerSessionPanel::prepareWidgets()
    241246{
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerSessionPanel.h

    r75220 r75224  
    3737    void switchSessionCloseMode();
    3838    void switchSessionCreateMode();
     39    virtual QString panelName() const /* override */;
    3940
    4041signals:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerSettingsPanel.cpp

    r75220 r75224  
    3737#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3838
    39 
    4039UIGuestControlFileManagerSettingsPanel::UIGuestControlFileManagerSettingsPanel(UIGuestControlFileManager *pManagerWidget,
    4140                                                                               QWidget *pParent, UIGuestControlFileManagerSettings *pFileManagerSettings)
     
    4645{
    4746    prepare();
     47}
     48
     49QString UIGuestControlFileManagerSettingsPanel::panelName() const
     50{
     51    return "SettingsPanel";
    4852}
    4953
     
    8589        connect(m_pListDirectoriesOnTopCheckBox, &QCheckBox::toggled,
    8690                this, &UIGuestControlFileManagerSettingsPanel::sltListDirectoryCheckBoxToogled);
    87     // if (m_pWrapLinesCheckBox)
    88     //     connect(m_pWrapLinesCheckBox, &QCheckBox::toggled, this, &UIGuestControlFileManagerSettingsPanel::sigWrapLines);
    89     // if (m_pFontSizeSpinBox)
    90     //     connect(m_pFontSizeSpinBox, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
    91     //             this, &UIGuestControlFileManagerSettingsPanel::sigChangeFontSizeInPoints);
    92     // if (m_pResetToDefaultsButton)
    93     //     connect(m_pResetToDefaultsButton, &QIToolButton::clicked, this, &UIGuestControlFileManagerSettingsPanel::sigResetToDefaults);
    9491}
    9592
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerSettingsPanel.h

    r75220 r75224  
    3838    UIGuestControlFileManagerSettingsPanel(UIGuestControlFileManager *pManagerWidget,
    3939                                           QWidget *pParent, UIGuestControlFileManagerSettings *pFileManagerSettings);
     40    virtual QString panelName() const /* override */;
    4041
    4142signals:
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