Skip to content

Commit

Permalink
Merge pull request #3
Browse files Browse the repository at this point in the history
3cfa176 Hiding "next" button on the final page (Ilya Kitaev)
63e4d19 Save settings for each wizard page in "wizard.settings" object and diplay overview at the last page (Ilya Kitaev)
78b5565 password page: checking if passwords match. merged "configuration" and "donation" pages into one (Ilya Kitaev)
29f3abd Copy lang files to the output directory at the "build" step (Ilya Kitaev)
965a875 WizardWelcome: ListView replaced with GridView (Ilya Kitaev)
  • Loading branch information
fluffypony committed Jan 27, 2016
2 parents 04302ec + 3cfa176 commit d546bac
Show file tree
Hide file tree
Showing 10 changed files with 198 additions and 135 deletions.
21 changes: 18 additions & 3 deletions monero-core.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@ TEMPLATE = app

QT += qml quick widgets

HEADERS += \
filter.h \
clipboardAdapter.h


SOURCES += main.cpp \
filter.cpp \
clipboardAdapter.cpp

CONFIG(release, debug|release) {
DESTDIR=release
}

CONFIG(debug, debug|release) {
DESTDIR=debug
}


RESOURCES += qml.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
Expand All @@ -14,6 +28,7 @@ QML_IMPORT_PATH =
# Default rules for deployment.
include(deployment.pri)

HEADERS += \
filter.h \
clipboardAdapter.h
# copy language files (xml and images) to the output directory
copydata.commands = $(COPY_DIR) $$shell_path($$PWD/lang) $$shell_path($$DESTDIR/lang)
QMAKE_EXTRA_TARGETS += copydata
POST_TARGETDEPS += copydata
1 change: 1 addition & 0 deletions qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@
<file>wizard/WizardConfigure.qml</file>
<file>wizard/WizardDonation.qml</file>
<file>wizard/WizardFinish.qml</file>
<file>wizard/WizardPasswordInput.qml</file>
</qresource>
</RCC>
7 changes: 7 additions & 0 deletions wizard/WizardCreateWallet.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ Item {

onOpacityChanged: visible = opacity !== 0

function saveSettings(settingsObject) {
settingsObject['account_name'] = accountName.text
settingsObject['words'] = wordsText.text
settingsObject['wallet_path'] = fileUrlInput.text
}

Row {
id: dotsRow
anchors.top: parent.top
Expand Down Expand Up @@ -106,6 +112,7 @@ Item {
height: 62

TextInput {
id: accountName
anchors.fill: parent
horizontalAlignment: TextInput.AlignHCenter
verticalAlignment: TextInput.AlignVCenter
Expand Down
37 changes: 37 additions & 0 deletions wizard/WizardDonation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Item {

onOpacityChanged: visible = opacity !== 0

function saveSettings(settingsObject) {
settingsObject['auto_donations_enabled'] = enableAutoDonationCheckBox.checked;
settingsObject['auto_donations_amount'] = autoDonationAmountText.text;
settingsObject['allow_background_mining'] = allowBackgroundMiningCheckBox.checked;
}

Row {
id: dotsRow
anchors.top: parent.top
Expand Down Expand Up @@ -94,6 +100,7 @@ Item {
spacing: 2

CheckBox {
id: enableAutoDonationCheckBox
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Enable auto-donations of?")
background: "#F0EEEE"
Expand All @@ -110,6 +117,7 @@ Item {
width: 41

TextInput {
id: autoDonationAmountText
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
Expand Down Expand Up @@ -149,5 +157,34 @@ Item {
"as a percentage of that fee, to your transaction to support Monero development. For instance, a 50% " +
"autodonation take a transaction fee of 0.005 XMR and add a 0.0025 XMR to support Monero development.")
}
Column {
anchors.left: parent.left
anchors.right: parent.right
spacing: 12

CheckBox {
id: allowBackgroundMiningCheckBox
text: qsTr("Allow background mining?")
anchors.left: parent.left
anchors.right: parent.right
background: "#F0EEEE"
fontColor: "#4A4646"
fontSize: 18
checkedIcon: "../images/checkedVioletIcon.png"
uncheckedIcon: "../images/uncheckedIcon.png"
checked: true
}

Text {
anchors.left: parent.left
anchors.right: parent.right
font.family: "Arial"
font.pixelSize: 15
color: "#4A4646"
wrapMode: Text.Wrap
text: qsTr("Mining secures the Monero network, and also pays a small reward for the work done. This option " +
"will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working.")
}
}
}
}
19 changes: 18 additions & 1 deletion wizard/WizardFinish.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ Item {

onOpacityChanged: visible = opacity !== 0

function buildSettingsString() {
var str = "<br>" + qsTr("<b>Language:</b> ") + wizard.settings['language'] + "<br>"
+ qsTr("<b>Account name:</b> ") + wizard.settings['account_name'] + "<br>"
+ qsTr("<b>Words:</b> ") + wizard.settings['words'] + "<br>"
+ qsTr("<b>Wallet Path: </b>") + wizard.settings['wallet_path'] + "<br>"
+ qsTr("<b>Enable auto donation: </b>") + wizard.settings['auto_donations_enabled'] + "<br>"
+ qsTr("<b>Auto donation amount: </b>") + wizard.settings['auto_donations_amount'] + "<br>"
+ qsTr("<b>Allow background mining: </b>") + wizard.settings['allow_background_mining'] + "<br>"
return str;
}
function updateSettingsSummary() {
settingsText.text = qsTr("An overview of your Monero configuration is below:")
+ "<br>"
+ buildSettingsString();
}

Row {
id: dotsRow
anchors.top: parent.top
Expand Down Expand Up @@ -84,14 +100,15 @@ Item {
}

Text {
id: settingsText
anchors.left: parent.left
anchors.right: parent.right
font.family: "Arial"
font.pixelSize: 18
wrapMode: Text.Wrap
textFormat: Text.RichText
//renderType: Text.NativeRendering
color: "#4A4646"
text: qsTr("An overview of your Monero configuration is below:")
}
}
}
74 changes: 41 additions & 33 deletions wizard/WizardMain.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,50 @@ import "../components"

Rectangle {
id: wizard
property alias nextButton : nextButton
property var settings : ({})
property int currentPage: 0
property var pages: [welcomePage, optionsPage, createWalletPage, passwordPage, /*configurePage,*/ donationPage, finishPage ]

signal useMoneroClicked()
border.color: "#DBDBDB"
border.width: 1
color: "#FFFFFF"

function switchPage(next) {

// save settings for current page;
if (typeof pages[currentPage].saveSettings !== 'undefined') {
pages[currentPage].saveSettings(settings);
}

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
}
}

// disallow "next" button until passwords match
if (pages[currentPage] === passwordPage) {
nextButton.visible = passwordPage.passwordValid
}

// display settings summary
if (pages[currentPage] === finishPage) {
finishPage.updateSettingsSummary();
nextButton.visible = false
} else {
nextButton.visible = true
}
}


Rectangle {
id: nextButton
anchors.verticalCenter: parent.verticalCenter
Expand All @@ -61,29 +100,8 @@ Rectangle {
}
}

property int currentPage: 0
function switchPage(next) {
var pages = new Array()
pages[0] = welcomePage
pages[1] = optionsPage
pages[2] = createWalletPage
pages[3] = passwordPage
pages[4] = configurePage
pages[5] = donationPage
pages[6] = finishPage

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
Expand Down Expand Up @@ -126,16 +144,6 @@ Rectangle {
anchors.rightMargin: 50
}

WizardConfigure {
id: configurePage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
}

WizardDonation {
id: donationPage
anchors.top: parent.top
Expand Down Expand Up @@ -192,7 +200,7 @@ Rectangle {
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
visible: parent.currentPage === 6
visible: parent.pages[currentPage] === finishPage
onClicked: wizard.useMoneroClicked()
}
}
30 changes: 0 additions & 30 deletions wizard/WizardOptions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -137,35 +137,5 @@ Item {
text: qsTr("I want to recover my account<br/>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")
}
}
}
}
Loading

0 comments on commit d546bac

Please sign in to comment.