2020-08-10 15:17:29 +03:00
/ *
2021-02-20 02:14:43 +03:00
Copyright ( C ) 2020 - 21 Sebastian J . Wolf and other contributors
2020-08-10 15:17:29 +03:00
This file is part of Fernschreiber .
2020-08-13 18:08:14 +03:00
Fernschreiber is free software: you can redistribute it and / or modify
2020-08-10 15:17:29 +03:00
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
2020-08-13 18:08:14 +03:00
Fernschreiber is distributed in the hope that it will be useful ,
2020-08-10 15:17:29 +03:00
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with Fernschreiber . If not , see < http: //www.gnu.org/licenses/>.
* /
2020-10-31 22:49:03 +03:00
import QtQuick 2.6
2020-08-10 15:17:29 +03:00
import Sailfish . Silica 1.0
2020-08-14 11:33:42 +03:00
import "../components"
2020-08-13 23:32:35 +03:00
import "../js/twemoji.js" as Emoji
2020-08-10 15:17:29 +03:00
Page {
id: aboutPage
allowedOrientations: Orientation . All
2021-01-11 21:05:55 +03:00
property bool isLoggedIn : false
2020-11-06 01:23:37 +03:00
property var userInformation : tdLibWrapper . getUserInformation ( ) ;
2020-08-13 23:32:35 +03:00
2020-08-10 15:17:29 +03:00
SilicaFlickable {
id: aboutContainer
contentHeight: column . height
anchors.fill: parent
Column {
id: column
width: aboutPage . width
spacing: Theme . paddingLarge
PageHeader {
title: qsTr ( "About Fernschreiber" )
}
Image {
id: wunderfitzImage
2020-10-26 17:15:53 +03:00
source: "../../images/fernschreiber.svg"
2020-08-10 15:17:29 +03:00
anchors {
horizontalCenter: parent . horizontalCenter
}
2020-10-26 17:15:53 +03:00
sourceSize {
width: width
height: height
}
2020-08-10 15:17:29 +03:00
fillMode: Image . PreserveAspectFit
2020-08-29 17:32:43 +03:00
asynchronous: true
2020-10-18 01:56:11 +03:00
width: Math . min ( 2 * Theme . itemSizeHuge , Math . min ( aboutPage . width , aboutPage . height ) / 2 )
2020-10-26 17:15:53 +03:00
height: width
2020-08-10 15:17:29 +03:00
}
Label {
2021-02-22 23:46:55 +03:00
text: "Fernschreiber 0.8"
2020-08-10 15:17:29 +03:00
horizontalAlignment: Text . AlignHCenter
font.pixelSize: Theme . fontSizeExtraLarge
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Label {
wrapMode: Text . Wrap
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
horizontalAlignment: Text . AlignHCenter
text: qsTr ( "A Telegram client for Sailfish OS" )
font.pixelSize: Theme . fontSizeSmall
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Label {
2020-09-28 21:47:03 +03:00
text: qsTr ( "By Sebastian J. Wolf and <a href=\"https://github.com/Wunderfitz/harbour-fernschreiber#contributions\">other contributors</a>" )
2020-08-10 15:17:29 +03:00
font.pixelSize: Theme . fontSizeSmall
2020-09-28 21:47:03 +03:00
width: parent . width - ( 2 * Theme . horizontalPageMargin )
horizontalAlignment: Text . AlignHCenter
wrapMode: Text . Wrap
linkColor: Theme . highlightColor
onLinkActivated: Qt . openUrlExternally ( link )
2020-08-10 15:17:29 +03:00
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Text {
text: "<a href=\"mailto:sebastian@ygriega.de\">" + qsTr ( "Send E-Mail" ) + "</a>"
anchors {
horizontalCenter: parent . horizontalCenter
}
font.pixelSize: Theme . fontSizeSmall
linkColor: Theme . highlightColor
onLinkActivated: Qt . openUrlExternally ( "mailto:sebastian@ygriega.de" )
}
Separator {
width: parent . width
color: Theme . primaryColor
horizontalAlignment: Qt . AlignHCenter
}
Label {
text: qsTr ( "Licensed under GNU GPLv3" )
font.pixelSize: Theme . fontSizeSmall
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Text {
text: "<a href=\"https://github.com/Wunderfitz/harbour-fernschreiber\">" + qsTr ( "Sources on GitHub" ) + "</a>"
anchors {
horizontalCenter: parent . horizontalCenter
}
font.pixelSize: Theme . fontSizeSmall
linkColor: Theme . highlightColor
onLinkActivated: Qt . openUrlExternally ( "https://github.com/Wunderfitz/harbour-fernschreiber" )
}
SectionHeader {
text: qsTr ( "About Telegram" )
}
Label {
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
2020-08-12 11:50:01 +03:00
horizontalAlignment: Text . AlignHCenter
text: qsTr ( "This product uses the Telegram API but is not endorsed or certified by Telegram." )
font.pixelSize: Theme . fontSizeSmall
wrapMode: Text . Wrap
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Label {
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
horizontalAlignment: Text . AlignHCenter
text: qsTr ( "TDLib version %1" ) . arg ( tdLibWrapper . getVersion ( ) )
2020-08-10 15:17:29 +03:00
font.pixelSize: Theme . fontSizeSmall
wrapMode: Text . Wrap
anchors {
horizontalCenter: parent . horizontalCenter
}
}
2020-11-26 13:18:17 +03:00
Loader {
2021-01-11 21:05:55 +03:00
id: userInformationLoader
active: isLoggedIn
2020-11-26 13:18:17 +03:00
width: parent . width
sourceComponent: Component {
Column {
2021-01-16 01:08:58 +03:00
spacing: Theme . paddingSmall
2020-11-26 13:18:17 +03:00
Text {
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
horizontalAlignment: Text . AlignHCenter
2020-11-26 17:10:26 +03:00
text: qsTr ( "Logged in as %1" ) . arg ( Emoji . emojify ( aboutPage . userInformation . first_name + " " + aboutPage . userInformation . last_name , Theme . fontSizeSmall ) )
2020-11-26 13:18:17 +03:00
font.pixelSize: Theme . fontSizeSmall
wrapMode: Text . Wrap
color: Theme . primaryColor
textFormat: Text . StyledText
anchors {
horizontalCenter: parent . horizontalCenter
}
}
ProfileThumbnail {
2021-01-02 22:06:53 +03:00
photoData: ( ( typeof aboutPage . userInformation . profile_photo !== "undefined" ) ? aboutPage.userInformation.profile_photo.small : { } )
2020-11-26 13:18:17 +03:00
width: Theme . itemSizeExtraLarge
height: Theme . itemSizeExtraLarge
replacementStringHint: aboutPage . userInformation . first_name + " " + aboutPage . userInformation . last_name
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Label {
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
horizontalAlignment: Text . AlignHCenter
text: qsTr ( "Phone number: +%1" ) . arg ( aboutPage . userInformation . phone_number )
font.pixelSize: Theme . fontSizeSmall
wrapMode: Text . Wrap
anchors {
horizontalCenter: parent . horizontalCenter
}
}
2021-01-11 21:05:55 +03:00
BackgroundItem {
width: parent . width
BackgroundItem {
id: logOutItem
width: parent . width
function showRemorseItem ( ) {
remorse . execute ( logOutItem , qsTr ( "Logged out" ) , function ( ) {
tdLibWrapper . logout ( ) ;
pageStack . pop ( ) ;
} ) ;
}
RemorseItem {
id: remorse
}
Button {
id: logOutButton
text: qsTr ( "Log Out" )
anchors {
horizontalCenter: parent . horizontalCenter
}
onClicked: {
logOutItem . showRemorseItem ( ) ;
}
}
}
}
2020-11-26 13:18:17 +03:00
}
2020-08-13 23:32:35 +03:00
}
}
2020-08-10 15:17:29 +03:00
Button {
2021-02-20 02:14:43 +03:00
id: activeSessionsButton
text: qsTr ( "Active Sessions" )
anchors {
horizontalCenter: parent . horizontalCenter
}
onClicked: {
pageStack . push ( Qt . resolvedUrl ( "ActiveSessionsPage.qml" ) ) ;
}
}
Button {
2020-08-10 15:17:29 +03:00
text: qsTr ( "Terms of Service" )
anchors {
horizontalCenter: parent . horizontalCenter
}
onClicked: {
Qt . openUrlExternally ( "https://telegram.org/tos" ) ;
}
}
Button {
text: qsTr ( "Privacy Policy" )
anchors {
horizontalCenter: parent . horizontalCenter
}
onClicked: {
2020-08-12 11:50:01 +03:00
Qt . openUrlExternally ( "https://telegram.org/privacy" )
2020-08-10 15:17:29 +03:00
}
}
SectionHeader {
text: qsTr ( "Credits" )
}
Label {
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
text: qsTr ( "This project uses the Telegram Database Library (TDLib). Thanks for making it available under the conditions of the Boost Software License 1.0!" )
font.pixelSize: Theme . fontSizeExtraSmall
wrapMode: Text . Wrap
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Text {
text: "<a href=\"https://github.com/tdlib/td\">" + qsTr ( "Open Telegram Database Library on GitHub" ) + "</a>"
anchors {
horizontalCenter: parent . horizontalCenter
}
font.pixelSize: Theme . fontSizeSmall
linkColor: Theme . highlightColor
onLinkActivated: Qt . openUrlExternally ( "https://github.com/tdlib/td" )
}
2020-08-13 23:42:54 +03:00
Label {
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
text: qsTr ( "This project uses twemoji. Copyright 2018 Twitter, Inc. and other contributors. Thanks for making it available under the conditions of the MIT License (coding) and CC-BY 4.0 (graphics)!" )
font.pixelSize: Theme . fontSizeExtraSmall
wrapMode: Text . Wrap
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Text {
text: "<a href=\"https://github.com/twitter/twemoji\">" + qsTr ( "Open twemoji on GitHub" ) + "</a>"
anchors {
horizontalCenter: parent . horizontalCenter
}
font.pixelSize: Theme . fontSizeSmall
linkColor: Theme . highlightColor
onLinkActivated: Qt . openUrlExternally ( "https://github.com/twitter/twemoji" )
}
2020-11-11 19:54:44 +03:00
Label {
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
text: qsTr ( "This project uses rlottie. Copyright 2020 Samsung Electronics Co., Ltd. and other contributors. Thanks for making it available under the conditions of the MIT License!" )
font.pixelSize: Theme . fontSizeExtraSmall
wrapMode: Text . Wrap
anchors {
horizontalCenter: parent . horizontalCenter
}
}
Text {
text: "<a href=\"https://github.com/Samsung/rlottie\">" + qsTr ( "Open rlottie on GitHub" ) + "</a>"
anchors {
horizontalCenter: parent . horizontalCenter
}
font.pixelSize: Theme . fontSizeSmall
linkColor: Theme . highlightColor
onLinkActivated: Qt . openUrlExternally ( "https://github.com/Samsung/rlottie" )
}
2020-08-10 15:17:29 +03:00
Label {
id: separatorLabel
x: Theme . horizontalPageMargin
width: parent . width - ( 2 * Theme . horizontalPageMargin )
font.pixelSize: Theme . fontSizeExtraSmall
wrapMode: Text . Wrap
anchors {
horizontalCenter: parent . horizontalCenter
}
}
VerticalScrollDecorator { }
}
}
}