diff --git a/src/app/constant/JamiStrings.qml b/src/app/constant/JamiStrings.qml index a40318278281fc308ec2e74ab045ffda8c7787e9..219b186793cf1c55e1f43428e1410505075a5679 100644 --- a/src/app/constant/JamiStrings.qml +++ b/src/app/constant/JamiStrings.qml @@ -626,6 +626,7 @@ Item { property string installMannuallyDescription: qsTr("Install an extension directly from your device.") property string pluginStoreTitle: qsTr("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 installationFailed: qsTr("Installation failed") property string pluginInstallationFailed: qsTr("The installation of the plugin failed") diff --git a/src/app/pluginadapter.cpp b/src/app/pluginadapter.cpp index 1ca2c4065397396ac1db728fcc3b4e1291f4284e..c3b22b245c60b1f39c645319f91425dbba94855d 100644 --- a/src/app/pluginadapter.cpp +++ b/src/app/pluginadapter.cpp @@ -102,8 +102,13 @@ PluginAdapter::getPluginsFromStore() auto result = QJsonDocument::fromJson(data).array(); auto pluginsInstalled = lrcInstance_->pluginModel().getPluginsId(); QList<QVariantMap> plugins; + if (result.size() == 0) { + Q_EMIT storeNotAvailableForPlatform(); + return; + } for (const auto& plugin : result) { auto qPlugin = plugin.toVariant().toMap(); + if (!qPlugin.contains("id")) { qPlugin["id"] = qPlugin["name"]; } diff --git a/src/app/pluginadapter.h b/src/app/pluginadapter.h index afd02c263a59092d5b2df6b12c20dc0884edee1d..a7048631dbfac00685a3af3e48ef0917d16f4cc8 100644 --- a/src/app/pluginadapter.h +++ b/src/app/pluginadapter.h @@ -68,6 +68,7 @@ protected: bool removeLast = false); Q_SIGNALS: void storeNotAvailable(); + void storeNotAvailableForPlatform(); private: void updateHandlersListCount(); diff --git a/src/app/settingsview/components/PluginStoreListView.qml b/src/app/settingsview/components/PluginStoreListView.qml index 02fa930fa0e88c8608a4ad4161415be8906acbe7..f6e697d56cce0cef1d1f04f195085e7be6976745 100644 --- a/src/app/settingsview/components/PluginStoreListView.qml +++ b/src/app/settingsview/components/PluginStoreListView.qml @@ -19,6 +19,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import Qt.labs.platform +import Qt5Compat.GraphicalEffects import net.jami.Models 1.1 import net.jami.Adapters 1.1 import net.jami.Constants 1.1 @@ -28,6 +29,8 @@ ColumnLayout { id: root property bool storeAvailable: true property bool remotePluginHovered: false + property bool storeAvailableForPlatform: true + Component.onCompleted: { PluginAdapter.getPluginsFromStore(); } @@ -36,6 +39,9 @@ ColumnLayout { function onStoreNotAvailable() { storeAvailable = false; } + function onStoreNotAvailableForPlatform() { + storeAvailableForPlatform = false; + } } Label { Layout.fillWidth: true @@ -57,10 +63,8 @@ ColumnLayout { height: childrenRect.height spacing: 10 Repeater { + id: pluginStoreRepeater model: PluginStoreListModel - onCountChanged: { - root.visible = count > 0; - } delegate: Item { id: wrapper function widthProvider() { @@ -111,4 +115,43 @@ ColumnLayout { 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 + } + } + } + } } diff --git a/src/libclient/api/pluginmodel.h b/src/libclient/api/pluginmodel.h index 9dee4df0013316e40b7bfe840ec92a6a6d365d5a..3fd4500adb63d8d72e6311f4a8b66d73f911c414 100644 --- a/src/libclient/api/pluginmodel.h +++ b/src/libclient/api/pluginmodel.h @@ -102,7 +102,7 @@ public: */ QString getPluginPath(const QString& pluginId); - MapStringString getPlatformInfo(); + Q_INVOKABLE MapStringString getPlatformInfo(); /** * @brief fetch all plugins path and id *