Commit 7e0d1726 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(SettingsModel): provide an email for logs

parent 6ebc8033
...@@ -759,6 +759,19 @@ void SettingsModel::setLogsEnabled (bool status) { ...@@ -759,6 +759,19 @@ void SettingsModel::setLogsEnabled (bool status) {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
QString SettingsModel::getLogsEmail () const {
return ::Utils::coreStringToAppString(
mConfig->getString(UI_SECTION, "logs_email", "")
);
}
void SettingsModel::setLogsEmail (const QString &email) {
mConfig->setString(UI_SECTION, "logs_email", ::Utils::appStringToCoreString(email));
emit logsEmailChanged(email);
}
// ---------------------------------------------------------------------------
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())
......
...@@ -125,6 +125,7 @@ class SettingsModel : public QObject { ...@@ -125,6 +125,7 @@ class SettingsModel : public QObject {
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); Q_PROPERTY(QString logsUploadUrl READ getLogsUploadUrl WRITE setLogsUploadUrl NOTIFY logsUploadUrlChanged);
Q_PROPERTY(bool logsEnabled READ getLogsEnabled WRITE setLogsEnabled NOTIFY logsEnabledChanged); Q_PROPERTY(bool logsEnabled READ getLogsEnabled WRITE setLogsEnabled NOTIFY logsEnabledChanged);
Q_PROPERTY(QString logsEmail READ getLogsEmail WRITE setLogsEmail NOTIFY logsEmailChanged);
public: public:
enum MediaEncryption { enum MediaEncryption {
...@@ -295,6 +296,9 @@ public: ...@@ -295,6 +296,9 @@ public:
bool getLogsEnabled () const; bool getLogsEnabled () const;
void setLogsEnabled (bool status); void setLogsEnabled (bool status);
QString getLogsEmail () const;
void setLogsEmail (const QString &email);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
static QString getLogsFolder (const std::shared_ptr<linphone::Config> &config); static QString getLogsFolder (const std::shared_ptr<linphone::Config> &config);
...@@ -382,6 +386,7 @@ signals: ...@@ -382,6 +386,7 @@ signals:
void logsFolderChanged (const QString &folder); void logsFolderChanged (const QString &folder);
void logsUploadUrlChanged (const QString &url); void logsUploadUrlChanged (const QString &url);
void logsEnabledChanged (bool status); void logsEnabledChanged (bool status);
void logsEmailChanged (const QString &email);
private: private:
std::shared_ptr<linphone::Config> mConfig; std::shared_ptr<linphone::Config> mConfig;
......
...@@ -22,7 +22,8 @@ function handleLogsUploaded (url) { ...@@ -22,7 +22,8 @@ function handleLogsUploaded (url) {
if (url.length) { if (url.length) {
sendLogsBlock.stop('') sendLogsBlock.stop('')
Qt.openUrlExternally( Qt.openUrlExternally(
'mailto:?subject=' + encodeURIComponent('Desktop Linphone Log') + 'mailto:' + encodeURIComponent(Linphone.SettingsModel.logsEmail) +
'?subject=' + encodeURIComponent('Desktop Linphone Log') +
'&body=' + encodeURIComponent(url) '&body=' + encodeURIComponent(url)
) )
} else { } else {
......
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