mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 14:55:43 +02:00
plugin: fix load/unload
Change-Id: If527d5c8ca3947943ac17ef627cb5bf73a4530bd
This commit is contained in:
parent
be70e36bf7
commit
72646960da
2 changed files with 36 additions and 30 deletions
|
@ -43,6 +43,8 @@ Rectangle {
|
|||
|
||||
visible: false
|
||||
|
||||
signal uninstalled
|
||||
|
||||
function resetPluginSlot() {
|
||||
resetPluginMessageBox.open()
|
||||
}
|
||||
|
@ -64,6 +66,7 @@ Rectangle {
|
|||
|
||||
function uninstallPlugin() {
|
||||
PluginModel.uninstallPlugin(pluginId)
|
||||
uninstalled()
|
||||
}
|
||||
|
||||
function setPreference(pluginId, preferenceKey, preferenceNewValue)
|
||||
|
@ -72,11 +75,9 @@ Rectangle {
|
|||
PluginModel.unloadPlugin(pluginId)
|
||||
PluginModel.setPluginPreference(pluginId, preferenceKey, preferenceNewValue)
|
||||
PluginModel.loadPlugin(pluginId)
|
||||
}
|
||||
else {
|
||||
} else
|
||||
PluginModel.setPluginPreference(pluginId, preferenceKey, preferenceNewValue)
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
id: uninstallPluginMessageBox
|
||||
|
|
|
@ -24,6 +24,7 @@ import QtQuick.Layouts 1.3
|
|||
import Qt.labs.platform 1.1
|
||||
import QtGraphicalEffects 1.14
|
||||
import net.jami.Models 1.0
|
||||
import net.jami.Adapters 1.0
|
||||
import "../../commoncomponents"
|
||||
|
||||
Rectangle {
|
||||
|
@ -31,6 +32,14 @@ Rectangle {
|
|||
|
||||
property PluginListPreferencesView pluginListPreferencesView
|
||||
|
||||
Connections {
|
||||
target: pluginListPreferencesView
|
||||
|
||||
function onUninstalled() {
|
||||
pluginListView.model = PluginAdapter.getPluginSelectableModel()
|
||||
}
|
||||
}
|
||||
|
||||
visible: false
|
||||
|
||||
function openPluginFileSlot() {
|
||||
|
@ -79,6 +88,7 @@ Rectangle {
|
|||
onAccepted: {
|
||||
var url = UtilsAdapter.getAbsPath(file.toString())
|
||||
PluginModel.installPlugin(url, true)
|
||||
pluginListView.model = PluginAdapter.getPluginSelectableModel()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,9 +127,7 @@ Rectangle {
|
|||
|
||||
text: qsTr("Install Plugin")
|
||||
|
||||
onClicked: {
|
||||
openPluginFileSlot()
|
||||
}
|
||||
onClicked: openPluginFileSlot()
|
||||
}
|
||||
|
||||
ListView {
|
||||
|
@ -142,17 +150,14 @@ Rectangle {
|
|||
pluginIcon: PluginIcon
|
||||
isLoaded: IsLoaded
|
||||
|
||||
onClicked: {
|
||||
pluginListView.currentIndex = index
|
||||
}
|
||||
onClicked: pluginListView.currentIndex = index
|
||||
|
||||
onBtnLoadPluginToggled: {
|
||||
loadPluginSlot(pluginId, isLoaded)
|
||||
pluginListView.model = PluginAdapter.getPluginSelectableModel()
|
||||
}
|
||||
|
||||
onBtnPreferencesPluginClicked:{
|
||||
openPreferencesPluginSlot(pluginName, pluginIcon, pluginId, isLoaded)
|
||||
}
|
||||
onBtnPreferencesPluginClicked: openPreferencesPluginSlot(pluginName, pluginIcon, pluginId, isLoaded)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue