Mercurial > trustbridge
comparison ui/administratorwindow.cpp @ 424:81cf25402cb0
Merge
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 17 Apr 2014 08:55:16 +0000 |
parents | b19290d6b148 |
children | d7cda835abd6 |
comparison
equal
deleted
inserted
replaced
423:3d1e9df24803 | 424:81cf25402cb0 |
---|---|
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 | 30 |
31 AdministratorWindow::AdministratorWindow() { | 31 AdministratorWindow::AdministratorWindow() { |
32 setWindowTitle(tr("TrustBridge Administration")); | |
32 QString path = QStandardPaths::locate( | 33 QString path = QStandardPaths::locate( |
33 QStandardPaths::DataLocation, QString("certlist_last.txt")); | 34 QStandardPaths::DataLocation, QString("certlist_last.txt")); |
34 certList.readList(path.toLocal8Bit()); | 35 certList.readList(path.toLocal8Bit()); |
35 createActions(); | 36 createActions(); |
36 createMenuBar(); | 37 createMenuBar(); |
46 void AdministratorWindow::createMenuBar() | 47 void AdministratorWindow::createMenuBar() |
47 { | 48 { |
48 menuBar = new QMenuBar(this); | 49 menuBar = new QMenuBar(this); |
49 QMenu *menu = new QMenu(tr("Menu"), menuBar); | 50 QMenu *menu = new QMenu(tr("Menu"), menuBar); |
50 menuBar->addMenu(menu); | 51 menuBar->addMenu(menu); |
51 QAction *createInstaller = menu->addAction(tr("Create Installer")); | 52 QAction *createInstaller = menu->addAction(tr("Create installer ...")); |
52 QAction *settings = menu->addAction(tr("Settings")); | 53 QAction *about = menu->addAction(tr("About TrustBridge")); |
53 menu->addSeparator(); | |
54 QAction *help = menu->addAction(tr("Help")); | |
55 QAction *about = menu->addAction(tr("About")); | |
56 menu->addSeparator(); | 54 menu->addSeparator(); |
57 QAction *quit = menu->addAction(tr("Quit")); | 55 QAction *quit = menu->addAction(tr("Quit")); |
58 connect(createInstaller, SIGNAL(triggered()), this, SLOT(createInstaller())); | 56 connect(createInstaller, SIGNAL(triggered()), this, SLOT(createInstaller())); |
59 connect(settings, SIGNAL(triggered()), this, SLOT(showSettings())); | |
60 connect(help, SIGNAL(triggered()), this, SLOT(showHelp())); | |
61 connect(about, SIGNAL(triggered()), this, SLOT(showAbout())); | 57 connect(about, SIGNAL(triggered()), this, SLOT(showAbout())); |
62 connect(quit, SIGNAL(triggered()), qApp, SLOT(quit())); | 58 connect(quit, SIGNAL(triggered()), qApp, SLOT(quit())); |
63 setMenuBar(menuBar); | 59 setMenuBar(menuBar); |
64 } | 60 } |
65 | 61 |
74 QHBoxLayout *headerLayout = new QHBoxLayout; | 70 QHBoxLayout *headerLayout = new QHBoxLayout; |
75 QVBoxLayout *headerTextLayout = new QVBoxLayout; | 71 QVBoxLayout *headerTextLayout = new QVBoxLayout; |
76 QHBoxLayout *bottomLayout = new QHBoxLayout; | 72 QHBoxLayout *bottomLayout = new QHBoxLayout; |
77 | 73 |
78 // The certificate list | 74 // The certificate list |
79 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); | 75 QGroupBox *certBox = new QGroupBox( |
76 tr("All managed root certificates of the certificate list:")); | |
80 certificateView = new QTableView; | 77 certificateView = new QTableView; |
81 certificateModel = new CertificateTabelModel(); | 78 certificateModel = new CertificateTabelModel(); |
82 QSortFilterProxyModel *filterModel = new QSortFilterProxyModel(this); | 79 QSortFilterProxyModel *filterModel = new QSortFilterProxyModel(this); |
83 filterModel->setSourceModel(certificateModel); | 80 filterModel->setSourceModel(certificateModel); |
84 CertificateTableDelegate *delegate = new CertificateTableDelegate(certificateView); | 81 CertificateTableDelegate *delegate = new CertificateTableDelegate(certificateView); |
97 // The header (icon, about text) | 94 // The header (icon, about text) |
98 QImage *logoImage = new QImage(":/img/logo.png"); | 95 QImage *logoImage = new QImage(":/img/logo.png"); |
99 QLabel *logo = new QLabel; | 96 QLabel *logo = new QLabel; |
100 logo->setBackgroundRole(QPalette::Base); | 97 logo->setBackgroundRole(QPalette::Base); |
101 logo->setPixmap(QPixmap::fromImage(*logoImage)); | 98 logo->setPixmap(QPixmap::fromImage(*logoImage)); |
102 QLabel *title = new QLabel("<h2>" + tr("Administrator Application") + "</h2>"); | 99 QLabel *title = new QLabel("<h2>" + tr("TrustBridge Adminstration") + "</h2>"); |
103 QLabel *subTitle = new QLabel("This Software creates a signed file containing certificates"); | 100 QLabel *subTitle = new QLabel( |
101 tr("Management application of the BSI certificate installer")); | |
104 headerTextLayout->addWidget(title); | 102 headerTextLayout->addWidget(title); |
105 headerTextLayout->addWidget(subTitle); | 103 headerTextLayout->addWidget(subTitle); |
106 headerLayout->addWidget(logo); | 104 headerLayout->addWidget(logo); |
107 headerLayout->addLayout(headerTextLayout); | 105 headerLayout->addLayout(headerTextLayout); |
108 headerLayout->setStretch(0, 0); | 106 headerLayout->setStretch(0, 0); |
109 headerLayout->setStretch(1, 10); | 107 headerLayout->setStretch(1, 10); |
110 | 108 |
111 // The buttons. | 109 // The buttons. |
112 bottomLayout->setAlignment(Qt::AlignBottom); | 110 bottomLayout->setAlignment(Qt::AlignBottom); |
113 saveButton = new QPushButton(tr("Save")); | 111 saveButton = new QPushButton(QIcon(":/img/document-save.png"), tr("Save list")); |
114 connect(saveButton, SIGNAL(clicked()), this, SLOT(saveCertificateFile())); | 112 connect(saveButton, SIGNAL(clicked()), this, SLOT(saveCertificateFile())); |
115 loadButton = new QPushButton(tr("Load")); | 113 loadButton = new QPushButton(QIcon(":/img/document-open.png"), tr("Load list")); |
116 connect(loadButton, SIGNAL(clicked()), this, SLOT(loadCertificateFile())); | 114 connect(loadButton, SIGNAL(clicked()), this, SLOT(loadCertificateFile())); |
117 addButton = new QPushButton(tr("Add")); | 115 addButton = new QPushButton(QIcon(":/img/document-new.png"), tr("Add certificate")); |
118 connect(addButton, SIGNAL(clicked()), this, SLOT(addCertificates())); | 116 connect(addButton, SIGNAL(clicked()), this, SLOT(addCertificates())); |
119 removeButton = new QPushButton(tr("Remove")); | 117 removeButton = new QPushButton(QIcon(":/img/document-close.png"), tr("Remove certificate")); |
120 removeButton->setEnabled(false); | 118 removeButton->setEnabled(false); |
121 connect(removeButton, SIGNAL(clicked()), this, SLOT(removeCertificates())); | 119 connect(removeButton, SIGNAL(clicked()), this, SLOT(removeCertificates())); |
122 bottomLayout->addWidget(saveButton); | 120 bottomLayout->addWidget(saveButton); |
123 bottomLayout->addWidget(loadButton); | 121 bottomLayout->addWidget(loadButton); |
124 bottomLayout->addWidget(addButton); | 122 bottomLayout->addWidget(addButton); |