diff --git a/bitmonero.pro.user b/bitmonero.pro.user index 7b75f718..cffb0d85 100644 --- a/bitmonero.pro.user +++ b/bitmonero.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/components/TitleBar.qml b/components/TitleBar.qml index 535a4113..3cd0d8ed 100644 --- a/components/TitleBar.qml +++ b/components/TitleBar.qml @@ -10,6 +10,7 @@ Rectangle { property string walletName: "Donations" property bool containsMouse: false property alias maximizeButtonVisible: maximizeButton.visible + property alias basicButtonVisible: goToBasicVersionButton.visible signal goToBasicVersion(bool yes) Text { diff --git a/images/createWallet.png b/images/createWallet.png new file mode 100644 index 00000000..560e7e73 Binary files /dev/null and b/images/createWallet.png differ diff --git a/images/nextPage.png b/images/nextPage.png new file mode 100644 index 00000000..e79463b3 Binary files /dev/null and b/images/nextPage.png differ diff --git a/images/openAccount.png b/images/openAccount.png new file mode 100644 index 00000000..1232fc83 Binary files /dev/null and b/images/openAccount.png differ diff --git a/images/prevPage.png b/images/prevPage.png new file mode 100644 index 00000000..636cfa25 Binary files /dev/null and b/images/prevPage.png differ diff --git a/images/recoverWallet.png b/images/recoverWallet.png new file mode 100644 index 00000000..78ceaeb9 Binary files /dev/null and b/images/recoverWallet.png differ diff --git a/lang/flags/bangladesh.png b/lang/flags/bangladesh.png new file mode 100644 index 00000000..099b7eee Binary files /dev/null and b/lang/flags/bangladesh.png differ diff --git a/lang/flags/brazil.png b/lang/flags/brazil.png new file mode 100644 index 00000000..baa62b9d Binary files /dev/null and b/lang/flags/brazil.png differ diff --git a/lang/flags/china.png b/lang/flags/china.png new file mode 100644 index 00000000..5f3c6fc8 Binary files /dev/null and b/lang/flags/china.png differ diff --git a/lang/flags/german.png b/lang/flags/german.png new file mode 100644 index 00000000..7756bf59 Binary files /dev/null and b/lang/flags/german.png differ diff --git a/lang/flags/india.png b/lang/flags/india.png new file mode 100644 index 00000000..bf27a173 Binary files /dev/null and b/lang/flags/india.png differ diff --git a/lang/flags/palestine.png b/lang/flags/palestine.png new file mode 100644 index 00000000..78f5b1d4 Binary files /dev/null and b/lang/flags/palestine.png differ diff --git a/lang/flags/rpa.png b/lang/flags/rpa.png new file mode 100644 index 00000000..61de692d Binary files /dev/null and b/lang/flags/rpa.png differ diff --git a/lang/flags/russia.png b/lang/flags/russia.png new file mode 100644 index 00000000..905e6bab Binary files /dev/null and b/lang/flags/russia.png differ diff --git a/lang/flags/uk.png b/lang/flags/uk.png new file mode 100644 index 00000000..cb68609c Binary files /dev/null and b/lang/flags/uk.png differ diff --git a/lang/flags/usa.png b/lang/flags/usa.png new file mode 100644 index 00000000..fd501324 Binary files /dev/null and b/lang/flags/usa.png differ diff --git a/lang/languages.xml b/lang/languages.xml new file mode 100644 index 00000000..eacfcad5 --- /dev/null +++ b/lang/languages.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/main.cpp b/main.cpp index 38776326..122ea561 100644 --- a/main.cpp +++ b/main.cpp @@ -13,6 +13,7 @@ int main(int argc, char *argv[]) qmlRegisterType("moneroComponents", 1, 0, "Clipboard"); QQmlApplicationEngine engine; + engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath()); engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); QObject *rootObject = engine.rootObjects().first(); diff --git a/main.qml b/main.qml index bedcea4d..42df18b7 100644 --- a/main.qml +++ b/main.qml @@ -3,6 +3,7 @@ import QtQuick.Window 2.0 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 import "components" +import "wizard" ApplicationWindow { id: appWindow @@ -98,6 +99,26 @@ ApplicationWindow { anchors.fill: parent clip: true + state: "wizard" + states: [ + State { + name: "wizard" + PropertyChanges { target: leftPanel; visible: false } + PropertyChanges { target: rightPanel; visible: false } + PropertyChanges { target: middlePanel; visible: false } + PropertyChanges { target: titleBar; basicButtonVisible: false } + PropertyChanges { target: wizard; visible: true } + }, + State { + name: "normal" + PropertyChanges { target: leftPanel; visible: true } + PropertyChanges { target: rightPanel; visible: true } + PropertyChanges { target: middlePanel; visible: true } + PropertyChanges { target: titleBar; basicButtonVisible: true } + PropertyChanges { target: wizard; visible: false } + } + ] + LeftPanel { id: leftPanel anchors.left: parent.left @@ -261,6 +282,11 @@ ApplicationWindow { } } + WizardMain { + id: wizard + anchors.fill: parent + } + property int maxWidth: leftPanel.width + 655 + rightPanel.width property int maxHeight: 700 MouseArea { diff --git a/qml.qrc b/qml.qrc index bc40ee0d..03ff35e1 100644 --- a/qml.qrc +++ b/qml.qrc @@ -80,5 +80,14 @@ images/checkedVioletIcon.png images/resize.png images/resizeHovered.png + wizard/WizardWelcome.qml + wizard/WizardMain.qml + images/nextPage.png + images/prevPage.png + wizard/WizardOptions.qml + images/createWallet.png + images/openAccount.png + images/recoverWallet.png + wizard/WizardCreateWallet.qml diff --git a/wizard/WizardCreateWallet.qml b/wizard/WizardCreateWallet.qml new file mode 100644 index 00000000..5ce37a96 --- /dev/null +++ b/wizard/WizardCreateWallet.qml @@ -0,0 +1,5 @@ +import QtQuick 2.2 + +Item { + +} diff --git a/wizard/WizardMain.qml b/wizard/WizardMain.qml new file mode 100644 index 00000000..9c523ac0 --- /dev/null +++ b/wizard/WizardMain.qml @@ -0,0 +1,96 @@ +import QtQuick 2.2 + +Rectangle { + id: wizard + border.color: "#DBDBDB" + border.width: 1 + color: "#FFFFFF" + + Rectangle { + id: nextButton + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 50 + + width: 50; height: 50 + radius: 25 + color: nextArea.containsMouse ? "#FF4304" : "#FF6C3C" + + Image { + anchors.centerIn: parent + anchors.horizontalCenterOffset: 3 + source: "qrc:///images/nextPage.png" + } + + MouseArea { + id: nextArea + anchors.fill: parent + hoverEnabled: true + onClicked: wizard.switchPage(true) + } + } + + property int currentPage: 0 + function switchPage(next) { + var pages = new Array() + pages[0] = welcomePage + pages[1] = optionsPage + + if(next === false) { + if(currentPage > 0) { + pages[currentPage].opacity = 0 + pages[--currentPage].opacity = 1 + } + } else { + if(currentPage < pages.length - 1) { + pages[currentPage].opacity = 0 + pages[++currentPage].opacity = 1 + } + } + } + + WizardWelcome { + id: welcomePage + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: nextButton.left + anchors.left: prevButton.right + anchors.leftMargin: 50 + anchors.rightMargin: 50 + } + + WizardOptions { + id: optionsPage + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: nextButton.left + anchors.left: prevButton.right + anchors.leftMargin: 50 + anchors.rightMargin: 50 + } + + Rectangle { + id: prevButton + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 50 + visible: parent.currentPage > 0 + + width: 50; height: 50 + radius: 25 + color: prevArea.containsMouse ? "#FF4304" : "#FF6C3C" + + Image { + anchors.centerIn: parent + anchors.horizontalCenterOffset: -3 + source: "qrc:///images/prevPage.png" + } + + MouseArea { + id: prevArea + anchors.fill: parent + hoverEnabled: true + onClicked: wizard.switchPage(false) + } + } +} diff --git a/wizard/WizardOptions.qml b/wizard/WizardOptions.qml new file mode 100644 index 00000000..90fbd93d --- /dev/null +++ b/wizard/WizardOptions.qml @@ -0,0 +1,131 @@ +import QtQuick 2.2 + +Item { + opacity: 0 + visible: false + Behavior on opacity { + NumberAnimation { duration: 100; easing.type: Easing.InQuad } + } + + onOpacityChanged: visible = opacity !== 0 + + Column { + id: headerColumn + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.topMargin: 74 + spacing: 24 + + Text { + font.family: "Arial" + font.pixelSize: 28 + //renderType: Text.NativeRendering + color: "#3F3F3F" + text: qsTr("I want") + } + + Text { + font.family: "Arial" + font.pixelSize: 18 + //renderType: Text.NativeRendering + color: "#4A4646" + text: qsTr("Please select one of the following options:") + } + } + + Row { + anchors.centerIn: parent + spacing: 50 + + Column { + anchors.verticalCenter: parent.verticalCenter + spacing: 30 + + Rectangle { + width: 202; height: 202 + radius: 101 + color: createWalletArea.containsMouse ? "#DBDBDB" : "#FFFFFF" + + Image { + anchors.centerIn: parent + source: "qrc:///images/createWallet.png" + } + + MouseArea { + id: createWalletArea + anchors.fill: parent + hoverEnabled: true + } + } + + Text { + font.family: "Arial" + font.pixelSize: 16 + color: "#4A4949" + horizontalAlignment: Text.AlignHCenter + text: qsTr("This is my first time, I want to
create a new account") + } + } + + Column { + anchors.verticalCenter: parent.verticalCenter + spacing: 30 + + Rectangle { + width: 202; height: 202 + radius: 101 + color: recoverWalletArea.containsMouse ? "#DBDBDB" : "#FFFFFF" + + Image { + anchors.centerIn: parent + source: "qrc:///images/recoverWallet.png" + } + + MouseArea { + id: recoverWalletArea + anchors.fill: parent + hoverEnabled: true + } + } + + Text { + font.family: "Arial" + font.pixelSize: 16 + color: "#4A4949" + horizontalAlignment: Text.AlignHCenter + text: qsTr("I want to recover my account
from my 24 work seed") + } + } + + Column { + anchors.verticalCenter: parent.verticalCenter + spacing: 30 + + Rectangle { + width: 202; height: 202 + radius: 101 + color: openAccountArea.containsMouse ? "#DBDBDB" : "#FFFFFF" + + Image { + anchors.centerIn: parent + source: "qrc:///images/openAccount.png" + } + + MouseArea { + id: openAccountArea + anchors.fill: parent + hoverEnabled: true + } + } + + Text { + font.family: "Arial" + font.pixelSize: 16 + color: "#4A4949" + horizontalAlignment: Text.AlignHCenter + text: qsTr("I want to open account file") + } + } + } +} diff --git a/wizard/WizardWelcome.qml b/wizard/WizardWelcome.qml new file mode 100644 index 00000000..5ddbfe5c --- /dev/null +++ b/wizard/WizardWelcome.qml @@ -0,0 +1,102 @@ +import QtQuick 2.2 +import QtQuick.XmlListModel 2.0 + +Item { + Behavior on opacity { + NumberAnimation { duration: 100; easing.type: Easing.InQuad } + } + + onOpacityChanged: visible = opacity !== 0 + + Column { + id: headerColumn + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.topMargin: 74 + spacing: 24 + + Text { + font.family: "Arial" + font.pixelSize: 28 + //renderType: Text.NativeRendering + color: "#3F3F3F" + text: qsTr("Welcome") + } + + Text { + font.family: "Arial" + font.pixelSize: 18 + //renderType: Text.NativeRendering + color: "#4A4646" + text: qsTr("Please choose a language and regional format.") + } + } + + XmlListModel { + id: languagesModel + source: "file:///" + applicationDirectory + "/lang/languages.xml" + query: "/languages/language" + + XmlRole { name: "name"; query: "@name/string()" } + XmlRole { name: "flag"; query: "@flag/string()" } + XmlRole { name: "isCurrent"; query: "@enabled/string()" } + } + + ListView { + id: listView + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.top: headerColumn.bottom + anchors.topMargin: 24 + clip: true + + model: languagesModel + delegate: Item { + width: listView.width + height: 80 + + Rectangle { + id: flagRect + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + width: 60; height: 60 + radius: 30 + color: listView.currentIndex === index ? "#DBDBDB" : "#FFFFFF" + + Image { + anchors.centerIn: parent + source: "file:///" + applicationDirectory + flag + } + } + + Text { + anchors.verticalCenter: parent.verticalCenter + anchors.left: flagRect.right + anchors.right: parent.right + anchors.leftMargin: 16 + font.family: "Arial" + font.pixelSize: 24 + font.bold: listView.currentIndex === index + elide: Text.ElideRight + color: "#3F3F3F" + text: name + } + + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: 1 + color: "#DBDBDB" + } + + MouseArea { + id: delegateArea + anchors.fill: parent + onClicked: listView.currentIndex = index + } + } + } +}