summaryrefslogtreecommitdiff
path: root/settings/accounts/ui/MastodonSettingsDisplay.qml
diff options
context:
space:
mode:
Diffstat (limited to 'settings/accounts/ui/MastodonSettingsDisplay.qml')
-rw-r--r--settings/accounts/ui/MastodonSettingsDisplay.qml35
1 files changed, 28 insertions, 7 deletions
diff --git a/settings/accounts/ui/MastodonSettingsDisplay.qml b/settings/accounts/ui/MastodonSettingsDisplay.qml
index 1ee276e..13ac06c 100644
--- a/settings/accounts/ui/MastodonSettingsDisplay.qml
+++ b/settings/accounts/ui/MastodonSettingsDisplay.qml
@@ -1,17 +1,21 @@
/*
- * Copyright (C) 2013-2026 Jolla Ltd.
+ * SPDX-FileCopyrightText: 2013 - 2026 Jolla Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
*/
import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Accounts 1.0
import com.jolla.settings.accounts 1.0
+import com.jolla.settings.accounts.mastodon 1.0
import org.nemomobile.configuration 1.0
StandardAccountSettingsDisplay {
id: root
settingsModified: true
+ property bool postsServiceEnabled: false
function refreshDescriptionEditor() {
var description = root.account.configurationValues("")["description"]
@@ -37,7 +41,8 @@ StandardAccountSettingsDisplay {
var providerDisplayName = root.accountProvider && root.accountProvider.displayName
? root.accountProvider.displayName.toString().trim()
: ""
- return providerDisplayName.length > 0 ? providerDisplayName : "Mastodon"
+ //% "Mastodon"
+ return providerDisplayName.length > 0 ? providerDisplayName : qsTrId("settings-accounts-mastodon-la-provider_name")
}
onAboutToSaveAccount: {
@@ -106,12 +111,25 @@ StandardAccountSettingsDisplay {
id: syncServicesRepeater
TextSwitch {
checked: model.enabled
- text: model.displayName
+ text: model.serviceName === "mastodon-microblog"
+ //% "Posts"
+ ? qsTrId("settings-accounts-mastodon-la-service_posts")
+ : (model.serviceName === "mastodon-notifications"
+ //% "Notifications"
+ ? qsTrId("settings-accounts-mastodon-la-service_notifications")
+ : model.displayName)
description: model.serviceName === "mastodon-microblog"
- ? "Show Mastodon posts in the Events view."
- : ""
+ //% "Show Mastodon posts in the Events view."
+ ? qsTrId("settings-accounts-mastodon-la-service_posts_description")
+ : (model.serviceName === "mastodon-notifications"
+ //% "Show Mastodon notifications."
+ ? qsTrId("settings-accounts-mastodon-la-service_notifications_description")
+ : "")
visible: text.length > 0
onCheckedChanged: {
+ if (model.serviceName === "mastodon-microblog") {
+ root.postsServiceEnabled = checked
+ }
if (checked) {
root.account.enableWithService(model.serviceName)
} else {
@@ -124,8 +142,11 @@ StandardAccountSettingsDisplay {
TextSwitch {
id: eventsSyncSwitch
- text: "Sync Mastodon feed automatically"
- description: "Fetch new posts periodically when browsing Events Mastodon feed."
+ //% "Sync Mastodon feed automatically"
+ text: qsTrId("settings-accounts-mastodon-la-auto_sync_feed")
+ //% "Fetch new posts periodically when browsing Events Mastodon feed."
+ description: qsTrId("settings-accounts-mastodon-la-auto_sync_feed_description")
+ enabled: root.postsServiceEnabled
onCheckedChanged: {
autoSyncConf.value = checked