// In changeEvent:
if (event->type() == QEvent::WindowStateChange) {
- qInfo() << "changeEvent: WindowStateChange. State:" << this->windowState() << " isMinimized:" << this->isMinimized();
+ qDebug() << "changeEvent: WindowStateChange. State:" << this->windowState() << " isMinimized:" << this->isMinimized();
if (this->isMinimized()) {
// ... existing logic ...
if (conf()->get(Config::lockOnMinimize).toBool()) {
}
}
} else if (event->type() == QEvent::ActivationChange) {
- qInfo() << "changeEvent: ActivationChange. Active:" << this->isActiveWindow();
+ qDebug() << "changeEvent: ActivationChange. Active:" << this->isActiveWindow();
QTimer::singleShot(500, this, [this](){
auto handle = this->windowHandle();
if (handle && !handle->isExposed()) {
- qInfo() << "ActivationChange (delayed): Window not exposed -> Hiding to tray";
+ qDebug() << "ActivationChange (delayed): Window not exposed -> Hiding to tray";
if (conf()->get(Config::lockOnMinimize).toBool()) {
this->lockWallet();
}
bool showTray = conf()->get(Config::showTrayIcon).toBool();
bool minimizeToTray = conf()->get(Config::minimizeToTray).toBool();
if (showTray && minimizeToTray) {
- this->hide();
+ // Hide all widgets and dialogs, not just MainWindow
+ for (const auto &widget : QApplication::topLevelWidgets()) {
+ if (widget->isVisible() && !widget->windowFlags().testFlag(Qt::Popup) && !widget->windowFlags().testFlag(Qt::ToolTip)) {
+ widget->hide();
+ }
+ }
}
}
});
ui->comboBox_logLevel->setCurrentIndex(conf()->get(Config::logLevel).toInt());
connect(ui->comboBox_logLevel, QOverload<int>::of(&QComboBox::currentIndexChanged), [](int index){
conf()->set(Config::logLevel, index);
+ qDebug() << "Log level changed to:" << index;
if (!conf()->get(Config::disableLogging).toBool()) {
WalletManager::instance()->setLogLevel(index);
}
connect(ui->btn_import, &QPushButton::clicked, this, &TxImportDialog::onImport);
+ ui->line_txid->setMinimumWidth(600);
+
this->adjustSize();
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
}
wm->setEventFilter(&filter);
int exitCode = Application::exec();
- qDebug() << "Application::exec() returned";
+ qDebug() << "Application::exec() returned with exit code:" << exitCode;
return exitCode;
}
}
void applicationLogHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
+ if (conf()->get(Config::disableLogging).toBool())
+ return;
+
+ int level = conf()->get(Config::logLevel).toInt();
+
+ // Mapping:
+ // 0: Critical/Fatal [always reported under below scheme]
+ // 1: + Warning
+ // 2: + Info
+ // 3+: + Debug
+ if (level < 3 && type == QtDebugMsg) return;
+ if (level < 2 && type == QtInfoMsg) return;
+ if (level < 1 && type == QtWarningMsg) return;
+
const QString fn = context.function ? QString::fromUtf8(context.function) : "";
const QString date = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss");
QString line;