Add Q_OBJECT macros and fix Cannot invoke tr
This commit is contained in:
@@ -11,6 +11,8 @@ class MainWindow;
|
||||
|
||||
class AddressBookModel : public QAbstractTableModel {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AddressBookModel(QTableView* parent);
|
||||
~AddressBookModel();
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
#include "camount.h"
|
||||
|
||||
|
||||
class BalancesTableModel : public QAbstractTableModel
|
||||
{
|
||||
class BalancesTableModel : public QAbstractTableModel {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BalancesTableModel(QObject* parent);
|
||||
~BalancesTableModel();
|
||||
|
||||
@@ -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"));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ private:
|
||||
|
||||
class NewOrRestorePage: public QWizardPage {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
NewOrRestorePage(FirstTimeWizard* parent);
|
||||
@@ -65,6 +67,9 @@ private:
|
||||
|
||||
|
||||
class NewSeedPage: public QWizardPage {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
NewSeedPage(FirstTimeWizard* parent);
|
||||
|
||||
@@ -80,6 +85,9 @@ private:
|
||||
|
||||
|
||||
class RestoreSeedPage: public QWizardPage {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RestoreSeedPage(FirstTimeWizard* parent);
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
class MemoEdit : public QPlainTextEdit
|
||||
{
|
||||
class MemoEdit : public QPlainTextEdit {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MemoEdit(QWidget* parent);
|
||||
|
||||
|
||||
@@ -121,6 +121,8 @@ private:
|
||||
// Model for list of configured recurring payments
|
||||
class RecurringListViewModel : public QAbstractTableModel {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RecurringListViewModel(QTableView* parent);
|
||||
~RecurringListViewModel() = default;
|
||||
@@ -138,6 +140,8 @@ private:
|
||||
// Model for history of payments
|
||||
class RecurringPaymentsListViewModel : public QAbstractTableModel {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RecurringPaymentsListViewModel(QTableView* parent, RecurringPaymentInfo rpi);
|
||||
~RecurringPaymentsListViewModel() = default;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
class ViewAllAddressesModel : public QAbstractTableModel {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ViewAllAddressesModel(QTableView* parent, QList<QString> taddrs, Controller* rpc);
|
||||
~ViewAllAddressesModel() = default;
|
||||
|
||||
Reference in New Issue
Block a user