Changeset 92191 in vbox
- Timestamp:
- Nov 3, 2021 2:11:43 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 148020
- 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 63 63 /* Apply form: */ 64 64 AssertReturnVoid(m_comForm.isNotNull()); 65 if (!applyCloudMachineSettingsForm(m_comCloudMachine, m_comForm, this))65 if (!applyCloudMachineSettingsForm(m_comCloudMachine, m_comForm, notificationCenter())) 66 66 return; 67 67 … … 90 90 { 91 91 /* Update name: */ 92 if (!cloudMachineName(m_comCloudMachine, m_strName, this))92 if (!cloudMachineName(m_comCloudMachine, m_strName, notificationCenter())) 93 93 reject(); 94 94 … … 97 97 98 98 /* Update form: */ 99 if (!cloudMachineSettingsForm(m_comCloudMachine, m_comForm, this))99 if (!cloudMachineSettingsForm(m_comCloudMachine, m_comForm, notificationCenter())) 100 100 reject(); 101 101 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp ¶
r92173 r92191 281 281 } 282 282 283 QVector<CCloudProfile> UICloudNetworkingStuff::listCloudProfiles( CCloudProvidercomCloudProvider,283 QVector<CCloudProfile> UICloudNetworkingStuff::listCloudProfiles(const CCloudProvider &comCloudProvider, 284 284 UINotificationCenter *pParent /* = 0 */) 285 285 { … … 336 336 CStringArray &comNames, 337 337 CStringArray &comIDs, 338 QWidget*pParent /* = 0 */)338 UINotificationCenter *pParent /* = 0 */) 339 339 { 340 340 /* Currently we are interested in Available images only: */ 341 341 const QVector<KCloudImageState> cloudImageStates = QVector<KCloudImageState>() 342 342 << 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 358 360 /* Return false by default: */ 359 361 return false; … … 363 365 CStringArray &comNames, 364 366 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 389 bool 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 382 410 /* Return false by default: */ 383 411 return false; … … 387 415 CStringArray &comNames, 388 416 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 406 435 /* Return false by default: */ 407 436 return false; 408 437 } 409 438 410 bool UICloudNetworkingStuff::exportDescriptionForm( CCloudClientcomCloudClient,411 CVirtualSystemDescriptioncomDescription,439 bool UICloudNetworkingStuff::exportDescriptionForm(const CCloudClient &comCloudClient, 440 const CVirtualSystemDescription &comDescription, 412 441 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 430 456 /* False by default: */ 431 457 return false; 432 458 } 433 459 434 bool UICloudNetworkingStuff::importDescriptionForm( CCloudClientcomCloudClient,435 CVirtualSystemDescriptioncomDescription,460 bool UICloudNetworkingStuff::importDescriptionForm(const CCloudClient &comCloudClient, 461 const CVirtualSystemDescription &comDescription, 436 462 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 454 477 /* False by default: */ 455 478 return false; … … 458 481 bool UICloudNetworkingStuff::cloudMachineId(const CCloudMachine &comCloudMachine, 459 482 QUuid &uResult, 460 QWidget*pParent /* = 0 */)483 UINotificationCenter *pParent /* = 0 */) 461 484 { 462 485 const QUuid uId = comCloudMachine.GetId(); 463 486 if (!comCloudMachine.isOk()) 464 msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);487 UINotificationMessage::cannotAcquireCloudMachineParameter(comCloudMachine, pParent); 465 488 else 466 489 { … … 473 496 bool UICloudNetworkingStuff::cloudMachineName(const CCloudMachine &comCloudMachine, 474 497 QString &strResult, 475 QWidget*pParent /* = 0 */)498 UINotificationCenter *pParent /* = 0 */) 476 499 { 477 500 const QString strName = comCloudMachine.GetName(); 478 501 if (!comCloudMachine.isOk()) 479 msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);502 UINotificationMessage::cannotAcquireCloudMachineParameter(comCloudMachine, pParent); 480 503 else 481 504 { … … 488 511 bool UICloudNetworkingStuff::cloudMachineConsoleConnectionFingerprint(const CCloudMachine &comCloudMachine, 489 512 QString &strResult, 490 QWidget*pParent /* = 0 */)513 UINotificationCenter *pParent /* = 0 */) 491 514 { 492 515 const QString strConsoleConnectionFingerprint = comCloudMachine.GetConsoleConnectionFingerprint(); 493 516 if (!comCloudMachine.isOk()) 494 msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);517 UINotificationMessage::cannotAcquireCloudMachineParameter(comCloudMachine, pParent); 495 518 else 496 519 { … … 501 524 } 502 525 503 bool UICloudNetworkingStuff::cloudMachineSettingsForm( CCloudMachinecomCloudMachine,526 bool UICloudNetworkingStuff::cloudMachineSettingsForm(const CCloudMachine &comCloudMachine, 504 527 CForm &comResult, 505 QWidget*pParent /* = 0 */)528 UINotificationCenter *pParent /* = 0 */) 506 529 { 507 530 /* Acquire machine name first: */ … … 510 533 return false; 511 534 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; 538 549 } 539 550 … … 568 579 } 569 580 570 bool UICloudNetworkingStuff::applyCloudMachineSettingsForm( CCloudMachinecomCloudMachine,571 CFormcomForm,572 QWidget*pParent /* = 0 */)581 bool UICloudNetworkingStuff::applyCloudMachineSettingsForm(const CCloudMachine &comCloudMachine, 582 const CForm &comForm, 583 UINotificationCenter *pParent /* = 0 */) 573 584 { 574 585 /* Acquire machine name first: */ … … 577 588 return false; 578 589 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 101 101 102 102 /** Acquires cloud profiles of certain @a comCloudProvider, using @a pParent to show messages according to. */ 103 SHARED_LIBRARY_STUFF QVector<CCloudProfile> listCloudProfiles( CCloudProvidercomCloudProvider,103 SHARED_LIBRARY_STUFF QVector<CCloudProfile> listCloudProfiles(const CCloudProvider &comCloudProvider, 104 104 UINotificationCenter *pParent = 0); 105 105 … … 118 118 CStringArray &comNames, 119 119 CStringArray &comIDs, 120 QWidget*pParent = 0);120 UINotificationCenter *pParent = 0); 121 121 /** Acquires cloud source boot volumes of certain @a comCloudClient, using @a pParent to show messages according to. */ 122 122 SHARED_LIBRARY_STUFF bool listCloudSourceBootVolumes(const CCloudClient &comCloudClient, 123 123 CStringArray &comNames, 124 124 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); 126 131 /** Acquires cloud source instances of certain @a comCloudClient, using @a pParent to show messages according to. */ 127 132 SHARED_LIBRARY_STUFF bool listCloudSourceInstances(const CCloudClient &comCloudClient, 128 133 CStringArray &comNames, 129 134 CStringArray &comIDs, 130 QWidget*pParent = 0);135 UINotificationCenter *pParent = 0); 131 136 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, 136 140 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, 142 145 CVirtualSystemDescriptionForm &comResult, 143 QWidget*pParent = 0);146 UINotificationCenter *pParent = 0); 144 147 145 148 /** Acquires @a comCloudMachine ID as a @a uResult, using @a pParent to show messages according to. */ 146 149 SHARED_LIBRARY_STUFF bool cloudMachineId(const CCloudMachine &comCloudMachine, 147 150 QUuid &uResult, 148 QWidget*pParent = 0);151 UINotificationCenter *pParent = 0); 149 152 /** Acquires @a comCloudMachine name as a @a strResult, using @a pParent to show messages according to. */ 150 153 SHARED_LIBRARY_STUFF bool cloudMachineName(const CCloudMachine &comCloudMachine, 151 154 QString &strResult, 152 QWidget*pParent = 0);155 UINotificationCenter *pParent = 0); 153 156 /** Acquires @a comCloudMachine console connection fingerprint as a @a strResult, 154 157 * using @a pParent to show messages according to. */ 155 158 SHARED_LIBRARY_STUFF bool cloudMachineConsoleConnectionFingerprint(const CCloudMachine &comCloudMachine, 156 159 QString &strResult, 157 QWidget*pParent = 0);160 UINotificationCenter *pParent = 0); 158 161 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, 162 164 CForm &comResult, 163 QWidget*pParent = 0);165 UINotificationCenter *pParent = 0); 164 166 /** Acquires @a comCloudMachine settings form as a @a comResult, using @a strErrorMessage to store messages to. 165 167 * @note Be aware, this is a blocking function, it will hang for a time of progress being executed. */ … … 168 170 QString &strErrorMessage); 169 171 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); 182 176 } 183 177 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp ¶
r92173 r92191 707 707 .arg(CMachine(machine).GetName(), CMachine(machine).GetSettingsFilePath()), 708 708 UIErrorString::formatErrorInfo(machine)); 709 }710 711 void UIMessageCenter::cannotApplyCloudMachineFormSettings(const CForm &comForm, const QString &strName, QWidget *pParent /* = 0 */) const712 {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 */) const719 {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));723 709 } 724 710 … … 1414 1400 } 1415 1401 1416 void UIMessageCenter::cannotAcquireCloudClientParameter(const CCloudClient &comClient, QWidget *pParent /* = 0 */) const1417 {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 */) const1424 {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 */) const1431 {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 */) const1438 {1439 error(pParent, MessageType_Error,1440 tr("Failed to acquire cloud machine parameter."),1441 UIErrorString::formatErrorInfo(comProgress));1442 }1443 1444 1402 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 1445 1403 bool UIMessageCenter::confirmLookingForGuestAdditions() const -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h ¶
r92173 r92191 285 285 void cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent = 0) const; 286 286 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;289 287 290 288 void cannotAddDiskEncryptionPassword(const CConsole &console); … … 373 371 bool confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent = 0) const; 374 372 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;383 373 /** @} */ 384 374 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp ¶
r92173 r92191 745 745 QApplication::translate("UIMessageCenter", "Failed to acquire cloud profile parameter.") + 746 746 UIErrorString::formatErrorInfo(comCloudProfile), 747 QString(), QString(), pParent); 748 } 749 750 /* static */ 751 void 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), 747 758 QString(), QString(), pParent); 748 759 } … … 2395 2406 2396 2407 /********************************************************************************************************************************* 2408 * Class UINotificationProgressExportVSDFormCreate implementation. * 2409 *********************************************************************************************************************************/ 2410 2411 UINotificationProgressExportVSDFormCreate::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 2420 QString UINotificationProgressExportVSDFormCreate::name() const 2421 { 2422 return UINotificationProgress::tr("Creating export VSD form ..."); 2423 } 2424 2425 QString UINotificationProgressExportVSDFormCreate::details() const 2426 { 2427 return QString(); 2428 } 2429 2430 CProgress 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 2440 void 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 2451 UINotificationProgressImportVSDFormCreate::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 2460 QString UINotificationProgressImportVSDFormCreate::name() const 2461 { 2462 return UINotificationProgress::tr("Creating import VSD form ..."); 2463 } 2464 2465 QString UINotificationProgressImportVSDFormCreate::details() const 2466 { 2467 return QString(); 2468 } 2469 2470 CProgress 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 2480 void 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 2491 UINotificationProgressCloudImageList::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 2500 QString UINotificationProgressCloudImageList::name() const 2501 { 2502 return UINotificationProgress::tr("Listing cloud images ..."); 2503 } 2504 2505 QString UINotificationProgressCloudImageList::details() const 2506 { 2507 return QString(); 2508 } 2509 2510 CProgress 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 2520 void 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 2534 UINotificationProgressCloudSourceBootVolumeList::UINotificationProgressCloudSourceBootVolumeList(const CCloudClient &comClient) 2535 : m_comClient(comClient) 2536 { 2537 connect(this, &UINotificationProgress::sigProgressFinished, 2538 this, &UINotificationProgressCloudSourceBootVolumeList::sltHandleProgressFinished); 2539 } 2540 2541 QString UINotificationProgressCloudSourceBootVolumeList::name() const 2542 { 2543 return UINotificationProgress::tr("Listing cloud source boot volumes ..."); 2544 } 2545 2546 QString UINotificationProgressCloudSourceBootVolumeList::details() const 2547 { 2548 return QString(); 2549 } 2550 2551 CProgress 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 2561 void 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 2575 UINotificationProgressCloudInstanceList::UINotificationProgressCloudInstanceList(const CCloudClient &comClient) 2576 : m_comClient(comClient) 2577 { 2578 connect(this, &UINotificationProgress::sigProgressFinished, 2579 this, &UINotificationProgressCloudInstanceList::sltHandleProgressFinished); 2580 } 2581 2582 QString UINotificationProgressCloudInstanceList::name() const 2583 { 2584 return UINotificationProgress::tr("Listing cloud instances ..."); 2585 } 2586 2587 QString UINotificationProgressCloudInstanceList::details() const 2588 { 2589 return QString(); 2590 } 2591 2592 CProgress 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 2607 void 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 2621 UINotificationProgressCloudSourceInstanceList::UINotificationProgressCloudSourceInstanceList(const CCloudClient &comClient) 2622 : m_comClient(comClient) 2623 { 2624 connect(this, &UINotificationProgress::sigProgressFinished, 2625 this, &UINotificationProgressCloudSourceInstanceList::sltHandleProgressFinished); 2626 } 2627 2628 QString UINotificationProgressCloudSourceInstanceList::name() const 2629 { 2630 return UINotificationProgress::tr("Listing cloud source instances ..."); 2631 } 2632 2633 QString UINotificationProgressCloudSourceInstanceList::details() const 2634 { 2635 return QString(); 2636 } 2637 2638 CProgress 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 2648 void 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 /********************************************************************************************************************************* 2397 2659 * Class UINotificationProgressCloudMachineAdd implementation. * 2398 2660 *********************************************************************************************************************************/ … … 2709 2971 /* Store COM result: */ 2710 2972 comResult = m_comMachine; 2973 /* Return progress-wrapper: */ 2974 return comProgress; 2975 } 2976 2977 2978 /********************************************************************************************************************************* 2979 * Class UINotificationProgressCloudMachineSettingsFormCreate implementation. * 2980 *********************************************************************************************************************************/ 2981 2982 UINotificationProgressCloudMachineSettingsFormCreate::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 2991 QString UINotificationProgressCloudMachineSettingsFormCreate::name() const 2992 { 2993 return UINotificationProgress::tr("Creating cloud VM settings form ..."); 2994 } 2995 2996 QString UINotificationProgressCloudMachineSettingsFormCreate::details() const 2997 { 2998 return UINotificationProgress::tr("<b>Cloud VM Name:</b> %1").arg(m_strMachineName); 2999 } 3000 3001 CProgress 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 3011 void 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 3022 UINotificationProgressCloudMachineSettingsFormApply::UINotificationProgressCloudMachineSettingsFormApply(const CForm &comForm, 3023 const QString &strMachineName) 3024 : m_comForm(comForm) 3025 , m_strMachineName(strMachineName) 3026 { 3027 } 3028 3029 QString UINotificationProgressCloudMachineSettingsFormApply::name() const 3030 { 3031 return UINotificationProgress::tr("Applying cloud VM settings form ..."); 3032 } 3033 3034 QString UINotificationProgressCloudMachineSettingsFormApply::details() const 3035 { 3036 return UINotificationProgress::tr("<b>Cloud VM Name:</b> %1").arg(m_strMachineName); 3037 } 3038 3039 CProgress UINotificationProgressCloudMachineSettingsFormApply::createProgress(COMResult &comResult) 3040 { 3041 /* Initialize progress-wrapper: */ 3042 CProgress comProgress = m_comForm.Apply(); 3043 /* Store COM result: */ 3044 comResult = m_comForm; 2711 3045 /* Return progress-wrapper: */ 2712 3046 return comProgress; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h ¶
r92173 r92191 37 37 #include "CExtPackFile.h" 38 38 #include "CExtPackManager.h" 39 #include "CForm.h" 39 40 #include "CFormValue.h" 40 41 #include "CGuest.h" … … 45 46 #include "CSession.h" 46 47 #include "CSnapshot.h" 48 #include "CStringArray.h" 47 49 #include "CVFSExplorer.h" 48 50 #include "CVirtualSystemDescription.h" … … 311 313 static void cannotAcquireCloudProfileParameter(const CCloudProfile &comCloudProfile, 312 314 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); 313 319 314 320 /** Notifies about inability to change IMedium parameter. … … 1187 1193 }; 1188 1194 1195 /** UINotificationProgress extension for export VSD form create functionality. */ 1196 class SHARED_LIBRARY_STUFF UINotificationProgressExportVSDFormCreate : public UINotificationProgress 1197 { 1198 Q_OBJECT; 1199 1200 signals: 1201 1202 /** Notifies listeners about VSD @a comForm created. 1203 * @param form Brings created VSD form. */ 1204 void sigVSDFormCreated(const QVariant &form); 1205 1206 public: 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 1214 protected: 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 1223 private slots: 1224 1225 /** Handles signal about progress being finished. */ 1226 void sltHandleProgressFinished(); 1227 1228 private: 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. */ 1239 class SHARED_LIBRARY_STUFF UINotificationProgressImportVSDFormCreate : public UINotificationProgress 1240 { 1241 Q_OBJECT; 1242 1243 signals: 1244 1245 /** Notifies listeners about VSD @a comForm created. 1246 * @param form Brings created VSD form. */ 1247 void sigVSDFormCreated(const QVariant &form); 1248 1249 public: 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 1257 protected: 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 1266 private slots: 1267 1268 /** Handles signal about progress being finished. */ 1269 void sltHandleProgressFinished(); 1270 1271 private: 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. */ 1282 class SHARED_LIBRARY_STUFF UINotificationProgressCloudImageList : public UINotificationProgress 1283 { 1284 Q_OBJECT; 1285 1286 signals: 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 1293 public: 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 1301 protected: 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 1310 private slots: 1311 1312 /** Handles signal about progress being finished. */ 1313 void sltHandleProgressFinished(); 1314 1315 private: 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. */ 1328 class SHARED_LIBRARY_STUFF UINotificationProgressCloudSourceBootVolumeList : public UINotificationProgress 1329 { 1330 Q_OBJECT; 1331 1332 signals: 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 1339 public: 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 1345 protected: 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 1354 private slots: 1355 1356 /** Handles signal about progress being finished. */ 1357 void sltHandleProgressFinished(); 1358 1359 private: 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. */ 1370 class SHARED_LIBRARY_STUFF UINotificationProgressCloudInstanceList : public UINotificationProgress 1371 { 1372 Q_OBJECT; 1373 1374 signals: 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 1381 public: 1382 1383 /** Constructs cloud instances list notification-progress. 1384 * @param comClient Brings the cloud client being listing instances. */ 1385 UINotificationProgressCloudInstanceList(const CCloudClient &comClient); 1386 1387 protected: 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 1396 private slots: 1397 1398 /** Handles signal about progress being finished. */ 1399 void sltHandleProgressFinished(); 1400 1401 private: 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. */ 1412 class SHARED_LIBRARY_STUFF UINotificationProgressCloudSourceInstanceList : public UINotificationProgress 1413 { 1414 Q_OBJECT; 1415 1416 signals: 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 1423 public: 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 1429 protected: 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 1438 private slots: 1439 1440 /** Handles signal about progress being finished. */ 1441 void sltHandleProgressFinished(); 1442 1443 private: 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 1189 1453 /** UINotificationProgress extension for cloud machine add functionality. */ 1190 1454 class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineAdd : public UINotificationProgress … … 1466 1730 }; 1467 1731 1732 /** UINotificationProgress extension for cloud machine settings form create functionality. */ 1733 class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineSettingsFormCreate : public UINotificationProgress 1734 { 1735 Q_OBJECT; 1736 1737 signals: 1738 1739 /** Notifies listeners about settings @a comForm created. 1740 * @param form Brings created VSD form. */ 1741 void sigSettingsFormCreated(const QVariant &form); 1742 1743 public: 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 1751 protected: 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 1760 private slots: 1761 1762 /** Handles signal about progress being finished. */ 1763 void sltHandleProgressFinished(); 1764 1765 private: 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. */ 1776 class SHARED_LIBRARY_STUFF UINotificationProgressCloudMachineSettingsFormApply : public UINotificationProgress 1777 { 1778 Q_OBJECT; 1779 1780 public: 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 1788 protected: 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 1797 private: 1798 1799 /** Holds the machine form being created for. */ 1800 CForm m_comForm; 1801 /** Holds the machine name. */ 1802 QString m_strMachineName; 1803 }; 1804 1468 1805 /** UINotificationProgress extension for cloud console connection create functionality. */ 1469 1806 class SHARED_LIBRARY_STUFF UINotificationProgressCloudConsoleConnectionCreate : public UINotificationProgress -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp ¶
r92173 r92191 228 228 229 229 /* Update profile instances: */ 230 populateProfileInstances(m_pSourceInstanceList, wizard()-> client());230 populateProfileInstances(m_pSourceInstanceList, wizard()->notificationCenter(), wizard()->client()); 231 231 sltHandleSourceInstanceChange(); 232 232 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp ¶
r92173 r92191 155 155 } 156 156 157 void UIWizardAddCloudVMSource::populateProfileInstances(QListWidget *pList, const CCloudClient &comClient)157 void UIWizardAddCloudVMSource::populateProfileInstances(QListWidget *pList, UINotificationCenter *pCenter, const CCloudClient &comClient) 158 158 { 159 159 /* Sanity check: */ 160 160 AssertPtrReturnVoid(pList); 161 161 AssertReturnVoid(comClient.isNotNull()); 162 /* We need top-level parent as well: */163 QWidget *pParent = pList->window();164 AssertPtrReturnVoid(pParent);165 162 166 163 /* Block signals while updating: */ … … 173 170 CStringArray comNames; 174 171 CStringArray comIDs; 175 if (listCloudSourceInstances(comClient, comNames, comIDs, p Parent))172 if (listCloudSourceInstances(comClient, comNames, comIDs, pCenter)) 176 173 { 177 174 /* Push acquired names to list rows: */ … … 475 472 476 473 /* Update profile instances: */ 477 populateProfileInstances(m_pSourceInstanceList, wizard()-> client());474 populateProfileInstances(m_pSourceInstanceList, wizard()->notificationCenter(), wizard()->client()); 478 475 sltHandleSourceInstanceChange(); 479 476 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.h ¶
r92173 r92191 62 62 void populateProfiles(QIComboBox *pCombo, UINotificationCenter *pCenter, const QString &strProviderShortName, const QString &strProfileName); 63 63 /** 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); 65 65 66 66 /** Updates @a pCombo tool-tips. */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageFormat.cpp ¶
r92173 r92191 539 539 /* Read Cloud Client Export description form: */ 540 540 CVirtualSystemDescriptionForm comVsdExportForm; 541 bool fResult = exportDescriptionForm(comCloudClient, comCloudVsd, comVsdExportForm );541 bool fResult = exportDescriptionForm(comCloudClient, comCloudVsd, comVsdExportForm, pWizard->notificationCenter()); 542 542 if (!fResult) 543 543 return; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageSource.cpp ¶
r92173 r92191 253 253 pListWidget->clear(); 254 254 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)) 261 259 { 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) 265 264 { 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 } 268 272 } 269 273 } … … 339 343 /* Read Cloud Client description form: */ 340 344 CVirtualSystemDescriptionForm comVsdImportForm; 341 bool fSuccess = importDescriptionForm(comClient, comDescription, comVsdImportForm, pWizard );345 bool fSuccess = importDescriptionForm(comClient, comDescription, comVsdImportForm, pWizard->notificationCenter()); 342 346 if (!fSuccess) 343 347 return; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp ¶
r92173 r92191 343 343 { 344 344 /* Update source type: */ 345 populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()-> client());345 populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->notificationCenter(), wizard()->client()); 346 346 sltHandleSourceImageChange(); 347 347 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp ¶
r92173 r92191 158 158 void UIWizardNewCloudVMSource::populateSourceImages(QListWidget *pList, 159 159 QTabBar *pTabBar, 160 UINotificationCenter *pCenter, 160 161 const CCloudClient &comClient) 161 162 { … … 164 165 AssertPtrReturnVoid(pTabBar); 165 166 AssertReturnVoid(comClient.isNotNull()); 166 /* We need top-level parent as well: */167 QWidget *pParent = pList->window();168 AssertPtrReturnVoid(pParent);169 167 170 168 /* Block signals while updating: */ … … 181 179 { 182 180 /* Ask for cloud images, currently we are interested in Available images only: */ 183 case 0: fResult = listCloudImages(comClient, comNames, comIDs, p Parent); break;181 case 0: fResult = listCloudImages(comClient, comNames, comIDs, pCenter); break; 184 182 /* Ask for cloud boot-volumes, currently we are interested in Source boot-volumes only: */ 185 case 1: fResult = listCloudSourceBootVolumes(comClient, comNames, comIDs, p Parent); break;183 case 1: fResult = listCloudSourceBootVolumes(comClient, comNames, comIDs, pCenter); break; 186 184 default: break; 187 185 } … … 562 560 { 563 561 /* Update source type: */ 564 populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()-> client());562 populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->notificationCenter(), wizard()->client()); 565 563 sltHandleSourceImageChange(); 566 564 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.h ¶
r92173 r92191 72 72 void populateSourceImages(QListWidget *pList, 73 73 QTabBar *pTabBar, 74 UINotificationCenter *pCenter, 74 75 const CCloudClient &comClient); 75 76 /** Populates @a comVSD with form property.
Note:
See TracChangeset
for help on using the changeset viewer.