From 0b72d01f4a798838a2887d3aa6f237d511304bb8 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 26 Mar 2023 07:55:34 -0700 Subject: [PATCH] Add DEBUG macro for less typing --- src/mainwindow.cpp | 18 +++++++++--------- src/sdl.h | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 src/sdl.h diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7f2c785..f00dfd6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -37,6 +37,7 @@ #include #include #include +#include "sdl.h" using json = nlohmann::json; @@ -158,11 +159,11 @@ MainWindow::MainWindow(QWidget *parent) : // Rescan QObject::connect(ui->actionRescan, &QAction::triggered, [=]() { - - Ui_Restore restoreSeed; - QDialog dialog(this); - restoreSeed.setupUi(&dialog); - Settings::saveRestore(&dialog); + DEBUG("rescan action triggered"); + Ui_Restore restoreSeed; + QDialog dialog(this); + restoreSeed.setupUi(&dialog); + Settings::saveRestore(&dialog); rpc->fetchSeed([=](json reply) { if (isJsonError(reply)) { @@ -260,15 +261,14 @@ MainWindow::MainWindow(QWidget *parent) : // Then reload the connection. The ConnectionLoader deletes itself. auto cl = new ConnectionLoader(this, rpc); cl->loadConnection(); - }); + }); }); - + } }); - dialog.exec(); -}); + }); // actionReason // Import Privkey QObject::connect(ui->actionImport_Privatkey, &QAction::triggered, this, &MainWindow::importPrivKey); diff --git a/src/sdl.h b/src/sdl.h new file mode 100644 index 0000000..68b24b3 --- /dev/null +++ b/src/sdl.h @@ -0,0 +1 @@ +#define DEBUG(x) (qDebug() << QString(__func__) << ": " << x)