VirtualBox

Changeset 92413 in vbox


Ignore:
Timestamp:
Nov 14, 2021 11:38:38 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10141. Passing the action pool instance pointer to UIMediumSelector.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r92397 r92413  
    18191819int UICommon::openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, const QUuid &uCurrentMediumId,
    18201820                                       QUuid &uSelectedMediumUuid, const QString &strMachineFolder, const QString &strMachineName,
    1821                                        const QString &strMachineGuestOSTypeId, bool fEnableCreate, const QUuid &uMachineID)
    1822 {
     1821                                       const QString &strMachineGuestOSTypeId, bool fEnableCreate, const QUuid &uMachineID,
     1822                                       UIActionPool *pActionPool)
     1823{
     1824    Q_UNUSED(pActionPool);
    18231825    QUuid uMachineOrGlobalId = uMachineID == QUuid() ? gEDataManager->GlobalID : uMachineID;
    18241826
     
    20932095                                                                 uCurrentID, uMediumID,
    20942096                                                                 strMachineFolder, comConstMachine.GetName(),
    2095                                                                  comConstMachine.GetOSTypeId(), true /*fEnableCreate */, comConstMachine.GetId());
     2097                                                                 comConstMachine.GetOSTypeId(), true /*fEnableCreate */,
     2098                                                                 comConstMachine.GetId(), pActionPool);
    20962099                    if (iDialogReturn == UIMediumSelector::ReturnCode_LeftEmpty &&
    20972100                        (target.mediumType == UIMediumDeviceType_DVD || target.mediumType == UIMediumDeviceType_Floppy))
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r92397 r92413  
    417417          * @param  fEnableCreate            Passes whether to show/enable create action in the medium selector dialog,
    418418          * @param  uMachineID               Passes the machine UUID,
     419          * @param  pActionPool              Passes the action pool instance pointer,
    419420          * returns the return code of the UIMediumSelector::ReturnCode as int. In case of a medium selection
    420421          *         UUID of the selected medium is stored in @param inOutUuid.*/
    421         int openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, const QUuid &uCurrentMediumId, QUuid &uSelectedMediumUuid,
    422                                      const QString &strMachineFolder, const QString &strMachineName,
    423                                      const QString &strMachineGuestOSTypeId, bool fEnableCreate, const QUuid &uMachineID);
     422        int openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, const QUuid &uCurrentMediumId,
     423                                     QUuid &uSelectedMediumUuid, const QString &strMachineFolder, const QString &strMachineName,
     424                                     const QString &strMachineGuestOSTypeId, bool fEnableCreate, const QUuid &uMachineID,
     425                                     UIActionPool *pActionPool);
    424426
    425427        /** Creates and shows a dialog (wizard) to create a medium of type @a enmMediumType.
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r92132 r92413  
    973973        /* Use the "safe way" to open stack of Mac OS X Sheets: */
    974974        QWidget *pWizardParent = windowManager().realParentWindow(this);
    975         UISafePointerWizardNewVM pWizard = new UIWizardNewVM(pWizardParent, m_pWidget->fullGroupName(), "gui-createvm");
     975        UISafePointerWizardNewVM pWizard = new UIWizardNewVM(pWizardParent, actionPool(),
     976                                                             m_pWidget->fullGroupName(), "gui-createvm");
    976977        windowManager().registerNewParent(pWizard, pWizardParent);
    977978
     
    10991100            UISafePointerSettingsDialogMachine pDialog = new UISettingsDialogMachine(pDialogParent,
    11001101                                                                                     uID.isNull() ? pItem->id() : uID,
    1101                                                                                      strCategory, strControl);
     1102                                                                                     strCategory, strControl, actionPool());
    11021103            windowManager().registerNewParent(pDialog, pDialogParent);
    11031104
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r92397 r92413  
    21532153    QPointer<UISettingsDialogMachine> pDialog = new UISettingsDialogMachine(activeMachineWindow(),
    21542154                                                                            machine().GetId(),
    2155                                                                             strCategory, strControl);
     2155                                                                            strCategory, strControl, actionPool());
    21562156    /* Executing VM settings window.
    21572157     * This blocking function calls for the internal event-loop to process all further events,
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r91713 r92413  
    320320
    321321UISettingsDialogMachine::UISettingsDialogMachine(QWidget *pParent, const QUuid &uMachineId,
    322                                                  const QString &strCategory, const QString &strControl)
     322                                                 const QString &strCategory, const QString &strControl, UIActionPool *pActionPool)
    323323    : UISettingsDialog(pParent)
    324324    , m_uMachineId(uMachineId)
    325325    , m_strCategory(strCategory)
    326326    , m_strControl(strControl)
     327    , m_pActionPool(pActionPool)
    327328{
    328329    /* Prepare: */
     
    705706                case MachineSettingsPageType_Storage:
    706707                {
    707                     pSettingsPage = new UIMachineSettingsStorage;
     708                    pSettingsPage = new UIMachineSettingsStorage(m_pActionPool);
    708709                    addItem(":/hd_32px.png", ":/hd_24px.png", ":/hd_16px.png",
    709710                            iPageIndex, "#storage", pSettingsPage);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h

    r91713 r92413  
    3434#include "CSession.h"
    3535
     36/* Forward declarations: */
     37class UIActionPool;
    3638
    3739/** UISettingsDialog extension encapsulating all the specific functionality of the Global Preferences. */
     
    9294      * @param  uMachineId    Brings the machine ID.
    9395      * @param  strCategory   Brings the name of category to be opened.
    94       * @param  strControl    Brings the name of control to be focused. */
     96      * @param  strControl    Brings the name of control to be focused.
     97      * @param  pActionPool   Brings the action pool instance.  */
    9598    UISettingsDialogMachine(QWidget *pParent, const QUuid &uMachineId,
    96                             const QString &strCategory, const QString &strControl);
     99                            const QString &strCategory, const QString &strControl, UIActionPool *pActionPool);
    97100
    98101protected:
     
    166169    CConsole  m_console;
    167170
     171    UIActionPool *m_pActionPool;
    168172};
    169173
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r91414 r92413  
    29432943const QString UIMachineSettingsStorage::s_strAttachmentMimeType = QString("application/virtualbox;value=StorageAttachmentID");
    29442944
    2945 UIMachineSettingsStorage::UIMachineSettingsStorage()
     2945UIMachineSettingsStorage::UIMachineSettingsStorage(UIActionPool *pActionPool)
    29462946    : m_pModelStorage(0)
    29472947    , m_pMediumIdHolder(new UIMediumIDHolder(this))
     
    30003000    , m_pLabelEncryption(0)
    30013001    , m_pFieldEncryption(0)
     3002    , m_pActionPool(pActionPool)
    30023003{
    30033004    /* Prepare: */
     
    40104011                                                      strMachineFolder, m_strMachineName,
    40114012                                                      m_strMachineGuestOSTypeId,
    4012                                                       true /* enable create action: */, m_uMachineId);
     4013                                                      true /* enable create action: */, m_uMachineId, m_pActionPool);
    40134014
    40144015    if (iResult == UIMediumSelector::ReturnCode_Rejected ||
     
    52235224                                                      strMachineFolder, m_strMachineName,
    52245225                                                      m_strMachineGuestOSTypeId,
    5225                                                       true /* enable cr1eate action: */, m_uMachineId);
     5226                                                      true /* enable cr1eate action: */, m_uMachineId, m_pActionPool);
    52265227
    52275228    /* Continue only if iResult is either UIMediumSelector::ReturnCode_Accepted or UIMediumSelector::ReturnCode_LeftEmpty: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r86233 r92413  
    4242class QITreeView;
    4343class StorageModel;
     44class QIToolBar;
     45class UIActionPool;
    4446class UIMediumIDHolder;
    45 class QIToolBar;
    4647struct UIDataSettingsMachineStorage;
    4748struct UIDataSettingsMachineStorageController;
     
    6970
    7071    /** Constructs Storage settings page. */
    71     UIMachineSettingsStorage();
     72    UIMachineSettingsStorage(UIActionPool *pActionPool);
    7273    /** Destructs Storage settings page. */
    7374    virtual ~UIMachineSettingsStorage() /* override */;
     
    407408        /** Holds the encryption field instance. */
    408409        QILabel          *m_pFieldEncryption;
     410        /** Holds the action pool instance. */
     411        UIActionPool     *m_pActionPool;
    409412   /** @} */
    410413};
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r92111 r92413  
    5252}
    5353
    54 UIWizardNewVM::UIWizardNewVM(QWidget *pParent, const QString &strMachineGroup /* = QString() */,
     54UIWizardNewVM::UIWizardNewVM(QWidget *pParent, UIActionPool *pActionPool,
     55                             const QString &strMachineGroup /* = QString() */,
    5556                             const QString &strHelpHashtag /* = QString() */)
    5657    : UINativeWizard(pParent, WizardType_NewVM, WizardMode_Auto, strHelpHashtag)
     
    7172    , m_enmDiskSource(SelectedDiskSource_New)
    7273    , m_fEmptyDiskRecommended(false)
     74    , m_pActionPool(pActionPool)
    7375{
    7476#ifndef VBOX_WS_MAC
     
    9597            setUnattendedPageVisible(false);
    9698            addPage(new UIWizardNewVMHardwarePage);
    97             addPage(new UIWizardNewVMDiskPage);
     99            addPage(new UIWizardNewVMDiskPage(m_pActionPool));
    98100            addPage(new UIWizardNewVMSummaryPage);
    99101            break;
     
    101103        case WizardMode_Expert:
    102104        {
    103             addPage(new UIWizardNewVMExpertPage);
     105            addPage(new UIWizardNewVMExpertPage(m_pActionPool));
    104106            break;
    105107        }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r92110 r92413  
    3131#include "CMediumFormat.h"
    3232#include "CGuestOSType.h"
     33
     34/* Forward declarations: */
     35class UIActionPool;
    3336
    3437enum SelectedDiskSource
     
    7174public:
    7275
    73     UIWizardNewVM(QWidget *pParent, const QString &strMachineGroup = QString(), const QString &strHelpHashtag = QString());
     76    UIWizardNewVM(QWidget *pParent, UIActionPool *pActionPool,
     77                  const QString &strMachineGroup = QString(), const QString &strHelpHashtag = QString());
    7478    bool isUnattendedEnabled() const;
    7579    void setDefaultUnattendedInstallData(const UIUnattendedInstallData &unattendedInstallData);
     
    241245       bool m_fEmptyDiskRecommended;
    242246       QVector<KMediumVariant> m_mediumVariants;
     247       UIActionPool *m_pActionPool;
    243248    /** @} */
    244249};
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp

    r92111 r92413  
    4242QUuid UIWizardNewVMDiskCommon::getWithFileOpenDialog(const QString &strOSTypeID,
    4343                                                     const QString &strMachineFolder,
    44                                                      QWidget *pCaller)
     44                                                     QWidget *pCaller, UIActionPool *pActionPool)
    4545{
    4646    QUuid uMediumId;
     
    5252                                                         strOSTypeID,
    5353                                                         false /* don't show/enable the create action: */,
    54                                                          QUuid() /* Machinie Id */);
     54                                                         QUuid() /* Machinie Id */, pActionPool);
    5555    if (returnCode != static_cast<int>(UIMediumSelector::ReturnCode_Accepted))
    5656        return QUuid();
     
    5858}
    5959
    60 UIWizardNewVMDiskPage::UIWizardNewVMDiskPage()
     60UIWizardNewVMDiskPage::UIWizardNewVMDiskPage(UIActionPool *pActionPool)
    6161    : m_pDiskSourceButtonGroup(0)
    6262    , m_pDiskEmpty(0)
     
    7575    , m_uMediumSizeMin(_4M)
    7676    , m_uMediumSizeMax(uiCommon().virtualBox().GetSystemProperties().GetInfoVDSize())
     77    , m_pActionPool(pActionPool)
    7778{
    7879    prepare();
     
    191192    QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog(comOSType.GetId(),
    192193                                                                     pWizard->machineFolder(),
    193                                                                      this);
     194                                                                     this, m_pActionPool);
    194195    if (!uMediumId.isNull())
    195196    {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.h

    r91593 r92413  
    4040class QIRichTextLabel;
    4141class QIToolButton;
     42class UIActionPool;
    4243class UIMediaComboBox;
    4344class UIMediumSizeEditor;
     
    4748    QUuid getWithFileOpenDialog(const QString &strOSTypeID,
    4849                                const QString &strMachineFolder,
    49                                 QWidget *pCaller);
     50                                QWidget *pCaller, UIActionPool *pActionPool);
    5051}
    5152
     
    5758public:
    5859
    59     UIWizardNewVMDiskPage();
     60    UIWizardNewVMDiskPage(UIActionPool *pActionPool);
    6061
    6162protected:
     
    110111        qulonglong m_uMediumSizeMax;
    111112    /** @} */
     113    UIActionPool *m_pActionPool;
    112114};
    113115
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp

    r92111 r92413  
    4141#include "CSystemProperties.h"
    4242
    43 UIWizardNewVMExpertPage::UIWizardNewVMExpertPage()
     43UIWizardNewVMExpertPage::UIWizardNewVMExpertPage(UIActionPool *pActionPool)
    4444    : m_pToolBox(0)
    4545    , m_pDiskFormatVariantGroupBox(0)
     
    6262    , m_uMediumSizeMin(_4M)
    6363    , m_uMediumSizeMax(uiCommon().virtualBox().GetSystemProperties().GetInfoVDSize())
     64    , m_pActionPool(pActionPool)
    6465{
    6566    /* Create widgets: */
     
    130131    QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog(comOSType.GetId(),
    131132                                                                     pWizard->machineFolder(),
    132                                                                      this);
     133                                                                     this, m_pActionPool);
    133134    if (!uMediumId.isNull())
    134135    {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.h

    r91277 r92413  
    3535class QRadioButton;
    3636class QIToolButton;
     37class UIActionPool;
    3738class UIAdditionalUnattendedOptions;
    3839class UIDiskFormatsComboBox;
     
    5354public:
    5455
    55     UIWizardNewVMExpertPage();
     56    UIWizardNewVMExpertPage(UIActionPool *pActionPool);
    5657
    5758private slots:
     
    148149        qulonglong m_uMediumSizeMin;
    149150        qulonglong m_uMediumSizeMax;
     151        UIActionPool *m_pActionPool;
    150152    /** @} */
    151153};
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