Commit 5cd52f90 authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Fix 2FA support (password input step dialog)

parent 98aa8c4d
......@@ -231,6 +231,68 @@ Page {
}
}
}
Item {
id: tabPassword;
enabled: (TD_Global.authorizationState && TD_Global.authorizationState.typeOf === TD_ObjectType.AUTHORIZATION_STATE_WAIT_PASSWORD);
opacity: (enabled ? 1.0 : 0.0);
anchors.fill: parent;
PageHeader {
id: headerPassword;
title: qsTr ("2FA");
ExtraAnchors.topDock: parent;
}
ColumnContainer {
spacing: Theme.paddingLarge;
anchors {
top: headerPassword.bottom;
margins: Theme.paddingLarge;
}
ExtraAnchors.horizontalFill: parent;
LabelFixed {
text: qsTr ("Enter your password :");
color: Theme.highlightColor;
wrapMode: Text.WrapAtWordBoundaryOrAnywhere;
font.family: Theme.fontFamilyHeading;
ExtraAnchors.horizontalFill: parent;
}
TextField {
id: inputPassword2FA;
echoMode: TextInput.Password;
placeholderText: qsTr ("Password");
ExtraAnchors.horizontalFill: parent;
}
MouseArea {
id: btnPassword;
opacity: (enabled ? 1.0 : 0.35);
enabled: (inputPassword2FA.text !== "");
implicitWidth: (lblPassword.width + lblPassword.anchors.margins * 2);
implicitHeight: (lblPassword.height + lblPassword.anchors.margins * 2);
anchors.horizontalCenter: parent.horizontalCenter;
onClicked: {
TD_Global.send ({
"@type" : "checkAuthenticationPassword",
"password" : inputPassword2FA.text.trim (),
});
}
Rectangle {
color: Theme.rgba ((parent.pressed ? Theme.highlightColor : Theme.primaryColor), 0.15);
radius: Theme.paddingSmall;
anchors.fill: parent;
}
LabelFixed {
id: lblPassword;
text: qsTr ("Unlock");
anchors {
centerIn: parent;
margins: Theme.paddingLarge;
}
}
}
}
}
Item {
id: tabConverstations;
enabled: (TD_Global.authorizationState && TD_Global.authorizationState.typeOf === TD_ObjectType.AUTHORIZATION_STATE_READY);
......
......@@ -18,6 +18,7 @@ QtTdLibObjectType::Type QtTdLibEnums::objectTypeEnumFromString (const QString &
{ "authorizationStateReady", QtTdLibObjectType::AUTHORIZATION_STATE_READY },
{ "authorizationStateWaitCode", QtTdLibObjectType::AUTHORIZATION_STATE_WAIT_CODE },
{ "authorizationStateWaitEncryptionKey", QtTdLibObjectType::AUTHORIZATION_STATE_WAIT_ENCRYPTION_KEY },
{ "authorizationStateWaitPassword", QtTdLibObjectType::AUTHORIZATION_STATE_WAIT_PASSWORD },
{ "authorizationStateWaitPhoneNumber", QtTdLibObjectType::AUTHORIZATION_STATE_WAIT_PHONE_NUMBER },
{ "authorizationStateWaitTdlibParameters", QtTdLibObjectType::AUTHORIZATION_STATE_WAIT_TDLIB_PARAMETERS },
{ "basicGroup", QtTdLibObjectType::BASIC_GROUP },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment