diff options
author | will <will@palepurple.co.uk> | 2013-05-27 11:31:25 (GMT) |
---|---|---|
committer | will <will@palepurple.co.uk> | 2013-05-27 11:31:25 (GMT) |
commit | 7c6e039d1c3986986c83649ad81fc0ce9cffd250 (patch) | |
tree | 19df42edab3aec2e53795c71538a06d33acc11b3 | |
parent | ef7b80656fc39dc0fd4012231633cf858e6aa10b (diff) |
Show a QMessageBox when saving a file failes.
-rw-r--r-- | src/mainwin.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc index 08f0435..ac75269 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -917,6 +917,8 @@ void MainWindow::actionSave() QFile file(this->fileName); if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) { PRINTB("Failed to open file for writing: %s (%s)", this->fileName.toLocal8Bit().constData() % file.errorString().toLocal8Bit().constData()); + QMessageBox::warning(this, windowTitle(), tr("Failed to open file for writing:\n %1 (%2)") + .arg(this->fileName).arg(file.errorString())); } else { QTextStream writer(&file); |