mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
Help Page (including Log enable/clear/send)
This commit is contained in:
parent
6eb9932254
commit
1e065cfa72
24 changed files with 626 additions and 51 deletions
|
|
@ -53,7 +53,12 @@ if(NOT LINPHONEAPP_VERSION)
|
|||
bc_compute_full_version(LINPHONEAPP_VERSION)
|
||||
endif()
|
||||
include(application_info.cmake)
|
||||
|
||||
string(TIMESTAMP CURRENT_YEAR "%Y")
|
||||
if(NOT APPLICATION_START_LICENCE OR "${CURRENT_YEAR}" STREQUAL "${APPLICATION_START_LICENCE}")
|
||||
set(COPYRIGHT_RANGE_DATE "${APPLICATION_START_LICENCE}")
|
||||
else()
|
||||
set(COPYRIGHT_RANGE_DATE "${APPLICATION_START_LICENCE}-${CURRENT_YEAR}")
|
||||
endif()
|
||||
|
||||
|
||||
if(MEDIASTREAMER2_PLUGINS_LOCATION)
|
||||
|
|
|
|||
|
|
@ -160,6 +160,30 @@ void App::init() {
|
|||
|
||||
mEngine->addImportPath(":/");
|
||||
mEngine->rootContext()->setContextProperty("applicationDirPath", QGuiApplication::applicationDirPath());
|
||||
#ifdef APPLICATION_VENDOR
|
||||
mEngine->rootContext()->setContextProperty("applicationVendor", APPLICATION_VENDOR);
|
||||
#else
|
||||
mEngine->rootContext()->setContextProperty("applicationVendor", "");
|
||||
#endif
|
||||
#ifdef APPLICATION_LICENCE
|
||||
mEngine->rootContext()->setContextProperty("applicationLicence", APPLICATION_LICENCE);
|
||||
#else
|
||||
mEngine->rootContext()->setContextProperty("applicationLicence", "");
|
||||
#endif
|
||||
#ifdef APPLICATION_LICENCE_URL
|
||||
mEngine->rootContext()->setContextProperty("applicationLicenceUrl", APPLICATION_LICENCE_URL);
|
||||
#else
|
||||
mEngine->rootContext()->setContextProperty("applicationLicenceUrl", "");
|
||||
#endif
|
||||
#ifdef COPYRIGHT_RANGE_DATE
|
||||
mEngine->rootContext()->setContextProperty("copyrightRangeDate", COPYRIGHT_RANGE_DATE);
|
||||
#else
|
||||
mEngine->rootContext()->setContextProperty("copyrightRangeDate", "");
|
||||
#endif
|
||||
mEngine->rootContext()->setContextProperty("applicationName", APPLICATION_NAME);
|
||||
mEngine->rootContext()->setContextProperty("executableName", EXECUTABLE_NAME);
|
||||
|
||||
|
||||
initCppInterfaces();
|
||||
mEngine->addImageProvider(ImageProvider::ProviderId, new ImageProvider());
|
||||
mEngine->addImageProvider(AvatarProvider::ProviderId, new AvatarProvider());
|
||||
|
|
|
|||
|
|
@ -63,6 +63,11 @@ Settings::Settings(QObject *parent) : QObject(parent) {
|
|||
mVideoDevice = mSettingsModel->getVideoDevice();
|
||||
mVideoDevices = mSettingsModel->getVideoDevices();
|
||||
|
||||
//Logs
|
||||
mLogsEnabled = mSettingsModel->getLogsEnabled();
|
||||
mFullLogsEnabled = mSettingsModel->getFullLogsEnabled();
|
||||
mLogsFolder = mSettingsModel->getLogsFolder();
|
||||
mLogsEmail = mSettingsModel->getLogsEmail();
|
||||
}
|
||||
|
||||
Settings::~Settings() {
|
||||
|
|
@ -229,6 +234,45 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
|
|||
emit videoDevicesChanged();
|
||||
});
|
||||
});
|
||||
|
||||
// Logs
|
||||
mSettingsModelConnection->makeConnectToCore(&Settings::setLogsEnabled, [this](const bool status) {
|
||||
mSettingsModelConnection->invokeToModel(
|
||||
[this, status]() { mSettingsModel->setLogsEnabled(status); });
|
||||
});
|
||||
|
||||
mSettingsModelConnection->makeConnectToModel(&SettingsModel::logsEnabledChanged, [this](const bool status) {
|
||||
mSettingsModelConnection->invokeToCore(
|
||||
[this, status]() {
|
||||
mLogsEnabled = status;
|
||||
emit logsEnabledChanged();
|
||||
});
|
||||
});
|
||||
|
||||
mSettingsModelConnection->makeConnectToCore(&Settings::setFullLogsEnabled, [this](const bool status) {
|
||||
mSettingsModelConnection->invokeToModel(
|
||||
[this, status]() { mSettingsModel->setFullLogsEnabled(status); });
|
||||
});
|
||||
|
||||
mSettingsModelConnection->makeConnectToModel(&SettingsModel::fullLogsEnabledChanged, [this](const bool status) {
|
||||
mSettingsModelConnection->invokeToCore(
|
||||
[this, status]() {
|
||||
mFullLogsEnabled = status;
|
||||
emit fullLogsEnabledChanged();
|
||||
});
|
||||
});
|
||||
|
||||
auto coreModelConnection = QSharedPointer<SafeConnection<Settings, CoreModel>>(
|
||||
new SafeConnection<Settings, CoreModel>(me, CoreModel::getInstance()), &QObject::deleteLater);
|
||||
|
||||
coreModelConnection->makeConnectToModel(&CoreModel::logCollectionUploadStateChanged, [this](auto core, auto state, auto info) {
|
||||
mSettingsModelConnection->invokeToCore(
|
||||
[this, state, info]() {
|
||||
if (state == linphone::Core::LogCollectionUploadState::Delivered || state == linphone::Core::LogCollectionUploadState::NotDelivered) {
|
||||
emit logsUploadTerminated(state == linphone::Core::LogCollectionUploadState::Delivered, Utils::coreStringToAppString(info));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
QString Settings::getConfigPath(const QCommandLineParser &parser) {
|
||||
|
|
@ -319,3 +363,31 @@ void Settings::updateMicVolume() const {
|
|||
[this]() { mSettingsModel->getMicVolume(); }
|
||||
);
|
||||
}
|
||||
|
||||
bool Settings::getLogsEnabled () const {
|
||||
return mLogsEnabled;
|
||||
}
|
||||
|
||||
bool Settings::getFullLogsEnabled () const {
|
||||
return mFullLogsEnabled;
|
||||
}
|
||||
|
||||
void Settings::cleanLogs () const {
|
||||
mSettingsModelConnection->invokeToModel(
|
||||
[this]() { mSettingsModel->cleanLogs(); }
|
||||
);
|
||||
}
|
||||
|
||||
void Settings::sendLogs () const {
|
||||
mSettingsModelConnection->invokeToModel(
|
||||
[this]() { mSettingsModel->sendLogs(); }
|
||||
);
|
||||
}
|
||||
|
||||
QString Settings::getLogsEmail () const {
|
||||
return mLogsEmail;
|
||||
}
|
||||
|
||||
QString Settings::getLogsFolder () const {
|
||||
return mLogsFolder;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,12 @@ class Settings : public QObject, public AbstractObject {
|
|||
Q_PROPERTY(QString videoDevice READ getVideoDevice WRITE setVideoDevice NOTIFY videoDeviceChanged)
|
||||
|
||||
Q_PROPERTY(float micVolume MEMBER _dummy_int NOTIFY micVolumeChanged)
|
||||
|
||||
Q_PROPERTY(bool logsEnabled READ getLogsEnabled WRITE setLogsEnabled NOTIFY logsEnabledChanged)
|
||||
Q_PROPERTY(bool fullLogsEnabled READ getFullLogsEnabled WRITE setFullLogsEnabled NOTIFY fullLogsEnabledChanged)
|
||||
Q_PROPERTY(QString logsEmail READ getLogsEmail)
|
||||
Q_PROPERTY(QString logsFolder READ getLogsFolder)
|
||||
|
||||
|
||||
public:
|
||||
static QSharedPointer<Settings> create();
|
||||
|
|
@ -104,6 +110,15 @@ public:
|
|||
Q_INVOKABLE void closeCallSettings();
|
||||
Q_INVOKABLE void updateMicVolume() const;
|
||||
|
||||
bool getLogsEnabled () const;
|
||||
bool getFullLogsEnabled () const;
|
||||
|
||||
Q_INVOKABLE void cleanLogs () const;
|
||||
Q_INVOKABLE void sendLogs () const;
|
||||
QString getLogsEmail () const;
|
||||
QString getLogsFolder () const;
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
// Security
|
||||
|
|
@ -145,12 +160,21 @@ signals:
|
|||
|
||||
void echoCancellationCalibrationChanged();
|
||||
void micVolumeChanged(float volume);
|
||||
|
||||
|
||||
void logsEnabledChanged ();
|
||||
void fullLogsEnabledChanged ();
|
||||
|
||||
void setLogsEnabled (bool status);
|
||||
void setFullLogsEnabled (bool status);
|
||||
|
||||
void logsUploadTerminated (bool status, QString url);
|
||||
void logsEmailChanged (const QString &email);
|
||||
void logsFolderChanged (const QString &folder);
|
||||
|
||||
private:
|
||||
std::shared_ptr<SettingsModel> mSettingsModel;
|
||||
|
||||
// Dummy properties (for properties that use values from core received throuh signals)
|
||||
// Dummy properties (for properties that use values from core received through signals)
|
||||
int _dummy_int = 0;
|
||||
|
||||
// Security
|
||||
|
|
@ -177,6 +201,12 @@ private:
|
|||
float mPlaybackGain;
|
||||
int mEchoCancellationCalibration;
|
||||
|
||||
//Debug logs
|
||||
bool mLogsEnabled;
|
||||
bool mFullLogsEnabled;
|
||||
QString mLogsFolder;
|
||||
QString mLogsEmail;
|
||||
|
||||
QSettings mAppSettings;
|
||||
QSharedPointer<SafeConnection<Settings, SettingsModel>> mSettingsModelConnection;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ username_regex=^[a-z0-9+_.\-]*$
|
|||
lime_update_threshold=86400
|
||||
|
||||
[misc]
|
||||
#log_collection_upload_server_url=https://www.linphone.org:444/lft.php
|
||||
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
|
||||
aggregate_imdn=1
|
||||
enable_basic_to_client_group_chat_room_migration=0
|
||||
enable_simple_group_chat_message_state=0
|
||||
|
|
|
|||
3
Linphone/data/image/debug.svg
Normal file
3
Linphone/data/image/debug.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M26.6617 6.43733C26.5994 6.28357 26.5009 6.14719 26.3744 6.03989C26.2479 5.93259 26.0973 5.85758 25.9354 5.82127C25.7736 5.78497 25.6053 5.78847 25.4451 5.83146C25.2849 5.87446 25.1375 5.95566 25.0156 6.06812L19.8493 10.8358L17.6405 10.3614L17.1661 8.1526L21.9338 2.98628C22.0462 2.86435 22.1274 2.71697 22.1704 2.55677C22.2134 2.39657 22.2169 2.22833 22.1806 2.06648C22.1443 1.90463 22.0693 1.754 21.962 1.62751C21.8547 1.50102 21.7183 1.40244 21.5646 1.34023C20.1633 0.773389 18.6442 0.559365 17.1409 0.716963C15.6376 0.874562 14.1959 1.39896 12.9427 2.24408C11.6894 3.08921 10.6629 4.22919 9.95331 5.56386C9.24373 6.89854 8.87279 8.38706 8.87309 9.89864C8.87142 11.1751 9.13328 12.4381 9.64226 13.6087L1.92354 20.2826C1.90431 20.298 1.88637 20.3159 1.86842 20.3326C1.099 21.102 0.666748 22.1455 0.666748 23.2337C0.666748 23.7724 0.772869 24.3059 0.979052 24.8037C1.18524 25.3015 1.48744 25.7538 1.86842 26.1347C2.2494 26.5157 2.70168 26.8179 3.19945 27.0241C3.69722 27.2303 4.23073 27.3364 4.76951 27.3364C5.85763 27.3364 6.90118 26.9042 7.6706 26.1347C7.68727 26.1181 7.70521 26.0989 7.7206 26.0809L14.3932 18.3596C15.7988 18.9766 17.3361 19.2333 18.8659 19.1065C20.3957 18.9797 21.8697 18.4733 23.1545 17.6332C24.4393 16.7932 25.4943 15.6459 26.2239 14.2954C26.9536 12.9449 27.3349 11.4337 27.3334 9.89864C27.3354 8.71229 27.1073 7.53681 26.6617 6.43733ZM18.1032 17.0777C16.8893 17.076 15.6955 16.7673 14.633 16.1803C14.4271 16.0666 14.1884 16.027 13.9569 16.0683C13.7254 16.1097 13.5151 16.2293 13.3612 16.4072L6.19506 24.7066C5.80726 25.0751 5.29089 25.2774 4.75603 25.2706C4.22117 25.2637 3.71014 25.0482 3.33191 24.67C2.95367 24.2917 2.73815 23.7807 2.73131 23.2459C2.72446 22.711 2.92682 22.1946 3.29525 21.8068L11.5883 14.6419C11.7665 14.488 11.8863 14.2775 11.9276 14.0457C11.969 13.8139 11.9293 13.5749 11.8152 13.3689C11.1614 12.1865 10.8546 10.8436 10.93 9.49454C11.0055 8.14551 11.46 6.84515 12.2415 5.74296C13.023 4.64076 14.0997 3.78147 15.3477 3.26388C16.5958 2.7463 17.9646 2.59142 19.2968 2.81706L15.297 7.15139C15.1857 7.27211 15.1051 7.4178 15.0618 7.57618C15.0185 7.73457 15.0139 7.90104 15.0483 8.06158L15.7739 11.437C15.8154 11.6301 15.9118 11.807 16.0514 11.9466C16.191 12.0863 16.368 12.1826 16.561 12.2241L19.939 12.9497C20.0996 12.9842 20.266 12.9795 20.4244 12.9363C20.5828 12.893 20.7285 12.8123 20.8492 12.701L25.1835 8.70128C25.3563 9.73071 25.3028 10.7854 25.0267 11.7921C24.7506 12.7987 24.2585 13.7331 23.5846 14.5303C22.9108 15.3275 22.0714 15.9684 21.1248 16.4083C20.1781 16.8482 19.1471 17.0766 18.1032 17.0777Z" fill="#FE5E00"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
3
Linphone/data/image/license.svg
Normal file
3
Linphone/data/image/license.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M27.3334 2.88884V25.1105C27.3334 25.6999 27.0993 26.2651 26.6826 26.6819C26.2658 27.0986 25.7006 27.3327 25.1112 27.3327H15.1115C14.8168 27.3327 14.5342 27.2157 14.3258 27.0073C14.1175 26.7989 14.0004 26.5163 14.0004 26.2216C14.0004 25.927 14.1175 25.6443 14.3258 25.436C14.5342 25.2276 14.8168 25.1105 15.1115 25.1105H25.1112V2.88884H2.88954V16.2219C2.88954 16.5165 2.77248 16.7992 2.56411 17.0075C2.35574 17.2159 2.07313 17.333 1.77845 17.333C1.48377 17.333 1.20116 17.2159 0.992795 17.0075C0.784426 16.7992 0.667366 16.5165 0.667366 16.2219V2.88884C0.667366 2.29949 0.901487 1.73427 1.31822 1.31753C1.73496 0.900793 2.30018 0.666672 2.88954 0.666672H25.1112C25.7006 0.666672 26.2658 0.900793 26.6826 1.31753C27.0993 1.73427 27.3334 2.29949 27.3334 2.88884ZM13.6754 17.6579C13.5722 17.5546 13.4497 17.4727 13.3148 17.4168C13.1799 17.3609 13.0353 17.3321 12.8893 17.3321C12.7433 17.3321 12.5987 17.3609 12.4638 17.4168C12.3289 17.4727 12.2064 17.5546 12.1032 17.6579L5.11171 24.6508L2.56454 22.1023C2.46131 21.9991 2.33876 21.9172 2.20388 21.8613C2.069 21.8054 1.92444 21.7767 1.77845 21.7767C1.63246 21.7767 1.4879 21.8054 1.35302 21.8613C1.21814 21.9172 1.09559 21.9991 0.992358 22.1023C0.889127 22.2055 0.80724 22.3281 0.751371 22.4629C0.695503 22.5978 0.666748 22.7424 0.666748 22.8884C0.666748 23.0344 0.695503 23.1789 0.751371 23.3138C0.80724 23.4487 0.889127 23.5712 0.992358 23.6745L4.32561 27.0077C4.4288 27.111 4.55134 27.193 4.68623 27.2489C4.82111 27.3048 4.96569 27.3336 5.11171 27.3336C5.25772 27.3336 5.4023 27.3048 5.53719 27.2489C5.67207 27.193 5.79461 27.111 5.8978 27.0077L13.6754 19.2301C13.7787 19.1269 13.8607 19.0044 13.9166 18.8695C13.9725 18.7346 14.0013 18.59 14.0013 18.444C14.0013 18.298 13.9725 18.1534 13.9166 18.0186C13.8607 17.8837 13.7787 17.7611 13.6754 17.6579Z" fill="#FE5E00"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
3
Linphone/data/image/world.svg
Normal file
3
Linphone/data/image/world.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.0001 0.666656C11.363 0.666656 8.78514 1.44864 6.59248 2.91373C4.39983 4.37881 2.69086 6.46119 1.68169 8.89754C0.672525 11.3339 0.408481 14.0148 0.92295 16.6012C1.43742 19.1876 2.7073 21.5634 4.572 23.4281C6.4367 25.2928 8.81247 26.5627 11.3989 27.0771C13.9853 27.5916 16.6662 27.3275 19.1025 26.3184C21.5389 25.3092 23.6213 23.6002 25.0863 21.4076C26.5514 19.2149 27.3334 16.6371 27.3334 14C27.3297 10.4649 25.9237 7.0757 23.424 4.57602C20.9244 2.07635 17.5352 0.67039 14.0001 0.666656ZM25.2821 14C25.2833 15.4474 25.0046 16.8814 24.4616 18.2231L18.7309 14.6987C18.4872 14.5483 18.2146 14.4509 17.9309 14.4128L15.0052 14.0179C14.6021 13.9654 14.1924 14.0329 13.8275 14.2122C13.4626 14.3915 13.1587 14.6744 12.9539 15.0256H11.836L11.3488 14.0179C11.2141 13.7373 11.017 13.4913 10.7726 13.2986C10.5281 13.106 10.2428 12.9718 9.93855 12.9064L8.91291 12.6846L9.91547 10.9231H12.0578C12.4044 10.9224 12.7453 10.8342 13.0488 10.6667L14.6193 9.79999C14.7573 9.72307 14.8863 9.63106 15.0039 9.52563L18.4539 6.40512C18.7998 6.09513 19.0297 5.6765 19.1057 5.21829C19.1817 4.76007 19.0992 4.28964 18.8719 3.8846L18.8257 3.80127C20.7562 4.71665 22.3876 6.16075 23.5304 7.96596C24.6732 9.77116 25.2806 11.8635 25.2821 14ZM15.9629 2.88973L17.077 4.8846L13.627 8.00512L12.0578 8.87178H9.91547C9.55488 8.87125 9.20053 8.96578 8.88811 9.14585C8.5757 9.32591 8.31628 9.58514 8.13598 9.89742L7.01675 11.85L5.71547 8.38332L7.11803 5.06666C8.3595 4.10742 9.78763 3.41806 11.311 3.04275C12.8343 2.66744 14.4192 2.61445 15.9642 2.88717L15.9629 2.88973ZM2.71804 14C2.71632 12.3231 3.09045 10.6671 3.81291 9.15383L5.26675 13.0346C5.38791 13.3559 5.5878 13.6417 5.84808 13.8657C6.10836 14.0897 6.42072 14.2447 6.7565 14.3167L9.50393 14.9077L9.99239 15.9231C10.1619 16.2684 10.4246 16.5595 10.7509 16.7634C11.0771 16.9673 11.4538 17.0759 11.8385 17.0769H12.0283L11.1014 19.1577C10.938 19.5241 10.8857 19.9303 10.9509 20.3261C11.0161 20.7219 11.1959 21.0899 11.468 21.3846L11.486 21.4026L14.0001 23.9923L13.7514 25.2743C10.805 25.2058 8.00208 23.9884 5.94075 21.8821C3.87943 19.7757 2.72292 16.9472 2.71804 14ZM15.8693 25.1256L16.0142 24.3808C16.0737 24.0643 16.0584 23.7383 15.9693 23.4289C15.8803 23.1194 15.72 22.8351 15.5014 22.5987C15.4951 22.593 15.4891 22.5871 15.4834 22.5808L12.9744 19.9923L14.7309 16.0513L17.6565 16.4461L23.518 20.0513C22.6688 21.3849 21.5493 22.5256 20.2318 23.3996C18.9144 24.2737 17.4282 24.8617 15.8693 25.1256Z" fill="#FE5E00"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -110,6 +110,11 @@ std::shared_ptr<linphone::Core> CoreModel::getCore() {
|
|||
return mCore;
|
||||
}
|
||||
|
||||
std::shared_ptr<LoggerModel> CoreModel::getLogger() {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return mLogger;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
void CoreModel::setConfigPath(QString path) {
|
||||
if (mConfigPath != path) {
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ public:
|
|||
static std::shared_ptr<CoreModel> getInstance();
|
||||
|
||||
std::shared_ptr<linphone::Core> getCore();
|
||||
std::shared_ptr<LoggerModel> getLogger();
|
||||
|
||||
void start();
|
||||
void setConfigPath(QString path);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "LoggerModel.hpp"
|
||||
#include "tool/Constants.hpp"
|
||||
#include "tool/Utils.hpp"
|
||||
#include "model/setting/SettingsModel.hpp"
|
||||
|
||||
#include "core/logger/QtLogger.hpp"
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
@ -122,12 +123,11 @@ void LoggerModel::enable(bool status) {
|
|||
: linphone::LogCollectionState::Disabled);
|
||||
}
|
||||
|
||||
void LoggerModel::init(const std::shared_ptr<linphone::Config> &config) {
|
||||
// TODO update from config
|
||||
// const QString folder = SettingsModel::getLogsFolder(config);
|
||||
// linphone::Core::setLogCollectionPath(Utils::appStringToCoreString(folder));
|
||||
// enableFullLogs(SettingsModel::getFullLogsEnabled(config));
|
||||
// enable(SettingsModel::getLogsEnabled(config));
|
||||
void LoggerModel::applyConfig(const std::shared_ptr<linphone::Config> &config) {
|
||||
const QString folder = SettingsModel::getLogsFolder(config);
|
||||
linphone::Core::setLogCollectionPath(Utils::appStringToCoreString(folder));
|
||||
enableFullLogs(SettingsModel::getFullLogsEnabled(config));
|
||||
enable(SettingsModel::getLogsEnabled(config));
|
||||
}
|
||||
|
||||
void LoggerModel::init() {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public:
|
|||
void enableQtOnly(const bool &enable);
|
||||
|
||||
void init();
|
||||
void init(const std::shared_ptr<linphone::Config> &config);
|
||||
void applyConfig(const std::shared_ptr<linphone::Config> &config);
|
||||
|
||||
void onQtLog(QtMsgType type, QString msg); // Received from Qt
|
||||
void onLinphoneLog(const std::shared_ptr<linphone::LoggingService> &,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
#include "model/core/CoreModel.hpp"
|
||||
#include "tool/Utils.hpp"
|
||||
#include "model/tool/ToolModel.hpp"
|
||||
#include "core/path/Paths.hpp"
|
||||
|
||||
|
||||
// =============================================================================
|
||||
|
||||
|
|
@ -32,13 +34,14 @@ using namespace std;
|
|||
const std::string SettingsModel::UiSection("ui");
|
||||
|
||||
SettingsModel::SettingsModel(QObject *parent) : QObject(parent) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
auto core = CoreModel::getInstance()->getCore();
|
||||
mConfig = core->getConfig();
|
||||
CoreModel::getInstance()->getLogger()->applyConfig(mConfig);
|
||||
}
|
||||
|
||||
SettingsModel::~SettingsModel() {
|
||||
mustBeInLinphoneThread("~" + getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
}
|
||||
|
||||
bool SettingsModel::isReadOnly(const std::string §ion, const std::string &name) const {
|
||||
|
|
@ -51,7 +54,7 @@ std::string SettingsModel::getEntryFullName(const std::string §ion, const st
|
|||
}
|
||||
|
||||
QStringList SettingsModel::getVideoDevices() const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
auto core = CoreModel::getInstance()->getCore();
|
||||
QStringList result;
|
||||
for (auto &device : core->getVideoDevicesList()) {
|
||||
|
|
@ -61,14 +64,14 @@ QStringList SettingsModel::getVideoDevices() const {
|
|||
}
|
||||
|
||||
QString SettingsModel::getVideoDevice () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return Utils::coreStringToAppString(
|
||||
CoreModel::getInstance()->getCore()->getVideoDevice()
|
||||
);
|
||||
}
|
||||
|
||||
void SettingsModel::setVideoDevice (const QString &device) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
CoreModel::getInstance()->getCore()->setVideoDevice(
|
||||
Utils::appStringToCoreString(device)
|
||||
);
|
||||
|
|
@ -80,24 +83,24 @@ void SettingsModel::setVideoDevice (const QString &device) {
|
|||
// =============================================================================
|
||||
|
||||
bool SettingsModel::getIsInCall() const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return CoreModel::getInstance()->getCore()->getCallsNb() != 0;
|
||||
}
|
||||
|
||||
void SettingsModel::resetCaptureGraph() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
deleteCaptureGraph();
|
||||
createCaptureGraph();
|
||||
}
|
||||
void SettingsModel::createCaptureGraph() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
mSimpleCaptureGraph =
|
||||
new MediastreamerUtils::SimpleCaptureGraph(Utils::appStringToCoreString(getCaptureDevice()), Utils::appStringToCoreString(getPlaybackDevice()));
|
||||
mSimpleCaptureGraph->start();
|
||||
emit captureGraphRunningChanged(getCaptureGraphRunning());
|
||||
}
|
||||
void SettingsModel::startCaptureGraph() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (!getIsInCall()) {
|
||||
if (!mSimpleCaptureGraph) {
|
||||
qDebug() << "Starting capture graph [" << mCaptureGraphListenerCount << "]";
|
||||
|
|
@ -107,7 +110,7 @@ void SettingsModel::startCaptureGraph() {
|
|||
}
|
||||
}
|
||||
void SettingsModel::stopCaptureGraph() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (mCaptureGraphListenerCount > 0) {
|
||||
if (--mCaptureGraphListenerCount == 0) {
|
||||
qDebug() << "Stopping capture graph [" << mCaptureGraphListenerCount << "]";
|
||||
|
|
@ -116,14 +119,14 @@ void SettingsModel::stopCaptureGraph() {
|
|||
}
|
||||
}
|
||||
void SettingsModel::stopCaptureGraphs() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (mCaptureGraphListenerCount > 0) {
|
||||
mCaptureGraphListenerCount = 0;
|
||||
deleteCaptureGraph();
|
||||
}
|
||||
}
|
||||
void SettingsModel::deleteCaptureGraph() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (mSimpleCaptureGraph) {
|
||||
if (mSimpleCaptureGraph->isRunning()) {
|
||||
mSimpleCaptureGraph->stop();
|
||||
|
|
@ -135,7 +138,7 @@ void SettingsModel::deleteCaptureGraph() {
|
|||
//Force a call on the 'detect' method of all audio filters, updating new or removed devices
|
||||
void SettingsModel::accessCallSettings() {
|
||||
// Audio
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
CoreModel::getInstance()->getCore()->reloadSoundDevices();
|
||||
emit captureDevicesChanged(getCaptureDevices());
|
||||
emit playbackDevicesChanged(getPlaybackDevices());
|
||||
|
|
@ -156,18 +159,18 @@ void SettingsModel::accessCallSettings() {
|
|||
}
|
||||
|
||||
void SettingsModel::closeCallSettings() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
stopCaptureGraph();
|
||||
emit captureGraphRunningChanged(getCaptureGraphRunning());
|
||||
}
|
||||
|
||||
bool SettingsModel::getCaptureGraphRunning() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return mSimpleCaptureGraph && mSimpleCaptureGraph->isRunning() && !getIsInCall();
|
||||
}
|
||||
|
||||
float SettingsModel::getMicVolume() {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
float v = 0.0;
|
||||
|
||||
if (mSimpleCaptureGraph && mSimpleCaptureGraph->isRunning()) {
|
||||
|
|
@ -178,13 +181,13 @@ float SettingsModel::getMicVolume() {
|
|||
}
|
||||
|
||||
float SettingsModel::getPlaybackGain() const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
float dbGain = CoreModel::getInstance()->getCore()->getPlaybackGainDb();
|
||||
return MediastreamerUtils::dbToLinear(dbGain);
|
||||
}
|
||||
|
||||
void SettingsModel::setPlaybackGain(float gain) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
float oldGain = getPlaybackGain();
|
||||
CoreModel::getInstance()->getCore()->setPlaybackGainDb(MediastreamerUtils::linearToDb(gain));
|
||||
if (mSimpleCaptureGraph && mSimpleCaptureGraph->isRunning()) {
|
||||
|
|
@ -201,7 +204,7 @@ float SettingsModel::getCaptureGain() const {
|
|||
}
|
||||
|
||||
void SettingsModel::setCaptureGain(float gain) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
float oldGain = getCaptureGain();
|
||||
CoreModel::getInstance()->getCore()->setMicGainDb(MediastreamerUtils::linearToDb(gain));
|
||||
if (mSimpleCaptureGraph && mSimpleCaptureGraph->isRunning()) {
|
||||
|
|
@ -212,7 +215,7 @@ void SettingsModel::setCaptureGain(float gain) {
|
|||
}
|
||||
|
||||
QStringList SettingsModel::getCaptureDevices () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
shared_ptr<linphone::Core> core = CoreModel::getInstance()->getCore();
|
||||
QStringList list;
|
||||
|
||||
|
|
@ -224,7 +227,7 @@ QStringList SettingsModel::getCaptureDevices () const {
|
|||
}
|
||||
|
||||
QStringList SettingsModel::getPlaybackDevices () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
shared_ptr<linphone::Core> core = CoreModel::getInstance()->getCore();
|
||||
QStringList list;
|
||||
|
||||
|
|
@ -239,13 +242,13 @@ QStringList SettingsModel::getPlaybackDevices () const {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
QString SettingsModel::getCaptureDevice () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
auto audioDevice = CoreModel::getInstance()->getCore()->getInputAudioDevice();
|
||||
return Utils::coreStringToAppString(audioDevice? audioDevice->getId() : CoreModel::getInstance()->getCore()->getCaptureDevice());
|
||||
}
|
||||
|
||||
void SettingsModel::setCaptureDevice (const QString &device) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
std::string devId = Utils::appStringToCoreString(device);
|
||||
auto list = CoreModel::getInstance()->getCore()->getExtendedAudioDevices();
|
||||
auto audioDevice = find_if(list.cbegin(), list.cend(), [&] ( const std::shared_ptr<linphone::AudioDevice> & audioItem) {
|
||||
|
|
@ -263,13 +266,13 @@ void SettingsModel::setCaptureDevice (const QString &device) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
QString SettingsModel::getPlaybackDevice () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
auto audioDevice = CoreModel::getInstance()->getCore()->getOutputAudioDevice();
|
||||
return Utils::coreStringToAppString(audioDevice? audioDevice->getId() : CoreModel::getInstance()->getCore()->getPlaybackDevice());
|
||||
}
|
||||
|
||||
void SettingsModel::setPlaybackDevice (const QString &device) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
std::string devId = Utils::appStringToCoreString(device);
|
||||
|
||||
auto list = CoreModel::getInstance()->getCore()->getExtendedAudioDevices();
|
||||
|
|
@ -289,14 +292,14 @@ void SettingsModel::setPlaybackDevice (const QString &device) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
QString SettingsModel::getRingerDevice () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return Utils::coreStringToAppString(
|
||||
CoreModel::getInstance()->getCore()->getRingerDevice()
|
||||
);
|
||||
}
|
||||
|
||||
void SettingsModel::setRingerDevice (const QString &device) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
CoreModel::getInstance()->getCore()->setRingerDevice(
|
||||
Utils::appStringToCoreString(device)
|
||||
);
|
||||
|
|
@ -306,12 +309,12 @@ void SettingsModel::setRingerDevice (const QString &device) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool SettingsModel::getVideoEnabled() const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return CoreModel::getInstance()->getCore()->videoEnabled();
|
||||
}
|
||||
|
||||
void SettingsModel::setVideoEnabled(const bool enabled) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
auto core = CoreModel::getInstance()->getCore();
|
||||
core->enableVideoCapture(enabled);
|
||||
core->enableVideoDisplay(enabled);
|
||||
|
|
@ -321,33 +324,33 @@ void SettingsModel::setVideoEnabled(const bool enabled) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool SettingsModel::getEchoCancellationEnabled () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return CoreModel::getInstance()->getCore()->echoCancellationEnabled();
|
||||
}
|
||||
|
||||
void SettingsModel::setEchoCancellationEnabled (bool status) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
CoreModel::getInstance()->getCore()->enableEchoCancellation(status);
|
||||
emit echoCancellationEnabledChanged(status);
|
||||
}
|
||||
|
||||
void SettingsModel::startEchoCancellerCalibration(){
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
CoreModel::getInstance()->getCore()->startEchoCancellerCalibration();
|
||||
}
|
||||
|
||||
int SettingsModel::getEchoCancellationCalibration()const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return CoreModel::getInstance()->getCore()->getEchoCancellationCalibration();
|
||||
}
|
||||
|
||||
bool SettingsModel::getAutomaticallyRecordCallsEnabled () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return !!mConfig->getInt(UiSection, "automatically_record_calls", 0);
|
||||
}
|
||||
|
||||
void SettingsModel::setAutomaticallyRecordCallsEnabled (bool enabled) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
mConfig->setInt(UiSection, "automatically_record_calls", enabled);
|
||||
emit automaticallyRecordCallsEnabledChanged(enabled);
|
||||
}
|
||||
|
|
@ -357,12 +360,83 @@ void SettingsModel::setAutomaticallyRecordCallsEnabled (bool enabled) {
|
|||
// =============================================================================
|
||||
|
||||
bool SettingsModel::getVfsEnabled () const {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return !!mConfig->getInt(UiSection, "vfs_enabled", 0);
|
||||
}
|
||||
|
||||
void SettingsModel::setVfsEnabled (bool enabled) {
|
||||
mustBeInLinphoneThread(getClassName());
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
mConfig->setInt(UiSection, "vfs_enabled", enabled);
|
||||
emit vfsEnabledChanged(enabled);
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Logs.
|
||||
// =============================================================================
|
||||
|
||||
bool SettingsModel::getLogsEnabled () const {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return getLogsEnabled(mConfig);
|
||||
}
|
||||
|
||||
void SettingsModel::setLogsEnabled (bool status) {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
mConfig->setInt(UiSection, "logs_enabled", status);
|
||||
CoreModel::getInstance()->getLogger()->enable(status);
|
||||
emit logsEnabledChanged(status);
|
||||
}
|
||||
|
||||
bool SettingsModel::getFullLogsEnabled () const {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return getFullLogsEnabled(mConfig);
|
||||
}
|
||||
|
||||
void SettingsModel::setFullLogsEnabled (bool status) {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
mConfig->setInt(UiSection, "full_logs_enabled", status);
|
||||
CoreModel::getInstance()->getLogger()->enableFullLogs(status);
|
||||
emit fullLogsEnabledChanged(status);
|
||||
}
|
||||
|
||||
bool SettingsModel::getLogsEnabled (const shared_ptr<linphone::Config> &config) {
|
||||
mustBeInLinphoneThread(sLog().arg(Q_FUNC_INFO));
|
||||
return config ? config->getInt(UiSection, "logs_enabled", false) : true;
|
||||
}
|
||||
|
||||
bool SettingsModel::getFullLogsEnabled (const shared_ptr<linphone::Config> &config) {
|
||||
mustBeInLinphoneThread(sLog().arg(Q_FUNC_INFO));
|
||||
return config ? config->getInt(UiSection, "full_logs_enabled", false) : false;
|
||||
}
|
||||
|
||||
QString SettingsModel::getLogsFolder () const {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return getLogsFolder(mConfig);
|
||||
}
|
||||
|
||||
QString SettingsModel::getLogsFolder (const shared_ptr<linphone::Config> &config) {
|
||||
mustBeInLinphoneThread(sLog().arg(Q_FUNC_INFO));
|
||||
return config
|
||||
? Utils::coreStringToAppString(config->getString(UiSection, "logs_folder", Utils::appStringToCoreString(Paths::getLogsDirPath())))
|
||||
: Paths::getLogsDirPath();
|
||||
}
|
||||
|
||||
void SettingsModel::cleanLogs () const {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
CoreModel::getInstance()->getCore()->resetLogCollection();
|
||||
}
|
||||
|
||||
void SettingsModel::sendLogs () const {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
auto core = CoreModel::getInstance()->getCore();
|
||||
qInfo() << QStringLiteral("Send logs to: `%1` from `%2`.")
|
||||
.arg(Utils::coreStringToAppString(core->getLogCollectionUploadServerUrl()))
|
||||
.arg(Utils::coreStringToAppString(core->getLogCollectionPath()));
|
||||
core->uploadLogCollection();
|
||||
}
|
||||
|
||||
QString SettingsModel::getLogsEmail () const {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return Utils::coreStringToAppString(
|
||||
mConfig->getString(UiSection, "logs_email", Constants::DefaultLogsEmail)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,27 @@ public:
|
|||
|
||||
QString getVideoDevice () const;
|
||||
void setVideoDevice (const QString &device);
|
||||
|
||||
bool getLogsEnabled () const;
|
||||
void setLogsEnabled (bool status);
|
||||
|
||||
bool getFullLogsEnabled () const;
|
||||
void setFullLogsEnabled (bool status);
|
||||
|
||||
static bool getLogsEnabled (const std::shared_ptr<linphone::Config> &config);
|
||||
static bool getFullLogsEnabled (const std::shared_ptr<linphone::Config> &config);
|
||||
|
||||
QString getLogsFolder () const;
|
||||
void setLogsFolder (const QString &folder);
|
||||
static QString getLogsFolder (const std::shared_ptr<linphone::Config> &config);
|
||||
|
||||
QString getLogsUploadUrl () const;
|
||||
void setLogsUploadUrl (const QString &url);
|
||||
|
||||
void cleanLogs () const;
|
||||
void sendLogs () const;
|
||||
|
||||
QString getLogsEmail () const;
|
||||
|
||||
signals:
|
||||
|
||||
|
|
@ -132,6 +153,9 @@ signals:
|
|||
void videoDeviceChanged (const QString &device);
|
||||
|
||||
void micVolumeChanged(float volume);
|
||||
|
||||
void logsEnabledChanged (bool status);
|
||||
void fullLogsEnabledChanged (bool status);
|
||||
|
||||
private:
|
||||
MediastreamerUtils::SimpleCaptureGraph *mSimpleCaptureGraph = nullptr;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@
|
|||
const char *CLASS_NAME::gClassName = #CLASS_NAME; \
|
||||
QString CLASS_NAME::getClassName() const { \
|
||||
return gClassName; \
|
||||
} \
|
||||
static inline QString sLog() { \
|
||||
return QStringLiteral("[%1]: %2").arg(#CLASS_NAME).arg("%1"); \
|
||||
}
|
||||
|
||||
#define DECLARE_GUI_OBJECT \
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public:
|
|||
static constexpr char PrivatePolicyUrl[] = "https://www.linphone.org/privacy-policy";
|
||||
static constexpr char ContactUrl[] = "https://www.linphone.org/contact";
|
||||
static constexpr char TranslationUrl[] = "https://weblate.linphone.org/projects/linphone-desktop/";
|
||||
|
||||
|
||||
static constexpr int MaxMosaicParticipants =
|
||||
6; // From 7, the mosaic quality will be limited to avoid useless computations
|
||||
|
||||
|
|
@ -99,6 +99,7 @@ public:
|
|||
Q_PROPERTY(int maxMosaicParticipants MEMBER MaxMosaicParticipants CONSTANT)
|
||||
Q_PROPERTY(QStringList reactionsList READ getReactionsList CONSTANT)
|
||||
|
||||
|
||||
// For Webviews
|
||||
static constexpr char DefaultAssistantRegistrationUrl[] = "https://subscribe.linphone.org/register";
|
||||
static constexpr char DefaultAssistantLoginUrl[] = "https://subscribe.linphone.org/login";
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ Item {
|
|||
id: mainItem
|
||||
property var callObj
|
||||
property bool settingsHidden: true
|
||||
|
||||
property bool helpHidden: true
|
||||
|
||||
signal addAccountRequest()
|
||||
|
||||
function goToNewCall() {
|
||||
|
|
@ -140,6 +141,10 @@ Item {
|
|||
mainStackView.pop()
|
||||
mainItem.settingsHidden = true
|
||||
}
|
||||
if (!mainItem.helpHidden) {
|
||||
mainStackView.pop()
|
||||
mainItem.helpHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
|
|
@ -343,6 +348,10 @@ Item {
|
|||
text: qsTr("Paramètres")
|
||||
iconSource: AppIcons.settings
|
||||
onClicked: {
|
||||
if (!mainItem.helpHidden) {
|
||||
mainStackView.pop()
|
||||
mainItem.helpHidden = true
|
||||
}
|
||||
if (mainItem.settingsHidden) {
|
||||
mainStackView.push(settingsPageComponent)
|
||||
settingsButton.popup.close()
|
||||
|
|
@ -363,6 +372,19 @@ Item {
|
|||
iconSize: 32 * DefaultStyle.dp
|
||||
text: qsTr("Aide")
|
||||
iconSource: AppIcons.question
|
||||
onClicked: {
|
||||
if (!mainItem.settingsHidden) {
|
||||
mainStackView.pop()
|
||||
mainItem.settingsHidden = true
|
||||
}
|
||||
if (mainItem.helpHidden) {
|
||||
mainStackView.push(helpPageComponent)
|
||||
settingsButton.popup.close()
|
||||
mainItem.helpHidden = false
|
||||
} else {
|
||||
settingsButton.popup.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -408,6 +430,15 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: helpPageComponent
|
||||
HelpPage {
|
||||
onGoBack: {
|
||||
mainStackView.pop()
|
||||
mainItem.helpHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
Control.StackView {
|
||||
id: mainStackView
|
||||
property Transition noTransition: Transition {
|
||||
|
|
|
|||
87
Linphone/view/App/Layout/Settings/DebugSettingsLayout.qml
Normal file
87
Linphone/view/App/Layout/Settings/DebugSettingsLayout.qml
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls as Control
|
||||
|
||||
import Linphone
|
||||
import SettingsCpp 1.0
|
||||
import UtilsCpp 1.0
|
||||
|
||||
GenericSettingsLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
id: mainItem
|
||||
property string logsUrl
|
||||
|
||||
Dialog {
|
||||
id: deleteLogs
|
||||
text: qsTr("Les traces de débogage seront supprimées. Souhaitez-vous continuer ?")
|
||||
onAccepted: SettingsCpp.cleanLogs()
|
||||
}
|
||||
Dialog {
|
||||
id: shareLogs
|
||||
text: qsTr("Les traces de débogage ont été téléversées. Comment souhaitez-vous partager le lien ? ")
|
||||
buttons: [
|
||||
Button {
|
||||
text: qsTr("Presse-papier")
|
||||
onClicked: {
|
||||
shareLogs.close()
|
||||
UtilsCpp.copyToClipboard(mainItem.logsUrl)
|
||||
}
|
||||
},
|
||||
Button {
|
||||
text: qsTr("E-Mail")
|
||||
onClicked: {
|
||||
shareLogs.close()
|
||||
if(!Qt.openUrlExternally(
|
||||
'mailto:' + encodeURIComponent(SettingsCpp.logsEmail) +
|
||||
'?subject=' + encodeURIComponent(qsTr('Traces Linphone')) +
|
||||
'&body=' + encodeURIComponent(mainItem.logsUrl)
|
||||
))
|
||||
UtilsCpp.showInformationPopup(qsTr("Une erreur est survenue."), qsTr("Le partage par mail a échoué. Veuillez envoyer le lien %1 directement à l'adresse %2.").replace("%1",mainItem.logsUrl).replace("%2",SettingsCpp.logsEmail), false)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Component {
|
||||
id: debug
|
||||
ColumnLayout {
|
||||
spacing: 40 * DefaultStyle.dp
|
||||
SwitchSetting {
|
||||
titleText: qsTr("Activer les traces de débogage")
|
||||
propertyName: "logsEnabled"
|
||||
}
|
||||
SwitchSetting {
|
||||
titleText: qsTr("Activer les traces de débogage intégrales")
|
||||
propertyName: "fullLogsEnabled"
|
||||
}
|
||||
MediumButton {
|
||||
text: qsTr("Supprimer les traces")
|
||||
onClicked: {
|
||||
deleteLogs.open()
|
||||
}
|
||||
}
|
||||
MediumButton {
|
||||
text: qsTr("Partager les traces")
|
||||
enabled: SettingsCpp.logsEnabled || SettingsCpp.fullLogsEnabled
|
||||
onClicked: {
|
||||
UtilsCpp.getMainWindow().showLoadingPopup(qsTr("Téléversement des traces en cours ..."))
|
||||
SettingsCpp.sendLogs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: SettingsCpp
|
||||
onLogsUploadTerminated: {
|
||||
UtilsCpp.getMainWindow().closeLoadingPopup()
|
||||
if (status) {
|
||||
mainItem.logsUrl = url
|
||||
shareLogs.open()
|
||||
} else {
|
||||
UtilsCpp.showInformationPopup(qsTr("Une erreur est survenue."), qsTr("Le téléversement des traces a échoué. Vous pouvez partager les fichiers de trace directement depuis le répertoire suivant :") + SettingsCpp.logsFolder, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
component: debug
|
||||
}
|
||||
|
|
@ -21,6 +21,7 @@ list(APPEND _LINPHONEAPP_QML_FILES
|
|||
view/App/Layout/Settings/GenericSettingsLayout.qml
|
||||
view/App/Layout/Settings/SecuritySettingsLayout.qml
|
||||
view/App/Layout/Settings/CallSettingsLayout.qml
|
||||
view/App/Layout/Settings/DebugSettingsLayout.qml
|
||||
|
||||
view/Item/Account/Accounts.qml
|
||||
|
||||
|
|
@ -51,6 +52,7 @@ list(APPEND _LINPHONEAPP_QML_FILES
|
|||
|
||||
view/Item/BusyIndicator.qml
|
||||
view/Item/Button.qml
|
||||
view/Item/MediumButton.qml
|
||||
view/Item/Calendar.qml
|
||||
view/Item/CalendarComboBox.qml
|
||||
view/Item/Carousel.qml
|
||||
|
|
@ -96,6 +98,8 @@ list(APPEND _LINPHONEAPP_QML_FILES
|
|||
view/Item/Settings/SettingsFamily.qml
|
||||
view/Item/Settings/SwitchSetting.qml
|
||||
view/Item/Settings/ComboSetting.qml
|
||||
|
||||
view/Item/Help/HelpIconLabelButton.qml
|
||||
|
||||
view/Page/Login/LoginPage.qml
|
||||
view/Page/Login/RegisterPage.qml
|
||||
|
|
@ -110,6 +114,7 @@ list(APPEND _LINPHONEAPP_QML_FILES
|
|||
view/Page/Main/MeetingPage.qml
|
||||
|
||||
view/Page/Main/SettingsPage.qml
|
||||
view/Page/Main/HelpPage.qml
|
||||
|
||||
view/Tool/utils.js
|
||||
# Prototypes
|
||||
|
|
|
|||
51
Linphone/view/Item/Help/HelpIconLabelButton.qml
Normal file
51
Linphone/view/Item/Help/HelpIconLabelButton.qml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Layouts
|
||||
import Linphone
|
||||
|
||||
MouseArea {
|
||||
id: mainItem
|
||||
property string iconSource
|
||||
property string title
|
||||
property string subTitle
|
||||
property int iconSize: 32 * DefaultStyle.dp
|
||||
hoverEnabled: true
|
||||
width: content.implicitWidth
|
||||
height: content.implicitHeight
|
||||
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
RowLayout {
|
||||
id: content
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.fill:parent
|
||||
EffectImage {
|
||||
Layout.preferredWidth: mainItem.iconSize
|
||||
Layout.preferredHeight: mainItem.iconSize
|
||||
width: mainItem.iconSize
|
||||
height: mainItem.iconSize
|
||||
imageSource: mainItem.iconSource
|
||||
colorizationColor: DefaultStyle.main1_500_main
|
||||
}
|
||||
ColumnLayout {
|
||||
width: implicitWidth
|
||||
height: implicitHeight
|
||||
Layout.leftMargin: 16 * DefaultStyle.dp
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
text: mainItem.title
|
||||
color: DefaultStyle.main2_600
|
||||
font: Typography.p2
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
verticalAlignment: Text.AlignBottom
|
||||
}
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
verticalAlignment: Text.AlignTop
|
||||
Layout.fillWidth: true
|
||||
text: mainItem.subTitle
|
||||
color: DefaultStyle.main2_500main
|
||||
visible: subTitle.length > 0
|
||||
font: Typography.p1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Linphone/view/Item/MediumButton.qml
Normal file
17
Linphone/view/Item/MediumButton.qml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Controls.Basic 2.2 as Control
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Layouts
|
||||
import Linphone
|
||||
|
||||
Button {
|
||||
id: mainItem
|
||||
textSize: Typography.b2.pixelSize
|
||||
textWeight: Typography.b2.weight
|
||||
color: DefaultStyle.main1_100
|
||||
textColor: DefaultStyle.main1_500_main
|
||||
leftPadding: 16 * DefaultStyle.dp
|
||||
rightPadding: 16 * DefaultStyle.dp
|
||||
topPadding: 10 * DefaultStyle.dp
|
||||
bottomPadding: 10 * DefaultStyle.dp
|
||||
}
|
||||
126
Linphone/view/Page/Main/HelpPage.qml
Normal file
126
Linphone/view/Page/Main/HelpPage.qml
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls as Control
|
||||
import Linphone
|
||||
import UtilsCpp 1.0
|
||||
import ConstantsCpp 1.0
|
||||
|
||||
AbstractMainPage {
|
||||
|
||||
id: mainItem
|
||||
showDefaultItem: false
|
||||
|
||||
signal goBack()
|
||||
|
||||
leftPanelContent: ColumnLayout {
|
||||
id: leftPanel
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
property int sideMargin: 45 * DefaultStyle.dp
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: leftPanel.sideMargin
|
||||
Layout.rightMargin: leftPanel.sideMargin
|
||||
Button {
|
||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||
icon.source: AppIcons.leftArrow
|
||||
width: 24 * DefaultStyle.dp
|
||||
height: 24 * DefaultStyle.dp
|
||||
background: Item {
|
||||
anchors.fill: parent
|
||||
}
|
||||
onClicked: {
|
||||
mainItem.goBack()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Aide")
|
||||
color: DefaultStyle.main2_700
|
||||
font: Typography.h2
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
Text {
|
||||
Layout.leftMargin: leftPanel.sideMargin
|
||||
Layout.rightMargin: leftPanel.sideMargin
|
||||
Layout.topMargin: 41 * DefaultStyle.dp
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("À propos de Linphone")
|
||||
color: DefaultStyle.main2_600
|
||||
font: Typography.h3m
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: leftPanel.sideMargin
|
||||
Layout.rightMargin: leftPanel.sideMargin
|
||||
Layout.topMargin: 24 * DefaultStyle.dp
|
||||
spacing: 32 * DefaultStyle.dp
|
||||
HelpIconLabelButton {
|
||||
Layout.fillWidth: true
|
||||
iconSource: AppIcons.detective
|
||||
title: qsTr("Règles de confidentialité")
|
||||
subTitle: qsTr("Comment Linphone récolte et utilise les informations")
|
||||
onClicked: {
|
||||
rightPanelStackView.clear()
|
||||
Qt.openUrlExternally(ConstantsCpp.PrivatePolicyUrl)
|
||||
}
|
||||
}
|
||||
HelpIconLabelButton {
|
||||
Layout.fillWidth: true
|
||||
iconSource: AppIcons.info
|
||||
title: qsTr("Version")
|
||||
subTitle: qsTr("1.0")
|
||||
onClicked: {}
|
||||
}
|
||||
HelpIconLabelButton {
|
||||
Layout.fillWidth: true
|
||||
iconSource: AppIcons.license
|
||||
title: qsTr("Licences GPLv3")
|
||||
subTitle: (copyrightRangeDate || applicationVendor ? '\u00A9 ': '') + (copyrightRangeDate ? copyrightRangeDate : '')+ (applicationVendor ? ' ' + applicationVendor : '')
|
||||
onClicked: {
|
||||
rightPanelStackView.clear()
|
||||
Qt.openUrlExternally(applicationLicenceUrl)
|
||||
}
|
||||
}
|
||||
HelpIconLabelButton {
|
||||
Layout.fillWidth: true
|
||||
iconSource: AppIcons.world
|
||||
title: qsTr("Contribuer à la traduction de Linphone")
|
||||
onClicked: {
|
||||
rightPanelStackView.clear()
|
||||
Qt.openUrlExternally(ConstantsCpp.TranslationUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
Layout.leftMargin: leftPanel.sideMargin
|
||||
Layout.rightMargin: leftPanel.sideMargin
|
||||
Layout.topMargin: 32 * DefaultStyle.dp
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("À propos de Linphone")
|
||||
color: DefaultStyle.main2_600
|
||||
font: Typography.h3m
|
||||
}
|
||||
HelpIconLabelButton {
|
||||
id: troubleShooting
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: leftPanel.sideMargin
|
||||
Layout.rightMargin: leftPanel.sideMargin
|
||||
Layout.topMargin: 24 * DefaultStyle.dp
|
||||
iconSource: AppIcons.debug
|
||||
title: qsTr("Dépannage")
|
||||
onClicked: {
|
||||
rightPanelStackView.clear()
|
||||
rightPanelStackView.push("qrc:/Linphone/view/App/Layout/Settings/DebugSettingsLayout.qml", { titleText: troubleShooting.title })
|
||||
}
|
||||
}
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -94,5 +94,8 @@ QtObject {
|
|||
property string videoconferenceSelected: "image://internal/video-conference-selected.svg"
|
||||
property string switchOn: "image://internal/switch-on.svg"
|
||||
property string switchOff: "image://internal/switch-off.svg"
|
||||
|
||||
property string license: "image://internal/license.svg"
|
||||
property string debug: "image://internal/debug.svg"
|
||||
property string world: "image://internal/world.svg"
|
||||
property string detective: "image://internal/detective.svg"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,4 +38,11 @@ QtObject {
|
|||
weight: 400 * DefaultStyle.dp
|
||||
})
|
||||
|
||||
// Bouton/B2 - Medium Bouton
|
||||
property font b2: Qt.font( {
|
||||
family: DefaultStyle.defaultFont,
|
||||
pixelSize: 15 * DefaultStyle.dp,
|
||||
weight: 600 * DefaultStyle.dp
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue