Stefan 16b866ccbd chore(CPP): Enhance type safety using phantom types
Important changes:

- Converted the easy to mix strings to named types as phantom types
- Renamed `AccountDto`s to `MultiAccount` to better match the status-go
domain knowledge.
- Renamed MultiAccount to ChatOrWalletAccount to better match its multi
purpose and don't confuse with the MultiAccount domain knowledge.
- Remove libs/CMakeLists.txt

Note: Tried to use the fluent::NamedType but it doesn't work with
nlohmann_json, gave up finding why. Therefore I extracted only
the needed functionality for the simple types we use.

Updates: #6321
2022-07-19 16:56:06 +02:00

84 lines
1.9 KiB
QML

import QtQuick
import QtQuick.Controls
import Status.Onboarding
import "base"
SetupNewProfilePageBase {
id: root
TempTextInput {
id: confirmPasswordInput
width: 416
height: 44
anchors {
horizontalCenter: alignmentItem.horizontalCenter
verticalCenter: alignmentItem.verticalCenter
verticalCenterOffset: -baselineOffset
}
font.pointSize: 23
verticalAlignment: TextInput.AlignVCenter
}
Label {
id: errorLabel
anchors {
bottom: finalizeButton.top
horizontalCenter: finalizeButton.horizontalCenter
margins: 10
}
color: "red"
text: qsTr("Something went wrong")
visible: false
}
Button {
id: finalizeButton
text: qsTr("Finalize Status Password Creation")
anchors {
horizontalCenter: alignmentItem.horizontalCenter
top: alignmentItem.bottom
topMargin: 125
}
enabled: confirmPasswordInput.text === newAccountController.password
onClicked: {
// TODO have states to drive async creation
errorLabel.visible = false
finalizeButton.enabled = false
busyIndicatorMouseArea.cursorShape = Qt.BusyCursor
newAccountController.createAccount()
}
}
Connections {
target: newAccountController
function onAccountCreatedAndLoggedIn() {
busyIndicatorMouseArea.cursorShape = undefined
root.pageDone()
}
function onAccountCreationError() {
errorLabel.visible = true;
busyIndicatorMouseArea.cursorShape = undefined
}
}
MouseArea {
id: busyIndicatorMouseArea
anchors.fill: parent
acceptedButtons: Qt.NoButton
enabled: false
}
}