Changeset 57384 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 17, 2015 12:24:04 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp
r57366 r57384 28 28 # include "UIGlobalSettingsPortForwardingDlg.h" 29 29 # include "UIIconPool.h" 30 # include "UIMessageCenter.h" 30 31 # include "QIDialogButtonBox.h" 31 32 … … 95 96 void UIGlobalSettingsPortForwardingDlg::reject() 96 97 { 97 /* Discard table: */98 bool fPassed = m_pIPv4Table->discard() && m_pIPv6Table->discard();99 if (!fPassed)98 /* Ask user to discard table changes if necessary: */ 99 if ( (m_pIPv4Table->isChanged() || m_pIPv6Table->isChanged()) 100 && !msgCenter().confirmCancelingPortForwardingDialog(window())) 100 101 return; 101 102 /* Call to base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp
r57366 r57384 27 27 # include "UIMachineSettingsPortForwardingDlg.h" 28 28 # include "UIIconPool.h" 29 # include "UIMessageCenter.h" 29 30 # include "QIDialogButtonBox.h" 30 31 … … 79 80 void UIMachineSettingsPortForwardingDlg::reject() 80 81 { 81 /* Discard table: */82 bool fPassed = m_pTable->discard();83 if (!fPassed)82 /* Ask user to discard table changes if necessary: */ 83 if ( m_pTable->isChanged() 84 && !msgCenter().confirmCancelingPortForwardingDialog(window())) 84 85 return; 85 86 /* Call to base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
r57366 r57384 754 754 } 755 755 756 bool UIPortForwardingTable::discard() const757 {758 /* Check if table data was changed and user do not want to loose it: */759 if (m_fIsTableDataChanged && !msgCenter().confirmCancelingPortForwardingDialog(window()))760 return false;761 /* True by default: */762 return true;763 }764 765 756 void UIPortForwardingTable::sltAddRule() 766 757 { … … 787 778 sltCurrentChanged(); 788 779 sltAdjustTable(); 789 }790 791 void UIPortForwardingTable::sltTableDataChanged()792 {793 m_fIsTableDataChanged = true;794 780 } 795 781 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h
r57366 r57384 135 135 const UIPortForwardingDataList& rules() const; 136 136 bool validate() const; 137 bool discard() const; 137 138 /** Returns whether the table data was changed. */ 139 bool isChanged() const { return m_fIsTableDataChanged; } 138 140 139 141 private slots: … … 144 146 void sltDelRule(); 145 147 148 /** Marks table data as changed. */ 149 void sltTableDataChanged() { m_fIsTableDataChanged = true; } 150 146 151 /* Handlers: Table stuff: */ 147 void sltTableDataChanged();148 152 void sltCurrentChanged(); 149 153 void sltShowTableContexMenu(const QPoint &position); … … 160 164 /* Flags: */ 161 165 bool m_fAllowEmptyGuestIPs; 166 167 /** Holds whether the table data was changed. */ 162 168 bool m_fIsTableDataChanged; 163 169
Note:
See TracChangeset
for help on using the changeset viewer.