Changeset 80046 in vbox
- Timestamp:
- Jul 29, 2019 4:06:19 PM (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
r79982 r80046 256 256 /* Video memory: */ 257 257 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM) 258 { 259 /* Configure hovering anchor: */ 260 const QString strAnchorType = QString("video_memory"); 261 const int iVideoMemory = comMachine.GetVRAMSize(); 258 262 table << UITextTableLine(QApplication::translate("UIDetails", "Video Memory", "details (display)"), 259 QApplication::translate("UIDetails", "%1 MB", "details").arg(comMachine.GetVRAMSize())); 263 QApplication::translate("UIDetails", "<a href=#%1,%2>%2 MB</a>", "details") 264 .arg(strAnchorType).arg(iVideoMemory)); 265 } 260 266 261 267 /* Screens: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.cpp
r79982 r80046 111 111 break; 112 112 } 113 case MachineAttribute_VideoMemory: 114 { 115 /* Change machine video memory (VRAM): */ 116 comMachine.SetVRAMSize(guiAttribute.toInt()); 117 if (!comMachine.isOk()) 118 { 119 msgCenter().cannotChangeMachineAttribute(comMachine); 120 fErrorHappened = true; 121 } 122 break; 123 } 113 124 default: 114 125 break; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.h
r79982 r80046 35 35 MachineAttribute_BaseMemory, 36 36 MachineAttribute_BootOrder, 37 MachineAttribute_VideoMemory, 37 38 }; 38 39 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r79997 r80046 40 40 #include "UIMachineAttributeSetter.h" 41 41 #include "UINameAndSystemEditor.h" 42 #include "UIVideoMemoryEditor.h" 42 43 #include "UIVirtualBoxManager.h" 43 44 … … 52 53 AnchorRole_BaseMemory, 53 54 AnchorRole_BootOrder, 55 AnchorRole_VideoMemory, 54 56 AnchorRole_Storage, 55 57 }; … … 156 158 m_pTextPane->setAnchorRoleRestricted("#base_memory", cal != ConfigurationAccessLevel_Full); 157 159 m_pTextPane->setAnchorRoleRestricted("#boot_order", cal != ConfigurationAccessLevel_Full); 160 m_pTextPane->setAnchorRoleRestricted("#video_memory", cal != ConfigurationAccessLevel_Full); 158 161 m_pTextPane->setAnchorRoleRestricted("#mount", cal == ConfigurationAccessLevel_Null); 159 162 m_pTextPane->setAnchorRoleRestricted("#attach", cal != ConfigurationAccessLevel_Full); … … 440 443 roles["#base_memory"] = AnchorRole_BaseMemory; 441 444 roles["#boot_order"] = AnchorRole_BootOrder; 445 roles["#video_memory"] = AnchorRole_VideoMemory; 442 446 roles["#mount"] = AnchorRole_Storage; 443 447 roles["#attach"] = AnchorRole_Storage; … … 571 575 break; 572 576 } 577 case AnchorRole_VideoMemory: 578 { 579 /* Prepare popup: */ 580 QPointer<QIDialogContainer> pPopup = new QIDialogContainer(0, Qt::Tool); 581 if (pPopup) 582 { 583 /* Prepare editor: */ 584 UIVideoMemoryEditor *pEditor = new UIVideoMemoryEditor(pPopup, true /* with label */); 585 if (pEditor) 586 { 587 pEditor->setValue(strData.section(',', 0, 0).toInt()); 588 connect(pEditor, &UIVideoMemoryEditor::sigValidChanged, 589 pPopup.data(), &QIDialogContainer::setOkButtonEnabled); 590 pPopup->setWidget(pEditor); 591 } 592 593 /* Adjust popup geometry: */ 594 pPopup->move(QCursor::pos()); 595 pPopup->adjustSize(); 596 597 // WORKAROUND: 598 // On Windows, Tool dialogs aren't activated by default by some reason. 599 // So we have created sltActivateWindow wrapping actual activateWindow 600 // to fix that annoying issue. 601 QMetaObject::invokeMethod(pPopup, "sltActivateWindow", Qt::QueuedConnection); 602 /* Execute popup, change machine name if confirmed: */ 603 if (pPopup->exec() == QDialog::Accepted) 604 setMachineAttribute(machine(), MachineAttribute_VideoMemory, QVariant::fromValue(pEditor->value())); 605 606 /* Delete popup: */ 607 delete pPopup; 608 } 609 break; 610 } 573 611 case AnchorRole_Storage: 574 612 {
Note:
See TracChangeset
for help on using the changeset viewer.