Skip to content

Commit

Permalink
Add a new option in the list of industries for Students/University (#…
Browse files Browse the repository at this point in the history
…3540)

* Add student/university as an option in the industries list

* Remove unused "colorx" property from the sourceListModel

* Fix wrong key used
  • Loading branch information
ValentinBuira authored Jul 22, 2024
1 parent 619d682 commit 0f8a801
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 29 deletions.
5 changes: 5 additions & 0 deletions app/icons/Student.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/icons/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,6 @@
<file>Youtube.svg</file>
<file>ZoomToProject.svg</file>
<file>StakeOut.svg</file>
<file>Student.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 @@ -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 )
Expand Down Expand Up @@ -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" );}

Expand Down
18 changes: 0 additions & 18 deletions app/qml/account/MMAccountController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions app/qml/account/MMHowYouFoundUsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
});
}
}
44 changes: 33 additions & 11 deletions app/qml/account/MMWhichIndustryPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@ MMPage {

Component.onCompleted: {
var items = [
{ name: qsTr( "Agriculture" ), key: "agriculture", icon: __style.tractorIcon, colorx: __style.sunColor, color: "#F4CB46" },
{ name: qsTr( "Archaeology" ), key: "archaeology", icon: __style.archaeologyIcon, colorx: __style.sandColor, color: "#FFF4E2" },
{ name: qsTr( "Construction and engineering" ), key: "engineering", icon: __style.engineeringIcon, colorx: __style.roseColor, color: "#FFBABC" },
{ name: qsTr( "Electric utilities" ), key: "electricity", icon: __style.electricityIcon, colorx: __style.nightColor, color: "#12181F" },
{ name: qsTr( "Environmental protection" ), key: "environmental", icon: __style.environmentalIcon, colorx: __style.fieldColor, color: "#9BD1A9" },
{ name: qsTr( "Local governments" ), key: "gov", icon: __style.stateAndLocalIcon, colorx: __style.purpleColor, color: "#CCBDF5" },
{ 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( "Agriculture" ), key: "agriculture", icon: __style.tractorIcon, color: __style.sunColor },
{ name: qsTr( "Archaeology" ), key: "archaeology", icon: __style.archaeologyIcon, color: __style.sandColor },
{ name: qsTr( "Construction and engineering" ), key: "engineering", icon: __style.engineeringIcon, color: __style.roseColor },
{ name: qsTr( "Electric utilities" ), key: "electricity", icon: __style.electricityIcon, color: __style.nightColor },
{ name: qsTr( "Environmental protection" ), key: "environmental", icon: __style.environmentalIcon, color: __style.fieldColor },
{ name: qsTr( "Local governments" ), key: "gov", icon: __style.stateAndLocalIcon, color: __style.purpleColor },
{ name: qsTr( "Natural resources" ), key: "natural", icon: __style.naturalResourcesIcon, color: __style.earthColor },
{ name: qsTr( "Telecom" ), key: "telecom", icon: __style.telecommunicationIcon, color: __style.deepOceanColor },
{ name: qsTr( "Transportation" ), key: "transportation", icon: __style.transportationIcon, color: __style.skyColor },
{ name: qsTr( "Water utilities" ), key: "water", icon: __style.waterResourcesIcon, color: __style.lightGreenColor },
{ name: qsTr( "Student/University" ), key: "university", icon: __style.studentIcon, color: __style.grapeColor }
];

var otherItem = { name: qsTr( "Other" ), key: "other", icon: __style.otherIcon, colorx: __style.sunsetColor, color: "#FFB673" };
var otherItem = { name: qsTr( "Other" ), key: "other", icon: __style.otherIcon, color: __style.sunsetColor };

shuffleAndAppend( sourceListModel, items );

Expand Down Expand Up @@ -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 );
});
}
}



1 comment on commit 0f8a801

@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 24.7.642911 just submitted!

Please sign in to comment.