Changeset 91757 in vbox
- Timestamp:
- Oct 15, 2021 9:58:36 AM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r91216 r91757 1932 1932 1933 1933 /********************************************************************************************************************************* 1934 * Class UINotificationProgressLaunchVSDFormCreate implementation. * 1935 *********************************************************************************************************************************/ 1936 1937 UINotificationProgressLaunchVSDFormCreate::UINotificationProgressLaunchVSDFormCreate(const CCloudClient &comClient, 1938 const CVirtualSystemDescription &comVSD, 1939 const QString &strProviderShortName, 1940 const QString &strProfileName) 1941 : m_comClient(comClient) 1942 , m_comVSD(comVSD) 1943 , m_strProviderShortName(strProviderShortName) 1944 , m_strProfileName(strProfileName) 1945 { 1946 connect(this, &UINotificationProgress::sigProgressFinished, 1947 this, &UINotificationProgressLaunchVSDFormCreate::sltHandleProgressFinished); 1948 } 1949 1950 QString UINotificationProgressLaunchVSDFormCreate::name() const 1951 { 1952 return UINotificationProgress::tr("Creating launch VSD form ..."); 1953 } 1954 1955 QString UINotificationProgressLaunchVSDFormCreate::details() const 1956 { 1957 return UINotificationProgress::tr("<b>Provider:</b> %1<br><b>Profile:</b> %2") 1958 .arg(m_strProviderShortName, m_strProfileName); 1959 } 1960 1961 CProgress UINotificationProgressLaunchVSDFormCreate::createProgress(COMResult &comResult) 1962 { 1963 /* Initialize progress-wrapper: */ 1964 CProgress comProgress = m_comClient.GetLaunchDescriptionForm(m_comVSD, m_comVSDForm); 1965 /* Store COM result: */ 1966 comResult = m_comClient; 1967 /* Return progress-wrapper: */ 1968 return comProgress; 1969 } 1970 1971 void UINotificationProgressLaunchVSDFormCreate::sltHandleProgressFinished() 1972 { 1973 if (m_comVSDForm.isNotNull()) 1974 emit sigVSDFormCreated(m_comVSDForm); 1975 } 1976 1977 1978 /********************************************************************************************************************************* 1934 1979 * Class UINotificationProgressCloudMachineAdd implementation. * 1935 1980 *********************************************************************************************************************************/ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r91216 r91757 45 45 #include "CSnapshot.h" 46 46 #include "CVirtualSystemDescription.h" 47 #include "CVirtualSystemDescriptionForm.h" 47 48 48 49 /* Forward declarations: */ … … 960 961 }; 961 962 963 /** UINotificationProgress extension for launch VSD form create functionality. */ 964 class SHARED_LIBRARY_STUFF UINotificationProgressLaunchVSDFormCreate : public UINotificationProgress 965 { 966 Q_OBJECT; 967 968 signals: 969 970 /** Notifies listeners about VSD @a comForm created. 971 * @param comForm Brings created VSD form. */ 972 void sigVSDFormCreated(const CVirtualSystemDescriptionForm &comForm); 973 974 public: 975 976 /** Constructs launch VSD form create notification-progress. 977 * @param comClient Brings the cloud client being creating VSD form. 978 * @param comVsd Brings the VSD, form being created for. 979 * @param strProviderShortName Brings the short provider name. 980 * @param strProfileName Brings the profile name. */ 981 UINotificationProgressLaunchVSDFormCreate(const CCloudClient &comClient, 982 const CVirtualSystemDescription &comVSD, 983 const QString &strProviderShortName, 984 const QString &strProfileName); 985 986 protected: 987 988 /** Returns object name. */ 989 virtual QString name() const /* override final */; 990 /** Returns object details. */ 991 virtual QString details() const /* override final */; 992 /** Creates and returns started progress-wrapper. */ 993 virtual CProgress createProgress(COMResult &comResult) /* override final */; 994 995 private slots: 996 997 /** Handles signal about progress being finished. */ 998 void sltHandleProgressFinished(); 999 1000 private: 1001 1002 /** Holds the cloud client being creating VSD form. */ 1003 CCloudClient m_comClient; 1004 /** Holds the VSD, form being created for. */ 1005 CVirtualSystemDescription m_comVSD; 1006 /** Holds the VSD form being created. */ 1007 CVirtualSystemDescriptionForm m_comVSDForm; 1008 /** Holds the short provider name. */ 1009 QString m_strProviderShortName; 1010 /** Holds the profile name. */ 1011 QString m_strProfileName; 1012 }; 1013 962 1014 /** UINotificationProgress extension for cloud machine add functionality. */ 963 1015 class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineAdd : public UINotificationProgress -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.cpp
r91499 r91757 52 52 } 53 53 54 boolUIWizardNewCloudVM::createVSDForm()54 void UIWizardNewCloudVM::createVSDForm() 55 55 { 56 /* Prepare result: */57 bool fResult = false;58 59 56 /* Acquire prepared client and description: */ 60 57 CCloudClient comClient = client(); 61 58 CVirtualSystemDescription comVSD = vsd(); 62 AssertReturn (comClient.isNotNull() && comVSD.isNotNull(), false);59 AssertReturnVoid(comClient.isNotNull() && comVSD.isNotNull()); 63 60 64 /* Read Cloud Client description form: */ 65 CVirtualSystemDescriptionForm comForm; 66 CProgress comProgress = comClient.GetLaunchDescriptionForm(comVSD, comForm); 67 /* Check for immediate errors: */ 68 if (!comClient.isOk()) 69 msgCenter().cannotAcquireCloudClientParameter(comClient); 70 else 71 { 72 /* Make sure progress initially valid: */ 73 if (!comProgress.isNull() && !comProgress.GetCompleted()) 74 { 75 /* Create take snapshot progress object: */ 76 QPointer<UIProgressObject> pObject = new UIProgressObject(comProgress, this); 77 if (pObject) 78 { 79 connect(pObject.data(), &UIProgressObject::sigProgressChange, 80 this, &UIWizardNewCloudVM::sltHandleProgressChange); 81 connect(pObject.data(), &UIProgressObject::sigProgressComplete, 82 this, &UIWizardNewCloudVM::sltHandleProgressFinished); 83 sltHandleProgressStarted(); 84 pObject->exec(); 85 if (pObject) 86 delete pObject; 87 else 88 { 89 // Premature application shutdown, 90 // exit immediately: 91 return fResult; 92 } 93 } 94 } 95 96 /* Check for progress errors: */ 97 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 98 msgCenter().cannotAcquireCloudClientParameter(comProgress); 99 else 100 { 101 /* Check whether form really read: */ 102 if (comForm.isNotNull()) 103 { 104 /* Remember Virtual System Description Form: */ 105 setVSDForm(comForm); 106 107 /* Finally, success: */ 108 fResult = true; 109 } 110 } 111 } 112 113 /* Return result: */ 114 return fResult; 61 /* Create launch VSD form: */ 62 UINotificationProgressLaunchVSDFormCreate *pNotification = new UINotificationProgressLaunchVSDFormCreate(comClient, 63 comVSD, 64 providerShortName(), 65 profileName()); 66 connect(pNotification, &UINotificationProgressLaunchVSDFormCreate::sigVSDFormCreated, 67 this, &UIWizardNewCloudVM::setVSDForm); 68 handleNotificationProgressNow(pNotification); 115 69 } 116 70 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.h
r91756 r91757 54 54 55 55 /** Creates VSD Form. */ 56 boolcreateVSDForm();56 void createVSDForm(); 57 57 58 58 /** Creates New Cloud VM. */
Note:
See TracChangeset
for help on using the changeset viewer.