Changeset 80073 in vbox
- Timestamp:
- Jul 31, 2019 11:54:13 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r80046 r80073 294 294 /* Graphics Controller: */ 295 295 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController) 296 { 297 const QString strAnchorType = QString("graphics_controller_type"); 298 const KGraphicsControllerType enmType = comMachine.GetGraphicsControllerType(); 296 299 table << UITextTableLine(QApplication::translate("UIDetails", "Graphics Controller", "details (display)"), 297 gpConverter->toString(comMachine.GetGraphicsControllerType())); 300 QApplication::translate("UIDetails", "<a href=#%1,%2>%3</a>", "details") 301 .arg(strAnchorType) 302 .arg((int)enmType) 303 .arg(gpConverter->toString(enmType))); 304 } 298 305 299 306 /* Acceleration: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.cpp
r80046 r80073 122 122 break; 123 123 } 124 case MachineAttribute_GraphicsControllerType: 125 { 126 /* Change machine graphics controller type: */ 127 comMachine.SetGraphicsControllerType(guiAttribute.value<KGraphicsControllerType>()); 128 if (!comMachine.isOk()) 129 { 130 msgCenter().cannotChangeMachineAttribute(comMachine); 131 fErrorHappened = true; 132 } 133 break; 134 } 124 135 default: 125 136 break; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.h
r80046 r80073 36 36 MachineAttribute_BootOrder, 37 37 MachineAttribute_VideoMemory, 38 MachineAttribute_GraphicsControllerType, 38 39 }; 39 40 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r80046 r80073 35 35 #include "UIDetailsModel.h" 36 36 #include "UIExtraDataManager.h" 37 #include "UIGraphicsControllerEditor.h" 37 38 #include "UIGraphicsRotatorButton.h" 38 39 #include "UIGraphicsTextPane.h" … … 54 55 AnchorRole_BootOrder, 55 56 AnchorRole_VideoMemory, 57 AnchorRole_GraphicsControllerType, 56 58 AnchorRole_Storage, 57 59 }; … … 159 161 m_pTextPane->setAnchorRoleRestricted("#boot_order", cal != ConfigurationAccessLevel_Full); 160 162 m_pTextPane->setAnchorRoleRestricted("#video_memory", cal != ConfigurationAccessLevel_Full); 163 m_pTextPane->setAnchorRoleRestricted("#graphics_controller_type", cal != ConfigurationAccessLevel_Full); 161 164 m_pTextPane->setAnchorRoleRestricted("#mount", cal == ConfigurationAccessLevel_Null); 162 165 m_pTextPane->setAnchorRoleRestricted("#attach", cal != ConfigurationAccessLevel_Full); … … 444 447 roles["#boot_order"] = AnchorRole_BootOrder; 445 448 roles["#video_memory"] = AnchorRole_VideoMemory; 449 roles["#graphics_controller_type"] = AnchorRole_GraphicsControllerType; 446 450 roles["#mount"] = AnchorRole_Storage; 447 451 roles["#attach"] = AnchorRole_Storage; … … 609 613 break; 610 614 } 615 case AnchorRole_GraphicsControllerType: 616 { 617 /* Prepare popup: */ 618 QPointer<QIDialogContainer> pPopup = new QIDialogContainer(0, Qt::Tool); 619 if (pPopup) 620 { 621 /* Prepare editor: */ 622 UIGraphicsControllerEditor *pEditor = new UIGraphicsControllerEditor(pPopup, true /* with label */); 623 if (pEditor) 624 { 625 pEditor->setValue(static_cast<KGraphicsControllerType>(strData.section(',', 0, 0).toInt())); 626 pPopup->setWidget(pEditor); 627 } 628 629 /* Adjust popup geometry: */ 630 pPopup->move(QCursor::pos()); 631 pPopup->adjustSize(); 632 633 // WORKAROUND: 634 // On Windows, Tool dialogs aren't activated by default by some reason. 635 // So we have created sltActivateWindow wrapping actual activateWindow 636 // to fix that annoying issue. 637 QMetaObject::invokeMethod(pPopup, "sltActivateWindow", Qt::QueuedConnection); 638 /* Execute popup, change machine name if confirmed: */ 639 if (pPopup->exec() == QDialog::Accepted) 640 setMachineAttribute(machine(), MachineAttribute_GraphicsControllerType, QVariant::fromValue(pEditor->value())); 641 642 /* Delete popup: */ 643 delete pPopup; 644 } 645 break; 646 } 611 647 case AnchorRole_Storage: 612 648 {
Note:
See TracChangeset
for help on using the changeset viewer.