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
2020-06-03 08:34:33 +03:00
allowedOrientations: Orientation . All
2017-07-20 13:14:16 +03:00
SilicaFlickable {
contentHeight: column . height + Theme . paddingLarge
contentWidth: parent . width
2020-06-03 08:34:33 +03:00
anchors.fill: parent
2019-01-27 11:59:43 +03:00
RemorsePopup { id: remorsePopup }
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
VerticalScrollDecorator { }
2020-06-03 08:34:33 +03:00
2020-04-27 18:43:10 +03:00
Column {
2017-07-20 13:14:16 +03:00
id: column
2020-06-03 08:34:33 +03:00
spacing: Theme . paddingMedium
2017-07-20 13:14:16 +03:00
width: parent . width
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
PageHeader {
title: qsTr ( "Settings" )
}
2020-06-03 08:34:33 +03:00
2020-06-04 12:17:06 +03:00
SectionHeader { text: qsTr ( "Options" ) }
2020-06-03 08:34:33 +03:00
IconTextSwitch {
text: qsTr ( "Load Images in Toots" )
description: qsTr ( "Disable this option if you want to preserve your data connection" )
icon.source: "image://theme/icon-m-image"
checked: typeof Logic . conf [ 'loadImages' ] !== "undefined" && Logic . conf [ 'loadImages' ]
onClicked: {
Logic . conf [ 'loadImages' ] = checked
}
}
2020-06-18 09:32:52 +03:00
SectionHeader { text: qsTr ( "Account" ) }
2020-06-03 08:34:33 +03:00
Item {
id: removeAccount
2017-07-20 13:14:16 +03:00
width: parent . width
2020-06-03 08:34:33 +03:00
height: txtRemoveAccount . height + btnRemoveAccount . height + Theme . paddingLarge
anchors {
left: parent . left
2020-06-04 20:44:12 +03:00
leftMargin: Theme . horizontalPageMargin
2020-06-03 08:34:33 +03:00
right: parent . right
rightMargin: Theme . paddingLarge
}
2020-05-29 21:05:05 +03:00
2020-06-03 08:34:33 +03:00
Icon {
id: icnRemoveAccount
2020-06-04 12:17:06 +03:00
color: Theme . highlightColor
2020-06-03 08:34:33 +03:00
width: Theme . iconSizeMedium
fillMode: Image . PreserveAspectFit
source: Logic . conf [ 'login' ] ? "image://theme/icon-m-contact" : "image://theme/icon-m-add"
anchors.right: parent . right
2017-07-20 13:14:16 +03:00
}
2020-05-29 21:05:05 +03:00
2020-06-03 08:34:33 +03:00
Column {
id: clnRemoveAccount
spacing: Theme . paddingMedium
anchors {
left: parent . left
right: icnRemoveAccount . left
2017-07-20 13:14:16 +03:00
}
2020-05-29 21:05:05 +03:00
2020-06-03 08:34:33 +03:00
Button {
id: btnRemoveAccount
text: Logic . conf [ 'login' ] ? qsTr ( "Remove Account" ) : qsTr ( "Add Account" )
2020-06-19 11:16:13 +03:00
preferredWidth: Theme . buttonWidthMedium
2020-06-03 08:34:33 +03:00
anchors.horizontalCenter: parent . horizontalCenter
onClicked: {
remorsePopup . execute ( btnRemoveAccount . text , function ( ) {
if ( Logic . conf [ 'login' ] ) {
Logic . conf [ 'login' ] = false
Logic . conf [ 'instance' ] = null ;
Logic . conf [ 'api_user_token' ] = null ;
}
pageStack . push ( Qt . resolvedUrl ( "LoginPage.qml" ) )
} )
}
Timer {
id: timer1
interval: 4700
onTriggered: parent . busy = false
}
2020-04-27 18:28:59 +03:00
}
2020-06-03 08:34:33 +03:00
Label {
id: txtRemoveAccount
text: Logic . conf [ 'login' ] ? qsTr ( "Deauthorize this app from using your account and remove account data from phone" ) : qsTr ( "Authorize this app to access your Mastodon account" )
font.pixelSize: Theme . fontSizeExtraSmall
wrapMode: Text . Wrap
2020-06-04 12:17:06 +03:00
color: Theme . highlightColor
2020-06-15 11:42:10 +03:00
width: parent . width - Theme . paddingMedium
anchors.left: parent . left
2020-04-27 18:28:59 +03:00
}
}
2020-01-16 00:11:59 +03:00
}
2020-05-29 21:05:05 +03:00
2020-06-04 12:17:06 +03:00
SectionHeader {
text: qsTr ( "Translate" )
}
2020-06-03 08:34:33 +03:00
2020-06-04 12:17:06 +03:00
LinkedLabel {
2020-06-10 17:11:42 +03:00
id: translateLbl
//: Full sentence for translation: "Use Transifex to help with app translation to your language." - The word Transifex is a link and doesn't need translation.
2020-06-10 19:47:57 +03:00
text: qsTr ( "Use" ) + " " + "<a href='https://www.transifex.com/molan-git/tooter-b'>Transifex</a>" + " " + qsTr ( "to help with app translation to your language." )
2020-06-04 12:17:06 +03:00
textFormat: Text . StyledText
color: Theme . highlightColor
linkColor: Theme . primaryColor
font.family: Theme . fontFamilyHeading
font.pixelSize: Theme . fontSizeExtraSmall
wrapMode: Text . Wrap
anchors {
left: parent . left
leftMargin: Theme . horizontalPageMargin
right: parent . right
rightMargin: Theme . paddingLarge
2020-06-03 08:34:33 +03:00
}
2020-06-04 12:17:06 +03:00
}
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
SectionHeader {
2020-06-19 11:16:13 +03:00
//: Translation alternative: "Development"
2017-07-20 13:14:16 +03:00
text: qsTr ( "Credits" )
}
Column {
width: parent . width
anchors {
left: parent . left
right: parent . right
2020-06-03 08:34:33 +03:00
rightMargin: Theme . paddingLarge
2017-07-20 13:14:16 +03:00
}
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
Repeater {
model: ListModel {
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
ListElement {
name: "Duško Angirević"
desc: qsTr ( "UI/UX design and development" )
mastodon: "dysko@mastodon.social"
mail: ""
}
2020-06-03 08:34:33 +03:00
2020-04-16 01:37:11 +03:00
ListElement {
2023-01-18 16:37:32 +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"
2023-01-18 16:37:32 +03:00
mail: "mol_an@sunrise.ch"
2020-04-16 01:37:11 +03:00
}
2023-01-18 16:37:32 +03:00
2022-12-01 12:40:37 +03:00
ListElement {
name: "poetaster"
desc: qsTr ( "Development" )
mastodon: "postaster@mastodon.gamedev.place"
mail: "blueprint@poetaster.de"
}
2020-06-03 08:34:33 +03:00
2020-06-19 11:16:13 +03:00
ListElement {
name: "Miodrag Nikolić"
desc: qsTr ( "Visual identity" )
mastodon: ""
mail: "micotakis@gmail.com"
}
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-06-03 08:34:33 +03:00
2020-04-27 18:40:16 +03:00
ListElement {
name: "Luchy Kon / dashinfantry"
desc: qsTr ( "Chinese translation" )
mastodon: ""
mail: "dashinfantry@gmail.com"
}
2020-06-03 08:34:33 +03:00
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"
}
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
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
}
}
Item {
width: parent . width
height: Theme . itemSizeMedium
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
IconButton {
id: btn
2020-06-03 08:34:33 +03:00
icon.source: "image://theme/" + ( model . mastodon !== "" ? "icon-m-outline-chat" : "icon-m-mail" ) + "?" + ( pressed
? Theme.highlightColor : Theme . primaryColor )
2017-07-20 13:14:16 +03:00
anchors {
verticalCenter: parent . verticalCenter
right: parent . right
}
onClicked: {
if ( model . mastodon !== "" ) {
2020-06-19 11:16:13 +03:00
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" ) , {
2020-06-03 08:34:33 +03:00
headerTitle: "Mention" ,
2017-07-20 13:14:16 +03:00
description: '@' + model . mastodon ,
2020-06-03 08:34:33 +03:00
type: "new"
2017-07-20 13:14:16 +03:00
} )
} else {
Qt . openUrlExternally ( "mailto:" + model . mail ) ;
}
}
}
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
Column {
anchors {
verticalCenter: parent . verticalCenter
left: parent . left
leftMargin: Theme . horizontalPageMargin
right: btn . left
rightMargin: Theme . paddingMedium
}
Label {
id: lblName
text: model . name
2020-06-03 08:34:33 +03:00
color: Theme . highlightColor
2017-07-20 13:14:16 +03:00
font.pixelSize: Theme . fontSizeSmall
}
2020-06-03 08:34:33 +03:00
2017-07-20 13:14:16 +03:00
Label {
text: model . desc
color: Theme . secondaryHighlightColor
font.pixelSize: Theme . fontSizeExtraSmall
}
}
}
}
}
}
}
}