VirtualBox

Changeset 66589 in vbox for trunk/src


Ignore:
Timestamp:
Apr 17, 2017 2:00:39 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: Get rid of VBoxGlobalSettings: Moving remapped scan codes handling into extra-data manager (it's X11 stuff generally).

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

Legend:

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

    r66588 r66589  
    5151{
    5252    /* default settings */
    53     remapScancodes = QString::null;
    5453    proxySettings = QString::null;
    5554    hostScreenSaverDisabled = false;
     
    5857VBoxGlobalSettingsData::VBoxGlobalSettingsData (const VBoxGlobalSettingsData &that)
    5958{
    60     remapScancodes = that.remapScancodes;
    6159    proxySettings = that.proxySettings;
    6260    hostScreenSaverDisabled = that.hostScreenSaverDisabled;
     
    7068{
    7169    return this == &that ||
    72         (remapScancodes == that.remapScancodes &&
    73          proxySettings == that.proxySettings &&
     70        (proxySettings == that.proxySettings &&
    7471         hostScreenSaverDisabled == that.hostScreenSaverDisabled
    7572        );
     
    9188gPropertyMap[] =
    9289{
    93     { "GUI/RemapScancodes",                        "remapScancodes",          "(\\d+=\\d+,)*\\d+=\\d+", true },
    9490    { "GUI/ProxySettings",                         "proxySettings",           "[\\s\\S]*", true },
    9591    { "GUI/HostScreenSaverDisabled",               "hostScreenSaverDisabled", "true|false", true }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.h

    r66588 r66589  
    3737private:
    3838
    39     QString remapScancodes;
    4039    QString proxySettings;
    4140    bool hostScreenSaverDisabled;
     
    4948{
    5049    Q_OBJECT
    51     Q_PROPERTY (QString remapScancodes READ remapScancodes WRITE setRemapScancodes)
    5250    Q_PROPERTY (QString proxySettings READ proxySettings WRITE setProxySettings)
    5351    Q_PROPERTY (bool hostScreenSaverDisabled READ hostScreenSaverDisabled WRITE setHostScreenSaverDisabled)
     
    6563
    6664    // Properties
    67 
    68     QString remapScancodes() const { return data()->remapScancodes; }
    69     void setRemapScancodes (const QString &aRemapScancodes)
    70     {
    71         mData()->remapScancodes = aRemapScancodes;
    72     }
    7365
    7466    QString proxySettings() const { return data()->proxySettings; }
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp

    r66588 r66589  
    6060const char* UIExtraDataDefs::GUI_Input_HostKeyCombination = "GUI/Input/HostKeyCombination";
    6161const char* UIExtraDataDefs::GUI_Input_AutoCapture = "GUI/Input/AutoCapture";
     62const char* UIExtraDataDefs::GUI_RemapScancodes = "GUI/RemapScancodes";
    6263
    6364/* Settings: Storage: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r66588 r66589  
    9494        /** Holds whether Runtime UI auto-capture is enabled. */
    9595        extern const char* GUI_Input_AutoCapture;
     96        /** Holds Runtime UI remapped scan codes. */
     97        extern const char* GUI_RemapScancodes;
    9698    /** @} */
    9799
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r66588 r66589  
    24802480}
    24812481
     2482QString UIExtraDataManager::remappedScanCodes()
     2483{
     2484    /* Acquire remapped scan codes: */
     2485    QString strRemappedScanCodes = extraDataString(GUI_RemapScancodes);
     2486    /* Clear the record if it's absolutely wrong: */
     2487    QRegularExpression reTemplate("(\\d+=\\d+,)*\\d+=\\d+");
     2488    if (!reTemplate.match(strRemappedScanCodes).hasMatch())
     2489        strRemappedScanCodes.clear();
     2490    /* Return remapped scan codes: */
     2491    return strRemappedScanCodes;
     2492}
     2493
    24822494QString UIExtraDataManager::recentFolderForHardDrives()
    24832495{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r66588 r66589  
    228228        /** Defines whether the Runtime UI auto-capture is @a fEnabled. */
    229229        void setAutoCaptureEnabled(bool fEnabled);
     230
     231        /** Returns the Runtime UI remapped scan codes. */
     232        QString remappedScanCodes();
    230233    /** @} */
    231234
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r66571 r66589  
    16031603#ifdef VBOX_WS_X11
    16041604    /* Initialize the X keyboard subsystem: */
    1605     initMappedX11Keyboard(QX11Info::display(), vboxGlobal().settings().publicProperty("GUI/RemapScancodes"));
     1605    initMappedX11Keyboard(QX11Info::display(), gEDataManager->remappedScanCodes());
    16061606#endif /* VBOX_WS_X11 */
    16071607
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHostComboEditor.cpp

    r65592 r66589  
    3232/* GUI includes: */
    3333# include "UIHostComboEditor.h"
    34 # include "UIExtraDataDefs.h"
     34# include "UIExtraDataManager.h"
    3535# include "UIIconPool.h"
    3636# include "VBoxGlobal.h"
     
    584584#elif defined(VBOX_WS_X11)
    585585    /* Initialize the X keyboard subsystem: */
    586     initMappedX11Keyboard(QX11Info::display(), vboxGlobal().settings().publicProperty("GUI/RemapScancodes"));
     586    initMappedX11Keyboard(QX11Info::display(), gEDataManager->remappedScanCodes());
    587587#endif /* VBOX_WS_X11 */
    588588}
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