VirtualBox

Changeset 76950 in vbox


Ignore:
Timestamp:
Jan 23, 2019 10:17:54 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699: Use UIDialogPanel as the base in file manager panels

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r76947 r76950  
    721721        src/guestctrl/UIFileManagerOperationsPanel.h \
    722722        src/guestctrl/UIFileManagerOptionsPanel.h \
    723         src/guestctrl/UIFileManagerPanel.h \
    724723        src/guestctrl/UIFileManagerSessionPanel.h \
    725724        src/guestctrl/UIFileManagerTable.h \
     
    11591158        src/guestctrl/UIFileManagerOperationsPanel.cpp \
    11601159        src/guestctrl/UIFileManagerOptionsPanel.cpp \
    1161         src/guestctrl/UIFileManagerPanel.cpp \
    11621160        src/guestctrl/UIFileManagerSessionPanel.cpp \
    11631161        src/guestctrl/UIFileManagerTable.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDialogPanel.cpp

    r76947 r76950  
    3333
    3434
    35 UIDialogPanel::UIDialogPanel(QWidget *pParent)
     35UIDialogPanel::UIDialogPanel(QWidget *pParent /* = 0 */)
    3636    : QIWithRetranslateUI<QWidget>(pParent)
    3737    , m_pMainLayout(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDialogPanel.h

    r76947 r76950  
    3030/* Forward declarations: */
    3131class QHBoxLayout;
    32 class QPlainTextEdit;
    33 class QTextDocument;
    3432class QIToolButton;
    3533
    3634
    37 /** QWidget extension acting as the base class for UIVMLogViewerXXXPanel widgets. */
    38 class UIDialogPanel : public QIWithRetranslateUI<QWidget>
     35/** QWidget extension acting as the base class for all the dialog panels like file manager, logviewer etc. */
     36class SHARED_LIBRARY_STUFF UIDialogPanel : public QIWithRetranslateUI<QWidget>
    3937{
    4038    Q_OBJECT;
     
    4240public:
    4341
    44     UIDialogPanel(QWidget *pParent);
     42    UIDialogPanel(QWidget *pParent = 0);
    4543    void setCloseButtonShortCut(QKeySequence shortCut);
    4644    virtual QString panelName() const = 0;
     
    7270private:
    7371
    74     /** Holds the reference to VM Log-Viewer this panel belongs to. */
    7572    QHBoxLayout   *m_pMainLayout;
    7673    QIToolButton  *m_pCloseButton;
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r76734 r76950  
    261261
    262262    pTopLayout->addLayout(pFileTableContainerLayout);
    263     m_pSessionPanel = new UIFileManagerSessionPanel(this /* manager dialog */, 0 /*parent */);
     263    m_pSessionPanel = new UIFileManagerSessionPanel;
    264264    if (m_pSessionPanel)
    265265    {
     
    270270
    271271    m_pOptionsPanel =
    272         new UIFileManagerOptionsPanel(this /* manager dialog */,
    273                                                    0 /*parent */, UIFileManagerOptions::instance());
     272        new UIFileManagerOptionsPanel(0 /*parent */, UIFileManagerOptions::instance());
    274273    if (m_pOptionsPanel)
    275274    {
     
    284283
    285284    m_pOperationsPanel =
    286         new UIFileManagerOperationsPanel(this /* manager dialog */, 0 /*parent */);
     285        new UIFileManagerOperationsPanel;
    287286    if (m_pOperationsPanel)
    288287    {
     
    295294    }
    296295
    297     m_pLogPanel = new UIFileManagerLogPanel(this /* manager dialog */, 0 /*parent */);
     296    m_pLogPanel = new UIFileManagerLogPanel;
    298297    if (m_pLogPanel)
    299298    {
     
    356355        connect(m_pSessionPanel, &UIFileManagerSessionPanel::sigCloseSession,
    357356                this, &UIFileManager::sltCloseSession);
    358     }
     357        connect(m_pSessionPanel, &UIFileManagerSessionPanel::sigHidePanel,
     358                this, &UIFileManager::sltHandleHidePanel);
     359    }
     360    if (m_pOptionsPanel)
     361        connect(m_pOptionsPanel, &UIFileManagerOptionsPanel::sigHidePanel,
     362                this, &UIFileManager::sltHandleHidePanel);
     363
     364    if (m_pLogPanel)
     365        connect(m_pLogPanel, &UIFileManagerLogPanel::sigHidePanel,
     366                this, &UIFileManager::sltHandleHidePanel);
     367
     368    if (m_pOperationsPanel)
     369        connect(m_pOperationsPanel, &UIFileManagerOperationsPanel::sigHidePanel,
     370                this, &UIFileManager::sltHandleHidePanel);
    359371}
    360372
     
    484496    if (!pSenderAction)
    485497        return;
    486     UIFileManagerPanel* pPanel = 0;
     498    UIDialogPanel* pPanel = 0;
    487499    /* Look for the sender() within the m_panelActionMap's values: */
    488     for (QMap<UIFileManagerPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin();
     500    for (QMap<UIDialogPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin();
    489501        iterator != m_panelActionMap.end(); ++iterator)
    490502    {
     
    527539    if (m_pHostFileTable)
    528540        m_pHostFileTable->optionsUpdated();
     541}
     542
     543void UIFileManager::sltHandleHidePanel(UIDialogPanel *pPanel)
     544{
     545    hidePanel(pPanel);
    529546}
    530547
     
    678695    /* Save a list of currently visible panels: */
    679696    QStringList strNameList;
    680     foreach(UIFileManagerPanel* pPanel, m_visiblePanelsList)
     697    foreach(UIDialogPanel* pPanel, m_visiblePanelsList)
    681698        strNameList.append(pPanel->panelName());
    682699    gEDataManager->setFileManagerVisiblePanels(strNameList);
     
    707724    foreach(const QString strName, strNameList)
    708725    {
    709         foreach(UIFileManagerPanel* pPanel, m_panelActionMap.keys())
     726        foreach(UIDialogPanel* pPanel, m_panelActionMap.keys())
    710727        {
    711728            if (strName == pPanel->panelName())
     
    731748}
    732749
    733 void UIFileManager::hidePanel(UIFileManagerPanel* panel)
     750void UIFileManager::hidePanel(UIDialogPanel* panel)
    734751{
    735752    if (panel && panel->isVisible())
    736753        panel->setVisible(false);
    737     QMap<UIFileManagerPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
     754    QMap<UIDialogPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
    738755    if (iterator != m_panelActionMap.end())
    739756    {
     
    745762}
    746763
    747 void UIFileManager::showPanel(UIFileManagerPanel* panel)
     764void UIFileManager::showPanel(UIDialogPanel* panel)
    748765{
    749766    if (panel && panel->isHidden())
    750767        panel->setVisible(true);
    751     QMap<UIFileManagerPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
     768    QMap<UIDialogPanel*, QAction*>::iterator iterator = m_panelActionMap.find(panel);
    752769    if (iterator != m_panelActionMap.end())
    753770    {
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h

    r76734 r76950  
    5050class UIGuestControlConsole;
    5151class UIGuestControlInterface;
    52 class UIFileManagerPanel;
     52class UIDialogPanel;
    5353class UIFileManagerLogPanel;
    5454class UIFileManagerOperationsPanel;
     
    124124    /** Performs whatever necessary when some signal about option change has been receieved. */
    125125    void sltHandleOptionsUpdated();
     126    void sltHandleHidePanel(UIDialogPanel *pPanel);
    126127
    127128private:
     
    157158     *  since some widgets are initilized with these options */
    158159    void loadOptions();
    159     void hidePanel(UIFileManagerPanel *panel);
    160     void showPanel(UIFileManagerPanel *panel);
     160    void hidePanel(UIDialogPanel *panel);
     161    void showPanel(UIDialogPanel *panel);
    161162    /** Makes sure escape key is assigned to only a single widget. This is done by checking
    162163        several things in the following order:
     
    189190    UIActionPool  *m_pActionPool;
    190191    const bool     m_fShowToolbar;
    191     QMap<UIFileManagerPanel*, QAction*> m_panelActionMap;
    192     QList<UIFileManagerPanel*>          m_visiblePanelsList;
     192    QMap<UIDialogPanel*, QAction*> m_panelActionMap;
     193    QList<UIDialogPanel*>          m_visiblePanelsList;
    193194    UIFileManagerOptionsPanel          *m_pOptionsPanel;
    194195    UIFileManagerLogPanel              *m_pLogPanel;
     
    196197    UIFileManagerOperationsPanel       *m_pOperationsPanel;
    197198    friend class UIFileManagerOptionsPanel;
    198     friend class UIFileManagerPanel;
    199199    friend class UIFileManagerDialog;
    200200};
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerLogPanel.cpp

    r76606 r76950  
    8383*********************************************************************************************************************************/
    8484
    85 UIFileManagerLogPanel::UIFileManagerLogPanel(UIFileManager *pManagerWidget, QWidget *pParent)
    86     : UIFileManagerPanel(pManagerWidget, pParent)
     85UIFileManagerLogPanel::UIFileManagerLogPanel(QWidget *pParent /* = 0 */)
     86    : UIDialogPanel(pParent)
    8787    , m_pLogTextEdit(0)
    8888{
     
    125125void UIFileManagerLogPanel::retranslateUi()
    126126{
    127     UIFileManagerPanel::retranslateUi();
     127    UIDialogPanel::retranslateUi();
    128128
    129129}
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerLogPanel.h

    r76581 r76950  
    2424/* GUI includes: */
    2525#include "UIGuestControlDefs.h"
    26 #include "UIFileManagerPanel.h"
     26#include "UIDialogPanel.h"
    2727
    2828/* Forward declarations: */
     
    3030class UIFileManager;
    3131
    32 /** UIFileManagerPanel extension to display file manager logs. */
    33 class UIFileManagerLogPanel : public UIFileManagerPanel
     32/** UIDialogPanel extension to display file manager logs. */
     33class UIFileManagerLogPanel : public UIDialogPanel
    3434{
    3535    Q_OBJECT;
     
    3737public:
    3838
    39     UIFileManagerLogPanel(UIFileManager *pManagerWidget, QWidget *pParent);
     39    UIFileManagerLogPanel(QWidget *pParent = 0);
    4040    void appendLog(const QString &str, FileManagerLogType);
    4141    virtual QString panelName() const /* override */;
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerOperationsPanel.cpp

    r76606 r76950  
    308308*********************************************************************************************************************************/
    309309
    310 UIFileManagerOperationsPanel::UIFileManagerOperationsPanel(UIFileManager *pManagerWidget,
    311                                                                                    QWidget *pParent)
    312     : UIFileManagerPanel(pManagerWidget, pParent)
     310UIFileManagerOperationsPanel::UIFileManagerOperationsPanel(QWidget *pParent /* = 0 */)
     311    : UIDialogPanel(pParent)
    313312    , m_pScrollArea(0)
    314313    , m_pContainerWidget(0)
     
    380379void UIFileManagerOperationsPanel::retranslateUi()
    381380{
    382     UIFileManagerPanel::retranslateUi();
     381    UIDialogPanel::retranslateUi();
    383382}
    384383
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerOperationsPanel.h

    r76581 r76950  
    2727/* GUI includes: */
    2828#include "UIGuestControlDefs.h"
    29 #include "UIFileManagerPanel.h"
     29#include "UIDialogPanel.h"
    3030
    3131/* Forward declarations: */
     
    4242/** UIVMLogViewerPanel extension hosting a QListWidget which in turn has a special QWidget extension
    4343  * to manage multiple CProgress instances. This is particulary used in monitoring file operations. */
    44 class UIFileManagerOperationsPanel : public UIFileManagerPanel
     44class UIFileManagerOperationsPanel : public UIDialogPanel
    4545{
    4646    Q_OBJECT;
     47
     48public:
     49
     50    UIFileManagerOperationsPanel(QWidget *pParent = 0);
     51    virtual QString panelName() const /* override */;
     52    void addNewProgress(const CProgress &comProgress);
    4753
    4854signals:
     
    5056    void sigFileOperationComplete(QUuid progressId);
    5157    void sigFileOperationFail(QString strErrorString, FileManagerLogType eLogType);
    52 
    53 public:
    54 
    55     UIFileManagerOperationsPanel(UIFileManager *pManagerWidget, QWidget *pParent);
    56     virtual QString panelName() const /* override */;
    57     void addNewProgress(const CProgress &comProgress);
    5858
    5959protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerOptionsPanel.cpp

    r76627 r76950  
    3232
    3333
    34 UIFileManagerOptionsPanel::UIFileManagerOptionsPanel(UIFileManager *pManagerWidget,
    35                                                                                QWidget *pParent, UIFileManagerOptions *pFileManagerOptions)
    36     : UIFileManagerPanel(pManagerWidget, pParent)
     34UIFileManagerOptionsPanel::UIFileManagerOptionsPanel(QWidget *pParent, UIFileManagerOptions *pFileManagerOptions)
     35    : UIDialogPanel(pParent)
    3736    , m_pListDirectoriesOnTopCheckBox(0)
    3837    , m_pDeleteConfirmationCheckBox(0)
     
    181180void UIFileManagerOptionsPanel::retranslateUi()
    182181{
    183     UIFileManagerPanel::retranslateUi();
     182    UIDialogPanel::retranslateUi();
    184183    if (m_pListDirectoriesOnTopCheckBox)
    185184    {
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerOptionsPanel.h

    r76626 r76950  
    2323
    2424/* GUI includes: */
    25 #include "UIFileManagerPanel.h"
     25#include "UIDialogPanel.h"
    2626
    2727/* Forward declarations: */
     
    3232class UIFileManagerOptions;
    3333
    34 /** UIFileManagerPanel extension to change file manager options. It directly
     34/** UIDialogPanel extension to change file manager options. It directly
    3535 *  modifies the options through the passed UIFileManagerOptions instance. */
    36 class UIFileManagerOptionsPanel : public UIFileManagerPanel
     36class UIFileManagerOptionsPanel : public UIDialogPanel
    3737{
    3838    Q_OBJECT;
     
    4040public:
    4141
    42     UIFileManagerOptionsPanel(UIFileManager *pManagerWidget,
    43                                            QWidget *pParent, UIFileManagerOptions *pFileManagerOptions);
     42    UIFileManagerOptionsPanel(QWidget *pParent, UIFileManagerOptions *pFileManagerOptions);
    4443    virtual QString panelName() const /* override */;
    4544    /** Reads the file manager options and updates the widget accordingly. This functions is typically called
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerSessionPanel.cpp

    r76606 r76950  
    216216*********************************************************************************************************************************/
    217217
    218 UIFileManagerSessionPanel::UIFileManagerSessionPanel(UIFileManager *pManagerWidget, QWidget *pParent)
    219     : UIFileManagerPanel(pManagerWidget, pParent)
     218UIFileManagerSessionPanel::UIFileManagerSessionPanel(QWidget *pParent /* = 0 */)
     219    : UIDialogPanel(pParent)
    220220    , m_pSessionCreateWidget(0)
    221221{
     
    262262void UIFileManagerSessionPanel::retranslateUi()
    263263{
    264     UIFileManagerPanel::retranslateUi();
     264    UIDialogPanel::retranslateUi();
    265265
    266266}
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerSessionPanel.h

    r76581 r76950  
    2323
    2424/* GUI includes: */
    25 #include "UIFileManagerPanel.h"
     25#include "UIDialogPanel.h"
    2626
    2727/* Forward declarations: */
     
    3030class UIGuestSessionCreateWidget;
    3131
    32 /** UIFileManagerPanel extension providing GUI for creating/stopping a guest session. */
    33 class UIFileManagerSessionPanel : public UIFileManagerPanel
     32/** UIDialogPanel extension providing GUI for creating/stopping a guest session. */
     33class UIFileManagerSessionPanel : public UIDialogPanel
    3434{
    3535    Q_OBJECT;
     
    3737public:
    3838
    39     UIFileManagerSessionPanel(UIFileManager *pManagerWidget, QWidget *pParent);
     39    UIFileManagerSessionPanel(QWidget *pParent = 0);
    4040    /** @name Enable/disable member widget wrt. guest session status.
    4141      * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoConfigurationPanel.h

    r76947 r76950  
    5151    void sigCustomVisoOptionsChanged(const QStringList &customVisoOptions);
    5252
    53 
    5453protected:
    5554
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