Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
b8dbdd98
Commit
b8dbdd98
authored
Jun 19, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Settings): add an option to quit app on main window close signal
parent
c4e6e50b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
2 deletions
+64
-2
CMakeLists.txt
CMakeLists.txt
+2
-2
en.ts
assets/languages/en.ts
+8
-0
fr.ts
assets/languages/fr.ts
+8
-0
SettingsModel.cpp
src/components/settings/SettingsModel.cpp
+11
-0
SettingsModel.hpp
src/components/settings/SettingsModel.hpp
+7
-0
MainWindow.js
ui/views/App/Main/MainWindow.js
+5
-0
SettingsUi.qml
ui/views/App/Settings/SettingsUi.qml
+23
-0
No files found.
CMakeLists.txt
View file @
b8dbdd98
...
...
@@ -233,8 +233,8 @@ foreach (line ${QRC_RESOURCES_CONTENT})
result
"
${
line
}
"
)
string
(
REGEX MATCH
"
\\
.[a-z]+$"
is
U
i
${
result
}
)
if
(
NOT
${
is
U
i
}
STREQUAL
""
)
string
(
REGEX MATCH
"
\\
.[a-z]+$"
is
_u
i
${
result
}
)
if
(
NOT
${
is
_u
i
}
STREQUAL
""
)
list
(
APPEND QML_SOURCES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
result
}
"
)
endif
()
endforeach
()
...
...
assets/languages/en.ts
View file @
b8dbdd98
...
...
@@ -1296,6 +1296,14 @@ your friend's SIP address or username.</translation>
<
source
>
setLocaleDescription
<
/source
>
<
translation
>
It
is
necessary
to
restart
the
application
.
Do
you
want
to
restart
now
?
<
/translation
>
<
/message
>
<
message
>
<
source
>
otherTitle
<
/source
>
<
translation
>
Other
<
/translation
>
<
/message
>
<
message
>
<
source
>
exitOnCloseLabel
<
/source
>
<
translation
>
Exit
app
on
close
window
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsVideo
<
/name
>
...
...
assets/languages/fr.ts
View file @
b8dbdd98
...
...
@@ -1294,6 +1294,14 @@ Cliquez ici : <a href="%1">%1</a>
<
source
>
setLocaleDescription
<
/source
>
<
translation
>
Voulez
-
vous
red
é
marrer
maintenant
pour
prendre
en
compte
ces
modifications
?
<
/translation
>
<
/message
>
<
message
>
<
source
>
otherTitle
<
/source
>
<
translation
>
Divers
<
/translation
>
<
/message
>
<
message
>
<
source
>
exitOnCloseLabel
<
/source
>
<
translation
>
Quitter
à
la
fermeture
de
fen
ê
tre
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsVideo
<
/name
>
...
...
src/components/settings/SettingsModel.cpp
View file @
b8dbdd98
...
...
@@ -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
);
}
src/components/settings/SettingsModel.hpp
View file @
b8dbdd98
...
...
@@ -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
<
linphone
::
Config
>
mConfig
;
};
...
...
ui/views/App/Main/MainWindow.js
View file @
b8dbdd98
...
...
@@ -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
()
...
...
ui/views/App/Settings/SettingsUi.qml
View file @
b8dbdd98
...
...
@@ -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
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment