Changeset 97605 in vbox for trunk/src/VBox
- Timestamp:
- Nov 18, 2022 10:25:20 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154649
- 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
r96407 r97605 726 726 addLocalMachineIntoTheTree(comMachine, true /* make it visible */); 727 727 } 728 } 729 } 730 731 void UIChooserAbstractModel::sltLocalMachineGroupsChanged(const QUuid &uMachineId) 732 { 733 /* Skip VM if restricted: */ 734 if (!gEDataManager->showMachineInVirtualBoxManagerChooser(uMachineId)) 735 return; 736 737 /* Search for cached group list: */ 738 const QStringList oldGroupList = m_groups.value(toOldStyleUuid(uMachineId)); 739 //printf("Old groups for VM with ID=%s: %s\n", 740 // uMachineId.toString().toUtf8().constData(), 741 // oldGroupList.join(", ").toUtf8().constData()); 742 743 /* Search for existing registered machine: */ 744 const CMachine comMachine = uiCommon().virtualBox().FindMachine(uMachineId.toString()); 745 if (comMachine.isNull()) 746 return; 747 /* Look for a new group list: */ 748 const QStringList newGroupList = comMachine.GetGroups().toList(); 749 //printf("New groups for VM with ID=%s: %s\n", 750 // uMachineId.toString().toUtf8().constData(), 751 // newGroupList.join(", ").toUtf8().constData()); 752 753 /* Re-register VM if required: */ 754 if (newGroupList.toSet() != oldGroupList.toSet()) 755 { 756 sltLocalMachineRegistrationChanged(uMachineId, false); 757 sltLocalMachineRegistrationChanged(uMachineId, true); 728 758 } 729 759 } … … 1016 1046 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered, 1017 1047 this, &UIChooserAbstractModel::sltLocalMachineRegistrationChanged); 1048 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineGroupsChange, 1049 this, &UIChooserAbstractModel::sltLocalMachineGroupsChanged); 1018 1050 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSessionStateChange, 1019 1051 this, &UIChooserAbstractModel::sltSessionStateChanged); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
r96407 r97605 182 182 /** Handles local machine registering/unregistering for machine with certain @a uMachineId. */ 183 183 virtual void sltLocalMachineRegistrationChanged(const QUuid &uMachineId, const bool fRegistered); 184 /** Handles local machine registering/unregistering for machine with certain @a uMachineId. */ 185 virtual void sltLocalMachineGroupsChanged(const QUuid &uMachineId); 184 186 185 187 /** Handles session @a enmState change for machine with certain @a uMachineId. */
Note:
See TracChangeset
for help on using the changeset viewer.