Commit dfeaa870 authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Sébastien Blin

plugin:add editable preference

Change-Id: I7483021c6e866456638ff4285d2888d30454227e
parent ac1c821c
......@@ -157,11 +157,20 @@ public:
Q_INVOKABLE MapStringString getPluginPreferencesValues(const QString& path);
/**
* Reste preferences values of installed plugin to default values
* Reset preferences values of installed plugin to default values
* @return true if preference was succesfully reset
*/
Q_INVOKABLE bool resetPluginPreferencesValues(const QString& path);
/**
* Add a possible value to a preference that can be edited by the user
* the only possibility at the moment is USERLIST option
* @return if addition was successfull
*/
Q_INVOKABLE bool addValueToPreference(const QString& pluginId,
const QString& preferenceKey,
const QString& value);
};
} // namespace api
......
......@@ -191,6 +191,14 @@ PluginModel::resetPluginPreferencesValues(const QString& path)
return PluginManager::instance().resetPluginPreferencesValues(path);
}
bool
PluginModel::addValueToPreference(const QString& pluginId,
const QString& preferenceKey,
const QString& value)
{
return PluginManager::instance().addValueToPreference(pluginId, preferenceKey, value);
}
} // namespace lrc
#include "api/moc_pluginmodel.cpp"
......
......@@ -124,3 +124,13 @@ PluginManagerInterface::resetPluginPreferencesValues(const QString& path)
{
return DRing::resetPluginPreferencesValues(path.toStdString());
}
bool
PluginManagerInterface::addValueToPreference(const QString& pluginId,
const QString& preferenceKey,
const QString& value)
{
return DRing::addValueToPreference(pluginId.toStdString(),
preferenceKey.toStdString(),
value.toStdString());
}
......@@ -79,6 +79,10 @@ public Q_SLOTS: // METHODS
MapStringString getPluginPreferencesValues(const QString& path);
bool resetPluginPreferencesValues(const QString& path);
bool addValueToPreference(const QString& pluginId,
const QString& preferenceKey,
const QString& value);
};
namespace org {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment