summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/qconf.cc
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-05-25 15:10:25 +0200
committerMichal Marek <mmarek@suse.cz>2011-07-25 15:50:34 +0200
commitbac6aa865b3dc98e9fbc17f11d4d513d6b0bc435 (patch)
tree26b8c3a2567286ea4da5489ac7df1c51a1f94026 /scripts/kconfig/qconf.cc
parenteb4cf5a642f6430cffff7ba5d8d9bd46ea409281 (diff)
downloadop-kernel-dev-bac6aa865b3dc98e9fbc17f11d4d513d6b0bc435.zip
op-kernel-dev-bac6aa865b3dc98e9fbc17f11d4d513d6b0bc435.tar.gz
xconfig: Abort close if configuration cannot be saved
Give the user an opportunity to fix the error or save the configuration under a different path. Reported-by: Hiromu Yakura <hiromu1996@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r--scripts/kconfig/qconf.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 31e01cd..df274fe 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1478,10 +1478,13 @@ void ConfigMainWindow::loadConfig(void)
ConfigView::updateListAll();
}
-void ConfigMainWindow::saveConfig(void)
+bool ConfigMainWindow::saveConfig(void)
{
- if (conf_write(NULL))
+ if (conf_write(NULL)) {
QMessageBox::information(this, "qconf", _("Unable to save configuration!"));
+ return false;
+ }
+ return true;
}
void ConfigMainWindow::saveConfigAs(void)
@@ -1642,7 +1645,11 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e)
mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit"));
switch (mb.exec()) {
case QMessageBox::Yes:
- saveConfig();
+ if (saveConfig())
+ e->accept();
+ else
+ e->ignore();
+ break;
case QMessageBox::No:
e->accept();
break;
OpenPOWER on IntegriCloud