simplified ui and remove unused buttons and text boxes

master
Arne Schroeder 2019-09-07 21:17:21 +02:00
parent 1fd7baea4c
commit db79a91afa
2 changed files with 28 additions and 54 deletions

View File

@ -14,8 +14,6 @@ AppWindow::AppWindow() : QMainWindow(nullptr), ui(new Ui::MainWindow()) {
ui->setupUi(this); ui->setupUi(this);
connect(ui->btnFolderSelect, &QToolButton::clicked, this, connect(ui->btnFolderSelect, &QToolButton::clicked, this,
&AppWindow::onAppFolderSelect_click); &AppWindow::onAppFolderSelect_click);
connect(ui->btnSelectPublicKey, &QToolButton::clicked, this,
&AppWindow::onPublicKeySelect_click);
connect(ui->btnSign, &QPushButton::clicked, this, &AppWindow::onSign_click); connect(ui->btnSign, &QPushButton::clicked, this, &AppWindow::onSign_click);
connect(ui->btnVerify, &QPushButton::clicked, this, connect(ui->btnVerify, &QPushButton::clicked, this,
&AppWindow::onVerify_click); &AppWindow::onVerify_click);
@ -28,22 +26,9 @@ void AppWindow::onAppFolderSelect_click() {
this, tr("Open Directory"), basePath, this, tr("Open Directory"), basePath,
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
ui->txtFolderPath->setText(dir); ui->txtFolderPath->setText(dir);
QString pubKey = checkPublicKey(dir);
if (!pubKey.isEmpty()) {
ui->txtPublicKey->setText(pubKey);
} }
} }
void AppWindow::onPublicKeySelect_click() {
auto basePath = ui->txtFolderPath->text();
if (basePath.isEmpty()) {
QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
}
QString fileName = QFileDialog::getOpenFileName(
this, tr("Open Public Key File"), basePath, tr("KeyFiles (*.pub)"));
ui->txtPublicKey->setText(fileName);
}
void AppWindow::onSign_click() { void AppWindow::onSign_click() {
std::string dir = ui->txtFolderPath->text().toStdString(); std::string dir = ui->txtFolderPath->text().toStdString();
IntegretyCheck integretyCheck(dir, true); IntegretyCheck integretyCheck(dir, true);

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>696</width>
<height>375</height> <height>375</height>
</rect> </rect>
</property> </property>
@ -16,40 +16,21 @@
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QHBoxLayout" name="hLayoutAppInput">
<item row="1" column="0"> <item>
<widget class="QLabel" name="lblPublicKey">
<property name="text">
<string>PublicKey:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblFolderPath"> <widget class="QLabel" name="lblFolderPath">
<property name="text"> <property name="text">
<string>Application Folder:</string> <string>Application Folder:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="hLayoutKeyInput">
<item> <item>
<widget class="QLineEdit" name="txtPublicKey"/> <widget class="QLineEdit" name="txtFolderPath">
</item> <property name="readOnly">
<item> <bool>true</bool>
<widget class="QToolButton" name="btnSelectPublicKey">
<property name="text">
<string>...</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="hLayoutAppInput">
<item>
<widget class="QLineEdit" name="txtFolderPath"/>
</item>
<item> <item>
<widget class="QToolButton" name="btnFolderSelect"> <widget class="QToolButton" name="btnFolderSelect">
<property name="text"> <property name="text">
@ -59,8 +40,6 @@
</item> </item>
</layout> </layout>
</item> </item>
</layout>
</item>
<item> <item>
<layout class="QHBoxLayout" name="hLayoutButtons"> <layout class="QHBoxLayout" name="hLayoutButtons">
<item> <item>
@ -78,6 +57,9 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="btnSign"> <widget class="QPushButton" name="btnSign">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch> <horstretch>1</horstretch>
@ -104,6 +86,9 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="btnVerify"> <widget class="QPushButton" name="btnVerify">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch> <horstretch>1</horstretch>
@ -131,14 +116,18 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QListWidget" name="listWidget"/> <widget class="QListWidget" name="listWidget">
<property name="font">
<font>
<family>Droid Sans Mono</family>
</font>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>txtPublicKey</tabstop>
<tabstop>btnSelectPublicKey</tabstop>
<tabstop>txtFolderPath</tabstop> <tabstop>txtFolderPath</tabstop>
<tabstop>btnFolderSelect</tabstop> <tabstop>btnFolderSelect</tabstop>
<tabstop>btnSign</tabstop> <tabstop>btnSign</tabstop>