VirtualBox

Changeset 92152 in vbox for trunk/src


Ignore:
Timestamp:
Oct 29, 2021 2:53:35 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Make UICloudMachineSettingsDialog have own notification-center; Pass it through to the child widget page and further to form-editor widget.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialog.cpp

    r84014 r92152  
    2222/* GUI includes: */
    2323#include "QIDialogButtonBox.h"
    24 #include "UIMessageCenter.h"
    2524#include "UICloudMachineSettingsDialog.h"
    2625#include "UICloudMachineSettingsDialogPage.h"
    2726#include "UICloudNetworkingStuff.h"
     27#include "UINotificationCenter.h"
    2828
    2929/* COM includes: */
     
    3636    , m_pPage(0)
    3737    , m_pButtonBox(0)
     38    , m_pNotificationCenter(0)
    3839{
    3940    prepare();
     41}
     42
     43UICloudMachineSettingsDialog::~UICloudMachineSettingsDialog()
     44{
     45    cleanup();
    4046}
    4147
     
    100106void UICloudMachineSettingsDialog::prepare()
    101107{
     108    /* Prepare local notification-center (parent to be assigned in the end): */
     109    m_pNotificationCenter = new UINotificationCenter(0);
     110
    102111    /* Prepare layout: */
    103112    QVBoxLayout *pLayout = new QVBoxLayout(this);
     
    128137    }
    129138
     139    /* Assign notification-center parent (after everything else is done): */
     140    m_pNotificationCenter->setParent(this);
     141
    130142    /* Apply language settings: */
    131143    retranslateUi();
    132144}
     145
     146void UICloudMachineSettingsDialog::cleanup()
     147{
     148    /* Cleanup local notification-center: */
     149    delete m_pNotificationCenter;
     150    m_pNotificationCenter = 0;
     151}
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialog.h

    r84010 r92152  
    3737/* Forward declarations: */
    3838class QIDialogButtonBox;
     39class UINotificationCenter;
    3940
    4041/** Cloud machine settings dialog. */
     
    4748    /** Constructs @a comCloudMachine settings dialog passing @a pParent to the base-class. */
    4849    UICloudMachineSettingsDialog(QWidget *pParent, const CCloudMachine &comCloudMachine);
     50    /** Destructs cloud machine settings dialog. */
     51    virtual ~UICloudMachineSettingsDialog() /* override final */;
     52
     53    /** Returns local notification-center reference. */
     54    UINotificationCenter *notificationCenter() const { return m_pNotificationCenter; }
    4955
    5056public slots:
     
    7379    /** Prepares all. */
    7480    void prepare();
     81    /** Cleanups all. */
     82    void cleanup();
    7583
    7684    /** Holds the cloud machine object reference. */
     
    8593    /** Holds the dialog button-box instance. */
    8694    QIDialogButtonBox                           *m_pButtonBox;
     95
     96    /** Holds the local notification-center instance. */
     97    UINotificationCenter *m_pNotificationCenter;
    8798};
    8899
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialogPage.cpp

    r84018 r92152  
    2121
    2222/* GUI includes: */
     23#include "UICloudMachineSettingsDialog.h"
    2324#include "UICloudMachineSettingsDialogPage.h"
    2425
     
    2728
    2829
    29 UICloudMachineSettingsDialogPage::UICloudMachineSettingsDialogPage(QWidget *pParent, bool fFullScale /* = true */)
     30UICloudMachineSettingsDialogPage::UICloudMachineSettingsDialogPage(QWidget *pParent,
     31                                                                   bool fFullScale /* = true */)
    3032    : QWidget(pParent)
     33    , m_pParent(qobject_cast<UICloudMachineSettingsDialog*>(pParent))
    3134    , m_fFullScale(fFullScale)
    3235{
     
    6164
    6265        /* Prepare form editor widget: */
    63         m_pFormEditor = new UIFormEditorWidget(this);
     66        m_pFormEditor = new UIFormEditorWidget(this, m_pParent ? m_pParent->notificationCenter() : 0);
    6467        if (m_pFormEditor)
    6568        {
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialogPage.h

    r84018 r92152  
    3232#include "COMEnums.h"
    3333#include "CForm.h"
     34
     35/* Forward declarations: */
     36class UICloudMachineSettingsDialog;
    3437
    3538/** Cloud machine settings dialog page. */
     
    7275    void updateEditor();
    7376
     77    /** Holds the parent cloud machine settings dialog reference. */
     78    UICloudMachineSettingsDialog *m_pParent;
     79
    7480    /** Holds whether this page is full-scale and should reflect at least 12 fields. */
    7581    bool  m_fFullScale;
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