mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
PlatformPluginSupport: add info if plugins are not available for none supported platform
Gitlab: #1404 Change-Id: Iaa43a705d1b5e7cf9b960bdf1863d325e4a5332b
This commit is contained in:
parent
d5bacf6b9f
commit
a8be1f0271
5 changed files with 54 additions and 4 deletions
|
@ -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")
|
||||
|
|
|
@ -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"];
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ protected:
|
|||
bool removeLast = false);
|
||||
Q_SIGNALS:
|
||||
void storeNotAvailable();
|
||||
void storeNotAvailableForPlatform();
|
||||
|
||||
private:
|
||||
void updateHandlersListCount();
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
*/
|
||||
QString getPluginPath(const QString& pluginId);
|
||||
|
||||
MapStringString getPlatformInfo();
|
||||
Q_INVOKABLE MapStringString getPlatformInfo();
|
||||
/**
|
||||
* @brief fetch all plugins path and id
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue