Just Wonder
5 years ago
9 changed files with 203 additions and 2 deletions
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>KevaAddKeyDialog</class> |
||||
<widget class="QDialog" name="KevaAddKeyDialog"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>800</width> |
||||
<height>400</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string notr="true">Add New Key-Value Pair</string> |
||||
</property> |
||||
<layout class="QVBoxLayout" name="verticalLayout"> |
||||
<item> |
||||
<widget class="QLabel" name="label_1"> |
||||
<property name="text"> |
||||
<string>Key</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLineEdit" name="keyText"> |
||||
<property name="toolTip"> |
||||
<string>New value</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<spacer name="horizontalSpacer"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>40</width> |
||||
<height>15</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="label_2"> |
||||
<property name="text"> |
||||
<string>Value</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QTextEdit" name="valueText"> |
||||
<property name="toolTip"> |
||||
<string>New value</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDialogButtonBox" name="buttonBox"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="standardButtons"> |
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<resources/> |
||||
</ui> |
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) 2011-2017 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <qt/kevaaddkeydialog.h> |
||||
#include <qt/forms/ui_kevaaddkeydialog.h> |
||||
|
||||
#include <qt/kevatablemodel.h> |
||||
|
||||
#include <QPushButton> |
||||
|
||||
KevaAddKeyDialog::KevaAddKeyDialog(QWidget *parent) : |
||||
QDialog(parent), |
||||
ui(new Ui::KevaAddKeyDialog) |
||||
{ |
||||
ui->setupUi(this); |
||||
connect(ui->buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(cancel())); |
||||
connect(ui->buttonBox->button(QDialogButtonBox::Save), SIGNAL(clicked()), this, SLOT(create())); |
||||
connect(ui->keyText, SIGNAL(textChanged(const QString &)), this, SLOT(onKeyChanged(const QString &))); |
||||
ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); |
||||
} |
||||
|
||||
KevaAddKeyDialog::~KevaAddKeyDialog() |
||||
{ |
||||
delete ui; |
||||
} |
||||
|
||||
void KevaAddKeyDialog::create() |
||||
{ |
||||
QDialog::close(); |
||||
} |
||||
|
||||
void KevaAddKeyDialog::cancel() |
||||
{ |
||||
QDialog::close(); |
||||
} |
||||
|
||||
void KevaAddKeyDialog::onKeyChanged(const QString& key) |
||||
{ |
||||
bool enabled = key.length() > 0; |
||||
ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(enabled); |
||||
} |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) 2011-2014 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_QT_KEVAADDKEYDIALOG_H |
||||
#define BITCOIN_QT_KEVAADDKEYDIALOG_H |
||||
|
||||
#include <QObject> |
||||
#include <QString> |
||||
|
||||
#include <QDialog> |
||||
|
||||
namespace Ui { |
||||
class KevaAddKeyDialog; |
||||
} |
||||
|
||||
QT_BEGIN_NAMESPACE |
||||
class QModelIndex; |
||||
QT_END_NAMESPACE |
||||
|
||||
/** Dialog add new key-value pair. */ |
||||
class KevaAddKeyDialog : public QDialog |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit KevaAddKeyDialog(QWidget *parent = 0); |
||||
~KevaAddKeyDialog(); |
||||
|
||||
private: |
||||
Ui::KevaAddKeyDialog *ui; |
||||
|
||||
public Q_SLOTS: |
||||
void create(); |
||||
void cancel(); |
||||
void onKeyChanged(const QString& key); |
||||
}; |
||||
|
||||
#endif // BITCOIN_QT_KEVAADDKEYDIALOG_H
|
Loading…
Reference in new issue