| 37 | #include <QVBoxLayout> |
| 38 | |
| 39 | TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) : |
| 40 | QWidget(parent), model(0), transactionProxyModel(0), |
| 41 | transactionView(0), abandonAction(0), bumpFeeAction(0), columnResizingFixer(0) |
| 42 | { |
| 43 | // Build filter row |
| 44 | setContentsMargins(0,0,0,0); |
| 45 | |
| 46 | QHBoxLayout *hlayout = new QHBoxLayout(); |
| 47 | hlayout->setContentsMargins(0,0,0,0); |
| 48 | |
| 49 | if (platformStyle->getUseExtraSpacing()) { |
| 50 | hlayout->setSpacing(5); |
| 51 | hlayout->addSpacing(26); |
| 52 | } else { |
| 53 | hlayout->setSpacing(0); |
| 54 | hlayout->addSpacing(23); |
| 55 | } |
| 56 | |
| 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); |
| 63 | |
| 64 | dateWidget = new QComboBox(this); |
| 65 | if (platformStyle->getUseExtraSpacing()) { |
| 66 | dateWidget->setFixedWidth(121); |
| 67 | } else { |
| 68 | dateWidget->setFixedWidth(120); |
| 69 | } |
| 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); |
| 78 | |
| 79 | typeWidget = new QComboBox(this); |
| 80 | if (platformStyle->getUseExtraSpacing()) { |
| 81 | typeWidget->setFixedWidth(121); |
| 82 | } else { |
| 83 | typeWidget->setFixedWidth(120); |
| 84 | } |
| 85 | |
| 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)); |
| 94 | |
| 95 | hlayout->addWidget(typeWidget); |
| 96 |
nothing calls this directly
no test coverage detected