Changeset 77291 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 13, 2019 9:13:50 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128808
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r77278 r77291 2674 2674 2675 2675 2676 QUuid VBoxGlobal::openMediumCreatorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, 2677 const QString &strDefaultFolder /* = QString() */, const QString &strMachineName /* = QString() */, 2678 const QString &strMachineGuestOSTypeId /*= QString() */) 2679 { 2680 QUuid uMediumId; 2681 2682 switch (enmMediumType) 2683 { 2684 case UIMediumDeviceType_Floppy: 2685 uMediumId = showCreateFloppyDiskDialog(pParent, strDefaultFolder, strMachineName); 2686 break; 2687 case UIMediumDeviceType_HardDisk: 2688 uMediumId = createHDWithNewHDWizard(pParent, strDefaultFolder, strMachineName, strMachineGuestOSTypeId); 2689 break; 2690 case UIMediumDeviceType_DVD: 2691 uMediumId = createVisoMediumWithVisoCreator(pParent, strDefaultFolder, strMachineName); 2692 break; 2693 default: 2694 break; 2695 } 2696 2697 return uMediumId; 2698 } 2699 2676 2700 QUuid VBoxGlobal::createVisoMediumWithVisoCreator(QWidget *pParent, const QString &strDefaultFolder /* = QString */, 2677 2701 const QString &strMachineName /* = QString */) … … 2777 2801 2778 2802 int VBoxGlobal::openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, QUuid &outUuid, 2779 const QString &strMachine Name, const QString &strMachineFolder,2803 const QString &strMachineFolder, const QString &strMachineName, 2780 2804 const QString &strMachineGuestOSTypeId, bool fEnableCreate) 2781 2805 { … … 2811 2835 } 2812 2836 2813 QUuid VBoxGlobal::openMediumCreatorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, 2814 const QString &strDefaultFolder /* = QString() */, const QString &strMachineName /* = QString() */, 2815 const QString &strMachineGuestOSTypeId /*= QString() */) 2816 { 2817 QUuid uMediumId; 2818 2819 switch (enmMediumType) 2820 { 2821 case UIMediumDeviceType_Floppy: 2822 uMediumId = showCreateFloppyDiskDialog(pParent, strDefaultFolder, strMachineName); 2823 break; 2824 case UIMediumDeviceType_HardDisk: 2825 uMediumId = createHDWithNewHDWizard(pParent, strMachineGuestOSTypeId, strDefaultFolder, strMachineName); 2826 2827 break; 2828 case UIMediumDeviceType_DVD: 2829 uMediumId = createVisoMediumWithVisoCreator(pParent, strDefaultFolder, strMachineName); 2830 break; 2831 default: 2832 break; 2833 } 2834 2835 return uMediumId; 2836 } 2837 2838 QUuid VBoxGlobal::createHDWithNewHDWizard(QWidget *pParent, const QString &strMachineGuestOSTypeId, 2837 QUuid VBoxGlobal::createHDWithNewHDWizard(QWidget *pParent, const QString &strMachineGuestOSTypeId /* = QString() */, 2839 2838 const QString &strMachineFolder /* = QString() */, 2840 2839 const QString &strMachineName /* = QString() */) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r77277 r77291 502 502 const QString &strDefaultFolder = QString(), bool fUseLastFolder = false); 503 503 504 /** Creates a VISO by using the VISO creator dialog.505 * @param pParent Passes the dialog parent.506 * @param strDefaultFolder Passes the folder to save the VISO file.507 * @param strMachineName Passes the name of the machine, */508 QUuid createVisoMediumWithVisoCreator(QWidget *pParent, const QString &strDefaultFolder = QString(), const QString &strMachineName = QString());509 510 /** Creates and shows a dialog thru which user can create a new floppy disk a VISO using the file-open dialog.511 * @param parent Passes the parent of the dialog,512 * @param strDefaultFolder Passes the default folder,513 * @param strMachineName Passes the name of the machine,514 * returns the ID of the newly created medium if successful, a null QUuid otherwise.*/515 QUuid showCreateFloppyDiskDialog(QWidget *pParent, const QString &strDefaultFolder = QString(),516 const QString &strMachineName = QString());517 504 518 505 /** Creates and shows a UIMediumSelector dialog. … … 526 513 * UUID of the selected medium is stored in @param outUuid.*/ 527 514 int openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, QUuid &outUuid, 528 const QString &strMachine Name, const QString &strMachineFolder,515 const QString &strMachineFolder, const QString &strMachineName, 529 516 const QString &strMachineGuestOSTypeId, bool fEnableCreate); 530 517 … … 543 530 544 531 545 /** Creates and shows a UIWizardNewVD wizard.546 * @param parent Passes the parent of the wizard,547 * @param strMachineGuestOSTypeId Passes the string of machine's guest OS type ID,548 * @param strMachineFolder Passes the machine folder,549 * @param strMachineName Passes the name of the machine,550 * returns the ID of the created hard disk if successful, a null QUuid otherwise.*/551 QUuid createHDWithNewHDWizard(QWidget *pParent, const QString &strMachineGuestOSTypeId,552 const QString &strMachineFolder = QString(), const QString &strMachineName = QString());553 554 532 /** Prepares storage menu according passed parameters. 555 533 * @param menu Brings the #QMenu to be prepared. … … 713 691 /** Destrucs global VirtualBox object. */ 714 692 virtual ~VBoxGlobal() /* override */; 693 694 695 /** @name COM: Virtual Media create functions. 696 * @{ */ 697 698 /** Creates a VISO by using the VISO creator dialog. 699 * @param pParent Passes the dialog parent. 700 * @param strDefaultFolder Passes the folder to save the VISO file. 701 * @param strMachineName Passes the name of the machine, */ 702 QUuid createVisoMediumWithVisoCreator(QWidget *pParent, const QString &strDefaultFolder = QString(), const QString &strMachineName = QString()); 703 704 /** Creates and shows a dialog thru which user can create a new floppy disk a VISO using the file-open dialog. 705 * @param parent Passes the parent of the dialog, 706 * @param strDefaultFolder Passes the default folder, 707 * @param strMachineName Passes the name of the machine, 708 * returns the ID of the newly created medium if successful, a null QUuid otherwise.*/ 709 QUuid showCreateFloppyDiskDialog(QWidget *pParent, const QString &strDefaultFolder = QString(), 710 const QString &strMachineName = QString()); 711 712 /** Creates and shows a UIWizardNewVD wizard. 713 * @param parent Passes the parent of the wizard, 714 * @param strMachineFolder Passes the machine folder, 715 * @param strMachineName Passes the name of the machine, 716 * @param strMachineGuestOSTypeId Passes the string of machine's guest OS type ID, 717 * returns the ID of the created hard disk if successful, a null QUuid otherwise.*/ 718 QUuid createHDWithNewHDWizard(QWidget *pParent, const QString &strMachineFolder = QString(), 719 const QString &strMachineName = QString(), const QString &strMachineGuestOSTypeId = QString()); 720 /** @} */ 715 721 716 722 /** @name Common stuff. -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
r77277 r77291 156 156 prepareWidgets(); 157 157 prepareActions(); 158 prepareMenuAndToolBar(); 158 159 prepareConnections(); 159 160 } … … 182 183 { 183 184 /* Configure add-action: */ 184 m_pActionAdd->setShortcut(QKeySequence(" Ctrl+A"));185 m_pActionAdd->setShortcut(QKeySequence("")); 185 186 186 187 m_pActionAdd->setIcon(UIIconPool::iconSetFull(QString(":/%1_add_32px.png").arg(strPrefix), … … 188 189 QString(":/%1_add_disabled_32px.png").arg(strPrefix), 189 190 QString(":/%1_add_disabled_16px.png").arg(strPrefix))); 190 if (m_pMainMenu) 191 m_pMainMenu->addAction(m_pActionAdd); 192 if (m_pToolBar) 193 m_pToolBar->addAction(m_pActionAdd); 191 194 192 } 195 193 … … 197 195 if (m_pActionCreate) 198 196 { 199 200 m_pActionCreate->setShortcut(QKeySequence("Ctrl+C")); 197 m_pActionCreate->setShortcut(QKeySequence("")); 201 198 m_pActionCreate->setIcon(UIIconPool::iconSetFull(QString(":/%1_create_32px.png").arg(strPrefix), 202 199 QString(":/%1_create_16px.png").arg(strPrefix), 203 200 QString(":/%1_create_disabled_32px.png").arg(strPrefix), 204 201 QString(":/%1_create_disabled_16px.png").arg(strPrefix))); 205 if (m_pMainMenu)206 m_pMainMenu->addAction(m_pActionCreate);207 if (m_pToolBar)208 m_pToolBar->addAction(m_pActionCreate);209 202 } 210 203 … … 213 206 if (m_pActionRefresh) 214 207 { 215 m_pActionRefresh->setShortcut(QKeySequence( QKeySequence::Refresh));208 m_pActionRefresh->setShortcut(QKeySequence()); 216 209 if (m_pActionRefresh && m_pActionRefresh->icon().isNull()) 217 210 m_pActionRefresh->setIcon(UIIconPool::iconSetFull(":/refresh_32px.png", ":/refresh_16px.png", 218 211 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")); 219 if (m_pMainMenu) 220 m_pMainMenu->addAction(m_pActionRefresh); 221 if (m_pToolBar) 222 m_pToolBar->addAction(m_pActionRefresh); 223 } 212 } 213 } 214 215 void UIMediumSelector::prepareMenuAndToolBar() 216 { 217 if (!m_pMainMenu || !m_pToolBar) 218 return; 219 220 m_pMainMenu->addAction(m_pActionAdd); 221 m_pMainMenu->addAction(m_pActionCreate); 222 m_pMainMenu->addSeparator(); 223 m_pMainMenu->addAction(m_pActionRefresh); 224 225 m_pToolBar->addAction(m_pActionAdd); 226 m_pToolBar->addAction(m_pActionCreate); 227 m_pToolBar->addSeparator(); 228 m_pToolBar->addAction(m_pActionRefresh); 224 229 } 225 230 … … 748 753 { 749 754 case UIMediumDeviceType_DVD: 750 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Optical Disk Selector"))); 755 if (!m_strMachineName.isEmpty()) 756 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Optical Disk Selector"))); 757 else 758 setWindowTitle(QString("%1").arg(tr("Optical Disk Selector"))); 751 759 break; 752 760 case UIMediumDeviceType_Floppy: 753 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Floppy Disk Selector"))); 761 if (!m_strMachineName.isEmpty()) 762 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Floppy Disk Selector"))); 763 else 764 setWindowTitle(QString("%1").arg(tr("Floppy Disk Selector"))); 754 765 break; 755 766 case UIMediumDeviceType_HardDisk: 756 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Hard Disk Selector"))); 767 if (!m_strMachineName.isEmpty()) 768 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Hard Disk Selector"))); 769 else 770 setWindowTitle(QString("%1").arg(tr("Hard Disk Selector"))); 757 771 break; 758 772 case UIMediumDeviceType_All: 759 773 case UIMediumDeviceType_Invalid: 760 774 default: 761 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Virtual Medium Selector"))); 762 break; 763 } 764 } 775 if (!m_strMachineName.isEmpty()) 776 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Virtual Medium Selector"))); 777 else 778 setWindowTitle(QString("%1").arg(tr("Virtual Medium Selector"))); 779 break; 780 } 781 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h
r77217 r77291 104 104 void prepareWidgets(); 105 105 void prepareActions(); 106 void prepareMenuAndToolBar(); 106 107 void prepareConnections(); 107 108 /** Perform final preparations. */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r77277 r77291 3082 3082 void UIMachineSettingsStorage::sltCreateNewHardDisk() 3083 3083 { 3084 const QUuid uMediumId = vboxGlobal().createHDWithNewHDWizard(this, m_strMachineGuestOSTypeId, 3085 m_strMachineSettingsFilePath, m_strMachineName); 3084 const QUuid uMediumId = vboxGlobal().openMediumCreatorDialog(this, UIMediumDeviceType_HardDisk, m_strMachineSettingsFilePath, 3085 m_strMachineName, m_strMachineGuestOSTypeId); 3086 3086 3087 if (!uMediumId.isNull()) 3087 3088 m_pMediumIdHolder->setId(uMediumId); … … 3099 3100 QUuid uMediumId; 3100 3101 int iResult = vboxGlobal().openMediumSelectorDialog(this, m_pMediumIdHolder->type(), uMediumId, 3101 m_strMachineName, strMachineFolder,3102 strMachineFolder, m_strMachineName, 3102 3103 m_strMachineGuestOSTypeId, true /* enable create action: */); 3103 3104 … … 3811 3812 QUuid uMediumId; 3812 3813 int iResult = vboxGlobal().openMediumSelectorDialog(this, UIMediumDefs::mediumTypeToLocal(enmDevice), uMediumId, 3813 m_strMachineName, strMachineFolder,3814 strMachineFolder, m_strMachineName, 3814 3815 m_strMachineGuestOSTypeId, true /* enable cr1eate action: */); 3815 3816 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r77217 r77291 67 67 int returnCode = vboxGlobal().openMediumSelectorDialog(thisImp(), UIMediumDeviceType_HardDisk, 68 68 uMediumId, 69 fieldImp("machineFolder").toString(), 69 70 fieldImp("machineBaseName").toString(), 70 fieldImp("machineFolder").toString(),71 71 fieldImp("type").value<CGuestOSType>().GetId(), 72 72 false /* don't show/enable the create action: */);
Note:
See TracChangeset
for help on using the changeset viewer.