Skip to content
Snippets Groups Projects
Commit d96ee4c4 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

misc: add preferences to enable full UI for swarm

Change-Id: Ied9e8d59fe9dff08ffbc10d2c723b8998d8469f1
GitLab: #670
parent e944e2e0
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ extern const QString defaultDownloadPath; ...@@ -43,6 +43,7 @@ extern const QString defaultDownloadPath;
X(AcceptTransferBelow, 20) \ X(AcceptTransferBelow, 20) \
X(AutoAcceptFiles, true) \ X(AutoAcceptFiles, true) \
X(DisplayHyperlinkPreviews, true) \ X(DisplayHyperlinkPreviews, true) \
X(EnableExperimentalSwarm, false) \
X(EnableDarkTheme, false) \ X(EnableDarkTheme, false) \
X(AutoUpdate, true) \ X(AutoUpdate, true) \
X(StartMinimized, false) \ X(StartMinimized, false) \
......
...@@ -424,6 +424,8 @@ Item { ...@@ -424,6 +424,8 @@ Item {
property string troubleshootTitle: qsTr("Troubleshoot") property string troubleshootTitle: qsTr("Troubleshoot")
property string troubleshootButton: qsTr("Open logs") property string troubleshootButton: qsTr("Open logs")
property string troubleshootText: qsTr("Get logs") property string troubleshootText: qsTr("Get logs")
property string experimentalSwarm: qsTr("(Experimental) Enable small groups support for Swarm")
property string experimentalSwarmTooltip: qsTr("This feature is in development.")
// Recording Settings // Recording Settings
property string tipRecordFolder: qsTr("Select a record directory") property string tipRecordFolder: qsTr("Select a record directory")
......
...@@ -21,9 +21,10 @@ import QtQuick ...@@ -21,9 +21,10 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
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
import net.jami.Enums 1.1
import net.jami.Models 1.1
import "../../commoncomponents" import "../../commoncomponents"
...@@ -175,10 +176,20 @@ Rectangle { ...@@ -175,10 +176,20 @@ Rectangle {
preferredSize: startBar.height preferredSize: startBar.height
visible: UtilsAdapter.getAppValue(Settings.EnableExperimentalSwarm)
source: smartListLayout.visible ? JamiResources.create_swarm_svg : JamiResources.round_close_24dp_svg source: smartListLayout.visible ? JamiResources.create_swarm_svg : JamiResources.round_close_24dp_svg
toolTipText: smartListLayout.visible ? JamiStrings.startASwarm : JamiStrings.cancel toolTipText: smartListLayout.visible ? JamiStrings.startASwarm : JamiStrings.cancel
onClicked: createSwarmClicked() onClicked: createSwarmClicked()
Connections {
target: UtilsAdapter
function onShowExperimentalSwarm() {
startConversation.visible = UtilsAdapter.getAppValue(Settings.EnableExperimentalSwarm)
}
}
} }
} }
......
...@@ -20,9 +20,10 @@ import QtQuick ...@@ -20,9 +20,10 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
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
import net.jami.Enums 1.1
import net.jami.Models 1.1
import "../../commoncomponents" import "../../commoncomponents"
import "../js/logviewwindowcreation.js" as LogViewWindowCreation import "../js/logviewwindowcreation.js" as LogViewWindowCreation
...@@ -83,4 +84,22 @@ ColumnLayout { ...@@ -83,4 +84,22 @@ ColumnLayout {
} }
} }
} }
ToggleSwitch {
id: checkboxSwarm
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
checked: UtilsAdapter.getAppValue(Settings.EnableExperimentalSwarm)
labelText: JamiStrings.experimentalSwarm
fontPointSize: JamiTheme.settingsFontSize
tooltipText: JamiStrings.experimentalSwarmTooltip
onSwitchToggled: {
UtilsAdapter.setAppValue(Settings.Key.EnableExperimentalSwarm, checked)
}
}
} }
...@@ -365,6 +365,8 @@ UtilsAdapter::setAppValue(const Settings::Key key, const QVariant& value) ...@@ -365,6 +365,8 @@ UtilsAdapter::setAppValue(const Settings::Key key, const QVariant& value)
// If we change the lang preference, reload the translations // If we change the lang preference, reload the translations
if (key == Settings::Key::LANG) if (key == Settings::Key::LANG)
settingsManager_->loadTranslations(); settingsManager_->loadTranslations();
else if (key == Settings::Key::EnableExperimentalSwarm)
Q_EMIT showExperimentalSwarm();
} }
QString QString
......
...@@ -110,6 +110,7 @@ public: ...@@ -110,6 +110,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void debugMessageReceived(const QString& message); void debugMessageReceived(const QString& message);
void showExperimentalSwarm();
private: private:
QClipboard* clipboard_; QClipboard* clipboard_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment