Changeset 86573 in vbox
- Timestamp:
- Oct 14, 2020 12:06:06 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 140927
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r86341 r86573 2576 2576 } 2577 2577 2578 void UICommon::notifyCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName, 2579 const QUuid &uId, const bool fRegistered) 2580 { 2581 emit sigCloudMachineRegistered(strProviderShortName, strProfileName, uId, fRegistered); 2578 void UICommon::notifyCloudMachineRegistered(const QString &strProviderShortName, 2579 const QString &strProfileName, 2580 const CCloudMachine &comCloudMachine) 2581 { 2582 emit sigCloudMachineRegistered(strProviderShortName, strProfileName, comCloudMachine, true /* select */); 2583 } 2584 2585 void UICommon::notifyCloudMachineRegistrationChanged(const QString &strProviderShortName, 2586 const QString &strProfileName, 2587 const QUuid &uId, 2588 const bool fRegistered) 2589 { 2590 emit sigCloudMachineRegistrationChanged(strProviderShortName, strProfileName, uId, fRegistered); 2582 2591 } 2583 2592 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r84847 r86573 86 86 /** @} */ 87 87 88 /** @name Temporary: Cloud Virtual Machine stuff. 89 * @{ */ 90 /** Notifies listeners about cloud VM was (un)registered. 91 * @note This is to be replaced by corresponding Main API event later. 88 /** @name Cloud Virtual Machine stuff. 89 * @{ */ 90 /** Notifies listeners about cloud VM was registered. 91 * @param strProviderShortName Brings provider short name. 92 * @param strProfileName Brings profile name. 93 * @param comCloudMachine Brings cloud VM. 94 * @param fSelect Brings whether registered VM should be selected. */ 95 void sigCloudMachineRegistered(const QString &strProviderShortName, 96 const QString &strProfileName, 97 const CCloudMachine &comCloudMachine, 98 const bool fSelect); 99 /** Notifies listeners about cloud VM registeration changed. 92 100 * @param strProviderShortName Brings provider short name. 93 101 * @param strProfileName Brings profile name. 94 102 * @param uId Brings cloud VM id. 95 103 * @param fRegistered True is machine was registered, false otherwise. */ 96 void sigCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName, 97 const QUuid &uId, const bool fRegistered); 104 void sigCloudMachineRegistrationChanged(const QString &strProviderShortName, 105 const QString &strProfileName, 106 const QUuid &uId, 107 const bool fRegistered); 98 108 /** @} */ 99 109 … … 500 510 /** @} */ 501 511 502 /** @name Temporary: Cloud Virtual Machine stuff. 503 * @{ */ 504 /** Notifies listeners about cloud VM was (un)registered. 505 * @note This is to be replaced by corresponding Main API event later. 512 /** @name Cloud Virtual Machine stuff. 513 * @{ */ 514 /** Notifies listeners about cloud VM was registered. 515 * @param strProviderShortName Brings provider short name. 516 * @param strProfileName Brings profile name. 517 * @param comCloudMachine Brings cloud VM. */ 518 void notifyCloudMachineRegistered(const QString &strProviderShortName, 519 const QString &strProfileName, 520 const CCloudMachine &comCloudMachine); 521 /** Notifies listeners about cloud VM registeration changed. 506 522 * @param strProviderShortName Brings provider short name. 507 523 * @param strProfileName Brings profile name. 508 524 * @param uId Brings cloud VM id. 509 525 * @param fRegistered True is machine was registered, false otherwise. */ 510 void notifyCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName, 511 const QUuid &uId, const bool fRegistered); 526 void notifyCloudMachineRegistrationChanged(const QString &strProviderShortName, 527 const QString &strProfileName, 528 const QUuid &uId, 529 const bool fRegistered); 512 530 /** @} */ 513 531 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r86572 r86573 636 636 } 637 637 638 void UIChooserAbstractModel::sltCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName, 639 const CCloudMachine &comMachine, bool fSelect) 640 { 641 /* Search for profile node: */ 642 const QString strProfileNodeName = QString("/%1/%2").arg(strProviderShortName, strProfileName); 643 QList<UIChooserNode*> profileNodes; 644 invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes); 645 AssertReturnVoid(!profileNodes.isEmpty()); 646 UIChooserNode *pProfileNode = profileNodes.first(); 647 AssertPtrReturnVoid(pProfileNode); 648 649 /* Add new machine-item: */ 650 addCloudMachineIntoTheTree(strProfileNodeName, comMachine, fSelect); 651 652 /* Search for possible fake node: */ 653 QList<UIChooserNode*> fakeNodes; 654 pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes); 655 /* Delete fake node if present: */ 656 delete fakeNodes.value(0); 657 } 658 638 659 void UIChooserAbstractModel::sltCloudMachineRegistrationChanged(const QString &strProviderShortName, const QString &strProfileName, 639 660 const QUuid &uMachineId, const bool fRegistered) … … 797 818 connect(uiCommon().threadPoolCloud(), &UIThreadPool::sigTaskComplete, 798 819 this, &UIChooserAbstractModel::sltHandleCloudListMachinesTaskComplete); 799 /* Setup temporary connections, 800 * this is to be replaced by corresponding Main API event later.*/820 821 /* Cloud VM registration connections: */ 801 822 connect(&uiCommon(), &UICommon::sigCloudMachineRegistered, 823 this, &UIChooserAbstractModel::sltCloudMachineRegistered); 824 connect(&uiCommon(), &UICommon::sigCloudMachineRegistrationChanged, 802 825 this, &UIChooserAbstractModel::sltCloudMachineRegistrationChanged); 803 826 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
r86572 r86573 145 145 /** Handles local machine registering/unregistering for machine with certain @a uMachineId. */ 146 146 virtual void sltLocalMachineRegistrationChanged(const QUuid &uMachineId, const bool fRegistered); 147 /** Handles cloud machine registering for @a comMachine. 148 * @param strProviderShortName Brings provider short name. 149 * @param strProfileName Brings profile name. 150 * @param fSelect Brings whether registered machine should be selected. */ 151 virtual void sltCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName, 152 const CCloudMachine &comMachine, bool fSelect); 147 153 /** Handles cloud machine registering/unregistering for machine with certain @a uMachineId. 148 154 * @param strProviderShortName Brings provider short name. -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r86572 r86573 40 40 #include "UIChooserNodeMachine.h" 41 41 #include "UIChooserView.h" 42 #include "UICloudNetworkingStuff.h" 42 43 #include "UIExtraDataManager.h" 43 44 #include "UIMessageCenter.h" … … 1107 1108 UIChooserItemSearchFlag_ExactId)); 1108 1109 } 1110 } 1111 } 1112 1113 void UIChooserModel::sltCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName, 1114 const CCloudMachine &comMachine, bool fSelect) 1115 { 1116 /* Call to base-class: */ 1117 UIChooserAbstractModel::sltCloudMachineRegistered(strProviderShortName, strProfileName, comMachine, fSelect); 1118 1119 /* Rebuild tree for main root: */ 1120 buildTreeForMainRoot(false /* preserve selection */); 1121 1122 /* Select newly added item: */ 1123 if (fSelect) 1124 { 1125 QUuid uMachineId; 1126 if (cloudMachineId(comMachine, uMachineId)) 1127 setSelectedItem(root()->searchForItem(uMachineId.toString(), 1128 UIChooserItemSearchFlag_Machine | 1129 UIChooserItemSearchFlag_ExactId)); 1109 1130 } 1110 1131 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r86572 r86573 263 263 /** Handles local machine registering/unregistering for machine with certain @a uMachineId. */ 264 264 virtual void sltLocalMachineRegistrationChanged(const QUuid &uMachineId, const bool fRegistered) /* override */; 265 /** Handles cloud machine registering for @a comMachine. 266 * @param strProviderShortName Brings provider short name. 267 * @param strProfileName Brings profile name. 268 * @param fSelect Brings whether registered machine should be selected. */ 269 virtual void sltCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName, 270 const CCloudMachine &comMachine, bool fSelect); 265 271 /** Handles cloud machine registering/unregistering for machine with certain @a uMachineId. 266 272 * @param strProviderShortName Brings provider short name. -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVM.cpp
r86345 r86573 111 111 uiCommon().notifyCloudMachineRegistered(field("source").toString(), 112 112 field("profileName").toString(), 113 comMachine.GetId(), 114 true /* registered */); 113 comMachine); 115 114 fResult = true; 116 115 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.cpp
r86345 r86573 165 165 uiCommon().notifyCloudMachineRegistered(field("location").toString(), 166 166 field("profileName").toString(), 167 comMachine.GetId(), 168 true /* registered */); 167 comMachine); 169 168 170 169 /* Finally, success: */
Note:
See TracChangeset
for help on using the changeset viewer.