1
0
Fork 0
forked from lthn/blockchain

fixes for disabling notification feature

This commit is contained in:
cryptozoidberg 2021-11-03 22:17:01 +01:00
parent 8ae6be2694
commit a2eb47d7e4
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
2 changed files with 9 additions and 4 deletions

View file

@ -865,6 +865,10 @@ bool MainWindow::money_transfer(const view::transfer_event_info& tei)
LOG_PRINT_L0(get_wallet_log_prefix(tei.wallet_id) + "SENDING SIGNAL -> [money_transfer]" << std::endl << json_str);
//this->money_transfer(json_str.c_str());
QMetaObject::invokeMethod(this, "money_transfer", Qt::QueuedConnection, Q_ARG(QString, json_str.c_str()));
if (m_config.disable_notifications)
return true;
if (!m_tray_icon)
return true;
if (!tei.ti.is_income)
@ -883,7 +887,7 @@ bool MainWindow::money_transfer(const view::transfer_event_info& tei)
return true;
}
auto amount_str = currency::print_money(tei.ti.amount);
auto amount_str = currency::print_money_brief(tei.ti.amount);
std::string title, msg;
if (tei.ti.height == 0) // unconfirmed trx
{
@ -900,8 +904,8 @@ bool MainWindow::money_transfer(const view::transfer_event_info& tei)
else if (tei.ti.unlock_time)
msg += m_localization[localization_id_locked];
if(!m_config.disable_notifications)
show_notification(title, msg);
show_notification(title, msg);
return true;
CATCH_ENTRY2(false);

View file

@ -181,6 +181,7 @@ signals:
void do_dispatch(const QString status, const QString params); //general function
void on_core_event(const QString method_name); //general function
void set_options(const QString str); //general function
void get_wallet_name();
private:
//-------------------- i_core_event_handler --------------------
@ -259,7 +260,7 @@ private:
enum localization_string_indices
{
// order is surprizingly important here! (see also updateLocalisation in AppController.js)
// order is surprisingly important here! (see also updateLocalisation in AppController.js)
localization_id_quit = 0,
localization_id_is_received,
localization_id_is_confirmed,