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