Browse Source

WIP: added create new namespace dialog.

kevaview
Just Wonder 5 years ago
parent
commit
54d326c088
  1. 4
      src/Makefile.qt.include
  2. 2
      src/qt/forms/kevadialog.ui
  3. 94
      src/qt/forms/kevanewnamespacedialog.ui
  4. 11
      src/qt/kevadialog.cpp
  5. 1
      src/qt/kevadialog.h
  6. 28
      src/qt/kevanewnamespacedialog.cpp
  7. 32
      src/qt/kevanewnamespacedialog.h

4
src/Makefile.qt.include

@ -137,6 +137,7 @@ QT_FORMS_UI = \ @@ -137,6 +137,7 @@ QT_FORMS_UI = \
qt/forms/receiverequestdialog.ui \
qt/forms/kevadialog.ui \
qt/forms/kevadetaildialog.ui \
qt/forms/kevanewnamespacedialog.ui \
qt/forms/debugwindow.ui \
qt/forms/sendcoinsdialog.ui \
qt/forms/sendcoinsentry.ui \
@ -177,6 +178,7 @@ QT_MOC_CPP = \ @@ -177,6 +178,7 @@ QT_MOC_CPP = \
qt/moc_recentrequeststablemodel.cpp \
qt/moc_kevatablemodel.cpp \
qt/moc_kevadetaildialog.cpp \
qt/moc_kevanewnamespacedialog.cpp \
qt/moc_rpcconsole.cpp \
qt/moc_sendcoinsdialog.cpp \
qt/moc_sendcoinsentry.cpp \
@ -266,6 +268,7 @@ BITCOIN_QT_H = \ @@ -266,6 +268,7 @@ BITCOIN_QT_H = \
qt/kevadialog.h \
qt/kevatablemodel.h \
qt/kevadetaildialog.h \
qt/kevanewnamespacedialog.h \
qt/utilitydialog.h \
qt/walletframe.h \
qt/walletmodel.h \
@ -384,6 +387,7 @@ BITCOIN_QT_WALLET_CPP = \ @@ -384,6 +387,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/kevadialog.cpp \
qt/kevatablemodel.cpp \
qt/kevadetaildialog.cpp \
qt/kevanewnamespacedialog.cpp \
qt/walletframe.cpp \
qt/walletmodel.cpp \
qt/walletmodeltransaction.cpp \

2
src/qt/forms/kevadialog.ui

@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="createNamespaceButton">
<widget class="QPushButton" name="createNamespace">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>

94
src/qt/forms/kevanewnamespacedialog.ui

@ -0,0 +1,94 @@ @@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KevaNewNamespaceDialog</class>
<widget class="QDialog" name="KevaNewNamespaceDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>100</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">Create New Namespace</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="toolTip">
<string>The name of the namespace.</string>
</property>
<property name="text">
<string>Name:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>namespaceText</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="namespaceText">
<property name="toolTip">
<string>This pane allows the creation of a new Keva namespace</string>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</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/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>KevaNewNamespaceDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>KevaNewNamespaceDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

11
src/qt/kevadialog.cpp

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
#include <qt/receiverequestdialog.h>
#include <qt/kevatablemodel.h>
#include <qt/kevadetaildialog.h>
#include <qt/kevanewnamespacedialog.h>
#include <qt/walletmodel.h>
#include <QAction>
@ -120,6 +121,16 @@ void KevaDialog::updateDisplayUnit() @@ -120,6 +121,16 @@ void KevaDialog::updateDisplayUnit()
}
}
void KevaDialog::on_createNamespace_clicked()
{
if(!model || !model->getKevaTableModel())
return;
KevaNewNamespaceDialog *dialog = new KevaNewNamespaceDialog(this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
void KevaDialog::on_showContent_clicked()
{
if(!model || !model->getKevaTableModel())

1
src/qt/kevadialog.h

@ -65,6 +65,7 @@ private: @@ -65,6 +65,7 @@ private:
private Q_SLOTS:
void on_showContent_clicked();
void on_createNamespace_clicked();
void on_showRequestButton_clicked();
void on_removeRequestButton_clicked();
void on_kevaView_doubleClicked(const QModelIndex &index);

28
src/qt/kevanewnamespacedialog.cpp

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
// 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/kevanewnamespacedialog.h>
#include <qt/forms/ui_kevanewnamespacedialog.h>
#include <qt/kevatablemodel.h>
#include <QModelIndex>
KevaNewNamespaceDialog::KevaNewNamespaceDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::KevaNewNamespaceDialog)
{
ui->setupUi(this);
}
void KevaNewNamespaceDialog::accept()
{
// Create the namespace here.
QDialog::accept();
}
KevaNewNamespaceDialog::~KevaNewNamespaceDialog()
{
delete ui;
}

32
src/qt/kevanewnamespacedialog.h

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
// 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_KEVANEWNMAESPACEDIALOG_H
#define BITCOIN_QT_KEVANEWNMAESPACEDIALOG_H
#include <QObject>
#include <QString>
#include <QDialog>
namespace Ui {
class KevaNewNamespaceDialog;
}
/** Dialog showing namepsace creation. */
class KevaNewNamespaceDialog : public QDialog
{
Q_OBJECT
public:
explicit KevaNewNamespaceDialog(QWidget *parent = 0);
~KevaNewNamespaceDialog();
void accept();
private:
Ui::KevaNewNamespaceDialog *ui;
};
#endif // BITCOIN_QT_KEVANEWNMAESPACEDIALOG_H
Loading…
Cancel
Save