mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-05 07:15:40 +02:00
settings: refactor for SettingsView - stage one
1. Add account config QML properties and use them in settings directly to avoid manual update 2. Rough clean up for video/audio settings 3. Remove settingsAdapter entirely and split the responsibility Change-Id: Icf81b91d5a3a0dd9f2a52824159cd222367b801f
This commit is contained in:
parent
8e1736fd9e
commit
a196513d2e
57 changed files with 1078 additions and 2132 deletions
|
@ -60,7 +60,6 @@ set(COMMON_SOURCES
|
||||||
${SRC_DIR}/avadapter.cpp
|
${SRC_DIR}/avadapter.cpp
|
||||||
${SRC_DIR}/contactadapter.cpp
|
${SRC_DIR}/contactadapter.cpp
|
||||||
${SRC_DIR}/pluginadapter.cpp
|
${SRC_DIR}/pluginadapter.cpp
|
||||||
${SRC_DIR}/settingsadapter.cpp
|
|
||||||
${SRC_DIR}/deviceitemlistmodel.cpp
|
${SRC_DIR}/deviceitemlistmodel.cpp
|
||||||
${SRC_DIR}/pluginitemlistmodel.cpp
|
${SRC_DIR}/pluginitemlistmodel.cpp
|
||||||
${SRC_DIR}/pluginhandleritemlistmodel.cpp
|
${SRC_DIR}/pluginhandleritemlistmodel.cpp
|
||||||
|
@ -117,7 +116,6 @@ set(COMMON_HEADERS
|
||||||
${SRC_DIR}/avadapter.h
|
${SRC_DIR}/avadapter.h
|
||||||
${SRC_DIR}/contactadapter.h
|
${SRC_DIR}/contactadapter.h
|
||||||
${SRC_DIR}/pluginadapter.h
|
${SRC_DIR}/pluginadapter.h
|
||||||
${SRC_DIR}/settingsadapter.h
|
|
||||||
${SRC_DIR}/deviceitemlistmodel.h
|
${SRC_DIR}/deviceitemlistmodel.h
|
||||||
${SRC_DIR}/pluginitemlistmodel.h
|
${SRC_DIR}/pluginitemlistmodel.h
|
||||||
${SRC_DIR}/pluginhandleritemlistmodel.h
|
${SRC_DIR}/pluginhandleritemlistmodel.h
|
||||||
|
|
|
@ -116,7 +116,7 @@ ApplicationWindow {
|
||||||
function close(force = false) {
|
function close(force = false) {
|
||||||
// If we're in the onboarding wizard or 'MinimizeOnClose'
|
// If we're in the onboarding wizard or 'MinimizeOnClose'
|
||||||
// is set, then we can quit
|
// is set, then we can quit
|
||||||
if (force || !SettingsAdapter.getAppValue(Settings.MinimizeOnClose) ||
|
if (force || !UtilsAdapter.getAppValue(Settings.MinimizeOnClose) ||
|
||||||
!UtilsAdapter.getAccountListSize()) {
|
!UtilsAdapter.getAccountListSize()) {
|
||||||
Qt.quit()
|
Qt.quit()
|
||||||
} else
|
} else
|
||||||
|
@ -158,7 +158,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
// Quiet check for updates on start if set to.
|
// Quiet check for updates on start if set to.
|
||||||
if (SettingsAdapter.getAppValue(Settings.AutoUpdate)) {
|
if (UtilsAdapter.getAppValue(Settings.AutoUpdate)) {
|
||||||
UpdateManager.checkForUpdates(true)
|
UpdateManager.checkForUpdates(true)
|
||||||
UpdateManager.setAutoUpdateCheck(true)
|
UpdateManager.setAutoUpdateCheck(true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,6 +324,20 @@ AccountAdapter::setCurrentAccountAvatarBase64(const QString& data)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AccountAdapter::setDefaultModerator(const QString& accountId,
|
||||||
|
const QString& peerURI,
|
||||||
|
const bool& state)
|
||||||
|
{
|
||||||
|
lrcInstance_->accountModel().setDefaultModerator(accountId, peerURI, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList
|
||||||
|
AccountAdapter::getDefaultModerators(const QString& accountId)
|
||||||
|
{
|
||||||
|
return lrcInstance_->accountModel().getDefaultModerators(accountId);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AccountAdapter::hasPassword()
|
AccountAdapter::hasPassword()
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,6 +85,10 @@ public:
|
||||||
Q_INVOKABLE void setCurrAccDisplayName(const QString& text);
|
Q_INVOKABLE void setCurrAccDisplayName(const QString& text);
|
||||||
Q_INVOKABLE void setCurrentAccountAvatarFile(const QString& source);
|
Q_INVOKABLE void setCurrentAccountAvatarFile(const QString& source);
|
||||||
Q_INVOKABLE void setCurrentAccountAvatarBase64(const QString& source = {});
|
Q_INVOKABLE void setCurrentAccountAvatarBase64(const QString& source = {});
|
||||||
|
Q_INVOKABLE void setDefaultModerator(const QString& accountId,
|
||||||
|
const QString& peerURI,
|
||||||
|
const bool& state);
|
||||||
|
Q_INVOKABLE QStringList getDefaultModerators(const QString& accountId);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
// Trigger other components to reconnect account related signals.
|
// Trigger other components to reconnect account related signals.
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
#include "avadapter.h"
|
#include "avadapter.h"
|
||||||
#include "qtutils.h"
|
#include "qtutils.h"
|
||||||
|
|
||||||
|
#include "api/newcodecmodel.h"
|
||||||
|
#include "api/newdevicemodel.h"
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
#include "xrectsel.h"
|
#include "xrectsel.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -339,3 +342,51 @@ AvAdapter::getScreenNumber() const
|
||||||
#endif
|
#endif
|
||||||
return display;
|
return display;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AvAdapter::setDeviceName(const QString& deviceName)
|
||||||
|
{
|
||||||
|
lrcInstance_->getCurrentAccountInfo().deviceModel->setCurrentDeviceName(deviceName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AvAdapter::setCurrentVideoDeviceRateAndResolution(qreal rate, const QString& resolution)
|
||||||
|
{
|
||||||
|
auto settings = lrcInstance_->avModel().getDeviceSettings(
|
||||||
|
lrcInstance_->avModel().getCurrentVideoCaptureDevice());
|
||||||
|
settings.rate = rate;
|
||||||
|
settings.size = resolution;
|
||||||
|
lrcInstance_->avModel().setDeviceSettings(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
AvAdapter::getVideoSettingsSize(const QString& deviceId)
|
||||||
|
{
|
||||||
|
return lrcInstance_->avModel().getDeviceSettings(deviceId).size;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
AvAdapter::getCurrentVideoDeviceCapabilitiesSize()
|
||||||
|
{
|
||||||
|
return lrcInstance_->avModel()
|
||||||
|
.getDeviceCapabilities(lrcInstance_->avModel().getCurrentVideoCaptureDevice())
|
||||||
|
.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AvAdapter::enableCodec(unsigned int id, bool isToEnable)
|
||||||
|
{
|
||||||
|
lrcInstance_->getCurrentAccountInfo().codecModel->enable(id, isToEnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AvAdapter::increaseCodecPriority(unsigned int id, bool isVideo)
|
||||||
|
{
|
||||||
|
lrcInstance_->getCurrentAccountInfo().codecModel->increasePriority(id, isVideo);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AvAdapter::decreaseCodecPriority(unsigned int id, bool isVideo)
|
||||||
|
{
|
||||||
|
lrcInstance_->getCurrentAccountInfo().codecModel->decreasePriority(id, isVideo);
|
||||||
|
}
|
||||||
|
|
|
@ -75,6 +75,15 @@ protected:
|
||||||
Q_INVOKABLE void startAudioMeter();
|
Q_INVOKABLE void startAudioMeter();
|
||||||
Q_INVOKABLE void stopAudioMeter();
|
Q_INVOKABLE void stopAudioMeter();
|
||||||
|
|
||||||
|
Q_INVOKABLE void setDeviceName(const QString& deviceName);
|
||||||
|
Q_INVOKABLE void setCurrentVideoDeviceRateAndResolution(qreal rate, const QString& resolution);
|
||||||
|
Q_INVOKABLE QString getVideoSettingsSize(const QString& deviceId);
|
||||||
|
Q_INVOKABLE int getCurrentVideoDeviceCapabilitiesSize();
|
||||||
|
|
||||||
|
Q_INVOKABLE void enableCodec(unsigned int id, bool isToEnable);
|
||||||
|
Q_INVOKABLE void increaseCodecPriority(unsigned int id, bool isVideo);
|
||||||
|
Q_INVOKABLE void decreaseCodecPriority(unsigned int id, bool isVideo);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void onAudioDeviceEvent();
|
void onAudioDeviceEvent();
|
||||||
void onVideoDeviceEvent();
|
void onVideoDeviceEvent();
|
||||||
|
|
|
@ -29,10 +29,8 @@ import "../commoncomponents"
|
||||||
BaseDialog {
|
BaseDialog {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int profileType: SettingsAdapter.getCurrentAccount_Profile_Info_Type()
|
|
||||||
|
|
||||||
property bool isSIP: {
|
property bool isSIP: {
|
||||||
switch (profileType) {
|
switch (CurrentAccount.type) {
|
||||||
case Profile.Type.SIP:
|
case Profile.Type.SIP:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
@ -42,13 +40,6 @@ BaseDialog {
|
||||||
|
|
||||||
signal accepted
|
signal accepted
|
||||||
|
|
||||||
function openDialog() {
|
|
||||||
profileType = SettingsAdapter.getCurrentAccount_Profile_Info_Type()
|
|
||||||
labelBestId.text = SettingsAdapter.getAccountBestName()
|
|
||||||
labelAccountHash.text = SettingsAdapter.getCurrentAccount_Profile_Info_Uri()
|
|
||||||
open()
|
|
||||||
}
|
|
||||||
|
|
||||||
title: JamiStrings.deleteAccount
|
title: JamiStrings.deleteAccount
|
||||||
|
|
||||||
contentItem: Rectangle {
|
contentItem: Rectangle {
|
||||||
|
@ -67,7 +58,8 @@ BaseDialog {
|
||||||
id: labelDeletion
|
id: labelDeletion
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: deleteAccountContentRect.width - JamiTheme.preferredMarginSize * 2
|
Layout.preferredWidth: deleteAccountContentRect.width -
|
||||||
|
JamiTheme.preferredMarginSize * 2
|
||||||
|
|
||||||
color: JamiTheme.textColor
|
color: JamiTheme.textColor
|
||||||
text: JamiStrings.confirmDeleteQuestion
|
text: JamiStrings.confirmDeleteQuestion
|
||||||
|
@ -84,10 +76,11 @@ BaseDialog {
|
||||||
id: labelBestId
|
id: labelBestId
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: deleteAccountContentRect.width - JamiTheme.preferredMarginSize * 2
|
Layout.preferredWidth: deleteAccountContentRect.width -
|
||||||
|
JamiTheme.preferredMarginSize * 2
|
||||||
|
|
||||||
color: JamiTheme.textColor
|
color: JamiTheme.textColor
|
||||||
text: SettingsAdapter.getAccountBestName()
|
text: CurrentAccount.bestName
|
||||||
|
|
||||||
font.pointSize: JamiTheme.textFontSize
|
font.pointSize: JamiTheme.textFontSize
|
||||||
font.kerning: true
|
font.kerning: true
|
||||||
|
@ -102,10 +95,11 @@ BaseDialog {
|
||||||
id: labelAccountHash
|
id: labelAccountHash
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: deleteAccountContentRect.width - JamiTheme.preferredMarginSize * 2
|
Layout.preferredWidth: deleteAccountContentRect.width -
|
||||||
|
JamiTheme.preferredMarginSize * 2
|
||||||
|
|
||||||
color: JamiTheme.textColor
|
color: JamiTheme.textColor
|
||||||
text: SettingsAdapter.getCurrentAccount_Profile_Info_Uri()
|
text: CurrentAccount.uri
|
||||||
|
|
||||||
font.pointSize: JamiTheme.textFontSize
|
font.pointSize: JamiTheme.textFontSize
|
||||||
font.kerning: true
|
font.kerning: true
|
||||||
|
@ -121,7 +115,8 @@ BaseDialog {
|
||||||
visible: !isSIP
|
visible: !isSIP
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: deleteAccountContentRect.width - JamiTheme.preferredMarginSize * 2
|
Layout.preferredWidth: deleteAccountContentRect.width -
|
||||||
|
JamiTheme.preferredMarginSize * 2
|
||||||
|
|
||||||
text: JamiStrings.deleteAccountInfos
|
text: JamiStrings.deleteAccountInfos
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,8 @@ Item {
|
||||||
// AdvancedMediaSettings
|
// AdvancedMediaSettings
|
||||||
property string media: qsTr("Media")
|
property string media: qsTr("Media")
|
||||||
property string enableVideo: qsTr("Enable video")
|
property string enableVideo: qsTr("Enable video")
|
||||||
|
property string videoCodecs: qsTr("Video Codecs")
|
||||||
|
property string audioCodecs: qsTr("Audio Codecs")
|
||||||
|
|
||||||
// AdvancedSDPSettings
|
// AdvancedSDPSettings
|
||||||
property string sdpSettingsTitle: qsTr("SDP Session Negotiation (ICE Fallback)")
|
property string sdpSettingsTitle: qsTr("SDP Session Negotiation (ICE Fallback)")
|
||||||
|
|
|
@ -25,7 +25,7 @@ import net.jami.Adapters 1.1
|
||||||
import net.jami.Enums 1.1
|
import net.jami.Enums 1.1
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property bool darkTheme: SettingsAdapter.getAppValue(Settings.EnableDarkTheme)
|
property bool darkTheme: UtilsAdapter.getAppValue(Settings.EnableDarkTheme)
|
||||||
|
|
||||||
// Jami theme colors
|
// Jami theme colors
|
||||||
function rgba256(r, g, b, a) {
|
function rgba256(r, g, b, a) {
|
||||||
|
|
|
@ -18,8 +18,11 @@
|
||||||
|
|
||||||
#include "currentaccount.h"
|
#include "currentaccount.h"
|
||||||
|
|
||||||
CurrentAccount::CurrentAccount(LRCInstance* lrcInstance, QObject* parent)
|
CurrentAccount::CurrentAccount(LRCInstance* lrcInstance,
|
||||||
|
AppSettingsManager* settingsManager,
|
||||||
|
QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
, settingsManager_(settingsManager)
|
||||||
, lrcInstance_(lrcInstance)
|
, lrcInstance_(lrcInstance)
|
||||||
{
|
{
|
||||||
connect(&lrcInstance_->accountModel(),
|
connect(&lrcInstance_->accountModel(),
|
||||||
|
@ -33,9 +36,64 @@ CurrentAccount::CurrentAccount(LRCInstance* lrcInstance, QObject* parent)
|
||||||
&CurrentAccount::onAccountUpdated);
|
&CurrentAccount::onAccountUpdated);
|
||||||
|
|
||||||
connect(lrcInstance_, &LRCInstance::currentAccountIdChanged, [this] { updateData(); });
|
connect(lrcInstance_, &LRCInstance::currentAccountIdChanged, [this] { updateData(); });
|
||||||
|
|
||||||
updateData();
|
updateData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CurrentAccount::set_enabled(bool enabled, bool initialize)
|
||||||
|
{
|
||||||
|
if (enabled_ != enabled) {
|
||||||
|
enabled_ = enabled;
|
||||||
|
if (!initialize)
|
||||||
|
lrcInstance_->accountModel().setAccountEnabled(lrcInstance_->get_currentAccountId(),
|
||||||
|
enabled);
|
||||||
|
Q_EMIT enabledChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CurrentAccount::get_enabled()
|
||||||
|
{
|
||||||
|
return enabled_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CurrentAccount::set_isAllModeratorsEnabled(bool enabled, bool initialize)
|
||||||
|
{
|
||||||
|
if (enabled != isAllModeratorsEnabled_) {
|
||||||
|
isAllModeratorsEnabled_ = enabled;
|
||||||
|
if (!initialize)
|
||||||
|
lrcInstance_->accountModel().setAllModerators(lrcInstance_->get_currentAccountId(),
|
||||||
|
enabled);
|
||||||
|
Q_EMIT isAllModeratorsEnabledChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CurrentAccount::get_isAllModeratorsEnabled()
|
||||||
|
{
|
||||||
|
return isAllModeratorsEnabled_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CurrentAccount::set_isLocalModeratorsEnabled(bool enabled, bool initialize)
|
||||||
|
{
|
||||||
|
if (enabled != isLocalModeratorsEnabled_) {
|
||||||
|
isLocalModeratorsEnabled_ = enabled;
|
||||||
|
if (!initialize)
|
||||||
|
lrcInstance_->accountModel().enableLocalModerators(lrcInstance_->get_currentAccountId(),
|
||||||
|
enabled);
|
||||||
|
Q_EMIT isLocalModeratorsEnabledChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CurrentAccount::get_isLocalModeratorsEnabled()
|
||||||
|
{
|
||||||
|
return isLocalModeratorsEnabled_;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CurrentAccount::onAccountUpdated(const QString& id)
|
CurrentAccount::onAccountUpdated(const QString& id)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +108,9 @@ CurrentAccount::updateData()
|
||||||
{
|
{
|
||||||
set_id(lrcInstance_->get_currentAccountId());
|
set_id(lrcInstance_->get_currentAccountId());
|
||||||
try {
|
try {
|
||||||
const auto& accInfo = lrcInstance_->getAccountInfo(id_);
|
const auto& accConfig = lrcInstance_->getCurrAccConfig();
|
||||||
|
const auto& accInfo = lrcInstance_->getCurrentAccountInfo();
|
||||||
|
|
||||||
set_uri(accInfo.profileInfo.uri);
|
set_uri(accInfo.profileInfo.uri);
|
||||||
set_registeredName(accInfo.registeredName);
|
set_registeredName(accInfo.registeredName);
|
||||||
set_alias(accInfo.profileInfo.alias);
|
set_alias(accInfo.profileInfo.alias);
|
||||||
|
@ -59,7 +119,96 @@ CurrentAccount::updateData()
|
||||||
set_hasAvatarSet(!accInfo.profileInfo.avatar.isEmpty());
|
set_hasAvatarSet(!accInfo.profileInfo.avatar.isEmpty());
|
||||||
set_status(accInfo.status);
|
set_status(accInfo.status);
|
||||||
set_type(accInfo.profileInfo.type);
|
set_type(accInfo.profileInfo.type);
|
||||||
|
|
||||||
|
set_enabled(accInfo.enabled, true);
|
||||||
|
set_managerUri(accConfig.managerUri);
|
||||||
|
set_keepAliveEnabled(accConfig.keepAliveEnabled, true);
|
||||||
|
set_peerDiscovery(accConfig.peerDiscovery, true);
|
||||||
|
set_sendReadReceipt(accConfig.sendReadReceipt, true);
|
||||||
|
set_isRendezVous(accConfig.isRendezVous, true);
|
||||||
|
set_autoAnswer(accConfig.autoAnswer, true);
|
||||||
|
set_proxyEnabled(accConfig.proxyEnabled, true);
|
||||||
|
set_upnpEnabled(accConfig.upnpEnabled, true);
|
||||||
|
set_publishedSameAsLocal(accConfig.publishedSameAsLocal, true);
|
||||||
|
set_allowIPAutoRewrite(accConfig.allowIPAutoRewrite, true);
|
||||||
|
set_proxyServer(accConfig.proxyServer, true);
|
||||||
|
set_routeset(accConfig.routeset, true);
|
||||||
|
set_username(accConfig.username, true);
|
||||||
|
set_hostname(accConfig.hostname, true);
|
||||||
|
set_password(accConfig.password, true);
|
||||||
|
set_mailbox(accConfig.mailbox, true);
|
||||||
|
set_publishedAddress(accConfig.publishedAddress, true);
|
||||||
|
set_localPort(accConfig.localPort, true);
|
||||||
|
set_publishedPort(accConfig.publishedPort, true);
|
||||||
|
|
||||||
|
// DHT
|
||||||
|
set_PublicInCallsDHT(accConfig.DHT.PublicInCalls, true);
|
||||||
|
|
||||||
|
// RingNS
|
||||||
|
set_uriRingNS(accConfig.RingNS.uri, true);
|
||||||
|
|
||||||
|
// TLS
|
||||||
|
set_enableTLS(accConfig.TLS.enable, true);
|
||||||
|
set_verifyServerTLS(accConfig.TLS.verifyServer, true);
|
||||||
|
set_verifyClientTLS(accConfig.TLS.verifyClient, true);
|
||||||
|
set_requireClientCertificateTLS(accConfig.TLS.requireClientCertificate, true);
|
||||||
|
set_certificateListFileTLS(accConfig.TLS.certificateListFile, true);
|
||||||
|
set_certificateFileTLS(accConfig.TLS.certificateFile, true);
|
||||||
|
set_privateKeyFileTLS(accConfig.TLS.privateKeyFile, true);
|
||||||
|
set_passwordTLS(accConfig.TLS.password, true);
|
||||||
|
set_serverNameTLS(accConfig.TLS.serverName, true);
|
||||||
|
set_methodTLS(accConfig.TLS.method, true);
|
||||||
|
set_negotiationTimeoutSecTLS(accConfig.TLS.negotiationTimeoutSec, true);
|
||||||
|
|
||||||
|
// SRTP
|
||||||
|
set_enableSRTP(accConfig.SRTP.enable, true);
|
||||||
|
set_rtpFallbackSRTP(accConfig.SRTP.rtpFallback, true);
|
||||||
|
set_keyExchangeSRTP(accConfig.SRTP.keyExchange, true);
|
||||||
|
|
||||||
|
// TURN
|
||||||
|
set_enableTURN(accConfig.TURN.enable, true);
|
||||||
|
set_serverTURN(accConfig.TURN.server, true);
|
||||||
|
set_usernameTURN(accConfig.TURN.username, true);
|
||||||
|
set_passwordTURN(accConfig.TURN.password, true);
|
||||||
|
set_realmTURN(accConfig.TURN.realm, true);
|
||||||
|
|
||||||
|
// STUN
|
||||||
|
set_enableSTUN(accConfig.STUN.enable, true);
|
||||||
|
set_serverSTUN(accConfig.STUN.server, true);
|
||||||
|
|
||||||
|
// Video & Audio
|
||||||
|
set_videoEnabledVideo(accConfig.Video.videoEnabled, true);
|
||||||
|
set_videoPortMinVideo(accConfig.Video.videoPortMin, true);
|
||||||
|
set_videoPortMaxVideo(accConfig.Video.videoPortMax, true);
|
||||||
|
set_audioPortMinAudio(accConfig.Audio.audioPortMin, true);
|
||||||
|
set_audioPortMaxAudio(accConfig.Audio.audioPortMax, true);
|
||||||
|
|
||||||
|
// Ringtone
|
||||||
|
set_ringtoneEnabledRingtone(accConfig.Ringtone.ringtoneEnabled, true);
|
||||||
|
set_ringtonePathRingtone(accConfig.Ringtone.ringtonePath, true);
|
||||||
|
|
||||||
|
// Registration
|
||||||
|
set_expireRegistration(accConfig.Registration.expire, true);
|
||||||
|
|
||||||
|
// Moderators
|
||||||
|
set_isAllModeratorsEnabled(lrcInstance_->accountModel().isAllModerators(
|
||||||
|
lrcInstance_->get_currentAccountId()),
|
||||||
|
true);
|
||||||
|
set_isLocalModeratorsEnabled(lrcInstance_->accountModel().isLocalModeratorsEnabled(
|
||||||
|
lrcInstance_->get_currentAccountId()),
|
||||||
|
true);
|
||||||
|
|
||||||
|
// NewAccount model
|
||||||
|
set_autoTransferFromTrusted(settingsManager_->getValue(Settings::Key::AutoAcceptFiles)
|
||||||
|
.toBool(),
|
||||||
|
true);
|
||||||
|
set_autoTransferFromUntrusted(settingsManager_->getValue(Settings::Key::AllowFromUntrusted)
|
||||||
|
.toBool(),
|
||||||
|
true);
|
||||||
|
set_autoTransferSizeThreshold(settingsManager_->getValue(Settings::Key::AcceptTransferBelow)
|
||||||
|
.toInt(),
|
||||||
|
true);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
qWarning() << "Can't update current account data for" << id_;
|
qWarning() << "Can't update current account info data for" << id_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,31 +19,208 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "lrcinstance.h"
|
#include "lrcinstance.h"
|
||||||
|
#include "qtutils.h"
|
||||||
|
#include "appsettingsmanager.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
#define ACCOUNT_CONFIG_SETTINGS_PROPERTY_BASE(type, prop) \
|
||||||
|
PROPERTY_GETTER_BASE(type, prop) \
|
||||||
|
void set_##prop(const type& x = {}, bool initialize = false) \
|
||||||
|
{ \
|
||||||
|
if (prop##_ != x) { \
|
||||||
|
prop##_ = x; \
|
||||||
|
if (!initialize) { \
|
||||||
|
auto confProps = lrcInstance_->getCurrAccConfig(); \
|
||||||
|
confProps.prop = x; \
|
||||||
|
lrcInstance_->accountModel().setAccountConfig(lrcInstance_->get_currentAccountId(), \
|
||||||
|
confProps); \
|
||||||
|
} \
|
||||||
|
Q_EMIT prop##Changed(); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define NEW_ACCOUNT_MODEL_SETTINGS_PROPERTY_BASE(type, prop, appSettingName) \
|
||||||
|
PROPERTY_GETTER_BASE(type, prop) \
|
||||||
|
void set_##prop(const type& x = {}, bool initialize = false) \
|
||||||
|
{ \
|
||||||
|
if (prop##_ != x) { \
|
||||||
|
prop##_ = x; \
|
||||||
|
lrcInstance_->accountModel().prop = x; \
|
||||||
|
if (!initialize) { \
|
||||||
|
settingsManager_->setValue(Settings::Key::appSettingName, x); \
|
||||||
|
} \
|
||||||
|
Q_EMIT prop##Changed(); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY_BASE(type, prop, cate) \
|
||||||
|
type prop##cate##_ {}; \
|
||||||
|
\
|
||||||
|
public: \
|
||||||
|
Q_SIGNAL void prop##cate##Changed(); \
|
||||||
|
type get_##prop##cate() \
|
||||||
|
{ \
|
||||||
|
return prop##cate##_; \
|
||||||
|
} \
|
||||||
|
void set_##prop##cate(const type& x = {}, bool initialize = false) \
|
||||||
|
{ \
|
||||||
|
if (prop##cate##_ != x) { \
|
||||||
|
prop##cate##_ = x; \
|
||||||
|
if (!initialize) { \
|
||||||
|
auto confProps = lrcInstance_->getCurrAccConfig(); \
|
||||||
|
confProps.cate.prop = x; \
|
||||||
|
lrcInstance_->accountModel().setAccountConfig(lrcInstance_->get_currentAccountId(), \
|
||||||
|
confProps); \
|
||||||
|
} \
|
||||||
|
Q_EMIT prop##cate##Changed(); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(type, prop) \
|
||||||
|
private: \
|
||||||
|
Q_PROPERTY(type prop READ get_##prop WRITE set_##prop NOTIFY prop##Changed); \
|
||||||
|
ACCOUNT_CONFIG_SETTINGS_PROPERTY_BASE(type, prop)
|
||||||
|
|
||||||
|
#define QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(type, prop, cate) \
|
||||||
|
private: \
|
||||||
|
Q_PROPERTY(type prop##_##cate READ get_##prop##cate WRITE set_##prop##cate NOTIFY \
|
||||||
|
prop##cate##Changed); \
|
||||||
|
ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY_BASE(type, prop, cate)
|
||||||
|
|
||||||
|
#define QML_NEW_ACCOUNT_MODEL_SETTINGS_PROPERTY(type, prop, appSettingName) \
|
||||||
|
private: \
|
||||||
|
Q_PROPERTY(type prop READ get_##prop WRITE set_##prop NOTIFY prop##Changed); \
|
||||||
|
NEW_ACCOUNT_MODEL_SETTINGS_PROPERTY_BASE(type, prop, appSettingName)
|
||||||
|
|
||||||
class CurrentAccount final : public QObject
|
class CurrentAccount final : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
// Basic settings
|
||||||
|
Q_PROPERTY(bool enabled READ get_enabled WRITE set_enabled NOTIFY enabledChanged);
|
||||||
|
|
||||||
QML_RO_PROPERTY(QString, id)
|
QML_RO_PROPERTY(QString, id)
|
||||||
QML_RO_PROPERTY(QString, uri)
|
QML_RO_PROPERTY(QString, uri)
|
||||||
QML_RO_PROPERTY(QString, registeredName)
|
QML_RO_PROPERTY(QString, registeredName)
|
||||||
QML_RO_PROPERTY(QString, alias)
|
QML_RO_PROPERTY(QString, alias)
|
||||||
QML_RO_PROPERTY(QString, bestId)
|
QML_RO_PROPERTY(QString, bestId)
|
||||||
QML_RO_PROPERTY(QString, bestName)
|
QML_RO_PROPERTY(QString, bestName)
|
||||||
|
QML_RO_PROPERTY(QString, managerUri)
|
||||||
QML_RO_PROPERTY(bool, hasAvatarSet)
|
QML_RO_PROPERTY(bool, hasAvatarSet)
|
||||||
QML_RO_PROPERTY(lrc::api::account::Status, status)
|
QML_RO_PROPERTY(lrc::api::account::Status, status)
|
||||||
QML_RO_PROPERTY(lrc::api::profile::Type, type)
|
QML_RO_PROPERTY(lrc::api::profile::Type, type)
|
||||||
|
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, keepAliveEnabled)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, peerDiscovery)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, sendReadReceipt)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, isRendezVous)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, autoAnswer)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, proxyEnabled)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, upnpEnabled)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, publishedSameAsLocal)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(bool, allowIPAutoRewrite)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(QString, proxyServer)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(QString, routeset)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(QString, username)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(QString, hostname)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(QString, password)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(QString, mailbox)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(QString, publishedAddress)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(int, localPort)
|
||||||
|
QML_ACCOUNT_CONFIG_SETTINGS_PROPERTY(int, publishedPort)
|
||||||
|
|
||||||
|
// Moderator settings
|
||||||
|
Q_PROPERTY(bool isAllModeratorsEnabled READ get_isAllModeratorsEnabled WRITE
|
||||||
|
set_isAllModeratorsEnabled NOTIFY isAllModeratorsEnabledChanged)
|
||||||
|
Q_PROPERTY(bool isLocalModeratorsEnabled READ get_isLocalModeratorsEnabled WRITE
|
||||||
|
set_isLocalModeratorsEnabled NOTIFY isLocalModeratorsEnabledChanged)
|
||||||
|
|
||||||
|
// RingNS setting
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, uri, RingNS)
|
||||||
|
|
||||||
|
// DHT settings
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, PublicInCalls, DHT)
|
||||||
|
|
||||||
|
// TLS settings
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, enable, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, verifyServer, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, verifyClient, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, requireClientCertificate, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, certificateListFile, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, certificateFile, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, privateKeyFile, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, password, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, serverName, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(lrc::api::account::TlsMethod, method, TLS)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(int, negotiationTimeoutSec, TLS)
|
||||||
|
|
||||||
|
// SRTP settings
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, enable, SRTP)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, rtpFallback, SRTP)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(lrc::api::account::KeyExchangeProtocol,
|
||||||
|
keyExchange,
|
||||||
|
SRTP)
|
||||||
|
|
||||||
|
// TURN settings
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, enable, TURN)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, server, TURN)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, username, TURN)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, password, TURN)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, realm, TURN)
|
||||||
|
|
||||||
|
// STUN settings
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, enable, STUN)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, server, STUN)
|
||||||
|
|
||||||
|
// Video & Audio settings
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, videoEnabled, Video)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(int, videoPortMin, Video)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(int, videoPortMax, Video)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(int, audioPortMin, Audio)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(int, audioPortMax, Audio)
|
||||||
|
|
||||||
|
// Ringtone settings
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(bool, ringtoneEnabled, Ringtone)
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(QString, ringtonePath, Ringtone)
|
||||||
|
|
||||||
|
// Registration settings
|
||||||
|
QML_ACCOUNT_CONFIG_CATEGORY_SETTINGS_PROPERTY(int, expire, Registration)
|
||||||
|
|
||||||
|
// NewAccount model settings
|
||||||
|
QML_NEW_ACCOUNT_MODEL_SETTINGS_PROPERTY(bool, autoTransferFromTrusted, AutoAcceptFiles)
|
||||||
|
QML_NEW_ACCOUNT_MODEL_SETTINGS_PROPERTY(bool, autoTransferFromUntrusted, AllowFromUntrusted)
|
||||||
|
QML_NEW_ACCOUNT_MODEL_SETTINGS_PROPERTY(int, autoTransferSizeThreshold, AcceptTransferBelow)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CurrentAccount(LRCInstance* lrcInstance, QObject* parent = nullptr);
|
explicit CurrentAccount(LRCInstance* lrcInstance,
|
||||||
|
AppSettingsManager* settingsManager,
|
||||||
|
QObject* parent = nullptr);
|
||||||
~CurrentAccount() = default;
|
~CurrentAccount() = default;
|
||||||
|
|
||||||
|
void set_enabled(bool enabled = false, bool initialize = false);
|
||||||
|
bool get_enabled();
|
||||||
|
|
||||||
|
void set_isAllModeratorsEnabled(bool enabled, bool initialize = false);
|
||||||
|
bool get_isAllModeratorsEnabled();
|
||||||
|
|
||||||
|
void set_isLocalModeratorsEnabled(bool enabled, bool initialize = false);
|
||||||
|
bool get_isLocalModeratorsEnabled();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void enabledChanged();
|
||||||
|
void isAllModeratorsEnabledChanged();
|
||||||
|
void isLocalModeratorsEnabledChanged();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void updateData();
|
void updateData();
|
||||||
void onAccountUpdated(const QString& id);
|
void onAccountUpdated(const QString& id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool enabled_;
|
||||||
|
bool isAllModeratorsEnabled_;
|
||||||
|
bool isLocalModeratorsEnabled_;
|
||||||
|
|
||||||
|
AppSettingsManager* settingsManager_;
|
||||||
LRCInstance* lrcInstance_;
|
LRCInstance* lrcInstance_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,7 +68,7 @@ Rectangle {
|
||||||
height = preferredHeight
|
height = preferredHeight
|
||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
var device = AVModel.getDefaultDevice()
|
var device = AVModel.getDefaultDevice()
|
||||||
var settings = SettingsAdapter.get_Video_Settings_Size(device)
|
var settings = AvAdapter.getVideoSettingsSize(device)
|
||||||
var res = settings.split("x")
|
var res = settings.split("x")
|
||||||
var aspectRatio = res[1] / res[0]
|
var aspectRatio = res[1] / res[0]
|
||||||
if (aspectRatio) {
|
if (aspectRatio) {
|
||||||
|
|
|
@ -28,7 +28,14 @@
|
||||||
|
|
||||||
MediaCodecListModel::MediaCodecListModel(QObject* parent)
|
MediaCodecListModel::MediaCodecListModel(QObject* parent)
|
||||||
: AbstractListModelBase(parent)
|
: AbstractListModelBase(parent)
|
||||||
{}
|
{
|
||||||
|
connect(this, &MediaCodecListModel::lrcInstanceChanged, [this]() {
|
||||||
|
connect(lrcInstance_,
|
||||||
|
&LRCInstance::currentAccountIdChanged,
|
||||||
|
this,
|
||||||
|
&MediaCodecListModel::reset);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
MediaCodecListModel::~MediaCodecListModel() {}
|
MediaCodecListModel::~MediaCodecListModel() {}
|
||||||
|
|
||||||
|
@ -141,6 +148,13 @@ MediaCodecListModel::flags(const QModelIndex& index) const
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MediaCodecListModel::reset()
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
MediaCodecListModel::mediaType()
|
MediaCodecListModel::mediaType()
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,6 +46,8 @@ public:
|
||||||
QModelIndex parent(const QModelIndex& child) const;
|
QModelIndex parent(const QModelIndex& child) const;
|
||||||
Qt::ItemFlags flags(const QModelIndex& index) const;
|
Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void reset();
|
||||||
|
|
||||||
int mediaType();
|
int mediaType();
|
||||||
void setMediaType(int mediaType);
|
void setMediaType(int mediaType);
|
||||||
|
|
||||||
|
|
|
@ -530,6 +530,22 @@ MessagesAdapter::blockConversation(const QString& convUid)
|
||||||
lrcInstance_->getCurrentConversationModel()->removeConversation(currentConvUid, true);
|
lrcInstance_->getCurrentConversationModel()->removeConversation(currentConvUid, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MessagesAdapter::unbanContact(int index)
|
||||||
|
{
|
||||||
|
auto& accountInfo = lrcInstance_->getCurrentAccountInfo();
|
||||||
|
auto bannedContactList = accountInfo.contactModel->getBannedContacts();
|
||||||
|
auto it = bannedContactList.begin();
|
||||||
|
std::advance(it, index);
|
||||||
|
|
||||||
|
try {
|
||||||
|
auto contactInfo = accountInfo.contactModel->getContact(*it);
|
||||||
|
accountInfo.contactModel->addContact(contactInfo);
|
||||||
|
} catch (const std::out_of_range& e) {
|
||||||
|
qDebug() << e.what();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MessagesAdapter::clearConversationHistory(const QString& accountId, const QString& convUid)
|
MessagesAdapter::clearConversationHistory(const QString& accountId, const QString& convUid)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,6 +50,7 @@ protected:
|
||||||
Q_INVOKABLE void acceptInvitation(const QString& convId = {});
|
Q_INVOKABLE void acceptInvitation(const QString& convId = {});
|
||||||
Q_INVOKABLE void refuseInvitation(const QString& convUid = "");
|
Q_INVOKABLE void refuseInvitation(const QString& convUid = "");
|
||||||
Q_INVOKABLE void blockConversation(const QString& convUid = "");
|
Q_INVOKABLE void blockConversation(const QString& convUid = "");
|
||||||
|
Q_INVOKABLE void unbanContact(int index);
|
||||||
|
|
||||||
// JS Q_INVOKABLE.
|
// JS Q_INVOKABLE.
|
||||||
Q_INVOKABLE void setDisplayLinks();
|
Q_INVOKABLE void setDisplayLinks();
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include "contactadapter.h"
|
#include "contactadapter.h"
|
||||||
#include "pluginadapter.h"
|
#include "pluginadapter.h"
|
||||||
#include "messagesadapter.h"
|
#include "messagesadapter.h"
|
||||||
#include "settingsadapter.h"
|
|
||||||
#include "utilsadapter.h"
|
#include "utilsadapter.h"
|
||||||
#include "conversationsadapter.h"
|
#include "conversationsadapter.h"
|
||||||
#include "currentconversation.h"
|
#include "currentconversation.h"
|
||||||
|
@ -113,11 +112,10 @@ registerTypes(QQmlEngine* engine,
|
||||||
auto avAdapter = new AvAdapter(lrcInstance, parent);
|
auto avAdapter = new AvAdapter(lrcInstance, parent);
|
||||||
auto contactAdapter = new ContactAdapter(lrcInstance, parent);
|
auto contactAdapter = new ContactAdapter(lrcInstance, parent);
|
||||||
auto accountAdapter = new AccountAdapter(appSettingsManager, lrcInstance, parent);
|
auto accountAdapter = new AccountAdapter(appSettingsManager, lrcInstance, parent);
|
||||||
auto utilsAdapter = new UtilsAdapter(systemTray, lrcInstance, parent);
|
auto utilsAdapter = new UtilsAdapter(appSettingsManager, systemTray, lrcInstance, parent);
|
||||||
auto settingsAdapter = new SettingsAdapter(appSettingsManager, lrcInstance, parent);
|
|
||||||
auto pluginAdapter = new PluginAdapter(lrcInstance, parent);
|
auto pluginAdapter = new PluginAdapter(lrcInstance, parent);
|
||||||
auto currentConversation = new CurrentConversation(lrcInstance, parent);
|
auto currentConversation = new CurrentConversation(lrcInstance, parent);
|
||||||
auto currentAccount = new CurrentAccount(lrcInstance, parent);
|
auto currentAccount = new CurrentAccount(lrcInstance, appSettingsManager, parent);
|
||||||
|
|
||||||
// qml adapter registration
|
// qml adapter registration
|
||||||
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, callAdapter, "CallAdapter");
|
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, callAdapter, "CallAdapter");
|
||||||
|
@ -127,7 +125,6 @@ registerTypes(QQmlEngine* engine,
|
||||||
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, contactAdapter, "ContactAdapter");
|
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, contactAdapter, "ContactAdapter");
|
||||||
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, accountAdapter, "AccountAdapter");
|
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, accountAdapter, "AccountAdapter");
|
||||||
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, utilsAdapter, "UtilsAdapter");
|
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, utilsAdapter, "UtilsAdapter");
|
||||||
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, settingsAdapter, "SettingsAdapter");
|
|
||||||
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, pluginAdapter, "PluginAdapter");
|
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, pluginAdapter, "PluginAdapter");
|
||||||
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, currentConversation, "CurrentConversation");
|
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, currentConversation, "CurrentConversation");
|
||||||
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, currentAccount, "CurrentAccount");
|
QML_REGISTERSINGLETONTYPE_POBJECT(NS_ADAPTERS, currentAccount, "CurrentAccount");
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#define PROPERTY_BASE(type, prop) \
|
#define PROPERTY_GETTER_BASE(type, prop) \
|
||||||
type prop##_ {}; \
|
type prop##_ {}; \
|
||||||
\
|
\
|
||||||
public: \
|
public: \
|
||||||
|
@ -32,7 +32,9 @@ public: \
|
||||||
type get_##prop() \
|
type get_##prop() \
|
||||||
{ \
|
{ \
|
||||||
return prop##_; \
|
return prop##_; \
|
||||||
} \
|
}
|
||||||
|
|
||||||
|
#define PROPERTY_SETTER_BASE(type, prop) \
|
||||||
void set_##prop(const type& x = {}) \
|
void set_##prop(const type& x = {}) \
|
||||||
{ \
|
{ \
|
||||||
if (prop##_ != x) { \
|
if (prop##_ != x) { \
|
||||||
|
@ -41,6 +43,10 @@ public: \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define PROPERTY_BASE(type, prop) \
|
||||||
|
PROPERTY_GETTER_BASE(type, prop) \
|
||||||
|
PROPERTY_SETTER_BASE(type, prop)
|
||||||
|
|
||||||
#define QML_RO_PROPERTY(type, prop) \
|
#define QML_RO_PROPERTY(type, prop) \
|
||||||
private: \
|
private: \
|
||||||
Q_PROPERTY(type prop READ get_##prop NOTIFY prop##Changed); \
|
Q_PROPERTY(type prop READ get_##prop NOTIFY prop##Changed); \
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,258 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2020 by Savoir-faire Linux
|
|
||||||
* Author: Yang Wang <yang.wang@savoirfairelinux.com>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
|
|
||||||
#include "api/account.h"
|
|
||||||
#include "api/datatransfermodel.h"
|
|
||||||
#include "lrcinstance.h"
|
|
||||||
#include "typedefs.h"
|
|
||||||
#include "utils.h"
|
|
||||||
#include "qmladapterbase.h"
|
|
||||||
#include "appsettingsmanager.h"
|
|
||||||
|
|
||||||
class SettingsAdapter : public QmlAdapterBase
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
#define LOGSLIMIT 10000
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit SettingsAdapter(AppSettingsManager* settingsManager,
|
|
||||||
LRCInstance* instance,
|
|
||||||
QObject* parent = nullptr);
|
|
||||||
|
|
||||||
void safeInit() override {}
|
|
||||||
|
|
||||||
// Getters of directories
|
|
||||||
Q_INVOKABLE QString getDir_Document();
|
|
||||||
Q_INVOKABLE QString getDir_Download();
|
|
||||||
|
|
||||||
Q_INVOKABLE QVariant getAppValue(const Settings::Key key);
|
|
||||||
Q_INVOKABLE void setAppValue(const Settings::Key key, const QVariant& value);
|
|
||||||
|
|
||||||
Q_INVOKABLE void setRunOnStartUp(bool state);
|
|
||||||
Q_INVOKABLE void setDownloadPath(QString dir);
|
|
||||||
|
|
||||||
// Getters of devices' Info and options
|
|
||||||
Q_INVOKABLE lrc::api::video::Capabilities get_DeviceCapabilities(const QString& device);
|
|
||||||
Q_INVOKABLE lrc::api::video::ResRateList get_ResRateList(lrc::api::video::Channel channel,
|
|
||||||
QString device);
|
|
||||||
Q_INVOKABLE int get_DeviceCapabilitiesSize(const QString& device);
|
|
||||||
|
|
||||||
// Getters of resolution and frame rates of current device
|
|
||||||
Q_INVOKABLE QVector<QString> getResolutions(const QString& device);
|
|
||||||
Q_INVOKABLE QVector<int> getFrameRates(const QString& device);
|
|
||||||
|
|
||||||
// Getters and setters: lrc video::setting
|
|
||||||
Q_INVOKABLE QString get_Video_Settings_Channel(const QString& deviceId);
|
|
||||||
Q_INVOKABLE QString get_Video_Settings_Name(const QString& deviceId);
|
|
||||||
Q_INVOKABLE QString get_Video_Settings_Id(const QString& deviceId);
|
|
||||||
Q_INVOKABLE qreal get_Video_Settings_Rate(const QString& deviceId);
|
|
||||||
Q_INVOKABLE QString get_Video_Settings_Size(const QString& deviceId);
|
|
||||||
|
|
||||||
Q_INVOKABLE void set_Video_Settings_Rate_And_Resolution(const QString& deviceId,
|
|
||||||
qreal rate,
|
|
||||||
const QString& resolution);
|
|
||||||
|
|
||||||
// Getters and setters of current account Info
|
|
||||||
const Q_INVOKABLE lrc::api::account::Info& getCurrentAccountInfo();
|
|
||||||
const Q_INVOKABLE lrc::api::profile::Info& getCurrentAccount_Profile_Info();
|
|
||||||
|
|
||||||
Q_INVOKABLE lrc::api::ContactModel* getContactModel();
|
|
||||||
Q_INVOKABLE lrc::api::NewDeviceModel* getDeviceModel();
|
|
||||||
|
|
||||||
Q_INVOKABLE QString get_CurrentAccountInfo_RegisteredName();
|
|
||||||
Q_INVOKABLE QString get_CurrentAccountInfo_Id();
|
|
||||||
Q_INVOKABLE bool get_CurrentAccountInfo_Enabled();
|
|
||||||
|
|
||||||
// Profile info
|
|
||||||
Q_INVOKABLE QString getCurrentAccount_Profile_Info_Uri();
|
|
||||||
Q_INVOKABLE QString getCurrentAccount_Profile_Info_Alias();
|
|
||||||
Q_INVOKABLE int getCurrentAccount_Profile_Info_Type();
|
|
||||||
Q_INVOKABLE QString getAccountBestName();
|
|
||||||
|
|
||||||
// Getters and setters of ConfProperties_t
|
|
||||||
// Getters
|
|
||||||
Q_INVOKABLE lrc::api::account::ConfProperties_t getAccountConfig();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_Manageruri();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_Username();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_Hostname();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_Password();
|
|
||||||
|
|
||||||
Q_INVOKABLE bool getAccountConfig_KeepAliveEnabled();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_RouteSet();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_ProxyServer();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_ProxyEnabled();
|
|
||||||
|
|
||||||
Q_INVOKABLE bool getAccountConfig_PeerDiscovery();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_DHT_PublicInCalls();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_ReadReceipt();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_RendezVous();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_AutoAnswer();
|
|
||||||
|
|
||||||
Q_INVOKABLE QString getAccountConfig_RingNS_Uri();
|
|
||||||
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TLS_CertificateListFile();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TLS_CertificateFile();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TLS_PrivateKeyFile();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_TLS_Enable();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TLS_Password();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_TLS_VerifyServer();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_TLS_VerifyClient();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_TLS_RequireClientCertificate();
|
|
||||||
Q_INVOKABLE int getAccountConfig_TLS_Method_inInt();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TLS_Servername();
|
|
||||||
Q_INVOKABLE int getAccountConfig_TLS_NegotiationTimeoutSec();
|
|
||||||
|
|
||||||
Q_INVOKABLE bool getAccountConfig_SRTP_Enabled();
|
|
||||||
Q_INVOKABLE int getAccountConfig_SRTP_KeyExchange();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_SRTP_RtpFallback();
|
|
||||||
|
|
||||||
Q_INVOKABLE bool getAccountConfig_UpnpEnabled();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_TURN_Enabled();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TURN_Server();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TURN_Username();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TURN_Password();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_TURN_Realm();
|
|
||||||
|
|
||||||
Q_INVOKABLE bool getAccountConfig_STUN_Enabled();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_STUN_Server();
|
|
||||||
|
|
||||||
Q_INVOKABLE bool getAccountConfig_Video_Enabled();
|
|
||||||
Q_INVOKABLE int getAccountConfig_Video_VideoPortMin();
|
|
||||||
Q_INVOKABLE int getAccountConfig_Video_VideoPortMax();
|
|
||||||
|
|
||||||
Q_INVOKABLE int getAccountConfig_Audio_AudioPortMin();
|
|
||||||
Q_INVOKABLE int getAccountConfig_Audio_AudioPortMax();
|
|
||||||
|
|
||||||
Q_INVOKABLE bool getAccountConfig_Ringtone_RingtoneEnabled();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_Ringtone_RingtonePath();
|
|
||||||
|
|
||||||
Q_INVOKABLE int getAccountConfig_Registration_Expire();
|
|
||||||
Q_INVOKABLE int getAccountConfig_Localport();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_PublishedSameAsLocal();
|
|
||||||
Q_INVOKABLE QString getAccountConfig_PublishedAddress();
|
|
||||||
Q_INVOKABLE int getAccountConfig_PublishedPort();
|
|
||||||
Q_INVOKABLE bool getAccountConfig_AllowIPAutoRewrite();
|
|
||||||
|
|
||||||
Q_INVOKABLE QString getAccountConfig_Mailbox();
|
|
||||||
|
|
||||||
// Setters
|
|
||||||
Q_INVOKABLE void setAccountConfig_Username(QString input);
|
|
||||||
Q_INVOKABLE void setAccountConfig_Hostname(QString input);
|
|
||||||
Q_INVOKABLE void setAccountConfig_Password(QString input);
|
|
||||||
Q_INVOKABLE void setAccountConfig_RouteSet(QString input);
|
|
||||||
|
|
||||||
Q_INVOKABLE void setAutoConnectOnLocalNetwork(bool state);
|
|
||||||
Q_INVOKABLE void setCallsUntrusted(bool state);
|
|
||||||
Q_INVOKABLE void setIsRendezVous(bool state);
|
|
||||||
Q_INVOKABLE void setAutoAnswerCalls(bool state);
|
|
||||||
Q_INVOKABLE void setSendReadReceipt(bool state);
|
|
||||||
Q_INVOKABLE void setEnableRingtone(bool state);
|
|
||||||
Q_INVOKABLE void setEnableProxy(bool state);
|
|
||||||
Q_INVOKABLE void setKeepAliveEnabled(bool state);
|
|
||||||
Q_INVOKABLE void setUseUPnP(bool state);
|
|
||||||
Q_INVOKABLE void setUseTURN(bool state);
|
|
||||||
Q_INVOKABLE void setUseSTUN(bool state);
|
|
||||||
Q_INVOKABLE void setVideoState(bool state);
|
|
||||||
Q_INVOKABLE void setUseSRTP(bool state);
|
|
||||||
Q_INVOKABLE void setUseSDES(bool state);
|
|
||||||
Q_INVOKABLE void setUseRTPFallback(bool state);
|
|
||||||
Q_INVOKABLE void setUseTLS(bool state);
|
|
||||||
Q_INVOKABLE void setVerifyCertificatesServer(bool state);
|
|
||||||
Q_INVOKABLE void setVerifyCertificatesClient(bool state);
|
|
||||||
Q_INVOKABLE void setRequireCertificatesIncomingTLS(bool state);
|
|
||||||
Q_INVOKABLE void setUseCustomAddressAndPort(bool state);
|
|
||||||
Q_INVOKABLE void setAllowIPAutoRewrite(bool state);
|
|
||||||
|
|
||||||
Q_INVOKABLE void setNameServer(QString text);
|
|
||||||
Q_INVOKABLE void setProxyAddress(QString text);
|
|
||||||
Q_INVOKABLE void setBootstrapAddress(QString text);
|
|
||||||
Q_INVOKABLE void setTURNAddress(QString text);
|
|
||||||
Q_INVOKABLE void setTURNUsername(QString text);
|
|
||||||
Q_INVOKABLE void setTURNPassword(QString text);
|
|
||||||
Q_INVOKABLE void setTURNRealm(QString text);
|
|
||||||
Q_INVOKABLE void setSTUNAddress(QString text);
|
|
||||||
|
|
||||||
Q_INVOKABLE void lineEditVoiceMailDialCodeEditFinished(QString text);
|
|
||||||
Q_INVOKABLE void outgoingTLSServerNameLineEditTextChanged(QString text);
|
|
||||||
Q_INVOKABLE void lineEditSIPCertPasswordLineEditTextChanged(QString text);
|
|
||||||
Q_INVOKABLE void lineEditSIPCustomAddressLineEditTextChanged(QString text);
|
|
||||||
|
|
||||||
Q_INVOKABLE void customPortSIPSpinBoxValueChanged(int value);
|
|
||||||
Q_INVOKABLE void negotiationTimeoutSpinBoxValueChanged(int value);
|
|
||||||
Q_INVOKABLE void registrationExpirationTimeSpinBoxValueChanged(int value);
|
|
||||||
Q_INVOKABLE void networkInterfaceSpinBoxValueChanged(int value);
|
|
||||||
Q_INVOKABLE void audioRTPMinPortSpinBoxEditFinished(int value);
|
|
||||||
Q_INVOKABLE void audioRTPMaxPortSpinBoxEditFinished(int value);
|
|
||||||
Q_INVOKABLE void videoRTPMinPortSpinBoxEditFinished(int value);
|
|
||||||
Q_INVOKABLE void videoRTPMaxPortSpinBoxEditFinished(int value);
|
|
||||||
|
|
||||||
Q_INVOKABLE void autoAcceptFiles(bool value);
|
|
||||||
Q_INVOKABLE void allowFromUntrusted(bool value);
|
|
||||||
Q_INVOKABLE void acceptTransferBelow(int value);
|
|
||||||
|
|
||||||
Q_INVOKABLE void tlsProtocolComboBoxIndexChanged(const int& index);
|
|
||||||
|
|
||||||
Q_INVOKABLE void setDeviceName(QString text);
|
|
||||||
|
|
||||||
Q_INVOKABLE void unbanContact(int index);
|
|
||||||
|
|
||||||
Q_INVOKABLE void audioCodecsStateChange(unsigned int id, bool isToEnable);
|
|
||||||
Q_INVOKABLE void videoCodecsStateChange(unsigned int id, bool isToEnable);
|
|
||||||
|
|
||||||
Q_INVOKABLE void decreaseAudioCodecPriority(unsigned int id);
|
|
||||||
Q_INVOKABLE void increaseAudioCodecPriority(unsigned int id);
|
|
||||||
|
|
||||||
Q_INVOKABLE void decreaseVideoCodecPriority(unsigned int id);
|
|
||||||
Q_INVOKABLE void increaseVideoCodecPriority(unsigned int id);
|
|
||||||
|
|
||||||
Q_INVOKABLE void set_RingtonePath(QString text);
|
|
||||||
Q_INVOKABLE void set_FileCACert(QString text);
|
|
||||||
Q_INVOKABLE void set_FileUserCert(QString text);
|
|
||||||
Q_INVOKABLE void set_FilePrivateKey(QString text);
|
|
||||||
|
|
||||||
Q_INVOKABLE void setDefaultModerator(const QString& accountID,
|
|
||||||
const QString& peerURI,
|
|
||||||
const bool& state);
|
|
||||||
Q_INVOKABLE void setAllModeratorsEnabled(const QString& accountId, bool enabled);
|
|
||||||
Q_INVOKABLE QStringList getDefaultModerators(const QString& accId);
|
|
||||||
Q_INVOKABLE void enableLocalModerators(const QString& accountID, const bool& isModEnabled);
|
|
||||||
Q_INVOKABLE bool isLocalModeratorsEnabled(const QString& accountId);
|
|
||||||
Q_INVOKABLE bool isAllModeratorsEnabled(const QString& accountId);
|
|
||||||
|
|
||||||
Q_INVOKABLE void monitor(const bool& continuous);
|
|
||||||
Q_INVOKABLE QString getLogs() const;
|
|
||||||
Q_INVOKABLE int getSizeOfLogs() const;
|
|
||||||
Q_INVOKABLE int getFirstLogLength() const;
|
|
||||||
Q_INVOKABLE void clearLogs();
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
|
||||||
void debugMessageReceived(const QString& message);
|
|
||||||
|
|
||||||
private:
|
|
||||||
AppSettingsManager* settingsManager_;
|
|
||||||
|
|
||||||
QMetaObject::Connection debugMessageReceivedConnection_;
|
|
||||||
|
|
||||||
QStringList logList_;
|
|
||||||
};
|
|
||||||
Q_DECLARE_METATYPE(SettingsAdapter*)
|
|
|
@ -47,8 +47,6 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSelected(sel, recovery = false) {
|
function setSelected(sel, recovery = false) {
|
||||||
profileType = SettingsAdapter.getCurrentAccount_Profile_Info_Type()
|
|
||||||
|
|
||||||
if(selectedMenu === sel && (!recovery)) { return }
|
if(selectedMenu === sel && (!recovery)) { return }
|
||||||
switch(sel) {
|
switch(sel) {
|
||||||
case SettingsView.Account:
|
case SettingsView.Account:
|
||||||
|
@ -57,7 +55,6 @@ Rectangle {
|
||||||
pageIdCurrentAccountSettings.updateAccountInfoDisplayed()
|
pageIdCurrentAccountSettings.updateAccountInfoDisplayed()
|
||||||
break
|
break
|
||||||
case SettingsView.General:
|
case SettingsView.General:
|
||||||
generalSettings.updateValues()
|
|
||||||
AccountAdapter.stopPreviewing()
|
AccountAdapter.stopPreviewing()
|
||||||
selectedMenu = sel
|
selectedMenu = sel
|
||||||
break
|
break
|
||||||
|
@ -102,7 +99,6 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property int profileType: SettingsAdapter.getCurrentAccount_Profile_Info_Type()
|
|
||||||
property int selectedMenu: SettingsView.Account
|
property int selectedMenu: SettingsView.Account
|
||||||
// signal to redirect the page to main view
|
// signal to redirect the page to main view
|
||||||
signal settingsViewNeedToShowMainView()
|
signal settingsViewNeedToShowMainView()
|
||||||
|
@ -121,7 +117,7 @@ Rectangle {
|
||||||
signal stopBooth
|
signal stopBooth
|
||||||
|
|
||||||
property bool isSIP: {
|
property bool isSIP: {
|
||||||
switch (profileType) {
|
switch (CurrentAccount.type) {
|
||||||
case Profile.Type.SIP:
|
case Profile.Type.SIP:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -36,10 +36,6 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateAccountInfo() {
|
|
||||||
displayNameLineEdit.text = SettingsAdapter.getCurrentAccount_Profile_Info_Alias()
|
|
||||||
}
|
|
||||||
|
|
||||||
function stopBooth() {
|
function stopBooth() {
|
||||||
currentAccountAvatar.stopBooth()
|
currentAccountAvatar.stopBooth()
|
||||||
}
|
}
|
||||||
|
@ -77,6 +73,7 @@ ColumnLayout {
|
||||||
|
|
||||||
font.pointSize: JamiTheme.textFontSize
|
font.pointSize: JamiTheme.textFontSize
|
||||||
font.kerning: true
|
font.kerning: true
|
||||||
|
text: CurrentAccount.alias
|
||||||
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
|
@ -34,32 +34,9 @@ ColumnLayout {
|
||||||
property bool isSIP
|
property bool isSIP
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateCallSettingsInfos() {
|
|
||||||
checkBoxUntrusted.checked = SettingsAdapter.getAccountConfig_DHT_PublicInCalls()
|
|
||||||
checkBoxRdv.checked = SettingsAdapter.getAccountConfig_RendezVous()
|
|
||||||
checkBoxAutoAnswer.checked = SettingsAdapter.getAccountConfig_AutoAnswer()
|
|
||||||
checkBoxCustomRingtone.checked = SettingsAdapter.getAccountConfig_Ringtone_RingtoneEnabled()
|
|
||||||
checkboxAllModerators.checked = SettingsAdapter.isAllModeratorsEnabled(LRCInstance.currentAccountId)
|
|
||||||
|
|
||||||
btnRingtone.enabled = SettingsAdapter.getAccountConfig_Ringtone_RingtoneEnabled()
|
|
||||||
btnRingtone.textField = UtilsAdapter.toFileInfoName(SettingsAdapter.getAccountConfig_Ringtone_RingtonePath())
|
|
||||||
updateAndShowModeratorsSlot()
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeRingtonePath(url) {
|
|
||||||
if(url.length !== 0) {
|
|
||||||
SettingsAdapter.set_RingtonePath(url)
|
|
||||||
btnRingtone.textField = UtilsAdapter.toFileInfoName(url)
|
|
||||||
} else if (SettingsAdapter.getAccountConfig_Ringtone_RingtonePath().length === 0){
|
|
||||||
btnRingtone.textField = JamiStrings.addCustomRingtone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateAndShowModeratorsSlot() {
|
function updateAndShowModeratorsSlot() {
|
||||||
toggleLocalModerators.checked = SettingsAdapter.isLocalModeratorsEnabled(
|
|
||||||
LRCInstance.currentAccountId)
|
|
||||||
moderatorListWidget.model.reset()
|
moderatorListWidget.model.reset()
|
||||||
moderatorListWidget.visible = (moderatorListWidget.model.rowCount() > 0)
|
moderatorListWidget.visible = moderatorListWidget.model.rowCount() > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
@ -76,14 +53,16 @@ ColumnLayout {
|
||||||
mode: JamiFileDialog.OpenFile
|
mode: JamiFileDialog.OpenFile
|
||||||
title: JamiStrings.selectNewRingtone
|
title: JamiStrings.selectNewRingtone
|
||||||
folder: JamiQmlUtils.qmlFilePrefix + UtilsAdapter.toFileAbsolutepath(
|
folder: JamiQmlUtils.qmlFilePrefix + UtilsAdapter.toFileAbsolutepath(
|
||||||
SettingsAdapter.getAccountConfig_Ringtone_RingtonePath())
|
CurrentAccount.ringtonePath_Ringtone)
|
||||||
|
|
||||||
nameFilters: [qsTr("Audio Files") + " (*.wav *.ogg *.opus *.mp3 *.aiff *.wma)", qsTr(
|
nameFilters: [qsTr("Audio Files") + " (*.wav *.ogg *.opus *.mp3 *.aiff *.wma)",
|
||||||
"All files") + " (*)"]
|
qsTr("All files") + " (*)"]
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
var url = UtilsAdapter.getAbsPath(file.toString())
|
var url = UtilsAdapter.getAbsPath(file.toString())
|
||||||
changeRingtonePath(url)
|
|
||||||
|
if(url.length !== 0)
|
||||||
|
CurrentAccount.ringtonePath_Ringtone = url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,9 +85,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.allowCallsUnknownContacs
|
labelText: JamiStrings.allowCallsUnknownContacs
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.PublicInCalls_DHT
|
||||||
SettingsAdapter.setCallsUntrusted(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.PublicInCalls_DHT = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -117,9 +96,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.autoAnswerCalls
|
labelText: JamiStrings.autoAnswerCalls
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.autoAnswer
|
||||||
SettingsAdapter.setAutoAnswerCalls(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.autoAnswer = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -128,17 +107,21 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.enableCustomRingtone
|
labelText: JamiStrings.enableCustomRingtone
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.ringtoneEnabled_Ringtone
|
||||||
SettingsAdapter.setEnableRingtone(checked)
|
|
||||||
btnRingtone.enabled = checked
|
onSwitchToggled: CurrentAccount.ringtoneEnabled_Ringtone = checked
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingMaterialButton {
|
SettingMaterialButton {
|
||||||
id: btnRingtone
|
id: btnRingtone
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: checkBoxCustomRingtone.checked
|
||||||
|
|
||||||
|
textField: UtilsAdapter.toFileInfoName(CurrentAccount.ringtonePath_Ringtone)
|
||||||
|
|
||||||
titleField: JamiStrings.selectCustomRingtone
|
titleField: JamiStrings.selectCustomRingtone
|
||||||
source: JamiResources.round_folder_24dp_svg
|
source: JamiResources.round_folder_24dp_svg
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
|
@ -147,14 +130,15 @@ ColumnLayout {
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
id: checkBoxRdv
|
id: checkBoxRdv
|
||||||
|
|
||||||
visible: !isSIP
|
visible: !isSIP
|
||||||
|
|
||||||
labelText: JamiStrings.rendezVous
|
labelText: JamiStrings.rendezVous
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.isRendezVous
|
||||||
SettingsAdapter.setIsRendezVous(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.isRendezVous = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -163,8 +147,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.enableLocalModerators
|
labelText: JamiStrings.enableLocalModerators
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.enableLocalModerators(
|
checked: CurrentAccount.isLocalModeratorsEnabled
|
||||||
LRCInstance.currentAccountId, checked)
|
|
||||||
|
onSwitchToggled: CurrentAccount.isLocalModeratorsEnabled = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
|
@ -182,6 +167,8 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 160
|
Layout.preferredHeight: 160
|
||||||
|
|
||||||
|
visible: model.rowCount() > 0
|
||||||
|
|
||||||
model: ModeratorListModel {
|
model: ModeratorListModel {
|
||||||
lrcInstance: LRCInstance
|
lrcInstance: LRCInstance
|
||||||
}
|
}
|
||||||
|
@ -200,7 +187,7 @@ ColumnLayout {
|
||||||
|
|
||||||
onClicked: moderatorListWidget.currentIndex = index
|
onClicked: moderatorListWidget.currentIndex = index
|
||||||
onBtnContactClicked: {
|
onBtnContactClicked: {
|
||||||
SettingsAdapter.setDefaultModerator(
|
AccountAdapter.setDefaultModerator(
|
||||||
LRCInstance.currentAccountId, contactID, false)
|
LRCInstance.currentAccountId, contactID, false)
|
||||||
updateAndShowModeratorsSlot()
|
updateAndShowModeratorsSlot()
|
||||||
}
|
}
|
||||||
|
@ -239,8 +226,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.enableAllModerators
|
labelText: JamiStrings.enableAllModerators
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.setAllModeratorsEnabled(
|
checked: CurrentAccount.isAllModeratorsEnabled
|
||||||
LRCInstance.currentAccountId, checked)
|
|
||||||
|
onSwitchToggled: CurrentAccount.isAllModeratorsEnabled = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,10 +29,6 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateSettings() {
|
|
||||||
checkBoxSendDisplayed.checked = SettingsAdapter.getAccountConfig_ReadReceipt()
|
|
||||||
}
|
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
@ -52,9 +48,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.enableReadReceipts
|
labelText: JamiStrings.enableReadReceipts
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.sendReadReceipt
|
||||||
SettingsAdapter.setSendReadReceipt(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.sendReadReceipt = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,23 +31,6 @@ ColumnLayout {
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
property bool isSIP
|
property bool isSIP
|
||||||
|
|
||||||
function updateConnectivityAccountInfos() {
|
|
||||||
autoRegistrationAfterExpired.checked = SettingsAdapter.getAccountConfig_KeepAliveEnabled()
|
|
||||||
registrationExpireTimeoutSpinBox.valueField = SettingsAdapter.getAccountConfig_Registration_Expire()
|
|
||||||
networkInterfaceSpinBox.valueField = SettingsAdapter.getAccountConfig_Localport()
|
|
||||||
checkBoxUPnP.checked = SettingsAdapter.getAccountConfig_UpnpEnabled()
|
|
||||||
checkBoxTurnEnable.checked = SettingsAdapter.getAccountConfig_TURN_Enabled()
|
|
||||||
lineEditTurnAddress.textField = SettingsAdapter.getAccountConfig_TURN_Server()
|
|
||||||
lineEditTurnUsername.textField = SettingsAdapter.getAccountConfig_TURN_Username()
|
|
||||||
lineEditTurnPassword.textField = SettingsAdapter.getAccountConfig_TURN_Password()
|
|
||||||
checkBoxSTUNEnable.checked = SettingsAdapter.getAccountConfig_STUN_Enabled()
|
|
||||||
lineEditSTUNAddress.textField = SettingsAdapter.getAccountConfig_STUN_Server()
|
|
||||||
lineEditTurnRealmSIP.textField = SettingsAdapter.getAccountConfig_TURN_Realm()
|
|
||||||
lineEditTurnRealmSIP.enabled = SettingsAdapter.getAccountConfig_TURN_Enabled()
|
|
||||||
lineEditSTUNAddress.enabled = SettingsAdapter.getAccountConfig_STUN_Enabled()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
@ -70,11 +53,14 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.autoRegistration
|
labelText: JamiStrings.autoRegistration
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.setKeepAliveEnabled(checked)
|
checked: CurrentAccount.keepAliveEnabled
|
||||||
|
|
||||||
|
onSwitchToggled: CurrentAccount.keepAliveEnabled = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinBox {
|
SettingSpinBox {
|
||||||
id: registrationExpireTimeoutSpinBox
|
id: registrationExpireTimeoutSpinBox
|
||||||
|
|
||||||
visible: isSIP
|
visible: isSIP
|
||||||
|
|
||||||
title: JamiStrings.registrationExpirationTime
|
title: JamiStrings.registrationExpirationTime
|
||||||
|
@ -82,11 +68,14 @@ ColumnLayout {
|
||||||
bottomValue: 0
|
bottomValue: 0
|
||||||
topValue: 7*24*3600
|
topValue: 7*24*3600
|
||||||
|
|
||||||
onNewValue: SettingsAdapter.registrationExpirationTimeSpinBoxValueChanged(valueField)
|
valueField: CurrentAccount.expire_Registration
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.expire_Registration = valueField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinBox {
|
SettingSpinBox {
|
||||||
id: networkInterfaceSpinBox
|
id: networkInterfaceSpinBox
|
||||||
|
|
||||||
visible: isSIP
|
visible: isSIP
|
||||||
|
|
||||||
title: JamiStrings.networkInterface
|
title: JamiStrings.networkInterface
|
||||||
|
@ -94,7 +83,14 @@ ColumnLayout {
|
||||||
bottomValue: 0
|
bottomValue: 0
|
||||||
topValue: 65535
|
topValue: 65535
|
||||||
|
|
||||||
onNewValue: SettingsAdapter.networkInterfaceSpinBoxValueChanged(valueField)
|
valueField: CurrentAccount.localPort
|
||||||
|
|
||||||
|
onInputAcceptableChanged: {
|
||||||
|
if (!inputAcceptable && valueField.length !== 0)
|
||||||
|
valueField = Qt.binding(function() { return CurrentAccount.localPort })
|
||||||
|
}
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.localPort = valueField
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -105,7 +101,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.useUPnP
|
labelText: JamiStrings.useUPnP
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.setUseUPnP(checked)
|
checked: CurrentAccount.upnpEnabled
|
||||||
|
|
||||||
|
onSwitchToggled: CurrentAccount.upnpEnabled = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -116,15 +114,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.useTURN
|
labelText: JamiStrings.useTURN
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.enable_TURN
|
||||||
SettingsAdapter.setUseTURN(checked)
|
|
||||||
if (isSIP) {
|
onSwitchToggled: CurrentAccount.enable_TURN = checked
|
||||||
lineEditTurnAddress.enabled = checked
|
|
||||||
lineEditTurnUsername.enabled = checked
|
|
||||||
lineEditTurnPassword.enabled = checked
|
|
||||||
lineEditTurnRealmSIP.enabled = checked
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -132,9 +124,15 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: checkBoxTurnEnable.checked
|
||||||
|
|
||||||
|
textField: CurrentAccount.server_TURN
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.turnAdress
|
titleField: JamiStrings.turnAdress
|
||||||
onEditFinished: SettingsAdapter.setTURNAddress(textField)
|
|
||||||
|
onEditFinished: CurrentAccount.server_TURN = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -142,9 +140,15 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: checkBoxTurnEnable.checked
|
||||||
|
|
||||||
|
textField: CurrentAccount.username_TURN
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.turnUsername
|
titleField: JamiStrings.turnUsername
|
||||||
onEditFinished: SettingsAdapter.setTURNUsername(textField)
|
|
||||||
|
onEditFinished: CurrentAccount.username_TURN = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -152,9 +156,15 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: checkBoxTurnEnable.checked
|
||||||
|
|
||||||
|
textField: CurrentAccount.password_TURN
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.turnPassword
|
titleField: JamiStrings.turnPassword
|
||||||
onEditFinished: SettingsAdapter.setTURNPassword(textField)
|
|
||||||
|
onEditFinished: CurrentAccount.password_TURN = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -162,9 +172,15 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: checkBoxTurnEnable.checked
|
||||||
|
|
||||||
|
textField: CurrentAccount.realm_TURN
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.turnRealm
|
titleField: JamiStrings.turnRealm
|
||||||
onEditFinished: SettingsAdapter.setTURNRealm(textField)
|
|
||||||
|
onEditFinished: CurrentAccount.realm_TURN = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -175,10 +191,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.useSTUN
|
labelText: JamiStrings.useSTUN
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.enable_STUN
|
||||||
SettingsAdapter.setUseSTUN(checked)
|
|
||||||
lineEditSTUNAddress.enabled = checked
|
onSwitchToggled: CurrentAccount.enable_STUN = checked
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -186,9 +201,15 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: checkBoxSTUNEnable.checked
|
||||||
|
|
||||||
|
textField: CurrentAccount.server_STUN
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.stunAdress
|
titleField: JamiStrings.stunAdress
|
||||||
onEditFinished: SettingsAdapter.setSTUNAddress(textField)
|
|
||||||
|
onEditFinished: CurrentAccount.server_STUN = textField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,90 +30,58 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateSecurityAccountInfos() {
|
|
||||||
btnCACert.textField = UtilsAdapter.toFileInfoName(SettingsAdapter.getAccountConfig_TLS_CertificateListFile())
|
|
||||||
btnCACert.enabled = SettingsAdapter.getAccountConfig_TLS_Enable()
|
|
||||||
btnUserCert.textField = UtilsAdapter.toFileInfoName(SettingsAdapter.getAccountConfig_TLS_CertificateFile())
|
|
||||||
btnUserCert.enabled = SettingsAdapter.getAccountConfig_TLS_Enable()
|
|
||||||
btnPrivateKey.textField = UtilsAdapter.toFileInfoName(SettingsAdapter.getAccountConfig_TLS_PrivateKeyFile())
|
|
||||||
btnPrivateKey.enabled = SettingsAdapter.getAccountConfig_TLS_Enable()
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeFileCACert(url){
|
|
||||||
if(url.length !== 0) {
|
|
||||||
SettingsAdapter.set_FileCACert(url)
|
|
||||||
btnCACert.textField = UtilsAdapter.toFileInfoName(url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeFileUserCert(url){
|
|
||||||
if(url.length !== 0) {
|
|
||||||
SettingsAdapter.set_FileUserCert(url)
|
|
||||||
btnUserCert.textField = UtilsAdapter.toFileInfoName(url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeFilePrivateKey(url){
|
|
||||||
if(url.length !== 0) {
|
|
||||||
SettingsAdapter.set_FilePrivateKey(url)
|
|
||||||
btnPrivateKey.textField = UtilsAdapter.toFileInfoName(url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JamiFileDialog {
|
JamiFileDialog {
|
||||||
id: caCert_Dialog
|
id: caCert_Dialog
|
||||||
|
|
||||||
property string oldPath : SettingsAdapter.getAccountConfig_TLS_CertificateListFile()
|
property string oldPath: CurrentAccount.certificateListFile_TLS
|
||||||
property string openPath : oldPath === "" ? (UtilsAdapter.getCurrentPath() + "/ringtones/") : (UtilsAdapter.toFileAbsolutepath(oldPath))
|
property string openPath: oldPath === "" ?
|
||||||
|
(UtilsAdapter.getCurrentPath() + "/ringtones/") :
|
||||||
|
(UtilsAdapter.toFileAbsolutepath(oldPath))
|
||||||
|
|
||||||
mode: JamiFileDialog.OpenFile
|
mode: JamiFileDialog.OpenFile
|
||||||
title: JamiStrings.selectCACert
|
title: JamiStrings.selectCACert
|
||||||
folder: openPath
|
folder: openPath
|
||||||
nameFilters: [qsTr("Certificate File") + " (*.crt)", qsTr(
|
nameFilters: [qsTr("Certificate File") + " (*.crt)",
|
||||||
"All files") + " (*)"]
|
qsTr("All files") + " (*)"]
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: CurrentAccount.certificateListFile_TLS =
|
||||||
var url = UtilsAdapter.getAbsPath(file.toString())
|
UtilsAdapter.getAbsPath(file.toString())
|
||||||
changeFileCACert(url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JamiFileDialog {
|
JamiFileDialog {
|
||||||
id: userCert_Dialog
|
id: userCert_Dialog
|
||||||
|
|
||||||
property string oldPath : SettingsAdapter.getAccountConfig_TLS_CertificateFile()
|
property string oldPath: CurrentAccount.certificateFile_TLS
|
||||||
property string openPath : oldPath === "" ? (UtilsAdapter.getCurrentPath() + "/ringtones/") : (UtilsAdapter.toFileAbsolutepath(oldPath))
|
property string openPath: oldPath === "" ?
|
||||||
|
(UtilsAdapter.getCurrentPath() + "/ringtones/") :
|
||||||
|
(UtilsAdapter.toFileAbsolutepath(oldPath))
|
||||||
|
|
||||||
mode: JamiFileDialog.OpenFile
|
mode: JamiFileDialog.OpenFile
|
||||||
title: JamiStrings.selectUserCert
|
title: JamiStrings.selectUserCert
|
||||||
folder: openPath
|
folder: openPath
|
||||||
nameFilters: [qsTr("Certificate File") + " (*.crt)", qsTr(
|
nameFilters: [qsTr("Certificate File") + " (*.crt)",
|
||||||
"All files") + " (*)"]
|
qsTr("All files") + " (*)"]
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: CurrentAccount.certificateFile_TLS =
|
||||||
var url = UtilsAdapter.getAbsPath(file.toString())
|
UtilsAdapter.getAbsPath(file.toString())
|
||||||
changeFileUserCert(url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JamiFileDialog {
|
JamiFileDialog {
|
||||||
id: privateKey_Dialog
|
id: privateKey_Dialog
|
||||||
|
|
||||||
property string oldPath : {
|
property string oldPath: CurrentAccount.privateKeyFile_TLS
|
||||||
return SettingsAdapter.getAccountConfig_TLS_PrivateKeyFile()
|
property string openPath: oldPath === "" ?
|
||||||
}
|
(UtilsAdapter.getCurrentPath() + "/ringtones/") :
|
||||||
property string openPath : oldPath === "" ? (UtilsAdapter.getCurrentPath() + "/ringtones/") : (UtilsAdapter.toFileAbsolutepath(oldPath))
|
(UtilsAdapter.toFileAbsolutepath(oldPath))
|
||||||
|
|
||||||
mode: JamiFileDialog.OpenFile
|
mode: JamiFileDialog.OpenFile
|
||||||
title: JamiStrings.selectPrivateKey
|
title: JamiStrings.selectPrivateKey
|
||||||
folder: openPath
|
folder: openPath
|
||||||
nameFilters: [qsTr("Key File") + " (*.key)", qsTr(
|
nameFilters: [qsTr("Key File") + " (*.key)",
|
||||||
"All files") + " (*)"]
|
qsTr("All files") + " (*)"]
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: CurrentAccount.privateKeyFile_TLS =
|
||||||
var url = UtilsAdapter.getAbsPath(file.toString())
|
UtilsAdapter.getAbsPath(file.toString())
|
||||||
changeFilePrivateKey(url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
|
@ -131,34 +99,46 @@ ColumnLayout {
|
||||||
|
|
||||||
SettingMaterialButton {
|
SettingMaterialButton {
|
||||||
id: btnCACert
|
id: btnCACert
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_TLS
|
||||||
|
textField: UtilsAdapter.toFileInfoName(CurrentAccount.certificateListFile_TLS)
|
||||||
titleField: JamiStrings.caCertificate
|
titleField: JamiStrings.caCertificate
|
||||||
source: JamiResources.round_folder_24dp_svg
|
source: JamiResources.round_folder_24dp_svg
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
|
|
||||||
onClick: caCert_Dialog.open()
|
onClick: caCert_Dialog.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingMaterialButton {
|
SettingMaterialButton {
|
||||||
id: btnUserCert
|
id: btnUserCert
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_TLS
|
||||||
|
textField: UtilsAdapter.toFileInfoName(CurrentAccount.certificateFile_TLS)
|
||||||
titleField: JamiStrings.userCertificate
|
titleField: JamiStrings.userCertificate
|
||||||
source: JamiResources.round_folder_24dp_svg
|
source: JamiResources.round_folder_24dp_svg
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
|
|
||||||
onClick: userCert_Dialog.open()
|
onClick: userCert_Dialog.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingMaterialButton {
|
SettingMaterialButton {
|
||||||
id: btnPrivateKey
|
id: btnPrivateKey
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_TLS
|
||||||
|
textField: UtilsAdapter.toFileInfoName(CurrentAccount.privateKeyFile_TLS)
|
||||||
titleField: JamiStrings.privateKey
|
titleField: JamiStrings.privateKey
|
||||||
source: JamiResources.round_folder_24dp_svg
|
source: JamiResources.round_folder_24dp_svg
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
|
|
||||||
onClick: privateKey_Dialog.open()
|
onClick: privateKey_Dialog.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,8 +147,13 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.privateKeyPassword
|
titleField: JamiStrings.privateKeyPassword
|
||||||
|
|
||||||
|
textField: CurrentAccount.password_TLS
|
||||||
|
|
||||||
|
onEditFinished: CurrentAccount.password_TLS = textField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,12 +29,6 @@ import "../../commoncomponents"
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
function updateMediaConnectivityAccountInfos() {
|
|
||||||
videoCheckBox.checked = SettingsAdapter.getAccountConfig_Video_Enabled()
|
|
||||||
videoSettings.updateCodecs();
|
|
||||||
audioSettings.updateCodecs();
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
@ -58,7 +52,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.enableVideo
|
labelText: JamiStrings.enableVideo
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.setVideoState(checked)
|
checked: CurrentAccount.videoEnabled_Video
|
||||||
|
|
||||||
|
onSwitchToggled: CurrentAccount.videoEnabled_Video = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
|
@ -30,10 +30,6 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateNameServerInfos() {
|
|
||||||
lineEditNameServer.textField = SettingsAdapter.getAccountConfig_RingNS_Uri()
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
|
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
|
||||||
|
@ -55,9 +51,12 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: qsTr("Address")
|
titleField: qsTr("Address")
|
||||||
|
|
||||||
onEditFinished: SettingsAdapter.setNameServer(textField)
|
textField: CurrentAccount.uri_RingNS
|
||||||
|
|
||||||
|
onEditFinished: CurrentAccount.uri_RingNS = textField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,13 +30,6 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateOpenDHTSettingsInfos() {
|
|
||||||
checkAutoConnectOnLocalNetwork.checked = SettingsAdapter.getAccountConfig_PeerDiscovery()
|
|
||||||
checkBoxEnableProxy.checked = SettingsAdapter.getAccountConfig_ProxyEnabled()
|
|
||||||
lineEditProxy.textField = SettingsAdapter.getAccountConfig_ProxyServer()
|
|
||||||
lineEditBootstrap.textField = SettingsAdapter.getAccountConfig_Hostname()
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
|
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
|
||||||
|
@ -65,9 +58,9 @@ ColumnLayout {
|
||||||
tooltipText: JamiStrings.tooltipPeerDiscovery
|
tooltipText: JamiStrings.tooltipPeerDiscovery
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.peerDiscovery
|
||||||
SettingsAdapter.setAutoConnectOnLocalNetwork(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.peerDiscovery = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -76,10 +69,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.enableProxy
|
labelText: JamiStrings.enableProxy
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.proxyEnabled
|
||||||
SettingsAdapter.setEnableProxy(checked)
|
|
||||||
lineEditProxy.enabled = checked
|
onSwitchToggled: CurrentAccount.proxyEnabled = checked
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -87,10 +79,15 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: checkBoxEnableProxy.checked
|
||||||
|
|
||||||
|
textField: CurrentAccount.proxyServer
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.proxyAddress
|
titleField: JamiStrings.proxyAddress
|
||||||
|
|
||||||
onEditFinished: SettingsAdapter.setProxyAddress(textField)
|
onEditFinished: CurrentAccount.proxyServer = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -98,10 +95,13 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
textField: CurrentAccount.hostname
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.bootstrap
|
titleField: JamiStrings.bootstrap
|
||||||
|
|
||||||
onEditFinished: SettingsAdapter.setBootstrapAddress(textField)
|
onEditFinished: CurrentAccount.hostname = textField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,19 +30,6 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updatePublicAddressAccountInfos() {
|
|
||||||
checkBoxAllowIPAutoRewrite.checked = SettingsAdapter.getAccountConfig_AllowIPAutoRewrite()
|
|
||||||
checkBoxCustomAddressPort.checked = !SettingsAdapter.getAccountConfig_PublishedSameAsLocal()
|
|
||||||
lineEditSIPCustomAddress.textField = SettingsAdapter.getAccountConfig_PublishedAddress()
|
|
||||||
customPortSIPSpinBox.valueField = SettingsAdapter.getAccountConfig_PublishedPort()
|
|
||||||
|
|
||||||
if (checkBoxAllowIPAutoRewrite.checked) {
|
|
||||||
checkBoxCustomAddressPort.visible = false
|
|
||||||
lineEditSIPCustomAddress.visible = false
|
|
||||||
customPortSIPSpinBox.visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
@ -67,12 +54,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.allowIPAutoRewrite
|
labelText: JamiStrings.allowIPAutoRewrite
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.allowIPAutoRewrite
|
||||||
SettingsAdapter.setAllowIPAutoRewrite(checked)
|
|
||||||
checkBoxCustomAddressPort.visible = !checked
|
onSwitchToggled: CurrentAccount.allowIPAutoRewrite = checked
|
||||||
lineEditSIPCustomAddress.visible = !checked
|
|
||||||
customPortSIPSpinBox.visible = !checked
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -81,11 +65,10 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.useCustomAddress
|
labelText: JamiStrings.useCustomAddress
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
visible: !checkBoxAllowIPAutoRewrite.checked
|
||||||
SettingsAdapter.setUseCustomAddressAndPort(!checked)
|
checked: CurrentAccount.publishedSameAsLocal
|
||||||
lineEditSIPCustomAddress.enabled = checked
|
|
||||||
customPortSIPSpinBox.enabled = checked
|
onSwitchToggled: CurrentAccount.publishedSameAsLocal = checked
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -93,10 +76,16 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
visible: !checkBoxAllowIPAutoRewrite.checked
|
||||||
|
enabled: checkBoxCustomAddressPort.checked
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.address
|
titleField: JamiStrings.address
|
||||||
|
|
||||||
onEditFinished: SettingsAdapter.lineEditSIPCustomAddressLineEditTextChanged(textField)
|
textField: CurrentAccount.publishedAddress
|
||||||
|
|
||||||
|
onEditFinished: CurrentAccount.publishedAddress = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinBox {
|
SettingSpinBox {
|
||||||
|
@ -107,7 +96,17 @@ ColumnLayout {
|
||||||
bottomValue: 0
|
bottomValue: 0
|
||||||
topValue: 65535
|
topValue: 65535
|
||||||
|
|
||||||
onNewValue: SettingsAdapter.customPortSIPSpinBoxValueChanged(valueField)
|
visible: !checkBoxAllowIPAutoRewrite.checked
|
||||||
|
enabled: checkBoxCustomAddressPort.checked
|
||||||
|
|
||||||
|
valueField: CurrentAccount.publishedPort
|
||||||
|
|
||||||
|
onInputAcceptableChanged: {
|
||||||
|
if (!inputAcceptable && valueField.length !== 0)
|
||||||
|
valueField = Qt.binding(function() { return CurrentAccount.publishedPort })
|
||||||
|
}
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.publishedPort = valueField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,45 +30,6 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateSDPAccountInfos(){
|
|
||||||
audioRTPMinPortSpinBox.valueField = SettingsAdapter.getAccountConfig_Audio_AudioPortMin()
|
|
||||||
audioRTPMaxPortSpinBox.valueField = SettingsAdapter.getAccountConfig_Audio_AudioPortMax()
|
|
||||||
videoRTPMinPortSpinBox.valueField = SettingsAdapter.getAccountConfig_Video_VideoPortMin()
|
|
||||||
videoRTPMaxPortSpinBox.valueField = SettingsAdapter.getAccountConfig_Video_VideoPortMax()
|
|
||||||
}
|
|
||||||
|
|
||||||
function audioRTPMinPortSpinBoxEditFinished(value) {
|
|
||||||
if (SettingsAdapter.getAccountConfig_Audio_AudioPortMax() < value) {
|
|
||||||
audioRTPMinPortSpinBox.valueField = SettingsAdapter.getAccountConfig_Audio_AudioPortMin()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
SettingsAdapter.audioRTPMinPortSpinBoxEditFinished(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
function audioRTPMaxPortSpinBoxEditFinished(value) {
|
|
||||||
if (value <SettingsAdapter.getAccountConfig_Audio_AudioPortMin()) {
|
|
||||||
audioRTPMaxPortSpinBox.valueField = SettingsAdapter.getAccountConfig_Audio_AudioPortMax()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
SettingsAdapter.audioRTPMaxPortSpinBoxEditFinished(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
function videoRTPMinPortSpinBoxEditFinished(value) {
|
|
||||||
if (SettingsAdapter.getAccountConfig_Video_VideoPortMax() < value) {
|
|
||||||
videoRTPMinPortSpinBox.valueField = SettingsAdapter.getAccountConfig_Video_VideoPortMin()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
SettingsAdapter.videoRTPMinPortSpinBoxEditFinished(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
function videoRTPMaxPortSpinBoxEditFinished(value) {
|
|
||||||
if (value <SettingsAdapter.getAccountConfig_Video_VideoPortMin()) {
|
|
||||||
videoRTPMinPortSpinBox.valueField = SettingsAdapter.getAccountConfig_Video_VideoPortMin()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
SettingsAdapter.videoRTPMaxPortSpinBoxEditFinished(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
Layout.preferredWidth: textWidth
|
Layout.preferredWidth: textWidth
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
@ -97,9 +58,16 @@ ColumnLayout {
|
||||||
title: JamiStrings.audioRTPMinPort
|
title: JamiStrings.audioRTPMinPort
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
bottomValue: 0
|
bottomValue: 0
|
||||||
topValue: 65535
|
topValue: audioRTPMaxPortSpinBox.valueField - 1
|
||||||
|
|
||||||
onNewValue: audioRTPMinPortSpinBoxEditFinished(valueField)
|
valueField: CurrentAccount.audioPortMin_Audio
|
||||||
|
|
||||||
|
onInputAcceptableChanged: {
|
||||||
|
if (!inputAcceptable && valueField.length !== 0)
|
||||||
|
valueField = Qt.binding(function() { return CurrentAccount.audioPortMin_Audio })
|
||||||
|
}
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.audioPortMin_Audio = valueField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinBox {
|
SettingSpinBox {
|
||||||
|
@ -107,10 +75,17 @@ ColumnLayout {
|
||||||
|
|
||||||
title: JamiStrings.audioRTPMaxPort
|
title: JamiStrings.audioRTPMaxPort
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
bottomValue: 0
|
bottomValue: audioRTPMinPortSpinBox.valueField + 1
|
||||||
topValue: 65535
|
topValue: 65535
|
||||||
|
|
||||||
onNewValue: audioRTPMaxPortSpinBoxEditFinished(valueField)
|
valueField: CurrentAccount.audioPortMax_Audio
|
||||||
|
|
||||||
|
onInputAcceptableChanged: {
|
||||||
|
if (!inputAcceptable && valueField.length !== 0)
|
||||||
|
valueField = Qt.binding(function() { return CurrentAccount.audioPortMax_Audio })
|
||||||
|
}
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.audioPortMax_Audio = valueField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinBox {
|
SettingSpinBox {
|
||||||
|
@ -119,9 +94,16 @@ ColumnLayout {
|
||||||
title: JamiStrings.videoRTPMinPort
|
title: JamiStrings.videoRTPMinPort
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
bottomValue: 0
|
bottomValue: 0
|
||||||
topValue: 65535
|
topValue: videoRTPMaxPortSpinBox.valueField - 1
|
||||||
|
|
||||||
onNewValue: videoRTPMinPortSpinBoxEditFinished(valueField)
|
valueField: CurrentAccount.videoPortMin_Video
|
||||||
|
|
||||||
|
onInputAcceptableChanged: {
|
||||||
|
if (!inputAcceptable && valueField.length !== 0)
|
||||||
|
valueField = Qt.binding(function() { return CurrentAccount.videoPortMin_Video })
|
||||||
|
}
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.videoPortMin_Video = valueField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinBox {
|
SettingSpinBox {
|
||||||
|
@ -129,10 +111,17 @@ ColumnLayout {
|
||||||
|
|
||||||
title: JamiStrings.videoRTPMaxPort
|
title: JamiStrings.videoRTPMaxPort
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
bottomValue: 0
|
bottomValue: videoRTPMinPortSpinBox.valueField + 1
|
||||||
topValue: 65535
|
topValue: 65535
|
||||||
|
|
||||||
onNewValue: videoRTPMaxPortSpinBoxEditFinished(valueField)
|
valueField: CurrentAccount.videoPortMax_Video
|
||||||
|
|
||||||
|
onInputAcceptableChanged: {
|
||||||
|
if (!inputAcceptable && valueField.length !== 0)
|
||||||
|
valueField = Qt.binding(function() { return CurrentAccount.videoPortMax_Video })
|
||||||
|
}
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.videoPortMax_Video = valueField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,107 +31,58 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateSecurityAccountInfos() {
|
|
||||||
enableSDESToggle.enabled = SettingsAdapter.getAccountConfig_SRTP_Enabled()
|
|
||||||
fallbackRTPToggle.enabled = SettingsAdapter.getAccountConfig_SRTP_Enabled()
|
|
||||||
btnSIPCACert.enabled = SettingsAdapter.getAccountConfig_TLS_Enable()
|
|
||||||
btnSIPUserCert.enabled = SettingsAdapter.getAccountConfig_TLS_Enable()
|
|
||||||
btnSIPPrivateKey.enabled = SettingsAdapter.getAccountConfig_TLS_Enable()
|
|
||||||
lineEditSIPCertPassword.enabled = SettingsAdapter.getAccountConfig_TLS_Enable()
|
|
||||||
|
|
||||||
btnSIPCACert.textField = UtilsAdapter.toFileInfoName(SettingsAdapter.getAccountConfig_TLS_CertificateListFile())
|
|
||||||
btnSIPUserCert.textField = UtilsAdapter.toFileInfoName(SettingsAdapter.getAccountConfig_TLS_CertificateFile())
|
|
||||||
btnSIPPrivateKey.textField = UtilsAdapter.toFileInfoName(SettingsAdapter.getAccountConfig_TLS_PrivateKeyFile())
|
|
||||||
lineEditSIPCertPassword.textField = SettingsAdapter.getAccountConfig_TLS_Password()
|
|
||||||
|
|
||||||
encryptMediaStreamsToggle.checked = SettingsAdapter.getAccountConfig_SRTP_Enabled()
|
|
||||||
enableSDESToggle.checked = (SettingsAdapter.getAccountConfig_SRTP_KeyExchange() === Account.KeyExchangeProtocol.SDES)
|
|
||||||
fallbackRTPToggle.checked = SettingsAdapter.getAccountConfig_SRTP_RtpFallback()
|
|
||||||
encryptNegotitationToggle.checked = SettingsAdapter.getAccountConfig_TLS_Enable()
|
|
||||||
verifyIncomingCertificatesServerToggle.checked = SettingsAdapter.getAccountConfig_TLS_VerifyServer()
|
|
||||||
verifyIncomingCertificatesClientToggle.checked = SettingsAdapter.getAccountConfig_TLS_VerifyClient()
|
|
||||||
requireCeritificateForTLSIncomingToggle.checked = SettingsAdapter.getAccountConfig_TLS_RequireClientCertificate()
|
|
||||||
|
|
||||||
var method = SettingsAdapter.getAccountConfig_TLS_Method_inInt()
|
|
||||||
tlsProtocolComboBox.setCurrentIndex(method)
|
|
||||||
|
|
||||||
outgoingTLSServerNameLineEdit.textField = SettingsAdapter.getAccountConfig_TLS_Servername()
|
|
||||||
negotiationTimeoutSpinBox.valueField = SettingsAdapter.getAccountConfig_TLS_NegotiationTimeoutSec()
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeFileCACert(url){
|
|
||||||
if(url.length !== 0) {
|
|
||||||
SettingsAdapter.set_FileCACert(url)
|
|
||||||
btnSIPCACert.textField = UtilsAdapter.toFileInfoName(url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeFileUserCert(url){
|
|
||||||
if(url.length !== 0) {
|
|
||||||
SettingsAdapter.set_FileUserCert(url)
|
|
||||||
btnSIPUserCert.textField = UtilsAdapter.toFileInfoName(url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeFilePrivateKey(url){
|
|
||||||
if(url.length !== 0) {
|
|
||||||
SettingsAdapter.set_FilePrivateKey(url)
|
|
||||||
btnSIPPrivateKey.textField = UtilsAdapter.toFileInfoName(url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JamiFileDialog {
|
JamiFileDialog {
|
||||||
id: caCert_Dialog_SIP
|
id: caCert_Dialog_SIP
|
||||||
|
|
||||||
property string oldPath : SettingsAdapter.getAccountConfig_TLS_CertificateListFile()
|
property string oldPath: CurrentAccount.certificateListFile_TLS
|
||||||
property string openPath : oldPath === "" ? (UtilsAdapter.getCurrentPath() + "/ringtones/") : (UtilsAdapter.toFileAbsolutepath(oldPath))
|
property string openPath: oldPath === "" ?
|
||||||
|
(UtilsAdapter.getCurrentPath() + "/ringtones/") :
|
||||||
|
(UtilsAdapter.toFileAbsolutepath(oldPath))
|
||||||
|
|
||||||
mode: JamiFileDialog.OpenFile
|
mode: JamiFileDialog.OpenFile
|
||||||
title: JamiStrings.selectCACert
|
title: JamiStrings.selectCACert
|
||||||
folder: openPath
|
folder: openPath
|
||||||
nameFilters: [qsTr("Certificate File") + " (*.crt)", qsTr(
|
nameFilters: [qsTr("Certificate File") + " (*.crt)",
|
||||||
"All files") + " (*)"]
|
qsTr("All files") + " (*)"]
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: CurrentAccount.certificateListFile_TLS =
|
||||||
var url = UtilsAdapter.getAbsPath(file.toString())
|
UtilsAdapter.getAbsPath(file.toString())
|
||||||
changeFileCACert(url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JamiFileDialog {
|
JamiFileDialog {
|
||||||
id: userCert_Dialog_SIP
|
id: userCert_Dialog_SIP
|
||||||
|
|
||||||
property string oldPath : SettingsAdapter.getAccountConfig_TLS_CertificateFile()
|
property string oldPath: CurrentAccount.certificateFile_TLS
|
||||||
property string openPath : oldPath === "" ? (UtilsAdapter.getCurrentPath() + "/ringtones/") : (UtilsAdapter.toFileAbsolutepath(oldPath))
|
property string openPath: oldPath === "" ?
|
||||||
|
(UtilsAdapter.getCurrentPath() + "/ringtones/") :
|
||||||
|
(UtilsAdapter.toFileAbsolutepath(oldPath))
|
||||||
|
|
||||||
mode: JamiFileDialog.OpenFile
|
mode: JamiFileDialog.OpenFile
|
||||||
title: JamiStrings.selectUserCert
|
title: JamiStrings.selectUserCert
|
||||||
folder: openPath
|
folder: openPath
|
||||||
nameFilters: [qsTr("Certificate File") + " (*.crt)", qsTr(
|
nameFilters: [qsTr("Certificate File") + " (*.crt)",
|
||||||
"All files") + " (*)"]
|
qsTr("All files") + " (*)"]
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: CurrentAccount.certificateFile_TLS =
|
||||||
var url = UtilsAdapter.getAbsPath(file.toString())
|
UtilsAdapter.getAbsPath(file.toString())
|
||||||
changeFileUserCert(url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JamiFileDialog {
|
JamiFileDialog {
|
||||||
id: privateKey_Dialog_SIP
|
id: privateKey_Dialog_SIP
|
||||||
|
|
||||||
property string oldPath : SettingsAdapter.getAccountConfig_TLS_PrivateKeyFile()
|
property string oldPath: CurrentAccount.privateKeyFile_TLS
|
||||||
property string openPath : oldPath === "" ? (UtilsAdapter.getCurrentPath() + "/ringtones/") : (UtilsAdapter.toFileAbsolutepath(oldPath))
|
property string openPath: oldPath === "" ?
|
||||||
|
(UtilsAdapter.getCurrentPath() + "/ringtones/") :
|
||||||
|
(UtilsAdapter.toFileAbsolutepath(oldPath))
|
||||||
|
|
||||||
mode: JamiFileDialog.OpenFile
|
mode: JamiFileDialog.OpenFile
|
||||||
title: JamiStrings.selectPrivateKey
|
title: JamiStrings.selectPrivateKey
|
||||||
folder: openPath
|
folder: openPath
|
||||||
nameFilters: [qsTr("Key File") + " (*.key)", qsTr(
|
nameFilters: [qsTr("Key File") + " (*.key)",
|
||||||
"All files") + " (*)"]
|
qsTr("All files") + " (*)"]
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: CurrentAccount.privateKeyFile_TLS =
|
||||||
var url = UtilsAdapter.getAbsPath(file.toString())
|
UtilsAdapter.getAbsPath(file.toString())
|
||||||
changeFilePrivateKey(url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
|
@ -153,33 +104,35 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.encryptMediaStream
|
labelText: JamiStrings.encryptMediaStream
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.enable_SRTP
|
||||||
SettingsAdapter.setUseSRTP(checked)
|
|
||||||
enableSDESToggle.enabled = checked
|
onSwitchToggled: CurrentAccount.enable_SRTP = checked
|
||||||
fallbackRTPToggle.enabled = checked
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
id: enableSDESToggle
|
id: enableSDESToggle
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_SRTP
|
||||||
|
|
||||||
labelText: JamiStrings.enableSDES
|
labelText: JamiStrings.enableSDES
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.keyExchange_SRTP
|
||||||
SettingsAdapter.setUseSDES(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.keyExchange_SRTP = Number(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
id: fallbackRTPToggle
|
id: fallbackRTPToggle
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_SRTP
|
||||||
|
|
||||||
labelText: JamiStrings.fallbackRTP
|
labelText: JamiStrings.fallbackRTP
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.rtpFallback_SRTP
|
||||||
SettingsAdapter.setUseRTPFallback(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.rtpFallback_SRTP = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -188,45 +141,59 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.encryptNegotiation
|
labelText: JamiStrings.encryptNegotiation
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.enable_TLS
|
||||||
SettingsAdapter.setUseTLS(checked)
|
|
||||||
btnSIPCACert.enabled = checked
|
onSwitchToggled: CurrentAccount.enable_TLS = checked
|
||||||
btnSIPUserCert.enabled = checked
|
|
||||||
btnSIPPrivateKey.enabled = checked
|
|
||||||
lineEditSIPCertPassword.enabled = checked
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingMaterialButton {
|
SettingMaterialButton {
|
||||||
id: btnSIPCACert
|
id: btnSIPCACert
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_TLS
|
||||||
|
|
||||||
titleField: JamiStrings.caCertificate
|
titleField: JamiStrings.caCertificate
|
||||||
source: JamiResources.round_folder_24dp_svg
|
source: JamiResources.round_folder_24dp_svg
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
|
|
||||||
|
textField: UtilsAdapter.toFileInfoName(CurrentAccount.certificateListFile_TLS)
|
||||||
|
|
||||||
onClick: caCert_Dialog_SIP.open()
|
onClick: caCert_Dialog_SIP.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingMaterialButton {
|
SettingMaterialButton {
|
||||||
id: btnSIPUserCert
|
id: btnSIPUserCert
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_TLS
|
||||||
|
|
||||||
titleField: JamiStrings.userCertificate
|
titleField: JamiStrings.userCertificate
|
||||||
source: JamiResources.round_folder_24dp_svg
|
source: JamiResources.round_folder_24dp_svg
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
|
|
||||||
|
textField: UtilsAdapter.toFileInfoName(CurrentAccount.certificateFile_TLS)
|
||||||
|
|
||||||
onClick: userCert_Dialog_SIP.open()
|
onClick: userCert_Dialog_SIP.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingMaterialButton {
|
SettingMaterialButton {
|
||||||
id: btnSIPPrivateKey
|
id: btnSIPPrivateKey
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
Layout.minimumHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_TLS
|
||||||
|
|
||||||
titleField: JamiStrings.privateKey
|
titleField: JamiStrings.privateKey
|
||||||
source: JamiResources.round_folder_24dp_svg
|
source: JamiResources.round_folder_24dp_svg
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
|
|
||||||
|
textField: UtilsAdapter.toFileInfoName(CurrentAccount.privateKeyFile_TLS)
|
||||||
|
|
||||||
onClick: privateKey_Dialog_SIP.open()
|
onClick: privateKey_Dialog_SIP.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,10 +203,15 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
enabled: CurrentAccount.enable_TLS
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.privateKeyPassword
|
titleField: JamiStrings.privateKeyPassword
|
||||||
|
|
||||||
onEditFinished: SettingsAdapter.lineEditSIPCertPasswordLineEditTextChanged(textField)
|
textField: CurrentAccount.password_TLS
|
||||||
|
|
||||||
|
onEditFinished: CurrentAccount.password_TLS = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -248,9 +220,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.verifyCertificatesServer
|
labelText: JamiStrings.verifyCertificatesServer
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.verifyServer_TLS
|
||||||
SettingsAdapter.setVerifyCertificatesServer(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.verifyServer_TLS = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -259,9 +231,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.verifyCertificatesClient
|
labelText: JamiStrings.verifyCertificatesClient
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.verifyClient_TLS
|
||||||
SettingsAdapter.setVerifyCertificatesClient(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.verifyClient_TLS = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -270,9 +242,9 @@ ColumnLayout {
|
||||||
labelText: JamiStrings.tlsRequireConnections
|
labelText: JamiStrings.tlsRequireConnections
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
checked: CurrentAccount.requireClientCertificate_TLS
|
||||||
SettingsAdapter.setRequireCertificatesIncomingTLS(checked)
|
|
||||||
}
|
onSwitchToggled: CurrentAccount.requireClientCertificate_TLS = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsComboBox {
|
SettingsComboBox {
|
||||||
|
@ -293,10 +265,10 @@ ColumnLayout {
|
||||||
tipText: JamiStrings.audioDeviceSelector
|
tipText: JamiStrings.audioDeviceSelector
|
||||||
role: "textDisplay"
|
role: "textDisplay"
|
||||||
|
|
||||||
onIndexChanged: {
|
modelIndex: CurrentAccount.method_TLS
|
||||||
var indexOfOption = comboModel.get(modelIndex).secondArg
|
|
||||||
SettingsAdapter.tlsProtocolComboBoxIndexChanged(parseInt(indexOfOption))
|
onModelIndexChanged: CurrentAccount.method_TLS =
|
||||||
}
|
parseInt(comboModel.get(modelIndex).secondArg)
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -307,7 +279,9 @@ ColumnLayout {
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.tlsServerName
|
titleField: JamiStrings.tlsServerName
|
||||||
|
|
||||||
onEditFinished: SettingsAdapter.outgoingTLSServerNameLineEditTextChanged(textField)
|
textField: CurrentAccount.serverName_TLS
|
||||||
|
|
||||||
|
onEditFinished: CurrentAccount.serverName_TLS = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinBox {
|
SettingSpinBox {
|
||||||
|
@ -319,7 +293,14 @@ ColumnLayout {
|
||||||
bottomValue: 0
|
bottomValue: 0
|
||||||
topValue: 3000
|
topValue: 3000
|
||||||
|
|
||||||
onNewValue: SettingsAdapter.negotiationTimeoutSpinBoxValueChanged(valueField)
|
valueField: CurrentAccount.negotiationTimeoutSec_TLS
|
||||||
|
|
||||||
|
onInputAcceptableChanged: {
|
||||||
|
if (!inputAcceptable && valueField.length !== 0)
|
||||||
|
valueField = Qt.binding(function() { return CurrentAccount.negotiationTimeoutSec_TLS })
|
||||||
|
}
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.negotiationTimeoutSec_TLS = valueField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,20 +33,6 @@ ColumnLayout {
|
||||||
property alias settingsVisible: advancedSettingsView.visible
|
property alias settingsVisible: advancedSettingsView.visible
|
||||||
signal showAdvancedSettingsRequest
|
signal showAdvancedSettingsRequest
|
||||||
|
|
||||||
function updateAdvancedAccountInfos() {
|
|
||||||
advancedCallSettings.updateCallSettingsInfos()
|
|
||||||
advancedChatSettings.updateSettings()
|
|
||||||
advancedVoiceMailSettings.updateVoiceMailSettingsInfos()
|
|
||||||
advancedSIPSecuritySettings.updateSecurityAccountInfos()
|
|
||||||
advancedNameServerSettings.updateNameServerInfos()
|
|
||||||
advancedOpenDHTSettings.updateOpenDHTSettingsInfos()
|
|
||||||
advancedJamiSecuritySettings.updateSecurityAccountInfos()
|
|
||||||
advancedConnectivitySettings.updateConnectivityAccountInfos()
|
|
||||||
advancedPublicAddressSettings.updatePublicAddressAccountInfos()
|
|
||||||
advancedMediaSettings.updateMediaConnectivityAccountInfos()
|
|
||||||
advancedSDPStettings.updateSDPAccountInfos()
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: rowAdvancedSettingsBtn
|
id: rowAdvancedSettingsBtn
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -82,8 +68,6 @@ ColumnLayout {
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
advancedSettingsView.visible = !advancedSettingsView.visible
|
advancedSettingsView.visible = !advancedSettingsView.visible
|
||||||
if(advancedSettingsView.visible)
|
|
||||||
updateAdvancedAccountInfos()
|
|
||||||
showAdvancedSettingsRequest()
|
showAdvancedSettingsRequest()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,10 +31,6 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateVoiceMailSettingsInfos() {
|
|
||||||
lineEditVoiceMailDialCode.textField = SettingsAdapter.getAccountConfig_Mailbox()
|
|
||||||
}
|
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
@ -50,9 +46,12 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
titleField: JamiStrings.voiceMailDialCode
|
titleField: JamiStrings.voiceMailDialCode
|
||||||
|
|
||||||
onEditFinished: SettingsAdapter.lineEditVoiceMailDialCodeEditFinished(textField)
|
textField: CurrentAccount.mailbox
|
||||||
|
|
||||||
|
onEditFinished: CurrentAccount.mailbox = textField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,13 +39,14 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
function populateAudioSettings() {
|
function populateAudioSettings() {
|
||||||
inputComboBoxSetting.setCurrentIndex(inputComboBoxSetting.comboModel.getCurrentIndex())
|
inputComboBoxSetting.modelIndex = inputComboBoxSetting.comboModel.getCurrentIndex()
|
||||||
outputComboBoxSetting.setCurrentIndex(outputComboBoxSetting.comboModel.getCurrentIndex())
|
outputComboBoxSetting.modelIndex = outputComboBoxSetting.comboModel.getCurrentIndex()
|
||||||
ringtoneComboBoxSetting.setCurrentIndex(outputComboBoxSetting.comboModel.getCurrentIndex())
|
ringtoneComboBoxSetting.modelIndex = outputComboBoxSetting.comboModel.getCurrentIndex()
|
||||||
if(audioManagerComboBoxSetting.comboModel.rowCount() > 0) {
|
if(audioManagerComboBoxSetting.comboModel.rowCount() > 0) {
|
||||||
audioManagerComboBoxSetting.setCurrentIndex(audioManagerComboBoxSetting.comboModel.getCurrentSettingIndex())
|
audioManagerComboBoxSetting.modelIndex =
|
||||||
|
audioManagerComboBoxSetting.comboModel.getCurrentSettingIndex()
|
||||||
}
|
}
|
||||||
audioManagerComboBoxSetting.visible = (audioManagerComboBoxSetting.comboModel.rowCount() > 0)
|
audioManagerComboBoxSetting.visible = audioManagerComboBoxSetting.comboModel.rowCount() > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
|
@ -74,7 +75,7 @@ ColumnLayout {
|
||||||
tipText: JamiStrings.selectAudioInputDevice
|
tipText: JamiStrings.selectAudioInputDevice
|
||||||
role: "DeviceName"
|
role: "DeviceName"
|
||||||
|
|
||||||
onIndexChanged: {
|
onModelIndexChanged: {
|
||||||
AvAdapter.stopAudioMeter()
|
AvAdapter.stopAudioMeter()
|
||||||
AVModel.setInputDevice(comboModel.data(
|
AVModel.setInputDevice(comboModel.data(
|
||||||
comboModel.index(modelIndex, 0),
|
comboModel.index(modelIndex, 0),
|
||||||
|
@ -113,7 +114,7 @@ ColumnLayout {
|
||||||
tipText: JamiStrings.selectAudioOutputDevice
|
tipText: JamiStrings.selectAudioOutputDevice
|
||||||
role: "DeviceName"
|
role: "DeviceName"
|
||||||
|
|
||||||
onIndexChanged: {
|
onModelIndexChanged: {
|
||||||
AvAdapter.stopAudioMeter()
|
AvAdapter.stopAudioMeter()
|
||||||
AVModel.setOutputDevice(comboModel.data(
|
AVModel.setOutputDevice(comboModel.data(
|
||||||
comboModel.index(modelIndex, 0),
|
comboModel.index(modelIndex, 0),
|
||||||
|
@ -139,7 +140,7 @@ ColumnLayout {
|
||||||
tipText: JamiStrings.selectRingtoneOutputDevice
|
tipText: JamiStrings.selectRingtoneOutputDevice
|
||||||
role: "DeviceName"
|
role: "DeviceName"
|
||||||
|
|
||||||
onIndexChanged: {
|
onModelIndexChanged: {
|
||||||
AvAdapter.stopAudioMeter()
|
AvAdapter.stopAudioMeter()
|
||||||
AVModel.setRingtoneDevice(comboModel.data(
|
AVModel.setRingtoneDevice(comboModel.data(
|
||||||
comboModel.index(modelIndex, 0),
|
comboModel.index(modelIndex, 0),
|
||||||
|
@ -163,7 +164,7 @@ ColumnLayout {
|
||||||
widthOfComboBox: itemWidth
|
widthOfComboBox: itemWidth
|
||||||
role: "ID_UTF8"
|
role: "ID_UTF8"
|
||||||
|
|
||||||
onIndexChanged: {
|
onModelIndexChanged: {
|
||||||
AvAdapter.stopAudioMeter()
|
AvAdapter.stopAudioMeter()
|
||||||
var selectedAudioManager = comboModel.data(
|
var selectedAudioManager = comboModel.data(
|
||||||
comboModel.index(modelIndex, 0), AudioManagerListModel.AudioManagerID)
|
comboModel.index(modelIndex, 0), AudioManagerListModel.AudioManagerID)
|
||||||
|
|
|
@ -33,7 +33,7 @@ ColumnLayout {
|
||||||
visible: {
|
visible: {
|
||||||
if (bannedListWidget.model.rowCount() <= 0)
|
if (bannedListWidget.model.rowCount() <= 0)
|
||||||
return false
|
return false
|
||||||
return true && !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
|
return true && !isSIP && CurrentAccount.managerUri === ""
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
@ -68,10 +68,6 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function unban(index) {
|
|
||||||
SettingsAdapter.unbanContact(index)
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: bannedContactsBtn
|
id: bannedContactsBtn
|
||||||
|
|
||||||
|
@ -127,7 +123,7 @@ ColumnLayout {
|
||||||
btnToolTip: JamiStrings.reinstateContact
|
btnToolTip: JamiStrings.reinstateContact
|
||||||
|
|
||||||
onClicked: bannedListWidget.currentIndex = index
|
onClicked: bannedListWidget.currentIndex = index
|
||||||
onBtnContactClicked: unban(index)
|
onBtnContactClicked: MessagesAdapter.unbanContact(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,14 +50,14 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
checked: SettingsAdapter.getAppValue(Settings.EnableTypingIndicator)
|
checked: UtilsAdapter.getAppValue(Settings.EnableTypingIndicator)
|
||||||
|
|
||||||
labelText: JamiStrings.enableTypingIndicator
|
labelText: JamiStrings.enableTypingIndicator
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
tooltipText: JamiStrings.enableTypingIndicator
|
tooltipText: JamiStrings.enableTypingIndicator
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.setAppValue(Settings.Key.EnableTypingIndicator, checked)
|
onSwitchToggled: UtilsAdapter.setAppValue(Settings.Key.EnableTypingIndicator, checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -66,7 +66,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
checked: SettingsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews)
|
checked: UtilsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews)
|
||||||
|
|
||||||
labelText: JamiStrings.displayHyperlinkPreviews
|
labelText: JamiStrings.displayHyperlinkPreviews
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
@ -74,7 +74,7 @@ ColumnLayout {
|
||||||
tooltipText: JamiStrings.displayHyperlinkPreviews
|
tooltipText: JamiStrings.displayHyperlinkPreviews
|
||||||
|
|
||||||
onSwitchToggled: {
|
onSwitchToggled: {
|
||||||
SettingsAdapter.setAppValue(Settings.Key.DisplayHyperlinkPreviews, checked)
|
UtilsAdapter.setAppValue(Settings.Key.DisplayHyperlinkPreviews, checked)
|
||||||
MessagesAdapter.setDisplayLinks()
|
MessagesAdapter.setDisplayLinks()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,14 +41,7 @@ Rectangle {
|
||||||
signal advancedSettingsToggled(bool settingsVisible)
|
signal advancedSettingsToggled(bool settingsVisible)
|
||||||
|
|
||||||
function updateAccountInfoDisplayed() {
|
function updateAccountInfoDisplayed() {
|
||||||
accountEnableCheckBox.checked = SettingsAdapter.get_CurrentAccountInfo_Enabled()
|
|
||||||
accountProfile.updateAccountInfo()
|
|
||||||
userIdentity.updateAccountInfo()
|
|
||||||
bannedContacts.updateAndShowBannedContactsSlot()
|
bannedContacts.updateAndShowBannedContactsSlot()
|
||||||
advancedSettings.updateAdvancedAccountInfos()
|
|
||||||
var isJams = !isSIP && SettingsAdapter.getAccountConfig_Manageruri() !== ""
|
|
||||||
passwdPushButton.visible = !isJams
|
|
||||||
btnExportAccount.visible = !isJams
|
|
||||||
setPasswordButtonText()
|
setPasswordButtonText()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +58,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function delAccountSlot() {
|
function delAccountSlot() {
|
||||||
deleteAccountDialog.openDialog()
|
deleteAccountDialog.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAdvancedSettingsScrollPosition() {
|
function getAdvancedSettingsScrollPosition() {
|
||||||
|
@ -176,8 +169,9 @@ Rectangle {
|
||||||
labelText: JamiStrings.enableAccount
|
labelText: JamiStrings.enableAccount
|
||||||
fontPointSize: JamiTheme.headerFontSize
|
fontPointSize: JamiTheme.headerFontSize
|
||||||
|
|
||||||
onSwitchToggled: AccountAdapter.model.setAccountEnabled(
|
checked: CurrentAccount.enabled
|
||||||
LRCInstance.currentAccountId, checked)
|
|
||||||
|
onSwitchToggled: CurrentAccount.enabled = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountProfile {
|
AccountProfile {
|
||||||
|
@ -204,7 +198,7 @@ Rectangle {
|
||||||
MaterialButton {
|
MaterialButton {
|
||||||
id: passwdPushButton
|
id: passwdPushButton
|
||||||
|
|
||||||
visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
|
visible: !isSIP && CurrentAccount.managerUri === ""
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.topMargin: JamiTheme.preferredMarginSize
|
Layout.topMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
|
@ -231,7 +225,7 @@ Rectangle {
|
||||||
MaterialButton {
|
MaterialButton {
|
||||||
id: btnExportAccount
|
id: btnExportAccount
|
||||||
|
|
||||||
visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
|
visible: !isSIP && CurrentAccount.managerUri === ""
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
preferredWidth: JamiTheme.preferredFieldWidth
|
preferredWidth: JamiTheme.preferredFieldWidth
|
||||||
|
|
|
@ -90,7 +90,7 @@ ItemDelegate {
|
||||||
backgroundColor: JamiTheme.editBackgroundColor
|
backgroundColor: JamiTheme.editBackgroundColor
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
SettingsAdapter.setDeviceName(editDeviceName.text)
|
AvAdapter.setDeviceName(editDeviceName.text)
|
||||||
editable = !editable
|
editable = !editable
|
||||||
}
|
}
|
||||||
onReadOnlyChanged: {
|
onReadOnlyChanged: {
|
||||||
|
|
|
@ -29,12 +29,6 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateValues() {
|
|
||||||
acceptTransferBelowSpinBox.valueField = SettingsAdapter.getAppValue(Settings.AcceptTransferBelow)
|
|
||||||
allowFromUntrustedCheckbox.checked = SettingsAdapter.getAppValue(Settings.AllowFromUntrusted)
|
|
||||||
autoAcceptFilesCheckbox.checked = SettingsAdapter.getAppValue(Settings.AutoAcceptFiles)
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
@ -52,14 +46,14 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
checked: SettingsAdapter.getAppValue(Settings.AllowFromUntrusted)
|
checked: CurrentAccount.autoTransferFromUntrusted
|
||||||
|
|
||||||
labelText: JamiStrings.allowFromUntrusted
|
labelText: JamiStrings.allowFromUntrusted
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
tooltipText: JamiStrings.allowFromUntrusted
|
tooltipText: JamiStrings.allowFromUntrusted
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.allowFromUntrusted(checked)
|
onSwitchToggled: CurrentAccount.autoTransferFromUntrusted = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -67,14 +61,14 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
checked: SettingsAdapter.getAppValue(Settings.AutoAcceptFiles)
|
checked: CurrentAccount.autoTransferFromTrusted
|
||||||
|
|
||||||
labelText: JamiStrings.autoAcceptFiles
|
labelText: JamiStrings.autoAcceptFiles
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
tooltipText: JamiStrings.autoAcceptFiles
|
tooltipText: JamiStrings.autoAcceptFiles
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.autoAcceptFiles(checked)
|
onSwitchToggled: CurrentAccount.autoTransferFromTrusted = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinBox {
|
SettingSpinBox {
|
||||||
|
@ -86,8 +80,10 @@ ColumnLayout {
|
||||||
tooltipText: JamiStrings.acceptTransferTooltip
|
tooltipText: JamiStrings.acceptTransferTooltip
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
bottomValue: 0
|
bottomValue: 0
|
||||||
topValue: 99999999
|
topValue: Number.MAX_VALUE
|
||||||
|
|
||||||
onNewValue: SettingsAdapter.acceptTransferBelow(valueField)
|
valueField: CurrentAccount.autoTransferSizeThreshold
|
||||||
|
|
||||||
|
onNewValue: CurrentAccount.autoTransferSizeThreshold = valueField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,6 @@ Rectangle {
|
||||||
|
|
||||||
color: JamiTheme.secondaryBackgroundColor
|
color: JamiTheme.secondaryBackgroundColor
|
||||||
|
|
||||||
function updateValues() {
|
|
||||||
fileTransferSettings.updateValues()
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: generalSettingsColumnLayout
|
id: generalSettingsColumnLayout
|
||||||
|
|
||||||
|
|
|
@ -30,27 +30,12 @@ ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
property bool registeredIdNeedsSet: false
|
|
||||||
|
|
||||||
function updateAccountInfo() {
|
|
||||||
currentRingIDText.text = SettingsAdapter.getCurrentAccount_Profile_Info_Uri()
|
|
||||||
registeredIdNeedsSet = (SettingsAdapter.get_CurrentAccountInfo_RegisteredName() === "")
|
|
||||||
|
|
||||||
if(!registeredIdNeedsSet) {
|
|
||||||
currentRegisteredID.text = SettingsAdapter.get_CurrentAccountInfo_RegisteredName()
|
|
||||||
} else {
|
|
||||||
currentRegisteredID.text = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NameRegistrationDialog {
|
NameRegistrationDialog {
|
||||||
id : nameRegistrationDialog
|
id : nameRegistrationDialog
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: currentRegisteredID.nameRegistrationState =
|
||||||
registeredIdNeedsSet = false
|
|
||||||
currentRegisteredID.nameRegistrationState =
|
|
||||||
UsernameLineEdit.NameRegistrationState.BLANK
|
UsernameLineEdit.NameRegistrationState.BLANK
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Identity
|
// Identity
|
||||||
|
@ -106,7 +91,7 @@ ColumnLayout {
|
||||||
elideWidth: root.width - idLabel.width -
|
elideWidth: root.width - idLabel.width -
|
||||||
JamiTheme.preferredMarginSize * 4
|
JamiTheme.preferredMarginSize * 4
|
||||||
|
|
||||||
text: SettingsAdapter.getCurrentAccount_Profile_Info_Uri()
|
text: CurrentAccount.uri
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,21 +130,15 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
padding: 8
|
padding: 8
|
||||||
horizontalAlignment: registeredIdNeedsSet ?
|
horizontalAlignment: CurrentAccount.registeredName === "" ? Text.AlignLeft :
|
||||||
Text.AlignLeft :
|
Text.AlignRight
|
||||||
Text.AlignRight
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
wrapMode: Text.NoWrap
|
wrapMode: Text.NoWrap
|
||||||
placeholderText: registeredIdNeedsSet ?
|
placeholderText: CurrentAccount.registeredName === "" ?
|
||||||
JamiStrings.registerAUsername : ""
|
JamiStrings.registerAUsername : ""
|
||||||
text: {
|
text: CurrentAccount.registeredName
|
||||||
if (!registeredIdNeedsSet)
|
readOnly: CurrentAccount.registeredName !== ""
|
||||||
return SettingsAdapter.get_CurrentAccountInfo_RegisteredName()
|
font.bold: CurrentAccount.registeredName !== ""
|
||||||
else
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
readOnly: !registeredIdNeedsSet
|
|
||||||
font.bold: !registeredIdNeedsSet
|
|
||||||
loseFocusWhenEnterPressed: btnRegisterName.visible
|
loseFocusWhenEnterPressed: btnRegisterName.visible
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
@ -178,9 +157,9 @@ ColumnLayout {
|
||||||
preferredWidth: 120
|
preferredWidth: 120
|
||||||
preferredHeight: 30
|
preferredHeight: 30
|
||||||
|
|
||||||
visible: registeredIdNeedsSet &&
|
visible: CurrentAccount.registeredName === "" &&
|
||||||
currentRegisteredID.nameRegistrationState ===
|
currentRegisteredID.nameRegistrationState ===
|
||||||
UsernameLineEdit.NameRegistrationState.FREE
|
UsernameLineEdit.NameRegistrationState.FREE
|
||||||
|
|
||||||
text: JamiStrings.register
|
text: JamiStrings.register
|
||||||
toolTipText: JamiStrings.registerUsername
|
toolTipText: JamiStrings.registerUsername
|
||||||
|
|
|
@ -30,19 +30,6 @@ import "../../commoncomponents"
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id:root
|
id:root
|
||||||
|
|
||||||
Connections {
|
|
||||||
id: accountConnections
|
|
||||||
|
|
||||||
target: AccountAdapter
|
|
||||||
enabled: root.visible
|
|
||||||
|
|
||||||
function onAccountStatusChanged(id) {
|
|
||||||
if (SettingsAdapter.getAccountConfig_Manageruri() === ""){
|
|
||||||
linkDevPushButton.visible = SettingsAdapter.get_CurrentAccountInfo_Enabled()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeDeviceSlot(index){
|
function removeDeviceSlot(index){
|
||||||
var idOfDevice = settingsListView.model.data(settingsListView.model.index(index,0),
|
var idOfDevice = settingsListView.model.data(settingsListView.model.index(index,0),
|
||||||
DeviceItemListModel.DeviceID)
|
DeviceItemListModel.DeviceID)
|
||||||
|
@ -122,6 +109,8 @@ ColumnLayout {
|
||||||
|
|
||||||
preferredWidth: JamiTheme.preferredFieldWidth
|
preferredWidth: JamiTheme.preferredFieldWidth
|
||||||
|
|
||||||
|
visible: CurrentAccount.managerUri === "" && CurrentAccount.enabled
|
||||||
|
|
||||||
color: JamiTheme.buttonTintedBlack
|
color: JamiTheme.buttonTintedBlack
|
||||||
hoveredColor: JamiTheme.buttonTintedBlackHovered
|
hoveredColor: JamiTheme.buttonTintedBlackHovered
|
||||||
pressedColor: JamiTheme.buttonTintedBlackPressed
|
pressedColor: JamiTheme.buttonTintedBlackPressed
|
||||||
|
|
|
@ -43,38 +43,41 @@ Dialog {
|
||||||
property var lineSize: []
|
property var lineSize: []
|
||||||
property var lineCounter: 0
|
property var lineCounter: 0
|
||||||
|
|
||||||
|
|
||||||
function monitor(continuous) {
|
function monitor(continuous) {
|
||||||
SettingsAdapter.monitor(continuous)
|
UtilsAdapter.monitor(continuous)
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections{
|
Connections {
|
||||||
target: SettingsAdapter
|
target: UtilsAdapter
|
||||||
|
|
||||||
function onDebugMessageReceived(message) {
|
function onDebugMessageReceived(message) {
|
||||||
if (!root.visible) {
|
if (!root.visible) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
var initialPosition = scrollView.ScrollBar.vertical.position
|
var initialPosition = scrollView.ScrollBar.vertical.position
|
||||||
lineCounter += 1
|
lineCounter += 1
|
||||||
lineSize.push(message.length)
|
lineSize.push(message.length)
|
||||||
if (!root.cancelPressed) {
|
if (!root.cancelPressed) {
|
||||||
logsText.append(message);
|
logsText.append(message)
|
||||||
}
|
}
|
||||||
if (lineCounter >= 10000){
|
if (lineCounter >= 10000) {
|
||||||
lineCounter -= 1
|
lineCounter -= 1
|
||||||
logsText.remove(0, lineSize[0])
|
logsText.remove(0, lineSize[0])
|
||||||
lineSize.shift()
|
lineSize.shift()
|
||||||
}
|
}
|
||||||
scrollView.ScrollBar.vertical.position = initialPosition > (.8*(1.0 - scrollView.ScrollBar.vertical.size)) ? 1.0 - scrollView.ScrollBar.vertical.size : initialPosition
|
scrollView.ScrollBar.vertical.position = initialPosition
|
||||||
|
> (.8 * (1.0 - scrollView.ScrollBar.vertical.size)) ?
|
||||||
|
1.0 - scrollView.ScrollBar.vertical.size : initialPosition
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible && startStopToggle.checked) {
|
if (visible && startStopToggle.checked) {
|
||||||
if (hasOpened && lineCounter == 0) {
|
if (hasOpened && lineCounter == 0) {
|
||||||
logsText.append(SettingsAdapter.getLogs())
|
var logList = UtilsAdapter.logList
|
||||||
lineCounter = SettingsAdapter.getSizeOfLogs()
|
logsText.append(logList.join('\n'))
|
||||||
lineSize.push(SettingsAdapter.getFirstLogLength())
|
lineCounter = logList.length
|
||||||
|
lineSize.push(lineCounter ? logList[0].length : 0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logsText.clear()
|
logsText.clear()
|
||||||
|
@ -111,12 +114,12 @@ Dialog {
|
||||||
|
|
||||||
border.color: color
|
border.color: color
|
||||||
border.width: 0
|
border.width: 0
|
||||||
height: JamiTheme.preferredFieldHeight*2
|
height: JamiTheme.preferredFieldHeight * 2
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: buttons
|
id: buttons
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignTop| Qt.AlignHCenter
|
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -132,7 +135,7 @@ Dialog {
|
||||||
|
|
||||||
onSwitchToggled: {
|
onSwitchToggled: {
|
||||||
logging = !logging
|
logging = !logging
|
||||||
if (logging){
|
if (logging) {
|
||||||
isStopped = false
|
isStopped = false
|
||||||
root.cancelPressed = false
|
root.cancelPressed = false
|
||||||
monitor(true)
|
monitor(true)
|
||||||
|
@ -165,7 +168,7 @@ Dialog {
|
||||||
logging = false
|
logging = false
|
||||||
startStopToggle.checked = false
|
startStopToggle.checked = false
|
||||||
root.cancelPressed = true
|
root.cancelPressed = true
|
||||||
SettingsAdapter.clearLogs()
|
UtilsAdapter.logList = []
|
||||||
monitor(false)
|
monitor(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +188,7 @@ Dialog {
|
||||||
outlined: true
|
outlined: true
|
||||||
text: JamiStrings.logsViewCopy
|
text: JamiStrings.logsViewCopy
|
||||||
|
|
||||||
onClicked:{
|
onClicked: {
|
||||||
logsText.selectAll()
|
logsText.selectAll()
|
||||||
logsText.copy()
|
logsText.copy()
|
||||||
logsText.deselect()
|
logsText.deselect()
|
||||||
|
@ -196,11 +199,11 @@ Dialog {
|
||||||
id: copiedToolTip
|
id: copiedToolTip
|
||||||
|
|
||||||
height: JamiTheme.preferredFieldHeight
|
height: JamiTheme.preferredFieldHeight
|
||||||
TextArea{
|
TextArea {
|
||||||
text: JamiStrings.logsViewCopied
|
text: JamiStrings.logsViewCopied
|
||||||
color: JamiTheme.textColor
|
color: JamiTheme.textColor
|
||||||
}
|
}
|
||||||
background: Rectangle{
|
background: Rectangle {
|
||||||
color: JamiTheme.primaryBackgroundColor
|
color: JamiTheme.primaryBackgroundColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,7 +226,8 @@ Dialog {
|
||||||
text: JamiStrings.logsViewReport
|
text: JamiStrings.logsViewReport
|
||||||
outlined: true
|
outlined: true
|
||||||
|
|
||||||
onClicked: Qt.openUrlExternally("https://jami.net/bugs-and-improvements/")
|
onClicked: Qt.openUrlExternally(
|
||||||
|
"https://jami.net/bugs-and-improvements/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,20 +240,19 @@ Dialog {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
color: JamiTheme.primaryBackgroundColor
|
color: JamiTheme.primaryBackgroundColor
|
||||||
border.color: color
|
border.color: color
|
||||||
border.width: 6
|
border.width: 6
|
||||||
height: root.height - buttonRectangleBackground.height
|
height: root.height - buttonRectangleBackground.height
|
||||||
|
|
||||||
|
ScrollView {
|
||||||
ScrollView{
|
|
||||||
id: scrollView
|
id: scrollView
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
anchors.fill: flickableRectangleBackground
|
anchors.fill: flickableRectangleBackground
|
||||||
|
|
||||||
TextArea{
|
TextArea {
|
||||||
id: logsText
|
id: logsText
|
||||||
|
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
@ -286,7 +289,3 @@ Dialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,10 +43,7 @@ ColumnLayout {
|
||||||
var codecId = mediaListWidget.model.data(mediaListWidget.model.index(index,0),
|
var codecId = mediaListWidget.model.data(mediaListWidget.model.index(index,0),
|
||||||
MediaCodecListModel.MediaCodecID)
|
MediaCodecListModel.MediaCodecID)
|
||||||
|
|
||||||
if (mediaType === MediaSettings.VIDEO)
|
AvAdapter.decreaseCodecPriority(codecId, mediaType === MediaSettings.VIDEO)
|
||||||
SettingsAdapter.decreaseVideoCodecPriority(codecId)
|
|
||||||
else if (mediaType === MediaSettings.AUDIO)
|
|
||||||
SettingsAdapter.decreaseAudioCodecPriority(codecId)
|
|
||||||
mediaListWidget.currentIndex = index + 1
|
mediaListWidget.currentIndex = index + 1
|
||||||
updateCodecs()
|
updateCodecs()
|
||||||
}
|
}
|
||||||
|
@ -66,10 +63,7 @@ ColumnLayout {
|
||||||
var codecId = mediaListWidget.model.data(mediaListWidget.model.index(index,0),
|
var codecId = mediaListWidget.model.data(mediaListWidget.model.index(index,0),
|
||||||
MediaCodecListModel.MediaCodecID)
|
MediaCodecListModel.MediaCodecID)
|
||||||
|
|
||||||
if (mediaType === MediaSettings.VIDEO)
|
AvAdapter.increaseCodecPriority(codecId, mediaType === MediaSettings.VIDEO)
|
||||||
SettingsAdapter.increaseVideoCodecPriority(codecId)
|
|
||||||
else if (mediaType === MediaSettings.AUDIO)
|
|
||||||
SettingsAdapter.increaseAudioCodecPriority(codecId)
|
|
||||||
mediaListWidget.currentIndex = index - 1
|
mediaListWidget.currentIndex = index - 1
|
||||||
updateCodecs()
|
updateCodecs()
|
||||||
}
|
}
|
||||||
|
@ -86,9 +80,9 @@ ColumnLayout {
|
||||||
maxWidth: width
|
maxWidth: width
|
||||||
eText: {
|
eText: {
|
||||||
if (mediaType === MediaSettings.VIDEO)
|
if (mediaType === MediaSettings.VIDEO)
|
||||||
return "Video Codecs"
|
return JamiStrings.videoCodecs
|
||||||
else if (mediaType === MediaSettings.AUDIO)
|
else if (mediaType === MediaSettings.AUDIO)
|
||||||
return "Audio Codecs"
|
return JamiStrings.audioCodecs
|
||||||
}
|
}
|
||||||
fontSize: JamiTheme.settingsFontSize
|
fontSize: JamiTheme.settingsFontSize
|
||||||
}
|
}
|
||||||
|
@ -134,10 +128,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMediaCodecStateChange: {
|
onMediaCodecStateChange: {
|
||||||
if (mediaType === MediaSettings.VIDEO)
|
AvAdapter.enableCodec(idToSet, isToBeEnabled)
|
||||||
SettingsAdapter.videoCodecsStateChange(idToSet, isToBeEnabled)
|
|
||||||
if (mediaType === MediaSettings.AUDIO)
|
|
||||||
SettingsAdapter.audioCodecsStateChange(idToSet, isToBeEnabled)
|
|
||||||
updateCodecs()
|
updateCodecs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ ColumnLayout {
|
||||||
id:root
|
id:root
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
property string recordPath: SettingsAdapter.getDir_Document()
|
property string recordPath: UtilsAdapter.getDirDocument()
|
||||||
|
|
||||||
onRecordPathChanged: {
|
onRecordPathChanged: {
|
||||||
if(recordPath === "") return
|
if(recordPath === "") return
|
||||||
|
|
|
@ -30,22 +30,18 @@ ColumnLayout {
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updateAccountInfo() {
|
|
||||||
usernameSIP.textField = SettingsAdapter.getAccountConfig_Username()
|
|
||||||
hostnameSIP.textField = SettingsAdapter.getAccountConfig_Hostname()
|
|
||||||
passSIPlineEdit.textField = SettingsAdapter.getAccountConfig_Password()
|
|
||||||
proxySIP.textField = SettingsAdapter.getAccountConfig_RouteSet()
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
id: usernameSIP
|
id: usernameSIP
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
textField: CurrentAccount.username
|
||||||
|
|
||||||
titleField: JamiStrings.username
|
titleField: JamiStrings.username
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
onEditFinished: SettingsAdapter.setAccountConfig_Username(textField)
|
|
||||||
|
onEditFinished: CurrentAccount.username = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -54,9 +50,12 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
textField: CurrentAccount.hostname
|
||||||
|
|
||||||
titleField: JamiStrings.server
|
titleField: JamiStrings.server
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
onEditFinished: SettingsAdapter.setAccountConfig_Hostname(textField)
|
|
||||||
|
onEditFinished: CurrentAccount.hostname = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
|
@ -65,20 +64,27 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
|
textField: CurrentAccount.routeset
|
||||||
|
|
||||||
titleField: JamiStrings.proxy
|
titleField: JamiStrings.proxy
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
onEditFinished: SettingsAdapter.setAccountConfig_RouteSet(textField)
|
|
||||||
|
onEditFinished: CurrentAccount.routeset = textField
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsMaterialLineEdit {
|
SettingsMaterialLineEdit {
|
||||||
id: passSIPlineEdit
|
id: passSIPlineEdit
|
||||||
|
|
||||||
|
textField: CurrentAccount.password
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
||||||
titleField: JamiStrings.password
|
titleField: JamiStrings.password
|
||||||
|
|
||||||
itemWidth: root.itemWidth
|
itemWidth: root.itemWidth
|
||||||
onEditFinished: SettingsAdapter.setAccountConfig_Password(textField)
|
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
|
|
||||||
|
onEditFinished:nCurrentAccount.password = textField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ RowLayout {
|
||||||
property alias topValue: textFieldValidator.top
|
property alias topValue: textFieldValidator.top
|
||||||
property alias valueField: textField.text
|
property alias valueField: textField.text
|
||||||
property alias tooltipText: toolTip.text
|
property alias tooltipText: toolTip.text
|
||||||
|
property alias inputAcceptable: textField.acceptableInput
|
||||||
|
|
||||||
property string borderColor: JamiTheme.greyBorderColor
|
property string borderColor: JamiTheme.greyBorderColor
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
|
@ -33,19 +33,10 @@ RowLayout {
|
||||||
property alias placeholderText: comboBoxOfLayout.placeholderText
|
property alias placeholderText: comboBoxOfLayout.placeholderText
|
||||||
property alias enabled: comboBoxOfLayout.enabled
|
property alias enabled: comboBoxOfLayout.enabled
|
||||||
property alias fontPointSize: comboBoxOfLayout.font.pointSize
|
property alias fontPointSize: comboBoxOfLayout.font.pointSize
|
||||||
|
property alias modelIndex: comboBoxOfLayout.currentIndex
|
||||||
|
|
||||||
property int heightOfLayout: 30
|
property int heightOfLayout: 30
|
||||||
property int widthOfComboBox: 50
|
property int widthOfComboBox: 50
|
||||||
property int modelIndex
|
|
||||||
|
|
||||||
signal indexChanged
|
|
||||||
|
|
||||||
function setCurrentIndex(index, emitIndexChanged = false) {
|
|
||||||
comboBoxOfLayout.currentIndex = index
|
|
||||||
modelIndex = index
|
|
||||||
if (emitIndexChanged)
|
|
||||||
indexChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
id: label
|
id: label
|
||||||
|
@ -71,10 +62,5 @@ RowLayout {
|
||||||
|
|
||||||
textRole: role
|
textRole: role
|
||||||
tooltipText: tipText
|
tooltipText: tipText
|
||||||
|
|
||||||
onActivated: {
|
|
||||||
root.modelIndex = index
|
|
||||||
indexChanged()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,11 +32,11 @@ ColumnLayout {
|
||||||
id:root
|
id:root
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
property string downloadPath: SettingsAdapter.getDir_Download()
|
property string downloadPath: UtilsAdapter.getDirDownload()
|
||||||
|
|
||||||
onDownloadPathChanged: {
|
onDownloadPathChanged: {
|
||||||
if(downloadPath === "") return
|
if(downloadPath === "") return
|
||||||
SettingsAdapter.setDownloadPath(downloadPath)
|
UtilsAdapter.setDownloadPath(downloadPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
FolderDialog {
|
FolderDialog {
|
||||||
|
@ -68,7 +68,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
checked: SettingsAdapter.getAppValue(Settings.EnableDarkTheme)
|
checked: UtilsAdapter.getAppValue(Settings.EnableDarkTheme)
|
||||||
|
|
||||||
labelText: qsTr("Enable dark theme")
|
labelText: qsTr("Enable dark theme")
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
@ -77,7 +77,7 @@ ColumnLayout {
|
||||||
|
|
||||||
onSwitchToggled: {
|
onSwitchToggled: {
|
||||||
JamiTheme.setTheme(checked)
|
JamiTheme.setTheme(checked)
|
||||||
SettingsAdapter.setAppValue(Settings.Key.EnableDarkTheme, checked)
|
UtilsAdapter.setAppValue(Settings.Key.EnableDarkTheme, checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,26 +86,26 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
checked: SettingsAdapter.getAppValue(Settings.EnableNotifications)
|
checked: UtilsAdapter.getAppValue(Settings.EnableNotifications)
|
||||||
|
|
||||||
labelText: qsTr("Enable desktop notifications")
|
labelText: qsTr("Enable desktop notifications")
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
tooltipText: JamiStrings.enableNotifications
|
tooltipText: JamiStrings.enableNotifications
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.setAppValue(Settings.Key.EnableNotifications, checked)
|
onSwitchToggled: UtilsAdapter.setAppValue(Settings.Key.EnableNotifications, checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
id: closeOrMinCheckBox
|
id: closeOrMinCheckBox
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
checked: SettingsAdapter.getAppValue(Settings.MinimizeOnClose)
|
checked: UtilsAdapter.getAppValue(Settings.MinimizeOnClose)
|
||||||
|
|
||||||
labelText: JamiStrings.keepMinimized
|
labelText: JamiStrings.keepMinimized
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.setAppValue(Settings.Key.MinimizeOnClose, checked)
|
onSwitchToggled: UtilsAdapter.setAppValue(Settings.Key.MinimizeOnClose, checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
|
@ -120,7 +120,7 @@ ColumnLayout {
|
||||||
|
|
||||||
tooltipText: JamiStrings.tipRunStartup
|
tooltipText: JamiStrings.tipRunStartup
|
||||||
|
|
||||||
onSwitchToggled: SettingsAdapter.setRunOnStartUp(checked)
|
onSwitchToggled: UtilsAdapter.setRunOnStartUp(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
|
@ -26,15 +26,16 @@ import net.jami.Constants 1.1
|
||||||
|
|
||||||
import "../../commoncomponents"
|
import "../../commoncomponents"
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout {
|
||||||
id:root
|
id: root
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
LogsView{
|
LogsView {
|
||||||
id: logsView
|
id: logsView
|
||||||
}
|
}
|
||||||
|
|
||||||
Label{
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
text: JamiStrings.troubleshootTitle
|
text: JamiStrings.troubleshootTitle
|
||||||
|
@ -47,7 +48,9 @@ ColumnLayout{
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Text{
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
|
Text {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 30
|
Layout.preferredHeight: 30
|
||||||
Layout.rightMargin: JamiTheme.preferredMarginSize
|
Layout.rightMargin: JamiTheme.preferredMarginSize
|
||||||
|
@ -81,4 +84,3 @@ ColumnLayout{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,14 +50,14 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
checked: SettingsAdapter.getAppValue(Settings.Key.AutoUpdate)
|
checked: UtilsAdapter.getAppValue(Settings.Key.AutoUpdate)
|
||||||
|
|
||||||
labelText: JamiStrings.update
|
labelText: JamiStrings.update
|
||||||
tooltipText: JamiStrings.enableAutoUpdates
|
tooltipText: JamiStrings.enableAutoUpdates
|
||||||
fontPointSize: JamiTheme.settingsFontSize
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
onSwitchToggled: {
|
onSwitchToggled: {
|
||||||
SettingsAdapter.setAppValue(Settings.Key.AutoUpdate, checked)
|
UtilsAdapter.setAppValue(Settings.Key.AutoUpdate, checked)
|
||||||
UpdateManager.setAutoUpdateCheck(checked)
|
UpdateManager.setAutoUpdateCheck(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,6 @@ ColumnLayout {
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
property bool isSIP
|
property bool isSIP
|
||||||
|
|
||||||
function updateAccountInfo() {
|
|
||||||
if (!isSIP) {
|
|
||||||
jamiUserIdentity.updateAccountInfo()
|
|
||||||
} else {
|
|
||||||
sipUserIdentity.updateAccountInfo()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
|
|
@ -37,13 +37,19 @@ ColumnLayout {
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: AvAdapter
|
target: AvAdapter
|
||||||
enabled: root.visible
|
|
||||||
|
|
||||||
function onVideoDeviceListChanged() {
|
function onVideoDeviceListChanged() {
|
||||||
populateVideoSettings()
|
populateVideoSettings()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function startPreviewing(force = false) {
|
||||||
|
if (root.visible) {
|
||||||
|
AccountAdapter.startPreviewing(force)
|
||||||
|
previewAvailable = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function populateVideoSettings() {
|
function populateVideoSettings() {
|
||||||
deviceComboBoxSetting.comboModel.reset()
|
deviceComboBoxSetting.comboModel.reset()
|
||||||
|
|
||||||
|
@ -55,22 +61,26 @@ ColumnLayout {
|
||||||
fpsComboBoxSetting.enabled = count > 0
|
fpsComboBoxSetting.enabled = count > 0
|
||||||
|
|
||||||
if (count === 0) {
|
if (count === 0) {
|
||||||
resolutionComboBoxSetting.comboModel.reset()
|
resolutionComboBoxSetting.reset()
|
||||||
fpsComboBoxSetting.comboModel.reset()
|
fpsComboBoxSetting.reset()
|
||||||
} else {
|
} else {
|
||||||
deviceComboBoxSetting.setCurrentIndex(
|
deviceComboBoxSetting.modelIndex =
|
||||||
deviceComboBoxSetting.comboModel.getCurrentIndex(), true)
|
deviceComboBoxSetting.comboModel.getCurrentIndex()
|
||||||
}
|
}
|
||||||
hardwareAccelControl.checked = AVModel.getHardwareAcceleration()
|
hardwareAccelControl.checked = AVModel.getHardwareAcceleration()
|
||||||
}
|
}
|
||||||
|
|
||||||
function slotDeviceBoxCurrentIndexChanged(index) {
|
function slotDeviceBoxCurrentIndexChanged(index) {
|
||||||
if(deviceComboBoxSetting.comboModel.deviceCount() <= 0)
|
if (deviceComboBoxSetting.comboModel.deviceCount() <= 0)
|
||||||
return
|
return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var deviceId = deviceComboBoxSetting.comboModel.data(deviceComboBoxSetting.comboModel.index(index, 0), VideoInputDeviceModel.DeviceId)
|
var deviceId = deviceComboBoxSetting.comboModel.data(
|
||||||
var deviceName = deviceComboBoxSetting.comboModel.data(deviceComboBoxSetting.comboModel.index(index, 0), VideoInputDeviceModel.DeviceName)
|
deviceComboBoxSetting.comboModel.index(index, 0),
|
||||||
|
VideoInputDeviceModel.DeviceId)
|
||||||
|
var deviceName = deviceComboBoxSetting.comboModel.data(
|
||||||
|
deviceComboBoxSetting.comboModel.index(index, 0),
|
||||||
|
VideoInputDeviceModel.DeviceName)
|
||||||
if(deviceId.length === 0) {
|
if(deviceId.length === 0) {
|
||||||
console.warn("Couldn't find device: " + deviceName)
|
console.warn("Couldn't find device: " + deviceName)
|
||||||
return
|
return
|
||||||
|
@ -81,60 +91,10 @@ ColumnLayout {
|
||||||
AVModel.setDefaultDevice(deviceId)
|
AVModel.setDefaultDevice(deviceId)
|
||||||
}
|
}
|
||||||
|
|
||||||
setFormatListForCurrentDevice()
|
resolutionComboBoxSetting.reset()
|
||||||
startPreviewing()
|
|
||||||
} catch(err){ console.warn(err.message) }
|
} catch(err){ console.warn(err.message) }
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPreviewing(force = false) {
|
|
||||||
AccountAdapter.startPreviewing(force)
|
|
||||||
previewAvailable = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function setFormatListForCurrentDevice() {
|
|
||||||
var device = AVModel.getCurrentVideoCaptureDevice()
|
|
||||||
try {
|
|
||||||
if (SettingsAdapter.get_DeviceCapabilitiesSize(device) === 0)
|
|
||||||
return
|
|
||||||
|
|
||||||
resolutionComboBoxSetting.comboModel.reset()
|
|
||||||
resolutionComboBoxSetting.setCurrentIndex(
|
|
||||||
resolutionComboBoxSetting.comboModel.getCurrentSettingIndex(), true)
|
|
||||||
} catch(err) { console.warn("Exception: " + err.message) }
|
|
||||||
}
|
|
||||||
|
|
||||||
function slotFormatCurrentIndexChanged(index, isResolutionIndex) {
|
|
||||||
var resolution
|
|
||||||
var rate
|
|
||||||
if(isResolutionIndex) {
|
|
||||||
fpsComboBoxSetting.comboModel.reset()
|
|
||||||
resolution = resolutionComboBoxSetting.comboModel.data(
|
|
||||||
resolutionComboBoxSetting.comboModel.index(index, 0),
|
|
||||||
VideoFormatResolutionModel.Resolution)
|
|
||||||
fpsComboBoxSetting.comboModel.currentResolution = resolution
|
|
||||||
fpsComboBoxSetting.setCurrentIndex(
|
|
||||||
fpsComboBoxSetting.comboModel.getCurrentSettingIndex(), true)
|
|
||||||
rate = fpsComboBoxSetting.comboModel.data(
|
|
||||||
fpsComboBoxSetting.comboModel.index(0, 0),
|
|
||||||
VideoFormatFpsModel.FPS)
|
|
||||||
} else {
|
|
||||||
resolution = resolutionComboBoxSetting.comboModel.data(
|
|
||||||
resolutionComboBoxSetting.comboModel.index(
|
|
||||||
resolutionComboBoxSetting.modelIndex, 0),
|
|
||||||
VideoFormatResolutionModel.Resolution)
|
|
||||||
fpsComboBoxSetting.comboModel.currentResolution = resolution
|
|
||||||
rate = fpsComboBoxSetting.comboModel.data(
|
|
||||||
fpsComboBoxSetting.comboModel.index(index, 0),
|
|
||||||
VideoFormatFpsModel.FPS)
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
SettingsAdapter.set_Video_Settings_Rate_And_Resolution(
|
|
||||||
AVModel.getCurrentVideoCaptureDevice(),rate, resolution)
|
|
||||||
updatePreviewRatio(resolution)
|
|
||||||
} catch(error){ console.warn(error.message) }
|
|
||||||
}
|
|
||||||
|
|
||||||
function updatePreviewRatio(resolution) {
|
function updatePreviewRatio(resolution) {
|
||||||
var res = resolution.split("x")
|
var res = resolution.split("x")
|
||||||
var ratio = res[1] / res[0]
|
var ratio = res[1] / res[0]
|
||||||
|
@ -145,6 +105,11 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible)
|
||||||
|
startPreviewing(true)
|
||||||
|
}
|
||||||
|
|
||||||
ElidedTextLabel {
|
ElidedTextLabel {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
@ -170,9 +135,7 @@ ColumnLayout {
|
||||||
tipText: JamiStrings.selectVideoDevice
|
tipText: JamiStrings.selectVideoDevice
|
||||||
role: "DeviceName_UTF8"
|
role: "DeviceName_UTF8"
|
||||||
|
|
||||||
onIndexChanged: {
|
onModelIndexChanged: slotDeviceBoxCurrentIndexChanged(modelIndex)
|
||||||
slotDeviceBoxCurrentIndexChanged(modelIndex)
|
|
||||||
}
|
|
||||||
|
|
||||||
placeholderText: JamiStrings.noVideoDevice
|
placeholderText: JamiStrings.noVideoDevice
|
||||||
}
|
}
|
||||||
|
@ -180,6 +143,12 @@ ColumnLayout {
|
||||||
SettingsComboBox {
|
SettingsComboBox {
|
||||||
id: resolutionComboBoxSetting
|
id: resolutionComboBoxSetting
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
modelIndex = -1
|
||||||
|
comboModel.reset()
|
||||||
|
modelIndex = 0
|
||||||
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
@ -193,14 +162,34 @@ ColumnLayout {
|
||||||
tipText: JamiStrings.selectVideoResolution
|
tipText: JamiStrings.selectVideoResolution
|
||||||
role: "Resolution_UTF8"
|
role: "Resolution_UTF8"
|
||||||
|
|
||||||
onIndexChanged: {
|
modelIndex: -1
|
||||||
slotFormatCurrentIndexChanged(modelIndex, true)
|
|
||||||
|
onModelIndexChanged: {
|
||||||
|
if (modelIndex === -1)
|
||||||
|
return
|
||||||
|
var resolution = comboModel.data(comboModel.index(modelIndex, 0),
|
||||||
|
VideoFormatResolutionModel.Resolution)
|
||||||
|
fpsComboBoxSetting.comboModel.currentResolution = resolution
|
||||||
|
fpsComboBoxSetting.modelIndex = 0
|
||||||
|
|
||||||
|
var rate = fpsComboBoxSetting.comboModel.data(
|
||||||
|
fpsComboBoxSetting.comboModel.index(0, 0),
|
||||||
|
VideoFormatFpsModel.FPS)
|
||||||
|
|
||||||
|
AvAdapter.setCurrentVideoDeviceRateAndResolution(rate, resolution)
|
||||||
|
updatePreviewRatio(resolution)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsComboBox {
|
SettingsComboBox {
|
||||||
id: fpsComboBoxSetting
|
id: fpsComboBoxSetting
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
modelIndex = -1
|
||||||
|
comboModel.reset()
|
||||||
|
modelIndex = 0
|
||||||
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
@ -214,8 +203,20 @@ ColumnLayout {
|
||||||
tipText: JamiStrings.selectFPS
|
tipText: JamiStrings.selectFPS
|
||||||
role: "FPS_ToDisplay_UTF8"
|
role: "FPS_ToDisplay_UTF8"
|
||||||
|
|
||||||
onIndexChanged: {
|
modelIndex: -1
|
||||||
slotFormatCurrentIndexChanged(modelIndex, false)
|
|
||||||
|
onModelIndexChanged: {
|
||||||
|
if (modelIndex === -1)
|
||||||
|
return
|
||||||
|
var resolution = resolutionComboBoxSetting.comboModel.data(
|
||||||
|
resolutionComboBoxSetting.comboModel.index(
|
||||||
|
resolutionComboBoxSetting.modelIndex, 0),
|
||||||
|
VideoFormatResolutionModel.Resolution)
|
||||||
|
|
||||||
|
var rate = comboModel.data(comboModel.index(modelIndex, 0),
|
||||||
|
VideoFormatFpsModel.FPS)
|
||||||
|
|
||||||
|
AvAdapter.setCurrentVideoDeviceRateAndResolution(rate, resolution)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,15 +28,20 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include "api/pluginmodel.h"
|
#include "api/pluginmodel.h"
|
||||||
|
#include "api/datatransfermodel.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
UtilsAdapter::UtilsAdapter(SystemTray* systemTray, LRCInstance* instance, QObject* parent)
|
UtilsAdapter::UtilsAdapter(AppSettingsManager* settingsManager,
|
||||||
|
SystemTray* systemTray,
|
||||||
|
LRCInstance* instance,
|
||||||
|
QObject* parent)
|
||||||
: QmlAdapterBase(instance, parent)
|
: QmlAdapterBase(instance, parent)
|
||||||
, clipboard_(QApplication::clipboard())
|
, clipboard_(QApplication::clipboard())
|
||||||
, systemTray_(systemTray)
|
, systemTray_(systemTray)
|
||||||
|
, settingsManager_(settingsManager)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
const QString
|
const QString
|
||||||
|
@ -319,3 +324,78 @@ UtilsAdapter::setSystemTrayIconVisible(bool visible)
|
||||||
{
|
{
|
||||||
systemTray_->setVisible(visible);
|
systemTray_->setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariant
|
||||||
|
UtilsAdapter::getAppValue(const Settings::Key key)
|
||||||
|
{
|
||||||
|
return settingsManager_->getValue(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UtilsAdapter::setAppValue(const Settings::Key key, const QVariant& value)
|
||||||
|
{
|
||||||
|
settingsManager_->setValue(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
UtilsAdapter::getDirDocument()
|
||||||
|
{
|
||||||
|
return QDir::toNativeSeparators(
|
||||||
|
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
UtilsAdapter::getDirDownload()
|
||||||
|
{
|
||||||
|
QString downloadPath = QDir::toNativeSeparators(lrcInstance_->accountModel().downloadDirectory);
|
||||||
|
if (downloadPath.isEmpty()) {
|
||||||
|
downloadPath = lrc::api::DataTransferModel::createDefaultDirectory();
|
||||||
|
setDownloadPath(downloadPath);
|
||||||
|
lrcInstance_->accountModel().downloadDirectory = downloadPath;
|
||||||
|
}
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
int pos = downloadPath.lastIndexOf(QChar('\\'));
|
||||||
|
#else
|
||||||
|
int pos = downloadPath.lastIndexOf(QChar('/'));
|
||||||
|
#endif
|
||||||
|
if (pos == downloadPath.length() - 1)
|
||||||
|
downloadPath.truncate(pos);
|
||||||
|
return downloadPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UtilsAdapter::setRunOnStartUp(bool state)
|
||||||
|
{
|
||||||
|
if (Utils::CheckStartupLink(L"Jami")) {
|
||||||
|
if (!state) {
|
||||||
|
Utils::DeleteStartupLink(L"Jami");
|
||||||
|
}
|
||||||
|
} else if (state) {
|
||||||
|
Utils::CreateStartupLink(L"Jami");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UtilsAdapter::setDownloadPath(QString dir)
|
||||||
|
{
|
||||||
|
setAppValue(Settings::Key::DownloadPath, dir);
|
||||||
|
lrcInstance_->accountModel().downloadDirectory = dir + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UtilsAdapter::monitor(const bool& continuous)
|
||||||
|
{
|
||||||
|
disconnect(debugMessageReceivedConnection_);
|
||||||
|
if (continuous)
|
||||||
|
debugMessageReceivedConnection_
|
||||||
|
= QObject::connect(&lrcInstance_->behaviorController(),
|
||||||
|
&lrc::api::BehaviorController::debugMessageReceived,
|
||||||
|
[this](const QString& data) {
|
||||||
|
logList_.append(data);
|
||||||
|
if (logList_.size() >= LOGSLIMIT) {
|
||||||
|
logList_.removeFirst();
|
||||||
|
}
|
||||||
|
Q_EMIT debugMessageReceived(data);
|
||||||
|
});
|
||||||
|
lrcInstance_->monitor(continuous);
|
||||||
|
}
|
|
@ -26,15 +26,23 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "qmladapterbase.h"
|
#include "qmladapterbase.h"
|
||||||
|
#include "appsettingsmanager.h"
|
||||||
|
#include "qtutils.h"
|
||||||
|
|
||||||
class QClipboard;
|
class QClipboard;
|
||||||
class SystemTray;
|
class SystemTray;
|
||||||
|
|
||||||
|
#define LOGSLIMIT 10000
|
||||||
|
|
||||||
class UtilsAdapter final : public QmlAdapterBase
|
class UtilsAdapter final : public QmlAdapterBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
QML_PROPERTY(QStringList, logList)
|
||||||
public:
|
public:
|
||||||
explicit UtilsAdapter(SystemTray* systemTray, LRCInstance* instance, QObject* parent = nullptr);
|
explicit UtilsAdapter(AppSettingsManager* settingsManager,
|
||||||
|
SystemTray* systemTray,
|
||||||
|
LRCInstance* instance,
|
||||||
|
QObject* parent = nullptr);
|
||||||
~UtilsAdapter() = default;
|
~UtilsAdapter() = default;
|
||||||
|
|
||||||
void safeInit() override {}
|
void safeInit() override {}
|
||||||
|
@ -74,9 +82,22 @@ public:
|
||||||
Q_INVOKABLE bool isImage(const QString& fileExt);
|
Q_INVOKABLE bool isImage(const QString& fileExt);
|
||||||
Q_INVOKABLE QString humanFileSize(qint64 fileSize);
|
Q_INVOKABLE QString humanFileSize(qint64 fileSize);
|
||||||
Q_INVOKABLE void setSystemTrayIconVisible(bool visible);
|
Q_INVOKABLE void setSystemTrayIconVisible(bool visible);
|
||||||
|
Q_INVOKABLE QVariant getAppValue(const Settings::Key key);
|
||||||
|
Q_INVOKABLE void setAppValue(const Settings::Key key, const QVariant& value);
|
||||||
|
Q_INVOKABLE QString getDirDocument();
|
||||||
|
Q_INVOKABLE QString getDirDownload();
|
||||||
|
Q_INVOKABLE void setRunOnStartUp(bool state);
|
||||||
|
Q_INVOKABLE void setDownloadPath(QString dir);
|
||||||
|
Q_INVOKABLE void monitor(const bool& continuous);
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void debugMessageReceived(const QString& message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QClipboard* clipboard_;
|
QClipboard* clipboard_;
|
||||||
SystemTray* systemTray_;
|
SystemTray* systemTray_;
|
||||||
|
AppSettingsManager* settingsManager_;
|
||||||
|
|
||||||
|
QMetaObject::Connection debugMessageReceivedConnection_;
|
||||||
};
|
};
|
||||||
Q_DECLARE_METATYPE(UtilsAdapter*)
|
Q_DECLARE_METATYPE(UtilsAdapter*)
|
||||||
|
|
|
@ -290,7 +290,7 @@ WizardView {
|
||||||
compare(spyCloseWizardView.count, 1)
|
compare(spyCloseWizardView.count, 1)
|
||||||
|
|
||||||
// Check alias text
|
// Check alias text
|
||||||
compare(SettingsAdapter.getCurrentAccount_Profile_Info_Alias(), aliasText)
|
compare(CurrentAccount.alias, aliasText)
|
||||||
|
|
||||||
spyAccountStatusChanged.clear()
|
spyAccountStatusChanged.clear()
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ WizardView {
|
||||||
compare(spyAccountConfigFinalized.count, 1)
|
compare(spyAccountConfigFinalized.count, 1)
|
||||||
|
|
||||||
// Check if it is a RendezVous acc
|
// Check if it is a RendezVous acc
|
||||||
compare(SettingsAdapter.getAccountConfig_RendezVous(), true)
|
compare(CurrentAccount.isRendezVous, true)
|
||||||
|
|
||||||
aliasEdit.text = aliasText
|
aliasEdit.text = aliasText
|
||||||
saveProfileBtn.clicked()
|
saveProfileBtn.clicked()
|
||||||
|
@ -384,7 +384,7 @@ WizardView {
|
||||||
compare(spyCloseWizardView.count, 1)
|
compare(spyCloseWizardView.count, 1)
|
||||||
|
|
||||||
// Check alias text
|
// Check alias text
|
||||||
compare(SettingsAdapter.getCurrentAccount_Profile_Info_Alias(), aliasText)
|
compare(CurrentAccount.alias, aliasText)
|
||||||
|
|
||||||
spyAccountStatusChanged.clear()
|
spyAccountStatusChanged.clear()
|
||||||
|
|
||||||
|
@ -459,10 +459,10 @@ WizardView {
|
||||||
compare(spyAccountConfigFinalized.count, 1)
|
compare(spyAccountConfigFinalized.count, 1)
|
||||||
|
|
||||||
// Check if paras match with setup
|
// Check if paras match with setup
|
||||||
compare(SettingsAdapter.getAccountConfig_RouteSet(), proxy)
|
compare(CurrentAccount.routeset, proxy)
|
||||||
compare(SettingsAdapter.getAccountConfig_Username(), userName)
|
compare(CurrentAccount.username, userName)
|
||||||
compare(SettingsAdapter.getAccountConfig_Hostname(), serverName)
|
compare(CurrentAccount.hostname, serverName)
|
||||||
compare(SettingsAdapter.getAccountConfig_Password(), password)
|
compare(CurrentAccount.password, password)
|
||||||
|
|
||||||
WizardViewStepModel.nextStep()
|
WizardViewStepModel.nextStep()
|
||||||
|
|
||||||
|
@ -1530,7 +1530,7 @@ WizardView {
|
||||||
compare(spyCloseWizardView.count, 1)
|
compare(spyCloseWizardView.count, 1)
|
||||||
|
|
||||||
// Check alias text
|
// Check alias text
|
||||||
compare(SettingsAdapter.getCurrentAccount_Profile_Info_Alias(), aliasName)
|
compare(CurrentAccount.alias, aliasName)
|
||||||
|
|
||||||
AccountAdapter.deleteCurrentAccount()
|
AccountAdapter.deleteCurrentAccount()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue