[tests] Remove accidental trailing semicolon
[bitcoinplatinum.git] / src / qt / transactionview.cpp
blobe3e070b27f3545d96498d27167854516b4709890
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #include "transactionview.h"
7 #include "addresstablemodel.h"
8 #include "bitcoinunits.h"
9 #include "csvmodelwriter.h"
10 #include "editaddressdialog.h"
11 #include "guiutil.h"
12 #include "optionsmodel.h"
13 #include "platformstyle.h"
14 #include "sendcoinsdialog.h"
15 #include "transactiondescdialog.h"
16 #include "transactionfilterproxy.h"
17 #include "transactionrecord.h"
18 #include "transactiontablemodel.h"
19 #include "walletmodel.h"
21 #include "ui_interface.h"
23 #include <QComboBox>
24 #include <QDateTimeEdit>
25 #include <QDesktopServices>
26 #include <QDoubleValidator>
27 #include <QHBoxLayout>
28 #include <QHeaderView>
29 #include <QLabel>
30 #include <QLineEdit>
31 #include <QMenu>
32 #include <QPoint>
33 #include <QScrollBar>
34 #include <QSignalMapper>
35 #include <QTableView>
36 #include <QUrl>
37 #include <QVBoxLayout>
39 TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) :
40 QWidget(parent), model(0), transactionProxyModel(0),
41 transactionView(0), abandonAction(0), bumpFeeAction(0), columnResizingFixer(0)
43 // Build filter row
44 setContentsMargins(0,0,0,0);
46 QHBoxLayout *hlayout = new QHBoxLayout();
47 hlayout->setContentsMargins(0,0,0,0);
49 if (platformStyle->getUseExtraSpacing()) {
50 hlayout->setSpacing(5);
51 hlayout->addSpacing(26);
52 } else {
53 hlayout->setSpacing(0);
54 hlayout->addSpacing(23);
57 watchOnlyWidget = new QComboBox(this);
58 watchOnlyWidget->setFixedWidth(24);
59 watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All);
60 watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes);
61 watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No);
62 hlayout->addWidget(watchOnlyWidget);
64 dateWidget = new QComboBox(this);
65 if (platformStyle->getUseExtraSpacing()) {
66 dateWidget->setFixedWidth(121);
67 } else {
68 dateWidget->setFixedWidth(120);
70 dateWidget->addItem(tr("All"), All);
71 dateWidget->addItem(tr("Today"), Today);
72 dateWidget->addItem(tr("This week"), ThisWeek);
73 dateWidget->addItem(tr("This month"), ThisMonth);
74 dateWidget->addItem(tr("Last month"), LastMonth);
75 dateWidget->addItem(tr("This year"), ThisYear);
76 dateWidget->addItem(tr("Range..."), Range);
77 hlayout->addWidget(dateWidget);
79 typeWidget = new QComboBox(this);
80 if (platformStyle->getUseExtraSpacing()) {
81 typeWidget->setFixedWidth(121);
82 } else {
83 typeWidget->setFixedWidth(120);
86 typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
87 typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
88 TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
89 typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
90 TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
91 typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
92 typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
93 typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));
95 hlayout->addWidget(typeWidget);
97 addressWidget = new QLineEdit(this);
98 #if QT_VERSION >= 0x040700
99 addressWidget->setPlaceholderText(tr("Enter address or label to search"));
100 #endif
101 hlayout->addWidget(addressWidget);
103 amountWidget = new QLineEdit(this);
104 #if QT_VERSION >= 0x040700
105 amountWidget->setPlaceholderText(tr("Min amount"));
106 #endif
107 if (platformStyle->getUseExtraSpacing()) {
108 amountWidget->setFixedWidth(97);
109 } else {
110 amountWidget->setFixedWidth(100);
112 amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
113 hlayout->addWidget(amountWidget);
115 QVBoxLayout *vlayout = new QVBoxLayout(this);
116 vlayout->setContentsMargins(0,0,0,0);
117 vlayout->setSpacing(0);
119 QTableView *view = new QTableView(this);
120 vlayout->addLayout(hlayout);
121 vlayout->addWidget(createDateRangeWidget());
122 vlayout->addWidget(view);
123 vlayout->setSpacing(0);
124 int width = view->verticalScrollBar()->sizeHint().width();
125 // Cover scroll bar width with spacing
126 if (platformStyle->getUseExtraSpacing()) {
127 hlayout->addSpacing(width+2);
128 } else {
129 hlayout->addSpacing(width);
131 // Always show scroll bar
132 view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
133 view->setTabKeyNavigation(false);
134 view->setContextMenuPolicy(Qt::CustomContextMenu);
136 view->installEventFilter(this);
138 transactionView = view;
139 transactionView->setObjectName("transactionView");
141 // Actions
142 abandonAction = new QAction(tr("Abandon transaction"), this);
143 bumpFeeAction = new QAction(tr("Increase transaction fee"), this);
144 bumpFeeAction->setObjectName("bumpFeeAction");
145 QAction *copyAddressAction = new QAction(tr("Copy address"), this);
146 QAction *copyLabelAction = new QAction(tr("Copy label"), this);
147 QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
148 QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
149 QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
150 QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this);
151 QAction *editLabelAction = new QAction(tr("Edit label"), this);
152 QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
154 contextMenu = new QMenu(this);
155 contextMenu->setObjectName("contextMenu");
156 contextMenu->addAction(copyAddressAction);
157 contextMenu->addAction(copyLabelAction);
158 contextMenu->addAction(copyAmountAction);
159 contextMenu->addAction(copyTxIDAction);
160 contextMenu->addAction(copyTxHexAction);
161 contextMenu->addAction(copyTxPlainText);
162 contextMenu->addAction(showDetailsAction);
163 contextMenu->addSeparator();
164 contextMenu->addAction(bumpFeeAction);
165 contextMenu->addAction(abandonAction);
166 contextMenu->addAction(editLabelAction);
168 mapperThirdPartyTxUrls = new QSignalMapper(this);
170 // Connect actions
171 connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString)));
173 connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int)));
174 connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int)));
175 connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int)));
176 connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString)));
177 connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString)));
179 connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));
180 connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
182 connect(bumpFeeAction, SIGNAL(triggered()), this, SLOT(bumpFee()));
183 connect(abandonAction, SIGNAL(triggered()), this, SLOT(abandonTx()));
184 connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
185 connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
186 connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
187 connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
188 connect(copyTxHexAction, SIGNAL(triggered()), this, SLOT(copyTxHex()));
189 connect(copyTxPlainText, SIGNAL(triggered()), this, SLOT(copyTxPlainText()));
190 connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
191 connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
194 void TransactionView::setModel(WalletModel *_model)
196 this->model = _model;
197 if(_model)
199 transactionProxyModel = new TransactionFilterProxy(this);
200 transactionProxyModel->setSourceModel(_model->getTransactionTableModel());
201 transactionProxyModel->setDynamicSortFilter(true);
202 transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
203 transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
205 transactionProxyModel->setSortRole(Qt::EditRole);
207 transactionView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
208 transactionView->setModel(transactionProxyModel);
209 transactionView->setAlternatingRowColors(true);
210 transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
211 transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
212 transactionView->setSortingEnabled(true);
213 transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);
214 transactionView->verticalHeader()->hide();
216 transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);
217 transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH);
218 transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH);
219 transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH);
220 transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
222 columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(transactionView, AMOUNT_MINIMUM_COLUMN_WIDTH, MINIMUM_COLUMN_WIDTH, this);
224 if (_model->getOptionsModel())
226 // Add third party transaction URLs to context menu
227 QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
228 for (int i = 0; i < listUrls.size(); ++i)
230 QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();
231 if (!host.isEmpty())
233 QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
234 if (i == 0)
235 contextMenu->addSeparator();
236 contextMenu->addAction(thirdPartyTxUrlAction);
237 connect(thirdPartyTxUrlAction, SIGNAL(triggered()), mapperThirdPartyTxUrls, SLOT(map()));
238 mapperThirdPartyTxUrls->setMapping(thirdPartyTxUrlAction, listUrls[i].trimmed());
243 // show/hide column Watch-only
244 updateWatchOnlyColumn(_model->haveWatchOnly());
246 // Watch-only signal
247 connect(_model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyColumn(bool)));
251 void TransactionView::chooseDate(int idx)
253 if(!transactionProxyModel)
254 return;
255 QDate current = QDate::currentDate();
256 dateRangeWidget->setVisible(false);
257 switch(dateWidget->itemData(idx).toInt())
259 case All:
260 transactionProxyModel->setDateRange(
261 TransactionFilterProxy::MIN_DATE,
262 TransactionFilterProxy::MAX_DATE);
263 break;
264 case Today:
265 transactionProxyModel->setDateRange(
266 QDateTime(current),
267 TransactionFilterProxy::MAX_DATE);
268 break;
269 case ThisWeek: {
270 // Find last Monday
271 QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
272 transactionProxyModel->setDateRange(
273 QDateTime(startOfWeek),
274 TransactionFilterProxy::MAX_DATE);
276 } break;
277 case ThisMonth:
278 transactionProxyModel->setDateRange(
279 QDateTime(QDate(current.year(), current.month(), 1)),
280 TransactionFilterProxy::MAX_DATE);
281 break;
282 case LastMonth:
283 transactionProxyModel->setDateRange(
284 QDateTime(QDate(current.year(), current.month(), 1).addMonths(-1)),
285 QDateTime(QDate(current.year(), current.month(), 1)));
286 break;
287 case ThisYear:
288 transactionProxyModel->setDateRange(
289 QDateTime(QDate(current.year(), 1, 1)),
290 TransactionFilterProxy::MAX_DATE);
291 break;
292 case Range:
293 dateRangeWidget->setVisible(true);
294 dateRangeChanged();
295 break;
299 void TransactionView::chooseType(int idx)
301 if(!transactionProxyModel)
302 return;
303 transactionProxyModel->setTypeFilter(
304 typeWidget->itemData(idx).toInt());
307 void TransactionView::chooseWatchonly(int idx)
309 if(!transactionProxyModel)
310 return;
311 transactionProxyModel->setWatchOnlyFilter(
312 (TransactionFilterProxy::WatchOnlyFilter)watchOnlyWidget->itemData(idx).toInt());
315 void TransactionView::changedPrefix(const QString &prefix)
317 if(!transactionProxyModel)
318 return;
319 transactionProxyModel->setAddressPrefix(prefix);
322 void TransactionView::changedAmount(const QString &amount)
324 if(!transactionProxyModel)
325 return;
326 CAmount amount_parsed = 0;
327 if(BitcoinUnits::parse(model->getOptionsModel()->getDisplayUnit(), amount, &amount_parsed))
329 transactionProxyModel->setMinAmount(amount_parsed);
331 else
333 transactionProxyModel->setMinAmount(0);
337 void TransactionView::exportClicked()
339 // CSV is currently the only supported format
340 QString filename = GUIUtil::getSaveFileName(this,
341 tr("Export Transaction History"), QString(),
342 tr("Comma separated file (*.csv)"), NULL);
344 if (filename.isNull())
345 return;
347 CSVModelWriter writer(filename);
349 // name, column, role
350 writer.setModel(transactionProxyModel);
351 writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
352 if (model && model->haveWatchOnly())
353 writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
354 writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
355 writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
356 writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
357 writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
358 writer.addColumn(BitcoinUnits::getAmountColumnTitle(model->getOptionsModel()->getDisplayUnit()), 0, TransactionTableModel::FormattedAmountRole);
359 writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole);
361 if(!writer.write()) {
362 Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
363 CClientUIInterface::MSG_ERROR);
365 else {
366 Q_EMIT message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
367 CClientUIInterface::MSG_INFORMATION);
371 void TransactionView::contextualMenu(const QPoint &point)
373 QModelIndex index = transactionView->indexAt(point);
374 QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
375 if (selection.empty())
376 return;
378 // check if transaction can be abandoned, disable context menu action in case it doesn't
379 uint256 hash;
380 hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
381 abandonAction->setEnabled(model->transactionCanBeAbandoned(hash));
382 bumpFeeAction->setEnabled(model->transactionCanBeBumped(hash));
384 if(index.isValid())
386 contextMenu->popup(transactionView->viewport()->mapToGlobal(point));
390 void TransactionView::abandonTx()
392 if(!transactionView || !transactionView->selectionModel())
393 return;
394 QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
396 // get the hash from the TxHashRole (QVariant / QString)
397 uint256 hash;
398 QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
399 hash.SetHex(hashQStr.toStdString());
401 // Abandon the wallet transaction over the walletModel
402 model->abandonTransaction(hash);
404 // Update the table
405 model->getTransactionTableModel()->updateTransaction(hashQStr, CT_UPDATED, false);
408 void TransactionView::bumpFee()
410 if(!transactionView || !transactionView->selectionModel())
411 return;
412 QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
414 // get the hash from the TxHashRole (QVariant / QString)
415 uint256 hash;
416 QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
417 hash.SetHex(hashQStr.toStdString());
419 // Bump tx fee over the walletModel
420 if (model->bumpFee(hash)) {
421 // Update the table
422 model->getTransactionTableModel()->updateTransaction(hashQStr, CT_UPDATED, true);
426 void TransactionView::copyAddress()
428 GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::AddressRole);
431 void TransactionView::copyLabel()
433 GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::LabelRole);
436 void TransactionView::copyAmount()
438 GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::FormattedAmountRole);
441 void TransactionView::copyTxID()
443 GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole);
446 void TransactionView::copyTxHex()
448 GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxHexRole);
451 void TransactionView::copyTxPlainText()
453 GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole);
456 void TransactionView::editLabel()
458 if(!transactionView->selectionModel() ||!model)
459 return;
460 QModelIndexList selection = transactionView->selectionModel()->selectedRows();
461 if(!selection.isEmpty())
463 AddressTableModel *addressBook = model->getAddressTableModel();
464 if(!addressBook)
465 return;
466 QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
467 if(address.isEmpty())
469 // If this transaction has no associated address, exit
470 return;
472 // Is address in address book? Address book can miss address when a transaction is
473 // sent from outside the UI.
474 int idx = addressBook->lookupAddress(address);
475 if(idx != -1)
477 // Edit sending / receiving address
478 QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
479 // Determine type of address, launch appropriate editor dialog type
480 QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
482 EditAddressDialog dlg(
483 type == AddressTableModel::Receive
484 ? EditAddressDialog::EditReceivingAddress
485 : EditAddressDialog::EditSendingAddress, this);
486 dlg.setModel(addressBook);
487 dlg.loadRow(idx);
488 dlg.exec();
490 else
492 // Add sending address
493 EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,
494 this);
495 dlg.setModel(addressBook);
496 dlg.setAddress(address);
497 dlg.exec();
502 void TransactionView::showDetails()
504 if(!transactionView->selectionModel())
505 return;
506 QModelIndexList selection = transactionView->selectionModel()->selectedRows();
507 if(!selection.isEmpty())
509 TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
510 dlg->setAttribute(Qt::WA_DeleteOnClose);
511 dlg->show();
515 void TransactionView::openThirdPartyTxUrl(QString url)
517 if(!transactionView || !transactionView->selectionModel())
518 return;
519 QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
520 if(!selection.isEmpty())
521 QDesktopServices::openUrl(QUrl::fromUserInput(url.replace("%s", selection.at(0).data(TransactionTableModel::TxHashRole).toString())));
524 QWidget *TransactionView::createDateRangeWidget()
526 dateRangeWidget = new QFrame();
527 dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
528 dateRangeWidget->setContentsMargins(1,1,1,1);
529 QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
530 layout->setContentsMargins(0,0,0,0);
531 layout->addSpacing(23);
532 layout->addWidget(new QLabel(tr("Range:")));
534 dateFrom = new QDateTimeEdit(this);
535 dateFrom->setDisplayFormat("dd/MM/yy");
536 dateFrom->setCalendarPopup(true);
537 dateFrom->setMinimumWidth(100);
538 dateFrom->setDate(QDate::currentDate().addDays(-7));
539 layout->addWidget(dateFrom);
540 layout->addWidget(new QLabel(tr("to")));
542 dateTo = new QDateTimeEdit(this);
543 dateTo->setDisplayFormat("dd/MM/yy");
544 dateTo->setCalendarPopup(true);
545 dateTo->setMinimumWidth(100);
546 dateTo->setDate(QDate::currentDate());
547 layout->addWidget(dateTo);
548 layout->addStretch();
550 // Hide by default
551 dateRangeWidget->setVisible(false);
553 // Notify on change
554 connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged()));
555 connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged()));
557 return dateRangeWidget;
560 void TransactionView::dateRangeChanged()
562 if(!transactionProxyModel)
563 return;
564 transactionProxyModel->setDateRange(
565 QDateTime(dateFrom->date()),
566 QDateTime(dateTo->date()).addDays(1));
569 void TransactionView::focusTransaction(const QModelIndex &idx)
571 if(!transactionProxyModel)
572 return;
573 QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
574 transactionView->scrollTo(targetIdx);
575 transactionView->setCurrentIndex(targetIdx);
576 transactionView->setFocus();
579 // We override the virtual resizeEvent of the QWidget to adjust tables column
580 // sizes as the tables width is proportional to the dialogs width.
581 void TransactionView::resizeEvent(QResizeEvent* event)
583 QWidget::resizeEvent(event);
584 columnResizingFixer->stretchColumnWidth(TransactionTableModel::ToAddress);
587 // Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
588 bool TransactionView::eventFilter(QObject *obj, QEvent *event)
590 if (event->type() == QEvent::KeyPress)
592 QKeyEvent *ke = static_cast<QKeyEvent *>(event);
593 if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))
595 GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole);
596 return true;
599 return QWidget::eventFilter(obj, event);
602 // show/hide column Watch-only
603 void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)
605 watchOnlyWidget->setVisible(fHaveWatchOnly);
606 transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);