VirtualBox

Changeset 18006 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 17, 2009 10:07:44 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: 3714: Ask for confirmation before discarding snapshot & state.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited

Legend:

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

    r17884 r18006  
    201201
    202202    void cannotSetSnapshotFolder (const CMachine &aMachine, const QString &aPath);
     203    bool askAboutSnapshotAndStateDiscarding();
    203204    void cannotDiscardSnapshot (const CConsole &aConsole,
    204205                                const QString &aSnapshotName);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r17884 r18006  
    889889}
    890890
     891bool VBoxProblemReporter::askAboutSnapshotAndStateDiscarding()
     892{
     893    return messageOkCancel (mainWindowShown(), Question,
     894        tr ("<p>Are you sure you wish to delete the selected snapshot "
     895            "and saved state?</p>"),
     896        "confirmSnapshotAndStateDiscarding" /* aAutoConfirmId */,
     897        tr ("Discard"), tr ("Cancel"));
     898}
     899
    891900void VBoxProblemReporter::cannotDiscardSnapshot (const CConsole &aConsole,
    892901                                                 const QString &aSnapshotName)
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp

    r17260 r18006  
    567567void VBoxSnapshotsWgt::discardCurSnapAndState()
    568568{
     569    if (!vboxProblem().askAboutSnapshotAndStateDiscarding())
     570        return;
     571
    569572    SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
    570573        static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
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