Changeset 1413 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 12, 2007 11:17:52 AM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/ui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxDiskImageManagerDlg.ui
r1381 r1413 613 613 <function access="private">addDroppedImages( QStringList* )</function> 614 614 <function access="private">addImageToList( const QString & aSource, VBoxDefs::DiskType aDiskType )</function> 615 <function access="private" returnType="DiskImageItem*">createImageNode( QListView *aList, DiskImageItem *aRoot )</function>615 <function access="private" returnType="DiskImageItem*">createImageNode( QListView *aList, DiskImageItem *aRoot, const VBoxMedia & )</function> 616 616 <function access="private">updateHdItem( DiskImageItem*, const VBoxMedia & )</function> 617 617 <function access="private">updateCdItem( DiskImageItem*, const VBoxMedia & )</function> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxDiskImageManagerDlg.ui.h
r1381 r1413 43 43 QListViewItem (parent), mStatus (VBoxMedia::Unknown) {} 44 44 45 void setMedia (const VBoxMedia &aMedia) { mMedia = aMedia; } 46 VBoxMedia &getMedia() { return mMedia; } 47 45 48 QString getName() { return mName; } 46 49 … … 126 129 127 130 protected: 131 132 VBoxMedia mMedia; 128 133 129 134 QString mName; … … 787 792 788 793 DiskImageItem* VBoxDiskImageManagerDlg::createImageNode (QListView *aList, 789 DiskImageItem *aRoot) 794 DiskImageItem *aRoot, 795 const VBoxMedia &aMedia) 790 796 { 791 797 DiskImageItem *item = 0; … … 797 803 else 798 804 Assert (0); 805 806 item->setMedia (aMedia); 799 807 800 808 return item; … … 1185 1193 QUuid rootId = hd.GetParent().isNull() ? QUuid() : hd.GetParent().GetId(); 1186 1194 DiskImageItem *root = searchItem (aList, rootId); 1187 DiskImageItem *item = createImageNode (aList, root );1195 DiskImageItem *item = createImageNode (aList, root, aMedia); 1188 1196 updateHdItem (item, aMedia); 1189 1197 return item; … … 1193 1201 const VBoxMedia &aMedia) 1194 1202 { 1195 DiskImageItem *item = createImageNode (aList, 0 );1203 DiskImageItem *item = createImageNode (aList, 0, aMedia); 1196 1204 updateCdItem (item, aMedia); 1197 1205 return item; … … 1201 1209 const VBoxMedia &aMedia) 1202 1210 { 1203 DiskImageItem *item = createImageNode (aList, 0 );1211 DiskImageItem *item = createImageNode (aList, 0, aMedia); 1204 1212 updateFdItem (item, aMedia); 1205 1213 return item; … … 1572 1580 if (parentList == hdsView) 1573 1581 { 1574 QUuid machineId = vbox.GetHardDisk (itemId).GetMachineId(); 1582 CHardDisk hd = aItem->getMedia().disk; 1583 QUuid machineId = hd.GetMachineId(); 1575 1584 if (machineId.isNull() || 1576 1585 vbox.GetMachine (machineId).GetState() != CEnums::PoweredOff && … … 1795 1804 title = tr( "Select a floppy disk image file" ); 1796 1805 type = VBoxDefs::FD; 1797 } else 1806 } 1807 else 1798 1808 { 1799 1809 AssertMsgFailed (("Root list should be equal to hdsView, cdsView or fdsView")); … … 1820 1830 AssertMsg (item, ("Current item must not be null")); 1821 1831 1832 QUuid uuid = QUuid (item->getUuid()); 1833 AssertMsg (!uuid.isNull(), ("Current item must have uuid")); 1834 1822 1835 QString src = item->getPath().stripWhiteSpace(); 1823 QUuid uuid = QUuid (item->getUuid());1824 1836 VBoxDefs::DiskType type = VBoxDefs::InvalidType; 1825 1837 … … 1831 1843 /// enable image deletion for them as well (use 1832 1844 /// GetStorageType() to define the correct cast). 1833 if (vbox.GetHardDisk (uuid).GetStorageType() == CEnums::VirtualDiskImage && 1845 CHardDisk disk = item->getMedia().disk; 1846 if (disk.GetStorageType() == CEnums::VirtualDiskImage && 1834 1847 item->getStatus() == VBoxMedia::Ok) 1835 1848 deleteImage = vboxProblem().confirmHardDiskImageDeletion (this, src); … … 1881 1894 AssertMsg (!itemId.isNull(), ("Current item must have uuid")); 1882 1895 1883 VBoxMedia media;1884 QUuid machineId;1885 1896 /* if it is a hard disk sub-item: */ 1886 1897 if (currentList == hdsView) 1887 1898 { 1888 machineId = vbox.GetHardDisk (itemId).GetMachineId(); 1899 CHardDisk hd = item->getMedia().disk; 1900 QUuid machineId = hd.GetMachineId(); 1889 1901 if (vboxProblem().confirmReleaseImage (this, 1890 vbox.GetMachine(machineId).GetName()))1902 vbox.GetMachine (machineId).GetName())) 1891 1903 { 1892 1904 releaseDisk (machineId, itemId, VBoxDefs::HD); 1893 CHardDisk hd = vboxGlobal().virtualBox().GetHardDisk (itemId); 1894 media = VBoxMedia (CUnknown (hd), VBoxDefs::HD, item->getStatus()); 1905 vboxGlobal().updateMedia (item->getMedia()); 1895 1906 } 1896 1907 } … … 1909 1920 releaseDisk (QUuid (*it), itemId, VBoxDefs::CD); 1910 1921 1911 CDVDImage cd = vbox Global().virtualBox().GetDVDImage (itemId);1912 media = VBoxMedia (CUnknown (cd), VBoxDefs::CD, item->getStatus());1922 CDVDImage cd = vbox.GetDVDImage (itemId); 1923 vboxGlobal().updateMedia (item->getMedia()); 1913 1924 } 1914 1925 } … … 1927 1938 releaseDisk (QUuid (*it), itemId, VBoxDefs::FD); 1928 1939 1929 CFloppyImage fd = vboxGlobal().virtualBox().GetFloppyImage (itemId); 1930 media = VBoxMedia (CUnknown (fd), VBoxDefs::FD, item->getStatus()); 1931 } 1932 } 1933 if (media.type != VBoxDefs::InvalidType) 1934 vboxGlobal().updateMedia (media); 1940 CFloppyImage fd = vbox.GetFloppyImage (itemId); 1941 vboxGlobal().updateMedia (item->getMedia()); 1942 } 1943 } 1935 1944 } 1936 1945 … … 1990 1999 } 1991 2000 default: 1992 Assert Failed();2001 AssertMsgFailed (("Incorrect disk type.")); 1993 2002 } 1994 2003 /* save all setting changes: */
Note:
See TracChangeset
for help on using the changeset viewer.