Mercurial > trustbridge
comparison ui/administratorwindow.cpp @ 401:e11409381e16
Changed path for load certificatelist and add certificate.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 16 Apr 2014 11:03:18 +0200 |
parents | d481b1d0956f |
children | 17e1c8f37d72 |
comparison
equal
deleted
inserted
replaced
400:d481b1d0956f | 401:e11409381e16 |
---|---|
129 setCentralWidget(base); | 129 setCentralWidget(base); |
130 } | 130 } |
131 | 131 |
132 void AdministratorWindow::loadCertificateFile() | 132 void AdministratorWindow::loadCertificateFile() |
133 { | 133 { |
134 QString path = QStandardPaths::locate( | |
135 QStandardPaths::DataLocation, QString("certlist_last.txt")); | |
134 QString certFile = QFileDialog::getOpenFileName( | 136 QString certFile = QFileDialog::getOpenFileName( |
135 this, tr("Select certificate file"), "/home/rrenkert/local-home/projects/m13/src/repo/ui/tests/data/", "*.txt"); | 137 this, tr("Select certificate file"), path, "*.txt"); |
136 qDebug() << "selected: " + certFile; | 138 qDebug() << "selected: " + certFile; |
137 certList.readList(certFile.toLocal8Bit().constData()); | 139 certList.readList(certFile.toLocal8Bit().constData()); |
138 if (!certList.isValid()) { | 140 if (!certList.isValid()) { |
139 qDebug() << "Not a valid list."; | 141 qDebug() << "Not a valid list."; |
140 } | 142 } |
151 } | 153 } |
152 | 154 |
153 void AdministratorWindow::addCertificates() | 155 void AdministratorWindow::addCertificates() |
154 { | 156 { |
155 QString certFile = QFileDialog::getOpenFileName( | 157 QString certFile = QFileDialog::getOpenFileName( |
156 this, tr("Select certificate"), "/home/rrenkert/local-home/projects/m13/src/repo/ui/tests/data/", "*.pem *.der"); | 158 this, tr("Select certificate"), QDir::homePath(), "*.pem *.der"); |
157 QList<Certificate> certs = Certificate::fromFileName(certFile); | 159 QList<Certificate> certs = Certificate::fromFileName(certFile); |
158 addToCertificateTable(certs); | 160 addToCertificateTable(certs); |
159 } | 161 } |
160 | 162 |
161 void AdministratorWindow::removeCertificates() | 163 void AdministratorWindow::removeCertificates() |