2020-09-03 21:19:10 -04:00
|
|
|
/*
|
2020-08-03 13:27:42 -04:00
|
|
|
* Copyright (C) 2019-2020 by Savoir-faire Linux
|
2020-08-28 12:04:45 -04:00
|
|
|
* 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.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Controls.Universal 2.12
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtGraphicalEffects 1.14
|
|
|
|
import QtQuick.Controls.Styles 1.4
|
|
|
|
import net.jami.Models 1.0
|
|
|
|
|
|
|
|
import "../../commoncomponents"
|
|
|
|
|
|
|
|
ItemDelegate {
|
2020-08-18 17:41:05 -04:00
|
|
|
id: root
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
property string pluginName : ""
|
|
|
|
property string pluginId: ""
|
|
|
|
property string pluginIcon: ""
|
|
|
|
property bool isLoaded: false
|
|
|
|
|
|
|
|
signal btnLoadPluginToggled
|
|
|
|
signal btnPreferencesPluginClicked
|
|
|
|
|
2020-10-07 15:46:41 -04:00
|
|
|
RowLayout {
|
2020-08-03 13:27:42 -04:00
|
|
|
anchors.fill: parent
|
|
|
|
|
2020-10-07 15:46:41 -04:00
|
|
|
Label {
|
2020-08-18 17:41:05 -04:00
|
|
|
id: pluginImage
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlingVCenter
|
|
|
|
width: 30
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-10-07 15:46:41 -04:00
|
|
|
background: Rectangle {
|
2020-08-03 13:27:42 -04:00
|
|
|
Image {
|
2020-08-18 17:41:05 -04:00
|
|
|
anchors.centerIn: parent
|
2020-10-07 15:46:41 -04:00
|
|
|
source: "file:" + pluginIcon
|
|
|
|
sourceSize: Qt.size(256, 256)
|
|
|
|
mipmap: true
|
|
|
|
width: 32
|
|
|
|
height: 32
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-07 15:46:41 -04:00
|
|
|
Label {
|
2020-08-18 17:41:05 -04:00
|
|
|
id: labelDeviceId
|
2020-08-03 13:27:42 -04:00
|
|
|
Layout.fillWidth: true
|
2020-08-18 17:41:05 -04:00
|
|
|
Layout.leftMargin: 8
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-08-18 17:41:05 -04:00
|
|
|
font.pointSize: JamiTheme.settingsFontSize
|
|
|
|
font.kerning: true
|
|
|
|
text: pluginName === "" ? pluginId : pluginName
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Switch {
|
|
|
|
id: loadSwitch
|
|
|
|
property bool isHovering: false
|
2020-08-18 17:41:05 -04:00
|
|
|
Layout.rightMargin: 8
|
|
|
|
width: 20
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-08-18 17:41:05 -04:00
|
|
|
ToolTip.visible: hovered
|
2020-10-07 15:46:41 -04:00
|
|
|
ToolTip.text: qsTr("Load/Unload")
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
checked: isLoaded
|
2020-10-07 15:46:41 -04:00
|
|
|
onClicked: btnLoadPluginToggled()
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
id: switchBackground
|
|
|
|
MouseArea {
|
|
|
|
id: btnMouseArea
|
|
|
|
hoverEnabled: true
|
|
|
|
onReleased: {
|
|
|
|
loadSwitch.clicked()
|
|
|
|
}
|
|
|
|
onEntered: {
|
|
|
|
loadSwitch.isHovering = true
|
|
|
|
}
|
|
|
|
onExited: {
|
|
|
|
loadSwitch.isHovering = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-06 16:59:29 -04:00
|
|
|
PushButton {
|
2020-08-03 13:27:42 -04:00
|
|
|
id: btnPreferencesPlugin
|
|
|
|
|
2020-08-18 17:41:05 -04:00
|
|
|
Layout.alignment: Qt.AlingVCenter | Qt.AlignRight
|
|
|
|
Layout.rightMargin: 8
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-10-06 16:59:29 -04:00
|
|
|
source: "qrc:/images/icons/round-settings-24px.svg"
|
|
|
|
normalColor: JamiTheme.primaryBackgroundColor
|
|
|
|
toolTipText: JamiStrings.showHidePrefs
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-08-28 12:04:45 -04:00
|
|
|
onClicked: btnPreferencesPluginClicked()
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|