mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 14:55:43 +02:00
SettingsPage: dynamically load the individual pages of the settings view
Replace StackLayout with StackView. The StackView manages the lifetime of the view. GitLab: #897 Change-Id: I25892310eb83ad70f4b06f91e94ec5ea8b87ef86
This commit is contained in:
parent
acd4b3065c
commit
72f7b37503
17 changed files with 94 additions and 107 deletions
|
@ -36,23 +36,24 @@ ListSelectionView {
|
||||||
id: viewNode
|
id: viewNode
|
||||||
objectName: "SettingsView"
|
objectName: "SettingsView"
|
||||||
|
|
||||||
enum SettingsMenu {
|
// A map of view names to file paths for QML files that define each view.
|
||||||
ManageAccount,
|
property variant resources: {
|
||||||
CustomizeProfile,
|
"ManageAccountPage": Qt.resolvedUrl("components/ManageAccountPage.qml"),
|
||||||
LinkedDevices,
|
"CustomizeProfilePage": Qt.resolvedUrl("components/CustomizeProfilePage.qml"),
|
||||||
AdvancedSettings,
|
"LinkedDevicesPage": Qt.resolvedUrl("components/LinkedDevicesPage.qml"),
|
||||||
System,
|
"CallSettingsPage": Qt.resolvedUrl("components/CallSettingsPage.qml"),
|
||||||
CallSettings,
|
"AdvancedSettingsPage": Qt.resolvedUrl("components/AdvancedSettingsPage.qml"),
|
||||||
Appearence,
|
"SystemSettingsPage": Qt.resolvedUrl("components/SystemSettingsPage.qml"),
|
||||||
LocationSharing,
|
"AppearenceSettingsPage": Qt.resolvedUrl("components/AppearenceSettingsPage.qml"),
|
||||||
FileTransfer,
|
"LocationSharingSettingsPage": Qt.resolvedUrl("components/LocationSharingSettingsPage.qml"),
|
||||||
CallRecording,
|
"FileTransferSettingsPage": Qt.resolvedUrl("components/FileTransferSettingsPage.qml"),
|
||||||
Troubleshoot,
|
"CallRecordingSettingsPage": Qt.resolvedUrl("components/CallRecordingSettingsPage.qml"),
|
||||||
Update,
|
"TroubleshootSettingsPage": Qt.resolvedUrl("components/TroubleshootSettingsPage.qml"),
|
||||||
Audio,
|
"UpdatesSettingsPage": Qt.resolvedUrl("components/UpdatesSettingsPage.qml"),
|
||||||
Video,
|
"AudioSettingsPage": Qt.resolvedUrl("components/AudioSettingsPage.qml"),
|
||||||
Screensharing,
|
"VideoSettingsPage": Qt.resolvedUrl("components/VideoSettingsPage.qml"),
|
||||||
Plugin
|
"ScreenSharingSettingsPage": Qt.resolvedUrl("components/ScreenSharingSettingsPage.qml"),
|
||||||
|
"PluginSettingsPage": Qt.resolvedUrl("components/PluginSettingsPage.qml"),
|
||||||
}
|
}
|
||||||
|
|
||||||
splitViewStateKey: "Main"
|
splitViewStateKey: "Main"
|
||||||
|
@ -83,50 +84,71 @@ ListSelectionView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rightPaneItem: StackLayout {
|
rightPaneItem: StackView {
|
||||||
id: settingsViewRect
|
id: settingsView
|
||||||
|
objectName: "settingsView"
|
||||||
|
|
||||||
currentIndex: selectedMenu !== -1 ? selectedMenu : 0
|
property var currentIndex: selectedMenu !== -1 ? selectedMenu : 0
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
signal stopBooth
|
signal stopBooth
|
||||||
|
|
||||||
property bool isSIP: CurrentAccount.type === Profile.Type.SIP
|
initialItem: ManageAccountPage {}
|
||||||
|
|
||||||
|
onCurrentIndexChanged: {
|
||||||
|
|
||||||
|
switch(currentIndex) {
|
||||||
|
default:
|
||||||
|
case 0:
|
||||||
|
replace(currentItem, viewNode.resources["ManageAccountPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
replace(currentItem, viewNode.resources["CustomizeProfilePage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
replace(currentItem, viewNode.resources["LinkedDevicesPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
replace(currentItem, viewNode.resources["CallSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 4:
|
||||||
|
replace(currentItem, viewNode.resources["AdvancedSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 5:
|
||||||
|
replace(currentItem, viewNode.resources["SystemSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 6:
|
||||||
|
replace(currentItem, viewNode.resources["AppearenceSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 7:
|
||||||
|
replace(currentItem, viewNode.resources["LocationSharingSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 8:
|
||||||
|
replace(currentItem, viewNode.resources["FileTransferSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 9:
|
||||||
|
replace(currentItem, viewNode.resources["CallRecordingSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 10:
|
||||||
|
replace(currentItem, viewNode.resources["TroubleshootSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 11:
|
||||||
|
replace(currentItem, viewNode.resources["UpdatesSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 12:
|
||||||
|
replace(currentItem, viewNode.resources["AudioSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 13:
|
||||||
|
replace(currentItem, viewNode.resources["VideoSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 14:
|
||||||
|
replace(currentItem, viewNode.resources["ScreenSharingSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
case 15:
|
||||||
|
replace(currentItem, viewNode.resources["PluginSettingsPage"], StackView.Immediate)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
ManageAccountPage {
|
|
||||||
isSIP: settingsViewRect.isSIP
|
|
||||||
onNavigateToMainView: dismiss()
|
|
||||||
onNavigateToNewWizardView: dismiss()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomizeProfilePage {}
|
|
||||||
|
|
||||||
LinkedDevicesPage {}
|
|
||||||
|
|
||||||
CallSettingsPage {}
|
|
||||||
|
|
||||||
AdvancedSettingsPage {}
|
|
||||||
|
|
||||||
SystemSettingsPage {}
|
|
||||||
|
|
||||||
AppearenceSettingsPage {}
|
|
||||||
|
|
||||||
LocationSharingSettingsPage {}
|
|
||||||
|
|
||||||
FileTransferSettingsPage{}
|
|
||||||
|
|
||||||
CallRecordingSettingsPage {}
|
|
||||||
|
|
||||||
TroubleshootSettingsPage {}
|
|
||||||
|
|
||||||
UpdatesSettingsPage {}
|
|
||||||
|
|
||||||
AudioSettingsPage {}
|
|
||||||
|
|
||||||
VideoSettingsPage {}
|
|
||||||
|
|
||||||
ScreenSharingSettingsPage {}
|
|
||||||
|
|
||||||
PluginSettingsPage {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,6 @@ SettingsPageBase {
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
signal showAdvancedSettingsRequest
|
signal showAdvancedSettingsRequest
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
|
|
||||||
title: JamiStrings.advancedSettingsTitle
|
title: JamiStrings.advancedSettingsTitle
|
||||||
|
|
||||||
flickableContent: ColumnLayout {
|
flickableContent: ColumnLayout {
|
||||||
|
|
|
@ -36,9 +36,6 @@ SettingsPageBase {
|
||||||
|
|
||||||
property int itemWidth: 188
|
property int itemWidth: 188
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
|
|
||||||
title: JamiStrings.appearence
|
title: JamiStrings.appearence
|
||||||
|
|
||||||
flickableContent: ColumnLayout {
|
flickableContent: ColumnLayout {
|
||||||
|
|
|
@ -30,9 +30,6 @@ SettingsPageBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int itemWidth: 188
|
property int itemWidth: 188
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.audio
|
title: JamiStrings.audio
|
||||||
|
|
||||||
flickableContent: ColumnLayout {
|
flickableContent: ColumnLayout {
|
||||||
|
|
|
@ -38,9 +38,6 @@ SettingsPageBase {
|
||||||
property string screenshotPathBestName: UtilsAdapter.dirName(UtilsAdapter.getDirScreenshot())
|
property string screenshotPathBestName: UtilsAdapter.dirName(UtilsAdapter.getDirScreenshot())
|
||||||
|
|
||||||
property int itemWidth: 188
|
property int itemWidth: 188
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.callRecording
|
title: JamiStrings.callRecording
|
||||||
|
|
||||||
onRecordPathChanged: {
|
onRecordPathChanged: {
|
||||||
|
|
|
@ -37,9 +37,6 @@ SettingsPageBase {
|
||||||
|
|
||||||
property bool isSIP
|
property bool isSIP
|
||||||
property int itemWidth: 132
|
property int itemWidth: 132
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.callSettingsTitle
|
title: JamiStrings.callSettingsTitle
|
||||||
|
|
||||||
function updateAndShowModeratorsSlot() {
|
function updateAndShowModeratorsSlot() {
|
||||||
|
|
|
@ -30,8 +30,6 @@ import "../../commoncomponents"
|
||||||
SettingsPageBase {
|
SettingsPageBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.customizeProfile
|
title: JamiStrings.customizeProfile
|
||||||
|
|
||||||
function stopBooth() {
|
function stopBooth() {
|
||||||
|
@ -53,7 +51,7 @@ SettingsPageBase {
|
||||||
Layout.preferredWidth: parent.width
|
Layout.preferredWidth: parent.width
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: settingsViewRect
|
target: settingsView
|
||||||
|
|
||||||
function onStopBooth() {
|
function onStopBooth() {
|
||||||
stopBooth()
|
stopBooth()
|
||||||
|
|
|
@ -32,9 +32,6 @@ SettingsPageBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int itemWidth: 164
|
property int itemWidth: 164
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.fileTransfer
|
title: JamiStrings.fileTransfer
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,11 +32,8 @@ import "../../commoncomponents"
|
||||||
SettingsPageBase {
|
SettingsPageBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.linkedDevicesSettingsTitle
|
title: JamiStrings.linkedDevicesSettingsTitle
|
||||||
|
|
||||||
|
|
||||||
flickableContent: ColumnLayout {
|
flickableContent: ColumnLayout {
|
||||||
id: currentAccountEnableColumnLayout
|
id: currentAccountEnableColumnLayout
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,6 @@ SettingsPageBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int itemWidth: 578
|
property int itemWidth: 578
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.locationSharingLabel
|
title: JamiStrings.locationSharingLabel
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,12 @@ import "../../commoncomponents"
|
||||||
SettingsPageBase {
|
SettingsPageBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool isSIP
|
property bool isSIP: CurrentAccount.type === Profile.Type.SIP
|
||||||
property int itemWidth: 250
|
property int itemWidth: 250
|
||||||
|
|
||||||
signal navigateToMainView
|
signal navigateToMainView
|
||||||
signal navigateToNewWizardView
|
|
||||||
|
onNavigateToMainView: viewNode.dismiss()
|
||||||
|
|
||||||
title: JamiStrings.manageAccountSettingsTitle
|
title: JamiStrings.manageAccountSettingsTitle
|
||||||
|
|
||||||
flickableContent: ColumnLayout {
|
flickableContent: ColumnLayout {
|
||||||
|
|
|
@ -34,8 +34,6 @@ SettingsPageBase {
|
||||||
|
|
||||||
property int itemWidth: 150
|
property int itemWidth: 150
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.screenSharing
|
title: JamiStrings.screenSharing
|
||||||
|
|
||||||
flickableContent: ColumnLayout {
|
flickableContent: ColumnLayout {
|
||||||
|
|
|
@ -62,5 +62,6 @@ Page {
|
||||||
contentItem.children: [flickableContent]
|
contentItem.children: [flickableContent]
|
||||||
topMargin: JamiTheme.preferredSettingsBottomMarginSize
|
topMargin: JamiTheme.preferredSettingsBottomMarginSize
|
||||||
bottomMargin: JamiTheme.preferredSettingsBottomMarginSize
|
bottomMargin: JamiTheme.preferredSettingsBottomMarginSize
|
||||||
|
ScrollBar.horizontal.visible: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,6 @@ SettingsPageBase {
|
||||||
|
|
||||||
property bool isSIP
|
property bool isSIP
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.system
|
title: JamiStrings.system
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,6 @@ SettingsPageBase {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.troubleshootTitle
|
title: JamiStrings.troubleshootTitle
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,6 @@ import "../../commoncomponents"
|
||||||
SettingsPageBase {
|
SettingsPageBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.updatesTitle
|
title: JamiStrings.updatesTitle
|
||||||
|
|
||||||
function presentInfoDialog(infoText) {
|
function presentInfoDialog(infoText) {
|
||||||
|
|
|
@ -36,9 +36,6 @@ SettingsPageBase {
|
||||||
|
|
||||||
property int itemWidth: 266
|
property int itemWidth: 266
|
||||||
property real aspectRatio: 0.75
|
property real aspectRatio: 0.75
|
||||||
|
|
||||||
signal navigateToMainView
|
|
||||||
signal navigateToNewWizardView
|
|
||||||
title: JamiStrings.video
|
title: JamiStrings.video
|
||||||
|
|
||||||
flickableContent: ColumnLayout {
|
flickableContent: ColumnLayout {
|
||||||
|
@ -63,17 +60,6 @@ SettingsPageBase {
|
||||||
previewWidget.startWithId(VideoDevices.getDefaultDevice(), force)
|
previewWidget.startWithId(VideoDevices.getDefaultDevice(), force)
|
||||||
}
|
}
|
||||||
|
|
||||||
onVisibleChanged: {
|
|
||||||
flipControl.checked = UtilsAdapter.getAppValue(Settings.FlipSelf)
|
|
||||||
if (visible) {
|
|
||||||
hardwareAccelControl.checked = AvAdapter.getHardwareAcceleration()
|
|
||||||
if (previewWidget.visible)
|
|
||||||
generalSettings.startPreviewing(true)
|
|
||||||
} else {
|
|
||||||
previewWidget.startWithId("")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: VideoDevices
|
target: VideoDevices
|
||||||
|
|
||||||
|
@ -114,6 +100,17 @@ SettingsPageBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
flipControl.checked = UtilsAdapter.getAppValue(Settings.FlipSelf)
|
||||||
|
hardwareAccelControl.checked = AvAdapter.getHardwareAcceleration()
|
||||||
|
if (previewWidget.visible)
|
||||||
|
startPreviewing(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
previewWidget.startWithId("")
|
||||||
|
}
|
||||||
|
|
||||||
// video Preview
|
// video Preview
|
||||||
Rectangle {
|
Rectangle {
|
||||||
visible: VideoDevices.listSize !== 0
|
visible: VideoDevices.listSize !== 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue