Changeset 77255 in vbox
- Timestamp:
- Feb 11, 2019 11:11:06 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128762
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp
r77215 r77255 1822 1822 setStatusTip(QApplication::translate("UIActionPool", "Add a disk image file")); 1823 1823 setToolTip(QApplication::translate("UIActionPool", "Add a Disk Image File (%1)").arg(shortcut().toString())); 1824 } 1825 }; 1826 1827 /** Simple action extension, used as 'Perform Create' action class. */ 1828 class UIActionMenuSelectorMediumPerformCreate : public UIActionSimple 1829 { 1830 Q_OBJECT; 1831 1832 public: 1833 1834 /** Constructs action passing @a pParent to the base-class. */ 1835 UIActionMenuSelectorMediumPerformCreate(UIActionPool *pParent) 1836 : UIActionSimple(pParent) 1837 { 1838 setShortcutContext(Qt::WidgetWithChildrenShortcut); 1839 setIcon(0, UIIconPool::iconSetFull(":/hd_create_32px.png", ":/hd_create_16px.png", 1840 ":/hd_create_disabled_32px.png", ":/hd_create_disabled_16px.png")); 1841 setIcon(1, UIIconPool::iconSetFull(":/cd_create_32px.png", ":/cd_create_16px.png", 1842 ":/cd_create_disabled_32px.png", ":/cd_create_disabled_16px.png")); 1843 setIcon(2, UIIconPool::iconSetFull(":/fd_create_32px.png", ":/fd_create_16px.png", 1844 ":/fd_create_disabled_32px.png", ":/fd_create_disabled_16px.png")); 1845 } 1846 1847 protected: 1848 1849 /** Returns shortcut extra-data ID. */ 1850 virtual QString shortcutExtraDataID() const /* override */ 1851 { 1852 return QString("CreateMedium"); 1853 } 1854 1855 /** Returns default shortcut. */ 1856 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 1857 { 1858 return QKeySequence(""); 1859 } 1860 1861 /** Handles translation event. */ 1862 virtual void retranslateUi() /* override */ 1863 { 1864 setName(QApplication::translate("UIActionPool", "&Create...")); 1865 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager")); 1866 setStatusTip(QApplication::translate("UIActionPool", "Create a new disk image")); 1867 setToolTip(QApplication::translate("UIActionPool", "Create a New Disk Image (%1)").arg(shortcut().toString())); 1824 1868 } 1825 1869 }; … … 2658 2702 m_pool[UIActionIndexST_M_Medium] = new UIActionMenuSelectorMedium(this); 2659 2703 m_pool[UIActionIndexST_M_Medium_S_Add] = new UIActionMenuSelectorMediumPerformAdd(this); 2704 m_pool[UIActionIndexST_M_Medium_S_Create] = new UIActionMenuSelectorMediumPerformCreate(this); 2660 2705 m_pool[UIActionIndexST_M_Medium_S_Copy] = new UIActionMenuSelectorMediumPerformCopy(this); 2661 2706 m_pool[UIActionIndexST_M_Medium_S_Move] = new UIActionMenuSelectorMediumPerformMove(this); … … 3114 3159 /* 'Add' action: */ 3115 3160 fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Add)) || fSeparator; 3161 fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Create)) || fSeparator; 3116 3162 3117 3163 /* Separator? */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r77014 r77255 133 133 UIActionIndexST_M_Medium, 134 134 UIActionIndexST_M_Medium_S_Add, 135 UIActionIndexST_M_Medium_S_Create, 135 136 UIActionIndexST_M_Medium_S_Copy, 136 137 UIActionIndexST_M_Medium_S_Move, -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r77161 r77255 492 492 } 493 493 494 void UIMediumManagerWidget::sltCreateMedium() 495 { 496 } 497 494 498 void UIMediumManagerWidget::sltCopyMedium() 495 499 { … … 637 641 { 638 642 menu.addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Add)); 643 menu.addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Create)); 639 644 menu.addAction(m_pActionPool->action(UIActionIndexST_M_Medium_T_Search)); 640 645 menu.addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Refresh)); … … 731 736 /* First of all, add actions which has smaller shortcut scope: */ 732 737 addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Add)); 738 addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Create)); 733 739 addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy)); 734 740 addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Move)); … … 742 748 connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Add), &QAction::triggered, 743 749 this, &UIMediumManagerWidget::sltAddMedium); 750 connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Create), &QAction::triggered, 751 this, &UIMediumManagerWidget::sltCreateMedium); 744 752 connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy), &QAction::triggered, 745 753 this, &UIMediumManagerWidget::sltCopyMedium); … … 800 808 /* Add toolbar actions: */ 801 809 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Add)); 810 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Create)); 802 811 m_pToolBar->addSeparator(); 803 812 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy)); … … 1071 1080 { 1072 1081 m_pActionPool->action(UIActionIndexST_M_Medium_S_Add)->setState((int)enmCurrentMediumType); 1082 m_pActionPool->action(UIActionIndexST_M_Medium_S_Create)->setState((int)enmCurrentMediumType); 1073 1083 m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy)->setState((int)enmCurrentMediumType); 1074 1084 m_pActionPool->action(UIActionIndexST_M_Medium_S_Move)->setState((int)enmCurrentMediumType); -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r77014 r77255 168 168 /** Handles command to add medium. */ 169 169 void sltAddMedium(); 170 /** Handles command to create medium. */ 171 void sltCreateMedium(); 170 172 /** Handles command to copy medium. */ 171 173 void sltCopyMedium(); -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
r77238 r77255 446 446 QUuid uMediumId; 447 447 448 if (m_enmMediumType == UIMediumDeviceType_Floppy) 449 uMediumId = vboxGlobal().showCreateFloppyDiskDialog(this, m_strMachineName, m_strMachineFolder); 450 else if (m_enmMediumType == UIMediumDeviceType_HardDisk) 451 uMediumId = vboxGlobal().createHDWithNewHDWizard(this, m_strMachineGuestOSTypeId, m_strMachineName, m_strMachineFolder); 452 else if (m_enmMediumType == UIMediumDeviceType_DVD) 453 uMediumId = vboxGlobal().createVisoMediumWithVisoCreator(this, m_strMachineName, m_strMachineFolder); 454 448 switch (m_enmMediumType) 449 { 450 case UIMediumDeviceType_Floppy: 451 uMediumId = vboxGlobal().showCreateFloppyDiskDialog(this, m_strMachineName, m_strMachineFolder); 452 break; 453 case UIMediumDeviceType_HardDisk: 454 uMediumId = vboxGlobal().createHDWithNewHDWizard(this, m_strMachineGuestOSTypeId, m_strMachineName, m_strMachineFolder); 455 break; 456 case UIMediumDeviceType_DVD: 457 uMediumId = vboxGlobal().createVisoMediumWithVisoCreator(this, m_strMachineName, m_strMachineFolder); 458 break; 459 default: 460 break; 461 } 455 462 if (!uMediumId.isNull()) 456 463 {
Note:
See TracChangeset
for help on using the changeset viewer.