Mercurial > trustbridge
annotate ui/createinstallerdialog.cpp @ 515:9d3880db6ba7
Improve error handlig and persist user decisions
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 28 Apr 2014 14:02:40 +0000 |
parents | d1819cd56dee |
children | 3332db04c77d |
rev | line source |
---|---|
404 | 1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU GPL (v>=2) | |
5 * and comes with ABSOLUTELY NO WARRANTY! | |
6 * See LICENSE.txt for details. | |
7 */ | |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 #include "createinstallerdialog.h" |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 #include <QDebug> |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 #include <QDir> |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 #include <QPushButton> |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 #include <QGroupBox> |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 #include <QHBoxLayout> |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 #include <QVBoxLayout> |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 #include <QLabel> |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 #include <QFileDialog> |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
17 #include <QSettings> |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
18 #include <QMessageBox> |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 CreateInstallerDialog::CreateInstallerDialog(QMainWindow *parent) : |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 QDialog(parent) |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 { |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
23 QSettings settings; |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
24 setWindowTitle(tr("Create binary installer")); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 setupGUI(); |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
26 resize(500, 250); |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
27 mCertFile->setText(settings.value("CodeSignCert", QString()).toString()); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
28 mBinaryFolder->setText(settings.value("LastBinaryFolder", QString()).toString()); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
29 mSaveFile->setText(settings.value("LastBinOutputFolder", QString()).toString()); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 } |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 void CreateInstallerDialog::setupGUI() |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 { |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 /* Top level layout / widgets */ |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 QVBoxLayout *topLayout = new QVBoxLayout; |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
36 QVBoxLayout *headerLayout = new QVBoxLayout; |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
37 QHBoxLayout *headerSubLayout = new QHBoxLayout; |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
38 QHBoxLayout *centerLayout = new QHBoxLayout; |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 QHBoxLayout *bottomLayout = new QHBoxLayout; |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
40 QVBoxLayout *labelLayout = new QVBoxLayout; |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
41 QVBoxLayout *fieldLayout = new QVBoxLayout; |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
42 QVBoxLayout *buttonLayout = new QVBoxLayout; |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
44 QLabel *header = new QLabel("<h3>" + tr("Create binary installer") + "</h3>"); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
45 QLabel *description = new QLabel( |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
46 tr("Create and sign a TrustBridge binary installer.")); |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
47 headerSubLayout->insertSpacing(0, 40); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
48 headerSubLayout->addWidget(description); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
49 QFrame *headerSeparator = new QFrame(); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
50 headerSeparator->setFrameShape(QFrame::HLine); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
51 headerSeparator->setFrameShadow(QFrame::Sunken); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
52 headerLayout->addWidget(header); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
53 headerLayout->addLayout(headerSubLayout); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
54 headerLayout->addWidget(headerSeparator); |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
55 headerLayout->insertSpacing(4, 10); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
56 |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
57 QLabel *archiveLabel = new QLabel(tr("Select binary folder:")); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
58 QLabel *certLabel = new QLabel(tr("Select code signing certificate:")); |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
59 QLabel *saveLabel = new QLabel(tr("Select output folder:")); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
60 labelLayout->addWidget(archiveLabel); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
61 labelLayout->addWidget(certLabel); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
62 labelLayout->addWidget(saveLabel); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
63 |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
64 mBinaryFolder = new QLineEdit(); |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
65 mCertFile = new QLineEdit(); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
66 mSaveFile = new QLineEdit(); |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
67 fieldLayout->addWidget(mBinaryFolder); |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
68 fieldLayout->addWidget(mCertFile); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
69 fieldLayout->addWidget(mSaveFile); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
70 |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
71 QPushButton *archiveSelect = new QPushButton("..."); |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
72 connect(archiveSelect, SIGNAL(clicked()), this, SLOT(openFolderSelect())); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
73 archiveSelect->setFixedWidth(30); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
74 QPushButton *certSelect = new QPushButton("..."); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
75 connect(certSelect, SIGNAL(clicked()), this, SLOT(openCertificateSelect())); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
76 certSelect->setFixedWidth(30); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
77 QPushButton *saveSelect = new QPushButton("..."); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
78 connect(saveSelect, SIGNAL(clicked()), this, SLOT(openSaveLocation())); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
79 saveSelect->setFixedWidth(30); |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
80 buttonLayout->addWidget(archiveSelect); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
81 buttonLayout->addWidget(certSelect); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
82 buttonLayout->addWidget(saveSelect); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
83 |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
84 centerLayout->addLayout(labelLayout); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
85 centerLayout->addLayout(fieldLayout); |
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
86 centerLayout->addLayout(buttonLayout); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
87 |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
88 QPushButton *create = new QPushButton(tr("Create installer")); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
89 connect(create, SIGNAL(clicked()), this, SLOT(createInstaller())); |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
90 QPushButton *cancel = new QPushButton(tr("Cancel")); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
91 connect(cancel, SIGNAL(clicked()), this, SLOT(close())); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
92 bottomLayout->insertStretch(0, 10); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
93 bottomLayout->addWidget(create); |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
94 bottomLayout->addWidget(cancel); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
95 |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
96 QFrame *bottomSeparator = new QFrame(); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
97 bottomSeparator->setFrameShape(QFrame::HLine); |
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
98 bottomSeparator->setFrameShadow(QFrame::Sunken); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
99 |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
100 topLayout->addLayout(headerLayout); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
101 topLayout->addLayout(centerLayout); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
102 topLayout->insertStretch(2, 10); |
428
d1819cd56dee
Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
426
diff
changeset
|
103 centerLayout->insertSpacing(3, 10); |
414
3d803d383b41
Wording and layout in TrustBridge administration create binary dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
104 topLayout->addWidget(bottomSeparator); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
105 topLayout->addLayout(bottomLayout); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
106 |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
107 setLayout(topLayout); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
108 |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
109 return; |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
110 } |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
111 |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
112 void CreateInstallerDialog::openCertificateSelect() |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
113 { |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
114 QSettings settings; |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
115 QString certFile = QFileDialog::getOpenFileName( |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
116 this, tr("Select certificate"), |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
117 mCertFile->text().isEmpty() ? QDir::homePath() : mCertFile->text(), |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
118 "*.pem *.der *.crt"); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
119 settings.setValue("CodeSignCert", certFile); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
120 mCertFile->setText(certFile); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
121 } |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
122 |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
123 void CreateInstallerDialog::openFolderSelect() |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
124 { |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
125 QSettings settings; |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
126 QString archiveFolder = QFileDialog::getExistingDirectory( |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
127 this, tr("Select binary folder"), |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
128 mBinaryFolder->text().isEmpty() ? QDir::homePath() : mBinaryFolder->text()); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
129 mBinaryFolder->setText(archiveFolder); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
130 settings.setValue("LastBinaryFolder", archiveFolder); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
131 } |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
132 |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
133 void CreateInstallerDialog::openSaveLocation() |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
134 { |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
135 QSettings settings; |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
136 QString saveFile = QFileDialog::getExistingDirectory( |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
137 this, tr("Select target location"), |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
138 mSaveFile->text().isEmpty() ? QDir::homePath() : mSaveFile->text()); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
139 mSaveFile->setText(saveFile); |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
140 settings.setValue("LastBinOutputFolder", saveFile); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
141 } |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
142 |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
143 void CreateInstallerDialog::showErrorMessage(const QString &msg) |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
144 { |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
145 QMessageBox::warning(this, tr("Error!"), msg); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
146 } |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
147 |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
148 void CreateInstallerDialog::createInstaller() |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
149 { |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
150 QDir binDir(mBinaryFolder->text()); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
151 if (mBinaryFolder->text().isEmpty() && binDir.exists()) { |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
152 showErrorMessage(tr("Please select an existing input folder.")); |
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
153 } |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
154 qDebug() << "and now create the installer using:"; |
515
9d3880db6ba7
Improve error handlig and persist user decisions
Andre Heinecke <aheinecke@intevation.de>
parents:
428
diff
changeset
|
155 qDebug() << "source archive: " << mBinaryFolder->text(); |
361
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
156 qDebug() << "certificate: " << mCertFile->text(); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
157 qDebug() << "target" << mSaveFile->text(); |
b67dd46cd4a9
Added dialog to create a new, signed installer binary.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
158 } |