VirtualBox

Changeset 25318 in vbox


Ignore:
Timestamp:
Dec 11, 2009 10:28:31 AM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: Add a option for enabling "Auto show Dock & Menubar in fullscreen" (public #5636).

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r25116 r25318  
    736736    connect (&vboxGlobal(), SIGNAL (dockIconUpdateChanged (const VBoxChangeDockIconUpdateEvent &)),
    737737             this, SLOT (changeDockIconUpdate (const VBoxChangeDockIconUpdateEvent &)));
     738    connect (&vboxGlobal(), SIGNAL (presentationModeChanged (const VBoxChangePresentationModeEvent &)),
     739             this, SLOT (changePresentationMode (const VBoxChangePresentationModeEvent &)));
    738740#endif
    739741
     
    28232825}
    28242826
     2827void VBoxConsoleWnd::changePresentationMode (const VBoxChangePresentationModeEvent &aEvent)
     2828{
     2829    Q_UNUSED (aEvent);
     2830#ifdef Q_WS_MAC
     2831    if (mIsFullscreen)
     2832    {
     2833        QString testStr = vboxGlobal().virtualBox().GetExtraData (VBoxDefs::GUI_PresentationModeEnabled).toLower();
     2834        /* Default to false if it is an empty value */
     2835        if (testStr.isEmpty() || testStr == "false")
     2836            SetSystemUIMode (kUIModeAllHidden, 0);
     2837        else
     2838            SetSystemUIMode (kUIModeAllSuppressed, 0);
     2839    }
     2840    else
     2841        SetSystemUIMode (kUIModeNormal, 0);
     2842#endif
     2843}
     2844
    28252845/**
    28262846 *  Called (on non-UI thread!) when a global GUI setting changes.
     
    35013521        setWindowState (windowState() ^ Qt::WindowFullScreen);
    35023522# ifdef QT_MAC_USE_COCOA
    3503         /* Disable the auto show menubar feature of Qt in fullscreen. */
    3504         if (aOn)
    3505             SetSystemUIMode (kUIModeAllHidden, 0);
     3523        changePresentationMode (VBoxChangePresentationModeEvent(aOn));
    35063524# endif /* QT_MAC_USE_COCOA */
    35073525    }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.h

    r25171 r25318  
    5959class QIStateIndicator;
    6060class VBoxChangeDockIconUpdateEvent;
     61class VBoxChangePresentationModeEvent;
    6162class VBoxConsoleView;
    6263class VBoxMiniToolBar;
     
    178179
    179180    void changeDockIconUpdate (const VBoxChangeDockIconUpdateEvent &aEvent);
     181    void changePresentationMode (const VBoxChangePresentationModeEvent &aEvent);
    180182    void processGlobalSettingChange (const char *aPublicName, const char *aName);
    181183
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.cpp

    r21711 r25318  
    6363    trayIconEnabled = false;
    6464    dockPreviewEnabled = true;
     65    presentationModeEnabled = false;
    6566}
    6667
     
    7576    trayIconEnabled = that.trayIconEnabled;
    7677    dockPreviewEnabled = that.dockPreviewEnabled;
     78    presentationModeEnabled = that.presentationModeEnabled;
    7779}
    7880
     
    9092         maxGuestRes == that.maxGuestRes &&
    9193         remapScancodes == that.remapScancodes &&
    92          trayIconEnabled == that.trayIconEnabled
    93          && dockPreviewEnabled == that.dockPreviewEnabled
     94         trayIconEnabled == that.trayIconEnabled &&
     95         dockPreviewEnabled == that.dockPreviewEnabled &&
     96         presentationModeEnabled == that.presentationModeEnabled
    9497        );
    9598}
     
    113116gPropertyMap[] =
    114117{
    115     { "GUI/Input/HostKey",                         "hostKey",            "\\d*[1-9]\\d*", true },
    116     { "GUI/Input/AutoCapture",                     "autoCapture",        "true|false", true },
    117     { "GUI/Customizations",                        "guiFeatures",        "\\S+", true },
    118     { "GUI/LanguageID",                            "languageId",         gVBoxLangIDRegExp, true },
    119     { "GUI/MaxGuestResolution",                    "maxGuestRes",        "\\d*[1-9]\\d*,\\d*[1-9]\\d*|any|auto", true },
    120     { "GUI/RemapScancodes",                        "remapScancodes",     "(\\d+=\\d+,)*\\d+=\\d+", true },
    121     { "GUI/TrayIcon/Enabled",                      "trayIconEnabled",    "true|false", true },
     118    { "GUI/Input/HostKey",                         "hostKey",                 "\\d*[1-9]\\d*", true },
     119    { "GUI/Input/AutoCapture",                     "autoCapture",             "true|false", true },
     120    { "GUI/Customizations",                        "guiFeatures",             "\\S+", true },
     121    { "GUI/LanguageID",                            "languageId",              gVBoxLangIDRegExp, true },
     122    { "GUI/MaxGuestResolution",                    "maxGuestRes",             "\\d*[1-9]\\d*,\\d*[1-9]\\d*|any|auto", true },
     123    { "GUI/RemapScancodes",                        "remapScancodes",          "(\\d+=\\d+,)*\\d+=\\d+", true },
     124    { "GUI/TrayIcon/Enabled",                      "trayIconEnabled",         "true|false", true },
    122125#ifdef Q_WS_MAC
    123     { VBoxDefs::GUI_RealtimeDockIconUpdateEnabled, "dockPreviewEnabled", "true|false", true }
     126    { VBoxDefs::GUI_RealtimeDockIconUpdateEnabled, "dockPreviewEnabled",      "true|false", true },
     127    { VBoxDefs::GUI_PresentationModeEnabled,       "presentationModeEnabled", "true|false", true }
    124128#endif /* Q_WS_MAC */
    125129};
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.h

    r25171 r25318  
    5050    bool trayIconEnabled;
    5151    bool dockPreviewEnabled;
     52    bool presentationModeEnabled;
    5253
    5354    friend class VBoxGlobalSettings;
     
    6768    Q_PROPERTY (bool trayIconEnabled READ trayIconEnabled WRITE setTrayIconEnabled)
    6869    Q_PROPERTY (bool dockPreviewEnabled READ dockPreviewEnabled WRITE setDockPreviewEnabled)
     70    Q_PROPERTY (bool presentationModeEnabled READ presentationModeEnabled WRITE setPresentationModeEnabled)
    6971
    7072public:
     
    129131    }
    130132
     133    bool presentationModeEnabled() const { return data()->presentationModeEnabled; }
     134    void setPresentationModeEnabled (bool enabled)
     135    {
     136        mData()->presentationModeEnabled = enabled;
     137    }
     138
    131139
    132140    //
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.cpp

    r25177 r25318  
    5555#ifdef Q_WS_MAC
    5656const char* VBoxDefs::GUI_RealtimeDockIconUpdateEnabled = "GUI/RealtimeDockIconUpdateEnabled";
     57const char* VBoxDefs::GUI_PresentationModeEnabled = "GUI/PresentationModeEnabled";
    5758#endif /* Q_WS_MAC */
    5859const char* VBoxDefs::GUI_PassCAD = "GUI/PassCAD";
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h

    r25177 r25318  
    66
    77/*
    8  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9191    enum
    9292    {
    93         AsyncEventType = QEvent::User + 100,
    94         ResizeEventType,
    95         RepaintEventType,
    96         SetRegionEventType,
    97         MouseCapabilityEventType,
    98         MousePointerChangeEventType,
    99         MachineStateChangeEventType,
    100         AdditionsStateChangeEventType,
    101         MediaDriveChangeEventType,
    102         MachineDataChangeEventType,
    103         MachineRegisteredEventType,
    104         SessionStateChangeEventType,
    105         SnapshotEventType,
    106         CanShowRegDlgEventType,
    107         CanShowUpdDlgEventType,
    108         NetworkAdapterChangeEventType,
    109         USBCtlStateChangeEventType,
    110         USBDeviceStateChangeEventType,
    111         SharedFolderChangeEventType,
    112         RuntimeErrorEventType,
    113         ModifierKeyChangeEventType,
    114         MediaEnumEventType,
     93          AsyncEventType = QEvent::User + 100
     94        , ResizeEventType
     95        , RepaintEventType
     96        , SetRegionEventType
     97        , MouseCapabilityEventType
     98        , MousePointerChangeEventType
     99        , MachineStateChangeEventType
     100        , AdditionsStateChangeEventType
     101        , MediaDriveChangeEventType
     102        , MachineDataChangeEventType
     103        , MachineRegisteredEventType
     104        , SessionStateChangeEventType
     105        , SnapshotEventType
     106        , CanShowRegDlgEventType
     107        , CanShowUpdDlgEventType
     108        , NetworkAdapterChangeEventType
     109        , USBCtlStateChangeEventType
     110        , USBDeviceStateChangeEventType
     111        , SharedFolderChangeEventType
     112        , RuntimeErrorEventType
     113        , ModifierKeyChangeEventType
     114        , MediaEnumEventType
    115115#if defined (Q_WS_WIN)
    116         ShellExecuteEventType,
     116        , ShellExecuteEventType
    117117#endif
    118         ActivateMenuEventType,
     118        , ActivateMenuEventType
    119119#if defined (Q_WS_MAC)
    120         ShowWindowEventType,
     120        , ShowWindowEventType
    121121#endif
    122         ChangeGUILanguageEventType,
     122        , ChangeGUILanguageEventType
    123123#if defined (VBOX_GUI_WITH_SYSTRAY)
    124         CanShowTrayIconEventType,
    125         ShowTrayIconEventType,
    126         TrayIconChangeEventType,
    127         MainWindowCountChangeEventType,
     124        , CanShowTrayIconEventType
     125        , ShowTrayIconEventType
     126        , TrayIconChangeEventType
     127        , MainWindowCountChangeEventType
    128128#endif
    129         AddVDMUrlsEventType,
    130         ChangeDockIconUpdateEventType
     129        , AddVDMUrlsEventType
     130        , ChangeDockIconUpdateEventType
     131        , ChangePresentationmodeEventType
    131132#ifdef VBOX_GUI_USE_QGL
    132         ,
    133         VHWACommandProcessType
     133        , VHWACommandProcessType
    134134#endif
    135135    };
     
    173173#ifdef Q_WS_MAC
    174174    static const char* GUI_RealtimeDockIconUpdateEnabled;
     175    static const char* GUI_PresentationModeEnabled;
    175176#endif /* Q_WS_MAC */
    176177    static const char* GUI_PassCAD;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r25177 r25318  
    379379                    QApplication::postEvent (&mGlobal, new VBoxChangeDockIconUpdateEvent (f));
    380380                }
     381                else if (sKey == VBoxDefs::GUI_PresentationModeEnabled)
     382                {
     383                    /* Default to true if it is an empty value */
     384                    QString testStr = sVal.toLower();
     385                    bool f = (testStr.isEmpty() || testStr == "false");
     386                    QApplication::postEvent (&mGlobal, new VBoxChangePresentationModeEvent (f));
     387                }
    381388#endif
    382389
     
    45124519        {
    45134520            emit dockIconUpdateChanged (*(VBoxChangeDockIconUpdateEvent *) e);
     4521            return true;
     4522        }
     4523        case VBoxDefs::ChangePresentationmodeEventType:
     4524        {
     4525            emit presentationModeChanged (*(VBoxChangePresentationModeEvent *) e);
    45144526            return true;
    45154527        }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r25177 r25318  
    199199    VBoxChangeDockIconUpdateEvent (bool aChanged)
    200200        : QEvent ((QEvent::Type) VBoxDefs::ChangeDockIconUpdateEventType)
     201        , mChanged (aChanged)
     202        {}
     203
     204    const bool mChanged;
     205};
     206
     207class VBoxChangePresentationModeEvent : public QEvent
     208{
     209public:
     210    VBoxChangePresentationModeEvent (bool aChanged)
     211        : QEvent ((QEvent::Type) VBoxDefs::ChangePresentationmodeEventType)
    201212        , mChanged (aChanged)
    202213        {}
     
    855866#endif
    856867    void dockIconUpdateChanged (const VBoxChangeDockIconUpdateEvent &e);
     868    void presentationModeChanged (const VBoxChangePresentationModeEvent &e);
    857869
    858870    void canShowRegDlg (bool aCanShow);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.cpp

    r25177 r25318  
    3636#ifndef Q_WS_MAC
    3737    mCbCheckDockPreview->hide();
     38    mCbCheckPresentationMode->hide();
    3839#endif /* Q_WS_MAC */
    39     if (mCbCheckTrayIcon->isHidden() && mCbCheckDockPreview->isHidden())
     40    if (   mCbCheckTrayIcon->isHidden()
     41        && mCbCheckDockPreview->isHidden()
     42        && mCbCheckPresentationMode->isHidden())
    4043        mLnSeparator2->hide();
    4144
     
    5861#ifdef Q_WS_MAC
    5962    mCbCheckDockPreview->setChecked (aGs.dockPreviewEnabled());
     63    mCbCheckPresentationMode->setChecked (aGs.presentationModeEnabled());
    6064#endif /* Q_WS_MAC */
    6165}
     
    7377#ifdef Q_WS_MAC
    7478    aGs.setDockPreviewEnabled (mCbCheckDockPreview->isChecked());
     79    aGs.setPresentationModeEnabled (mCbCheckPresentationMode->isChecked());
    7580#endif /* Q_WS_MAC */
    7681}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.ui

    r25196 r25318  
    1 <ui version="4.0" >
     1<?xml version="1.0" encoding="UTF-8"?>
     2<ui version="4.0">
    23 <comment>
    3  VBox frontends: Qt4 GUI ("VirtualBox"):
     4 VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
    45
    56     Copyright (C) 2008 Sun Microsystems, Inc.
     
    910     you can redistribute it and/or modify it under the terms of the GNU
    1011     General Public License (GPL) as published by the Free Software
    11      Foundation, in version 2 as it comes in the "COPYING" file of the
     12     Foundation, in version 2 as it comes in the &quot;COPYING&quot; file of the
    1213     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    1314     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     
    1819 </comment>
    1920 <class>VBoxGLSettingsGeneral</class>
    20  <widget class="QWidget" name="VBoxGLSettingsGeneral" >
    21   <property name="geometry" >
     21 <widget class="QWidget" name="VBoxGLSettingsGeneral">
     22  <property name="geometry">
    2223   <rect>
    2324    <x>0</x>
    2425    <y>0</y>
    25     <width>390</width>
    26     <height>172</height>
     26    <width>402</width>
     27    <height>212</height>
    2728   </rect>
    2829  </property>
    29   <layout class="QGridLayout" >
    30    <property name="leftMargin" >
    31     <number>0</number>
    32    </property>
    33    <property name="topMargin" >
    34     <number>0</number>
    35    </property>
    36    <property name="rightMargin" >
    37     <number>0</number>
    38    </property>
    39    <property name="bottomMargin" >
     30  <layout class="QGridLayout">
     31   <property name="margin">
    4032    <number>0</number>
    4133   </property>
    4234   <item row="0" column="0" colspan="2">
    43     <widget class="QLabel" name="mLbHardDisk" >
    44      <property name="text" >
     35    <widget class="QLabel" name="mLbHardDisk">
     36     <property name="text">
    4537      <string>Default &amp;Hard Disk Folder:</string>
    4638     </property>
    47      <property name="alignment" >
     39     <property name="alignment">
    4840      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    4941     </property>
    50      <property name="buddy" >
     42     <property name="buddy">
    5143      <cstring>mPsHardDisk</cstring>
    5244     </property>
    5345    </widget>
    5446   </item>
    55    <item row="0" column="2" >
    56     <widget class="VBoxFilePathSelectorWidget" name="mPsHardDisk" >
    57      <property name="sizePolicy" >
    58       <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
     47   <item row="0" column="2">
     48    <widget class="VBoxFilePathSelectorWidget" name="mPsHardDisk">
     49     <property name="sizePolicy">
     50      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
    5951       <horstretch>0</horstretch>
    6052       <verstretch>0</verstretch>
     
    6456   </item>
    6557   <item row="1" column="0" colspan="2">
    66     <widget class="QLabel" name="mLbMach" >
    67      <property name="text" >
     58    <widget class="QLabel" name="mLbMach">
     59     <property name="text">
    6860      <string>Default &amp;Machine Folder:</string>
    6961     </property>
    70      <property name="alignment" >
     62     <property name="alignment">
    7163      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    7264     </property>
    73      <property name="buddy" >
     65     <property name="buddy">
    7466      <cstring>mPsMach</cstring>
    7567     </property>
    7668    </widget>
    7769   </item>
    78    <item row="1" column="2" >
    79     <widget class="VBoxFilePathSelectorWidget" name="mPsMach" >
    80      <property name="sizePolicy" >
    81       <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
     70   <item row="1" column="2">
     71    <widget class="VBoxFilePathSelectorWidget" name="mPsMach">
     72     <property name="sizePolicy">
     73      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
    8274       <horstretch>0</horstretch>
    8375       <verstretch>0</verstretch>
     
    8678    </widget>
    8779   </item>
    88    <item row="2" column="0" colspan="3" >
    89     <widget class="Line" name="mLnSeparator" >
    90      <property name="orientation" >
     80   <item row="2" column="0" colspan="3">
     81    <widget class="Line" name="mLnSeparator">
     82     <property name="orientation">
    9183      <enum>Qt::Horizontal</enum>
    9284     </property>
     
    9486   </item>
    9587   <item row="3" column="0" colspan="2">
    96     <widget class="QLabel" name="mLbVRDP" >
    97      <property name="text" >
     88    <widget class="QLabel" name="mLbVRDP">
     89     <property name="text">
    9890      <string>V&amp;RDP Authentication Library:</string>
    9991     </property>
    100      <property name="alignment" >
     92     <property name="alignment">
    10193      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    10294     </property>
    103      <property name="buddy" >
     95     <property name="buddy">
    10496      <cstring>mPsVRDP</cstring>
    10597     </property>
    10698    </widget>
    10799   </item>
    108    <item row="3" column="2" >
    109     <widget class="VBoxFilePathSelectorWidget" name="mPsVRDP" >
    110      <property name="sizePolicy" >
    111       <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
     100   <item row="3" column="2">
     101    <widget class="VBoxFilePathSelectorWidget" name="mPsVRDP">
     102     <property name="sizePolicy">
     103      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
    112104       <horstretch>0</horstretch>
    113105       <verstretch>0</verstretch>
     
    116108    </widget>
    117109   </item>
    118    <item row="4" column="0" colspan="3" >
    119     <widget class="Line" name="mLnSeparator2" >
    120      <property name="orientation" >
     110   <item row="4" column="0" colspan="3">
     111    <widget class="Line" name="mLnSeparator2">
     112     <property name="orientation">
    121113      <enum>Qt::Horizontal</enum>
    122114     </property>
    123115    </widget>
    124116   </item>
    125    <item row="5" column="1" colspan="2" >
    126     <widget class="QCheckBox" name="mCbCheckTrayIcon" >
    127      <property name="whatsThis" >
     117   <item row="5" column="1" colspan="2">
     118    <widget class="QCheckBox" name="mCbCheckTrayIcon">
     119     <property name="whatsThis">
    128120      <string>When checked, the application will provide an icon with the context menu in the system tray.</string>
    129121     </property>
    130      <property name="text" >
     122     <property name="text">
    131123      <string>&amp;Show System Tray Icon</string>
    132124     </property>
    133      <property name="checked" >
     125     <property name="checked">
    134126      <bool>true</bool>
    135127     </property>
    136128    </widget>
    137129   </item>
    138    <item row="6" column="1" colspan="2" >
    139     <widget class="QCheckBox" name="mCbCheckDockPreview" >
    140      <property name="whatsThis" >
     130   <item row="6" column="1" colspan="2">
     131    <widget class="QCheckBox" name="mCbCheckDockPreview">
     132     <property name="whatsThis">
    141133      <string>When checked, the Dock Icon will reflect the VM window content in realtime.</string>
    142134     </property>
    143      <property name="text" >
     135     <property name="text">
    144136      <string>&amp;Dock Icon Realtime Preview</string>
    145137     </property>
    146      <property name="checked" >
     138     <property name="checked">
    147139      <bool>true</bool>
    148140     </property>
    149141    </widget>
    150142   </item>
    151    <item row="7" column="0" colspan="3" >
     143   <item row="11" column="0" colspan="3">
    152144    <spacer>
    153      <property name="orientation" >
     145     <property name="orientation">
    154146      <enum>Qt::Vertical</enum>
    155147     </property>
    156      <property name="sizeHint" >
     148     <property name="sizeHint" stdset="0">
    157149      <size>
    158150       <width>0</width>
     
    161153     </property>
    162154    </spacer>
     155   </item>
     156   <item row="7" column="1" colspan="2">
     157    <widget class="QCheckBox" name="mCbCheckPresentationMode">
     158     <property name="text">
     159      <string>&amp;Auto show Dock &amp;&amp; Menubar in fullscreen</string>
     160     </property>
     161    </widget>
    163162   </item>
    164163  </layout>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette