Changed loginPage to Dialog

This commit is contained in:
Scharel Clemens 2020-08-22 15:48:35 +02:00
parent 2a47f51366
commit 0989216d90
5 changed files with 75 additions and 10 deletions

View file

@ -2,14 +2,20 @@ import QtQuick 2.2
import Sailfish.Silica 1.0
import Nemo.Configuration 1.0
Page {
id: loginPage
Dialog {
id: loginDialog
property string accountId
property bool legacyLoginPossible: false
property bool flowLoginV2Possible: false
onRejected: {
appSettings.removeAccount(accountId)
}
onAccepted: {
}
ConfigurationGroup {
id: account
path: "/apps/harbour-nextcloudnotes/accounts/" + accountId
@ -23,7 +29,7 @@ Page {
property bool allowUnecrypted: account.value("allowUnecrypted", false, Boolean)
Component.onCompleted: {
pageHeader.title = name
dialogHeader.title = name
serverField.text = server ? server : allowUnecrypted ? "http://" : "https://"
usernameField.text = username
passwordField.text = password
@ -52,7 +58,7 @@ Page {
if (notesApi.statusInstalled)
serverField.focus = false
else {
pageHeader.title
dialogHeader.title
}
}
onStatusVersionChanged: {
@ -75,11 +81,11 @@ Page {
}
onStatusVersionStringChanged: {
if (notesApi.statusVersionString)
pageHeader.description = "Nextcloud " + notesApi.statusVersionString
dialogHeader.description = "Nextcloud " + notesApi.statusVersionString
}
onStatusProductNameChanged: {
if (notesApi.statusProductName) {
pageHeader.title = notesApi.statusProductName
dialogHeader.title = notesApi.statusProductName
account.name = notesApi.statusProductName
}
}
@ -139,8 +145,8 @@ Page {
width: parent.width
spacing: Theme.paddingLarge
PageHeader {
id: pageHeader
DialogHeader {
id: dialogHeader
}
Image {
@ -148,7 +154,7 @@ Page {
anchors.horizontalCenter: parent.horizontalCenter
height: Theme.itemSizeHuge
fillMode: Image.PreserveAspectFit
source: "../img/nextcloud-logo-transparent.png"
source: Theme.colorScheme === Theme.DarkOnLight ? "../img/nextcloud-logo-dark.png" : "../img/nextcloud-logo-light.png"
}
ProgressBar {
@ -204,7 +210,7 @@ Page {
TextSwitch {
id: forceLegacyButton
visible: debug
visible: debug || !notesApi.statusInstalled
text: qsTr("Enforce legacy login")
onCheckedChanged: {
checked != checked

View file

@ -208,6 +208,26 @@ Page {
checked: appSettings.useCapitalX
onCheckedChanged: appSettings.useCapitalX = checked
}
SectionHeader {
text: qsTr("Reset")
}
Button {
text: qsTr("Reset app settings")
anchors.horizontalCenter: parent.horizontalCenter
RemorseItem { id: resetRemorse }
ConfigurationGroup {
id: appConfig
path: "/apps/harbour-nextcloudnotes"
}
onClicked: resetRemorse.execute(this, "Reset app", appConfig.clear())
}
LinkedLabel {
text: qsTr("Resetting the app wipes all application data from the device! This includes offline synced notes, app settings and accounts.")
x: Theme.horizontalPageMargin
width: parent.width - 2*x
}
}
VerticalScrollDecorator {}

View file

@ -516,6 +516,18 @@
<source>No sorting</source>
<translation>Keine Sortierung</translation>
</message>
<message>
<source>Reset</source>
<translation type="unfinished">Zurücksetzen</translation>
</message>
<message>
<source>Reset app settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Resetting the app wipes all application data from the device! This includes offline synced notes, app settings and accounts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SyntaxPage</name>

View file

@ -516,6 +516,18 @@
<source>No sorting</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reset</source>
<translation type="unfinished">Återställ</translation>
</message>
<message>
<source>Reset app settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Resetting the app wipes all application data from the device! This includes offline synced notes, app settings and accounts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SyntaxPage</name>

View file

@ -567,6 +567,21 @@
<source>Show notes marked as favorite above the others</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/SettingsPage.qml" line="213"/>
<source>Reset</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/SettingsPage.qml" line="216"/>
<source>Reset app settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/SettingsPage.qml" line="226"/>
<source>Resetting the app wipes all application data from the device! This includes offline synced notes, app settings and accounts.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/SettingsPage.qml" line="147"/>
<source>Last edited</source>