Changeset 97141 in vbox
- Timestamp:
- Oct 13, 2022 4:38:35 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154113
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r96967 r97141 780 780 } 781 781 782 bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent /* = 0*/) const 782 bool UIMessageCenter::confirmSettingsDiscarding(QWidget *pParent /* = 0 */) const 783 { 784 return questionBinary(pParent, MessageType_Question, 785 tr("<p>The machine settings were changed.</p>" 786 "<p>Would you like to discard the changed settings or to keep editing them?</p>"), 787 0 /* auto-confirm id */, 788 tr("Discard changes"), tr("Keep editing")); 789 790 } 791 792 bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent /* = 0 */) const 783 793 { 784 794 return questionBinary(pParent, MessageType_Question, -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r96967 r97141 307 307 void warnAboutUnaccessibleUSB(const COMBaseWithEI &object, QWidget *pParent = 0) const; 308 308 void warnAboutStateChange(QWidget *pParent = 0) const; 309 bool confirmSettingsDiscarding(QWidget *pParent = 0) const; 309 310 bool confirmSettingsReloading(QWidget *pParent = 0) const; 310 311 int confirmRemovingOfLastDVDDevice(QWidget *pParent = 0) const; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r97135 r97141 343 343 } 344 344 345 void UISettingsDialog::closeEvent(QCloseEvent *pEvent) 346 { 347 /* Check whether there are unsaved settings 348 * which will be lost in such case: */ 349 if ( !isSettingsChanged() 350 || msgCenter().confirmSettingsDiscarding()) 351 { 352 /* Call to base-class: */ 353 QIWithRetranslateUI<QIMainDialog>::closeEvent(pEvent); 354 } 355 else 356 { 357 /* Otherwise ignore this: */ 358 pEvent->ignore(); 359 } 360 } 361 345 362 void UISettingsDialog::loadData(QVariant &data) 346 363 { … … 804 821 QDialogButtonBox::NoButton); 805 822 #endif 806 connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UISettingsDialog:: reject);823 connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UISettingsDialog::close); 807 824 connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UISettingsDialog::accept); 808 825 #ifndef VBOX_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r97135 r97141 103 103 /** Handles first show @a pEvent. */ 104 104 virtual void polishEvent(QShowEvent *pEvent) RT_OVERRIDE; 105 /** Handles close @a pEvent. */ 106 virtual void closeEvent(QCloseEvent *pEvent) RT_OVERRIDE; 105 107 106 108 /** Returns the serialize process instance. */
Note:
See TracChangeset
for help on using the changeset viewer.