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
c71f1590
Commit
c71f1590
authored
Feb 23, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsUi): supports videos/screenshots paths
parent
c30c3d16
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
13 deletions
+77
-13
App.cpp
linphone-desktop/src/app/App.cpp
+1
-2
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+4
-3
CoreManager.cpp
linphone-desktop/src/components/core/CoreManager.cpp
+5
-2
CoreManager.hpp
linphone-desktop/src/components/core/CoreManager.hpp
+6
-0
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+37
-0
SettingsModel.hpp
linphone-desktop/src/components/settings/SettingsModel.hpp
+18
-6
SettingsUi.qml
linphone-desktop/ui/views/App/Settings/SettingsUi.qml
+6
-0
No files found.
linphone-desktop/src/app/App.cpp
View file @
c71f1590
...
...
@@ -26,7 +26,6 @@
#include "../components/contacts/ContactsListProxyModel.hpp"
#include "../components/core/CoreManager.hpp"
#include "../components/settings/AccountSettingsModel.hpp"
#include "../components/settings/SettingsModel.hpp"
#include "../components/smart-search-bar/SmartSearchBarModel.hpp"
#include "../components/timeline/TimelineModel.hpp"
#include "../utils.hpp"
...
...
@@ -265,7 +264,7 @@ void App::registerTypes () {
qmlRegisterSingletonType
<
SettingsModel
>
(
"Linphone"
,
1
,
0
,
"SettingsModel"
,
[](
QQmlEngine
*
,
QJSEngine
*
)
->
QObject
*
{
return
new
SettingsModel
();
return
CoreManager
::
getInstance
()
->
get
SettingsModel
();
}
);
...
...
linphone-desktop/src/components/call/CallModel.cpp
View file @
c71f1590
...
...
@@ -24,7 +24,6 @@
#include <QtDebug>
#include "../../app/App.hpp"
#include "../../app/Paths.hpp"
#include "../../utils.hpp"
#include "../core/CoreManager.hpp"
...
...
@@ -87,8 +86,8 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphone_call) {
void
CallModel
::
setRecordFile
(
shared_ptr
<
linphone
::
CallParams
>
&
call_params
)
{
call_params
->
setRecordFile
(
Paths
::
getCapturesDirPath
()
+
::
Utils
::
qStringToLinphoneString
(
CoreManager
::
getInstance
()
->
getSettingsModel
()
->
getSavedVideosFolder
()
+
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd_hh:mm:ss"
)
)
+
".mkv"
);
...
...
@@ -150,7 +149,9 @@ void CallModel::takeSnapshot () {
qInfo
()
<<
"Take snapshot of call:"
<<
&
m_linphone_call
;
m_linphone_call
->
takeVideoSnapshot
(
Paths
::
getCapturesDirPath
()
+
::
Utils
::
qStringToLinphoneString
(
new_name
)
::
Utils
::
qStringToLinphoneString
(
CoreManager
::
getInstance
()
->
getSettingsModel
()
->
getSavedScreenshotsFolder
()
+
new_name
)
);
}
...
...
linphone-desktop/src/components/core/CoreManager.cpp
View file @
c71f1590
...
...
@@ -57,6 +57,7 @@ void CoreManager::init (const QString &configPath) {
m_instance
->
m_calls_list_model
=
new
CallsListModel
(
m_instance
);
m_instance
->
m_contacts_list_model
=
new
ContactsListModel
(
m_instance
);
m_instance
->
m_sip_addresses_model
=
new
SipAddressesModel
(
m_instance
);
m_instance
->
m_settings_model
=
new
SettingsModel
(
m_instance
);
QTimer
*
timer
=
m_instance
->
m_cbs_timer
=
new
QTimer
(
m_instance
);
timer
->
setInterval
(
20
);
...
...
@@ -88,7 +89,9 @@ void CoreManager::setResourcesPaths () {
mspluginsdir
.
cd
(
"lib/mediastreamer/plugins"
);
QDir
datadir
(
dir
);
datadir
.
cd
(
"share"
);
linphone
::
Factory
::
get
()
->
setMspluginsDir
(
::
Utils
::
qStringToLinphoneString
(
mspluginsdir
.
absolutePath
()));
linphone
::
Factory
::
get
()
->
setTopResourcesDir
(
::
Utils
::
qStringToLinphoneString
(
datadir
.
absolutePath
()));
shared_ptr
<
linphone
::
Factory
>
factory
=
linphone
::
Factory
::
get
();
factory
->
setMspluginsDir
(
::
Utils
::
qStringToLinphoneString
(
mspluginsdir
.
absolutePath
()));
factory
->
setTopResourcesDir
(
::
Utils
::
qStringToLinphoneString
(
datadir
.
absolutePath
()));
}
}
linphone-desktop/src/components/core/CoreManager.hpp
View file @
c71f1590
...
...
@@ -25,6 +25,7 @@
#include "../calls/CallsListModel.hpp"
#include "../contacts/ContactsListModel.hpp"
#include "../settings/SettingsModel.hpp"
#include "../sip-addresses/SipAddressesModel.hpp"
#include "CoreHandlers.hpp"
...
...
@@ -64,6 +65,10 @@ public:
return
m_sip_addresses_model
;
}
SettingsModel
*
getSettingsModel
()
const
{
return
m_settings_model
;
}
// ---------------------------------------------------------------------------
// Initialization.
// ---------------------------------------------------------------------------
...
...
@@ -92,6 +97,7 @@ private:
CallsListModel
*
m_calls_list_model
;
ContactsListModel
*
m_contacts_list_model
;
SipAddressesModel
*
m_sip_addresses_model
;
SettingsModel
*
m_settings_model
;
QTimer
*
m_cbs_timer
;
...
...
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
c71f1590
...
...
@@ -20,9 +20,12 @@
* Author: Ronan Abhamon
*/
#include "../../app/Paths.hpp"
#include "../../utils.hpp"
#include "../core/CoreManager.hpp"
#include <QDir>
#include "SettingsModel.hpp"
using
namespace
std
;
...
...
@@ -59,3 +62,37 @@ void SettingsModel::setFileTransferUrl (const QString &url) {
::
Utils
::
qStringToLinphoneString
(
url
)
);
}
// -----------------------------------------------------------------------------
QString
SettingsModel
::
getSavedScreenshotsFolder
()
const
{
return
QDir
::
cleanPath
(
::
Utils
::
linphoneStringToQString
(
m_config
->
getString
(
UI_SECTION
,
"saved_screenshots_folder"
,
Paths
::
getCapturesDirPath
())
)
)
+
QDir
::
separator
();
}
void
SettingsModel
::
setSavedScreenshotsFolder
(
const
QString
&
folder
)
{
QString
_folder
=
QDir
::
cleanPath
(
folder
)
+
QDir
::
separator
();
m_config
->
setString
(
UI_SECTION
,
"saved_screenshots_folder"
,
::
Utils
::
qStringToLinphoneString
(
_folder
));
emit
savedScreenshotsFolderChanged
(
_folder
);
}
// -----------------------------------------------------------------------------
QString
SettingsModel
::
getSavedVideosFolder
()
const
{
return
QDir
::
cleanPath
(
::
Utils
::
linphoneStringToQString
(
m_config
->
getString
(
UI_SECTION
,
"saved_videos_folder"
,
Paths
::
getCapturesDirPath
())
)
)
+
QDir
::
separator
();
}
void
SettingsModel
::
setSavedVideosFolder
(
const
QString
&
folder
)
{
QString
_folder
=
QDir
::
cleanPath
(
folder
)
+
QDir
::
separator
();
m_config
->
setString
(
UI_SECTION
,
"saved_videos_folder"
,
::
Utils
::
qStringToLinphoneString
(
_folder
));
emit
savedVideosFolderChanged
(
_folder
);
}
linphone-desktop/src/components/settings/SettingsModel.hpp
View file @
c71f1590
...
...
@@ -34,22 +34,34 @@ class SettingsModel : public QObject {
Q_PROPERTY
(
bool
autoAnswerStatus
READ
getAutoAnswerStatus
WRITE
setAutoAnswerStatus
NOTIFY
autoAnswerStatusChanged
);
Q_PROPERTY
(
QString
fileTransferUrl
READ
getFileTransferUrl
WRITE
setFileTransferUrl
NOTIFY
fileTransferUrlChanged
);
Q_PROPERTY
(
QString
savedScreenshotsFolder
READ
getSavedScreenshotsFolder
WRITE
setSavedScreenshotsFolder
NOTIFY
savedScreenshotsFolderChanged
);
Q_PROPERTY
(
QString
savedVideosFolder
READ
getSavedVideosFolder
WRITE
setSavedVideosFolder
NOTIFY
savedVideosFolderChanged
);
public:
SettingsModel
(
QObject
*
parent
=
Q_NULLPTR
);
bool
getAutoAnswerStatus
()
const
;
void
setAutoAnswerStatus
(
bool
status
);
QString
getFileTransferUrl
()
const
;
void
setFileTransferUrl
(
const
QString
&
url
);
QString
getSavedScreenshotsFolder
()
const
;
void
setSavedScreenshotsFolder
(
const
QString
&
folder
);
QString
getSavedVideosFolder
()
const
;
void
setSavedVideosFolder
(
const
QString
&
folder
);
static
const
std
::
string
UI_SECTION
;
signals:
void
autoAnswerStatusChanged
(
bool
status
);
void
fileTransferUrlChanged
(
const
QString
&
url
);
private:
bool
getAutoAnswerStatus
()
const
;
void
setAutoAnswerStatus
(
bool
status
);
QString
getFileTransferUrl
()
const
;
void
setFileTransferUrl
(
const
QString
&
url
);
void
savedScreenshotsFolderChanged
(
const
QString
&
folder
);
void
savedVideosFolderChanged
(
const
QString
&
folder
);
private:
std
::
shared_ptr
<
linphone
::
Config
>
m_config
;
};
...
...
linphone-desktop/ui/views/App/Settings/SettingsUi.qml
View file @
c71f1590
...
...
@@ -89,7 +89,10 @@ TabContainer {
FileChooserButton
{
id
:
savedScreenshotsFolder
selectedFile
:
SettingsModel
.
savedScreenshotsFolder
selectFolder
:
true
onAccepted
:
SettingsModel
.
savedScreenshotsFolder
=
selectedFile
}
}
...
...
@@ -99,7 +102,10 @@ TabContainer {
FileChooserButton
{
id
:
savedVideosFolder
selectedFile
:
SettingsModel
.
savedVideosFolder
selectFolder
:
true
onAccepted
:
SettingsModel
.
savedVideosFolder
=
selectedFile
}
}
}
...
...
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