Commit d84149ef authored by Ronan's avatar Ronan

feat(SettingsAdvanced): send logs in progress

parent 3a0dbaf9
......@@ -977,6 +977,14 @@ your friend&apos;s SIP address or username.</translation>
<source>logsFolderLabel</source>
<translation>Logs folder</translation>
</message>
<message>
<source>sendLogs</source>
<translation>SEND LOGS</translation>
</message>
<message>
<source>logsUploadUrlLabel</source>
<translation>Logs upload server url</translation>
</message>
</context>
<context>
<name>SettingsAudio</name>
......
......@@ -975,6 +975,14 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<source>logsFolderLabel</source>
<translation>Dossier des logs</translation>
</message>
<message>
<source>sendLogs</source>
<translation>ENVOYER LOGS</translation>
</message>
<message>
<source>logsUploadUrlLabel</source>
<translation>Url du serveur de logs</translation>
</message>
</context>
<context>
<name>SettingsAudio</name>
......
[misc]
version_check_url_root=https://linphone.org/releases
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
[sound]
ec_filter=MSWebRTCAEC
......@@ -48,7 +48,7 @@
#define QT_DOMAIN "qt"
#define MAX_LOGS_COLLECTION_SIZE 104857600 /* 100MB. */
#define MAX_LOGS_COLLECTION_SIZE 10485760 /* 10MB. */
#define SRC_PATTERN "/linphone-desktop/src/"
......
......@@ -101,7 +101,10 @@ void CoreManager::forceRefreshRegisters () {
void CoreManager::sendLogs () const {
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) {
// -----------------------------------------------------------------------------
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) {
return ::Utils::coreStringToAppString(
config->getString(UI_SECTION, "logs_folder", Paths::getLogsDirPath())
......
......@@ -123,6 +123,7 @@ class SettingsModel : public QObject {
// Advanced. -----------------------------------------------------------------
Q_PROPERTY(QString logsFolder READ getLogsFolder WRITE setLogsFolder NOTIFY logsFolderChanged);
Q_PROPERTY(QString logsUploadUrl READ getLogsUploadUrl WRITE setLogsUploadUrl NOTIFY logsUploadUrlChanged);
public:
enum MediaEncryption {
......@@ -287,6 +288,9 @@ public:
QString getLogsFolder () const;
void setLogsFolder (const QString &folder);
QString getLogsUploadUrl () const;
void setLogsUploadUrl (const QString &url);
// ---------------------------------------------------------------------------
static QString getLogsFolder (const std::shared_ptr<linphone::Config> &config);
......@@ -371,6 +375,7 @@ signals:
// Advanced. -----------------------------------------------------------------
void logsFolderChanged (const QString &folder);
void logsUploadUrlChanged (const QString &url);
private:
std::shared_ptr<linphone::Config> mConfig;
......
......@@ -38,7 +38,6 @@ ApplicationWindow {
minimumHeight: MainWindowStyle.minimumHeight
minimumWidth: MainWindowStyle.minimumWidth
width: MainWindowStyle.width
title: MainWindowStyle.title
......
......@@ -32,12 +32,33 @@ TabContainer {
}
}
}
FormLine {
FormGroup {
label: qsTr('logsUploadUrlLabel')
TextField {
text: SettingsModel.logsUploadUrl
onEditingFinished: SettingsModel.logsUploadUrl = text
}
}
}
FormEmptyLine {}
}
// -------------------------------------------------------------------------
// Internal features.
// -------------------------------------------------------------------------
TextButtonB {
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
ApplicationWindow {
id: window
height: SettingsWindowStyle.height
width: SettingsWindowStyle.width
minimumHeight: SettingsWindowStyle.height
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