- Timestamp:
- May 31, 2010 12:14:53 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
r29730 r29897 544 544 545 545 UINewVMWzdPage5::UINewVMWzdPage5() 546 : m_iIDECount(0) 547 , m_iSATACount(0) 548 , m_iSCSICount(0) 549 , m_iFloppyCount(0) 550 , m_iSASCount(0) 546 551 { 547 552 /* Decorate page */ … … 670 675 671 676 /* Create recommended DVD storage controller */ 672 QString ctrDvdName = VBoxVMSettingsHD::tr("Storage Controller");673 677 KStorageBus ctrDvdBus = type.GetRecommendedDvdStorageBus(); 678 QString ctrDvdName = getNextControllerName(ctrDvdBus); 674 679 m_Machine.AddStorageController(ctrDvdName, ctrDvdBus); 675 680 … … 686 691 if (ctrHdBus != ctrDvdBus || hdStorageControllerType != dvdStorageControllerType) 687 692 { 688 ctrHdName = VBoxVMSettingsHD::tr("Storage Controller 1");693 ctrHdName = getNextControllerName(ctrHdBus); 689 694 m_Machine.AddStorageController(ctrHdName, ctrHdBus); 690 695 hdCtr = m_Machine.GetStorageControllerByName(ctrHdName); … … 786 791 } 787 792 793 QString UINewVMWzdPage5::getNextControllerName(KStorageBus type) 794 { 795 QString strControllerName; 796 switch (type) 797 { 798 case KStorageBus_IDE: 799 { 800 strControllerName = VBoxVMSettingsHD::tr("IDE Controller"); 801 ++m_iIDECount; 802 if (m_iIDECount > 1) 803 strControllerName = QString("%1 %2").arg(strControllerName).arg(m_iIDECount); 804 break; 805 } 806 case KStorageBus_SATA: 807 { 808 strControllerName = VBoxVMSettingsHD::tr("SATA Controller"); 809 ++m_iSATACount; 810 if (m_iSATACount > 1) 811 strControllerName = QString("%1 %2").arg(strControllerName).arg(m_iSATACount); 812 break; 813 } 814 case KStorageBus_SCSI: 815 { 816 strControllerName = VBoxVMSettingsHD::tr("SCSI Controller"); 817 ++m_iSCSICount; 818 if (m_iSCSICount > 1) 819 strControllerName = QString("%1 %2").arg(strControllerName).arg(m_iSCSICount); 820 break; 821 } 822 case KStorageBus_Floppy: 823 { 824 strControllerName = VBoxVMSettingsHD::tr("Floppy Controller"); 825 ++m_iFloppyCount; 826 if (m_iFloppyCount > 1) 827 strControllerName = QString("%1 %2").arg(strControllerName).arg(m_iFloppyCount); 828 break; 829 } 830 case KStorageBus_SAS: 831 { 832 strControllerName = VBoxVMSettingsHD::tr("SAS Controller"); 833 ++m_iSASCount; 834 if (m_iSASCount > 1) 835 strControllerName = QString("%1 %2").arg(strControllerName).arg(m_iSASCount); 836 break; 837 } 838 default: 839 break; 840 } 841 return strControllerName; 842 } 843 788 844 CMachine UINewVMWzdPage5::machine() const 789 845 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.h
r28800 r29897 178 178 void setMachine(const CMachine &machine); 179 179 CMachine m_Machine; 180 181 QString getNextControllerName(KStorageBus type); 182 int m_iIDECount; 183 int m_iSATACount; 184 int m_iSCSICount; 185 int m_iFloppyCount; 186 int m_iSASCount; 180 187 }; 181 188
Note:
See TracChangeset
for help on using the changeset viewer.