feat: send a notify when plugin is not compatible

https://github.com/linuxdeepin/internal-discussion/issues/840

Change-Id: I9c46ebcb984e3a2660e7607774a54c931d2cf123
This commit is contained in:
listenerri 2019-02-27 15:14:16 +08:00
parent fc06a6a078
commit f30e28cf81
Notes: gerrit 2019-02-28 19:28:22 +08:00
Verified+1: <jenkins@deepin.com>
Code-Review+2: listenerri <listenerri@gmail.com>
Submitted-by: listenerri <listenerri@gmail.com>
Submitted-at: Thu, 28 Feb 2019 19:28:22 +0800
Reviewed-on: https://cr.deepin.io/41784
Project: dde/dde-dock
Branch: refs/heads/master
2 changed files with 12 additions and 0 deletions

View File

@ -154,6 +154,10 @@ void DockPluginsController::loadPlugin(const QString &pluginFile)
const auto meta = pluginLoader->metaData().value("MetaData").toObject();
if (!meta.contains("api") || meta["api"].toString() != DOCK_PLUGIN_API_VERSION)
{
QString notifyMessage(tr("The plugin %1 is not compatible with the system."));
QProcess::startDetached("notify-send", QStringList()
<< "-i" << "dialog-warning"
<< notifyMessage.arg(QFileInfo(pluginFile).fileName()));
qWarning() << "plugin api version not matched! expect version:" << DOCK_PLUGIN_API_VERSION << pluginFile;
return;
}

View File

@ -104,6 +104,14 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DockPluginsController</name>
<message>
<location filename="../frame/controller/dockpluginscontroller.cpp" line="157"/>
<source>The plugin %1 is not compatible with the system.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DockSettings</name>
<message>