annotate ui/administratorwindow.cpp @ 363:d10d9bc2e84f

Update Windows api usage. Warning: To build on windows you need a shell32.dll with SHGetKnownFolder
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 14 Apr 2014 16:57:41 +0000
parents 857ae1ffdd6f
children f9c98f9e9f76
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"
362
857ae1ffdd6f Open the new dialog from the main menu.
Raimund Renkert <rrenkert@intevation.de>
parents: 358
diff changeset
19 #include "createinstallerdialog.h"
348
e6aa82466420 Use the table item delegate for certificates and make the model editable.
Raimund Renkert <rrenkert@intevation.de>
parents: 344
diff changeset
20
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 AdministratorWindow::AdministratorWindow() {
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 createActions();
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 createMenuBar();
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 createContent();
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
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 void AdministratorWindow::createActions()
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
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 void AdministratorWindow::createMenuBar()
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 {
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 menuBar = new QMenuBar(this);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 QMenu *menu = new QMenu(tr("Menu"), menuBar);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35 menuBar->addMenu(menu);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 QAction *createInstaller = menu->addAction(tr("Create Installer"));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 QAction *settings = menu->addAction(tr("Settings"));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 menu->addSeparator();
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39 QAction *help = menu->addAction(tr("Help"));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
40 QAction *about = menu->addAction(tr("About"));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41 menu->addSeparator();
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
42 QAction *quit = menu->addAction(tr("Quit"));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
43 connect(createInstaller, SIGNAL(triggered()), this, SLOT(createInstaller()));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
44 connect(settings, SIGNAL(triggered()), this, SLOT(showSettings()));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
45 connect(help, SIGNAL(triggered()), this, SLOT(showHelp()));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
46 connect(about, SIGNAL(triggered()), this, SLOT(showAbout()));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
47 connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48 setMenuBar(menuBar);
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
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
51 void AdministratorWindow::createContent()
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
52 {
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
53 // Create a central widget containing the main layout.
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
54 QWidget *base = new QWidget;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
55
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
56 // Layouts and Container
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
57 QVBoxLayout *mainLayout = new QVBoxLayout;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
58 QVBoxLayout *certLayout = new QVBoxLayout;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
59 QHBoxLayout *headerLayout = new QHBoxLayout;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
60 QVBoxLayout *headerTextLayout = new QVBoxLayout;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61 QHBoxLayout *bottomLayout = new QHBoxLayout;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
62
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
63 // The certificate list
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
64 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
65 certificateView = new QTableView;
343
e3d6de930c90 Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 335
diff changeset
66 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
67 CertificateTableDelegate *delegate = new CertificateTableDelegate(certificateView);
343
e3d6de930c90 Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 335
diff changeset
68 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
69 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
70 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
71 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
72 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
73 certificateView->setColumnWidth(4, 200);
343
e3d6de930c90 Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 335
diff changeset
74 certificateView->setSelectionBehavior(QAbstractItemView::SelectRows);
e3d6de930c90 Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 335
diff changeset
75 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
76 certLayout->addWidget(certificateView);
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
77 certBox->setLayout(certLayout);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
78
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
79 // The header (icon, about text)
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
80 QImage *logoImage = new QImage(":/img/logo.png");
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
81 QLabel *logo = new QLabel;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
82 logo->setBackgroundRole(QPalette::Base);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
83 logo->setPixmap(QPixmap::fromImage(*logoImage));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
84 QLabel *title = new QLabel("<h2>" + tr("Administrator Application") + "</h2>");
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
85 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
86 headerTextLayout->addWidget(title);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
87 headerTextLayout->addWidget(subTitle);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
88 headerLayout->addWidget(logo);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
89 headerLayout->addLayout(headerTextLayout);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
90 headerLayout->setStretch(0, 0);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
91 headerLayout->setStretch(1, 10);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
92
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
93 // The buttons.
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
94 bottomLayout->setAlignment(Qt::AlignBottom);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
95 saveButton = new QPushButton(tr("Save"));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
96 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
97 connect(loadButton, SIGNAL(clicked()), this, SLOT(loadCertificateFile()));
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
98 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
99 connect(addButton, SIGNAL(clicked()), this, SLOT(addCertificates()));
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
100 removeButton = new QPushButton(tr("Remove"));
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
101 bottomLayout->addWidget(saveButton);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
102 bottomLayout->addWidget(loadButton);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
103 bottomLayout->addWidget(addButton);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
104 bottomLayout->addWidget(removeButton);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
105 bottomLayout->insertStretch(4, 10);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
106
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
107 mainLayout->addLayout(headerLayout);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
108 mainLayout->addWidget(certBox);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
109 mainLayout->addLayout(bottomLayout);
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
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
112 // 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
113 // managed in the central widget.
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
114 base->setLayout(mainLayout);
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
115 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
116 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
117 QHeaderView::Stretch);
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
118 }
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
119
344
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
120 void AdministratorWindow::loadCertificateFile()
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
121 {
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
122 QString certFile = QFileDialog::getOpenFileName(
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
123 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
124 qDebug() << "selected: " + certFile;
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
125 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
126 if (!certList.isValid()) {
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
127 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
128 }
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
129 else {
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
130 loadCertificateTable();
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 }
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
133
358
9ba7b4b4c1de Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 348
diff changeset
134 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
135 {
9ba7b4b4c1de Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 348
diff changeset
136 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
137 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
138 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
139 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
140 }
9ba7b4b4c1de Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 348
diff changeset
141
344
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
142 void AdministratorWindow::loadCertificateTable() {
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
143 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
144 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
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
9ba7b4b4c1de Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 348
diff changeset
148 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
149 {
9ba7b4b4c1de Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 348
diff changeset
150 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
151 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
152 }
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
153 }
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
154
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
155 void AdministratorWindow::showSettings()
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
156 {
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
157 qDebug() << "show settingsdialog";
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
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
160 void AdministratorWindow::showHelp()
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
161 {
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
162 qDebug() << "show helpdialog";
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
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
165 void AdministratorWindow::showAbout()
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
166 {
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
167 qDebug() << "show aboutdialog";
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
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
170 void AdministratorWindow::createInstaller()
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
171 {
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
172 qDebug() << "create Installer";
362
857ae1ffdd6f Open the new dialog from the main menu.
Raimund Renkert <rrenkert@intevation.de>
parents: 358
diff changeset
173 CreateInstallerDialog *dialog = new CreateInstallerDialog(this);
857ae1ffdd6f Open the new dialog from the main menu.
Raimund Renkert <rrenkert@intevation.de>
parents: 358
diff changeset
174 dialog->show();
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
175 }
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
176

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