From d1daf2371856c8d553d1c4f4a600c91bc68da487 Mon Sep 17 00:00:00 2001 From: "evgenii.tagiltsev" <tagiltsev.evgenii@gmail.com> Date: Wed, 4 Dec 2019 12:41:33 +0100 Subject: [PATCH] [-] trying to fix the capital letters in the paths --- .../Console/DapUiQmlScreenConsoleForm.ui.qml | 23 -- .../Screen/Console/DapUiQmlWidgetConsole.qml | 102 ------ .../Console/DapUiQmlWidgetConsoleForm.ui.qml | 12 - ...mlWidgetConsoleLastActionsDelegateForm.qml | 41 --- .../DapUiQmlWidgetConsoleLastActionsForm.qml | 12 - .../Screen/DapUiQmlScreen.qml | 6 - .../Screen/DapUiQmlScreenMainWindow.qml | 92 ----- .../DapUiQmlScreenMainWindowForm.ui.qml | 162 --------- .../DapUiQmlWidgetStatusBarComboBox.qml | 84 ----- ...apUiQmlWidgetStatusBarComboBoxDelegate.qml | 27 -- .../DapUiQmlWidgetStatusBarContentItem.qml | 11 - .../Dashboard/DapUiQmlScreenDashboard.qml | 212 ------------ .../DapUiQmlScreenExchangeForm.ui.qml | 31 -- .../DapUiQmlWidgetChainExchanges.ui.qml | 14 - ...pUiQmlWidgetExchangeOrderButtonForm.ui.qml | 27 -- ...UiQmlWidgetExchangeOrderContentForm.ui.qml | 73 ---- .../DapUiQmlWidgetExchangeOrderForm.ui.qml | 49 --- ...apUiQmlWidgetExchangeOrderTitleForm.ui.qml | 32 -- .../DapUiQmlWidgetNodeNetworkExplorer.qml | 198 ----------- .../Screen/History/DapUiQmlScreenHistory.qml | 250 -------------- .../History/DapUiQmlScreenHistoryForm.ui.qml | 18 - .../DapUiQmlRecoveryNotesForm.ui.qml | 251 -------------- .../LastAction/DapUiQmlRecoveryQrForm.ui.qml | 172 --------- .../DapUiQmlScreenDialogAddWallet.qml | 35 -- .../DapUiQmlScreenDialogAddWalletForm.ui.qml | 224 ------------ .../DapUiQmlScreenDialogAddWalletHeader.qml | 53 --- .../LastAction/DapUiQmlWalletCreated.qml | 8 - .../DapUiQmlWalletCreatedForm.ui.qml | 68 ---- .../DapUiQmlWalletCreatedHeader.qml | 10 - .../DapUiQmlWidgetHistoryLastActions.qml | 12 - .../LastAction/DapUiQmlWidgetLastActions.qml | 50 --- .../DapUiQmlWidgetLastActionsButtonForm.qml | 91 ----- .../DapUiQmlWidgetLastActionsDelegateForm.qml | 65 ---- .../DapUiQmlWidgetLastActionsForm.ui.qml | 5 - .../DapUiQmlWidgetLastActionsHeaderForm.qml | 27 -- .../DapUiQmlWidgetLastActionsSectionForm.qml | 19 - .../LastAction/DapUiQmlWidgetRightPanel.qml | 5 - .../DapUiQmlWidgetRightPanelForm.ui.qml | 42 --- ...DapUiQmlWidgetScreenDialogAddWallet.ui.qml | 14 - .../DapUiQmlWidgetSignatureTypeComboBox.qml | 58 ---- .../Log/DapUiQmlWidgetChainNodeLogs.qml | 82 ----- .../DapUiQmlWidgetChainNodeLogsForm.ui.qml | 40 --- .../Settings/DapUiQmlScreenSettings.qml | 41 --- .../DapUiQmlScreenSettingsForm.ui.qml | 5 - .../DapUiQmlScreenSettingsSection.qml | 21 -- .../DapUiQmlWidgetSettingsNetwork.qml | 25 -- .../DapUiQmlWidgetSettingsNetworkForm.ui.qml | 6 - .../StatusBar/DapUiQmlWidgetStatusBar.qml | 87 ----- .../DapUiQmlWidgetStatusBarButton.ui.qml | 32 -- .../DapUiQmlWidgetStatusBarComboBoxWallet.qml | 20 -- ...mlWidgetStatusBarComboBoxWalletForm.ui.qml | 6 - .../Screen/VPN/DapUiQmlScreenVpn.qml | 4 - .../Screen/VPN/DapUiQmlScreenVpnForm.ui.qml | 149 -------- .../Screen/VPN/DapUiQmlWidgetSettingsVpn.qml | 67 ---- .../VPN/DapUiQmlWidgetSettingsVpnComboBox.qml | 5 - ...pUiQmlWidgetSettingsVpnComboBoxForm.ui.qml | 32 -- .../VPN/DapUiQmlWidgetSettingsVpnForm.ui.qml | 7 - CellFrameDashboardGUI/Screen/main.qml | 37 -- .../Src/DapChainNodeNetworkExplorer.cpp | 325 ------------------ .../Src/DapChainNodeNetworkModel.cpp | 141 -------- .../Src/DapChainWalletModel.cpp | 188 ---------- .../Src/DapChainWalletsModel.cpp | 114 ------ CellFrameDashboardGUI/Src/DapClipboard.cpp | 17 - .../Src/DapCommandController.cpp | 306 ----------------- CellFrameDashboardGUI/Src/DapConsoleModel.cpp | 101 ------ CellFrameDashboardGUI/Src/DapScreenDialog.cpp | 19 - .../Src/DapScreenDialogChangeWidget.cpp | 19 - .../Src/DapScreenHistoryFilterModel.cpp | 60 ---- .../Src/DapScreenHistoryModel.cpp | 114 ------ .../Src/DapServiceClient.cpp | 150 -------- .../Src/DapServiceClientNativeAbstract.cpp | 53 --- .../Src/DapServiceClientNativeLinux.cpp | 75 ---- .../Src/DapServiceClientNativeMacOS.cpp | 75 ---- .../Src/DapServiceClientNativeWin.cpp | 30 -- .../Src/DapServiceController.cpp | 293 ---------------- .../Src/DapSettingsNetworkModel.cpp | 65 ---- .../Src/DapWalletFilterModel.cpp | 38 -- .../Src/include/DapChainNodeNetworkExplorer.h | 204 ----------- .../Src/include/DapChainNodeNetworkModel.h | 81 ----- .../Src/include/DapChainWalletModel.h | 69 ---- .../Src/include/DapChainWalletsModel.h | 98 ------ .../Src/include/DapClipboard.h | 23 -- .../Src/include/DapCommandController.h | 179 ---------- .../Src/include/DapConsoleModel.h | 69 ---- .../Src/include/DapScreenDialog.h | 33 -- .../Src/include/DapScreenDialogChangeWidget.h | 31 -- .../Src/include/DapScreenHistoryFilterModel.h | 47 --- .../Src/include/DapScreenHistoryModel.h | 60 ---- .../Src/include/DapServiceClient.h | 91 ----- .../include/DapServiceClientNativeAbstract.h | 40 --- .../Src/include/DapServiceClientNativeLinux.h | 21 -- .../Src/include/DapServiceClientNativeMacOS.h | 21 -- .../Src/include/DapServiceClientNativeWin.h | 19 - .../Src/include/DapServiceController.h | 181 ---------- .../Src/include/DapSettingsNetworkModel.h | 56 --- .../Src/include/DapWalletFilterModel.h | 26 -- CellFrameDashboardGUI/Src/main.cpp | 107 ------ 97 files changed, 6990 deletions(-) delete mode 100644 CellFrameDashboardGUI/Screen/Console/DapUiQmlScreenConsoleForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsole.qml delete mode 100644 CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleLastActionsDelegateForm.qml delete mode 100644 CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleLastActionsForm.qml delete mode 100644 CellFrameDashboardGUI/Screen/DapUiQmlScreen.qml delete mode 100644 CellFrameDashboardGUI/Screen/DapUiQmlScreenMainWindow.qml delete mode 100644 CellFrameDashboardGUI/Screen/DapUiQmlScreenMainWindowForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarComboBox.qml delete mode 100644 CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarComboBoxDelegate.qml delete mode 100644 CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarContentItem.qml delete mode 100644 CellFrameDashboardGUI/Screen/Dashboard/DapUiQmlScreenDashboard.qml delete mode 100644 CellFrameDashboardGUI/Screen/Exchange/DapUiQmlScreenExchangeForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetChainExchanges.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderButtonForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderContentForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderTitleForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Explorer/DapUiQmlWidgetNodeNetworkExplorer.qml delete mode 100644 CellFrameDashboardGUI/Screen/History/DapUiQmlScreenHistory.qml delete mode 100644 CellFrameDashboardGUI/Screen/History/DapUiQmlScreenHistoryForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlRecoveryNotesForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlRecoveryQrForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWallet.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWalletForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWalletHeader.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreated.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreatedForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreatedHeader.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetHistoryLastActions.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActions.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsButtonForm.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsDelegateForm.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsHeaderForm.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsSectionForm.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetRightPanel.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetRightPanelForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetScreenDialogAddWallet.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetSignatureTypeComboBox.qml delete mode 100644 CellFrameDashboardGUI/Screen/Log/DapUiQmlWidgetChainNodeLogs.qml delete mode 100644 CellFrameDashboardGUI/Screen/Log/DapUiQmlWidgetChainNodeLogsForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettings.qml delete mode 100644 CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettingsForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettingsSection.qml delete mode 100644 CellFrameDashboardGUI/Screen/Settings/DapUiQmlWidgetSettingsNetwork.qml delete mode 100644 CellFrameDashboardGUI/Screen/Settings/DapUiQmlWidgetSettingsNetworkForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBar.qml delete mode 100644 CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarButton.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWallet.qml delete mode 100644 CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWalletForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/VPN/DapUiQmlScreenVpn.qml delete mode 100644 CellFrameDashboardGUI/Screen/VPN/DapUiQmlScreenVpnForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpn.qml delete mode 100644 CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnComboBox.qml delete mode 100644 CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnComboBoxForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnForm.ui.qml delete mode 100644 CellFrameDashboardGUI/Screen/main.qml delete mode 100644 CellFrameDashboardGUI/Src/DapChainNodeNetworkExplorer.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapChainNodeNetworkModel.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapChainWalletModel.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapChainWalletsModel.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapClipboard.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapCommandController.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapConsoleModel.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapScreenDialog.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapScreenDialogChangeWidget.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapScreenHistoryFilterModel.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapScreenHistoryModel.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapServiceClient.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapServiceClientNativeAbstract.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapServiceClientNativeLinux.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapServiceClientNativeMacOS.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapServiceClientNativeWin.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapServiceController.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapSettingsNetworkModel.cpp delete mode 100644 CellFrameDashboardGUI/Src/DapWalletFilterModel.cpp delete mode 100644 CellFrameDashboardGUI/Src/include/DapChainNodeNetworkExplorer.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapChainNodeNetworkModel.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapChainWalletModel.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapChainWalletsModel.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapClipboard.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapCommandController.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapConsoleModel.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapScreenDialog.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapScreenDialogChangeWidget.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapScreenHistoryFilterModel.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapScreenHistoryModel.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapServiceClient.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapServiceClientNativeAbstract.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapServiceClientNativeLinux.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapServiceClientNativeMacOS.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapServiceClientNativeWin.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapServiceController.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapSettingsNetworkModel.h delete mode 100644 CellFrameDashboardGUI/Src/include/DapWalletFilterModel.h delete mode 100644 CellFrameDashboardGUI/Src/main.cpp diff --git a/CellFrameDashboardGUI/Screen/Console/DapUiQmlScreenConsoleForm.ui.qml b/CellFrameDashboardGUI/Screen/Console/DapUiQmlScreenConsoleForm.ui.qml deleted file mode 100644 index 0bd82d2d6..000000000 --- a/CellFrameDashboardGUI/Screen/Console/DapUiQmlScreenConsoleForm.ui.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick 2.13 -import QtQml 2.12 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 1.4 -import "../" - -DapUiQmlScreen { - SplitView { - anchors.fill: parent - orientation: Qt.Horizontal - anchors.leftMargin: 30 * pt - handleDelegate: Item { } - - - DapUiQmlWidgetConsoleForm { - id: dapConsoleForm - Layout.fillWidth: true - Layout.topMargin: 30 * pt - Layout.rightMargin: 30 * pt - } - } -} diff --git a/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsole.qml b/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsole.qml deleted file mode 100644 index 9ecd40b1c..000000000 --- a/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsole.qml +++ /dev/null @@ -1,102 +0,0 @@ -import QtQuick 2.13 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.13 - -Rectangle { - property alias textAreaCmdHistory: txtCommand - property alias textAreaCmd: consoleCmd - - ColumnLayout { - anchors.fill: parent - - Flickable { - id: scrollCmdHistory - contentY: txtCommand.height - height - Layout.fillWidth: true - Layout.fillHeight: true - clip: true - - TextArea.flickable: TextArea { - id: txtCommand - text: dapConsoleModel.getCmdHistory(); - selectByMouse: true - wrapMode: TextArea.WordWrap - - Keys.onPressed: { - switch(event.key) - { - case Qt.Key_Left: break; - case Qt.Key_Right: break; - case Qt.Key_Up: break; - case Qt.Key_Down: break; - default: event.accepted = - !(event.modifiers & Qt.ControlModifier) || (event.key === Qt.Key_X); break; - } - } - } - - ScrollBar.vertical: ScrollBar { } - ScrollBar.horizontal: ScrollBar { } - } - - RowLayout { - spacing: 0 - - Text { - id: promt - verticalAlignment: Qt.AlignVCenter - text: ">" - color: consoleCmd.color - font.family: consoleCmd.font.family - font.pixelSize: consoleCmd.font.pixelSize - } - - TextArea { - id: consoleCmd - - Layout.fillWidth: true - height: contentChildren.height - wrapMode: TextArea.Wrap - placeholderText: qsTr("Type here...") - selectByMouse: true - focus: true - - Keys.onUpPressed: { - consoleCmd.text = dapConsoleModel.getCommandUp(); - } - - Keys.onDownPressed: { - consoleCmd.text = dapConsoleModel.getCommandDown(); - } - - Keys.onEnterPressed: { - Keys.onReturnPressed(event); - } - - Keys.onReturnPressed: { - txtCommand.append("> " + consoleCmd.text); - if(consoleCmd.text === "") return; - dapConsoleModel.receiveRequest(consoleCmd.text); - consoleCmd.text = ""; - } - } - } - - } - - Connections { - target: dapConsoleModel - onSendResponse: { - txtCommand.append(response); - } - - onCmdHistoryChanged: { - txtCommand.append(history); - } - } - - Component.onCompleted: { - rightPanel.content.currentItem.consoleData = dapConsoleForm.textAreaCmdHistory; - } -} - diff --git a/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleForm.ui.qml b/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleForm.ui.qml deleted file mode 100644 index 1b3ac691d..000000000 --- a/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleForm.ui.qml +++ /dev/null @@ -1,12 +0,0 @@ -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/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleLastActionsDelegateForm.qml b/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleLastActionsDelegateForm.qml deleted file mode 100644 index 9a54cf094..000000000 --- a/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleLastActionsDelegateForm.qml +++ /dev/null @@ -1,41 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.13 - -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 - verticalAlignment: Qt.AlignVCenter - wrapMode: Text.Wrap - text: lastCommand - color: "#5F5F63" - font.family: "Roboto Regular" - font.pixelSize: 14 * pt - clip: true - - MouseArea { - anchors.fill: parent - onClicked: { - consoleData.append("> " + lastCommand); - dapConsoleModel.receiveRequest(lastCommand); - } - } - } - - Rectangle { - height: 18 * pt - } - } -} diff --git a/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleLastActionsForm.qml b/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleLastActionsForm.qml deleted file mode 100644 index d59b10cbf..000000000 --- a/CellFrameDashboardGUI/Screen/Console/DapUiQmlWidgetConsoleLastActionsForm.qml +++ /dev/null @@ -1,12 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.1 -import QtQuick.Layouts 1.13 -import "../LastAction" - -DapUiQmlWidgetLastActions { - property TextArea consoleData - - id: lastActionsPanel - viewModel: dapConsoleModel - viewDelegate: DapUiQmlWidgetConsoleLastActionsDelegateForm { } -} diff --git a/CellFrameDashboardGUI/Screen/DapUiQmlScreen.qml b/CellFrameDashboardGUI/Screen/DapUiQmlScreen.qml deleted file mode 100644 index ad7147400..000000000 --- a/CellFrameDashboardGUI/Screen/DapUiQmlScreen.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.9 -import "LastAction" - -Rectangle { - property DapUiQmlWidgetRightPanel rightPanel -} diff --git a/CellFrameDashboardGUI/Screen/DapUiQmlScreenMainWindow.qml b/CellFrameDashboardGUI/Screen/DapUiQmlScreenMainWindow.qml deleted file mode 100644 index 33f62f756..000000000 --- a/CellFrameDashboardGUI/Screen/DapUiQmlScreenMainWindow.qml +++ /dev/null @@ -1,92 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 1.4 - -DapUiQmlScreenMainWindowForm { - id: dapQmlScreenMainWindow - - Component { - id: componentItemMainMenuTab - - Rectangle { - id: componentItem - property bool isPushed: listViewTabs.currentIndex === index - width: 180 * pt - height: 60 * pt - color: "transparent" - - Image - { - id: imageItem - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: 24 * pt - source: model.normal - height: 18 * pt - width: 18 * pt - } - - Text { - id: textItemMenu - anchors.verticalCenter: parent.verticalCenter - anchors.left: imageItem.right - anchors.leftMargin: 18 * pt - text: name - font.family: fontRobotoLight.name - font.pixelSize: 16 * pt - color: "#FFFFFF" - } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - - onEntered: { - if(!componentItem.isPushed) - { - imageItem.source = model.hover; - textItemMenu.font.family = fontRobotoRegular.name; - } - } - - onExited: { - if(!componentItem.isPushed) - { - imageItem.source = model.normal - textItemMenu.font.family = fontRobotoLight.name; - } - } - - onClicked: { - listViewTabs.currentIndex = index; - rightPanel.header.clear(StackView.Immediate); - rightPanel.content.clear(StackView.Immediate); - - var headerData = panelHeader; - var contentData = panelContent; - if(panelHeader !== "" || panelContent !== "") - { - rightPanel.visible = true; - if(headerData !== "") rightPanel.header.push(Qt.resolvedUrl(headerData)); - if(contentData !== "") rightPanel.content.push(Qt.resolvedUrl(contentData)); - } - else rightPanel.visible = false; - - - stackViewScreenDashboard.setSource(Qt.resolvedUrl(page), {"rightPanel": rightPanel}); - } - } - - onIsPushedChanged: { - componentItem.color = (isPushed ? "#D51F5D" : "transparent"); - imageItem.source = isPushed ? model.hover : model.normal; - textItemMenu.font.family = (isPushed ? fontRobotoRegular.name : fontRobotoLight.name); - } - } - } -} - - -/*##^## Designer { - D{i:0;autoSize:true;height:480;width:640} -} - ##^##*/ diff --git a/CellFrameDashboardGUI/Screen/DapUiQmlScreenMainWindowForm.ui.qml b/CellFrameDashboardGUI/Screen/DapUiQmlScreenMainWindowForm.ui.qml deleted file mode 100644 index 7858fad9b..000000000 --- a/CellFrameDashboardGUI/Screen/DapUiQmlScreenMainWindowForm.ui.qml +++ /dev/null @@ -1,162 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 1.4 -import QtQuick.Controls 2.2 -import QtQuick.Controls.Styles 1.4 -import "./StatusBar" -import "./LastAction" - -Page { - id: dapUiQmlScreenMainWindow - title: qsTr("General") - - /// ----------- Load fonts ----------- - /// using example: font.family: fontRobotoLight.name - readonly property FontLoader fontRobotoLight: FontLoader { - source: "qrc:/res/fonts/roboto_light.ttf" - } - readonly property FontLoader fontRobotoRegular: FontLoader { - source: "qrc:/res/fonts/roboto_regular.ttf" - } - - readonly property FontLoader fontRobotoMedium: FontLoader { - source: "qrc:/res/fonts/roboto_medium.ttf" - } - /// ----------- - property alias listViewTabs: listViewTabs - property alias stackViewScreenDashboard: stackViewScreenDashboard - property alias rightPanel : rightPanel - - DapUiQmlWidgetStatusBar { - id: rectangleStatusBar - anchors.left: rectangleTabsBorder.right - anchors.top: parent.top - anchors.right: parent.right - color: "#070023" - height: 60 * pt - } - - Rectangle { - id: rectangleTabsBorder - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.left: parent.left - color: "#070023" - width: 160 * pt - - ListView { - id: listViewTabs - anchors.fill: parent - anchors.topMargin: 60 * pt - model: listModelTabs - spacing: 3 - - ListModel { - id: listModelTabs - - ListElement { - name: qsTr("Dashboard") - page: "qrc:/screen/Dashboard/DapUiQmlScreenDashboard.qml" - normal: "qrc:/res/icons/icon_dashboard.png" - hover: "qrc:/res/icons/icon_dashboard_hover.png" - panelHeader: "qrc:/screen/LastAction/DapUiQmlWidgetLastActionsHeaderForm.qml" - panelContent: "qrc:/screen/LastAction/DapUiQmlWidgetHistoryLastActions.qml" - } - - ListElement { - name: qsTr("Exchange") - page: "qrc:/screen/Exchange/DapUiQmlScreenExchangeForm.ui.qml" - normal: "qrc:/res/icons/icon_exchange.png" - hover: "qrc:/res/icons/icon_exchange_hover.png" - panelHeader: "" - panelContent: "" - } - - ListElement { - name: qsTr("History") - page: "qrc:/screen/History/DapUiQmlScreenHistory.qml" - normal: "qrc:/res/icons/icon_history.png" - hover: "qrc:/res/icons/icon_history_hover.png" - panelHeader: "" - panelContent: "" - } - - ListElement { - name: qsTr("Console") - page: "qrc:/screen/Console/DapUiQmlScreenConsoleForm.ui.qml" - normal: "qrc:/res/icons/icon_console.png" - hover: "qrc:/res/icons/icon_console_hover.png" - panelHeader: "qrc:/screen/LastAction/DapUiQmlWidgetLastActionsHeaderForm.qml" - panelContent: "qrc:/screen/Console/DapUiQmlWidgetConsoleLastActionsForm.qml" - } - - ListElement { - name: qsTr("Logs") - page: "qrc:/screen/Log/DapUiQmlWidgetChainNodeLogs.qml" - normal: "qrc:/res/icons/icon_logs.png" - hover: "qrc:/res/icons/icon_logs_hover.png" - panelHeader: "" - panelContent: "" - } - - ListElement { - name: qsTr("Settings") - page: "qrc:/screen/Settings/DapUiQmlScreenSettings.qml" - normal: "qrc:/res/icons/icon_settings.png" - hover: "qrc:/res/icons/icon_settings_hover.png" - panelHeader: "" - panelContent: "" - } - - ListElement { - name: qsTr("VPN") - page: "qrc:/screen/VPN/DapUiQmlScreenVpn.qml" - normal: "qrc:/res/icons/defaul_icon.png" - hover: "qrc:/res/icons/defaul_icon.png" - panelHeader: "" - panelContent: "" - } - - /// TODO: It wasn't in the task. I will not delete it, maybe later - /// we will need it - // ListElement { - // name: qsTr("About") - // page: "DapQmlScreenAbout.qml" - // source: "qrc:/Resources/Icons/defaul_icon.png" - // } - } - delegate: componentItemMainMenuTab - clip: true - interactive: false - currentIndex: 0 - } - focus: true - } - - Rectangle { - id: mainDashboard - anchors.left: rectangleTabsBorder.right - anchors.top: rectangleStatusBar.bottom - anchors.bottom: parent.bottom - anchors.right: parent.right - - Loader { - id: stackViewScreenDashboard - clip: true - anchors.left: parent.left - anchors.right: rightPanel.left - anchors.top: parent.top - anchors.bottom: parent.bottom - source: "qrc:/screen/Dashboard/DapUiQmlScreenDashboard.qml" - } - - DapUiQmlWidgetRightPanel { - id: rightPanel - anchors.bottom: parent.bottom - anchors.top: parent.top - anchors.right: parent.right - header.initialItem: "qrc:/screen/LastAction/DapUiQmlWidgetLastActionsHeaderForm.qml" - content.initialItem: "qrc:/screen/LastAction/DapUiQmlWidgetHistoryLastActions.qml" - } - } -} - diff --git a/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarComboBox.qml b/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarComboBox.qml deleted file mode 100644 index b37128b37..000000000 --- a/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarComboBox.qml +++ /dev/null @@ -1,84 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 -import QtQuick.Controls.Styles 1.4 -import QtGraphicalEffects 1.0 - -ComboBox { - property alias headerTextColor: headerText.color - property alias widthArrow: arrow.width - property alias heightArrow: arrow.height - - id: customComboBox - width: 190 * pt - indicator: Image { - id: arrow - source: parent.popup.visible ? "qrc:/res/icons/ic_arrow_drop_up.png" : "qrc:/res/icons/ic_arrow_drop_down.png" - width: 24 * pt - height: 24 * pt - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 16 * pt - } - - background: Rectangle { - anchors.fill: parent - color: parent.popup.visible ? "#FFFFFF" : "transparent" - radius: 2 * pt - } - - contentItem: Text { - id: headerText - anchors.fill: parent - anchors.leftMargin: 12 * pt - anchors.rightMargin: 48 * pt - anchors.topMargin: 10 * pt - text: parent.displayText - font.family: fontRobotoRegular.name - font.pixelSize: 14 * pt - color: parent.popup.visible ? "#332F49" : "#FFFFFF" - verticalAlignment: Text.AlignTop - elide: Text.ElideRight - } - - popup: Popup { - y: parent.height - 1 - width: parent.width + 1 - implicitHeight: contentItem.implicitHeight - padding: 1 - - contentItem: ListView { - clip: true - implicitHeight: contentHeight - model: customComboBox.popup.visible ? customComboBox.delegateModel : null - currentIndex: customComboBox.highlightedIndex - - ScrollIndicator.vertical: ScrollIndicator { } - } - - background: Rectangle { - width: customComboBox.background.width - - Rectangle { - id: contentCorner - anchors.fill: parent - } - - DropShadow { - anchors.fill: parent - source: contentCorner - verticalOffset: 9 * pt - samples: 13 * pt - color: "#40000000" - } - } - } - - DropShadow { - anchors.fill: parent - source: background - verticalOffset: 9 * pt - samples: 13 * pt - color: "#40000000" - } - -} diff --git a/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarComboBoxDelegate.qml b/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarComboBoxDelegate.qml deleted file mode 100644 index 174defb90..000000000 --- a/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarComboBoxDelegate.qml +++ /dev/null @@ -1,27 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 - -ItemDelegate { - property string delegateContentText: "" - - width: parent.width - height: 42 * pt - contentItem: DapUiQmlWidgetStatusBarContentItem { - anchors.fill: parent - anchors.topMargin: 8 * pt - anchors.leftMargin: 12 * pt - anchors.rightMargin: 16 * pt - verticalAlignment: Qt.AlignTop - text: delegateContentText - color: hovered ? "#FFFFFF" : "#332F49" - } - - background: Rectangle { - anchors.fill: parent - anchors.bottomMargin: 10 * pt - color: hovered ? "#332F49" : "#FFFFFF" - } - - highlighted: parent.highlightedIndex === index - -} diff --git a/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarContentItem.qml b/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarContentItem.qml deleted file mode 100644 index e98535449..000000000 --- a/CellFrameDashboardGUI/Screen/DapUiQmlWidgetStatusBarContentItem.qml +++ /dev/null @@ -1,11 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 -import QtQuick.Controls.Styles 1.4 - -Text { - color: "#A7A7A7" - font.family: fontRobotoRegular.name - font.pixelSize: 14 * pt - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter -} diff --git a/CellFrameDashboardGUI/Screen/Dashboard/DapUiQmlScreenDashboard.qml b/CellFrameDashboardGUI/Screen/Dashboard/DapUiQmlScreenDashboard.qml deleted file mode 100644 index d470646ef..000000000 --- a/CellFrameDashboardGUI/Screen/Dashboard/DapUiQmlScreenDashboard.qml +++ /dev/null @@ -1,212 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.2 -import CellFrameDashboard 1.0 -import QtQml 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.12 -import "../" - -DapUiQmlScreen { - id: dapUiQmlScreenDialog - anchors.fill: parent - - ColumnLayout { - anchors.fill: parent - anchors.topMargin: 20 * pt - anchors.leftMargin: 24 * pt - anchors.rightMargin: 24 * pt - spacing: 20 * pt - - Rectangle { - Layout.fillWidth: true - height: 36 * pt - - Text { - anchors.left: parent.left - font.pixelSize: 20 * pt - font.family: fontRobotoRegular.name - verticalAlignment: Qt.AlignVCenter - text: "My first wallet" - } - - Button { - anchors.top: parent.top - width: 132 * pt - anchors.bottom: parent.bottom - anchors.right: parent.right - text: "New payment" - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - highlighted: true - - background: Rectangle { - color: "#3E3853" - } - - icon.width: 20 * pt - icon.height: 20 * pt - icon.source: "qrc:/res/icons/new-payment_icon.png" - icon.color: "#FFFFFF" - } - } - - - ListView { - id: listViewToken - Layout.fillWidth: true - Layout.fillHeight: true - model: dapWalletFilterModel - section.property: "networkDisplayRole" - section.criteria: ViewSection.FullString - section.delegate: Rectangle { - width: parent.width - height: 30 * pt - color: "#908D9D" - - Text { - anchors.fill: parent - anchors.leftMargin: 16 * pt - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - color: "#FFFFFF" - verticalAlignment: Qt.AlignVCenter - text: section - } - } - - - clip: true - - delegate: Component { - - ListView - { - width: listViewToken.width - height: contentItem.height - leftMargin: 16 * pt - interactive: false - - model: walletTokenListDisplayRole - section.property: "modelData.wallet" - section.delegate: Component{ - Rectangle { - width: parent.width - height: 36 * pt - - Row { - anchors.fill: parent - - Text { - anchors.top: parent.top - anchors.bottom: parent.bottom - verticalAlignment: Qt.AlignVCenter - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - color: "#908D9D" - - text: "Wallet address:" - } - - Item { - anchors.top: parent.top - anchors.bottom: parent.bottom - width: 36 * pt - } - - Text { - id: titleWalletAddress - anchors.top: parent.top - anchors.bottom: parent.bottom - width: 180 * pt - verticalAlignment: Qt.AlignVCenter - elide: Text.ElideRight - font.family: fontRobotoRegular.name - font.pixelSize: 10 * pt - color: "#757184" - text: section - } - - Item { - anchors.top: parent.top - anchors.bottom: parent.bottom - width: 4 * pt - } - - Rectangle { - anchors.top: parent.top - anchors.bottom: parent.bottom - width: 16 * pt - - Image { - id: imageButton - anchors.centerIn: parent - width: 16 * pt - height: 16 * pt - source: "qrc:/res/icons/ic_copy.png" - } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - - onEntered: imageButton.source = "qrc:/res/icons/ic_copy_hover.png" - onExited: imageButton.source = "qrc:/res/icons/ic_copy.png" - onClicked: clipboard.setText(titleWalletAddress.text); - } - } - } - } - } - - delegate: Component - { - - Rectangle { - width: parent.width - 16 * pt - height: 62 * pt - color: "#E3E2E6" - - Rectangle { - anchors.fill: parent - anchors.topMargin: 1 - - Label { - anchors.left: parent.left - verticalAlignment: Qt.AlignVCenter - height: parent.height - font.family: fontRobotoRegular.name - font.pixelSize: 18 * pt - color: "#070023" - text: model.modelData.name - } - - Label { - anchors.horizontalCenter: parent.horizontalCenter - width: 1 - height: parent.height - verticalAlignment: Qt.AlignVCenter - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - color: "#070023" - text: model.modelData.balance + " " + model.modelData.name - } - - Label { - anchors.right: parent.right - height: parent.height - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignRight - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - color: "#757184" - text: "$ " + model.modelData.balance + " USD" - } - - } - } - } - } - } - } - } -} diff --git a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlScreenExchangeForm.ui.qml b/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlScreenExchangeForm.ui.qml deleted file mode 100644 index 7e796a587..000000000 --- a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlScreenExchangeForm.ui.qml +++ /dev/null @@ -1,31 +0,0 @@ -import QtQuick 2.12 -import QtQml 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 - -Page { - - Row { - anchors.left: parent.left - anchors.bottom: parent.bottom - anchors.leftMargin: 28 * pt - anchors.bottomMargin: 42 * pt - spacing: 68 * pt - - DapUiQmlWidgetExchangeOrderForm { - titleOrder: qsTr("Buy") - - } - - DapUiQmlWidgetExchangeOrderForm { - titleOrder: qsTr("Sell") - } - } -} - - - -/*##^## Designer { - D{i:0;autoSize:true;height:480;width:640} -} - ##^##*/ diff --git a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetChainExchanges.ui.qml b/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetChainExchanges.ui.qml deleted file mode 100644 index fef680a80..000000000 --- a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetChainExchanges.ui.qml +++ /dev/null @@ -1,14 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.2 - -Page { - id: dapUiQmlWidgetChainExchanges - - title: qsTr("Exchanges") - - Text { - id: name - anchors.centerIn: parent - text: qsTr("Exchanges") - } -} diff --git a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderButtonForm.ui.qml b/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderButtonForm.ui.qml deleted file mode 100644 index d85a8a71c..000000000 --- a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderButtonForm.ui.qml +++ /dev/null @@ -1,27 +0,0 @@ -import QtQuick 2.12 -import QtQml 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 - -Button { - property alias buttonFont: buttonText.font.family - property alias buttonText: buttonText.text - - id: buttonBuy - width: 70 * pt - height: 30 * pt - - contentItem: Text { - id: buttonText - color: "#FFFFFF" - font.pixelSize: 14 * pt - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - background: Rectangle { - implicitWidth: parent.width - implicitHeight: parent.height - color: buttonBuy.hovered ? "#A2A4A7" : "#4F5357" - } -} diff --git a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderContentForm.ui.qml b/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderContentForm.ui.qml deleted file mode 100644 index be2e895fc..000000000 --- a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderContentForm.ui.qml +++ /dev/null @@ -1,73 +0,0 @@ -import QtQuick 2.12 -import QtQml 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 - -Item { - property string contentFont: "" - width: childrenRect.width - height: childrenRect.height - - ColumnLayout { - spacing: 16 * pt - - Repeater { - model: [qsTr("Ammount"), qsTr("Price"), qsTr("Total"), qsTr("Fee (0.2%)"), qsTr("Total+Fee")] - RowLayout { - spacing: 0 - Rectangle { - height: childrenRect.height - width: 120 * pt - - Text { - text: modelData - color: "#ACACAF" - font.family: contentFont - font.pixelSize: 12 * pt - } - } - - - Rectangle { - width: 130 * pt - height: 22 * pt - border.width: 1 * pt - border.color: "#B0B1B5" - - TextInput { - id: currencyTextInput - anchors.left: parent.left - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: textCurrency.left - anchors.leftMargin: 6 * pt - anchors.rightMargin: 6 * pt - color: readOnly ? "#ACACAF" : "#737880" - font.family: contentFont - font.pixelSize: 12 * pt - verticalAlignment: Qt.AlignVCenter - validator: RegExpValidator{ regExp: /\d+/ } - clip: true - readOnly: index === 3 || index === 4 - text: readOnly ? "0" : "" - } - - Text { - id: textCurrency - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.rightMargin: 6 * pt - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignRight - color: currencyTextInput.readOnly ? "#ACACAF" : "#737880" - font.family: contentFont - font.pixelSize: 12 * pt - text: index === 0 ? currencyName : qsTr("USD") - } - } - } - } - } - -} diff --git a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderForm.ui.qml b/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderForm.ui.qml deleted file mode 100644 index 0f2363717..000000000 --- a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderForm.ui.qml +++ /dev/null @@ -1,49 +0,0 @@ -import QtQuick 2.12 -import QtQml 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 - -Item { - property alias titleOrder: orderTitle.orderText - property string currencyName: qsTr("KLVN") - property string balance: "0" - - width: childrenRect.width - height: childrenRect.height - - ColumnLayout { - - DapUiQmlWidgetExchangeOrderTitleForm { - id: orderTitle - orderFont: "Roboto" - - } - - Text { - text: qsTr("Balance: ") + balance + " " + currencyName - color: "#ACACAF" - font.family: "Roboto" - font.pixelSize: 12 * pt - } - - Rectangle { - width: parent.width - height: 6 * pt - - } - - DapUiQmlWidgetExchangeOrderContentForm { - contentFont: "Roboto" - } - - Rectangle { - height: 12 * pt - width: parent.width - } - - DapUiQmlWidgetExchangeOrderButtonForm { - buttonFont: "Roboto" - buttonText: titleOrder - } - } -} diff --git a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderTitleForm.ui.qml b/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderTitleForm.ui.qml deleted file mode 100644 index a90eb4096..000000000 --- a/CellFrameDashboardGUI/Screen/Exchange/DapUiQmlWidgetExchangeOrderTitleForm.ui.qml +++ /dev/null @@ -1,32 +0,0 @@ -import QtQuick 2.12 -import QtQml 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 - -Item { - property alias orderText: textOrder.text - property alias orderFont: textOrder.font.family - - width: childrenRect.width - height: childrenRect.height - - RowLayout { - spacing: 8 * pt - Rectangle { - width: 32 - height: 32 - border.color: "#000000" - border.width: 1 - - Image { - anchors.fill: parent - } - } - - Text { - id: textOrder - color: "#4F5357" - font.pixelSize: 14 * pt - } - } -} diff --git a/CellFrameDashboardGUI/Screen/Explorer/DapUiQmlWidgetNodeNetworkExplorer.qml b/CellFrameDashboardGUI/Screen/Explorer/DapUiQmlWidgetNodeNetworkExplorer.qml deleted file mode 100644 index d0cd57297..000000000 --- a/CellFrameDashboardGUI/Screen/Explorer/DapUiQmlWidgetNodeNetworkExplorer.qml +++ /dev/null @@ -1,198 +0,0 @@ -import QtQuick 2.13 -import QtQuick.Controls 2.2 -import QtQuick.Dialogs 1.2 -import QtQuick.Layouts 1.12 -import NodeNetworkExplorer 1.0 - -Page { - Rectangle { - anchors.fill: parent; -// color: "#3b3353"; - } - - RowLayout { - anchors.fill: parent - spacing: 2 - - Flickable { - id: dapExplorer - Layout.fillWidth: true - Layout.fillHeight: true - contentWidth: dapGraphWidget.width * dapGraphWidget.scale - contentHeight: dapGraphWidget.height * dapGraphWidget.scale - contentY: dapGraphWidget.height / 2 - contentX: dapGraphWidget.width / 2 - - DapUiQmlWidgetNodeNetwork { - id: dapGraphWidget - scale: 0.6 - transformOrigin: Item.TopLeft - model: dapNodeNetworkModel - colorOffline: "#eb4d4b" - colorOnline: "#6ab04c" - colorFocused: "#ff7979" - colorSelect: "#686de0" - onSelectNode: { - dapNodeNetworkMenu.x = getSelectedNodePosX(); - dapNodeNetworkMenu.y = getSelectedNodePosY(); - - if(dapNodeNetworkModel.isNodeOnline(getSelectedNodeAddress())) - dapRadioButtonOnline.checked = true; - else - dapRadioButtonOffline.checked = true; - - dapMenuItemStatus.enabled = isCurrentNode; - dapNodeNetworkMenu.visible = true; - } - onSelectNodeChanged: { - dapNodeNetworkDescription.visible = false; - } - - Menu { - id: dapNodeNetworkMenu - MenuItem { - id: dapMenuItemDetails - text: qsTr("Show detalies") - onTriggered: { - dapNodeNetworkDescription.visible = true; - dapDescriptionModel.get(0).name = dapGraphWidget.getSelectedNodeAddress(); - dapDescriptionModel.get(1).name = dapGraphWidget.getSelectedNodeAlias(); - dapDescriptionModel.get(2).name = dapGraphWidget.getSelectedNodeIpv4(); - } - } - - MenuItem { - id: dapMenuItemStatus - text: qsTr("Set status") - onTriggered: { - dapWidgetNodeStatus.visible = true; - } - } - } - } - } - - - Rectangle { - id: dapNodeNetworkDescription - Layout.fillWidth: true - Layout.fillHeight: true - visible: false - color: "#eaecef" - - ListModel { - id: dapDescriptionModel - ListElement { name: ""; category: "Address"; } - ListElement { name: ""; category: "Alias"; } - ListElement { name: ""; category: "Ipv4"; } - } - - ListView { - anchors.fill: parent - model: dapDescriptionModel - delegate: Text {text: name; font.pixelSize: 18 } - section.property: "category" - section.criteria: ViewSection.FullString - section.delegate: dapCategory - - header: Rectangle { - width: parent.width - height: rowContent.height - RowLayout { - id: rowContent - Button { - text: "X" - onClicked: { - dapNodeNetworkDescription.visible = false; - } - } - - Text { - Layout.rowSpan: 1 - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - text: qsTr("Description") - } - } - - } - } - - - Component { - id: dapCategory - Rectangle { - width: dapNodeNetworkDescription.width - height: childrenRect.height - color: "#0000FF" - - Text { - color: "#FFFFFF" - text: section - font.bold: true - font.pixelSize: 20 - } - } - } - } - } - - Rectangle - { - id: dapWidgetNodeStatus - anchors.fill: parent - visible: false - color: "#B3B2B1" - opacity: 0.6 - } - - Rectangle { - anchors.centerIn: parent - visible: dapWidgetNodeStatus.visible - width: contentLayout.width - height: contentLayout.height - border.color: "#F3F2F1" - border.width: 1 - - ColumnLayout { - id: contentLayout - - Text { - Layout.fillWidth: true - leftPadding: 30 - rightPadding: 30 - topPadding: 15 - font.pointSize: 16 - text: qsTr("Choose status") - } - - RadioButton { - id: dapRadioButtonOffline - Layout.alignment: Qt.AlignCenter - text: qsTr("Offline") - onToggled: { - dapNodeNetworkModel.sendRequestNodeStatus(false); - } - } - - RadioButton { - id: dapRadioButtonOnline - Layout.alignment: Qt.AlignCenter - text: qsTr("Online") - onToggled: { - dapNodeNetworkModel.sendRequestNodeStatus(true); - } - } - - Button { - Layout.fillWidth: true - text: qsTr("Ok") - - onClicked: { - dapWidgetNodeStatus.visible = false; - } - } - } - } - -} diff --git a/CellFrameDashboardGUI/Screen/History/DapUiQmlScreenHistory.qml b/CellFrameDashboardGUI/Screen/History/DapUiQmlScreenHistory.qml deleted file mode 100644 index 0d5d53672..000000000 --- a/CellFrameDashboardGUI/Screen/History/DapUiQmlScreenHistory.qml +++ /dev/null @@ -1,250 +0,0 @@ -import QtQuick 2.9 -import QtQml 2.12 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.12 -import DapTransactionHistory 1.0 - -DapUiQmlScreenHistoryForm { - id: dapUiQmlScreenHistory - - Component { - id: delegateDate - Rectangle { - width: parent.width - height: 30 * pt - color: "#DFE1E6" - - Text { - anchors.fill: parent - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignLeft - color: "#5F5F63" - text: section - font.family: "Regular" - font.pixelSize: 12 * pt - leftPadding: 30 * pt - } - } - } - - - Component { - id: delegateConetnet - - Column { - Rectangle { - id: dapDelegateContent - height: 65 * pt - width: 1124 * pt - - RowLayout { - anchors.fill: parent - - // Spacing - Rectangle { - width: 30 * pt - height: parent.height - } - - // Image - Rectangle { - id: dapToken - border.color: "#000000" - border.width: 1 - width: 30 * pt - height: 30 * pt - Layout.alignment: Qt.AlignVCenter - - Image { - id: dapPicToken - anchors.fill: parent - fillMode: Image.PreserveAspectFit - } - } - - // Spacing - Rectangle { - width: 14 * pt - height: parent.height - } - - // Token name - Rectangle { - id: dapTokenNameContainer - width: 246 * pt - Layout.maximumWidth: width - height: dapTokenName.contentHeight - Layout.alignment: Qt.AlignVCenter - - Text { - id: dapTokenName - anchors.fill: parent - text: tokenName - color: "#4F5357" - font.family: "Regular" - font.pixelSize: 16 * pt - } - } - - // Spacing - Rectangle { - width: 30 * pt - height: parent.height - } - - // Wallet number - Rectangle { - width: 330 * pt - Layout.maximumWidth: width - height: dapNumberWallet.contentHeight - Layout.alignment: Qt.AlignVCenter - - Text { - id: dapNumberWallet -// width: parent.width / 2 - anchors.fill: parent - color: "#4F5357" - text: numberWallet - font.family: "Regular" - font.pixelSize: 14 * pt - clip: true - elide: Text.ElideRight - - MouseArea { - anchors.fill: parent - hoverEnabled: true - - onPositionChanged: { - if(!hovered) return; - var globalCoord = mapToItem(dapUiQmlScreenHistory, mouse.x, mouse.y); - tipTokenName.x = globalCoord.x - tipTokenName.width / 2; - tipTokenName.y = globalCoord.y - (tipTokenName.height + 5); - } - - onEntered: { - tipTokenName.text = dapNumberWallet.text; - tipTokenName.visible = true; - } - - onExited: { - tipTokenName.visible = false; - } - } - } - } - - - // Spacing - Rectangle { - width: 30 * pt - height: parent.height - } - - // Status - Rectangle { - width: 100 * pt - height: dapStatus.contentHeight - Layout.alignment: Qt.AlignVCenter - - Text { - id: dapStatus - anchors.fill: parent - text: txStatus - color: statusColor - font.family: "Regular" - font.pixelSize: 14 * pt - } - } - - // Spacing - Rectangle { - width: 30 * pt - } - - // Money - Rectangle { - width: 264 * pt - height: parent.height - Layout.alignment: Qt.AlignVCenter - - Column { - anchors.fill: parent - spacing: 0 - - // Spacing - Rectangle { - width: parent.width - height: 15 * pt - } - - // Token currency - Label { - id: dapCurrency - width: parent.width - horizontalAlignment: Qt.AlignRight - text: cryptocurrency - color: "#4F5357" - font.family: "Regular" - font.pixelSize: 16 * pt - } - - // Spacing - Rectangle { - width: parent.width - height: 5 * pt - } - - // Equivalent currency - Label { - width: parent.width - horizontalAlignment: Qt.AlignRight - text: currency - color: "#C2CAD1" - font.family: "Regular" - font.pixelSize: 12 * pt - } - } - } - - // Spacing - Rectangle { - id: dapEndItem - width: 20 * pt - height: parent.height - } - } - } - - // Underline - Rectangle { - x: dapTokenNameContainer.x - width: 1056 * pt - height: 1 - color: "#C2CAD1" - } - } - } - - - // Number wallet tip - Label { - id: tipTokenName - padding: 3 * pt - color: "#4F5357" - font.family: "Regular" - font.pixelSize: 14 * pt - background: Rectangle { - anchors.fill: parent - color: "#FFFFFF"; - border.color: "#80000000" - border.width: 1 * pt - } - - visible: false - } -} - -/*##^## Designer { - D{i:0;autoSize:true;height:480;width:640} -} - ##^##*/ diff --git a/CellFrameDashboardGUI/Screen/History/DapUiQmlScreenHistoryForm.ui.qml b/CellFrameDashboardGUI/Screen/History/DapUiQmlScreenHistoryForm.ui.qml deleted file mode 100644 index 91671e853..000000000 --- a/CellFrameDashboardGUI/Screen/History/DapUiQmlScreenHistoryForm.ui.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.9 -import QtQml 2.12 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.12 -import DapTransactionHistory 1.0 -import "../" - -DapUiQmlScreen { - ListView { - id: dapListView - anchors.fill: parent - model: dapHistoryModel - delegate: delegateConetnet - section.property: "date" - section.criteria: ViewSection.FullString - section.delegate: delegateDate - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlRecoveryNotesForm.ui.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlRecoveryNotesForm.ui.qml deleted file mode 100644 index fd6d621da..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlRecoveryNotesForm.ui.qml +++ /dev/null @@ -1,251 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.1 -import "../" - -DapUiQmlScreen { - id: recoveryNoteMenu - color: "#edeff2" - - Rectangle { - id: wordTextArea - height: 30 - color: "#757184" - anchors.rightMargin: 1 - anchors.leftMargin: 1 - anchors.right: parent.right - anchors.left: parent.left - anchors.top: parent.top - - Text { - id: wordText - color: "#ffffff" - text: qsTr("24 words") - anchors.bottom: parent.bottom - anchors.bottomMargin: 8 - anchors.top: parent.top - anchors.topMargin: 8 - anchors.left: parent.left - anchors.leftMargin: 16 - font.pointSize: 10 - horizontalAlignment: Text.AlignLeft - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - } - } - - Rectangle { - id: saveNotesDescription - color: "#edeff2" - height: 42 - anchors.top: wordTextArea.bottom - anchors.topMargin: 24 - anchors.left: wordTextArea.left - anchors.right: wordTextArea.right - - Text { - anchors.fill: parent - text: qsTr("Keep these words in a safe place. They will be\nrequired to restore your wallet in case of loss of\naccess to it") - anchors.leftMargin: 1 - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - color: "#FF0300" - - font { - pointSize: 10 - family: "Roboto" - styleName: "Normal" - weight: Font.Normal - } - } - } - - Rectangle { - id: recoveryWords - height: 210 - anchors.top: saveNotesDescription.bottom - anchors.topMargin: 24 - anchors.right: parent.right - anchors.left: parent.left - anchors.leftMargin: 1 * pt - anchors.rightMargin: 1 * pt - color: "#edeff2" - - ListModel { - id: listRecoveryWords - ListElement { - word: "Word1" - } - ListElement { - word: "Word2" - } - ListElement { - word: "Word3" - } - ListElement { - word: "Word4" - } - ListElement { - word: "Word5" - } - ListElement { - word: "Word6" - } - ListElement { - word: "Word7" - } - ListElement { - word: "Word8" - } - ListElement { - word: "Word9" - } - ListElement { - word: "Word10" - } - ListElement { - word: "Word11" - } - ListElement { - word: "Word12" - } - } - - RowLayout { - spacing: 60 - height: parent.height - anchors.right: parent.right - anchors.rightMargin: 1 - anchors.left: parent.left - anchors.leftMargin: 1 - - ListView { - height: parent.height - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - width: 50 - model: listRecoveryWords - delegate: Text { - text: word - color: "#070023" - font { - pointSize: 12 - family: "Roboto" - styleName: "Normal" - weight: Font.Normal - } - } - } - - ListView { - height: parent.height - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - width: 50 - model: listRecoveryWords - delegate: Text { - text: word - color: "#070023" - font { - pointSize: 12 - family: "Roboto" - styleName: "Normal" - weight: Font.Normal - } - } - } - } - } - - Rectangle { - id: notifyNotesSavedArea - height: 70 - anchors.top: recoveryWords.bottom - anchors.topMargin: 24 - anchors.left: parent.left - anchors.right: parent.right - color: "#EDEFF2" - anchors.leftMargin: 1 - - Text { - id: notifyText - anchors.centerIn: parent - text: qsTr("") - color: "#6F9F00" - font.pointSize: 14 - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - } - - RowLayout { - id: actionButtons - height: 44 - anchors.leftMargin: 1 - spacing: 30 - anchors.top: notifyNotesSavedArea.bottom - anchors.topMargin: 24 - anchors.left: parent.left - anchors.right: parent.right - Layout.leftMargin: 26 - Layout.columnSpan: 2 - - Button { - id: nextButton - height: 44 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - width: 130 - - Text { - id: nextButtonText - text: qsTr("Next") - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - color: "#ffffff" - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - font.pointSize: 16 - horizontalAlignment: Text.AlignLeft - } - - background: Rectangle { - implicitWidth: parent.width - implicitHeight: parent.height - color: "#3E3853" - } - } - - Button { - id: copyNotesButton - height: 44 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - width: 130 - checkable: true - - Text { - id: copyNotesButtonText - text: qsTr("Copy") - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - color: copyNotesButton.checked ? "#3E3853" : "#FFFFFF" - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - font.pointSize: 16 - horizontalAlignment: Text.AlignLeft - } - - background: Rectangle { - implicitWidth: parent.width - implicitHeight: parent.height - color: copyNotesButton.checked ? "#EDEFF2" : "#3E3853" - border.color: "#3E3853" - border.width: 1 * pt - } - - onClicked: notifyText.text = qsTr( - "Recovery words copied to clipboard. Keep them in a\nsafe place before proceeding to the next step.") - } - } -} - diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlRecoveryQrForm.ui.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlRecoveryQrForm.ui.qml deleted file mode 100644 index 6d1c94a86..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlRecoveryQrForm.ui.qml +++ /dev/null @@ -1,172 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.1 - -Rectangle { - id: recoveryQrMenu - color: "#edeff2" - - Rectangle { - id: qrCodeTextArea - height: 30 - color: "#757184" - anchors.right: parent.right - anchors.left: parent.left - anchors.top: parent.top - - Text { - id: qrCodeText - color: "#ffffff" - text: qsTr("QR Code") - anchors.bottom: parent.bottom - anchors.bottomMargin: 8 - anchors.top: parent.top - anchors.topMargin: 8 - anchors.left: parent.left - anchors.leftMargin: 16 - font.pointSize: 10 - horizontalAlignment: Text.AlignLeft - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - } - } - - Rectangle { - id: saveQrCodeDescription - color: "#edeff2" - height: 42 - anchors.top: qrCodeTextArea.bottom - anchors.topMargin: 24 - anchors.left: qrCodeTextArea.left - anchors.right: qrCodeTextArea.right - anchors.leftMargin: 1 * pt - anchors.rightMargin: 1 * pt - - Text { - anchors.fill: parent - text: qsTr("Keep these QR-code in a safe place. They will be\nrequired to restore your wallet in case of loss of\naccess to it") - font.pointSize: 10 - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - color: "#FF0300" - - font { - family: "Roboto" - styleName: "Normal" - weight: Font.Normal - } - } - } - - Rectangle { - id: qrCodeImageArea - height: 200 - anchors.top: saveQrCodeDescription.bottom - anchors.topMargin: 24 - anchors.left: parent.left - anchors.right: parent.right - color: "#EDEFF2" - anchors.leftMargin: 1 - - Image { - id: qrCodeImage - width: parent.height - height: parent.height - anchors.horizontalCenter: parent.horizontalCenter - source: "Resources/QRCode.png" - } - } - - Rectangle { - id: notifyQrCodeSavedArea - height: 100 - anchors.top: qrCodeImageArea.bottom - anchors.topMargin: 24 - anchors.left: parent.left - anchors.right: parent.right - color: "#EDEFF2" - anchors.leftMargin: 1 - - Text { - id: notifyText - anchors.centerIn: parent - text: qsTr("") - color: "#6F9F00" - font.pointSize: 14 - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - } - - RowLayout { - id: actionButtons - height: 44 - anchors.leftMargin: 1 - spacing: 60 - anchors.top: notifyQrCodeSavedArea.bottom - anchors.topMargin: 24 - anchors.left: parent.left - anchors.right: parent.right - Layout.leftMargin: 26 - Layout.columnSpan: 2 - - Button { - id: nextButton - height: 44 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - width: 130 - - Text { - id: nextButtonText - text: qsTr("Next") - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - color: "#ffffff" - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - font.pointSize: 16 - horizontalAlignment: Text.AlignLeft - } - - background: Rectangle { - implicitWidth: parent.width - implicitHeight: parent.height - color: "#3E3853" - } - } - - Button { - id: saveQrCodeButton - height: 44 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - width: 130 - checkable: true - - Text { - id: saveQrCodeButtonText - text: qsTr("Save") - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - color: saveQrCodeButton.checked ? "#3E3853" : "#FFFFFF" - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - font.pointSize: 16 - horizontalAlignment: Text.AlignLeft - } - - background: Rectangle { - implicitWidth: parent.width - implicitHeight: parent.height - color: saveQrCodeButton.checked ? "#EDEFF2" : "#3E3853" - border.color: "#3E3853" - border.width: 1 * pt - } - - onClicked: notifyText.text = qsTr( - "QR-code saved. Keep them in a\nsafe place before proceeding to the next step.") - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWallet.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWallet.qml deleted file mode 100644 index ec0e0f95d..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWallet.qml +++ /dev/null @@ -1,35 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 2.2 - -DapUiQmlScreenDialogAddWalletForm { - id: dialogAddWallet - focus: true - - Connections { - target: nextButton - onClicked: { - if(isWordsRecoveryMethodChecked) { - - rightPanel.content.push("DapUiQmlRecoveryNotesForm.ui.qml", {"rightPanel": rightPanel}); - rightPanel.header.push("DapUiQmlScreenDialogAddWalletHeader.qml", { - "backButtonNormal": "qrc:/res/icons/back_icon.png", - "backButtonHovered": "qrc:/res/icons/back_icon_hover.png", - "rightPanel": rightPanel - }); - } - else if(isQRCodeRecoveryMethodChecked) { - rightPanel.content.push("DapUiQmlRecoveryQrForm.ui.qml", {"rightPanel": rightPanel}); - rightPanel.header.push("DapUiQmlScreenDialogAddWalletHeader.qml", { - "backButtonNormal": "qrc:/res/icons/back_icon.png", - "backButtonHovered": "qrc:/res/icons/back_icon_hover.png", - "rightPanel": rightPanel - }); - } - else if(isExportToFileRecoveryMethodChecked) console.debug("Export to file"); /*TODO: create dialog select file to export */ - else { - rightPanel.header.push("DapUiQmlWalletCreatedHeader.qml", {"rightPanel": rightPanel }); - rightPanel.content.push("DapUiQmlWalletCreated.qml", {"rightPanel": rightPanel} ) - } - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWalletForm.ui.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWalletForm.ui.qml deleted file mode 100644 index 11853ced3..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWalletForm.ui.qml +++ /dev/null @@ -1,224 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.1 -import "../" - -DapUiQmlScreen { - property alias nextButton: nextButton - property bool isWordsRecoveryMethodChecked: selectionWords.checked - property bool isQRCodeRecoveryMethodChecked: selectionQRcode.checked - property bool isExportToFileRecoveryMethodChecked: selectionExportToFile.checked - - id: addWalletMenu - color: "#EDEFF2" - - Rectangle { - id: nameWalletTextArea - height: 30 - color: "#757184" - anchors.right: parent.right - anchors.left: parent.left - anchors.top: parent.top - - Text { - id: nameWalletText - color: "#ffffff" - text: qsTr("Name of wallet") - anchors.left: parent.left - anchors.leftMargin: 16 - anchors.verticalCenter: parent.verticalCenter - font.pointSize: 12 - horizontalAlignment: Text.AlignLeft - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - } - } - - Rectangle { - id: inputNameWalletArea - height: 68 - color: "#EDEFF2" - anchors.left: parent.left - anchors.leftMargin: 1 - anchors.right: parent.right - anchors.top: nameWalletTextArea.bottom - - TextInput { - id: textInputNameWallet - text: qsTr("Pocket of happiness") - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: 20 - font.pointSize: 16 - color: "#070023" - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - horizontalAlignment: Text.AlignLeft - } - } - - Rectangle { - id: chooseSignatureTypeTextArea - height: 30 - color: "#757184" - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 1 - anchors.top: inputNameWalletArea.bottom - - Text { - id: chooseSignatureTypeText - color: "#ffffff" - text: qsTr("Choose signature type") - font.pointSize: 12 - anchors.leftMargin: 16 - horizontalAlignment: Text.AlignLeft - font.styleName: "Normal" - font.family: "Roboto" - font.weight: Font.Normal - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - } - } - - Rectangle { - id: chooseSignatureTypeArea - height: 68 - color: "#EDEFF2" - anchors.leftMargin: 1 - anchors.left: parent.left - anchors.right: parent.right - anchors.top: chooseSignatureTypeTextArea.bottom - - DapUiQmlWidgetSignatureTypeComboBox { - id: comboBoxChooseSignatureType - height: 20 * pt - anchors { - verticalCenter: chooseSignatureTypeArea.verticalCenter - left: parent.left - right: parent.right - leftMargin: 8 - rightMargin: 32 - verticalCenterOffset: 0 - } - } - } - - Rectangle { - id: recoveryMethodTextArea - height: 30 - color: "#757184" - anchors.leftMargin: 1 - anchors.left: parent.left - anchors.right: parent.right - anchors.top: chooseSignatureTypeArea.bottom - - Text { - id: recoveryMethodText - color: "#ffffff" - text: qsTr("Recovery method") - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - anchors.left: parent.left - font.pointSize: 12 - horizontalAlignment: Text.AlignLeft - anchors.leftMargin: 16 - anchors.verticalCenter: parent.verticalCenter - } - } - - ColumnLayout { - id: chooseRecoveryMethod - height: 272 - anchors.leftMargin: 1 - spacing: 32 - anchors.top: recoveryMethodTextArea.bottom - anchors.left: parent.left - anchors.right: parent.right - - RadioButton { - id: selectionWords - text: qsTr("24 words") - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - Layout.topMargin: 32 - checked: true - spacing: 16 - autoExclusive: true - display: AbstractButton.TextBesideIcon - font.pointSize: 14 - font.wordSpacing: 0 - font.family: "Roboto" - Layout.leftMargin: 16 - } - - RadioButton { - id: selectionQRcode - y: 120 - text: qsTr("QR code") - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - Layout.topMargin: 0 - Layout.leftMargin: 16 - spacing: 16 - font.pointSize: 14 - font.family: "Roboto" - } - - RadioButton { - id: selectionExportToFile - text: qsTr("Export to file") - spacing: 16 - font.pointSize: 14 - font.family: "Roboto" - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - Layout.topMargin: 0 - Layout.leftMargin: 16 - } - - RadioButton { - id: selectionNothing - y: 235 - text: qsTr("Nothing") - spacing: 16 - checked: false - font.family: "Roboto" - font.pointSize: 14 - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - Layout.topMargin: 0 - Layout.leftMargin: 16 - } - } - - Button { - id: nextButton - height: 44 - width: 130 - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: chooseRecoveryMethod.bottom - anchors.topMargin: 32 - hoverEnabled: true - - contentItem: Text { - id: nextButtonText - text: qsTr("Next") - anchors.fill: parent - color: "#ffffff" - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - font.pointSize: 18 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - - background: Rectangle { - implicitWidth: parent.width - implicitHeight: parent.height - color: parent.hovered ? "#D51F5D" : "#070023" - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWalletHeader.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWalletHeader.qml deleted file mode 100644 index d911b7994..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlScreenDialogAddWalletHeader.qml +++ /dev/null @@ -1,53 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.3 -import "../" - -DapUiQmlScreen { - height: 36 * pt - color: "#edeff2" - - property string backButtonNormal : "qrc:/res/icons/close_icon.png" - property string backButtonHovered : "qrc:/res/icons/close_icon_hover.png" - property string title : qsTr("New wallet") - property alias mouseArea : mouseArea - - RowLayout - { - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: 8 - spacing: 12 - - Rectangle { - width: 20 - height: 20 - color: "transparent" - - Image { - id: buttonCloseAddWallet - anchors.fill: parent - source: backButtonNormal - } - - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - - onEntered: buttonCloseAddWallet.source = backButtonHovered - onExited: buttonCloseAddWallet.source = backButtonNormal - - onClicked: { - rightPanel.header.pop(); - rightPanel.content.pop(); - } - } - } - - Text { - text: title - font.pointSize: 14 - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreated.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreated.qml deleted file mode 100644 index e336476f6..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreated.qml +++ /dev/null @@ -1,8 +0,0 @@ -import QtQuick 2.0 - -DapUiQmlWalletCreatedForm { - buttonDone.onClicked: { - rightPanel.header.pop(null); - rightPanel.content.pop(null); - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreatedForm.ui.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreatedForm.ui.qml deleted file mode 100644 index 8ed3fe723..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreatedForm.ui.qml +++ /dev/null @@ -1,68 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.1 -import "../" - -DapUiQmlScreen { - property alias buttonDone: doneCreateWalletButton - - id: walletCreatedMenu - color: "#edeff2" - - Button { - id: doneCreateWalletButton - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - anchors.bottomMargin: 189 + 24 - height: 44 - width: 130 - - Text { - id: doneCreateWalletButtonText - text: qsTr("Done") - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - color: doneCreateWalletButton.checked ? "#3E3853" : "#FFFFFF" - font.family: "Roboto" - font.styleName: "Normal" - font.weight: Font.Normal - font.pointSize: 16 - horizontalAlignment: Text.AlignLeft - } - - background: Rectangle { - implicitWidth: parent.width - implicitHeight: parent.height - color: "#3E3853" - } - - - } - - Rectangle { - id: createWalletDescription - color: "#edeff2" - height: 50 - anchors.bottom: doneCreateWalletButton.top - anchors.bottomMargin: 24 + 118 + 24 - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 1 * pt - anchors.rightMargin: 1 * pt - - Text { - anchors.fill: parent - text: qsTr("Wallet created\nsuccessfully") - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - color: "#070023" - - font { - pointSize: 16 - family: "Roboto" - styleName: "Normal" - weight: Font.Normal - } - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreatedHeader.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreatedHeader.qml deleted file mode 100644 index 5f0d953d6..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWalletCreatedHeader.qml +++ /dev/null @@ -1,10 +0,0 @@ -import QtQuick 2.0 - -DapUiQmlScreenDialogAddWalletHeader { - title: "" - - mouseArea.onClicked: { - rightPanel.header.pop(null); - rightPanel.content.pop(null); - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetHistoryLastActions.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetHistoryLastActions.qml deleted file mode 100644 index e900efb77..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetHistoryLastActions.qml +++ /dev/null @@ -1,12 +0,0 @@ -import QtQuick 2.0 - -DapUiQmlWidgetLastActions { - viewModel: dapHistoryModel - viewDelegate: DapUiQmlWidgetLastActionsDelegateForm {} - viewSection.property: "date" - viewSection.criteria: ViewSection.FullString - viewSection.delegate: DapUiQmlWidgetLastActionsSectionForm { - width: parent.width - height: 30 * pt - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActions.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActions.qml deleted file mode 100644 index 57853a3aa..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActions.qml +++ /dev/null @@ -1,50 +0,0 @@ -import QtQuick 2.9 -import QtQml 2.12 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.12 - -import DapTransactionHistory 1.0 - -DapUiQmlWidgetLastActionsForm { - - property alias viewModel: dapListView.model - property alias viewDelegate: dapListView.delegate - property alias viewSection: dapListView.section - - MouseArea { - id: mainMouseArea - anchors.fill: parent - hoverEnabled: true - - onEntered: { - if(!buttonListScroll.isHovered) - buttonListScroll.visible = true; - } - - onExited: { - if(!buttonListScroll.isHovered) - buttonListScroll.visible = false; - } - } - - ListView { - id: dapListView - anchors.fill: parent - clip: true - - property var contentPos: 0.0; - onContentYChanged: { - if(atYBeginning) buttonListScroll.state = "goUp"; - else if(atYEnd) buttonListScroll.state = "goDown" - else if(contentPos < contentItem.y) buttonListScroll.state = "goUp"; - else buttonListScroll.state = "goDown"; - - contentPos = contentItem.y; - } - - DapUiQmlWidgetLastActionsButtonForm { - id: buttonListScroll - viewData: dapListView - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsButtonForm.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsButtonForm.qml deleted file mode 100644 index 56694c6f4..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsButtonForm.qml +++ /dev/null @@ -1,91 +0,0 @@ -import QtQuick 2.9 -import QtQml 2.12 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.12 - -Item { - id: buttonScroll - - property ListView viewData: ListView{} - property bool isHovered: false - - width: 36 * pt - height: width - anchors.right: viewData.right - anchors.bottom: viewData.bottom - anchors.bottomMargin: 10 * pt - anchors.topMargin: 10 * pt - anchors.rightMargin: 10 * pt - visible: false - - Image { - id: imageButton - anchors.fill: parent - fillMode: Image.PreserveAspectFit - source: "qrc:/res/icons/ic_scroll-down.png" - } - - states: [ - State { - name: "goDown" - PropertyChanges { - target: buttonScroll - onStateChanged: { - buttonScroll.anchors.top = undefined; - buttonScroll.anchors.bottom = dapListView.bottom; - buttonMouseArea.exited(); - } - } - }, - - State { - name: "goUp" - PropertyChanges { - target: buttonScroll - onStateChanged: { - buttonScroll.anchors.bottom = undefined; - buttonScroll.anchors.top = viewData.top; - buttonMouseArea.exited(); - } - } - } - ] - - state: "goUp" - - MouseArea { - id: buttonMouseArea - anchors.fill: parent - hoverEnabled: true - - onEntered: { - isHovered = true; - if(buttonScroll.state === "goUp") - imageButton.source = "qrc:/res/icons/ic_scroll-down_hover.png"; - else if(buttonScroll.state === "goDown") - imageButton.source = "qrc:/res/icons/ic_scroll-up_hover.png"; - - } - - onExited: { - isHovered = false; - if(buttonScroll.state === "goUp") - imageButton.source = "qrc:/res/icons/ic_scroll-down.png"; - else if(buttonScroll.state === "goDown") - imageButton.source = "qrc:/res/icons/ic_scroll-up.png"; - } - - onClicked: { - if(buttonScroll.state === "goUp") - { - viewData.positionViewAtEnd(); - buttonScroll.state = "goDown"; - } - else if(buttonScroll.state === "goDown") - { - viewData.positionViewAtBeginning(); - buttonScroll.state = "goUp"; - } - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsDelegateForm.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsDelegateForm.qml deleted file mode 100644 index b6c9f37df..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsDelegateForm.qml +++ /dev/null @@ -1,65 +0,0 @@ -import QtQuick 2.9 -import QtQml 2.12 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.12 - -Component { - Rectangle { - id: dapContentDelegate - width: parent.width - height: 50 * pt - color: "transparent" - - Rectangle { - id: dapData - width: childrenRect.width - height: childrenRect.height - Layout.alignment: Qt.AlignVCenter - anchors.left: dapContentDelegate.left - anchors.leftMargin: 16 * pt - anchors.top: parent.top - anchors.topMargin: 13 - - Column { - anchors.fill: parent - spacing: 2 - - Text { - text: tokenName - color: "#5F5F63" - font.family: "Roboto Regular" - font.pixelSize: 14 * pt - } - - Text { - text: txStatus - color: "#A7A7A7" - font.family: "Roboto" - font.pixelSize: 12 * pt - } - } - } - - Text { - anchors.left: dapData.right - anchors.top: parent.top - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.rightMargin: 20 * pt - - horizontalAlignment: Qt.AlignRight - verticalAlignment: Qt.AlignVCenter - color: "#505559" - text: cryptocurrency; - font.family: "Roboto" - font.pixelSize: 14 * pt - } - - Rectangle { - width: parent.width - height: 1 * pt - color: "#C7C9CC" - anchors.bottom: parent.bottom - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsForm.ui.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsForm.ui.qml deleted file mode 100644 index 7648b3a8c..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsForm.ui.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.4 - -Rectangle { - color: "transparent" -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsHeaderForm.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsHeaderForm.qml deleted file mode 100644 index a8a3b4b95..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsHeaderForm.qml +++ /dev/null @@ -1,27 +0,0 @@ -import QtQuick 2.9 -import QtQml 2.12 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.12 - -Rectangle { - height: 36 * pt - color: "transparent" - - Text { - anchors.fill: parent - anchors.leftMargin: 16 * pt - text: qsTr("Last actions") - verticalAlignment: Qt.AlignVCenter - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - color: "#5F5F63" - } - - Rectangle { - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - height: 1 - color: "#757184" - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsSectionForm.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsSectionForm.qml deleted file mode 100644 index 6ea635c49..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetLastActionsSectionForm.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 2.9 -import QtQml 2.12 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.12 - -Rectangle { - color: "#757184" - - Text { - anchors.fill: parent - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignLeft - color: "#FFFFFF" - text: section - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - leftPadding: 16 * pt - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetRightPanel.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetRightPanel.qml deleted file mode 100644 index 8169b7b84..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetRightPanel.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.4 - -DapUiQmlWidgetRightPanelForm { - -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetRightPanelForm.ui.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetRightPanelForm.ui.qml deleted file mode 100644 index 27a6895a2..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetRightPanelForm.ui.qml +++ /dev/null @@ -1,42 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 2.13 - -Rectangle { - id: rightPanel - property alias header : stackViewHeader - property alias content : stackViewContent - property alias background : rightPanelPage.background - property alias footer: stackViewFooter - - width: visible ? 400 * pt : 0 - color: "#E3E2E6" - - Page { - id: rightPanelPage - anchors.fill: parent - anchors.leftMargin: 1 - background: Rectangle { - color: "#F8F7FA" - } - - header: StackView { - id: stackViewHeader - width: parent.width - height: currentItem === null ? 0 : currentItem.height - clip: true - } - - StackView { - id: stackViewContent - anchors.fill: parent - clip: true - } - - footer: StackView { - id: stackViewFooter - width: parent.width - height: currentItem === null ? 0 : currentItem.height - clip: true - } - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetScreenDialogAddWallet.ui.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetScreenDialogAddWallet.ui.qml deleted file mode 100644 index 27c038bcc..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetScreenDialogAddWallet.ui.qml +++ /dev/null @@ -1,14 +0,0 @@ -import QtQuick 2.4 - -Rectangle { - width: 400 * pt - border.color: "#B5B5B5" - border.width: 1 * pt - color: "#EDEFF2" - - anchors { - top: parent.top - right: parent.right - bottom: parent.bottom - } -} diff --git a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetSignatureTypeComboBox.qml b/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetSignatureTypeComboBox.qml deleted file mode 100644 index e7338ec0c..000000000 --- a/CellFrameDashboardGUI/Screen/LastAction/DapUiQmlWidgetSignatureTypeComboBox.qml +++ /dev/null @@ -1,58 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 -import QtQuick.Controls.Styles 1.4 -import "../" - -DapUiQmlWidgetStatusBarComboBox { - - model: ListModel { - id: signatureType - ListElement { - signatureName: "Dilithium" - } - ListElement { - signatureName: "Bliss" - } - ListElement { - signatureName: "Picnic" - } - ListElement { - signatureName: "Tesla" - } - } - - headerTextColor: "#070023" - widthArrow: 20 * pt - heightArrow: 20 * pt - - font { - pointSize: 16 - family: "Roboto" - styleName: "Normal" - weight: Font.Normal - } - - currentIndex: 0 - displayText: currentText - - delegate: ItemDelegate { - width: parent.width - contentItem: DapUiQmlWidgetStatusBarContentItem { - text: signatureName - color: hovered ? "#FFFFFF" : "#070023" - } - - background: Rectangle { - height: 32 * pt - color: hovered ? "#330F54" : "#FFFFFF" - } - - highlighted: parent.highlightedIndex === index - } -} - -/*##^## -Designer { - D{i:0;autoSize:true;height:480;width:640} -} -##^##*/ diff --git a/CellFrameDashboardGUI/Screen/Log/DapUiQmlWidgetChainNodeLogs.qml b/CellFrameDashboardGUI/Screen/Log/DapUiQmlWidgetChainNodeLogs.qml deleted file mode 100644 index 5a2d7bdb2..000000000 --- a/CellFrameDashboardGUI/Screen/Log/DapUiQmlWidgetChainNodeLogs.qml +++ /dev/null @@ -1,82 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 1.4 -import CellFrameDashboard 1.0 - -DapUiQmlWidgetChainNodeLogsForm { - id: dapQmlWidgetChainNodeLogs - - Component - { - id: componentItenDelegate - Rectangle - { - color: listViewLogs.currentIndex === index ? "#48435F" : "#3B3652" - width: listViewLogs.width - height: 72 - z: 1 - clip: true - - Row - { - id: rowItem - padding: 10 - spacing: 10 - clip: true - width: parent.width - Column - { - anchors.leftMargin: 10 - width: 25 - Text - { - text: qsTr(type) - color: "#CFCBD9" - font.weight: Font.Normal - font.family: "Roboto" - font.pointSize: 10 - anchors.horizontalCenter: parent.horizontalCenter - } - } - Column - { - spacing: 5 - clip: true - width: rowItem.width - 50 - Text - { - text: qsTr(message) - color: "#CFCBD9" - font.weight: Font.Normal - font.family: "Roboto" - font.pointSize: 10 - width: parent.width - elide: Text.ElideRight - } - Text - { - text: qsTr(file) - color: "#CFCBD9" - font.weight: Font.Light - font.family: "Roboto" - font.pointSize: 8 - } - Text - { - text: qsTr(timestamp) - color: "#CFCBD9" - font.weight: Font.Light - font.family: "Roboto" - font.pointSize: 8 - } - } - } - - MouseArea - { - id: mouseAreaListViewLogs - anchors.fill: parent - onClicked: listViewLogs.currentIndex = index - } - } - } -} diff --git a/CellFrameDashboardGUI/Screen/Log/DapUiQmlWidgetChainNodeLogsForm.ui.qml b/CellFrameDashboardGUI/Screen/Log/DapUiQmlWidgetChainNodeLogsForm.ui.qml deleted file mode 100644 index 3620bae88..000000000 --- a/CellFrameDashboardGUI/Screen/Log/DapUiQmlWidgetChainNodeLogsForm.ui.qml +++ /dev/null @@ -1,40 +0,0 @@ -import QtQuick 2.11 -import QtQuick.Controls 1.4 -import QtQuick.Controls 2.2 -import CellFrameDashboard 1.0 - -Page { - id: dapUiQmlWidgetChainNodeLogs - title: "Logs" - - property alias listViewLogs: listViewLogs - - Connections { - target: dapServiceController - onLogCompleted: - { - listViewLogs.model = null - listViewLogs.model = dapLogModel - } - } - - Rectangle - { - id: rectangleBackgroundPageLogs - anchors.fill: parent - color: "#36314D" - - ListView - { - id: listViewLogs - anchors.fill: parent - focus: true - model: dapLogModel - spacing: 3 - anchors.margins: 3 - - delegate: componentItenDelegate - } - } - -} diff --git a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettings.qml b/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettings.qml deleted file mode 100644 index f2a1bd322..000000000 --- a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettings.qml +++ /dev/null @@ -1,41 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 2.12 - -DapUiQmlScreenSettingsForm { - anchors.fill: parent - - ListModel { - id: dapListModelSettings - ListElement { - name: qsTr("Network") - element: "DapUiQmlWidgetSettingsNetwork.qml" - } - - ListElement { - name: qsTr("VPN") - element: "qrc:/screen/VPN/DapUiQmlWidgetSettingsVpn.qml" - } - } - - ListView { - id: dapListViewSettings - anchors.fill: parent - model: dapListModelSettings - delegate: Component { - - Item { - width: parent.width - height: loaderSettings.height - - Loader { - id: loaderSettings - source: element - } - } - } - - section.property: "name" - section.criteria: ViewSection.FullString - section.delegate: DapUiQmlScreenSettingsSection {} - } -} diff --git a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettingsForm.ui.qml b/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettingsForm.ui.qml deleted file mode 100644 index 9faa0c04d..000000000 --- a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettingsForm.ui.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.4 - -Item { - anchors.fill: parent -} diff --git a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettingsSection.qml b/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettingsSection.qml deleted file mode 100644 index 51d10f3f6..000000000 --- a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlScreenSettingsSection.qml +++ /dev/null @@ -1,21 +0,0 @@ -import QtQuick 2.0 - -Component { - - Rectangle { - width: parent.width - height: 30 * pt - color: "#DFE1E6" - - Text { - anchors.fill: parent - anchors.leftMargin: 18 * pt - verticalAlignment: Qt.AlignVCenter - text: section - font.family: "Roboto" - font.pixelSize: 12 * pt - color: "#5F5F63" - } - } - -} diff --git a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlWidgetSettingsNetwork.qml b/CellFrameDashboardGUI/Screen/Settings/DapUiQmlWidgetSettingsNetwork.qml deleted file mode 100644 index b73c03d6c..000000000 --- a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlWidgetSettingsNetwork.qml +++ /dev/null @@ -1,25 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 2.12 - -DapUiQmlWidgetSettingsNetworkForm { - width: parent.width - height: childrenRect.height + 40 * pt - - ComboBox { - width: 150 - height: 50 - anchors.left: parent.left - anchors.top: parent.top - anchors.leftMargin: 18 * pt - anchors.topMargin: 13 * pt - model: dapSettingsNetworkModel - textRole: "network" - currentIndex: dapSettingsNetworkModel.getCurrentIndex() - - onCurrentTextChanged: { - if(dapSettingsNetworkModel.getCurrentIndex() !== currentIndex) { - dapSettingsNetworkModel.setCurrentNetwork(currentText, currentIndex); - } - } - } -} diff --git a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlWidgetSettingsNetworkForm.ui.qml b/CellFrameDashboardGUI/Screen/Settings/DapUiQmlWidgetSettingsNetworkForm.ui.qml deleted file mode 100644 index 96a8ae4f5..000000000 --- a/CellFrameDashboardGUI/Screen/Settings/DapUiQmlWidgetSettingsNetworkForm.ui.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.4 - -Item { - width: 400 - height: 400 -} diff --git a/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBar.qml b/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBar.qml deleted file mode 100644 index 8ed0069e5..000000000 --- a/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBar.qml +++ /dev/null @@ -1,87 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 -import QtQuick.Controls.Styles 1.4 -import QtGraphicalEffects 1.0 -import QtQuick.Layouts 1.3 - -Rectangle { -// property alias addWalletPressed: statusBarAddWalletButton.pressed - Rectangle { - anchors.fill: parent - anchors.bottomMargin: 1 - color: "transparent" - - Row { - anchors.top: parent.top - anchors.left: parent.left - anchors.bottom: parent.bottom - anchors.right: statusBarAddWalletButton.left - anchors.leftMargin: 30 * pt - anchors.topMargin: 10 * pt - anchors.bottomMargin: 10 * pt - spacing: 10 * pt - - Label { - text: qsTr("Wallet") - anchors.top: parent.top - anchors.bottom: parent.bottom - verticalAlignment: Qt.AlignVCenter - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - color: "#A7A7A7" - } - - DapUiQmlWidgetStatusBarComboBoxWallet { - id: comboboxWallet - anchors.top: parent.top - anchors.bottom: parent.bottom - fieldBalance: fieldWalletBalance - } - - Label { - id: titleWalletBalance - anchors.top: parent.top - anchors.bottom: parent.bottom - verticalAlignment: Qt.AlignVCenter - text: qsTr("Wallet balance:") - font.family: fontRobotoRegular.name - font.pixelSize: 12 * pt - color: "#A7A7A7" - } - - Label { - id: fieldWalletBalance - anchors.top: parent.top - anchors.bottom: parent.bottom - verticalAlignment: Qt.AlignVCenter - font.family: fontRobotoRegular.name - font.pixelSize: 16 * pt - color: "#FFFFFF" - text: dapChainConvertor.toConvertCurrency( - dapWalletModel.walletBalance(comboboxWallet.currentText)) - } - } - - DapUiQmlWidgetStatusBarButton { - id: statusBarAddWalletButton - width: 130 * pt - anchors.right: parent.right - anchors.top: parent.top - anchors.topMargin: 10 * pt - anchors.rightMargin: 20 * pt - anchors.bottom: parent.bottom - anchors.bottomMargin: 10 * pt - - onClicked: { - rightPanel.header.push("qrc:/screen/LastAction/DapUiQmlScreenDialogAddWalletHeader.qml", {"rightPanel": rightPanel}); - rightPanel.content.push("qrc:/screen/LastAction/DapUiQmlScreenDialogAddWallet.qml", {"rightPanel": rightPanel}); - } - } - } -} - -/*##^## -Designer { - D{i:0;autoSize:true;height:480;width:640} -} -##^##*/ diff --git a/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarButton.ui.qml b/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarButton.ui.qml deleted file mode 100644 index 8ff9e9cbe..000000000 --- a/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarButton.ui.qml +++ /dev/null @@ -1,32 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 - -Button { - id: button - contentItem: Rectangle { - anchors.fill: parent - border.color: "#B5B5B5" - border.width: 1 * pt - color: "transparent" - - Text { - anchors.fill: parent - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignRight - anchors.rightMargin: 20 * pt - font.family: "Regular" - color: "#505559" - text: qsTr("New wallet") - } - - Image { - id: iconNewWallet - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: 10 * pt - source: "qrc:/res/icons/defaul_icon.png" - width: 28 * pt - height: 28 * pt - } - } -} diff --git a/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWallet.qml b/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWallet.qml deleted file mode 100644 index 572e877f1..000000000 --- a/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWallet.qml +++ /dev/null @@ -1,20 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 2.5 -import QtQuick.Controls.Styles 1.4 -import QtGraphicalEffects 1.0 -import QtQml 2.13 -import "../" - -DapUiQmlWidgetStatusBarComboBoxWalletForm { - property Label fieldBalance: Label {} - model: dapWalletModel.wallets - - delegate: DapUiQmlWidgetStatusBarComboBoxDelegate { - delegateContentText: modelData - } - - onCurrentTextChanged: { - dapWalletFilterModel.setWalletFilter(currentText); - - } -} diff --git a/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWalletForm.ui.qml b/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWalletForm.ui.qml deleted file mode 100644 index 955455563..000000000 --- a/CellFrameDashboardGUI/Screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWalletForm.ui.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.4 -import "../" - -DapUiQmlWidgetStatusBarComboBox { - -} diff --git a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlScreenVpn.qml b/CellFrameDashboardGUI/Screen/VPN/DapUiQmlScreenVpn.qml deleted file mode 100644 index d764fba09..000000000 --- a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlScreenVpn.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.4 - -DapUiQmlScreenVpnForm { -} diff --git a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlScreenVpnForm.ui.qml b/CellFrameDashboardGUI/Screen/VPN/DapUiQmlScreenVpnForm.ui.qml deleted file mode 100644 index d4d6286f5..000000000 --- a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlScreenVpnForm.ui.qml +++ /dev/null @@ -1,149 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 2.5 -import QtQuick.Controls.Styles 1.4 -import QtGraphicalEffects 1.0 -import QtQuick.Layouts 1.12 - -Item { - width: 400 - height: 600 - - Text { - anchors.left: parent.left - anchors.top: parent.top - anchors.leftMargin: 30 * pt - anchors.topMargin: 18 * pt - color: "#d61f5d" - font.family: "Roboto Regular" - font.pixelSize: 14 * pt - text: "283 days left" - } - - Row { - width: childrenRect.width - anchors.top: parent.top - anchors.topMargin: 40 * pt - anchors.horizontalCenter: parent.horizontalCenter - spacing: 10 * pt - - Image { - id: imageVpn - Layout.alignment: Qt.AlignVCenter - width: 48 * pt - height: 48 * pt - source: "qrc:/res/icons/defaul_icon.png" - } - - Text { - id: titleVpn - Layout.alignment: Qt.AlignVCenter - verticalAlignment: Text.AlignVCenter - text: "KELVPN" - font.family: "Roboto Regular" - font.pixelSize: 42 * pt - } - } - - - Switch { - id: control - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: 150 * pt - height: 70 * pt - text: checked ? "Connected" : "Disconnected" - - indicator: Rectangle { - implicitWidth: control.width - implicitHeight: control.height - x: control.leftPadding - y: parent.height / 2 - height / 2 - radius: control.height / 2 - color: control.checked ? "#d61f5d" : "#ffffff" - border.color: control.checked ? "#d61f5d" : "#cccccc" - - Rectangle { - x: control.checked ? parent.width - width - 10 * pt : 10 * pt - anchors.verticalCenter: parent.verticalCenter - width: control.height - 15 * pt - height: width - radius: height / 2 - color: control.down ? "#cccccc" : "#ffffff" - border.color: control.checked ? (control.down ? "#17a81a" : "#d61f5d") : "#999999" - } - } - - contentItem: Text { - text: control.text - anchors.left: control.left - anchors.right: control.right - anchors.bottom: control.top - anchors.bottomMargin: 10 * pt - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignBottom - font.family: "Roboto" - font.pixelSize: 16 * pt - color: "#707070" - } - } - - ComboBox { - id: comboboxServer - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - anchors.bottomMargin: 40 * pt - width: 150 * pt - height: 48 * pt - textRole: "name" - - model: ListModel { - id: modelTest - ListElement {name: "first"; icon: "qrc:/res/icons/defaul_icon.png" } - ListElement {name: "second"; icon: "qrc:/res/icons/defaul_icon.png" } - } - - background: Rectangle { - anchors.fill: parent - - Rectangle { - id: contentCorner - anchors.fill: parent - color: "#FFFFFF" - radius: width / 2 - } - - DropShadow { - anchors.fill: parent - source: contentCorner - verticalOffset: 4 * pt - samples: 13 * pt - color: "#40000000" - } - } - - contentItem: Rectangle { - anchors.fill: parent - color: "transparent" - - Image { - id: imageServer - anchors.left: parent.left - anchors.leftMargin: 22 * pt - anchors.verticalCenter: parent.verticalCenter - source: modelTest.get(modelTest.index(comboboxServer.currentIndex, 0)).icon - width: 24 * pt - height: 24 * pt - } - - Text { - anchors.left: imageServer.right - anchors.leftMargin: 10 * pt - anchors.verticalCenter: parent.verticalCenter - text: comboboxServer.currentText - font.family: "Roboto Light" - font.pixelSize: 16 * pt - } - } - - } -} diff --git a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpn.qml b/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpn.qml deleted file mode 100644 index d8d1cccb0..000000000 --- a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpn.qml +++ /dev/null @@ -1,67 +0,0 @@ -import QtQuick 2.4 - -DapUiQmlWidgetSettingsVpnForm { - Column { - anchors.left: parent.left - anchors.top: parent.top - anchors.leftMargin: 15 * pt - anchors.topMargin: 13 * pt - spacing: 15 * pt - - DapUiQmlWidgetSettingsVpnComboBox { - id: comboBoxBand - width: 150 * pt - height: 32 * pt - textRole: "band" - model: ListModel { - ListElement {band: "100 Mbit" } - ListElement {band: "200 Mbit" } - } - } - - DapUiQmlWidgetSettingsVpnComboBox { - id: comboBoxUptime - width: 150 * pt - height: 32 * pt - textRole: "uptime" - model: ListModel { - ListElement {uptime: "30 minutes" } - ListElement {uptime: "3 hours" } - } - } - - DapUiQmlWidgetSettingsVpnComboBox { - id: comboBoxEncription - width: 150 * pt - height: 32 * pt - textRole: "encription" - model: ListModel { - ListElement {encription: "RSA-2048" } - ListElement {encription: "AES-256" } - } - } - - DapUiQmlWidgetSettingsVpnComboBox { - id: comboBoxBalance - width: 150 * pt - height: 32 * pt - textRole: "balance" - model: ListModel { - ListElement {balance: "320 RUB" } - ListElement {balance: "500 RUB" } - } - } - - DapUiQmlWidgetSettingsVpnComboBox { - id: comboBoxLanguage - width: 150 * pt - height: 32 * pt - textRole: "language" - model: ListModel { - ListElement {language: "RUS" } - ListElement {language: "ENG" } - } - } - } - -} diff --git a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnComboBox.qml b/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnComboBox.qml deleted file mode 100644 index 3651997ce..000000000 --- a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnComboBox.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.4 - -DapUiQmlWidgetSettingsVpnComboBoxForm { - -} diff --git a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnComboBoxForm.ui.qml b/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnComboBoxForm.ui.qml deleted file mode 100644 index fa2b6d696..000000000 --- a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnComboBoxForm.ui.qml +++ /dev/null @@ -1,32 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 2.5 -import QtGraphicalEffects 1.0 - -ComboBox { - background: Rectangle { - anchors.fill: parent - border.color: "#707070" - border.width: 1 - radius: parent.width / 2 - } - - contentItem: Text { - anchors.fill: parent - anchors.leftMargin: 12 * pt - anchors.rightMargin: 52 * pt - text: parent.displayText - font.family: "Regular" - font.pixelSize: 14 * pt - color: "#A7A7A7" - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - - DropShadow { - anchors.fill: parent - source: parent.background - verticalOffset: 4 * pt - samples: 13 * pt - color: "#40000000" - } -} diff --git a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnForm.ui.qml b/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnForm.ui.qml deleted file mode 100644 index 86a170a0a..000000000 --- a/CellFrameDashboardGUI/Screen/VPN/DapUiQmlWidgetSettingsVpnForm.ui.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 2.4 - -Item { - width: 400 - height: 400 - -} diff --git a/CellFrameDashboardGUI/Screen/main.qml b/CellFrameDashboardGUI/Screen/main.qml deleted file mode 100644 index 7458e4c24..000000000 --- a/CellFrameDashboardGUI/Screen/main.qml +++ /dev/null @@ -1,37 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 1.4 -import QtQuick.Controls 2.2 -import QtQuick.Window 2.0 -import QtQuick.Controls.Styles 1.3 -import QtQuick.Controls.Styles 1.4 -import Qt.labs.platform 1.0 - -ApplicationWindow { - id: window - visible: true - width: 1280 - height: 800 - - onClosing: { - console.log("Close") - window.hide() - } - - Connections { - target: dapServiceController - - onActivateWindow: { - if(window.visibility === Window.Hidden) { - window.show() - window.raise() - window.requestActivate() - } else { - window.hide() - } - } - } - - DapUiQmlScreenMainWindow { - anchors.fill: parent - } -} diff --git a/CellFrameDashboardGUI/Src/DapChainNodeNetworkExplorer.cpp b/CellFrameDashboardGUI/Src/DapChainNodeNetworkExplorer.cpp deleted file mode 100644 index 53a988b05..000000000 --- a/CellFrameDashboardGUI/Src/DapChainNodeNetworkExplorer.cpp +++ /dev/null @@ -1,325 +0,0 @@ -#include "DapChainNodeNetworkExplorer.h" - -#define DEFAULT_NODE_COLOR_HOVER QColor("#FF0000") -#define DEFAULT_NODE_COLOR QColor("#000000") -#define DEFAULT_NODE_COLOR_OFFLINE QColor("#FF0000") -#define DEFAULT_NODE_COLOR_ONLINE QColor("#00FF00") -#define DEFAULT_NODE_COLOR_SELECTED QColor("#0000FF") -#define DEFAULT_NODE_SIZE 50 -#define DEFAULT_WIDTH_LINE 3 - -DapChainNodeNetworkExplorer::DapChainNodeNetworkExplorer(QQuickItem *parent) : - QQuickPaintedItem(parent), - m_model(nullptr), - m_colorOnline(DEFAULT_NODE_COLOR_ONLINE), - m_colorOffline(DEFAULT_NODE_COLOR_OFFLINE), - m_colorSelect(DEFAULT_NODE_COLOR_SELECTED), - m_colorNormal(DEFAULT_NODE_COLOR), - m_colorFocused(DEFAULT_NODE_COLOR_HOVER), - m_widthLine(DEFAULT_WIDTH_LINE), - m_sizeNode(DEFAULT_NODE_SIZE) -{ - setAcceptedMouseButtons(Qt::RightButton); - setAcceptHoverEvents(true); -} - -void DapChainNodeNetworkExplorer::mousePressEvent(QMouseEvent* event) -{ - QQuickPaintedItem::mousePressEvent(event); - - emit selectNodeChanged(); - - if(m_currentSelectedNode.second != nullptr) - { - m_currentSelectedNode.second->State = Normal; - m_currentSelectedNode.second = nullptr; - } - - for(auto node = m_nodeMap.begin(); node != m_nodeMap.end(); node++) - { - if(node.value().State == DapNodeState::Focused) - { - DapNodeGui* nodeData = &node.value(); - nodeData->State = DapNodeState::Selected; - m_currentSelectedNode = QPair<QString, DapNodeGui*>(node.key(), nodeData); - - const DapNodeData* currentData = m_model->getNodeData(node.key()); - emit selectNode(currentData->isCurrentNode); - update(); - return; - } - } -} - -void DapChainNodeNetworkExplorer::wheelEvent(QWheelEvent* event) -{ - if(event->delta() > 1) - { - if(scale() < 1.8) setScale(scale() + 0.1); - } - else - { - if(scale() > 0.5) setScale(scale() - 0.1); - } -} - -void DapChainNodeNetworkExplorer::hoverMoveEvent(QHoverEvent* event) -{ - QQuickPaintedItem::hoverMoveEvent(event); - - for(auto node = m_nodeMap.begin(); node != m_nodeMap.end(); node++) - { - DapNodeGui* nodeDataGui = &node.value(); - if(nodeDataGui->Rect.contains(event->pos()) && nodeDataGui->State != Selected) - { - nodeDataGui->State = DapNodeState::Focused; - break; - } - else if(nodeDataGui->State == DapNodeState::Focused) - { - nodeDataGui->State = DapNodeState::Normal; - break; - } - } - - update(); -} - -void DapChainNodeNetworkExplorer::paint(QPainter* painter) -{ - if(m_model == nullptr) return; - QString focusedNode = QString(); - QPen penNormal(QBrush(m_colorNormal), m_widthLine); - QPen penOnline(QBrush(m_colorOnline), m_widthLine); - QPen penOffline(QBrush(m_colorOffline), m_widthLine); - QPen penFocused(QBrush(m_colorFocused), m_widthLine); - QPen penSelected(QBrush(m_colorSelect), m_widthLine); - - painter->setBrush(QBrush("#FFFFFF")); - for(auto node = m_nodeMap.constBegin(); node != m_nodeMap.constEnd(); node++) - { - const DapNodeGui* nodeDataGui = &node.value(); - const DapNodeData* nodeData = m_model->getNodeData(node.key()); - if(nodeData == nullptr) continue; - for(int i = 0; i < nodeData->Link.count(); i++) - { - painter->setPen(penNormal); - if(nodeData->isCurrentNode) - { - if(nodeData->Status) painter->setPen(penOnline); - else painter->setPen(penOffline); - } - - painter->drawLine(nodeDataGui->Rect.center(), m_nodeMap[nodeData->Link.at(i)].Rect.center()); - } - - if(nodeDataGui->State == Focused) - { - painter->setPen(penFocused); - focusedNode = node.key(); - } - else if(nodeDataGui->State == Selected) painter->setPen(penSelected); - else painter->setPen(penNormal); - - painter->drawEllipse(nodeDataGui->Rect); - } - - if(!focusedNode.isEmpty()) - { - QPen penWhite(QBrush("#FFFFFF"), m_widthLine); - QRect rect(m_nodeMap[focusedNode].Rect.center(), QSize(200, 15)); - const DapNodeData* nodeData = m_model->getNodeData(focusedNode); - - painter->setPen(penWhite); - painter->drawRect(rect); - painter->setPen(penNormal); - painter->drawText(rect, nodeData->Alias); - } -} - -QColor DapChainNodeNetworkExplorer::getColorNormal() const -{ - return m_colorNormal; -} - -QColor DapChainNodeNetworkExplorer::getColorFocused() const -{ - return m_colorFocused; -} - -int DapChainNodeNetworkExplorer::getWidthLine() const -{ - return m_widthLine; -} - -int DapChainNodeNetworkExplorer::getSizeNode() const -{ - return m_sizeNode; -} - -DapChainNodeNetworkModel* DapChainNodeNetworkExplorer::getModel() const -{ - return m_model; -} - -int DapChainNodeNetworkExplorer::getSelectedNodePosX() const -{ - if(m_currentSelectedNode.second != nullptr) - return m_currentSelectedNode.second->Rect.center().x(); - return -1; -} - -int DapChainNodeNetworkExplorer::getSelectedNodePosY() const -{ - if(m_currentSelectedNode.second != nullptr) - return m_currentSelectedNode.second->Rect.center().y(); - return -1; -} - -QString DapChainNodeNetworkExplorer::getSelectedNodeAddress() const -{ - if(m_currentSelectedNode.second != nullptr) - return m_currentSelectedNode.first; - return QString(); -} - -QString DapChainNodeNetworkExplorer::getSelectedNodeAlias() const -{ - if(m_currentSelectedNode.second != nullptr) - { - const DapNodeData* nodeData = m_model->getNodeData(m_currentSelectedNode.first); - if(nodeData != nullptr) - return nodeData->Alias; - } - - return QString(); -} - -QString DapChainNodeNetworkExplorer::getSelectedNodeIpv4() const -{ - if(m_currentSelectedNode.second != nullptr) - { - const DapNodeData* nodeData = m_model->getNodeData(m_currentSelectedNode.first); - if(nodeData != nullptr) - return nodeData->Ipv4; - } - - return QString(); -} - -QColor DapChainNodeNetworkExplorer::getColorOnline() const -{ - return m_colorOnline; -} - -QColor DapChainNodeNetworkExplorer::getColorOffline() const -{ - return m_colorOffline; -} - -QColor DapChainNodeNetworkExplorer::getColorSelect() const -{ - return m_colorSelect; -} - -void DapChainNodeNetworkExplorer::setColorNormal(const QColor& aColorNormal) -{ - if (m_colorNormal == aColorNormal) - return; - - m_colorNormal = aColorNormal; - emit colorNormalChanged(m_colorNormal); -} - -void DapChainNodeNetworkExplorer::setColorFocused(const QColor& aColorActivated) -{ - if (m_colorFocused == aColorActivated) return; - m_colorFocused = aColorActivated; - emit colorFocusedChanged(m_colorFocused); -} - -void DapChainNodeNetworkExplorer::setWidthLine(const int widthLine) -{ - if (m_widthLine == widthLine) return; - m_widthLine = widthLine; - emit widthLineChanged(m_widthLine); -} - -void DapChainNodeNetworkExplorer::setSizeNode(const int sizeNode) -{ - if (m_sizeNode == sizeNode) return; - m_sizeNode = sizeNode; - emit sizeNodeChanged(m_sizeNode); -} - -void DapChainNodeNetworkExplorer::setModel(DapChainNodeNetworkModel* aModel) -{ - if (m_model == aModel) return; - m_model = aModel; - QObject::connect(m_model, SIGNAL(changeNodeNetwork()), this, SLOT(proccessCreateGraph())); - QObject::connect(m_model, SIGNAL(changeStatusNode(QString, bool)), this, SLOT(update())); - proccessCreateGraph(); - emit modelChanged(m_model); -} - -QString DapChainNodeNetworkExplorer::getAddressByPos(const int aX, const int aY) -{ - for(auto node = m_nodeMap.constBegin(); node != m_nodeMap.constEnd(); node++) - { - if(node->Rect.contains(aX, aY)) - return node.key(); - } - - return QString(); -} - -void DapChainNodeNetworkExplorer::setColorOnline(const QColor& aColorOnline) -{ - if (m_colorOnline == aColorOnline) - return; - - m_colorOnline = aColorOnline; - emit colorOnlineChanged(m_colorOnline); -} - -void DapChainNodeNetworkExplorer::setColorOffline(const QColor& aColorOffline) -{ - if (m_colorOffline == aColorOffline) - return; - - m_colorOffline = aColorOffline; - emit colorOfflineChanged(m_colorOffline); -} - -void DapChainNodeNetworkExplorer::setColorSelect(const QColor& aColorSelect) -{ - if (m_colorSelect == aColorSelect) - return; - - m_colorSelect = aColorSelect; - emit colorSelectChanged(m_colorSelect); -} - -void DapChainNodeNetworkExplorer::proccessCreateGraph() -{ - if(m_model == nullptr) return; - - const DapNodeMap* const nodeMap = m_model->getDataMap(); - int pointX = m_sizeNode; - int heightConten = nodeMap->count() * m_sizeNode; - - qsrand(150); - for (auto node = nodeMap->constBegin(); node != nodeMap->constEnd(); node++) - { - DapNodeGui nodeData; - - int posY = (qrand() % ((heightConten + 1) - m_sizeNode) + m_sizeNode); - nodeData.Rect = QRect(pointX, posY, m_sizeNode, m_sizeNode); - pointX += m_sizeNode * 2; - - m_nodeMap[node.key()] = nodeData; - } - - setSize(QSize(pointX + m_sizeNode * 2, heightConten + m_sizeNode * 2)); - update(); -} diff --git a/CellFrameDashboardGUI/Src/DapChainNodeNetworkModel.cpp b/CellFrameDashboardGUI/Src/DapChainNodeNetworkModel.cpp deleted file mode 100644 index 7dfd5a715..000000000 --- a/CellFrameDashboardGUI/Src/DapChainNodeNetworkModel.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "DapChainNodeNetworkModel.h" -#include <QDataStream> -#include <QDebug> - -#define DEFAULT_TIMER_MS 1000 - -DapChainNodeNetworkModel::DapChainNodeNetworkModel(QObject *parent) : QObject(parent) -{ - m_timerRequest = new QTimer(this); - QObject::connect(m_timerRequest, SIGNAL(timeout()), this, SIGNAL(requestNodeNetwork())); - m_timerRequest->start(DEFAULT_TIMER_MS); -} - -DapChainNodeNetworkModel& DapChainNodeNetworkModel::getInstance() -{ - static DapChainNodeNetworkModel instance; - return instance; -} - -const DapNodeMap* DapChainNodeNetworkModel::getDataMap() const -{ - return &m_nodeMap; -} - -const DapNodeData* DapChainNodeNetworkModel::getNodeData(const QString& aAddress) const -{ - const DapNodeData* nodeData = nullptr; - if(m_nodeMap.contains(aAddress)) - nodeData = const_cast<const DapNodeData*>(&m_nodeMap.find(aAddress).value()); - - return nodeData; -} - -QString DapChainNodeNetworkModel::getCurrentAddress() const -{ - for (auto node = m_nodeMap.constBegin(); node != m_nodeMap.constBegin(); node++) { - if(node.value().isCurrentNode) return node.key(); - } - - return QString(); -} - -bool DapChainNodeNetworkModel::isNodeOnline(const QString& aAddress) const -{ - if(m_nodeMap.contains(aAddress)) - return m_nodeMap[aAddress].Status; - - return false; -} - -void DapChainNodeNetworkModel::sendRequestNodeStatus(const bool aIsOnline) -{ - QString address = getCurrentAddress(); - qDebug() << "New STatus" << address << aIsOnline; - if(m_nodeMap[address].Status != aIsOnline) - emit requestNodeStatus(aIsOnline); -} - -void DapChainNodeNetworkModel::startRequest() -{ - if(m_timerRequest->isActive()) m_timerRequest->stop(); - m_timerRequest->start(); -} - -void DapChainNodeNetworkModel::startRequest(const int aTimeout) -{ - if(m_timerRequest->isActive()) m_timerRequest->stop(); - m_timerRequest->start(aTimeout); -} - -void DapChainNodeNetworkModel::stopRequest() -{ - m_timerRequest->stop(); -} - -void DapChainNodeNetworkModel::receiveNewNetwork(const QVariant& aData) -{ - if (m_data == aData) return; - m_data = aData; - m_nodeMap.clear(); - - QMap<QString, QVariant> dataMap = m_data.toMap(); - - QList<QString> addressList = dataMap.keys(); - QString currentNode; - bool currentNodeStatus = false; - foreach(auto address, addressList) - { - if(address == "current") - { - QStringList args = dataMap["current"].toStringList(); - currentNode = args.at(0); - currentNodeStatus = (args.at(1) == "NET_STATE_OFFLINE" ? false : true); - - continue; - } - m_nodeMap[address] = DapNodeData(); - } - - if(m_nodeMap.contains(currentNode)) - { - m_nodeMap[currentNode].Status = currentNodeStatus; - m_nodeMap[currentNode].isCurrentNode = true; - } - - for(auto node = m_nodeMap.begin(); node != m_nodeMap.end(); node++) - { - DapNodeData* nodeData = &node.value(); - QStringList nodeDataList = dataMap[node.key()].toStringList(); - nodeData->Cell = nodeDataList.at(0).toUInt(); - nodeData->Ipv4 = nodeDataList.at(1); - nodeData->Alias = nodeDataList.at(2); - - if(nodeDataList.at(3).toUInt() > 0) - { - for(int i = 4; i < nodeDataList.count(); i++) - nodeData->Link.append(nodeDataList.at(i)); - } - } - - emit changeNodeNetwork(); -} - -void DapChainNodeNetworkModel::receiveNodeStatus(const QVariant& aData) -{ - QByteArray data = aData.toByteArray(); - QDataStream out(&data, QIODevice::ReadOnly); - - QString address; - bool status; - - out >> address >> status; - - if(m_nodeMap.contains(address)) - { - DapNodeData* nodeData = &m_nodeMap[address]; - nodeData->Status = status; - nodeData->isCurrentNode = true; - emit changeStatusNode(address, status); - } -} diff --git a/CellFrameDashboardGUI/Src/DapChainWalletModel.cpp b/CellFrameDashboardGUI/Src/DapChainWalletModel.cpp deleted file mode 100644 index 1a5d6fd2e..000000000 --- a/CellFrameDashboardGUI/Src/DapChainWalletModel.cpp +++ /dev/null @@ -1,188 +0,0 @@ -#include "DapChainWalletModel.h" - -DapChainWalletModel::DapChainWalletModel(QObject *parent) - : QAbstractListModel(parent) -{ - -} - -DapChainWalletModel& DapChainWalletModel::instance() -{ - static DapChainWalletModel instance; - return instance; -} - -int DapChainWalletModel::rowCount(const QModelIndex &parent) const -{ - // For list models only the root node (an invalid parent) should return the list's size. For all - // other (valid) parents, rowCount() should return 0 so that it does not become a tree model. - if (parent.isValid()) return 0; - return m_walletList.count(); -} - -QVariant DapChainWalletModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid()) return QVariant(); - switch (role) { - case WalletListDisplayRole: return walletList(); - case WalletNameDisplayRole: return m_walletList[index.row()].first.Name; - case WalletAddressDisplayRole: return m_walletList[index.row()].first.Address; - case WalletIconDisplayRole: return m_walletList[index.row()].first.IconPath; - case NetworkDisplayRole: return m_walletList[index.row()].first.Network; - case WalletTokenListDisplayRole: - return QVariant::fromValue<QList<QObject*>>(tokeListByIndex(index.row())); - default: break; - } - - return QVariant(); -} - -QHash<int, QByteArray> DapChainWalletModel::roleNames() const -{ - QHash<int, QByteArray> roles; - roles[WalletNameDisplayRole] = "walletNameDisplayRole"; - roles[WalletAddressDisplayRole] = "walletAddressDisplayRole"; - roles[WalletIconDisplayRole] = "walletIconDisplayRole"; - roles[WalletTokenListDisplayRole] = "walletTokenListDisplayRole"; - roles[NetworkDisplayRole] = "networkDisplayRole"; - roles[WalletListDisplayRole] = "walletListDisplayRole"; - return roles; -} - -QStringList DapChainWalletModel::walletList() const -{ - return m_wallets; -} - -double DapChainWalletModel::walletBalance(const QString& aName) const -{ - double balance = 0.0; - - for(int i = 0; i < m_walletList.count(); i++) - { - if(m_walletList[i].first.Name == aName || aName == TITLE_ALL_WALLETS) - { - DapChainWalletTokenItemList tokenList = m_walletList[i].second; - for(int m = 0; m < tokenList.count(); m++) - { - balance += tokenList[m]->balance(); - } - } - } - - return balance; -} - -double DapChainWalletModel::walletBalance(const int aWalletIndex) const -{ - QString address = m_walletList[aWalletIndex].first.Address; - return walletBalance(address); -} - -QList<QObject*> DapChainWalletModel::tokeListByWallet(const QString& aWalletAddress, const QString& aNetwork) const -{ - QList<QObject*> tokenList; - for(int i = 0; i < m_walletList.count(); i++) - { - if(m_walletList[i].first.Address == aWalletAddress) - { - if(aNetwork.isEmpty() || aNetwork == m_walletList[i].first.Network) - { - DapChainWalletTokenItemList mTokenList = m_walletList[i].second; - for(int m = 0; m < mTokenList.count(); m++) - { - tokenList.append(mTokenList[m]); - } - - return tokenList; - } - - } - } - - return tokenList; -} - -QList<QObject*> DapChainWalletModel::tokeListByIndex(const int aIndex) const -{ - QList<QObject*> tokenList; - DapChainWalletTokenItemList tokenDataList = m_walletList[aIndex].second; - for(int i = 0; i < tokenDataList.count(); i++) - tokenList.append(tokenDataList[i]); - - return tokenList; -} - -void DapChainWalletModel::setWalletData(const QByteArray& aData) -{ - beginResetModel(); - m_walletList.clear(); - m_wallets.clear(); - m_wallets << TITLE_ALL_WALLETS; - QList<QPair<DapChainWalletData, QList<DapChainWalletTokenData>>> walletData; - QDataStream in(aData); - in >> walletData; - - for(int i = 0; i < walletData.count(); i++) - { - DapChainWalletPair walletPair(walletData[i].first, DapChainWalletTokenItemList()); - QList<DapChainWalletTokenData> tokeData = walletData[i].second; - if(!m_wallets.contains(walletData[i].first.Name)) - m_wallets.append(walletData[i].first.Name); - - for(int m = 0; m < tokeData.count(); m++) - { - walletPair.second.append(new DapChainWalletTokenItem(walletData[i].first.Address, tokeData[m], this)); - } - - m_walletList.append(walletPair); - } - - emit walletListChanged(m_wallets); - endResetModel(); -} - -void DapChainWalletModel::appendWallet(const DapChainWalletData& aWallet) -{ - m_walletList.append(DapChainWalletPair(aWallet, DapChainWalletTokenItemList())); - int lastIndex = m_walletList.count() - 1; - beginInsertRows(QModelIndex(), lastIndex, lastIndex); - endInsertRows(); -} - -void DapChainWalletModel::appendToken(const QString& aWalletAddress, const DapChainWalletTokenData& aTokenData) -{ - for(int i = 0; i < m_walletList.count(); i++) - { - if(m_walletList[i].first.Address == aWalletAddress) - { - m_walletList[i].second.append(new DapChainWalletTokenItem(aWalletAddress, aTokenData, this)); - } - } -} - -void DapChainWalletModel::removeWallet(const QString& aWalletAddress) -{ - int removeIndex = -1; - for(int i = 0; i < m_walletList.count(); i++) - { - if(m_walletList[i].first.Address == aWalletAddress) - { - m_walletList.removeAt(i); - removeIndex = i; - break; - } - } - - if(removeIndex == -1) return; - beginRemoveRows(QModelIndex(), removeIndex, removeIndex); - endRemoveRows(); -} - -void DapChainWalletModel::removeWallet(const int aWalletIndex) -{ - if(aWalletIndex > m_walletList.count() || m_walletList.count() < aWalletIndex) return; - beginRemoveRows(QModelIndex(), aWalletIndex, aWalletIndex); - m_walletList.removeAt(aWalletIndex); - endRemoveRows(); -} diff --git a/CellFrameDashboardGUI/Src/DapChainWalletsModel.cpp b/CellFrameDashboardGUI/Src/DapChainWalletsModel.cpp deleted file mode 100644 index 86d4815bf..000000000 --- a/CellFrameDashboardGUI/Src/DapChainWalletsModel.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include "DapChainWalletsModel.h" - - -DapChainWalletsModel::DapChainWalletsModel(QObject *parent) : QAbstractListModel(parent) -{ - -} - -DapChainWalletsModel &DapChainWalletsModel::getInstance() -{ - static DapChainWalletsModel instance; - return instance; -} - -int DapChainWalletsModel::rowCount(const QModelIndex &) const -{ - return m_dapChainWallets.count(); -} - -QVariant DapChainWalletsModel::data(const QModelIndex &index, int role) const -{ - if (index.row() < rowCount()) - switch (role) { - case IconWalletRole: return m_dapChainWallets.at(index.row())->getIconPath(); - case NameWalletRole: return m_dapChainWallets.at(index.row())->getName(); - case AddressWalletRole: return m_dapChainWallets.at(index.row())->getAddress(); - case BalanceWalletRole: return m_dapChainWallets.at(index.row())->getBalance(); - case TokensWalletRole: return m_dapChainWallets.at(index.row())->getTokens(); - case CountWalletRole: return m_dapChainWallets.at(index.row())->getCount(); - default: - return QVariant(); - } - return QVariant(); -} - -QHash<int, QByteArray> DapChainWalletsModel::roleNames() const -{ - static const QHash<int, QByteArray> roles { - { IconWalletRole, "iconPath" }, - { NameWalletRole, "name" }, - { AddressWalletRole, "address" }, - { BalanceWalletRole, "balance" }, - { TokensWalletRole, "tokens" }, - { CountWalletRole, "count" } - }; - - return roles; -} - -QVariantMap DapChainWalletsModel::get(int row) const -{ - if (m_dapChainWallets.count() == 0 || m_dapChainWallets.count() == row) { - return { {"iconPath", ""}, {"name", ""}, {"address", ""}, {"balance", ""}, {"tokens", QStringList()}, {"count", 0} }; - } - const DapChainWallet *wallet = m_dapChainWallets.value(row); - return { {"iconPath", wallet->getIconPath()}, {"name", wallet->getName()}, {"address", wallet->getAddress()}, {"balance", wallet->getBalance()}, {"tokens", wallet->getTokens()}, {"count", wallet->getCount()} }; -} - -void DapChainWalletsModel::append(const DapChainWallet &arWallet) -{ - this->append(arWallet.getIconPath(), arWallet.getName(), arWallet.getAddress(), arWallet.getBalance(), arWallet.getTokens()); -} - -void DapChainWalletsModel::append(const QString& asIconPath, const QString &asName, const QString &asAddress, const QStringList& aBalance, const QStringList& aTokens) -{ - int row = 0; - while (row < m_dapChainWallets.count()) - ++row; - beginInsertRows(QModelIndex(), row, row); - m_dapChainWallets.insert(row, new DapChainWallet(asIconPath, asName, asAddress, aBalance, aTokens)); - endInsertRows(); -} - -void DapChainWalletsModel::set(int row, const QString& asIconPath, const QString &asName, const QString &asAddresss, const QStringList& aBalance, const QStringList& aTokens) -{ - if (row < 0 || row >= m_dapChainWallets.count()) - return; - - DapChainWallet *wallet = m_dapChainWallets.value(row); - wallet->setIconPath(asIconPath); - wallet->setName(asName); - wallet->setAddress(asAddresss); - wallet->setBalance(aBalance); - wallet->setTokens(aTokens); - dataChanged(index(row, 0), index(row, 0), { IconWalletRole, NameWalletRole, AddressWalletRole, BalanceWalletRole, CountWalletRole }); -} - -void DapChainWalletsModel::remove(int row) -{ - if (row < 0 || row >= m_dapChainWallets.count()) - return; - - beginRemoveRows(QModelIndex(), row, row); - m_dapChainWallets.removeAt(row); - endRemoveRows(); -} - -void DapChainWalletsModel::clear() -{ - beginResetModel(); - if(m_dapChainWallets.count() > 0) { - qDeleteAll(m_dapChainWallets); - m_dapChainWallets.clear(); - } - endResetModel(); -} - -QObject *DapChainWalletsModel::singletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine) -{ - Q_UNUSED(engine) - Q_UNUSED(scriptEngine) - - return &getInstance(); -} diff --git a/CellFrameDashboardGUI/Src/DapClipboard.cpp b/CellFrameDashboardGUI/Src/DapClipboard.cpp deleted file mode 100644 index eb618ac2a..000000000 --- a/CellFrameDashboardGUI/Src/DapClipboard.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "DapClipboard.h" - -DapClipboard::DapClipboard(QObject *parent) : QObject(parent) -{ - m_clipboard = QApplication::clipboard(); -} - -DapClipboard& DapClipboard::instance() -{ - static DapClipboard instance; - return instance; -} - -void DapClipboard::setText(const QString& aText) -{ - m_clipboard->setText(aText); -} diff --git a/CellFrameDashboardGUI/Src/DapCommandController.cpp b/CellFrameDashboardGUI/Src/DapCommandController.cpp deleted file mode 100644 index 0fa87cd4a..000000000 --- a/CellFrameDashboardGUI/Src/DapCommandController.cpp +++ /dev/null @@ -1,306 +0,0 @@ -#include "DapCommandController.h" - -#include <DapNodeType.h> -#include <QDataStream> - -/// Overloaded constructor. -/// @param apIODevice Data transfer device. -/// @param apParent Parent. -DapCommandController::DapCommandController(QIODevice *apIODevice, QObject *apParent) - : DapRpcService(apParent) -{ - // Socket initialization - m_DAPRpcSocket = new DapRpcSocket(apIODevice, this); - // Signal-slot connection initiating the execution of the method called by the service - connect(m_DAPRpcSocket, SIGNAL(messageReceived(DapRpcMessage)), SLOT(messageProcessing(DapRpcMessage))); - - addService(this); -} - -/// Process incoming message. -/// @param asMessage Incoming message. -void DapCommandController::messageProcessing(const DapRpcMessage &asMessage) -{ - DapRpcSocket *socket = static_cast<DapRpcSocket*>(sender()); - if (!socket) { - qDebug() << "Called without service socket"; - return; - } - - processMessage(socket, asMessage); -} - -/// Process the result of the command execution. -void DapCommandController::processCommandResult() -{ - qInfo() << "processCommandResult()"; - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - if (!reply) { - qWarning() << "Invalid response received"; - return; - } - emit sigCommandResult(reply->response().toJsonValue()); -} - -/// Get node logs. -void DapCommandController::getNodeLogs() -{ - qInfo() << QString("getNodeLogs()"); - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.getNodeLogs"); - connect(reply, SIGNAL(finished()), this, SLOT(processGetNodeLogs())); -} - -void DapCommandController::getHistory() -{ - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.getHistory"); - connect(reply, SIGNAL(finished()), this, SLOT(processGetHistory())); - -} - -void DapCommandController::setNewHistory(const QVariant& aData) -{ - emit sendHistory(aData); -} - -void DapCommandController::requestConsole(const QString& aQueue) -{ - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.getQueryResult", aQueue); - connect(reply, SIGNAL(finished()), this, SLOT(processResponseConsole())); -} - -void DapCommandController::getCmdHistory() -{ - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.getCmdHistory"); - connect(reply, SIGNAL(finished()), this, SLOT(processGetCmdHistory())); -} - -void DapCommandController::changeCurrentNetwork(const QString& aNetwork) -{ - m_DAPRpcSocket->invokeRemoteMethod("RPCServer.changeCurrentNetwork", aNetwork); -} - -#include "DapChainWallet.h" -void DapCommandController::setNewWalletData(const QVariant& aData) -{ - emit sigWalletData(QByteArray::fromHex(aData.toByteArray())); -} - -void DapCommandController::requestWalletData() -{ - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.walletData"); - connect(reply, SIGNAL(finished()), this, SLOT(processGetWalletData())); -} - -void DapCommandController::processChangedLog() -{ -// QStringList tempLogModel; -// for(int x{0}; x < aLogModel.count(); ++x) -// tempLogModel.append(aLogModel.at(x).toString()); - emit onChangeLogModel(); -} - -/// Handling service response for receiving node logs. -void DapCommandController::processGetNodeLogs() -{ - qInfo() << "processGetNodeLogs()"; - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - if (!reply) { - qWarning() << "Invalid response received"; - return; - } - emit sigCommandResult(reply->response().toJsonValue()); - emit sigNodeLogsReceived(reply->response().toJsonValue().toVariant().toStringList()); -} - -/// -void DapCommandController::processAddWallet() -{ - qInfo() << "processAddWallet()"; - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - if (!reply) { - qWarning() << "Invalid response received"; - return; - } - emit sigCommandResult(reply->response().toJsonValue()); - auto name = reply->response().toJsonValue().toVariant().toStringList().at(0); - auto address = reply->response().toJsonValue().toVariant().toStringList().at(1); - emit sigWalletAdded(name, address); -} - -void DapCommandController::processSendToken() -{ - qInfo() << "processSendToken()"; - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - if (!reply) { - qWarning() << "Invalid response received"; - return; - } - qInfo() << reply->response(); - emit sigCommandResult(reply->response().toJsonValue()); - auto answer = reply->response().toJsonValue().toVariant().toString(); - emit onTokenSended(answer); -} - -void DapCommandController::processGetWallets() -{ - qInfo() << "processGetWallets()"; - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - if (!reply) { - qWarning() << "Invalid response received"; - return; - } - emit sigCommandResult(reply->response().toJsonValue()); - emit sigWalletsReceived(reply->response().toJsonValue().toVariant().toMap()); -} - -void DapCommandController::processGetWalletInfo() -{ - qInfo() << "processGetWalletInfo()"; - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - if (!reply || reply->response().toJsonValue().toVariant().toStringList().count() <= 0) { - qWarning() << "Invalid response received"; - return; - } - emit sigCommandResult(reply->response().toJsonValue()); - QString name = reply->response().toJsonValue().toVariant().toStringList().at(0); - QString address = reply->response().toJsonValue().toVariant().toStringList().at(1); - QStringList temp = reply->response().toJsonValue().toVariant().toStringList(); - QStringList tokens = temp.mid(3, temp.count()); - - emit sigWalletInfoChanged(name, address, QStringList(), tokens); -} - -void DapCommandController::processGetNodeNetwork() -{ - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - emit sendNodeNetwork(reply->response().toJsonValue().toVariant()); -} - -void DapCommandController::processGetNodeStatus() -{ - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - emit sendNodeStatus(reply->response().toJsonValue().toVariant()); -} - -void DapCommandController::processExecuteCommand() -{ - qInfo() << "processGetWalletInfo()"; - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - if (!reply || reply->response().toJsonValue().toVariant().toStringList().isEmpty()) { - - QString result = "Invalid response received"; - qWarning() << result; - emit executeCommandChanged(result); - return; - } - emit sigCommandResult(reply->response().toJsonValue()); - QString result = reply->response().toJsonValue().toVariant().toStringList().at(0); - emit executeCommandChanged(result); -} - -void DapCommandController::processGetHistory() -{ - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - QVariant result = reply->response().toJsonValue().toArray().toVariantList(); - emit sendHistory(result); -} - -void DapCommandController::processResponseConsole() -{ - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - QString result = reply->response().toJsonValue().toVariant().toString(); - emit responseConsole(result); -} - -void DapCommandController::processGetCmdHistory() -{ - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - QString result = reply->response().toJsonValue().toVariant().toString(); - emit sigCmdHistory(result); -} - -void DapCommandController::processGetWalletData() -{ - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - QByteArray result = reply->response().toJsonValue().toVariant().toByteArray(); - emit sigWalletData(QByteArray::fromHex(result)); -} - -void DapCommandController::processGetNetworkList() -{ - DapRpcServiceReply *reply = static_cast<DapRpcServiceReply *>(sender()); - QStringList result = reply->response().toJsonValue().toVariant().toStringList(); - emit sendNetworkList(result); -} - -/// Show or hide GUI client by clicking on the tray icon. -/// @param aIsActivated Accepts true - when requesting to -/// display a client, falso - when requesting to hide a client. -void DapCommandController::activateClient(bool aIsActivated) -{ - emit onClientActivate(aIsActivated); -} - -/// Shut down client. -void DapCommandController::closeClient() -{ - emit onClientClose(); -} - -void DapCommandController::addWallet(const QString &asWalletName) -{ - qInfo() << QString("addWallet(%1)").arg(asWalletName); - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.addWallet", asWalletName); - connect(reply, SIGNAL(finished()), this, SLOT(processAddWallet())); -} - -void DapCommandController::removeWallet(const QString &asWalletName) -{ - qInfo() << QString("removeWallet(%1)").arg(asWalletName); - m_DAPRpcSocket->invokeRemoteMethod("RPCServer.removeWallet", asWalletName); -} - -void DapCommandController::sendToken(const QString &asSendWallet, const QString &asAddressReceiver, const QString &asToken, const QString &aAmount) -{ - qInfo() << QString("sendToken(%1, %2, %3, %4)").arg(asSendWallet).arg(asAddressReceiver).arg(asToken).arg(aAmount); - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.sendToken", asSendWallet, asAddressReceiver, asToken, aAmount); - connect(reply, SIGNAL(finished()), this, SLOT(processSendToken())); -} - -void DapCommandController::getWallets() -{ - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.getWallets"); - connect(reply, SIGNAL(finished()), this, SLOT(processGetWallets())); -} - -void DapCommandController::getWalletInfo(const QString& asWalletName) -{ - qInfo() << QString("getWalletInfo(%1)").arg(asWalletName); - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.getWalletInfo", asWalletName); - connect(reply, SIGNAL(finished()), this, SLOT(processGetWalletInfo())); -} - -void DapCommandController::getNodeNetwork() -{ - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.getNodeNetwork"); - connect(reply, SIGNAL(finished()), this, SLOT(processGetNodeNetwork())); -} - -void DapCommandController::getNetworkList() -{ - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.getNetworkList"); - connect(reply, SIGNAL(finished()), this, SLOT(processGetNetworkList())); -} - -void DapCommandController::setNodeStatus(const bool aIsOnline) -{ - /*DapRpcServiceReply *reply =*/ m_DAPRpcSocket->invokeRemoteMethod("RPCServer.setNodeStatus", aIsOnline); -// connect(reply, SIGNAL(finished()), this, SLOT(processGetNodeStatus())); -} - -void DapCommandController::executeCommand(const QString &command) -{ - qInfo() << QString("rpc executeCommand(%1)").arg(command); - DapRpcServiceReply *reply = m_DAPRpcSocket->invokeRemoteMethod("RPCServer.executeCommand", command); - connect(reply, SIGNAL(finished()), this, SLOT(processExecuteCommand())); -} diff --git a/CellFrameDashboardGUI/Src/DapConsoleModel.cpp b/CellFrameDashboardGUI/Src/DapConsoleModel.cpp deleted file mode 100644 index 01d0ad78a..000000000 --- a/CellFrameDashboardGUI/Src/DapConsoleModel.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "DapConsoleModel.h" - -DapConsoleModel::DapConsoleModel(QObject *parent) : - QAbstractListModel(parent) -{ - -} - -DapConsoleModel& DapConsoleModel::getInstance() -{ - static DapConsoleModel instance; - return instance; -} - -void DapConsoleModel::receiveResponse(const QString& aResponse) -{ - m_History.append(aResponse); - emit sendResponse(aResponse); -} - -int DapConsoleModel::rowCount(const QModelIndex& parent) const -{ - Q_UNUSED(parent) - - return m_CommandList.count(); -} - -QVariant DapConsoleModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid()) return QVariant(); - - if(role == LastCommand) - return m_CommandList.at(index.row()); - - return QVariant(); -} - -QHash<int, QByteArray> DapConsoleModel::roleNames() const -{ - QHash<int, QByteArray> roles; - roles[LastCommand] = "lastCommand"; - return roles; -} - -QString DapConsoleModel::getCommandUp() -{ - if(m_CommandList.isEmpty()) return QString(); - if(m_CommandIndex > m_CommandList.begin()) m_CommandIndex--; - return *m_CommandIndex; -} - -QString DapConsoleModel::getCommandDown() -{ - if(m_CommandList.isEmpty()) return QString(); - if(m_CommandIndex < m_CommandList.end() -1) m_CommandIndex++; - else return QString(); - return *m_CommandIndex; -} - -void DapConsoleModel::receiveRequest(const QString& aCommand) -{ - beginResetModel(); - if(!m_CommandList.contains(aCommand)) - m_CommandList.append(aCommand); - endResetModel(); - m_CommandIndex = m_CommandList.end(); - - QString returnSymbol = "\n"; - -#ifdef Q_OS_WIN - returnSymbol.prepend("\r"); -#endif - - m_History.append(returnSymbol + "> " + aCommand + returnSymbol); - emit sendRequest(aCommand); -} - -QString DapConsoleModel::getCmdHistory() -{ - return m_History; -} - -void DapConsoleModel::receiveCmdHistory(const QString& aHistory) -{ - m_History = aHistory; - QRegularExpression rx("^> (.+)$"); - rx.setPatternOptions(QRegularExpression::MultilineOption); - - QRegularExpressionMatchIterator i = rx.globalMatch(m_History); - - while (i.hasNext()) { - QRegularExpressionMatch match = i.next(); - QString cmd = match.captured(1).remove(QChar('\r'), Qt::CaseInsensitive); - if(!m_CommandList.contains(cmd)) - m_CommandList.append(cmd); - } - - if(!m_CommandList.isEmpty()) - m_CommandIndex = m_CommandList.end(); - emit cmdHistoryChanged(m_History); -} diff --git a/CellFrameDashboardGUI/Src/DapScreenDialog.cpp b/CellFrameDashboardGUI/Src/DapScreenDialog.cpp deleted file mode 100644 index 33155e7b1..000000000 --- a/CellFrameDashboardGUI/Src/DapScreenDialog.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "DapScreenDialog.h" - -DapScreenDialog::DapScreenDialog(QObject *parent) : QObject(parent) -{ - m_proxyModel = new QSortFilterProxyModel; -// m_proxyModel->setSourceModel(&DapUiQmlWidgetModel::getInstance()); - m_proxyModel->setFilterRegExp(QRegExp("true")); -// m_proxyModel->setFilterRole(VisibleRole); -} - -QSortFilterProxyModel *DapScreenDialog::proxyModel() const -{ - return m_proxyModel; -} - -void DapScreenDialog::setProxyModel(QSortFilterProxyModel *proxyModel) -{ - m_proxyModel = proxyModel; -} diff --git a/CellFrameDashboardGUI/Src/DapScreenDialogChangeWidget.cpp b/CellFrameDashboardGUI/Src/DapScreenDialogChangeWidget.cpp deleted file mode 100644 index eb80026d3..000000000 --- a/CellFrameDashboardGUI/Src/DapScreenDialogChangeWidget.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "DapScreenDialogChangeWidget.h" - -DapScreenDialogChangeWidget::DapScreenDialogChangeWidget(QObject *parent) : QObject(parent) -{ - m_proxyModel = new QSortFilterProxyModel(this); -// m_proxyModel->setSourceModel(&DapUiQmlWidgetModel::getInstance()); - m_proxyModel->setFilterRegExp(QRegExp("false")); -// m_proxyModel->setFilterRole(VisibleRole); -} - -QSortFilterProxyModel *DapScreenDialogChangeWidget::proxyModel() const -{ - return m_proxyModel; -} - -void DapScreenDialogChangeWidget::setProxyModel(QSortFilterProxyModel *proxyModel) -{ - m_proxyModel = proxyModel; -} diff --git a/CellFrameDashboardGUI/Src/DapScreenHistoryFilterModel.cpp b/CellFrameDashboardGUI/Src/DapScreenHistoryFilterModel.cpp deleted file mode 100644 index 8f6d334e8..000000000 --- a/CellFrameDashboardGUI/Src/DapScreenHistoryFilterModel.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "DapScreenHistoryFilterModel.h" - -DapScreenHistoryFilterModel::DapScreenHistoryFilterModel(QObject *parent) : - QSortFilterProxyModel(parent), - m_status(-1) -{ - sort(0, Qt::DescendingOrder); -} - -DapScreenHistoryFilterModel& DapScreenHistoryFilterModel::getInstance() -{ - static DapScreenHistoryFilterModel instance; - return instance; -} - -void DapScreenHistoryFilterModel::setFilterWallet(const QString& aWalletNumber) -{ - if(m_walletNumber == aWalletNumber) return; - m_walletNumber = aWalletNumber; - setFilterKeyColumn(0); -} - -void DapScreenHistoryFilterModel::setFilterDate(const QDate& aDateLeft, const QDate& aDateRight) -{ - if(m_dateLeft == aDateLeft || m_dateRight == aDateRight) return; - m_dateLeft = aDateLeft; - m_dateRight = aDateRight; - setFilterKeyColumn(0); -} - -void DapScreenHistoryFilterModel::setFilterStatus(const DapTransactionStatus aStatus) -{ - if(m_status == aStatus) return; - m_status = aStatus; - setFilterKeyColumn(0); -} - -bool DapScreenHistoryFilterModel::lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const -{ - QDateTime first = source_left.data(DapScreenHistoryModel::DateRole).toDateTime(); - QDateTime second = source_right.data(DapScreenHistoryModel::DateRole).toDateTime(); - return first < second; -} - -bool DapScreenHistoryFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const -{ - QModelIndex index = sourceModel()->index(source_row, 0, source_parent); - QDateTime time = index.data(DapScreenHistoryModel::DateRole).toDateTime(); - - bool result = true; - bool filterByWalletNumber = !m_walletNumber.isEmpty(); - bool filterByDate = m_dateLeft.isValid() && m_dateRight.isValid(); - bool filterByStatus = m_status > -1; - - if(filterByDate) result &= (time.date() >= m_dateLeft && time.date() <= m_dateRight); - if(filterByStatus) result &= (index.data(DapScreenHistoryModel::StatusRole).toInt() == m_status); - if(filterByWalletNumber) result &= (index.data(DapScreenHistoryModel::DisplayNumberWalletRole).toString() == m_walletNumber); - - return result; -} diff --git a/CellFrameDashboardGUI/Src/DapScreenHistoryModel.cpp b/CellFrameDashboardGUI/Src/DapScreenHistoryModel.cpp deleted file mode 100644 index 2e8762934..000000000 --- a/CellFrameDashboardGUI/Src/DapScreenHistoryModel.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include "DapScreenHistoryModel.h" - -DapScreenHistoryModel::DapScreenHistoryModel(QObject *parent) - : QAbstractListModel(parent) -{ - -} - -DapScreenHistoryModel& DapScreenHistoryModel::getInstance() -{ - static DapScreenHistoryModel instance; - return instance; -} - -QHash<int, QByteArray> DapScreenHistoryModel::roleNames() const -{ - QHash<int, QByteArray> names; - names[DisplayDateRole] = "date"; - names[DisplayNameTokenRole] = "tokenName"; - names[DisplayNumberWalletRole] = "numberWallet"; - names[DisplayStatusRole] = "txStatus"; - names[DisplayCryptocurrency] = "cryptocurrency"; - names[DisplayCurrency] = "currency"; - names[DateRole] = "dateRole"; - names[StatusColorRole] = "statusColor"; - return names; -} - -void DapScreenHistoryModel::receiveNewData(const QVariant& aData) -{ - if(!aData.isValid()) - { - qWarning() << "New history data is not valid"; - return; - } - - beginResetModel(); - QList<QVariant> dataList = aData.toList(); - m_elementList.clear(); - - for(int i = 0; i < dataList.count(); i++) - { - // Description QStringList - // ------------------------ - // 0: date - // 1: status - // 2: currency - // 3: token - // 4: wallet_to - // 5: wallet_from - - QStringList dataItem = dataList.at(i).toStringList(); - DapTransactionItem item; - item.Date = QDateTime::fromString(dataItem.at(0), Qt::RFC2822Date); - item.Status = static_cast<DapTransactionStatus>(dataItem.at(1).toInt()); - item.Cryptocurrency = dataItem.at(2); - item.TokenName = dataItem.at(3); - item.WalletNumber = dataItem.at(5); - // TODO: Later we should convert currency - item.Currency = QString::number(dataItem.at(2).toDouble() * 0.98); - - switch (item.Status) { - case DapTransactionStatus::stSent: - item.Cryptocurrency.prepend("- "); - item.Currency.prepend("- $ "); - break; - case DapTransactionStatus::stReceived: - item.Cryptocurrency.prepend("+ "); - item.Currency.prepend("+ $ "); - break; - default: break; - } - - item.Cryptocurrency = DapChainConvertor::getInstance().toConvertCurrency(item.Cryptocurrency); - item.Cryptocurrency += " " + item.TokenName; - item.Currency.append(" USD"); - - m_elementList.append(item); - } - - - endResetModel(); -} - -int DapScreenHistoryModel::rowCount(const QModelIndex &parent) const -{ - if (parent.isValid()) return 0; - return m_elementList.count(); -} - -QVariant DapScreenHistoryModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid()) return QVariant(); - - switch (role) - { - case DisplayDateRole: - { - QDateTime currentTime = QDateTime::currentDateTime(); - QDateTime itemDate = m_elementList.at(index.row()).Date; - if(currentTime.date() == itemDate.date()) return QString("Today"); - return itemDate.toString(MASK_FOR_MODEL); - } - case DisplayNameTokenRole: return m_elementList.at(index.row()).TokenName; - case DisplayNumberWalletRole: return m_elementList.at(index.row()).WalletNumber; - case DisplayStatusRole: return DapTransactionStatusConvertor::getLongStatus(m_elementList.at(index.row()).Status); - case DisplayCryptocurrency: return m_elementList.at(index.row()).Cryptocurrency; - case DisplayCurrency: return m_elementList.at(index.row()).Currency; - case DateRole: return m_elementList.at(index.row()).Date; - case StatusColorRole: return DapTransactionStatusConvertor::getStatusColor(m_elementList.at(index.row()).Status); - case StatusRole: return m_elementList.at(index.row()).Status; - default: return QVariant(); - } -} diff --git a/CellFrameDashboardGUI/Src/DapServiceClient.cpp b/CellFrameDashboardGUI/Src/DapServiceClient.cpp deleted file mode 100644 index 6c387bed1..000000000 --- a/CellFrameDashboardGUI/Src/DapServiceClient.cpp +++ /dev/null @@ -1,150 +0,0 @@ -#include "DapServiceClient.h" - -DapServiceClient::DapServiceClient(QObject *apParent) - : QObject(apParent) -{ - // Initialization of the service connection socket - m_pClientSocket = new DapUiSocket(this); - // Signal-slot connection broadcasting service connection error - connect(m_pClientSocket,static_cast<void(DapUiSocket::*)(DapUiSocketError)> (&DapUiSocket::error), - this, &DapServiceClient::handleSocketError); - // Signal-slot connection broadcasting signal of successful connection to the service - connect(m_pClientSocket,SIGNAL(connected()), this, SLOT(connectedToService())); - // Signal-slot connection transmitting a signal to disconnect from the service - connect(m_pClientSocket,SIGNAL(disconnected()), this, SLOT(disconnectFromService())); - // Signal-slot connection that reconnects to the service - connect(&m_reconnectTimer, SIGNAL(timeout()), this, SLOT(reconnectToService())); -} - -/// Get a socket pointer. -/// @return A pointer to a socket. -DapUiSocket *DapServiceClient::getClientSocket() const -{ - return m_pClientSocket; -} - -/// Establish a connection with the service when the latter is launched. -void DapServiceClient::onServiceStarted() -{ - qInfo() << "Service started."; - connectToService(); -} - -/// Handle event of successful connection to the service. -void DapServiceClient::connectedToService() -{ - qInfo() << "Connected to the service"; - m_launchAttemptCounter = 0; - m_isServiceConnected = true; - stopReconnectingToService(); - emit sigConnected(); -} - -/// Start the process of reconnecting to the service. -void DapServiceClient::startReconnectingToService() -{ - if(!m_reconnectTimer.isActive()) { - qInfo() << "Start trying to reconnect to service"; - m_reconnectTimer.start(RECONNECT_TIMEOUT_MS); - } -} - -/// Stop the process of reconnecting to the service. -void DapServiceClient::stopReconnectingToService() -{ - if(m_reconnectTimer.isActive()) - { - m_reconnectTimer.stop(); - qInfo() << "Reconnect timer stopped"; - } -} - -/// Handle socket error. -/// @param aSocketEror Socket error code. -void DapServiceClient::handleSocketError(DapUiSocketError aSocketEror) -{ - qDebug() << m_pClientSocket->errorString(); - startReconnectingToService(); - emit sigSocketError(aSocketEror); - emit sigSocketErrorString(m_pClientSocket->errorString()); -} - -/// Reconnect service. -void DapServiceClient::reconnectToService() -{ - ++m_launchAttemptCounter; - DapServiceError resultInit = DapServiceError::NO_ERRORS; - if(m_launchAttemptCounter == NUMBER_LAUNCH_ATTEMPTS) - { - qCritical() << "Server not running after `serviceStart` operation"; - QMessageBox::critical(Q_NULLPTR, DAP_BRAND, "Unable to start service", QMessageBox::Ok); - exit(-1); - } - else - { - resultInit = init(); - } - if(resultInit == DapServiceError::NO_ERRORS) - { - connectToService(); - } -} - -/// Initiate the service monitor. -DapServiceError DapServiceClient::init() -{ - DapServiceError result = DapServiceClientNative::init(); - - handleServiceError(result); - - return result; -} - -/// Handle service error. -/// @param aServiceEror Service error code. -void DapServiceClient::handleServiceError(DapServiceError aServiceEror) -{ - switch (aServiceEror) - { - case DapServiceError::NO_ERRORS: - break; - case DapServiceError::USER_COMMAND_ABORT: - QMessageBox::critical(Q_NULLPTR, DAP_BRAND, "User abort service comand", QMessageBox::Ok); - exit(-1); - case DapServiceError::UNABLE_START_SERVICE: - QMessageBox::critical(Q_NULLPTR, DAP_BRAND, "Start the service with administrator rights", QMessageBox::Ok); - qCritical() << "Start the service with administrator rights"; - break; - case DapServiceError::UNABLE_STOP_SERVICE: - qCritical() << "Can't stop service"; - break; - case DapServiceError::UNKNOWN_ERROR: - qCritical() << "Got unknown error"; - break; - case DapServiceError::SERVICE_NOT_FOUND: - qCritical() << "Service not found"; - break; - } - if(aServiceEror != DapServiceError::NO_ERRORS) - { - emit sigServiceError(aServiceEror); - } -} - -/// Establish a connection with the service. -void DapServiceClient::connectToService() -{ - if(m_pClientSocket->state() == QAbstractSocket::ConnectedState) - return; - - qInfo() << "with parametr: " << DAP_BRAND; - m_pClientSocket->connectToServer(DAP_BRAND); -} - -/// Handle service outage. -void DapServiceClient::disconnectFromService() -{ - m_isServiceConnected = true; - startReconnectingToService(); - emit sigDisconnected(); -} diff --git a/CellFrameDashboardGUI/Src/DapServiceClientNativeAbstract.cpp b/CellFrameDashboardGUI/Src/DapServiceClientNativeAbstract.cpp deleted file mode 100644 index 3d05bb31e..000000000 --- a/CellFrameDashboardGUI/Src/DapServiceClientNativeAbstract.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "DapServiceClientNativeAbstract.h" - -DapServiceClientNativeAbstract::DapServiceClientNativeAbstract() -{ - m_isServiceRunning = false; -} - -DapServiceError DapServiceClientNativeAbstract::init() -{ - qInfo() << "DapServiceClientNativeAbstract::init()"; - DapServiceError result = DapServiceError::NO_ERRORS; - if(!isServiceRunning()) - { - qInfo() << "Install the service in the system"; - - result = serviceInstallAndRun(); - - if(result != DapServiceError::NO_ERRORS) - return result; - - if(isServiceRunning()) - { - onServiceStarted(); - } - else - { - qCritical() << "Service not started after " - "'serviceInstallAndRun' operation!"; - } - } - else - { - onServiceStarted(); - } - return result; -} - -void DapServiceClientNativeAbstract::onServiceInstalled() -{ - qInfo() << "DapServiceClientNativeAbstract::onServiceInstalled()"; - if(isServiceRunning()) - onServiceStarted(); -} - -void DapServiceClientNativeAbstract::onServiceStarted() -{ - -} - -void DapServiceClientNativeAbstract::onServiceStopped() -{ - -} diff --git a/CellFrameDashboardGUI/Src/DapServiceClientNativeLinux.cpp b/CellFrameDashboardGUI/Src/DapServiceClientNativeLinux.cpp deleted file mode 100644 index 3a8e46175..000000000 --- a/CellFrameDashboardGUI/Src/DapServiceClientNativeLinux.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include "DapServiceClientNativeLinux.h" - -#include <QtDebug> -#include <QMessageBox> - -DapServiceClientNativeLinux::DapServiceClientNativeLinux() -{ - QString dapServiceNameToLower = QString(DAP_SERVICE_NAME).toLower(); - QString cmd = QString("ps -C %1 > /dev/null").arg(DAP_SERVICE_NAME); - m_checkIsServiceRunningCommand = strdup(cmd.toLatin1().data()); - - m_cmdTemplate = QString("service " + dapServiceNameToLower) + " %1"; - - qDebug() << "command for check is service running: " << m_checkIsServiceRunningCommand; -} - -DapServiceClientNativeLinux::~DapServiceClientNativeLinux() -{ - delete m_checkIsServiceRunningCommand; -} - -bool DapServiceClientNativeLinux::isServiceRunning() -{ - m_isServiceRunning =true;// (::system(m_checkIsServiceRunningCommand) == 0); - return m_isServiceRunning; -} - -DapServiceError DapServiceClientNativeLinux::serviceRestart() -{ - qDebug() << "Restart service name" << m_cmdTemplate.arg("restart").toLatin1().data(); - - int retCode = ::system(m_cmdTemplate.arg("restart").toLatin1().data()); - qDebug() << "Restart result code:" << retCode; - if(retCode != 0) { - return DapServiceError::USER_COMMAND_ABORT; - } - - return DapServiceError::NO_ERRORS; -} - -/** - * @brief SapNetworkClientNativeLinux::serviceStart - */ -DapServiceError DapServiceClientNativeLinux::serviceStart() -{ - // yes better use restart - int ret = ::system(m_cmdTemplate.arg("restart").toLatin1().data()); - qDebug() << "serviceStart Result: " << ret; - - if(ret != 0) { - return DapServiceError::USER_COMMAND_ABORT; - } - - return DapServiceError::NO_ERRORS; -} - -/** - * @brief SapServiceClientNativeLinux::serviceStop - */ -DapServiceError DapServiceClientNativeLinux::serviceStop() -{ - int ret = ::system(m_cmdTemplate.arg("stop").toLatin1().data()); - qDebug() << "serviceStop result:" << ret; - if(ret != 0) { - return DapServiceError::USER_COMMAND_ABORT; - } - return DapServiceError::NO_ERRORS; -} -/** - * @brief SapServiceClientNativeLinux::serviceInstallAndRun - */ -DapServiceError DapServiceClientNativeLinux::serviceInstallAndRun() -{ - return serviceStart(); -} diff --git a/CellFrameDashboardGUI/Src/DapServiceClientNativeMacOS.cpp b/CellFrameDashboardGUI/Src/DapServiceClientNativeMacOS.cpp deleted file mode 100644 index d58f43a5a..000000000 --- a/CellFrameDashboardGUI/Src/DapServiceClientNativeMacOS.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include "DapServiceClientNativeMacOS.h" - -#include <QtDebug> -#include <QMessageBox> - -DapServiceClientNativeMacOS::DapServiceClientNativeMacOS() -{ - QString dapServiceNameToLower = QString(DAP_SERVICE_NAME).toLower(); - QString cmd = QString("ps -C %1 > /dev/null").arg(DAP_SERVICE_NAME); - m_checkIsServiceRunningCommand = strdup(cmd.toLatin1().data()); - - m_cmdTemplate = QString("service " + dapServiceNameToLower) + " %1"; - - qDebug() << "command for check is service running: " << m_checkIsServiceRunningCommand; -} - -DapServiceClientNativeMacOS::~DapServiceClientNativeMacOS() -{ - delete m_checkIsServiceRunningCommand; -} - -bool DapServiceClientNativeMacOS::isServiceRunning() -{ - m_isServiceRunning =true;// (::system(m_checkIsServiceRunningCommand) == 0); - return m_isServiceRunning; -} - -DapServiceError DapServiceClientNativeMacOS::serviceRestart() -{ - qDebug() << "Restart service name" << m_cmdTemplate.arg("restart").toLatin1().data(); - - int retCode = ::system(m_cmdTemplate.arg("restart").toLatin1().data()); - qDebug() << "Restart result code:" << retCode; - if(retCode != 0) { - return DapServiceError::USER_COMMAND_ABORT; - } - - return DapServiceError::NO_ERRORS; -} - -/** - * @brief SapNetworkClientNativeMacOS::serviceStart - */ -DapServiceError DapServiceClientNativeMacOS::serviceStart() -{ - // yes better use restart - int ret = ::system(m_cmdTemplate.arg("restart").toLatin1().data()); - qDebug() << "serviceStart Result: " << ret; - - if(ret != 0) { - return DapServiceError::USER_COMMAND_ABORT; - } - - return DapServiceError::NO_ERRORS; -} - -/** - * @brief SapServiceClientNativeMacOS::serviceStop - */ -DapServiceError DapServiceClientNativeMacOS::serviceStop() -{ - int ret = ::system(m_cmdTemplate.arg("stop").toLatin1().data()); - qDebug() << "serviceStop result:" << ret; - if(ret != 0) { - return DapServiceError::USER_COMMAND_ABORT; - } - return DapServiceError::NO_ERRORS; -} -/** - * @brief SapServiceClientNativeMacOS::serviceInstallAndRun - */ -DapServiceError DapServiceClientNativeMacOS::serviceInstallAndRun() -{ - return serviceStart(); -} diff --git a/CellFrameDashboardGUI/Src/DapServiceClientNativeWin.cpp b/CellFrameDashboardGUI/Src/DapServiceClientNativeWin.cpp deleted file mode 100644 index 724c1f0e6..000000000 --- a/CellFrameDashboardGUI/Src/DapServiceClientNativeWin.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "DapServiceClientNativeWin.h" - -DapServiceClientNativeWin::DapServiceClientNativeWin() -{ -} - -bool DapServiceClientNativeWin::isServiceRunning() -{ - return true; -} - -DapServiceError DapServiceClientNativeWin::serviceInstallAndRun() { - return DapServiceError::NO_ERRORS; -} - -DapServiceError DapServiceClientNativeWin::serviceStart() { - return DapServiceError::NO_ERRORS; -} - -DapServiceError DapServiceClientNativeWin::serviceRestart() { - return DapServiceError::NO_ERRORS; -} - -DapServiceError DapServiceClientNativeWin::serviceStop() { - return DapServiceError::NO_ERRORS; -} - -DapServiceClientNativeWin::~DapServiceClientNativeWin() { - -} diff --git a/CellFrameDashboardGUI/Src/DapServiceController.cpp b/CellFrameDashboardGUI/Src/DapServiceController.cpp deleted file mode 100644 index 90bd849fd..000000000 --- a/CellFrameDashboardGUI/Src/DapServiceController.cpp +++ /dev/null @@ -1,293 +0,0 @@ -#include "DapServiceController.h" -#include "DapLogMessage.h" -#include "DapChainWallet.h" -#include "DapSettings.h" -#include <QRegularExpression> - -DapServiceController::DapServiceController(QObject *apParent) - : QObject(apParent) -{ - -} - -/// Show or hide GUI client by clicking on the tray icon. -/// @param aIsActivated Accepts true - when requesting to -/// display a client, falso - when requesting to hide a client. -void DapServiceController::activateClient(bool aIsActivated) -{ - if(aIsActivated) - emit activateWindow(); -} - -/// Shut down client. -void DapServiceController::closeClient() -{ - qApp->quit(); -} - -/// Get company brand. -/// @return Brand Ñompany. -void DapServiceController::init(DapServiceClient *apDapServiceClient) -{ - m_pDapServiceClient = apDapServiceClient; - - connect(m_pDapServiceClient, SIGNAL(sigDisconnected()), SLOT(clearLogModel())); - connect(m_pDapServiceClient, SIGNAL(sigConnected()), SLOT(loadUserSettings())); - - // Creating rpc controller - m_pDapCommandController = new DapCommandController(apDapServiceClient->getClientSocket(), this); - - // Signal-slot connection that implements the client display control when you click on the tray icon - connect(m_pDapCommandController, SIGNAL(onClientActivate(bool)), SLOT(activateClient(bool))); - // Signal-slot connection that implements the client display control when you click on the tray icon - connect(m_pDapCommandController, SIGNAL(onClientClose()), SLOT(closeClient())); - // Signal-slot connection for receiving node logs from the service - connect(m_pDapCommandController, SIGNAL(sigNodeLogsReceived(QStringList)), SLOT(processGetNodeLogs(QStringList))); - - connect(m_pDapCommandController, SIGNAL(sigWalletAdded(QString, QString)), SLOT(processAddWallet(QString, QString))); - - connect(m_pDapCommandController, SIGNAL(sigWalletsReceived(QMap<QString,QVariant>)), SLOT(processGetWallets(QMap<QString,QVariant>))); - - connect(m_pDapCommandController, SIGNAL(sigWalletInfoChanged(QString,QString, QStringList, QStringList)), SLOT(processGetWalletInfo(QString,QString, QStringList, QStringList))); - - connect(m_pDapCommandController, SIGNAL(onTokenSended(QString)), SLOT(processSendToken(QString))); - - connect(m_pDapCommandController, SIGNAL(executeCommandChanged(QString)), SLOT(processExecuteCommandInfo(QString))); - - connect(m_pDapCommandController, SIGNAL(sendNodeNetwork(QVariant)), this, SLOT(processGetNodeNetwork(QVariant))); - connect(m_pDapCommandController, SIGNAL(onChangeLogModel()), SLOT(getNodeLogs())); - - connect(&DapChainNodeNetworkModel::getInstance(), SIGNAL(requestNodeNetwork()), this, SLOT(getNodeNetwork())); - connect(&DapChainNodeNetworkModel::getInstance(), SIGNAL(requestNodeStatus(bool)), this, SLOT(setNodeStatus(bool))); - - connect(m_pDapCommandController, SIGNAL(sendHistory(QVariant)), this, SLOT(processGetHistory(QVariant))); - - connect(m_pDapCommandController, &DapCommandController::sendHistory, &DapScreenHistoryModel::getInstance(), &DapScreenHistoryModel::receiveNewData); - - connect(&DapConsoleModel::getInstance(), &DapConsoleModel::sendRequest, m_pDapCommandController, &DapCommandController::requestConsole); - connect(m_pDapCommandController, &DapCommandController::responseConsole, &DapConsoleModel::getInstance(), &DapConsoleModel::receiveResponse); - connect(m_pDapCommandController, &DapCommandController::sigCmdHistory, &DapConsoleModel::getInstance(), &DapConsoleModel::receiveCmdHistory); - - connect(m_pDapCommandController, &DapCommandController::sendNetworkList, &DapSettingsNetworkModel::getInstance(), &DapSettingsNetworkModel::setNetworkList); - connect(&DapSettingsNetworkModel::getInstance(), &DapSettingsNetworkModel::currentNetworkChanged, m_pDapCommandController, &DapCommandController::changeCurrentNetwork); - - connect(m_pDapCommandController, &DapCommandController::sigWalletData, &DapChainWalletModel::instance(), &DapChainWalletModel::setWalletData); - -} - -QString DapServiceController::getBrand() const -{ - return m_sBrand; -} - -/// Get app version. -/// @return Application version. -QString DapServiceController::getVersion() const -{ - return m_sVersion; -} - -QString DapServiceController::getSettingFile() const -{ - return m_sSettingFile; -} - -QString DapServiceController::getResult() -{ - return m_sResult; -} - -void DapServiceController::getWallets() const -{ - qInfo() << QString("getWallets()"); - m_pDapCommandController->getWallets(); -} - -/// Handling service response for receiving node logs. -/// @param aNodeLogs List of node logs. -void DapServiceController::processGetNodeLogs(const QStringList &aNodeLogs) -{ - if(aNodeLogs.isEmpty()) - return; - - int xx = DapLogModel::getInstance().rowCount(); - QRegularExpression re("(?<=])\\s"); - for (auto const & log : aNodeLogs) - { - const QStringList list = log.split(re); - DapLogMessage logMessage; - logMessage.setTimeStamp(list.at(0)); - logMessage.setType(list.at(1)); - logMessage.setFile(list.at(2)); - logMessage.setMessage(list.at(3)); - DapLogModel::getInstance().append(logMessage); - } - - emit logCompleted(); -} - -/// Get node logs. -void DapServiceController::getNodeLogs() const -{ - qInfo() << QString("getNodeLogs()"); - m_pDapCommandController->getNodeLogs(); -} - -void DapServiceController::clearLogModel() -{ - DapLogModel::getInstance().clear(); - int z = DapLogModel::getInstance().rowCount(); - emit logCompleted(); -} - -void DapServiceController::addWallet(const QString &asWalletName) -{ - qInfo() << QString("addWallet(%1)").arg(asWalletName); - m_pDapCommandController->addWallet(asWalletName); -} - -void DapServiceController::removeWallet(int index, const QString &asWalletName) -{ - qInfo() << QString("removeWallet(%1)").arg(asWalletName); - m_pDapCommandController->removeWallet(asWalletName.trimmed()); - DapChainWalletsModel::getInstance().remove(index); -} - -void DapServiceController::sendToken(const QString &asSendWallet, const QString &asAddressReceiver, const QString &asToken, const QString &aAmount) -{ - qInfo() << QString("sendToken(%1, %2, %3, %4)").arg(asSendWallet).arg(asAddressReceiver).arg(asToken).arg(aAmount); - m_pDapCommandController->sendToken(asSendWallet.trimmed(), asAddressReceiver.trimmed(), asToken.trimmed(), aAmount); -} - -void DapServiceController::executeCommand(const QString& command) -{ - qInfo() << QString("executeCommand (%1)").arg(command); - m_pDapCommandController->executeCommand(command); -} - - -void DapServiceController::getWalletInfo(const QString &asWalletName) -{ - qInfo() << QString("getWalletInfo(%1)").arg(asWalletName); - m_pDapCommandController->getWalletInfo(asWalletName); -} - -void DapServiceController::getCmdHistory() -{ - m_pDapCommandController->getCmdHistory(); -} - -void DapServiceController::getHistory() -{ - m_pDapCommandController->getHistory(); -} - -void DapServiceController::getNodeNetwork() -{ - m_pDapCommandController->getNodeNetwork(); -} - -void DapServiceController::setNodeStatus(const bool aIsOnline) -{ - m_pDapCommandController->setNodeStatus(aIsOnline); -} - -void DapServiceController::processAddWallet(const QString& asWalletName, const QString& asWalletAddress) -{ - qInfo() << QString("processAddWallet(%1, %2)").arg(asWalletName).arg(asWalletAddress); - DapChainWallet wallet("", asWalletName, asWalletAddress); - DapChainWalletsModel::getInstance().append(wallet); -} - -void DapServiceController::processSendToken(const QString &asAnswer) -{ - qInfo() << QString("processSendToken(%1)").arg(asAnswer); -} - -void DapServiceController::processGetWallets(const QMap<QString, QVariant> &aWallets) -{ - qInfo() << QString("processGetWallets()") << aWallets.size(); - for(QString w : aWallets.keys()) - { - getWalletInfo(w); - } -} - -void DapServiceController::processGetWalletInfo(const QString &asWalletName, const QString &asWalletAddress, const QStringList& aBalance, const QStringList &aTokens) -{ - qInfo() << QString("processGetWalletInfo(%1, %2)").arg(asWalletName).arg(asWalletAddress); - DapChainWallet wallet("", asWalletName, asWalletAddress, aBalance, aTokens); - DapChainWalletsModel::getInstance().append(wallet); - - for (QString s : aBalance) { - qDebug() << s; - } -} - -void DapServiceController::processExecuteCommandInfo(const QString &result) -{ - qInfo() << QString("processExecuteCommandInfo(%1)").arg(result); - m_sResult = result; - emit resultChanged(); -} - -void DapServiceController::processGetNodeNetwork(const QVariant& aData) -{ - DapChainNodeNetworkModel::getInstance().receiveNewNetwork(aData); -} - -void DapServiceController::processGetHistory(const QVariant& aData) -{ - DapScreenHistoryModel::getInstance().receiveNewData(aData); -} - -void DapServiceController::getNetworkList() -{ - m_pDapCommandController->getNetworkList(); -} - -void DapServiceController::loadUserSettings() -{ - const QString networkName = DapSettings::getInstance(m_sSettingFile) - .getKeyValue("network").toString(); - qInfo() << "get settings name: " << networkName; - int currentIndex = DapSettingsNetworkModel::getInstance().getCurrentIndex(); - qInfo() << "current index is " << currentIndex; - DapSettingsNetworkModel::getInstance().setCurrentNetwork(networkName, ++currentIndex); - qInfo() << "change Current Network: " << DapSettingsNetworkModel::getInstance().getCurrentNetwork(); - emit userSettingsLoaded(); -} - -void DapServiceController::saveUserSettings() -{ - DapSettings::getInstance().setFileName(m_sSettingFile); - QJsonObject networkObject; - networkObject["network"] = DapSettingsNetworkModel::getInstance().getCurrentNetwork(); - qInfo() << "Save to file: " << networkObject; - DapSettings::getInstance().writeFile(QJsonDocument(networkObject)); - emit userSettingsSaved(); -} - -/// Get an instance of a class. -/// @return Instance of a class. -DapServiceController &DapServiceController::getInstance() -{ - static DapServiceController instance; - return instance; -} - -/// Method that implements the singleton pattern for the qml layer. -/// @param engine QML application. -/// @param scriptEngine The QJSEngine class provides an environment for evaluating JavaScript code. -QObject *DapServiceController::singletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine) -{ - Q_UNUSED(engine) - Q_UNUSED(scriptEngine) - - return &getInstance(); -} - -void DapServiceController::requestWalletData() -{ - m_pDapCommandController->requestWalletData(); -} diff --git a/CellFrameDashboardGUI/Src/DapSettingsNetworkModel.cpp b/CellFrameDashboardGUI/Src/DapSettingsNetworkModel.cpp deleted file mode 100644 index e6567a038..000000000 --- a/CellFrameDashboardGUI/Src/DapSettingsNetworkModel.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "DapSettingsNetworkModel.h" - -DapSettingsNetworkModel::DapSettingsNetworkModel(QObject *parent) : QAbstractListModel(parent), - m_CurrentIndex(-1) -{ - -} - -DapSettingsNetworkModel& DapSettingsNetworkModel::getInstance() -{ - static DapSettingsNetworkModel instance; - return instance; -} - -int DapSettingsNetworkModel::rowCount(const QModelIndex& parent) const -{ - Q_UNUSED(parent) - - return m_NetworkList.count(); -} - -QVariant DapSettingsNetworkModel::data(const QModelIndex& index, int role) const -{ - if(!index.isValid()) return QVariant(); - if(role == DisplayName) - return m_NetworkList.at(index.row()); - - return QVariant(); -} - -QHash<int, QByteArray> DapSettingsNetworkModel::roleNames() const -{ - QHash<int, QByteArray> roles; - roles[DisplayName] = "network"; - - return roles; -} - -QString DapSettingsNetworkModel::getCurrentNetwork() const -{ - return m_CurrentNetwork; -} - -int DapSettingsNetworkModel::getCurrentIndex() const -{ - return m_CurrentIndex; -} - -void DapSettingsNetworkModel::setNetworkList(const QStringList& aNetworkList) -{ - if(m_NetworkList == aNetworkList) return; - beginResetModel(); - m_NetworkList = aNetworkList; - endResetModel(); -} - -void DapSettingsNetworkModel::setCurrentNetwork(QString CurrentNetwork, int CurrentIndex) -{ - if (m_CurrentNetwork == CurrentNetwork) - return; - - m_CurrentNetwork = CurrentNetwork; - m_CurrentIndex = CurrentIndex; - emit currentNetworkChanged(m_CurrentNetwork); -} diff --git a/CellFrameDashboardGUI/Src/DapWalletFilterModel.cpp b/CellFrameDashboardGUI/Src/DapWalletFilterModel.cpp deleted file mode 100644 index 3228100fb..000000000 --- a/CellFrameDashboardGUI/Src/DapWalletFilterModel.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "DapWalletFilterModel.h" - -DapWalletFilterModel::DapWalletFilterModel(QObject *parent) : - QSortFilterProxyModel(parent), - m_filterWalletName(TITLE_ALL_WALLETS) -{ - sort(0, Qt::DescendingOrder); -} - -DapWalletFilterModel& DapWalletFilterModel::instance() -{ - static DapWalletFilterModel instance; - return instance; -} - -void DapWalletFilterModel::setWalletFilter(const QString& aName) -{ - if(m_filterWalletName == aName) return; - m_filterWalletName = aName; - setFilterKeyColumn(0); -} - -bool DapWalletFilterModel::lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const -{ - QString first = source_left.data(DapChainWalletModel::NetworkDisplayRole).toString(); - QString second = source_right.data(DapChainWalletModel::NetworkDisplayRole).toString(); - return first < second; -} - -bool DapWalletFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const -{ - if(m_filterWalletName == TITLE_ALL_WALLETS) return true; - - QModelIndex index = sourceModel()->index(source_row, 0, source_parent); - QString wallet = index.data(DapChainWalletModel::WalletNameDisplayRole).toString(); - - return wallet == m_filterWalletName; -} diff --git a/CellFrameDashboardGUI/Src/include/DapChainNodeNetworkExplorer.h b/CellFrameDashboardGUI/Src/include/DapChainNodeNetworkExplorer.h deleted file mode 100644 index 6e9098024..000000000 --- a/CellFrameDashboardGUI/Src/include/DapChainNodeNetworkExplorer.h +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef DAPCHAINNODENETWORKEXPLORER_H -#define DAPCHAINNODENETWORKEXPLORER_H - -#include <QQuickPaintedItem> -#include <QPainter> -#include <QVariant> -#include <QToolTip> - -#include "DapChainNodeNetworkModel.h" -#include "DapNodeType.h" - -/// The DapChainNodeNetworkExplorer class -/// details Class painting DapCellFrame map -/// @warning To use this class it requers to send DapChainNodeNetworkModel model to slot setModel() -class DapChainNodeNetworkExplorer : public QQuickPaintedItem -{ - Q_OBJECT - Q_PROPERTY(QColor colorSelect READ getColorSelect WRITE setColorSelect NOTIFY colorSelectChanged) - Q_PROPERTY(QColor colorNormal READ getColorNormal WRITE setColorNormal NOTIFY colorNormalChanged) - Q_PROPERTY(QColor colorFocused READ getColorFocused WRITE setColorFocused NOTIFY colorFocusedChanged) - Q_PROPERTY(QColor colorOnline READ getColorOnline WRITE setColorOnline NOTIFY colorOnlineChanged) - Q_PROPERTY(QColor colorOffline READ getColorOffline WRITE setColorOffline NOTIFY colorOfflineChanged) - Q_PROPERTY(int widthLine READ getWidthLine WRITE setWidthLine NOTIFY widthLineChanged) - Q_PROPERTY(int sizeNode READ getSizeNode WRITE setSizeNode NOTIFY sizeNodeChanged) - Q_PROPERTY(DapChainNodeNetworkModel* model READ getModel WRITE setModel NOTIFY modelChanged) - -public: - /** - * @brief The DapNodeState enum - * The values are used to display state of nodes - */ - enum DapNodeState { - /// Normal - Normal, - /// Focused - Focused, - /// Selected - Selected - }; - - /** - * @brief The DapNodeGui struct - * Structure which has state of node and size of area node - */ - struct DapNodeGui { - /// State of node - DapNodeState State; - /// Graphic area node - QRect Rect; - }; - -private: - /// Model for Network Explorer - DapChainNodeNetworkModel* m_model; - /// node map for gui - QMap<QString /*Address*/, DapNodeGui /*NodeDataGui*/> m_nodeMap; - /// selected node - QPair<QString /*Address*/, DapNodeGui* /*NodeDataGui*/> m_currentSelectedNode; - - /// Color online state - QColor m_colorOnline; - /// Color offline state - QColor m_colorOffline; - /// Color selected state - QColor m_colorSelect; - /// Color normal state - QColor m_colorNormal; - /// Color focused state - QColor m_colorFocused; - /// Width of line - int m_widthLine; - /// Size of node - int m_sizeNode; - -protected: - /// Event occurs when moused pressed - /// @param event Mouse event - void mousePressEvent(QMouseEvent* event); - /// Event occurs when wheel moves - /// @param event Wheel event - void wheelEvent(QWheelEvent* event); - /// Event occurs when mouse hover under item - /// @param event Hover move - void hoverMoveEvent(QHoverEvent* event); - -public: - /// Standard constructor - explicit DapChainNodeNetworkExplorer(QQuickItem *parent = nullptr); - /// Overload method for paiting - void paint(QPainter* painter); - - /// Get color for online nodes - /// @return color of online nodes - QColor getColorOnline() const; - /// Get color for offline nodes - /// @return color of offline nodes - QColor getColorOffline() const; - /// Get color for selected node - /// @return color of seletected node - QColor getColorSelect() const; - /// Get color for normal state for node - /// @return color of normal state - QColor getColorNormal() const; - /// Get color for focused node - /// @return color of focused node - QColor getColorFocused() const; - /// Get line width for borders - /// @return width of line - int getWidthLine() const; - /// Get lenght of square's side - /// @return diameter of node element - int getSizeNode() const; - - /// Get model - /// @return model for network explorer - DapChainNodeNetworkModel* getModel() const; - - /// Get X position for selected node - /// @return X position of selected node - Q_INVOKABLE int getSelectedNodePosX() const; - /// Get Y position for selected node - /// @return Y position of selected node - Q_INVOKABLE int getSelectedNodePosY() const; - /// Get address for selected node - /// @return address of selected node - Q_INVOKABLE QString getSelectedNodeAddress() const; - /// Get alias for selected node - /// @return alias of selected node - Q_INVOKABLE QString getSelectedNodeAlias() const; - /// Get Ipv4 address for selected node - /// @return Ipv4 address of selected node - Q_INVOKABLE QString getSelectedNodeIpv4() const; - /// Find node address by coordinate - /// @param X position - /// @param Y position - /// @return address of node - Q_INVOKABLE QString getAddressByPos(const int aX, const int aY); - -public slots: - /// Set color for selected node - /// @param color for selected node - void setColorSelect(const QColor& aColorSelect); - /// Set color for normal state for node - /// @param color for normal state of node - void setColorNormal(const QColor& aColorNormal); - /// Set color for focused node - /// @param color for focused node - void setColorFocused(const QColor& aColorActivated); - /// Set color for online nodes - /// @param color for online nodes - void setColorOnline(const QColor& aColorOnline); - /// Set color for offline nodes - /// @param color offline nodes - void setColorOffline(const QColor& aColorOffline); - /// Set line width for borders - /// @param width of line - void setWidthLine(const int widthLine); - /// Set lenght of square's side - /// @param diameter of node element - void setSizeNode(const int sizeNode); - - /// Set model - /// @param model for explorer - void setModel(DapChainNodeNetworkModel* aModel); - -private slots: - /// Create graph - void proccessCreateGraph(); - -signals: - /// Signals emitted when select color was changed - /// @param colorSelect Color for select state - void colorSelectChanged(QColor colorSelect); - /// Signals emitted when normal state color was changed - /// @param colorNormal Color for normal state - void colorNormalChanged(QColor colorNormal); - /// Signals emitted when focused state color was changed - /// @param colorActivated Color for focused state - void colorFocusedChanged(QColor colorActivated); - /// Signals emitted when online state color was changed - /// @param colorOnline Color for online state - void colorOnlineChanged(QColor colorOnline); - /// Signals emitted when offline state color was changed - /// @param colorOffline Color for offline state - void colorOfflineChanged(QColor colorOffline); - /// Signals emitted when width line was changed - /// @param widthLine Width of line - void widthLineChanged(int widthLine); - /// Signals emitted when size node was changed - /// @param sizeNode Size of node - void sizeNodeChanged(int sizeNode); - /// Signals emitted when model was changed - /// @param model New model for Network Explorer - void modelChanged(DapChainNodeNetworkModel* model); - - /// Signal selected node - /// @param status current selected node. It is true - /// if current node was selected - void selectNode(bool isCurrentNode); - /// Signal skip selected node to normal state - void selectNodeChanged(); -}; - -#endif // DAPCHAINNODENETWORKEXPLORER_H diff --git a/CellFrameDashboardGUI/Src/include/DapChainNodeNetworkModel.h b/CellFrameDashboardGUI/Src/include/DapChainNodeNetworkModel.h deleted file mode 100644 index 236041ce0..000000000 --- a/CellFrameDashboardGUI/Src/include/DapChainNodeNetworkModel.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef DAPCHAINNODENETWORKMODEL_H -#define DAPCHAINNODENETWORKMODEL_H - -#include <QObject> -#include <QTimer> -#include <QHostAddress> -#include <QVariant> - -#include "DapNodeType.h" - -/// Class model for Network Explorer -class DapChainNodeNetworkModel : public QObject -{ - Q_OBJECT - -private: - /// Data about network with nodes - QVariant m_data; - /// Timer for request - QTimer* m_timerRequest; - -protected: - /// Data about whole network with nodes - DapNodeMap m_nodeMap; - -public: - /// Standard constructor - explicit DapChainNodeNetworkModel(QObject *parent = nullptr); - - /// Get an instance of a class. - /// @return Instance of a class. - Q_INVOKABLE static DapChainNodeNetworkModel &getInstance(); - /// Get data about whole network with nodes - /// @return QMap where key is address and value is structure about one node - const DapNodeMap* getDataMap() const; - /// Get data about node by address - /// @param aAddress Address of node - /// @return data's node structure - const DapNodeData* getNodeData(const QString& aAddress) const; - - /// Get current address of node - /// @return address of current node - QString getCurrentAddress() const; - /// Get status of node - /// @param aAddress Address of node - /// @return It is true if node is online - Q_INVOKABLE bool isNodeOnline(const QString& aAddress) const; - -public slots: - /// Receive new network data and repaint the screen - /// @param aData data of node network - void receiveNewNetwork(const QVariant& aData); - /// Receive changes status for nodes - /// @param aData data of node network - void receiveNodeStatus(const QVariant& aData); - /// Send request to service about changing status of node - /// @param aIsOnline set new status to node - Q_INVOKABLE void sendRequestNodeStatus(const bool aIsOnline); - /// Start timer for request new data of network - Q_INVOKABLE void startRequest(); - /// @param aTimeout in milliseconds for delay - Q_INVOKABLE void startRequest(const int aTimeout); - /// Stop timer for request data of network - Q_INVOKABLE void stopRequest(); - -signals: - /// Signal for changing network - void changeNodeNetwork(); - /// Signal for request network - void requestNodeNetwork(); - /// Signal for request status of node - /// @param status status of node - void requestNodeStatus(bool status); - /// SIgnal about changing status node - /// @param node Address of node - /// @param aIsOnline new status to node - void changeStatusNode(QString asNode, bool aIsOnline); -}; - - -#endif // DAPCHAINNODENETWORKMODEL_H diff --git a/CellFrameDashboardGUI/Src/include/DapChainWalletModel.h b/CellFrameDashboardGUI/Src/include/DapChainWalletModel.h deleted file mode 100644 index 3a7c9c7c4..000000000 --- a/CellFrameDashboardGUI/Src/include/DapChainWalletModel.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef DAPCHAINWALLETMODEL_H -#define DAPCHAINWALLETMODEL_H - -#include <QAbstractListModel> -#include <QDebug> -#include "DapChainWallet.h" - -#define TITLE_ALL_WALLETS tr("all wallets") - -class DapChainWalletModel : public QAbstractListModel -{ - Q_OBJECT - Q_PROPERTY(QStringList wallets READ walletList NOTIFY walletListChanged) - -public: - enum { - WalletNameDisplayRole = Qt::UserRole, - WalletAddressDisplayRole, - WalletIconDisplayRole, - WalletTokenListDisplayRole, - WalletListDisplayRole, - NetworkDisplayRole, - }; - -private: - QStringList m_wallets; - QList<DapChainWalletPair> m_walletList; - - -public: - explicit DapChainWalletModel(QObject *parent = nullptr); - - static DapChainWalletModel& instance(); - - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - - QHash<int, QByteArray> roleNames() const override; - - Q_INVOKABLE QStringList walletList() const; - - Q_INVOKABLE double walletBalance(const QString& aName) const; - - Q_INVOKABLE double walletBalance(const int aWalletIndex) const; - - Q_INVOKABLE QList<QObject*> tokeListByWallet(const QString& aWalletAddress, const QString& aNetwork = QString()) const; - - QList<QObject*> tokeListByIndex(const int aIndex) const; - -public slots: - - void setWalletData(const QByteArray& aData); - - void appendWallet(const DapChainWalletData& aWallet); - - void appendToken(const QString& aWalletAddress, const DapChainWalletTokenData& aTokenData); - - void removeWallet(const QString& aWalletAddress); - - void removeWallet(const int aWalletIndex); - -signals: - void sigAppendWallet(QString name); - void sigRemoveWallet(QString address); - void walletListChanged(QStringList walletList); -}; - -#endif // DAPCHAINWALLETMODEL_H diff --git a/CellFrameDashboardGUI/Src/include/DapChainWalletsModel.h b/CellFrameDashboardGUI/Src/include/DapChainWalletsModel.h deleted file mode 100644 index c622c5a0d..000000000 --- a/CellFrameDashboardGUI/Src/include/DapChainWalletsModel.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef DAPCHAINWALLETSMODEL_H -#define DAPCHAINWALLETSMODEL_H - -#include <QObject> -#include <QAbstractListModel> -#include <QList> -#include <QQmlEngine> -#include <QJSEngine> -#include <QXmlStreamWriter> -#include <QXmlStreamReader> -#include <QXmlStreamAttribute> - -#include <DapChainWallet.h> -/** - * @brief The DapChainWalletRole enum - * - * These values are used in arguments to methods data and roleNames. - * Main goal is return data from selected information about wallet - */ -enum DapChainWalletRole { - /// Icon wallet - IconWalletRole = Qt::DisplayRole, - /// Name of wallet - NameWalletRole = Qt::UserRole, - /// Address of wallet - AddressWalletRole, - /// Balance - BalanceWalletRole, - /// Tokens name - TokensWalletRole, - /// Number of wallets - CountWalletRole - }; - -/// Class model for wallets screen -class DapChainWalletsModel : public QAbstractListModel -{ - Q_OBJECT - /// Set of wallets - QList<DapChainWallet*> m_dapChainWallets; - - /// standard constructor - DapChainWalletsModel(QObject* parent = nullptr); -public: - /// Get an instance of a class. - /// @return Instance of a class. - Q_INVOKABLE static DapChainWalletsModel &getInstance(); - - /// Overraid model's methods - /// Get number of wallets - /// @return Number of wallets - int rowCount(const QModelIndex & = QModelIndex()) const; - /// Information about selected wallet by index and which field needs - /// @return Information about wallet - /// @param index Index of wallet - /// @param role Concrete fields about wallet - /// @return Data about concrete field of wallet - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - /// Information about fields of wallet - /// @return Set of fields wallet - QHash<int, QByteArray> roleNames() const; - - /// Get data in a row - /// @param row Row of wallet - /// @return Information about wallet selected by row - Q_INVOKABLE QVariantMap get(int row) const; - /// Add new wallet - /// @param arWallet new wallet - Q_INVOKABLE void append(const DapChainWallet &arWallet); - /// Add new wallet - /// @param asIconPath Path icon - /// @param asName Name of wallet - /// @param asAddress Address of wallet - /// @param aBalance Balance - /// @param aTokens Tokens name - Q_INVOKABLE void append(const QString& asIconPath, const QString &asName, const QString &asAddress, const QStringList &aBalance, const QStringList &aTokens); - /// Change data for wallet in a row - /// @param row Row of wallet - /// @param asName Name of wallet - /// @param asAddress Address of wallet - /// @param aBalance Balance - /// @param aTokens Tokens name - Q_INVOKABLE void set(int row, const QString& asIconPath, const QString &asName, const QString &asAddresss, const QStringList &aBalance, const QStringList &aTokens); - /// Remove row with wallet - /// @param row Row of wallet - Q_INVOKABLE void remove(int row); - /// Clear screen - Q_INVOKABLE void clear(); - -public slots: - /// Method that implements the singleton pattern for the qml layer. - /// @param engine QML application. - /// @param scriptEngine The QJSEngine class provides an environment for evaluating JavaScript code. - static QObject *singletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine); - -}; - -#endif // DAPCHAINWALLETSMODEL_H diff --git a/CellFrameDashboardGUI/Src/include/DapClipboard.h b/CellFrameDashboardGUI/Src/include/DapClipboard.h deleted file mode 100644 index 1e95afebc..000000000 --- a/CellFrameDashboardGUI/Src/include/DapClipboard.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef DAPCLIPBOARD_H -#define DAPCLIPBOARD_H - -#include <QObject> -#include <QClipboard> -#include <QApplication> - -class DapClipboard : public QObject -{ - Q_OBJECT - -private: - QClipboard* m_clipboard; - -public: - explicit DapClipboard(QObject *parent = nullptr); - static DapClipboard& instance(); - -public slots: - Q_INVOKABLE void setText(const QString& aText); -}; - -#endif // DAPCLIPBOARD_H diff --git a/CellFrameDashboardGUI/Src/include/DapCommandController.h b/CellFrameDashboardGUI/Src/include/DapCommandController.h deleted file mode 100644 index 8d4f4a5a8..000000000 --- a/CellFrameDashboardGUI/Src/include/DapCommandController.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef DAPCOMMANDCONTROLLER_H -#define DAPCOMMANDCONTROLLER_H - -#include <QObject> -#include <QIODevice> -#include <QVariantMap> -#include <QDebug> - -#include "DapRpcSocket.h" -#include "DapRpcServiceProvider.h" -#include "DapRpcService.h" - -/// Class command controller for service -class DapCommandController : public DapRpcService, public DapRpcServiceProvider -{ - Q_OBJECT - Q_DISABLE_COPY(DapCommandController) - Q_CLASSINFO("serviceName", "RPCClient") - - /// RPC socket. - DapRpcSocket * m_DAPRpcSocket {nullptr}; - -signals: - /// The signal is emitted after receiving a response from the service about the command execution. - void sigCommandResult(QJsonValue ); - /// The signal is emitted when node logs are received from the service. - /// @param aNodeLogs List of node logs. - void sigNodeLogsReceived(const QStringList& aNodeLogs); - - /// The signal is emitted when new wallet was added - /// @param asWalletName Wallet's name - /// @param asWalletAddress Wallet's address - void sigWalletAdded(const QString& asWalletName, const QString& asWalletAddress); - /// The signal is emitted when token was sent - /// @param asAnswer Answer from service - void onTokenSended(const QString& asAnswer); - - /// The signal is emitted when receive current wallets - /// @param aWallets current wallets - void sigWalletsReceived(const QMap<QString, QVariant>& aWallets); - /// The signal is emitted when the main application window is activated. - /// @param aIsActivated Accepts true - when requesting to - /// display a client, falso - when requesting to hide a client. - void onClientActivate(bool aIsActivated); - /// The signal is emitted when the main application window closed - void onClientClose(); - /// Signal for changing information of wallet - /// @param asWalletName Wallet's name - /// @param asWalletAddress Wallet's address - void sigWalletInfoChanged(const QString& asWalletName, const QString& asWalletAddress, const QStringList& aBalance, const QStringList& aTokens); - /// Signal for data network - /// @param Data network - void sendNodeNetwork(const QVariant& aData); - /// Signal for sending status of node - /// @param Status of node - void sendNodeStatus(const QVariant& aData); - /// The signal is emitted when execute command result was changed - /// @param result Result of command - void executeCommandChanged(const QString& result); - /// The signal for changing logs - void onChangeLogModel(); - /// Ths signal for sending new transaction history - /// @param aData New transaction history - void sendHistory(const QVariant& aData); - /// The signal for response from service about command request - /// @param Responce from service - void responseConsole(const QString& aResponse); - /// The signal about changing history of commands - /// @param aHistory Changed history of commands - void sigCmdHistory(const QString& aHistory); - /// The signal for send network list - /// @param List of networks - void sendNetworkList(const QStringList& aList); - -// --------------------------------------------- - void sigWalletData(QByteArray data); - -public: - /// Overloaded constructor. - /// @param apIODevice Data transfer device. - /// @param apParent Parent. - DapCommandController(QIODevice *apIODevice, QObject *apParent = nullptr); - -private slots: - /// Process incoming message. - /// @param asMessage Incoming message. - void messageProcessing(const DapRpcMessage &asMessage); - /// Process the result of the command execution. - void processCommandResult(); - /// Handling service response for receiving node logs. - void processGetNodeLogs(); - /// Handling service response for add new wallet - void processAddWallet(); - /// Handling service response for send token - void processSendToken(); - /// Handling service response for get wallets - void processGetWallets(); - /// Handling service response for get information about wallet - void processGetWalletInfo(); - /// Handling service response for get node network - void processGetNodeNetwork(); - /// Handling service response for get node status - void processGetNodeStatus(); - /// Handling service response for execute command from service - void processExecuteCommand(); - /// Handling service response for get history - void processGetHistory(); - /// Handling service response for get list network and send to network model - void processGetNetworkList(); - /// Handling service response for send new history operation to console model - void processResponseConsole(); - /// Handling service response for changing history of commands - void processGetCmdHistory(); - - // --------------------------------------------- - void processGetWalletData(); - -public slots: - /// Show or hide GUI client by clicking on the tray icon. - /// @param aIsActivated Accepts true - when requesting to - /// display a client, falso - when requesting to hide a client. - void activateClient(bool aIsActivated); - /// Shut down client. - void closeClient(); - /// Send signal for changing log model - void processChangedLog(); - /// Add new wallet - /// @param asWalletName Name of new wallet - void addWallet(const QString& asWalletName); - /// Remove wallet - /// @param asWalletName Name of removing wallet - void removeWallet(const QString& asWalletName); - /// Send new token - /// @param asSendWallet Sent wallet - /// @param asAddressReceiver Address of receiver - /// @param asToken Name of token - /// @param aAmount sum for transaction - void sendToken(const QString &asSendWallet, const QString& asAddressReceiver, const QString& asToken, const QString& aAmount); - /// Get wallets - void getWallets(); - /// Get information about wallet - /// @param asWalletName Name of wallet - void getWalletInfo(const QString& asWalletName); - /// Get node network for explorer - void getNodeNetwork(); - /// Request about new network list - void getNetworkList(); - /// Set new status for node - /// @param aIsOnline New status for node - void setNodeStatus(const bool aIsOnline); - /// Execute command - /// @param command Command for executing - void executeCommand(const QString& command); - - /// Get node logs. - void getNodeLogs(); - - /// Get transaction history - void getHistory(); - /// Send to model new history - /// @param aData New history transaction - void setNewHistory(const QVariant& aData); - /// Commands request - /// @param aQueue Result for command - void requestConsole(const QString& aQueue); - /// Get command history - void getCmdHistory(); - /// Change current network - /// @param name of network which was selected - void changeCurrentNetwork(const QString& aNetwork); - - -// --------------------------------------------- - void setNewWalletData(const QVariant& aData); - - void requestWalletData(); -}; - -#endif // COMMANDCONTROLLER_H diff --git a/CellFrameDashboardGUI/Src/include/DapConsoleModel.h b/CellFrameDashboardGUI/Src/include/DapConsoleModel.h deleted file mode 100644 index 00bd228e4..000000000 --- a/CellFrameDashboardGUI/Src/include/DapConsoleModel.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef DAPUIQMLSCREENCONSOLEFORM_H -#define DAPUIQMLSCREENCONSOLEFORM_H - -#include <QDebug> -#include <QAbstractListModel> -#include <QStringList> -#include <QRegularExpression> - -/// Model for DAP console -class DapConsoleModel : public QAbstractListModel -{ - Q_OBJECT - -public: - /// Enumeration for model roles - enum ConsoleRole { - LastCommand = Qt::DisplayRole - }; - -private: - QString m_History; - QStringList m_CommandList; - QStringList::iterator m_CommandIndex; - -public: - explicit DapConsoleModel(QObject *parent = nullptr); - -public slots: - /// Receive response from service about command - /// @param result - void receiveResponse(const QString& aResponse); - /// Override methods of abstract model - int rowCount(const QModelIndex& parent) const override; - QVariant data(const QModelIndex& index, int role) const override; - QHash<int, QByteArray> roleNames() const override; - - /// Getting instanse of this class - /// @return instanse of this class - Q_INVOKABLE static DapConsoleModel& getInstance(); - /// Get the latest commands - /// @return the latest commands - Q_INVOKABLE QString getCommandUp(); - /// Get the earliest commands - /// @return the earliest commands. If it is last command in the list - /// it returns QString() - Q_INVOKABLE QString getCommandDown(); - /// 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: - /// Signal to send request to the service - /// @param command - void sendRequest(QString command); - /// 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); -}; - -#endif // DAPUIQMLSCREENCONSOLEFORM_H diff --git a/CellFrameDashboardGUI/Src/include/DapScreenDialog.h b/CellFrameDashboardGUI/Src/include/DapScreenDialog.h deleted file mode 100644 index a0347f393..000000000 --- a/CellFrameDashboardGUI/Src/include/DapScreenDialog.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef DAPSCREENDIALOG_H -#define DAPSCREENDIALOG_H - -#include <QObject> -#include <QSortFilterProxyModel> - -/// Class of screen dialog. Can filtered different models -class DapScreenDialog : public QObject -{ - Q_OBJECT - - /// Pointer to current filter proxy model - QSortFilterProxyModel *m_proxyModel; -public: - /// Standard constructor - explicit DapScreenDialog(QObject *parent = nullptr); - - Q_PROPERTY(QSortFilterProxyModel* ProxyModel MEMBER m_proxyModel READ proxyModel WRITE setProxyModel NOTIFY proxyModelChanged) - /// Get current filter of proxy model - /// @return Pointer to current filter of proxy model - QSortFilterProxyModel *proxyModel() const; - /// Setn new proxy model - /// @param proxyModel New current filter of proxy model - void setProxyModel(QSortFilterProxyModel *proxyModel); - -signals: - /// The signal is emitted when filter of proxy model was changed - /// @param proxyModel New current filter of proxy model - void proxyModelChanged(QSortFilterProxyModel *proxyModel); -public slots: -}; - -#endif // DAPSCREENDIALOG_H diff --git a/CellFrameDashboardGUI/Src/include/DapScreenDialogChangeWidget.h b/CellFrameDashboardGUI/Src/include/DapScreenDialogChangeWidget.h deleted file mode 100644 index 20dab7444..000000000 --- a/CellFrameDashboardGUI/Src/include/DapScreenDialogChangeWidget.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef DAPSCREENDIALOGCHANGEWIDGET_H -#define DAPSCREENDIALOGCHANGEWIDGET_H - -#include <QObject> -#include <QSortFilterProxyModel> - -/// Class of dialog change widget -class DapScreenDialogChangeWidget : public QObject -{ - Q_OBJECT - /// Pointer to current filter proxy model - QSortFilterProxyModel *m_proxyModel; -public: - /// Standard constructor - explicit DapScreenDialogChangeWidget(QObject *parent = nullptr); - - Q_PROPERTY(QSortFilterProxyModel* ProxyModel MEMBER m_proxyModel READ proxyModel WRITE setProxyModel NOTIFY proxyModelChanged) - /// Get current filter of proxy model - /// @return Pointer to current filter of proxy model - QSortFilterProxyModel *proxyModel() const; - /// Setn new proxy model - /// @param proxyModel New current filter of proxy model - void setProxyModel(QSortFilterProxyModel *proxyModel); -signals: - /// The signal is emitted when filter of proxy model was changed - /// @param proxyModel New current filter of proxy model - void proxyModelChanged(QSortFilterProxyModel *proxyModel); -public slots: -}; - -#endif // DAPSCREENDIALOGCHANGEWIDGET_H diff --git a/CellFrameDashboardGUI/Src/include/DapScreenHistoryFilterModel.h b/CellFrameDashboardGUI/Src/include/DapScreenHistoryFilterModel.h deleted file mode 100644 index 85bddba4f..000000000 --- a/CellFrameDashboardGUI/Src/include/DapScreenHistoryFilterModel.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef DAPSCREENHISTORYFILTERMODEL_H -#define DAPSCREENHISTORYFILTERMODEL_H - -#include <QSortFilterProxyModel> - -#include "DapScreenHistoryModel.h" - -/// Class screen of history transaction -class DapScreenHistoryFilterModel : public QSortFilterProxyModel -{ - Q_OBJECT - -private: - /// Number of wallet - QString m_walletNumber; - /// Minimum date - QDate m_dateLeft; - /// Maximum date - QDate m_dateRight; - /// Filter status - int m_status; - -protected: - /// Overides methods - bool lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const; - bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; - -public: - explicit DapScreenHistoryFilterModel(QObject *parent = nullptr); - /// Get instance of this class - /// @return instance of this class - static DapScreenHistoryFilterModel &getInstance(); - -public slots: - /// Filter model with wallet - /// @param number of wallet - void setFilterWallet(const QString& aWalletNumber); - /// Filter model with dates - /// @param Min date - /// @param Max date - void setFilterDate(const QDate& aDateLeft, const QDate& aDateRight); - /// Filter with status of transaction - /// @param status of transaction - void setFilterStatus(const DapTransactionStatus aStatus); -}; - -#endif // DAPSCREENHISTORYFILTERMODEL_H diff --git a/CellFrameDashboardGUI/Src/include/DapScreenHistoryModel.h b/CellFrameDashboardGUI/Src/include/DapScreenHistoryModel.h deleted file mode 100644 index 5df298d2c..000000000 --- a/CellFrameDashboardGUI/Src/include/DapScreenHistoryModel.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef DAPSCREENHISTORYMODEL_H -#define DAPSCREENHISTORYMODEL_H - -#include <QtGlobal> -#include <QDebug> -#include <QImage> -#include <QAbstractListModel> -#include <QDateTime> -#include <QTimer> -#include "DapHistoryType.h" -#include "DapChainConvertor.h" - -#define MASK_FOR_MODEL QString("MMMM, dd") - -class DapScreenHistoryModel : public QAbstractListModel -{ - Q_OBJECT - -public: - /// Role enumeration - enum { - DisplayDateRole = Qt::UserRole, - DateRole, - DisplayNameTokenRole, - DisplayNumberWalletRole, - DisplayStatusRole, - StatusRole, - StatusColorRole, - DisplayCryptocurrency, - DisplayCurrency - }; - -private: - QList<DapTransactionItem> m_elementList; - -public: - explicit DapScreenHistoryModel(QObject *parent = nullptr); - /// Get instance of this class - /// @param instance of this class - static DapScreenHistoryModel &getInstance(); - - /// Override model's methods - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QHash<int, QByteArray> roleNames() const override; - -public slots: - /// Receive new tx history - /// @param QList<QStringList> data - void receiveNewData(const QVariant& aData); - -signals: - /// Signal for requset current state of tx history - /// By defalt this signal emits when the client has just started while - /// the tx model will not get at least one tx history. - /// The signal stop emitting after getting the request result - void sendRequestHistory(); -}; - -#endif // DAPSCREENHISTORYMODEL_H diff --git a/CellFrameDashboardGUI/Src/include/DapServiceClient.h b/CellFrameDashboardGUI/Src/include/DapServiceClient.h deleted file mode 100644 index b1f9a3244..000000000 --- a/CellFrameDashboardGUI/Src/include/DapServiceClient.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef DAPSERVICECLIENT_H -#define DAPSERVICECLIENT_H - -#include <QObject> -#include <QTimer> -#include <QMessageBox> -#include <QLocalSocket> -#include <QLocalServer> - -#if defined(Q_OS_LINUX) -#include "DapServiceClientNativeLinux.h" -typedef class DapServiceClientNativeLinux DapServiceClientNative; -#elif defined(Q_OS_WIN) -#include "DapServiceClientNativeWin.h" -typedef class DapServiceClientNativeWin DapServiceClientNative; -#elif defined(Q_OS_MAC) -#include "DapServiceClientNativeMacOS.h" -typedef class DapServiceClientNativeMacOS DapServiceClientNative; -#endif - -typedef QLocalSocket DapUiSocket; -typedef QLocalServer DapUiServer; -typedef QLocalSocket::LocalSocketError DapUiSocketError; - -class DapServiceClient : public QObject, public DapServiceClientNative -{ - Q_OBJECT - Q_DISABLE_COPY(DapServiceClient) - - /// Reconnect interval. - const int RECONNECT_TIMEOUT_MS {5000}; - /// The number of attempts to restart the service. - const size_t NUMBER_LAUNCH_ATTEMPTS {3}; - /// The current number of attempts to restart the service. - size_t m_launchAttemptCounter {0}; - /// Reconnect timer. - QTimer m_reconnectTimer; - /// Service connection socket. - DapUiSocket *m_pClientSocket {nullptr}; - - bool m_isServiceConnected {false}; - -public: - explicit DapServiceClient(QObject * apParent = nullptr); - /// Get a socket pointer. - /// @return A pointer to a socket. - DapUiSocket *getClientSocket() const; - -signals: - /// The signal emitted in case of successful connection to the service. - void sigConnected(); - /// The signal emitted in case of successful disconnection from the service. - void sigDisconnected(); - /// The signal emitted in the event of an error when connecting to the service. - /// @param asErrorMessage Socket error message. - void sigSocketErrorString(const QString& asErrorMessage); - /// The signal emitted in the event of an error when connecting to the service. - /// @param aSocketEror Socket error code. - void sigSocketError(DapUiSocketError aSocketEror); - /// The signal is emitted in case of an error when trying to start the service. - /// @param aServiceEror Service error code. - void sigServiceError(DapServiceError aServiceEror); - -protected slots: - /// Establish a connection with the service when the latter is launched. - void onServiceStarted(); - /// Handle event of successful connection to the service. - void connectedToService(); - /// Start the process of reconnecting to the service. - void startReconnectingToService(); - /// Stop the process of reconnecting to the service. - void stopReconnectingToService(); - /// Handle socket error. - /// @param aSocketEror Socket error code. - void handleSocketError(DapUiSocketError aSocketEror); - /// Reconnect service. - void reconnectToService(); - /// Handle service error. - /// @param aServiceEror Service error code. - void handleServiceError(DapServiceError aServiceEror); - -public slots: - /// Initiate the service monitor. - virtual DapServiceError init() override; - /// Establish a connection with the service. - void connectToService(); - /// Handle service outage. - void disconnectFromService(); -}; - -#endif // DAPSERVICECLIENT_H diff --git a/CellFrameDashboardGUI/Src/include/DapServiceClientNativeAbstract.h b/CellFrameDashboardGUI/Src/include/DapServiceClientNativeAbstract.h deleted file mode 100644 index de92eea82..000000000 --- a/CellFrameDashboardGUI/Src/include/DapServiceClientNativeAbstract.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef DAPSERVICECLIENTNATIVEABSTRACT_H -#define DAPSERVICECLIENTNATIVEABSTRACT_H - -#include <QTimer> -#include <QDebug> - -enum class DapServiceError { - NO_ERRORS, - USER_COMMAND_ABORT, - UNABLE_START_SERVICE, - UNABLE_STOP_SERVICE, - SERVICE_NOT_FOUND, - UNKNOWN_ERROR -}; - -class DapServiceClientNativeAbstract -{ -public: - DapServiceClientNativeAbstract(); - virtual ~DapServiceClientNativeAbstract() { } - - virtual bool isServiceRunning() = 0; - - virtual DapServiceError serviceInstallAndRun() = 0; - virtual DapServiceError serviceStart() = 0; - virtual DapServiceError serviceStop() = 0; - virtual DapServiceError serviceRestart() = 0; - -public slots: - virtual DapServiceError init(); -protected: - bool m_isServiceRunning; - -protected slots: - virtual void onServiceInstalled(); - virtual void onServiceStarted(); - virtual void onServiceStopped(); -}; - -#endif // DAPSERVICECLIENTNATIVEABSTRACT_H diff --git a/CellFrameDashboardGUI/Src/include/DapServiceClientNativeLinux.h b/CellFrameDashboardGUI/Src/include/DapServiceClientNativeLinux.h deleted file mode 100644 index 16068d9ef..000000000 --- a/CellFrameDashboardGUI/Src/include/DapServiceClientNativeLinux.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef DAPSERVICECLIENTNATIVELINUX_H -#define DAPSERVICECLIENTNATIVELINUX_H - -#include "DapServiceClientNativeAbstract.h" - -class DapServiceClientNativeLinux : public DapServiceClientNativeAbstract -{ - const char* m_checkIsServiceRunningCommand; - QString m_cmdTemplate; -public: - DapServiceClientNativeLinux(); - ~DapServiceClientNativeLinux() override; - bool isServiceRunning() override; - DapServiceError serviceStart() override; - DapServiceError serviceRestart() override; - - DapServiceError serviceStop() override; - DapServiceError serviceInstallAndRun() override; -}; - -#endif // DAPSERVICECLIENTNATIVELINUX_H diff --git a/CellFrameDashboardGUI/Src/include/DapServiceClientNativeMacOS.h b/CellFrameDashboardGUI/Src/include/DapServiceClientNativeMacOS.h deleted file mode 100644 index 6d9f31dcc..000000000 --- a/CellFrameDashboardGUI/Src/include/DapServiceClientNativeMacOS.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef DAPSERVICECLIENTNATIVEMACOS_H -#define DAPSERVICECLIENTNATIVEMACOS_H - -#include "DapServiceClientNativeAbstract.h" - -class DapServiceClientNativeMacOS : public DapServiceClientNativeAbstract -{ - const char* m_checkIsServiceRunningCommand; - QString m_cmdTemplate; -public: - DapServiceClientNativeMacOS(); - ~DapServiceClientNativeMacOS() override; - bool isServiceRunning() override; - DapServiceError serviceStart() override; - DapServiceError serviceRestart() override; - - DapServiceError serviceStop() override; - DapServiceError serviceInstallAndRun() override; -}; - -#endif // DAPSERVICECLIENTNATIVEMACOS_H diff --git a/CellFrameDashboardGUI/Src/include/DapServiceClientNativeWin.h b/CellFrameDashboardGUI/Src/include/DapServiceClientNativeWin.h deleted file mode 100644 index 4a729fe70..000000000 --- a/CellFrameDashboardGUI/Src/include/DapServiceClientNativeWin.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef DAPSERVICECLIENTNATIVEWIN_H -#define DAPSERVICECLIENTNATIVEWIN_H - -#include "DapServiceClientNativeAbstract.h" - -class DapServiceClientNativeWin : public DapServiceClientNativeAbstract -{ -public: - DapServiceClientNativeWin(); - ~DapServiceClientNativeWin() override; - bool isServiceRunning() override; - DapServiceError serviceStart() override; - DapServiceError serviceRestart() override; - - DapServiceError serviceStop() override; - DapServiceError serviceInstallAndRun() override; -}; - -#endif // DAPSERVICECLIENTNATIVEWIN_H diff --git a/CellFrameDashboardGUI/Src/include/DapServiceController.h b/CellFrameDashboardGUI/Src/include/DapServiceController.h deleted file mode 100644 index f96d43b0d..000000000 --- a/CellFrameDashboardGUI/Src/include/DapServiceController.h +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef DAPSERVICECONTROLLER_H -#define DAPSERVICECONTROLLER_H - -#include <QObject> -#include <QQmlEngine> -#include <QJSEngine> -#include <QApplication> -#include <QTimer> -#include <QMap> -#include <QPair> - -#include "DapCommandController.h" -#include "DapServiceClient.h" -#include "DapLogModel.h" -#include "DapChainWalletsModel.h" -#include "DapChainNodeNetworkModel.h" -#include "DapScreenHistoryModel.h" -#include "DapSettingsNetworkModel.h" -#include "DapConsoleModel.h" - -#include "DapChainWalletModel.h" - -class DapServiceController : public QObject -{ - Q_OBJECT - Q_DISABLE_COPY(DapServiceController) - /// Brand Ñompany. - QString m_sBrand {DAP_BRAND}; - /// Application version. - QString m_sVersion {DAP_VERSION}; - /// Settings file. - QString m_sSettingFile {DAP_SETTINGS_FILE}; - /// Result execute. - QString m_sResult; - - /// Service connection management service. - DapServiceClient *m_pDapServiceClient {nullptr}; - /// RPC protocol controller. - DapCommandController *m_pDapCommandController {nullptr}; - /// Standard constructor - explicit DapServiceController(QObject *apParent = nullptr); - -public: - /// Get an instance of a class. - /// @return Instance of a class. - Q_INVOKABLE static DapServiceController &getInstance(); - - ///******************************************** - /// Property - /// ******************************************* - - /// Brand Ñompany. - Q_PROPERTY(QString Brand MEMBER m_sBrand READ getBrand NOTIFY brandChanged) - /// Application version. - Q_PROPERTY(QString Version MEMBER m_sVersion READ getVersion NOTIFY versionChanged) - /// Result execute command. - Q_PROPERTY(QString Result MEMBER m_sVersion READ getResult NOTIFY resultChanged) - - ///******************************************** - /// Interface - /// ******************************************* - void init(DapServiceClient *apDapServiceClient); - /// Get company brand. - /// @return Brand Ñompany. - QString getBrand() const; - /// Get app version. - /// @return Application version. - QString getVersion() const; - /// Get setting file name. - /// @return Setting file name - QString getSettingFile() const; - /// Get result command execute. - /// @return Result execute. - QString getResult(); - /// Get node logs. - /// @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; - /// 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); - - /// Get information about wallet - /// @param name of wallet - void getWalletInfo(const QString& asWalletName); - /// Request about new netowrk list - void getNetworkList(); - /// Get history of commands - void getCmdHistory(); - -signals: - /// The signal is emitted when the Brand company property changes. - /// @param asBrand Brand - void brandChanged(const QString &brand); - /// The signal is emitted when the Application version property changes. - /// @param version Version - void versionChanged(const QString &version); - /// The signal is emitted when the result execute property changes. - void resultChanged(); - /// The signal is emitted when the main application window is activated. - void activateWindow(); - /// The signal is emitted when checking the existence of an already running copy of the application. - /// @param isExistenceClient True if after checking client is exist. False when not - void isExistenceClient(bool isExistenceClient); - /// The signal is emitted when sending to QML - void sendToQML(QString); - /// The signal is emitted when log message append to log model or logs was cleared - void logCompleted(); - /// Signal for data network - /// @param aData Data network - void sendNodeNetwork(const QVariant& aData); - void userSettingsLoaded(); - void userSettingsSaved(); - -private slots: - /// Handling service response for receiving node logs. - /// @param aNodeLogs List of node logs. - void processGetNodeLogs(const QStringList& aNodeLogs); - /// Handling service response for add new wallet - /// @param asWalletName Name of wallet - /// @param asWalletAddress Address of wallet - void processAddWallet(const QString& asWalletName, const QString& asWalletAddress); - // TODO: Implement logic to proccess. - /// Handling service response for send new token - /// @param asAnswer Answer - void processSendToken(const QString& asAnswer); - /// Handling service response for get wallets - /// @param aWallets Wallets - void processGetWallets(const QMap<QString, QVariant>& aWallets); - /// Handling service response for get information about selected wallet - /// @param asWalletName Name of wallet - /// @param asWalletAddress Address of wallet - void processGetWalletInfo(const QString& asWalletName, const QString& asWalletAddress, const QStringList &aBalance, const QStringList& aTokens); - /// Handling service response for write information of result executing command - /// @param result Result executing information - void processExecuteCommandInfo(const QString& result); - /// Handling service response for get node network - /// @param aData Data of node network - void processGetNodeNetwork(const QVariant& aData); - /// Handling service response for get transaction history - /// @param Data of history - void processGetHistory(const QVariant& aData); - -public slots: - /// Get history of transaction - void getHistory(); - /// Get node network for explorer - void getNodeNetwork(); - /// Change status of node - /// @param it is true if a node is online - void setNodeStatus(const bool aIsOnline); - - /// Get node logs. - Q_INVOKABLE void getNodeLogs() const; - - void clearLogModel(); - /// Show or hide GUI client by clicking on the tray icon. - /// @param aIsActivated Accepts true - when requesting to - /// display a client, falso - when requesting to hide a client. - void activateClient(bool aIsActivated); - /// Shut down client. - void closeClient(); - /// Load user settings from settings file - void loadUserSettings(); - /// Save user settings to file - void saveUserSettings(); - /// Method that implements the singleton pattern for the qml layer. - /// @param engine QML application. - /// @param scriptEngine The QJSEngine class provides an environment for evaluating JavaScript code. - static QObject *singletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine); - -public slots: - void requestWalletData(); -}; - -#endif // DAPSERVICECONTROLLER_H diff --git a/CellFrameDashboardGUI/Src/include/DapSettingsNetworkModel.h b/CellFrameDashboardGUI/Src/include/DapSettingsNetworkModel.h deleted file mode 100644 index 216d01290..000000000 --- a/CellFrameDashboardGUI/Src/include/DapSettingsNetworkModel.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef DAPSETTINGSNETWORKMODEL_H -#define DAPSETTINGSNETWORKMODEL_H - -#include <QAbstractListModel> -#include <QStringList> -#include <QDebug> - -class DapSettingsNetworkModel : public QAbstractListModel -{ - Q_OBJECT - -public: - /// Enumeration display role - enum DisplayRole { - DisplayName = Qt::UserRole - }; - -private: - QStringList m_NetworkList; - QString m_CurrentNetwork; - int m_CurrentIndex; - -public: - explicit DapSettingsNetworkModel(QObject *parent = nullptr); - /// Get instance of this object - /// @return instance - static DapSettingsNetworkModel &getInstance(); - - /// Overload methods - int rowCount(const QModelIndex& parent) const; - QVariant data(const QModelIndex& index, int role) const; - QHash<int, QByteArray> roleNames() const; - - /// Get current network which was selected - /// @return name of current network - Q_INVOKABLE QString getCurrentNetwork() const; - /// Get current index which was selected - /// @return index of current network - Q_INVOKABLE int getCurrentIndex() const; - -public slots: - /// Set new network list - /// @param List of network - void setNetworkList(const QStringList& aNetworkList); - /// Set current network which was selected in combobox - /// @param name of network - /// @param index of network - void setCurrentNetwork(QString CurrentNetwork, int CurrentIndex); - -signals: - /// Signal about changing current network - /// @param name of network which was selected - void currentNetworkChanged(QString currentNetwork); -}; - -#endif // DAPSETTINGSNETWORKMODEL_H diff --git a/CellFrameDashboardGUI/Src/include/DapWalletFilterModel.h b/CellFrameDashboardGUI/Src/include/DapWalletFilterModel.h deleted file mode 100644 index fe8927d30..000000000 --- a/CellFrameDashboardGUI/Src/include/DapWalletFilterModel.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef DAPWALLETFILTERMODEL_H -#define DAPWALLETFILTERMODEL_H - -#include <QSortFilterProxyModel> -#include "DapChainWalletModel.h" - -class DapWalletFilterModel : public QSortFilterProxyModel -{ - Q_OBJECT - -private: - QString m_filterWalletName; - -protected: - bool lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const; - bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; - -public: - explicit DapWalletFilterModel(QObject *parent = nullptr); - static DapWalletFilterModel& instance(); - -public slots: - Q_INVOKABLE void setWalletFilter(const QString& aName); -}; - -#endif // DAPWALLETFILTERMODEL_H diff --git a/CellFrameDashboardGUI/Src/main.cpp b/CellFrameDashboardGUI/Src/main.cpp deleted file mode 100644 index 204ce4bac..000000000 --- a/CellFrameDashboardGUI/Src/main.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include <QApplication> -#include <QGuiApplication> -#include <QtQml> -#include <QQmlApplicationEngine> -#include <QQmlContext> -#include <QIcon> -#include <QSystemSemaphore> -#include <QSharedMemory> -#include <QScreen> - -#include "DapHalper.h" -#include "DapScreenDialog.h" -#include "DapScreenDialogChangeWidget.h" -#include "DapSettings.h" -#include "DapSettingsCipher.h" -#include "DapServiceClient.h" -#include "DapServiceController.h" -#include "DapLogger.h" -#include "DapLogMessage.h" -#include "DapLogModel.h" -#include "DapChainWalletsModel.h" -#include "DapChainNodeNetworkModel.h" -#include "DapChainNodeNetworkExplorer.h" -#include "DapScreenHistoryFilterModel.h" -#include "DapSettingsNetworkModel.h" -#include "DapConsoleModel.h" -#include "DapChainConvertor.h" -#include "DapClipboard.h" - -#include "DapChainWalletModel.h" -#include "DapWalletFilterModel.h" - -#include <QRegExp> - -#include <sys/stat.h> - -int main(int argc, char *argv[]) -{ - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - - QApplication app(argc, argv); - app.setOrganizationName("DEMLABS"); - app.setOrganizationDomain("demlabs.net"); - app.setApplicationName("CellFrame Dashboard"); - app.setWindowIcon(QIcon(":/res/icons/icon.ico")); - - DapLogger dapLogger; - /// TODO: The code is commented out at the time of developing the logging strategy in the project -//#ifndef QT_DEBUG - #ifdef Q_OS_LINUX - dapLogger.setLogFile(QString("/opt/cellframe-dashboard/log/%1Gui.log").arg(DAP_BRAND)); - #elif defined Q_OS_MACOS - mkdir("/tmp/cellframe-dashboard_log",0777); - dapLogger.setLogFile(QString("/tmp/cellframe-dashboard_log/%1Gui.log").arg(DAP_BRAND)); - #elif defined Q_OS_WIN - dapLogger.setLogFile(QString("%Dashboard.log").arg(DAP_BRAND)); - dapLogger.setLogLevel(L_DEBUG); - #endif -//#endif - - /// Local client. - DapServiceClient dapServiceClient; - // Creating a service controller - DapServiceController &controller = DapServiceController::getInstance(); - controller.init(&dapServiceClient); - dapServiceClient.init(); - controller.getWallets(); - controller.requestWalletData(); - controller.getHistory(); - controller.getCmdHistory(); - controller.getNetworkList(); - - DapScreenHistoryFilterModel::getInstance() - .setSourceModel(&DapScreenHistoryModel::getInstance()); - - DapWalletFilterModel::instance() - .setSourceModel(&DapChainWalletModel::instance()); - - qmlRegisterType<DapScreenDialog>("CellFrameDashboard", 1, 0, "DapScreenDialog"); - qmlRegisterType<DapScreenDialogChangeWidget>("CellFrameDashboard", 1, 0, "DapScreenDialogChangeWidget"); - qmlRegisterType<DapLogMessage>("LogMessage", 1, 0, "DapLogMessage"); - qmlRegisterType<DapChainNodeNetworkExplorer>("NodeNetworkExplorer", 1, 0, "DapUiQmlWidgetNodeNetwork"); - qmlRegisterType<DapScreenHistoryModel>("DapTransactionHistory", 1, 0, "DapTransactionModel"); - - QQmlApplicationEngine engine; - /// TODO: this method for getting DPI screen can be useful in the future -// qreal dpi = QGuiApplication::primaryScreen()->physicalDotsPerInch(); - engine.rootContext()->setContextProperty("dapServiceController", &DapServiceController::getInstance()); - engine.rootContext()->setContextProperty("dapLogModel", &DapLogModel::getInstance()); - engine.rootContext()->setContextProperty("dapChainWalletsModel", &DapChainWalletsModel::getInstance()); - engine.rootContext()->setContextProperty("dapNodeNetworkModel", &DapChainNodeNetworkModel::getInstance()); - engine.rootContext()->setContextProperty("dapConsoleModel", &DapConsoleModel::getInstance()); - engine.rootContext()->setContextProperty("dapHistoryModel", &DapScreenHistoryFilterModel::getInstance()); - engine.rootContext()->setContextProperty("dapSettingsNetworkModel", &DapSettingsNetworkModel::getInstance()); - engine.rootContext()->setContextProperty("dapChainConvertor", &DapChainConvertor::getInstance()); - engine.rootContext()->setContextProperty("dapWalletFilterModel", &DapWalletFilterModel::instance()); - engine.rootContext()->setContextProperty("dapWalletModel", &DapChainWalletModel::instance()); - engine.rootContext()->setContextProperty("clipboard", &DapClipboard::instance()); - engine.rootContext()->setContextProperty("pt", 1.3); - engine.load(QUrl("qrc:/screen/main.qml")); - - qDebug() << engine.rootObjects().isEmpty(); - if (engine.rootObjects().isEmpty()) - return -1; - - return app.exec(); -} -- GitLab