Skip to content
Snippets Groups Projects
Commit 896e6035 authored by jonymt's avatar jonymt
Browse files

[*] added comments and code refactoring

parent b719750f
No related branches found
No related tags found
1 merge request!14Features 2448,2533
Pipeline #818 passed with stage
in 3 minutes and 9 seconds
Showing
with 47 additions and 66 deletions
......@@ -48,9 +48,9 @@ signals:
void onLogModel();
/// Signal for sending new transaction history
void sendHistory(const QVariant& aData);
/// Response from service about command request
void responseConsole(const QString& aResponse);
/// Signal about changing history of commands
void sigCmdHistory(const QString& aHistory);
public:
......@@ -118,9 +118,9 @@ public slots:
void getHistory();
/// Send to model new history
void setNewHistory(const QVariant& aData);
/// Commands request
void requestConsole(const QString& aQueue);
/// Get command history
void getCmdHistory();
};
......
......@@ -47,9 +47,11 @@ public slots:
/// Receive command requst for service
/// @param command request
Q_INVOKABLE void receiveRequest(const QString& aCommand);
/// Get current history
/// @return history of commands
Q_INVOKABLE QString getCmdHistory();
/// Receive new history of commands
/// @param last 50 commands
void receiveCmdHistory(const QString& aHistory);
signals:
......@@ -59,7 +61,8 @@ signals:
/// Signal for getting response from service
/// @param result of command
void sendResponse(QString response);
/// Signal for view about changing history
/// @param last 50 commands
void cmdHistoryChanged(QString history);
};
......
......@@ -68,19 +68,20 @@ public:
/// @param aiTimeStamp Timestamp start reading logging.
/// @param aiRowCount Number of lines displayed.
void getNodeLogs(int aiTimeStamp, int aiRowCount) const;
/// Get wallets
Q_INVOKABLE void getWallets() const;
DapLogModel getLogModel() const;
void setLogModel(const DapLogModel &dapLogModel);
/// Add new wallet
/// @param wallet
Q_INVOKABLE void addWallet(const QString& asWalletName);
Q_INVOKABLE void removeWallet(int index, const QString& asWalletName);
Q_INVOKABLE void sendToken(const QString &asSendWallet, const QString& asAddressReceiver, const QString& asToken, const QString& aAmount);
Q_INVOKABLE void executeCommand(const QString& command);
void getWalletInfo(const QString& asWalletName);
/// Get history of commands
void getCmdHistory();
signals:
......
......@@ -64,7 +64,7 @@ Page {
}
ListElement {
name: qsTr("Console")
page: "DapUiQmlScreenConsoleForm.qml"
page: "DapUiQmlScreenConsoleForm.ui.qml"
source: "qrc:/Resources/Icons/defaul_icon.png"
}
ListElement {
......
......@@ -5,6 +5,9 @@ import QtQuick.Layouts 1.13
Rectangle {
property alias textAreaCmdHistory: txtCommand
property alias textAreaCmd: consoleCmd
ColumnLayout {
anchors.fill: parent
......@@ -20,9 +23,6 @@ Rectangle {
text: dapConsoleModel.getCmdHistory();
selectByMouse: true
wrapMode: TextArea.WordWrap
color: "#707070"
font.family: "Roboto"
font.pixelSize: 20 * pt
Keys.onPressed: {
switch(event.key)
......@@ -48,9 +48,9 @@ Rectangle {
id: promt
verticalAlignment: Qt.AlignVCenter
text: ">"
color: "#707070"
font.family: "Roboto"
font.pixelSize: 20 * pt
color: consoleCmd.color
font.family: consoleCmd.font.family
font.pixelSize: consoleCmd.font.pixelSize
}
TextArea {
......@@ -59,9 +59,6 @@ Rectangle {
Layout.fillWidth: true
height: contentChildren.height
wrapMode: TextArea.Wrap
color: "#707070"
font.family: "Roboto"
font.pixelSize: 20 * pt
placeholderText: qsTr("Type here...")
selectByMouse: true
focus: true
......
import QtQuick 2.4
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.13
DapUiQmlWidgetConsole {
textAreaCmdHistory.color: "#707070"
textAreaCmdHistory.font.family: "Roboto"
textAreaCmdHistory.font.pixelSize: 20 * pt
textAreaCmd.color: "#707070"
textAreaCmd.font.family: "Roboto"
textAreaCmd.font.pixelSize: 20 * pt
}
......@@ -28,5 +28,4 @@ Component {
height: 18 * pt
}
}
}
......@@ -5,44 +5,4 @@ DapUiQmlWidgetLastActions {
id: lastActionsPanel
viewModel: dapConsoleModel
viewDelegate: DapUiQmlWidgetConsoleLastActionsDelegateForm {}
// width: lastActionsPanel.width
// height: 60 * pt
// anchors.left: parent.left
// anchors.right: parent.right
// anchors.leftMargin: 18 * pt
// anchors.rightMargin: 18 * pt
// }
// viewDelegate: Component {
// ColumnLayout {
// anchors.left: parent.left
// anchors.right: parent.right
// anchors.leftMargin: 18 * pt
// anchors.rightMargin: 18 * pt
// Rectangle {
// height: 18 * pt
// }
// Text {
// id: textLastCmd
// Layout.fillWidth: true
//// anchors.fill: parent
// verticalAlignment: Qt.AlignVCenter
// wrapMode: Text.Wrap
// text: lastCommand
// color: "#5F5F63"
// font.family: "Roboto Regular"
// font.pixelSize: 14 * pt
// clip: true
// }
// Rectangle {
// height: 18 * pt
// }
// }
// }
}
......@@ -56,9 +56,10 @@
<file>DapUiQmlWidgetLastActions.qml</file>
<file>DapUiQmlWidgetLastActionsForm.ui.qml</file>
<file>DapUiQmlScreenHistoryForm.ui.qml</file>
<file>DapUiQmlScreenConsoleForm.qml</file>
<file>DapUiQmlWidgetConsoleForm.qml</file>
<file>DapUiQmlScreenConsoleForm.ui.qml</file>
<file>DapUiQmlWidgetConsoleLastActionsForm.qml</file>
<file>DapUiQmlWidgetConsoleLastActionsDelegateForm.qml</file>
<file>DapUiQmlWidgetConsole.qml</file>
<file>DapUiQmlWidgetConsoleForm.ui.qml</file>
</qresource>
</RCC>
......@@ -16,7 +16,12 @@ private:
public:
explicit DapChainConsoleHandler(QObject *parent = nullptr);
/// Get history of commands
/// @return history
QString getHistory() const;
/// Get result of command
/// @param command
/// @return command result
QString getResult(const QString& aQuery) const;
};
......
......@@ -49,7 +49,7 @@ class DapChainDashboardService : public DapRpcService
DapChainNodeNetworkHandler * m_pDapChainNodeHandler {nullptr};
/// Recipient history of transactions
DapChainHistoryHandler* m_pDapChainHistoryHandler {nullptr};
/// Recipient history of commands
DapChainConsoleHandler* m_pDapChainConsoleHandler {nullptr};
public:
......@@ -105,9 +105,12 @@ public slots:
/// Get history
/// @return QList data history
QVariant getHistory() const;
/// Get result for command
/// @param command
/// @return result
QString getQueryResult(const QString& aQuery) const;
/// Get history of commands
/// @return history of last 50 commands
QString getCmdHistory() const;
private slots:
......
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