Changeset 31563 in vbox for trunk/src/VBox
- Timestamp:
- Aug 11, 2010 12:14:50 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp
r31535 r31563 2354 2354 } 2355 2355 2356 bool VBoxProblemReporter::confirmCancelingPortForwardingDialog(QWidget *pParent) const 2357 { 2358 return messageOkCancel(pParent, Question, 2359 tr("<p>Canceling the port forwarding configuration process will cause " 2360 "any unsaved changes to be lost. Do you really wish to do so?</p>")); 2361 } 2362 2356 2363 void VBoxProblemReporter::showRuntimeError (const CConsole &aConsole, bool fatal, 2357 2364 const QString &errorID, -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h
r31535 r31563 370 370 371 371 void warnAboutIncorrectPort(QWidget *pParent) const; 372 bool confirmCancelingPortForwardingDialog(QWidget *pParent) const; 372 373 373 374 void showRuntimeError (const CConsole &console, bool fatal, -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsPortForwardingDlg.cpp
r31548 r31563 414 414 const UIPortForwardingDataList &rules) 415 415 : QIWithRetranslateUI<QIDialog>(pParent) 416 , fIsTableDataChanged(false) 416 417 , m_pTableView(0) 417 418 , m_pToolBar(0) … … 479 480 /* Create model: */ 480 481 m_pModel = new UIPortForwardingModel(this, rules); 482 connect(m_pModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(sltTableDataChanged())); 483 connect(m_pModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(sltTableDataChanged())); 484 connect(m_pModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(sltTableDataChanged())); 481 485 m_pTableView->setModel(m_pModel); 482 486 … … 568 572 } 569 573 574 /* Table data change handler: */ 575 void VBoxVMSettingsPortForwardingDlg::sltTableDataChanged() 576 { 577 fIsTableDataChanged = true; 578 } 579 570 580 /* Table index-change handler: */ 571 581 void VBoxVMSettingsPortForwardingDlg::sltCurrentChanged() … … 636 646 /* Base class accept() slot: */ 637 647 QIWithRetranslateUI<QIDialog>::accept(); 648 } 649 650 void VBoxVMSettingsPortForwardingDlg::reject() 651 { 652 /* Check if table data was changed: */ 653 if (fIsTableDataChanged && !vboxProblem().confirmCancelingPortForwardingDialog(this)) 654 return; 655 /* Base class reject() slot: */ 656 QIWithRetranslateUI<QIDialog>::reject(); 638 657 } 639 658 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsPortForwardingDlg.h
r31535 r31563 111 111 112 112 /* Table slots: */ 113 void sltTableDataChanged(); 113 114 void sltCurrentChanged(); 114 115 void sltShowTableContexMenu(const QPoint &position); … … 117 118 /* Dialog slots: */ 118 119 void accept(); 120 void reject(); 119 121 120 122 private: … … 125 127 /* Event filter: */ 126 128 bool eventFilter(QObject *pObj, QEvent *pEvent); 129 130 /* Flags: */ 131 bool fIsTableDataChanged; 127 132 128 133 /* Widgets: */
Note:
See TracChangeset
for help on using the changeset viewer.