Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-client-qt
Commits
a5ec0c8e
Commit
a5ec0c8e
authored
Jan 22, 2021
by
Aline Gondim Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugins: add ChatHandler API
Change-Id: I415fc953b9111ca7e3d899c1531a42bd43716ab2
parent
4a06565e
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
718 additions
and
308 deletions
+718
-308
CMakeLists.txt
CMakeLists.txt
+2
-2
jami-qt.pro
jami-qt.pro
+2
-2
qml.qrc
qml.qrc
+3
-3
src/constant/JamiTheme.qml
src/constant/JamiTheme.qml
+2
-0
src/mainview/components/CallOverlay.qml
src/mainview/components/CallOverlay.qml
+6
-6
src/mainview/components/CallViewContextMenu.qml
src/mainview/components/CallViewContextMenu.qml
+1
-1
src/mainview/components/MediaHandlerPicker.qml
src/mainview/components/MediaHandlerPicker.qml
+0
-259
src/mainview/components/MessageWebView.qml
src/mainview/components/MessageWebView.qml
+9
-0
src/mainview/components/MessageWebViewHeader.qml
src/mainview/components/MessageWebViewHeader.qml
+31
-1
src/mainview/components/PluginHandlerItemDelegate.qml
src/mainview/components/PluginHandlerItemDelegate.qml
+8
-8
src/mainview/components/PluginHandlerPicker.qml
src/mainview/components/PluginHandlerPicker.qml
+297
-0
src/mainview/components/RecordBox.qml
src/mainview/components/RecordBox.qml
+0
-1
src/mainview/js/pluginhandlerpickercreation.js
src/mainview/js/pluginhandlerpickercreation.js
+78
-0
src/pluginadapter.cpp
src/pluginadapter.cpp
+9
-2
src/pluginadapter.h
src/pluginadapter.h
+8
-3
src/pluginhandleritemlistmodel.cpp
src/pluginhandleritemlistmodel.cpp
+218
-0
src/pluginhandleritemlistmodel.h
src/pluginhandleritemlistmodel.h
+15
-10
src/pluginitemlistmodel.cpp
src/pluginitemlistmodel.cpp
+3
-3
src/qmlregister.cpp
src/qmlregister.cpp
+2
-2
src/settingsview/components/PluginListPreferencesView.qml
src/settingsview/components/PluginListPreferencesView.qml
+4
-0
src/settingsview/components/PluginListSettingsView.qml
src/settingsview/components/PluginListSettingsView.qml
+1
-0
src/settingsview/components/PluginSettingsPage.qml
src/settingsview/components/PluginSettingsPage.qml
+1
-0
src/utilsadapter.cpp
src/utilsadapter.cpp
+16
-4
src/utilsadapter.h
src/utilsadapter.h
+2
-1
No files found.
CMakeLists.txt
View file @
a5ec0c8e
...
...
@@ -66,7 +66,7 @@ set(COMMON_SOURCES
${
SRC_DIR
}
/settingsadapter.cpp
${
SRC_DIR
}
/deviceitemlistmodel.cpp
${
SRC_DIR
}
/pluginitemlistmodel.cpp
${
SRC_DIR
}
/
media
handleritemlistmodel.cpp
${
SRC_DIR
}
/
plugin
handleritemlistmodel.cpp
${
SRC_DIR
}
/preferenceitemlistmodel.cpp
${
SRC_DIR
}
/mediacodeclistmodel.cpp
${
SRC_DIR
}
/accountstomigratelistmodel.cpp
...
...
@@ -115,7 +115,7 @@ set(COMMON_HEADERS
${
SRC_DIR
}
/settingsadapter.h
${
SRC_DIR
}
/deviceitemlistmodel.h
${
SRC_DIR
}
/pluginitemlistmodel.h
${
SRC_DIR
}
/
media
handleritemlistmodel.h
${
SRC_DIR
}
/
plugin
handleritemlistmodel.h
${
SRC_DIR
}
/preferenceitemlistmodel.h
${
SRC_DIR
}
/mediacodeclistmodel.h
${
SRC_DIR
}
/accountstomigratelistmodel.h
...
...
jami-qt.pro
View file @
a5ec0c8e
...
...
@@ -170,7 +170,7 @@ HEADERS += \
src
/
settingsadapter
.
h
\
src
/
deviceitemlistmodel
.
h
\
src
/
pluginitemlistmodel
.
h
\
src
/
media
handleritemlistmodel
.
h
\
src
/
plugin
handleritemlistmodel
.
h
\
src
/
preferenceitemlistmodel
.
h
\
src
/
mediacodeclistmodel
.
h
\
src
/
accountstomigratelistmodel
.
h
\
...
...
@@ -211,7 +211,7 @@ SOURCES += \
src
/
settingsadapter
.
cpp
\
src
/
deviceitemlistmodel
.
cpp
\
src
/
pluginitemlistmodel
.
cpp
\
src
/
media
handleritemlistmodel
.
cpp
\
src
/
plugin
handleritemlistmodel
.
cpp
\
src
/
preferenceitemlistmodel
.
cpp
\
src
/
mediacodeclistmodel
.
cpp
\
src
/
accountstomigratelistmodel
.
cpp
\
...
...
qml.qrc
View file @
a5ec0c8e
...
...
@@ -45,7 +45,7 @@
<file>src/commoncomponents/SettingParaCombobox.qml</file>
<file>src/settingsview/components/DeviceItemDelegate.qml</file>
<file>src/settingsview/components/PluginItemDelegate.qml</file>
<file>src/mainview/components/
Media
HandlerItemDelegate.qml</file>
<file>src/mainview/components/
Plugin
HandlerItemDelegate.qml</file>
<file>src/commoncomponents/PreferenceItemDelegate.qml</file>
<file>src/settingsview/components/ContactItemDelegate.qml</file>
<file>src/settingsview/components/MediaCodecDelegate.qml</file>
...
...
@@ -112,9 +112,9 @@
<file>src/mainview/js/callfullscreenwindowcontainercreation.js</file>
<file>src/mainview/components/VideoCallFullScreenWindowContainer.qml</file>
<file>src/mainview/components/ContactPicker.qml</file>
<file>src/mainview/components/
Media
HandlerPicker.qml</file>
<file>src/mainview/components/
Plugin
HandlerPicker.qml</file>
<file>src/mainview/js/contactpickercreation.js</file>
<file>src/mainview/js/
media
handlerpickercreation.js</file>
<file>src/mainview/js/
plugin
handlerpickercreation.js</file>
<file>src/mainview/components/ContactPickerItemDelegate.qml</file>
<file>src/commoncomponents/AccountMigrationDialog.qml</file>
<file>src/commoncomponents/MaterialButton.qml</file>
...
...
src/constant/JamiTheme.qml
View file @
a5ec0c8e
...
...
@@ -170,6 +170,8 @@ Item {
property
int
preferredDialogWidth
:
400
property
int
preferredDialogHeight
:
300
property
int
minimumPreviewWidth
:
120
property
int
pluginHandlersPopupViewHeight
:
200
property
int
pluginHandlersPopupViewDelegateHeight
:
50
// main application spec
property
int
mainViewMinWidth
:
460
...
...
src/mainview/components/CallOverlay.qml
View file @
a5ec0c8e
...
...
@@ -28,7 +28,7 @@ import net.jami.Adapters 1.0
import
net
.
jami
.
Constants
1.0
import
"
../js/contactpickercreation.js
"
as
ContactPickerCreation
import
"
../js/
media
handlerpickercreation.js
"
as
Media
HandlerPickerCreation
import
"
../js/
plugin
handlerpickercreation.js
"
as
Plugin
HandlerPickerCreation
import
"
../../commoncomponents
"
...
...
@@ -73,8 +73,8 @@ Rectangle {
ContactPickerCreation
.
closeContactPicker
()
}
function
closePotential
Media
HandlerPicker
()
{
Media
HandlerPickerCreation
.
close
Media
HandlerPicker
()
function
closePotential
Plugin
HandlerPicker
()
{
Plugin
HandlerPickerCreation
.
close
Plugin
HandlerPicker
()
}
// returns true if participant is not fully maximized
...
...
@@ -561,9 +561,9 @@ Rectangle {
}
onPluginItemClicked
:
{
// Create
media
handler picker - PLUGINS
Media
HandlerPickerCreation
.
create
Media
HandlerPickerObjects
(
callOverlayRect
)
Media
HandlerPickerCreation
.
open
Media
HandlerPicker
()
// Create
plugin
handler picker - PLUGINS
Plugin
HandlerPickerCreation
.
create
Plugin
HandlerPickerObjects
(
callOverlayRect
,
true
)
Plugin
HandlerPickerCreation
.
open
Plugin
HandlerPicker
()
}
}
}
src/mainview/components/CallViewContextMenu.qml
View file @
a5ec0c8e
...
...
@@ -131,7 +131,7 @@ Item {
})
}
if
(
UtilsAdapter
.
checkShowPluginsButton
())
{
if
(
UtilsAdapter
.
checkShowPluginsButton
(
true
))
{
ContextMenuGenerator
.
addMenuItem
(
JamiStrings
.
viewPlugin
,
"
qrc:/images/icons/extension_24dp.svg
"
,
function
(){
...
...
src/mainview/components/MediaHandlerPicker.qml
deleted
100644 → 0
View file @
4a06565e
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@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 <https://www.gnu.org/licenses/>.
*/
import
QtQuick
2.14
import
QtQuick
.
Controls
2.14
import
QtQuick
.
Layouts
1.14
import
QtQuick
.
Controls
.
Universal
2.14
import
net
.
jami
.
Models
1.0
import
net
.
jami
.
Adapters
1.0
import
net
.
jami
.
Constants
1.0
import
"
../../commoncomponents
"
Popup
{
id
:
root
function
toggleMediaHandlerSlot
(
mediaHandlerId
,
isLoaded
)
{
var
callId
=
UtilsAdapter
.
getCallId
(
callStackViewWindow
.
responsibleAccountId
,
callStackViewWindow
.
responsibleConvUid
)
PluginModel
.
toggleCallMediaHandler
(
mediaHandlerId
,
callId
,
!
isLoaded
)
mediahandlerPickerListView
.
model
=
PluginAdapter
.
getMediaHandlerSelectableModel
(
callId
)
}
width
:
350
height
:
contentItem
.
height
modal
:
true
contentItem
:
StackLayout
{
id
:
stack
currentIndex
:
0
height
:
childrenRect
.
height
Rectangle
{
id
:
mediahandlerPickerPopupRect
width
:
root
.
width
height
:
childrenRect
.
height
+
50
color
:
JamiTheme
.
backgroundColor
radius
:
10
PushButton
{
id
:
closeButton
anchors.top
:
mediahandlerPickerPopupRect
.
top
anchors.topMargin
:
5
anchors.right
:
mediahandlerPickerPopupRect
.
right
anchors.rightMargin
:
5
source
:
"
qrc:/images/icons/round-close-24px.svg
"
imageColor
:
JamiTheme
.
textColor
onClicked
:
{
root
.
close
()
}
}
ColumnLayout
{
id
:
mediahandlerPickerPopupRectColumnLayout
anchors.top
:
mediahandlerPickerPopupRect
.
top
anchors.topMargin
:
15
height
:
230
Text
{
id
:
mediahandlerPickerTitle
Layout.alignment
:
Qt
.
AlignCenter
Layout.preferredWidth
:
mediahandlerPickerPopupRect
.
width
Layout.preferredHeight
:
30
font.pointSize
:
JamiTheme
.
textFontSize
font.bold
:
true
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
color
:
JamiTheme
.
textColor
text
:
qsTr
(
"
Choose plugin
"
)
}
ListView
{
id
:
mediahandlerPickerListView
Layout.alignment
:
Qt
.
AlignCenter
Layout.preferredWidth
:
mediahandlerPickerPopupRect
.
width
Layout.preferredHeight
:
200
model
:
{
var
callId
=
UtilsAdapter
.
getCallId
(
callStackViewWindow
.
responsibleAccountId
,
callStackViewWindow
.
responsibleConvUid
)
return
PluginAdapter
.
getMediaHandlerSelectableModel
(
callId
)
}
clip
:
true
delegate
:
MediaHandlerItemDelegate
{
id
:
mediaHandlerItemDelegate
visible
:
PluginModel
.
getPluginsEnabled
()
width
:
mediahandlerPickerListView
.
width
height
:
50
mediaHandlerName
:
MediaHandlerName
mediaHandlerId
:
MediaHandlerId
mediaHandlerIcon
:
MediaHandlerIcon
isLoaded
:
IsLoaded
pluginId
:
PluginId
onBtnLoadMediaHandlerToggled
:
{
toggleMediaHandlerSlot
(
mediaHandlerId
,
isLoaded
)
}
onOpenPreferences
:
{
mediahandlerPreferencePickerListView
.
pluginId
=
pluginId
mediahandlerPreferencePickerListView
.
mediaHandlerName
=
mediaHandlerName
mediahandlerPreferencePickerListView
.
model
=
PluginAdapter
.
getPluginPreferencesModel
(
pluginId
,
mediaHandlerName
)
stack
.
currentIndex
=
1
}
}
ScrollIndicator.vertical
:
ScrollIndicator
{}
}
}
}
Rectangle
{
id
:
mediahandlerPreferencePopupRect2
width
:
root
.
width
height
:
childrenRect
.
height
+
50
color
:
JamiTheme
.
backgroundColor
radius
:
10
PushButton
{
id
:
backButton
anchors.top
:
mediahandlerPreferencePopupRect2
.
top
anchors.topMargin
:
5
anchors.left
:
mediahandlerPreferencePopupRect2
.
left
anchors.leftMargin
:
5
imageColor
:
JamiTheme
.
textColor
source
:
"
qrc:/images/icons/ic_arrow_back_24px.svg
"
toolTipText
:
qsTr
(
"
Go back to plugins list
"
)
hoverEnabled
:
true
onClicked
:
{
stack
.
currentIndex
=
0
}
}
PushButton
{
id
:
closeButton2
anchors.top
:
mediahandlerPreferencePopupRect2
.
top
anchors.topMargin
:
5
anchors.right
:
mediahandlerPreferencePopupRect2
.
right
anchors.rightMargin
:
5
source
:
"
qrc:/images/icons/round-close-24px.svg
"
imageColor
:
JamiTheme
.
textColor
onClicked
:
{
stack
.
currentIndex
=
0
root
.
close
()
}
}
ColumnLayout
{
anchors.top
:
mediahandlerPreferencePopupRect2
.
top
anchors.topMargin
:
15
height
:
230
Text
{
Layout.alignment
:
Qt
.
AlignCenter
Layout.preferredWidth
:
mediahandlerPreferencePopupRect2
.
width
Layout.preferredHeight
:
30
font.pointSize
:
JamiTheme
.
textFontSize
font.bold
:
true
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
color
:
JamiTheme
.
textColor
text
:
qsTr
(
"
Preferences
"
)
}
ListView
{
id
:
mediahandlerPreferencePickerListView
Layout.alignment
:
Qt
.
AlignCenter
Layout.preferredWidth
:
mediahandlerPickerPopupRect
.
width
Layout.preferredHeight
:
200
property
string
pluginId
:
""
property
string
mediaHandlerName
:
""
model
:
PluginAdapter
.
getPluginPreferencesModel
(
pluginId
,
mediaHandlerName
)
clip
:
true
delegate
:
PreferenceItemDelegate
{
id
:
mediaHandlerPreferenceDelegate
width
:
mediahandlerPreferencePickerListView
.
width
height
:
childrenRect
.
height
preferenceName
:
PreferenceName
preferenceSummary
:
PreferenceSummary
preferenceType
:
PreferenceType
preferenceCurrentValue
:
PreferenceCurrentValue
pluginId
:
PluginId
currentPath
:
CurrentPath
preferenceKey
:
PreferenceKey
fileFilters
:
FileFilters
isImage
:
IsImage
pluginListPreferenceModel
:
PluginListPreferenceModel
{
id
:
pluginListPreferenceModel
preferenceKey
:
PreferenceKey
pluginId
:
PluginId
}
onClicked
:
mediahandlerPreferencePickerListView
.
currentIndex
=
index
onBtnPreferenceClicked
:
{
PluginModel
.
setPluginPreference
(
pluginId
,
preferenceKey
,
preferenceNewValue
)
mediahandlerPreferencePickerListView
.
model
=
PluginAdapter
.
getPluginPreferencesModel
(
pluginId
,
mediahandlerPreferencePickerListView
.
mediaHandlerName
)
}
}
ScrollIndicator.vertical
:
ScrollIndicator
{}
}
}
}
}
onAboutToHide
:
stack
.
currentIndex
=
0
onAboutToShow
:
{
// Reset the model on each show.
var
callId
=
UtilsAdapter
.
getCallId
(
callStackViewWindow
.
responsibleAccountId
,
callStackViewWindow
.
responsibleConvUid
)
mediahandlerPickerListView
.
model
=
PluginAdapter
.
getMediaHandlerSelectableModel
(
callId
)
}
background
:
Rectangle
{
color
:
"
transparent
"
}
}
src/mainview/components/MessageWebView.qml
View file @
a5ec0c8e
...
...
@@ -26,6 +26,7 @@ import net.jami.Adapters 1.0
import
net
.
jami
.
Constants
1.0
import
"
../../commoncomponents
"
import
"
../js/pluginhandlerpickercreation.js
"
as
PluginHandlerPickerCreation
Rectangle
{
id
:
messageWebViewRect
...
...
@@ -136,6 +137,14 @@ Rectangle {
onNeedToHideConversationInCall
:
{
messageWebViewRect
.
needToHideConversationInCall
()
}
onPluginSelector
:
{
// Create plugin handler picker - PLUGINS
PluginHandlerPickerCreation
.
createPluginHandlerPickerObjects
(
messageWebViewRect
,
false
)
PluginHandlerPickerCreation
.
calculateCurrentGeo
(
messageWebViewRect
.
width
/
2
,
messageWebViewRect
.
height
/
2
)
PluginHandlerPickerCreation
.
openPluginHandlerPicker
()
}
}
QtObject
{
...
...
src/mainview/components/MessageWebViewHeader.qml
View file @
a5ec0c8e
...
...
@@ -21,6 +21,7 @@ import QtQuick.Controls 2.14
import
QtQuick
.
Layouts
1.14
import
net
.
jami
.
Models
1.0
import
net
.
jami
.
Constants
1.0
import
net
.
jami
.
Adapters
1.0
import
"
../../commoncomponents
"
...
...
@@ -34,6 +35,7 @@ Rectangle {
signal
backClicked
signal
needToHideConversationInCall
signal
pluginSelector
function
resetBackToWelcomeViewButtonSource
(
reset
)
{
backToWelcomeViewButtonSource
=
reset
?
"
qrc:/images/icons/ic_arrow_back_24px.svg
"
:
"
qrc:/images/icons/round-close-24px.svg
"
...
...
@@ -42,6 +44,7 @@ Rectangle {
function
toggleMessagingHeaderButtonsVisible
(
visible
)
{
startAAudioCallButton
.
visible
=
visible
startAVideoCallButton
.
visible
=
visible
selectPluginButton
.
visible
=
visible
}
color
:
JamiTheme
.
secondaryBackgroundColor
...
...
@@ -155,7 +158,8 @@ Rectangle {
PushButton
{
id
:
startAVideoCallButton
anchors.right
:
sendContactRequestButton
.
visible
?
anchors.right
:
selectPluginButton
.
visible
?
selectPluginButton
.
left
:
sendContactRequestButton
.
visible
?
sendContactRequestButton
.
left
:
buttonGroup
.
right
anchors.rightMargin
:
16
...
...
@@ -173,6 +177,32 @@ Rectangle {
}
}
PushButton
{
id
:
selectPluginButton
visible
:
UtilsAdapter
.
checkShowPluginsButton
(
false
)
Connections
{
target
:
PluginAdapter
function
onPluginHandlersUpdateStatus
()
{
selectPluginButton
.
visible
=
UtilsAdapter
.
checkShowPluginsButton
(
false
)
}
}
anchors.right
:
sendContactRequestButton
.
visible
?
sendContactRequestButton
.
left
:
buttonGroup
.
right
anchors.rightMargin
:
16
anchors.verticalCenter
:
buttonGroup
.
verticalCenter
source
:
"
qrc:/images/icons/extension_24dp.svg
"
normalColor
:
JamiTheme
.
secondaryBackgroundColor
imageColor
:
JamiTheme
.
chatviewButtonColor
onClicked
:
pluginSelector
()
}
PushButton
{
id
:
sendContactRequestButton
...
...
src/mainview/components/
Media
HandlerItemDelegate.qml
→
src/mainview/components/
Plugin
HandlerItemDelegate.qml
View file @
a5ec0c8e
...
...
@@ -30,13 +30,13 @@ import "../../commoncomponents"
ItemDelegate
{
id
:
root
property
string
mediaH
andlerName
:
""
property
string
mediaH
andlerId
:
""
property
string
mediaH
andlerIcon
:
""
property
string
h
andlerName
:
""
property
string
h
andlerId
:
""
property
string
h
andlerIcon
:
""
property
bool
isLoaded
:
false
property
string
pluginId
:
""
signal
btnLoad
Media
HandlerToggled
signal
btnLoadHandlerToggled
signal
openPreferences
RowLayout
{
...
...
@@ -52,7 +52,7 @@ ItemDelegate {
color
:
"
transparent
"
Image
{
anchors.centerIn
:
parent
source
:
"
file:
"
+
mediaH
andlerIcon
source
:
"
file:
"
+
h
andlerIcon
width
:
30
height
:
30
mipmap
:
true
...
...
@@ -69,7 +69,7 @@ ItemDelegate {
font.pointSize
:
JamiTheme
.
settingsFontSize
font.kerning
:
true
text
:
mediaH
andlerName
===
""
?
mediaH
andlerId
:
mediaH
andlerName
text
:
h
andlerName
===
""
?
h
andlerId
:
h
andlerName
}
Switch
{
...
...
@@ -89,7 +89,7 @@ ItemDelegate {
checked
:
isLoaded
onClicked
:
{
btnLoad
Media
HandlerToggled
()
btnLoadHandlerToggled
()
}
background
:
Rectangle
{
...
...
@@ -116,7 +116,7 @@ ItemDelegate {
}
PushButton
{
id
:
btnPreferences
Media
Handler
id
:
btnPreferences
Plugin
Handler
Layout.alignment
:
Qt
.
AlingVCenter
|
Qt
.
AlignRight
Layout.rightMargin
:
8
...
...
src/mainview/components/PluginHandlerPicker.qml
0 → 100644
View file @
a5ec0c8e
/*
* Copyright (C) 2021 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@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 <https://www.gnu.org/licenses/>.
*/
import
QtQuick
2.14
import
QtQuick
.
Controls
2.14
import
QtQuick
.
Layouts
1.14
import
QtQuick
.
Controls
.
Universal
2.14
import
net
.
jami
.
Models
1.0
import
net
.
jami
.
Adapters
1.0
import
net
.
jami
.
Constants
1.0
import
"
../../commoncomponents
"
Popup
{
id
:
root
property
bool
isCall
property
string
pluginId
:
""
property
string
handlerName
:
""
signal
updateProperties
width
:
JamiTheme
.
preferredDialogWidth
height
:
JamiTheme
.
pluginHandlersPopupViewHeight
+
JamiTheme
.
pluginHandlersPopupViewDelegateHeight
modal
:
true
contentItem
:
StackView
{
id
:
stack
initialItem
:
pluginhandlerPreferenceStack
anchors.fill
:
parent
}
Component
{
id
:
pluginhandlerPreferenceStack
Rectangle
{
color
:
JamiTheme
.
backgroundColor
radius
:
10
anchors.fill
:
parent
Connections
{
target
:
root
function
onAboutToShow
(
visible
)
{
if
(
isCall
)
{
// Reset the model on each show.
var
callId
=
UtilsAdapter
.
getCallId
(
callStackViewWindow
.
responsibleAccountId
,
callStackViewWindow
.
responsibleConvUid
)
pluginhandlerPickerListView
.
model
=
PluginAdapter
.
getMediaHandlerSelectableModel
(
callId
)
}
else
{
// Reset the model on each show.
var
accountId
=
AccountAdapter
.
currentAccountId
var
peerId
=
UtilsAdapter
.
getPeerUri
(
accountId
,
UtilsAdapter
.
getCurrConvId
())
pluginhandlerPickerListView
.
model
=
PluginAdapter
.
getChatHandlerSelectableModel
(
accountId
,
peerId
)
}
}
}
function
toggleHandlerSlot
(
handlerId
,
isLoaded
)
{
if
(
isCall
)
{
var
callId
=
UtilsAdapter
.
getCallId
(
callStackViewWindow
.
responsibleAccountId
,
callStackViewWindow
.
responsibleConvUid
)
PluginModel
.
toggleCallMediaHandler
(
handlerId
,
callId
,
!
isLoaded
)
pluginhandlerPickerListView
.
model
=
PluginAdapter
.
getMediaHandlerSelectableModel
(
callId
)
}
else
{
var
accountId
=
AccountAdapter
.
currentAccountId
var
peerId
=
UtilsAdapter
.
getPeerUri
(
accountId
,
UtilsAdapter
.
getCurrConvId
())
PluginModel
.
toggleChatHandler
(
handlerId
,
accountId
,
peerId
,
!
isLoaded
)
pluginhandlerPickerListView
.
model
=
PluginAdapter
.
getChatHandlerSelectableModel
(
accountId
,
peerId
)
}
}
ColumnLayout
{
anchors.fill
:
parent
anchors.bottomMargin
:
5
RowLayout
{