Skip to content

Commit

Permalink
another try
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Jul 31, 2023
1 parent efedf54 commit 4aba190
Show file tree
Hide file tree
Showing 144 changed files with 6,534 additions and 6,931 deletions.
35 changes: 16 additions & 19 deletions app/qml/AboutPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import QtQuick.Layouts
import QtQuick.Dialogs
import Qt5Compat.GraphicalEffects
import QtQuick.Window

import "." // import InputStyle singleton
import "./components"

Expand All @@ -26,29 +25,27 @@ Page {
property color bgColor: InputStyle.panelBackgroundLight
property bool isPortraitOrientation: Screen.primaryOrientation === Qt.PortraitOrientation

signal close()
signal close

function setAnchors() {
if ( isPortraitOrientation )
{
lutraLogo.anchors.right = undefined
lutraLogo.anchors.horizontalCenter = content.horizontalCenter
lutraLogo.anchors.bottomMargin = 2 * InputStyle.panelMargin
lutraLogo.anchors.rightMargin = undefined
}
else // landscape
if (isPortraitOrientation) {
lutraLogo.anchors.right = undefined;
lutraLogo.anchors.horizontalCenter = content.horizontalCenter;
lutraLogo.anchors.bottomMargin = 2 * InputStyle.panelMargin;
lutraLogo.anchors.rightMargin = undefined;
} else // landscape
{
lutraLogo.anchors.horizontalCenter = undefined
lutraLogo.anchors.right = content.right
lutraLogo.anchors.bottomMargin = InputStyle.panelMargin
lutraLogo.anchors.rightMargin = InputStyle.panelMargin
lutraLogo.anchors.horizontalCenter = undefined;
lutraLogo.anchors.right = content.right;
lutraLogo.anchors.bottomMargin = InputStyle.panelMargin;
lutraLogo.anchors.rightMargin = InputStyle.panelMargin;
}
}

Keys.onReleased: function( event ) {
Keys.onReleased: function (event) {
if (event.key === Qt.Key_Back || event.key === Qt.Key_Escape) {
event.accepted = true
close()
event.accepted = true;
close();
}
}

Expand Down Expand Up @@ -101,13 +98,13 @@ Page {
width: content.width - 2 * root.panelMargin
height: fieldHeight * 0.7
anchors.horizontalCenter: parent.horizontalCenter
onClicked: Qt.openUrlExternally( __inputHelp.inputWebLink )
onClicked: Qt.openUrlExternally(__inputHelp.inputWebLink)
background: Rectangle {
color: root.bgColor
}

contentItem: Text {
text: __inputHelp.inputWebLink.split( '?' )[0] // do not show utm tags
text: __inputHelp.inputWebLink.split('?')[0] // do not show utm tags
font.pixelSize: InputStyle.fontPixelSizeNormal
color: InputStyle.highlightColor
horizontalAlignment: Text.AlignHCenter
Expand Down
147 changes: 64 additions & 83 deletions app/qml/AccountPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import "." // import InputStyle singleton
import "./components"

Page {
id: root
signal back
signal managePlansClicked
signal signOutClicked
Expand All @@ -35,11 +36,8 @@ Page {
property string nextBillPrice: __merginApi.subscriptionInfo.nextBillPrice
property bool ownsActiveSubscription: __merginApi.subscriptionInfo.ownsActiveSubscription
property bool apiSupportsSubscriptions: __merginApi.apiSupportsSubscriptions

id: root
visible: true


// /////////////////
// header
PanelHeader {
Expand All @@ -53,7 +51,6 @@ Page {
withBackButton: true
}


ScrollView {
id: scrollView
anchors.top: header.bottom
Expand All @@ -71,42 +68,42 @@ Page {

// avatar
Row {
id: avatarContainer
height: InputStyle.rowHeightHeader * 2
anchors.horizontalCenter: parent.horizontalCenter
id: avatarContainer
height: InputStyle.rowHeightHeader * 2
anchors.horizontalCenter: parent.horizontalCenter

Item {
id: avatar
width: avatarContainer.height
height: width

Item {
id: avatar
width: avatarContainer.height
Rectangle {
id: avatarImage
anchors.centerIn: parent
width: avatar.width * 0.8
height: width
color: InputStyle.fontColor
radius: width * 0.5
antialiasing: true

Rectangle {
id: avatarImage
Image {
id: userIcon
anchors.centerIn: parent
width: avatar.width * 0.8
height: width
color: InputStyle.fontColor
radius: width*0.5
antialiasing: true

Image {
id: userIcon
anchors.centerIn: parent
source: InputStyle.accountIcon
height: parent.height * 0.8
width: height
sourceSize.width: width
sourceSize.height: height
fillMode: Image.PreserveAspectFit
}

ColorOverlay {
anchors.fill: userIcon
source: userIcon
color: "#FFFFFF"
}
source: InputStyle.accountIcon
height: parent.height * 0.8
width: height
sourceSize.width: width
sourceSize.height: height
fillMode: Image.PreserveAspectFit
}

ColorOverlay {
anchors.fill: userIcon
source: userIcon
color: "#FFFFFF"
}
}
}
}

TextWithIcon {
Expand Down Expand Up @@ -136,21 +133,18 @@ Page {
height: InputStyle.rowHeight
visible: root.subscriptionStatus === MerginSubscriptionStatus.SubscriptionUnsubscribed
source: InputStyle.infoIcon
text: qsTr("Your subscription will not auto-renew after %1")
.arg(root.subscriptionsTimestamp)
text: qsTr("Your subscription will not auto-renew after %1").arg(root.subscriptionsTimestamp)
}

TextWithIcon {
width: parent.width
height: InputStyle.rowHeight
visible: root.subscriptionStatus === MerginSubscriptionStatus.SubscriptionInGracePeriod
source: InputStyle.exclamationTriangleIcon
onLinkActivated: function( link ) {
Qt.openUrlExternally(link)
onLinkActivated: function (link) {
Qt.openUrlExternally(link);
}
text: qsTr("Please update your %1billing details%2 as soon as possible")
.arg("<a href='" + __purchasing.subscriptionBillingUrl + "'>")
.arg("</a>")
text: qsTr("Please update your %1billing details%2 as soon as possible").arg("<a href='" + __purchasing.subscriptionBillingUrl + "'>").arg("</a>")
iconColor: InputStyle.highlightColor
}

Expand All @@ -159,18 +153,15 @@ Page {
height: InputStyle.rowHeight
visible: root.subscriptionStatus === MerginSubscriptionStatus.ValidSubscription
source: InputStyle.todayIcon
text: qsTr("Your next bill will be for %1 on %2")
.arg(root.nextBillPrice)
.arg(root.subscriptionsTimestamp)
text: qsTr("Your next bill will be for %1 on %2").arg(root.nextBillPrice).arg(root.subscriptionsTimestamp)
}

TextWithIcon {
width: parent.width
height: InputStyle.rowHeight
visible: root.subscriptionStatus === MerginSubscriptionStatus.CanceledSubscription
source: InputStyle.todayIcon
text: qsTr("Your subscription was cancelled on %1")
.arg(root.subscriptionsTimestamp)
text: qsTr("Your subscription was cancelled on %1").arg(root.subscriptionsTimestamp)
}

Row {
Expand All @@ -181,10 +172,10 @@ Page {

CircularProgressBar {
id: storageIcon
width: parent.width*0.6
width: parent.width * 0.6
anchors.centerIn: parent
height: width
value: root.diskUsage/root.storageLimit
value: root.diskUsage / root.storageLimit
}
}

Expand Down Expand Up @@ -236,7 +227,7 @@ Page {
id: spacer
visible: textRestore.visible
height: InputStyle.rowHeightHeader
width:parent.width
width: parent.width
}

Text {
Expand All @@ -247,11 +238,7 @@ Page {
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "<style>a:link { color: " + InputStyle.highlightColor
+ "; text-decoration: underline; }</style>" + qsTr(
"You can also %1restore%2 your purchases")
.arg("<a href='http://restore-purchases'>")
.arg("</a>")
text: "<style>a:link { color: " + InputStyle.highlightColor + "; text-decoration: underline; }</style>" + qsTr("You can also %1restore%2 your purchases").arg("<a href='http://restore-purchases'>").arg("</a>")
font.pixelSize: InputStyle.fontPixelSizeNormal
color: InputStyle.fontColor
width: root.width
Expand Down Expand Up @@ -319,7 +306,6 @@ Page {
elide: Text.ElideRight
}
}

}
}

Expand All @@ -331,25 +317,22 @@ Page {
anchors.centerIn: parent
leftMargin: InputStyle.panelMargin
rightMargin: InputStyle.panelMargin
title: qsTr( "Delete account?" )
title: qsTr("Delete account?")

contentItem: ColumnLayout {
id: column
Label {
id: label
text: qsTr("This action will delete your Mergin Maps account with all your projects, " +
"both on the device and on the server. This action cannot be undone. " +
"If you have an Apple subscription you need to cancel it manually.\n\n" +
"In order to delete your account, enter your username in the field below and click Yes.")
text: qsTr("This action will delete your Mergin Maps account with all your projects, " + "both on the device and on the server. This action cannot be undone. " + "If you have an Apple subscription you need to cancel it manually.\n\n" + "In order to delete your account, enter your username in the field below and click Yes.")
Layout.fillWidth: true
wrapMode: Text.WordWrap
}
TextField {
id: usernameField
placeholderText: qsTr("Enter username")
Layout.fillWidth: true
onTextEdited: function() {
buttons.standardButton(Dialog.Yes).enabled = (text === username)
onTextEdited: function () {
buttons.standardButton(Dialog.Yes).enabled = (text === username);
}
}
}
Expand All @@ -364,35 +347,35 @@ Page {
}

onAboutToHide: {
usernameField.clear()
usernameField.clear();
}

onAccepted: {
close()
accountDeleteIndicator.running = true
__merginApi.deleteAccount()
close();
accountDeleteIndicator.running = true;
__merginApi.deleteAccount();
}
onRejected: {
close()
close();
}
}

MessageDialog {
id: accountDeletionFailedDialog

visible: false
title: qsTr( "Failed to remove account" )
text: qsTr( "An error occured while removing your account" )
title: qsTr("Failed to remove account")
text: qsTr("An error occured while removing your account")
buttons: MessageDialog.Close

onButtonClicked: function( clickedButton ) {
close()
onButtonClicked: function (clickedButton) {
close();
}
}

BusyIndicator {
id: accountDeleteIndicator
width: root.width/8
width: root.width / 8
height: width
running: false
visible: running
Expand All @@ -404,18 +387,16 @@ Page {
target: __merginApi

function onUserIsAnOrgOwnerError() {
accountDeleteIndicator.running = false
accountDeletionFailedDialog.text = qsTr("Can not close account because user is the only owner of an organisation.\n\n" +
"Please go to the Mergin Maps website to remove it manually.")
accountDeletionFailedDialog.open()
accountDeleteIndicator.running = false;
accountDeletionFailedDialog.text = qsTr("Can not close account because user is the only owner of an organisation.\n\n" + "Please go to the Mergin Maps website to remove it manually.");
accountDeletionFailedDialog.open();
}
function onAccountDeleted( result ) {
accountDeleteIndicator.running = false
if ( result ) {
accountDeleted()
}
else {
accountDeletionFailedDialog.open()
function onAccountDeleted(result) {
accountDeleteIndicator.running = false;
if (result) {
accountDeleted();
} else {
accountDeletionFailedDialog.open();
}
}
}
Expand Down
Loading

1 comment on commit 4aba190

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 23.07.443711 just submitted!

Please sign in to comment.