- Timestamp:
- Nov 9, 2018 7:02:36 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/UIActionPoolRuntime.cpp
r75319 r75339 3230 3230 AssertPtrReturnVoid(pMenu); 3231 3231 3232 /* Call to corresponding handler: */ 3233 updateMenuViewScreen(pMenu); 3234 } 3235 3236 void UIActionPoolRuntime::sltPrepareMenuViewMultiscreen() 3237 { 3238 /* Make sure sender is valid: */ 3239 QMenu *pMenu = qobject_cast<QMenu*>(sender()); 3240 AssertPtrReturnVoid(pMenu); 3241 3242 /* Call to corresponding handler: */ 3243 updateMenuViewMultiscreen(pMenu); 3232 const bool fAllowToShowActionResize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize); 3233 const bool fAllowToShowActionScaleFactor = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ScaleFactor); 3234 const bool fAllowToShowActionMultiscreen = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Multiscreen); 3235 3236 /* Clear contents: */ 3237 pMenu->clear(); 3238 3239 /* Resize, scale factor, and multiscreen menu items are inserted into the same sub-menu: */ 3240 if (fAllowToShowActionResize) 3241 updateMenuViewScreen(pMenu); 3242 if (fAllowToShowActionScaleFactor) 3243 updateMenuViewScaleFactor(pMenu); 3244 if (fAllowToShowActionMultiscreen && m_cHostScreens > 1) 3245 updateMenuViewMultiscreen(pMenu); 3244 3246 } 3245 3247 … … 3687 3689 } 3688 3690 3689 /* Do we have to show resize or multiscreen menu? */3691 /* Do we have to show resize, scale factor, or multiscreen menu? */ 3690 3692 const bool fAllowToShowActionResize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize); 3693 const bool fAllowToShowActionScaleFactor = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ScaleFactor); 3691 3694 const bool fAllowToShowActionMultiscreen = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Multiscreen); 3692 if (fAllowToShowActionResize) 3695 3696 if (fAllowToShowActionResize || fAllowToShowActionScaleFactor || fAllowToShowActionMultiscreen) 3693 3697 { 3694 3698 for (int iGuestScreenIndex = 0; iGuestScreenIndex < m_cGuestScreens; ++iGuestScreenIndex) … … 3702 3706 } 3703 3707 } 3704 else if (fAllowToShowActionMultiscreen)3705 {3706 /* Only for multi-screen host case: */3707 if (m_cHostScreens > 1)3708 {3709 for (int iGuestScreenIndex = 0; iGuestScreenIndex < m_cGuestScreens; ++iGuestScreenIndex)3710 {3711 /* Add 'Virtual Screen %1' menu: */3712 QMenu *pSubMenu = pMenu->addMenu(UIIconPool::iconSet(":/virtual_screen_16px.png",3713 ":/virtual_screen_disabled_16px.png"),3714 QApplication::translate("UIMultiScreenLayout", "Virtual Screen %1").arg(iGuestScreenIndex + 1));3715 pSubMenu->setProperty("Guest Screen Index", iGuestScreenIndex);3716 connect(pSubMenu, SIGNAL(aboutToShow()), this, SLOT(sltPrepareMenuViewMultiscreen()));3717 }3718 }3719 }3720 3708 3721 3709 /* Mark menu as valid: */ … … 3748 3736 /* Do we have to show resize menu? */ 3749 3737 const bool fAllowToShowActionResize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize); 3750 if (fAllowToShowActionResize) 3738 const bool fAllowToShowActionScaleFactor = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ScaleFactor); 3739 if (fAllowToShowActionResize || fAllowToShowActionScaleFactor) 3751 3740 { 3752 3741 for (int iGuestScreenIndex = 0; iGuestScreenIndex < m_cGuestScreens; ++iGuestScreenIndex) … … 3760 3749 } 3761 3750 } 3762 3763 3751 /* Mark menu as valid: */ 3764 3752 m_invalidations.remove(UIActionIndexRT_M_ViewPopup); … … 3913 3901 void UIActionPoolRuntime::updateMenuViewScreen(QMenu *pMenu) 3914 3902 { 3915 /* Clear contents: */ 3916 pMenu->clear(); 3917 3903 AssertPtrReturnVoid(pMenu); 3918 3904 /* Prepare new contents: */ 3919 3905 const QList<QSize> sizes = QList<QSize>() … … 3984 3970 this, SLOT(sltHandleActionTriggerViewScreenResize(QAction*))); 3985 3971 } 3986 updateMenuViewScaleFactor(pMenu);3987 3972 } 3988 3973 3989 3974 void UIActionPoolRuntime::updateMenuViewMultiscreen(QMenu *pMenu) 3990 3975 { 3991 /* Clear contents: */ 3992 pMenu->clear(); 3993 3976 AssertPtrReturnVoid(pMenu); 3994 3977 /* Get corresponding screen index and size: */ 3995 3978 const int iGuestScreenIndex = pMenu->property("Guest Screen Index").toInt(); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.h
r75291 r75339 206 206 /** Prepares 'View' : 'Virtual Screen #' menu (Normal, Scale). */ 207 207 void sltPrepareMenuViewScreen(); 208 /** Prepares 'View' : 'Virtual Screen #' menu (Fullscreen, Seamless). */209 void sltPrepareMenuViewMultiscreen();210 208 211 209 /** Handles 'View' : 'Virtual Screen #' menu : 'Toggle' action trigger. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r70201 r75339 351 351 #endif /* !VBOX_WS_MAC */ 352 352 353 void UIMachineLogicNormal::prepareActionGroups() 354 { 355 /* Call to base-class: */ 356 UIMachineLogic::prepareActionGroups(); 357 358 /* Restrict 'Adjust Window', 'Guest Autoresize', 'Status Bar' and 'Resize' actions for 'View' menu: */ 359 actionPool()->toRuntime()->setRestrictionForMenuView(UIActionRestrictionLevel_Logic, 360 (UIExtraDataMetaDefs::RuntimeMenuViewActionType) 361 (UIExtraDataMetaDefs::RuntimeMenuViewActionType_Multiscreen)); 362 } 363 353 364 void UIMachineLogicNormal::cleanupMachineWindows() 354 365 { … … 388 399 UIMachineLogic::cleanupActionConnections(); 389 400 } 390 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h
r69500 r75339 75 75 76 76 /* Prepare helpers: */ 77 virtual void prepareActionGroups() /* override */; 77 78 void prepareActionConnections(); 78 79 void prepareMachineWindows(); … … 98 99 99 100 #endif /* !___UIMachineLogicNormal_h___ */ 100
Note:
See TracChangeset
for help on using the changeset viewer.