From 4a5c01f6407acb94ecd10173279902fdcb850ad9 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 8 Oct 2017 11:53:12 +0200 Subject: Fix up the rest of the account settings. --- .../gmail/package/contents/ui/GmailSettings.qml | 138 ++++++++-------- .../package/contents/ui/ImapAccountSettings.qml | 175 ++++++++++----------- .../package/contents/ui/MaildirAccountSettings.qml | 92 +++++------ 3 files changed, 193 insertions(+), 212 deletions(-) (limited to 'accounts') diff --git a/accounts/gmail/package/contents/ui/GmailSettings.qml b/accounts/gmail/package/contents/ui/GmailSettings.qml index 7f0c737b..4fe6bc89 100644 --- a/accounts/gmail/package/contents/ui/GmailSettings.qml +++ b/accounts/gmail/package/contents/ui/GmailSettings.qml @@ -26,9 +26,10 @@ import org.kube.accounts.gmail 1.0 as GmailAccount Item { property string accountId - property string heading: "Connect your GMail account" - property string subheadline: "To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube." + property string heading: qsTr("Connect your GMail account") + property string subheadline: qsTr("To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube.") property bool valid: true + implicitHeight: grid.implicitHeight GmailAccount.GmailSettings { id: gmailSettings @@ -44,90 +45,83 @@ Item { gmailSettings.remove() } - Item { - anchors { - fill: parent - } - - GridLayout { - anchors { - fill: parent - } - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing + GridLayout { + id: grid + anchors.fill: parent + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing - Kube.Label { - text: "Please note that GMail requires you to configure your account to allow IMAP connections from Kube: + Kube.Label { + text: "Please note that GMail requires you to configure your account to allow IMAP connections from Kube:
  1. See https://support.google.com/mail/answer/7126229 to configure your account to allow IMAP connections.
  2. Visit https://myaccount.google.com/lesssecureapps and enable the setting to allow Kube to connect to your account." - Layout.alignment: Qt.AlignCenter - Layout.columnSpan: 2 - onLinkActivated: Qt.openUrlExternally(link) - textFormat: Text.StyledText - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text - cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor - } + Layout.alignment: Qt.AlignCenter + Layout.columnSpan: 2 + onLinkActivated: Qt.openUrlExternally(link) + textFormat: Text.StyledText + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text + cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor } + } - Kube.Label { - text: qsTr("Title of Account") - Layout.alignment: Qt.AlignRight - } - Kube.TextField { - Layout.fillWidth: true - placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") - text: gmailSettings.accountName - onTextChanged: { - gmailSettings.accountName = text - } + Kube.Label { + text: qsTr("Title of Account") + Layout.alignment: Qt.AlignRight + } + Kube.TextField { + Layout.fillWidth: true + placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") + text: gmailSettings.accountName + onTextChanged: { + gmailSettings.accountName = text } + } - Kube.Label { - text: qsTr("Name") - Layout.alignment: Qt.AlignRight - } - Kube.TextField { - Layout.fillWidth: true - placeholderText: qsTr("Your name") - text: gmailSettings.userName - onTextChanged: { - gmailSettings.userName = text - } + Kube.Label { + text: qsTr("Name") + Layout.alignment: Qt.AlignRight + } + Kube.TextField { + Layout.fillWidth: true + placeholderText: qsTr("Your name") + text: gmailSettings.userName + onTextChanged: { + gmailSettings.userName = text } + } - Kube.Label { - text: qsTr("Email address") - Layout.alignment: Qt.AlignRight - } - Kube.TextField { - Layout.fillWidth: true - - text: gmailSettings.emailAddress - onTextChanged: { - gmailSettings.emailAddress = text - } - placeholderText: qsTr("Your email address") - } + Kube.Label { + text: qsTr("Email address") + Layout.alignment: Qt.AlignRight + } + Kube.TextField { + Layout.fillWidth: true - Kube.Label { - text: qsTr("Password") - Layout.alignment: Qt.AlignRight + text: gmailSettings.emailAddress + onTextChanged: { + gmailSettings.emailAddress = text } + placeholderText: qsTr("Your email address") + } + + Kube.Label { + text: qsTr("Password") + Layout.alignment: Qt.AlignRight + } - Kube.PasswordField { - id: pwField - Layout.fillWidth: true + Kube.PasswordField { + id: pwField + Layout.fillWidth: true - placeholderText: qsTr("Password of your email account") - text: gmailSettings.imapPassword - onTextChanged: { - gmailSettings.imapPassword = text - gmailSettings.smtpPassword = text - } + placeholderText: qsTr("Password of your email account") + text: gmailSettings.imapPassword + onTextChanged: { + gmailSettings.imapPassword = text + gmailSettings.smtpPassword = text } } } diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml index f2a68d9f..fec070f2 100644 --- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml @@ -26,9 +26,10 @@ import org.kube.accounts.imap 1.0 as ImapAccount Item { property string accountId - property string heading: "Connect your IMAP account" - property string subheadline: "To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube. For information about which SMTP, IMAP address, which authentification and port to be used, please contact your email provider." + property string heading: qsTr("Connect your IMAP account") + property string subheadline: qsTr("To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube. For information about which SMTP, IMAP address, which authentification and port to be used, please contact your email provider.") property bool valid: true + implicitHeight: grid.implicitHeight ImapAccount.ImapSettings { id: imapSettings @@ -43,111 +44,103 @@ Item { function remove(){ imapSettings.remove() } - - Item { - anchors { - fill: parent + GridLayout { + id: grid + anchors.fill: parent + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing + + Kube.Label { + text: qsTr("Title of Account") + Layout.alignment: Qt.AlignRight } - - GridLayout { - anchors { - fill: parent - } - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing - - Kube.Label { - text: qsTr("Title of Account") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - Layout.fillWidth: true - placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") - text: imapSettings.accountName - onTextChanged: { - imapSettings.accountName = text - } + Kube.RequiredTextField { + Layout.fillWidth: true + placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") + text: imapSettings.accountName + onTextChanged: { + imapSettings.accountName = text } + } - Kube.Label { - text: qsTr("Name") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - Layout.fillWidth: true - placeholderText: qsTr("Your name") - text: imapSettings.userName - onTextChanged: { - imapSettings.userName = text - } + Kube.Label { + text: qsTr("Name") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + Layout.fillWidth: true + placeholderText: qsTr("Your name") + text: imapSettings.userName + onTextChanged: { + imapSettings.userName = text } + } - Kube.Label { - text: qsTr("Email address") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - Layout.fillWidth: true - - text: imapSettings.emailAddress - onTextChanged: { - imapSettings.emailAddress = text - imapSettings.imapUsername = text - imapSettings.smtpUsername = text - } - placeholderText: qsTr("Your email address") + Kube.Label { + text: qsTr("Email address") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + Layout.fillWidth: true + + text: imapSettings.emailAddress + onTextChanged: { + imapSettings.emailAddress = text + imapSettings.imapUsername = text + imapSettings.smtpUsername = text } + placeholderText: qsTr("Your email address") + } - Kube.Label { - text: qsTr("Password") - Layout.alignment: Qt.AlignRight - } + Kube.Label { + text: qsTr("Password") + Layout.alignment: Qt.AlignRight + } - Kube.PasswordField { - id: pwField - Layout.fillWidth: true + Kube.PasswordField { + id: pwField + Layout.fillWidth: true - placeholderText: qsTr("Password of your email account") - text: imapSettings.imapPassword - onTextChanged: { - imapSettings.imapPassword = text - imapSettings.smtpPassword = text - } + placeholderText: qsTr("Password of your email account") + text: imapSettings.imapPassword + onTextChanged: { + imapSettings.imapPassword = text + imapSettings.smtpPassword = text } + } - Kube.Label { - text: qsTr("IMAP server address") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - id: imapServer + Kube.Label { + text: qsTr("IMAP server address") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + id: imapServer - Layout.fillWidth: true + Layout.fillWidth: true - placeholderText: "imaps://mainserver.example.net:993" - text: imapSettings.imapServer - onTextChanged: { - imapSettings.imapServer = text - } - validator: imapSettings.imapServerValidator + placeholderText: "imaps://mainserver.example.net:993" + text: imapSettings.imapServer + onTextChanged: { + imapSettings.imapServer = text } + validator: imapSettings.imapServerValidator + } - Kube.Label { - text: qsTr("Smtp address") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - id: smtpServer - Layout.fillWidth: true - - placeholderText: "smtps://mainserver.example.net:993" - text: imapSettings.smtpServer - onTextChanged: { - imapSettings.smtpServer = text - } - validator: imapSettings.smtpServerValidator + Kube.Label { + text: qsTr("Smtp address") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + id: smtpServer + Layout.fillWidth: true + + placeholderText: "smtps://mainserver.example.net:993" + text: imapSettings.smtpServer + onTextChanged: { + imapSettings.smtpServer = text } + validator: imapSettings.smtpServerValidator } } } diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml index ba5bd766..0fb87810 100644 --- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml @@ -26,9 +26,10 @@ import org.kube.accounts.maildir 1.0 as MaildirAccount Item { property string accountId - property string heading: "Add your Maildir archive" - property string subheadline: "To let Kube access your maildir archive, add the path to your archive and give the account a title that will be displayed inside Kube." + property string heading: qsTr("Add your Maildir archive") + property string subheadline: qsTr("To let Kube access your maildir archive, add the path to your archive and give the account a title that will be displayed inside Kube.") property bool valid: true + implicitHeight: grid.implicitHeight MaildirAccount.MaildirSettings { id: maildirSettings @@ -44,66 +45,59 @@ Item { maildirSettings.remove() } - Item { - anchors { - fill: parent - } + GridLayout { + id: grid + anchors.fill: parent + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing - GridLayout { - anchors { - fill: parent + Kube.Label { + text: qsTr("Title of Account") + Layout.alignment: Qt.AlignRight + } + Kube.TextField { + Layout.fillWidth: true + placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") + text: maildirSettings.accountName + onTextChanged: { + maildirSettings.accountName = text } - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing + } + + Kube.Label { + text: qsTr("Path") + Layout.alignment: Qt.AlignRight + } + RowLayout { + Layout.fillWidth: true - Kube.Label { - text: qsTr("Title of Account") - Layout.alignment: Qt.AlignRight - } Kube.TextField { + id: path Layout.fillWidth: true - placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") - text: maildirSettings.accountName - onTextChanged: { - maildirSettings.accountName = text - } + enabled: false + text: maildirSettings.path } - Kube.Label { - text: qsTr("Path") - Layout.alignment: Qt.AlignRight - } - RowLayout { - Layout.fillWidth: true + Controls.Button { + iconName: Kube.Icons.folder - Kube.TextField { - id: path - Layout.fillWidth: true - enabled: false - text: maildirSettings.path + onClicked: { + fileDialogComponent.createObject(parent) } - Controls.Button { - iconName: Kube.Icons.folder - - onClicked: { - fileDialogComponent.createObject(parent) - } - - Component { - id: fileDialogComponent - Dialogs.FileDialog { - id: fileDialog + Component { + id: fileDialogComponent + Dialogs.FileDialog { + id: fileDialog - visible: true - title: "Choose the maildir folder" + visible: true + title: "Choose the maildir folder" - selectFolder: true + selectFolder: true - onAccepted: { - maildirSettings.path = fileDialog.fileUrl - } + onAccepted: { + maildirSettings.path = fileDialog.fileUrl } } } -- cgit v1.2.3