]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
hide all widgets on minimize; respect log level
authorgg <chown_tee@proton.me>
Mon, 12 Jan 2026 19:54:41 +0000 (14:54 -0500)
committergg <chown_tee@proton.me>
Mon, 12 Jan 2026 19:54:41 +0000 (14:54 -0500)
src/MainWindow.cpp
src/SettingsDialog.cpp
src/dialog/TxImportDialog.cpp
src/main.cpp
src/utils/Utils.cpp

index 571efc5d429892d970235852da0a6d5afdf5f4b6..c5497d55f9c6e93f3b5849e1dad61c2143f491dc 100644 (file)
@@ -1508,7 +1508,7 @@ void MainWindow::changeEvent(QEvent* event)
 
 // 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()) {
@@ -1525,11 +1525,11 @@ void MainWindow::changeEvent(QEvent* event)
             }
         }
     } 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();
                 }
@@ -1537,7 +1537,12 @@ void MainWindow::changeEvent(QEvent* event)
                 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();
+                        }
+                    }
                 }
             }
         });
index 9dabad09583ef63a7d79fb71c7fd8a589ee0a881..b9f6a4b190e37d9cc4d20010d28c0f93bac22c30 100644 (file)
@@ -238,6 +238,7 @@ void Settings::setupStorageTab() {
     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);
        }
index 56b2befce6a258fc80ed5e9737022106354a5cda..3f1b2685eab04e7b199087c28edc635034b187e3 100644 (file)
@@ -17,6 +17,8 @@ TxImportDialog::TxImportDialog(QWidget *parent, Wallet *wallet)
 
     connect(ui->btn_import, &QPushButton::clicked, this, &TxImportDialog::onImport);
 
+    ui->line_txid->setMinimumWidth(600);
+
     this->adjustSize();
     this->layout()->setSizeConstraint(QLayout::SetFixedSize);
 }
index 495479de7beef05b4d0ef3794a2a4270ea6e10bf..aa62546cacbd9eed01869b1826435fb2dde94bc7 100644 (file)
@@ -219,6 +219,6 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
     wm->setEventFilter(&filter);
 
     int exitCode = Application::exec();
-    qDebug() << "Application::exec() returned";
+    qDebug() << "Application::exec() returned with exit code:" << exitCode;
     return exitCode;
 }
index 375e535ae5aae55cbf879343390665724b0b79d1..8977e56deceba11a41c2b5b54dfb218b70be3e2b 100644 (file)
@@ -559,6 +559,20 @@ QTextCharFormat addressTextFormat(const SubaddressIndex &index, quint64 amount)
 }
 
 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;