mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-25 13:09:26 +00:00
wizard: skip language page if only 1 language is availible
This commit is contained in:
parent
b795c4b0d7
commit
675e35d717
1 changed files with 16 additions and 3 deletions
|
@ -45,13 +45,18 @@ Item {
|
||||||
|
|
||||||
onOpacityChanged: visible = opacity !== 0
|
onOpacityChanged: visible = opacity !== 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function onPageClosed(settingsObject) {
|
function onPageClosed(settingsObject) {
|
||||||
|
|
||||||
|
// set default language to first item if none selected
|
||||||
|
if(gridView.currentIndex === -1) {
|
||||||
|
gridView.currentIndex = 0
|
||||||
|
}
|
||||||
|
|
||||||
var lang = languagesModel.get(gridView.currentIndex);
|
var lang = languagesModel.get(gridView.currentIndex);
|
||||||
settingsObject['language'] = lang.display_name;
|
settingsObject['language'] = lang.display_name;
|
||||||
settingsObject['wallet_language'] = lang.wallet_language;
|
settingsObject['wallet_language'] = lang.wallet_language;
|
||||||
settingsObject['locale'] = lang.locale;
|
settingsObject['locale'] = lang.locale;
|
||||||
|
console.log("Language chosen: ",lang.display_name)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +113,15 @@ Item {
|
||||||
// and set current language accordingly
|
// and set current language accordingly
|
||||||
XmlRole { name: "isCurrent"; query: "@enabled/string()" }
|
XmlRole { name: "isCurrent"; query: "@enabled/string()" }
|
||||||
|
|
||||||
|
onStatusChanged: {
|
||||||
|
if(status === XmlListModel.Ready){
|
||||||
|
console.log("languages availible: ",count);
|
||||||
|
if(count === 1){
|
||||||
|
console.log("Skipping language page until more languages are availible")
|
||||||
|
wizard.switchPage(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flags view
|
// Flags view
|
||||||
|
|
Loading…
Reference in a new issue