From 8fd583a6495e61f093f9ae7abb214dc262edd382 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 28 Mar 2023 22:26:53 +0200 Subject: [PATCH] refactor: move third party integrations to plugins folder --- src/CMakeLists.txt | 2 ++ src/MainWindow.h | 8 ++++---- src/MainWindow.ui | 8 ++++---- src/SendWidget.h | 1 - src/{model => plugins/bounties}/BountiesModel.cpp | 0 src/{model => plugins/bounties}/BountiesModel.h | 2 +- src/{widgets => plugins/bounties}/BountiesWidget.cpp | 2 +- src/{widgets => plugins/bounties}/BountiesWidget.h | 2 +- src/{widgets => plugins/bounties}/BountiesWidget.ui | 0 src/{widgets => plugins/bounties}/Bounty.h | 0 src/{widgets => plugins/ccs}/CCSEntry.h | 0 src/{model => plugins/ccs}/CCSModel.cpp | 0 src/{model => plugins/ccs}/CCSModel.h | 2 +- src/{widgets => plugins/ccs}/CCSProgressDelegate.cpp | 0 src/{widgets => plugins/ccs}/CCSProgressDelegate.h | 2 +- src/{widgets => plugins/ccs}/CCSWidget.cpp | 0 src/{widgets => plugins/ccs}/CCSWidget.h | 4 ++-- src/{widgets => plugins/ccs}/CCSWidget.ui | 0 src/{api => plugins/localmonero}/LocalMoneroApi.cpp | 0 src/{api => plugins/localmonero}/LocalMoneroApi.h | 0 .../localmonero}/LocalMoneroInfoDialog.cpp | 0 .../localmonero}/LocalMoneroInfoDialog.h | 2 +- .../localmonero}/LocalMoneroInfoDialog.ui | 0 src/{model => plugins/localmonero}/LocalMoneroModel.cpp | 0 src/{model => plugins/localmonero}/LocalMoneroModel.h | 0 .../localmonero}/LocalMoneroWidget.cpp | 3 +-- src/{widgets => plugins/localmonero}/LocalMoneroWidget.h | 4 ++-- src/{widgets => plugins/localmonero}/LocalMoneroWidget.ui | 0 src/{model => plugins/reddit}/RedditModel.cpp | 0 src/{model => plugins/reddit}/RedditModel.h | 2 +- src/{widgets => plugins/reddit}/RedditPost.h | 0 src/{widgets => plugins/reddit}/RedditWidget.cpp | 2 +- src/{widgets => plugins/reddit}/RedditWidget.h | 2 +- src/{widgets => plugins/reddit}/RedditWidget.ui | 0 src/{widgets => plugins/revuo}/RevuoItem.h | 0 src/{widgets => plugins/revuo}/RevuoWidget.cpp | 0 src/{widgets => plugins/revuo}/RevuoWidget.h | 0 src/{widgets => plugins/revuo}/RevuoWidget.ui | 0 src/{widgets => plugins/xmrig}/XMRigWidget.cpp | 0 src/{widgets => plugins/xmrig}/XMRigWidget.h | 2 +- src/{widgets => plugins/xmrig}/XMRigWidget.ui | 0 src/{utils => plugins/xmrig}/xmrig.cpp | 2 +- src/{utils => plugins/xmrig}/xmrig.h | 0 src/utils/WebsocketNotifier.h | 8 ++++---- 44 files changed, 30 insertions(+), 30 deletions(-) rename src/{model => plugins/bounties}/BountiesModel.cpp (100%) rename src/{model => plugins/bounties}/BountiesModel.h (97%) rename src/{widgets => plugins/bounties}/BountiesWidget.cpp (98%) rename src/{widgets => plugins/bounties}/BountiesWidget.h (96%) rename src/{widgets => plugins/bounties}/BountiesWidget.ui (100%) rename src/{widgets => plugins/bounties}/Bounty.h (100%) rename src/{widgets => plugins/ccs}/CCSEntry.h (100%) rename src/{model => plugins/ccs}/CCSModel.cpp (100%) rename src/{model => plugins/ccs}/CCSModel.h (96%) rename src/{widgets => plugins/ccs}/CCSProgressDelegate.cpp (100%) rename src/{widgets => plugins/ccs}/CCSProgressDelegate.h (95%) rename src/{widgets => plugins/ccs}/CCSWidget.cpp (100%) rename src/{widgets => plugins/ccs}/CCSWidget.h (93%) rename src/{widgets => plugins/ccs}/CCSWidget.ui (100%) rename src/{api => plugins/localmonero}/LocalMoneroApi.cpp (100%) rename src/{api => plugins/localmonero}/LocalMoneroApi.h (100%) rename src/{dialog => plugins/localmonero}/LocalMoneroInfoDialog.cpp (100%) rename src/{dialog => plugins/localmonero}/LocalMoneroInfoDialog.h (95%) rename src/{dialog => plugins/localmonero}/LocalMoneroInfoDialog.ui (100%) rename src/{model => plugins/localmonero}/LocalMoneroModel.cpp (100%) rename src/{model => plugins/localmonero}/LocalMoneroModel.h (100%) rename src/{widgets => plugins/localmonero}/LocalMoneroWidget.cpp (99%) rename src/{widgets => plugins/localmonero}/LocalMoneroWidget.h (94%) rename src/{widgets => plugins/localmonero}/LocalMoneroWidget.ui (100%) rename src/{model => plugins/reddit}/RedditModel.cpp (100%) rename src/{model => plugins/reddit}/RedditModel.h (96%) rename src/{widgets => plugins/reddit}/RedditPost.h (100%) rename src/{widgets => plugins/reddit}/RedditWidget.cpp (98%) rename src/{widgets => plugins/reddit}/RedditWidget.h (96%) rename src/{widgets => plugins/reddit}/RedditWidget.ui (100%) rename src/{widgets => plugins/revuo}/RevuoItem.h (100%) rename src/{widgets => plugins/revuo}/RevuoWidget.cpp (100%) rename src/{widgets => plugins/revuo}/RevuoWidget.h (100%) rename src/{widgets => plugins/revuo}/RevuoWidget.ui (100%) rename src/{widgets => plugins/xmrig}/XMRigWidget.cpp (100%) rename src/{widgets => plugins/xmrig}/XMRigWidget.h (98%) rename src/{widgets => plugins/xmrig}/XMRigWidget.ui (100%) rename src/{utils => plugins/xmrig}/xmrig.cpp (99%) rename src/{utils => plugins/xmrig}/xmrig.h (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ada21ff..63a196e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,6 +72,8 @@ file(GLOB SOURCE_FILES "monero_seed/*.cpp" "monero_seed/*.c" "monero_seed/*.hpp" + "plugins/*/*.cpp" + "plugins/*/*.h" ) if (WITH_SCANNER AND NOT Qt6_FOUND) diff --git a/src/MainWindow.h b/src/MainWindow.h index 99a261c..e871c64 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -32,8 +32,8 @@ #include "utils/daemonrpc.h" #include "utils/EventFilter.h" #include "utils/Updater.h" -#include "widgets/CCSWidget.h" -#include "widgets/RedditWidget.h" +#include "plugins/ccs/CCSWidget.h" +#include "plugins/reddit/RedditWidget.h" #include "widgets/TickerWidget.h" #include "widgets/WalletUnlockWidget.h" #include "wizard/WalletWizard.h" @@ -47,11 +47,11 @@ #include "WindowManager.h" #ifdef HAS_LOCALMONERO -#include "widgets/LocalMoneroWidget.h" +#include "plugins/localmonero/LocalMoneroWidget.h" #endif #ifdef HAS_XMRIG -#include "widgets/XMRigWidget.h" +#include "plugins/xmrig/XMRigWidget.h" #endif namespace Ui { diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 0f913ea..710e39e 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -960,25 +960,25 @@ CCSWidget QWidget -
widgets/CCSWidget.h
+
plugins/ccs/CCSWidget.h
1
RedditWidget QWidget -
widgets/RedditWidget.h
+
plugins/reddit/RedditWidget.h
1
RevuoWidget QWidget -
widgets/RevuoWidget.h
+
plugins/revuo/RevuoWidget.h
1
BountiesWidget QWidget -
widgets/BountiesWidget.h
+
plugins/bounties/BountiesWidget.h
1
diff --git a/src/SendWidget.h b/src/SendWidget.h index ca13759..db11b5f 100644 --- a/src/SendWidget.h +++ b/src/SendWidget.h @@ -7,7 +7,6 @@ #include #include "libwalletqt/Wallet.h" -#include "widgets/CCSWidget.h" namespace Ui { class SendWidget; diff --git a/src/model/BountiesModel.cpp b/src/plugins/bounties/BountiesModel.cpp similarity index 100% rename from src/model/BountiesModel.cpp rename to src/plugins/bounties/BountiesModel.cpp diff --git a/src/model/BountiesModel.h b/src/plugins/bounties/BountiesModel.h similarity index 97% rename from src/model/BountiesModel.h rename to src/plugins/bounties/BountiesModel.h index cde0d23..34b6e0c 100644 --- a/src/model/BountiesModel.h +++ b/src/plugins/bounties/BountiesModel.h @@ -7,7 +7,7 @@ #include #include -#include "widgets/Bounty.h" +#include "Bounty.h" class BountiesModel : public QAbstractTableModel { diff --git a/src/widgets/BountiesWidget.cpp b/src/plugins/bounties/BountiesWidget.cpp similarity index 98% rename from src/widgets/BountiesWidget.cpp rename to src/plugins/bounties/BountiesWidget.cpp index 7562285..3ed33f1 100644 --- a/src/widgets/BountiesWidget.cpp +++ b/src/plugins/bounties/BountiesWidget.cpp @@ -8,7 +8,7 @@ #include #include -#include "model/BountiesModel.h" +#include "BountiesModel.h" #include "utils/Utils.h" #include "utils/config.h" diff --git a/src/widgets/BountiesWidget.h b/src/plugins/bounties/BountiesWidget.h similarity index 96% rename from src/widgets/BountiesWidget.h rename to src/plugins/bounties/BountiesWidget.h index 47f070b..02e51a4 100644 --- a/src/widgets/BountiesWidget.h +++ b/src/plugins/bounties/BountiesWidget.h @@ -8,7 +8,7 @@ #include #include -#include "model/BountiesModel.h" +#include "BountiesModel.h" namespace Ui { class BountiesWidget; diff --git a/src/widgets/BountiesWidget.ui b/src/plugins/bounties/BountiesWidget.ui similarity index 100% rename from src/widgets/BountiesWidget.ui rename to src/plugins/bounties/BountiesWidget.ui diff --git a/src/widgets/Bounty.h b/src/plugins/bounties/Bounty.h similarity index 100% rename from src/widgets/Bounty.h rename to src/plugins/bounties/Bounty.h diff --git a/src/widgets/CCSEntry.h b/src/plugins/ccs/CCSEntry.h similarity index 100% rename from src/widgets/CCSEntry.h rename to src/plugins/ccs/CCSEntry.h diff --git a/src/model/CCSModel.cpp b/src/plugins/ccs/CCSModel.cpp similarity index 100% rename from src/model/CCSModel.cpp rename to src/plugins/ccs/CCSModel.cpp diff --git a/src/model/CCSModel.h b/src/plugins/ccs/CCSModel.h similarity index 96% rename from src/model/CCSModel.h rename to src/plugins/ccs/CCSModel.h index 2ff4be0..7b34416 100644 --- a/src/model/CCSModel.h +++ b/src/plugins/ccs/CCSModel.h @@ -7,7 +7,7 @@ #include #include -#include "widgets/CCSEntry.h" +#include "CCSEntry.h" class CCSModel : public QAbstractTableModel { diff --git a/src/widgets/CCSProgressDelegate.cpp b/src/plugins/ccs/CCSProgressDelegate.cpp similarity index 100% rename from src/widgets/CCSProgressDelegate.cpp rename to src/plugins/ccs/CCSProgressDelegate.cpp diff --git a/src/widgets/CCSProgressDelegate.h b/src/plugins/ccs/CCSProgressDelegate.h similarity index 95% rename from src/widgets/CCSProgressDelegate.h rename to src/plugins/ccs/CCSProgressDelegate.h index 0e2319c..ed621ab 100644 --- a/src/widgets/CCSProgressDelegate.h +++ b/src/plugins/ccs/CCSProgressDelegate.h @@ -6,7 +6,7 @@ #include -#include "model/CCSModel.h" +#include "CCSModel.h" class CCSProgressDelegate : public QStyledItemDelegate { diff --git a/src/widgets/CCSWidget.cpp b/src/plugins/ccs/CCSWidget.cpp similarity index 100% rename from src/widgets/CCSWidget.cpp rename to src/plugins/ccs/CCSWidget.cpp diff --git a/src/widgets/CCSWidget.h b/src/plugins/ccs/CCSWidget.h similarity index 93% rename from src/widgets/CCSWidget.h rename to src/plugins/ccs/CCSWidget.h index 0b47e4d..473bbb4 100644 --- a/src/widgets/CCSWidget.h +++ b/src/plugins/ccs/CCSWidget.h @@ -10,8 +10,8 @@ #include #include -#include "model/CCSModel.h" -#include "widgets/CCSEntry.h" +#include "CCSModel.h" +#include "CCSEntry.h" namespace Ui { class CSSWidget; diff --git a/src/widgets/CCSWidget.ui b/src/plugins/ccs/CCSWidget.ui similarity index 100% rename from src/widgets/CCSWidget.ui rename to src/plugins/ccs/CCSWidget.ui diff --git a/src/api/LocalMoneroApi.cpp b/src/plugins/localmonero/LocalMoneroApi.cpp similarity index 100% rename from src/api/LocalMoneroApi.cpp rename to src/plugins/localmonero/LocalMoneroApi.cpp diff --git a/src/api/LocalMoneroApi.h b/src/plugins/localmonero/LocalMoneroApi.h similarity index 100% rename from src/api/LocalMoneroApi.h rename to src/plugins/localmonero/LocalMoneroApi.h diff --git a/src/dialog/LocalMoneroInfoDialog.cpp b/src/plugins/localmonero/LocalMoneroInfoDialog.cpp similarity index 100% rename from src/dialog/LocalMoneroInfoDialog.cpp rename to src/plugins/localmonero/LocalMoneroInfoDialog.cpp diff --git a/src/dialog/LocalMoneroInfoDialog.h b/src/plugins/localmonero/LocalMoneroInfoDialog.h similarity index 95% rename from src/dialog/LocalMoneroInfoDialog.h rename to src/plugins/localmonero/LocalMoneroInfoDialog.h index fa01844..fb4ffa6 100644 --- a/src/dialog/LocalMoneroInfoDialog.h +++ b/src/plugins/localmonero/LocalMoneroInfoDialog.h @@ -8,7 +8,7 @@ #include #include "components.h" -#include "model/LocalMoneroModel.h" +#include "LocalMoneroModel.h" namespace Ui { class LocalMoneroInfoDialog; diff --git a/src/dialog/LocalMoneroInfoDialog.ui b/src/plugins/localmonero/LocalMoneroInfoDialog.ui similarity index 100% rename from src/dialog/LocalMoneroInfoDialog.ui rename to src/plugins/localmonero/LocalMoneroInfoDialog.ui diff --git a/src/model/LocalMoneroModel.cpp b/src/plugins/localmonero/LocalMoneroModel.cpp similarity index 100% rename from src/model/LocalMoneroModel.cpp rename to src/plugins/localmonero/LocalMoneroModel.cpp diff --git a/src/model/LocalMoneroModel.h b/src/plugins/localmonero/LocalMoneroModel.h similarity index 100% rename from src/model/LocalMoneroModel.h rename to src/plugins/localmonero/LocalMoneroModel.h diff --git a/src/widgets/LocalMoneroWidget.cpp b/src/plugins/localmonero/LocalMoneroWidget.cpp similarity index 99% rename from src/widgets/LocalMoneroWidget.cpp rename to src/plugins/localmonero/LocalMoneroWidget.cpp index e00a900..7a2c72d 100644 --- a/src/widgets/LocalMoneroWidget.cpp +++ b/src/plugins/localmonero/LocalMoneroWidget.cpp @@ -7,10 +7,9 @@ #include #include -#include "dialog/LocalMoneroInfoDialog.h" +#include "LocalMoneroInfoDialog.h" #include "utils/ColorScheme.h" #include "utils/Icons.h" -#include "utils/NetworkManager.h" #include "utils/WebsocketNotifier.h" LocalMoneroWidget::LocalMoneroWidget(QWidget *parent, Wallet *wallet) diff --git a/src/widgets/LocalMoneroWidget.h b/src/plugins/localmonero/LocalMoneroWidget.h similarity index 94% rename from src/widgets/LocalMoneroWidget.h rename to src/plugins/localmonero/LocalMoneroWidget.h index ffb470a..edad19b 100644 --- a/src/widgets/LocalMoneroWidget.h +++ b/src/plugins/localmonero/LocalMoneroWidget.h @@ -6,8 +6,8 @@ #include -#include "api/LocalMoneroApi.h" -#include "model/LocalMoneroModel.h" +#include "LocalMoneroApi.h" +#include "LocalMoneroModel.h" #include "libwalletqt/Wallet.h" namespace Ui { diff --git a/src/widgets/LocalMoneroWidget.ui b/src/plugins/localmonero/LocalMoneroWidget.ui similarity index 100% rename from src/widgets/LocalMoneroWidget.ui rename to src/plugins/localmonero/LocalMoneroWidget.ui diff --git a/src/model/RedditModel.cpp b/src/plugins/reddit/RedditModel.cpp similarity index 100% rename from src/model/RedditModel.cpp rename to src/plugins/reddit/RedditModel.cpp diff --git a/src/model/RedditModel.h b/src/plugins/reddit/RedditModel.h similarity index 96% rename from src/model/RedditModel.h rename to src/plugins/reddit/RedditModel.h index a4b1c94..0b9da90 100644 --- a/src/model/RedditModel.h +++ b/src/plugins/reddit/RedditModel.h @@ -7,7 +7,7 @@ #include #include -#include "widgets/RedditPost.h" +#include "RedditPost.h" class RedditModel : public QAbstractTableModel { diff --git a/src/widgets/RedditPost.h b/src/plugins/reddit/RedditPost.h similarity index 100% rename from src/widgets/RedditPost.h rename to src/plugins/reddit/RedditPost.h diff --git a/src/widgets/RedditWidget.cpp b/src/plugins/reddit/RedditWidget.cpp similarity index 98% rename from src/widgets/RedditWidget.cpp rename to src/plugins/reddit/RedditWidget.cpp index c5089b8..c360586 100644 --- a/src/widgets/RedditWidget.cpp +++ b/src/plugins/reddit/RedditWidget.cpp @@ -8,7 +8,7 @@ #include #include -#include "model/RedditModel.h" +#include "RedditModel.h" #include "utils/Utils.h" #include "utils/config.h" diff --git a/src/widgets/RedditWidget.h b/src/plugins/reddit/RedditWidget.h similarity index 96% rename from src/widgets/RedditWidget.h rename to src/plugins/reddit/RedditWidget.h index a88cf4f..950700e 100644 --- a/src/widgets/RedditWidget.h +++ b/src/plugins/reddit/RedditWidget.h @@ -8,7 +8,7 @@ #include #include -#include "model/RedditModel.h" +#include "RedditModel.h" namespace Ui { class RedditWidget; diff --git a/src/widgets/RedditWidget.ui b/src/plugins/reddit/RedditWidget.ui similarity index 100% rename from src/widgets/RedditWidget.ui rename to src/plugins/reddit/RedditWidget.ui diff --git a/src/widgets/RevuoItem.h b/src/plugins/revuo/RevuoItem.h similarity index 100% rename from src/widgets/RevuoItem.h rename to src/plugins/revuo/RevuoItem.h diff --git a/src/widgets/RevuoWidget.cpp b/src/plugins/revuo/RevuoWidget.cpp similarity index 100% rename from src/widgets/RevuoWidget.cpp rename to src/plugins/revuo/RevuoWidget.cpp diff --git a/src/widgets/RevuoWidget.h b/src/plugins/revuo/RevuoWidget.h similarity index 100% rename from src/widgets/RevuoWidget.h rename to src/plugins/revuo/RevuoWidget.h diff --git a/src/widgets/RevuoWidget.ui b/src/plugins/revuo/RevuoWidget.ui similarity index 100% rename from src/widgets/RevuoWidget.ui rename to src/plugins/revuo/RevuoWidget.ui diff --git a/src/widgets/XMRigWidget.cpp b/src/plugins/xmrig/XMRigWidget.cpp similarity index 100% rename from src/widgets/XMRigWidget.cpp rename to src/plugins/xmrig/XMRigWidget.cpp diff --git a/src/widgets/XMRigWidget.h b/src/plugins/xmrig/XMRigWidget.h similarity index 98% rename from src/widgets/XMRigWidget.h rename to src/plugins/xmrig/XMRigWidget.h index a7e3f67..4a645f5 100644 --- a/src/widgets/XMRigWidget.h +++ b/src/plugins/xmrig/XMRigWidget.h @@ -9,7 +9,7 @@ #include #include -#include "utils/xmrig.h" +#include "xmrig.h" #include "utils/config.h" #include "libwalletqt/Wallet.h" diff --git a/src/widgets/XMRigWidget.ui b/src/plugins/xmrig/XMRigWidget.ui similarity index 100% rename from src/widgets/XMRigWidget.ui rename to src/plugins/xmrig/XMRigWidget.ui diff --git a/src/utils/xmrig.cpp b/src/plugins/xmrig/xmrig.cpp similarity index 99% rename from src/utils/xmrig.cpp rename to src/plugins/xmrig/xmrig.cpp index 418fd57..403a2e3 100644 --- a/src/utils/xmrig.cpp +++ b/src/plugins/xmrig/xmrig.cpp @@ -6,7 +6,7 @@ #include "utils/config.h" #include "utils/Utils.h" -#include "utils/xmrig.h" +#include "xmrig.h" #include "utils/TorManager.h" XmRig::XmRig(const QString &configDir, QObject *parent) diff --git a/src/utils/xmrig.h b/src/plugins/xmrig/xmrig.h similarity index 100% rename from src/utils/xmrig.h rename to src/plugins/xmrig/xmrig.h diff --git a/src/utils/WebsocketNotifier.h b/src/utils/WebsocketNotifier.h index 228f3f2..ce131ca 100644 --- a/src/utils/WebsocketNotifier.h +++ b/src/utils/WebsocketNotifier.h @@ -11,10 +11,10 @@ #include "networktype.h" #include "nodes.h" #include "prices.h" -#include "widgets/Bounty.h" -#include "widgets/RedditPost.h" -#include "widgets/CCSEntry.h" -#include "widgets/RevuoItem.h" +#include "plugins/bounties/Bounty.h" +#include "plugins/reddit/RedditPost.h" +#include "plugins/ccs/CCSEntry.h" +#include "plugins/revuo/RevuoItem.h" #include "TxFiatHistory.h" class WebsocketNotifier : public QObject {