Browse Source

WIP: Showed value detail.

kevaview
Just Wonder 4 years ago
parent
commit
17fe007aca
  1. 5
      src/Makefile.qt.include
  2. 74
      src/qt/forms/kevadetaildialog.ui
  3. 41
      src/qt/forms/kevadialog.ui
  4. 27
      src/qt/kevadetaildialog.cpp
  5. 34
      src/qt/kevadetaildialog.h
  6. 30
      src/qt/kevadialog.cpp
  7. 4
      src/qt/kevadialog.h
  8. 257
      src/qt/locale/bitcoin_en.ts

5
src/Makefile.qt.include

@ -136,6 +136,7 @@ QT_FORMS_UI = \ @@ -136,6 +136,7 @@ QT_FORMS_UI = \
qt/forms/receivecoinsdialog.ui \
qt/forms/receiverequestdialog.ui \
qt/forms/kevadialog.ui \
qt/forms/kevadetaildialog.ui \
qt/forms/debugwindow.ui \
qt/forms/sendcoinsdialog.ui \
qt/forms/sendcoinsentry.ui \
@ -175,6 +176,7 @@ QT_MOC_CPP = \ @@ -175,6 +176,7 @@ QT_MOC_CPP = \
qt/moc_receiverequestdialog.cpp \
qt/moc_recentrequeststablemodel.cpp \
qt/moc_kevatablemodel.cpp \
qt/moc_kevadetaildialog.cpp \
qt/moc_rpcconsole.cpp \
qt/moc_sendcoinsdialog.cpp \
qt/moc_sendcoinsentry.cpp \
@ -262,6 +264,8 @@ BITCOIN_QT_H = \ @@ -262,6 +264,8 @@ BITCOIN_QT_H = \
qt/transactiontablemodel.h \
qt/transactionview.h \
qt/kevadialog.h \
qt/kevatablemodel.h \
qt/kevadetaildialog.h \
qt/utilitydialog.h \
qt/walletframe.h \
qt/walletmodel.h \
@ -379,6 +383,7 @@ BITCOIN_QT_WALLET_CPP = \ @@ -379,6 +383,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/transactionview.cpp \
qt/kevadialog.cpp \
qt/kevatablemodel.cpp \
qt/kevadetaildialog.cpp \
qt/walletframe.cpp \
qt/walletmodel.cpp \
qt/walletmodeltransaction.cpp \

74
src/qt/forms/kevadetaildialog.ui

@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KevaDetailDialog</class>
<widget class="QDialog" name="KevaDetailDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">Value</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextEdit" name="detailText">
<property name="toolTip">
<string>This pane shows the value associated with a give key</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>KevaDetailDialog</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>KevaDetailDialog</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>

41
src/qt/forms/kevadialog.ui

@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
<string>The namespace ID with a prefix "N".</string>
</property>
<property name="text">
<string>&amp;Namespace:</string>
<string>Namespace:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
<string>Show content of the namespace.</string>
</property>
<property name="text">
<string>Show content</string>
<string>Show</string>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
@ -85,14 +85,17 @@ @@ -85,14 +85,17 @@
</item>
<item>
<widget class="QPushButton" name="receiveButton">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Bookmark this namespace</string>
</property>
<property name="text">
<string>&amp;Previously used namespaces</string>
<string>&amp;Bookmark</string>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
@ -100,6 +103,26 @@ @@ -100,6 +103,26 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="createNamespaceButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Create a new namespace</string>
</property>
<property name="text">
<string>&amp;Create</string>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/add</normaloff>:/icons/add</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@ -169,7 +192,7 @@ @@ -169,7 +192,7 @@
</widget>
</item>
<item>
<widget class="QTableView" name="recentRequestsView">
<widget class="QTableView" name="kevaView">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>

27
src/qt/kevadetaildialog.cpp

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
// 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/kevadetaildialog.h>
#include <qt/forms/ui_kevadetaildialog.h>
#include <qt/kevatablemodel.h>
#include <QModelIndex>
KevaDetailDialog::KevaDetailDialog(const QModelIndex &idx, QWidget *parent) :
QDialog(parent),
ui(new Ui::KevaDetailDialog)
{
ui->setupUi(this);
QModelIndex keyIdx = idx.sibling(idx.row(), KevaTableModel::Key);
QModelIndex valueIdx = idx.sibling(idx.row(), KevaTableModel::Value);
setWindowTitle(tr("Value for %1").arg(keyIdx.data(Qt::DisplayRole).toString()));
QString desc = valueIdx.data(Qt::DisplayRole).toString();
ui->detailText->setHtml(desc);
}
KevaDetailDialog::~KevaDetailDialog()
{
delete ui;
}

34
src/qt/kevadetaildialog.h

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
// 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_KEVADETAILDIALOG_H
#define BITCOIN_QT_KEVADETAILDIALOG_H
#include <QObject>
#include <QString>
#include <QDialog>
namespace Ui {
class KevaDetailDialog;
}
QT_BEGIN_NAMESPACE
class QModelIndex;
QT_END_NAMESPACE
/** Dialog showing transaction details. */
class KevaDetailDialog : public QDialog
{
Q_OBJECT
public:
explicit KevaDetailDialog(const QModelIndex &idx, QWidget *parent = 0);
~KevaDetailDialog();
private:
Ui::KevaDetailDialog *ui;
};
#endif // BITCOIN_QT_KEVADETAILDIALOG_H

30
src/qt/kevadialog.cpp

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
#include <qt/platformstyle.h>
#include <qt/receiverequestdialog.h>
#include <qt/kevatablemodel.h>
#include <qt/kevadetaildialog.h>
#include <qt/walletmodel.h>
#include <QAction>
@ -56,7 +57,7 @@ KevaDialog::KevaDialog(const PlatformStyle *_platformStyle, QWidget *parent) : @@ -56,7 +57,7 @@ KevaDialog::KevaDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
contextMenu->addAction(copyAmountAction);
// context menu signals
connect(ui->recentRequestsView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint)));
connect(ui->kevaView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint)));
connect(copyURIAction, SIGNAL(triggered()), this, SLOT(copyURI()));
connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
connect(copyMessageAction, SIGNAL(triggered()), this, SLOT(copyMessage()));
@ -71,7 +72,7 @@ void KevaDialog::setModel(WalletModel *_model) @@ -71,7 +72,7 @@ void KevaDialog::setModel(WalletModel *_model)
if(_model && _model->getOptionsModel())
{
_model->getKevaTableModel()->sort(KevaTableModel::Block, Qt::DescendingOrder);
QTableView* tableView = ui->recentRequestsView;
QTableView* tableView = ui->kevaView;
tableView->verticalHeader()->hide();
tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@ -137,40 +138,37 @@ void KevaDialog::on_showContent_clicked() @@ -137,40 +138,37 @@ void KevaDialog::on_showContent_clicked()
model->getKevaTableModel()->sort(KevaTableModel::Date, Qt::DescendingOrder);
}
void KevaDialog::on_recentRequestsView_doubleClicked(const QModelIndex &index)
void KevaDialog::on_kevaView_doubleClicked(const QModelIndex &index)
{
const KevaTableModel *submodel = model->getKevaTableModel();
ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);
dialog->setModel(model->getOptionsModel());
//dialog->setInfo(submodel->entry(index.row()).recipient);
KevaDetailDialog *dialog = new KevaDetailDialog(index, this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
void KevaDialog::recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
void KevaDialog::kevaView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
{
// Enable Show/Remove buttons only if anything is selected.
bool enable = !ui->recentRequestsView->selectionModel()->selectedRows().isEmpty();
bool enable = !ui->kevaView->selectionModel()->selectedRows().isEmpty();
ui->showRequestButton->setEnabled(enable);
ui->removeRequestButton->setEnabled(enable);
}
void KevaDialog::on_showRequestButton_clicked()
{
if(!model || !model->getKevaTableModel() || !ui->recentRequestsView->selectionModel())
if(!model || !model->getKevaTableModel() || !ui->kevaView->selectionModel())
return;
QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();
QModelIndexList selection = ui->kevaView->selectionModel()->selectedRows();
for (const QModelIndex& index : selection) {
on_recentRequestsView_doubleClicked(index);
on_kevaView_doubleClicked(index);
}
}
void KevaDialog::on_removeRequestButton_clicked()
{
if(!model || !model->getKevaTableModel() || !ui->recentRequestsView->selectionModel())
if(!model || !model->getKevaTableModel() || !ui->kevaView->selectionModel())
return;
QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();
QModelIndexList selection = ui->kevaView->selectionModel()->selectedRows();
if(selection.empty())
return;
// correct for selection mode ContiguousSelection
@ -204,9 +202,9 @@ void KevaDialog::keyPressEvent(QKeyEvent *event) @@ -204,9 +202,9 @@ void KevaDialog::keyPressEvent(QKeyEvent *event)
QModelIndex KevaDialog::selectedRow()
{
if(!model || !model->getKevaTableModel() || !ui->recentRequestsView->selectionModel())
if(!model || !model->getKevaTableModel() || !ui->kevaView->selectionModel())
return QModelIndex();
QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();
QModelIndexList selection = ui->kevaView->selectionModel()->selectedRows();
if(selection.empty())
return QModelIndex();
// correct for selection mode ContiguousSelection

4
src/qt/kevadialog.h

@ -67,8 +67,8 @@ private Q_SLOTS: @@ -67,8 +67,8 @@ private Q_SLOTS:
void on_showContent_clicked();
void on_showRequestButton_clicked();
void on_removeRequestButton_clicked();
void on_recentRequestsView_doubleClicked(const QModelIndex &index);
void recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void on_kevaView_doubleClicked(const QModelIndex &index);
void kevaView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void updateDisplayUnit();
void showMenu(const QPoint &point);
void copyURI();

257
src/qt/locale/bitcoin_en.ts

@ -1160,87 +1160,79 @@ @@ -1160,87 +1160,79 @@
</message>
</context>
<context>
<name>KevaDialog</name>
<name>KevaDetailDialog</name>
<message>
<location filename="../forms/kevadialog.ui" line="+34"/>
<location line="+153"/>
<source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>
<location filename="../forms/kevadetaildialog.ui" line="+20"/>
<source>This pane shows the value associated with a give key</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-150"/>
<source>&amp;Amount:</source>
<location filename="../kevadetaildialog.cpp" line="+17"/>
<source>Value for %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KevaDialog</name>
<message>
<location line="+13"/>
<location line="+46"/>
<source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Kevacoin network.</source>
<location filename="../forms/kevadialog.ui" line="+215"/>
<source>Show the selected request (does the same as double clicking an entry)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-43"/>
<source>&amp;Message:</source>
<location line="-140"/>
<location line="+143"/>
<source>Show</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<location line="-184"/>
<location line="+14"/>
<source>An optional label to associate with the new receiving address.</source>
<source>The namespace ID with a prefix &quot;N&quot;.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-7"/>
<source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>
<source>Use this form to perform Keva database operations.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>&amp;Label:</source>
<translation type="unfinished">&amp;Label:</translation>
</message>
<message>
<location line="+28"/>
<source>&amp;Request payment</source>
<source>Namespace:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Clear all fields of the form.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Clear</source>
<location line="+21"/>
<source>Show content of the namespace.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+78"/>
<source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don&apos;t support them. When unchecked, an address compatible with older wallets will be created instead.</source>
<location line="+23"/>
<source>Bookmark this namespace</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Generate native segwit (Bech32) address</source>
<source>&amp;Bookmark</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+61"/>
<source>Requested payments history</source>
<location line="+17"/>
<source>Create a new namespace</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Show the selected request (does the same as double clicking an entry)</source>
<location line="+3"/>
<source>&amp;Create</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Show</source>
<location line="+72"/>
<source>Content of namespace</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<location line="+45"/>
<source>Remove the selected entries from the list</source>
<translation type="unfinished"></translation>
</message>
@ -1271,201 +1263,30 @@ @@ -1271,201 +1263,30 @@
</message>
</context>
<context>
<name>KevaView</name>
<message>
<location filename="../kevaview.cpp" line="+70"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Enter address, transaction id, or label to search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Min amount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+48"/>
<source>Abandon transaction</source>
<translation type="unfinished"></translation>
</message>
<name>KevaTableModel</name>
<message>
<location line="+1"/>
<source>Increase transaction fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Copy address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy raw transaction</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy full transaction details</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+194"/>
<source>Export Transaction History</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Confirmed</source>
<translation type="unfinished">Confirmed</translation>
</message>
<message>
<location line="+2"/>
<source>Watch-only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<location filename="../kevatablemodel.cpp" line="+21"/>
<source>Date</source>
<translation type="unfinished">Date</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Exporting Failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the transaction history to %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Exporting Successful</source>
<source>Key</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>The transaction history was successfully saved to %1.</source>
<source>Value</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+166"/>
<source>Range:</source>
<location line="+0"/>
<source>Block</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<location line="+73"/>
<source>Requested</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -4199,12 +4020,12 @@ @@ -4199,12 +4020,12 @@
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+291"/>
<location filename="../walletmodel.cpp" line="+296"/>
<source>Send Coins</source>
<translation type="unfinished">Send Coins</translation>
</message>
<message>
<location line="+384"/>
<location line="+389"/>
<location line="+39"/>
<location line="+6"/>
<source>Fee bump error</source>

Loading…
Cancel
Save