Changeset 72527 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 12, 2018 1:56:47 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r72174 r72527 372 372 m_enmVSDType == KVirtualSystemDescriptionType_NetworkAdapter || 373 373 m_enmVSDType == KVirtualSystemDescriptionType_HardDiskControllerIDE || 374 m_enmVSDType == KVirtualSystemDescriptionType_HardDiskImage) && 374 m_enmVSDType == KVirtualSystemDescriptionType_HardDiskImage || 375 m_enmVSDType == KVirtualSystemDescriptionType_SettingsFile || 376 m_enmVSDType == KVirtualSystemDescriptionType_BaseFolder || 377 m_enmVSDType == KVirtualSystemDescriptionType_PrimaryGroup) && 375 378 m_checkState == Qt::Checked) /* Item has to be enabled */ 376 379 enmFlags |= Qt::ItemIsEditable; … … 451 454 case KVirtualSystemDescriptionType_SoundCard: value = UIApplianceEditorWidget::tr("Sound Card"); break; 452 455 case KVirtualSystemDescriptionType_HardDiskImage: value = UIApplianceEditorWidget::tr("Virtual Disk Image"); break; 456 case KVirtualSystemDescriptionType_SettingsFile: value = UIApplianceEditorWidget::tr("Settings File"); break; 457 case KVirtualSystemDescriptionType_BaseFolder: value = UIApplianceEditorWidget::tr("Base Folder"); break; 458 case KVirtualSystemDescriptionType_PrimaryGroup: value = UIApplianceEditorWidget::tr("Primary Group"); break; 453 459 default: value = UIApplianceEditorWidget::tr("Unknown Hardware Item"); break; 454 460 } … … 516 522 case KVirtualSystemDescriptionType_USBController: value = UIIconPool::iconSet(":/usb_16px.png"); break; 517 523 case KVirtualSystemDescriptionType_SoundCard: value = UIIconPool::iconSet(":/sound_16px.png"); break; 524 case KVirtualSystemDescriptionType_BaseFolder: value = vboxGlobal().icon(QFileIconProvider::Folder); break; 525 case KVirtualSystemDescriptionType_PrimaryGroup: value = UIIconPool::iconSet(":/vm_group_name_16px.png"); break; 518 526 default: break; 519 527 } … … 666 674 case KVirtualSystemDescriptionType_HardDiskImage: 667 675 { 668 UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent); 669 pFileChooser->setMode(UIFilePathSelector::Mode_File_Save); 670 pFileChooser->setResetEnabled(false); 671 pEditor = pFileChooser; 676 UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent); 677 pFileChooser->setMode(UIFilePathSelector::Mode_File_Save); 678 pFileChooser->setResetEnabled(false); 679 pEditor = pFileChooser; 680 break; 681 } 682 case KVirtualSystemDescriptionType_SettingsFile: 683 { 684 UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent); 685 pFileChooser->setMode(UIFilePathSelector::Mode_File_Save); 686 pFileChooser->setResetEnabled(false); 687 pEditor = pFileChooser; 688 break; 689 } 690 case KVirtualSystemDescriptionType_BaseFolder: 691 { 692 UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent); 693 pFileChooser->setMode(UIFilePathSelector::Mode_Folder); 694 pFileChooser->setResetEnabled(false); 695 pEditor = pFileChooser; 696 break; 697 } 698 case KVirtualSystemDescriptionType_PrimaryGroup: 699 { 700 QComboBox *pComboBox = new QComboBox(pParent); 701 pComboBox->setEditable(true); 702 QVector<QString> groupsVector = vboxGlobal().virtualBox().GetMachineGroups(); 703 704 for (int i = 0; i < groupsVector.size(); ++i) 705 pComboBox->addItem(groupsVector.at(i)); 706 pEditor = pComboBox; 672 707 break; 673 708 } … … 750 785 } 751 786 case KVirtualSystemDescriptionType_HardDiskImage: 787 case KVirtualSystemDescriptionType_SettingsFile: 788 case KVirtualSystemDescriptionType_BaseFolder: 752 789 { 753 790 if (UIFilePathSelector *pFileChooser = qobject_cast<UIFilePathSelector*>(pEditor)) 754 791 { 755 792 pFileChooser->setPath(m_strConfigValue); 793 fDone = true; 794 } 795 break; 796 } 797 case KVirtualSystemDescriptionType_PrimaryGroup: 798 { 799 if (QComboBox *pGroupCombo = qobject_cast<QComboBox*>(pEditor)) 800 { 801 pGroupCombo->setCurrentText(m_strConfigValue); 756 802 fDone = true; 757 803 } … … 872 918 { 873 919 m_strConfigValue = pComboBox->itemData(pComboBox->currentIndex()).toString(); 920 printf("%s\n", qPrintable(pComboBox->itemData(pComboBox->currentIndex()).toString())); 921 fDone = true; 922 } 923 break; 924 } 925 case KVirtualSystemDescriptionType_PrimaryGroup: 926 { 927 if (QComboBox *pComboBox = qobject_cast<QComboBox*>(pEditor)) 928 { 929 m_strConfigValue = pComboBox->currentText(); 874 930 fDone = true; 875 931 } … … 877 933 } 878 934 case KVirtualSystemDescriptionType_HardDiskImage: 935 case KVirtualSystemDescriptionType_BaseFolder: 879 936 { 880 937 if (UIFilePathSelector *pFileChooser = qobject_cast<UIFilePathSelector*>(pEditor)) … … 935 992 for (int i = 0; i < types.size(); ++i) 936 993 { 994 if (types[i] == KVirtualSystemDescriptionType_SettingsFile) 995 continue; 937 996 /* We add the hard disk images in an second step, so save a 938 997 reference to them. */ 939 if (types[i] == KVirtualSystemDescriptionType_HardDiskImage)998 else if (types[i] == KVirtualSystemDescriptionType_HardDiskImage) 940 999 hdIndexes << i; 941 1000 else
Note:
See TracChangeset
for help on using the changeset viewer.