VirtualBox

Changeset 92191 in vbox


Ignore:
Timestamp:
Nov 3, 2021 2:11:43 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148020
Message:

FE/Qt: bugref:10067: Migrate rest of UIMessageCenter in UICloudNetworkingStuff to UINotificationCenter.

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

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialog.cpp

    r92152 r92191  
    6363    /* Apply form: */
    6464    AssertReturnVoid(m_comForm.isNotNull());
    65     if (!applyCloudMachineSettingsForm(m_comCloudMachine, m_comForm, this))
     65    if (!applyCloudMachineSettingsForm(m_comCloudMachine, m_comForm, notificationCenter()))
    6666        return;
    6767
     
    9090{
    9191    /* Update name: */
    92     if (!cloudMachineName(m_comCloudMachine, m_strName, this))
     92    if (!cloudMachineName(m_comCloudMachine, m_strName, notificationCenter()))
    9393        reject();
    9494
     
    9797
    9898    /* Update form: */
    99     if (!cloudMachineSettingsForm(m_comCloudMachine, m_comForm, this))
     99    if (!cloudMachineSettingsForm(m_comCloudMachine, m_comForm, notificationCenter()))
    100100        reject();
    101101
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp

    r92173 r92191  
    281281}
    282282
    283 QVector<CCloudProfile> UICloudNetworkingStuff::listCloudProfiles(CCloudProvider comCloudProvider,
     283QVector<CCloudProfile> UICloudNetworkingStuff::listCloudProfiles(const CCloudProvider &comCloudProvider,
    284284                                                                 UINotificationCenter *pParent /* = 0 */)
    285285{
     
    336336                                             CStringArray &comNames,
    337337                                             CStringArray &comIDs,
    338                                              QWidget *pParent /* = 0 */)
     338                                             UINotificationCenter *pParent /* = 0 */)
    339339{
    340340    /* Currently we are interested in Available images only: */
    341341    const QVector<KCloudImageState> cloudImageStates  = QVector<KCloudImageState>()
    342342                                                     << KCloudImageState_Available;
    343     /* Execute ListImages async method: */
    344     CProgress comProgress = comCloudClient.ListImages(cloudImageStates, comNames, comIDs);
    345     if (!comCloudClient.isOk())
    346         msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent);
    347     else
    348     {
    349         /* Show "Acquire cloud images" progress: */
    350         msgCenter().showModalProgressDialog(comProgress,
    351                                             QString(),
    352                                             ":/progress_reading_appliance_90px.png", pParent, 0);
    353         if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    354             msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent);
    355         else
    356             return true;
    357     }
     343
     344    /* List cloud images: */
     345    UINotificationProgressCloudImageList *pNotification =
     346        new UINotificationProgressCloudImageList(comCloudClient, cloudImageStates);
     347    UINotificationReceiver receiver1;
     348    UINotificationReceiver receiver2;
     349    QObject::connect(pNotification, &UINotificationProgressCloudImageList::sigImageNamesReceived,
     350                     &receiver1, &UINotificationReceiver::setReceiverProperty);
     351    QObject::connect(pNotification, &UINotificationProgressCloudImageList::sigImageIdsReceived,
     352                     &receiver2, &UINotificationReceiver::setReceiverProperty);
     353    if (pParent->handleNow(pNotification))
     354    {
     355        comNames = receiver1.property("received_value").value<CStringArray>();
     356        comIDs = receiver2.property("received_value").value<CStringArray>();
     357        return true;
     358    }
     359
    358360    /* Return false by default: */
    359361    return false;
     
    363365                                                        CStringArray &comNames,
    364366                                                        CStringArray &comIDs,
    365                                                         QWidget *pParent /* = 0 */)
    366 {
    367     /* Execute ListSourceBootVolumes async method: */
    368     CProgress comProgress = comCloudClient.ListSourceBootVolumes(comNames, comIDs);
    369     if (!comCloudClient.isOk())
    370         msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent);
    371     else
    372     {
    373         /* Show "Acquire cloud source boot volumes" progress: */
    374         msgCenter().showModalProgressDialog(comProgress,
    375                                             QString(),
    376                                             ":/progress_reading_appliance_90px.png", pParent, 0);
    377         if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    378             msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent);
    379         else
    380             return true;
    381     }
     367                                                        UINotificationCenter *pParent /* = 0 */)
     368{
     369    /* List cloud source boot volumes: */
     370    UINotificationProgressCloudSourceBootVolumeList *pNotification =
     371        new UINotificationProgressCloudSourceBootVolumeList(comCloudClient);
     372    UINotificationReceiver receiver1;
     373    UINotificationReceiver receiver2;
     374    QObject::connect(pNotification, &UINotificationProgressCloudSourceBootVolumeList::sigImageNamesReceived,
     375                     &receiver1, &UINotificationReceiver::setReceiverProperty);
     376    QObject::connect(pNotification, &UINotificationProgressCloudSourceBootVolumeList::sigImageIdsReceived,
     377                     &receiver2, &UINotificationReceiver::setReceiverProperty);
     378    if (pParent->handleNow(pNotification))
     379    {
     380        comNames = receiver1.property("received_value").value<CStringArray>();
     381        comIDs = receiver2.property("received_value").value<CStringArray>();
     382        return true;
     383    }
     384
     385    /* Return false by default: */
     386    return false;
     387}
     388
     389bool UICloudNetworkingStuff::listCloudInstances(const CCloudClient &comCloudClient,
     390                                                CStringArray &comNames,
     391                                                CStringArray &comIDs,
     392                                                UINotificationCenter *pParent /* = 0 */)
     393{
     394    /* List cloud instances: */
     395    UINotificationProgressCloudInstanceList *pNotification =
     396        new UINotificationProgressCloudInstanceList(comCloudClient);
     397    UINotificationReceiver receiver1;
     398    UINotificationReceiver receiver2;
     399    QObject::connect(pNotification, &UINotificationProgressCloudInstanceList::sigImageNamesReceived,
     400                     &receiver1, &UINotificationReceiver::setReceiverProperty);
     401    QObject::connect(pNotification, &UINotificationProgressCloudInstanceList::sigImageIdsReceived,
     402                     &receiver2, &UINotificationReceiver::setReceiverProperty);
     403    if (pParent->handleNow(pNotification))
     404    {
     405        comNames = receiver1.property("received_value").value<CStringArray>();
     406        comIDs = receiver2.property("received_value").value<CStringArray>();
     407        return true;
     408    }
     409
    382410    /* Return false by default: */
    383411    return false;
     
    387415                                                      CStringArray &comNames,
    388416                                                      CStringArray &comIDs,
    389                                                       QWidget *pParent /* = 0 */)
    390 {
    391     /* Execute ListSourceInstances async method: */
    392     CProgress comProgress = comCloudClient.ListSourceInstances(comNames, comIDs);
    393     if (!comCloudClient.isOk())
    394         msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent);
    395     else
    396     {
    397         /* Show "Acquire cloud source instances" progress: */
    398         msgCenter().showModalProgressDialog(comProgress,
    399                                             QString(),
    400                                             ":/progress_reading_appliance_90px.png", pParent, 0);
    401         if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    402             msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent);
    403         else
    404             return true;
    405     }
     417                                                      UINotificationCenter *pParent /* = 0 */)
     418{
     419    /* List cloud source instances: */
     420    UINotificationProgressCloudSourceInstanceList *pNotification =
     421        new UINotificationProgressCloudSourceInstanceList(comCloudClient);
     422    UINotificationReceiver receiver1;
     423    UINotificationReceiver receiver2;
     424    QObject::connect(pNotification, &UINotificationProgressCloudSourceInstanceList::sigImageNamesReceived,
     425                     &receiver1, &UINotificationReceiver::setReceiverProperty);
     426    QObject::connect(pNotification, &UINotificationProgressCloudSourceInstanceList::sigImageIdsReceived,
     427                     &receiver2, &UINotificationReceiver::setReceiverProperty);
     428    if (pParent->handleNow(pNotification))
     429    {
     430        comNames = receiver1.property("received_value").value<CStringArray>();
     431        comIDs = receiver2.property("received_value").value<CStringArray>();
     432        return true;
     433    }
     434
    406435    /* Return false by default: */
    407436    return false;
    408437}
    409438
    410 bool UICloudNetworkingStuff::exportDescriptionForm(CCloudClient comCloudClient,
    411                                                    CVirtualSystemDescription comDescription,
     439bool UICloudNetworkingStuff::exportDescriptionForm(const CCloudClient &comCloudClient,
     440                                                   const CVirtualSystemDescription &comDescription,
    412441                                                   CVirtualSystemDescriptionForm &comResult,
    413                                                    QWidget *pParent /* = 0 */)
    414 {
    415     /* Execute GetExportDescriptionForm async method: */
    416     CProgress comProgress = comCloudClient.GetExportDescriptionForm(comDescription, comResult);
    417     if (!comCloudClient.isOk())
    418         msgCenter().cannotAcquireCloudClientParameter(comCloudClient);
    419     else
    420     {
    421         /* Show "Get Export Description Form" progress: */
    422         msgCenter().showModalProgressDialog(comProgress,
    423                                             QString(),
    424                                             ":/progress_refresh_90px.png", pParent, 0);
    425         if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    426             msgCenter().cannotAcquireCloudClientParameter(comProgress);
    427         else
    428             return true;
    429     }
     442                                                   UINotificationCenter *pParent /* = 0 */)
     443{
     444    /* Prepare export VSD form: */
     445    UINotificationProgressExportVSDFormCreate *pNotification =
     446        new UINotificationProgressExportVSDFormCreate(comCloudClient, comDescription);
     447    UINotificationReceiver receiver;
     448    QObject::connect(pNotification, &UINotificationProgressExportVSDFormCreate::sigVSDFormCreated,
     449                     &receiver, &UINotificationReceiver::setReceiverProperty);
     450    if (pParent->handleNow(pNotification))
     451    {
     452        comResult = receiver.property("received_value").value<CVirtualSystemDescriptionForm>();
     453        return true;
     454    }
     455
    430456    /* False by default: */
    431457    return false;
    432458}
    433459
    434 bool UICloudNetworkingStuff::importDescriptionForm(CCloudClient comCloudClient,
    435                                                    CVirtualSystemDescription comDescription,
     460bool UICloudNetworkingStuff::importDescriptionForm(const CCloudClient &comCloudClient,
     461                                                   const CVirtualSystemDescription &comDescription,
    436462                                                   CVirtualSystemDescriptionForm &comResult,
    437                                                    QWidget *pParent /* = 0 */)
    438 {
    439     /* Execute GetImportDescriptionForm async method: */
    440     CProgress comProgress = comCloudClient.GetImportDescriptionForm(comDescription, comResult);
    441     if (!comCloudClient.isOk())
    442         msgCenter().cannotAcquireCloudClientParameter(comCloudClient);
    443     else
    444     {
    445         /* Show "Get Import Description Form" progress: */
    446         msgCenter().showModalProgressDialog(comProgress,
    447                                             QString(),
    448                                             ":/progress_refresh_90px.png", pParent, 0);
    449         if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    450             msgCenter().cannotAcquireCloudClientParameter(comProgress);
    451         else
    452             return true;
    453     }
     463                                                   UINotificationCenter *pParent /* = 0 */)
     464{
     465    /* Prepare import VSD form: */
     466    UINotificationProgressImportVSDFormCreate *pNotification =
     467        new UINotificationProgressImportVSDFormCreate(comCloudClient, comDescription);
     468    UINotificationReceiver receiver;
     469    QObject::connect(pNotification, &UINotificationProgressImportVSDFormCreate::sigVSDFormCreated,
     470                     &receiver, &UINotificationReceiver::setReceiverProperty);
     471    if (pParent->handleNow(pNotification))
     472    {
     473        comResult = receiver.property("received_value").value<CVirtualSystemDescriptionForm>();
     474        return true;
     475    }
     476
    454477    /* False by default: */
    455478    return false;
     
    458481bool UICloudNetworkingStuff::cloudMachineId(const CCloudMachine &comCloudMachine,
    459482                                            QUuid &uResult,
    460                                             QWidget *pParent /* = 0 */)
     483                                            UINotificationCenter *pParent /* = 0 */)
    461484{
    462485    const QUuid uId = comCloudMachine.GetId();
    463486    if (!comCloudMachine.isOk())
    464         msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
     487        UINotificationMessage::cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
    465488    else
    466489    {
     
    473496bool UICloudNetworkingStuff::cloudMachineName(const CCloudMachine &comCloudMachine,
    474497                                              QString &strResult,
    475                                               QWidget *pParent /* = 0 */)
     498                                              UINotificationCenter *pParent /* = 0 */)
    476499{
    477500    const QString strName = comCloudMachine.GetName();
    478501    if (!comCloudMachine.isOk())
    479         msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
     502        UINotificationMessage::cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
    480503    else
    481504    {
     
    488511bool UICloudNetworkingStuff::cloudMachineConsoleConnectionFingerprint(const CCloudMachine &comCloudMachine,
    489512                                                                      QString &strResult,
    490                                                                       QWidget *pParent /* = 0 */)
     513                                                                      UINotificationCenter *pParent /* = 0 */)
    491514{
    492515    const QString strConsoleConnectionFingerprint = comCloudMachine.GetConsoleConnectionFingerprint();
    493516    if (!comCloudMachine.isOk())
    494         msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
     517        UINotificationMessage::cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
    495518    else
    496519    {
     
    501524}
    502525
    503 bool UICloudNetworkingStuff::cloudMachineSettingsForm(CCloudMachine comCloudMachine,
     526bool UICloudNetworkingStuff::cloudMachineSettingsForm(const CCloudMachine &comCloudMachine,
    504527                                                      CForm &comResult,
    505                                                       QWidget *pParent /* = 0 */)
     528                                                      UINotificationCenter *pParent /* = 0 */)
    506529{
    507530    /* Acquire machine name first: */
     
    510533        return false;
    511534
    512     /* Prepare settings form: */
    513     CForm comForm;
    514 
    515     /* Now execute GetSettingsForm async method: */
    516     CProgress comProgress = comCloudMachine.GetSettingsForm(comForm);
    517     if (!comCloudMachine.isOk())
    518     {
    519         msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
    520         return false;
    521     }
    522 
    523     /* Show "Get settings form" progress: */
    524     msgCenter().showModalProgressDialog(comProgress,
    525                                         strMachineName,
    526                                         ":/progress_settings_90px.png", pParent, 0);
    527     if (comProgress.GetCanceled())
    528         return false;
    529     if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    530     {
    531         msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent);
    532         return false;
    533     }
    534 
    535     /* Return result: */
    536     comResult = comForm;
    537     return true;
     535    /* Prepare VM settings form: */
     536    UINotificationProgressCloudMachineSettingsFormCreate *pNotification =
     537        new UINotificationProgressCloudMachineSettingsFormCreate(comCloudMachine, strMachineName);
     538    UINotificationReceiver receiver;
     539    QObject::connect(pNotification, &UINotificationProgressCloudMachineSettingsFormCreate::sigSettingsFormCreated,
     540                     &receiver, &UINotificationReceiver::setReceiverProperty);
     541    if (pParent->handleNow(pNotification))
     542    {
     543        comResult = receiver.property("received_value").value<CForm>();
     544        return true;
     545    }
     546
     547    /* False by default: */
     548    return false;
    538549}
    539550
     
    568579}
    569580
    570 bool UICloudNetworkingStuff::applyCloudMachineSettingsForm(CCloudMachine comCloudMachine,
    571                                                            CForm comForm,
    572                                                            QWidget *pParent /* = 0 */)
     581bool UICloudNetworkingStuff::applyCloudMachineSettingsForm(const CCloudMachine &comCloudMachine,
     582                                                           const CForm &comForm,
     583                                                           UINotificationCenter *pParent /* = 0 */)
    573584{
    574585    /* Acquire machine name first: */
     
    577588        return false;
    578589
    579     /* Now execute Apply async method: */
    580     CProgress comProgress = comForm.Apply();
    581     if (!comForm.isOk())
    582     {
    583         msgCenter().cannotApplyCloudMachineFormSettings(comForm, strMachineName, pParent);
    584         return false;
    585     }
    586 
    587     /* Show "Apply" progress: */
    588     msgCenter().showModalProgressDialog(comProgress,
    589                                         strMachineName,
    590                                         ":/progress_settings_90px.png", pParent, 0);
    591     if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    592     {
    593         msgCenter().cannotApplyCloudMachineFormSettings(comProgress, strMachineName, pParent);
    594         return false;
    595     }
    596 
    597     /* Return result: */
    598     return true;
    599 }
    600 
    601 QMap<QString, QString> UICloudNetworkingStuff::listInstances(const CCloudClient &comCloudClient,
    602                                                              QWidget *pParent /* = 0 */)
    603 {
    604     /* Prepare VM names, ids and states.
    605      * Currently we are interested in Running and Stopped VMs only. */
    606     CStringArray comNames;
    607     CStringArray comIDs;
    608     const QVector<KCloudMachineState> cloudMachineStates  = QVector<KCloudMachineState>()
    609                                                          << KCloudMachineState_Running
    610                                                          << KCloudMachineState_Stopped;
    611 
    612     /* Now execute ListInstances async method: */
    613     CProgress comProgress = comCloudClient.ListInstances(cloudMachineStates, comNames, comIDs);
    614     if (!comCloudClient.isOk())
    615     {
    616         if (pParent)
    617             msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent);
    618     }
    619     else
    620     {
    621         /* Show "Acquire cloud instances" progress: */
    622         if (pParent)
    623             msgCenter().showModalProgressDialog(comProgress,
    624                                                 QString(),
    625                                                 ":/progress_reading_appliance_90px.png", pParent, 0);
    626         else
    627             comProgress.WaitForCompletion(-1);
    628         if (!comProgress.GetCanceled())
    629         {
    630             if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    631             {
    632                 if (pParent)
    633                     msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent);
    634             }
    635             else
    636             {
    637                 /* Fetch acquired objects to map: */
    638                 const QVector<QString> instanceIds = comIDs.GetValues();
    639                 const QVector<QString> instanceNames = comNames.GetValues();
    640                 QMap<QString, QString> resultMap;
    641                 for (int i = 0; i < instanceIds.size(); ++i)
    642                     resultMap[instanceIds.at(i)] = instanceNames.at(i);
    643                 return resultMap;
    644             }
    645         }
    646     }
    647 
    648     /* Return empty map by default: */
    649     return QMap<QString, QString>();
    650 }
     590    /* Apply VM settings form: */
     591    UINotificationProgressCloudMachineSettingsFormApply *pNotification =
     592        new UINotificationProgressCloudMachineSettingsFormApply(comForm, strMachineName);
     593    return pParent->handleNow(pNotification);
     594}
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r92173 r92191  
    101101
    102102    /** Acquires cloud profiles of certain @a comCloudProvider, using @a pParent to show messages according to. */
    103     SHARED_LIBRARY_STUFF QVector<CCloudProfile> listCloudProfiles(CCloudProvider comCloudProvider,
     103    SHARED_LIBRARY_STUFF QVector<CCloudProfile> listCloudProfiles(const CCloudProvider &comCloudProvider,
    104104                                                                  UINotificationCenter *pParent = 0);
    105105
     
    118118                                              CStringArray &comNames,
    119119                                              CStringArray &comIDs,
    120                                               QWidget *pParent = 0);
     120                                              UINotificationCenter *pParent = 0);
    121121    /** Acquires cloud source boot volumes of certain @a comCloudClient, using @a pParent to show messages according to. */
    122122    SHARED_LIBRARY_STUFF bool listCloudSourceBootVolumes(const CCloudClient &comCloudClient,
    123123                                                         CStringArray &comNames,
    124124                                                         CStringArray &comIDs,
    125                                                          QWidget *pParent = 0);
     125                                                         UINotificationCenter *pParent = 0);
     126    /** Acquires cloud instances of certain @a comCloudClient, using @a pParent to show messages according to. */
     127    SHARED_LIBRARY_STUFF bool listCloudInstances(const CCloudClient &comCloudClient,
     128                                                 CStringArray &comNames,
     129                                                 CStringArray &comIDs,
     130                                                 UINotificationCenter *pParent = 0);
    126131    /** Acquires cloud source instances of certain @a comCloudClient, using @a pParent to show messages according to. */
    127132    SHARED_LIBRARY_STUFF bool listCloudSourceInstances(const CCloudClient &comCloudClient,
    128133                                                       CStringArray &comNames,
    129134                                                       CStringArray &comIDs,
    130                                                        QWidget *pParent = 0);
     135                                                       UINotificationCenter *pParent = 0);
    131136
    132     /** Acquires @a comCloudClient export description form as a @a comResult, using @a pParent to show messages according to.
    133       * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
    134     SHARED_LIBRARY_STUFF bool exportDescriptionForm(CCloudClient comCloudClient,
    135                                                     CVirtualSystemDescription comDescription,
     137    /** Acquires @a comCloudClient export description form as a @a comResult, using @a pParent to show messages according to. */
     138    SHARED_LIBRARY_STUFF bool exportDescriptionForm(const CCloudClient &comCloudClient,
     139                                                    const CVirtualSystemDescription &comDescription,
    136140                                                    CVirtualSystemDescriptionForm &comResult,
    137                                                     QWidget *pParent = 0);
    138     /** Acquires @a comCloudClient import description form as a @a comResult, using @a pParent to show messages according to.
    139       * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
    140     SHARED_LIBRARY_STUFF bool importDescriptionForm(CCloudClient comCloudClient,
    141                                                     CVirtualSystemDescription comDescription,
     141                                                    UINotificationCenter *pParent = 0);
     142    /** Acquires @a comCloudClient import description form as a @a comResult, using @a pParent to show messages according to. */
     143    SHARED_LIBRARY_STUFF bool importDescriptionForm(const CCloudClient &comCloudClient,
     144                                                    const CVirtualSystemDescription &comDescription,
    142145                                                    CVirtualSystemDescriptionForm &comResult,
    143                                                     QWidget *pParent = 0);
     146                                                    UINotificationCenter *pParent = 0);
    144147
    145148    /** Acquires @a comCloudMachine ID as a @a uResult, using @a pParent to show messages according to. */
    146149    SHARED_LIBRARY_STUFF bool cloudMachineId(const CCloudMachine &comCloudMachine,
    147150                                             QUuid &uResult,
    148                                              QWidget *pParent = 0);
     151                                             UINotificationCenter *pParent = 0);
    149152    /** Acquires @a comCloudMachine name as a @a strResult, using @a pParent to show messages according to. */
    150153    SHARED_LIBRARY_STUFF bool cloudMachineName(const CCloudMachine &comCloudMachine,
    151154                                               QString &strResult,
    152                                                QWidget *pParent = 0);
     155                                               UINotificationCenter *pParent = 0);
    153156    /** Acquires @a comCloudMachine console connection fingerprint as a @a strResult,
    154157      * using @a pParent to show messages according to. */
    155158    SHARED_LIBRARY_STUFF bool cloudMachineConsoleConnectionFingerprint(const CCloudMachine &comCloudMachine,
    156159                                                                       QString &strResult,
    157                                                                        QWidget *pParent = 0);
     160                                                                       UINotificationCenter *pParent = 0);
    158161
    159     /** Acquires @a comCloudMachine settings form as a @a comResult, using @a pParent to show messages according to.
    160       * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
    161     SHARED_LIBRARY_STUFF bool cloudMachineSettingsForm(CCloudMachine comCloudMachine,
     162    /** Acquires @a comCloudMachine settings form as a @a comResult, using @a pParent to show messages according to. */
     163    SHARED_LIBRARY_STUFF bool cloudMachineSettingsForm(const CCloudMachine &comCloudMachine,
    162164                                                       CForm &comResult,
    163                                                        QWidget *pParent = 0);
     165                                                       UINotificationCenter *pParent = 0);
    164166    /** Acquires @a comCloudMachine settings form as a @a comResult, using @a strErrorMessage to store messages to.
    165167      * @note  Be aware, this is a blocking function, it will hang for a time of progress being executed. */
     
    168170                                                       QString &strErrorMessage);
    169171
    170     /** Applies @a comCloudMachine @a comForm settings, using @a pParent to show messages according to.
    171       * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
    172     SHARED_LIBRARY_STUFF bool applyCloudMachineSettingsForm(CCloudMachine comCloudMachine,
    173                                                             CForm comForm,
    174                                                             QWidget *pParent = 0);
    175 
    176     /** Acquires instance map.
    177       * @param  comCloudClient  Brings cloud client object.
    178       * @param  pWidget         Brings parent widget to show messages according to,
    179       *                         if no parent set, progress will be executed in blocking way. */
    180     SHARED_LIBRARY_STUFF QMap<QString, QString> listInstances(const CCloudClient &comCloudClient,
    181                                                               QWidget *pParent = 0);
     172    /** Applies @a comCloudMachine @a comForm settings, using @a pParent to show messages according to. */
     173    SHARED_LIBRARY_STUFF bool applyCloudMachineSettingsForm(const CCloudMachine &comCloudMachine,
     174                                                            const CForm &comForm,
     175                                                            UINotificationCenter *pParent = 0);
    182176}
    183177
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r92173 r92191  
    707707             .arg(CMachine(machine).GetName(), CMachine(machine).GetSettingsFilePath()),
    708708          UIErrorString::formatErrorInfo(machine));
    709 }
    710 
    711 void UIMessageCenter::cannotApplyCloudMachineFormSettings(const CForm &comForm, const QString &strName, QWidget *pParent /* = 0 */) const
    712 {
    713     error(pParent, MessageType_Error,
    714           tr("Failed to save the settings of the cloud virtual machine <b>%1</b>.").arg(strName),
    715           UIErrorString::formatErrorInfo(comForm));
    716 }
    717 
    718 void UIMessageCenter::cannotApplyCloudMachineFormSettings(const CProgress &comProgress, const QString &strName, QWidget *pParent /* = 0 */) const
    719 {
    720     error(pParent, MessageType_Error,
    721           tr("Failed to save the settings of the cloud virtual machine <b>%1</b>.").arg(strName),
    722           UIErrorString::formatErrorInfo(comProgress));
    723709}
    724710
     
    14141400}
    14151401
    1416 void UIMessageCenter::cannotAcquireCloudClientParameter(const CCloudClient &comClient, QWidget *pParent /* = 0 */) const
    1417 {
    1418     error(pParent, MessageType_Error,
    1419           tr("Failed to acquire cloud client parameter."),
    1420           UIErrorString::formatErrorInfo(comClient));
    1421 }
    1422 
    1423 void UIMessageCenter::cannotAcquireCloudClientParameter(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
    1424 {
    1425     error(pParent, MessageType_Error,
    1426           tr("Failed to acquire cloud client parameter."),
    1427           UIErrorString::formatErrorInfo(comProgress));
    1428 }
    1429 
    1430 void UIMessageCenter::cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */) const
    1431 {
    1432     error(pParent, MessageType_Error,
    1433           tr("Failed to acquire cloud machine parameter."),
    1434           UIErrorString::formatErrorInfo(comMachine));
    1435 }
    1436 
    1437 void UIMessageCenter::cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
    1438 {
    1439     error(pParent, MessageType_Error,
    1440           tr("Failed to acquire cloud machine parameter."),
    1441           UIErrorString::formatErrorInfo(comProgress));
    1442 }
    1443 
    14441402#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    14451403bool UIMessageCenter::confirmLookingForGuestAdditions() const
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r92173 r92191  
    285285        void cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent = 0) const;
    286286        void cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent = 0) const;
    287         void cannotApplyCloudMachineFormSettings(const CForm &comForm, const QString &strName, QWidget *pParent = 0) const;
    288         void cannotApplyCloudMachineFormSettings(const CProgress &comProgress, const QString &strName, QWidget *pParent = 0) const;
    289287
    290288        void cannotAddDiskEncryptionPassword(const CConsole &console);
     
    373371        bool confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent = 0) const;
    374372        bool confirmCloudConsoleProfileRemoval(const QString &strName, QWidget *pParent = 0) const;
    375     /** @} */
    376 
    377     /** @name VirtualBox Manager / Cloud networking warnings.
    378       * @{ */
    379         void cannotAcquireCloudClientParameter(const CCloudClient &comClient, QWidget *pParent = 0) const;
    380         void cannotAcquireCloudClientParameter(const CProgress &comProgress, QWidget *pParent = 0) const;
    381         void cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent = 0) const;
    382         void cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent = 0) const;
    383373    /** @} */
    384374
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r92173 r92191  
    745745        QApplication::translate("UIMessageCenter", "Failed to acquire cloud profile parameter.") +
    746746        UIErrorString::formatErrorInfo(comCloudProfile),
     747        QString(), QString(), pParent);
     748}
     749
     750/* static */
     751void UINotificationMessage::cannotAcquireCloudMachineParameter(const CCloudMachine &comCloudMachine,
     752                                                               UINotificationCenter *pParent /* = 0 */)
     753{
     754    createMessage(
     755        QApplication::translate("UIMessageCenter", "Cloud failure ..."),
     756        QApplication::translate("UIMessageCenter", "Failed to acquire cloud machine parameter.") +
     757        UIErrorString::formatErrorInfo(comCloudMachine),
    747758        QString(), QString(), pParent);
    748759}
     
    23952406
    23962407/*********************************************************************************************************************************
     2408*   Class UINotificationProgressExportVSDFormCreate implementation.                                                              *
     2409*********************************************************************************************************************************/
     2410
     2411UINotificationProgressExportVSDFormCreate::UINotificationProgressExportVSDFormCreate(const CCloudClient &comClient,
     2412                                                                                     const CVirtualSystemDescription &comVSD)
     2413    : m_comClient(comClient)
     2414    , m_comVSD(comVSD)
     2415{
     2416    connect(this, &UINotificationProgress::sigProgressFinished,
     2417            this, &UINotificationProgressExportVSDFormCreate::sltHandleProgressFinished);
     2418}
     2419
     2420QString UINotificationProgressExportVSDFormCreate::name() const
     2421{
     2422    return UINotificationProgress::tr("Creating export VSD form ...");
     2423}
     2424
     2425QString UINotificationProgressExportVSDFormCreate::details() const
     2426{
     2427    return QString();
     2428}
     2429
     2430CProgress UINotificationProgressExportVSDFormCreate::createProgress(COMResult &comResult)
     2431{
     2432    /* Initialize progress-wrapper: */
     2433    CProgress comProgress = m_comClient.GetExportDescriptionForm(m_comVSD, m_comVSDForm);
     2434    /* Store COM result: */
     2435    comResult = m_comClient;
     2436    /* Return progress-wrapper: */
     2437    return comProgress;
     2438}
     2439
     2440void UINotificationProgressExportVSDFormCreate::sltHandleProgressFinished()
     2441{
     2442    if (m_comVSDForm.isNotNull())
     2443        emit sigVSDFormCreated(QVariant::fromValue(m_comVSDForm));
     2444}
     2445
     2446
     2447/*********************************************************************************************************************************
     2448*   Class UINotificationProgressImportVSDFormCreate implementation.                                                              *
     2449*********************************************************************************************************************************/
     2450
     2451UINotificationProgressImportVSDFormCreate::UINotificationProgressImportVSDFormCreate(const CCloudClient &comClient,
     2452                                                                                     const CVirtualSystemDescription &comVSD)
     2453    : m_comClient(comClient)
     2454    , m_comVSD(comVSD)
     2455{
     2456    connect(this, &UINotificationProgress::sigProgressFinished,
     2457            this, &UINotificationProgressImportVSDFormCreate::sltHandleProgressFinished);
     2458}
     2459
     2460QString UINotificationProgressImportVSDFormCreate::name() const
     2461{
     2462    return UINotificationProgress::tr("Creating import VSD form ...");
     2463}
     2464
     2465QString UINotificationProgressImportVSDFormCreate::details() const
     2466{
     2467    return QString();
     2468}
     2469
     2470CProgress UINotificationProgressImportVSDFormCreate::createProgress(COMResult &comResult)
     2471{
     2472    /* Initialize progress-wrapper: */
     2473    CProgress comProgress = m_comClient.GetImportDescriptionForm(m_comVSD, m_comVSDForm);
     2474    /* Store COM result: */
     2475    comResult = m_comClient;
     2476    /* Return progress-wrapper: */
     2477    return comProgress;
     2478}
     2479
     2480void UINotificationProgressImportVSDFormCreate::sltHandleProgressFinished()
     2481{
     2482    if (m_comVSDForm.isNotNull())
     2483        emit sigVSDFormCreated(QVariant::fromValue(m_comVSDForm));
     2484}
     2485
     2486
     2487/*********************************************************************************************************************************
     2488*   Class UINotificationProgressCloudImageList implementation.                                                                   *
     2489*********************************************************************************************************************************/
     2490
     2491UINotificationProgressCloudImageList::UINotificationProgressCloudImageList(const CCloudClient &comClient,
     2492                                                                           const QVector<KCloudImageState> &cloudImageStates)
     2493    : m_comClient(comClient)
     2494    , m_cloudImageStates(cloudImageStates)
     2495{
     2496    connect(this, &UINotificationProgress::sigProgressFinished,
     2497            this, &UINotificationProgressCloudImageList::sltHandleProgressFinished);
     2498}
     2499
     2500QString UINotificationProgressCloudImageList::name() const
     2501{
     2502    return UINotificationProgress::tr("Listing cloud images ...");
     2503}
     2504
     2505QString UINotificationProgressCloudImageList::details() const
     2506{
     2507    return QString();
     2508}
     2509
     2510CProgress UINotificationProgressCloudImageList::createProgress(COMResult &comResult)
     2511{
     2512    /* Initialize progress-wrapper: */
     2513    CProgress comProgress = m_comClient.ListImages(m_cloudImageStates, m_comNames, m_comIds);
     2514    /* Store COM result: */
     2515    comResult = m_comClient;
     2516    /* Return progress-wrapper: */
     2517    return comProgress;
     2518}
     2519
     2520void UINotificationProgressCloudImageList::sltHandleProgressFinished()
     2521{
     2522    if (m_comNames.isNotNull() && m_comIds.isNotNull())
     2523    {
     2524        emit sigImageNamesReceived(QVariant::fromValue(m_comNames));
     2525        emit sigImageIdsReceived(QVariant::fromValue(m_comIds));
     2526    }
     2527}
     2528
     2529
     2530/*********************************************************************************************************************************
     2531*   Class UINotificationProgressCloudSourceBootVolumeList implementation.                                                        *
     2532*********************************************************************************************************************************/
     2533
     2534UINotificationProgressCloudSourceBootVolumeList::UINotificationProgressCloudSourceBootVolumeList(const CCloudClient &comClient)
     2535    : m_comClient(comClient)
     2536{
     2537    connect(this, &UINotificationProgress::sigProgressFinished,
     2538            this, &UINotificationProgressCloudSourceBootVolumeList::sltHandleProgressFinished);
     2539}
     2540
     2541QString UINotificationProgressCloudSourceBootVolumeList::name() const
     2542{
     2543    return UINotificationProgress::tr("Listing cloud source boot volumes ...");
     2544}
     2545
     2546QString UINotificationProgressCloudSourceBootVolumeList::details() const
     2547{
     2548    return QString();
     2549}
     2550
     2551CProgress UINotificationProgressCloudSourceBootVolumeList::createProgress(COMResult &comResult)
     2552{
     2553    /* Initialize progress-wrapper: */
     2554    CProgress comProgress = m_comClient.ListSourceBootVolumes(m_comNames, m_comIds);
     2555    /* Store COM result: */
     2556    comResult = m_comClient;
     2557    /* Return progress-wrapper: */
     2558    return comProgress;
     2559}
     2560
     2561void UINotificationProgressCloudSourceBootVolumeList::sltHandleProgressFinished()
     2562{
     2563    if (m_comNames.isNotNull() && m_comIds.isNotNull())
     2564    {
     2565        emit sigImageNamesReceived(QVariant::fromValue(m_comNames));
     2566        emit sigImageIdsReceived(QVariant::fromValue(m_comIds));
     2567    }
     2568}
     2569
     2570
     2571/*********************************************************************************************************************************
     2572*   Class UINotificationProgressCloudInstanceList implementation.                                                                *
     2573*********************************************************************************************************************************/
     2574
     2575UINotificationProgressCloudInstanceList::UINotificationProgressCloudInstanceList(const CCloudClient &comClient)
     2576    : m_comClient(comClient)
     2577{
     2578    connect(this, &UINotificationProgress::sigProgressFinished,
     2579            this, &UINotificationProgressCloudInstanceList::sltHandleProgressFinished);
     2580}
     2581
     2582QString UINotificationProgressCloudInstanceList::name() const
     2583{
     2584    return UINotificationProgress::tr("Listing cloud instances ...");
     2585}
     2586
     2587QString UINotificationProgressCloudInstanceList::details() const
     2588{
     2589    return QString();
     2590}
     2591
     2592CProgress UINotificationProgressCloudInstanceList::createProgress(COMResult &comResult)
     2593{
     2594    /* Currently we are interested in Running and Stopped VMs only: */
     2595    const QVector<KCloudMachineState> cloudMachineStates  = QVector<KCloudMachineState>()
     2596                                                         << KCloudMachineState_Running
     2597                                                         << KCloudMachineState_Stopped;
     2598
     2599    /* Initialize progress-wrapper: */
     2600    CProgress comProgress = m_comClient.ListInstances(cloudMachineStates, m_comNames, m_comIds);
     2601    /* Store COM result: */
     2602    comResult = m_comClient;
     2603    /* Return progress-wrapper: */
     2604    return comProgress;
     2605}
     2606
     2607void UINotificationProgressCloudInstanceList::sltHandleProgressFinished()
     2608{
     2609    if (m_comNames.isNotNull() && m_comIds.isNotNull())
     2610    {
     2611        emit sigImageNamesReceived(QVariant::fromValue(m_comNames));
     2612        emit sigImageIdsReceived(QVariant::fromValue(m_comIds));
     2613    }
     2614}
     2615
     2616
     2617/*********************************************************************************************************************************
     2618*   Class UINotificationProgressCloudSourceInstanceList implementation.                                                          *
     2619*********************************************************************************************************************************/
     2620
     2621UINotificationProgressCloudSourceInstanceList::UINotificationProgressCloudSourceInstanceList(const CCloudClient &comClient)
     2622    : m_comClient(comClient)
     2623{
     2624    connect(this, &UINotificationProgress::sigProgressFinished,
     2625            this, &UINotificationProgressCloudSourceInstanceList::sltHandleProgressFinished);
     2626}
     2627
     2628QString UINotificationProgressCloudSourceInstanceList::name() const
     2629{
     2630    return UINotificationProgress::tr("Listing cloud source instances ...");
     2631}
     2632
     2633QString UINotificationProgressCloudSourceInstanceList::details() const
     2634{
     2635    return QString();
     2636}
     2637
     2638CProgress UINotificationProgressCloudSourceInstanceList::createProgress(COMResult &comResult)
     2639{
     2640    /* Initialize progress-wrapper: */
     2641    CProgress comProgress = m_comClient.ListSourceInstances(m_comNames, m_comIds);
     2642    /* Store COM result: */
     2643    comResult = m_comClient;
     2644    /* Return progress-wrapper: */
     2645    return comProgress;
     2646}
     2647
     2648void UINotificationProgressCloudSourceInstanceList::sltHandleProgressFinished()
     2649{
     2650    if (m_comNames.isNotNull() && m_comIds.isNotNull())
     2651    {
     2652        emit sigImageNamesReceived(QVariant::fromValue(m_comNames));
     2653        emit sigImageIdsReceived(QVariant::fromValue(m_comIds));
     2654    }
     2655}
     2656
     2657
     2658/*********************************************************************************************************************************
    23972659*   Class UINotificationProgressCloudMachineAdd implementation.                                                                  *
    23982660*********************************************************************************************************************************/
     
    27092971    /* Store COM result: */
    27102972    comResult = m_comMachine;
     2973    /* Return progress-wrapper: */
     2974    return comProgress;
     2975}
     2976
     2977
     2978/*********************************************************************************************************************************
     2979*   Class UINotificationProgressCloudMachineSettingsFormCreate implementation.                                                   *
     2980*********************************************************************************************************************************/
     2981
     2982UINotificationProgressCloudMachineSettingsFormCreate::UINotificationProgressCloudMachineSettingsFormCreate(const CCloudMachine &comMachine,
     2983                                                                                                           const QString &strMachineName)
     2984    : m_comMachine(comMachine)
     2985    , m_strMachineName(strMachineName)
     2986{
     2987    connect(this, &UINotificationProgress::sigProgressFinished,
     2988            this, &UINotificationProgressCloudMachineSettingsFormCreate::sltHandleProgressFinished);
     2989}
     2990
     2991QString UINotificationProgressCloudMachineSettingsFormCreate::name() const
     2992{
     2993    return UINotificationProgress::tr("Creating cloud VM settings form ...");
     2994}
     2995
     2996QString UINotificationProgressCloudMachineSettingsFormCreate::details() const
     2997{
     2998    return UINotificationProgress::tr("<b>Cloud VM Name:</b> %1").arg(m_strMachineName);
     2999}
     3000
     3001CProgress UINotificationProgressCloudMachineSettingsFormCreate::createProgress(COMResult &comResult)
     3002{
     3003    /* Initialize progress-wrapper: */
     3004    CProgress comProgress = m_comMachine.GetSettingsForm(m_comForm);
     3005    /* Store COM result: */
     3006    comResult = m_comMachine;
     3007    /* Return progress-wrapper: */
     3008    return comProgress;
     3009}
     3010
     3011void UINotificationProgressCloudMachineSettingsFormCreate::sltHandleProgressFinished()
     3012{
     3013    if (m_comForm.isNotNull())
     3014        emit sigSettingsFormCreated(QVariant::fromValue(m_comForm));
     3015}
     3016
     3017
     3018/*********************************************************************************************************************************
     3019*   Class UINotificationProgressCloudMachineSettingsFormApply implementation.                                                    *
     3020*********************************************************************************************************************************/
     3021
     3022UINotificationProgressCloudMachineSettingsFormApply::UINotificationProgressCloudMachineSettingsFormApply(const CForm &comForm,
     3023                                                                                                         const QString &strMachineName)
     3024    : m_comForm(comForm)
     3025    , m_strMachineName(strMachineName)
     3026{
     3027}
     3028
     3029QString UINotificationProgressCloudMachineSettingsFormApply::name() const
     3030{
     3031    return UINotificationProgress::tr("Applying cloud VM settings form ...");
     3032}
     3033
     3034QString UINotificationProgressCloudMachineSettingsFormApply::details() const
     3035{
     3036    return UINotificationProgress::tr("<b>Cloud VM Name:</b> %1").arg(m_strMachineName);
     3037}
     3038
     3039CProgress UINotificationProgressCloudMachineSettingsFormApply::createProgress(COMResult &comResult)
     3040{
     3041    /* Initialize progress-wrapper: */
     3042    CProgress comProgress = m_comForm.Apply();
     3043    /* Store COM result: */
     3044    comResult = m_comForm;
    27113045    /* Return progress-wrapper: */
    27123046    return comProgress;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r92173 r92191  
    3737#include "CExtPackFile.h"
    3838#include "CExtPackManager.h"
     39#include "CForm.h"
    3940#include "CFormValue.h"
    4041#include "CGuest.h"
     
    4546#include "CSession.h"
    4647#include "CSnapshot.h"
     48#include "CStringArray.h"
    4749#include "CVFSExplorer.h"
    4850#include "CVirtualSystemDescription.h"
     
    311313        static void cannotAcquireCloudProfileParameter(const CCloudProfile &comCloudProfile,
    312314                                                       UINotificationCenter *pParent = 0);
     315        /** Notifies about inability to acquire ICloudMachine parameter.
     316          * @param  comCloudMachine  Brings the object parameter get acquired from. */
     317        static void cannotAcquireCloudMachineParameter(const CCloudMachine &comCloudMachine,
     318                                                       UINotificationCenter *pParent = 0);
    313319
    314320        /** Notifies about inability to change IMedium parameter.
     
    11871193};
    11881194
     1195/** UINotificationProgress extension for export VSD form create functionality. */
     1196class SHARED_LIBRARY_STUFF UINotificationProgressExportVSDFormCreate : public UINotificationProgress
     1197{
     1198    Q_OBJECT;
     1199
     1200signals:
     1201
     1202    /** Notifies listeners about VSD @a comForm created.
     1203      * @param  form  Brings created VSD form. */
     1204    void sigVSDFormCreated(const QVariant &form);
     1205
     1206public:
     1207
     1208    /** Constructs export VSD form create notification-progress.
     1209      * @param  comClient  Brings the cloud client being creating VSD form.
     1210      * @param  comVsd     Brings the VSD, form being created for. */
     1211    UINotificationProgressExportVSDFormCreate(const CCloudClient &comClient,
     1212                                              const CVirtualSystemDescription &comVSD);
     1213
     1214protected:
     1215
     1216    /** Returns object name. */
     1217    virtual QString name() const /* override final */;
     1218    /** Returns object details. */
     1219    virtual QString details() const /* override final */;
     1220    /** Creates and returns started progress-wrapper. */
     1221    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     1222
     1223private slots:
     1224
     1225    /** Handles signal about progress being finished. */
     1226    void sltHandleProgressFinished();
     1227
     1228private:
     1229
     1230    /** Holds the cloud client being creating VSD form. */
     1231    CCloudClient                   m_comClient;
     1232    /** Holds the VSD, form being created for. */
     1233    CVirtualSystemDescription      m_comVSD;
     1234    /** Holds the VSD form being created. */
     1235    CVirtualSystemDescriptionForm  m_comVSDForm;
     1236};
     1237
     1238/** UINotificationProgress extension for import VSD form create functionality. */
     1239class SHARED_LIBRARY_STUFF UINotificationProgressImportVSDFormCreate : public UINotificationProgress
     1240{
     1241    Q_OBJECT;
     1242
     1243signals:
     1244
     1245    /** Notifies listeners about VSD @a comForm created.
     1246      * @param  form  Brings created VSD form. */
     1247    void sigVSDFormCreated(const QVariant &form);
     1248
     1249public:
     1250
     1251    /** Constructs import VSD form create notification-progress.
     1252      * @param  comClient  Brings the cloud client being creating VSD form.
     1253      * @param  comVsd     Brings the VSD, form being created for. */
     1254    UINotificationProgressImportVSDFormCreate(const CCloudClient &comClient,
     1255                                              const CVirtualSystemDescription &comVSD);
     1256
     1257protected:
     1258
     1259    /** Returns object name. */
     1260    virtual QString name() const /* override final */;
     1261    /** Returns object details. */
     1262    virtual QString details() const /* override final */;
     1263    /** Creates and returns started progress-wrapper. */
     1264    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     1265
     1266private slots:
     1267
     1268    /** Handles signal about progress being finished. */
     1269    void sltHandleProgressFinished();
     1270
     1271private:
     1272
     1273    /** Holds the cloud client being creating VSD form. */
     1274    CCloudClient                   m_comClient;
     1275    /** Holds the VSD, form being created for. */
     1276    CVirtualSystemDescription      m_comVSD;
     1277    /** Holds the VSD form being created. */
     1278    CVirtualSystemDescriptionForm  m_comVSDForm;
     1279};
     1280
     1281/** UINotificationProgress extension for cloud image list functionality. */
     1282class SHARED_LIBRARY_STUFF UINotificationProgressCloudImageList : public UINotificationProgress
     1283{
     1284    Q_OBJECT;
     1285
     1286signals:
     1287
     1288    /** Notifies listeners about image @a names received. */
     1289    void sigImageNamesReceived(const QVariant &names);
     1290    /** Notifies listeners about image @a ids received. */
     1291    void sigImageIdsReceived(const QVariant &ids);
     1292
     1293public:
     1294
     1295    /** Constructs cloud images list notification-progress.
     1296      * @param  comClient         Brings the cloud client being listing images.
     1297      * @param  cloudImageStates  Brings the image states we are interested in. */
     1298    UINotificationProgressCloudImageList(const CCloudClient &comClient,
     1299                                         const QVector<KCloudImageState> &cloudImageStates);
     1300
     1301protected:
     1302
     1303    /** Returns object name. */
     1304    virtual QString name() const /* override final */;
     1305    /** Returns object details. */
     1306    virtual QString details() const /* override final */;
     1307    /** Creates and returns started progress-wrapper. */
     1308    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     1309
     1310private slots:
     1311
     1312    /** Handles signal about progress being finished. */
     1313    void sltHandleProgressFinished();
     1314
     1315private:
     1316
     1317    /** Holds the cloud client being listing images. */
     1318    CCloudClient               m_comClient;
     1319    /** Holds the image states we are interested in. */
     1320    QVector<KCloudImageState>  m_cloudImageStates;
     1321    /** Holds the listed names. */
     1322    CStringArray               m_comNames;
     1323    /** Holds the listed ids. */
     1324    CStringArray               m_comIds;
     1325};
     1326
     1327/** UINotificationProgress extension for cloud source boot volume list functionality. */
     1328class SHARED_LIBRARY_STUFF UINotificationProgressCloudSourceBootVolumeList : public UINotificationProgress
     1329{
     1330    Q_OBJECT;
     1331
     1332signals:
     1333
     1334    /** Notifies listeners about source boot volume @a names received. */
     1335    void sigImageNamesReceived(const QVariant &names);
     1336    /** Notifies listeners about source boot volume @a ids received. */
     1337    void sigImageIdsReceived(const QVariant &ids);
     1338
     1339public:
     1340
     1341    /** Constructs cloud source boot volumes list notification-progress.
     1342      * @param  comClient  Brings the cloud client being listing source boot volumes. */
     1343    UINotificationProgressCloudSourceBootVolumeList(const CCloudClient &comClient);
     1344
     1345protected:
     1346
     1347    /** Returns object name. */
     1348    virtual QString name() const /* override final */;
     1349    /** Returns object details. */
     1350    virtual QString details() const /* override final */;
     1351    /** Creates and returns started progress-wrapper. */
     1352    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     1353
     1354private slots:
     1355
     1356    /** Handles signal about progress being finished. */
     1357    void sltHandleProgressFinished();
     1358
     1359private:
     1360
     1361    /** Holds the cloud client being listing source boot volumes. */
     1362    CCloudClient  m_comClient;
     1363    /** Holds the listed names. */
     1364    CStringArray  m_comNames;
     1365    /** Holds the listed ids. */
     1366    CStringArray  m_comIds;
     1367};
     1368
     1369/** UINotificationProgress extension for cloud instance list functionality. */
     1370class SHARED_LIBRARY_STUFF UINotificationProgressCloudInstanceList : public UINotificationProgress
     1371{
     1372    Q_OBJECT;
     1373
     1374signals:
     1375
     1376    /** Notifies listeners about instance @a names received. */
     1377    void sigImageNamesReceived(const QVariant &names);
     1378    /** Notifies listeners about instance @a ids received. */
     1379    void sigImageIdsReceived(const QVariant &ids);
     1380
     1381public:
     1382
     1383    /** Constructs cloud instances list notification-progress.
     1384      * @param  comClient  Brings the cloud client being listing instances. */
     1385    UINotificationProgressCloudInstanceList(const CCloudClient &comClient);
     1386
     1387protected:
     1388
     1389    /** Returns object name. */
     1390    virtual QString name() const /* override final */;
     1391    /** Returns object details. */
     1392    virtual QString details() const /* override final */;
     1393    /** Creates and returns started progress-wrapper. */
     1394    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     1395
     1396private slots:
     1397
     1398    /** Handles signal about progress being finished. */
     1399    void sltHandleProgressFinished();
     1400
     1401private:
     1402
     1403    /** Holds the cloud client being listing instances. */
     1404    CCloudClient  m_comClient;
     1405    /** Holds the listed names. */
     1406    CStringArray  m_comNames;
     1407    /** Holds the listed ids. */
     1408    CStringArray  m_comIds;
     1409};
     1410
     1411/** UINotificationProgress extension for cloud source instance list functionality. */
     1412class SHARED_LIBRARY_STUFF UINotificationProgressCloudSourceInstanceList : public UINotificationProgress
     1413{
     1414    Q_OBJECT;
     1415
     1416signals:
     1417
     1418    /** Notifies listeners about source instance @a names received. */
     1419    void sigImageNamesReceived(const QVariant &names);
     1420    /** Notifies listeners about source instance @a ids received. */
     1421    void sigImageIdsReceived(const QVariant &ids);
     1422
     1423public:
     1424
     1425    /** Constructs cloud source instances list notification-progress.
     1426      * @param  comClient  Brings the cloud client being listing source instances. */
     1427    UINotificationProgressCloudSourceInstanceList(const CCloudClient &comClient);
     1428
     1429protected:
     1430
     1431    /** Returns object name. */
     1432    virtual QString name() const /* override final */;
     1433    /** Returns object details. */
     1434    virtual QString details() const /* override final */;
     1435    /** Creates and returns started progress-wrapper. */
     1436    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     1437
     1438private slots:
     1439
     1440    /** Handles signal about progress being finished. */
     1441    void sltHandleProgressFinished();
     1442
     1443private:
     1444
     1445    /** Holds the cloud client being listing source instances. */
     1446    CCloudClient  m_comClient;
     1447    /** Holds the listed names. */
     1448    CStringArray  m_comNames;
     1449    /** Holds the listed ids. */
     1450    CStringArray  m_comIds;
     1451};
     1452
    11891453/** UINotificationProgress extension for cloud machine add functionality. */
    11901454class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineAdd : public UINotificationProgress
     
    14661730};
    14671731
     1732/** UINotificationProgress extension for cloud machine settings form create functionality. */
     1733class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineSettingsFormCreate : public UINotificationProgress
     1734{
     1735    Q_OBJECT;
     1736
     1737signals:
     1738
     1739    /** Notifies listeners about settings @a comForm created.
     1740      * @param  form  Brings created VSD form. */
     1741    void sigSettingsFormCreated(const QVariant &form);
     1742
     1743public:
     1744
     1745    /** Constructs cloud machine settings form create notification-progress.
     1746      * @param  comMachine      Brings the machine form being created for.
     1747      * @param  strMachineName  Brings the machine name. */
     1748    UINotificationProgressCloudMachineSettingsFormCreate(const CCloudMachine &comMachine,
     1749                                                         const QString &strMachineName);
     1750
     1751protected:
     1752
     1753    /** Returns object name. */
     1754    virtual QString name() const /* override final */;
     1755    /** Returns object details. */
     1756    virtual QString details() const /* override final */;
     1757    /** Creates and returns started progress-wrapper. */
     1758    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     1759
     1760private slots:
     1761
     1762    /** Handles signal about progress being finished. */
     1763    void sltHandleProgressFinished();
     1764
     1765private:
     1766
     1767    /** Holds the machine form being created for. */
     1768    CCloudMachine  m_comMachine;
     1769    /** Holds the machine name. */
     1770    QString        m_strMachineName;
     1771    /** Holds the form being created. */
     1772    CForm          m_comForm;
     1773};
     1774
     1775/** UINotificationProgress extension for cloud machine settings form apply functionality. */
     1776class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineSettingsFormApply : public UINotificationProgress
     1777{
     1778    Q_OBJECT;
     1779
     1780public:
     1781
     1782    /** Constructs cloud machine settings form apply notification-progress.
     1783      * @param  comForm         Brings the form being applied.
     1784      * @param  strMachineName  Brings the machine name. */
     1785    UINotificationProgressCloudMachineSettingsFormApply(const CForm &comForm,
     1786                                                        const QString &strMachineName);
     1787
     1788protected:
     1789
     1790    /** Returns object name. */
     1791    virtual QString name() const /* override final */;
     1792    /** Returns object details. */
     1793    virtual QString details() const /* override final */;
     1794    /** Creates and returns started progress-wrapper. */
     1795    virtual CProgress createProgress(COMResult &comResult) /* override final */;
     1796
     1797private:
     1798
     1799    /** Holds the machine form being created for. */
     1800    CForm    m_comForm;
     1801    /** Holds the machine name. */
     1802    QString  m_strMachineName;
     1803};
     1804
    14681805/** UINotificationProgress extension for cloud console connection create functionality. */
    14691806class SHARED_LIBRARY_STUFF UINotificationProgressCloudConsoleConnectionCreate : public UINotificationProgress
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp

    r92173 r92191  
    228228
    229229    /* Update profile instances: */
    230     populateProfileInstances(m_pSourceInstanceList, wizard()->client());
     230    populateProfileInstances(m_pSourceInstanceList, wizard()->notificationCenter(), wizard()->client());
    231231    sltHandleSourceInstanceChange();
    232232
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp

    r92173 r92191  
    155155}
    156156
    157 void UIWizardAddCloudVMSource::populateProfileInstances(QListWidget *pList, const CCloudClient &comClient)
     157void UIWizardAddCloudVMSource::populateProfileInstances(QListWidget *pList, UINotificationCenter *pCenter, const CCloudClient &comClient)
    158158{
    159159    /* Sanity check: */
    160160    AssertPtrReturnVoid(pList);
    161161    AssertReturnVoid(comClient.isNotNull());
    162     /* We need top-level parent as well: */
    163     QWidget *pParent = pList->window();
    164     AssertPtrReturnVoid(pParent);
    165162
    166163    /* Block signals while updating: */
     
    173170    CStringArray comNames;
    174171    CStringArray comIDs;
    175     if (listCloudSourceInstances(comClient, comNames, comIDs, pParent))
     172    if (listCloudSourceInstances(comClient, comNames, comIDs, pCenter))
    176173    {
    177174        /* Push acquired names to list rows: */
     
    475472
    476473    /* Update profile instances: */
    477     populateProfileInstances(m_pSourceInstanceList, wizard()->client());
     474    populateProfileInstances(m_pSourceInstanceList, wizard()->notificationCenter(), wizard()->client());
    478475    sltHandleSourceInstanceChange();
    479476
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.h

    r92173 r92191  
    6262    void populateProfiles(QIComboBox *pCombo, UINotificationCenter *pCenter, const QString &strProviderShortName, const QString &strProfileName);
    6363    /** Populates @a pList with profile instances available in @a comClient. */
    64     void populateProfileInstances(QListWidget *pList, const CCloudClient &comClient);
     64    void populateProfileInstances(QListWidget *pList, UINotificationCenter *pCenter, const CCloudClient &comClient);
    6565
    6666    /** Updates @a pCombo tool-tips. */
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageFormat.cpp

    r92173 r92191  
    539539    /* Read Cloud Client Export description form: */
    540540    CVirtualSystemDescriptionForm comVsdExportForm;
    541     bool fResult = exportDescriptionForm(comCloudClient, comCloudVsd, comVsdExportForm);
     541    bool fResult = exportDescriptionForm(comCloudClient, comCloudVsd, comVsdExportForm, pWizard->notificationCenter());
    542542    if (!fResult)
    543543        return;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageSource.cpp

    r92173 r92191  
    253253        pListWidget->clear();
    254254
    255         /* Gather VM names, ids and states.
    256          * Currently we are interested in Running and Stopped VMs only. */
    257         const QMap<QString, QString> instances = listInstances(comClient, pParent);
    258 
    259         /* Push acquired names to list rows: */
    260         foreach (const QString &strId, instances.keys())
     255        /* Gather instance names and ids: */
     256        CStringArray comNames;
     257        CStringArray comIDs;
     258        if (listCloudInstances(comClient, comNames, comIDs, pCenter))
    261259        {
    262             /* Create list item: */
    263             QListWidgetItem *pItem = new QListWidgetItem(instances.value(strId), pListWidget);
    264             if (pItem)
     260            /* Push acquired names to list rows: */
     261            const QVector<QString> names = comNames.GetValues();
     262            const QVector<QString> ids = comIDs.GetValues();
     263            for (int i = 0; i < names.size(); ++i)
    265264            {
    266                 pItem->setFlags(pItem->flags() & ~Qt::ItemIsEditable);
    267                 pItem->setData(Qt::UserRole, strId);
     265                /* Create list item: */
     266                QListWidgetItem *pItem = new QListWidgetItem(names.at(i), pListWidget);
     267                if (pItem)
     268                {
     269                    pItem->setFlags(pItem->flags() & ~Qt::ItemIsEditable);
     270                    pItem->setData(Qt::UserRole, ids.at(i));
     271                }
    268272            }
    269273        }
     
    339343    /* Read Cloud Client description form: */
    340344    CVirtualSystemDescriptionForm comVsdImportForm;
    341     bool fSuccess = importDescriptionForm(comClient, comDescription, comVsdImportForm, pWizard);
     345    bool fSuccess = importDescriptionForm(comClient, comDescription, comVsdImportForm, pWizard->notificationCenter());
    342346    if (!fSuccess)
    343347        return;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp

    r92173 r92191  
    343343{
    344344    /* Update source type: */
    345     populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->client());
     345    populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->notificationCenter(), wizard()->client());
    346346    sltHandleSourceImageChange();
    347347
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp

    r92173 r92191  
    158158void UIWizardNewCloudVMSource::populateSourceImages(QListWidget *pList,
    159159                                                    QTabBar *pTabBar,
     160                                                    UINotificationCenter *pCenter,
    160161                                                    const CCloudClient &comClient)
    161162{
     
    164165    AssertPtrReturnVoid(pTabBar);
    165166    AssertReturnVoid(comClient.isNotNull());
    166     /* We need top-level parent as well: */
    167     QWidget *pParent = pList->window();
    168     AssertPtrReturnVoid(pParent);
    169167
    170168    /* Block signals while updating: */
     
    181179    {
    182180        /* Ask for cloud images, currently we are interested in Available images only: */
    183         case 0: fResult = listCloudImages(comClient, comNames, comIDs, pParent); break;
     181        case 0: fResult = listCloudImages(comClient, comNames, comIDs, pCenter); break;
    184182        /* Ask for cloud boot-volumes, currently we are interested in Source boot-volumes only: */
    185         case 1: fResult = listCloudSourceBootVolumes(comClient, comNames, comIDs, pParent); break;
     183        case 1: fResult = listCloudSourceBootVolumes(comClient, comNames, comIDs, pCenter); break;
    186184        default: break;
    187185    }
     
    562560{
    563561    /* Update source type: */
    564     populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->client());
     562    populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->notificationCenter(), wizard()->client());
    565563    sltHandleSourceImageChange();
    566564
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.h

    r92173 r92191  
    7272    void populateSourceImages(QListWidget *pList,
    7373                              QTabBar *pTabBar,
     74                              UINotificationCenter *pCenter,
    7475                              const CCloudClient &comClient);
    7576    /** Populates @a comVSD with form property.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette