- Timestamp:
- Oct 16, 2020 2:19:08 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r86607 r86608 2576 2576 } 2577 2577 2578 void UICommon::notifyCloudMachineUnregistered(const QString &strProviderShortName, 2579 const QString &strProfileName, 2580 const QUuid &uId) 2581 { 2582 emit sigCloudMachineUnregistered(strProviderShortName, strProfileName, uId); 2583 } 2584 2578 2585 void UICommon::notifyCloudMachineRegistered(const QString &strProviderShortName, 2579 2586 const QString &strProfileName, … … 2581 2588 { 2582 2589 emit sigCloudMachineRegistered(strProviderShortName, strProfileName, comMachine); 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);2591 2590 } 2592 2591 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r86607 r86608 88 88 /** @name Cloud Virtual Machine stuff. 89 89 * @{ */ 90 /** Notifies listeners about cloud VM was unregistered. 91 * @param strProviderShortName Brings provider short name. 92 * @param strProfileName Brings profile name. 93 * @param uId Brings cloud VM id. */ 94 void sigCloudMachineUnregistered(const QString &strProviderShortName, 95 const QString &strProfileName, 96 const QUuid &uId); 90 97 /** Notifies listeners about cloud VM was registered. 91 98 * @param strProviderShortName Brings provider short name. … … 95 102 const QString &strProfileName, 96 103 const CCloudMachine &comMachine); 97 /** Notifies listeners about cloud VM registeration changed.98 * @param strProviderShortName Brings provider short name.99 * @param strProfileName Brings profile name.100 * @param uId Brings cloud VM id.101 * @param fRegistered True is machine was registered, false otherwise. */102 void sigCloudMachineRegistrationChanged(const QString &strProviderShortName,103 const QString &strProfileName,104 const QUuid &uId,105 const bool fRegistered);106 104 /** @} */ 107 105 … … 510 508 /** @name Cloud Virtual Machine stuff. 511 509 * @{ */ 510 /** Notifies listeners about cloud VM was unregistered. 511 * @param strProviderShortName Brings provider short name. 512 * @param strProfileName Brings profile name. 513 * @param uId Brings cloud VM id. */ 514 void notifyCloudMachineUnregistered(const QString &strProviderShortName, 515 const QString &strProfileName, 516 const QUuid &uId); 512 517 /** Notifies listeners about cloud VM was registered. 513 518 * @param strProviderShortName Brings provider short name. … … 517 522 const QString &strProfileName, 518 523 const CCloudMachine &comMachine); 519 /** Notifies listeners about cloud VM registeration changed.520 * @param strProviderShortName Brings provider short name.521 * @param strProfileName Brings profile name.522 * @param uId Brings cloud VM id.523 * @param fRegistered True is machine was registered, false otherwise. */524 void notifyCloudMachineRegistrationChanged(const QString &strProviderShortName,525 const QString &strProfileName,526 const QUuid &uId,527 const bool fRegistered);528 524 /** @} */ 529 525 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r86607 r86608 691 691 } 692 692 693 void UIChooserAbstractModel::sltCloudMachine Registered(const QString &strProviderShortName,694 const QString &strProfileName,695 const CCloudMachine &comMachine)693 void UIChooserAbstractModel::sltCloudMachineUnregistered(const QString &strProviderShortName, 694 const QString &strProfileName, 695 const QUuid &uId) 696 696 { 697 697 /* Search for profile node: */ … … 703 703 return; 704 704 705 /* Add new machine-item: */ 706 addCloudMachineIntoTheTree(strProfileNodeName, comMachine, true /* make it visible? */); 707 708 /* Search for possible fake node: */ 709 QList<UIChooserNode*> fakeNodes; 710 pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes); 711 /* Delete fake node if present: */ 712 delete fakeNodes.value(0); 713 } 714 715 void UIChooserAbstractModel::sltCloudMachineRegistrationChanged(const QString &strProviderShortName, 716 const QString &strProfileName, 717 const QUuid &uMachineId, 718 const bool fRegistered) 705 /* Remove machine-item with passed uId: */ 706 pProfileNode->removeAllNodes(uId); 707 708 /* If there are no items left => add fake cloud VM node: */ 709 if (pProfileNode->nodes(UIChooserNodeType_Machine).isEmpty()) 710 new UIChooserNodeMachine(pProfileNode /* parent */, 711 0 /* position */, 712 UIFakeCloudVirtualMachineItemState_Done); 713 } 714 715 void UIChooserAbstractModel::sltCloudMachineRegistered(const QString &strProviderShortName, 716 const QString &strProfileName, 717 const CCloudMachine &comMachine) 719 718 { 720 719 /* Search for profile node: */ … … 726 725 return; 727 726 728 /* Existing VM unregistered? */ 729 if (!fRegistered) 730 { 731 /* Remove machine-items with passed id: */ 732 pProfileNode->removeAllNodes(uMachineId); 733 734 /* If there are no items left: */ 735 if (pProfileNode->nodes(UIChooserNodeType_Machine).isEmpty()) 736 { 737 /* Add fake cloud VM item: */ 738 new UIChooserNodeMachine(pProfileNode /* parent */, 739 0 /* position */, 740 UIFakeCloudVirtualMachineItemState_Done); 741 } 742 } 743 /* New VM registered? */ 744 else 745 { 746 /* Add new machine-item: */ 747 const CCloudMachine comMachine = cloudMachineById(strProviderShortName, strProfileName, uMachineId); 748 addCloudMachineIntoTheTree(strProfileNodeName, comMachine, true /* make it visible */); 749 750 /* Search for possible fake node: */ 751 QList<UIChooserNode*> fakeNodes; 752 pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes); 753 /* Delete fake node if present: */ 754 delete fakeNodes.value(0); 755 } 727 /* Add new machine-item: */ 728 addCloudMachineIntoTheTree(strProfileNodeName, comMachine, true /* make it visible? */); 729 730 /* Search for possible fake node: */ 731 QList<UIChooserNode*> fakeNodes; 732 pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes); 733 /* Delete fake node if present: */ 734 delete fakeNodes.value(0); 756 735 } 757 736 … … 821 800 822 801 /* Cloud VM registration connections: */ 802 connect(&uiCommon(), &UICommon::sigCloudMachineUnregistered, 803 this, &UIChooserAbstractModel::sltCloudMachineUnregistered); 823 804 connect(&uiCommon(), &UICommon::sigCloudMachineRegistered, 824 805 this, &UIChooserAbstractModel::sltCloudMachineRegistered); 825 connect(&uiCommon(), &UICommon::sigCloudMachineRegistrationChanged,826 this, &UIChooserAbstractModel::sltCloudMachineRegistrationChanged);827 806 828 807 /* Setup global connections: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
r86607 r86608 22 22 #endif 23 23 24 /* Qt includes: */ 25 #include <QUuid> 26 24 27 /* GUI includes: */ 25 28 #include "UIChooserDefs.h" … … 29 32 30 33 /* Forward declaration: */ 31 class QUuid;32 34 class UIChooser; 33 35 class UIChooserNode; … … 164 166 /** @name Cloud stuff. 165 167 * @{ */ 168 /** Handles cloud machine unregistering for @a uId. 169 * @param strProviderShortName Brings provider short name. 170 * @param strProfileName Brings profile name. */ 171 virtual void sltCloudMachineUnregistered(const QString &strProviderShortName, 172 const QString &strProfileName, 173 const QUuid &uId); 166 174 /** Handles cloud machine registering for @a comMachine. 167 175 * @param strProviderShortName Brings provider short name. … … 170 178 const QString &strProfileName, 171 179 const CCloudMachine &comMachine); 172 /** Handles cloud machine registering/unregistering for machine with certain @a uMachineId.173 * @param strProviderShortName Brings provider short name.174 * @param strProfileName Brings profile name. */175 virtual void sltCloudMachineRegistrationChanged(const QString &strProviderShortName,176 const QString &strProfileName,177 const QUuid &uMachineId,178 const bool fRegistered);179 180 180 181 /** Handles list cloud machines task complete signal. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r86607 r86608 1154 1154 } 1155 1155 1156 void UIChooserModel::sltCloudMachineUnregistered(const QString &strProviderShortName, 1157 const QString &strProfileName, 1158 const QUuid &uId) 1159 { 1160 /* Make sure no item with passed uId is selected: */ 1161 makeSureNoItemWithCertainIdSelected(uId); 1162 1163 /* Call to base-class: */ 1164 UIChooserAbstractModel::sltCloudMachineUnregistered(strProviderShortName, strProfileName, uId); 1165 1166 /* Rebuild tree for main root: */ 1167 buildTreeForMainRoot(true /* preserve selection */); 1168 } 1169 1156 1170 void UIChooserModel::sltCloudMachineRegistered(const QString &strProviderShortName, 1157 1171 const QString &strProfileName, … … 1170 1184 UIChooserItemSearchFlag_Machine | 1171 1185 UIChooserItemSearchFlag_ExactId)); 1172 }1173 1174 void UIChooserModel::sltCloudMachineRegistrationChanged(const QString &strProviderShortName,1175 const QString &strProfileName,1176 const QUuid &uMachineId,1177 const bool fRegistered)1178 {1179 /* Existing VM unregistered => make sure no item with passed uMachineId is selected: */1180 if (!fRegistered)1181 makeSureNoItemWithCertainIdSelected(uMachineId);1182 1183 /* Call to base-class: */1184 UIChooserAbstractModel::sltCloudMachineRegistrationChanged(strProviderShortName, strProfileName, uMachineId, fRegistered);1185 1186 /* Existing VM unregistered? */1187 if (!fRegistered)1188 {1189 /* Rebuild tree for main root: */1190 buildTreeForMainRoot(true /* preserve selection */);1191 }1192 /* New VM registered? */1193 else1194 {1195 /* Rebuild tree for main root: */1196 buildTreeForMainRoot(false /* preserve selection */);1197 /* Select newly added item: */1198 setSelectedItem(root()->searchForItem(uMachineId.toString(),1199 UIChooserItemSearchFlag_Machine |1200 UIChooserItemSearchFlag_ExactId));1201 }1202 1186 } 1203 1187 … … 1803 1787 const QString strProviderShortName = pItem->parentItem()->parentItem()->name(); 1804 1788 const QString strProfileName = pItem->parentItem()->name(); 1805 sltCloudMachineRegistrationChanged(strProviderShortName, 1806 strProfileName, 1807 uId /* machine ID */, 1808 false /* registered? */); 1789 sltCloudMachineUnregistered(strProviderShortName, 1790 strProfileName, 1791 uId /* machine ID */); 1809 1792 } 1810 1793 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r86607 r86608 276 276 /** @name Cloud stuff. 277 277 * @{ */ 278 /** Handles cloud machine unregistering for @a uId. 279 * @param strProviderShortName Brings provider short name. 280 * @param strProfileName Brings profile name. */ 281 virtual void sltCloudMachineUnregistered(const QString &strProviderShortName, 282 const QString &strProfileName, 283 const QUuid &uId) /* override */; 278 284 /** Handles cloud machine registering for @a comMachine. 279 285 * @param strProviderShortName Brings provider short name. 280 * @param strProfileName Brings profile name. 281 * @param fSelect Brings whether registered machine should be selected. */ 286 * @param strProfileName Brings profile name. */ 282 287 virtual void sltCloudMachineRegistered(const QString &strProviderShortName, 283 288 const QString &strProfileName, 284 289 const CCloudMachine &comMachine) /* override */; 285 /** Handles cloud machine registering/unregistering for machine with certain @a uMachineId.286 * @param strProviderShortName Brings provider short name.287 * @param strProfileName Brings profile name. */288 virtual void sltCloudMachineRegistrationChanged(const QString &strProviderShortName,289 const QString &strProfileName,290 const QUuid &uMachineId,291 const bool fRegistered) /* override */;292 290 293 291 /** Handles list cloud machines task complete signal. */
Note:
See TracChangeset
for help on using the changeset viewer.