//slot of the update button click envent void EvaDetailsWindow::slotUpdateClick() { if(!frd) return; if( m_IsMemoPage ){ //if the user is in Memo page and the id is set //if the auto uplad checkbutton selected m_Memo.name = codec->fromUnicode(leMemoName->text()).data(); m_Memo.mobile = codec->fromUnicode(leMemoMobile->text()).data(); m_Memo.telephone = codec->fromUnicode(leMemoTelephone->text()).data(); m_Memo.address = codec->fromUnicode(leMemoAddress->text()).data(); m_Memo.email = codec->fromUnicode(leMemoEmail->text()).data(); m_Memo.zipcode = codec->fromUnicode(leMemoZipCode->text()).data(); m_Memo.note = codec->fromUnicode(teMemoNote->text()).data(); if(chbAutoUploadMemo->isChecked()){ emit memoChanged(frd->getQQ(), m_Memo); emit requestUploadMemo(frd->getQQ(), m_Memo); } else{ //save memo to local file emit memoChanged(frd->getQQ(), m_Memo); QMessageBox::information(this, i18n( "Store Memo"), i18n( "Store memo successfully")); } } else{ emit requestUpdate(id); } }
void TransferOperation::encryptMemo(Wallet* wallet, ChainDataModel* model) { if (!canEncryptMemo(wallet, model)) return; auto privateKey = graphene::utilities::wif_to_key(wallet->getPrivateKey(model->getAccount(sender())->memoKey()).toStdString()); if (!privateKey) return; m_op.memo->set_message(*privateKey, public_key_type(model->getAccount(receiver())->memoKey().toStdString()), memo().toStdString()); Q_EMIT memoChanged(); }
void TransferOperation::setMemo(QString memo) { if (memo == this->memo()) return; if (!m_op.memo) m_op.memo = graphene::chain::memo_data(); while (memo.size() % 32) memo.append('\0'); m_op.memo->set_message({}, {}, memo.toStdString()); Q_EMIT memoChanged(); }
bool EvaDetailsWindow::qt_emit( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { case 0: requestUpdate((const unsigned int)(*((const unsigned int*)static_QUType_ptr.get(_o+1)))); break; case 1: requestQQShow((const unsigned int)(*((const unsigned int*)static_QUType_ptr.get(_o+1)))); break; case 2: requestDownloadMemo((const unsigned int)(*((const unsigned int*)static_QUType_ptr.get(_o+1)))); break; case 3: requestUploadMemo((const unsigned int)(*((const unsigned int*)static_QUType_ptr.get(_o+1))),(const MemoItem&)*((const MemoItem*)static_QUType_ptr.get(_o+2))); break; case 4: memoChanged((const unsigned int)(*((const unsigned int*)static_QUType_ptr.get(_o+1))),(const MemoItem&)*((const MemoItem*)static_QUType_ptr.get(_o+2))); break; default: return EvaUserUIBase::qt_emit(_id,_o); } return TRUE; }
void TestRecurrentTransaction::testSetMemoNoSignal() { auto memo = QString("Dinner with friends"); auto numberOfDays = 3; auto amount = .45; auto account = std::make_shared<PublicAccount>("Test account", .0, ""); auto category = std::make_shared<com::chancho::Category>("Sushi", com::chancho::Category::Type::EXPENSE); auto transactionPtr = std::make_shared<com::chancho::Transaction>(account, amount, category); transactionPtr->memo = memo; auto recurrentPtr = std::make_shared<com::chancho::RecurrentTransaction>(transactionPtr, std::make_shared<com::chancho::RecurrentTransaction::Recurrence>(numberOfDays, QDate::currentDate())); auto qmlTransaction = std::make_shared<com::chancho::tests::PublicRecurrentTransaction>(recurrentPtr); QSignalSpy spy(qmlTransaction.get(), SIGNAL(memoChanged(QString))); qmlTransaction->setMemo(memo); QCOMPARE(spy.count(), 0); }