VirtualBox

Changeset 5774

Show
Ignore:
Timestamp:
11/16/07 16:34:20 (1 year ago)
Author:
vboxsync
Message:

FE/Qt: Fixed a regression (would unregister an inaccessible hard disk even if the user chose Cancel in the confirmation dialog).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r5763 r5774  
    186186    void cannotDeleteHardDiskImage (QWidget *parent, const CVirtualDiskImage &vdi); 
    187187 
    188     int confirmHardDiskUnregister (QWidget *parent, const QString &src); 
     188    bool confirmHardDiskUnregister (QWidget *parent, const QString &src); 
    189189 
    190190    void cannotCreateHardDiskImage ( 
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r5763 r5774  
    10111011} 
    10121012 
    1013 int VBoxProblemReporter::confirmHardDiskUnregister (QWidget *parent, 
     1013bool VBoxProblemReporter::confirmHardDiskUnregister (QWidget *parent, 
    10141014                                                    const QString &src) 
    10151015{ 
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxDiskImageManagerDlg.ui.h

    r5483 r5774  
    20172017    { 
    20182018        type = VBoxDefs::HD; 
    2019         int deleteImage; 
     2019        bool deleteImage = false; 
     2020 
    20202021        /// @todo When creation of VMDK is implemented, we should 
    20212022        /// enable image deletion for  them as well (use 
     
    20242025        if (disk.GetStorageType() == CEnums::VirtualDiskImage && 
    20252026            item->getStatus() == VBoxMedia::Ok) 
    2026             deleteImage = vboxProblem().confirmHardDiskImageDeletion (this, src); 
     2027        { 
     2028            int rc = vboxProblem().confirmHardDiskImageDeletion (this, src); 
     2029            if (rc == QIMessageBox::Cancel) 
     2030                return; 
     2031            deleteImage = rc == QIMessageBox::Yes; 
     2032        } 
    20272033        else 
    2028             deleteImage = vboxProblem().confirmHardDiskUnregister (this, src); 
    2029         if (deleteImage == QIMessageBox::Cancel) 
    2030             return; 
     2034        { 
     2035            if (!vboxProblem().confirmHardDiskUnregister (this, src)) 
     2036                return; 
     2037        } 
     2038 
    20312039        CHardDisk hd = vbox.UnregisterHardDisk (uuid); 
    2032         if (vbox.isOk() && deleteImage == QIMessageBox::Yes) 
     2040        if (!vbox.isOk()) 
     2041            vboxProblem().cannotUnregisterMedia (this, vbox, type, src); 
     2042        else if (deleteImage) 
    20332043        { 
    20342044            /// @todo When creation of VMDK is implemented, we should 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy