Browse Source

Add Q_OBJECT macros and fix Cannot invoke tr

pull/126/head
onryo 1 year ago
parent
commit
613df81407
  1. 2
      src/addressbook.h
  2. 6
      src/balancestablemodel.h
  3. 12
      src/controller.cpp
  4. 8
      src/firsttimewizard.h
  5. 6
      src/memoedit.h
  6. 4
      src/recurring.h
  7. 2
      src/viewalladdresses.h

2
src/addressbook.h

@ -11,6 +11,8 @@ class MainWindow;
class AddressBookModel : public QAbstractTableModel { class AddressBookModel : public QAbstractTableModel {
Q_OBJECT
public: public:
AddressBookModel(QTableView* parent); AddressBookModel(QTableView* parent);
~AddressBookModel(); ~AddressBookModel();

6
src/balancestablemodel.h

@ -8,8 +8,10 @@
#include "camount.h" #include "camount.h"
class BalancesTableModel : public QAbstractTableModel class BalancesTableModel : public QAbstractTableModel {
{
Q_OBJECT
public: public:
BalancesTableModel(QObject* parent); BalancesTableModel(QObject* parent);
~BalancesTableModel(); ~BalancesTableModel();

12
src/controller.cpp

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

8
src/firsttimewizard.h

@ -51,6 +51,8 @@ private:
class NewOrRestorePage: public QWizardPage { class NewOrRestorePage: public QWizardPage {
Q_OBJECT
public: public:
NewOrRestorePage(FirstTimeWizard* parent); NewOrRestorePage(FirstTimeWizard* parent);
@ -65,6 +67,9 @@ private:
class NewSeedPage: public QWizardPage { class NewSeedPage: public QWizardPage {
Q_OBJECT
public: public:
NewSeedPage(FirstTimeWizard* parent); NewSeedPage(FirstTimeWizard* parent);
@ -80,6 +85,9 @@ private:
class RestoreSeedPage: public QWizardPage { class RestoreSeedPage: public QWizardPage {
Q_OBJECT
public: public:
RestoreSeedPage(FirstTimeWizard* parent); RestoreSeedPage(FirstTimeWizard* parent);

6
src/memoedit.h

@ -5,8 +5,10 @@
#include "precompiled.h" #include "precompiled.h"
class MemoEdit : public QPlainTextEdit class MemoEdit : public QPlainTextEdit {
{
Q_OBJECT
public: public:
MemoEdit(QWidget* parent); MemoEdit(QWidget* parent);

4
src/recurring.h

@ -121,6 +121,8 @@ private:
// Model for list of configured recurring payments // Model for list of configured recurring payments
class RecurringListViewModel : public QAbstractTableModel { class RecurringListViewModel : public QAbstractTableModel {
Q_OBJECT
public: public:
RecurringListViewModel(QTableView* parent); RecurringListViewModel(QTableView* parent);
~RecurringListViewModel() = default; ~RecurringListViewModel() = default;
@ -138,6 +140,8 @@ private:
// Model for history of payments // Model for history of payments
class RecurringPaymentsListViewModel : public QAbstractTableModel { class RecurringPaymentsListViewModel : public QAbstractTableModel {
Q_OBJECT
public: public:
RecurringPaymentsListViewModel(QTableView* parent, RecurringPaymentInfo rpi); RecurringPaymentsListViewModel(QTableView* parent, RecurringPaymentInfo rpi);
~RecurringPaymentsListViewModel() = default; ~RecurringPaymentsListViewModel() = default;

2
src/viewalladdresses.h

@ -8,6 +8,8 @@
class ViewAllAddressesModel : public QAbstractTableModel { class ViewAllAddressesModel : public QAbstractTableModel {
Q_OBJECT
public: public:
ViewAllAddressesModel(QTableView* parent, QList<QString> taddrs, Controller* rpc); ViewAllAddressesModel(QTableView* parent, QList<QString> taddrs, Controller* rpc);
~ViewAllAddressesModel() = default; ~ViewAllAddressesModel() = default;

Loading…
Cancel
Save