mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-06 16:45:26 +02:00
WelcomePage: add possibility to switch languages
Allow switching languages directly when creating an account. Change-Id: I73bf3e72e4ceb48c95210447335c8191981d3546
This commit is contained in:
parent
91780ae400
commit
05501e33e9
2 changed files with 41 additions and 1 deletions
|
@ -362,6 +362,8 @@ Rectangle {
|
||||||
|
|
||||||
JamiPushButton {
|
JamiPushButton {
|
||||||
id: backButton
|
id: backButton
|
||||||
|
QWKSetParentHitTestVisible {
|
||||||
|
}
|
||||||
|
|
||||||
objectName: "createAccountPageBackButton"
|
objectName: "createAccountPageBackButton"
|
||||||
|
|
||||||
|
|
|
@ -18,15 +18,18 @@ import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtMultimedia
|
import QtMultimedia
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
import net.jami.Models 1.1
|
|
||||||
import net.jami.Adapters 1.1
|
import net.jami.Adapters 1.1
|
||||||
import net.jami.Constants 1.1
|
import net.jami.Constants 1.1
|
||||||
|
import net.jami.Enums 1.1
|
||||||
|
import net.jami.Models 1.1
|
||||||
import "../../commoncomponents"
|
import "../../commoncomponents"
|
||||||
import "../../mainview/components"
|
import "../../mainview/components"
|
||||||
|
import "../../settingsview/components"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property int itemWidth: 188
|
||||||
property int preferredHeight: welcomePageColumnLayout.implicitHeight + 2 * JamiTheme.wizardViewPageBackButtonMargins + JamiTheme.wizardViewPageBackButtonSize
|
property int preferredHeight: welcomePageColumnLayout.implicitHeight + 2 * JamiTheme.wizardViewPageBackButtonMargins + JamiTheme.wizardViewPageBackButtonSize
|
||||||
property bool showTab: false
|
property bool showTab: false
|
||||||
property bool showAlreadyHave: false
|
property bool showAlreadyHave: false
|
||||||
|
@ -408,4 +411,39 @@ Rectangle {
|
||||||
|
|
||||||
onClicked: WizardViewStepModel.previousStep()
|
onClicked: WizardViewStepModel.previousStep()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsComboBox {
|
||||||
|
id: langComboBoxSetting
|
||||||
|
|
||||||
|
height: JamiTheme.preferredFieldHeight + 20
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.margins: JamiTheme.wizardViewPageBackButtonMargins
|
||||||
|
|
||||||
|
labelText: JamiStrings.language
|
||||||
|
tipText: JamiStrings.language
|
||||||
|
comboModel: ListModel {
|
||||||
|
id: langModel
|
||||||
|
Component.onCompleted: {
|
||||||
|
var supported = UtilsAdapter.supportedLang();
|
||||||
|
var keys = Object.keys(supported);
|
||||||
|
var currentKey = UtilsAdapter.getAppValue(Settings.Key.LANG);
|
||||||
|
for (var i = 0; i < keys.length; ++i) {
|
||||||
|
append({
|
||||||
|
"textDisplay": supported[keys[i]],
|
||||||
|
"id": keys[i]
|
||||||
|
});
|
||||||
|
if (keys[i] === currentKey)
|
||||||
|
langComboBoxSetting.modelIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
widthOfComboBox: itemWidth
|
||||||
|
role: "textDisplay"
|
||||||
|
|
||||||
|
onActivated: {
|
||||||
|
UtilsAdapter.setAppValue(Settings.Key.LANG, comboModel.get(modelIndex).id);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue