- Timestamp:
- Jul 29, 2021 7:59:31 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145975
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r90386 r90389 1251 1251 if (cloudMachineName(comMachine, strName)) 1252 1252 { 1253 /* Prepare "create console connection" progress: */ 1254 CProgress comProgress = comMachine.CreateConsoleConnection(pDialog->publicKey()); 1255 if (!comMachine.isOk()) 1256 msgCenter().cannotCreateConsoleConnection(comMachine); 1257 else 1258 { 1259 /* Show "create console connection" progress: */ 1260 msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_new_cloud_vm_90px.png", 0, 0); 1261 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 1262 msgCenter().cannotCreateConsoleConnection(comProgress, strName); 1263 } 1253 /* Create cloud console connection: */ 1254 UINotificationProgressCloudConsoleConnectionCreate *pNotification = 1255 new UINotificationProgressCloudConsoleConnectionCreate(comMachine, 1256 pDialog->publicKey()); 1257 notificationCenter().append(pNotification); 1264 1258 } 1265 1259 } … … 1304 1298 if (cloudMachineName(comMachine, strName)) 1305 1299 { 1306 /* Prepare "create console connection" progress: */ 1307 CProgress comProgress = comMachine.CreateConsoleConnection(pDialog->publicKey()); 1308 if (!comMachine.isOk()) 1309 msgCenter().cannotCreateConsoleConnection(comMachine); 1310 else 1311 { 1312 /* Show "create console connection" progress: */ 1313 msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_new_cloud_vm_90px.png", 0, 0); 1314 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 1315 msgCenter().cannotCreateConsoleConnection(comProgress, strName); 1316 } 1300 /* Create cloud console connection: */ 1301 UINotificationProgressCloudConsoleConnectionCreate *pNotification = 1302 new UINotificationProgressCloudConsoleConnectionCreate(comMachine, 1303 pDialog->publicKey()); 1304 notificationCenter().append(pNotification); 1317 1305 } 1318 1306 } -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90376 r90389 443 443 444 444 /********************************************************************************************************************************* 445 * Class UINotificationProgressCloudConsoleConnectionCreate implementation. * 446 *********************************************************************************************************************************/ 447 448 UINotificationProgressCloudConsoleConnectionCreate::UINotificationProgressCloudConsoleConnectionCreate(const CCloudMachine &comMachine, 449 const QString &strPublicKey) 450 : m_comMachine(comMachine) 451 , m_strPublicKey(strPublicKey) 452 { 453 } 454 455 QString UINotificationProgressCloudConsoleConnectionCreate::name() const 456 { 457 return UINotificationProgress::tr("Creating cloud console connection ..."); 458 } 459 460 QString UINotificationProgressCloudConsoleConnectionCreate::details() const 461 { 462 return UINotificationProgress::tr("<b>Cloud VM Name:</b> %1").arg(m_strName); 463 } 464 465 CProgress UINotificationProgressCloudConsoleConnectionCreate::createProgress(COMResult &comResult) 466 { 467 /* Acquire cloud VM name: */ 468 m_strName = m_comMachine.GetName(); 469 if (!m_comMachine.isOk()) 470 { 471 comResult = m_comMachine; 472 return CProgress(); 473 } 474 475 /* Initialize progress-wrapper: */ 476 CProgress comProgress = m_comMachine.CreateConsoleConnection(m_strPublicKey); 477 /* Store COM result: */ 478 comResult = m_comMachine; 479 /* Return progress-wrapper: */ 480 return comProgress; 481 } 482 483 484 /********************************************************************************************************************************* 445 485 * Class UINotificationProgressApplianceExport implementation. * 446 486 *********************************************************************************************************************************/ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90376 r90389 450 450 }; 451 451 452 /** UINotificationProgress extension for cloud console connection create functionality. */ 453 class SHARED_LIBRARY_STUFF UINotificationProgressCloudConsoleConnectionCreate : public UINotificationProgress 454 { 455 Q_OBJECT; 456 457 public: 458 459 /** Constructs cloud console connection create notification-progress. 460 * @param comMachine Brings the cloud machine for which console connection being created. 461 * @param strPublicKey Brings the public key used for console connection being created. */ 462 UINotificationProgressCloudConsoleConnectionCreate(const CCloudMachine &comMachine, 463 const QString &strPublicKey); 464 465 protected: 466 467 /** Returns object name. */ 468 virtual QString name() const /* override final */; 469 /** Returns object details. */ 470 virtual QString details() const /* override final */; 471 /** Creates and returns started progress-wrapper. */ 472 virtual CProgress createProgress(COMResult &comResult) /* override final */; 473 474 private: 475 476 /** Holds the cloud machine for which console connection being created. */ 477 CCloudMachine m_comMachine; 478 /** Holds the name acquired from cloud machine. */ 479 QString m_strName; 480 /** Holds the public key used for console connection being created. */ 481 QString m_strPublicKey; 482 }; 483 452 484 /** UINotificationProgress extension for export appliance functionality. */ 453 485 class SHARED_LIBRARY_STUFF UINotificationProgressApplianceExport : public UINotificationProgress
Note:
See TracChangeset
for help on using the changeset viewer.