mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-04-22 06:02:03 +02:00
swarmdetailspanel: fix identifier row
also separate debug and muteDaemon options so that "jami -dq" shows debug informations from the client. Change-Id: Ic69c5cf8b6a8ef4aa1fff607d01a541dab3e6da2
This commit is contained in:
parent
593ecc9910
commit
0b18f3d145
14 changed files with 46 additions and 36 deletions
|
@ -31,12 +31,14 @@ LRCInstance::LRCInstance(migrateCallback willMigrateCb,
|
||||||
migrateCallback didMigrateCb,
|
migrateCallback didMigrateCb,
|
||||||
const QString& updateUrl,
|
const QString& updateUrl,
|
||||||
ConnectivityMonitor* connectivityMonitor,
|
ConnectivityMonitor* connectivityMonitor,
|
||||||
bool muteDring)
|
bool debugMode,
|
||||||
: lrc_(std::make_unique<Lrc>(willMigrateCb, didMigrateCb, muteDring))
|
bool muteDaemon)
|
||||||
|
: lrc_(std::make_unique<Lrc>(willMigrateCb, didMigrateCb, !debugMode || muteDaemon))
|
||||||
, updateManager_(std::make_unique<UpdateManager>(updateUrl, connectivityMonitor, this))
|
, updateManager_(std::make_unique<UpdateManager>(updateUrl, connectivityMonitor, this))
|
||||||
, threadPool_(new QThreadPool(this))
|
, threadPool_(new QThreadPool(this))
|
||||||
{
|
{
|
||||||
debugMode_ = !muteDring;
|
debugMode_ = debugMode;
|
||||||
|
muteDaemon_ = muteDaemon;
|
||||||
threadPool_->setMaxThreadCount(1);
|
threadPool_->setMaxThreadCount(1);
|
||||||
|
|
||||||
connect(this, &LRCInstance::currentAccountIdChanged, [this] {
|
connect(this, &LRCInstance::currentAccountIdChanged, [this] {
|
||||||
|
|
|
@ -65,7 +65,8 @@ public:
|
||||||
migrateCallback didMigrateCb,
|
migrateCallback didMigrateCb,
|
||||||
const QString& updateUrl,
|
const QString& updateUrl,
|
||||||
ConnectivityMonitor* connectivityMonitor,
|
ConnectivityMonitor* connectivityMonitor,
|
||||||
bool muteDring);
|
bool debugMode,
|
||||||
|
bool muteDaemon);
|
||||||
~LRCInstance() = default;
|
~LRCInstance() = default;
|
||||||
|
|
||||||
void finish();
|
void finish();
|
||||||
|
@ -153,6 +154,7 @@ private:
|
||||||
conversation::Info invalid {};
|
conversation::Info invalid {};
|
||||||
|
|
||||||
bool debugMode_ {false};
|
bool debugMode_ {false};
|
||||||
|
bool muteDaemon_ {true};
|
||||||
|
|
||||||
QThreadPool* threadPool_;
|
QThreadPool* threadPool_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -149,7 +149,8 @@ MainApplication::init()
|
||||||
|
|
||||||
initLrc(runOptions_[Option::UpdateUrl].toString(),
|
initLrc(runOptions_[Option::UpdateUrl].toString(),
|
||||||
connectivityMonitor_.get(),
|
connectivityMonitor_.get(),
|
||||||
runOptions_[Option::Debug].toBool() && !runOptions_[Option::MuteJamid].toBool());
|
runOptions_[Option::Debug].toBool(),
|
||||||
|
runOptions_[Option::MuteDaemon].toBool());
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
using namespace Interfaces;
|
using namespace Interfaces;
|
||||||
|
@ -227,7 +228,10 @@ MainApplication::handleUriAction(const QString& arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MainApplication::initLrc(const QString& downloadUrl, ConnectivityMonitor* cm, bool logDaemon)
|
MainApplication::initLrc(const QString& downloadUrl,
|
||||||
|
ConnectivityMonitor* cm,
|
||||||
|
bool debugMode,
|
||||||
|
bool muteDaemon)
|
||||||
{
|
{
|
||||||
lrc::api::Lrc::cacheAvatars.store(false);
|
lrc::api::Lrc::cacheAvatars.store(false);
|
||||||
/*
|
/*
|
||||||
|
@ -252,7 +256,8 @@ MainApplication::initLrc(const QString& downloadUrl, ConnectivityMonitor* cm, bo
|
||||||
},
|
},
|
||||||
downloadUrl,
|
downloadUrl,
|
||||||
cm,
|
cm,
|
||||||
!logDaemon));
|
debugMode,
|
||||||
|
muteDaemon));
|
||||||
lrcInstance_->subscribeToDebugReceived();
|
lrcInstance_->subscribeToDebugReceived();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,7 +323,7 @@ MainApplication::parseArguments()
|
||||||
runOptions_[Option::UpdateUrl] = parser.value(updateUrlOption);
|
runOptions_[Option::UpdateUrl] = parser.value(updateUrlOption);
|
||||||
#endif
|
#endif
|
||||||
runOptions_[Option::TerminationRequested] = parser.isSet(terminateOption);
|
runOptions_[Option::TerminationRequested] = parser.isSet(terminateOption);
|
||||||
runOptions_[Option::MuteJamid] = parser.isSet(muteDaemonOption);
|
runOptions_[Option::MuteDaemon] = parser.isSet(muteDaemonOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
StartMinimized = 0,
|
StartMinimized = 0,
|
||||||
Debug,
|
Debug,
|
||||||
UpdateUrl,
|
UpdateUrl,
|
||||||
MuteJamid,
|
MuteDaemon,
|
||||||
TerminationRequested,
|
TerminationRequested,
|
||||||
StartUri
|
StartUri
|
||||||
};
|
};
|
||||||
|
@ -99,7 +99,10 @@ Q_SIGNALS:
|
||||||
void searchAndSelect(const QString& request);
|
void searchAndSelect(const QString& request);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initLrc(const QString& downloadUrl, ConnectivityMonitor* cm, bool logDaemon);
|
void initLrc(const QString& downloadUrl,
|
||||||
|
ConnectivityMonitor* cm,
|
||||||
|
bool debugMode,
|
||||||
|
bool muteDaemon);
|
||||||
void parseArguments();
|
void parseArguments();
|
||||||
void setApplicationFont();
|
void setApplicationFont();
|
||||||
void initQmlLayer();
|
void initQmlLayer();
|
||||||
|
|
|
@ -509,14 +509,12 @@ Rectangle {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
Layout.preferredHeight: JamiTheme.settingsFontSize + 2 * JamiTheme.preferredMarginSize + 4
|
Layout.preferredHeight: JamiTheme.settingsFontSize + 2 * JamiTheme.preferredMarginSize + 4
|
||||||
Layout.maximumWidth: parent.width
|
|
||||||
visible: LRCInstance.debugMode()
|
visible: LRCInstance.debugMode()
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: idLabel
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 30
|
Layout.preferredHeight: 30
|
||||||
Layout.rightMargin: JamiTheme.preferredMarginSize
|
Layout.rightMargin: JamiTheme.preferredMarginSize
|
||||||
Layout.maximumWidth: parent.width / 2
|
|
||||||
|
|
||||||
text: JamiStrings.identifier
|
text: JamiStrings.identifier
|
||||||
font.pixelSize: JamiTheme.settingsDescriptionPixelSize
|
font.pixelSize: JamiTheme.settingsDescriptionPixelSize
|
||||||
|
@ -530,12 +528,11 @@ Rectangle {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
Layout.rightMargin: JamiTheme.settingsMarginSize
|
Layout.rightMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
Layout.maximumWidth: parent.width / 2
|
|
||||||
|
|
||||||
color: JamiTheme.textColor
|
color: JamiTheme.textColor
|
||||||
font.pixelSize: JamiTheme.settingsDescriptionPixelSize
|
font.pixelSize: JamiTheme.settingsDescriptionPixelSize
|
||||||
|
font.weight: Font.Medium
|
||||||
|
|
||||||
text: CurrentConversation.id
|
text: CurrentConversation.id
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
* @param willMigrateCb
|
* @param willMigrateCb
|
||||||
* @param didMigrateCb
|
* @param didMigrateCb
|
||||||
*/
|
*/
|
||||||
Lrc(MigrationCb willMigrateCb = {}, MigrationCb didMigrateCb = {}, bool muteDring = false);
|
Lrc(MigrationCb willMigrateCb = {}, MigrationCb didMigrateCb = {}, bool muteDaemon = false);
|
||||||
~Lrc();
|
~Lrc();
|
||||||
/**
|
/**
|
||||||
* get a reference on account model.
|
* get a reference on account model.
|
||||||
|
|
|
@ -27,14 +27,14 @@
|
||||||
#include "../interfaces/dbuserrorhandleri.h"
|
#include "../interfaces/dbuserrorhandleri.h"
|
||||||
|
|
||||||
InstanceManagerInterface&
|
InstanceManagerInterface&
|
||||||
InstanceManager::instance(bool muteDring)
|
InstanceManager::instance(bool muteDaemon)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_LIBWRAP
|
#ifdef ENABLE_LIBWRAP
|
||||||
static auto interface = new InstanceManagerInterface(muteDring);
|
static auto interface = new InstanceManagerInterface(muteDaemon);
|
||||||
#else
|
#else
|
||||||
if (!dbus_metaTypeInit)
|
if (!dbus_metaTypeInit)
|
||||||
registerCommTypes();
|
registerCommTypes();
|
||||||
Q_UNUSED(muteDring)
|
Q_UNUSED(muteDaemon)
|
||||||
|
|
||||||
static auto interface = new InstanceManagerInterface("cx.ring.Ring",
|
static auto interface = new InstanceManagerInterface("cx.ring.Ring",
|
||||||
"/cx/ring/Ring/Instance",
|
"/cx/ring/Ring/Instance",
|
||||||
|
|
|
@ -32,6 +32,6 @@
|
||||||
|
|
||||||
namespace InstanceManager {
|
namespace InstanceManager {
|
||||||
|
|
||||||
LIB_EXPORT InstanceManagerInterface& instance(bool muteDring = false);
|
LIB_EXPORT InstanceManagerInterface& instance(bool muteDaemon = false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
std::unique_ptr<PluginModel> PluginModel_;
|
std::unique_ptr<PluginModel> PluginModel_;
|
||||||
};
|
};
|
||||||
|
|
||||||
Lrc::Lrc(MigrationCb willDoMigrationCb, MigrationCb didDoMigrationCb, bool muteDring)
|
Lrc::Lrc(MigrationCb willDoMigrationCb, MigrationCb didDoMigrationCb, bool muteDaemon)
|
||||||
{
|
{
|
||||||
lrc::api::Lrc::holdConferences.store(true);
|
lrc::api::Lrc::holdConferences.store(true);
|
||||||
#ifndef ENABLE_LIBWRAP
|
#ifndef ENABLE_LIBWRAP
|
||||||
|
@ -77,7 +77,7 @@ Lrc::Lrc(MigrationCb willDoMigrationCb, MigrationCb didDoMigrationCb, bool muteD
|
||||||
#endif
|
#endif
|
||||||
// Ensure Daemon is running/loaded (especially on non-DBus platforms)
|
// Ensure Daemon is running/loaded (especially on non-DBus platforms)
|
||||||
// before instantiating LRC and its members
|
// before instantiating LRC and its members
|
||||||
InstanceManager::instance(muteDring);
|
InstanceManager::instance(muteDaemon);
|
||||||
lrcPimpl_ = std::make_unique<LrcPimpl>(*this, willDoMigrationCb, didDoMigrationCb);
|
lrcPimpl_ = std::make_unique<LrcPimpl>(*this, willDoMigrationCb, didDoMigrationCb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
static int ringFlags = 0;
|
static int ringFlags = 0;
|
||||||
|
|
||||||
InstanceManagerInterface::InstanceManagerInterface(bool muteDring)
|
InstanceManagerInterface::InstanceManagerInterface(bool muteDaemon)
|
||||||
{
|
{
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ InstanceManagerInterface::InstanceManagerInterface(bool muteDring)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MUTE_LIBJAMI
|
#ifndef MUTE_LIBJAMI
|
||||||
if (!muteDring) {
|
if (!muteDaemon) {
|
||||||
ringFlags |= libjami::LIBJAMI_FLAG_DEBUG;
|
ringFlags |= libjami::LIBJAMI_FLAG_DEBUG;
|
||||||
ringFlags |= libjami::LIBJAMI_FLAG_CONSOLE_LOG;
|
ringFlags |= libjami::LIBJAMI_FLAG_CONSOLE_LOG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class InstanceManagerInterface : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
InstanceManagerInterface(bool muteDring = false);
|
InstanceManagerInterface(bool muteDaemon = false);
|
||||||
~InstanceManagerInterface();
|
~InstanceManagerInterface();
|
||||||
|
|
||||||
// TODO: These are not present in jami.h
|
// TODO: These are not present in jami.h
|
||||||
|
|
|
@ -45,8 +45,8 @@ class Setup : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Setup(bool muteDring = false)
|
Setup(bool muteDaemon = false)
|
||||||
: muteDring_(muteDring)
|
: muteDaemon_(muteDaemon)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
@ -64,7 +64,7 @@ public Q_SLOTS:
|
||||||
QFontDatabase::addApplicationFont(":/images/FontAwesome.otf");
|
QFontDatabase::addApplicationFont(":/images/FontAwesome.otf");
|
||||||
|
|
||||||
lrcInstance_.reset(
|
lrcInstance_.reset(
|
||||||
new LRCInstance(nullptr, nullptr, "", connectivityMonitor_.get(), muteDring_));
|
new LRCInstance(nullptr, nullptr, "", connectivityMonitor_.get(), true, muteDaemon_));
|
||||||
lrcInstance_->subscribeToDebugReceived();
|
lrcInstance_->subscribeToDebugReceived();
|
||||||
|
|
||||||
auto downloadPath = settingsManager_->getValue(Settings::Key::DownloadPath);
|
auto downloadPath = settingsManager_->getValue(Settings::Key::DownloadPath);
|
||||||
|
@ -118,7 +118,7 @@ private:
|
||||||
QScopedPointer<PreviewEngine> previewEngine_;
|
QScopedPointer<PreviewEngine> previewEngine_;
|
||||||
ScreenInfo screenInfo_;
|
ScreenInfo screenInfo_;
|
||||||
|
|
||||||
bool muteDring_ {false};
|
bool muteDaemon_ {false};
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -141,10 +141,10 @@ main(int argc, char** argv)
|
||||||
if (!envSet)
|
if (!envSet)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
bool muteDring {false};
|
bool muteDaemon {false};
|
||||||
|
|
||||||
// We likely want to mute the daemon for log clarity.
|
// We likely want to mute the daemon for log clarity.
|
||||||
Utils::remove_argument(argv, argc, "--mutejamid", [&]() { muteDring = true; });
|
Utils::remove_argument(argv, argc, "--mutejamid", [&]() { muteDaemon = true; });
|
||||||
|
|
||||||
// Allow the user to enable fatal warnings for certain tests.
|
// Allow the user to enable fatal warnings for certain tests.
|
||||||
Utils::remove_argument(argv, argc, "--failonwarn", [&]() { qputenv("QT_FATAL_WARNINGS", "1"); });
|
Utils::remove_argument(argv, argc, "--failonwarn", [&]() { qputenv("QT_FATAL_WARNINGS", "1"); });
|
||||||
|
@ -153,7 +153,7 @@ main(int argc, char** argv)
|
||||||
QtWebEngineQuick::initialize();
|
QtWebEngineQuick::initialize();
|
||||||
#endif
|
#endif
|
||||||
QTEST_SET_MAIN_SOURCE_PATH
|
QTEST_SET_MAIN_SOURCE_PATH
|
||||||
Setup setup(muteDring);
|
Setup setup(muteDaemon);
|
||||||
return quick_test_main_with_setup(argc, argv, "qml_test", nullptr, &setup);
|
return quick_test_main_with_setup(argc, argv, "qml_test", nullptr, &setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ public:
|
||||||
|
|
||||||
std::atomic_bool isMigrating(false);
|
std::atomic_bool isMigrating(false);
|
||||||
lrcInstance.reset(
|
lrcInstance.reset(
|
||||||
new LRCInstance(nullptr, nullptr, "", connectivityMonitor.get(), muteDring));
|
new LRCInstance(nullptr, nullptr, "", connectivityMonitor.get(), debugMode, muteDaemon));
|
||||||
lrcInstance->subscribeToDebugReceived();
|
lrcInstance->subscribeToDebugReceived();
|
||||||
|
|
||||||
// setup the adapters (their lifetimes are that of MainApplication)
|
// setup the adapters (their lifetimes are that of MainApplication)
|
||||||
|
@ -71,7 +71,8 @@ public:
|
||||||
connectivityMonitor.reset();
|
connectivityMonitor.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool muteDring {false};
|
bool debugMode {false};
|
||||||
|
bool muteDaemon {false};
|
||||||
|
|
||||||
QScopedPointer<AccountAdapter> accountAdapter;
|
QScopedPointer<AccountAdapter> accountAdapter;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
// We likely want to mute the daemon for log clarity.
|
// We likely want to mute the daemon for log clarity.
|
||||||
Utils::remove_argument(argv, argc, "--mutejamid", [&]() { globalEnv.muteDring = true; });
|
Utils::remove_argument(argv, argc, "--mutejamid", [&]() { globalEnv.muteDaemon = true; });
|
||||||
|
|
||||||
// Allow the user to enable fatal warnings for certain tests.
|
// Allow the user to enable fatal warnings for certain tests.
|
||||||
Utils::remove_argument(argv, argc, "--failonwarn", [&]() { qputenv("QT_FATAL_WARNINGS", "1"); });
|
Utils::remove_argument(argv, argc, "--failonwarn", [&]() { qputenv("QT_FATAL_WARNINGS", "1"); });
|
||||||
|
|
Loading…
Add table
Reference in a new issue