VirtualBox

Changeset 91158 in vbox


Ignore:
Timestamp:
Sep 8, 2021 2:32:51 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Extend UICloudNetworkingStuff with export/import description form generators.

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

Legend:

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

    r91150 r91158  
    149149        CCloudProfile comProfile = comProvider.GetProfileByName(strProfileName);
    150150        if (!comProvider.isOk())
    151             msgCenter().cannotAcquireCloudProviderParameter(comProvider, pParent);
     151            msgCenter().cannotFindCloudProfile(comProvider, strProfileName, pParent);
    152152        else
    153153            return comProfile;
     
    698698    /* Return empty list by default: */
    699699    return QVector<CCloudMachine>();
     700}
     701
     702bool UICloudNetworkingStuff::exportDescriptionForm(CCloudClient comCloudClient,
     703                                                   CVirtualSystemDescription comDescription,
     704                                                   CVirtualSystemDescriptionForm &comResult,
     705                                                   QWidget *pParent /* = 0 */)
     706{
     707    /* Execute GetExportDescriptionForm async method: */
     708    CProgress comProgress = comCloudClient.GetExportDescriptionForm(comDescription, comResult);
     709    if (!comCloudClient.isOk())
     710        msgCenter().cannotAcquireCloudClientParameter(comCloudClient);
     711    else
     712    {
     713        /* Show "Get Export Description Form" progress: */
     714        msgCenter().showModalProgressDialog(comProgress,
     715                                            QString(),
     716                                            ":/progress_refresh_90px.png", pParent, 0);
     717        if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     718            msgCenter().cannotAcquireCloudClientParameter(comProgress);
     719        else
     720            return true;
     721    }
     722    /* False by default: */
     723    return false;
     724}
     725
     726bool UICloudNetworkingStuff::exportDescriptionForm(CCloudClient comCloudClient,
     727                                                   CVirtualSystemDescription comDescription,
     728                                                   CVirtualSystemDescriptionForm &comResult,
     729                                                   QString &strErrorMessage)
     730{
     731    /* Execute GetExportDescriptionForm async method: */
     732    CProgress comProgress = comCloudClient.GetExportDescriptionForm(comDescription, comResult);
     733    if (!comCloudClient.isOk())
     734        strErrorMessage = UIErrorString::formatErrorInfo(comCloudClient);
     735    else
     736    {
     737        /* Show "Get Export Description Form" progress: */
     738        comProgress.WaitForCompletion(-1);
     739        if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     740            strErrorMessage = UIErrorString::formatErrorInfo(comProgress);
     741        else
     742            return true;
     743    }
     744    /* False by default: */
     745    return false;
     746}
     747
     748bool UICloudNetworkingStuff::importDescriptionForm(CCloudClient comCloudClient,
     749                                                   CVirtualSystemDescription comDescription,
     750                                                   CVirtualSystemDescriptionForm &comResult,
     751                                                   QWidget *pParent /* = 0 */)
     752{
     753    /* Execute GetImportDescriptionForm async method: */
     754    CProgress comProgress = comCloudClient.GetImportDescriptionForm(comDescription, comResult);
     755    if (!comCloudClient.isOk())
     756        msgCenter().cannotAcquireCloudClientParameter(comCloudClient);
     757    else
     758    {
     759        /* Show "Get Import Description Form" progress: */
     760        msgCenter().showModalProgressDialog(comProgress,
     761                                            QString(),
     762                                            ":/progress_refresh_90px.png", pParent, 0);
     763        if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     764            msgCenter().cannotAcquireCloudClientParameter(comProgress);
     765        else
     766            return true;
     767    }
     768    /* False by default: */
     769    return false;
     770}
     771
     772bool UICloudNetworkingStuff::importDescriptionForm(CCloudClient comCloudClient,
     773                                                   CVirtualSystemDescription comDescription,
     774                                                   CVirtualSystemDescriptionForm &comResult,
     775                                                   QString &strErrorMessage)
     776{
     777    /* Execute GetImportDescriptionForm async method: */
     778    CProgress comProgress = comCloudClient.GetImportDescriptionForm(comDescription, comResult);
     779    if (!comCloudClient.isOk())
     780        strErrorMessage = UIErrorString::formatErrorInfo(comCloudClient);
     781    else
     782    {
     783        /* Show "Get Import Description Form" progress: */
     784        comProgress.WaitForCompletion(-1);
     785        if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     786            strErrorMessage = UIErrorString::formatErrorInfo(comProgress);
     787        else
     788            return true;
     789    }
     790    /* False by default: */
     791    return false;
    700792}
    701793
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r91150 r91158  
    183183    SHARED_LIBRARY_STUFF QVector<CCloudMachine> listCloudMachineStubs(CCloudClient comCloudClient,
    184184                                                                      QString &strErrorMessage);
     185
     186    /** Acquires @a comCloudClient export description form as a @a comResult, using @a pParent to show messages according to.
     187      * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
     188    SHARED_LIBRARY_STUFF bool exportDescriptionForm(CCloudClient comCloudClient,
     189                                                    CVirtualSystemDescription comDescription,
     190                                                    CVirtualSystemDescriptionForm &comResult,
     191                                                    QWidget *pParent = 0);
     192    /** Acquires @a comCloudClient export description form as a @a comResult, using @a strErrorMessage to store messages to.
     193      * @note  Be aware, this is a blocking function, it will hang for a time of progress being executed. */
     194    SHARED_LIBRARY_STUFF bool exportDescriptionForm(CCloudClient comCloudClient,
     195                                                    CVirtualSystemDescription comDescription,
     196                                                    CVirtualSystemDescriptionForm &comResult,
     197                                                    QString &strErrorMessage);
     198    /** Acquires @a comCloudClient import description form as a @a comResult, using @a pParent to show messages according to.
     199      * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
     200    SHARED_LIBRARY_STUFF bool importDescriptionForm(CCloudClient comCloudClient,
     201                                                    CVirtualSystemDescription comDescription,
     202                                                    CVirtualSystemDescriptionForm &comResult,
     203                                                    QWidget *pParent = 0);
     204    /** Acquires @a comCloudClient import description form as a @a comResult, using @a strErrorMessage to store messages to.
     205      * @note  Be aware, this is a blocking function, it will hang for a time of progress being executed. */
     206    SHARED_LIBRARY_STUFF bool importDescriptionForm(CCloudClient comCloudClient,
     207                                                    CVirtualSystemDescription comDescription,
     208                                                    CVirtualSystemDescriptionForm &comResult,
     209                                                    QString &strErrorMessage);
    185210
    186211    /** Acquires @a comCloudMachine ID as a @a uResult, 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