Changeset 86786 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 2, 2020 5:54:03 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r86783 r86786 629 629 UIChooserNode *pMachineNode = searchMachineNode(invisibleRoot(), uId); 630 630 631 /* Insert cloud entitykey into a list of keys currently being updated: */632 const UICloudEntityKey cloudEntityKey = UICloudEntityKey(pMachineNode->parentNode()->parentNode()->name(),633 pMachineNode->parentNode()->name(),634 pMachineNode->toMachineNode()->id());635 insertCloudEntityKey( cloudEntityKey);631 /* Insert cloud machine key into a list of keys currently being updated: */ 632 const UICloudEntityKey guiCloudMachineKey = UICloudEntityKey(pMachineNode->parentNode()->parentNode()->name(), 633 pMachineNode->parentNode()->name(), 634 pMachineNode->toMachineNode()->id()); 635 insertCloudEntityKey(guiCloudMachineKey); 636 636 } 637 637 … … 648 648 UIChooserNode *pMachineNode = searchMachineNode(invisibleRoot(), uId); 649 649 650 /* Remove cloud entitykey from the list of keys currently being updated: */651 const UICloudEntityKey cloudEntityKey = UICloudEntityKey(pMachineNode->parentNode()->parentNode()->name(),652 pMachineNode->parentNode()->name(),653 pMachineNode->toMachineNode()->id());654 removeCloudEntityKey( cloudEntityKey);650 /* Remove cloud machine key from the list of keys currently being updated: */ 651 const UICloudEntityKey guiCloudMachineKey = UICloudEntityKey(pMachineNode->parentNode()->parentNode()->name(), 652 pMachineNode->parentNode()->name(), 653 pMachineNode->toMachineNode()->id()); 654 removeCloudEntityKey(guiCloudMachineKey); 655 655 656 656 /* Notify listeners: */ … … 755 755 addLocalMachineIntoTheTree(comMachine, true /* make it visible */); 756 756 } 757 }758 759 void UIChooserAbstractModel::sltStartGroupSaving()760 {761 saveGroupSettings();762 saveGroupDefinitions();763 757 } 764 758 … … 911 905 912 906 /* Remove cloud entity key from the list of keys currently being updated: */ 913 const UICloudEntityKey cloudEntityKey = UICloudEntityKey(strProviderShortName, strProfileName);914 removeCloudEntityKey( cloudEntityKey);907 const UICloudEntityKey guiCloudEntityKey = UICloudEntityKey(strProviderShortName, strProfileName); 908 removeCloudEntityKey(guiCloudEntityKey); 915 909 } 916 910 … … 919 913 /* Reload cloud tree: */ 920 914 reloadCloudTree(); 915 } 916 917 void UIChooserAbstractModel::sltStartGroupSaving() 918 { 919 saveGroupSettings(); 920 saveGroupDefinitions(); 921 921 } 922 922 … … 1111 1111 createCloudMachineNode(pProfileNode, UIFakeCloudVirtualMachineItemState_Loading); 1112 1112 1113 /* Insert cloud entitykey into a list of keys currently being updated: */1114 const UICloudEntityKey cloudEntityKey = UICloudEntityKey(strProviderShortName, strProfileName);1115 insertCloudEntityKey( cloudEntityKey);1113 /* Insert cloud profile key into a list of keys currently being updated: */ 1114 const UICloudEntityKey guiCloudProfileKey = UICloudEntityKey(strProviderShortName, strProfileName); 1115 insertCloudEntityKey(guiCloudProfileKey); 1116 1116 1117 1117 /* Create list cloud machines task: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r86770 r86786 940 940 AssertPtrReturnVoid(pParentOfParent); 941 941 942 /* Insert cloud entitykey into a list of keys currently being updated: */943 const UICloudEntityKey cloudEntityKey = UICloudEntityKey(pParentOfParent->name(), pParent->name());944 insertCloudEntityKey( cloudEntityKey);942 /* Insert cloud profile key into a list of keys currently being updated: */ 943 const UICloudEntityKey guiCloudProfileKey = UICloudEntityKey(pParentOfParent->name(), pParent->name()); 944 insertCloudEntityKey(guiCloudProfileKey); 945 945 946 946 /* Create list cloud machines task: */ 947 UITaskCloudListMachines *pTask = new UITaskCloudListMachines( cloudEntityKey.m_strProviderShortName,948 cloudEntityKey.m_strProfileName,947 UITaskCloudListMachines *pTask = new UITaskCloudListMachines(guiCloudProfileKey.m_strProviderShortName, 948 guiCloudProfileKey.m_strProfileName, 949 949 true /* with refresh? */); 950 950 AssertPtrReturnVoid(pTask); … … 1303 1303 { 1304 1304 /* For every selected item: */ 1305 QSet<UICloudEntityKey> selectedCloud EntityKeys;1305 QSet<UICloudEntityKey> selectedCloudProfileKeys; 1306 1306 foreach (UIChooserItem *pSelectedItem, selectedItems()) 1307 1307 { 1308 /* Enumerate cloud entitykeys to update: */1308 /* Enumerate cloud profile keys to update: */ 1309 1309 switch (pSelectedItem->type()) 1310 1310 { … … 1321 1321 { 1322 1322 const QString strProfileName = pChildItem->name(); 1323 const UICloudEntityKey cloudEntityKey = UICloudEntityKey(strProviderShortName, strProfileName);1324 if (!selectedCloud EntityKeys.contains(cloudEntityKey))1325 selectedCloud EntityKeys.insert(cloudEntityKey);1323 const UICloudEntityKey guiCloudProfileKey = UICloudEntityKey(strProviderShortName, strProfileName); 1324 if (!selectedCloudProfileKeys.contains(guiCloudProfileKey)) 1325 selectedCloudProfileKeys.insert(guiCloudProfileKey); 1326 1326 } 1327 1327 break; … … 1331 1331 const QString strProviderShortName = pSelectedItem->parentItem()->name(); 1332 1332 const QString strProfileName = pSelectedItem->name(); 1333 const UICloudEntityKey cloudEntityKey = UICloudEntityKey(strProviderShortName, strProfileName);1334 if (!selectedCloud EntityKeys.contains(cloudEntityKey))1335 selectedCloud EntityKeys.insert(cloudEntityKey);1333 const UICloudEntityKey guiCloudProfileKey = UICloudEntityKey(strProviderShortName, strProfileName); 1334 if (!selectedCloudProfileKeys.contains(guiCloudProfileKey)) 1335 selectedCloudProfileKeys.insert(guiCloudProfileKey); 1336 1336 break; 1337 1337 } … … 1350 1350 const QString strProviderShortName = pMachineItem->parentItem()->parentItem()->name(); 1351 1351 const QString strProfileName = pMachineItem->parentItem()->name(); 1352 const UICloudEntityKey cloudEntityKey = UICloudEntityKey(strProviderShortName, strProfileName);1353 if (!selectedCloud EntityKeys.contains(cloudEntityKey))1354 selectedCloud EntityKeys.insert(cloudEntityKey);1352 const UICloudEntityKey guiCloudProfileKey = UICloudEntityKey(strProviderShortName, strProfileName); 1353 if (!selectedCloudProfileKeys.contains(guiCloudProfileKey)) 1354 selectedCloudProfileKeys.insert(guiCloudProfileKey); 1355 1355 } 1356 1356 break; … … 1359 1359 } 1360 1360 1361 /* Restart List Cloud Machines task for selected entitykeys: */1362 foreach (const UICloudEntityKey & cloudEntityKey, selectedCloudEntityKeys)1363 { 1364 /* Skip cloud entitykeys already being updated: */1365 if (containsCloudEntityKey( cloudEntityKey))1361 /* Restart List Cloud Machines task for selected profile keys: */ 1362 foreach (const UICloudEntityKey &guiCloudProfileKey, selectedCloudProfileKeys) 1363 { 1364 /* Skip cloud profile keys already being updated: */ 1365 if (containsCloudEntityKey(guiCloudProfileKey)) 1366 1366 continue; 1367 insertCloudEntityKey( cloudEntityKey);1367 insertCloudEntityKey(guiCloudProfileKey); 1368 1368 1369 1369 /* Create a task for particular cloud entity key: */ 1370 UITaskCloudListMachines *pTask = new UITaskCloudListMachines( cloudEntityKey.m_strProviderShortName,1371 cloudEntityKey.m_strProfileName,1370 UITaskCloudListMachines *pTask = new UITaskCloudListMachines(guiCloudProfileKey.m_strProviderShortName, 1371 guiCloudProfileKey.m_strProfileName, 1372 1372 false /* with refresh? */); 1373 1373 AssertPtrReturnVoid(pTask); … … 1958 1958 } 1959 1959 1960 /* Restart List Cloud Machines task for required entitykeys: */1961 foreach (const UICloudEntityKey & cloudEntityKey, changedCloudEntityKeys)1962 { 1963 /* Skip cloud entitykeys already being updated: */1964 if (containsCloudEntityKey( cloudEntityKey))1960 /* Restart List Cloud Machines task for required profile keys: */ 1961 foreach (const UICloudEntityKey &guiCloudProfileKey, changedCloudEntityKeys) 1962 { 1963 /* Skip cloud profile keys already being updated: */ 1964 if (containsCloudEntityKey(guiCloudProfileKey)) 1965 1965 continue; 1966 insertCloudEntityKey( cloudEntityKey);1966 insertCloudEntityKey(guiCloudProfileKey); 1967 1967 1968 1968 /* Create a task for particular cloud entity key: */ 1969 UITaskCloudListMachines *pTask = new UITaskCloudListMachines( cloudEntityKey.m_strProviderShortName,1970 cloudEntityKey.m_strProfileName,1969 UITaskCloudListMachines *pTask = new UITaskCloudListMachines(guiCloudProfileKey.m_strProviderShortName, 1970 guiCloudProfileKey.m_strProfileName, 1971 1971 false /* with refresh? */); 1972 1972 AssertPtrReturnVoid(pTask);
Note:
See TracChangeset
for help on using the changeset viewer.