QTfrontend/ui/widget/drawmapwidget.cpp
changeset 7794 ab7b94c03bc9
parent 6952 7f70f37bbf08
child 9080 9b42757d7e71
--- a/QTfrontend/ui/widget/drawmapwidget.cpp	Tue Oct 23 05:21:44 2012 +0200
+++ b/QTfrontend/ui/widget/drawmapwidget.cpp	Tue Oct 23 06:50:19 2012 +0200
@@ -95,7 +95,14 @@
         QFile file(fileName);
 
         if(!file.open(QIODevice::WriteOnly))
-            QMessageBox::warning(this, tr("File error"), tr("Cannot open file '%1' for writing").arg(fileName));
+        {
+            QMessageBox errorMsg(this);
+            errorMsg.setIcon(QMessageBox::Warning);
+            errorMsg.setWindowTitle(QMessageBox::tr("File error"));
+            errorMsg.setText(QMessageBox::tr("Cannot open '%1' for writing").arg(fileName));
+            errorMsg.setWindowModality(Qt::WindowModal);
+            errorMsg.exec();
+        }
         else
             file.write(qCompress(m_scene->encode()).toBase64());
     }
@@ -108,7 +115,14 @@
         QFile f(fileName);
 
         if(!f.open(QIODevice::ReadOnly))
-            QMessageBox::warning(this, tr("File error"), tr("Cannot read file '%1'").arg(fileName));
+        {
+            QMessageBox errorMsg(this);
+            errorMsg.setIcon(QMessageBox::Warning);
+            errorMsg.setWindowTitle(QMessageBox::tr("File error"));
+            errorMsg.setText(QMessageBox::tr("Cannot open '%1' for reading").arg(fileName));
+            errorMsg.setWindowModality(Qt::WindowModal);
+            errorMsg.exec();
+        }
         else
             m_scene->decode(qUncompress(QByteArray::fromBase64(f.readAll())));
     }