comparison ui/administratorwindow.cpp @ 427:d08e39b913ee

Added about dialog content and open the dialog via administration app.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 17 Apr 2014 12:56:23 +0200
parents d7cda835abd6
children f07bc5de2a87
comparison
equal deleted inserted replaced
426:d7cda835abd6 427:d08e39b913ee
25 #include <QSortFilterProxyModel> 25 #include <QSortFilterProxyModel>
26 26
27 #include "certificatetabledelegate.h" 27 #include "certificatetabledelegate.h"
28 #include "createinstallerdialog.h" 28 #include "createinstallerdialog.h"
29 #include "createcertlistdialog.h" 29 #include "createcertlistdialog.h"
30 #include "aboutdialog.h"
30 31
31 AdministratorWindow::AdministratorWindow() { 32 AdministratorWindow::AdministratorWindow() {
32 setWindowTitle(tr("TrustBridge Administration")); 33 setWindowTitle(tr("TrustBridge Administration"));
33 QString path = QStandardPaths::locate( 34 QString path = QStandardPaths::locate(
34 QStandardPaths::DataLocation, QString("certlist_last.txt")); 35 QStandardPaths::DataLocation, QString("certlist_last.txt"));
95 // The header (icon, about text) 96 // The header (icon, about text)
96 QImage *logoImage = new QImage(":/img/logo.png"); 97 QImage *logoImage = new QImage(":/img/logo.png");
97 QLabel *logo = new QLabel; 98 QLabel *logo = new QLabel;
98 logo->setBackgroundRole(QPalette::Base); 99 logo->setBackgroundRole(QPalette::Base);
99 logo->setPixmap(QPixmap::fromImage(*logoImage)); 100 logo->setPixmap(QPixmap::fromImage(*logoImage));
100 QLabel *title = new QLabel("<h2>" + tr("TrustBridge Adminstration") + "</h2>"); 101 QLabel *title = new QLabel("<h2>" + tr("TrustBridge Administration") + "</h2>");
101 QLabel *subTitle = new QLabel( 102 QLabel *subTitle = new QLabel(
102 tr("Management application of the BSI certificate installer")); 103 tr("Management application of the BSI certificate installer"));
103 headerTextLayout->addWidget(title); 104 headerTextLayout->addWidget(title);
104 headerTextLayout->addWidget(subTitle); 105 headerTextLayout->addWidget(subTitle);
105 headerLayout->addWidget(logo); 106 headerLayout->addWidget(logo);
162 { 163 {
163 QString certFile = QFileDialog::getOpenFileName( 164 QString certFile = QFileDialog::getOpenFileName(
164 this, tr("Select certificate"), QDir::homePath(), "*.pem *.der"); 165 this, tr("Select certificate"), QDir::homePath(), "*.pem *.der");
165 QList<Certificate> certs = Certificate::fromFileName(certFile); 166 QList<Certificate> certs = Certificate::fromFileName(certFile);
166 addToCertificateTable(certs); 167 addToCertificateTable(certs);
168 certificateView->resizeColumnsToContents();
169 certificateView->setColumnWidth(0, 60);
167 } 170 }
168 171
169 void AdministratorWindow::removeCertificates() 172 void AdministratorWindow::removeCertificates()
170 { 173 {
171 QModelIndexList list = certificateView->selectionModel()->selectedRows(); 174 QModelIndexList list = certificateView->selectionModel()->selectedRows();
187 foreach(const Certificate &cert, certs) { 190 foreach(const Certificate &cert, certs) {
188 certificateModel->addCertificate(cert, false); 191 certificateModel->addCertificate(cert, false);
189 } 192 }
190 } 193 }
191 194
192 void AdministratorWindow::showSettings()
193 {
194 qDebug() << "show settingsdialog";
195 }
196
197 void AdministratorWindow::showHelp()
198 {
199 qDebug() << "show helpdialog";
200 }
201
202 void AdministratorWindow::showAbout() 195 void AdministratorWindow::showAbout()
203 { 196 {
204 qDebug() << "show aboutdialog"; 197 AboutDialog *dialog = new AboutDialog(this);
198 dialog->show();
205 } 199 }
206 200
207 void AdministratorWindow::createInstaller() 201 void AdministratorWindow::createInstaller()
208 { 202 {
209 qDebug() << "create Installer"; 203 qDebug() << "create Installer";

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