diff --git a/KelvinDashboardGUI/DapCommandController.h b/KelvinDashboardGUI/DapCommandController.h index 7596180dca372a3d814b02489c03ecd6e6bd51f1..f04ea3f1aaf8ccc87165f2a5c2c7bb16403ec8fa 100755 --- a/KelvinDashboardGUI/DapCommandController.h +++ b/KelvinDashboardGUI/DapCommandController.h @@ -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(); }; diff --git a/KelvinDashboardGUI/DapConsoleModel.h b/KelvinDashboardGUI/DapConsoleModel.h index 428983a4494730d0710e18aad5ec4cd05044c10e..00bd228e4d905260b56eb8f6eb988f9fe8dc905d 100644 --- a/KelvinDashboardGUI/DapConsoleModel.h +++ b/KelvinDashboardGUI/DapConsoleModel.h @@ -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); }; diff --git a/KelvinDashboardGUI/DapServiceController.h b/KelvinDashboardGUI/DapServiceController.h index 7dc0553147d9c82191388ff635ef839faf806abb..4663366094fcbad0c7d2a7610fd71e6d23240998 100755 --- a/KelvinDashboardGUI/DapServiceController.h +++ b/KelvinDashboardGUI/DapServiceController.h @@ -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: diff --git a/KelvinDashboardGUI/DapUiQmlScreenConsoleForm.qml b/KelvinDashboardGUI/DapUiQmlScreenConsoleForm.ui.qml similarity index 100% rename from KelvinDashboardGUI/DapUiQmlScreenConsoleForm.qml rename to KelvinDashboardGUI/DapUiQmlScreenConsoleForm.ui.qml diff --git a/KelvinDashboardGUI/DapUiQmlScreenMainWindowForm.ui.qml b/KelvinDashboardGUI/DapUiQmlScreenMainWindowForm.ui.qml index 2604654a6518707fc50f4374527f059ace5bc867..da3b890a6e1a6b55b9dfce28f743851fccaf86e7 100644 --- a/KelvinDashboardGUI/DapUiQmlScreenMainWindowForm.ui.qml +++ b/KelvinDashboardGUI/DapUiQmlScreenMainWindowForm.ui.qml @@ -64,7 +64,7 @@ Page { } ListElement { name: qsTr("Console") - page: "DapUiQmlScreenConsoleForm.qml" + page: "DapUiQmlScreenConsoleForm.ui.qml" source: "qrc:/Resources/Icons/defaul_icon.png" } ListElement { diff --git a/KelvinDashboardGUI/DapUiQmlWidgetConsoleForm.qml b/KelvinDashboardGUI/DapUiQmlWidgetConsole.qml similarity index 87% rename from KelvinDashboardGUI/DapUiQmlWidgetConsoleForm.qml rename to KelvinDashboardGUI/DapUiQmlWidgetConsole.qml index 159660d826b86d04731a212ebfd9d170e6b9ae2e..7610a2b08f6c6af9085bc0a9ff7c8d4ea62a30a0 100644 --- a/KelvinDashboardGUI/DapUiQmlWidgetConsoleForm.qml +++ b/KelvinDashboardGUI/DapUiQmlWidgetConsole.qml @@ -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 diff --git a/KelvinDashboardGUI/DapUiQmlWidgetConsoleForm.ui.qml b/KelvinDashboardGUI/DapUiQmlWidgetConsoleForm.ui.qml new file mode 100644 index 0000000000000000000000000000000000000000..1b3ac691dd07cd3d8da0550e27978bac1292eacf --- /dev/null +++ b/KelvinDashboardGUI/DapUiQmlWidgetConsoleForm.ui.qml @@ -0,0 +1,12 @@ +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 +} diff --git a/KelvinDashboardGUI/DapUiQmlWidgetConsoleLastActionsDelegateForm.qml b/KelvinDashboardGUI/DapUiQmlWidgetConsoleLastActionsDelegateForm.qml index 5abde372b064a78ef8e4e5ccb1ba52160f887815..3092bc5c15cf97d79817c358a3416c13bcc44a73 100644 --- a/KelvinDashboardGUI/DapUiQmlWidgetConsoleLastActionsDelegateForm.qml +++ b/KelvinDashboardGUI/DapUiQmlWidgetConsoleLastActionsDelegateForm.qml @@ -28,5 +28,4 @@ Component { height: 18 * pt } } - } diff --git a/KelvinDashboardGUI/DapUiQmlWidgetConsoleLastActionsForm.qml b/KelvinDashboardGUI/DapUiQmlWidgetConsoleLastActionsForm.qml index 3b47528267e738a5aac4a9a83a3ae4aa546a823e..d2ffab08835e00f5a6f2166fe15ace5d79e72924 100644 --- a/KelvinDashboardGUI/DapUiQmlWidgetConsoleLastActionsForm.qml +++ b/KelvinDashboardGUI/DapUiQmlWidgetConsoleLastActionsForm.qml @@ -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 -// } -// } - -// } - } diff --git a/KelvinDashboardGUI/qml.qrc b/KelvinDashboardGUI/qml.qrc index 908f5403868723ad9717f542ec5569fef4c0ee72..848c3ce91fb90d65b43f96925379f011160a8305 100755 --- a/KelvinDashboardGUI/qml.qrc +++ b/KelvinDashboardGUI/qml.qrc @@ -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> diff --git a/KelvinDashboardService/DapChainConsoleHandler.h b/KelvinDashboardService/DapChainConsoleHandler.h index f64fe62cf2eb68f785da1a1f8625ee7ca375c2bd..907c47e6b9a62b15c312a0abdef0900c76f32df3 100644 --- a/KelvinDashboardService/DapChainConsoleHandler.h +++ b/KelvinDashboardService/DapChainConsoleHandler.h @@ -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; }; diff --git a/KelvinDashboardService/DapChainDashboardService.h b/KelvinDashboardService/DapChainDashboardService.h index 5f9837d0df436cd84f0edac968f79fdad40b6ce3..52fd3438cf9c9693caaa3544796d2ab7fb66b146 100755 --- a/KelvinDashboardService/DapChainDashboardService.h +++ b/KelvinDashboardService/DapChainDashboardService.h @@ -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: