2020-08-03 13:27:42 -04:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2019-2020 by Savoir-faire Linux
|
|
|
|
|
* Author: Yang Wang <yang.wang@savoirfairelinux.com>
|
|
|
|
|
*
|
|
|
|
|
* 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 {
|
|
|
|
|
id: pluginSettingsRect
|
|
|
|
|
|
|
|
|
|
function populatePluginSettings(){
|
|
|
|
|
// settings
|
|
|
|
|
enabledplugin.checked = ClientWrapper.pluginModel.getPluginsEnabled()
|
|
|
|
|
pluginListSettingsView.visible = enabledplugin.checked
|
|
|
|
|
if (pluginListSettingsView.visible) {
|
|
|
|
|
pluginListSettingsView.updatePluginListDisplayed()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function slotSetPluginEnabled(state){
|
|
|
|
|
ClientWrapper.pluginModel.setPluginsEnabled(state)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
2020-08-10 12:33:34 +02:00
|
|
|
signal backArrowClicked
|
|
|
|
|
|
2020-08-03 13:27:42 -04:00
|
|
|
ColumnLayout {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
spacing: 6
|
|
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
|
2020-08-10 12:33:34 +02:00
|
|
|
RowLayout {
|
|
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.maximumHeight: 64
|
|
|
|
|
Layout.minimumHeight: 64
|
|
|
|
|
Layout.preferredHeight: 64
|
|
|
|
|
|
|
|
|
|
HoverableButton {
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-08-10 12:33:34 +02:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
|
|
|
|
Layout.preferredWidth: 30
|
|
|
|
|
Layout.preferredHeight: 30
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-08-10 12:33:34 +02:00
|
|
|
radius: 30
|
|
|
|
|
source: "qrc:/images/icons/ic_arrow_back_24px.svg"
|
|
|
|
|
backgroundColor: "white"
|
|
|
|
|
onExitColor: "white"
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-08-07 11:24:18 -04:00
|
|
|
toolTipText: qsTr("Toggle to display side panel")
|
|
|
|
|
hoverEnabled: true
|
2020-08-10 12:33:34 +02:00
|
|
|
visible: mainViewWindow.sidePanelHidden
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
backArrowClicked()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.minimumHeight: 25
|
|
|
|
|
Layout.preferredHeight: 25
|
|
|
|
|
Layout.maximumHeight: 25
|
|
|
|
|
|
|
|
|
|
text: qsTr("Plugin")
|
|
|
|
|
|
|
|
|
|
font.pointSize: 15
|
|
|
|
|
font.kerning: true
|
|
|
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
}
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
|
id: pluginScrollView
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
focus: true
|
|
|
|
|
|
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
id: pluginViewLayout
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
ToggleSwitch {
|
|
|
|
|
id: enabledplugin
|
|
|
|
|
|
|
|
|
|
Layout.topMargin: 15
|
|
|
|
|
Layout.leftMargin: 36
|
|
|
|
|
|
|
|
|
|
labelText: "Enable"
|
|
|
|
|
fontPointSize: 13
|
|
|
|
|
|
|
|
|
|
onSwitchToggled: {
|
|
|
|
|
slotSetPluginEnabled(checked)
|
2020-08-10 12:33:34 +02:00
|
|
|
|
2020-08-03 13:27:42 -04:00
|
|
|
pluginListSettingsView.visible = checked
|
|
|
|
|
if (!checked) {
|
|
|
|
|
pluginListPreferencesView.visible = checked
|
2020-08-10 17:36:47 -04:00
|
|
|
ClientWrapper.pluginModel.toggleCallMediaHandler("",true);
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
|
if (pluginListSettingsView.visible) {
|
|
|
|
|
pluginListSettingsView.updatePluginListDisplayed()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
spacing: 6
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
width:380
|
|
|
|
|
height:100
|
2020-08-10 12:33:34 +02:00
|
|
|
|
2020-08-03 13:27:42 -04:00
|
|
|
// instantiate plugin list setting page
|
|
|
|
|
PluginListSettingsView {
|
|
|
|
|
id: pluginListSettingsView
|
|
|
|
|
|
|
|
|
|
width:380
|
|
|
|
|
height:265
|
|
|
|
|
Layout.leftMargin: 35
|
|
|
|
|
Layout.topMargin: 15
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
|
|
|
|
|
pluginListPreferencesView: pluginListPreferencesView
|
|
|
|
|
|
|
|
|
|
onScrollView:{ }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PluginListPreferencesView {
|
|
|
|
|
id: pluginListPreferencesView
|
|
|
|
|
|
|
|
|
|
width:380
|
|
|
|
|
Layout.minimumHeight: 175
|
|
|
|
|
Layout.preferredHeight: height
|
|
|
|
|
Layout.maximumHeight: 1000
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
Layout.leftMargin: 55
|
|
|
|
|
|
|
|
|
|
onUpdatePluginList:{
|
|
|
|
|
pluginListSettingsView.updateAndShowPluginsSlot()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|