VirtualBox

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


Ignore:
Timestamp:
Apr 28, 2020 8:40:04 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137599
Message:

FE/Qt: bugref:9653: A bit of cleanup for UICloudNetworkingStuff.

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

Legend:

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

    r84020 r84028  
    205205}
    206206
    207 bool UICloudNetworkingStuff::cloudMachineSettingsForm(CCloudMachine &comCloudMachine,
     207bool UICloudNetworkingStuff::cloudMachineSettingsForm(CCloudMachine comCloudMachine,
    208208                                                      CForm &comResult,
    209209                                                      QWidget *pParent /* = 0 */)
     
    240240}
    241241
    242 bool UICloudNetworkingStuff::cloudMachineSettingsForm(CCloudMachine &comCloudMachine,
     242bool UICloudNetworkingStuff::cloudMachineSettingsForm(CCloudMachine comCloudMachine,
    243243                                                      CForm &comResult,
    244244                                                      QString &strErrorMessage)
     
    268268}
    269269
    270 bool UICloudNetworkingStuff::applyCloudMachineSettingsForm(CCloudMachine &comCloudMachine,
    271                                                            CForm &comForm,
     270bool UICloudNetworkingStuff::applyCloudMachineSettingsForm(CCloudMachine comCloudMachine,
     271                                                           CForm comForm,
    272272                                                           QWidget *pParent /* = 0 */)
    273273{
     
    352352}
    353353
    354 QVector<CCloudMachine> UICloudNetworkingStuff::listCloudMachines(CCloudClient &comCloudClient,
     354QVector<CCloudMachine> UICloudNetworkingStuff::listCloudMachines(CCloudClient comCloudClient,
    355355                                                                 QString &strErrorMessage,
    356356                                                                 QWidget *pParent /* = 0 */)
     
    485485}
    486486
    487 void UICloudNetworkingStuff::refreshCloudMachineInfo(CCloudMachine &comCloudMachine,
     487void UICloudNetworkingStuff::refreshCloudMachineInfo(CCloudMachine comCloudMachine,
    488488                                                     QString &strErrorMessage,
    489489                                                     QWidget *pParent /* = 0 */)
     
    566566    return resultMap;
    567567}
    568 
    569 QString UICloudNetworkingStuff::fetchOsType(const QMap<KVirtualSystemDescriptionType, QString> &infoMap)
    570 {
    571     /* Prepare a map of known OS types: */
    572     QMap<QString, QString> osTypes;
    573     osTypes["Custom"] = QString("Other");
    574     osTypes["Oracle Linux"] = QString("Oracle_64");
    575     osTypes["Canonical Ubuntu"] = QString("Ubuntu_64");
    576 
    577     /* Return OS type value: */
    578     return osTypes.value(infoMap.value(KVirtualSystemDescriptionType_OS), "Other");
    579 }
    580 
    581 int UICloudNetworkingStuff::fetchMemorySize(const QMap<KVirtualSystemDescriptionType, QString> &infoMap)
    582 {
    583     /* Return memory size value: */
    584     return infoMap.value(KVirtualSystemDescriptionType_Memory).toInt();
    585 }
    586 
    587 int UICloudNetworkingStuff::fetchCpuCount(const QMap<KVirtualSystemDescriptionType, QString> &infoMap)
    588 {
    589     /* Return CPU count value: */
    590     return infoMap.value(KVirtualSystemDescriptionType_CPU).toInt();
    591 }
    592 
    593 QString UICloudNetworkingStuff::fetchShape(const QMap<KVirtualSystemDescriptionType, QString> &infoMap)
    594 {
    595     /* Return shape value: */
    596     return infoMap.value(KVirtualSystemDescriptionType_CloudInstanceShape);
    597 }
    598 
    599 QString UICloudNetworkingStuff::fetchDomain(const QMap<KVirtualSystemDescriptionType, QString> &infoMap)
    600 {
    601     /* Return domain value: */
    602     return infoMap.value(KVirtualSystemDescriptionType_CloudDomain);
    603 }
    604 
    605 KMachineState UICloudNetworkingStuff::fetchMachineState(const QMap<KVirtualSystemDescriptionType, QString> &infoMap)
    606 {
    607     /* Prepare a map of known machine states: */
    608     QMap<QString, KMachineState> machineStates;
    609     machineStates["RUNNING"] = KMachineState_Running;
    610     machineStates["STOPPED"] = KMachineState_Paused;
    611     machineStates["STOPPING"] = KMachineState_Stopping;
    612     machineStates["STARTING"] = KMachineState_Starting;
    613 
    614     /* Return machine state value: */
    615     return machineStates.value(infoMap.value(KVirtualSystemDescriptionType_CloudInstanceState), KMachineState_PoweredOff);
    616 }
    617 
    618 QString UICloudNetworkingStuff::fetchBootingFirmware(const QMap<KVirtualSystemDescriptionType, QString> &infoMap)
    619 {
    620     /* Return booting firmware value: */
    621     return infoMap.value(KVirtualSystemDescriptionType_BootingFirmware);
    622 }
    623 
    624 QString UICloudNetworkingStuff::fetchImageId(const QMap<KVirtualSystemDescriptionType, QString> &infoMap)
    625 {
    626     /* Return image id value: */
    627     return infoMap.value(KVirtualSystemDescriptionType_CloudImageId);
    628 }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r84020 r84028  
    3232#include "CCloudClient.h"
    3333#include "CCloudMachine.h"
     34#include "CForm.h"
    3435
    3536/** Cloud networking stuff namespace. */
     
    7879    /** Acquires @a comCloudMachine settings form as a @a comResult, using @a pParent to show messages according to.
    7980      * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
    80     SHARED_LIBRARY_STUFF bool cloudMachineSettingsForm(CCloudMachine &comCloudMachine,
     81    SHARED_LIBRARY_STUFF bool cloudMachineSettingsForm(CCloudMachine comCloudMachine,
    8182                                                       CForm &comResult,
    8283                                                       QWidget *pParent = 0);
    8384    /** Acquires @a comCloudMachine settings form as a @a comResult, using @a strErrorMessage to store messages to.
    8485      * @note  Be aware, this is a blocking function, it will hang for a time of progress being executed. */
    85     SHARED_LIBRARY_STUFF bool cloudMachineSettingsForm(CCloudMachine &comCloudMachine,
     86    SHARED_LIBRARY_STUFF bool cloudMachineSettingsForm(CCloudMachine comCloudMachine,
    8687                                                       CForm &comResult,
    8788                                                       QString &strErrorMessage);
     
    8990    /** Applies @a comCloudMachine @a comForm settings, using @a pParent to show messages according to.
    9091      * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
    91     SHARED_LIBRARY_STUFF bool applyCloudMachineSettingsForm(CCloudMachine &comCloudMachine,
    92                                                             CForm &comForm,
     92    SHARED_LIBRARY_STUFF bool applyCloudMachineSettingsForm(CCloudMachine comCloudMachine,
     93                                                            CForm comForm,
    9394                                                            QWidget *pParent = 0);
    9495
     
    106107      * @param  pWidget          Brings parent widget to show messages according to,
    107108      *                          if no parent set, progress will be executed in blocking way. */
    108     SHARED_LIBRARY_STUFF QVector<CCloudMachine> listCloudMachines(CCloudClient &comCloudClient,
     109    SHARED_LIBRARY_STUFF QVector<CCloudMachine> listCloudMachines(CCloudClient comCloudClient,
    109110                                                                  QString &strErrorMessage,
    110111                                                                  QWidget *pParent = 0);
     
    136137      * @param  pWidget          Brings parent widget to show messages according to,
    137138      *                          if no parent set, progress will be executed in blocking way. */
    138     SHARED_LIBRARY_STUFF void refreshCloudMachineInfo(CCloudMachine &comCloudMachine,
     139    SHARED_LIBRARY_STUFF void refreshCloudMachineInfo(CCloudMachine comCloudMachine,
    139140                                                      QString &strErrorMessage,
    140141                                                      QWidget *pParent = 0);
     
    150151                                                             QString &strErrorMessage,
    151152                                                             QWidget *pParent = 0);
    152 
    153     /** Fetches cloud instance OS type from the passed @a info. */
    154     SHARED_LIBRARY_STUFF QString fetchOsType(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
    155     /** Fetches cloud instance memory size from the passed @a info. */
    156     SHARED_LIBRARY_STUFF int fetchMemorySize(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
    157     /** Fetches cloud instance CPU count from the passed @a info. */
    158     SHARED_LIBRARY_STUFF int fetchCpuCount(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
    159     /** Fetches cloud instance shape from the passed @a info. */
    160     SHARED_LIBRARY_STUFF QString fetchShape(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
    161     /** Fetches cloud instance domain from the passed @a info. */
    162     SHARED_LIBRARY_STUFF QString fetchDomain(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
    163     /** Fetches cloud instance state from the passed @a info. */
    164     SHARED_LIBRARY_STUFF KMachineState fetchMachineState(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
    165     /** Fetches cloud instance booting firmware from the passed @a info. */
    166     SHARED_LIBRARY_STUFF QString fetchBootingFirmware(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
    167     /** Fetches cloud instance image id from the passed @a info. */
    168     SHARED_LIBRARY_STUFF QString fetchImageId(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
    169153}
    170154
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