Changeset 98808 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 1, 2023 4:57:31 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r98779 r98808 1710 1710 } 1711 1711 1712 void UICommon::prepareStorageMenu(QMenu &menu,1713 1714 1712 void UICommon::prepareStorageMenu(QMenu *pMenu, 1713 QObject *pListener, const char *pszSlotName, 1714 const CMachine &comMachine, const QString &strControllerName, const StorageSlot &storageSlot) 1715 1715 { 1716 1716 /* Current attachment attributes: */ … … 1730 1730 1731 1731 /* Prepare open-existing-medium action: */ 1732 QAction *pActionOpenExistingMedium = menu.addAction(UIIconPool::iconSet(":/select_file_16px.png"),1733 QString(), pListener, pszSlotName);1732 QAction *pActionOpenExistingMedium = pMenu->addAction(UIIconPool::iconSet(":/select_file_16px.png"), 1733 QString(), pListener, pszSlotName); 1734 1734 pActionOpenExistingMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(), 1735 1735 comCurrentAttachment.GetDevice(), enmMediumType))); … … 1738 1738 1739 1739 /* Prepare open medium file action: */ 1740 QAction *pActionFileSelector = menu.addAction(UIIconPool::iconSet(":/select_file_16px.png"),1741 QString(), pListener, pszSlotName);1740 QAction *pActionFileSelector = pMenu->addAction(UIIconPool::iconSet(":/select_file_16px.png"), 1741 QString(), pListener, pszSlotName); 1742 1742 pActionFileSelector->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(), 1743 1743 comCurrentAttachment.GetDevice(), enmMediumType, … … 1747 1747 1748 1748 /* Insert separator: */ 1749 menu.addSeparator();1749 pMenu->addSeparator(); 1750 1750 1751 1751 /* Get existing-host-drive vector: */ … … 1777 1777 if (!fIsHostDriveUsed) 1778 1778 { 1779 QAction *pActionChooseHostDrive = menu.addAction(UIMedium(comMedium, enmMediumType).name(), pListener, pszSlotName);1779 QAction *pActionChooseHostDrive = pMenu->addAction(UIMedium(comMedium, enmMediumType).name(), pListener, pszSlotName); 1780 1780 pActionChooseHostDrive->setCheckable(true); 1781 1781 pActionChooseHostDrive->setChecked(!comCurrentMedium.isNull() && comMedium.GetId() == uCurrentID); … … 1832 1832 if (!fIsRecentMediumUsed) 1833 1833 { 1834 QAction *pActionChooseRecentMedium = menu.addAction(QFileInfo(strRecentMediumLocation).fileName(),1835 pListener, pszSlotName);1834 QAction *pActionChooseRecentMedium = pMenu->addAction(QFileInfo(strRecentMediumLocation).fileName(), 1835 pListener, pszSlotName); 1836 1836 pActionChooseRecentMedium->setCheckable(true); 1837 1837 pActionChooseRecentMedium->setChecked(!comCurrentMedium.isNull() && strRecentMediumLocation == strCurrentLocation); … … 1850 1850 { 1851 1851 /* Insert separator: */ 1852 menu.addSeparator();1852 pMenu->addSeparator(); 1853 1853 1854 1854 /* Prepare unmount-current-medium action: */ 1855 QAction *pActionUnmountMedium = menu.addAction(QString(), pListener, pszSlotName);1855 QAction *pActionUnmountMedium = pMenu->addAction(QString(), pListener, pszSlotName); 1856 1856 pActionUnmountMedium->setEnabled(!comCurrentMedium.isNull()); 1857 1857 pActionUnmountMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(), -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r98779 r98808 421 421 * @param strControllerName Brings the name of the #CStorageController in the @a machine above. 422 422 * @param storageSlot Brings the #StorageSlot of the storage controller with @a strControllerName above. */ 423 void prepareStorageMenu(QMenu &menu,423 void prepareStorageMenu(QMenu *pMenu, 424 424 QObject *pListener, const char *pszSlotName, 425 425 const CMachine &comMachine, const QString &strControllerName, const StorageSlot &storageSlot); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r98103 r98808 1077 1077 1078 1078 /* Fill storage-menu: */ 1079 uiCommon().prepareStorageMenu( menu, this, SLOT(sltMountStorageMedium()),1079 uiCommon().prepareStorageMenu(&menu, this, SLOT(sltMountStorageMedium()), 1080 1080 machine(), strControllerName, storageSlot); 1081 1081 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98806 r98808 770 770 { 771 771 return uisession()->mountBootMedium(uMediumId); 772 } 773 774 void UIMachine::prepareStorageMenu(QMenu *pMenu, 775 QObject *pListener, const char *pszSlotName, 776 const QString &strControllerName, const StorageSlot &storageSlot) 777 { 778 return uisession()->prepareStorageMenu(pMenu, 779 pListener, pszSlotName, 780 strControllerName, storageSlot); 781 } 782 783 void UIMachine::updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool) 784 { 785 return uisession()->updateMachineStorage(target, pActionPool); 772 786 } 773 787 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98806 r98808 40 40 #include "UIExtraDataDefs.h" 41 41 #include "UIMachineDefs.h" 42 #include "UIMediumDefs.h" 42 43 #include "UIMousePointerShapeData.h" 43 44 #include "UITextTable.h" … … 527 528 * if it can find an appropriate controller and port. */ 528 529 bool mountBootMedium(const QUuid &uMediumId); 530 531 /** Prepares storage menu. */ 532 void prepareStorageMenu(QMenu *pMenu, 533 QObject *pListener, const char *pszSlotName, 534 const QString &strControllerName, const StorageSlot &storageSlot); 535 /** Updates machine storage with data described by target. */ 536 void updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool); 529 537 /** @} */ 530 538 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r98805 r98808 268 268 { 269 269 return uimachine()->actionPool(); 270 }271 272 CMachine& UIMachineLogic::machine() const273 {274 return uisession()->machine();275 270 } 276 271 … … 2167 2162 2168 2163 /* Update current machine mount-target: */ 2169 ui Common().updateMachineStorage(machine(),target, actionPool());2164 uimachine()->updateMachineStorage(target, actionPool()); 2170 2165 } 2171 2166 … … 2683 2678 2684 2679 /* Fill current storage menu: */ 2685 ui Common().prepareStorageMenu(*pStorageMenu,2686 this, SLOT(sltMountStorageMedium()), machine(),2687 guiStorageDevice.m_strControllerName, guiStorageDevice.m_guiStorageSlot);2680 uimachine()->prepareStorageMenu(pStorageMenu, 2681 this, SLOT(sltMountStorageMedium()), 2682 guiStorageDevice.m_strControllerName, guiStorageDevice.m_guiStorageSlot); 2688 2683 } 2689 2684 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r98805 r98808 37 37 #include "UISettingsDialog.h" 38 38 39 /* COM includes: */40 #include "COMEnums.h"41 42 39 /* Forward declarations: */ 43 40 class QAction; … … 54 51 class UISoftKeyboard; 55 52 class UIVMInformationDialog; 56 class CMachine;57 class CMouse;58 class CSnapshot;59 53 class CUSBDevice; 60 54 class CVirtualBoxErrorInfo; … … 107 101 /** Returns action-pool reference. */ 108 102 UIActionPool *actionPool() const; 109 110 /** Returns the session's machine reference. */111 CMachine& machine() const;112 103 113 104 /** Returns the machine name. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98805 r98808 844 844 } 845 845 846 void UISession::prepareStorageMenu(QMenu *pMenu, 847 QObject *pListener, const char *pszSlotName, 848 const QString &strControllerName, const StorageSlot &storageSlot) 849 { 850 CMachine comMachine = machine(); 851 uiCommon().prepareStorageMenu(pMenu, 852 pListener, pszSlotName, 853 comMachine, strControllerName, storageSlot); 854 } 855 856 void UISession::updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool) 857 { 858 CMachine comMachine = machine(); 859 uiCommon().updateMachineStorage(comMachine, target, pActionPool); 860 } 861 846 862 bool UISession::usbDevices(QList<USBDeviceInfo> &guiUSBDevices) 847 863 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98805 r98808 338 338 * if it can find an appropriate controller and port. */ 339 339 bool mountBootMedium(const QUuid &uMediumId); 340 341 /** Prepares storage menu. */ 342 void prepareStorageMenu(QMenu *pMenu, 343 QObject *pListener, const char *pszSlotName, 344 const QString &strControllerName, const StorageSlot &storageSlot); 345 /** Updates machine storage with data described by target. */ 346 void updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool); 340 347 /** @} */ 341 348
Note:
See TracChangeset
for help on using the changeset viewer.