diff --git a/CMakeLists.txt b/CMakeLists.txt
index 575528fe3..bafe3457a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -233,8 +233,8 @@ foreach (line ${QRC_RESOURCES_CONTENT})
result
"${line}"
)
- string(REGEX MATCH "\\.[a-z]+$" isUi ${result})
- if (NOT ${isUi} STREQUAL "")
+ string(REGEX MATCH "\\.[a-z]+$" is_ui ${result})
+ if (NOT ${is_ui} STREQUAL "")
list(APPEND QML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${result}")
endif ()
endforeach ()
diff --git a/assets/languages/en.ts b/assets/languages/en.ts
index ce13a4cf0..68780a132 100644
--- a/assets/languages/en.ts
+++ b/assets/languages/en.ts
@@ -1296,6 +1296,14 @@ your friend's SIP address or username.
setLocaleDescription
It is necessary to restart the application. Do you want to restart now?
+
+ otherTitle
+ Other
+
+
+ exitOnCloseLabel
+ Exit app on close window
+
SettingsVideo
diff --git a/assets/languages/fr.ts b/assets/languages/fr.ts
index 244b9578d..9db336fd0 100644
--- a/assets/languages/fr.ts
+++ b/assets/languages/fr.ts
@@ -1294,6 +1294,14 @@ Cliquez ici : <a href="%1">%1</a>
setLocaleDescription
Voulez-vous redémarrer maintenant pour prendre en compte ces modifications ?
+
+ otherTitle
+ Divers
+
+
+ exitOnCloseLabel
+ Quitter à la fermeture de fenêtre
+
SettingsVideo
diff --git a/src/components/settings/SettingsModel.cpp b/src/components/settings/SettingsModel.cpp
index 1145251f2..caafa2a75 100644
--- a/src/components/settings/SettingsModel.cpp
+++ b/src/components/settings/SettingsModel.cpp
@@ -700,3 +700,14 @@ void SettingsModel::setRemoteProvisioning (const QString &remoteProvisioning) {
else
emit remoteProvisioningNotChanged(remoteProvisioning);
}
+
+// -----------------------------------------------------------------------------
+
+bool SettingsModel::getExitOnClose () const {
+ return !!mConfig->getInt(UI_SECTION, "exit_on_close", 0);
+}
+
+void SettingsModel::setExitOnClose (bool value) {
+ mConfig->setInt(UI_SECTION, "exit_on_close", value);
+ emit exitOnCloseChanged(value);
+}
diff --git a/src/components/settings/SettingsModel.hpp b/src/components/settings/SettingsModel.hpp
index 4b54da251..5d251c0ea 100644
--- a/src/components/settings/SettingsModel.hpp
+++ b/src/components/settings/SettingsModel.hpp
@@ -118,6 +118,8 @@ class SettingsModel : public QObject {
Q_PROPERTY(QString savedVideosFolder READ getSavedVideosFolder WRITE setSavedVideosFolder NOTIFY savedVideosFolderChanged);
Q_PROPERTY(QString downloadFolder READ getDownloadFolder WRITE setDownloadFolder NOTIFY downloadFolderChanged);
+ Q_PROPERTY(bool exitOnClose READ getExitOnClose WRITE setExitOnClose NOTIFY exitOnCloseChanged);
+
public:
enum MediaEncryption {
MediaEncryptionNone = linphone::MediaEncryptionNone,
@@ -273,6 +275,9 @@ public:
QString getRemoteProvisioning () const;
void setRemoteProvisioning (const QString &remoteProvisioning);
+ bool getExitOnClose () const;
+ void setExitOnClose (bool value);
+
// ---------------------------------------------------------------------------
static const std::string UI_SECTION;
@@ -350,6 +355,8 @@ signals:
void remoteProvisioningChanged (const QString &remoteProvisioning);
void remoteProvisioningNotChanged (const QString &remoteProvisioning);
+ void exitOnCloseChanged (bool value);
+
private:
std::shared_ptr mConfig;
};
diff --git a/ui/views/App/Main/MainWindow.js b/ui/views/App/Main/MainWindow.js
index a504fc208..91dbb43a7 100644
--- a/ui/views/App/Main/MainWindow.js
+++ b/ui/views/App/Main/MainWindow.js
@@ -18,6 +18,11 @@ function handleActiveFocusItemChanged (activeFocusItem) {
}
function handleClosing (close) {
+ if (Linphone.SettingsModel.exitOnClose) {
+ Qt.quit()
+ return
+ }
+
if (Qt.platform.os === 'osx') {
close.accepted = false
window.showMinimized()
diff --git a/ui/views/App/Settings/SettingsUi.qml b/ui/views/App/Settings/SettingsUi.qml
index a70c98c82..fc9b02796 100644
--- a/ui/views/App/Settings/SettingsUi.qml
+++ b/ui/views/App/Settings/SettingsUi.qml
@@ -108,5 +108,28 @@ TabContainer {
onClicked: Logic.cleanAvatars()
}
+
+ // -------------------------------------------------------------------------
+ // Other.
+ // -------------------------------------------------------------------------
+
+ Form {
+ title: qsTr('otherTitle')
+ width: parent.width
+
+ FormLine {
+ FormGroup {
+ label: qsTr('exitOnCloseLabel')
+
+ Switch {
+ id: autoAnswer
+
+ checked: SettingsModel.exitOnClose
+
+ onClicked: SettingsModel.exitOnClose = !checked
+ }
+ }
+ }
+ }
}
}