2020-09-03 21:19:10 -04:00
|
|
|
/*
|
2020-08-18 17:41:05 -04:00
|
|
|
* Copyright (C) 2020 by Savoir-faire Linux
|
|
|
|
|
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
|
2020-08-03 13:27:42 -04:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Window 2.14
|
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
|
import QtQuick.Controls.Universal 2.12
|
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
|
import Qt.labs.platform 1.1
|
|
|
|
|
import QtGraphicalEffects 1.14
|
|
|
|
|
import net.jami.Models 1.0
|
|
|
|
|
import "../../commoncomponents"
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
2020-08-18 17:41:05 -04:00
|
|
|
id: root
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
function populatePluginSettings() {
|
2020-09-04 17:53:24 -04:00
|
|
|
enabledplugin.checked = PluginModel.getPluginsEnabled()
|
2020-08-03 13:27:42 -04:00
|
|
|
pluginListSettingsView.visible = enabledplugin.checked
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
function slotSetPluginEnabled(state) {
|
2020-09-04 17:53:24 -04:00
|
|
|
PluginModel.setPluginsEnabled(state)
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
|
|
2020-08-10 12:33:34 +02:00
|
|
|
signal backArrowClicked
|
|
|
|
|
|
2020-08-03 13:27:42 -04:00
|
|
|
ColumnLayout {
|
2020-08-18 17:41:05 -04:00
|
|
|
anchors.fill: root
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
SettingsHeader {
|
2020-09-03 21:19:10 -04:00
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
|
|
|
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
|
|
|
|
Layout.fillWidth: true
|
2020-08-10 12:33:34 +02:00
|
|
|
Layout.preferredHeight: 64
|
|
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
title: qsTr("Plugin")
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
onBackArrowClicked: root.backArrowClicked()
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
|
id: pluginScrollView
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
focus: true
|
|
|
|
|
|
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
|
|
ColumnLayout {
|
2020-08-18 17:41:05 -04:00
|
|
|
width: root.width
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
|
ToggleSwitch {
|
|
|
|
|
id: enabledplugin
|
2020-08-18 17:41:05 -04:00
|
|
|
Layout.fillWidth: true
|
2020-09-03 21:19:10 -04:00
|
|
|
Layout.topMargin: JamiTheme.preferredMarginSize
|
|
|
|
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
|
|
|
|
Layout.rightMargin: JamiTheme.preferredMarginSize
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
|
labelText: "Enable"
|
2020-08-18 17:41:05 -04:00
|
|
|
fontPointSize: JamiTheme.headerFontSize
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
|
onSwitchToggled: {
|
|
|
|
|
slotSetPluginEnabled(checked)
|
2020-08-10 12:33:34 +02:00
|
|
|
|
2020-08-03 13:27:42 -04:00
|
|
|
pluginListSettingsView.visible = checked
|
2020-09-01 18:19:22 -04:00
|
|
|
if (!pluginListSettingsView.visible) {
|
2020-09-04 17:53:24 -04:00
|
|
|
PluginModel.toggleCallMediaHandler("", true)
|
2020-08-18 17:41:05 -04:00
|
|
|
pluginListSettingsView.hidePreferences()
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-18 17:41:05 -04:00
|
|
|
PluginListSettingsView {
|
|
|
|
|
id: pluginListSettingsView
|
|
|
|
|
Layout.fillWidth: true
|
2020-09-03 21:19:10 -04:00
|
|
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
|
|
|
|
Layout.rightMargin: JamiTheme.preferredMarginSize
|
2020-08-18 17:41:05 -04:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-08-18 17:41:05 -04:00
|
|
|
pluginListPreferencesView: pluginListPreferencesView
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-09-03 21:19:10 -04:00
|
|
|
Layout.topMargin: JamiTheme.preferredMarginSize
|
2020-08-18 17:41:05 -04:00
|
|
|
Layout.minimumHeight: 0
|
|
|
|
|
Layout.preferredHeight: childrenRect.height
|
|
|
|
|
}
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-08-18 17:41:05 -04:00
|
|
|
PluginListPreferencesView {
|
|
|
|
|
id: pluginListPreferencesView
|
|
|
|
|
Layout.fillWidth: true
|
2020-09-03 21:19:10 -04:00
|
|
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
|
|
|
|
Layout.rightMargin: JamiTheme.preferredMarginSize
|
|
|
|
|
Layout.bottomMargin: JamiTheme.preferredMarginSize
|
2020-08-18 17:41:05 -04:00
|
|
|
Layout.minimumHeight: 0
|
|
|
|
|
Layout.preferredHeight: childrenRect.height
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|