Add Q_OBJECT macros and fix Cannot invoke tr

This commit is contained in:
onryo
2023-02-24 14:47:22 +01:00
parent 5a389cf1cf
commit 613df81407
7 changed files with 30 additions and 10 deletions

View File

@@ -1444,8 +1444,8 @@ void Controller::unlockIfEncrypted(std::function<void(void)> cb, std::function<v
// Wallet is encrypted and locked. Ask for the password and unlock.
QString password = QInputDialog::getText(
main,
main->tr("Wallet Password"),
main->tr("Your wallet is encrypted.\nPlease enter your wallet password"),
QObject::tr("Wallet Password"),
QObject::tr("Your wallet is encrypted.\nPlease enter your wallet password"),
QLineEdit::Password
);
@@ -1453,8 +1453,8 @@ void Controller::unlockIfEncrypted(std::function<void(void)> cb, std::function<v
{
QMessageBox::critical(
main,
main->tr("Wallet Decryption Failed"),
main->tr("Please enter a valid password"),
QObject::tr("Wallet Decryption Failed"),
QObject::tr("Please enter a valid password"),
QMessageBox::Ok
);
error();
@@ -1473,7 +1473,7 @@ void Controller::unlockIfEncrypted(std::function<void(void)> cb, std::function<v
{
QMessageBox::critical(
main,
main->tr("Wallet Decryption Failed"),
QObject::tr("Wallet Decryption Failed"),
QString::fromStdString(reply["error"].get<json::string_t>()),
QMessageBox::Ok
);
@@ -1543,7 +1543,7 @@ void Controller::executeTransaction(Tx tx,
error("", errStr);
});
}, [=]() {
error("", main->tr("Failed to unlock wallet"));
error("", QObject::tr("Failed to unlock wallet"));
});
}