Changeset 47222 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 17, 2013 3:12:06 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r47171 r47222 29 29 #include <QWindowsStyle> 30 30 #include <QPointer> 31 #include <QApplication> 31 32 32 33 /* GUI includes: */ … … 413 414 connect (mTreeWidget, SIGNAL (itemChanged (QTreeWidgetItem*, int)), 414 415 this, SLOT (onItemChanged (QTreeWidgetItem*))); 416 connect(mTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), 417 this, SLOT (sltItemDoubleClicked(QTreeWidgetItem*))); 415 418 416 419 connect (mTakeSnapshotAction, SIGNAL (triggered()), this, SLOT (sltTakeSnapshot())); … … 570 573 } 571 574 575 void VBoxSnapshotsWgt::sltItemDoubleClicked(QTreeWidgetItem *pItem) 576 { 577 /* Make sure *nothing* is being edited currently: */ 578 if (mEditProtector) 579 return; 580 581 /* Make sure some *valid* item was *really* double-clicked: */ 582 SnapshotWgtItem *pValidItem = pItem ? static_cast<SnapshotWgtItem*>(pItem) : 0; 583 if (!pValidItem) 584 return; 585 586 /* Handle Ctrl+DoubleClick: */ 587 if (QApplication::keyboardModifiers() == Qt::ControlModifier) 588 { 589 /* As call for snapshot-restore procedure: */ 590 sltRestoreSnapshot(true /* suppress non-critical warnings */); 591 } 592 } 593 572 594 void VBoxSnapshotsWgt::sltTakeSnapshot() 573 595 { … … 575 597 } 576 598 577 void VBoxSnapshotsWgt::sltRestoreSnapshot( )599 void VBoxSnapshotsWgt::sltRestoreSnapshot(bool fSuppressNonCriticalWarnings /*= false*/) 578 600 { 579 601 /* Get currently chosen item: */ … … 587 609 588 610 /* Ask the user if he really wants to restore the snapshot: */ 589 int iResultCode = msgCenter().confirmSnapshotRestoring(snapshot.GetName(), mMachine.GetCurrentStateModified()); 590 if (iResultCode & AlertButton_Cancel) 591 return; 611 int iResultCode = AlertButton_Ok; 612 if (!fSuppressNonCriticalWarnings || mMachine.GetCurrentStateModified()) 613 { 614 iResultCode = msgCenter().confirmSnapshotRestoring(snapshot.GetName(), mMachine.GetCurrentStateModified()); 615 if (iResultCode & AlertButton_Cancel) 616 return; 617 } 592 618 593 619 /* If user also confirmed new snapshot creation: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.h
r46726 r47222 64 64 void onContextMenuRequested (const QPoint &aPoint); 65 65 void onItemChanged (QTreeWidgetItem *aItem); 66 void sltItemDoubleClicked(QTreeWidgetItem *pItem); 66 67 67 68 /* Snapshot functionality slots: */ 68 69 void sltTakeSnapshot(); 69 void sltRestoreSnapshot( );70 void sltRestoreSnapshot(bool fSuppressNonCriticalWarnings = false); 70 71 void sltDeleteSnapshot(); 71 72 void sltShowSnapshotDetails();
Note:
See TracChangeset
for help on using the changeset viewer.