Skip to content

Commit

Permalink
Redesign of the NoPermissionsDialog (#3088)
Browse files Browse the repository at this point in the history
MMNoPermissionsDialog
  • Loading branch information
VitorVieiraZ authored Feb 29, 2024
1 parent 5a3a2b6 commit d8371d5
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 4 deletions.
14 changes: 14 additions & 0 deletions app/images/NoPermissions.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 @@ -29,5 +29,6 @@
<file>StreamingBootsOrange.svg</file>
<file>NoWifi.svg</file>
<file>SyncFailed.svg</file>
<file>NoPermissions.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 @@ -182,6 +182,7 @@ class MMStyle: public QObject
Q_PROPERTY( QUrl uploadImage READ uploadImage CONSTANT )
Q_PROPERTY( QUrl noMapThemesImage READ noMapThemesImage CONSTANT )
Q_PROPERTY( QUrl syncFailedImage READ syncFailedImage CONSTANT )
Q_PROPERTY( QUrl noPermissionsImage READ noPermissionsImage 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 @@ -412,6 +413,7 @@ class MMStyle: public QObject
QUrl uploadImage() {return QUrl( "qrc:/images/UploadImage.svg" );}
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 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 @@ -8,7 +8,7 @@ set(MM_QML
components/TextWithIcon.qml
dialogs/MigrateToMerginDialog.qml
dialogs/MissingAuthDialog.qml
dialogs/NoPermissionsDialog.qml
dialogs/MMNoPermissionsDialog.qml
dialogs/SplittingFailedDialog.qml
dialogs/SyncFailedDialog.qml
dialogs/MMSyncFailedDialog.qml
Expand Down
25 changes: 25 additions & 0 deletions app/qml/dialogs/MMNoPermissionsDialog.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/***************************************************************************
* *
* 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

picture: __style.noPermissionsImage
bigTitle: qsTr( "No rights to access the project" )
description: qsTr( "You are not allowed to synchronize your changes in this project. Contact the project owner to assign you the correct permission. If you are the project owner, log in to the dashboard." )
primaryButton: qsTr( "Ok, I understand" )

onPrimaryButtonClicked: {
close()
}
}
2 changes: 1 addition & 1 deletion app/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ ApplicationWindow {
onMigrationRequested: __syncManager.migrateProjectToMergin( __activeProject.projectFullName() )
}

NoPermissionsDialog {
MMNoPermissionsDialog {
id: noPermissionsDialog
}

Expand Down
1 change: 1 addition & 0 deletions gallery/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@
<file>../app/qml/settings/MMSettingSwitch.qml</file>
<file>../app/qml/gps/MMBluetoothConnectionDrawer.qml</file>
<file>../app/qml/dialogs/MMSyncFailedDialog.qml</file>
<file>../app/qml/dialogs/MMNoPermissionsDialog.qml</file>
</qresource>
</RCC>
17 changes: 15 additions & 2 deletions gallery/qml/pages/DrawerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,17 @@ Page {

MMButton {
text: "MMSyncFailedDialog"

onClicked: {
drawer4.open()
syncFailedDialog.open()
}
}

MMButton {
text: "MMNoPermissionsDialog"

onClicked: {
noPermissionsDialog.open()
}
}
}
Expand Down Expand Up @@ -198,6 +207,10 @@ Page {
}

MMSyncFailedDialog {
id: drawer4
id: syncFailedDialog
}

MMNoPermissionsDialog {
id: noPermissionsDialog
}
}

0 comments on commit d8371d5

Please sign in to comment.