VirtualBox

Changeset 36364 in vbox for trunk


Ignore:
Timestamp:
Mar 23, 2011 11:35:44 AM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime GUI: VRDE server status is now updated on notifications from Main.

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

Legend:

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

    r35722 r36364  
    171171        /* Not used *
    172172        case KVBoxEventType_OnCPUChange:
    173         case KVBoxEventType_OnVRDEServerChange:
    174         case KVBoxEventType_OnVRDEServerInfoChange:
    175          */
     173         */
     174        case KVBoxEventType_OnVRDEServerChanged:
     175        case KVBoxEventType_OnVRDEServerInfoChanged:
     176        {
     177            emit sigVRDEChange();
     178            break;
     179        }
    176180        case KVBoxEventType_OnUSBControllerChanged:
    177181        {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r35722 r36364  
    6868    void sigNetworkAdapterChange(CNetworkAdapter adapter);
    6969    void sigMediumChange(CMediumAttachment attachment);
     70    void sigVRDEChange();
    7071    void sigUSBControllerChange();
    7172    void sigUSBDeviceStateChange(CUSBDevice device, bool fAttached, CVirtualBoxErrorInfo error);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp

    r35722 r36364  
    7272        << KVBoxEventType_OnNetworkAdapterChanged
    7373        << KVBoxEventType_OnMediumChanged
     74        << KVBoxEventType_OnVRDEServerChanged
     75        << KVBoxEventType_OnVRDEServerInfoChanged
    7476        << KVBoxEventType_OnUSBControllerChanged
    7577        << KVBoxEventType_OnUSBDeviceStateChanged
     
    109111    connect(pListener->getWrapped(), SIGNAL(sigMediumChange(CMediumAttachment)),
    110112            this, SIGNAL(sigMediumChange(CMediumAttachment)),
     113            Qt::QueuedConnection);
     114
     115    connect(pListener->getWrapped(), SIGNAL(sigVRDEChange()),
     116            this, SIGNAL(sigVRDEChange()),
    111117            Qt::QueuedConnection);
    112118
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h

    r31816 r36364  
    4242    void sigNetworkAdapterChange(CNetworkAdapter adapter);
    4343    void sigMediumChange(CMediumAttachment attachment);
     44    void sigVRDEChange();
    4445    void sigUSBControllerChange();
    4546    void sigUSBDeviceStateChange(CUSBDevice device, bool fAttached, CVirtualBoxErrorInfo error);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp

    r36357 r36364  
    237237    pMenu->addAction(pActionsPool->action(UIActionIndex_Simple_NetworkAdaptersDialog));
    238238    pMenu->addAction(pActionsPool->action(UIActionIndex_Simple_SharedFoldersDialog));
    239     pMenu->addSeparator();
    240239    pMenu->addAction(pActionsPool->action(UIActionIndex_Toggle_VRDEServer));
    241240    pMenu->addSeparator();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r35926 r36364  
    110110            this, SLOT(sltAdditionsChange()));
    111111
     112    connect(gConsoleEvents, SIGNAL(sigVRDEChange()),
     113            this, SLOT(sltVRDEChange()));
     114
    112115    connect(gConsoleEvents, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter)),
    113116            this, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter)));
     
    603606}
    604607
     608void UISession::sltVRDEChange()
     609{
     610    /* Get machine: */
     611    const CMachine &machine = session().GetMachine();
     612    /* Get VRDE server: */
     613    const CVRDEServer &server = machine.GetVRDEServer();
     614    bool fIsVRDEServerAvailable = !server.isNull();
     615    /* Show/Hide VRDE action depending on VRDE server availability status: */
     616    uimachine()->actionsPool()->action(UIActionIndex_Toggle_VRDEServer)->setVisible(fIsVRDEServerAvailable);
     617    /* Check/Uncheck VRDE action depending on VRDE server activity status: */
     618    if (fIsVRDEServerAvailable)
     619        uimachine()->actionsPool()->action(UIActionIndex_Toggle_VRDEServer)->setChecked(server.GetEnabled());
     620    /* Notify listeners about VRDE change: */
     621    emit sigVRDEChange();
     622}
     623
    605624void UISession::sltAdditionsChange()
    606625{
     
    967986    }
    968987
    969     /* VRDE stuff: */
    970     {
    971         /* Get VRDE server: */
    972         CVRDEServer server = machine.GetVRDEServer();
    973         bool fIsVRDEServerAvailable = !server.isNull();
    974         /* Show/Hide VRDE action depending on VRDE server availability status: */
    975         uimachine()->actionsPool()->action(UIActionIndex_Toggle_VRDEServer)->setVisible(fIsVRDEServerAvailable);
    976         /* Check/Uncheck VRDE action depending on VRDE server activity status: */
    977         if (fIsVRDEServerAvailable)
    978             uimachine()->actionsPool()->action(UIActionIndex_Toggle_VRDEServer)->setChecked(server.GetEnabled());
    979     }
    980 
    981988    /* Network stuff: */
    982989    {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r35695 r36364  
    168168    void sigNetworkAdapterChange(const CNetworkAdapter &networkAdapter);
    169169    void sigMediumChange(const CMediumAttachment &mediumAttachment);
     170    void sigVRDEChange();
    170171    void sigUSBControllerChange();
    171172    void sigUSBDeviceStateChange(const CUSBDevice &device, bool bIsAttached, const CVirtualBoxErrorInfo &error);
     
    194195    void sltStateChange(KMachineState state);
    195196    void sltAdditionsChange();
     197    void sltVRDEChange();
    196198
    197199private:
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