on xenial help sign in
prevent unchecking a location method
4d8a9d7Lukáš Tinkl
plugins/Wizard/LocalePlugin.cpp+4−2
@@ -43,7 +43,9 @@ QJsonObject LocaleAttached::countriesForLanguage(const QString &code) const
43 Q_FOREACH(const QLocale &loc, allLocales) {
43 Q_FOREACH(const QLocale &loc, allLocales) {
44 const QString countryCode = loc.name().section('_', 1, 1);
44 const QString countryCode = loc.name().section('_', 1, 1);
45 //qDebug() << "Matching country:" << countryCode;
45 //qDebug() << "Matching country:" << countryCode;
46+ if (!countryCode.isEmpty()) {
46− result.insert(countryCode, QLocale::countryToString(loc.country()));
47+ result.insert(countryCode, QLocale::countryToString(loc.country()));
48+ }
47 }
49 }
48 return result;
50 return result;
49}
51}
@@ -55,7 +57,7 @@ QJsonObject LocaleAttached::countries() const
55
57
56 Q_FOREACH(const QLocale &loc, allLocales) {
58 Q_FOREACH(const QLocale &loc, allLocales) {
57 const QString countryCode = loc.name().section('_', 1, 1);
59 const QString countryCode = loc.name().section('_', 1, 1);
58− if (!countryCode.isEmpty() && countryCode.length() == 2) {
60+ if (countryCode.length() == 2) {
59 result.insert(countryCode, QLocale::countryToString(loc.country()));
61 result.insert(countryCode, QLocale::countryToString(loc.country()));
60 }
62 }
61 }
63 }
plugins/Wizard/timezonemodel.cpp+1−1
@@ -67,7 +67,7 @@ QVariant TimeZoneModel::data(const QModelIndex &index, int role) const
67 case Country:
67 case Country:
68 return QLocale::countryToString(tz.country());
68 return QLocale::countryToString(tz.country());
69 case City: {
69 case City: {
70− const QString cityName = QString::fromUtf8(tzid.split('/').last().replace("_", " "));
70+ const QString cityName = QString::fromUtf8(tzid.split('/').last().replace("_", " ")); // take the last part, replace _ by a space
71 return cityName;
71 return cityName;
72 }
72 }
73 case Comment:
73 case Comment:
qml/Wizard/Pages/15-country.qml+1−1
@@ -97,7 +97,7 @@ LocalComponents.Page {
97 criteria: ViewSection.FullString;
97 criteria: ViewSection.FullString;
98 labelPositioning: ViewSection.InlineLabels | ViewSection.CurrentLabelAtStart
98 labelPositioning: ViewSection.InlineLabels | ViewSection.CurrentLabelAtStart
99 delegate: Label {
99 delegate: Label {
100− fontSize: "large"
100+ fontSize: "x-large"
101 }
101 }
102 }
102 }
103
103
qml/Wizard/Pages/50-location.qml+6−3
@@ -84,7 +84,8 @@ LocalComponents.Page {
84 MouseArea {
84 MouseArea {
85 anchors.fill: parent
85 anchors.fill: parent
86 onClicked: {
86 onClicked: {
87+ if (!hereCheckLabel.checked)
87− hereCheckLabel.checked = !hereCheckLabel.checked
88+ hereCheckLabel.checked = true
88 }
89 }
89 }
90 }
90 }
91 }
@@ -135,7 +136,8 @@ LocalComponents.Page {
135 MouseArea {
136 MouseArea {
136 anchors.fill: parent
137 anchors.fill: parent
137 onClicked: {
138 onClicked: {
139+ if (!gpsCheckLabel.checked)
138− gpsCheckLabel.checked = !gpsCheckLabel.checked
140+ gpsCheckLabel.checked = true
139 }
141 }
140 }
142 }
141 }
143 }
@@ -168,7 +170,8 @@ LocalComponents.Page {
168 MouseArea {
170 MouseArea {
169 anchors.fill: parent
171 anchors.fill: parent
170 onClicked: {
172 onClicked: {
173+ if (!nopeCheckLabel.checked)
171− nopeCheckLabel.checked = !nopeCheckLabel.checked
174+ nopeCheckLabel.checked = true
172 }
175 }
173 }
176 }
174 }
177 }