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
485a9f3e
Commit
485a9f3e
authored
Jun 22, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Settings): add a advanced entry and a logs folder selector
parent
f9c4eb12
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
134 additions
and
12 deletions
+134
-12
en.ts
assets/languages/en.ts
+15
-0
fr.ts
assets/languages/fr.ts
+15
-0
resources.qrc
resources.qrc
+1
-0
App.cpp
src/app/App.cpp
+4
-5
Logger.cpp
src/app/logger/Logger.cpp
+5
-2
Logger.hpp
src/app/logger/Logger.hpp
+1
-1
SettingsModel.cpp
src/components/settings/SettingsModel.cpp
+25
-1
SettingsModel.hpp
src/components/settings/SettingsModel.hpp
+18
-3
SettingsAdvanced.qml
ui/views/App/Settings/SettingsAdvanced.qml
+43
-0
SettingsWindow.qml
ui/views/App/Settings/SettingsWindow.qml
+7
-0
No files found.
assets/languages/en.ts
View file @
485a9f3e
...
@@ -967,6 +967,17 @@ your friend's SIP address or username.</translation>
...
@@ -967,6 +967,17 @@ your friend's SIP address or username.</translation>
<
translation
>
Offline
<
/translation
>
<
translation
>
Offline
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
SettingsAdvanced
<
/name
>
<
message
>
<
source
>
logsTitle
<
/source
>
<
translation
>
Logs
<
/translation
>
<
/message
>
<
message
>
<
source
>
logsFolderLabel
<
/source
>
<
translation
>
Logs
folder
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
SettingsAudio
<
/name
>
<
name
>
SettingsAudio
<
/name
>
<
message
>
<
message
>
...
@@ -1389,6 +1400,10 @@ your friend's SIP address or username.</translation>
...
@@ -1389,6 +1400,10 @@ your friend's SIP address or username.</translation>
<
source
>
validButton
<
/source
>
<
source
>
validButton
<
/source
>
<
translation
>
OK
<
/translation
>
<
translation
>
OK
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
uiAdvanced
<
/source
>
<
translation
>
Advanced
<
/translation
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
context
>
<
name
>
SmartSearchBar
<
/name
>
<
name
>
SmartSearchBar
<
/name
>
...
...
assets/languages/fr.ts
View file @
485a9f3e
...
@@ -965,6 +965,17 @@ Cliquez ici : <a href="%1">%1</a>
...
@@ -965,6 +965,17 @@ Cliquez ici : <a href="%1">%1</a>
<
translation
>
Hors
-
ligne
<
/translation
>
<
translation
>
Hors
-
ligne
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
SettingsAdvanced
<
/name
>
<
message
>
<
source
>
logsTitle
<
/source
>
<
translation
>
Logs
<
/translation
>
<
/message
>
<
message
>
<
source
>
logsFolderLabel
<
/source
>
<
translation
>
Dossier
des
logs
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
SettingsAudio
<
/name
>
<
name
>
SettingsAudio
<
/name
>
<
message
>
<
message
>
...
@@ -1387,6 +1398,10 @@ Cliquez ici : <a href="%1">%1</a>
...
@@ -1387,6 +1398,10 @@ Cliquez ici : <a href="%1">%1</a>
<
source
>
validButton
<
/source
>
<
source
>
validButton
<
/source
>
<
translation
>
OK
<
/translation
>
<
translation
>
OK
<
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
uiAdvanced
<
/source
>
<
translation
>
Avanc
é
<
/translation
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
context
>
<
name
>
SmartSearchBar
<
/name
>
<
name
>
SmartSearchBar
<
/name
>
...
...
resources.qrc
View file @
485a9f3e
...
@@ -403,6 +403,7 @@
...
@@ -403,6 +403,7 @@
<file>
ui/views/App/Main/MainWindow.js
</file>
<file>
ui/views/App/Main/MainWindow.js
</file>
<file>
ui/views/App/Main/MainWindowMenuBar.qml
</file>
<file>
ui/views/App/Main/MainWindowMenuBar.qml
</file>
<file>
ui/views/App/Main/MainWindow.qml
</file>
<file>
ui/views/App/Main/MainWindow.qml
</file>
<file>
ui/views/App/Settings/SettingsAdvanced.qml
</file>
<file>
ui/views/App/Settings/SettingsAudio.qml
</file>
<file>
ui/views/App/Settings/SettingsAudio.qml
</file>
<file>
ui/views/App/Settings/SettingsCallsChat.qml
</file>
<file>
ui/views/App/Settings/SettingsCallsChat.qml
</file>
<file>
ui/views/App/Settings/SettingsNetwork.qml
</file>
<file>
ui/views/App/Settings/SettingsNetwork.qml
</file>
...
...
src/app/App.cpp
View file @
485a9f3e
...
@@ -84,10 +84,9 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U
...
@@ -84,10 +84,9 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U
createParser
();
createParser
();
mParser
->
process
(
*
this
);
mParser
->
process
(
*
this
);
// Initialize logger. (Do not do this before this point because the
// Initialize logger.
// application has to be created for the logs to be put in the correct
shared_ptr
<
linphone
::
Config
>
config
=
::
getConfigIfExists
(
*
mParser
);
// directory.)
Logger
::
init
(
SettingsModel
::
getLogsFolder
(
config
));
Logger
::
init
();
if
(
mParser
->
isSet
(
"verbose"
))
if
(
mParser
->
isSet
(
"verbose"
))
Logger
::
getInstance
()
->
setVerbose
(
true
);
Logger
::
getInstance
()
->
setVerbose
(
true
);
...
@@ -97,7 +96,7 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U
...
@@ -97,7 +96,7 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U
// Init locale.
// Init locale.
mTranslator
=
new
DefaultTranslator
(
this
);
mTranslator
=
new
DefaultTranslator
(
this
);
initLocale
(
::
getConfigIfExists
(
*
mParser
)
);
initLocale
(
config
);
if
(
mParser
->
isSet
(
"help"
))
{
if
(
mParser
->
isSet
(
"help"
))
{
createParser
();
createParser
();
...
...
src/app/logger/Logger.cpp
View file @
485a9f3e
...
@@ -155,7 +155,9 @@ void Logger::log (QtMsgType type, const QMessageLogContext &context, const QStri
...
@@ -155,7 +155,9 @@ void Logger::log (QtMsgType type, const QMessageLogContext &context, const QStri
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
Logger
::
init
()
{
void
Logger
::
init
(
const
QString
&
folder
)
{
Q_ASSERT
(
!
folder
.
isEmpty
());
if
(
mInstance
)
if
(
mInstance
)
return
;
return
;
mInstance
=
new
Logger
();
mInstance
=
new
Logger
();
...
@@ -168,7 +170,8 @@ void Logger::init () {
...
@@ -168,7 +170,8 @@ void Logger::init () {
::
linphoneLog
(
domain
,
type
,
fmt
,
args
);
::
linphoneLog
(
domain
,
type
,
fmt
,
args
);
});
});
linphone_core_set_log_collection_path
(
Paths
::
getLogsDirPath
().
c_str
());
linphone_core_set_log_collection_path
(
::
Utils
::
appStringToCoreString
(
folder
).
c_str
());
linphone_core_set_log_collection_max_file_size
(
MAX_LOGS_COLLECTION_SIZE
);
linphone_core_set_log_collection_max_file_size
(
MAX_LOGS_COLLECTION_SIZE
);
linphone_core_enable_log_collection
(
LinphoneLogCollectionEnabled
);
linphone_core_enable_log_collection
(
LinphoneLogCollectionEnabled
);
}
}
src/app/logger/Logger.hpp
View file @
485a9f3e
...
@@ -39,7 +39,7 @@ public:
...
@@ -39,7 +39,7 @@ public:
mVerbose
=
verbose
;
mVerbose
=
verbose
;
}
}
static
void
init
();
static
void
init
(
const
QString
&
folder
);
static
Logger
*
getInstance
()
{
static
Logger
*
getInstance
()
{
return
mInstance
;
return
mInstance
;
...
...
src/components/settings/SettingsModel.cpp
View file @
485a9f3e
...
@@ -636,7 +636,7 @@ void SettingsModel::setDscpVideo (int dscp) {
...
@@ -636,7 +636,7 @@ void SettingsModel::setDscpVideo (int dscp) {
}
}
// =============================================================================
// =============================================================================
//
Misc
.
//
UI
.
// =============================================================================
// =============================================================================
QString
SettingsModel
::
getSavedScreenshotsFolder
()
const
{
QString
SettingsModel
::
getSavedScreenshotsFolder
()
const
{
...
@@ -711,3 +711,27 @@ void SettingsModel::setExitOnClose (bool value) {
...
@@ -711,3 +711,27 @@ void SettingsModel::setExitOnClose (bool value) {
mConfig
->
setInt
(
UI_SECTION
,
"exit_on_close"
,
value
);
mConfig
->
setInt
(
UI_SECTION
,
"exit_on_close"
,
value
);
emit
exitOnCloseChanged
(
value
);
emit
exitOnCloseChanged
(
value
);
}
}
// =============================================================================
// Advanced.
// =============================================================================
QString
SettingsModel
::
getLogsFolder
()
const
{
return
getLogsFolder
(
mConfig
);
}
void
SettingsModel
::
setLogsFolder
(
const
QString
&
folder
)
{
// Do not update path in linphone core.
// Just update the config file.
mConfig
->
setString
(
UI_SECTION
,
"logs_folder"
,
::
Utils
::
appStringToCoreString
(
folder
));
emit
logsFolderChanged
(
folder
);
}
// -----------------------------------------------------------------------------
QString
SettingsModel
::
getLogsFolder
(
const
shared_ptr
<
linphone
::
Config
>
&
config
)
{
return
::
Utils
::
coreStringToAppString
(
config
->
getString
(
UI_SECTION
,
"logs_folder"
,
Paths
::
getLogsDirPath
())
);
}
src/components/settings/SettingsModel.hpp
View file @
485a9f3e
...
@@ -110,7 +110,7 @@ class SettingsModel : public QObject {
...
@@ -110,7 +110,7 @@ class SettingsModel : public QObject {
Q_PROPERTY
(
int
dscpAudio
READ
getDscpAudio
WRITE
setDscpAudio
NOTIFY
dscpAudioChanged
);
Q_PROPERTY
(
int
dscpAudio
READ
getDscpAudio
WRITE
setDscpAudio
NOTIFY
dscpAudioChanged
);
Q_PROPERTY
(
int
dscpVideo
READ
getDscpVideo
WRITE
setDscpVideo
NOTIFY
dscpVideoChanged
);
Q_PROPERTY
(
int
dscpVideo
READ
getDscpVideo
WRITE
setDscpVideo
NOTIFY
dscpVideoChanged
);
//
Misc.
---------------------------------------------------------------------
//
UI. --
---------------------------------------------------------------------
Q_PROPERTY
(
QString
remoteProvisioning
READ
getRemoteProvisioning
WRITE
setRemoteProvisioning
NOTIFY
remoteProvisioningChanged
);
Q_PROPERTY
(
QString
remoteProvisioning
READ
getRemoteProvisioning
WRITE
setRemoteProvisioning
NOTIFY
remoteProvisioningChanged
);
...
@@ -120,6 +120,10 @@ class SettingsModel : public QObject {
...
@@ -120,6 +120,10 @@ class SettingsModel : public QObject {
Q_PROPERTY
(
bool
exitOnClose
READ
getExitOnClose
WRITE
setExitOnClose
NOTIFY
exitOnCloseChanged
);
Q_PROPERTY
(
bool
exitOnClose
READ
getExitOnClose
WRITE
setExitOnClose
NOTIFY
exitOnCloseChanged
);
// Advanced. -----------------------------------------------------------------
Q_PROPERTY
(
QString
logsFolder
READ
getLogsFolder
WRITE
setLogsFolder
NOTIFY
logsFolderChanged
);
public:
public:
enum
MediaEncryption
{
enum
MediaEncryption
{
MediaEncryptionNone
=
linphone
::
MediaEncryptionNone
,
MediaEncryptionNone
=
linphone
::
MediaEncryptionNone
,
...
@@ -261,7 +265,7 @@ public:
...
@@ -261,7 +265,7 @@ public:
int
getDscpVideo
()
const
;
int
getDscpVideo
()
const
;
void
setDscpVideo
(
int
dscp
);
void
setDscpVideo
(
int
dscp
);
//
Misc.
---------------------------------------------------------------------
//
UI. --
---------------------------------------------------------------------
QString
getSavedScreenshotsFolder
()
const
;
QString
getSavedScreenshotsFolder
()
const
;
void
setSavedScreenshotsFolder
(
const
QString
&
folder
);
void
setSavedScreenshotsFolder
(
const
QString
&
folder
);
...
@@ -280,6 +284,13 @@ public:
...
@@ -280,6 +284,13 @@ public:
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
QString
getLogsFolder
()
const
;
void
setLogsFolder
(
const
QString
&
folder
);
// ---------------------------------------------------------------------------
static
QString
getLogsFolder
(
const
std
::
shared_ptr
<
linphone
::
Config
>
&
config
);
static
const
std
::
string
UI_SECTION
;
static
const
std
::
string
UI_SECTION
;
// ===========================================================================
// ===========================================================================
...
@@ -346,7 +357,7 @@ signals:
...
@@ -346,7 +357,7 @@ signals:
void
dscpAudioChanged
(
int
dscp
);
void
dscpAudioChanged
(
int
dscp
);
void
dscpVideoChanged
(
int
dscp
);
void
dscpVideoChanged
(
int
dscp
);
//
Misc.
---------------------------------------------------------------------
//
UI. --
---------------------------------------------------------------------
void
savedScreenshotsFolderChanged
(
const
QString
&
folder
);
void
savedScreenshotsFolderChanged
(
const
QString
&
folder
);
void
savedVideosFolderChanged
(
const
QString
&
folder
);
void
savedVideosFolderChanged
(
const
QString
&
folder
);
...
@@ -357,6 +368,10 @@ signals:
...
@@ -357,6 +368,10 @@ signals:
void
exitOnCloseChanged
(
bool
value
);
void
exitOnCloseChanged
(
bool
value
);
// Advanced. -----------------------------------------------------------------
void
logsFolderChanged
(
const
QString
&
folder
);
private:
private:
std
::
shared_ptr
<
linphone
::
Config
>
mConfig
;
std
::
shared_ptr
<
linphone
::
Config
>
mConfig
;
};
};
...
...
ui/views/App/Settings/SettingsAdvanced.qml
0 → 100644
View file @
485a9f3e
import
QtQuick
2.7
import
Common
1.0
import
Linphone
1.0
import
App
.
Styles
1.0
// =============================================================================
TabContainer
{
Column
{
spacing
:
SettingsWindowStyle
.
forms
.
spacing
width
:
parent
.
width
// -------------------------------------------------------------------------
// Logs.
// -------------------------------------------------------------------------
Form
{
title
:
qsTr
(
'
logsTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
logsFolderLabel
'
)
FileChooserButton
{
selectedFile
:
SettingsModel
.
logsFolder
selectFolder
:
true
onAccepted
:
SettingsModel
.
logsFolder
=
selectedFile
}
}
}
}
// -------------------------------------------------------------------------
// Internal features.
// -------------------------------------------------------------------------
// Nothing for the moment.
}
}
ui/views/App/Settings/SettingsWindow.qml
View file @
485a9f3e
...
@@ -84,6 +84,12 @@ ApplicationWindow {
...
@@ -84,6 +84,12 @@ ApplicationWindow {
text
:
qsTr
(
'
uiTab
'
)
text
:
qsTr
(
'
uiTab
'
)
width
:
implicitWidth
width
:
implicitWidth
}
}
TabButton
{
icon
:
'
settings_advanced
'
text
:
qsTr
(
'
uiAdvanced
'
)
width
:
implicitWidth
}
}
}
Rectangle
{
Rectangle
{
...
@@ -110,6 +116,7 @@ ApplicationWindow {
...
@@ -110,6 +116,7 @@ ApplicationWindow {
SettingsCallsChat
{}
SettingsCallsChat
{}
SettingsNetwork
{}
SettingsNetwork
{}
SettingsUi
{}
SettingsUi
{}
SettingsAdvanced
{}
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
...
...
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