Skip to content
Snippets Groups Projects
Commit 71135113 authored by andrey.daragan's avatar andrey.daragan
Browse files

features-3108

parent abff247b
No related branches found
No related tags found
1 merge request!11Cellframe clone
......@@ -81,6 +81,7 @@ void DapServiceController::requestToService(const QString &asServiceName, const
{
DapAbstractCommand * transceiver = dynamic_cast<DapAbstractCommand*>(m_DAPRpcSocket->findService(asServiceName));
Q_ASSERT(transceiver);
disconnect(transceiver, SIGNAL(serviceResponded(QVariant)), this, SLOT(findEmittedSignal(QVariant)));
connect(transceiver, SIGNAL(serviceResponded(QVariant)), SLOT(findEmittedSignal(QVariant)));
transceiver->requestToService(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
}
......@@ -186,7 +187,6 @@ void DapServiceController::registerCommand()
void DapServiceController::findEmittedSignal(const QVariant &aValue)
{
DapAbstractCommand * transceiver = dynamic_cast<DapAbstractCommand *>(sender());
disconnect(transceiver, SIGNAL(serviceResponded(QVariant)), this, SLOT(findEmittedSignal(QVariant)));
Q_ASSERT(transceiver);
auto service = std::find_if(m_transceivers.begin(), m_transceivers.end(), [=] (const QPair<DapAbstractCommand*, QString>& it)
{
......
......@@ -82,7 +82,7 @@ DapDashboardScreenForm
height: 16 * pt
hoverEnabled: true
onClicked: textMetworkAddress.copy()
onClicked: textMetworkAddress.copyFullText()
Image
......
......@@ -18,7 +18,7 @@ DapAbstractRightPanel
property string dapCurrentWallet
property alias dapTextSenderWalletAddress: textSenderWalletAddress.text
property alias dapTextSenderWalletAddress: textSenderWalletAddress.fullText
/// @param dapTextInputRecipientWalletAddress Recipient wallet address input field.
property alias dapTextInputRecipientWalletAddress: textInputRecipientWalletAddress
......@@ -154,7 +154,7 @@ DapAbstractRightPanel
anchors.leftMargin: 20 * pt
anchors.rightMargin: 20 * pt
}
Text
DapText
{
id: textSenderWalletAddress
width: 328 * pt
......@@ -169,7 +169,6 @@ DapAbstractRightPanel
font.styleName: "Normal"
font.weight: Font.Normal
color: "#757184"
elide: Text.ElideRight
}
}
......
......@@ -8,55 +8,35 @@ DapHistoryScreenForm
id: historyScreen
ListModel
{
id: testModel
ListElement
{
date: "6, february"
token: "KELT"
status: "Sent"
amount: "165489878556"
}
ListElement
{
date: "6, february"
token: "DAG"
status: "Received"
amount: "333559878556"
}
ListElement
{
date: "5, february"
token: "KELT"
status: "Error"
amount: "165489878556"
}
ListElement
{
date: "5, february"
token: "DAG"
status: "Panding"
amount: "333559878556"
}
ListElement
{
date: "7, february"
token: "DAG"
status: "Received"
amount: "333559878556"
}
ListElement
id: modelHistory
}
Component.onCompleted:
{
for(var i=0; i < dapModelWallets.count; ++i)
{
date: "3, february"
token: "KELT"
status: "Error"
amount: "165489878556"
modelHistory.clear()
dapServiceController.requestToService("DapGetWalletHistoryCommand",
dapServiceController.CurrentNetwork,
dapServiceController.CurrentChain,
dapWallets[i].findAddress(dapServiceController.CurrentNetwork),
dapWallets[i].Name)
}
ListElement
}
Connections
{
target: dapServiceController
onWalletHistoryReceived:
{
date: "5, february"
token: "DAG"
status: "Panding"
amount: "333559878556"
for (var q = 0; q < walletHistory.length; ++q)
{
modelHistory.append({ "wallet" : walletHistory[q].Wallet,
"name" : walletHistory[q].Name,
"status" : walletHistory[q].Status,
"amount" : walletHistory[q].Amount,
"date" : walletHistory[q].Date})
}
}
}
......@@ -130,7 +110,7 @@ DapHistoryScreenForm
{
id: textTokenName
anchors.fill: parent
text: token
text: name
color: "#070023"
font.family: "Roboto"
font.styleName: "Normal"
......@@ -195,7 +175,7 @@ DapHistoryScreenForm
id: lblAmount
width: parent.width
property string sign: (status === "Sent" || status === "Pending") ? "- " : "+ "
text: sign + amount + " " + token
text: sign + amount + " " + name
color: "#070023"
font.family: "Roboto"
font.styleName: "Normal"
......
......@@ -11,10 +11,11 @@ DapAbstractScreen
anchors.topMargin: 24 * pt
anchors.leftMargin: 24 * pt
anchors.rightMargin: 24 * pt
model: testModel
model: modelHistory
delegate: delegateToken
section.property: "date"
section.criteria: ViewSection.FullString
section.delegate: delegateDate
clip: true
}
}
......@@ -2,11 +2,11 @@
DapWalletHistoryEvent::DapWalletHistoryEvent(QObject *parent) : QObject(parent)
{
}
DapWalletHistoryEvent::DapWalletHistoryEvent(const DapWalletHistoryEvent &aHistoryEvent)
: m_sName(aHistoryEvent.m_sName), m_sStatus(aHistoryEvent.m_sStatus),
: QObject(aHistoryEvent.parent()),m_sWallet(aHistoryEvent.m_sWallet), m_sName(aHistoryEvent.m_sName), m_sStatus(aHistoryEvent.m_sStatus),
m_dAmount(aHistoryEvent.m_dAmount), m_sDate(aHistoryEvent.m_sDate)
{
......@@ -14,6 +14,7 @@ DapWalletHistoryEvent::DapWalletHistoryEvent(const DapWalletHistoryEvent &aHisto
DapWalletHistoryEvent &DapWalletHistoryEvent::operator=(const DapWalletHistoryEvent &aHistoryEvent)
{
m_sWallet = aHistoryEvent.m_sWallet;
m_sName = aHistoryEvent.m_sName;
m_sStatus = aHistoryEvent.m_sStatus;
m_dAmount = aHistoryEvent.m_dAmount;
......@@ -23,12 +24,25 @@ DapWalletHistoryEvent &DapWalletHistoryEvent::operator=(const DapWalletHistoryEv
bool DapWalletHistoryEvent::operator==(const DapWalletHistoryEvent &aHistoryEvent) const
{
return (m_sName == aHistoryEvent.m_sName)
return (m_sWallet == aHistoryEvent.m_sWallet)
&& (m_sName == aHistoryEvent.m_sName)
&& (m_sStatus == aHistoryEvent.m_sStatus)
&& (m_dAmount == aHistoryEvent.m_dAmount)
&& (m_sDate == aHistoryEvent.m_sDate);
}
QString DapWalletHistoryEvent::getWallet() const
{
return m_sWallet;
}
void DapWalletHistoryEvent::setWallet(const QString &sWallet)
{
m_sWallet = sWallet;
emit walletChanged(m_sWallet);
}
QString DapWalletHistoryEvent::getName() const
{
return m_sName;
......@@ -79,7 +93,8 @@ void DapWalletHistoryEvent::setDate(const QString &sDate)
QDataStream& operator << (QDataStream& aOut, const DapWalletHistoryEvent& aHistoryEvent)
{
aOut << aHistoryEvent.m_sName
aOut << aHistoryEvent.m_sWallet
<< aHistoryEvent.m_sName
<< aHistoryEvent.m_dAmount
<< aHistoryEvent.m_sStatus
<< aHistoryEvent.m_sDate;
......@@ -88,7 +103,8 @@ QDataStream& operator << (QDataStream& aOut, const DapWalletHistoryEvent& aHisto
QDataStream& operator >> (QDataStream& aOut, DapWalletHistoryEvent& aHistoryEvent)
{
aOut >> aHistoryEvent.m_sName;
aOut >> aHistoryEvent.m_sWallet
>> aHistoryEvent.m_sName;
aOut.setFloatingPointPrecision(QDataStream::DoublePrecision);
aOut >> aHistoryEvent.m_dAmount;
aOut >> aHistoryEvent.m_sStatus
......
......@@ -9,6 +9,7 @@ class DapWalletHistoryEvent : public QObject
{
Q_OBJECT
QString m_sWallet;
/// Token name.
QString m_sName;
/// Token balance.
......@@ -24,6 +25,7 @@ public:
DapWalletHistoryEvent& operator=(const DapWalletHistoryEvent& aHistoryEvent);
bool operator==(const DapWalletHistoryEvent& aHistoryEvent) const;
Q_PROPERTY(QString Wallet MEMBER m_sWallet READ getWallet WRITE setWallet NOTIFY walletChanged)
Q_PROPERTY(QString Name MEMBER m_sName READ getName WRITE setName NOTIFY nameChanged)
Q_PROPERTY(double Amount MEMBER m_dAmount READ getAmount WRITE setAmount NOTIFY amountChanged)
Q_PROPERTY(QString Status MEMBER m_sName READ getStatus WRITE setStatus NOTIFY statusChanged)
......@@ -33,12 +35,15 @@ public:
friend QDataStream& operator >> (QDataStream& aOut, DapWalletHistoryEvent& aHistoryEvent);
signals:
void walletChanged(const QString& asWallet);
void nameChanged(const QString& asName);
void amountChanged(const double& adAmount);
void statusChanged(const QString& asStatus);
void dateChanged(const QString& asDate);
public slots:
QString getWallet() const;
void setWallet(const QString &sWallet);
QString getName() const;
void setName(const QString &sName);
double getAmount() const;
......
......@@ -50,6 +50,7 @@ QVariant DapGetWalletHistoryCommand::respondToClient(const QVariant &arg1, const
event.setStatus(match.captured(4) == "send" ? "Sent" : "Received");
event.setAmount(match.captured(5).toDouble());
event.setName(match.captured(6));
event.setWallet(arg4.toString());
events.append(event);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment