Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-lrc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-lrc
Commits
1302194c
Commit
1302194c
authored
Aug 28, 2020
by
Aline Gondim Santos
Committed by
Sébastien Blin
Aug 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin: support for preferences in callView
Change-Id: I12241fa07e9ac6bcdbfdac29154d86528e606611
parent
dfeaa870
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
43 deletions
+39
-43
src/api/pluginmodel.h
src/api/pluginmodel.h
+29
-29
src/pluginmodel.cpp
src/pluginmodel.cpp
+10
-14
No files found.
src/api/pluginmodel.h
View file @
1302194c
...
@@ -28,34 +28,33 @@
...
@@ -28,34 +28,33 @@
// LRC
// LRC
#include "typedefs.h"
#include "typedefs.h"
namespace
lrc
namespace
lrc
{
{
namespace
api
namespace
api
{
{
namespace
plugin
namespace
plugin
{
{
/**
/**
* This class describes current plugin Details
* This class describes current plugin Details
*/
*/
struct
PluginDetails
struct
PluginDetails
{
{
QString
name
=
""
;
QString
name
=
""
;
QString
path
=
""
;
QString
path
=
""
;
QString
iconPath
=
""
;
QString
iconPath
=
""
;
bool
loaded
=
false
;
bool
loaded
=
false
;
};
};
struct
MediaHandlerDetails
struct
MediaHandlerDetails
{
{
QString
id
=
""
;
QString
id
=
""
;
QString
name
=
""
;
QString
name
=
""
;
QString
iconPath
=
""
;
QString
iconPath
=
""
;
};
QString
pluginId
=
""
;
}
};
}
// namespace plugin
class
LIB_EXPORT
PluginModel
:
public
QObject
{
class
LIB_EXPORT
PluginModel
:
public
QObject
{
Q_OBJECT
Q_OBJECT
public:
public:
PluginModel
();
PluginModel
();
...
@@ -148,7 +147,9 @@ public:
...
@@ -148,7 +147,9 @@ public:
* Modify preference of installed plugin
* Modify preference of installed plugin
* @return true if preference was succesfully modified
* @return true if preference was succesfully modified
*/
*/
Q_INVOKABLE
bool
setPluginPreference
(
const
QString
&
path
,
const
QString
&
key
,
const
QString
&
value
);
Q_INVOKABLE
bool
setPluginPreference
(
const
QString
&
path
,
const
QString
&
key
,
const
QString
&
value
);
/**
/**
* Get preferences values of installed plugin
* Get preferences values of installed plugin
...
@@ -170,7 +171,6 @@ public:
...
@@ -170,7 +171,6 @@ public:
Q_INVOKABLE
bool
addValueToPreference
(
const
QString
&
pluginId
,
Q_INVOKABLE
bool
addValueToPreference
(
const
QString
&
pluginId
,
const
QString
&
preferenceKey
,
const
QString
&
preferenceKey
,
const
QString
&
value
);
const
QString
&
value
);
};
};
}
// namespace api
}
// namespace api
...
...
src/pluginmodel.cpp
View file @
1302194c
...
@@ -35,17 +35,15 @@
...
@@ -35,17 +35,15 @@
// Ring daemon
// Ring daemon
// LRC
// LRC
#include "dbus/pluginmanager.h"
#include "dbus/pluginmanager.h"
namespace
lrc
namespace
lrc
{
{
using
namespace
api
;
using
namespace
api
;
PluginModel
::
PluginModel
()
PluginModel
::
PluginModel
()
:
QObject
()
:
QObject
()
{}
{}
PluginModel
::~
PluginModel
()
{}
PluginModel
::~
PluginModel
()
{}
...
@@ -82,8 +80,7 @@ PluginModel::getPluginDetails(const QString& path)
...
@@ -82,8 +80,7 @@ PluginModel::getPluginDetails(const QString& path)
}
}
MapStringString
details
=
PluginManager
::
instance
().
getPluginDetails
(
path
);
MapStringString
details
=
PluginManager
::
instance
().
getPluginDetails
(
path
);
plugin
::
PluginDetails
result
;
plugin
::
PluginDetails
result
;
if
(
!
details
.
empty
())
if
(
!
details
.
empty
())
{
{
result
.
name
=
details
[
"name"
];
result
.
name
=
details
[
"name"
];
result
.
path
=
path
;
result
.
path
=
path
;
result
.
iconPath
=
details
[
"iconPath"
];
result
.
iconPath
=
details
[
"iconPath"
];
...
@@ -100,8 +97,7 @@ PluginModel::getPluginDetails(const QString& path)
...
@@ -100,8 +97,7 @@ PluginModel::getPluginDetails(const QString& path)
bool
bool
PluginModel
::
installPlugin
(
const
QString
&
jplPath
,
bool
force
)
PluginModel
::
installPlugin
(
const
QString
&
jplPath
,
bool
force
)
{
{
if
(
getPluginsEnabled
())
if
(
getPluginsEnabled
())
{
{
return
PluginManager
::
instance
().
installPlugin
(
jplPath
,
force
);
return
PluginManager
::
instance
().
installPlugin
(
jplPath
,
force
);
}
}
return
false
;
return
false
;
...
@@ -136,7 +132,7 @@ void
...
@@ -136,7 +132,7 @@ void
PluginModel
::
toggleCallMediaHandler
(
const
QString
&
id
)
PluginModel
::
toggleCallMediaHandler
(
const
QString
&
id
)
{
{
MapStringString
toggleInfo
=
PluginManager
::
instance
().
getCallMediaHandlerStatus
();
MapStringString
toggleInfo
=
PluginManager
::
instance
().
getCallMediaHandlerStatus
();
if
(
toggleInfo
[
"name"
]
==
id
){
if
(
toggleInfo
[
"name"
]
==
id
)
{
PluginManager
::
instance
().
toggleCallMediaHandler
(
id
,
false
);
PluginManager
::
instance
().
toggleCallMediaHandler
(
id
,
false
);
}
else
{
}
else
{
PluginManager
::
instance
().
toggleCallMediaHandler
(
id
,
true
);
PluginManager
::
instance
().
toggleCallMediaHandler
(
id
,
true
);
...
@@ -157,11 +153,11 @@ PluginModel::getCallMediaHandlerDetails(const QString& id)
...
@@ -157,11 +153,11 @@ PluginModel::getCallMediaHandlerDetails(const QString& id)
}
}
MapStringString
mediaHandlerDetails
=
PluginManager
::
instance
().
getCallMediaHandlerDetails
(
id
);
MapStringString
mediaHandlerDetails
=
PluginManager
::
instance
().
getCallMediaHandlerDetails
(
id
);
plugin
::
MediaHandlerDetails
result
;
plugin
::
MediaHandlerDetails
result
;
if
(
!
mediaHandlerDetails
.
empty
())
if
(
!
mediaHandlerDetails
.
empty
())
{
{
result
.
id
=
id
;
result
.
id
=
id
;
result
.
iconPath
=
mediaHandlerDetails
[
"iconPath"
];
result
.
iconPath
=
mediaHandlerDetails
[
"iconPath"
];
result
.
name
=
mediaHandlerDetails
[
"name"
];
result
.
name
=
mediaHandlerDetails
[
"name"
];
result
.
pluginId
=
mediaHandlerDetails
[
"pluginId"
];
}
}
return
result
;
return
result
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment