bool churn = dialog.churn();
int outputs = dialog.outputs();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QtFuture::connect(m_wallet, &Wallet::preTransactionChecksComplete)
.then([this, keyImages, address, churn, outputs](int feeLevel){
m_wallet->sweepOutputs(keyImages, address, churn, outputs, feeLevel);
});
+#else
+ QObject::connect(m_wallet, &Wallet::preTransactionChecksComplete, [this, keyImages, address, churn, outputs](int feeLevel){
+ m_wallet->sweepOutputs(keyImages, address, churn, outputs, feeLevel);
+ });
+#endif
m_wallet->preTransactionChecks(dialog.feeLevel());
}
}
catch (const tools::error::daemon_busy &e) {
message.description = QString("Node was unable to respond. Failed request: %1").arg(QString::fromStdString(e.request()));
- message.helpItems = {"Try sending the transaction again.", "If this keeps happening, connect to a different node."};
+ message.helpItems = QStringList{"Try sending the transaction again.", "If this keeps happening, connect to a different node."};
}
catch (const tools::error::no_connection_to_daemon &e) {
message.description = QString("Connection to node lost. Failed request: %1").arg(QString::fromStdString(e.request()));
- message.helpItems = {"Try sending the transaction again.", "If this keeps happening, connect to a different node."};
+ message.helpItems = QStringList{"Try sending the transaction again.", "If this keeps happening, connect to a different node."};
}
catch (const tools::error::wallet_rpc_error &e) {
message.description = QString("RPC error: %1").arg(QString::fromStdString(e.to_string()));
- message.helpItems = {"Try sending the transaction again.", "If this keeps happening, connect to a different node."};
+ message.helpItems = QStringList{"Try sending the transaction again.", "If this keeps happening, connect to a different node."};
}
catch (const tools::error::get_outs_error &e) {
message.description = "Failed to get enough decoy outputs from node";
- message.helpItems = {"Your transaction has too many inputs. Try sending a lower amount."};
+ message.helpItems = QStringList{"Your transaction has too many inputs. Try sending a lower amount."};
}
catch (const tools::error::not_enough_unlocked_money &e) {
QString error;
error = QString("Spendable balance insufficient to pay for transaction.\n\nSpendable balance: %1\nTransaction needs: %2").arg(WalletManager::displayAmount(e.available()), WalletManager::displayAmount(e.tx_amount() + e.fee()));
}
message.description = error;
- message.helpItems = {"Wait for more balance to unlock.", "Click 'Help' to learn more about how balance works."};
+ message.helpItems = QStringList{"Wait for more balance to unlock.", "Click 'Help' to learn more about how balance works."};
message.doc = "balance";
}
catch (const tools::error::not_enough_money &e) {
message.description = QString("Not enough money to transfer\n\nTotal balance: %1\nTransaction amount: %2").arg(WalletManager::displayAmount(e.available()), WalletManager::displayAmount(e.tx_amount()));
- message.helpItems = {"If you are trying to send your entire balance, click 'Max'."};
+ message.helpItems = QStringList{"If you are trying to send your entire balance, click 'Max'."};
message.doc = "balance";
}
catch (const tools::error::tx_not_possible &e) {
message.description = QString("Not enough money to transfer. Transaction amount + fee exceeds available balance.\n\n"
"Spendable balance: %1\n"
"Transaction needs: %2").arg(WalletManager::displayAmount(e.available()), WalletManager::displayAmount(e.tx_amount() + e.fee()));
- message.helpItems = {"If you're trying to send your entire balance, click 'Max'."};
+ message.helpItems = QStringList{"If you're trying to send your entire balance, click 'Max'."};
message.doc = "balance";
}
catch (const tools::error::not_enough_outs_to_mix &e) {
}
catch (const tools::error::tx_not_constructed&) {
message.description = "Transaction was not constructed";
- message.helpItems = {"You have found a bug. Please contact the developers."};
+ message.helpItems = QStringList{"You have found a bug. Please contact the developers."};
message.doc = "report_an_issue";
}
catch (const tools::error::tx_rejected &e) {
}
catch (const tools::error::tx_sum_overflow &e) {
message.description = "Transaction tries to spend an unrealistic amount of XMR";
- message.helpItems = {"You have found a bug. Please contact the developers."};
+ message.helpItems = QStringList{"You have found a bug. Please contact the developers."};
message.doc = "report_an_issue";
}
catch (const tools::error::zero_amount&) {
message.description = "Destination amount is zero";
- message.helpItems = {"You have found a bug. Please contact the developers."};
+ message.helpItems = QStringList{"You have found a bug. Please contact the developers."};
message.doc = "report_an_issue";
}
catch (const tools::error::zero_destination&) {
message.description = "Transaction has no destination";
- message.helpItems = {"You have found a bug. Please contact the developers."};
+ message.helpItems = QStringList{"You have found a bug. Please contact the developers."};
message.doc = "report_an_issue";
}
catch (const tools::error::tx_too_big &e) {
message.description = "Transaction too big";
- message.helpItems = {"Try sending a smaller amount."};
+ message.helpItems = QStringList{"Try sending a smaller amount."};
}
catch (const tools::error::transfer_error &e) {
message.description = QString("Unknown transfer error: %1").arg(QString::fromStdString(e.what()));
- message.helpItems = {"You have found a bug. Please contact the developers."};
+ message.helpItems = QStringList{"You have found a bug. Please contact the developers."};
message.doc = "report_an_issue";
}
catch (const tools::error::wallet_internal_error &e) {
}
if (msg.contains("Failed to get height") || msg.contains("Failed to get earliest fork height")) {
message.description = QString("RPC error: %1").arg(QString::fromStdString(e.to_string()));
- message.helpItems = {"Try sending the transaction again.", "If this keeps happening, connect to a different node."};
+ message.helpItems = QStringList{"Try sending the transaction again.", "If this keeps happening, connect to a different node."};
bug = false;
}
if (bug) {
- message.helpItems = {"You have found a bug. Please contact the developers."};
+ message.helpItems = QStringList{"You have found a bug. Please contact the developers."};
message.doc = "report_an_issue";
}
}
amounts.push_back(output.amount);
}
+ #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QtFuture::connect(m_wallet, &Wallet::preTransactionChecksComplete)
.then([this, addresses, amounts, description, subtractFeeFromAmount](int feeLevel){
m_wallet->createTransactionMultiDest(addresses, amounts, description, feeLevel, subtractFeeFromAmount);
});
+ #else
+ // Qt 5 Fallback
+ connect(m_wallet, &Wallet::preTransactionChecksComplete, this, [this, addresses, amounts, description, subtractFeeFromAmount](int feeLevel){
+ m_wallet->createTransactionMultiDest(addresses, amounts, description, feeLevel, subtractFeeFromAmount);
+ });
+ #endif
m_wallet->preTransactionChecks(ui->combo_feePriority->currentIndex());
#endif
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QtFuture::connect(m_wallet, &Wallet::preTransactionChecksComplete)
- .then([this, recipient, amount, description, sendAll, subtractFeeFromAmount](int feeLevel){
- m_wallet->createTransaction(recipient, amount, description, sendAll, feeLevel, subtractFeeFromAmount);
- });
+ .then([this, recipient, amount, description, sendAll, subtractFeeFromAmount](int feeLevel){
+ m_wallet->createTransaction(recipient, amount, description, sendAll, feeLevel, subtractFeeFromAmount);
+ });
+#else
+ // Qt 5 Fallback
+ connect(m_wallet, &Wallet::preTransactionChecksComplete, this, [this, recipient, amount, description, sendAll, subtractFeeFromAmount](int feeLevel){
+ m_wallet->createTransaction(recipient, amount, description, sendAll, feeLevel, subtractFeeFromAmount);
+ });
+#endif
m_wallet->preTransactionChecks(ui->combo_feePriority->currentIndex());
}
// Ledger
if (error.contains("No device found")) {
msg.description = "No Ledger device found.";
- msg.helpItems = {"Make sure the Monero app is open on the device.", "If the problem persists, try restarting Feather."};
+ msg.helpItems = QStringList{"Make sure the Monero app is open on the device.", "If the problem persists, try restarting Feather."};
msg.doc = "create_wallet_hardware_device";
}
else if (error.contains("Unable to open device")) {
msg.description = "Unable to open device.";
- msg.helpItems = {"The device might be in use by a different application."};
+ msg.helpItems = QStringList{"The device might be in use by a different application."};
#if defined(Q_OS_LINUX)
msg.helpItems.append("On Linux you may need to follow the instructions in the link below before the device can be opened:\n"
"https://support.ledger.com/hc/en-us/articles/115005165269-Fix-connection-issues");
// Trezor
else if (error.contains("Unable to claim libusb device")) {
msg.description = "Unable to claim Trezor device";
- msg.helpItems = {"Please make sure the device is not used by another program, like Trezor Suite or trezord, and try again."};
+ msg.helpItems = QStringList{"Please make sure the device is not used by another program, like Trezor Suite or trezord, and try again."};
}
else if (error.contains("Cannot get a device address")) {
msg.description = "Cannot get a device address";
- msg.helpItems = {"Reattach the Trezor device and try again"};
+ msg.helpItems = QStringList{"Reattach the Trezor device and try again"};
}
else if (error.contains("Could not connect to the device Trezor") || error.contains("Device connect failed")) {
msg.description = "Could not connect to the Trezor device";
- msg.helpItems = {"Make sure the device is connected to your computer and unlocked."};
+ msg.helpItems = QStringList{"Make sure the device is connected to your computer and unlocked."};
#if defined(Q_OS_LINUX)
msg.helpItems.append("On Linux you may need to follow the instructions in the link below before the device can be opened:\n"
"https://wiki.trezor.io/Udev_rules");
#endif
}
else if (error.contains("Failed to acquire device")) {
- msg.helpItems = {"Make sure Trezor Suite and trezord are closed."};
+ msg.helpItems = QStringList{"Make sure Trezor Suite and trezord are closed."};
}
else if (error.contains("SW_CLIENT_NOT_SUPPORTED")) {
- msg.helpItems = {"Upgrade your Ledger device firmware to the latest version using Ledger Live.\n"
+ msg.helpItems = QStringList{"Upgrade your Ledger device firmware to the latest version using Ledger Live.\n"
"Then upgrade the Monero app for the Ledger device to the latest version."};
}
else if (error.contains("Wrong Device Status")) {
- msg.helpItems = {"The device may need to be unlocked."};
+ msg.helpItems = QStringList{"The device may need to be unlocked."};
}
else if (error.contains("Wrong Channel")) {
- msg.helpItems = {"Restart the hardware device and try again."};
+ msg.helpItems = QStringList{"Restart the hardware device and try again."};
}
else {
msg.doc = "report_an_issue";
Utils::showInfo(this, m_text, m_informativeText, {}, m_doc);
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void HelpLabel::enterEvent(QEnterEvent *event)
+#else
+void HelpLabel::enterEvent(QEvent *event)
+#endif
{
font.setUnderline(true);
setFont(font);
protected:
void mouseReleaseEvent(QMouseEvent *event) override;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void enterEvent(QEnterEvent *event) override;
+#else
+ void enterEvent(QEvent *event) override;
+#endif
void leaveEvent(QEvent *event) override;
private:
ui->date_max->setDate(QDate::currentDate());
});
- connect(ui->spin_days, &QSpinBox::valueChanged, [this] {
+ // Works on Qt 5 and Qt 6
+ connect(ui->spin_days, QOverload<int>::of(&QSpinBox::valueChanged), [this] {
ui->date_min->setDate(QDate::currentDate().addDays(-ui->spin_days->value() + 1));
ui->date_max->setDate(QDate::currentDate());
});
#include <QMutex>
#include <QPointer>
#include <QWaitCondition>
+#include <optional> // For Qt5 compatibility
/**
* Implements component responsible for showing entry prompt to the user,
if (!quiet && !conf()->get(Config::disableLogging).toBool()) {
QList<QPair<QString, QString>> info;
- info.emplace_back("Feather", FEATHER_VERSION);
- info.emplace_back("Monero", MONERO_VERSION);
- info.emplace_back("Qt", QT_VERSION_STR);
- info.emplace_back("Tor", TOR_VERSION);
- info.emplace_back("SSL", QSslSocket::sslLibraryVersionString());
- info.emplace_back("Mode", stagenet ? "Stagenet" : (testnet ? "Testnet" : "Mainnet"));
- info.emplace_back("Network", conf()->get(Config::syncPaused).toBool() ? "PAUSED" : "ACTIVE");
- info.emplace_back("Config dir", configDir);
+ info.push_back({"Feather", FEATHER_VERSION});
+ info.push_back({"Monero", MONERO_VERSION});
+ info.push_back({"Qt", QT_VERSION_STR});
+ info.push_back({"Tor", TOR_VERSION});
+ info.push_back({"SSL", QSslSocket::sslLibraryVersionString()});
+ info.push_back({"Mode", stagenet ? "Stagenet" : (testnet ? "Testnet" : "Mainnet")});
+ info.push_back({"Network", conf()->get(Config::syncPaused).toBool() ? "PAUSED" : "ACTIVE"});
+ info.push_back({"Config dir", configDir});
for (const auto &k: info) {
qWarning().nospace().noquote() << QString("%1: %2").arg(k.first, k.second);
#define FEATHER_COINSMODEL_H
#include <QAbstractTableModel>
+#include <QSet> // For Qt5 compatibility
class Coins;
class CoinsInfo;