Changeset 85038 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 1, 2020 6:37:27 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r85037 r85038 724 724 QList<UIChooserNode*> profileNodes; 725 725 invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes); 726 AssertReturnVoid(!profileNodes.isEmpty());727 UIChooserNode *pProfileNode = profileNodes.first();728 AssertPtrReturnVoid(pProfileNode);726 UIChooserNode *pProfileNode = profileNodes.value(0); 727 if (!pProfileNode) 728 return; 729 729 730 730 /* Search for fake node: */ … … 732 732 pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes); 733 733 UIChooserNode *pFakeNode = fakeNodes.value(0); 734 AssertPtrReturnVoid(pFakeNode); 734 if (!pFakeNode) 735 return; 735 736 736 737 /* And if we have at least one cloud machine: */ … … 755 756 pFakeCloudMachineItem->setFakeCloudItemErrorMessage(pAcquiringTask->errorInfo()); 756 757 } 758 } 759 760 void UIChooserAbstractModel::sltHandleCloudProfileManagerRestrictionChange() 761 { 762 /* Reload cloud tree: */ 763 reloadCloudTree(); 757 764 } 758 765 … … 796 803 this, &UIChooserAbstractModel::sltStartGroupSaving, 797 804 Qt::QueuedConnection); 805 806 /* Setup extra-data connections: */ 807 connect(gEDataManager, &UIExtraDataManager::sigCloudProfileManagerRestrictionChange, 808 this, &UIChooserAbstractModel::sltHandleCloudProfileManagerRestrictionChange); 798 809 } 799 810 … … 848 859 #ifdef VBOX_GUI_WITH_CLOUD_VMS 849 860 LogRelFlow(("UIChooserAbstractModel: Loading cloud providers/profiles...\n")); 861 862 /* Wipe out existing cloud providers first. 863 * This is quite rude, in future we need to reimplement it more wise.. */ 864 foreach (UIChooserNode *pNode, invisibleRoot()->nodes(UIChooserNodeType_Group)) 865 { 866 AssertPtrReturnVoid(pNode); 867 UIChooserNodeGroup *pGroupNode = pNode->toGroupNode(); 868 AssertPtrReturnVoid(pGroupNode); 869 if (pGroupNode->groupType() == UIChooserNodeGroupType_Provider) 870 delete pNode; 871 } 850 872 851 873 /* Acquire Cloud Profile Manager restrictions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
r85036 r85038 166 166 /** Handles list cloud machines task complete signal. */ 167 167 virtual void sltHandleCloudListMachinesTaskComplete(UITask *pTask); 168 /** Handles Cloud Profile Manager restriction change. */ 169 virtual void sltHandleCloudProfileManagerRestrictionChange(); 168 170 /** @} */ 169 171 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r84635 r85038 1157 1157 1158 1158 /* Rebuild tree for main root: */ 1159 buildTreeForMainRoot(true /* preserve selection */); 1160 } 1161 1162 void UIChooserModel::sltHandleCloudProfileManagerRestrictionChange() 1163 { 1164 /* Call to base-class: */ 1165 UIChooserAbstractModel::sltHandleCloudProfileManagerRestrictionChange(); 1166 1167 /* Build tree for main root: */ 1159 1168 buildTreeForMainRoot(true /* preserve selection */); 1160 1169 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r84635 r85038 278 278 /** Handles list cloud machines task complete signal. */ 279 279 virtual void sltHandleCloudListMachinesTaskComplete(UITask *pTask) /* override */; 280 /** Handles Cloud Profile Manager restriction changes. */ 281 virtual void sltHandleCloudProfileManagerRestrictionChange() /* override */; 280 282 /** @} */ 281 283
Note:
See TracChangeset
for help on using the changeset viewer.