VirtualBox

Changeset 46542 in vbox


Ignore:
Timestamp:
Jun 13, 2013 4:49:48 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Video Capture toggle action with configurable shortcut, integrated into Devices menu.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc

    r45736 r46542  
    247247        <file alias="save_state_16px.png">images/save_state_16px.png</file>
    248248        <file alias="save_state_disabled_16px.png">images/save_state_disabled_16px.png</file>
     249        <file alias="video_capture_16px.png">images/video_capture_16px.png</file>
     250        <file alias="video_capture_disabled_16px.png">images/video_capture_disabled_16px.png</file>
    249251    </qresource>
    250252</RCC>
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp

    r44529 r46542  
    77
    88/*
    9  * Copyright (C) 2010-2012 Oracle Corporation
     9 * Copyright (C) 2010-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    209209            break;
    210210        }
     211        case KVBoxEventType_OnVideoCaptureChanged:
     212        {
     213            emit sigVideoCaptureChange();
     214            break;
     215        }
    211216        case KVBoxEventType_OnUSBControllerChanged:
    212217        {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r44529 r46542  
    66
    77/*
    8  * Copyright (C) 2010-2012 Oracle Corporation
     8 * Copyright (C) 2010-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7373    void sigMediumChange(CMediumAttachment attachment);
    7474    void sigVRDEChange();
     75    void sigVideoCaptureChange();
    7576    void sigUSBControllerChange();
    7677    void sigUSBDeviceStateChange(CUSBDevice device, bool fAttached, CVirtualBoxErrorInfo error);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r45736 r46542  
    879879        setName(QApplication::translate("UIActionPool", "Enable R&emote Display"));
    880880        setStatusTip(QApplication::translate("UIActionPool", "Enable remote desktop (RDP) connections to this machine"));
     881    }
     882};
     883
     884class UIActionToggleVideoCapture : public UIActionToggle
     885{
     886    Q_OBJECT;
     887
     888public:
     889
     890    UIActionToggleVideoCapture(UIActionPool *pParent)
     891        : UIActionToggle(pParent,
     892                         ":/video_capture_16px.png", ":/video_capture_disabled_16px.png")
     893    {
     894        retranslateUi();
     895    }
     896
     897protected:
     898
     899    QString shortcutExtraDataID() const
     900    {
     901        return QString("VideoCapture");
     902    }
     903
     904    void retranslateUi()
     905    {
     906        setName(QApplication::translate("UIActionPool", "Enable &Video Capture"));
     907        setStatusTip(QApplication::translate("UIActionPool", "Enable video capture"));
    881908    }
    882909};
     
    11451172    m_pool[UIActionIndexRuntime_Simple_SharedFoldersDialog] = new UIActionSimpleShowSharedFoldersDialog(this);
    11461173    m_pool[UIActionIndexRuntime_Toggle_VRDEServer] = new UIActionToggleVRDEServer(this);
     1174    m_pool[UIActionIndexRuntime_Toggle_VideoCapture] = new UIActionToggleVideoCapture(this);
    11471175    m_pool[UIActionIndexRuntime_Simple_InstallGuestTools] = new UIActionSimplePerformInstallGuestTools(this);
    11481176
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r45736 r46542  
    6565    UIActionIndexRuntime_Simple_SharedFoldersDialog,
    6666    UIActionIndexRuntime_Toggle_VRDEServer,
     67    UIActionIndexRuntime_Toggle_VideoCapture,
    6768    UIActionIndexRuntime_Simple_InstallGuestTools,
    6869
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp

    r44529 r46542  
    77
    88/*
    9  * Copyright (C) 2010-2012 Oracle Corporation
     9 * Copyright (C) 2010-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7373        << KVBoxEventType_OnVRDEServerChanged
    7474        << KVBoxEventType_OnVRDEServerInfoChanged
     75        << KVBoxEventType_OnVideoCaptureChanged
    7576        << KVBoxEventType_OnUSBControllerChanged
    7677        << KVBoxEventType_OnUSBDeviceStateChanged
     
    116117    connect(pListener->getWrapped(), SIGNAL(sigVRDEChange()),
    117118            this, SIGNAL(sigVRDEChange()),
     119            Qt::QueuedConnection);
     120
     121    connect(pListener->getWrapped(), SIGNAL(sigVideoCaptureChange()),
     122            this, SIGNAL(sigVideoCaptureChange()),
    118123            Qt::QueuedConnection);
    119124
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h

    r44529 r46542  
    66
    77/*
    8  * Copyright (C) 2010-2012 Oracle Corporation
     8 * Copyright (C) 2010-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4848    void sigMediumChange(CMediumAttachment attachment);
    4949    void sigVRDEChange();
     50    void sigVideoCaptureChange();
    5051    void sigUSBControllerChange();
    5152    void sigUSBDeviceStateChange(CUSBDevice device, bool fAttached, CVirtualBoxErrorInfo error);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r45939 r46542  
    747747    m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_SharedFoldersDialog));
    748748    m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VRDEServer));
     749    m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture));
    749750    m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_InstallGuestTools));
    750751
     
    808809    connect(gActionPool->action(UIActionIndexRuntime_Toggle_VRDEServer), SIGNAL(toggled(bool)),
    809810            this, SLOT(sltSwitchVrde(bool)));
     811    connect(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture), SIGNAL(toggled(bool)),
     812            this, SLOT(sltToggleVideoCapture(bool)));
    810813    connect(gActionPool->action(UIActionIndexRuntime_Simple_InstallGuestTools), SIGNAL(triggered()),
    811814            this, SLOT(sltInstallGuestAdditions()));
     
    18901893}
    18911894
     1895void UIMachineLogic::sltToggleVideoCapture(bool fEnabled)
     1896{
     1897    /* Do not process if window(s) missed! */
     1898    if (!isMachineWindowsCreated())
     1899        return;
     1900
     1901    /* Make sure something had changed: */
     1902    CMachine machine = session().GetMachine();
     1903    if (machine.GetVideoCaptureEnabled() == fEnabled)
     1904        return;
     1905
     1906    /* Machine is OK? */
     1907    if (machine.isOk())
     1908    {
     1909        /* Update Video Capture state: */
     1910        machine.SetVideoCaptureEnabled(fEnabled);
     1911        /* Machine still OK? */
     1912        if (machine.isOk())
     1913        {
     1914            /* Save machine-settings: */
     1915            machine.SaveSettings();
     1916        }
     1917    }
     1918    /* Machine had failed on one of steps? */
     1919    if (!machine.isOk())
     1920        msgCenter().cannotSaveMachineSettings(machine, activeMachineWindow());
     1921}
     1922
    18921923void UIMachineLogic::sltInstallGuestAdditions()
    18931924{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r45939 r46542  
    206206    void sltChangeDragAndDropType(QAction *pAction);
    207207    void sltSwitchVrde(bool fOn);
     208    void sltToggleVideoCapture(bool fEnabled);
    208209    void sltInstallGuestAdditions();
    209210
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp

    r45842 r46542  
    245245    pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_SharedFoldersDialog));
    246246    pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VRDEServer));
     247    pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture));
    247248    pMenu->addSeparator();
    248249    pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_InstallGuestTools));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r46524 r46542  
    718718{
    719719    /* Get machine: */
    720     const CMachine &machine = session().GetMachine();
     720    const CMachine machine = session().GetMachine();
    721721    /* Get VRDE server: */
    722722    const CVRDEServer &server = machine.GetVRDEServer();
     
    729729    /* Notify listeners about VRDE change: */
    730730    emit sigVRDEChange();
     731}
     732
     733void UISession::sltVideoCaptureChange()
     734{
     735    /* Get machine: */
     736    const CMachine machine = session().GetMachine();
     737    /* Check/Uncheck Video Capture action depending on feature status: */
     738    gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture)->setChecked(machine.GetVideoCaptureEnabled());
     739    /* Notify listeners about Video Capture change: */
     740    emit sigVideoCaptureChange();
    731741}
    732742
     
    806816    connect(gConsoleEvents, SIGNAL(sigVRDEChange()),
    807817            this, SLOT(sltVRDEChange()));
     818
     819    connect(gConsoleEvents, SIGNAL(sigVideoCaptureChange()),
     820            this, SLOT(sltVideoCaptureChange()));
    808821
    809822    connect(gConsoleEvents, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter)),
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r45736 r46542  
    182182    void sigMediumChange(const CMediumAttachment &mediumAttachment);
    183183    void sigVRDEChange();
     184    void sigVideoCaptureChange();
    184185    void sigUSBControllerChange();
    185186    void sigUSBDeviceStateChange(const CUSBDevice &device, bool bIsAttached, const CVirtualBoxErrorInfo &error);
     
    214215    void sltAdditionsChange();
    215216    void sltVRDEChange();
     217    void sltVideoCaptureChange();
    216218    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    217219
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