Changeset 84910 in vbox
- Timestamp:
- Jun 22, 2020 4:10:09 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r84904 r84910 1415 1415 switch (enmDetailsElementOptionTypeUserInterface) 1416 1416 { 1417 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState: strResult = QApplication::translate("UICommon", "Visual State"); break; 1417 1418 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar: strResult = QApplication::translate("UICommon", "Menu Bar"); break; 1418 1419 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar: strResult = QApplication::translate("UICommon", "Status Bar"); break; … … 1433 1434 switch (enmDetailsElementOptionTypeUserInterface) 1434 1435 { 1436 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState: strResult = "VisualState"; break; 1435 1437 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar: strResult = "MenuBar"; break; 1436 1438 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar: strResult = "StatusBar"; break; … … 1451 1453 * to search through the keys using 'case-insensitive' rule: */ 1452 1454 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface> values; 1455 keys << "VisualState"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState; 1453 1456 keys << "MenuBar"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar; 1454 1457 keys << "StatusBar"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r84790 r84910 764 764 { 765 765 DetailsElementOptionTypeUserInterface_Invalid = 0, 766 DetailsElementOptionTypeUserInterface_MenuBar = RT_BIT(0), 767 DetailsElementOptionTypeUserInterface_StatusBar = RT_BIT(1), 768 DetailsElementOptionTypeUserInterface_MiniToolbar = RT_BIT(2), 766 DetailsElementOptionTypeUserInterface_VisualState = RT_BIT(0), 767 DetailsElementOptionTypeUserInterface_MenuBar = RT_BIT(1), 768 DetailsElementOptionTypeUserInterface_StatusBar = RT_BIT(2), 769 DetailsElementOptionTypeUserInterface_MiniToolbar = RT_BIT(3), 769 770 DetailsElementOptionTypeUserInterface_Default = 0xFFFF 770 771 }; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r84790 r84910 959 959 } 960 960 961 /* Visual state: */ 962 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState) 963 { 964 const QString strAnchorType = QString("visual_state"); 965 const QString strEnabledFullscreen = comMachine.GetExtraData(UIExtraDataDefs::GUI_Fullscreen); 966 const QString strEnabledSeamless = comMachine.GetExtraData(UIExtraDataDefs::GUI_Seamless); 967 const QString strEnabledScale = comMachine.GetExtraData(UIExtraDataDefs::GUI_Scale); 968 UIVisualStateType enmType = UIVisualStateType_Normal; 969 if ( strEnabledFullscreen.compare("true", Qt::CaseInsensitive) == 0 970 || strEnabledFullscreen.compare("yes", Qt::CaseInsensitive) == 0 971 || strEnabledFullscreen.compare("on", Qt::CaseInsensitive) == 0 972 || strEnabledFullscreen == "1") 973 enmType = UIVisualStateType_Fullscreen; 974 else 975 if ( strEnabledSeamless.compare("true", Qt::CaseInsensitive) == 0 976 || strEnabledSeamless.compare("yes", Qt::CaseInsensitive) == 0 977 || strEnabledSeamless.compare("on", Qt::CaseInsensitive) == 0 978 || strEnabledSeamless == "1") 979 enmType = UIVisualStateType_Seamless; 980 else 981 if ( strEnabledScale.compare("true", Qt::CaseInsensitive) == 0 982 || strEnabledScale.compare("yes", Qt::CaseInsensitive) == 0 983 || strEnabledScale.compare("on", Qt::CaseInsensitive) == 0 984 || strEnabledScale == "1") 985 enmType = UIVisualStateType_Scale; 986 const QString strVisualState = gpConverter->toString(enmType); 987 table << UITextTableLine(QApplication::translate("UIDetails", "Visual State", "details (user interface)"), 988 QString("<a href=#%1,%2>%3</a>") 989 .arg(strAnchorType) 990 .arg(enmType) 991 .arg(strVisualState)); 992 } 993 961 994 #ifndef VBOX_WS_MAC 962 995 /* Menu-bar: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r84098 r84910 51 51 #include "UIVideoMemoryEditor.h" 52 52 #include "UIVirtualBoxManager.h" 53 #include "UIVisualStateEditor.h" 53 54 54 55 … … 69 70 AnchorRole_NetworkAttachmentType, 70 71 AnchorRole_USBControllerType, 72 AnchorRole_VisualStateType, 71 73 #ifndef VBOX_WS_MAC 72 74 AnchorRole_MenuBar, … … 190 192 m_pTextPane->setAnchorRoleRestricted("#network_attachment_type", enmCal == ConfigurationAccessLevel_Null); 191 193 m_pTextPane->setAnchorRoleRestricted("#usb_controller_type", enmCal != ConfigurationAccessLevel_Full); 194 m_pTextPane->setAnchorRoleRestricted("#visual_state", enmCal == ConfigurationAccessLevel_Null); 192 195 #ifndef VBOX_WS_MAC 193 196 m_pTextPane->setAnchorRoleRestricted("#menu_bar", enmCal == ConfigurationAccessLevel_Null); … … 497 500 roles["#network_attachment_type"] = AnchorRole_NetworkAttachmentType; 498 501 roles["#usb_controller_type"] = AnchorRole_USBControllerType; 502 roles["#visual_state"] = AnchorRole_VisualStateType; 499 503 #ifndef VBOX_WS_MAC 500 504 roles["#menu_bar"] = AnchorRole_MenuBar; … … 877 881 if (controllerSets.key(controllerSet) != iTriggeredIndex) 878 882 setMachineAttribute(machine(), MachineAttribute_USBControllerType, QVariant::fromValue(controllerSets.value(iTriggeredIndex))); 883 } 884 break; 885 } 886 case AnchorRole_VisualStateType: 887 { 888 /* Prepare popup: */ 889 QPointer<QIDialogContainer> pPopup = new QIDialogContainer(0, Qt::Tool); 890 if (pPopup) 891 { 892 /* Prepare editor: */ 893 UIVisualStateEditor *pEditor = new UIVisualStateEditor(pPopup, true /* with label */); 894 if (pEditor) 895 { 896 pEditor->setMachineId(machine().GetId()); 897 pEditor->setValue(static_cast<UIVisualStateType>(strData.section(',', 0, 0).toInt())); 898 pPopup->setWidget(pEditor); 899 } 900 901 /* Adjust popup geometry: */ 902 pPopup->move(QCursor::pos()); 903 pPopup->adjustSize(); 904 905 // WORKAROUND: 906 // On Windows, Tool dialogs aren't activated by default by some reason. 907 // So we have created sltActivateWindow wrapping actual activateWindow 908 // to fix that annoying issue. 909 QMetaObject::invokeMethod(pPopup, "sltActivateWindow", Qt::QueuedConnection); 910 /* Execute popup, change machine name if confirmed: */ 911 if (pPopup->exec() == QDialog::Accepted) 912 gEDataManager->setRequestedVisualState(pEditor->value(), machine().GetId()); 913 914 /* Delete popup: */ 915 delete pPopup; 879 916 } 880 917 break;
Note:
See TracChangeset
for help on using the changeset viewer.