Changeset 79959 in vbox
- Timestamp:
- Jul 24, 2019 1:57:03 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132390
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r79948 r79959 888 888 src/settings/machine/UIMachineSettingsUSBFilterDetails.h \ 889 889 src/widgets/UIAddDiskEncryptionPasswordDialog.h \ 890 src/widgets/UIBaseMemoryEditor.h \ 890 891 src/widgets/UIBaseMemorySlider.h \ 891 892 src/widgets/UIBootTable.h \ … … 1378 1379 src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp \ 1379 1380 src/widgets/UIAddDiskEncryptionPasswordDialog.cpp \ 1381 src/widgets/UIBaseMemoryEditor.cpp \ 1380 1382 src/widgets/UIBaseMemorySlider.cpp \ 1381 1383 src/widgets/UIBootTable.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r79940 r79959 132 132 /* Base memory: */ 133 133 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM) 134 { 135 /* Configure hovering anchor: */ 136 const QString strAnchorType = QString("base_memory"); 137 const int iBaseMemory = comMachine.GetMemorySize(); 134 138 table << UITextTableLine(QApplication::translate("UIDetails", "Base Memory", "details (system)"), 135 QApplication::translate("UIDetails", "%1 MB", "details").arg(comMachine.GetMemorySize())); 139 QApplication::translate("UIDetails", "<a href=#%1,%2>%2 MB</a>", "details") 140 .arg(strAnchorType).arg(iBaseMemory)); 141 } 136 142 137 143 /* Processors: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.cpp
r79940 r79959 88 88 break; 89 89 } 90 case MachineAttribute_BaseMemory: 91 { 92 /* Change machine base memory (RAM): */ 93 comMachine.SetMemorySize(guiAttribute.toInt()); 94 if (!comMachine.isOk()) 95 { 96 msgCenter().cannotChangeMachineAttribute(comMachine); 97 fErrorHappened = true; 98 } 99 break; 100 } 90 101 default: 91 102 break; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.h
r79940 r79959 33 33 MachineAttribute_OSType, 34 34 MachineAttribute_Location, 35 MachineAttribute_BaseMemory, 35 36 }; 36 37 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r79940 r79959 27 27 #include "QIDialogContainer.h" 28 28 #include "UIActionPool.h" 29 #include "UIBaseMemoryEditor.h" 29 30 #include "UICommon.h" 30 31 #include "UIConverter.h" … … 48 49 AnchorRole_MachineLocation, 49 50 AnchorRole_OSType, 51 AnchorRole_BaseMemory, 50 52 AnchorRole_Storage, 51 53 }; … … 150 152 m_pTextPane->setAnchorRoleRestricted("#machine_location", cal != ConfigurationAccessLevel_Full); 151 153 m_pTextPane->setAnchorRoleRestricted("#os_type", cal != ConfigurationAccessLevel_Full); 154 m_pTextPane->setAnchorRoleRestricted("#base_memory", cal != ConfigurationAccessLevel_Full); 152 155 m_pTextPane->setAnchorRoleRestricted("#mount", cal == ConfigurationAccessLevel_Null); 153 156 m_pTextPane->setAnchorRoleRestricted("#attach", cal != ConfigurationAccessLevel_Full); … … 432 435 roles["#machine_location"] = AnchorRole_MachineLocation; 433 436 roles["#os_type"] = AnchorRole_OSType; 437 roles["#base_memory"] = AnchorRole_BaseMemory; 434 438 roles["#mount"] = AnchorRole_Storage; 435 439 roles["#attach"] = AnchorRole_Storage; … … 497 501 break; 498 502 } 503 case AnchorRole_BaseMemory: 504 { 505 /* Prepare popup: */ 506 QPointer<QIDialogContainer> pPopup = new QIDialogContainer(0, Qt::Tool); 507 if (pPopup) 508 { 509 /* Prepare editor: */ 510 UIBaseMemoryEditor *pEditor = new UIBaseMemoryEditor(pPopup); 511 if (pEditor) 512 { 513 pEditor->setValue(strData.section(',', 0, 0).toInt()); 514 connect(pEditor, &UIBaseMemoryEditor::sigValidChanged, 515 pPopup, &QIDialogContainer::setOkButtonEnabled); 516 pPopup->setWidget(pEditor); 517 } 518 519 /* Adjust popup geometry: */ 520 pPopup->move(QCursor::pos()); 521 pPopup->adjustSize(); 522 523 // WORKAROUND: 524 // On Windows, Tool dialogs aren't activated by default by some reason. 525 // So we have created sltActivateWindow wrapping actual activateWindow 526 // to fix that annoying issue. 527 QMetaObject::invokeMethod(pPopup, "sltActivateWindow", Qt::QueuedConnection); 528 /* Execute popup, change machine name if confirmed: */ 529 if (pPopup->exec() == QDialog::Accepted) 530 setMachineAttribute(machine(), MachineAttribute_BaseMemory, QVariant::fromValue(pEditor->value())); 531 532 /* Delete popup: */ 533 delete pPopup; 534 } 535 break; 536 } 499 537 case AnchorRole_Storage: 500 538 {
Note:
See TracChangeset
for help on using the changeset viewer.