- Timestamp:
- Aug 1, 2019 2:59:49 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r80101 r80103 804 804 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar) 805 805 { 806 const QString strAnchorType = QString("menu_bar"); 806 807 const QString strMenubarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_MenuBar_Enabled); 807 /* Try to convert loaded data to bool: */808 808 const bool fEnabled = !( strMenubarEnabled.compare("false", Qt::CaseInsensitive) == 0 809 809 || strMenubarEnabled.compare("no", Qt::CaseInsensitive) == 0 810 810 || strMenubarEnabled.compare("off", Qt::CaseInsensitive) == 0 811 811 || strMenubarEnabled == "0"); 812 /* Append information: */813 812 table << UITextTableLine(QApplication::translate("UIDetails", "Menu-bar", "details (user interface)"), 814 fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/menu-bar)") 815 : QApplication::translate("UIDetails", "Disabled", "details (user interface/menu-bar)")); 813 QString("<a href=#%1,%2>%3</a>") 814 .arg(strAnchorType) 815 .arg((int)fEnabled) 816 .arg(fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/menu-bar)") 817 : QApplication::translate("UIDetails", "Disabled", "details (user interface/menu-bar)"))); 816 818 } 817 819 #endif /* !VBOX_WS_MAC */ … … 820 822 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar) 821 823 { 824 const QString strAnchorType = QString("status_bar"); 822 825 const QString strStatusbarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_StatusBar_Enabled); 823 /* Try to convert loaded data to bool: */824 826 const bool fEnabled = !( strStatusbarEnabled.compare("false", Qt::CaseInsensitive) == 0 825 827 || strStatusbarEnabled.compare("no", Qt::CaseInsensitive) == 0 826 828 || strStatusbarEnabled.compare("off", Qt::CaseInsensitive) == 0 827 829 || strStatusbarEnabled == "0"); 828 /* Append information: */829 830 table << UITextTableLine(QApplication::translate("UIDetails", "Status-bar", "details (user interface)"), 830 fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/status-bar)") 831 : QApplication::translate("UIDetails", "Disabled", "details (user interface/status-bar)")); 831 QString("<a href=#%1,%2>%3</a>") 832 .arg(strAnchorType) 833 .arg((int)fEnabled) 834 .arg(fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/status-bar)") 835 : QApplication::translate("UIDetails", "Disabled", "details (user interface/status-bar)"))); 832 836 } 833 837 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r80083 r80103 61 61 AnchorRole_AudioHostDriverType, 62 62 AnchorRole_AudioControllerType, 63 AnchorRole_MenuBar, 64 AnchorRole_StatusBar, 63 65 }; 64 66 … … 166 168 m_pTextPane->setAnchorRoleRestricted("#video_memory", cal != ConfigurationAccessLevel_Full); 167 169 m_pTextPane->setAnchorRoleRestricted("#graphics_controller_type", cal != ConfigurationAccessLevel_Full); 170 m_pTextPane->setAnchorRoleRestricted("#mount", cal == ConfigurationAccessLevel_Null); 171 m_pTextPane->setAnchorRoleRestricted("#attach", cal != ConfigurationAccessLevel_Full); 168 172 m_pTextPane->setAnchorRoleRestricted("#audio_host_driver_type", cal != ConfigurationAccessLevel_Full); 169 173 m_pTextPane->setAnchorRoleRestricted("#audio_controller_type", cal != ConfigurationAccessLevel_Full); 170 m_pTextPane->setAnchorRoleRestricted("#m ount", cal == ConfigurationAccessLevel_Null);171 m_pTextPane->setAnchorRoleRestricted("# attach", cal != ConfigurationAccessLevel_Full);174 m_pTextPane->setAnchorRoleRestricted("#menu_bar", cal == ConfigurationAccessLevel_Null); 175 m_pTextPane->setAnchorRoleRestricted("#status_bar", cal == ConfigurationAccessLevel_Null); 172 176 } 173 177 … … 454 458 roles["#video_memory"] = AnchorRole_VideoMemory; 455 459 roles["#graphics_controller_type"] = AnchorRole_GraphicsControllerType; 460 roles["#mount"] = AnchorRole_Storage; 461 roles["#attach"] = AnchorRole_Storage; 456 462 roles["#audio_host_driver_type"] = AnchorRole_AudioHostDriverType; 457 463 roles["#audio_controller_type"] = AnchorRole_AudioControllerType; 458 roles["#m ount"] = AnchorRole_Storage;459 roles["# attach"] = AnchorRole_Storage;464 roles["#menu_bar"] = AnchorRole_MenuBar; 465 roles["#status_bar"] = AnchorRole_StatusBar; 460 466 461 467 /* Current anchor role: */ … … 736 742 break; 737 743 } 744 case AnchorRole_MenuBar: 745 case AnchorRole_StatusBar: 746 { 747 /* Parse whether we have it enabled, true if unable to parse: */ 748 bool fParsed = false; 749 bool fEnabled = strData.section(',', 0, 0).toInt(&fParsed); 750 if (!fParsed) 751 fEnabled = true; 752 753 /* Fill menu with actions, use menu-bar NLS for both cases for simplicity: */ 754 UIMenu menu; 755 QAction *pActionEnable = menu.addAction(QApplication::translate("UIDetails", "Enabled", "details (user interface/menu-bar)")); 756 pActionEnable->setCheckable(true); 757 pActionEnable->setChecked(fEnabled); 758 QAction *pActionDisable = menu.addAction(QApplication::translate("UIDetails", "Disabled", "details (user interface/menu-bar)")); 759 pActionDisable->setCheckable(true); 760 pActionDisable->setChecked(!fEnabled); 761 762 /* Execute menu, look for result: */ 763 QAction *pTriggeredAction = menu.exec(QCursor::pos()); 764 if ( pTriggeredAction 765 && ( fEnabled && pTriggeredAction == pActionDisable 766 || !fEnabled && pTriggeredAction == pActionEnable)) 767 { 768 switch (enmRole) 769 { 770 case AnchorRole_MenuBar: gEDataManager->setMenuBarEnabled(!fEnabled, machine().GetId()); break; 771 case AnchorRole_StatusBar: gEDataManager->setStatusBarEnabled(!fEnabled, machine().GetId()); break; 772 default: break; 773 } 774 } 775 break; 776 } 738 777 default: 739 778 break;
Note:
See TracChangeset
for help on using the changeset viewer.