diff --git a/daemon b/daemon index 417447a167c52512e8c81250cc08bb5b24c6b667..d191e2e262a26c5c17bc0ea2ecea08fe6f42142c 160000 --- a/daemon +++ b/daemon @@ -1 +1 @@ -Subproject commit 417447a167c52512e8c81250cc08bb5b24c6b667 +Subproject commit d191e2e262a26c5c17bc0ea2ecea08fe6f42142c diff --git a/src/app/currentaccount.cpp b/src/app/currentaccount.cpp index 00090325d85f09e42e8aee58bdaf1fe66bdb452e..5b1b54b1aa88886e18932015bbe384656cfdd62e 100644 --- a/src/app/currentaccount.cpp +++ b/src/app/currentaccount.cpp @@ -222,6 +222,9 @@ CurrentAccount::updateData() set_autoTransferSizeThreshold(settingsManager_->getValue(Settings::Key::AcceptTransferBelow) .toInt(), true); + + // UI Customization settings + set_uiCustomization(accConfig.uiCustomization, true); } catch (...) { qWarning() << "Can't update current account info data for" << id_; } diff --git a/src/app/currentaccount.h b/src/app/currentaccount.h index a20d959c2b9f9904494a790adc572d7fd4b1fc95..f73a4240a292618246feed9b721066cbb80b2754 100644 --- a/src/app/currentaccount.h +++ b/src/app/currentaccount.h @@ -191,6 +191,9 @@ class CurrentAccount final : public QObject QML_NEW_ACCOUNT_MODEL_SETTINGS_PROPERTY(bool, autoTransferFromTrusted, AutoAcceptFiles) QML_NEW_ACCOUNT_MODEL_SETTINGS_PROPERTY(int, autoTransferSizeThreshold, AcceptTransferBelow) + // UI Customization settings + QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(QJsonObject, uiCustomization) + public: explicit CurrentAccount(LRCInstance* lrcInstance, AppSettingsManager* settingsManager, diff --git a/src/libclient/accountmodel.cpp b/src/libclient/accountmodel.cpp index 1669a49a937955a5fde03d773340cadf0def1dd6..c484e6d561b8899807292087a0449b7b726c6581 100644 --- a/src/libclient/accountmodel.cpp +++ b/src/libclient/accountmodel.cpp @@ -49,6 +49,7 @@ #include <QtGui/QPixmap> #include <QtGui/QImage> #include <QtCore/QBuffer> +#include <QJsonDocument> #include <atomic> @@ -928,6 +929,11 @@ account::Info::fromDetails(const MapStringString& details) // Jams confProperties.managerUri = details[ConfProperties::MANAGER_URI]; confProperties.managerUsername = details[ConfProperties::MANAGER_USERNAME]; + // uiCustomization + QJsonDocument doc = QJsonDocument::fromJson(details[ConfProperties::UI_CUSTOMIZATION].toUtf8()); + if (!doc.isNull() && doc.isObject()) { + confProperties.uiCustomization = doc.object(); + } } MapStringString @@ -1033,6 +1039,9 @@ account::ConfProperties_t::toDetails() const // Manager details[ConfProperties::MANAGER_URI] = this->managerUri; details[ConfProperties::MANAGER_USERNAME] = this->managerUsername; + // UI Customization + QJsonDocument doc(this->uiCustomization); + details[ConfProperties::UI_CUSTOMIZATION] = doc.toJson(QJsonDocument::Compact); return details; } diff --git a/src/libclient/api/account.h b/src/libclient/api/account.h index 58701dd3eee86b865acbd577a433722a9ffab959..c57491bd937aaf9b4ac6eb421c646c959ddf5455 100644 --- a/src/libclient/api/account.h +++ b/src/libclient/api/account.h @@ -25,6 +25,7 @@ #include <memory> #include <QString> +#include <QJsonObject> namespace lrc { @@ -118,6 +119,7 @@ struct ConfProperties_t QString defaultModerators; bool localModeratorsEnabled; VectorMapStringString credentials; + QJsonObject uiCustomization; struct Audio_t { int audioPortMax;