Changeset 1015 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 21, 2007 7:47:10 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxDiskImageManagerDlg.ui.h
r852 r1015 658 658 it != (*aDroppedList).end(); ++it) 659 659 { 660 // Checking dropped media type 660 QString src = *it; 661 /* Check dropped media type */ 662 /// @todo On OS/2 and windows (and mac?) extension checks should be case 663 /// insensitive, as OPPOSED to linux and the rest where case matters. 661 664 VBoxDefs::DiskType type = VBoxDefs::InvalidType; 662 if ( (*it).endsWith ("iso", false))665 if (src.endsWith (".iso", false)) 663 666 { 664 667 if (currentList == cdsView) type = VBoxDefs::CD; 665 668 } 666 else if ( (*it).endsWith ("img", false))669 else if (src.endsWith (".img", false)) 667 670 { 668 671 if (currentList == fdsView) type = VBoxDefs::FD; 669 672 } 670 else if ((*it).endsWith ("vdi", false)) 673 else if (src.endsWith (".vdi", false) || 674 src.endsWith (".vmdk", false)) 671 675 { 672 676 if (currentList == hdsView) type = VBoxDefs::HD; 673 677 } 674 // If media type has been determined - attach this device 675 if (type) addImageToList (*it, type); 678 /* If media type has been determined - attach this device */ 679 if (type) 680 { 681 addImageToList (*it, type); 682 if (!vbox.isOk()) 683 vboxProblem().cannotRegisterMedia (this, vbox, type, src); 684 } 676 685 } 677 686 delete aDroppedList; … … 691 700 case VBoxDefs::HD: 692 701 { 693 C VirtualDiskImage vdi = vbox.OpenVirtualDiskImage(aSource);702 CHardDisk hd = vbox.OpenHardDisk (aSource); 694 703 if (vbox.isOk()) 695 704 { 696 CHardDisk hd = CUnknown (vdi);697 705 vbox.RegisterHardDisk (hd); 698 706 if (vbox.isOk()) … … 1713 1721 DiskImageItem *item = 1714 1722 currentList->currentItem() && currentList->currentItem()->rtti() == 1001 ? 1715 static_cast <DiskImageItem*> (currentList->currentItem()) : 0;1723 static_cast <DiskImageItem*> (currentList->currentItem()) : 0; 1716 1724 1717 1725 QString dir; … … 1729 1737 VBoxDefs::DiskType type = VBoxDefs::InvalidType; 1730 1738 1731 if (currentList == hdsView) { 1732 filter = tr( "Hard disk images (*.vdi)" ); 1733 title = tr( "Select a hard disk image file" ); 1739 if (currentList == hdsView) 1740 { 1741 filter = tr ("All hard disk images (*.vdi; *.vmdk);;" 1742 "Virtual Disk images (*.vdi);;" 1743 "VMDK images (*.vmdk);;" 1744 "All files (*)"); 1745 title = tr ("Select a hard disk image file"); 1734 1746 type = VBoxDefs::HD; 1735 } else if (currentList == cdsView) { 1736 filter = tr( "CDROM images (*.iso)" ); 1737 title = tr( "Select a DVD/CD-ROM disk image file" ); 1747 } 1748 else if (currentList == cdsView) 1749 { 1750 filter = tr( "CD/DVD-ROM images (*.iso)"); 1751 title = tr( "Select a CD/DVD-ROM disk image file" ); 1738 1752 type = VBoxDefs::CD; 1739 } else if (currentList == fdsView) { 1753 } 1754 else if (currentList == fdsView) 1755 { 1740 1756 filter = tr( "Floppy images (*.img)" ); 1741 1757 title = tr( "Select a floppy disk image file" ); 1742 1758 type = VBoxDefs::FD; 1743 } else { 1759 } else 1760 { 1744 1761 AssertMsgFailed (("Root list should be equal to hdsView, cdsView or fdsView")); 1745 1762 } … … 1748 1765 this, "AddDiskImageDialog", 1749 1766 title); 1767 src = QDir::convertSeparators (src); 1750 1768 1751 1769 addImageToList (src, type); … … 1771 1789 type = VBoxDefs::HD; 1772 1790 int deleteImage; 1791 /// @todo When creation of VMDK is implemented, we should 1792 /// enable image deletion for them as well (use 1793 /// GetStorageType() to define the correct cast). 1773 1794 if (vbox.GetHardDisk (uuid).GetStorageType() == CEnums::VirtualDiskImage && 1774 1795 item->getStatus() == VBoxMedia::Ok) 1775 {1776 1796 deleteImage = vboxProblem().confirmHardDiskImageDeletion (this, src); 1777 }1778 1797 else 1779 {1780 1798 deleteImage = vboxProblem().confirmHardDiskUnregister (this, src); 1781 }1782 1799 if (deleteImage == QIMessageBox::Cancel) 1783 1800 return; … … 1785 1802 if (vbox.isOk() && deleteImage == QIMessageBox::Yes) 1786 1803 { 1787 /// @todo (dmik) later, change wrappers so that converting 1788 // to CUnknown is not necessary for cross-assignments 1804 /// @todo When creation of VMDK is implemented, we should 1805 /// enable image deletion for them as well (use 1806 /// GetStorageType() to define the correct cast). 1789 1807 CVirtualDiskImage vdi = CUnknown (hd); 1790 1808 if (vdi.isOk())
Note:
See TracChangeset
for help on using the changeset viewer.