VirtualBox

Ignore:
Timestamp:
Feb 21, 2007 7:47:10 PM (18 years ago)
Author:
vboxsync
Message:

Storage/Main/GUI: Implemented preliminary support of VMDK images version 3 and 4 (no separate Disk DescriptionFile support).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxDiskImageManagerDlg.ui.h

    r852 r1015  
    658658         it != (*aDroppedList).end(); ++it)
    659659    {
    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.
    661664        VBoxDefs::DiskType type = VBoxDefs::InvalidType;
    662         if      ((*it).endsWith ("iso", false))
     665        if      (src.endsWith (".iso", false))
    663666        {
    664667            if (currentList == cdsView) type = VBoxDefs::CD;
    665668        }
    666         else if ((*it).endsWith ("img", false))
     669        else if (src.endsWith (".img", false))
    667670        {
    668671            if (currentList == fdsView) type = VBoxDefs::FD;
    669672        }
    670         else if ((*it).endsWith ("vdi", false))
     673        else if (src.endsWith (".vdi", false) ||
     674                 src.endsWith (".vmdk", false))
    671675        {
    672676            if (currentList == hdsView) type = VBoxDefs::HD;
    673677        }
    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        }
    676685    }
    677686    delete aDroppedList;
     
    691700        case VBoxDefs::HD:
    692701        {
    693             CVirtualDiskImage vdi = vbox.OpenVirtualDiskImage (aSource);
     702            CHardDisk hd = vbox.OpenHardDisk (aSource);
    694703            if (vbox.isOk())
    695704            {
    696                 CHardDisk hd = CUnknown (vdi);
    697705                vbox.RegisterHardDisk (hd);
    698706                if (vbox.isOk())
     
    17131721    DiskImageItem *item =
    17141722        currentList->currentItem() && currentList->currentItem()->rtti() == 1001 ?
    1715         static_cast<DiskImageItem*> (currentList->currentItem()) : 0;
     1723        static_cast <DiskImageItem*> (currentList->currentItem()) : 0;
    17161724
    17171725    QString dir;
     
    17291737    VBoxDefs::DiskType type = VBoxDefs::InvalidType;
    17301738
    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");
    17341746        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" );
    17381752        type = VBoxDefs::CD;
    1739     } else if (currentList == fdsView) {
     1753    }
     1754    else if (currentList == fdsView)
     1755    {
    17401756        filter = tr( "Floppy images (*.img)" );
    17411757        title = tr( "Select a floppy disk image file" );
    17421758        type = VBoxDefs::FD;
    1743     } else {
     1759    } else
     1760    {
    17441761        AssertMsgFailed (("Root list should be equal to hdsView, cdsView or fdsView"));
    17451762    }
     
    17481765                                                this, "AddDiskImageDialog",
    17491766                                                title);
     1767    src =  QDir::convertSeparators (src);
    17501768
    17511769    addImageToList (src, type);
     
    17711789        type = VBoxDefs::HD;
    17721790        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).
    17731794        if (vbox.GetHardDisk (uuid).GetStorageType() == CEnums::VirtualDiskImage &&
    17741795            item->getStatus() == VBoxMedia::Ok)
    1775         {
    17761796            deleteImage = vboxProblem().confirmHardDiskImageDeletion (this, src);
    1777         }
    17781797        else
    1779         {
    17801798            deleteImage = vboxProblem().confirmHardDiskUnregister (this, src);
    1781         }
    17821799        if (deleteImage == QIMessageBox::Cancel)
    17831800            return;
     
    17851802        if (vbox.isOk() && deleteImage == QIMessageBox::Yes)
    17861803        {
    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).
    17891807            CVirtualDiskImage vdi = CUnknown (hd);
    17901808            if (vdi.isOk())
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette