Skip to content
Snippets Groups Projects
Commit a8be1f02 authored by Xavier Jouslin de Noray's avatar Xavier Jouslin de Noray
Browse files

PlatformPluginSupport: add info if plugins are not available for none supported platform

Gitlab: #1404

Change-Id: Iaa43a705d1b5e7cf9b960bdf1863d325e4a5332b
parent d5bacf6b
No related branches found
No related tags found
No related merge requests found
...@@ -626,6 +626,7 @@ Item { ...@@ -626,6 +626,7 @@ Item {
property string installMannuallyDescription: qsTr("Install an extension directly from your device.") property string installMannuallyDescription: qsTr("Install an extension directly from your device.")
property string pluginStoreTitle: qsTr("Available") property string pluginStoreTitle: qsTr("Available")
property string pluginStoreNotAvailable: qsTr("Plugins store is not available") property string pluginStoreNotAvailable: qsTr("Plugins store is not available")
property string storeNotSupportedPlatform: qsTr("The Jami Extension Store currently has no extension available for the platform in use. Check again later!")
property string pluginPreferences: qsTr("Preferences") property string pluginPreferences: qsTr("Preferences")
property string installationFailed: qsTr("Installation failed") property string installationFailed: qsTr("Installation failed")
property string pluginInstallationFailed: qsTr("The installation of the plugin failed") property string pluginInstallationFailed: qsTr("The installation of the plugin failed")
......
...@@ -102,8 +102,13 @@ PluginAdapter::getPluginsFromStore() ...@@ -102,8 +102,13 @@ PluginAdapter::getPluginsFromStore()
auto result = QJsonDocument::fromJson(data).array(); auto result = QJsonDocument::fromJson(data).array();
auto pluginsInstalled = lrcInstance_->pluginModel().getPluginsId(); auto pluginsInstalled = lrcInstance_->pluginModel().getPluginsId();
QList<QVariantMap> plugins; QList<QVariantMap> plugins;
if (result.size() == 0) {
Q_EMIT storeNotAvailableForPlatform();
return;
}
for (const auto& plugin : result) { for (const auto& plugin : result) {
auto qPlugin = plugin.toVariant().toMap(); auto qPlugin = plugin.toVariant().toMap();
if (!qPlugin.contains("id")) { if (!qPlugin.contains("id")) {
qPlugin["id"] = qPlugin["name"]; qPlugin["id"] = qPlugin["name"];
} }
......
...@@ -68,6 +68,7 @@ protected: ...@@ -68,6 +68,7 @@ protected:
bool removeLast = false); bool removeLast = false);
Q_SIGNALS: Q_SIGNALS:
void storeNotAvailable(); void storeNotAvailable();
void storeNotAvailableForPlatform();
private: private:
void updateHandlersListCount(); void updateHandlersListCount();
......
...@@ -19,6 +19,7 @@ import QtQuick ...@@ -19,6 +19,7 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Qt.labs.platform import Qt.labs.platform
import Qt5Compat.GraphicalEffects
import net.jami.Models 1.1 import net.jami.Models 1.1
import net.jami.Adapters 1.1 import net.jami.Adapters 1.1
import net.jami.Constants 1.1 import net.jami.Constants 1.1
...@@ -28,6 +29,8 @@ ColumnLayout { ...@@ -28,6 +29,8 @@ ColumnLayout {
id: root id: root
property bool storeAvailable: true property bool storeAvailable: true
property bool remotePluginHovered: false property bool remotePluginHovered: false
property bool storeAvailableForPlatform: true
Component.onCompleted: { Component.onCompleted: {
PluginAdapter.getPluginsFromStore(); PluginAdapter.getPluginsFromStore();
} }
...@@ -36,6 +39,9 @@ ColumnLayout { ...@@ -36,6 +39,9 @@ ColumnLayout {
function onStoreNotAvailable() { function onStoreNotAvailable() {
storeAvailable = false; storeAvailable = false;
} }
function onStoreNotAvailableForPlatform() {
storeAvailableForPlatform = false;
}
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
...@@ -57,10 +63,8 @@ ColumnLayout { ...@@ -57,10 +63,8 @@ ColumnLayout {
height: childrenRect.height height: childrenRect.height
spacing: 10 spacing: 10
Repeater { Repeater {
id: pluginStoreRepeater
model: PluginStoreListModel model: PluginStoreListModel
onCountChanged: {
root.visible = count > 0;
}
delegate: Item { delegate: Item {
id: wrapper id: wrapper
function widthProvider() { function widthProvider() {
...@@ -111,4 +115,43 @@ ColumnLayout { ...@@ -111,4 +115,43 @@ ColumnLayout {
text: JamiStrings.pluginStoreNotAvailable text: JamiStrings.pluginStoreNotAvailable
} }
} }
Loader {
id: platormNotAvailableLoader
Layout.fillWidth: true
active: !storeAvailableForPlatform && storeAvailable
Layout.preferredHeight: active ? JamiTheme.materialButtonPreferredHeight + 10 : 0
sourceComponent: Rectangle {
width: platormNotAvailableLoader.width
height: platormNotAvailableLoader.height
color: JamiTheme.lightTintedBlue
radius: 5
RowLayout {
width: parent.width
height: parent.height
ResponsiveImage {
layer {
enabled: true
effect: ColorOverlay {
color: JamiTheme.darkTintedBlue
}
}
Layout.leftMargin: 5
Layout.alignment: Qt.AlignRight | Qt.AlignHCenter
width: JamiTheme.popuptextSize
height: JamiTheme.popuptextSize
source: JamiResources.outline_info_24dp_svg
}
Text {
Scaffold {
}
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignRight
wrapMode: Text.WordWrap
color: JamiTheme.blackColor
font.pixelSize: JamiTheme.popuptextSize
text: JamiStrings.storeNotSupportedPlatform
}
}
}
}
} }
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
*/ */
QString getPluginPath(const QString& pluginId); QString getPluginPath(const QString& pluginId);
MapStringString getPlatformInfo(); Q_INVOKABLE MapStringString getPlatformInfo();
/** /**
* @brief fetch all plugins path and id * @brief fetch all plugins path and id
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment