diff ui/administratorwindow.cpp @ 515:9d3880db6ba7

Improve error handlig and persist user decisions
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 28 Apr 2014 14:02:40 +0000
parents 091ad56c2715
children c81123298387
line wrap: on
line diff
--- a/ui/administratorwindow.cpp	Mon Apr 28 13:59:55 2014 +0000
+++ b/ui/administratorwindow.cpp	Mon Apr 28 14:02:40 2014 +0000
@@ -138,14 +138,16 @@
 
 void AdministratorWindow::loadCertificateFile()
 {
+    QString lastCertFile = mSettings.value("LastCertList", QDir::homePath()).toString();
     QString certFile = QFileDialog::getOpenFileName(
-        this, tr("Select certificate list file"), QDir::homePath(), "*.txt");
+        this, tr("Select certificate list file"), lastCertFile, "*.txt");
     mCertList.readList(certFile.toLocal8Bit().constData());
     if (!mCertList.isValid()) {
-        qDebug() << "Not a valid list.";
+        QMessageBox::warning(this, tr("Error!"), tr("Failed to load the certificate list."));
     } else {
         certificateModel->removeAll();
         loadCertificateTable();
+        mSettings.setValue("LastCertList", certFile);
     }
 }
 

http://wald.intevation.org/projects/trustbridge/