VirtualBox

Changeset 83960 in vbox


Ignore:
Timestamp:
Apr 24, 2020 9:22:19 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137525
Message:

FE/Qt: bugref:9653: VirtualBox Manager: A bit of macOS sheet adjustments for settings stuff.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r83951 r83960  
    547547    updateActionsAppearance();
    548548
    549     /* Create and execute global settings window: */
    550     QPointer<UISettingsDialogGlobal> pDlg = new UISettingsDialogGlobal(this);
    551     pDlg->execute();
    552     delete pDlg;
     549    /* Use the "safe way" to open stack of Mac OS X Sheets: */
     550    QWidget *pDialogParent = windowManager().realParentWindow(this);
     551    UISafePointerSettingsDialogGlobal pDialog = new UISettingsDialogGlobal(pDialogParent);
     552    windowManager().registerNewParent(pDialog, pDialogParent);
     553
     554    /* Execute dialog: */
     555    pDialog->execute();
     556    delete pDialog;
    553557}
    554558
     
    570574
    571575    /* Get first selected item: */
    572     UIVirtualMachineItem *pItem = currentItems().value(0);
     576    UIVirtualMachineItem *pItem = currentItem();
    573577
    574578    /* For global item or local machine: */
     
    598602                                                       const QUuid &uID /* = QString() */)
    599603{
    600     /* Get current item: */
    601     UIVirtualMachineItem *pItem = currentItem();
    602     AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    603 
    604604    /* Lock the action preventing cascade calls: */
    605605    UIQObjectPropertySetter guardBlock(actionPool()->action(UIActionIndexST_M_Machine_S_Settings), "opened", true);
     
    607607            this, &UIVirtualBoxManager::sltHandleUpdateActionAppearanceRequest);
    608608    updateActionsAppearance();
     609
     610    /* Get current item: */
     611    UIVirtualMachineItem *pItem = currentItem();
     612    AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    609613
    610614    /* Process href from VM details / description: */
     
    630634        m_fFirstMediumEnumerationHandled = true;
    631635
    632         /* Create and execute corresponding VM settings window: */
    633         QPointer<UISettingsDialogMachine> pDlg = new UISettingsDialogMachine(this,
    634                                                                              uID.isNull() ? pItem->id() : uID,
    635                                                                              strCategory, strControl);
    636         pDlg->execute();
    637         delete pDlg;
     636        /* Use the "safe way" to open stack of Mac OS X Sheets: */
     637        QWidget *pDialogParent = windowManager().realParentWindow(this);
     638        UISafePointerSettingsDialogMachine pDialog = new UISettingsDialogMachine(pDialogParent,
     639                                                                                 uID.isNull() ? pItem->id() : uID,
     640                                                                                 strCategory, strControl);
     641        windowManager().registerNewParent(pDialog, pDialogParent);
     642
     643        /* Execute dialog: */
     644        pDialog->execute();
     645        delete pDialog;
    638646    }
    639647}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h

    r83939 r83960  
    2121# pragma once
    2222#endif
     23
     24/* Qt includes: */
     25#include <QPointer>
    2326
    2427/* GUI includes: */
     
    7477    QString  m_strControl;
    7578};
     79
     80/** Safe pointer to cloud machine settings dialog. */
     81typedef QPointer<UISettingsDialogGlobal> UISafePointerSettingsDialogGlobal;
    7682
    7783
     
    167173};
    168174
     175/** Safe pointer to cloud machine settings dialog. */
     176typedef QPointer<UISettingsDialogMachine> UISafePointerSettingsDialogMachine;
     177
    169178
    170179#endif /* !FEQT_INCLUDED_SRC_settings_UISettingsDialogSpecific_h */
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