VirtualBox

Changeset 46586 in vbox for trunk


Ignore:
Timestamp:
Jun 17, 2013 12:52:13 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Check for VRDE server enable/disable API errors; Make sure corresponding action is synchronized with actual server state on API errors.

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

Legend:

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

    r46015 r46586  
    6262#include "CExtPackFile.h"
    6363#include "CHostNetworkInterface.h"
     64#include "CVRDEServer.h"
    6465#ifdef VBOX_WITH_DRAG_AND_DROP
    6566# include "CGuest.h"
     
    19781979             .arg(strDevice, strMachineName),
    19791980          formatErrorInfo(errorInfo));
     1981}
     1982
     1983void UIMessageCenter::cannotToggleVRDEServer(const CVRDEServer &server, const QString &strMachineName, bool fEnable)
     1984{
     1985    error(0, MessageType_Error,
     1986          fEnable ?
     1987              tr("Failed to enable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName) :
     1988              tr("Failed to disable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName),
     1989          formatErrorInfo(server));
    19801990}
    19811991
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r45690 r46586  
    298298    void cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) const;
    299299    void cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const;
     300    void cannotToggleVRDEServer(const CVRDEServer &server, const QString &strMachineName, bool fEnable);
    300301    void remindAboutGuestAdditionsAreNotActive() const;
    301302
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r46582 r46586  
    18921892void UIMachineLogic::sltSwitchVrde(bool fOn)
    18931893{
    1894     /* Enable VRDE server if possible: */
    1895     CVRDEServer server = session().GetMachine().GetVRDEServer();
     1894    /* Prepare variables: */
     1895    CMachine machine = session().GetMachine();
     1896    CVRDEServer server = machine.GetVRDEServer();
    18961897    AssertMsg(!server.isNull(), ("VRDE server should not be null!\n"));
     1898
     1899    /* Toggle VRDE server state: */
    18971900    server.SetEnabled(fOn);
     1901    if (!server.isOk())
     1902    {
     1903        /* Notify about the error: */
     1904        msgCenter().cannotToggleVRDEServer(server, machine.GetName(), fOn);
     1905        /* Make sure action is updated! */
     1906        uisession()->updateStatusVRDE();
     1907    }
    18981908}
    18991909
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r46542 r46586  
    168168    void setFrameBuffer(ulong uScreenId, UIFrameBuffer* pFrameBuffer);
    169169
     170    /* Temporary API: VRDE stuff: */
     171    void updateStatusVRDE() { sltVRDEChange(); }
     172
    170173signals:
    171174
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