VirtualBox

Ignore:
Timestamp:
Oct 28, 2020 3:53:54 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Extend UICloudNetworkingStuff namespace with stuff to acquire cloud provider by id.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

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

    r86695 r86738  
    6464    /* Null by default: */
    6565    return CCloudProviderManager();
     66}
     67
     68CCloudProvider UICloudNetworkingStuff::cloudProviderById(const QUuid &uProviderId,
     69                                                         QWidget *pParent /* = 0 */)
     70{
     71    /* Acquire cloud provider manager: */
     72    CCloudProviderManager comProviderManager = cloudProviderManager(pParent);
     73    if (comProviderManager.isNotNull())
     74    {
     75        /* Acquire cloud provider: */
     76        CCloudProvider comProvider = comProviderManager.GetProviderById(uProviderId);
     77        if (!comProviderManager.isOk())
     78            msgCenter().cannotAcquireCloudProviderManagerParameter(comProviderManager, pParent);
     79        else
     80            return comProvider;
     81    }
     82    /* Null by default: */
     83    return CCloudProvider();
     84}
     85
     86CCloudProvider UICloudNetworkingStuff::cloudProviderById(const QUuid &uProviderId,
     87                                                         QString &strErrorMessage)
     88{
     89    /* Acquire cloud provider manager: */
     90    CCloudProviderManager comProviderManager = cloudProviderManager(strErrorMessage);
     91    if (comProviderManager.isNotNull())
     92    {
     93        /* Acquire cloud provider: */
     94        CCloudProvider comProvider = comProviderManager.GetProviderById(uProviderId);
     95        if (!comProviderManager.isOk())
     96            strErrorMessage = UIErrorString::formatErrorInfo(comProviderManager);
     97        else
     98            return comProvider;
     99    }
     100    /* Null by default: */
     101    return CCloudProvider();
    66102}
    67103
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r86695 r86738  
    4343      * using @a strErrorMessage to store messages to. */
    4444    SHARED_LIBRARY_STUFF CCloudProviderManager cloudProviderManager(QString &strErrorMessage);
     45    /** Acquires cloud provider specified by @a uProviderId,
     46      * using @a pParent to show messages according to. */
     47    SHARED_LIBRARY_STUFF CCloudProvider cloudProviderById(const QUuid &uProviderId,
     48                                                          QWidget *pParent = 0);
     49    /** Acquires cloud provider specified by @a uProviderId,
     50      * using @a strErrorMessage to store messages to. */
     51    SHARED_LIBRARY_STUFF CCloudProvider cloudProviderById(const QUuid &uProviderId,
     52                                                          QString &strErrorMessage);
    4553    /** Acquires cloud provider specified by @a strProviderShortName,
    4654      * using @a pParent to show messages according to. */
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