diff ui/administratorwindow.cpp @ 1317:d009da9cfa10

(issue157) Reload list after successful creation
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 13 Oct 2014 17:41:12 +0200
parents ff9cd05e861e
children 45082ec23e76
line wrap: on
line diff
--- a/ui/administratorwindow.cpp	Mon Oct 13 17:23:35 2014 +0200
+++ b/ui/administratorwindow.cpp	Mon Oct 13 17:41:12 2014 +0200
@@ -37,14 +37,20 @@
 
 AdministratorWindow::AdministratorWindow() {
     setWindowTitle(tr("TrustBridge Administration"));
-    QString path = QStandardPaths::locate(
-        QStandardPaths::DataLocation, QString("current_certificates.txt"));
-    mCertList.readList(path.toLocal8Bit());
     createActions();
     createMenuBar();
     createContent();
+    loadCurrentCertificates();
+    resize(1190, 500);
+}
+
+void AdministratorWindow::loadCurrentCertificates()
+{
+    QString path = QStandardPaths::locate(
+        QStandardPaths::DataLocation, QString("current_certificates.txt"));
+    certificateModel->removeAll();
+    mCertList.readList(path.toLocal8Bit());
     loadCertificateTable();
-    resize(1190, 500);
 }
 
 void AdministratorWindow::createActions()
@@ -170,6 +176,7 @@
     if (ret == QDialog::Accepted) {
         CreateCertListDialog *dialog = new CreateCertListDialog(this);
         dialog->show();
+        connect (dialog, SIGNAL(creationSuccessful()), this, SLOT(loadCurrentCertificates()));
     }
 }
 

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