comparison 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
comparison
equal deleted inserted replaced
514:ce8325686b09 515:9d3880db6ba7
136 setCentralWidget(base); 136 setCentralWidget(base);
137 } 137 }
138 138
139 void AdministratorWindow::loadCertificateFile() 139 void AdministratorWindow::loadCertificateFile()
140 { 140 {
141 QString lastCertFile = mSettings.value("LastCertList", QDir::homePath()).toString();
141 QString certFile = QFileDialog::getOpenFileName( 142 QString certFile = QFileDialog::getOpenFileName(
142 this, tr("Select certificate list file"), QDir::homePath(), "*.txt"); 143 this, tr("Select certificate list file"), lastCertFile, "*.txt");
143 mCertList.readList(certFile.toLocal8Bit().constData()); 144 mCertList.readList(certFile.toLocal8Bit().constData());
144 if (!mCertList.isValid()) { 145 if (!mCertList.isValid()) {
145 qDebug() << "Not a valid list."; 146 QMessageBox::warning(this, tr("Error!"), tr("Failed to load the certificate list."));
146 } else { 147 } else {
147 certificateModel->removeAll(); 148 certificateModel->removeAll();
148 loadCertificateTable(); 149 loadCertificateTable();
150 mSettings.setValue("LastCertList", certFile);
149 } 151 }
150 } 152 }
151 153
152 void AdministratorWindow::saveCertificateFile() 154 void AdministratorWindow::saveCertificateFile()
153 { 155 {

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