VirtualBox

Ignore:
Timestamp:
May 3, 2007 1:53:29 PM (18 years ago)
Author:
vboxsync
Message:

Main & All Frontends: Prototyped a bunch of Main API changes (IVirtualBoxErrorInfo extension for cascading errors; IMachine/IConsoleCallback extension to properly activate the console window; IVirtualBoxCallback::onExtraDataCanChange() support for error messages; minor IHost::createUSBDeviceFilter/removeUSBDeviceFilter corrections).

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

Legend:

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

    r2378 r2463  
    367367                                         QString::fromUcs2 (message)));
    368368        return S_OK;
     369    }
     370
     371    STDMETHOD(OnCanShowWindow)(BOOL *canShow)
     372    {
     373        if (!canShow)
     374            return E_POINTER;
     375        /* @todo return TRUE... */
     376        *canShow = FALSE;
     377        return S_OK;
     378    }
     379
     380    STDMETHOD(OnShowWindow)()
     381    {
     382        /* @todo implement */
     383        return E_NOTIMPL;
    369384    }
    370385
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r2392 r2463  
    174174    STDMETHOD(OnExtraDataCanChange)(IN_GUIDPARAM id,
    175175                                    IN_BSTRPARAM key, IN_BSTRPARAM value,
    176                                     BOOL *allowChange)
    177     {
    178         if (!allowChange)
     176                                    BSTR *error, BOOL *allowChange)
     177    {
     178        if (!error || !allowChange)
    179179            return E_INVALIDARG;
    180180
    181181        if (COMBase::toQUuid (id).isNull())
    182182        {
    183             // it's a global extra data key someone wants to change
     183            /* it's a global extra data key someone wants to change */
    184184            QString sKey = QString::fromUcs2 (key);
    185185            QString sVal = QString::fromUcs2 (value);
    186186            if (sKey.startsWith ("GUI/"))
    187187            {
    188                 // try to set the global setting to check its syntax
     188                /* try to set the global setting to check its syntax */
    189189                VBoxGlobalSettings gs (false /* non-null */);
    190190                if (gs.setPublicProperty (sKey, sVal))
    191191                {
    192                     /// @todo (dmik)
    193                     //  report the error message to the server using
    194                     //  IVurtualBoxError
    195                     *allowChange = !!gs; // allow only when no error
     192                    /* this is a known GUI property key */
     193                    if (!gs)
     194                    {
     195                        /* disallow the change when there is an error*/
     196                        *error = SysAllocString ((const OLECHAR *)
     197                                                 gs.lastError().ucs2());
     198                        *allowChange = FALSE;
     199                    }
     200                    else
     201                        *allowChange = TRUE;
    196202                    return S_OK;
    197203                }
     
    199205        }
    200206
    201         // not interested in this key -- never disagree
     207        /* not interested in this key -- never disagree */
    202208        *allowChange = TRUE;
    203209        return S_OK;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.cpp

    r2354 r2463  
    197197
    198198/**
    199  *  Sets a value of the property with the given public name.
    200  *  Returns false if such property is not found, and true otherwise.
     199 *  Sets a value of a property with the given public name.
     200 *  Returns false if the specified property is not found, and true otherwise.
    201201 *
    202202 *  This method (as opposed to #setProperty (const char *name, const QVariant& value))
     
    204204 *
    205205 *  If an error occures while setting the value of the property, #operator !()
    206  *  will return false after this method returns, and #lastError() will contain
     206 *  will return false after this method returns true, and #lastError() will contain
    207207 *  the error message.
    208208 *
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGlobalSettingsDlg.ui.h

    r2420 r2463  
    656656     */
    657657    CHost host = vboxGlobal().virtualBox().GetHost();
    658     CHostUSBDeviceFilter removedFilter;
    659658    if (mUSBFilterListModified)
    660         for (ulong count = host.GetUSBDeviceFilters().GetCount(); count; -- count)
    661             host.RemoveUSBDeviceFilter (0, removedFilter);
     659        for (ulong cnt = host.GetUSBDeviceFilters().GetCount(); cnt; -- cnt)
     660            host.RemoveUSBDeviceFilter (0);
    662661
    663662    /* then add all new filters */
     
    877876    }
    878877
    879     /* creating new usb filter */
    880     CHostUSBDeviceFilter hostFilter;
    881     vboxGlobal().virtualBox().GetHost().CreateUSBDeviceFilter (
    882         usbFilterName.arg (maxFilterIndex + 1), hostFilter);
     878    /* create a new usb filter */
     879    CHost host = vboxGlobal().virtualBox().GetHost();
     880    CHostUSBDeviceFilter hostFilter = host
     881        .CreateUSBDeviceFilter (usbFilterName.arg (maxFilterIndex + 1));
    883882    hostFilter.SetAction (CEnums::USBDeviceFilterHold);
    884883
     
    904903
    905904    CHost host = vboxGlobal().virtualBox().GetHost();
    906     CHostUSBDeviceFilter hostFilter;
    907     host.CreateUSBDeviceFilter (vboxGlobal().details (usb), hostFilter);
     905    CHostUSBDeviceFilter hostFilter = host
     906        .CreateUSBDeviceFilter (vboxGlobal().details (usb));
    908907    hostFilter.SetAction (CEnums::USBDeviceFilterHold);
    909908
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