Changeset 79256 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 20, 2019 1:40:17 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r79044 r79256 79 79 #include "CHostNetworkInterface.h" 80 80 #include "CVFSExplorer.h" 81 #include "CVirtualSystemDescription.h" 81 82 #include "CVirtualSystemDescriptionForm.h" 82 83 #ifdef VBOX_WITH_DRAG_AND_DROP … … 1702 1703 } 1703 1704 1705 void UIMessageCenter::cannotCreateCloudMachine(const CCloudClient &comClient, QWidget *pParent /* = 0 */) const 1706 { 1707 error(pParent, MessageType_Error, 1708 tr("Failed to create cloud machine."), 1709 UIErrorString::formatErrorInfo(comClient)); 1710 } 1711 1712 void UIMessageCenter::cannotCreateCloudMachine(const CProgress &comProgress, QWidget *pParent /* = 0 */) const 1713 { 1714 error(pParent, MessageType_Error, 1715 tr("Failed to create cloud machine."), 1716 UIErrorString::formatErrorInfo(comProgress)); 1717 } 1718 1704 1719 void UIMessageCenter::cannotAcquireCloudClientParameter(const CCloudClient &comClient, QWidget *pParent /* = 0 */) const 1705 1720 { … … 1923 1938 error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual system description.</p>"), 1924 1939 UIErrorString::formatErrorInfo(comAppliance)); 1940 } 1941 1942 void UIMessageCenter::cannotAddVirtualSystemDescriptionValue(const CVirtualSystemDescription &comDescription, 1943 QWidget *pParent /* = 0 */) const 1944 { 1945 error(pParent, MessageType_Critical, tr("<p>Cannot add a virtual system description value.</p>"), 1946 UIErrorString::formatErrorInfo(comDescription)); 1925 1947 } 1926 1948 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r79044 r79256 378 378 void cannotAssignCloudProfileParameter(const CCloudProfile &comProfile, QWidget *pParent = 0) const; 379 379 void cannotCreateCloudClient(const CCloudProfile &comProfile, QWidget *pParent = 0) const; 380 void cannotCreateCloudMachine(const CCloudClient &comClient, QWidget *pParent = 0) const; 381 void cannotCreateCloudMachine(const CProgress &comProgress, QWidget *pParent = 0) const; 380 382 void cannotAcquireCloudClientParameter(const CCloudClient &comClient, QWidget *pParent = 0) const; 381 383 void cannotAcquireCloudClientParameter(const CProgress &comProgress, QWidget *pParent = 0) const; … … 408 410 void cannotCreateVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent = 0) const; 409 411 void cannotAcquireVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent = 0) const; 412 void cannotAddVirtualSystemDescriptionValue(const CVirtualSystemDescription &comDescription, QWidget *pParent = 0) const; 410 413 void cannotAcquireVirtualSystemDescriptionFormProperty(const CVirtualSystemDescriptionForm &comForm, QWidget *pParent = 0) const; 411 414 void cannotImportAppliance(CAppliance &appliance, QWidget *pParent = 0) const; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.cpp
r79250 r79256 27 27 28 28 29 UIWizardNewCloudVM::UIWizardNewCloudVM(QWidget *pParent , bool fImportFromOCIByDefault)29 UIWizardNewCloudVM::UIWizardNewCloudVM(QWidget *pParent) 30 30 : UIWizard(pParent, WizardType_NewCloudVM) 31 , m_fImportFromOCIByDefault(fImportFromOCIByDefault)32 31 { 33 32 #ifndef VBOX_WS_MAC … … 47 46 case WizardMode_Basic: 48 47 { 49 setPage(Page1, new UIWizardNewCloudVMPageBasic1 (m_fImportFromOCIByDefault));48 setPage(Page1, new UIWizardNewCloudVMPageBasic1); 50 49 setPage(Page2, new UIWizardNewCloudVMPageBasic2); 51 50 break; … … 53 52 case WizardMode_Expert: 54 53 { 55 setPage(PageExpert, new UIWizardNewCloudVMPageExpert (m_fImportFromOCIByDefault));54 setPage(PageExpert, new UIWizardNewCloudVMPageExpert); 56 55 break; 57 56 } … … 66 65 } 67 66 68 bool UIWizardNewCloudVM:: importAppliance()67 bool UIWizardNewCloudVM::createCloudVM() 69 68 { 70 /* Acquire prepared appliance: */ 71 CAppliance comAppliance = field("appliance").value<CAppliance>(); 72 AssertReturn(!comAppliance.isNull(), false); 69 /* Acquire prepared client and description: */ 70 CCloudClient comCloudClient = field("client").value<CCloudClient>(); 71 CVirtualSystemDescription comDescription = field("description").value<CVirtualSystemDescription>(); 72 AssertReturn(comCloudClient.isNotNull() && comDescription.isNotNull(), false); 73 73 74 /* No options for cloud VMs for now: */ 75 QVector<KImportOptions> options; 76 77 /* Initiate import porocedure: */ 78 CProgress comProgress = comAppliance.ImportMachines(options); 74 /* Initiate cloud VM creation porocedure: */ 75 CProgress comProgress = comCloudClient.LaunchVM(comDescription); 79 76 80 77 /* Show error message if necessary: */ 81 if (!com Appliance.isOk())82 msgCenter().cannot ImportAppliance(comAppliance, this);78 if (!comCloudClient.isOk()) 79 msgCenter().cannotCreateCloudMachine(comCloudClient, this); 83 80 else 84 81 { 85 /* Show " Import appliance" progress: */86 msgCenter().showModalProgressDialog(comProgress, tr(" Importing Appliance ..."), ":/progress_import_90px.png", this, 0);82 /* Show "Create Cloud Machine" progress: */ 83 msgCenter().showModalProgressDialog(comProgress, tr("Create Cloud Machine ..."), ":/progress_import_90px.png", this, 0); 87 84 if (!comProgress.GetCanceled()) 88 85 { 89 86 /* Show error message if necessary: */ 90 87 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 91 msgCenter().cannot ImportAppliance(comProgress, comAppliance.GetPath(), this);88 msgCenter().cannotCreateCloudMachine(comProgress, this); 92 89 else 93 90 return true; … … 105 102 106 103 /* Translate wizard: */ 107 setWindowTitle(tr(" Import Virtual Appliance"));108 setButtonText(QWizard::FinishButton, tr(" Import"));104 setWindowTitle(tr("Create Cloud Virtual Machine")); 105 setButtonText(QWizard::FinishButton, tr("Create")); 109 106 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.h
r79244 r79256 25 25 #include "UIWizard.h" 26 26 27 /** Import Appliancewizard. */27 /** New Cloud VM wizard. */ 28 28 class UIWizardNewCloudVM : public UIWizard 29 29 { … … 45 45 }; 46 46 47 /** Constructs import appliancewizard passing @a pParent to the base-class. */48 UIWizardNewCloudVM(QWidget *pParent , bool fImportFromOCIByDefault);47 /** Constructs new cloud vm wizard passing @a pParent to the base-class. */ 48 UIWizardNewCloudVM(QWidget *pParent); 49 49 50 50 /** Prepares all. */ 51 51 virtual void prepare() /* override */; 52 52 53 /** Imports appliance. */54 bool importAppliance();53 /** Create cloud VM. */ 54 bool createCloudVM(); 55 55 56 56 protected: … … 58 58 /** Handles translation event. */ 59 59 virtual void retranslateUi() /* override */; 60 61 private:62 63 /** Holds whether default source should be Import from OCI. */64 bool m_fImportFromOCIByDefault;65 60 }; 66 61 67 /** Safe pointer to appliancewizard. */62 /** Safe pointer to new cloud vm wizard. */ 68 63 typedef QPointer<UIWizardNewCloudVM> UISafePointerWizardNewCloudVM; 69 64 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.cpp
r79247 r79256 35 35 36 36 /* COM includes: */ 37 #include "CAppliance.h" 37 38 #include "CStringArray.h" 38 #include "CVirtualSystemDescription.h"39 39 40 40 … … 43 43 *********************************************************************************************************************************/ 44 44 45 UIWizardNewCloudVMPage1::UIWizardNewCloudVMPage1(bool fImportFromOCIByDefault) 46 : m_fImportFromOCIByDefault(fImportFromOCIByDefault) 47 , m_fPolished(false) 48 , m_pSourceLayout(0) 49 , m_pSourceLabel(0) 50 , m_pSourceComboBox(0) 45 UIWizardNewCloudVMPage1::UIWizardNewCloudVMPage1() 46 : m_fPolished(false) 47 , m_pDestinationLayout(0) 48 , m_pDestinationLabel(0) 49 , m_pDestinationComboBox(0) 51 50 , m_pCloudContainerLayout(0) 52 51 , m_pAccountLabel(0) … … 54 53 , m_pAccountToolButton(0) 55 54 , m_pAccountPropertyTable(0) 56 , m_pAccountI nstanceLabel(0)57 , m_pAccountI nstanceList(0)58 { 59 } 60 61 void UIWizardNewCloudVMPage1::populate Sources()55 , m_pAccountImageLabel(0) 56 , m_pAccountImageList(0) 57 { 58 } 59 60 void UIWizardNewCloudVMPage1::populateDestinations() 62 61 { 63 62 /* To be executed just once, so combo should be empty: */ 64 AssertReturnVoid(m_p SourceComboBox->count() == 0);65 66 /* Do we have OCI source? */63 AssertReturnVoid(m_pDestinationComboBox->count() == 0); 64 65 /* Do we have OCI destination? */ 67 66 bool fOCIPresent = false; 68 67 … … 95 94 96 95 /* Compose empty item, fill it's data: */ 97 m_pSourceComboBox->addItem(QString()); 98 m_pSourceComboBox->setItemData(m_pSourceComboBox->count() - 1, comProvider.GetId(), SourceData_ID); 99 m_pSourceComboBox->setItemData(m_pSourceComboBox->count() - 1, comProvider.GetName(), SourceData_Name); 100 m_pSourceComboBox->setItemData(m_pSourceComboBox->count() - 1, comProvider.GetShortName(), SourceData_ShortName); 101 m_pSourceComboBox->setItemData(m_pSourceComboBox->count() - 1, true, SourceData_IsItCloudFormat); 102 if (m_pSourceComboBox->itemData(m_pSourceComboBox->count() - 1, SourceData_ShortName).toString() == "OCI") 96 m_pDestinationComboBox->addItem(QString()); 97 m_pDestinationComboBox->setItemData(m_pDestinationComboBox->count() - 1, comProvider.GetId(), DestinationData_ID); 98 m_pDestinationComboBox->setItemData(m_pDestinationComboBox->count() - 1, comProvider.GetName(), DestinationData_Name); 99 m_pDestinationComboBox->setItemData(m_pDestinationComboBox->count() - 1, comProvider.GetShortName(), DestinationData_ShortName); 100 if (m_pDestinationComboBox->itemData(m_pDestinationComboBox->count() - 1, DestinationData_ShortName).toString() == "OCI") 103 101 fOCIPresent = true; 104 102 } … … 107 105 108 106 /* Set default: */ 109 if ( m_fImportFromOCIByDefault &&fOCIPresent)110 set Source("OCI");107 if (fOCIPresent) 108 setDestination("OCI"); 111 109 } 112 110 … … 127 125 128 126 /* If provider chosen: */ 129 if (! sourceId().isNull())127 if (!destinationId().isNull()) 130 128 { 131 129 /* Main API request sequence, can be interrupted after any step: */ … … 133 131 { 134 132 /* (Re)initialize Cloud Provider: */ 135 m_comCloudProvider = m_comCloudProviderManager.GetProviderById( sourceId());133 m_comCloudProvider = m_comCloudProviderManager.GetProviderById(destinationId()); 136 134 if (!m_comCloudProviderManager.isOk()) 137 135 { 138 msgCenter().cannotFindCloudProvider(m_comCloudProviderManager, sourceId());136 msgCenter().cannotFindCloudProvider(m_comCloudProviderManager, destinationId()); 139 137 break; 140 138 } … … 271 269 } 272 270 273 void UIWizardNewCloudVMPage1::populateAccountI nstances()271 void UIWizardNewCloudVMPage1::populateAccountImages() 274 272 { 275 273 /* Block signals while updating: */ 276 m_pAccountI nstanceList->blockSignals(true);274 m_pAccountImageList->blockSignals(true); 277 275 278 276 /* Clear list initially: */ 279 m_pAccountI nstanceList->clear();277 m_pAccountImageList->clear(); 280 278 /* Clear Cloud Client: */ 281 279 m_comCloudClient = CCloudClient(); … … 295 293 } 296 294 297 /* Gather VMnames, ids and states.298 * Currently we are interested in Running and Stopped VMs only. */295 /* Gather image names, ids and states. 296 * Currently we are interested in Available images only. */ 299 297 CStringArray comNames; 300 298 CStringArray comIDs; 301 const QVector<KCloudMachineState> cloudMachineStates = QVector<KCloudMachineState>() 302 << KCloudMachineState_Running 303 << KCloudMachineState_Stopped; 304 305 /* Ask for cloud VMs: */ 306 CProgress comProgress = m_comCloudClient.ListInstances(cloudMachineStates, comNames, comIDs); 299 const QVector<KCloudImageState> cloudImageStates = QVector<KCloudImageState>() 300 << KCloudImageState_Available; 301 302 /* Ask for cloud custom images: */ 303 CProgress comProgress = m_comCloudClient.ListImages(cloudImageStates, comNames, comIDs); 307 304 if (!m_comCloudClient.isOk()) 308 305 { … … 311 308 } 312 309 313 /* Show "Acquire cloud i nstances" progress: */314 msgCenter().showModalProgressDialog(comProgress, UIWizardNewCloudVM::tr("Acquire cloud i nstances..."),310 /* Show "Acquire cloud images" progress: */ 311 msgCenter().showModalProgressDialog(comProgress, UIWizardNewCloudVM::tr("Acquire cloud images..."), 315 312 ":/progress_reading_appliance_90px.png", 0, 0); 316 313 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) … … 326 323 { 327 324 /* Create list item: */ 328 QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_pAccountI nstanceList);325 QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_pAccountImageList); 329 326 if (pItem) 330 327 { … … 335 332 336 333 /* Choose the 1st one by default if possible: */ 337 if (m_pAccountI nstanceList->count())338 m_pAccountI nstanceList->setCurrentRow(0);334 if (m_pAccountImageList->count()) 335 m_pAccountImageList->setCurrentRow(0); 339 336 } 340 337 while (0); … … 342 339 343 340 /* Unblock signals after update: */ 344 m_pAccountI nstanceList->blockSignals(false);341 m_pAccountImageList->blockSignals(false); 345 342 } 346 343 347 344 void UIWizardNewCloudVMPage1::populateFormProperties() 348 345 { 349 /* Clear appliance: */ 350 m_comAppliance = CAppliance(); 351 /* Clear form properties: */ 346 /* Clear description & form properties: */ 347 m_comVSD = CVirtualSystemDescription(); 352 348 m_comVSDForm = CVirtualSystemDescriptionForm(); 353 349 … … 367 363 } 368 364 369 /* Remember appliance: */ 370 m_comAppliance = comAppliance; 371 372 /* Read cloud instance info: */ 373 CProgress comReadProgress = m_comAppliance.Read(QString("OCI://%1/%2").arg(profileName(), machineId())); 374 if (!m_comAppliance.isOk()) 375 { 376 msgCenter().cannotImportAppliance(m_comAppliance); 377 break; 378 } 379 380 /* Show "Read appliance" progress: */ 381 msgCenter().showModalProgressDialog(comReadProgress, UIWizardNewCloudVM::tr("Read appliance..."), 382 ":/progress_reading_appliance_90px.png", 0, 0); 383 if (!comReadProgress.isOk() || comReadProgress.GetResultCode() != 0) 384 { 385 msgCenter().cannotImportAppliance(comReadProgress, m_comAppliance.GetPath()); 365 /* Create virtual system description: */ 366 comAppliance.CreateVirtualSystemDescriptions(1); 367 if (!comAppliance.isOk()) 368 { 369 msgCenter().cannotCreateVirtualSystemDescription(comAppliance); 386 370 break; 387 371 } 388 372 389 373 /* Acquire virtual system description: */ 390 QVector<CVirtualSystemDescription> descriptions = m_comAppliance.GetVirtualSystemDescriptions();391 if (! m_comAppliance.isOk())392 { 393 msgCenter().cannotAcquireVirtualSystemDescription( m_comAppliance);374 QVector<CVirtualSystemDescription> descriptions = comAppliance.GetVirtualSystemDescriptions(); 375 if (!comAppliance.isOk()) 376 { 377 msgCenter().cannotAcquireVirtualSystemDescription(comAppliance); 394 378 break; 395 379 } … … 397 381 /* Make sure there is at least one virtual system description created: */ 398 382 AssertReturnVoid(!descriptions.isEmpty()); 399 CVirtualSystemDescription comDescription = descriptions.at(0); 383 m_comVSD = descriptions.at(0); 384 385 /* Add image id to virtual system description: */ 386 m_comVSD.AddDescription(KVirtualSystemDescriptionType_CloudImageId, imageId(), QString()); 387 if (!m_comVSD.isOk()) 388 { 389 msgCenter().cannotAddVirtualSystemDescriptionValue(m_comVSD); 390 break; 391 } 400 392 401 393 /* Read Cloud Client description form: */ 402 394 CVirtualSystemDescriptionForm comForm; 403 CProgress com ImportDescriptionFormProgress = m_comCloudClient.GetImportDescriptionForm(comVBox, comDescription, comForm);395 CProgress comLaunchDescriptionFormProgress = m_comCloudClient.GetLaunchDescriptionForm(m_comVSD, comForm); 404 396 if (!m_comCloudClient.isOk()) 405 397 { … … 408 400 } 409 401 410 /* Show "Acquire importform" progress: */411 msgCenter().showModalProgressDialog(com ImportDescriptionFormProgress, UIWizardNewCloudVM::tr("Acquire importform..."),402 /* Show "Acquire launch form" progress: */ 403 msgCenter().showModalProgressDialog(comLaunchDescriptionFormProgress, UIWizardNewCloudVM::tr("Acquire launch form..."), 412 404 ":/progress_reading_appliance_90px.png", 0, 0); 413 if (!com ImportDescriptionFormProgress.isOk() || comImportDescriptionFormProgress.GetResultCode() != 0)414 { 415 msgCenter().cannotAcquireCloudClientParameter(com ImportDescriptionFormProgress);405 if (!comLaunchDescriptionFormProgress.isOk() || comLaunchDescriptionFormProgress.GetResultCode() != 0) 406 { 407 msgCenter().cannotAcquireCloudClientParameter(comLaunchDescriptionFormProgress); 416 408 break; 417 409 } … … 424 416 } 425 417 426 void UIWizardNewCloudVMPage1::update SourceComboToolTip()427 { 428 const int iCurrentIndex = m_p SourceComboBox->currentIndex();429 const QString strCurrentToolTip = m_p SourceComboBox->itemData(iCurrentIndex, Qt::ToolTipRole).toString();418 void UIWizardNewCloudVMPage1::updateDestinationComboToolTip() 419 { 420 const int iCurrentIndex = m_pDestinationComboBox->currentIndex(); 421 const QString strCurrentToolTip = m_pDestinationComboBox->itemData(iCurrentIndex, Qt::ToolTipRole).toString(); 430 422 AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!")); 431 m_p SourceComboBox->setToolTip(strCurrentToolTip);423 m_pDestinationComboBox->setToolTip(strCurrentToolTip); 432 424 } 433 425 … … 464 456 } 465 457 466 void UIWizardNewCloudVMPage1::set Source(const QString &strSource)467 { 468 const int iIndex = m_p SourceComboBox->findData(strSource, SourceData_ShortName);458 void UIWizardNewCloudVMPage1::setDestination(const QString &strDestination) 459 { 460 const int iIndex = m_pDestinationComboBox->findData(strDestination, DestinationData_ShortName); 469 461 AssertMsg(iIndex != -1, ("Data not found!")); 470 m_p SourceComboBox->setCurrentIndex(iIndex);471 } 472 473 QString UIWizardNewCloudVMPage1:: source() const474 { 475 const int iIndex = m_p SourceComboBox->currentIndex();476 return m_p SourceComboBox->itemData(iIndex, SourceData_ShortName).toString();477 } 478 479 QUuid UIWizardNewCloudVMPage1:: sourceId() const480 { 481 const int iIndex = m_p SourceComboBox->currentIndex();482 return m_p SourceComboBox->itemData(iIndex, SourceData_ID).toUuid();462 m_pDestinationComboBox->setCurrentIndex(iIndex); 463 } 464 465 QString UIWizardNewCloudVMPage1::destination() const 466 { 467 const int iIndex = m_pDestinationComboBox->currentIndex(); 468 return m_pDestinationComboBox->itemData(iIndex, DestinationData_ShortName).toString(); 469 } 470 471 QUuid UIWizardNewCloudVMPage1::destinationId() const 472 { 473 const int iIndex = m_pDestinationComboBox->currentIndex(); 474 return m_pDestinationComboBox->itemData(iIndex, DestinationData_ID).toUuid(); 483 475 } 484 476 … … 489 481 } 490 482 491 QString UIWizardNewCloudVMPage1:: machineId() const492 { 493 QListWidgetItem *pItem = m_pAccountI nstanceList->currentItem();483 QString UIWizardNewCloudVMPage1::imageId() const 484 { 485 QListWidgetItem *pItem = m_pAccountImageList->currentItem(); 494 486 return pItem ? pItem->data(Qt::UserRole).toString() : QString(); 495 487 } 496 488 497 CCloud Profile UIWizardNewCloudVMPage1::profile() const498 { 499 return m_comCloud Profile;500 } 501 502 C Appliance UIWizardNewCloudVMPage1::appliance() const503 { 504 return m_com Appliance;489 CCloudClient UIWizardNewCloudVMPage1::client() const 490 { 491 return m_comCloudClient; 492 } 493 494 CVirtualSystemDescription UIWizardNewCloudVMPage1::vsd() const 495 { 496 return m_comVSD; 505 497 } 506 498 … … 515 507 *********************************************************************************************************************************/ 516 508 517 UIWizardNewCloudVMPageBasic1::UIWizardNewCloudVMPageBasic1(bool fImportFromOCIByDefault) 518 : UIWizardNewCloudVMPage1(fImportFromOCIByDefault) 519 , m_pLabelMain(0) 509 UIWizardNewCloudVMPageBasic1::UIWizardNewCloudVMPageBasic1() 510 : m_pLabelMain(0) 520 511 , m_pLabelDescription(0) 521 512 { … … 532 523 } 533 524 534 /* Create sourcelayout: */535 m_p SourceLayout = new QGridLayout;536 if (m_p SourceLayout)537 { 538 m_p SourceLayout->setColumnStretch(0, 0);539 m_p SourceLayout->setColumnStretch(1, 1);540 541 /* Create sourcelabel: */542 m_p SourceLabel = new QLabel(this);543 if (m_p SourceLabel)525 /* Create destination layout: */ 526 m_pDestinationLayout = new QGridLayout; 527 if (m_pDestinationLayout) 528 { 529 m_pDestinationLayout->setColumnStretch(0, 0); 530 m_pDestinationLayout->setColumnStretch(1, 1); 531 532 /* Create destination label: */ 533 m_pDestinationLabel = new QLabel(this); 534 if (m_pDestinationLabel) 544 535 { 545 536 /* Add into layout: */ 546 m_p SourceLayout->addWidget(m_pSourceLabel, 0, 0, Qt::AlignRight);547 } 548 /* Create sourceselector: */549 m_p SourceComboBox = new QIComboBox(this);550 if (m_p SourceComboBox)551 { 552 m_p SourceLabel->setBuddy(m_pSourceComboBox);537 m_pDestinationLayout->addWidget(m_pDestinationLabel, 0, 0, Qt::AlignRight); 538 } 539 /* Create destination selector: */ 540 m_pDestinationComboBox = new QIComboBox(this); 541 if (m_pDestinationComboBox) 542 { 543 m_pDestinationLabel->setBuddy(m_pDestinationComboBox); 553 544 554 545 /* Add into layout: */ 555 m_p SourceLayout->addWidget(m_pSourceComboBox, 0, 1);546 m_pDestinationLayout->addWidget(m_pDestinationComboBox, 0, 1); 556 547 } 557 548 … … 561 552 { 562 553 /* Add into layout: */ 563 m_p SourceLayout->addWidget(m_pLabelDescription, 1, 0, 1, 2);554 m_pDestinationLayout->addWidget(m_pLabelDescription, 1, 0, 1, 2); 564 555 } 565 556 566 557 /* Add into layout: */ 567 pMainLayout->addLayout(m_p SourceLayout);558 pMainLayout->addLayout(m_pDestinationLayout); 568 559 } 569 560 … … 637 628 638 629 /* Create account instance label: */ 639 m_pAccountI nstanceLabel = new QLabel(this);640 if (m_pAccountI nstanceLabel)630 m_pAccountImageLabel = new QLabel(this); 631 if (m_pAccountImageLabel) 641 632 { 642 633 /* Add into layout: */ 643 m_pCloudContainerLayout->addWidget(m_pAccountI nstanceLabel, 2, 0, Qt::AlignRight);634 m_pCloudContainerLayout->addWidget(m_pAccountImageLabel, 2, 0, Qt::AlignRight); 644 635 } 645 636 /* Create profile instances table: */ 646 m_pAccountI nstanceList = new QListWidget(this);647 if (m_pAccountI nstanceList)648 { 649 m_pAccountI nstanceLabel->setBuddy(m_pAccountInstanceLabel);650 const QFontMetrics fm(m_pAccountI nstanceList->font());637 m_pAccountImageList = new QListWidget(this); 638 if (m_pAccountImageList) 639 { 640 m_pAccountImageLabel->setBuddy(m_pAccountImageLabel); 641 const QFontMetrics fm(m_pAccountImageList->font()); 651 642 const int iFontWidth = fm.width('x'); 652 643 const int iTotalWidth = 50 * iFontWidth; 653 644 const int iFontHeight = fm.height(); 654 645 const int iTotalHeight = 4 * iFontHeight; 655 m_pAccountI nstanceList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));656 //m_pAccountI nstanceList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);657 m_pAccountI nstanceList->setAlternatingRowColors(true);646 m_pAccountImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight)); 647 //m_pAccountImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); 648 m_pAccountImageList->setAlternatingRowColors(true); 658 649 659 650 /* Add into layout: */ 660 m_pCloudContainerLayout->addWidget(m_pAccountI nstanceList, 2, 1, 2, 1);651 m_pCloudContainerLayout->addWidget(m_pAccountImageList, 2, 1, 2, 1); 661 652 } 662 653 … … 666 657 } 667 658 668 /* Populate sources: */669 populate Sources();659 /* Populate destinations: */ 660 populateDestinations(); 670 661 671 662 /* Setup connections: */ 672 663 if (gpManager) 673 664 connect(gpManager, &UIVirtualBoxManager::sigCloudProfileManagerChange, 674 this, &UIWizardNewCloudVMPageBasic1::sltHandle SourceChange);675 connect(m_p SourceComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),676 this, &UIWizardNewCloudVMPageBasic1::sltHandle SourceChange);665 this, &UIWizardNewCloudVMPageBasic1::sltHandleDestinationChange); 666 connect(m_pDestinationComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated), 667 this, &UIWizardNewCloudVMPageBasic1::sltHandleDestinationChange); 677 668 connect(m_pAccountComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged), 678 669 this, &UIWizardNewCloudVMPageBasic1::sltHandleAccountComboChange); 679 670 connect(m_pAccountToolButton, &QIToolButton::clicked, 680 671 this, &UIWizardNewCloudVMPageBasic1::sltHandleAccountButtonClick); 681 connect(m_pAccountI nstanceList, &QListWidget::currentRowChanged,672 connect(m_pAccountImageList, &QListWidget::currentRowChanged, 682 673 this, &UIWizardNewCloudVMPageBasic1::completeChanged); 683 674 684 675 /* Register fields: */ 685 registerField("source", this, "source"); 686 registerField("profile", this, "profile"); 687 registerField("appliance", this, "appliance"); 676 registerField("client", this, "client"); 677 registerField("vsd", this, "vsd"); 688 678 registerField("vsdForm", this, "vsdForm"); 689 registerField("machineId", this, "machineId");690 679 } 691 680 … … 713 702 { 714 703 /* Translate page: */ 715 setTitle(UIWizardNewCloudVM::tr(" Appliance to import"));704 setTitle(UIWizardNewCloudVM::tr("Destination to create")); 716 705 717 706 /* Translate main label: */ 718 m_pLabelMain->setText(UIWizardNewCloudVM::tr("Please choose the source to import appliance from. This can be"719 " one of known cloud service providers to import cloud VM from."));720 721 /* Translate sourcelabel: */722 m_p SourceLabel->setText(tr("&Source:"));723 /* Translate received values of Sourcecombo-box.707 m_pLabelMain->setText(UIWizardNewCloudVM::tr("Please choose the destination to create cloud virtual machine in. This can " 708 "be one of known cloud service providers below.")); 709 710 /* Translate destination label: */ 711 m_pDestinationLabel->setText(tr("&Destination:")); 712 /* Translate received values of Destination combo-box. 724 713 * We are enumerating starting from 0 for simplicity: */ 725 for (int i = 0; i < m_p SourceComboBox->count(); ++i)726 { 727 m_p SourceComboBox->setItemText(i, m_pSourceComboBox->itemData(i, SourceData_Name).toString());728 m_p SourceComboBox->setItemData(i, UIWizardNewCloudVM::tr("Import fromcloud service provider."), Qt::ToolTipRole);714 for (int i = 0; i < m_pDestinationComboBox->count(); ++i) 715 { 716 m_pDestinationComboBox->setItemText(i, m_pDestinationComboBox->itemData(i, DestinationData_Name).toString()); 717 m_pDestinationComboBox->setItemData(i, UIWizardNewCloudVM::tr("Create VM for cloud service provider."), Qt::ToolTipRole); 729 718 } 730 719 731 720 /* Translate description label: */ 732 721 m_pLabelDescription->setText(UIWizardNewCloudVM::tr("<p>Please choose one of cloud service accounts you have registered to " 733 "import virtual machine from. Corresponding machines list will be " 734 "updated. To continue, select one of machines to import below.</p>")); 722 "create virtual machine for. Existing custom images list will be " 723 "updated. To continue, select one of custom images to create virtual " 724 "machine on the basis of it.</p>")); 735 725 736 726 /* Translate cloud stuff: */ 737 727 m_pAccountLabel->setText(UIWizardNewCloudVM::tr("&Account:")); 738 m_pAccountI nstanceLabel->setText(UIWizardNewCloudVM::tr("&Machines:"));728 m_pAccountImageLabel->setText(UIWizardNewCloudVM::tr("&Images:")); 739 729 740 730 /* Adjust label widths: */ 741 731 QList<QWidget*> labels; 742 labels << m_p SourceLabel;732 labels << m_pDestinationLabel; 743 733 labels << m_pAccountLabel; 744 labels << m_pAccountI nstanceLabel;734 labels << m_pAccountImageLabel; 745 735 int iMaxWidth = 0; 746 736 foreach (QWidget *pLabel, labels) 747 737 iMaxWidth = qMax(iMaxWidth, pLabel->minimumSizeHint().width()); 748 m_p SourceLayout->setColumnMinimumWidth(0, iMaxWidth);738 m_pDestinationLayout->setColumnMinimumWidth(0, iMaxWidth); 749 739 m_pCloudContainerLayout->setColumnMinimumWidth(0, iMaxWidth); 750 740 751 741 /* Update tool-tips: */ 752 update SourceComboToolTip();742 updateDestinationComboToolTip(); 753 743 updateAccountPropertyTableToolTips(); 754 744 } … … 759 749 if (!m_fPolished) 760 750 { 761 QMetaObject::invokeMethod(this, "sltHandle SourceChange", Qt::QueuedConnection);751 QMetaObject::invokeMethod(this, "sltHandleDestinationChange", Qt::QueuedConnection); 762 752 m_fPolished = true; 763 753 } … … 773 763 774 764 /* Check cloud settings: */ 775 fResult = !m_comCloudProfile.isNull() 776 && !m_comCloudClient.isNull() 777 && !machineId().isNull(); 765 fResult = client().isNotNull() 766 && !imageId().isNull(); 778 767 779 768 /* Return result: */ … … 786 775 bool fResult = true; 787 776 788 /* Create appliance & populateform properties: */777 /* Populate vsd and form properties: */ 789 778 populateFormProperties(); 790 779 /* And make sure they are not NULL: */ 791 fResult = m_comAppliance.isNotNull()792 && m_comVSDForm.isNotNull();780 fResult = vsd().isNotNull() 781 && vsdForm().isNotNull(); 793 782 794 783 /* Return result: */ … … 796 785 } 797 786 798 void UIWizardNewCloudVMPageBasic1::sltHandle SourceChange()787 void UIWizardNewCloudVMPageBasic1::sltHandleDestinationChange() 799 788 { 800 789 /* Update tool-tip: */ 801 update SourceComboToolTip();790 updateDestinationComboToolTip(); 802 791 803 792 /* Refresh required settings: */ 804 793 populateAccounts(); 805 794 populateAccountProperties(); 806 populateAccountI nstances();795 populateAccountImages(); 807 796 emit completeChanged(); 808 797 } … … 812 801 /* Refresh required settings: */ 813 802 populateAccountProperties(); 814 populateAccountI nstances();803 populateAccountImages(); 815 804 emit completeChanged(); 816 805 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.h
r79247 r79256 27 27 /* COM includes: */ 28 28 #include "COMEnums.h" 29 #include "CAppliance.h"30 29 #include "CCloudClient.h" 31 30 #include "CCloudProfile.h" 32 31 #include "CCloudProvider.h" 33 32 #include "CCloudProviderManager.h" 33 #include "CVirtualSystemDescription.h" 34 34 #include "CVirtualSystemDescriptionForm.h" 35 35 … … 43 43 class QIToolButton; 44 44 45 /** Sourcecombo data fields. */45 /** Destination combo data fields. */ 46 46 enum 47 47 { 48 SourceData_ID = Qt::UserRole + 1, 49 SourceData_Name = Qt::UserRole + 2, 50 SourceData_ShortName = Qt::UserRole + 3, 51 SourceData_IsItCloudFormat = Qt::UserRole + 4 48 DestinationData_ID = Qt::UserRole + 1, 49 DestinationData_Name = Qt::UserRole + 2, 50 DestinationData_ShortName = Qt::UserRole + 3 52 51 }; 53 52 … … 58 57 }; 59 58 60 /** UIWizardPageBase extension for 1st page of the Import Appliancewizard. */59 /** UIWizardPageBase extension for 1st page of the New Cloud VM wizard. */ 61 60 class UIWizardNewCloudVMPage1 : public UIWizardPageBase 62 61 { … … 64 63 65 64 /** Constructs 1st page base. */ 66 UIWizardNewCloudVMPage1( bool fImportFromOCIByDefault);65 UIWizardNewCloudVMPage1(); 67 66 68 /** Populates sources. */69 void populate Sources();67 /** Populates destinations. */ 68 void populateDestinations(); 70 69 /** Populates accounts. */ 71 70 void populateAccounts(); 72 71 /** Populates account properties. */ 73 72 void populateAccountProperties(); 74 /** Populates account i nstances. */75 void populateAccountI nstances();73 /** Populates account images. */ 74 void populateAccountImages(); 76 75 /** Populates form properties. */ 77 76 void populateFormProperties(); 78 77 79 /** Updates sourcecombo tool-tips. */80 void update SourceComboToolTip();78 /** Updates destination combo tool-tips. */ 79 void updateDestinationComboToolTip(); 81 80 /** Updates account property table tool-tips. */ 82 81 void updateAccountPropertyTableToolTips(); … … 84 83 void adjustAccountPropertyTable(); 85 84 86 /** Defines @a strSource. */ 87 void setSource(const QString &strSource); 88 /** Returns source. */ 89 QString source() const; 85 /** Defines @a strDestination. */ 86 void setDestination(const QString &strDestination); 87 /** Returns destination. */ 88 QString destination() const; 89 /** Returns destination ID. */ 90 QUuid destinationId() const; 90 91 91 /** Returns source ID. */92 QUuid sourceId() const;93 92 /** Returns profile name. */ 94 93 QString profileName() const; 95 /** Returns machine ID. */96 QString machineId() const;97 /** Returns Cloud Profile object. */98 CCloud Profile profile() const;99 /** Returns Applianceobject. */100 C Appliance appliance() const;94 /** Returns image ID. */ 95 QString imageId() const; 96 /** Returns Cloud Client. */ 97 CCloudClient client() const; 98 /** Returns Virtual System Description object. */ 99 CVirtualSystemDescription vsd() const; 101 100 /** Returns Virtual System Description Form object. */ 102 101 CVirtualSystemDescriptionForm vsdForm() const; 103 102 104 /** Holds whether default source should be Import from OCI. */105 bool m_fImportFromOCIByDefault;106 103 /** Holds whether starting page was polished. */ 107 104 bool m_fPolished; … … 115 112 /** Holds the Cloud Client object reference. */ 116 113 CCloudClient m_comCloudClient; 117 /** Holds the Applianceobject reference. */118 C Appliance m_comAppliance;114 /** Holds the Virtual System Description object reference. */ 115 CVirtualSystemDescription m_comVSD; 119 116 /** Holds the Virtual System Description Form object reference. */ 120 117 CVirtualSystemDescriptionForm m_comVSDForm; 121 118 122 /** Holds the sourcelayout instance. */123 QGridLayout *m_p SourceLayout;124 /** Holds the sourcetype label instance. */125 QLabel *m_p SourceLabel;126 /** Holds the sourcetype combo-box instance. */127 QIComboBox *m_p SourceComboBox;119 /** Holds the destination layout instance. */ 120 QGridLayout *m_pDestinationLayout; 121 /** Holds the destination type label instance. */ 122 QLabel *m_pDestinationLabel; 123 /** Holds the destination type combo-box instance. */ 124 QIComboBox *m_pDestinationComboBox; 128 125 129 126 /** Holds the cloud container layout instance. */ … … 137 134 /** Holds the account property table instance. */ 138 135 QTableWidget *m_pAccountPropertyTable; 139 /** Holds the account i nstance label instance. */140 QLabel *m_pAccountI nstanceLabel;141 /** Holds the account i nstance list instance. */142 QListWidget *m_pAccountI nstanceList;136 /** Holds the account image label instance. */ 137 QLabel *m_pAccountImageLabel; 138 /** Holds the account image list instance. */ 139 QListWidget *m_pAccountImageList; 143 140 }; 144 141 145 /** UIWizardPage extension for 1st page of the Import Appliancewizard, extends UIWizardNewCloudVMPage1 as well. */142 /** UIWizardPage extension for 1st page of the New Cloud VM wizard, extends UIWizardNewCloudVMPage1 as well. */ 146 143 class UIWizardNewCloudVMPageBasic1 : public UIWizardPage, public UIWizardNewCloudVMPage1 147 144 { 148 145 Q_OBJECT; 149 Q_PROPERTY(QString source READ source WRITE setSource); 150 Q_PROPERTY(CCloudProfile profile READ profile); 151 Q_PROPERTY(CAppliance appliance READ appliance); 146 Q_PROPERTY(CCloudClient client READ client); 147 Q_PROPERTY(CVirtualSystemDescription vsd READ vsd); 152 148 Q_PROPERTY(CVirtualSystemDescriptionForm vsdForm READ vsdForm); 153 Q_PROPERTY(QString machineId READ machineId);154 149 155 150 public: 156 151 157 152 /** Constructs 1st basic page. */ 158 UIWizardNewCloudVMPageBasic1( bool fImportFromOCIByDefault);153 UIWizardNewCloudVMPageBasic1(); 159 154 160 155 protected: … … 177 172 private slots: 178 173 179 /** Handles import source change. */180 void sltHandle SourceChange();174 /** Handles change in destination combo-box. */ 175 void sltHandleDestinationChange(); 181 176 182 177 /** Handles change in account combo-box. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic2.cpp
r79244 r79256 80 80 { 81 81 /* Translate page: */ 82 setTitle(UIWizardNewCloudVM::tr(" Appliance settings"));82 setTitle(UIWizardNewCloudVM::tr("Cloud Virtual Machine settings")); 83 83 84 84 /* Translate description label: */ 85 m_pLabel->setText(UIWizardNewCloudVM::tr("These are the the suggested settings of the cloud VM importprocedure, they are "86 "influencing the resulting localVM instance. You can change many of the "85 m_pLabel->setText(UIWizardNewCloudVM::tr("These are the the suggested settings of the cloud VM creation procedure, they are " 86 "influencing the resulting cloud VM instance. You can change many of the " 87 87 "properties shown by double-clicking on the items and disable others using the " 88 88 "check boxes below.")); … … 111 111 Assert(fResult); 112 112 113 /* Give changed VSD back to appliance: */113 /* Give changed VSD back: */ 114 114 if (fResult) 115 115 { … … 120 120 } 121 121 122 /* Try to import appliance: */122 /* Try to create cloud VM: */ 123 123 if (fResult) 124 fResult = qobject_cast<UIWizardNewCloudVM*>(wizard())-> importAppliance();124 fResult = qobject_cast<UIWizardNewCloudVM*>(wizard())->createCloudVM(); 125 125 126 126 /* Unlock finish button: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic2.h
r79244 r79256 29 29 class QIRichTextLabel; 30 30 31 /** UIWizardPageBase extension for 2nd page of the Import Appliancewizard. */31 /** UIWizardPageBase extension for 2nd page of the New Cloud VM wizard. */ 32 32 class UIWizardNewCloudVMPage2 : public UIWizardPageBase 33 33 { … … 44 44 }; 45 45 46 /** UIWizardPage extension for 2nd page of the Import Appliancewizard, extends UIWizardNewCloudVMPage2 as well. */46 /** UIWizardPage extension for 2nd page of the New Cloud VM wizard, extends UIWizardNewCloudVMPage2 as well. */ 47 47 class UIWizardNewCloudVMPageBasic2 : public UIWizardPage, public UIWizardNewCloudVMPage2 48 48 { … … 51 51 public: 52 52 53 /** Constructs 2nd basic page. 54 * @param strFileName Brings appliance file name. */ 53 /** Constructs 2nd basic page. */ 55 54 UIWizardNewCloudVMPageBasic2(); 56 55 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp
r79247 r79256 32 32 #include "UIWizardNewCloudVMPageExpert.h" 33 33 34 /* COM includes: */ 35 #include "CVirtualSystemDescription.h" 36 37 38 UIWizardNewCloudVMPageExpert::UIWizardNewCloudVMPageExpert(bool fImportFromOCIByDefault) 39 : UIWizardNewCloudVMPage1(fImportFromOCIByDefault) 40 , m_pCntSource(0) 34 35 UIWizardNewCloudVMPageExpert::UIWizardNewCloudVMPageExpert() 36 : m_pCntDestination(0) 41 37 , m_pSettingsCnt(0) 42 38 { … … 45 41 if (pMainLayout) 46 42 { 47 /* Create sourcecontainer: */48 m_pCnt Source= new QGroupBox(this);49 if (m_pCnt Source)43 /* Create destination container: */ 44 m_pCntDestination = new QGroupBox(this); 45 if (m_pCntDestination) 50 46 { 51 /* Create sourcelayout: */52 m_p SourceLayout = new QGridLayout(m_pCntSource);53 if (m_p SourceLayout)47 /* Create destination layout: */ 48 m_pDestinationLayout = new QGridLayout(m_pCntDestination); 49 if (m_pDestinationLayout) 54 50 { 55 /* Create sourceselector: */56 m_p SourceComboBox = new QIComboBox(m_pCntSource);57 if (m_p SourceComboBox)51 /* Create destination selector: */ 52 m_pDestinationComboBox = new QIComboBox(m_pCntDestination); 53 if (m_pDestinationComboBox) 58 54 { 59 55 /* Add into layout: */ 60 m_p SourceLayout->addWidget(m_pSourceComboBox, 0, 0);56 m_pDestinationLayout->addWidget(m_pDestinationComboBox, 0, 0); 61 57 } 62 58 … … 76 72 77 73 /* Create account combo-box: */ 78 m_pAccountComboBox = new QIComboBox(m_pCnt Source);74 m_pAccountComboBox = new QIComboBox(m_pCntDestination); 79 75 if (m_pAccountComboBox) 80 76 { … … 83 79 } 84 80 /* Create account tool-button: */ 85 m_pAccountToolButton = new QIToolButton(m_pCnt Source);81 m_pAccountToolButton = new QIToolButton(m_pCntDestination); 86 82 if (m_pAccountToolButton) 87 83 { … … 98 94 99 95 /* Create profile property table: */ 100 m_pAccountPropertyTable = new QTableWidget(m_pCnt Source);96 m_pAccountPropertyTable = new QTableWidget(m_pCntDestination); 101 97 if (m_pAccountPropertyTable) 102 98 { … … 118 114 119 115 /* Create profile instances table: */ 120 m_pAccountI nstanceList = new QListWidget(m_pCntSource);121 if (m_pAccountI nstanceList)116 m_pAccountImageList = new QListWidget(m_pCntDestination); 117 if (m_pAccountImageList) 122 118 { 123 const QFontMetrics fm(m_pAccountI nstanceList->font());119 const QFontMetrics fm(m_pAccountImageList->font()); 124 120 const int iFontWidth = fm.width('x'); 125 121 const int iTotalWidth = 50 * iFontWidth; 126 122 const int iFontHeight = fm.height(); 127 123 const int iTotalHeight = 4 * iFontHeight; 128 m_pAccountI nstanceList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));129 //m_pAccountI nstanceList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);130 m_pAccountI nstanceList->setAlternatingRowColors(true);124 m_pAccountImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight)); 125 //m_pAccountImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); 126 m_pAccountImageList->setAlternatingRowColors(true); 131 127 132 128 /* Add into layout: */ 133 m_pCloudContainerLayout->addWidget(m_pAccountI nstanceList, 2, 0);129 m_pCloudContainerLayout->addWidget(m_pAccountImageList, 2, 0); 134 130 } 135 131 136 132 /* Add into layout: */ 137 m_p SourceLayout->addLayout(m_pCloudContainerLayout, 1, 0);133 m_pDestinationLayout->addLayout(m_pCloudContainerLayout, 1, 0); 138 134 } 139 135 } 140 136 141 137 /* Add into layout: */ 142 pMainLayout->addWidget(m_pCnt Source);138 pMainLayout->addWidget(m_pCntDestination); 143 139 } 144 140 … … 165 161 } 166 162 167 /* Populate sources: */168 populate Sources();163 /* Populate destinations: */ 164 populateDestinations(); 169 165 170 166 /* Setup connections: */ 171 167 if (gpManager) 172 168 connect(gpManager, &UIVirtualBoxManager::sigCloudProfileManagerChange, 173 this, &UIWizardNewCloudVMPageExpert::sltHandle SourceChange);174 connect(m_p SourceComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),175 this, &UIWizardNewCloudVMPageExpert::sltHandle SourceChange);169 this, &UIWizardNewCloudVMPageExpert::sltHandleDestinationChange); 170 connect(m_pDestinationComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated), 171 this, &UIWizardNewCloudVMPageExpert::sltHandleDestinationChange); 176 172 connect(m_pAccountComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged), 177 173 this, &UIWizardNewCloudVMPageExpert::sltHandleAccountComboChange); 178 174 connect(m_pAccountToolButton, &QIToolButton::clicked, 179 175 this, &UIWizardNewCloudVMPageExpert::sltHandleAccountButtonClick); 180 connect(m_pAccountI nstanceList, &QListWidget::currentRowChanged,176 connect(m_pAccountImageList, &QListWidget::currentRowChanged, 181 177 this, &UIWizardNewCloudVMPageExpert::sltHandleInstanceListChange); 182 178 183 179 /* Register fields: */ 184 registerField("source", this, "source"); 185 registerField("profile", this, "profile"); 186 registerField("appliance", this, "appliance"); 180 registerField("client", this, "client"); 181 registerField("vsd", this, "vsd"); 187 182 registerField("vsdForm", this, "vsdForm"); 188 registerField("machineId", this, "machineId");189 183 } 190 184 … … 211 205 void UIWizardNewCloudVMPageExpert::retranslateUi() 212 206 { 213 /* Translate appliancecontainer: */214 m_pCnt Source->setTitle(UIWizardNewCloudVM::tr("Source"));215 216 /* Translate received values of Sourcecombo-box.207 /* Translate destination container: */ 208 m_pCntDestination->setTitle(UIWizardNewCloudVM::tr("Destination")); 209 210 /* Translate received values of Destination combo-box. 217 211 * We are enumerating starting from 0 for simplicity: */ 218 for (int i = 0; i < m_p SourceComboBox->count(); ++i)219 { 220 m_p SourceComboBox->setItemText(i, m_pSourceComboBox->itemData(i, SourceData_Name).toString());221 m_p SourceComboBox->setItemData(i, UIWizardNewCloudVM::tr("Import fromcloud service provider."), Qt::ToolTipRole);212 for (int i = 0; i < m_pDestinationComboBox->count(); ++i) 213 { 214 m_pDestinationComboBox->setItemText(i, m_pDestinationComboBox->itemData(i, DestinationData_Name).toString()); 215 m_pDestinationComboBox->setItemData(i, UIWizardNewCloudVM::tr("Create VM for cloud service provider."), Qt::ToolTipRole); 222 216 } 223 217 … … 226 220 227 221 /* Update tool-tips: */ 228 update SourceComboToolTip();222 updateDestinationComboToolTip(); 229 223 updateAccountPropertyTableToolTips(); 230 224 } … … 235 229 if (!m_fPolished) 236 230 { 237 QMetaObject::invokeMethod(this, "sltHandle SourceChange", Qt::QueuedConnection);231 QMetaObject::invokeMethod(this, "sltHandleDestinationChange", Qt::QueuedConnection); 238 232 m_fPolished = true; 239 233 } … … 249 243 250 244 /* Check cloud settings: */ 251 fResult = !m_comCloudProfile.isNull() 252 && !m_comCloudClient.isNull() 253 && !machineId().isNull() 254 && !m_comAppliance.isNull() 255 && !m_comVSDForm.isNull(); 245 fResult = client().isNotNull() 246 && !imageId().isNull() 247 && vsd().isNotNull() 248 && vsdForm().isNotNull(); 256 249 257 250 /* Return result: */ … … 272 265 Assert(fResult); 273 266 274 /* Give changed VSD back to appliance: */267 /* Give changed VSD back: */ 275 268 if (fResult) 276 269 { … … 281 274 } 282 275 283 /* Try to import appliance: */276 /* Try to create cloud VM: */ 284 277 if (fResult) 285 fResult = qobject_cast<UIWizardNewCloudVM*>(wizard())-> importAppliance();278 fResult = qobject_cast<UIWizardNewCloudVM*>(wizard())->createCloudVM(); 286 279 287 280 /* Unlock finish button: */ … … 292 285 } 293 286 294 void UIWizardNewCloudVMPageExpert::sltHandle SourceChange()287 void UIWizardNewCloudVMPageExpert::sltHandleDestinationChange() 295 288 { 296 289 /* Update tool-tip: */ 297 update SourceComboToolTip();290 updateDestinationComboToolTip(); 298 291 299 292 /* Refresh required settings: */ 300 293 populateAccounts(); 301 294 populateAccountProperties(); 302 populateAccountI nstances();295 populateAccountImages(); 303 296 populateFormProperties(); 304 297 refreshFormPropertiesTable(); … … 310 303 /* Refresh required settings: */ 311 304 populateAccountProperties(); 312 populateAccountI nstances();305 populateAccountImages(); 313 306 populateFormProperties(); 314 307 refreshFormPropertiesTable(); … … 325 318 void UIWizardNewCloudVMPageExpert::sltHandleInstanceListChange() 326 319 { 320 /* Refresh required settings: */ 327 321 populateFormProperties(); 328 322 refreshFormPropertiesTable(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.h
r79244 r79256 35 35 { 36 36 Q_OBJECT; 37 Q_PROPERTY(QString source READ source WRITE setSource); 38 Q_PROPERTY(CCloudProfile profile READ profile); 39 Q_PROPERTY(CAppliance appliance READ appliance); 37 Q_PROPERTY(CCloudClient client READ client); 38 Q_PROPERTY(CVirtualSystemDescription vsd READ vsd); 40 39 Q_PROPERTY(CVirtualSystemDescriptionForm vsdForm READ vsdForm); 41 Q_PROPERTY(QString machineId READ machineId);42 40 43 41 public: 44 42 45 /** Constructs expert page. 46 * @param strFileName Brings appliance file name. */ 47 UIWizardNewCloudVMPageExpert(bool fImportFromOCIByDefault); 43 /** Constructs expert page. */ 44 UIWizardNewCloudVMPageExpert(); 48 45 49 46 protected: … … 69 66 private slots: 70 67 71 /** Handles import source change. */72 void sltHandle SourceChange();68 /** Handles change in destination combo-box. */ 69 void sltHandleDestinationChange(); 73 70 74 71 /** Handles change in account combo-box. */ … … 82 79 private: 83 80 84 /** Holds the sourcecontainer instance. */85 QGroupBox *m_pCnt Source;81 /** Holds the destination container instance. */ 82 QGroupBox *m_pCntDestination; 86 83 /** Holds the settings container instance. */ 87 84 QGroupBox *m_pSettingsCnt;
Note:
See TracChangeset
for help on using the changeset viewer.