Skip to content

Commit

Permalink
MMMissingAuthDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Feb 29, 2024
1 parent a5d4d33 commit c0844c0
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 2 deletions.
29 changes: 29 additions & 0 deletions app/images/SignIn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<file>NoWifi.svg</file>
<file>SyncFailed.svg</file>
<file>NoPermissions.svg</file>
<file>SignIn.svg</file>
</qresource>
</RCC>
2 changes: 2 additions & 0 deletions app/mmstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class MMStyle: public QObject
Q_PROPERTY( QUrl noMapThemesImage READ noMapThemesImage CONSTANT )
Q_PROPERTY( QUrl syncFailedImage READ syncFailedImage CONSTANT )
Q_PROPERTY( QUrl noPermissionsImage READ noPermissionsImage CONSTANT )
Q_PROPERTY( QUrl signInImage READ signInImage CONSTANT )
Q_PROPERTY( QUrl warnLogoImage READ warnLogoImage CONSTANT )
Q_PROPERTY( QUrl mmLogoImage READ mmLogoImage CONSTANT )
Q_PROPERTY( QUrl lutraLogoImage READ lutraLogoImage CONSTANT )
Expand Down Expand Up @@ -421,6 +422,7 @@ class MMStyle: public QObject
QUrl noMapThemesImage() {return QUrl( "qrc:/images/NoMapThemesImage.svg" );}
QUrl syncFailedImage() {return QUrl( "qrc:/images/SyncFailed.svg" );}
QUrl noPermissionsImage() {return QUrl( "qrc:/images/NoPermissions.svg" );}
QUrl signInImage() {return QUrl( "qrc:/images/SignIn.svg" );}
QUrl reachedDataLimitImage() {return QUrl( "qrc:/images/ReachedDataLimit.svg" );}
QUrl warnLogoImage() {return QUrl( "qrc:/images/WarnLogoImage.svg" );}
QUrl mapPinImage() {return QUrl( "qrc:/images/MapPin.svg" );}
Expand Down
2 changes: 1 addition & 1 deletion app/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(MM_QML
components/Symbol.qml
components/TextWithIcon.qml
dialogs/MigrateToMerginDialog.qml
dialogs/MissingAuthDialog.qml
dialogs/MMMissingAuthDialog.qml
dialogs/MMNoPermissionsDialog.qml
dialogs/SplittingFailedDialog.qml
dialogs/SyncFailedDialog.qml
Expand Down
33 changes: 33 additions & 0 deletions app/qml/dialogs/MMMissingAuthDialog.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

import QtQuick

import "../components"

MMDrawerDialog {
id: root

signal singInRequested()

picture: __style.signInImage
bigTitle: qsTr( "Sign in to Mergin" )
description: qsTr( "You need to be signed in to your Mergin Maps account in order to synchronize the project." )
primaryButton: qsTr( "Yes, I want to sign in" )
secondaryButton: qsTr( "No, thanks" )

onPrimaryButtonClicked: {
root.singInRequested()
close()
}

onSecondaryButtonClicked: {
close()
}
}
2 changes: 1 addition & 1 deletion app/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ ApplicationWindow {
id: syncFailedDialog
}

MissingAuthDialog {
MMMissingAuthDialog {
id: missingAuthDialog

onSingInRequested: {
Expand Down
1 change: 1 addition & 0 deletions gallery/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,6 @@
<file>../app/qml/gps/MMBluetoothConnectionDrawer.qml</file>
<file>../app/qml/dialogs/MMSyncFailedDialog.qml</file>
<file>../app/qml/dialogs/MMNoPermissionsDialog.qml</file>
<file>../app/qml/dialogs/MMMissingAuthDialog.qml</file>
</qresource>
</RCC>
12 changes: 12 additions & 0 deletions gallery/qml/pages/DrawerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ Page {
noPermissionsDialog.open()
}
}

MMButton {
text: "MMMissingAuthDialog"

onClicked: {
missingAuthDialog.open()
}
}
}
}

Expand Down Expand Up @@ -217,4 +225,8 @@ Page {
MMNoPermissionsDialog {
id: noPermissionsDialog
}

MMMissingAuthDialog {
id: missingAuthDialog
}
}
1 change: 1 addition & 0 deletions gallery/qml/pages/ImagesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ScrollView {
Column { Image { source: __style.noWifiImage } Text { text: "noWifiImage" } }
Column { Image { source: __style.syncFailedImage } Text { text: "syncFailedImage " } }
Column { Image { source: __style.noPermissionsImage } Text { text: "noPermissionsImage" } }
Column { Image { source: __style.signInImage } Text { text: "signInImage" } }
}
}

Expand Down

0 comments on commit c0844c0

Please sign in to comment.