Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new option in the list of industries for Students/University #3540

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 )
Copy link
Contributor

Choose a reason for hiding this comment

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

We can keep shuffleAndAppend method exclusively in MMAccountController, as it will be inherited by both MMWhichIndustryPage and MMHowYouFoundUsPage. This way, there is no need to declare it twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was moved to make the "MerginMapsGallery" app working as the gallery don't inherit MMAccountController, afaik but maybe there is a more clever way to separate business logic with UI

{
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 );
});
}
}
24 changes: 23 additions & 1 deletion app/qml/account/MMWhichIndustryPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
ValentinBuira marked this conversation as resolved.
Show resolved Hide resolved
{ name: qsTr( "Student/University" ), key: "student", icon: __style.studentIcon, colorx: __style.grapeColor, color: "#5A2740" }
ValentinBuira marked this conversation as resolved.
Show resolved Hide resolved
];

var otherItem = { name: qsTr( "Other" ), key: "other", icon: __style.otherIcon, colorx: __style.sunsetColor, color: "#FFB673" };
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 );
});
}
}



Loading