diff options
Diffstat (limited to 'src')
45 files changed, 365 insertions, 42 deletions
diff --git a/src/alert.cpp b/src/alert.cpp index 46e861be9e..99164d63e5 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -10,6 +10,7 @@ #include "ui_interface.h" #include "util.h" +#include <stdint.h> #include <algorithm> #include <map> diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am index c0ebfb61d2..3bbc8516a0 100644 --- a/src/qt/Makefile.am +++ b/src/qt/Makefile.am @@ -7,8 +7,8 @@ AM_CPPFLAGS += -I$(top_srcdir)/src \ $(QR_CFLAGS) bin_PROGRAMS = bitcoin-qt noinst_LIBRARIES = libbitcoinqt.a -SUBDIRS = $(BUILD_TEST_QT) -DIST_SUBDIRS = test +SUBDIRS = . $(BUILD_TEST_QT) +DIST_SUBDIRS = . test # bitcoin qt core # QT_TS = \ diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 7e1831f037..4a4fece3e1 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -379,6 +379,121 @@ bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt) return QObject::eventFilter(obj, evt); } +void TableViewLastColumnResizingFixer::connectViewHeadersSignals() +{ + connect(tableView->horizontalHeader(), SIGNAL(sectionResized(int,int,int)), this, SLOT(on_sectionResized(int,int,int))); + connect(tableView->horizontalHeader(), SIGNAL(geometriesChanged()), this, SLOT(on_geometriesChanged())); +} + +//we need to disconnect these while handling the resize events, otherwise we can enter infinite loops +void TableViewLastColumnResizingFixer::disconnectViewHeadersSignals() +{ + disconnect(tableView->horizontalHeader(), SIGNAL(sectionResized(int,int,int)), this, SLOT(on_sectionResized(int,int,int))); + disconnect(tableView->horizontalHeader(), SIGNAL(geometriesChanged()), this, SLOT(on_geometriesChanged())); +} + +//setup the resize mode, handles compatibility for QT5 and below as the method signatures changed. (refactored here for readability) +void TableViewLastColumnResizingFixer::setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode) +{ +#if QT_VERSION < 0x050000 + tableView->horizontalHeader()->setResizeMode(logicalIndex, resizeMode); +#else + tableView->horizontalHeader()->setSectionResizeMode(logicalIndex, resizeMode); +#endif +} + +void TableViewLastColumnResizingFixer::resizeColumn(int nColumnIndex, int width) { + tableView->setColumnWidth(nColumnIndex, width); + tableView->horizontalHeader()->resizeSection(nColumnIndex, width); +} + +int TableViewLastColumnResizingFixer::getColumnsWidth() +{ + int nColumnsWidthSum = 0; + for (int i = 0; i < columnCount; i++) + { + nColumnsWidthSum += tableView->horizontalHeader()->sectionSize(i); + } + return nColumnsWidthSum; +} + +int TableViewLastColumnResizingFixer::getAvailableWidthForColumn(int column) +{ + int nResult = lastColumnMinimumWidth; + int nTableWidth = tableView->horizontalHeader()->width(); + + if (nTableWidth > 0) + { + int nOtherColsWidth = getColumnsWidth() - tableView->horizontalHeader()->sectionSize(column); + nResult = std::max(nResult, nTableWidth - nOtherColsWidth); + } + + return nResult; +} + +//make sure we don't make the columns wider than the table's viewport's width. +void TableViewLastColumnResizingFixer::adjustTableColumnsWidth() +{ + disconnectViewHeadersSignals(); + resizeColumn(lastColumnIndex, getAvailableWidthForColumn(lastColumnIndex)); + connectViewHeadersSignals(); + + int nTableWidth = tableView->horizontalHeader()->width(); + int nColsWidth = getColumnsWidth(); + if (nColsWidth > nTableWidth) + { + resizeColumn(secondToLastColumnIndex,getAvailableWidthForColumn(secondToLastColumnIndex)); + } +} + +//make column use all the space available, useful during window resizing. +void TableViewLastColumnResizingFixer::stretchColumnWidth(int column) { + disconnectViewHeadersSignals(); + resizeColumn(column, getAvailableWidthForColumn(column)); + connectViewHeadersSignals(); +} + +//when a section is resized this is a slot-proxy for ajustAmountColumnWidth() +void TableViewLastColumnResizingFixer::on_sectionResized(int logicalIndex, int oldSize, int newSize) +{ + adjustTableColumnsWidth(); + int remainingWidth = getAvailableWidthForColumn(logicalIndex); + if (newSize > remainingWidth) + { + resizeColumn(logicalIndex, remainingWidth); + } +} + +//when the table's geometry is ready, we manually perform the Stretch of the "Message" column +//as the "Stretch" resize mode does not allow for interactive resizing. +void TableViewLastColumnResizingFixer::on_geometriesChanged() +{ + if ((getColumnsWidth() - this->tableView->horizontalHeader()->width()) != 0) + { + disconnectViewHeadersSignals(); + resizeColumn(secondToLastColumnIndex, getAvailableWidthForColumn(secondToLastColumnIndex)); + connectViewHeadersSignals(); + } +} + +/** + * Initializes all internal variables and prepares the + * the resize modes of the last 2 columns of the table and + */ +TableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer(QTableView* table, int lastColMinimumWidth, int allColsMinimumWidth) : + tableView(table), + lastColumnMinimumWidth(lastColMinimumWidth), + allColumnsMinimumWidth(allColsMinimumWidth) +{ + columnCount = tableView->horizontalHeader()->count(); + lastColumnIndex = columnCount - 1; + secondToLastColumnIndex = columnCount - 2; + tableView->horizontalHeader()->setMinimumSectionSize(allColumnsMinimumWidth); + setViewHeaderResizeMode(secondToLastColumnIndex, QHeaderView::Interactive); + setViewHeaderResizeMode(lastColumnIndex, QHeaderView::Interactive); +} + + #ifdef WIN32 boost::filesystem::path static StartupShortcutPath() { diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 52124ff20a..26202e8d41 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -8,6 +8,8 @@ #include <QMessageBox> #include <QObject> #include <QString> +#include <QTableView> +#include <QHeaderView> class QValidatedLineEdit; class SendCoinsRecipient; @@ -116,6 +118,44 @@ namespace GUIUtil int size_threshold; }; + /** + * Makes a QTableView last column feel as if it was being resized from its left border. + * Also makes sure the column widths are never larger than the table's viewport. + * In Qt, all columns are resizable from the right, but it's not intuitive resizing the last column from the right. + * Usually our second to last columns behave as if stretched, and when on strech mode, columns aren't resizable + * interactively or programatically. + * + * This helper object takes care of this issue. + * + */ + class TableViewLastColumnResizingFixer: public QObject + { + Q_OBJECT + public: + TableViewLastColumnResizingFixer(QTableView* table, int lastColMinimumWidth, int allColsMinimumWidth); + void stretchColumnWidth(int column); + + private: + QTableView* tableView; + int lastColumnMinimumWidth; + int allColumnsMinimumWidth; + int lastColumnIndex; + int columnCount; + int secondToLastColumnIndex; + + void adjustTableColumnsWidth(); + int getAvailableWidthForColumn(int column); + int getColumnsWidth(); + void connectViewHeadersSignals(); + void disconnectViewHeadersSignals(); + void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode); + void resizeColumn(int nColumnIndex, int width); + + private slots: + void on_sectionResized(int logicalIndex, int oldSize, int newSize); + void on_geometriesChanged(); + }; + bool GetStartOnSystemStartup(); bool SetStartOnSystemStartup(bool fAutoStart); diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index 2af3949ae4..f630324947 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -55,34 +55,35 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(QWidget *parent) : connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); } + + void ReceiveCoinsDialog::setModel(WalletModel *model) { this->model = model; if(model && model->getOptionsModel()) { - connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); - updateDisplayUnit(); - - ui->recentRequestsView->setModel(model->getRecentRequestsTableModel()); - ui->recentRequestsView->setAlternatingRowColors(true); - ui->recentRequestsView->setSelectionBehavior(QAbstractItemView::SelectRows); - ui->recentRequestsView->setSelectionMode(QAbstractItemView::ContiguousSelection); - ui->recentRequestsView->horizontalHeader()->resizeSection(RecentRequestsTableModel::Date, 130); - ui->recentRequestsView->horizontalHeader()->resizeSection(RecentRequestsTableModel::Label, 120); -#if QT_VERSION < 0x050000 - ui->recentRequestsView->horizontalHeader()->setResizeMode(RecentRequestsTableModel::Message, QHeaderView::Stretch); -#else - ui->recentRequestsView->horizontalHeader()->setSectionResizeMode(RecentRequestsTableModel::Message, QHeaderView::Stretch); -#endif - ui->recentRequestsView->horizontalHeader()->resizeSection(RecentRequestsTableModel::Amount, 100); - model->getRecentRequestsTableModel()->sort(RecentRequestsTableModel::Date, Qt::DescendingOrder); - + connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); connect(ui->recentRequestsView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(on_recentRequestsView_selectionChanged(QItemSelection, QItemSelection))); + updateDisplayUnit(); + + QTableView* tableView = ui->recentRequestsView; + + tableView->verticalHeader()->hide(); + tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + tableView->setModel(model->getRecentRequestsTableModel()); + tableView->setAlternatingRowColors(true); + tableView->setSelectionBehavior(QAbstractItemView::SelectRows); + tableView->setSelectionMode(QAbstractItemView::ContiguousSelection); + tableView->setColumnWidth(RecentRequestsTableModel::Date, DATE_COLUMN_WIDTH); + tableView->setColumnWidth(RecentRequestsTableModel::Label, LABEL_COLUMN_WIDTH); + + //(last 2 columns are set when the table geometry is ready) by the columnResizingFixer. + columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH); } } @@ -200,6 +201,12 @@ void ReceiveCoinsDialog::on_removeRequestButton_clicked() model->getRecentRequestsTableModel()->removeRows(firstIndex.row(), selection.length(), firstIndex.parent()); } +//We override the virtual resizeEvent of the QWidget to adjust tablet's column sizes as the table's width is proportional to the dialog's. +void ReceiveCoinsDialog::resizeEvent(QResizeEvent* event) { + QWidget::resizeEvent(event); + columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message); +} + void ReceiveCoinsDialog::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Return) diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h index bfe8b3401f..1d051d9324 100644 --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -10,7 +10,9 @@ #include <QMenu> #include <QPoint> #include <QVariant> +#include <QHeaderView> #include <QItemSelection> +#include "guiutil.h" namespace Ui { class ReceiveCoinsDialog; @@ -28,11 +30,18 @@ class ReceiveCoinsDialog : public QDialog Q_OBJECT public: + enum ColumnWidths { + DATE_COLUMN_WIDTH = 130, + LABEL_COLUMN_WIDTH = 120, + AMOUNT_MINIMUM_COLUMN_WIDTH = 160, + MINIMUM_COLUMN_WIDTH = 130 + }; + explicit ReceiveCoinsDialog(QWidget *parent = 0); ~ReceiveCoinsDialog(); - void setModel(WalletModel *model); + public slots: void clear(); void reject(); @@ -43,9 +52,11 @@ protected: private: Ui::ReceiveCoinsDialog *ui; + GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; WalletModel *model; QMenu *contextMenu; void copyColumnToClipboard(int column); + virtual void resizeEvent(QResizeEvent* event); private slots: void on_receiveButton_clicked(); diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index a0c3ce62aa..d178efe8d5 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -168,6 +168,7 @@ void TransactionView::setModel(WalletModel *model) transactionProxyModel->setSortRole(Qt::EditRole); + transactionView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); transactionView->setModel(transactionProxyModel); transactionView->setAlternatingRowColors(true); transactionView->setSelectionBehavior(QAbstractItemView::SelectRows); @@ -176,15 +177,12 @@ void TransactionView::setModel(WalletModel *model) transactionView->sortByColumn(TransactionTableModel::Status, Qt::DescendingOrder); transactionView->verticalHeader()->hide(); - transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Status, 23); - transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Date, 120); - transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Type, 120); -#if QT_VERSION < 0x050000 - transactionView->horizontalHeader()->setResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch); -#else - transactionView->horizontalHeader()->setSectionResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch); -#endif - transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Amount, 100); + transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH); + transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH); + transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH); + transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH); + + columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(transactionView, AMOUNT_MINIMUM_COLUMN_WIDTH, MINIMUM_COLUMN_WIDTH); } } @@ -439,3 +437,9 @@ void TransactionView::focusTransaction(const QModelIndex &idx) transactionView->setCurrentIndex(targetIdx); transactionView->setFocus(); } + +//We override the virtual resizeEvent of the QWidget to adjust tablet's column sizes as the table's width is proportional to the dialog's. +void TransactionView::resizeEvent(QResizeEvent* event) { + QWidget::resizeEvent(event); + columnResizingFixer->stretchColumnWidth(TransactionTableModel::ToAddress); +} diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index 18f2b9bfc9..fe8e205d6c 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -6,6 +6,7 @@ #define TRANSACTIONVIEW_H #include <QWidget> +#include "guiutil.h" class TransactionFilterProxy; class WalletModel; @@ -44,6 +45,14 @@ public: Range }; + enum ColumnWidths { + STATUS_COLUMN_WIDTH = 23, + DATE_COLUMN_WIDTH = 120, + TYPE_COLUMN_WIDTH = 120, + AMOUNT_MINIMUM_COLUMN_WIDTH = 120, + MINIMUM_COLUMN_WIDTH = 23 + }; + private: WalletModel *model; TransactionFilterProxy *transactionProxyModel; @@ -62,6 +71,10 @@ private: QWidget *createDateRangeWidget(); + GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; + + virtual void resizeEvent(QResizeEvent* event); + private slots: void contextualMenu(const QPoint &); void dateRangeChanged(); diff --git a/src/test/Checkpoints_tests.cpp b/src/test/Checkpoints_tests.cpp index 78b0236b74..8f70f18c7c 100644 --- a/src/test/Checkpoints_tests.cpp +++ b/src/test/Checkpoints_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2011-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + // // Unit tests for block-chain checkpoints // diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index 7bf7b19b54..d86cc7a290 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2011-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + // // Unit tests for denial-of-service detection/prevention code // diff --git a/src/test/accounting_tests.cpp b/src/test/accounting_tests.cpp index bfdb95927b..e2a75da349 100644 --- a/src/test/accounting_tests.cpp +++ b/src/test/accounting_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2012-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "wallet.h" #include "walletdb.h" diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index a7e668222d..b16f3f7f57 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + // // Unit tests for alert system // diff --git a/src/test/allocator_tests.cpp b/src/test/allocator_tests.cpp index 490dff87e5..2752a0b215 100644 --- a/src/test/allocator_tests.cpp +++ b/src/test/allocator_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util.h" diff --git a/src/test/base32_tests.cpp b/src/test/base32_tests.cpp index 580e87f65f..87473585e3 100644 --- a/src/test/base32_tests.cpp +++ b/src/test/base32_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util.h" diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 94e84049be..5689e69995 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2011-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "base58.h" #include "data/base58_encode_decode.json.h" diff --git a/src/test/base64_tests.cpp b/src/test/base64_tests.cpp index c59c290669..d4a23d9aa0 100644 --- a/src/test/base64_tests.cpp +++ b/src/test/base64_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2011-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util.h" diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp index 205b15adcf..6587389a07 100644 --- a/src/test/bignum_tests.cpp +++ b/src/test/bignum_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "bignum.h" #include <limits> diff --git a/src/test/bip32_tests.cpp b/src/test/bip32_tests.cpp index 2bcca24336..9cf07fc38c 100644 --- a/src/test/bip32_tests.cpp +++ b/src/test/bip32_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include <boost/test/unit_test.hpp> #include "base58.h" diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index c4e4403b70..abedd3093c 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "bloom.h" #include "base58.h" diff --git a/src/test/canonical_tests.cpp b/src/test/canonical_tests.cpp index c521f2cf9c..a26ad335a4 100644 --- a/src/test/canonical_tests.cpp +++ b/src/test/canonical_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + // // Unit tests for canonical signatures // diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp index 67503b200b..10352240f4 100644 --- a/src/test/checkblock_tests.cpp +++ b/src/test/checkblock_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2013-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + // // Unit tests for block.CheckBlock() // diff --git a/src/test/compress_tests.cpp b/src/test/compress_tests.cpp index 4d16914774..719955ba85 100644 --- a/src/test/compress_tests.cpp +++ b/src/test/compress_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "main.h" #include "util.h" diff --git a/src/test/data/README.md b/src/test/data/README.md new file mode 100644 index 0000000000..f69a021ca0 --- /dev/null +++ b/src/test/data/README.md @@ -0,0 +1,14 @@ +Description +------------ + +This directory contains data-driven tests for various aspects of Bitcoin. + +License +-------- + +The data files in this directory are + + Copyright (c) 2012-2014 The Bitcoin Core developers + Distributed under the MIT/X11 software license, see the accompanying + file COPYING or http://www.opensource.org/licenses/mit-license.php. + diff --git a/src/test/getarg_tests.cpp b/src/test/getarg_tests.cpp index d76124885b..8cadcdd716 100644 --- a/src/test/getarg_tests.cpp +++ b/src/test/getarg_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util.h" diff --git a/src/test/hash_tests.cpp b/src/test/hash_tests.cpp index 28410f0fed..4568c8769b 100644 --- a/src/test/hash_tests.cpp +++ b/src/test/hash_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "hash.h" #include "util.h" diff --git a/src/test/hmac_tests.cpp b/src/test/hmac_tests.cpp index 68868866aa..780ce480ce 100644 --- a/src/test/hmac_tests.cpp +++ b/src/test/hmac_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "hash.h" #include "util.h" diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp index 421ffeac45..864d90128c 100644 --- a/src/test/key_tests.cpp +++ b/src/test/key_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "key.h" #include "base58.h" diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp index b7f4312cda..3f8ad20020 100644 --- a/src/test/main_tests.cpp +++ b/src/test/main_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "core.h" #include "main.h" diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index d35137a663..b72ba0293f 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2011-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "main.h" #include "miner.h" diff --git a/src/test/mruset_tests.cpp b/src/test/mruset_tests.cpp index 638c88fabe..60f11c147a 100644 --- a/src/test/mruset_tests.cpp +++ b/src/test/mruset_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "mruset.h" #include "util.h" diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 772217b888..3775abd633 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2011-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "key.h" #include "keystore.h" diff --git a/src/test/netbase_tests.cpp b/src/test/netbase_tests.cpp index 412ba04910..7d38700736 100644 --- a/src/test/netbase_tests.cpp +++ b/src/test/netbase_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "netbase.h" #include <string> diff --git a/src/test/pmt_tests.cpp b/src/test/pmt_tests.cpp index dea5e1b824..7d7e6681df 100644 --- a/src/test/pmt_tests.cpp +++ b/src/test/pmt_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "main.h" #include "serialize.h" diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index 29195545da..5bc38ce2de 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "rpcserver.h" #include "rpcclient.h" diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index 628ba95067..af34e496e2 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2013-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "rpcserver.h" #include "rpcclient.h" diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index e57dc9bbba..03dbdde57b 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "script.h" #include "key.h" diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index dd1b613047..7bc2bfb6dd 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2011-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "script.h" #include "data/script_invalid.json.h" diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index 415f957811..867a7df888 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "serialize.h" #include <stdint.h> diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index f098d46186..04b93fb105 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include <boost/test/unit_test.hpp> #include "main.h" diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp index 96f663ccef..722f14a989 100644 --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2012-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "key.h" #include "script.h" diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 96d0712403..3b75aad14b 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2011-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #define BOOST_TEST_MODULE Bitcoin Test Suite diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 588c8013c7..2ebb652f00 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -1,4 +1,6 @@ - +// Copyright (c) 2011-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "data/tx_invalid.json.h" #include "data/tx_valid.json.h" diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp index 368484fdff..815babf107 100644 --- a/src/test/uint256_tests.cpp +++ b/src/test/uint256_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2011-2013 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include <boost/test/unit_test.hpp> #include <stdint.h> #include <sstream> diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 706737b115..b8f107f644 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2011-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "util.h" #include "sync.h" diff --git a/src/test/wallet_tests.cpp b/src/test/wallet_tests.cpp index bd0517ae08..1993358826 100644 --- a/src/test/wallet_tests.cpp +++ b/src/test/wallet_tests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2012-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "wallet.h" #include <set> |