Commit d84149ef authored by Ronan Abhamon's avatar Ronan Abhamon

feat(SettingsAdvanced): send logs in progress

parent 3a0dbaf9
...@@ -977,6 +977,14 @@ your friend&apos;s SIP address or username.</translation> ...@@ -977,6 +977,14 @@ your friend&apos;s SIP address or username.</translation>
<source>logsFolderLabel</source> <source>logsFolderLabel</source>
<translation>Logs folder</translation> <translation>Logs folder</translation>
</message> </message>
<message>
<source>sendLogs</source>
<translation>SEND LOGS</translation>
</message>
<message>
<source>logsUploadUrlLabel</source>
<translation>Logs upload server url</translation>
</message>
</context> </context>
<context> <context>
<name>SettingsAudio</name> <name>SettingsAudio</name>
......
...@@ -975,6 +975,14 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt; ...@@ -975,6 +975,14 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<source>logsFolderLabel</source> <source>logsFolderLabel</source>
<translation>Dossier des logs</translation> <translation>Dossier des logs</translation>
</message> </message>
<message>
<source>sendLogs</source>
<translation>ENVOYER LOGS</translation>
</message>
<message>
<source>logsUploadUrlLabel</source>
<translation>Url du serveur de logs</translation>
</message>
</context> </context>
<context> <context>
<name>SettingsAudio</name> <name>SettingsAudio</name>
......
[misc] [misc]
version_check_url_root=https://linphone.org/releases version_check_url_root=https://linphone.org/releases
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
[sound] [sound]
ec_filter=MSWebRTCAEC ec_filter=MSWebRTCAEC
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#define QT_DOMAIN "qt" #define QT_DOMAIN "qt"
#define MAX_LOGS_COLLECTION_SIZE 104857600 /* 100MB. */ #define MAX_LOGS_COLLECTION_SIZE 10485760 /* 10MB. */
#define SRC_PATTERN "/linphone-desktop/src/" #define SRC_PATTERN "/linphone-desktop/src/"
......
...@@ -101,7 +101,10 @@ void CoreManager::forceRefreshRegisters () { ...@@ -101,7 +101,10 @@ void CoreManager::forceRefreshRegisters () {
void CoreManager::sendLogs () const { void CoreManager::sendLogs () const {
Q_CHECK_PTR(mCore); Q_CHECK_PTR(mCore);
// TODO.
qInfo() << QStringLiteral("Send logs to: `%1`.")
.arg(::Utils::coreStringToAppString(mCore->getLogCollectionUploadServerUrl()));
mCore->uploadLogCollection();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -730,6 +730,22 @@ void SettingsModel::setLogsFolder (const QString &folder) { ...@@ -730,6 +730,22 @@ void SettingsModel::setLogsFolder (const QString &folder) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString SettingsModel::getLogsUploadUrl () const {
return ::Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getLogCollectionUploadServerUrl()
);
}
void SettingsModel::setLogsUploadUrl (const QString &url) {
CoreManager::getInstance()->getCore()->setLogCollectionUploadServerUrl(
::Utils::appStringToCoreString(url)
);
emit logsUploadUrlChanged(getLogsUploadUrl());
}
// -----------------------------------------------------------------------------
QString SettingsModel::getLogsFolder (const shared_ptr<linphone::Config> &config) { QString SettingsModel::getLogsFolder (const shared_ptr<linphone::Config> &config) {
return ::Utils::coreStringToAppString( return ::Utils::coreStringToAppString(
config->getString(UI_SECTION, "logs_folder", Paths::getLogsDirPath()) config->getString(UI_SECTION, "logs_folder", Paths::getLogsDirPath())
......
...@@ -123,6 +123,7 @@ class SettingsModel : public QObject { ...@@ -123,6 +123,7 @@ class SettingsModel : public QObject {
// Advanced. ----------------------------------------------------------------- // Advanced. -----------------------------------------------------------------
Q_PROPERTY(QString logsFolder READ getLogsFolder WRITE setLogsFolder NOTIFY logsFolderChanged); Q_PROPERTY(QString logsFolder READ getLogsFolder WRITE setLogsFolder NOTIFY logsFolderChanged);
Q_PROPERTY(QString logsUploadUrl READ getLogsUploadUrl WRITE setLogsUploadUrl NOTIFY logsUploadUrlChanged);
public: public:
enum MediaEncryption { enum MediaEncryption {
...@@ -287,6 +288,9 @@ public: ...@@ -287,6 +288,9 @@ public:
QString getLogsFolder () const; QString getLogsFolder () const;
void setLogsFolder (const QString &folder); void setLogsFolder (const QString &folder);
QString getLogsUploadUrl () const;
void setLogsUploadUrl (const QString &url);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
static QString getLogsFolder (const std::shared_ptr<linphone::Config> &config); static QString getLogsFolder (const std::shared_ptr<linphone::Config> &config);
...@@ -371,6 +375,7 @@ signals: ...@@ -371,6 +375,7 @@ signals:
// Advanced. ----------------------------------------------------------------- // Advanced. -----------------------------------------------------------------
void logsFolderChanged (const QString &folder); void logsFolderChanged (const QString &folder);
void logsUploadUrlChanged (const QString &url);
private: private:
std::shared_ptr<linphone::Config> mConfig; std::shared_ptr<linphone::Config> mConfig;
......
...@@ -38,7 +38,6 @@ ApplicationWindow { ...@@ -38,7 +38,6 @@ ApplicationWindow {
minimumHeight: MainWindowStyle.minimumHeight minimumHeight: MainWindowStyle.minimumHeight
minimumWidth: MainWindowStyle.minimumWidth minimumWidth: MainWindowStyle.minimumWidth
width: MainWindowStyle.width
title: MainWindowStyle.title title: MainWindowStyle.title
......
...@@ -32,12 +32,33 @@ TabContainer { ...@@ -32,12 +32,33 @@ TabContainer {
} }
} }
} }
FormLine {
FormGroup {
label: qsTr('logsUploadUrlLabel')
TextField {
text: SettingsModel.logsUploadUrl
onEditingFinished: SettingsModel.logsUploadUrl = text
}
}
}
FormEmptyLine {}
} }
// ------------------------------------------------------------------------- TextButtonB {
// Internal features. anchors.right: parent.right
// ------------------------------------------------------------------------- text: qsTr('sendLogs')
onClicked: CoreManager.sendLogs()
}
// -------------------------------------------------------------------------
// Internal settings.
// -------------------------------------------------------------------------
// Nothing for the moment. // Nothing for the moment.
} }
} }
...@@ -12,8 +12,6 @@ import App.Styles 1.0 ...@@ -12,8 +12,6 @@ import App.Styles 1.0
ApplicationWindow { ApplicationWindow {
id: window id: window
height: SettingsWindowStyle.height
width: SettingsWindowStyle.width
minimumHeight: SettingsWindowStyle.height minimumHeight: SettingsWindowStyle.height
minimumWidth: SettingsWindowStyle.width minimumWidth: SettingsWindowStyle.width
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment