2017-07-20 13:14:16 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
import "../lib/API.js" as Logic
|
|
|
|
|
2020-05-29 21:05:05 +03:00
|
|
|
|
2017-07-20 13:14:16 +03:00
|
|
|
Page {
|
2020-05-29 21:05:05 +03:00
|
|
|
id: settingsPage
|
2017-07-20 13:14:16 +03:00
|
|
|
SilicaFlickable {
|
|
|
|
anchors.fill: parent
|
|
|
|
contentHeight: column.height + Theme.paddingLarge
|
|
|
|
contentWidth: parent.width
|
2019-01-27 11:59:43 +03:00
|
|
|
RemorsePopup { id: remorsePopup }
|
2017-07-20 13:14:16 +03:00
|
|
|
VerticalScrollDecorator {}
|
2020-04-27 18:43:10 +03:00
|
|
|
Column {
|
2017-07-20 13:14:16 +03:00
|
|
|
id: column
|
|
|
|
spacing: Theme.paddingSmall
|
|
|
|
width: parent.width
|
|
|
|
PageHeader {
|
|
|
|
title: qsTr("Settings")
|
|
|
|
}
|
|
|
|
Column {
|
|
|
|
// No spacing in this column
|
|
|
|
width: parent.width
|
2020-05-29 21:05:05 +03:00
|
|
|
|
2017-07-20 13:14:16 +03:00
|
|
|
IconTextSwitch {
|
2019-01-27 11:59:43 +03:00
|
|
|
id: removeAccount
|
|
|
|
text: Logic.conf['login'] ? qsTr("Remove Account") : qsTr("Add Account")
|
2020-04-28 23:11:07 +03:00
|
|
|
description: Logic.conf['login'] ? qsTr("Deauthorize this app and remove your account") : qsTr("Authorize this app to access your Mastodon account")
|
2020-04-29 15:27:54 +03:00
|
|
|
icon.source: Logic.conf['login'] ? "image://theme/icon-m-contact" : "image://theme/icon-m-add"
|
2020-04-27 18:31:25 +03:00
|
|
|
onCheckedChanged: {
|
2019-01-27 11:59:43 +03:00
|
|
|
remorsePopup.execute(removeAccount.text, function() {
|
|
|
|
busy = true;
|
|
|
|
checked = false;
|
|
|
|
timer1.start();
|
|
|
|
if (Logic.conf['login']) {
|
|
|
|
Logic.conf['login'] = false
|
|
|
|
Logic.conf['instance'] = null;
|
|
|
|
Logic.conf['api_user_token'] = null;
|
|
|
|
}
|
|
|
|
pageStack.push(Qt.resolvedUrl("LoginPage.qml"))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
/* busy = true;
|
2017-07-20 16:26:20 +03:00
|
|
|
checked = false;
|
|
|
|
timer1.start()
|
2020-05-29 21:05:05 +03:00
|
|
|
}*/
|
2017-07-20 16:26:20 +03:00
|
|
|
Timer {
|
|
|
|
id: timer1
|
|
|
|
interval: 4700
|
|
|
|
onTriggered: parent.busy = false
|
|
|
|
}
|
2017-07-20 13:14:16 +03:00
|
|
|
}
|
2020-05-29 21:05:05 +03:00
|
|
|
|
2017-07-20 13:14:16 +03:00
|
|
|
IconTextSwitch {
|
|
|
|
//enabled: false
|
|
|
|
checked: typeof Logic.conf['loadImages'] !== "undefined" && Logic.conf['loadImages']
|
2020-04-27 18:28:59 +03:00
|
|
|
text: qsTr("Load images in toots")
|
2017-07-20 13:14:16 +03:00
|
|
|
description: qsTr("Disable this option if you want to preserve your data connection")
|
2020-04-29 15:27:54 +03:00
|
|
|
icon.source: "image://theme/icon-m-image"
|
2017-07-20 13:14:16 +03:00
|
|
|
onClicked: {
|
|
|
|
Logic.conf['loadImages'] = checked
|
|
|
|
}
|
|
|
|
}
|
2020-05-29 21:05:05 +03:00
|
|
|
|
2020-04-27 18:28:59 +03:00
|
|
|
IconTextSwitch {
|
|
|
|
text: qsTr("Translate")
|
|
|
|
description: qsTr("Use Transifex to help with app translation to your language")
|
2020-04-29 15:27:54 +03:00
|
|
|
icon.source: "image://theme/icon-m-font-size"
|
2020-04-27 18:28:59 +03:00
|
|
|
onCheckedChanged: {
|
|
|
|
busy = true;
|
|
|
|
checked = false;
|
|
|
|
Qt.openUrlExternally("https://www.transifex.com/dysko/tooter/");
|
|
|
|
timer2.start()
|
|
|
|
}
|
|
|
|
Timer {
|
|
|
|
id: timer2
|
|
|
|
interval: 4700
|
|
|
|
onTriggered: parent.busy = false
|
|
|
|
}
|
|
|
|
}
|
2020-01-16 00:11:59 +03:00
|
|
|
}
|
2020-05-29 21:05:05 +03:00
|
|
|
|
2017-07-20 13:14:16 +03:00
|
|
|
SectionHeader {
|
|
|
|
text: qsTr("Credits")
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
width: parent.width
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
rightMargin: Theme.horizontalPageMargin
|
|
|
|
}
|
|
|
|
Repeater {
|
|
|
|
model: ListModel {
|
|
|
|
ListElement {
|
|
|
|
name: "Duško Angirević"
|
|
|
|
desc: qsTr("UI/UX design and development")
|
|
|
|
mastodon: "dysko@mastodon.social"
|
|
|
|
mail: ""
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
name: "Miodrag Nikolić"
|
2020-01-30 14:50:52 +03:00
|
|
|
desc: qsTr("Visual identity")
|
2017-07-20 13:14:16 +03:00
|
|
|
mastodon: ""
|
|
|
|
mail: "micotakis@gmail.com"
|
|
|
|
}
|
2020-04-16 01:37:11 +03:00
|
|
|
ListElement {
|
2020-04-27 18:11:34 +03:00
|
|
|
name: "Molan"
|
2020-04-28 12:43:57 +03:00
|
|
|
desc: qsTr("Development and translations")
|
2020-05-29 21:05:05 +03:00
|
|
|
mastodon: "molan@fosstodon.org"
|
|
|
|
mail: ""
|
2020-04-16 01:37:11 +03:00
|
|
|
}
|
2017-07-20 13:14:16 +03:00
|
|
|
ListElement {
|
|
|
|
name: "Quentin PAGÈS / Quenti ♏"
|
2020-01-30 14:50:52 +03:00
|
|
|
desc: qsTr("Occitan & French translation")
|
2017-07-20 13:14:16 +03:00
|
|
|
mastodon: "Quenti@framapiaf.org"
|
|
|
|
mail: ""
|
|
|
|
}
|
2020-04-27 18:40:16 +03:00
|
|
|
ListElement {
|
|
|
|
name: "Luchy Kon / dashinfantry"
|
|
|
|
desc: qsTr("Chinese translation")
|
|
|
|
mastodon: ""
|
|
|
|
mail: "dashinfantry@gmail.com"
|
|
|
|
}
|
2017-07-20 13:14:16 +03:00
|
|
|
ListElement {
|
|
|
|
name: "André Koot"
|
2020-01-30 14:50:52 +03:00
|
|
|
desc: qsTr("Dutch translation")
|
2017-07-20 13:14:16 +03:00
|
|
|
mastodon: "meneer@mastodon.social"
|
|
|
|
mail: "https://twitter.com/meneer"
|
|
|
|
}
|
|
|
|
ListElement {
|
2020-02-04 00:52:28 +03:00
|
|
|
name: "CarmenFdez"
|
2020-01-30 14:50:52 +03:00
|
|
|
desc: qsTr("Spanish translation")
|
2017-07-20 13:14:16 +03:00
|
|
|
mastodon: ""
|
2020-02-04 00:52:28 +03:00
|
|
|
mail: ""
|
2017-07-20 13:14:16 +03:00
|
|
|
}
|
2020-01-31 13:01:30 +03:00
|
|
|
ListElement {
|
|
|
|
name: "Mohamed-Touhami MAHDI"
|
|
|
|
desc: qsTr("Added README file")
|
|
|
|
mastodon: "dragnucs@touha.me"
|
|
|
|
mail: "touhami@touha.me"
|
|
|
|
}
|
2017-07-20 13:14:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
width: parent.width
|
|
|
|
height: Theme.itemSizeMedium
|
|
|
|
IconButton {
|
|
|
|
id: btn
|
|
|
|
anchors {
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
right: parent.right
|
|
|
|
}
|
2020-04-29 15:27:54 +03:00
|
|
|
icon.source: "image://theme/" + (model.mastodon !== "" ? "icon-m-contact" : "icon-m-mail") + "?" + (pressed
|
2017-07-20 13:14:16 +03:00
|
|
|
? Theme.highlightColor
|
|
|
|
: Theme.primaryColor)
|
|
|
|
onClicked: {
|
|
|
|
if (model.mastodon !== ""){
|
|
|
|
var m = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
|
2020-05-29 21:05:05 +03:00
|
|
|
pageStack.push(Qt.resolvedUrl("ConversationPage.qml"), {
|
2017-07-20 13:14:16 +03:00
|
|
|
toot_id: 0,
|
|
|
|
title: model.name,
|
|
|
|
description: '@'+model.mastodon,
|
|
|
|
avatar: "",
|
|
|
|
mdl: m,
|
|
|
|
type: "reply"
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
Qt.openUrlExternally("mailto:"+model.mail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Column {
|
|
|
|
anchors {
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: Theme.horizontalPageMargin
|
|
|
|
right: btn.left
|
|
|
|
rightMargin: Theme.paddingMedium
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: lblName
|
|
|
|
text: model.name
|
|
|
|
color: Theme.secondaryColor
|
|
|
|
font.pixelSize: Theme.fontSizeSmall
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: model.desc
|
|
|
|
color: Theme.secondaryHighlightColor
|
|
|
|
font.pixelSize: Theme.fontSizeExtraSmall
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-29 21:05:05 +03:00
|
|
|
|
2017-07-20 13:14:16 +03:00
|
|
|
}
|