simplified ui and remove unused buttons and text boxes
parent
1fd7baea4c
commit
db79a91afa
|
|
@ -14,8 +14,6 @@ AppWindow::AppWindow() : QMainWindow(nullptr), ui(new Ui::MainWindow()) {
|
|||
ui->setupUi(this);
|
||||
connect(ui->btnFolderSelect, &QToolButton::clicked, this,
|
||||
&AppWindow::onAppFolderSelect_click);
|
||||
connect(ui->btnSelectPublicKey, &QToolButton::clicked, this,
|
||||
&AppWindow::onPublicKeySelect_click);
|
||||
connect(ui->btnSign, &QPushButton::clicked, this, &AppWindow::onSign_click);
|
||||
connect(ui->btnVerify, &QPushButton::clicked, this,
|
||||
&AppWindow::onVerify_click);
|
||||
|
|
@ -28,22 +26,9 @@ void AppWindow::onAppFolderSelect_click() {
|
|||
this, tr("Open Directory"), basePath,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
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() {
|
||||
std::string dir = ui->txtFolderPath->text().toStdString();
|
||||
IntegretyCheck integretyCheck(dir, true);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<width>696</width>
|
||||
<height>375</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
@ -16,40 +16,21 @@
|
|||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblPublicKey">
|
||||
<property name="text">
|
||||
<string>PublicKey:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="hLayoutAppInput">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblFolderPath">
|
||||
<property name="text">
|
||||
<string>Application Folder:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="hLayoutKeyInput">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtPublicKey"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnSelectPublicKey">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
<widget class="QLineEdit" name="txtFolderPath">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="hLayoutAppInput">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtFolderPath"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnFolderSelect">
|
||||
<property name="text">
|
||||
|
|
@ -59,8 +40,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="hLayoutButtons">
|
||||
<item>
|
||||
|
|
@ -78,6 +57,9 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSign">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
|
|
@ -104,6 +86,9 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnVerify">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
|
|
@ -131,14 +116,18 @@
|
|||
</layout>
|
||||
</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>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>txtPublicKey</tabstop>
|
||||
<tabstop>btnSelectPublicKey</tabstop>
|
||||
<tabstop>txtFolderPath</tabstop>
|
||||
<tabstop>btnFolderSelect</tabstop>
|
||||
<tabstop>btnSign</tabstop>
|
||||
|
|
|
|||
Loading…
Reference in New Issue