Mercurial > trustbridge
annotate ui/administratorwindow.cpp @ 359:f6ce186cebc2
If DO_RELEASE_BUILD is set use pubkey-release and test with it
This currently fails because polarssl rejects keys with
a public exponent larger then 64 bit.
With the following patch all tests pass. But this
currently awaits upstream comment.
https://polarssl.org/discussions/bug-report-issues/rsa-keys-with-large-public-exponents-are-rejected
--- rsa.c.orig 2014-04-10 17:22:32.727290031 +0200
+++ rsa.c 2014-04-10 17:22:38.847410225 +0200
@@ -154,7 +154,7 @@
return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED );
if( mpi_msb( &ctx->E ) < 2 ||
- mpi_msb( &ctx->E ) > 64 )
+ mpi_msb( &ctx->E ) > POLARSSL_MPI_MAX_BITS )
return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED );
return( 0 );
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 10 Apr 2014 17:50:44 +0200 |
parents | 9ba7b4b4c1de |
children | 857ae1ffdd6f |
rev | line source |
---|---|
333
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 #include "administratorwindow.h" |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 #include <QDebug> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 #include <QMessageBox> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 #include <QAction> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 #include <QMenu> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 #include <QApplication> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 #include <QHBoxLayout> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 #include <QVBoxLayout> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 #include <QGroupBox> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 #include <QSplitter> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 #include <QLabel> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 #include <QImage> |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 #include <QCheckBox> |
335
811eec4e1b99
Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
333
diff
changeset
|
15 #include <QHeaderView> |
344
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
16 #include <QFileDialog> |
333
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 |
348
e6aa82466420
Use the table item delegate for certificates and make the model editable.
Raimund Renkert <rrenkert@intevation.de>
parents:
344
diff
changeset
|
18 #include "certificatetabledelegate.h" |
e6aa82466420
Use the table item delegate for certificates and make the model editable.
Raimund Renkert <rrenkert@intevation.de>
parents:
344
diff
changeset
|
19 |
333
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 AdministratorWindow::AdministratorWindow() { |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 createActions(); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 createMenuBar(); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 createContent(); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 } |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 void AdministratorWindow::createActions() |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 { |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 } |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 void AdministratorWindow::createMenuBar() |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 { |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 menuBar = new QMenuBar(this); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 QMenu *menu = new QMenu(tr("Menu"), menuBar); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 menuBar->addMenu(menu); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 QAction *createInstaller = menu->addAction(tr("Create Installer")); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 QAction *settings = menu->addAction(tr("Settings")); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 menu->addSeparator(); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 QAction *help = menu->addAction(tr("Help")); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 QAction *about = menu->addAction(tr("About")); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 menu->addSeparator(); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 QAction *quit = menu->addAction(tr("Quit")); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 connect(createInstaller, SIGNAL(triggered()), this, SLOT(createInstaller())); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 connect(settings, SIGNAL(triggered()), this, SLOT(showSettings())); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
44 connect(help, SIGNAL(triggered()), this, SLOT(showHelp())); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
45 connect(about, SIGNAL(triggered()), this, SLOT(showAbout())); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
46 connect(quit, SIGNAL(triggered()), qApp, SLOT(quit())); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 setMenuBar(menuBar); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
48 } |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
49 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 void AdministratorWindow::createContent() |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
51 { |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
52 // Create a central widget containing the main layout. |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
53 QWidget *base = new QWidget; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
54 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 // Layouts and Container |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
56 QVBoxLayout *mainLayout = new QVBoxLayout; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
57 QVBoxLayout *certLayout = new QVBoxLayout; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
58 QHBoxLayout *headerLayout = new QHBoxLayout; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
59 QVBoxLayout *headerTextLayout = new QVBoxLayout; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
60 QHBoxLayout *bottomLayout = new QHBoxLayout; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
61 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
62 // The certificate list |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); |
335
811eec4e1b99
Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
333
diff
changeset
|
64 certificateView = new QTableView; |
343
e3d6de930c90
Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
335
diff
changeset
|
65 certificateModel = new CertificateTabelModel(); |
348
e6aa82466420
Use the table item delegate for certificates and make the model editable.
Raimund Renkert <rrenkert@intevation.de>
parents:
344
diff
changeset
|
66 CertificateTableDelegate *delegate = new CertificateTableDelegate(certificateView); |
343
e3d6de930c90
Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
335
diff
changeset
|
67 certificateView->setModel(certificateModel); |
348
e6aa82466420
Use the table item delegate for certificates and make the model editable.
Raimund Renkert <rrenkert@intevation.de>
parents:
344
diff
changeset
|
68 certificateView->setItemDelegate(delegate); |
e6aa82466420
Use the table item delegate for certificates and make the model editable.
Raimund Renkert <rrenkert@intevation.de>
parents:
344
diff
changeset
|
69 certificateView->setColumnWidth(0, 50); |
335
811eec4e1b99
Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
333
diff
changeset
|
70 certificateView->setColumnWidth(2, 130); |
811eec4e1b99
Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
333
diff
changeset
|
71 certificateView->setColumnWidth(3, 130); |
811eec4e1b99
Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
333
diff
changeset
|
72 certificateView->setColumnWidth(4, 200); |
343
e3d6de930c90
Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
335
diff
changeset
|
73 certificateView->setSelectionBehavior(QAbstractItemView::SelectRows); |
e3d6de930c90
Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
335
diff
changeset
|
74 certificateView->verticalHeader()->setVisible(false); |
335
811eec4e1b99
Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
333
diff
changeset
|
75 certLayout->addWidget(certificateView); |
333
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
76 certBox->setLayout(certLayout); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
77 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
78 // The header (icon, about text) |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
79 QImage *logoImage = new QImage(":/img/logo.png"); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
80 QLabel *logo = new QLabel; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
81 logo->setBackgroundRole(QPalette::Base); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
82 logo->setPixmap(QPixmap::fromImage(*logoImage)); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
83 QLabel *title = new QLabel("<h2>" + tr("Administrator Application") + "</h2>"); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
84 QLabel *subTitle = new QLabel("This Software creates a signed file containing certificates"); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
85 headerTextLayout->addWidget(title); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
86 headerTextLayout->addWidget(subTitle); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
87 headerLayout->addWidget(logo); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
88 headerLayout->addLayout(headerTextLayout); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
89 headerLayout->setStretch(0, 0); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
90 headerLayout->setStretch(1, 10); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
91 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
92 // The buttons. |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
93 bottomLayout->setAlignment(Qt::AlignBottom); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
94 saveButton = new QPushButton(tr("Save")); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
95 loadButton = new QPushButton(tr("Load")); |
344
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
96 connect(loadButton, SIGNAL(clicked()), this, SLOT(loadCertificateFile())); |
333
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
97 addButton = new QPushButton(tr("Add")); |
358
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
98 connect(addButton, SIGNAL(clicked()), this, SLOT(addCertificates())); |
333
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
99 removeButton = new QPushButton(tr("Remove")); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
100 bottomLayout->addWidget(saveButton); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
101 bottomLayout->addWidget(loadButton); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
102 bottomLayout->addWidget(addButton); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
103 bottomLayout->addWidget(removeButton); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
104 bottomLayout->insertStretch(4, 10); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
105 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
106 mainLayout->addLayout(headerLayout); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
107 mainLayout->addWidget(certBox); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
108 mainLayout->addLayout(bottomLayout); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
109 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
110 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
111 // QMainWindow allready has a layout. All child layouts and widgets are |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
112 // managed in the central widget. |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
113 base->setLayout(mainLayout); |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
114 setCentralWidget(base); |
335
811eec4e1b99
Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
333
diff
changeset
|
115 certificateView->horizontalHeader()->setSectionResizeMode(1, |
811eec4e1b99
Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents:
333
diff
changeset
|
116 QHeaderView::Stretch); |
333
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
117 } |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
118 |
344
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
119 void AdministratorWindow::loadCertificateFile() |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
120 { |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
121 QString certFile = QFileDialog::getOpenFileName( |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
122 this, tr("Select certificate file"), "/home/rrenkert/local-home/projects/m13/src/repo/ui/tests/data/", "*.txt"); |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
123 qDebug() << "selected: " + certFile; |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
124 certList.readList(certFile.toLocal8Bit().constData()); |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
125 if (!certList.isValid()) { |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
126 qDebug() << "Not a valid list."; |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
127 } |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
128 else { |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
129 loadCertificateTable(); |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
130 } |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
131 } |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
132 |
358
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
133 void AdministratorWindow::addCertificates() |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
134 { |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
135 QString certFile = QFileDialog::getOpenFileName( |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
136 this, tr("Select certificate"), "/home/rrenkert/local-home/projects/m13/src/repo/ui/tests/data/", "*.pem *.der"); |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
137 QList<Certificate> certs = Certificate::fromFileName(certFile); |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
138 addToCertificateTable(certs); |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
139 } |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
140 |
344
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
141 void AdministratorWindow::loadCertificateTable() { |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
142 foreach(const Certificate &cert, certList.getCertificates()) { |
358
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
143 certificateModel->addCertificate(cert, true); |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
144 } |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
145 } |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
146 |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
147 void AdministratorWindow::addToCertificateTable(const QList<Certificate> &certs) |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
148 { |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
149 foreach(const Certificate &cert, certs) { |
9ba7b4b4c1de
Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
150 certificateModel->addCertificate(cert, false); |
344
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
151 } |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
152 } |
4454a4dc73a3
Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
153 |
333
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
154 void AdministratorWindow::showSettings() |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
155 { |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
156 qDebug() << "show settingsdialog"; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
157 } |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
158 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
159 void AdministratorWindow::showHelp() |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
160 { |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
161 qDebug() << "show helpdialog"; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
162 } |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
163 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
164 void AdministratorWindow::showAbout() |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
165 { |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
166 qDebug() << "show aboutdialog"; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
167 } |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
168 |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
169 void AdministratorWindow::createInstaller() |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
170 { |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
171 qDebug() << "create Installer"; |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
172 } |
de94c4ec22b1
Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
173 |