From a51298cf71665419e4b09b3951450f2fe0341926 Mon Sep 17 00:00:00 2001 From: Valentin Buira Date: Fri, 19 Jul 2024 13:10:11 +0200 Subject: [PATCH] Add student/university as an option in the industries list --- app/icons/Student.svg | 5 +++++ app/icons/icons.qrc | 1 + app/mmstyle.h | 2 ++ app/qml/account/MMAccountController.qml | 18 ------------------ app/qml/account/MMHowYouFoundUsPage.qml | 18 ++++++++++++++++++ app/qml/account/MMWhichIndustryPage.qml | 24 +++++++++++++++++++++++- 6 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 app/icons/Student.svg diff --git a/app/icons/Student.svg b/app/icons/Student.svg new file mode 100644 index 000000000..1474d1cfc --- /dev/null +++ b/app/icons/Student.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/app/icons/icons.qrc b/app/icons/icons.qrc index a4f672322..c3f553a97 100644 --- a/app/icons/icons.qrc +++ b/app/icons/icons.qrc @@ -96,5 +96,6 @@ Youtube.svg ZoomToProject.svg StakeOut.svg + Student.svg diff --git a/app/mmstyle.h b/app/mmstyle.h index 0b548ad7f..9288cd98c 100644 --- a/app/mmstyle.h +++ b/app/mmstyle.h @@ -161,6 +161,7 @@ class MMStyle: public QObject Q_PROPERTY( QUrl undoIcon READ undoIcon CONSTANT ) Q_PROPERTY( QUrl waitingIcon READ waitingIcon CONSTANT ) Q_PROPERTY( QUrl waterResourcesIcon READ waterResourcesIcon CONSTANT ) + Q_PROPERTY( QUrl studentIcon READ studentIcon CONSTANT ) Q_PROPERTY( QUrl xTwitterIcon READ xTwitterIcon CONSTANT ) Q_PROPERTY( QUrl youtubeIcon READ youtubeIcon CONSTANT ) Q_PROPERTY( QUrl splitGeometryIcon READ splitGeometryIcon CONSTANT ) @@ -450,6 +451,7 @@ class MMStyle: public QObject QUrl undoIcon() {return QUrl( "qrc:/Undo.svg" );} QUrl waitingIcon() {return QUrl( "qrc:/Waiting.svg" );} QUrl waterResourcesIcon() {return QUrl( "qrc:/WaterResources.svg" );} + QUrl studentIcon() {return QUrl( "qrc:/Student.svg" );} QUrl xTwitterIcon() {return QUrl( "qrc:/XTwitter.svg" );} QUrl youtubeIcon() {return QUrl( "qrc:/Youtube.svg" );} diff --git a/app/qml/account/MMAccountController.qml b/app/qml/account/MMAccountController.qml index bc611853d..96e1ceb3c 100644 --- a/app/qml/account/MMAccountController.qml +++ b/app/qml/account/MMAccountController.qml @@ -46,24 +46,6 @@ Item { stackView.pop(null); } - function shuffleAndAppend( listModel, items ) - { - items = items - .map(function( item ) { - return { value: item, sort: Math.random() }; - }) - .sort(function( a, b ) { - return a.sort - b.sort; - }) - .map(function( obj ) { - return obj.value; - }); - - items.forEach( function( item ) { - listModel.append( item ); - }); - } - Connections { target: __merginApi enabled: controller.inProgress diff --git a/app/qml/account/MMHowYouFoundUsPage.qml b/app/qml/account/MMHowYouFoundUsPage.qml index cc280a8ed..66a84031e 100644 --- a/app/qml/account/MMHowYouFoundUsPage.qml +++ b/app/qml/account/MMHowYouFoundUsPage.qml @@ -228,4 +228,22 @@ MMPage { } } } + + function shuffleAndAppend( listModel, items ) + { + items = items + .map(function( item ) { + return { value: item, sort: Math.random() }; + }) + .sort(function( a, b ) { + return a.sort - b.sort; + }) + .map(function( obj ) { + return obj.value; + }); + + items.forEach( function( item ) { + listModel.append( item ); + }); + } } diff --git a/app/qml/account/MMWhichIndustryPage.qml b/app/qml/account/MMWhichIndustryPage.qml index e8fb981e3..a0f76766b 100644 --- a/app/qml/account/MMWhichIndustryPage.qml +++ b/app/qml/account/MMWhichIndustryPage.qml @@ -38,7 +38,8 @@ MMPage { { name: qsTr( "Natural resources" ), key: "natural", icon: __style.naturalResourcesIcon, colorx: __style.earthColor, color: "#4D2A24" }, { name: qsTr( "Telecom" ), key: "telecom", icon: __style.telecommunicationIcon, colorx: __style.deepOceanColor, color: "#1C324A" }, { name: qsTr( "Transportation" ), key: "transportation", icon: __style.transportationIcon, colorx: __style.skyColor, color: "#A6CBF4" }, - { name: qsTr( "Water utilities" ), key: "water", icon: __style.waterResourcesIcon, colorx: __style.lightGreenColor, color: "#EFF5F3" } + { name: qsTr( "Water utilities" ), key: "water", icon: __style.waterResourcesIcon, colorx: __style.lightGreenColor, color: "#EFF5F3" }, + { name: qsTr( "Student/University" ), key: "student", icon: __style.studentIcon, colorx: __style.grapeColor, color: "#5A2740" } ]; var otherItem = { name: qsTr( "Other" ), key: "other", icon: __style.otherIcon, colorx: __style.sunsetColor, color: "#FFB673" }; @@ -217,4 +218,25 @@ MMPage { } } } + + function shuffleAndAppend( listModel, items ) + { + items = items + .map(function( item ) { + return { value: item, sort: Math.random() }; + }) + .sort(function( a, b ) { + return a.sort - b.sort; + }) + .map(function( obj ) { + return obj.value; + }); + + items.forEach( function( item ) { + listModel.append( item ); + }); + } } + + +