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
d90a252c
Commit
d90a252c
authored
Jun 23, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(SettingsAdvanced): supports all logs features
parent
95473668
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
214 additions
and
38 deletions
+214
-38
en.ts
assets/languages/en.ts
+4
-0
fr.ts
assets/languages/fr.ts
+5
-1
resources.qrc
resources.qrc
+4
-0
App.cpp
src/app/App.cpp
+1
-1
Logger.cpp
src/app/logger/Logger.cpp
+7
-4
Logger.hpp
src/app/logger/Logger.hpp
+2
-1
CoreHandlers.cpp
src/components/core/CoreHandlers.cpp
+6
-7
CoreHandlers.hpp
src/components/core/CoreHandlers.hpp
+1
-1
CoreManager.cpp
src/components/core/CoreManager.cpp
+11
-4
CoreManager.hpp
src/components/core/CoreManager.hpp
+3
-2
Colors.cpp
src/components/other/colors/Colors.cpp
+13
-13
Colors.hpp
src/components/other/colors/Colors.hpp
+2
-1
Konami.qml
ui/modules/Konami/Konami.qml
+92
-0
qmldir
ui/modules/Konami/qmldir
+5
-0
About.qml
ui/views/App/Main/Dialogs/About.qml
+11
-0
SettingsAdvanced.js
ui/views/App/Settings/SettingsAdvanced.js
+31
-0
SettingsAdvanced.qml
ui/views/App/Settings/SettingsAdvanced.qml
+5
-3
SettingsAdvancedStyle.qml
ui/views/App/Styles/Settings/SettingsAdvancedStyle.qml
+10
-0
qmldir
ui/views/App/Styles/qmldir
+1
-0
No files found.
assets/languages/en.ts
View file @
d90a252c
...
...
@@ -997,6 +997,10 @@ your friend's SIP address or username.</translation>
<
source
>
cleanLogs
<
/source
>
<
translation
>
CLEAN
LOGS
<
/translation
>
<
/message
>
<
message
>
<
source
>
cleanLogsDescription
<
/source
>
<
translation
>
Are
you
sure
you
want
to
remove
all
logs
?
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsAudio
<
/name
>
...
...
assets/languages/fr.ts
View file @
d90a252c
...
...
@@ -985,7 +985,7 @@ Cliquez ici : <a href="%1">%1</a>
<
/message
>
<
message
>
<
source
>
logsUploadFailed
<
/source
>
<
translation
>
L
&
apos
;
envoi
des
logs
a
é
chou
é
.
&
gt
;
<
/translation
>
<
translation
>
L
&
apos
;
envoi
des
logs
a
é
chou
é
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
logsEnabledLabel
<
/source
>
...
...
@@ -995,6 +995,10 @@ Cliquez ici : <a href="%1">%1</a>
<
source
>
cleanLogs
<
/source
>
<
translation
>
SUPPRIMER
LOGS
<
/translation
>
<
/message
>
<
message
>
<
source
>
cleanLogsDescription
<
/source
>
<
translation
>
Voulez
-
vous
vraiment
supprimer
tous
les
logs
?
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsAudio
<
/name
>
...
...
resources.qrc
View file @
d90a252c
...
...
@@ -296,6 +296,8 @@
<file>
ui/modules/Common/Window/VirtualWindow.qml
</file>
<file>
ui/modules/Common/Window/Window.js
</file>
<file>
ui/modules/Common/Window/Window.qml
</file>
<file>
ui/modules/Konami/Konami.qml
</file>
<file>
ui/modules/Konami/qmldir
</file>
<file>
ui/modules/Linphone/Account/AccountStatus.qml
</file>
<file>
ui/modules/Linphone/Blocks/CardBlock.qml
</file>
<file>
ui/modules/Linphone/Blocks/RequestBlock.qml
</file>
...
...
@@ -403,6 +405,7 @@
<file>
ui/views/App/Main/MainWindow.js
</file>
<file>
ui/views/App/Main/MainWindowMenuBar.qml
</file>
<file>
ui/views/App/Main/MainWindow.qml
</file>
<file>
ui/views/App/Settings/SettingsAdvanced.js
</file>
<file>
ui/views/App/Settings/SettingsAdvanced.qml
</file>
<file>
ui/views/App/Settings/SettingsAudio.qml
</file>
<file>
ui/views/App/Settings/SettingsCallsChat.qml
</file>
...
...
@@ -441,6 +444,7 @@
<file>
ui/views/App/Styles/Main/InviteFriendsStyle.qml
</file>
<file>
ui/views/App/Styles/Main/MainWindowStyle.qml
</file>
<file>
ui/views/App/Styles/qmldir
</file>
<file>
ui/views/App/Styles/Settings/SettingsAdvancedStyle.qml
</file>
<file>
ui/views/App/Styles/Settings/SettingsAudioStyle.qml
</file>
<file>
ui/views/App/Styles/Settings/SettingsSipAccountsEditStyle.qml
</file>
<file>
ui/views/App/Styles/Settings/SettingsVideoPreviewStyle.qml
</file>
...
...
src/app/App.cpp
View file @
d90a252c
...
...
@@ -86,7 +86,7 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U
// Initialize logger.
shared_ptr
<
linphone
::
Config
>
config
=
::
getConfigIfExists
(
*
mParser
);
Logger
::
init
(
SettingsModel
::
getLogsFolder
(
config
),
SettingsModel
::
getLogsEnabled
(
config
)
);
Logger
::
init
(
config
);
if
(
mParser
->
isSet
(
"verbose"
))
Logger
::
getInstance
()
->
setVerbose
(
true
);
...
...
src/app/logger/Logger.cpp
View file @
d90a252c
...
...
@@ -25,6 +25,7 @@
#include <QDateTime>
#include <QThread>
#include "../../components/settings/SettingsModel.hpp"
#include "../../utils/Utils.hpp"
#include "../paths/Paths.hpp"
...
...
@@ -159,11 +160,13 @@ void Logger::enable (bool status) {
linphone_core_enable_log_collection
(
status
?
LinphoneLogCollectionEnabled
:
LinphoneLogCollectionDisabled
);
}
void
Logger
::
init
(
const
QString
&
folder
,
bool
enabled
)
{
Q_ASSERT
(
!
folder
.
isEmpty
());
void
Logger
::
init
(
const
std
::
shared_ptr
<
linphone
::
Config
>
&
config
)
{
if
(
mInstance
)
return
;
const
QString
folder
=
SettingsModel
::
getLogsFolder
(
config
);
Q_ASSERT
(
!
folder
.
isEmpty
());
mInstance
=
new
Logger
();
qInstallMessageHandler
(
Logger
::
log
);
...
...
@@ -177,5 +180,5 @@ void Logger::init (const QString &folder, bool enabled) {
linphone_core_set_log_collection_path
(
::
Utils
::
appStringToCoreString
(
folder
).
c_str
());
linphone_core_set_log_collection_max_file_size
(
MAX_LOGS_COLLECTION_SIZE
);
mInstance
->
enable
(
enabled
);
mInstance
->
enable
(
SettingsModel
::
getLogsEnabled
(
config
)
);
}
src/app/logger/Logger.hpp
View file @
d90a252c
...
...
@@ -23,6 +23,7 @@
#ifndef LOGGER_H_
#define LOGGER_H_
#include <linphone++/linphone.hh>
#include <QMutex>
// =============================================================================
...
...
@@ -41,7 +42,7 @@ public:
void
enable
(
bool
status
);
static
void
init
(
const
QString
&
folder
,
bool
enabled
);
static
void
init
(
const
std
::
shared_ptr
<
linphone
::
Config
>
&
config
);
static
Logger
*
getInstance
()
{
return
mInstance
;
...
...
src/components/core/CoreHandlers.cpp
View file @
d90a252c
...
...
@@ -69,8 +69,7 @@ void CoreHandlers::handleCoreCreated () {
void
CoreHandlers
::
notifyCoreStarted
()
{
if
(
mCoreCreated
&&
mCoreStarted
)
scheduleFunctionInApp
(
[
this
]()
{
scheduleFunctionInApp
([
this
]
{
qInfo
()
<<
QStringLiteral
(
"Core started."
);
emit
coreStarted
();
});
...
...
@@ -125,9 +124,9 @@ void CoreHandlers::onGlobalStateChanged (
void
CoreHandlers
::
onLogCollectionUploadStateChanged
(
const
shared_ptr
<
linphone
::
Core
>
&
,
linphone
::
CoreLogCollectionUploadState
state
,
const
string
&
const
string
&
info
)
{
emit
logsUploadStateChanged
(
state
);
emit
logsUploadStateChanged
(
state
,
info
);
}
void
CoreHandlers
::
onLogCollectionUploadProgressIndication
(
...
...
src/components/core/CoreHandlers.hpp
View file @
d90a252c
...
...
@@ -46,7 +46,7 @@ signals:
void
callTransferFailed
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
callTransferSucceeded
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
coreStarted
();
void
logsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
);
void
logsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
,
const
std
::
string
&
info
);
void
messageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
presenceReceived
(
const
QString
&
sipAddress
,
const
std
::
shared_ptr
<
const
linphone
::
PresenceModel
>
&
presenceModel
);
void
registrationStateChanged
(
const
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxyConfig
,
linphone
::
RegistrationState
state
);
...
...
src/components/core/CoreManager.cpp
View file @
d90a252c
...
...
@@ -107,6 +107,8 @@ void CoreManager::forceRefreshRegisters () {
mCore
->
refreshRegisters
();
}
// -----------------------------------------------------------------------------
void
CoreManager
::
sendLogs
()
const
{
Q_CHECK_PTR
(
mCore
);
...
...
@@ -115,6 +117,12 @@ void CoreManager::sendLogs () const {
mCore
->
uploadLogCollection
();
}
void
CoreManager
::
cleanLogs
()
const
{
Q_CHECK_PTR
(
mCore
);
mCore
->
resetLogCollection
();
}
// -----------------------------------------------------------------------------
#define SET_DATABASE_PATH(DATABASE, PATH) \
...
...
@@ -198,15 +206,14 @@ void CoreManager::iterate () {
// -----------------------------------------------------------------------------
void
CoreManager
::
handleLogsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
)
{
void
CoreManager
::
handleLogsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
,
const
string
&
info
)
{
switch
(
state
)
{
case
linphone
:
:
CoreLogCollectionUploadStateInProgress
:
break
;
case
linphone
:
:
CoreLogCollectionUploadStateDelivered
:
emit
logsUploaded
(
true
);
break
;
case
linphone
:
:
CoreLogCollectionUploadStateNotDelivered
:
emit
logsUploaded
(
false
);
emit
logsUploaded
(
::
Utils
::
coreStringToAppString
(
info
)
);
break
;
}
}
...
...
src/components/core/CoreManager.hpp
View file @
d90a252c
...
...
@@ -120,12 +120,13 @@ public:
Q_INVOKABLE
void
forceRefreshRegisters
();
Q_INVOKABLE
void
sendLogs
()
const
;
Q_INVOKABLE
void
cleanLogs
()
const
;
signals:
void
coreCreated
();
void
coreStarted
();
void
logsUploaded
(
bool
success
);
void
logsUploaded
(
const
QString
&
url
);
private:
CoreManager
(
QObject
*
parent
,
const
QString
&
configPath
);
...
...
@@ -140,7 +141,7 @@ private:
void
iterate
();
void
handleLogsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
);
void
handleLogsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
,
const
std
::
string
&
info
);
static
QString
getDownloadUrl
();
...
...
src/components/other/colors/Colors.cpp
View file @
d90a252c
...
...
@@ -20,7 +20,6 @@
* Author: Ronan Abhamon
*/
#include <linphone++/linphone.hh>
#include <QMetaProperty>
#include "../../../utils/Utils.hpp"
...
...
@@ -29,10 +28,6 @@
#define COLORS_SECTION "ui_colors"
#ifndef LINPHONE_FRIDAY
#define LINPHONE_FRIDAY 1
#endif // ifndef LINPHONE_FRIDAY
#if LINPHONE_FRIDAY
#include <QDate>
#endif // if LINPHONE_FRIDAY
...
...
@@ -43,24 +38,29 @@ using namespace std;
#if LINPHONE_FRIDAY
static
void
setLinphoneFridayColors
(
Colors
&
colors
)
{
colors
.
setProperty
(
"i"
,
QColor
(
"#F48D8D"
));
colors
.
setProperty
(
"s"
,
QColor
(
"#F58585"
));
colors
.
setProperty
(
"t"
,
QColor
(
"#FFC5C5"
));
inline
bool
isLinphoneFriday
()
{
return
QDate
::
currentDate
().
dayOfWeek
()
==
5
;
}
#endif // if LINPHONE_FRIDAY
Colors
::
Colors
(
QObject
*
parent
)
:
QObject
(
parent
)
{
#if LINPHONE_FRIDAY
if
(
QDate
::
currentDate
().
dayOfWeek
()
==
5
)
::
setLinphoneFridayColors
(
*
this
);
if
(
isLinphoneFriday
())
{
setProperty
(
"i"
,
QColor
(
"#F48D8D"
));
setProperty
(
"s"
,
QColor
(
"#F58585"
));
setProperty
(
"t"
,
QColor
(
"#FFC5C5"
));
}
#endif // if LINPHONE_FRIDAY
}
void
Colors
::
useConfig
(
const
std
::
shared_ptr
<
linphone
::
Config
>
&
config
)
{
#if LINPHONE_FRIDAY
if
(
!
isLinphoneFriday
())
overrideColors
(
config
);
#else
overrideColors
(
config
);
#endif // if LINPHONE_FRIDAY
}
// -----------------------------------------------------------------------------
...
...
src/components/other/colors/Colors.hpp
View file @
d90a252c
...
...
@@ -23,6 +23,7 @@
#ifndef COLORS_H_
#define COLORS_H_
#include <linphone++/linphone.hh>
#include <QColor>
#include <QObject>
...
...
@@ -48,7 +49,7 @@
// -----------------------------------------------------------------------------
namespace
linphone
{
class
Config
;
class
Config
;
}
class
Colors
:
public
QObject
{
...
...
ui/modules/Konami/Konami.qml
0 → 100644
View file @
d90a252c
/*
* Konami.qml
* Copyright 2017 Ronan Abhamon (https://github.com/Wescoeur)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import
QtQuick
2.7
// =============================================================================
Item
{
id
:
konami
property
var
code
:
[
Qt
.
Key_Up
,
Qt
.
Key_Up
,
Qt
.
Key_Down
,
Qt
.
Key_Down
,
Qt
.
Key_Left
,
Qt
.
Key_Right
,
Qt
.
Key_Left
,
Qt
.
Key_Right
,
Qt
.
Key_B
,
Qt
.
Key_A
]
property
int
delay
:
2000
signal
triggered
// ---------------------------------------------------------------------------
Keys.forwardTo
:
core
Timer
{
id
:
timer
interval
:
konami
.
delay
onTriggered
:
core
.
index
=
0
}
Item
{
id
:
core
property
int
index
:
0
anchors.fill
:
parent
Keys.onPressed
:
{
timer
.
stop
()
var
code
=
konami
.
code
if
(
event
.
key
===
code
[
index
])
{
// 1. Code OK.
if
(
++
index
===
code
.
length
)
{
index
=
0
konami
.
triggered
()
return
}
// 2. Actual key OK.
if
(
delay
>
0
)
{
timer
.
start
()
}
return
}
// 3. Wrong key.
index
=
0
}
}
}
ui/modules/Konami/qmldir
0 → 100644
View file @
d90a252c
module Konami
// =============================================================================
Konami 1.0 Konami.qml
ui/views/App/Main/Dialogs/About.qml
View file @
d90a252c
...
...
@@ -2,6 +2,7 @@ import QtQuick 2.7
import
QtQuick
.
Layouts
1.3
import
Common
1.0
import
Konami
1.0
import
Linphone
1.0
import
App
.
Styles
1.0
...
...
@@ -40,6 +41,16 @@ DialogPlus {
Icon
{
icon
:
'
linphone_logo
'
iconSize
:
parent
.
height
Konami
{
anchors.fill
:
parent
onTriggered
:
console
.
log
(
'
TODO
'
)
MouseArea
{
anchors.fill
:
parent
onClicked
:
parent
.
focus
=
true
}
}
}
Column
{
...
...
ui/views/App/Settings/SettingsAdvanced.js
0 → 100644
View file @
d90a252c
// =============================================================================
// `SettingsAdvanced.qml` Logic.
// =============================================================================
.
import
Linphone
1.0
as
Linphone
.
import
'
qrc:/ui/scripts/Utils/utils.js
'
as
Utils
// =============================================================================
function
cleanLogs
()
{
window
.
attachVirtualWindow
(
Utils
.
buildDialogUri
(
'
ConfirmDialog
'
),
{
descriptionText
:
qsTr
(
'
cleanLogsDescription
'
),
},
function
(
status
)
{
if
(
status
)
{
Linphone
.
CoreManager
.
cleanLogs
()
}
})
}
function
handleLogsUploaded
(
url
)
{
if
(
url
.
length
)
{
sendLogsBlock
.
stop
(
''
)
Qt
.
openUrlExternally
(
'
mailto:?subject=
'
+
encodeURIComponent
(
'
Desktop Linphone Log
'
)
+
'
&body=
'
+
encodeURIComponent
(
url
)
)
}
else
{
sendLogsBlock
.
stop
(
qsTr
(
'
logsUploadFailed
'
))
}
}
ui/views/App/Settings/SettingsAdvanced.qml
View file @
d90a252c
...
...
@@ -5,6 +5,8 @@ import Linphone 1.0
import
App
.
Styles
1.0
import
'
SettingsAdvanced.js
'
as
Logic
// =============================================================================
TabContainer
{
...
...
@@ -63,12 +65,12 @@ TabContainer {
Row
{
anchors.right
:
parent
.
right
spacing
:
5
spacing
:
SettingsAdvancedStyle
.
buttons
.
spacing
TextButtonB
{
text
:
qsTr
(
'
cleanLogs
'
)
onClicked
:
CoreManager
.
cleanLogs
()
onClicked
:
Logic
.
cleanLogs
()
}
TextButtonB
{
...
...
@@ -88,7 +90,7 @@ TabContainer {
Connections
{
target
:
CoreManager
onLogsUploaded
:
sendLogsBlock
.
stop
(
success
?
''
:
qsTr
(
'
logsUploadFailed
'
)
)
onLogsUploaded
:
Logic
.
handleLogsUploaded
(
url
)
}
}
...
...
ui/views/App/Styles/Settings/SettingsAdvancedStyle.qml
0 → 100644
View file @
d90a252c
pragma
Singleton
import
QtQml
2.2
// =============================================================================
QtObject
{
property
QtObject
buttons
:
QtObject
{
property
int
spacing
:
10
}
}
ui/views/App/Styles/qmldir
View file @
d90a252c
...
...
@@ -31,6 +31,7 @@ singleton AboutStyle 1.0 Main/Dialogs/AboutS
singleton AuthenticationRequestStyle 1.0 Main/Dialogs/AuthenticationRequestStyle.qml
singleton ManageAccountsStyle 1.0 Main/Dialogs/ManageAccountsStyle.qml
singleton SettingsAdvancedStyle 1.0 Settings/SettingsAdvancedStyle.qml
singleton SettingsAudioStyle 1.0 Settings/SettingsAudioStyle.qml
singleton SettingsSipAccountsEditStyle 1.0 Settings/SettingsSipAccountsEditStyle.qml
singleton SettingsVideoPreviewStyle 1.0 Settings/SettingsVideoPreviewStyle.qml
...
...
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