Changeset 5247 in vbox
- Timestamp:
- Oct 11, 2007 6:59:17 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/ui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxDiskImageManagerDlg.ui
r5194 r5247 599 599 <function specifier="static" access="private" returnType="QString">getDVDImageUsage( const QUuid & id )</function> 600 600 <function specifier="static" access="private" returnType="QString">getFloppyImageUsage( const QUuid & id )</function> 601 <function specifier="static" access="private">sourceSnapshotsCD( const QUuid & aImageId, const CSnapshot & aSnapshot, QString & aUsage )</function> 602 <function specifier="static" access="private">sourceSnapshotsFD( const QUuid & aImageId, const CSnapshot & aSnapshot, QString & aUsage )</function> 601 603 <function access="private" returnType="bool">checkImage( DiskImageItem* item )</function> 602 604 <function access="private">releaseDisk( QUuid machineId, QUuid itemId, VBoxDefs::DiskType diskType )</function> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxDiskImageManagerDlg.ui.h
r4071 r5247 874 874 if (usage) 875 875 usage += ", "; 876 usage += vbox.GetMachine (QUuid (*it)).GetName(); 876 CMachine machine = vbox.GetMachine (QUuid (*it)); 877 usage += machine.GetName(); 878 879 QString snapshots; 880 sourceSnapshotsCD (aId, machine.GetSnapshot (QUuid()), snapshots); 881 if (!snapshots.isEmpty()) 882 usage += QString (" (%1)").arg (snapshots); 877 883 } 878 884 … … 888 894 else 889 895 usage += "["; 890 usage += vbox.GetMachine (QUuid (*it)).GetName() + "]"; 896 CMachine machine = vbox.GetMachine (QUuid (*it)); 897 usage += machine.GetName() + "]"; 898 899 QString snapshots; 900 sourceSnapshotsCD (aId, machine.GetSnapshot (QUuid()), snapshots); 901 if (!snapshots.isEmpty()) 902 usage += QString (" (%1)").arg (snapshots); 891 903 } 892 904 } … … 912 924 if (usage) 913 925 usage += ", "; 914 usage += vbox.GetMachine (QUuid (*it)).GetName(); 926 CMachine machine = vbox.GetMachine (QUuid (*it)); 927 usage += machine.GetName(); 928 929 QString snapshots; 930 sourceSnapshotsFD (aId, machine.GetSnapshot (QUuid()), snapshots); 931 if (!snapshots.isEmpty()) 932 usage += QString (" (%1)").arg (snapshots); 915 933 } 916 934 … … 926 944 else 927 945 usage += "["; 928 usage += vbox.GetMachine (QUuid (*it)).GetName() + "]"; 946 CMachine machine = vbox.GetMachine (QUuid (*it)); 947 usage += machine.GetName() + "]"; 948 949 QString snapshots; 950 sourceSnapshotsFD (aId, machine.GetSnapshot (QUuid()), snapshots); 951 if (!snapshots.isEmpty()) 952 usage += QString (" (%1)").arg (snapshots); 929 953 } 930 954 } 931 955 932 956 return usage; 957 } 958 959 960 void VBoxDiskImageManagerDlg::sourceSnapshotsCD (const QUuid &aImageId, 961 const CSnapshot &aSnapshot, 962 QString &aUsage) 963 { 964 if (aSnapshot.isNull()) 965 return; 966 967 if (!aSnapshot.GetMachine().GetDVDDrive().GetImage().isNull() && 968 aSnapshot.GetMachine().GetDVDDrive().GetImage().GetId() == aImageId) 969 { 970 if (aUsage) 971 aUsage += ", "; 972 aUsage += aSnapshot.GetName(); 973 } 974 975 CSnapshotEnumerator en = aSnapshot.GetChildren().Enumerate(); 976 while (en.HasMore()) 977 sourceSnapshotsCD (aImageId, en.GetNext(), aUsage); 978 } 979 980 void VBoxDiskImageManagerDlg::sourceSnapshotsFD (const QUuid &aImageId, 981 const CSnapshot &aSnapshot, 982 QString &aUsage) 983 { 984 if (aSnapshot.isNull()) 985 return; 986 987 if (!aSnapshot.GetMachine().GetFloppyDrive().GetImage().isNull() && 988 aSnapshot.GetMachine().GetFloppyDrive().GetImage().GetId() == aImageId) 989 { 990 if (aUsage) 991 aUsage += ", "; 992 aUsage += aSnapshot.GetName(); 993 } 994 995 CSnapshotEnumerator en = aSnapshot.GetChildren().Enumerate(); 996 while (en.HasMore()) 997 sourceSnapshotsFD (aImageId, en.GetNext(), aUsage); 933 998 } 934 999 … … 1745 1810 !item->firstChild() && !item->getPath().isNull(); 1746 1811 bool releaseEnabled = item && !item->getUsage().isNull() && 1747 checkImage (item) && 1748 !item->parent() && !item->firstChild() && 1749 item->getSnapshotName().isNull(); 1812 item->getUsage().find (QRegExp ("\\([\\s\\S]+\\)")) == -1 && 1813 checkImage (item) && 1814 !item->parent() && !item->firstChild() && 1815 item->getSnapshotName().isNull(); 1750 1816 bool newEnabled = notInEnum && 1751 1817 getCurrentListView() == hdsView ? true : false;
Note:
See TracChangeset
for help on using the changeset viewer.