Add homeserver URL field to login screen
This commit is contained in:
parent
8113ba468d
commit
11486ab51d
4
TODO.md
4
TODO.md
|
@ -58,11 +58,11 @@
|
||||||
- Prevent others from having a too similar hue as us, or our own accounts
|
- Prevent others from having a too similar hue as us, or our own accounts
|
||||||
from sharing a too similar hue
|
from sharing a too similar hue
|
||||||
- Combine events so they take less space
|
- Combine events so they take less space
|
||||||
- After combining is implemented, no need to hide our own profile changes.
|
- After combining is implemented, no need to hide profile changes anymore.
|
||||||
- Replies
|
- Replies
|
||||||
- Messages editing
|
- Messages editing
|
||||||
- Code highlighting
|
- Code highlighting
|
||||||
- Support GIF avatars
|
- Support GIF avatars and images
|
||||||
- Adapt shortcuts flicking speed to font size and DPI
|
- Adapt shortcuts flicking speed to font size and DPI
|
||||||
|
|
||||||
- EditAccount page:
|
- EditAccount page:
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Backend:
|
||||||
user: str,
|
user: str,
|
||||||
password: str,
|
password: str,
|
||||||
device_id: Optional[str] = None,
|
device_id: Optional[str] = None,
|
||||||
homeserver: str = "https://matrix.org",
|
homeserver: str = "https://matrix.org",
|
||||||
) -> Tuple[bool, str]:
|
) -> Tuple[bool, str]:
|
||||||
|
|
||||||
client = MatrixClient(
|
client = MatrixClient(
|
||||||
|
|
|
@ -4,7 +4,8 @@ import "../Base"
|
||||||
|
|
||||||
HPage {
|
HPage {
|
||||||
property string loginWith: "username"
|
property string loginWith: "username"
|
||||||
readonly property bool canLogin: idField.text && passwordField.text
|
readonly property bool canLogin:
|
||||||
|
serverField.text && idField.text && passwordField.text
|
||||||
|
|
||||||
onFocusChanged: idField.forceActiveFocus()
|
onFocusChanged: idField.forceActiveFocus()
|
||||||
|
|
||||||
|
@ -27,7 +28,10 @@ HPage {
|
||||||
|
|
||||||
login: button => {
|
login: button => {
|
||||||
button.loading = true
|
button.loading = true
|
||||||
let args = [idField.text, passwordField.text]
|
let args = [
|
||||||
|
idField.text, passwordField.text,
|
||||||
|
undefined, serverField.text,
|
||||||
|
]
|
||||||
|
|
||||||
py.callCoro("login_client", args, ([success, data]) => {
|
py.callCoro("login_client", args, ([success, data]) => {
|
||||||
if (! success) {
|
if (! success) {
|
||||||
|
@ -74,6 +78,14 @@ HPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HTextField {
|
||||||
|
id: serverField
|
||||||
|
placeholderText: qsTr("Homeserver URL")
|
||||||
|
text: "https://matrix.org"
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
HTextField {
|
HTextField {
|
||||||
id: idField
|
id: idField
|
||||||
placeholderText: qsTr(
|
placeholderText: qsTr(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user