mirror of
https://github.com/overte-org/overte.git
synced 2025-07-24 09:23:49 +02:00
more logic framework
This commit is contained in:
parent
84f9bff330
commit
09091d29f7
2 changed files with 25 additions and 8 deletions
|
@ -730,6 +730,13 @@ Rectangle {
|
||||||
WalletChoice {
|
WalletChoice {
|
||||||
visible: (root.activeView === "preexisting") || (root.activeView === "conflicting");
|
visible: (root.activeView === "preexisting") || (root.activeView === "conflicting");
|
||||||
activeView: root.activeView;
|
activeView: root.activeView;
|
||||||
|
proceedFunction: function (isReset) {
|
||||||
|
console.log(isReset ? "Reset wallet." : "Trying again with new wallet.");
|
||||||
|
if (isReset) {
|
||||||
|
root.activeView = "initialize";
|
||||||
|
Commerce.getWalletStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
anchors {
|
anchors {
|
||||||
top: titleBarContainer.bottom;
|
top: titleBarContainer.bottom;
|
||||||
|
|
|
@ -20,6 +20,7 @@ import "../../../controls-uit" as HifiControlsUit
|
||||||
Column {
|
Column {
|
||||||
property string activeView: "conflict";
|
property string activeView: "conflict";
|
||||||
property bool isMissing: activeView === "preeexisting";
|
property bool isMissing: activeView === "preeexisting";
|
||||||
|
property var proceedFunction: nil;
|
||||||
RalewayBold {
|
RalewayBold {
|
||||||
text: isMissing
|
text: isMissing
|
||||||
? "Where are your private keys?"
|
? "Where are your private keys?"
|
||||||
|
@ -45,26 +46,35 @@ Column {
|
||||||
color: hifi.buttons.blue;
|
color: hifi.buttons.blue;
|
||||||
colorScheme: hifi.colorSchemes.dark;
|
colorScheme: hifi.colorSchemes.dark;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("FIXME CREATE");
|
console.log("FIXME open modal that says Are you sure, where the yes button calls proceed directly instead of this next line.")
|
||||||
|
proceed(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
text: "What's this?";
|
text: "What's this?";
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFileOpenChanged(filename) {
|
function onFileOpenChanged(filename) {
|
||||||
console.log('fixme selected', filename);
|
|
||||||
// disconnect the event, otherwise the requests will stack up
|
// disconnect the event, otherwise the requests will stack up
|
||||||
try {
|
try { // Not all calls to onFileOpenChanged() connect an event.
|
||||||
// Not all calls to onFileOpenChanged() connect an event.
|
|
||||||
Window.browseChanged.disconnect(onFileOpenChanged);
|
Window.browseChanged.disconnect(onFileOpenChanged);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('ignoring', e);
|
console.log('WalletChoice.qml ignoring', e);
|
||||||
}
|
}
|
||||||
console.log('fixme do something with', filename);
|
if (filename) {
|
||||||
|
console.log("FIXME copy file to the right place");
|
||||||
|
proceed(false);
|
||||||
|
} // Else we're still at WalletChoice
|
||||||
}
|
}
|
||||||
function walletChooser() {
|
function walletChooser() {
|
||||||
console.log("GOT CLICK");
|
|
||||||
Window.browseChanged.connect(onFileOpenChanged);
|
Window.browseChanged.connect(onFileOpenChanged);
|
||||||
Window.browseAsync("Choose wallet file", "", "*.hifikey");
|
Window.browseAsync("Locate your .hifikey file", "", "*.hifikey");
|
||||||
|
}
|
||||||
|
function proceed(isReset) {
|
||||||
|
if (!proceedFunction) {
|
||||||
|
console.log("Provide a function of no arguments to WalletChoice.qml.");
|
||||||
|
} else {
|
||||||
|
proceedFunction(isReset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue