Changeset 55346 in vbox for trunk/src/VBox
- Timestamp:
- Apr 20, 2015 5:27:35 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.cpp
r52722 r55346 67 67 remapScancodes = QString::null; 68 68 proxySettings = QString::null; 69 presentationModeEnabled = false;70 69 hostScreenSaverDisabled = false; 71 70 } … … 80 79 remapScancodes = that.remapScancodes; 81 80 proxySettings = that.proxySettings; 82 presentationModeEnabled = that.presentationModeEnabled;83 81 hostScreenSaverDisabled = that.hostScreenSaverDisabled; 84 82 } … … 98 96 remapScancodes == that.remapScancodes && 99 97 proxySettings == that.proxySettings && 100 presentationModeEnabled == that.presentationModeEnabled &&101 98 hostScreenSaverDisabled == that.hostScreenSaverDisabled 102 99 ); … … 128 125 { "GUI/RemapScancodes", "remapScancodes", "(\\d+=\\d+,)*\\d+=\\d+", true }, 129 126 { "GUI/ProxySettings", "proxySettings", "[\\s\\S]*", true }, 130 #ifdef Q_WS_MAC131 { GUI_PresentationModeEnabled, "presentationModeEnabled", "true|false", true },132 #endif /* Q_WS_MAC */133 127 { "GUI/HostScreenSaverDisabled", "hostScreenSaverDisabled", "true|false", true } 134 128 }; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.h
r52722 r55346 43 43 QString remapScancodes; 44 44 QString proxySettings; 45 bool presentationModeEnabled;46 45 bool hostScreenSaverDisabled; 47 46 … … 61 60 Q_PROPERTY (QString remapScancodes READ remapScancodes WRITE setRemapScancodes) 62 61 Q_PROPERTY (QString proxySettings READ proxySettings WRITE setProxySettings) 63 Q_PROPERTY (bool presentationModeEnabled READ presentationModeEnabled WRITE setPresentationModeEnabled)64 62 Q_PROPERTY (bool hostScreenSaverDisabled READ hostScreenSaverDisabled WRITE setHostScreenSaverDisabled) 65 63 … … 118 116 } 119 117 120 bool presentationModeEnabled() const { return data()->presentationModeEnabled; }121 void setPresentationModeEnabled (bool enabled)122 {123 mData()->presentationModeEnabled = enabled;124 }125 126 118 bool hostScreenSaverDisabled() const { return data()->hostScreenSaverDisabled; } 127 119 void setHostScreenSaverDisabled (bool disabled) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r55187 r55346 134 134 const char* UIExtraDataDefs::GUI_StatusBar_IndicatorOrder = "GUI/StatusBar/IndicatorOrder"; 135 135 #ifdef Q_WS_MAC 136 const char* UIExtraDataDefs::GUI_PresentationModeEnabled = "GUI/PresentationModeEnabled";137 136 const char* UIExtraDataDefs::GUI_RealtimeDockIconUpdateEnabled = "GUI/RealtimeDockIconUpdateEnabled"; 138 137 const char* UIExtraDataDefs::GUI_RealtimeDockIconUpdateMonitor = "GUI/RealtimeDockIconUpdateMonitor"; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r55187 r55346 230 230 extern const char* GUI_StatusBar_IndicatorOrder; 231 231 #ifdef Q_WS_MAC 232 /** Mac OS X: Holds whether 'presentation mode' enabled. */233 extern const char* GUI_PresentationModeEnabled;234 232 /** Mac OS X: Holds whether Dock icon should be updated at runtime. */ 235 233 extern const char* GUI_RealtimeDockIconUpdateEnabled; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r55274 r55346 1791 1791 << GUI_StatusBar_Enabled << GUI_RestrictedStatusBarIndicators << GUI_StatusBar_IndicatorOrder 1792 1792 #ifdef Q_WS_MAC 1793 << GUI_PresentationModeEnabled1794 1793 << GUI_RealtimeDockIconUpdateEnabled << GUI_RealtimeDockIconUpdateMonitor 1795 1794 #endif /* Q_WS_MAC */ … … 3320 3319 3321 3320 #ifdef Q_WS_MAC 3322 bool UIExtraDataManager::presentationModeEnabled(const QString &strID)3323 {3324 /* 'False' unless feature allowed: */3325 return isFeatureAllowed(GUI_PresentationModeEnabled, strID);3326 }3327 3328 3321 bool UIExtraDataManager::realtimeDockIconUpdateEnabled(const QString &strID) 3329 3322 { … … 3647 3640 else if (strKey == GUI_Input_MachineShortcuts) 3648 3641 emit sigRuntimeUIShortcutChange(); 3649 #ifdef Q_WS_MAC3650 /* 'Presentation mode' status changed (allowed if not restricted)? */3651 else if (strKey == GUI_PresentationModeEnabled)3652 emit sigPresentationModeChange(!isFeatureRestricted(strKey));3653 #endif /* Q_WS_MAC */3654 3642 } 3655 3643 } -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r55187 r55346 86 86 87 87 #ifdef RT_OS_DARWIN 88 /** Mac OS X: Notifies about 'presentation mode' status change. */89 void sigPresentationModeChange(bool fEnabled);90 88 /** Mac OS X: Notifies about 'dock icon' appearance change. */ 91 89 void sigDockIconAppearanceChange(bool fEnabled); … … 448 446 449 447 #ifdef Q_WS_MAC 450 /** Mac OS X: Returns whether 'presentation mode' enabled. */451 bool presentationModeEnabled(const QString &strID);452 453 448 /** Mac OS X: Returns whether Dock icon should be updated at runtime. */ 454 449 bool realtimeDockIconUpdateEnabled(const QString &strID); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r53954 r55346 212 212 } 213 213 214 bool UIMultiScreenLayout::isHostTaskbarCovert() const215 {216 /* Check for all screens which are in use if they have some217 * taskbar/menubar/dock on it. Its done by comparing the available with the218 * screen geometry. Only if they are the same for all screens, there are no219 * host area covert. This is a little bit ugly, but there seems no other220 * way to find out if we are on a screen where the taskbar/dock or whatever221 * is present. */222 QDesktopWidget *pDW = QApplication::desktop();223 for (int i = 0; i < m_screenMap.size(); ++i)224 {225 int hostScreen = m_screenMap.value(i);226 if (pDW->availableGeometry(hostScreen) != pDW->screenGeometry(hostScreen))227 return true;228 }229 return false;230 }231 232 214 void UIMultiScreenLayout::sltHandleScreenLayoutChange(int iRequestedGuestScreen, int iRequestedHostScreen) 233 215 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h
r52727 r55346 54 54 bool hasHostScreenForGuestScreen(int iScreenId) const; 55 55 quint64 memoryRequirements() const; 56 bool isHostTaskbarCovert() const;57 56 58 57 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r54463 r55346 389 389 } 390 390 391 #ifdef Q_WS_MAC392 void UIMachineLogicFullscreen::sltChangePresentationMode(bool /* fEnabled */)393 {394 setPresentationModeEnabled(true);395 }396 #endif /* Q_WS_MAC */397 398 391 void UIMachineLogicFullscreen::sltScreenLayoutChanged() 399 392 { … … 407 400 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 408 401 pMachineWindow->showInNecessaryMode(); 409 /* Update 'presentation mode': */410 setPresentationModeEnabled(true);411 402 } 412 403 /* Revalidate native fullscreen for ML and next: */ … … 504 495 } 505 496 506 #ifdef Q_WS_MAC507 void UIMachineLogicFullscreen::prepareOtherConnections()508 {509 /* Make sure 'presentation mode' preference handling510 * is updated at runtime for Lion and previous: */511 if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)512 connect(gEDataManager, SIGNAL(sigPresentationModeChange(bool)),513 this, SLOT(sltChangePresentationMode(bool)));514 }515 #endif /* Q_WS_MAC */516 517 497 void UIMachineLogicFullscreen::prepareMachineWindows() 518 498 { … … 555 535 556 536 #ifdef Q_WS_MAC 557 /* Activate 'presentation mode': */558 setPresentationModeEnabled(true);559 560 537 /* For ML and next: */ 561 538 if (vboxGlobal().osRelease() > MacOSXRelease_Lion) … … 636 613 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 637 614 UIMachineWindow::destroy(pMachineWindow); 638 639 #ifdef Q_WS_MAC640 /* Deactivate 'presentation mode': */641 setPresentationModeEnabled(false);642 #endif/* Q_WS_MAC */643 615 } 644 616 … … 682 654 683 655 #ifdef Q_WS_MAC 684 void UIMachineLogicFullscreen::setPresentationModeEnabled(bool fEnabled)685 {686 /* Should we enable it? */687 if (fEnabled)688 {689 /* For Lion and previous: */690 if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)691 {692 /* Check if we have screen which contains the Dock or the Menubar (which hasn't to be the same),693 * only than the 'presentation mode' have to be changed. */694 if (m_pScreenLayout->isHostTaskbarCovert())695 {696 if (gEDataManager->presentationModeEnabled(vboxGlobal().managedVMUuid()))697 SetSystemUIMode(kUIModeAllHidden, 0);698 else699 SetSystemUIMode(kUIModeAllSuppressed, 0);700 }701 }702 /* For ML and next: */703 else704 {705 /* I am not sure we have to check anything here.706 * Without 'presentation mode' native fullscreen works pretty bad,707 * so we have to enable it anyway: */708 SetSystemUIMode(kUIModeAllSuppressed, 0);709 }710 }711 /* Should we disable it? */712 else SetSystemUIMode(kUIModeNormal, 0);713 }714 715 656 void UIMachineLogicFullscreen::revalidateNativeFullScreen(UIMachineWindow *pMachineWindow) 716 657 { … … 771 712 LogRel(("UIMachineLogicFullscreen::revalidateNativeFullScreen: " 772 713 "Ask machine-window #%d to enter native fullscreen.\n", (int)uScreenID)); 773 774 /* Update 'presentation mode': */775 setPresentationModeEnabled(true);776 714 777 715 /* Make sure window have proper geometry and shown: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h
r52752 r55346 100 100 void sltInvokePopupMenu(); 101 101 102 #ifdef RT_OS_DARWIN103 void sltChangePresentationMode(bool fEnabled);104 #endif /* RT_OS_DARWIN */105 106 102 /** Updates machine-window(s) location/size on screen-layout changes. */ 107 103 void sltScreenLayoutChanged(); … … 119 115 void prepareActionGroups(); 120 116 void prepareActionConnections(); 121 #ifdef Q_WS_MAC122 void prepareOtherConnections();123 #endif /* Q_WS_MAC */124 117 void prepareMachineWindows(); 125 118 void prepareMenu(); … … 128 121 void cleanupMenu(); 129 122 void cleanupMachineWindows(); 130 #ifdef Q_WS_MAC131 //void cleanupOtherConnections() {}132 #endif /* Q_WS_MAC */133 123 void cleanupActionConnections(); 134 124 void cleanupActionGroups(); 135 125 136 126 #ifdef Q_WS_MAC 137 void setPresentationModeEnabled(bool fEnabled);138 139 127 /** Mac OS X: Revalidates 'fullscreen' mode for @a pMachineWindow. */ 140 128 void revalidateNativeFullScreen(UIMachineWindow *pMachineWindow); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp
r53449 r55346 35 35 Ui::UIGlobalSettingsGeneral::setupUi(this); 36 36 37 #ifndef Q_WS_MAC38 m_pLabelPresentationMode->hide();39 m_pCheckBoxPresentationMode->hide();40 #endif /* !Q_WS_MAC */41 37 /* Hide checkbox for now: */ 42 38 m_pLabelHostScreenSaver->hide(); … … 62 58 m_cache.m_strDefaultMachineFolder = m_properties.GetDefaultMachineFolder(); 63 59 m_cache.m_strVRDEAuthLibrary = m_properties.GetVRDEAuthLibrary(); 64 #ifdef Q_WS_MAC65 m_cache.m_fPresentationModeEnabled = m_settings.presentationModeEnabled();66 #endif /* Q_WS_MAC */67 60 m_cache.m_fHostScreenSaverDisabled = m_settings.hostScreenSaverDisabled(); 68 61 … … 78 71 m_pSelectorMachineFolder->setPath(m_cache.m_strDefaultMachineFolder); 79 72 m_pSelectorVRDPLibName->setPath(m_cache.m_strVRDEAuthLibrary); 80 #ifdef Q_WS_MAC81 m_pCheckBoxPresentationMode->setChecked(m_cache.m_fPresentationModeEnabled);82 #endif /* Q_WS_MAC */83 73 m_pCheckBoxHostScreenSaver->setChecked(m_cache.m_fHostScreenSaverDisabled); 84 74 } … … 91 81 m_cache.m_strDefaultMachineFolder = m_pSelectorMachineFolder->path(); 92 82 m_cache.m_strVRDEAuthLibrary = m_pSelectorVRDPLibName->path(); 93 #ifdef Q_WS_MAC94 m_cache.m_fPresentationModeEnabled = m_pCheckBoxPresentationMode->isChecked();95 #endif /* Q_WS_MAC */96 83 m_cache.m_fHostScreenSaverDisabled = m_pCheckBoxHostScreenSaver->isChecked(); 97 84 } … … 109 96 if (m_properties.isOk() && m_pSelectorVRDPLibName->isModified()) 110 97 m_properties.SetVRDEAuthLibrary(m_cache.m_strVRDEAuthLibrary); 111 #ifdef Q_WS_MAC112 m_settings.setPresentationModeEnabled(m_cache.m_fPresentationModeEnabled);113 #endif /* Q_WS_MAC */114 98 m_settings.setHostScreenSaverDisabled(m_cache.m_fHostScreenSaverDisabled); 115 99 … … 123 107 setTabOrder(pWidget, m_pSelectorMachineFolder); 124 108 setTabOrder(m_pSelectorMachineFolder, m_pSelectorVRDPLibName); 125 setTabOrder(m_pSelectorVRDPLibName, m_pCheckBoxPresentationMode); 126 setTabOrder(m_pCheckBoxPresentationMode, m_pCheckBoxHostScreenSaver); 109 setTabOrder(m_pSelectorVRDPLibName, m_pCheckBoxHostScreenSaver); 127 110 } 128 111 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.h
r52727 r55346 27 27 QString m_strDefaultMachineFolder; 28 28 QString m_strVRDEAuthLibrary; 29 #ifdef Q_WS_MAC30 bool m_fPresentationModeEnabled;31 #endif /* Q_WS_MAC */32 29 bool m_fHostScreenSaverDisabled; 33 30 }; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.ui
r48576 r55346 72 72 </item> 73 73 <item row="2" column="0"> 74 <widget class="QLabel" name="m_pLabelPresentationMode">75 <property name="text">76 <string>&Dock and Menubar:</string>77 </property>78 <property name="alignment">79 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>80 </property>81 <property name="buddy">82 <cstring>m_pCheckBoxPresentationMode</cstring>83 </property>84 </widget>85 </item>86 <item row="2" column="1">87 <widget class="QCheckBox" name="m_pCheckBoxPresentationMode">88 <property name="text">89 <string>Auto-Show in Fullscreen</string>90 </property>91 <property name="whatsThis">92 <string>When checked, the host dock and menu bar will be shown when the virtual machine is in fullscreen mode.</string>93 </property>94 </widget>95 </item>96 <item row="3" column="0">97 74 <widget class="QLabel" name="m_pLabelHostScreenSaver"> 98 75 <property name="text"> … … 107 84 </widget> 108 85 </item> 109 <item row=" 3" column="1">86 <item row="2" column="1"> 110 87 <widget class="QCheckBox" name="m_pCheckBoxHostScreenSaver"> 111 88 <property name="whatsThis"> … … 117 94 </widget> 118 95 </item> 119 <item row=" 4" column="0" colspan="3">96 <item row="3" column="0" colspan="3"> 120 97 <spacer> 121 98 <property name="orientation">
Note:
See TracChangeset
for help on using the changeset viewer.