MCPcopy Create free account
hub / github.com/ElementsProject/elements / setWalletModel

Method setWalletModel

src/qt/overviewpage.cpp:265–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265void OverviewPage::setWalletModel(WalletModel *model)
266{
267 this->walletModel = model;
268 if(model && model->getOptionsModel())
269 {
270 // Set up transaction list
271 filter.reset(new TransactionFilterProxy());
272 filter->setSourceModel(model->getTransactionTableModel());
273 filter->setLimit(NUM_ITEMS);
274 filter->setDynamicSortFilter(true);
275 filter->setSortRole(Qt::EditRole);
276 filter->setShowInactive(false);
277 filter->sort(TransactionTableModel::Date, Qt::DescendingOrder);
278
279 ui->listTransactions->setModel(filter.get());
280 ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress);
281
282 // Keep up to date with wallet
283 interfaces::Wallet& wallet = model->wallet();
284 interfaces::WalletBalances balances = wallet.getBalances();
285 setBalance(balances);
286 connect(model, &WalletModel::balanceChanged, this, &OverviewPage::setBalance);
287
288 connect(model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &OverviewPage::updateDisplayUnit);
289
290 updateWatchOnlyLabels(wallet.haveWatchOnly() && !model->wallet().privateKeysDisabled());
291 connect(model, &WalletModel::notifyWatchonlyChanged, [this](bool showWatchOnly) {
292 updateWatchOnlyLabels(showWatchOnly && !walletModel->wallet().privateKeysDisabled());
293 });
294 }
295
296 // update the display unit, to not use the default ("BTC")
297 updateDisplayUnit();
298}
299
300void OverviewPage::changeEvent(QEvent* e)
301{

Callers 2

WalletViewMethod · 0.80
TestGUIFunction · 0.80

Calls 12

setLimitMethod · 0.80
setShowInactiveMethod · 0.80
getBalancesMethod · 0.80
haveWatchOnlyMethod · 0.80
privateKeysDisabledMethod · 0.80
getOptionsModelMethod · 0.45
resetMethod · 0.45
sortMethod · 0.45
setModelMethod · 0.45
getMethod · 0.45
walletMethod · 0.45

Tested by 1

TestGUIFunction · 0.64