From 0c31da57aff5f6044b485a76e9b38a68ec3bdc8e Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 27 Sep 2021 15:04:46 +0200 Subject: [PATCH] Add UI settings : allow to change text messages font and size --- linphone-app/assets/languages/da.ts | 15 + linphone-app/assets/languages/de.ts | 15 + linphone-app/assets/languages/en.ts | 15 + linphone-app/assets/languages/es.ts | 15 + linphone-app/assets/languages/fr_FR.ts | 15 + linphone-app/assets/languages/hu.ts | 15 + linphone-app/assets/languages/it.ts | 15 + linphone-app/assets/languages/ja.ts | 15 + linphone-app/assets/languages/lt.ts | 15 + linphone-app/assets/languages/pt_BR.ts | 15 + linphone-app/assets/languages/ru.ts | 15 + linphone-app/assets/languages/sv.ts | 15 + linphone-app/assets/languages/tr.ts | 15 + linphone-app/assets/languages/uk.ts | 15 + linphone-app/assets/languages/zh_CN.ts | 15 + linphone-app/src/app/App.hpp | 16 +- .../src/components/settings/SettingsModel.cpp | 22 + .../src/components/settings/SettingsModel.hpp | 605 +++++++++--------- .../modules/Linphone/Chat/IncomingMessage.qml | 1 - .../ui/modules/Linphone/Chat/Message.qml | 3 + .../modules/Linphone/Chat/OutgoingMessage.qml | 1 - .../Linphone/Styles/Chat/ChatStyle.qml | 2 - .../ui/views/App/Settings/SettingsUi.qml | 342 +++++----- 23 files changed, 761 insertions(+), 456 deletions(-) diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts index f720f9998..ce999be5a 100644 --- a/linphone-app/assets/languages/da.ts +++ b/linphone-app/assets/languages/da.ts @@ -2362,6 +2362,21 @@ Klik her: <a href="%1">%1</a> autoStartLabel Autostart applikation + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts index b7da5fe33..4803bf08b 100644 --- a/linphone-app/assets/languages/de.ts +++ b/linphone-app/assets/languages/de.ts @@ -2362,6 +2362,21 @@ Klicken Sie hier: <a href="%1">%1</a> autoStartLabel Anwendung automatisch starten + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index 80db01ea3..1b9b70610 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -2385,6 +2385,21 @@ Click here: <a href="%1">%1</a> autoStartLabel Autostart app + + fontsTitle + 'Fonts' : title of fonts section in settings + Fonts + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + Text Messages + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + Select a new font + SettingsVideo diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts index aed2e928c..4a53677b3 100644 --- a/linphone-app/assets/languages/es.ts +++ b/linphone-app/assets/languages/es.ts @@ -2362,6 +2362,21 @@ Haga clic aquí: <a href="%1">%1 </a> autoStartLabel Auto-iniciar aplicación + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts index 728bbf292..3f8dd0c6c 100644 --- a/linphone-app/assets/languages/fr_FR.ts +++ b/linphone-app/assets/languages/fr_FR.ts @@ -2362,6 +2362,21 @@ Cliquez ici : <a href="%1">%1</a> autoStartLabel Démarrer auto. l'app + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts index ffa402b05..5069f85be 100644 --- a/linphone-app/assets/languages/hu.ts +++ b/linphone-app/assets/languages/hu.ts @@ -2356,6 +2356,21 @@ Kattintson ide: <a href="%1">%1</a> autoStartLabel Alkalmazás önműködő indítása + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts index 75ba56915..968fd799d 100644 --- a/linphone-app/assets/languages/it.ts +++ b/linphone-app/assets/languages/it.ts @@ -2362,6 +2362,21 @@ Clicca: <a href="%1">%1</a> autoStartLabel Autoavvio dell'app + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts index 6b0223f15..4176a0b13 100644 --- a/linphone-app/assets/languages/ja.ts +++ b/linphone-app/assets/languages/ja.ts @@ -2352,6 +2352,21 @@ Ephemeral message is only supported in conference based chat room!'autoStartLabel アプリの自動起動 + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts index f53287cf3..38bc5969e 100644 --- a/linphone-app/assets/languages/lt.ts +++ b/linphone-app/assets/languages/lt.ts @@ -2372,6 +2372,21 @@ Spustelėkite čia: <a href="%1">%1</a> autoStartLabel Automatinio paleidimo programa + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts index 58eccf57e..6c5699db5 100644 --- a/linphone-app/assets/languages/pt_BR.ts +++ b/linphone-app/assets/languages/pt_BR.ts @@ -2362,6 +2362,21 @@ Clique aqui: <a href="%1">%1 </a> autoStartLabel Aplicação Autostart + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts index f6136bea0..84a421e6e 100644 --- a/linphone-app/assets/languages/ru.ts +++ b/linphone-app/assets/languages/ru.ts @@ -2372,6 +2372,21 @@ Ephemeral message is only supported in conference based chat room!'autoStartLabel Автозапуск + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts index 74c291b3e..cd823d1fd 100644 --- a/linphone-app/assets/languages/sv.ts +++ b/linphone-app/assets/languages/sv.ts @@ -2362,6 +2362,21 @@ Klicka här: <a href="%1">%1</a> autoStartLabel Autostarta appen + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts index 13841a920..2c55d478b 100644 --- a/linphone-app/assets/languages/tr.ts +++ b/linphone-app/assets/languages/tr.ts @@ -2352,6 +2352,21 @@ Buraya tıklayın: <a href="%1">%1</a> autoStartLabel Uygulamayı kendiliğinden başlat + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts index 364364e23..d738ca51d 100644 --- a/linphone-app/assets/languages/uk.ts +++ b/linphone-app/assets/languages/uk.ts @@ -2372,6 +2372,21 @@ Ephemeral message is only supported in conference based chat room!'autoStartLabel Самозапуск + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts index b9d92c1d5..f099fffbd 100644 --- a/linphone-app/assets/languages/zh_CN.ts +++ b/linphone-app/assets/languages/zh_CN.ts @@ -2352,6 +2352,21 @@ Ephemeral message is only supported in conference based chat room!'autoStartLabel 自动启动应用程序 + + fontsTitle + 'Fonts' : title of fonts section in settings + + + + fontsTextChange + 'Text Messages' : Label for changing text message fonts + + + + fontsPopupTitle + 'Select a new font' : Popup title for choosing new fonts + + SettingsVideo diff --git a/linphone-app/src/app/App.hpp b/linphone-app/src/app/App.hpp index 2383e99d6..b195f580f 100644 --- a/linphone-app/src/app/App.hpp +++ b/linphone-app/src/app/App.hpp @@ -43,14 +43,14 @@ class Notifier; class App : public SingleApplication { - Q_OBJECT; + Q_OBJECT - Q_PROPERTY(QString configLocale READ getConfigLocale WRITE setConfigLocale NOTIFY configLocaleChanged); - Q_PROPERTY(QString locale READ getLocale CONSTANT); - Q_PROPERTY(QVariantList availableLocales READ getAvailableLocales CONSTANT); - Q_PROPERTY(QString qtVersion READ getQtVersion CONSTANT); + Q_PROPERTY(QString configLocale READ getConfigLocale WRITE setConfigLocale NOTIFY configLocaleChanged) + Q_PROPERTY(QString locale READ getLocale CONSTANT) + Q_PROPERTY(QVariantList availableLocales READ getAvailableLocales CONSTANT) + Q_PROPERTY(QString qtVersion READ getQtVersion CONSTANT) - Q_PROPERTY(bool autoStart READ getAutoStart WRITE setAutoStart NOTIFY autoStartChanged); + Q_PROPERTY(bool autoStart READ getAutoStart WRITE setAutoStart NOTIFY autoStartChanged) public: App (int &argc, char *argv[]); @@ -113,7 +113,7 @@ public: Q_INVOKABLE QQuickWindow *getSettingsWindow () const; Q_INVOKABLE static void smartShowWindow (QQuickWindow *window); - + public slots: void stateChanged(Qt::ApplicationState); @@ -123,7 +123,7 @@ signals: void autoStartChanged (bool enabled); void opened (bool status); - + private: void createParser (); diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 194973a65..4b607fef5 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -26,6 +26,7 @@ #include #include +#include "app/App.hpp" #include "app/logger/Logger.hpp" #include "app/paths/Paths.hpp" #include "components/core/CoreManager.hpp" @@ -1132,6 +1133,27 @@ void SettingsModel::configureRlsUri (const shared_ptrgetString(UiSection, "text_message_font", Utils::appStringToCoreString(App::getInstance()->font().family()))); + int pointSize = getTextMessageFontSize(); + return QFont(family,pointSize); +} + +void SettingsModel::setTextMessageFont(const QFont& font){ + mConfig->setString(UiSection, "text_message_font", Utils::appStringToCoreString(font.family())); + setTextMessageFontSize(font.pointSize()); + emit textMessageFontChanged(font); +} + +int SettingsModel::getTextMessageFontSize() const{ + return mConfig->getInt(UiSection, "text_message_font_size", 10); +} + +void SettingsModel::setTextMessageFontSize(const int& size){ + mConfig->setInt(UiSection, "text_message_font_size", size); + emit textMessageFontSizeChanged(size); +} + QString SettingsModel::getSavedScreenshotsFolder () const { return QDir::cleanPath( Utils::coreStringToAppString( diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index c115cc6f4..43fa5b192 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "components/core/CoreHandlers.hpp" #include "components/contacts/ContactsImporterModel.hpp" @@ -32,295 +33,298 @@ // ============================================================================= class SettingsModel : public QObject { - Q_OBJECT - + Q_OBJECT + // =========================================================================== // PROPERTIES. // =========================================================================== - + // Assistant. ---------------------------------------------------------------- - - Q_PROPERTY(bool createAppSipAccountEnabled READ getCreateAppSipAccountEnabled WRITE setCreateAppSipAccountEnabled NOTIFY createAppSipAccountEnabledChanged) - Q_PROPERTY(bool fetchRemoteConfigurationEnabled READ getFetchRemoteConfigurationEnabled WRITE setFetchRemoteConfigurationEnabled NOTIFY fetchRemoteConfigurationEnabledChanged) - Q_PROPERTY(bool useAppSipAccountEnabled READ getUseAppSipAccountEnabled WRITE setUseAppSipAccountEnabled NOTIFY useAppSipAccountEnabledChanged) - Q_PROPERTY(bool useOtherSipAccountEnabled READ getUseOtherSipAccountEnabled WRITE setUseOtherSipAccountEnabled NOTIFY useOtherSipAccountEnabledChanged) - - Q_PROPERTY(bool assistantSupportsPhoneNumbers READ getAssistantSupportsPhoneNumbers WRITE setAssistantSupportsPhoneNumbers NOTIFY assistantSupportsPhoneNumbersChanged) - + + Q_PROPERTY(bool createAppSipAccountEnabled READ getCreateAppSipAccountEnabled WRITE setCreateAppSipAccountEnabled NOTIFY createAppSipAccountEnabledChanged) + Q_PROPERTY(bool fetchRemoteConfigurationEnabled READ getFetchRemoteConfigurationEnabled WRITE setFetchRemoteConfigurationEnabled NOTIFY fetchRemoteConfigurationEnabledChanged) + Q_PROPERTY(bool useAppSipAccountEnabled READ getUseAppSipAccountEnabled WRITE setUseAppSipAccountEnabled NOTIFY useAppSipAccountEnabledChanged) + Q_PROPERTY(bool useOtherSipAccountEnabled READ getUseOtherSipAccountEnabled WRITE setUseOtherSipAccountEnabled NOTIFY useOtherSipAccountEnabledChanged) + + Q_PROPERTY(bool assistantSupportsPhoneNumbers READ getAssistantSupportsPhoneNumbers WRITE setAssistantSupportsPhoneNumbers NOTIFY assistantSupportsPhoneNumbersChanged) + // Audio. -------------------------------------------------------------------- - - Q_PROPERTY(bool captureGraphRunning READ getCaptureGraphRunning NOTIFY captureGraphRunningChanged) - - Q_PROPERTY(QStringList captureDevices READ getCaptureDevices NOTIFY captureDevicesChanged) - Q_PROPERTY(QStringList playbackDevices READ getPlaybackDevices NOTIFY playbackDevicesChanged) - - Q_PROPERTY(float playbackGain READ getPlaybackGain WRITE setPlaybackGain NOTIFY playbackGainChanged) - Q_PROPERTY(float captureGain READ getCaptureGain WRITE setCaptureGain NOTIFY captureGainChanged) - - Q_PROPERTY(QString captureDevice READ getCaptureDevice WRITE setCaptureDevice NOTIFY captureDeviceChanged) - Q_PROPERTY(QString playbackDevice READ getPlaybackDevice WRITE setPlaybackDevice NOTIFY playbackDeviceChanged) - Q_PROPERTY(QString ringerDevice READ getRingerDevice WRITE setRingerDevice NOTIFY ringerDeviceChanged) - - Q_PROPERTY(QString ringPath READ getRingPath WRITE setRingPath NOTIFY ringPathChanged) - - Q_PROPERTY(bool echoCancellationEnabled READ getEchoCancellationEnabled WRITE setEchoCancellationEnabled NOTIFY echoCancellationEnabledChanged) - - Q_PROPERTY(bool showAudioCodecs READ getShowAudioCodecs WRITE setShowAudioCodecs NOTIFY showAudioCodecsChanged) - + + Q_PROPERTY(bool captureGraphRunning READ getCaptureGraphRunning NOTIFY captureGraphRunningChanged) + + Q_PROPERTY(QStringList captureDevices READ getCaptureDevices NOTIFY captureDevicesChanged) + Q_PROPERTY(QStringList playbackDevices READ getPlaybackDevices NOTIFY playbackDevicesChanged) + + Q_PROPERTY(float playbackGain READ getPlaybackGain WRITE setPlaybackGain NOTIFY playbackGainChanged) + Q_PROPERTY(float captureGain READ getCaptureGain WRITE setCaptureGain NOTIFY captureGainChanged) + + Q_PROPERTY(QString captureDevice READ getCaptureDevice WRITE setCaptureDevice NOTIFY captureDeviceChanged) + Q_PROPERTY(QString playbackDevice READ getPlaybackDevice WRITE setPlaybackDevice NOTIFY playbackDeviceChanged) + Q_PROPERTY(QString ringerDevice READ getRingerDevice WRITE setRingerDevice NOTIFY ringerDeviceChanged) + + Q_PROPERTY(QString ringPath READ getRingPath WRITE setRingPath NOTIFY ringPathChanged) + + Q_PROPERTY(bool echoCancellationEnabled READ getEchoCancellationEnabled WRITE setEchoCancellationEnabled NOTIFY echoCancellationEnabledChanged) + + Q_PROPERTY(bool showAudioCodecs READ getShowAudioCodecs WRITE setShowAudioCodecs NOTIFY showAudioCodecsChanged) + // Video. -------------------------------------------------------------------- - - Q_PROPERTY(QStringList videoDevices READ getVideoDevices NOTIFY videoDevicesChanged) - - Q_PROPERTY(QString videoDevice READ getVideoDevice WRITE setVideoDevice NOTIFY videoDeviceChanged) - - Q_PROPERTY(QString videoPreset READ getVideoPreset WRITE setVideoPreset NOTIFY videoPresetChanged) - Q_PROPERTY(int videoFramerate READ getVideoFramerate WRITE setVideoFramerate NOTIFY videoFramerateChanged) - - Q_PROPERTY(QVariantList supportedVideoDefinitions READ getSupportedVideoDefinitions CONSTANT) - - Q_PROPERTY(QVariantMap videoDefinition READ getVideoDefinition WRITE setVideoDefinition NOTIFY videoDefinitionChanged) - - Q_PROPERTY(bool videoSupported READ getVideoSupported CONSTANT) - - Q_PROPERTY(bool showVideoCodecs READ getShowVideoCodecs WRITE setShowVideoCodecs NOTIFY showVideoCodecsChanged) - + + Q_PROPERTY(QStringList videoDevices READ getVideoDevices NOTIFY videoDevicesChanged) + + Q_PROPERTY(QString videoDevice READ getVideoDevice WRITE setVideoDevice NOTIFY videoDeviceChanged) + + Q_PROPERTY(QString videoPreset READ getVideoPreset WRITE setVideoPreset NOTIFY videoPresetChanged) + Q_PROPERTY(int videoFramerate READ getVideoFramerate WRITE setVideoFramerate NOTIFY videoFramerateChanged) + + Q_PROPERTY(QVariantList supportedVideoDefinitions READ getSupportedVideoDefinitions CONSTANT) + + Q_PROPERTY(QVariantMap videoDefinition READ getVideoDefinition WRITE setVideoDefinition NOTIFY videoDefinitionChanged) + + Q_PROPERTY(bool videoSupported READ getVideoSupported CONSTANT) + + Q_PROPERTY(bool showVideoCodecs READ getShowVideoCodecs WRITE setShowVideoCodecs NOTIFY showVideoCodecsChanged) + // Chat & calls. ------------------------------------------------------------- - - Q_PROPERTY(bool autoAnswerStatus READ getAutoAnswerStatus WRITE setAutoAnswerStatus NOTIFY autoAnswerStatusChanged) - Q_PROPERTY(bool autoAnswerVideoStatus READ getAutoAnswerVideoStatus WRITE setAutoAnswerVideoStatus NOTIFY autoAnswerVideoStatusChanged) - Q_PROPERTY(int autoAnswerDelay READ getAutoAnswerDelay WRITE setAutoAnswerDelay NOTIFY autoAnswerDelayChanged) - - Q_PROPERTY(bool showTelKeypadAutomatically READ getShowTelKeypadAutomatically WRITE setShowTelKeypadAutomatically NOTIFY showTelKeypadAutomaticallyChanged) - - Q_PROPERTY(bool keepCallsWindowInBackground READ getKeepCallsWindowInBackground WRITE setKeepCallsWindowInBackground NOTIFY keepCallsWindowInBackgroundChanged) - - Q_PROPERTY(bool outgoingCallsEnabled READ getOutgoingCallsEnabled WRITE setOutgoingCallsEnabled NOTIFY outgoingCallsEnabledChanged) - - Q_PROPERTY(bool callRecorderEnabled READ getCallRecorderEnabled WRITE setCallRecorderEnabled NOTIFY callRecorderEnabledChanged) - Q_PROPERTY(bool automaticallyRecordCalls READ getAutomaticallyRecordCalls WRITE setAutomaticallyRecordCalls NOTIFY automaticallyRecordCallsChanged) - - Q_PROPERTY(bool callPauseEnabled READ getCallPauseEnabled WRITE setCallPauseEnabled NOTIFY callPauseEnabledChanged) - Q_PROPERTY(bool muteMicrophoneEnabled READ getMuteMicrophoneEnabled WRITE setMuteMicrophoneEnabled NOTIFY muteMicrophoneEnabledChanged) - - Q_PROPERTY(bool chatEnabled READ getChatEnabled WRITE setChatEnabled NOTIFY chatEnabledChanged) - Q_PROPERTY(bool hideEmptyChatRooms READ getHideEmptyChatRooms WRITE setHideEmptyChatRooms NOTIFY hideEmptyChatRoomsChanged) - - Q_PROPERTY(bool waitRegistrationForCall READ getWaitRegistrationForCall WRITE setWaitRegistrationForCall NOTIFY waitRegistrationForCallChanged)// Allow call only if the current proxy has been registered - - Q_PROPERTY(bool conferenceEnabled READ getConferenceEnabled WRITE setConferenceEnabled NOTIFY conferenceEnabledChanged) - - Q_PROPERTY(bool chatNotificationSoundEnabled READ getChatNotificationSoundEnabled WRITE setChatNotificationSoundEnabled NOTIFY chatNotificationSoundEnabledChanged) - Q_PROPERTY(QString chatNotificationSoundPath READ getChatNotificationSoundPath WRITE setChatNotificationSoundPath NOTIFY chatNotificationSoundPathChanged) - - Q_PROPERTY(QString fileTransferUrl READ getFileTransferUrl WRITE setFileTransferUrl NOTIFY fileTransferUrlChanged) - - Q_PROPERTY(bool limeIsSupported READ getLimeIsSupported CONSTANT) - Q_PROPERTY(QVariantList supportedMediaEncryptions READ getSupportedMediaEncryptions CONSTANT) - - Q_PROPERTY(MediaEncryption mediaEncryption READ getMediaEncryption WRITE setMediaEncryption NOTIFY mediaEncryptionChanged) - Q_PROPERTY(bool mediaEncryptionMandatory READ mandatoryMediaEncryptionEnabled WRITE enableMandatoryMediaEncryption NOTIFY mediaEncryptionChanged) - - Q_PROPERTY(bool limeState READ getLimeState WRITE setLimeState NOTIFY limeStateChanged) - - Q_PROPERTY(bool contactsEnabled READ getContactsEnabled WRITE setContactsEnabled NOTIFY contactsEnabledChanged) - + + Q_PROPERTY(bool autoAnswerStatus READ getAutoAnswerStatus WRITE setAutoAnswerStatus NOTIFY autoAnswerStatusChanged) + Q_PROPERTY(bool autoAnswerVideoStatus READ getAutoAnswerVideoStatus WRITE setAutoAnswerVideoStatus NOTIFY autoAnswerVideoStatusChanged) + Q_PROPERTY(int autoAnswerDelay READ getAutoAnswerDelay WRITE setAutoAnswerDelay NOTIFY autoAnswerDelayChanged) + + Q_PROPERTY(bool showTelKeypadAutomatically READ getShowTelKeypadAutomatically WRITE setShowTelKeypadAutomatically NOTIFY showTelKeypadAutomaticallyChanged) + + Q_PROPERTY(bool keepCallsWindowInBackground READ getKeepCallsWindowInBackground WRITE setKeepCallsWindowInBackground NOTIFY keepCallsWindowInBackgroundChanged) + + Q_PROPERTY(bool outgoingCallsEnabled READ getOutgoingCallsEnabled WRITE setOutgoingCallsEnabled NOTIFY outgoingCallsEnabledChanged) + + Q_PROPERTY(bool callRecorderEnabled READ getCallRecorderEnabled WRITE setCallRecorderEnabled NOTIFY callRecorderEnabledChanged) + Q_PROPERTY(bool automaticallyRecordCalls READ getAutomaticallyRecordCalls WRITE setAutomaticallyRecordCalls NOTIFY automaticallyRecordCallsChanged) + + Q_PROPERTY(bool callPauseEnabled READ getCallPauseEnabled WRITE setCallPauseEnabled NOTIFY callPauseEnabledChanged) + Q_PROPERTY(bool muteMicrophoneEnabled READ getMuteMicrophoneEnabled WRITE setMuteMicrophoneEnabled NOTIFY muteMicrophoneEnabledChanged) + + Q_PROPERTY(bool chatEnabled READ getChatEnabled WRITE setChatEnabled NOTIFY chatEnabledChanged) + Q_PROPERTY(bool hideEmptyChatRooms READ getHideEmptyChatRooms WRITE setHideEmptyChatRooms NOTIFY hideEmptyChatRoomsChanged) + + Q_PROPERTY(bool waitRegistrationForCall READ getWaitRegistrationForCall WRITE setWaitRegistrationForCall NOTIFY waitRegistrationForCallChanged)// Allow call only if the current proxy has been registered + + Q_PROPERTY(bool conferenceEnabled READ getConferenceEnabled WRITE setConferenceEnabled NOTIFY conferenceEnabledChanged) + + Q_PROPERTY(bool chatNotificationSoundEnabled READ getChatNotificationSoundEnabled WRITE setChatNotificationSoundEnabled NOTIFY chatNotificationSoundEnabledChanged) + Q_PROPERTY(QString chatNotificationSoundPath READ getChatNotificationSoundPath WRITE setChatNotificationSoundPath NOTIFY chatNotificationSoundPathChanged) + + Q_PROPERTY(QString fileTransferUrl READ getFileTransferUrl WRITE setFileTransferUrl NOTIFY fileTransferUrlChanged) + + Q_PROPERTY(bool limeIsSupported READ getLimeIsSupported CONSTANT) + Q_PROPERTY(QVariantList supportedMediaEncryptions READ getSupportedMediaEncryptions CONSTANT) + + Q_PROPERTY(MediaEncryption mediaEncryption READ getMediaEncryption WRITE setMediaEncryption NOTIFY mediaEncryptionChanged) + Q_PROPERTY(bool mediaEncryptionMandatory READ mandatoryMediaEncryptionEnabled WRITE enableMandatoryMediaEncryption NOTIFY mediaEncryptionChanged) + + Q_PROPERTY(bool limeState READ getLimeState WRITE setLimeState NOTIFY limeStateChanged) + + Q_PROPERTY(bool contactsEnabled READ getContactsEnabled WRITE setContactsEnabled NOTIFY contactsEnabledChanged) + // Network. ------------------------------------------------------------------ - - Q_PROPERTY(bool showNetworkSettings READ getShowNetworkSettings WRITE setShowNetworkSettings NOTIFY showNetworkSettingsChanged) - - Q_PROPERTY(bool useSipInfoForDtmfs READ getUseSipInfoForDtmfs WRITE setUseSipInfoForDtmfs NOTIFY dtmfsProtocolChanged) - Q_PROPERTY(bool useRfc2833ForDtmfs READ getUseRfc2833ForDtmfs WRITE setUseRfc2833ForDtmfs NOTIFY dtmfsProtocolChanged) - - Q_PROPERTY(bool ipv6Enabled READ getIpv6Enabled WRITE setIpv6Enabled NOTIFY ipv6EnabledChanged) - - Q_PROPERTY(int downloadBandwidth READ getDownloadBandwidth WRITE setDownloadBandwidth NOTIFY downloadBandWidthChanged) - Q_PROPERTY(int uploadBandwidth READ getUploadBandwidth WRITE setUploadBandwidth NOTIFY uploadBandWidthChanged) - + + Q_PROPERTY(bool showNetworkSettings READ getShowNetworkSettings WRITE setShowNetworkSettings NOTIFY showNetworkSettingsChanged) + + Q_PROPERTY(bool useSipInfoForDtmfs READ getUseSipInfoForDtmfs WRITE setUseSipInfoForDtmfs NOTIFY dtmfsProtocolChanged) + Q_PROPERTY(bool useRfc2833ForDtmfs READ getUseRfc2833ForDtmfs WRITE setUseRfc2833ForDtmfs NOTIFY dtmfsProtocolChanged) + + Q_PROPERTY(bool ipv6Enabled READ getIpv6Enabled WRITE setIpv6Enabled NOTIFY ipv6EnabledChanged) + + Q_PROPERTY(int downloadBandwidth READ getDownloadBandwidth WRITE setDownloadBandwidth NOTIFY downloadBandWidthChanged) + Q_PROPERTY(int uploadBandwidth READ getUploadBandwidth WRITE setUploadBandwidth NOTIFY uploadBandWidthChanged) + Q_PROPERTY( - bool adaptiveRateControlEnabled - READ getAdaptiveRateControlEnabled - WRITE setAdaptiveRateControlEnabled - NOTIFY adaptiveRateControlEnabledChanged - ) - - Q_PROPERTY(int tcpPort READ getTcpPort WRITE setTcpPort NOTIFY tcpPortChanged) - Q_PROPERTY(int udpPort READ getUdpPort WRITE setUdpPort NOTIFY udpPortChanged) - - Q_PROPERTY(QList audioPortRange READ getAudioPortRange WRITE setAudioPortRange NOTIFY audioPortRangeChanged) - Q_PROPERTY(QList videoPortRange READ getVideoPortRange WRITE setVideoPortRange NOTIFY videoPortRangeChanged) - - Q_PROPERTY(bool iceEnabled READ getIceEnabled WRITE setIceEnabled NOTIFY iceEnabledChanged) - Q_PROPERTY(bool turnEnabled READ getTurnEnabled WRITE setTurnEnabled NOTIFY turnEnabledChanged) - - Q_PROPERTY(QString stunServer READ getStunServer WRITE setStunServer NOTIFY stunServerChanged) - - Q_PROPERTY(QString turnUser READ getTurnUser WRITE setTurnUser NOTIFY turnUserChanged) - Q_PROPERTY(QString turnPassword READ getTurnPassword WRITE setTurnPassword NOTIFY turnPasswordChanged) - - Q_PROPERTY(int dscpSip READ getDscpSip WRITE setDscpSip NOTIFY dscpSipChanged) - Q_PROPERTY(int dscpAudio READ getDscpAudio WRITE setDscpAudio NOTIFY dscpAudioChanged) - Q_PROPERTY(int dscpVideo READ getDscpVideo WRITE setDscpVideo NOTIFY dscpVideoChanged) - - Q_PROPERTY(bool rlsUriEnabled READ getRlsUriEnabled WRITE setRlsUriEnabled NOTIFY rlsUriEnabledChanged) - + bool adaptiveRateControlEnabled + READ getAdaptiveRateControlEnabled + WRITE setAdaptiveRateControlEnabled + NOTIFY adaptiveRateControlEnabledChanged + ) + + Q_PROPERTY(int tcpPort READ getTcpPort WRITE setTcpPort NOTIFY tcpPortChanged) + Q_PROPERTY(int udpPort READ getUdpPort WRITE setUdpPort NOTIFY udpPortChanged) + + Q_PROPERTY(QList audioPortRange READ getAudioPortRange WRITE setAudioPortRange NOTIFY audioPortRangeChanged) + Q_PROPERTY(QList videoPortRange READ getVideoPortRange WRITE setVideoPortRange NOTIFY videoPortRangeChanged) + + Q_PROPERTY(bool iceEnabled READ getIceEnabled WRITE setIceEnabled NOTIFY iceEnabledChanged) + Q_PROPERTY(bool turnEnabled READ getTurnEnabled WRITE setTurnEnabled NOTIFY turnEnabledChanged) + + Q_PROPERTY(QString stunServer READ getStunServer WRITE setStunServer NOTIFY stunServerChanged) + + Q_PROPERTY(QString turnUser READ getTurnUser WRITE setTurnUser NOTIFY turnUserChanged) + Q_PROPERTY(QString turnPassword READ getTurnPassword WRITE setTurnPassword NOTIFY turnPasswordChanged) + + Q_PROPERTY(int dscpSip READ getDscpSip WRITE setDscpSip NOTIFY dscpSipChanged) + Q_PROPERTY(int dscpAudio READ getDscpAudio WRITE setDscpAudio NOTIFY dscpAudioChanged) + Q_PROPERTY(int dscpVideo READ getDscpVideo WRITE setDscpVideo NOTIFY dscpVideoChanged) + + Q_PROPERTY(bool rlsUriEnabled READ getRlsUriEnabled WRITE setRlsUriEnabled NOTIFY rlsUriEnabledChanged) + // UI. ----------------------------------------------------------------------- - - Q_PROPERTY(QString remoteProvisioning READ getRemoteProvisioning WRITE setRemoteProvisioning NOTIFY remoteProvisioningChanged) - - Q_PROPERTY(QString savedScreenshotsFolder READ getSavedScreenshotsFolder WRITE setSavedScreenshotsFolder NOTIFY savedScreenshotsFolderChanged) - Q_PROPERTY(QString savedCallsFolder READ getSavedCallsFolder WRITE setSavedCallsFolder NOTIFY savedCallsFolderChanged) - Q_PROPERTY(QString downloadFolder READ getDownloadFolder WRITE setDownloadFolder NOTIFY downloadFolderChanged) - - Q_PROPERTY(bool exitOnClose READ getExitOnClose WRITE setExitOnClose NOTIFY exitOnCloseChanged) - + + Q_PROPERTY(QFont textMessageFont READ getTextMessageFont WRITE setTextMessageFont NOTIFY textMessageFontChanged) + Q_PROPERTY(int textMessageFontSize READ getTextMessageFontSize WRITE setTextMessageFontSize NOTIFY textMessageFontSizeChanged) + + Q_PROPERTY(QString remoteProvisioning READ getRemoteProvisioning WRITE setRemoteProvisioning NOTIFY remoteProvisioningChanged) + + Q_PROPERTY(QString savedScreenshotsFolder READ getSavedScreenshotsFolder WRITE setSavedScreenshotsFolder NOTIFY savedScreenshotsFolderChanged) + Q_PROPERTY(QString savedCallsFolder READ getSavedCallsFolder WRITE setSavedCallsFolder NOTIFY savedCallsFolderChanged) + Q_PROPERTY(QString downloadFolder READ getDownloadFolder WRITE setDownloadFolder NOTIFY downloadFolderChanged) + + Q_PROPERTY(bool exitOnClose READ getExitOnClose WRITE setExitOnClose NOTIFY exitOnCloseChanged) + Q_PROPERTY(bool showLocalSipAccount READ getShowLocalSipAccount CONSTANT) Q_PROPERTY(bool showStartChatButton READ getShowStartChatButton CONSTANT) Q_PROPERTY(bool showStartVideoCallButton READ getShowStartVideoCallButton CONSTANT) - + // Advanced. ----------------------------------------------------------------- - - Q_PROPERTY(QString logsFolder READ getLogsFolder WRITE setLogsFolder NOTIFY logsFolderChanged) - Q_PROPERTY(QString logsUploadUrl READ getLogsUploadUrl WRITE setLogsUploadUrl NOTIFY logsUploadUrlChanged) - Q_PROPERTY(bool logsEnabled READ getLogsEnabled WRITE setLogsEnabled NOTIFY logsEnabledChanged) - Q_PROPERTY(QString logsEmail READ getLogsEmail WRITE setLogsEmail NOTIFY logsEmailChanged) - - Q_PROPERTY(bool developerSettingsEnabled READ getDeveloperSettingsEnabled WRITE setDeveloperSettingsEnabled NOTIFY developerSettingsEnabledChanged) - - Q_PROPERTY(bool isInCall READ getIsInCall NOTIFY isInCallChanged) - + + Q_PROPERTY(QString logsFolder READ getLogsFolder WRITE setLogsFolder NOTIFY logsFolderChanged) + Q_PROPERTY(QString logsUploadUrl READ getLogsUploadUrl WRITE setLogsUploadUrl NOTIFY logsUploadUrlChanged) + Q_PROPERTY(bool logsEnabled READ getLogsEnabled WRITE setLogsEnabled NOTIFY logsEnabledChanged) + Q_PROPERTY(QString logsEmail READ getLogsEmail WRITE setLogsEmail NOTIFY logsEmailChanged) + + Q_PROPERTY(bool developerSettingsEnabled READ getDeveloperSettingsEnabled WRITE setDeveloperSettingsEnabled NOTIFY developerSettingsEnabledChanged) + + Q_PROPERTY(bool isInCall READ getIsInCall NOTIFY isInCallChanged) + public: enum MediaEncryption { - MediaEncryptionNone = int(linphone::MediaEncryption::None), - MediaEncryptionDtls = int(linphone::MediaEncryption::DTLS), - MediaEncryptionSrtp = int(linphone::MediaEncryption::SRTP), - MediaEncryptionZrtp = int(linphone::MediaEncryption::ZRTP) + MediaEncryptionNone = int(linphone::MediaEncryption::None), + MediaEncryptionDtls = int(linphone::MediaEncryption::DTLS), + MediaEncryptionSrtp = int(linphone::MediaEncryption::SRTP), + MediaEncryptionZrtp = int(linphone::MediaEncryption::ZRTP) }; - Q_ENUM(MediaEncryption) - - + Q_ENUM(MediaEncryption) + + SettingsModel (QObject *parent = Q_NULLPTR); - virtual ~SettingsModel (); - + virtual ~SettingsModel (); + // =========================================================================== // METHODS. // =========================================================================== - + Q_INVOKABLE void onSettingsTabChanged(int idx); Q_INVOKABLE void settingsWindowClosing(void); - + // Assistant. ---------------------------------------------------------------- - + bool getCreateAppSipAccountEnabled () const; void setCreateAppSipAccountEnabled (bool status); - + bool getFetchRemoteConfigurationEnabled () const; void setFetchRemoteConfigurationEnabled (bool status); - + bool getUseAppSipAccountEnabled () const; void setUseAppSipAccountEnabled (bool status); - + bool getUseOtherSipAccountEnabled () const; void setUseOtherSipAccountEnabled (bool status); - + bool getAssistantSupportsPhoneNumbers () const; void setAssistantSupportsPhoneNumbers (bool status); - + // Audio. -------------------------------------------------------------------- - + void createCaptureGraph(); bool getCaptureGraphRunning(); void accessAudioSettings(); void closeAudioSettings(); - + Q_INVOKABLE float getMicVolume(); - + float getPlaybackGain() const; void setPlaybackGain(float gain); - + float getCaptureGain() const; void setCaptureGain(float gain); - + QStringList getCaptureDevices () const; QStringList getPlaybackDevices () const; - + QString getCaptureDevice () const; void setCaptureDevice (const QString &device); - + QString getPlaybackDevice () const; void setPlaybackDevice (const QString &device); - + QString getRingerDevice () const; void setRingerDevice (const QString &device); - + QString getRingPath () const; void setRingPath (const QString &path); - + bool getEchoCancellationEnabled () const; void setEchoCancellationEnabled (bool status); - + Q_INVOKABLE void startEchoCancellerCalibration(); - + bool getShowAudioCodecs () const; void setShowAudioCodecs (bool status); - + // Video. -------------------------------------------------------------------- - + //Called from qml when accessing audio settings panel Q_INVOKABLE void accessVideoSettings(); - + QStringList getVideoDevices () const; - + QString getVideoDevice () const; void setVideoDevice (const QString &device); - + QString getVideoPreset () const; void setVideoPreset (const QString &preset); - + int getVideoFramerate () const; void setVideoFramerate (int framerate); - + QVariantList getSupportedVideoDefinitions () const; - + QVariantMap getVideoDefinition () const; void setVideoDefinition (const QVariantMap &definition); - + bool getVideoSupported () const; - + bool getShowVideoCodecs () const; void setShowVideoCodecs (bool status); - + // Chat & calls. ------------------------------------------------------------- - + bool getAutoAnswerStatus () const; void setAutoAnswerStatus (bool status); - + bool getAutoAnswerVideoStatus () const; void setAutoAnswerVideoStatus (bool status); - + int getAutoAnswerDelay () const; void setAutoAnswerDelay (int delay); - + bool getShowTelKeypadAutomatically () const; void setShowTelKeypadAutomatically (bool status); - + bool getKeepCallsWindowInBackground () const; void setKeepCallsWindowInBackground (bool status); - + bool getOutgoingCallsEnabled () const; void setOutgoingCallsEnabled (bool status); - + bool getCallRecorderEnabled () const; void setCallRecorderEnabled (bool status); - + bool getAutomaticallyRecordCalls () const; void setAutomaticallyRecordCalls (bool status); - + bool getCallPauseEnabled () const; void setCallPauseEnabled (bool status); - + bool getMuteMicrophoneEnabled () const; void setMuteMicrophoneEnabled (bool status); - + bool getChatEnabled () const; void setChatEnabled (bool status); @@ -329,298 +333,307 @@ public: bool getWaitRegistrationForCall() const; void setWaitRegistrationForCall(const bool& data); - + bool getConferenceEnabled () const; void setConferenceEnabled (bool status); - + bool getChatNotificationSoundEnabled () const; void setChatNotificationSoundEnabled (bool status); - + QString getChatNotificationSoundPath () const; void setChatNotificationSoundPath (const QString &path); - + QString getFileTransferUrl () const; void setFileTransferUrl (const QString &url); - + bool getLimeIsSupported () const; QVariantList getSupportedMediaEncryptions () const; - + MediaEncryption getMediaEncryption () const; void setMediaEncryption (MediaEncryption encryption); - + bool mandatoryMediaEncryptionEnabled () const; void enableMandatoryMediaEncryption(bool mandatory); - + bool getLimeState () const; void setLimeState (const bool& state); - + bool getContactsEnabled () const; void setContactsEnabled (bool status); - + // Network. ------------------------------------------------------------------ - + bool getShowNetworkSettings () const; void setShowNetworkSettings (bool status); - + bool getUseSipInfoForDtmfs () const; void setUseSipInfoForDtmfs (bool status); - + bool getUseRfc2833ForDtmfs () const; void setUseRfc2833ForDtmfs (bool status); - + bool getIpv6Enabled () const; void setIpv6Enabled (bool status); - + int getDownloadBandwidth () const; void setDownloadBandwidth (int bandwidth); - + int getUploadBandwidth () const; void setUploadBandwidth (int bandwidth); - + bool getAdaptiveRateControlEnabled () const; void setAdaptiveRateControlEnabled (bool status); - + int getTcpPort () const; void setTcpPort (int port); - + int getUdpPort () const; void setUdpPort (int port); - + QList getAudioPortRange () const; void setAudioPortRange (const QList &range); - + QList getVideoPortRange () const; void setVideoPortRange (const QList &range); - + bool getIceEnabled () const; void setIceEnabled (bool status); - + bool getTurnEnabled () const; void setTurnEnabled (bool status); - + QString getStunServer () const; void setStunServer (const QString &stunServer); - + QString getTurnUser () const; void setTurnUser (const QString &user); - + QString getTurnPassword () const; void setTurnPassword (const QString &password); - + int getDscpSip () const; void setDscpSip (int dscp); - + int getDscpAudio () const; void setDscpAudio (int dscp); - + int getDscpVideo () const; void setDscpVideo (int dscp); - + bool getRlsUriEnabled () const; void setRlsUriEnabled (bool status); - + void configureRlsUri (); void configureRlsUri (const std::shared_ptr &proxyConfig); - + // UI. ----------------------------------------------------------------------- - + + QFont getTextMessageFont() const; + void setTextMessageFont(const QFont& font); + + int getTextMessageFontSize() const; + void setTextMessageFontSize(const int& size); + QString getSavedScreenshotsFolder () const; void setSavedScreenshotsFolder (const QString &folder); - + QString getSavedCallsFolder () const; void setSavedCallsFolder (const QString &folder); - + QString getDownloadFolder () const; void setDownloadFolder (const QString &folder); - + QString getRemoteProvisioning () const; void setRemoteProvisioning (const QString &remoteProvisioning); - + bool getExitOnClose () const; void setExitOnClose (bool value); - + Q_INVOKABLE bool getShowLocalSipAccount () const; Q_INVOKABLE bool getShowStartChatButton () const; Q_INVOKABLE bool getShowStartVideoCallButton () const; - + // Advanced. --------------------------------------------------------------------------- void accessAdvancedSettings(); - + QString getLogsFolder () const; void setLogsFolder (const QString &folder); - + QString getLogsUploadUrl () const; void setLogsUploadUrl (const QString &url); - + bool getLogsEnabled () const; void setLogsEnabled (bool status); - + QString getLogsEmail () const; void setLogsEmail (const QString &email); - + // --------------------------------------------------------------------------- - + static QString getLogsFolder (const std::shared_ptr &config); static bool getLogsEnabled (const std::shared_ptr &config); - + // --------------------------------------------------------------------------- - + bool getDeveloperSettingsEnabled () const; void setDeveloperSettingsEnabled (bool status); - + void handleCallCreated(const std::shared_ptr &call); void handleCallStateChanged(const std::shared_ptr &call, linphone::Call::State state); void handleEcCalibrationResult(linphone::EcCalibratorStatus status, int delayMs); - + bool getIsInCall() const; - + static const std::string UiSection; static const std::string ContactsSection; - + // =========================================================================== // SIGNALS. // =========================================================================== - + signals: // Assistant. ---------------------------------------------------------------- - + void createAppSipAccountEnabledChanged (bool status); void fetchRemoteConfigurationEnabledChanged (bool status); void useAppSipAccountEnabledChanged (bool status); void useOtherSipAccountEnabledChanged (bool status); - + void assistantSupportsPhoneNumbersChanged (bool status); - + // Audio. -------------------------------------------------------------------- - + void captureGraphRunningChanged(bool running); - + void playbackGainChanged(float gain); void captureGainChanged(float gain); - + void captureDevicesChanged (const QStringList &devices); void playbackDevicesChanged (const QStringList &devices); - + void captureDeviceChanged (const QString &device); void playbackDeviceChanged (const QString &device); void ringerDeviceChanged (const QString &device); - + void ringPathChanged (const QString &path); - + void echoCancellationEnabledChanged (bool status); void echoCancellationStatus(int status, int msDelay); - + void showAudioCodecsChanged (bool status); - + // Video. -------------------------------------------------------------------- - + void videoDevicesChanged (const QStringList &devices); void videoDeviceChanged (const QString &device); - + void videoPresetChanged (const QString &preset); void videoFramerateChanged (int framerate); - + void videoDefinitionChanged (const QVariantMap &definition); - + void showVideoCodecsChanged (bool status); - + // Chat & calls. ------------------------------------------------------------- - + void autoAnswerStatusChanged (bool status); void autoAnswerVideoStatusChanged (bool status); void autoAnswerDelayChanged (int delay); - + void showTelKeypadAutomaticallyChanged (bool status); - + void keepCallsWindowInBackgroundChanged (bool status); - + void outgoingCallsEnabledChanged (bool status); - + void callRecorderEnabledChanged (bool status); void automaticallyRecordCallsChanged (bool status); - + void callPauseEnabledChanged (bool status); void muteMicrophoneEnabledChanged (bool status); - + void chatEnabledChanged (bool status); void hideEmptyChatRoomsChanged (bool status); void waitRegistrationForCallChanged (bool status); - + void conferenceEnabledChanged (bool status); - + void chatNotificationSoundEnabledChanged (bool status); void chatNotificationSoundPathChanged (const QString &path); - + void fileTransferUrlChanged (const QString &url); - + void mediaEncryptionChanged (MediaEncryption encryption); void limeStateChanged (bool state); - + void contactsEnabledChanged (bool status); - + // Network. ------------------------------------------------------------------ - + void showNetworkSettingsChanged (bool status); - + void dtmfsProtocolChanged (); - + void ipv6EnabledChanged (bool status); - + void downloadBandWidthChanged (int bandwidth); void uploadBandWidthChanged (int bandwidth); - + bool adaptiveRateControlEnabledChanged (bool status); - + void tcpPortChanged (int port); void udpPortChanged (int port); - + void audioPortRangeChanged (int a, int b); void videoPortRangeChanged (int a, int b); - + void iceEnabledChanged (bool status); void turnEnabledChanged (bool status); - + void stunServerChanged (const QString &server); - + void turnUserChanged (const QString &user); void turnPasswordChanged (const QString &password); - + void dscpSipChanged (int dscp); void dscpAudioChanged (int dscp); void dscpVideoChanged (int dscp); - + void rlsUriEnabledChanged (bool status); - + // UI. ----------------------------------------------------------------------- - + + void textMessageFontChanged(const QFont& font); + void textMessageFontSizeChanged(const int& size); + void savedScreenshotsFolderChanged (const QString &folder); void savedCallsFolderChanged (const QString &folder); void downloadFolderChanged (const QString &folder); - + void remoteProvisioningChanged (const QString &remoteProvisioning); void remoteProvisioningNotChanged (const QString &remoteProvisioning); - + void exitOnCloseChanged (bool value); - + // Advanced. ----------------------------------------------------------------- - + void logsFolderChanged (const QString &folder); void logsUploadUrlChanged (const QString &url); void logsEnabledChanged (bool status); void logsEmailChanged (const QString &email); void contactImporterChanged(); - + bool developerSettingsEnabledChanged (bool status); - + bool isInCallChanged(bool); - + private: int mCurrentSettingsTab = 0; MediastreamerUtils::SimpleCaptureGraph *mSimpleCaptureGraph = nullptr; - + std::shared_ptr mConfig; }; diff --git a/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml b/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml index ce71d4696..169f3c5b1 100644 --- a/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml @@ -63,6 +63,5 @@ RowLayout { backgroundColor: ChatStyle.entry.message.incoming.backgroundColor color: ChatStyle.entry.message.incoming.text.color - pointSize: ChatStyle.entry.message.incoming.text.pointSize } } diff --git a/linphone-app/ui/modules/Linphone/Chat/Message.qml b/linphone-app/ui/modules/Linphone/Chat/Message.qml index 78584e87c..6cf8468c4 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Message.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Message.qml @@ -84,6 +84,7 @@ Item { TextEdit { id: message property string lastTextSelected : '' + property font customFont : SettingsModel.textMessageFont anchors { left: container.left @@ -94,6 +95,8 @@ Item { padding: ChatStyle.entry.message.padding readOnly: true selectByMouse: true + font.family: customFont.family + font.pointSize: Units.dp * customFont.pointSize text: Utils.encodeTextToQmlRichFormat($chatEntry.content, { imagesHeight: ChatStyle.entry.message.images.height, imagesWidth: ChatStyle.entry.message.images.width diff --git a/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml b/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml index 60f264534..55fda9b60 100644 --- a/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml @@ -24,7 +24,6 @@ Item { } backgroundColor: ChatStyle.entry.message.outgoing.backgroundColor color: ChatStyle.entry.message.outgoing.text.color - pointSize: ChatStyle.entry.message.outgoing.text.pointSize width: parent.width Row { diff --git a/linphone-app/ui/modules/Linphone/Styles/Chat/ChatStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Chat/ChatStyle.qml index f33adcf28..234ef372a 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Chat/ChatStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Chat/ChatStyle.qml @@ -116,7 +116,6 @@ QtObject { property QtObject text: QtObject { property color color: ColorsList.add("Chat_incoming_text", "d").color - property int pointSize: Units.dp * 10 } } @@ -128,7 +127,6 @@ QtObject { property QtObject text: QtObject { property color color: ColorsList.add("Chat_outgoing_text", "d").color - property int pointSize: Units.dp * 10 } } } diff --git a/linphone-app/ui/views/App/Settings/SettingsUi.qml b/linphone-app/ui/views/App/Settings/SettingsUi.qml index 48a22b5f2..ee5e54def 100644 --- a/linphone-app/ui/views/App/Settings/SettingsUi.qml +++ b/linphone-app/ui/views/App/Settings/SettingsUi.qml @@ -1,162 +1,208 @@ import QtQuick 2.7 +import QtQuick.Dialogs 1.3 +import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Utils 1.0 +import UtilsCpp 1.0 import App.Styles 1.0 +import Linphone.Styles 1.0 +import Common.Styles 1.0 import 'SettingsUi.js' as Logic // ============================================================================= TabContainer { - Column { - spacing: SettingsWindowStyle.forms.spacing - width: parent.width - - // ------------------------------------------------------------------------- - // Languages. - // ------------------------------------------------------------------------- - - Form { - title: qsTr('languagesTitle') - width: parent.width - - FormLine { - FormGroup { - label: qsTr('languagesLabel') - - ComboBox { - textRole: 'key' - - Component.onCompleted: { - var locales = Logic.getAvailableLocales() - model = locales - - var locale = App.configLocale - if (!locale.length) { - currentIndex = 0 - return - } - - var value = Qt.locale(locale).name - currentIndex = Number(Utils.findIndex(locales, function (locale) { - return locale.value === value - })) - } - - onActivated: Logic.setLocale(model[index].value) - } - } - } - } - - // ------------------------------------------------------------------------- - // Paths. - // ------------------------------------------------------------------------- - - Form { - title: qsTr('pathsTitle') - visible: SettingsModel.videoSupported || - SettingsModel.callRecorderEnabled || - SettingsModel.chatEnabled || - SettingsModel.developerSettingsEnabled - width: parent.width - - FormLine { - visible: SettingsModel.videoSupported - - FormGroup { - label: qsTr('savedScreenshotsLabel') - - FileChooserButton { - selectedFile: SettingsModel.savedScreenshotsFolder - selectFolder: true - - onAccepted: SettingsModel.savedScreenshotsFolder = selectedFile - } - } - } - - FormLine { - visible: SettingsModel.callRecorderEnabled || SettingsModel.developerSettingsEnabled - - FormGroup { - label: qsTr('savedCallsLabel') - - FileChooserButton { - selectedFile: SettingsModel.savedCallsFolder - selectFolder: true - - onAccepted: SettingsModel.savedCallsFolder = selectedFile - } - } - } - - FormLine { - visible: SettingsModel.chatEnabled || SettingsModel.developerSettingsEnabled - - FormGroup { - label: qsTr('downloadLabel') - - FileChooserButton { - selectedFile: SettingsModel.downloadFolder - selectFolder: true - - onAccepted: SettingsModel.downloadFolder = selectedFile - } - } - } - } - - // ------------------------------------------------------------------------- - // Data. - // ------------------------------------------------------------------------- - - Form { - title: qsTr('dataTitle') - visible: SettingsModel.contactsEnabled || SettingsModel.developerSettingsEnabled - width: parent.width - } - - TextButtonB { - anchors.right: parent.right - text: qsTr('cleanAvatars') - visible: SettingsModel.contactsEnabled || SettingsModel.developerSettingsEnabled - - onClicked: Logic.cleanAvatars() - } - - // ------------------------------------------------------------------------- - // Other. - // ------------------------------------------------------------------------- - - Form { - title: qsTr('otherTitle') - width: parent.width - - FormLine { - FormGroup { - label: qsTr('exitOnCloseLabel') - - Switch { - checked: SettingsModel.exitOnClose - - onClicked: SettingsModel.exitOnClose = !checked - } - } - - FormGroup { - label: qsTr('autoStartLabel') - - Switch { - checked: App.autoStart - - onClicked: App.autoStart = !checked - } - } - } - } - } + Column { + spacing: SettingsWindowStyle.forms.spacing + width: parent.width + + // ------------------------------------------------------------------------- + // Languages. + // ------------------------------------------------------------------------- + + Form { + title: qsTr('languagesTitle') + width: parent.width + + FormLine { + FormGroup { + label: qsTr('languagesLabel') + + ComboBox { + textRole: 'key' + + Component.onCompleted: { + var locales = Logic.getAvailableLocales() + model = locales + + var locale = App.configLocale + if (!locale.length) { + currentIndex = 0 + return + } + + var value = Qt.locale(locale).name + currentIndex = Number(Utils.findIndex(locales, function (locale) { + return locale.value === value + })) + } + + onActivated: Logic.setLocale(model[index].value) + } + } + } + Form { + //: 'Fonts' : title of fonts section in settings + title: qsTr('fontsTitle') + width: parent.width + FormLine { + FormGroup { + //: 'Text Messages' : Label for changing text message fonts + label: qsTr('fontsTextChange') + RowLayout{ + ActionButton { + icon: 'options' + iconSize: 25 + onClicked: fontDialog.visible = true + Layout.preferredWidth: 25 + FontDialog { + id: fontDialog + //: 'Select a new font' : Popup title for choosing new fonts + title: qsTr('fontsPopupTitle') + visible:false + font: SettingsModel.textMessageFont + onAccepted: { + SettingsModel.textMessageFont = fontDialog.font + } + onRejected: { + } + } + } + Text{ + Layout.leftMargin: 18 + Layout.fillWidth: true + text: SettingsModel.textMessageFont.family +", "+SettingsModel.textMessageFont.pointSize + font { + bold: true + pointSize: FormTableStyle.entry.text.pointSize + } + } + } + + } + } + } + } + + // ------------------------------------------------------------------------- + // Paths. + // ------------------------------------------------------------------------- + + Form { + title: qsTr('pathsTitle') + visible: SettingsModel.videoSupported || + SettingsModel.callRecorderEnabled || + SettingsModel.chatEnabled || + SettingsModel.developerSettingsEnabled + width: parent.width + + FormLine { + visible: SettingsModel.videoSupported + + FormGroup { + label: qsTr('savedScreenshotsLabel') + + FileChooserButton { + selectedFile: SettingsModel.savedScreenshotsFolder + selectFolder: true + + onAccepted: SettingsModel.savedScreenshotsFolder = selectedFile + } + } + } + + FormLine { + visible: SettingsModel.callRecorderEnabled || SettingsModel.developerSettingsEnabled + + FormGroup { + label: qsTr('savedCallsLabel') + + FileChooserButton { + selectedFile: SettingsModel.savedCallsFolder + selectFolder: true + + onAccepted: SettingsModel.savedCallsFolder = selectedFile + } + } + } + + FormLine { + visible: SettingsModel.chatEnabled || SettingsModel.developerSettingsEnabled + + FormGroup { + label: qsTr('downloadLabel') + + FileChooserButton { + selectedFile: SettingsModel.downloadFolder + selectFolder: true + + onAccepted: SettingsModel.downloadFolder = selectedFile + } + } + } + } + + // ------------------------------------------------------------------------- + // Data. + // ------------------------------------------------------------------------- + + Form { + title: qsTr('dataTitle') + visible: SettingsModel.contactsEnabled || SettingsModel.developerSettingsEnabled + width: parent.width + } + + TextButtonB { + anchors.right: parent.right + text: qsTr('cleanAvatars') + visible: SettingsModel.contactsEnabled || SettingsModel.developerSettingsEnabled + + onClicked: Logic.cleanAvatars() + } + + // ------------------------------------------------------------------------- + // Other. + // ------------------------------------------------------------------------- + + Form { + title: qsTr('otherTitle') + width: parent.width + + FormLine { + FormGroup { + label: qsTr('exitOnCloseLabel') + + Switch { + checked: SettingsModel.exitOnClose + + onClicked: SettingsModel.exitOnClose = !checked + } + } + + FormGroup { + label: qsTr('autoStartLabel') + + Switch { + checked: App.autoStart + + onClicked: App.autoStart = !checked + } + } + } + } + } }