VirtualBox

Changeset 46813 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jun 26, 2013 6:42:59 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Video Capture LED: More precise enable/disable Main API errors handling.

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

Legend:

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

    r46586 r46813  
    19881988              tr("Failed to disable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName),
    19891989          formatErrorInfo(server));
     1990}
     1991
     1992void UIMessageCenter::cannotToggleVideoCapture(const CMachine &machine, bool fEnable)
     1993{
     1994    /* Get machine-name preserving error-info: */
     1995    QString strMachineName(CMachine(machine).GetName());
     1996    error(0, MessageType_Error,
     1997          fEnable ?
     1998              tr("Failed to enable the video capture for the virtual machine <b>%1</b>.").arg(strMachineName) :
     1999              tr("Failed to disable the video capture for the virtual machine <b>%1</b>.").arg(strMachineName),
     2000          formatErrorInfo(machine));
    19902001}
    19912002
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r46586 r46813  
    299299    void cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const;
    300300    void cannotToggleVRDEServer(const CVRDEServer &server, const QString &strMachineName, bool fEnable);
     301    void cannotToggleVideoCapture(const CMachine &machine, bool fEnable);
    301302    void remindAboutGuestAdditionsAreNotActive() const;
    302303
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r46797 r46813  
    19461946        return;
    19471947
     1948    /* Access machine: */
     1949    CMachine machine = session().GetMachine();
     1950    AssertMsg(!machine.isNull(), ("Machine should NOT be null!\n"));
     1951    if (machine.isNull())
     1952        return;
     1953
    19481954    /* Make sure something had changed: */
    1949     CMachine machine = session().GetMachine();
    19501955    if (machine.GetVideoCaptureEnabled() == static_cast<BOOL>(fEnabled))
    19511956        return;
    19521957
     1958    /* Update Video Capture state: */
     1959    AssertMsg(machine.isOk(), ("Machine should be OK!\n"));
     1960    machine.SetVideoCaptureEnabled(fEnabled);
     1961    /* Machine is not OK? */
     1962    if (!machine.isOk())
     1963    {
     1964        /* Notify about the error: */
     1965        msgCenter().cannotToggleVideoCapture(machine, fEnabled);
     1966        /* Make sure action is updated! */
     1967        uisession()->updateStatusVideoCapture();
     1968    }
    19531969    /* Machine is OK? */
    1954     if (machine.isOk())
    1955     {
    1956         /* Update Video Capture state: */
    1957         machine.SetVideoCaptureEnabled(fEnabled);
    1958         /* Machine still OK? */
    1959         if (machine.isOk())
    1960         {
    1961             /* Save machine-settings: */
    1962             machine.SaveSettings();
    1963         }
    1964     }
    1965     /* Machine had failed on one of steps? */
    1966     if (!machine.isOk())
    1967         msgCenter().cannotSaveMachineSettings(machine);
     1970    else
     1971    {
     1972        /* Save machine-settings: */
     1973        machine.SaveSettings();
     1974        /* Machine is not OK? */
     1975        if (!machine.isOk())
     1976        {
     1977            /* Notify about the error: */
     1978            msgCenter().cannotSaveMachineSettings(machine);
     1979            /* Make sure action is updated! */
     1980            uisession()->updateStatusVideoCapture();
     1981        }
     1982    }
    19681983}
    19691984
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r46795 r46813  
    168168    void setFrameBuffer(ulong uScreenId, UIFrameBuffer* pFrameBuffer);
    169169
    170     /* Temporary API: VRDE stuff: */
     170    /* Temporary API: */
    171171    void updateStatusVRDE() { sltVRDEChange(); }
     172    void updateStatusVideoCapture() { sltVideoCaptureChange(); }
    172173
    173174signals:
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