endif()
if (WITH_SCANNER)
+ include(CheckCXXSourceCompiles)
+ set(CMAKE_REQUIRED_LIBRARIES ${ZXING_LIBRARIES})
+
+ check_cxx_source_compiles("
+ #include <ZXing/ReadBarcode.h>
+ int main() {
+ auto fmt = ZXing::ImageFormat::BGRA;
+ return 0;
+ }
+ " HAVE_ZXING_BGRA)
+
+ if (HAVE_ZXING_BGRA)
+ target_compile_definitions(feather PRIVATE HAVE_ZXING_BGRA)
+ endif()
+
target_link_libraries(feather PRIVATE
Qt::Multimedia
Qt::MultimediaWidgets
if (m_actionDisconnectNodeOnPause->isChecked()) {
qInfo() << "Disconnecting from node (Pause Sync enabled)";
- m_nodes->disconnect();
+ m_nodes->disconnectCurrentNode();
this->onConnectionStatusChanged(Wallet::ConnectionStatus_Disconnected);
}
case QImage::Format_ARGB32:
case QImage::Format_RGB32:
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+#ifdef HAVE_ZXING_BGRA
return ZXing::ImageFormat::BGRA;
+#else
+ return ZXing::ImageFormat::BGRX;
+#endif
#else
return ZXing::ImageFormat::XRGB;
#endif
- case QImage::Format_RGB888:
+ case QImage::Format_RGB888:
return ZXing::ImageFormat::RGB;
case QImage::Format_RGBX8888:
- case QImage::Format_RGBA8888:
+ case QImage::Format_RGBA8888:
+#ifdef HAVE_ZXING_BGRA
return ZXing::ImageFormat::RGBA;
+#else
+ return ZXing::ImageFormat::RGBX;
+#endif
- case QImage::Format_Grayscale8:
+ case QImage::Format_Grayscale8:
return ZXing::ImageFormat::Lum;
default:
if (!node.isValid()) {
return;
}
+}
+
+void Nodes::disconnectCurrentNode() {
+ if (!m_wallet) return;
+
+ // Stop any ongoing connection attempt
+ m_connection.isActive = false;
+ m_connection.isConnecting = false;
+
+ // Connect to empty "node" effectively disconnects
+ m_wallet->initAsync("", false, 0);
+
+ this->resetLocalState();
+ this->updateModels();
+}
if (conf()->get(Config::offlineMode).toBool()) {
return;
public slots:
void connectToNode();
void connectToNode(const FeatherNode &node);
+ void disconnectCurrentNode();
void onWSNodesReceived(QList<FeatherNode>& nodes);
void onNodeSourceChanged(NodeSource nodeSource);
void setCustomNodes(const QList<FeatherNode>& nodes);