Skip to content

Commit

Permalink
which industry page
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Dec 11, 2023
1 parent 70ff953 commit 4fff19d
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/qml/onboarding/MMHowYouFoundUs.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ Page {

var items = [
youtubeSocialMediaSource,
twitterSocialMediaSource,
facebookSocialMediaSource,
linkedinSocialMediaSource,
mastodonSocialMediaSource,
redditSocialMediaSource,
twitterSocialMediaSource,
facebookSocialMediaSource,
linkedinSocialMediaSource,
mastodonSocialMediaSource,
redditSocialMediaSource,
]

uncheck(except, isChecked, items)
Expand Down
118 changes: 117 additions & 1 deletion app/qml/onboarding/MMWhichIndustry.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,31 @@ Page {
signal backClicked
signal continueClicked

function uncheckAll(except, isChecked) {
if (!isChecked)
return;

var items = [
agricultureSource,
archaeologySource,
engineeringSource,
electricitySource,
environmentalSource,
stateAndLocalSource,
naturalResourcesSource,
telecommunicationSource,
transportationSource,
waterResourcesSource,
othersSource
]

items.forEach( function(item) {
if (item !== except) {
item.checked = false
}
} )
}

Column {
MMHeader {
headerTitle: qsTr("Which industry")
Expand All @@ -26,7 +51,98 @@ Page {
onBackClicked: root.backClicked()
}

ToolButton {
Grid {
columns: 2
spacing: 10

MMIconCheckBoxVertical {
id: agricultureSource
sourceIcon: __style.tractorIcon
text: qsTr("Agriculture")
onToggled: uncheckAll(agricultureSource, checked)
bgColorIcon: __style.sunColor
}
MMIconCheckBoxVertical {
id: archaeologySource
sourceIcon: __style.archaeologyIcon
text: qsTr("Archaeology")
onToggled: uncheckAll(archaeologySource, checked)
bgColorIcon: __style.sandColor
}
MMIconCheckBoxVertical {
id: engineeringSource
sourceIcon: __style.engineeringIcon
text: qsTr("Construction and engineering")
onToggled: uncheckAll(engineeringSource, checked)
bgColorIcon: __style.roseColor
}
MMIconCheckBoxVertical {
id: electricitySource
sourceIcon: __style.electricityIcon
text: qsTr("Electric utilities")
onToggled: uncheckAll(electricitySource, checked)
bgColorIcon: __style.nightColor
}
MMIconCheckBoxVertical {
id: environmentalSource
sourceIcon: __style.environmentalIcon
text: qsTr("Environmental protection")
onToggled: uncheckAll(environmentalSource, checked)
bgColorIcon: __style.fieldColor
}
MMIconCheckBoxVertical {
id: stateAndLocalSource
sourceIcon: __style.stateAndLocalIcon
text: qsTr("Local governments")
onToggled: uncheckAll(stateAndLocalSource, checked)
bgColorIcon: __style.purpleColor
}
MMIconCheckBoxVertical {
id: naturalResourcesSource
sourceIcon: __style.naturalResourcesIcon
text: qsTr("Natural resources")
onToggled: uncheckAll(naturalResourcesSource, checked)
bgColorIcon: __style.earthColor
}
MMIconCheckBoxVertical {
id: telecommunicationSource
sourceIcon: __style.telecommunicationIcon
text: qsTr("Telecom")
onToggled: uncheckAll(telecommunicationSource, checked)
bgColorIcon: __style.deepOceanColor
}
MMIconCheckBoxVertical {
id: transportationSource
sourceIcon: __style.transportationIcon
text: qsTr("Transportation")
onToggled: uncheckAll(transportationSource, checked)
bgColorIcon: __style.skyColor
}
MMIconCheckBoxVertical {
id: waterResourcesSource
sourceIcon: __style.waterResourcesIcon
text: qsTr("Water utilities")
onToggled: uncheckAll(waterResourcesSource, checked)
bgColorIcon: __style.lightGreenColor
}

MMIconCheckBoxVertical {
id: othersSource
sourceIcon: __style.othersIcon
text: qsTr("Others")
onToggled: uncheckAll(othersSource, checked)
bgColorIcon: __style.sunsetColor
}
}

MMInput {
id: othersSourceDescription
visible: othersSource.checked
title: qsTr("Industry")
placeholderText: qsTr("Please specify the industry")
}

MMButton {
onClicked: root.continueClicked()
text: qsTr("Continue")
}
Expand Down

0 comments on commit 4fff19d

Please sign in to comment.