mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 19:49:28 +00:00
CMake: minimize dependencies for CHECK_UPDATES=Off, WITH_SCANNER=Off
This commit is contained in:
parent
fde1b7b7c7
commit
2fe4e9e4b4
12 changed files with 68 additions and 25 deletions
|
@ -64,6 +64,9 @@ get_directory_property(UNBOUND_LIBRARY DIRECTORY "monero" DEFINITION UNBOUND_LIB
|
|||
get_directory_property(DEVICE_TREZOR_READY DIRECTORY "monero" DEFINITION DEVICE_TREZOR_READY)
|
||||
get_directory_property(TREZOR_DEP_LIBS DIRECTORY "monero" DEFINITION TREZOR_DEP_LIBS)
|
||||
|
||||
# pthread
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# Easylogging
|
||||
include_directories(${EASYLOGGING_INCLUDE})
|
||||
link_directories(${EASYLOGGING_LIBRARY_DIRS})
|
||||
|
@ -75,22 +78,26 @@ message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}")
|
|||
# QrEncode
|
||||
find_package(QREncode REQUIRED)
|
||||
|
||||
# ZBAR
|
||||
find_package(ZBAR REQUIRED)
|
||||
message(STATUS "libzbar: include dir at ${ZBAR_INCLUDE_DIR}")
|
||||
message(STATUS "libzbar: libraries at ${ZBAR_LIBRARIES}")
|
||||
|
||||
# Polyseed
|
||||
find_package(Polyseed REQUIRED)
|
||||
if(Polyseed_SUBMODULE)
|
||||
add_subdirectory(src/third-party/polyseed EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# ZBAR
|
||||
if(WITH_SCANNER)
|
||||
find_package(ZBAR REQUIRED)
|
||||
message(STATUS "libzbar: include dir at ${ZBAR_INCLUDE_DIR}")
|
||||
message(STATUS "libzbar: libraries at ${ZBAR_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
# libzip
|
||||
set(ZLIB_USE_STATIC_LIBS "ON")
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_path(LIBZIP_INCLUDE_DIRS zip.h)
|
||||
find_library(LIBZIP_LIBRARIES zip)
|
||||
if(CHECK_UPDATES)
|
||||
set(ZLIB_USE_STATIC_LIBS "ON")
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_path(LIBZIP_INCLUDE_DIRS zip.h)
|
||||
find_library(LIBZIP_LIBRARIES zip)
|
||||
endif()
|
||||
|
||||
# Boost
|
||||
if(DEBUG)
|
||||
|
@ -182,8 +189,6 @@ elseif(NOT MSVC AND NOT DEPENDS)
|
|||
set(EXTRA_LIBRARIES ${RT})
|
||||
endif()
|
||||
|
||||
list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
|
||||
if(APPLE)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -std=c++11")
|
||||
|
|
|
@ -2,9 +2,6 @@ set(CMAKE_AUTOMOC ON)
|
|||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
# pthread
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
set(QT_COMPONENTS
|
||||
Core
|
||||
Widgets
|
||||
|
@ -28,7 +25,9 @@ endif()
|
|||
set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
|
||||
add_subdirectory(third-party/singleapplication)
|
||||
|
||||
add_subdirectory(openpgp)
|
||||
if (CHECK_UPDATES)
|
||||
add_subdirectory(openpgp)
|
||||
endif()
|
||||
|
||||
qt_add_resources(RESOURCES assets.qrc assets_tor.qrc)
|
||||
|
||||
|
@ -74,6 +73,18 @@ file(GLOB SOURCE_FILES
|
|||
"plugins/*/*.h"
|
||||
)
|
||||
|
||||
if (CHECK_UPDATES)
|
||||
file(GLOB UPDATER_FILES
|
||||
"utils/updater/*.h"
|
||||
"utils/updater/*.cpp")
|
||||
endif()
|
||||
|
||||
if (WITH_SCANNER)
|
||||
file(GLOB QRCODE_UTILS_FILES
|
||||
"qrcode/utils/*.h"
|
||||
"qrcode/utils/*.cpp")
|
||||
endif()
|
||||
|
||||
if (WITH_SCANNER AND NOT Qt6_FOUND)
|
||||
file(GLOB SCANNER_FILES
|
||||
"qrcode/scanner/*.h"
|
||||
|
@ -87,6 +98,8 @@ if (WITH_SCANNER AND Qt6_FOUND)
|
|||
endif()
|
||||
|
||||
list(APPEND SOURCE_FILES
|
||||
${UPDATER_FILES}
|
||||
${QRCODE_UTILS_FILES}
|
||||
${SCANNER_FILES})
|
||||
|
||||
set(EXECUTABLE_FLAG)
|
||||
|
@ -143,12 +156,12 @@ target_include_directories(feather PUBLIC
|
|||
${QtWebSockets_INCLUDE_DIRS}
|
||||
${LIBZIP_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
${ZBAR_INCLUDE_DIR}
|
||||
${POLYSEED_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if(WITH_SCANNER)
|
||||
target_include_directories(feather PUBLIC
|
||||
${ZBAR_INCLUDE_DIR}
|
||||
${QtMultimedia_INCLUDE_DIRS}
|
||||
${QtMultimediaWidgets_INCLUDE_DIRS}
|
||||
)
|
||||
|
@ -230,7 +243,6 @@ target_link_libraries(feather
|
|||
ringct
|
||||
${Boost_LIBRARIES}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CMAKE_DL_LIBS}
|
||||
${EXTRA_LIBRARIES}
|
||||
Qt::Core
|
||||
Qt::Widgets
|
||||
|
@ -238,10 +250,8 @@ target_link_libraries(feather
|
|||
Qt::Network
|
||||
Qt::Svg
|
||||
Qt::WebSockets
|
||||
openpgp
|
||||
Threads::Threads
|
||||
${QRENCODE_LIBRARY}
|
||||
${ZBAR_LIBRARIES}
|
||||
${POLYSEED_LIBRARY}
|
||||
SingleApplication::SingleApplication
|
||||
${ICU_LIBRARIES}
|
||||
|
@ -249,6 +259,10 @@ target_link_libraries(feather
|
|||
${ZLIB_LIBRARIES}
|
||||
)
|
||||
|
||||
if(CHECK_UPDATES)
|
||||
target_link_libraries(feather openpgp)
|
||||
endif()
|
||||
|
||||
if(DEPENDS)
|
||||
target_link_libraries(feather ${ICONV_LIBRARIES})
|
||||
endif()
|
||||
|
@ -263,6 +277,7 @@ endif()
|
|||
|
||||
if (WITH_SCANNER)
|
||||
target_link_libraries(feather
|
||||
${ZBAR_LIBRARIES}
|
||||
Qt::Multimedia
|
||||
Qt::MultimediaWidgets
|
||||
)
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "dialog/ViewOnlyDialog.h"
|
||||
#include "dialog/WalletInfoDialog.h"
|
||||
#include "dialog/WalletCacheDebugDialog.h"
|
||||
#include "dialog/UpdateDialog.h"
|
||||
#include "libwalletqt/AddressBook.h"
|
||||
#include "libwalletqt/CoinsInfo.h"
|
||||
#include "libwalletqt/Transfer.h"
|
||||
|
@ -31,9 +30,11 @@
|
|||
#include "utils/Icons.h"
|
||||
#include "utils/SemanticVersion.h"
|
||||
#include "utils/TorManager.h"
|
||||
#include "utils/Updater.h"
|
||||
#include "utils/WebsocketNotifier.h"
|
||||
|
||||
#ifdef CHECK_UPDATES
|
||||
#include "utils/updater/UpdateDialog.h"
|
||||
#endif
|
||||
//#include "misc_log_ex.h"
|
||||
|
||||
MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *parent)
|
||||
|
@ -55,7 +56,9 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa
|
|||
m_splashDialog = new SplashDialog(this);
|
||||
m_accountSwitcherDialog = new AccountSwitcherDialog(m_wallet, this);
|
||||
|
||||
#ifdef CHECK_UPDATES
|
||||
m_updater = QSharedPointer<Updater>(new Updater(this));
|
||||
#endif
|
||||
|
||||
this->restoreGeo();
|
||||
|
||||
|
@ -70,7 +73,9 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa
|
|||
connect(websocketNotifier(), &WebsocketNotifier::BountyReceived, ui->bountiesWidget->model(), &BountiesModel::updateBounties);
|
||||
connect(websocketNotifier(), &WebsocketNotifier::RedditReceived, ui->redditWidget->model(), &RedditModel::updatePosts);
|
||||
connect(websocketNotifier(), &WebsocketNotifier::RevuoReceived, ui->revuoWidget, &RevuoWidget::updateItems);
|
||||
#ifdef CHECK_UPDATES
|
||||
connect(websocketNotifier(), &WebsocketNotifier::UpdatesReceived, m_updater.data(), &Updater::wsUpdatesReceived);
|
||||
#endif
|
||||
#ifdef HAS_XMRIG
|
||||
connect(websocketNotifier(), &WebsocketNotifier::XMRigDownloadsReceived, m_xmrig, &XMRigWidget::onDownloads);
|
||||
#endif
|
||||
|
@ -86,7 +91,9 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa
|
|||
connect(torManager(), &TorManager::connectionStateChanged, this, &MainWindow::onTorConnectionStateChanged);
|
||||
this->onTorConnectionStateChanged(torManager()->torConnected);
|
||||
|
||||
#ifdef CHECK_UPDATES
|
||||
connect(m_updater.data(), &Updater::updateAvailable, this, &MainWindow::showUpdateNotification);
|
||||
#endif
|
||||
|
||||
ColorScheme::updateFromWidget(this);
|
||||
QTimer::singleShot(1, [this]{this->updateWidgetIcons();});
|
||||
|
@ -1402,9 +1409,11 @@ void MainWindow::onHideUpdateNotifications(bool hidden) {
|
|||
if (hidden) {
|
||||
m_statusUpdateAvailable->hide();
|
||||
}
|
||||
#ifdef CHECK_UPDATES
|
||||
else if (m_updater->state == Updater::State::UPDATE_AVAILABLE) {
|
||||
m_statusUpdateAvailable->show();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::onTorConnectionStateChanged(bool connected) {
|
||||
|
@ -1419,6 +1428,7 @@ void MainWindow::onTorConnectionStateChanged(bool connected) {
|
|||
}
|
||||
|
||||
void MainWindow::showUpdateNotification() {
|
||||
#ifdef CHECK_UPDATES
|
||||
if (config()->get(Config::hideUpdateNotifications).toBool()) {
|
||||
return;
|
||||
}
|
||||
|
@ -1432,12 +1442,15 @@ void MainWindow::showUpdateNotification() {
|
|||
|
||||
m_statusUpdateAvailable->disconnect();
|
||||
connect(m_statusUpdateAvailable, &StatusBarButton::clicked, this, &MainWindow::showUpdateDialog);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::showUpdateDialog() {
|
||||
#ifdef CHECK_UPDATES
|
||||
UpdateDialog updateDialog{this, m_updater};
|
||||
connect(&updateDialog, &UpdateDialog::restartWallet, m_windowManager, &WindowManager::restartApplication);
|
||||
updateDialog.exec();
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::onInitiateTransaction() {
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "utils/config.h"
|
||||
#include "utils/daemonrpc.h"
|
||||
#include "utils/EventFilter.h"
|
||||
#include "utils/Updater.h"
|
||||
#include "plugins/ccs/CCSWidget.h"
|
||||
#include "plugins/reddit/RedditWidget.h"
|
||||
#include "widgets/TickerWidget.h"
|
||||
|
@ -46,6 +45,10 @@
|
|||
|
||||
#include "WindowManager.h"
|
||||
|
||||
#ifdef CHECK_UPDATES
|
||||
#include "utils/updater/Updater.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAS_LOCALMONERO
|
||||
#include "plugins/localmonero/LocalMoneroWidget.h"
|
||||
#endif
|
||||
|
@ -294,7 +297,9 @@ private:
|
|||
EventFilter *m_eventFilter = nullptr;
|
||||
qint64 m_userLastActive = QDateTime::currentSecsSinceEpoch();
|
||||
|
||||
#ifdef CHECK_UPDATES
|
||||
QSharedPointer<Updater> m_updater = nullptr;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // FEATHER_MAINWINDOW_H
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "utils/AsyncTask.h"
|
||||
#include "utils/Networking.h"
|
||||
#include "utils/NetworkManager.h"
|
||||
#include "utils/Updater.h"
|
||||
#include "utils/updater/Updater.h"
|
||||
#include "utils/Utils.h"
|
||||
#include "utils/SemanticVersion.h"
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#include <QNetworkReply>
|
||||
#include <QTimer>
|
||||
|
||||
#include "utils/Updater.h"
|
||||
#include "utils/updater/Updater.h"
|
||||
|
||||
namespace Ui {
|
||||
class UpdateDialog;
|
|
@ -10,9 +10,12 @@
|
|||
#include <QScrollBar>
|
||||
|
||||
#include "libwalletqt/WalletManager.h"
|
||||
#include "qrcode/QrCodeUtils.h"
|
||||
#include "utils/Utils.h"
|
||||
|
||||
#if defined(WITH_SCANNER)
|
||||
#include "qrcode/utils/QrCodeUtils.h"
|
||||
#endif
|
||||
|
||||
PayToEdit::PayToEdit(QWidget *parent) : QPlainTextEdit(parent)
|
||||
{
|
||||
this->setFont(Utils::getMonospaceFont());
|
||||
|
@ -108,10 +111,12 @@ void PayToEdit::pasteEvent(const QMimeData *mimeData) {
|
|||
return;
|
||||
}
|
||||
|
||||
#if defined(WITH_SCANNER)
|
||||
image.convertTo(QImage::Format_RGB32);
|
||||
QString result = QrCodeUtils::scanImage(image);
|
||||
|
||||
dataPasted(result);
|
||||
#endif
|
||||
}
|
||||
|
||||
void PayToEdit::checkText() {
|
||||
|
|
Loading…
Reference in a new issue