diff --git a/CellFrameDashboardGUI/DapServiceController.cpp b/CellFrameDashboardGUI/DapServiceController.cpp index 94c8780f4ada554741f1797bb0bca92f546e4cb9..a381b25db16fe76d7d9a274b3c7c51a45b9952f4 100644 --- a/CellFrameDashboardGUI/DapServiceController.cpp +++ b/CellFrameDashboardGUI/DapServiceController.cpp @@ -46,18 +46,18 @@ void DapServiceController::requestToService(const QString &asServicename, const const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, const QVariant &arg10) { - DapAbstractCommand * transceiver = m_transceivers.find(asServicename).value(); + DapAbstractCommand * transceiver = m_transceivers.find(asServicename).value().first; Q_ASSERT(transceiver); transceiver->requestToService(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); - connect(transceiver, SIGNAL(serviceResponded(QVariant)), SLOT(find(QVariant))); + connect(transceiver, SIGNAL(serviceResponded(QVariant)), SLOT(findEmittedSignal(QVariant))); } /// Register command. void DapServiceController::registerCommand() { - m_transceivers.insert("ADD", new DapAddWalletCommand("ADD", m_DAPRpcSocket, this)); + m_transceivers.insert("ADD", qMakePair(new DapAddWalletCommand("ADD", m_DAPRpcSocket, this), QString("addWalletResponded"))); } /// Find the emitted signal. @@ -67,28 +67,21 @@ void DapServiceController::findEmittedSignal(const QVariant &aValue) DapAbstractCommand * transceiver = dynamic_cast<DapAbstractCommand *>(sender()); Q_ASSERT(transceiver); - - QString nameSignal = QString("%1Responded").arg(transceiver->getName()); + auto service = std::find_if(m_transceivers.begin(), m_transceivers.end(), [=] (const QPair<DapAbstractCommand*, QString>& it) + { + QString s = it.first->getName(); + QString t = transceiver->getName(); + return it.first->getName() == transceiver->getName() ? true : false; + }); for (int idx = 0; idx < metaObject()->methodCount(); ++idx) { const QMetaMethod method = metaObject()->method(idx); - if (method.methodType() == QMetaMethod::Signal && method.name() == nameSignal) + if (method.methodType() == QMetaMethod::Signal && method.name() == service.value().second) { metaObject()->method(idx).invoke(this, Q_ARG(QVariant, aValue)); } } } -/// 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(); -} - diff --git a/CellFrameDashboardGUI/DapServiceController.h b/CellFrameDashboardGUI/DapServiceController.h index 3d6ac60c974cecd1cfc63bac80062e200693e359..ee81bc39fe1ca7de011da9375617d7555ff066fa 100644 --- a/CellFrameDashboardGUI/DapServiceController.h +++ b/CellFrameDashboardGUI/DapServiceController.h @@ -6,6 +6,8 @@ #include <QGenericArgument> #include <QQmlEngine> #include <QJSEngine> +#include <QPair> +#include <algorithm> #include "DapServiceClient.h" #include "Handlers/DapAbstractCommand.h" @@ -22,7 +24,7 @@ class DapServiceController : public QObject /// Service connection management service. DapServiceClient *m_pDapServiceClient {nullptr}; /// Command manager. - QMap<QString, DapAbstractCommand*> m_transceivers; + QMap<QString, QPair<DapAbstractCommand*, QString>> m_transceivers; /// RPC socket. DapRpcSocket * m_DAPRpcSocket {nullptr}; /// Standard constructor @@ -72,18 +74,14 @@ signals: /// @param version Version void versionChanged(const QString &version); + void addWalletResponded(const QVariant& wallet); + private slots: /// Register command. void registerCommand(); /// Find the emitted signal. /// @param aValue Transmitted parameter. void findEmittedSignal(const QVariant& aValue); - -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 // DAPSERVICECONTROLLER_H diff --git a/CellFrameDashboardGUI/main.cpp b/CellFrameDashboardGUI/main.cpp index 4677a6f397ba9e68f2295261a13ffebb16fb2589..6112b12ef6eeafdb3ad864c5edd3bf38610393cb 100644 --- a/CellFrameDashboardGUI/main.cpp +++ b/CellFrameDashboardGUI/main.cpp @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) QQmlApplicationEngine engine; engine.rootContext()->setContextProperty("dapServiceController", &DapServiceController::getInstance()); - engine.rootContext()->setContextProperty("pt", 1.0); + engine.rootContext()->setContextProperty("pt", 1); engine.load(QUrl("qrc:/main.qml")); if (engine.rootObjects().isEmpty()) diff --git a/CellFrameDashboardGUI/main.qml b/CellFrameDashboardGUI/main.qml index 073f94b1c1ea2b91f6848ed7b806492c926f02da..79e95443077a75d51ffc9ca2aa0990b60409ff50 100755 --- a/CellFrameDashboardGUI/main.qml +++ b/CellFrameDashboardGUI/main.qml @@ -28,7 +28,6 @@ ApplicationWindow { id: screenShotMainWindow anchors.fill: parent - sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } diff --git a/CellFrameDashboardGUI/screen/DapAbstractRightPanelForm.ui.qml b/CellFrameDashboardGUI/screen/DapAbstractRightPanelForm.ui.qml index 5dbe131a48540af9fd03f2bcba28f3461dcbb98f..53180347dcc88a781baa4feddc422ddb9d56a9cd 100644 --- a/CellFrameDashboardGUI/screen/DapAbstractRightPanelForm.ui.qml +++ b/CellFrameDashboardGUI/screen/DapAbstractRightPanelForm.ui.qml @@ -20,22 +20,9 @@ DapRightPanel normalImageButton: "qrc:/res/icons/close_icon.png" hoverImageButton: "qrc:/res/icons/close_icon_hover.png" } - - dapHeader.height: 30 * pt + + dapHeader.height: 36 * pt dapFrame.width: 400 * pt dapFrame.height: parent.height color: "#F8F7FA" } - - - - - - - - - -/*##^## Designer { - D{i:0;autoSize:true;height:480;width:640} -} - ##^##*/ diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTab.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTab.qml index 9d6c2b913c89a7dfa40370313f6be80eb5225aad..1e874c2250bc3324bbb77d88bf7f8f638b8f3727 100644 --- a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTab.qml +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTab.qml @@ -2,14 +2,20 @@ import QtQuick 2.4 DapDashboardTabForm { - ///@detalis Path to the right pane of transaction history. + ///@detalis Path to the right panel of transaction history. readonly property string transactionHistoryWallet: "qrc:/screen/" + device + "/Dashboard/RightPanel/DapTransactionHistoryRightPanel.qml" - ///@detalis Path to the right pane of transaction history. + ///@detalis Path to the right panel of transaction history. readonly property string inputNameWallet: "qrc:/screen/" + device + "/Dashboard/RightPanel/DapInputNewWalletNameRightPanel.qml" - ///@detalis Path to the right pane of transaction history. + ///@detalis Path to the right panel of transaction history. readonly property string recoveryWallet: "qrc:/screen/" + device + "/Dashboard/RightPanel/DapRecoveryWalletRightPanel.qml" - ///@detalis Path to the right pane of transaction history. + ///@detalis Path to the right panel of transaction history. readonly property string doneWallet: "qrc:/screen/" + device + "/Dashboard/RightPanel/DapDoneWalletRightPanel.qml" dapDashboardRightPanel.source: Qt.resolvedUrl(inputNameWallet) + + dapDashboardTopPanel.dapAddWalletButton.onClicked: + { + if(dapDashboardRightPanel.source != Qt.resolvedUrl(inputNameWallet)) + dapDashboardRightPanel.setSource(Qt.resolvedUrl(inputNameWallet)) + } } diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTabForm.ui.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTabForm.ui.qml index 59f69cfe5c362b47ad1bec729a228cbe949d7d0d..58011df9a412dab28a49d757eb1ef4f063363db4 100644 --- a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTabForm.ui.qml +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTabForm.ui.qml @@ -8,8 +8,13 @@ DapAbstractTab id: dashboardTab property alias dapDashboardRightPanel: rightPanelLoader + property alias dapDashboardTopPanel: dashboardTopPanel - dapTopPanel: DapDashboardTopPanel { } + dapTopPanel: + DapDashboardTopPanel + { + id: dashboardTopPanel + } dapScreen: DapDashboardScreen { } diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanel.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanel.qml index 756f7f22a97bc5cef5ce3a976c5bf1128140d98f..85c6f9eedf6dd84e87d4c02c8d368585dca7bcd3 100644 --- a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanel.qml +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanel.qml @@ -2,5 +2,26 @@ import QtQuick 2.4 DapDashboardTopPanelForm { + ListModel + { + id: modelWallets + } + + Connections + { + target: dapServiceController + onAddWalletResponded: updateModel(wallet) + } + function updateModel(wallet) + { + console.log(wallet) + if(wallet[1] === "created") + modelWallets.append({ "name" : wallet[0] }) + } + + dapAddWalletButton.onClicked: + { + dapServiceController.requestToService("ADD", "MYNEWWALLET"); + } } diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui.qml index 740beeb1b42f255337d46a56b429fc4578dd2471..7d5179e63a45ccd1cb36d7f6d0e8abf4e1893bad 100644 --- a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui.qml +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui.qml @@ -5,6 +5,8 @@ import "../../" DapAbstractTopPanel { + property alias dapAddWalletButton: addWalletButton + anchors.fill: parent // Static text "Wallet" @@ -34,27 +36,7 @@ DapAbstractTopPanel DapComboBox { id: comboboxWallet - - model: ListModel - { - id: ÑonversionList - ListElement - { - text: "all wallets" - } - ListElement - { - text: "Money for children" - } - ListElement - { - text: "Money for education" - } - ListElement - { - text: "Money for medicine" - } - } + model: modelWallets indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down.png" indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up.png" sidePaddingNormal: 0 * pt diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_BACKUP_6288.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_BACKUP_6288.qml new file mode 100644 index 0000000000000000000000000000000000000000..fe848398d7aec871a1b31e7fc6af9fa59ecad8d9 --- /dev/null +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_BACKUP_6288.qml @@ -0,0 +1,133 @@ +import QtQuick 2.4 +import QtQuick.Controls 2.0 +<<<<<<< HEAD +import "qrc:/widgets" +======= +>>>>>>> develop +import "../../" + + +DapAbstractTopPanel +{ +<<<<<<< HEAD + anchors.fill: parent +======= + property alias testButton: button + Button + { + id: button + anchors.fill: parent + text: "Press" + } +>>>>>>> develop + + // Static text "Wallet" + Label + { + id:textHeaderWallet + text: qsTr("Wallet") + anchors.left: parent.left + anchors.leftMargin: 24 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: DapMainApplicationWindow.dapFontRobotoRegular.name + font.pixelSize: 12 * pt + color: "#ACAAB5" + } + + // Wallet selection combo box + Rectangle + { + id: frameComboBox + + anchors.left: textHeaderWallet.right + anchors.verticalCenter: parent.verticalCenter + anchors.leftMargin: 30 * pt + width: 148 * pt + color: "transparent" + + DapComboBox + { + id: comboboxWallet + + model: ListModel{ + id:ÑonversionList + ListElement{text:"all wallets"} + ListElement{text:"Money for children"} + ListElement{text:"Money for education"} + ListElement{text:"Money for medicine"} + } + + indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down.png" + indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up.png" + sidePaddingNormal:0 * pt + sidePaddingActive:16 * pt + topIndentActive:10 * pt + normalColorText:"#070023" + hilightColorText:"#FFFFFF" + normalColorTopText:"#FFFFFF" + hilightColorTopText:"#070023" + hilightColor: "#330F54" + normalTopColor: "#070023" + fontSizeComboBox: 14*px + widthPopupComboBoxNormal:148 * pt + widthPopupComboBoxActive:180 * pt + heightComboBoxNormal:24 * pt + heightComboBoxActive:44 * pt + bottomIntervalListElement:8 * pt + topEffect:false + x: popup.visible ? sidePaddingActive * (-1) : sidePaddingNormal + } + } + + // Static wallet balance text "Wallet balance" + Label + { + id: headerWalletBalance + text: qsTr("Wallet balance") + anchors.left: frameComboBox.right + anchors.leftMargin: 70 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: DapMainApplicationWindow.dapFontRobotoRegular.name + font.pixelSize: 12 * pt + color: "#ACAAB5" + } + + // Dynamic wallet balance text + Label + { + id: textWalletBalance + text: "$ 3 050 745.3453289 USD" + anchors.left: headerWalletBalance.right + anchors.leftMargin: 18 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: DapMainApplicationWindow.dapFontRobotoRegular.name + font.pixelSize: 16 * pt + color: "#FFFFFF" + } + + // Wallet create button + DapButton + { + id: addWalletButton + textButton: "New wallet" + anchors.right: parent.right + anchors.rightMargin: 24 * pt + anchors.verticalCenter: parent.verticalCenter + normalImageButton: "qrc:/res/icons/new-wallet_icon_dark.png" + hoverImageButton: "qrc:/res/icons/new-wallet_icon_dark_hover.png" + heightButton: 24 * pt + widthButton: 120 * pt + widthImageButton: 28 * pt + heightImageButton: 28 * pt + indentImageLeftButton: 10 * pt + colorBackgroundNormal:"#070023" + colorBackgroundHover: "#D51F5D" + colorButtonTextNormal: "#FFFFFF" + colorButtonTextHover: "#FFFFFF" + indentTextRight: 20 * pt + fontSizeButton: 14 * pt + existenceImage:true + borderColorButton: "#000000" + borderWidthButton: 0 + } +} diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_BASE_6288.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_BASE_6288.qml new file mode 100644 index 0000000000000000000000000000000000000000..ea5ef5959e3cd220fa7a09b158bc0461f64ee4a3 --- /dev/null +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_BASE_6288.qml @@ -0,0 +1,18 @@ +import QtQuick 2.4 +import "../../" + +DapAbstractTopPanel +{ + +} + + + + + + + +/*##^## Designer { + D{i:0;autoSize:true;height:480;width:640} +} + ##^##*/ diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_LOCAL_6288.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_LOCAL_6288.qml new file mode 100644 index 0000000000000000000000000000000000000000..1b689c1d6207418c18e1a9ad5ae9a8dd9f5d9c49 --- /dev/null +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_LOCAL_6288.qml @@ -0,0 +1,120 @@ +import QtQuick 2.4 +import QtQuick.Controls 2.0 +import "qrc:/widgets" +import "../../" + + +DapAbstractTopPanel +{ + anchors.fill: parent + + // Static text "Wallet" + Label + { + id:textHeaderWallet + text: qsTr("Wallet") + anchors.left: parent.left + anchors.leftMargin: 24 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: DapMainApplicationWindow.dapFontRobotoRegular.name + font.pixelSize: 12 * pt + color: "#ACAAB5" + } + + // Wallet selection combo box + Rectangle + { + id: frameComboBox + + anchors.left: textHeaderWallet.right + anchors.verticalCenter: parent.verticalCenter + anchors.leftMargin: 30 * pt + width: 148 * pt + color: "transparent" + + DapComboBox + { + id: comboboxWallet + + model: ListModel{ + id:ÑonversionList + ListElement{text:"all wallets"} + ListElement{text:"Money for children"} + ListElement{text:"Money for education"} + ListElement{text:"Money for medicine"} + } + + indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down.png" + indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up.png" + sidePaddingNormal:0 * pt + sidePaddingActive:16 * pt + topIndentActive:10 * pt + normalColorText:"#070023" + hilightColorText:"#FFFFFF" + normalColorTopText:"#FFFFFF" + hilightColorTopText:"#070023" + hilightColor: "#330F54" + normalTopColor: "#070023" + fontSizeComboBox: 14*px + widthPopupComboBoxNormal:148 * pt + widthPopupComboBoxActive:180 * pt + heightComboBoxNormal:24 * pt + heightComboBoxActive:44 * pt + bottomIntervalListElement:8 * pt + topEffect:false + x: popup.visible ? sidePaddingActive * (-1) : sidePaddingNormal + } + } + + // Static wallet balance text "Wallet balance" + Label + { + id: headerWalletBalance + text: qsTr("Wallet balance") + anchors.left: frameComboBox.right + anchors.leftMargin: 70 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: DapMainApplicationWindow.dapFontRobotoRegular.name + font.pixelSize: 12 * pt + color: "#ACAAB5" + } + + // Dynamic wallet balance text + Label + { + id: textWalletBalance + text: "$ 3 050 745.3453289 USD" + anchors.left: headerWalletBalance.right + anchors.leftMargin: 18 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: DapMainApplicationWindow.dapFontRobotoRegular.name + font.pixelSize: 16 * pt + color: "#FFFFFF" + } + + // Wallet create button + DapButton + { + id: addWalletButton + textButton: "New wallet" + anchors.right: parent.right + anchors.rightMargin: 24 * pt + anchors.verticalCenter: parent.verticalCenter + normalImageButton: "qrc:/res/icons/new-wallet_icon_dark.png" + hoverImageButton: "qrc:/res/icons/new-wallet_icon_dark_hover.png" + heightButton: 24 * pt + widthButton: 120 * pt + widthImageButton: 28 * pt + heightImageButton: 28 * pt + indentImageLeftButton: 10 * pt + colorBackgroundNormal:"#070023" + colorBackgroundHover: "#D51F5D" + colorButtonTextNormal: "#FFFFFF" + colorButtonTextHover: "#FFFFFF" + indentTextRight: 20 * pt + fontSizeButton: 14 * pt + existenceImage:true + borderColorButton: "#000000" + borderWidthButton: 0 + } +} diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_REMOTE_6288.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_REMOTE_6288.qml new file mode 100644 index 0000000000000000000000000000000000000000..b58555259e7bc024f2f444000d92b2f0484c5839 --- /dev/null +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/DapDashboardTopPanelForm.ui_REMOTE_6288.qml @@ -0,0 +1,26 @@ +import QtQuick 2.4 +import QtQuick.Controls 2.0 +import "../../" + +DapAbstractTopPanel +{ + property alias testButton: button + Button + { + id: button + anchors.fill: parent + text: "Press" + } + +} + + + + + + + +/*##^## Designer { + D{i:0;autoSize:true;height:480;width:640} +} + ##^##*/ diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapDoneWalletRightPanelForm.ui.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapDoneWalletRightPanelForm.ui.qml index 63187d041700107ac112c172474de93e75f443ab..0cb2560afb9a71a5f42bc59ebf409b583c8599fa 100644 --- a/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapDoneWalletRightPanelForm.ui.qml +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapDoneWalletRightPanelForm.ui.qml @@ -10,7 +10,6 @@ DapAbstractRightPanel dapButtonClose.widthImageButton: 16 * pt dapButtonClose.normalImageButton: "qrc:/res/icons/close_icon.png" dapButtonClose.hoverImageButton: "qrc:/res/icons/close_icon_hover.png" - dapHeaderData: Row { @@ -19,8 +18,8 @@ DapAbstractRightPanel anchors.rightMargin: 16 * pt anchors.topMargin: 12 * pt anchors.bottomMargin: 12 * pt - - Item + + Item { id: itemButtonClose data: dapButtonClose @@ -82,7 +81,7 @@ DapAbstractRightPanel textButton: qsTr("Done") horizontalAligmentText: Text.AlignHCenter indentTextRight: 0 - fontSizeButton: 18 * pt + fontButton.pixelSize: 18 * pt colorTextButton: buttonDone.checked ? "#3E3853" : "#FFFFFF" colorBackgroundButton: "#3E3853" } diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapInputNewWalletNameRightPanelForm.ui.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapInputNewWalletNameRightPanelForm.ui.qml index 9232a2f3d587045f9de2336fd8d5e56851c1ab9d..c691075db67f66d0af656a1723faeff2f26415af 100644 --- a/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapInputNewWalletNameRightPanelForm.ui.qml +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapInputNewWalletNameRightPanelForm.ui.qml @@ -16,16 +16,16 @@ DapAbstractRightPanel anchors.topMargin: 12 * pt anchors.bottomMargin: 12 * pt spacing: 12 * pt - - Item + + Item { id: itemButtonClose data: dapButtonClose height: dapButtonClose.height width: dapButtonClose.width } - - Text + + Text { id: textHeader text: qsTr("New wallet") @@ -33,8 +33,8 @@ DapAbstractRightPanel color: "#3E3853" } } - - dapContentItemData: + + dapContentItemData: Rectangle { anchors.fill: parent @@ -50,7 +50,7 @@ DapAbstractRightPanel anchors.bottomMargin: 8 * pt color: "#757184" height: 30 * pt - Text + Text { id: textNameWallet color: "#ffffff" @@ -66,7 +66,7 @@ DapAbstractRightPanel } } - Rectangle + Rectangle { id: frameInputNameWallet height: 68 * pt @@ -103,8 +103,8 @@ DapAbstractRightPanel } } } - - Rectangle + + Rectangle { id: frameChooseSignatureType anchors.top: frameInputNameWallet.bottom @@ -112,7 +112,7 @@ DapAbstractRightPanel anchors.left: parent.left color: "#757184" height: 30 * pt - Text + Text { id: textChooseSignatureType color: "#ffffff" @@ -324,8 +324,3 @@ DapAbstractRightPanel } } } - -/*##^## Designer { - D{i:0;autoSize:true;height:480;width:640} -} - ##^##*/ diff --git a/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapRecoveryWalletRightPanelForm.ui.qml b/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapRecoveryWalletRightPanelForm.ui.qml index eb1524ce02e9a3f445ba9d61438d7e9b46e66cb5..41f1353848fdf764df1ea029a26d282dff7dead9 100644 --- a/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapRecoveryWalletRightPanelForm.ui.qml +++ b/CellFrameDashboardGUI/screen/desktop/Dashboard/RightPanel/DapRecoveryWalletRightPanelForm.ui.qml @@ -1,7 +1,303 @@ import QtQuick 2.4 +import QtQuick.Layouts 1.3 +import "qrc:/widgets" import "../../../" DapAbstractRightPanel { + dapButtonClose.normalImageButton: "qrc:/res/icons/back_icon.png" + dapButtonClose.hoverImageButton: "qrc:/res/icons/back_icon_hover.png" + + dapHeaderData: + Rectangle + { + id: frameHeaderItem + anchors.fill: parent + height: parent.height + color: "transparent" + Rectangle + { + anchors.fill: parent + anchors.leftMargin: 16 * pt + anchors.rightMargin: 16 * pt + anchors.topMargin: 12 * pt + anchors.bottomMargin: 12 * pt + color: "transparent" + + Item + { + id: itemButtonBack + data: dapButtonClose + height: dapButtonClose.height + width: dapButtonClose.width + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + } + + Text + { + id: textHeader + text: qsTr("New wallet") + font.pixelSize: 14 * pt + color: "#3E3853" + anchors.left: itemButtonBack.right + anchors.leftMargin: 12 * pt + anchors.verticalCenter: parent.verticalCenter + } + } + + Rectangle + { + id: bottomBorder + height: 1 * pt + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + color: "#757184" + } + } + + dapContentItemData: + Rectangle + { + anchors.fill: parent + color: "transparent" + Rectangle + { + id: frameMethod + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.bottomMargin: 8 * pt + color: "#757184" + height: 30 * pt + Text + { + id: textMethod + color: "#ffffff" + text: qsTr("24 words") + font.pixelSize: 12 * pt + horizontalAlignment: Text.AlignLeft + font.family: "Roboto" + font.styleName: "Normal" + font.weight: Font.Normal + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 16 * pt + } + } + + Text + { + id: textTopMessage + anchors.left: parent.left + anchors.right: parent.right + anchors.top: frameMethod.bottom + anchors.topMargin: 24 * pt + anchors.leftMargin: 16 * pt + anchors.rightMargin: 16 * pt + anchors.bottomMargin: 24 * pt + 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") + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + color: "#FF0300" + font + { + family: "Roboto" + styleName: "Normal" + weight: Font.Normal + pixelSize: 14 * pt + } + } + + Rectangle + { + id: frameRecoveryWords + anchors.top: textTopMessage.bottom + anchors.topMargin: 24 * pt + anchors.right: parent.right + anchors.left: parent.left + anchors.leftMargin: 16 * pt + anchors.rightMargin: 16 * pt + color: "transparent" + height: 250 * pt + + ListModel + { + id: modelRecoveryWords + 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 + { + id: rowListView + spacing: 60 * pt + anchors.fill: parent + height: frameRecoveryWords.height + ListView + { + id: firstListViewRecoveryWords + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + height: frameRecoveryWords.height + width: 50 * pt + model: modelRecoveryWords + delegate: + Text + { + text: word + color: "#070023" + anchors.horizontalCenter: parent.horizontalCenter + font + { + pixelSize: 16 * pt + family: "Roboto" + styleName: "Normal" + weight: Font.Normal + } + } + } + + ListView + { + id: lastListViewRecoveryWords + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + height: frameRecoveryWords.height + width: 50 * pt + model: modelRecoveryWords + delegate: + Text + { + text: word + color: "#070023" + anchors.horizontalCenter: parent.horizontalCenter + font + { + pixelSize: 16 * pt + family: "Roboto" + styleName: "Normal" + weight: Font.Normal + } + } + } + } + } + + Text + { + id: textBottomMessage + anchors.top: frameRecoveryWords.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.topMargin: 24 * pt + anchors.leftMargin: 16 * pt + anchors.rightMargin: 16 * pt + color: "#6F9F00" + font.pixelSize: 14 * pt + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + + RowLayout + { + id: rowButtons + height: 44 * pt + anchors.top: textBottomMessage.bottom + anchors.topMargin: 24 * pt + anchors.left: parent.left + anchors.right: parent.right + Layout.columnSpan: 2 + + DapButton + { + id: nextButton + heightButton: 44 * pt + widthButton: 130 * pt + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + textButton: qsTr("Next") + existenceImage: false + horizontalAligmentText: Text.AlignHCenter + indentTextRight: 0 + fontButton.pixelSize: 18 * pt + colorBackgroundButton: "#3E3853" + } + + DapButton + { + id: copyButton + heightButton: 44 * pt + widthButton: 130 * pt + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + checkable: true + textButton: qsTr("Copy") + existenceImage: false + horizontalAligmentText: Text.AlignHCenter + indentTextRight: 0 + fontButton.pixelSize: 18 * pt + colorBackgroundButton: copyButton.checked ? "#EDEFF2" : "#3E3853" + colorTextButton: copyButton.checked ? "#3E3853" : "#FFFFFF" + + onClicked: textBottomMessage.text = qsTr("Recovery words copied to clipboard. Keep them in a\nsafe place before proceeding to the next step.") + } + } + + Rectangle + { + id: frameMethodData + height: 124 * pt + color: "transparent" + anchors.top: rowButtons.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 16 * pt + anchors.rightMargin: 16 * pt + } + } } diff --git a/CellFrameDashboardGUI/screen/desktop/Settings/DapSettingsScreen.qml b/CellFrameDashboardGUI/screen/desktop/Settings/DapSettingsScreen.qml index 12dcfa012d2e5e7b74e9bd3d45618e0ab7e92715..60f961bc4483e144d6247e96e7f3c9836c657c88 100644 --- a/CellFrameDashboardGUI/screen/desktop/Settings/DapSettingsScreen.qml +++ b/CellFrameDashboardGUI/screen/desktop/Settings/DapSettingsScreen.qml @@ -74,7 +74,7 @@ DapSettingsScreenForm Rectangle { id: itemVPN - height: vpnHeader.height + textH.height + height: vpnHeader.height width: dapListViewSettings.width color: "blue" // Header diff --git a/libCellFrameDashboardCommon/Handlers/DapAddWalletCommand.cpp b/libCellFrameDashboardCommon/Handlers/DapAddWalletCommand.cpp index 9621391163199f9d5c0940f829c141a73f33e0c2..2f7e93edd2a45bd7eee451430c5ac2bf3e30caea 100644 --- a/libCellFrameDashboardCommon/Handlers/DapAddWalletCommand.cpp +++ b/libCellFrameDashboardCommon/Handlers/DapAddWalletCommand.cpp @@ -50,6 +50,15 @@ QVariant DapAddWalletCommand::respondToClient(const QVariant &arg1, const QVaria Q_UNUSED(arg8) Q_UNUSED(arg9) Q_UNUSED(arg10) - - return 5; + + QByteArray result; + QProcess process; + process.start(QString("%1 wallet new -w %2").arg(CLI_PATH).arg(arg1.toString())); + process.waitForFinished(-1); + result = process.readAll(); + QStringList res = QString::fromLatin1(result).split(" "); + QStringList list; + list.append(arg1.toString()); + list.append(res.at(res.size()-1).trimmed()); + return result.isEmpty() ? QStringList() : list; } diff --git a/libCellFrameDashboardCommon/Handlers/DapAddWalletCommand.h b/libCellFrameDashboardCommon/Handlers/DapAddWalletCommand.h index 6fa07f9516d7e5185ec5f1924e30eaedc4e0b442..81ad8b8bd36195882319b0e2f41a154f2eeb6c66 100644 --- a/libCellFrameDashboardCommon/Handlers/DapAddWalletCommand.h +++ b/libCellFrameDashboardCommon/Handlers/DapAddWalletCommand.h @@ -9,6 +9,9 @@ #ifndef DAPADDWALLETCOMMAND_H #define DAPADDWALLETCOMMAND_H +#include <QProcess> +#include <QString> + #include "DapAbstractCommand.h" class DapAddWalletCommand : public DapAbstractCommand