diff options
38 files changed, 672 insertions, 265 deletions
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index ae912e59e4..d938c07c45 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -210,7 +210,8 @@ HEADERS += src/qt/bitcoingui.h \ src/txdb.h \ src/leveldb.h \ src/threadsafety.h \ - src/limitedmap.h + src/limitedmap.h \ + src/qt/splashscreen.h SOURCES += src/qt/bitcoin.cpp \ src/qt/bitcoingui.cpp \ @@ -277,7 +278,8 @@ SOURCES += src/qt/bitcoin.cpp \ src/qt/rpcconsole.cpp \ src/noui.cpp \ src/leveldb.cpp \ - src/txdb.cpp + src/txdb.cpp \ + src/qt/splashscreen.cpp RESOURCES += src/qt/bitcoin.qrc @@ -330,8 +332,15 @@ TSQM.CONFIG = no_link QMAKE_EXTRA_COMPILERS += TSQM # "Other files" to show in Qt Creator -OTHER_FILES += \ - doc/*.rst doc/*.txt doc/README README.md res/bitcoin-qt.rc src/test/*.cpp src/test/*.h src/qt/test/*.cpp src/qt/test/*.h +OTHER_FILES += README.md \ + doc/*.rst \ + doc/*.txt \ + doc/README \ + src/qt/res/bitcoin-qt.rc \ + src/test/*.cpp \ + src/test/*.h \ + src/qt/test/*.cpp \ + src/qt/test/*.h # platform specific defaults, if not overridden on command line isEmpty(BOOST_LIB_SUFFIX) { diff --git a/contrib/test-patches/README b/contrib/test-patches/README new file mode 100644 index 0000000000..ed754cea7a --- /dev/null +++ b/contrib/test-patches/README @@ -0,0 +1,4 @@ +These patches are applied when the automated pull-tester +tests each pull and when master is tested using jenkins. +You can find more information about the tests run at +http://jenkins.bluematt.me/pull-tester/files/ diff --git a/contrib/test-patches/bitcoind-comparison.patch b/contrib/test-patches/bitcoind-comparison.patch new file mode 100644 index 0000000000..7464349b3c --- /dev/null +++ b/contrib/test-patches/bitcoind-comparison.patch @@ -0,0 +1,196 @@ +diff --git a/contrib/test-patches/bitcoind-comparison.patch b/contrib/test-patches/bitcoind-comparison.patch +index 04a8618..519429a 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -31,8 +31,8 @@ CTxMemPool mempool; + unsigned int nTransactionsUpdated = 0; + + map<uint256, CBlockIndex*> mapBlockIndex; +-uint256 hashGenesisBlock("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"); +-static CBigNum bnProofOfWorkLimit(~uint256(0) >> 32); ++uint256 hashGenesisBlock("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"); ++static CBigNum bnProofOfWorkLimit(~uint256(0) >> 1); + CBlockIndex* pindexGenesisBlock = NULL; + int nBestHeight = -1; + uint256 nBestChainWork = 0; +@@ -1055,7 +1055,7 @@ int64 static GetBlockValue(int nHeight, int64 nFees) + int64 nSubsidy = 50 * COIN; + + // Subsidy is cut in half every 210000 blocks, which will occur approximately every 4 years +- nSubsidy >>= (nHeight / 210000); ++ nSubsidy >>= (nHeight / 150); + + return nSubsidy + nFees; + } +@@ -2736,9 +2736,9 @@ bool InitBlockIndex() { + block.hashPrevBlock = 0; + block.hashMerkleRoot = block.BuildMerkleTree(); + block.nVersion = 1; +- block.nTime = 1231006505; +- block.nBits = 0x1d00ffff; +- block.nNonce = 2083236893; ++ block.nTime = 1296688602; ++ block.nBits = 0x207fffff; ++ block.nNonce = 2; + + if (fTestNet) + { +@@ -3024,7 +3024,7 @@ bool static AlreadyHave(const CInv& inv) + // The message start string is designed to be unlikely to occur in normal data. + // The characters are rarely used upper ASCII, not valid as UTF-8, and produce + // a large 4-byte int at any alignment. +-unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 }; ++unsigned char pchMessageStart[4] = { 0xfa, 0xbf, 0xb5, 0xda }; + + + void static ProcessGetData(CNode* pfrom) +diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp +index af28465..ee9a4db 100644 +--- a/src/test/miner_tests.cpp ++++ b/src/test/miner_tests.cpp +@@ -15,34 +15,117 @@ struct { + unsigned char extranonce; + unsigned int nonce; + } blockinfo[] = { +- {4, 0xa4a3e223}, {2, 0x15c32f9e}, {1, 0x0375b547}, {1, 0x7004a8a5}, +- {2, 0xce440296}, {2, 0x52cfe198}, {1, 0x77a72cd0}, {2, 0xbb5d6f84}, +- {2, 0x83f30c2c}, {1, 0x48a73d5b}, {1, 0xef7dcd01}, {2, 0x6809c6c4}, +- {2, 0x0883ab3c}, {1, 0x087bbbe2}, {2, 0x2104a814}, {2, 0xdffb6daa}, +- {1, 0xee8a0a08}, {2, 0xba4237c1}, {1, 0xa70349dc}, {1, 0x344722bb}, +- {3, 0xd6294733}, {2, 0xec9f5c94}, {2, 0xca2fbc28}, {1, 0x6ba4f406}, +- {2, 0x015d4532}, {1, 0x6e119b7c}, {2, 0x43e8f314}, {2, 0x27962f38}, +- {2, 0xb571b51b}, {2, 0xb36bee23}, {2, 0xd17924a8}, {2, 0x6bc212d9}, +- {1, 0x630d4948}, {2, 0x9a4c4ebb}, {2, 0x554be537}, {1, 0xd63ddfc7}, +- {2, 0xa10acc11}, {1, 0x759a8363}, {2, 0xfb73090d}, {1, 0xe82c6a34}, +- {1, 0xe33e92d7}, {3, 0x658ef5cb}, {2, 0xba32ff22}, {5, 0x0227a10c}, +- {1, 0xa9a70155}, {5, 0xd096d809}, {1, 0x37176174}, {1, 0x830b8d0f}, +- {1, 0xc6e3910e}, {2, 0x823f3ca8}, {1, 0x99850849}, {1, 0x7521fb81}, +- {1, 0xaacaabab}, {1, 0xd645a2eb}, {5, 0x7aea1781}, {5, 0x9d6e4b78}, +- {1, 0x4ce90fd8}, {1, 0xabdc832d}, {6, 0x4a34f32a}, {2, 0xf2524c1c}, +- {2, 0x1bbeb08a}, {1, 0xad47f480}, {1, 0x9f026aeb}, {1, 0x15a95049}, +- {2, 0xd1cb95b2}, {2, 0xf84bbda5}, {1, 0x0fa62cd1}, {1, 0xe05f9169}, +- {1, 0x78d194a9}, {5, 0x3e38147b}, {5, 0x737ba0d4}, {1, 0x63378e10}, +- {1, 0x6d5f91cf}, {2, 0x88612eb8}, {2, 0xe9639484}, {1, 0xb7fabc9d}, +- {2, 0x19b01592}, {1, 0x5a90dd31}, {2, 0x5bd7e028}, {2, 0x94d00323}, +- {1, 0xa9b9c01a}, {1, 0x3a40de61}, {1, 0x56e7eec7}, {5, 0x859f7ef6}, +- {1, 0xfd8e5630}, {1, 0x2b0c9f7f}, {1, 0xba700e26}, {1, 0x7170a408}, +- {1, 0x70de86a8}, {1, 0x74d64cd5}, {1, 0x49e738a1}, {2, 0x6910b602}, +- {0, 0x643c565f}, {1, 0x54264b3f}, {2, 0x97ea6396}, {2, 0x55174459}, +- {2, 0x03e8779a}, {1, 0x98f34d8f}, {1, 0xc07b2b07}, {1, 0xdfe29668}, +- {1, 0x3141c7c1}, {1, 0xb3b595f4}, {1, 0x735abf08}, {5, 0x623bfbce}, +- {2, 0xd351e722}, {1, 0xf4ca48c9}, {1, 0x5b19c670}, {1, 0xa164bf0e}, +- {2, 0xbbbeb305}, {2, 0xfe1c810a}, ++{4, 2762203683}, ++{2, 365113248}, ++{1, 58045772}, ++{1, 1879353512}, ++{2, 3460563607}, ++{2, 1389355416}, ++{1, 2007444690}, ++{2, 3143462790}, ++{2, 2213743660}, ++{1, 1218919771}, ++{1, 4017999107}, ++{2, 1745471173}, ++{2, 142846780}, ++{1, 142326754}, ++{2, 553953301}, ++{2, 3757796778}, ++{1, 4002023946}, ++{2, 3124901826}, ++{1, 2802010589}, ++{1, 877077181}, ++{3, 3593029427}, ++{2, 3969866902}, ++{2, 3392125996}, ++{1, 1805972490}, ++{2, 22889779}, ++{1, 1846647676}, ++{2, 1139340052}, ++{2, 664153912}, ++{2, 3044128027}, ++{2, 3010194979}, ++{2, 3514377385}, ++{2, 1807880922}, ++{1, 1661815113}, ++{2, 2588692156}, ++{2, 1431037239}, ++{1, 3594379210}, ++{2, 2701839377}, ++{1, 1973060452}, ++{2, 4218620174}, ++{1, 3895224884}, ++{1, 3812528857}, ++{3, 1703867851}, ++{2, 3123904294}, ++{5, 36151564}, ++{1, 2846294357}, ++{5, 3499546633}, ++{1, 924279160}, ++{1, 2198572304}, ++{1, 3336802574}, ++{2, 2185182379}, ++{1, 2575632458}, ++{1, 1965161345}, ++{1, 2865408940}, ++{1, 3594887915}, ++{5, 2062161796}, ++{5, 2641251194}, ++{1, 1290342362}, ++{1, 2883355438}, ++{6, 1244984107}, ++{2, 4065479712}, ++{2, 465481866}, ++{1, 2907174016}, ++{1, 2667735788}, ++{1, 363417673}, ++{2, 3519780275}, ++{2, 4165713317}, ++{1, 262548689}, ++{1, 3764359529}, ++{1, 2027001003}, ++{5, 1043862655}, ++{5, 1937481940}, ++{1, 1664585233}, ++{1, 1834979792}, ++{2, 2288070330}, ++{2, 3915617412}, ++{1, 3086662813}, ++{2, 430970259}, ++{1, 1519443249}, ++{2, 1540874280}, ++{2, 2496660261}, ++{1, 2847522842}, ++{1, 977329763}, ++{1, 1458040519}, ++{5, 2241822454}, ++{1, 4253963824}, ++{1, 722247551}, ++{1, 3127905834}, ++{1, 1903207432}, ++{1, 1893631657}, ++{1, 1960201429}, ++{1, 1239890082}, ++{2, 1762702850}, ++{0, 1681675873}, ++{1, 1411795775}, ++{2, 2548720534}, ++{2, 1427588186}, ++{2, 65566621}, ++{1, 2566081936}, ++{1, 3229297415}, ++{1, 3756168812}, ++{1, 826394561}, ++{1, 3015022068}, ++{1, 1935326986}, ++{5, 1648098256}, ++{2, 3545360164}, ++{1, 4106897609}, ++{1, 1528415857}, ++{1, 2707734286}, ++{2, 3149837061}, ++{2, 4263280906}, ++ + }; + + // NOTE: These tests rely on CreateNewBlock doing its own self-validation! diff --git a/contrib/test-patches/temp-revert-1.patch b/contrib/test-patches/temp-revert-1.patch new file mode 100644 index 0000000000..a5aec641ce --- /dev/null +++ b/contrib/test-patches/temp-revert-1.patch @@ -0,0 +1,21 @@ +commit 4dcc8701ac0eb09d8992d19fb411cee3c9aaf394 +Author: Matt Corallo <git@bluematt.me> +Date: Sun Mar 24 20:45:44 2013 -0400 + + Revert "Update unit test to match rule enforcement starts 21 March" + + This reverts commit d3e8c6a9d3fad68b0eee4434401ec7b3066399a2. + +diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp +index 3cfb6db..e167def 100644 +--- a/src/test/checkblock_tests.cpp ++++ b/src/test/checkblock_tests.cpp +@@ -52,7 +52,7 @@ BOOST_AUTO_TEST_CASE(May15) + if (read_block("Mar12Fork.dat", forkingBlock)) + { + CValidationState state; +- forkingBlock.nTime = tMay15-1; // Invalidates PoW ++ BOOST_CHECK(!forkingBlock.CheckBlock(state, true, true)); + BOOST_CHECK(!forkingBlock.CheckBlock(state, false, false)); + + // After May 15'th, big blocks are OK: diff --git a/contrib/test-patches/temp-revert-2.patch b/contrib/test-patches/temp-revert-2.patch new file mode 100644 index 0000000000..1cd043d0d7 --- /dev/null +++ b/contrib/test-patches/temp-revert-2.patch @@ -0,0 +1,20 @@ +commit cfae26916dba311f6f75d444301c1f9362267c3e +Author: Matt Corallo <git@bluematt.me> +Date: Sun Mar 24 20:45:50 2013 -0400 + + Revert "Checkpoint at first block in 11 March chain fork" + + This reverts commit f817c496a1482d05b22c8e539de67f07db1c09d9. + +diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp +index 62234b9..9b11f0b 100644 +--- a/src/checkpoints.cpp ++++ b/src/checkpoints.cpp +@@ -44,7 +44,6 @@ namespace Checkpoints + (193000, uint256("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")) + (210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")) + (216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")) +- (225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")) + ; + static const CCheckpointData data = { + &mapCheckpoints, diff --git a/contrib/test-patches/temp-revert-3.patch b/contrib/test-patches/temp-revert-3.patch new file mode 100644 index 0000000000..5c0775dfa5 --- /dev/null +++ b/contrib/test-patches/temp-revert-3.patch @@ -0,0 +1,34 @@ +commit ba84709c65b911798ddae1285d807f4cd036990d +Author: Matt Corallo <git@bluematt.me> +Date: Sun Mar 24 20:45:56 2013 -0400 + + Revert "Before 15 May, limit created block size to 500K" + + This reverts commit 402f19b64530775a7e4ded025c80d8c16a55e454. + +diff --git a/src/main.cpp b/src/main.cpp +index 22baf0f..51ada0a 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -2057,8 +2057,8 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk + return state.DoS(100, error("CheckBlock() : size limits failed")); + + // Special short-term limits to avoid 10,000 BDB lock limit: +- if (GetBlockTime() >= 1363867200 && // start enforcing 21 March 2013, noon GMT +- GetBlockTime() < 1368576000) // stop enforcing 15 May 2013 00:00:00 ++ if (GetBlockTime() > 1363039171 && // 11 March 2013, timestamp of block before the big fork ++ GetBlockTime() < 1368576000) // 15 May 2013 00:00:00 + { + // Rule is: #unique txids referenced <= 4,500 + // ... to prevent 10,000 BDB lock exhaustion on old clients +@@ -4155,10 +4155,6 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey) + // Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity: + nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize)); + +- // Special compatibility rule before 15 May: limit size to 500,000 bytes: +- if (GetAdjustedTime() < 1368576000) +- nBlockMaxSize = std::min(nBlockMaxSize, (unsigned int)(MAX_BLOCK_SIZE_GEN)); +- + // How much of the block should be dedicated to high-priority transactions, + // included regardless of the fees they pay + unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", 27000); diff --git a/contrib/test-patches/temp-revert-4.patch b/contrib/test-patches/temp-revert-4.patch new file mode 100644 index 0000000000..f93d7549c0 --- /dev/null +++ b/contrib/test-patches/temp-revert-4.patch @@ -0,0 +1,110 @@ +commit ca96b88b61f647d4f56d5d06321dda08a43bf92f +Author: Matt Corallo <git@bluematt.me> +Date: Sun Mar 24 20:46:01 2013 -0400 + + Revert "CheckBlock rule until 15-May for 10,000 BDB lock compatibility" + + This reverts commit 8c222dca4f961ad13ec64d690134a40d09b20813. + +diff --git a/src/main.cpp b/src/main.cpp +index 51ada0a..9a06dbf 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -2056,25 +2056,6 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk + if (vtx.empty() || vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE) + return state.DoS(100, error("CheckBlock() : size limits failed")); + +- // Special short-term limits to avoid 10,000 BDB lock limit: +- if (GetBlockTime() > 1363039171 && // 11 March 2013, timestamp of block before the big fork +- GetBlockTime() < 1368576000) // 15 May 2013 00:00:00 +- { +- // Rule is: #unique txids referenced <= 4,500 +- // ... to prevent 10,000 BDB lock exhaustion on old clients +- set<uint256> setTxIn; +- for (size_t i = 0; i < vtx.size(); i++) +- { +- setTxIn.insert(vtx[i].GetHash()); +- if (i == 0) continue; // skip coinbase txin +- BOOST_FOREACH(const CTxIn& txin, vtx[i].vin) +- setTxIn.insert(txin.prevout.hash); +- } +- size_t nTxids = setTxIn.size(); +- if (nTxids > 4500) +- return error("CheckBlock() : 15 May maxlocks violation"); +- } +- + // Check proof of work matches claimed amount + if (fCheckPOW && !CheckProofOfWork(GetHash(), nBits)) + return state.DoS(50, error("CheckBlock() : proof of work failed")); +diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp +deleted file mode 100644 +index e167def..0000000 +--- a/src/test/checkblock_tests.cpp ++++ /dev/null +@@ -1,66 +0,0 @@ +-// +-// Unit tests for block.CheckBlock() +-// +-#include <algorithm> +- +-#include <boost/assign/list_of.hpp> // for 'map_list_of()' +-#include <boost/date_time/posix_time/posix_time_types.hpp> +-#include <boost/test/unit_test.hpp> +-#include <boost/foreach.hpp> +- +-#include "main.h" +-#include "wallet.h" +-#include "net.h" +-#include "util.h" +- +-BOOST_AUTO_TEST_SUITE(CheckBlock_tests) +- +-bool +-read_block(const std::string& filename, CBlock& block) +-{ +- namespace fs = boost::filesystem; +- fs::path testFile = fs::current_path() / "test" / "data" / filename; +-#ifdef TEST_DATA_DIR +- if (!fs::exists(testFile)) +- { +- testFile = fs::path(BOOST_PP_STRINGIZE(TEST_DATA_DIR)) / filename; +- } +-#endif +- FILE* fp = fopen(testFile.string().c_str(), "rb"); +- if (!fp) return false; +- +- fseek(fp, 8, SEEK_SET); // skip msgheader/size +- +- CAutoFile filein = CAutoFile(fp, SER_DISK, CLIENT_VERSION); +- if (!filein) return false; +- +- filein >> block; +- +- return true; +-} +- +-BOOST_AUTO_TEST_CASE(May15) +-{ +- // Putting a 1MB binary file in the git repository is not a great +- // idea, so this test is only run if you manually download +- // test/data/Mar12Fork.dat from +- // http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/Mar12Fork.dat/download +- unsigned int tMay15 = 1368576000; +- SetMockTime(tMay15); // Test as if it was right at May 15 +- +- CBlock forkingBlock; +- if (read_block("Mar12Fork.dat", forkingBlock)) +- { +- CValidationState state; +- BOOST_CHECK(!forkingBlock.CheckBlock(state, true, true)); +- BOOST_CHECK(!forkingBlock.CheckBlock(state, false, false)); +- +- // After May 15'th, big blocks are OK: +- forkingBlock.nTime = tMay15; // Invalidates PoW +- BOOST_CHECK(forkingBlock.CheckBlock(state, false, false)); +- } +- +- SetMockTime(0); +-} +- +-BOOST_AUTO_TEST_SUITE_END() diff --git a/contrib/verifysfbinaries/verify.sh b/contrib/verifysfbinaries/verify.sh index 02814d894b..b109cd3ed0 100755 --- a/contrib/verifysfbinaries/verify.sh +++ b/contrib/verifysfbinaries/verify.sh @@ -18,7 +18,7 @@ WORKINGDIR="/tmp/bitcoin" TMPFILE="hashes.tmp" #this URL is used if a version number is not specified as an argument to the script -SIGNATUREFILE="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.8.0/SHA256SUMS.asc" +SIGNATUREFILE="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.8.1/SHA256SUMS.asc" SIGNATUREFILENAME="SHA256SUMS.asc" RCSUBDIR="test/" diff --git a/doc/assets-attribution.txt b/doc/assets-attribution.txt index f8dc320e1b..2069c5d6e0 100644 --- a/doc/assets-attribution.txt +++ b/doc/assets-attribution.txt @@ -38,22 +38,12 @@ Designer: http://www.everaldo.com Icon Pack: Crystal SVG License: LGPL -Icon: src/qt/res/icons/toolbar.png, toolbar_testnet.png -Designer: Bitboy (optimized for 16x16 by Wladimir van der Laan) -License: Public Domain -Site: https://bitcointalk.org/?topic=1756.0 - Icon: scripts/img/reload.xcf (modified), src/qt/res/movies/update_spinner.mng Icon Pack: Kids Designer: Everaldo (Everaldo Coelho) License: GNU/GPL Site: http://findicons.com/icon/17102/reload?id=17102 -Image: src/qt/res/images/splash2.jpg (Wallet image) -Designer: Crobbo (forum) -Site: https://bitcointalk.org/index.php?topic=32273.0 -License: Public domain - Icon: src/qt/res/icons/debugwindow.png Designer: Vignoni David Site: http://www.oxygen-icons.org/ @@ -61,6 +51,8 @@ License: Oxygen icon theme is dual licensed. You may copy it under the Creative Icon: src/qt/res/icons/bitcoin.icns, src/qt/res/src/bitcoin.svg, src/qt/res/src/bitcoin.ico, src/qt/res/src/bitcoin.png, - src/qt/res/src/bitcoin_testnet.png, docs/bitcoin_logo_doxygen.png + src/qt/res/src/bitcoin_testnet.png, docs/bitcoin_logo_doxygen.png, + src/qt/res/icons/toolbar.png, src/qt/res/icons/toolbar_testnet.png, + src/qt/res/images/splash.png, src/qt/res/images/splash_testnet.png Designer: Jonas Schnelli (based on the original bitcoin logo from Bitboy) -License: MIT
\ No newline at end of file +License: MIT diff --git a/src/bignum.h b/src/bignum.h index 1ee7a99934..0881807d70 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -222,7 +222,7 @@ public: BN_mpi2bn(pch, p - pch, this); } - uint256 getuint256() + uint256 getuint256() const { unsigned int nSize = BN_bn2mpi(this, NULL); if (nSize < 4) diff --git a/src/clientversion.h b/src/clientversion.h index bc2e9c882a..635641bd29 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -2,7 +2,7 @@ #define CLIENTVERSION_H // -// client versioning +// client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it @@ -14,6 +14,10 @@ // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE false +// Copyright year (2009-this) +// Todo: update this when changing our copyright comments in the source +#define COPYRIGHT_YEAR 2013 + // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) diff --git a/src/init.cpp b/src/init.cpp index 66272e8421..f6485c3b1d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -333,8 +333,10 @@ std::string HelpMessage() " -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n" + " -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)") + "\n" + " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified IP address") + "\n" + +#ifndef QT_GUI " -rpcconnect=<ip> " + _("Send commands to node running on <ip> (default: 127.0.0.1)") + "\n" + - " -rpcthreads=<n> " + _("Use this many threads to service RPC calls (default: 4)") + "\n" + +#endif + " -rpcthreads=<n> " + _("Set the number of threads to service RPC calls (default: 4)") + "\n" + " -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" + " -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n" + " -alertnotify=<cmd> " + _("Execute command when a relevant alert is received (%s in cmd is replaced by message)") + "\n" + @@ -347,7 +349,7 @@ std::string HelpMessage() " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n" + " -loadblock=<file> " + _("Imports blocks from external blk000??.dat file") + "\n" + " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n" + - " -par=N " + _("Set the number of script verification threads (1-16, 0=auto, default: 0)") + "\n" + + " -par=<n> " + _("Set the number of script verification threads (1-16, 0=auto, default: 0)") + "\n" + "\n" + _("Block creation options:") + "\n" + " -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n" + diff --git a/src/main.cpp b/src/main.cpp index 8284d54c7c..6f3b5da961 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,8 +35,8 @@ uint256 hashGenesisBlock("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3 static CBigNum bnProofOfWorkLimit(~uint256(0) >> 32); CBlockIndex* pindexGenesisBlock = NULL; int nBestHeight = -1; -CBigNum bnBestChainWork = 0; -CBigNum bnBestInvalidWork = 0; +uint256 nBestChainWork = 0; +uint256 nBestInvalidWork = 0; uint256 hashBestChain = 0; CBlockIndex* pindexBest = NULL; set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexValid; // may contain all CBlockIndex*'s that have validness >=BLOCK_VALID_TRANSACTIONS, and must contain those who aren't failed @@ -768,7 +768,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. - if (!tx.CheckInputs(state, view, true, SCRIPT_VERIFY_P2SH)) + if (!tx.CheckInputs(state, view, true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC)) { return error("CTxMemPool::accept() : ConnectInputs failed %s", hash.ToString().c_str()); } @@ -1191,20 +1191,20 @@ bool IsInitialBlockDownload() void static InvalidChainFound(CBlockIndex* pindexNew) { - if (pindexNew->bnChainWork > bnBestInvalidWork) + if (pindexNew->nChainWork > nBestInvalidWork) { - bnBestInvalidWork = pindexNew->bnChainWork; - pblocktree->WriteBestInvalidWork(bnBestInvalidWork); + nBestInvalidWork = pindexNew->nChainWork; + pblocktree->WriteBestInvalidWork(CBigNum(nBestInvalidWork)); uiInterface.NotifyBlocksChanged(); } - printf("InvalidChainFound: invalid block=%s height=%d work=%s date=%s\n", + printf("InvalidChainFound: invalid block=%s height=%d log2_work=%.8g date=%s\n", pindexNew->GetBlockHash().ToString().c_str(), pindexNew->nHeight, - pindexNew->bnChainWork.ToString().c_str(), DateTimeStrFormat("%Y-%m-%d %H:%M:%S", + log(pindexNew->nChainWork.getdouble())/log(2.0), DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexNew->GetBlockTime()).c_str()); - printf("InvalidChainFound: current best=%s height=%d work=%s date=%s\n", - hashBestChain.ToString().c_str(), nBestHeight, bnBestChainWork.ToString().c_str(), + printf("InvalidChainFound: current best=%s height=%d log2_work=%.8g date=%s\n", + hashBestChain.ToString().c_str(), nBestHeight, log(nBestChainWork.getdouble())/log(2.0), DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str()); - if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6) + if (pindexBest && nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256()) printf("InvalidChainFound: Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\n"); } @@ -1230,7 +1230,7 @@ bool ConnectBestBlock(CValidationState &state) { pindexNewBest = *it; } - if (pindexNewBest == pindexBest || (pindexBest && pindexNewBest->bnChainWork == pindexBest->bnChainWork)) + if (pindexNewBest == pindexBest || (pindexBest && pindexNewBest->nChainWork == pindexBest->nChainWork)) return true; // nothing to do // check ancestry @@ -1250,7 +1250,7 @@ bool ConnectBestBlock(CValidationState &state) { break; } - if (pindexBest == NULL || pindexTest->bnChainWork > pindexBest->bnChainWork) + if (pindexBest == NULL || pindexTest->nChainWork > pindexBest->nChainWork) vAttach.push_back(pindexTest); if (pindexTest->pprev == NULL || pindexTest->pnext != NULL) { @@ -1858,11 +1858,11 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew) pindexBest = pindexNew; pblockindexFBBHLast = NULL; nBestHeight = pindexBest->nHeight; - bnBestChainWork = pindexNew->bnChainWork; + nBestChainWork = pindexNew->nChainWork; nTimeBestReceived = GetTime(); nTransactionsUpdated++; - printf("SetBestChain: new best=%s height=%d work=%s tx=%lu date=%s progress=%f\n", - hashBestChain.ToString().c_str(), nBestHeight, bnBestChainWork.ToString().c_str(), (unsigned long)pindexNew->nChainTx, + printf("SetBestChain: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f\n", + hashBestChain.ToString().c_str(), nBestHeight, log(nBestChainWork.getdouble())/log(2.0), (unsigned long)pindexNew->nChainTx, DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str(), Checkpoints::GuessVerificationProgress(pindexBest)); @@ -1915,7 +1915,7 @@ bool CBlock::AddToBlockIndex(CValidationState &state, const CDiskBlockPos &pos) pindexNew->nHeight = pindexNew->pprev->nHeight + 1; } pindexNew->nTx = vtx.size(); - pindexNew->bnChainWork = (pindexNew->pprev ? pindexNew->pprev->bnChainWork : 0) + pindexNew->GetBlockWork(); + pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + pindexNew->GetBlockWork().getuint256(); pindexNew->nChainTx = (pindexNew->pprev ? pindexNew->pprev->nChainTx : 0) + pindexNew->nTx; pindexNew->nFile = pos.nFile; pindexNew->nDataPos = pos.nPos; @@ -2537,7 +2537,7 @@ bool static LoadBlockIndexDB() boost::this_thread::interruption_point(); - // Calculate bnChainWork + // Calculate nChainWork vector<pair<int, CBlockIndex*> > vSortedByHeight; vSortedByHeight.reserve(mapBlockIndex.size()); BOOST_FOREACH(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex) @@ -2549,7 +2549,7 @@ bool static LoadBlockIndexDB() BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight) { CBlockIndex* pindex = item.second; - pindex->bnChainWork = (pindex->pprev ? pindex->pprev->bnChainWork : 0) + pindex->GetBlockWork(); + pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + pindex->GetBlockWork().getuint256(); pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx; if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS && !(pindex->nStatus & BLOCK_FAILED_MASK)) setBlockIndexValid.insert(pindex); @@ -2561,8 +2561,10 @@ bool static LoadBlockIndexDB() if (pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile)) printf("LoadBlockIndexDB(): last block file info: %s\n", infoLastBlockFile.ToString().c_str()); - // Load bnBestInvalidWork, OK if it doesn't exist + // Load nBestInvalidWork, OK if it doesn't exist + CBigNum bnBestInvalidWork; pblocktree->ReadBestInvalidWork(bnBestInvalidWork); + nBestInvalidWork = bnBestInvalidWork.getuint256(); // Check whether we need to continue reindexing bool fReindexing = false; @@ -2579,7 +2581,7 @@ bool static LoadBlockIndexDB() return true; hashBestChain = pindexBest->GetBlockHash(); nBestHeight = pindexBest->nHeight; - bnBestChainWork = pindexBest->bnChainWork; + nBestChainWork = pindexBest->nChainWork; // set 'next' pointers in best chain CBlockIndex *pindex = pindexBest; @@ -2675,8 +2677,8 @@ void UnloadBlockIndex() setBlockIndexValid.clear(); pindexGenesisBlock = NULL; nBestHeight = 0; - bnBestChainWork = 0; - bnBestInvalidWork = 0; + nBestChainWork = 0; + nBestInvalidWork = 0; hashBestChain = 0; pindexBest = NULL; } @@ -2953,7 +2955,7 @@ string GetWarnings(string strFor) } // Longer invalid proof-of-work chain - if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6) + if (pindexBest && nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256()) { nPriority = 2000; strStatusBar = strRPC = _("Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade."); diff --git a/src/main.h b/src/main.h index 9a3664a437..24b2cb2aa6 100644 --- a/src/main.h +++ b/src/main.h @@ -77,8 +77,8 @@ extern std::set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexValid; extern uint256 hashGenesisBlock; extern CBlockIndex* pindexGenesisBlock; extern int nBestHeight; -extern CBigNum bnBestChainWork; -extern CBigNum bnBestInvalidWork; +extern uint256 nBestChainWork; +extern uint256 nBestInvalidWork; extern uint256 hashBestChain; extern CBlockIndex* pindexBest; extern unsigned int nTransactionsUpdated; @@ -1619,7 +1619,7 @@ public: unsigned int nUndoPos; // (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block - CBigNum bnChainWork; + uint256 nChainWork; // Number of transactions in this block. // Note: in a potential headers-first mode, this number cannot be relied upon @@ -1648,7 +1648,7 @@ public: nFile = 0; nDataPos = 0; nUndoPos = 0; - bnChainWork = 0; + nChainWork = 0; nTx = 0; nChainTx = 0; nStatus = 0; @@ -1669,7 +1669,7 @@ public: nFile = 0; nDataPos = 0; nUndoPos = 0; - bnChainWork = 0; + nChainWork = 0; nTx = 0; nChainTx = 0; nStatus = 0; @@ -1793,8 +1793,8 @@ public: struct CBlockIndexWorkComparator { bool operator()(CBlockIndex *pa, CBlockIndex *pb) { - if (pa->bnChainWork > pb->bnChainWork) return false; - if (pa->bnChainWork < pb->bnChainWork) return true; + if (pa->nChainWork > pb->nChainWork) return false; + if (pa->nChainWork < pb->nChainWork) return true; if (pa->GetBlockHash() < pb->GetBlockHash()) return false; if (pa->GetBlockHash() > pb->GetBlockHash()) return true; diff --git a/src/makefile.unix b/src/makefile.unix index 081edaf63e..8110235647 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -2,7 +2,13 @@ # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. +# :=0 --> UPnP support turned off by default at runtime +# :=1 --> UPnP support turned on by default at runtime +# :=- --> No UPnP support - miniupnp not required USE_UPNP:=0 + +# :=1 --> Enable IPv6 support +# :=0 --> Disable IPv6 support USE_IPV6:=1 LINK:=$(CXX) diff --git a/src/qt/aboutdialog.cpp b/src/qt/aboutdialog.cpp index 755413b2bb..57818b8a27 100644 --- a/src/qt/aboutdialog.cpp +++ b/src/qt/aboutdialog.cpp @@ -2,10 +2,7 @@ #include "ui_aboutdialog.h" #include "clientmodel.h" - -// Copyright year (2009-this) -// Todo: update this when changing our copyright comments in the source -const int ABOUTDIALOG_COPYRIGHT_YEAR = 2013; +#include "clientversion.h" AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), @@ -14,7 +11,7 @@ AboutDialog::AboutDialog(QWidget *parent) : ui->setupUi(this); // Set current copyright year - ui->copyrightLabel->setText(tr("Copyright") + QString(" © ") + tr("2009-%1 The Bitcoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR)); + ui->copyrightLabel->setText(tr("Copyright") + QString(" © ") + tr("2009-%1 The Bitcoin developers").arg(COPYRIGHT_YEAR)); } void AboutDialog::setModel(ClientModel *model) diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 23c69fef21..8529c88b39 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -33,6 +33,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : ui->deleteAddress->setIcon(QIcon()); ui->verifyMessage->setIcon(QIcon()); ui->signMessage->setIcon(QIcon()); + ui->exportButton->setIcon(QIcon()); #endif #ifndef USE_QRCODE @@ -45,6 +46,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept())); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tableView->setFocus(); + ui->exportButton->hide(); break; case ForEditing: ui->buttonBox->setVisible(false); @@ -323,7 +325,7 @@ void AddressBookPage::done(int retval) QDialog::done(retval); } -void AddressBookPage::exportClicked() +void AddressBookPage::on_exportButton_clicked() { // CSV is currently the only supported format QString filename = GUIUtil::getSaveFileName( diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h index 0631781685..34465aa65f 100644 --- a/src/qt/addressbookpage.h +++ b/src/qt/addressbookpage.h @@ -43,7 +43,6 @@ public: public slots: void done(int retval); - void exportClicked(); private: Ui::AddressBookPage *ui; @@ -76,6 +75,8 @@ private slots: void onCopyLabelAction(); /** Edit currently selected address entry (no button) */ void onEditAction(); + /** Export button clicked */ + void on_exportButton_clicked(); /** Set button states based on selected tab and selection */ void selectionChanged(); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index f079f3b0e9..9131f8250b 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -14,13 +14,13 @@ #include "util.h" #include "ui_interface.h" #include "paymentserver.h" +#include "splashscreen.h" #include <QMessageBox> #include <QTextCodec> #include <QLocale> #include <QTimer> #include <QTranslator> -#include <QSplashScreen> #include <QLibraryInfo> #if defined(BITCOIN_NEED_QT_PLUGINS) && !defined(_BITCOIN_QT_PLUGINS_INCLUDED) @@ -36,7 +36,7 @@ Q_IMPORT_PLUGIN(qtaccessiblewidgets) // Need a global reference for the notifications to find the GUI static BitcoinGUI *guiref; -static QSplashScreen *splashref; +static SplashScreen *splashref; static bool ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) { @@ -82,7 +82,7 @@ static void InitMessage(const std::string &message) { if(splashref) { - splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(255,255,200)); + splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(55,55,55)); qApp->processEvents(); } printf("init message: %s\n", message.c_str()); @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) return 1; } - QSplashScreen splash(QPixmap(":/images/splash"), 0); + SplashScreen splash(QPixmap(), 0); if (GetBoolArg("-splash", true) && !GetBoolArg("-min")) { splash.show(); diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index fd5f3b523c..c0e0124d7c 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -43,7 +43,8 @@ </qresource> <qresource prefix="/images"> <file alias="about">res/images/about.png</file> - <file alias="splash">res/images/splash2.jpg</file> + <file alias="splash">res/images/splash.png</file> + <file alias="splash_testnet">res/images/splash_testnet.png</file> </qresource> <qresource prefix="/movies"> <file alias="update_spinner">res/movies/update_spinner.mng</file> diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 542000993e..e2eefab3cc 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -236,9 +236,6 @@ void BitcoinGUI::createActions() verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcoin addresses")); - exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); - exportAction->setStatusTip(tr("Export the data in the current tab to a file")); - exportAction->setToolTip(exportAction->statusTip()); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console")); @@ -267,7 +264,6 @@ void BitcoinGUI::createMenuBar() // Configure the menus QMenu *file = appMenuBar->addMenu(tr("&File")); file->addAction(backupWalletAction); - file->addAction(exportAction); file->addAction(signMessageAction); file->addAction(verifyMessageAction); file->addSeparator(); @@ -295,10 +291,6 @@ void BitcoinGUI::createToolBars() toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); toolbar->addAction(addressBookAction); - - QToolBar *toolbar2 = addToolBar(tr("Actions toolbar")); - toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - toolbar2->addAction(exportAction); } void BitcoinGUI::setClientModel(ClientModel *clientModel) @@ -605,25 +597,28 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) void BitcoinGUI::message(const QString &title, const QString &message, unsigned int style, bool *ret) { - QString strTitle = tr("Bitcoin") + " - "; + QString strTitle = tr("Bitcoin"); // default title // Default to information icon int nMBoxIcon = QMessageBox::Information; int nNotifyIcon = Notificator::Information; - // Check for usage of predefined title + // Override title based on style + QString msgType; switch (style) { case CClientUIInterface::MSG_ERROR: - strTitle += tr("Error"); + msgType = tr("Error"); break; case CClientUIInterface::MSG_WARNING: - strTitle += tr("Warning"); + msgType = tr("Warning"); break; case CClientUIInterface::MSG_INFORMATION: - strTitle += tr("Information"); + msgType = tr("Information"); break; default: - strTitle += title; // Use supplied title + msgType = title; // Use supplied title } + if (!msgType.isEmpty()) + strTitle += " - " + msgType; // Check for error/warning icon if (style & CClientUIInterface::ICON_ERROR) { diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 5f7ef746f9..f361a62a41 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -67,7 +67,6 @@ public: QAction * getAddressBookAction() { return addressBookAction; } QAction * getReceiveCoinsAction() { return receiveCoinsAction; } QAction * getSendCoinsAction() { return sendCoinsAction; } - QAction * getExportAction() { return exportAction; } protected: void changeEvent(QEvent *e); @@ -98,7 +97,6 @@ private: QAction *receiveCoinsAction; QAction *optionsAction; QAction *toggleHideAction; - QAction *exportAction; QAction *encryptWalletAction; QAction *backupWalletAction; QAction *changePassphraseAction; diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 2c500f4fe1..4f3bb10642 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -119,7 +119,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Transaction creation failed!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction!"), -QT_TRANSLATE_NOOP("bitcoin-core", "Error: could not start node"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: system error: "), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to read block info"), @@ -177,6 +176,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (default QT_TRANSLATE_NOOP("bitcoin-core", "Set key pool size to <n> (default: 100)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set maximum block size in bytes (default: 250000)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: 0)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"), QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: bitcoin.conf)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (default: 5000)"), diff --git a/src/qt/forms/addressbookpage.ui b/src/qt/forms/addressbookpage.ui index 3cf307384a..a2a7da34dd 100644 --- a/src/qt/forms/addressbookpage.ui +++ b/src/qt/forms/addressbookpage.ui @@ -149,6 +149,20 @@ </spacer> </item> <item> + <widget class="QPushButton" name="exportButton"> + <property name="toolTip"> + <string>Export the data in the current tab to a file</string> + </property> + <property name="text"> + <string>&Export</string> + </property> + <property name="icon"> + <iconset resource="../bitcoin.qrc"> + <normaloff>:/icons/export</normaloff>:/icons/export</iconset> + </property> + </widget> + </item> + <item> <widget class="QDialogButtonBox" name="buttonBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index c74b11d3d6..105a5c6ab2 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -48,7 +48,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Address Book</translation> </message> <message> - <location line="+22"/> + <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Double-click to edit address or label</translation> </message> @@ -68,12 +68,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&New Address</translation> </message> <message> - <location line="-46"/> + <location filename="../addressbookpage.cpp" line="+59"/> <source>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</translation> </message> <message> - <location line="+60"/> + <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&Copy Address</source> <translation>&Copy Address</translation> </message> @@ -113,7 +113,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Delete</translation> </message> <message> - <location filename="../addressbookpage.cpp" line="+66"/> + <location filename="../addressbookpage.cpp" line="-5"/> + <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> + <translation>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</translation> + </message> + <message> + <location line="+13"/> <source>Copy &Label</source> <translation>Copy &Label</translation> </message> @@ -128,7 +133,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Send &Coins</translation> </message> <message> - <location line="+263"/> + <location line="+260"/> <source>Export Address Book Data</source> <translation>Export Address Book Data</translation> </message> @@ -310,7 +315,7 @@ This product includes software developed by the OpenSSL Project for use in the O <context> <name>BitcoinGUI</name> <message> - <location filename="../bitcoingui.cpp" line="+231"/> + <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &message...</source> <translation>Sign &message...</translation> </message> @@ -320,7 +325,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Synchronizing with network...</translation> </message> <message> - <location line="-367"/> + <location line="-368"/> <source>&Overview</source> <translation>&Overview</translation> </message> @@ -380,7 +385,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Options...</translation> </message> <message> - <location line="+5"/> + <location line="+6"/> <source>&Encrypt Wallet...</source> <translation>&Encrypt Wallet...</translation> </message> @@ -410,7 +415,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Export...</translation> </message> <message> - <location line="-65"/> + <location line="-66"/> <source>Send coins to a Bitcoin address</source> <translation>Send coins to a Bitcoin address</translation> </message> @@ -420,7 +425,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Modify configuration options for Bitcoin</translation> </message> <message> - <location line="+17"/> + <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation>Export the data in the current tab to a file</translation> </message> @@ -450,13 +455,13 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Verify message...</translation> </message> <message> - <location line="-162"/> - <location line="+540"/> + <location line="-163"/> + <location line="+541"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> - <location line="-540"/> + <location line="-541"/> <source>Wallet</source> <translation>Wallet</translation> </message> @@ -491,7 +496,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Show or hide the main Window</translation> </message> <message> - <location line="+2"/> + <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Encrypt the private keys that belong to your wallet</translation> </message> @@ -679,7 +684,7 @@ Address: %4 <translation>Wallet is <b>encrypted</b> and currently <b>locked</b></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+108"/> + <location filename="../bitcoin.cpp" line="+104"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</translation> </message> @@ -687,7 +692,7 @@ Address: %4 <context> <name>ClientModel</name> <message> - <location filename="../clientmodel.cpp" line="+96"/> + <location filename="../clientmodel.cpp" line="+98"/> <source>Network Alert</source> <translation>Network Alert</translation> </message> @@ -763,7 +768,7 @@ Address: %4 <context> <name>GUIUtil::HelpMessageBox</name> <message> - <location filename="../guiutil.cpp" line="+422"/> + <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Bitcoin-Qt</source> <translation>Bitcoin-Qt</translation> @@ -1157,7 +1162,7 @@ Address: %4 <location line="+53"/> <location line="+23"/> <location line="+23"/> - <location filename="../rpcconsole.cpp" line="+344"/> + <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>N/A</translation> </message> @@ -2146,117 +2151,7 @@ Address: %4 <context> <name>WalletView</name> <message> - <location filename="../walletview.cpp" line="+95"/> - <source>&Overview</source> - <translation>&Overview</translation> - </message> - <message> - <location line="+1"/> - <source>Show general overview of wallet</source> - <translation>Show general overview of wallet</translation> - </message> - <message> - <location line="+6"/> - <source>&Send coins</source> - <translation>&Send coins</translation> - </message> - <message> - <location line="+1"/> - <source>Send coins to a Bitcoin address</source> - <translation>Send coins to a Bitcoin address</translation> - </message> - <message> - <location line="+6"/> - <source>&Receive coins</source> - <translation>&Receive coins</translation> - </message> - <message> - <location line="+1"/> - <source>Show the list of addresses for receiving payments</source> - <translation>Show the list of addresses for receiving payments</translation> - </message> - <message> - <location line="+6"/> - <source>&Transactions</source> - <translation>&Transactions</translation> - </message> - <message> - <location line="+1"/> - <source>Browse transaction history</source> - <translation>Browse transaction history</translation> - </message> - <message> - <location line="+6"/> - <source>&Address Book</source> - <translation>&Address Book</translation> - </message> - <message> - <location line="+1"/> - <source>Edit the list of stored addresses and labels</source> - <translation>Edit the list of stored addresses and labels</translation> - </message> - <message> - <location line="+12"/> - <source>&Encrypt Wallet...</source> - <translation>&Encrypt Wallet...</translation> - </message> - <message> - <location line="+1"/> - <source>Encrypt the private keys that belong to your wallet</source> - <translation>Encrypt the private keys that belong to your wallet</translation> - </message> - <message> - <location line="+2"/> - <source>&Backup Wallet...</source> - <translation>&Backup Wallet...</translation> - </message> - <message> - <location line="+1"/> - <source>Backup wallet to another location</source> - <translation>Backup wallet to another location</translation> - </message> - <message> - <location line="+1"/> - <source>&Change Passphrase...</source> - <translation>&Change Passphrase...</translation> - </message> - <message> - <location line="+1"/> - <source>Change the passphrase used for wallet encryption</source> - <translation>Change the passphrase used for wallet encryption</translation> - </message> - <message> - <location line="+1"/> - <source>Sign &message...</source> - <translation>Sign &message...</translation> - </message> - <message> - <location line="+1"/> - <source>Sign messages with your Bitcoin addresses to prove you own them</source> - <translation>Sign messages with your Bitcoin addresses to prove you own them</translation> - </message> - <message> - <location line="+1"/> - <source>&Verify message...</source> - <translation>&Verify message...</translation> - </message> - <message> - <location line="+1"/> - <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source> - <translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation> - </message> - <message> - <location line="+2"/> - <source>&Export...</source> - <translation>&Export...</translation> - </message> - <message> - <location line="+1"/> - <source>Export the data in the current tab to a file</source> - <translation>Export the data in the current tab to a file</translation> - </message> - <message> - <location line="+180"/> + <location filename="../walletview.cpp" line="+247"/> <source>Backup Wallet</source> <translation>Backup Wallet</translation> </message> @@ -2299,7 +2194,7 @@ Address: %4 <translation>Usage:</translation> </message> <message> - <location line="-24"/> + <location line="-25"/> <source>Send command to -server or bitcoind</source> <translation>Send command to -server or bitcoind</translation> </message> @@ -2319,7 +2214,7 @@ Address: %4 <translation>Options:</translation> </message> <message> - <location line="+22"/> + <location line="+23"/> <source>Specify configuration file (default: bitcoin.conf)</source> <translation>Specify configuration file (default: bitcoin.conf)</translation> </message> @@ -2329,12 +2224,12 @@ Address: %4 <translation>Specify pid file (default: bitcoind.pid)</translation> </message> <message> - <location line="-47"/> + <location line="-48"/> <source>Generate coins</source> <translation>Generate coins</translation> </message> <message> - <location line="-28"/> + <location line="-27"/> <source>Don't generate coins</source> <translation>Don't generate coins</translation> </message> @@ -2344,7 +2239,7 @@ Address: %4 <translation>Specify data directory</translation> </message> <message> - <location line="-7"/> + <location line="-8"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Set database cache size in megabytes (default: 25)</translation> </message> @@ -2359,7 +2254,7 @@ Address: %4 <translation>Maintain at most <n> connections to peers (default: 125)</translation> </message> <message> - <location line="-49"/> + <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Connect to a node to retrieve peer addresses, and disconnect</translation> </message> @@ -2394,12 +2289,12 @@ Address: %4 <translation>Accept command line and JSON-RPC commands</translation> </message> <message> - <location line="+77"/> + <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Run in the background as a daemon and accept commands</translation> </message> <message> - <location line="+32"/> + <location line="+33"/> <source>Use the test network</source> <translation>Use the test network</translation> </message> @@ -2579,7 +2474,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Error: Wallet locked, unable to create transaction!</translation> </message> <message> - <location line="+2"/> + <location line="+1"/> <source>Error: system error: </source> <translation>Error: system error: </translation> </message> @@ -2659,7 +2554,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Rebuild block chain index from current blk000??.dat files</translation> </message> <message> - <location line="+37"/> + <location line="+16"/> + <source>Set the number of threads to service RPC calls (default: 4)</source> + <translation>Set the number of threads to service RPC calls (default: 4)</translation> + </message> + <message> + <location line="+22"/> <source>Verifying blocks...</source> <translation>Verifying blocks...</translation> </message> @@ -2669,7 +2569,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Verifying wallet...</translation> </message> <message> - <location line="-61"/> + <location line="-62"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Imports blocks from external blk000??.dat file</translation> </message> @@ -2754,7 +2654,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Set minimum block size in bytes (default: 0)</translation> </message> <message> - <location line="+1"/> + <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Shrink debug.log file on client startup (default: 1 when no -debug)</translation> </message> @@ -2809,22 +2709,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>wallet.dat corrupt, salvage failed</translation> </message> <message> - <location line="-45"/> + <location line="-46"/> <source>Password for JSON-RPC connections</source> <translation>Password for JSON-RPC connections</translation> </message> <message> - <location line="-68"/> + <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Allow JSON-RPC connections from specified IP address</translation> </message> <message> - <location line="+77"/> + <location line="+76"/> <source>Send commands to node running on <ip> (default: 127.0.0.1)</source> <translation>Send commands to node running on <ip> (default: 127.0.0.1)</translation> </message> <message> - <location line="-120"/> + <location line="-119"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation> </message> @@ -2834,7 +2734,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Upgrade wallet to latest format</translation> </message> <message> - <location line="-16"/> + <location line="-17"/> <source>Set key pool size to <n> (default: 100)</source> <translation>Set key pool size to <n> (default: 100)</translation> </message> @@ -2844,12 +2744,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Rescan the block chain for missing wallet transactions</translation> </message> <message> - <location line="+30"/> + <location line="+31"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Use OpenSSL (https) for JSON-RPC connections</translation> </message> <message> - <location line="-21"/> + <location line="-22"/> <source>Server certificate file (default: server.cert)</source> <translation>Server certificate file (default: server.cert)</translation> </message> @@ -2859,7 +2759,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Server private key (default: server.pem)</translation> </message> <message> - <location line="-154"/> + <location line="-153"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> @@ -2884,12 +2784,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation> </message> <message> - <location line="+57"/> + <location line="+56"/> <source>Loading addresses...</source> <translation>Loading addresses...</translation> </message> <message> - <location line="-35"/> + <location line="-34"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error loading wallet.dat: Wallet corrupted</translation> </message> @@ -2909,12 +2809,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Error loading wallet.dat</translation> </message> <message> - <location line="+30"/> + <location line="+29"/> <source>Invalid -proxy address: '%s'</source> <translation>Invalid -proxy address: '%s'</translation> </message> <message> - <location line="+48"/> + <location line="+49"/> <source>Unknown network specified in -onlynet: '%s'</source> <translation>Unknown network specified in -onlynet: '%s'</translation> </message> @@ -2934,17 +2834,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Cannot resolve -externalip address: '%s'</translation> </message> <message> - <location line="+45"/> + <location line="+44"/> <source>Invalid amount for -paytxfee=<amount>: '%s'</source> <translation>Invalid amount for -paytxfee=<amount>: '%s'</translation> </message> <message> - <location line="-24"/> - <source>Error: could not start node</source> - <translation>Error: could not start node</translation> - </message> - <message> - <location line="+25"/> + <location line="+1"/> <source>Invalid amount</source> <translation>Invalid amount</translation> </message> @@ -2959,7 +2854,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Loading block index...</translation> </message> <message> - <location line="-59"/> + <location line="-58"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Add a node to connect to and attempt to keep the connection open</translation> </message> @@ -2969,7 +2864,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Unable to bind to %s on this computer. Bitcoin is probably already running.</translation> </message> <message> - <location line="+68"/> + <location line="+67"/> <source>Fee per KB to add to transactions you send</source> <translation>Fee per KB to add to transactions you send</translation> </message> @@ -2979,7 +2874,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Loading wallet...</translation> </message> <message> - <location line="-54"/> + <location line="-53"/> <source>Cannot downgrade wallet</source> <translation>Cannot downgrade wallet</translation> </message> @@ -2994,12 +2889,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Cannot write default address</translation> </message> <message> - <location line="+64"/> + <location line="+63"/> <source>Rescanning...</source> <translation>Rescanning...</translation> </message> <message> - <location line="-56"/> + <location line="-55"/> <source>Done loading</source> <translation>Done loading</translation> </message> diff --git a/src/qt/res/bitcoin-qt.rc b/src/qt/res/bitcoin-qt.rc index 5449ff8359..3e3672a835 100644 --- a/src/qt/res/bitcoin-qt.rc +++ b/src/qt/res/bitcoin-qt.rc @@ -1,4 +1,5 @@ IDI_ICON1 ICON DISCARDABLE "icons/bitcoin.ico" +IDI_ICON2 ICON DISCARDABLE "icons/bitcoin_testnet.ico" #include <windows.h> // needed for VERSIONINFO #include "../../clientversion.h" // holds the needed client version information @@ -7,6 +8,7 @@ IDI_ICON1 ICON DISCARDABLE "icons/bitcoin.ico" #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin developers" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION @@ -22,7 +24,7 @@ BEGIN VALUE "FileDescription", "Bitcoin-Qt (OSS GUI client for Bitcoin)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "bitcoin-qt" - VALUE "LegalCopyright", "2009-2013 The Bitcoin developers" + VALUE "LegalCopyright", COPYRIGHT_STR VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." VALUE "OriginalFilename", "bitcoin-qt.exe" VALUE "ProductName", "Bitcoin-Qt" diff --git a/src/qt/res/icons/bitcoin.ico b/src/qt/res/icons/bitcoin.ico Binary files differindex ad74552e90..8f5045015d 100755 --- a/src/qt/res/icons/bitcoin.ico +++ b/src/qt/res/icons/bitcoin.ico diff --git a/src/qt/res/icons/bitcoin_testnet.ico b/src/qt/res/icons/bitcoin_testnet.ico Binary files differnew file mode 100755 index 0000000000..d67d9d5ce5 --- /dev/null +++ b/src/qt/res/icons/bitcoin_testnet.ico diff --git a/src/qt/res/icons/bitcoin_testnet.png b/src/qt/res/icons/bitcoin_testnet.png Binary files differindex 43b3d7b0eb..d54125c0c6 100644 --- a/src/qt/res/icons/bitcoin_testnet.png +++ b/src/qt/res/icons/bitcoin_testnet.png diff --git a/src/qt/res/icons/toolbar.png b/src/qt/res/icons/toolbar.png Binary files differindex 84c18e29fa..b694302871 100644 --- a/src/qt/res/icons/toolbar.png +++ b/src/qt/res/icons/toolbar.png diff --git a/src/qt/res/icons/toolbar_testnet.png b/src/qt/res/icons/toolbar_testnet.png Binary files differindex 90ed6d99f4..dcac261c36 100644 --- a/src/qt/res/icons/toolbar_testnet.png +++ b/src/qt/res/icons/toolbar_testnet.png diff --git a/src/qt/res/images/splash.png b/src/qt/res/images/splash.png Binary files differnew file mode 100644 index 0000000000..376c274a8d --- /dev/null +++ b/src/qt/res/images/splash.png diff --git a/src/qt/res/images/splash2.jpg b/src/qt/res/images/splash2.jpg Binary files differdeleted file mode 100644 index 3846e6f68d..0000000000 --- a/src/qt/res/images/splash2.jpg +++ /dev/null diff --git a/src/qt/res/images/splash_testnet.png b/src/qt/res/images/splash_testnet.png Binary files differnew file mode 100644 index 0000000000..2520e76e62 --- /dev/null +++ b/src/qt/res/images/splash_testnet.png diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp new file mode 100644 index 0000000000..f8d16699ca --- /dev/null +++ b/src/qt/splashscreen.cpp @@ -0,0 +1,82 @@ +#include "splashscreen.h" +#include "clientversion.h" +#include "util.h" + +#include <QPainter> +#include <QApplication> + +SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) : + QSplashScreen(pixmap, f) +{ + // set reference point, paddings + int paddingRight = 50; + int paddingTop = 50; + int titleVersionVSpace = 17; + int titleCopyrightVSpace = 40; + + float fontFactor = 1.0; + + // define text to place + QString titleText = QString(QApplication::applicationName()).replace(QString("-testnet"), QString(""), Qt::CaseSensitive); // cut of testnet, place it as single object further down + QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); + QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin developers")); + QString testnetAddText = QString(tr("[testnet]")); // define text to place as single text object + + QString font = "Arial"; + + // load the bitmap for writing some text over it + QPixmap newPixmap; + if(GetBoolArg("-testnet")) { + newPixmap = QPixmap(":/images/splash_testnet"); + } + else { + newPixmap = QPixmap(":/images/splash"); + } + + QPainter pixPaint(&newPixmap); + pixPaint.setPen(QColor(100,100,100)); + + // check font size and drawing with + pixPaint.setFont(QFont(font, 33*fontFactor)); + QFontMetrics fm = pixPaint.fontMetrics(); + int titleTextWidth = fm.width(titleText); + if(titleTextWidth > 160) { + // strange font rendering, Arial probably not found + fontFactor = 0.75; + } + + pixPaint.setFont(QFont(font, 33*fontFactor)); + fm = pixPaint.fontMetrics(); + titleTextWidth = fm.width(titleText); + pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight,paddingTop,titleText); + + pixPaint.setFont(QFont(font, 15*fontFactor)); + + // if the version string is to long, reduce size + fm = pixPaint.fontMetrics(); + int versionTextWidth = fm.width(versionText); + if(versionTextWidth > titleTextWidth+paddingRight-10) { + pixPaint.setFont(QFont(font, 10*fontFactor)); + titleVersionVSpace -= 5; + } + pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText); + + // draw copyright stuff + pixPaint.setFont(QFont(font, 10*fontFactor)); + pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText); + + // draw testnet string if -testnet is on + if(QApplication::applicationName().contains(QString("-testnet"))) { + // draw copyright stuff + QFont boldFont = QFont(font, 10*fontFactor); + boldFont.setWeight(QFont::Bold); + pixPaint.setFont(boldFont); + fm = pixPaint.fontMetrics(); + int testnetAddTextWidth = fm.width(testnetAddText); + pixPaint.drawText(newPixmap.width()-testnetAddTextWidth-10,15,testnetAddText); + } + + pixPaint.end(); + + this->setPixmap(newPixmap); +} diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h new file mode 100644 index 0000000000..6a6249d80c --- /dev/null +++ b/src/qt/splashscreen.h @@ -0,0 +1,16 @@ +#ifndef SPLASHSCREEN_H +#define SPLASHSCREEN_H + +#include <QSplashScreen> + +/** class for the splashscreen with information of the running client + */ +class SplashScreen : public QSplashScreen +{ + Q_OBJECT + +public: + explicit SplashScreen(const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = 0); +}; + +#endif // SPLASHSCREEN_H diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 1d02b81fb6..727b48ded7 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -23,6 +23,7 @@ #include <QAction> #include <QDesktopServices> #include <QFileDialog> +#include <QPushButton> WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): QStackedWidget(parent), @@ -35,8 +36,17 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); + QHBoxLayout *hbox_buttons = new QHBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); + QPushButton *exportButton = new QPushButton("&Export", this); + exportButton->setToolTip(tr("Export the data in the current tab to a file")); +#ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac + exportButton->setIcon(QIcon(":/icons/export")); +#endif + hbox_buttons->addStretch(); + hbox_buttons->addWidget(exportButton); + vbox->addLayout(hbox_buttons); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); @@ -66,6 +76,8 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page opens the sign message tab in the Sign/Verify Message dialog connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); + // Clicking on "Export" allows to export the transaction list + connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked())); gotoOverviewPage(); } @@ -142,39 +154,24 @@ void WalletView::gotoOverviewPage() { gui->getOverviewAction()->setChecked(true); setCurrentWidget(overviewPage); - - gui->getExportAction()->setEnabled(false); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); } void WalletView::gotoHistoryPage() { gui->getHistoryAction()->setChecked(true); setCurrentWidget(transactionsPage); - - gui->getExportAction()->setEnabled(true); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - connect(gui->getExportAction(), SIGNAL(triggered()), transactionView, SLOT(exportClicked())); } void WalletView::gotoAddressBookPage() { gui->getAddressBookAction()->setChecked(true); setCurrentWidget(addressBookPage); - - gui->getExportAction()->setEnabled(true); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - connect(gui->getExportAction(), SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); } void WalletView::gotoReceiveCoinsPage() { gui->getReceiveCoinsAction()->setChecked(true); setCurrentWidget(receiveCoinsPage); - - gui->getExportAction()->setEnabled(true); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - connect(gui->getExportAction(), SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); } void WalletView::gotoSendCoinsPage(QString addr) @@ -182,9 +179,6 @@ void WalletView::gotoSendCoinsPage(QString addr) gui->getSendCoinsAction()->setChecked(true); setCurrentWidget(sendCoinsPage); - gui->getExportAction()->setEnabled(false); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - if (!addr.isEmpty()) sendCoinsPage->setAddress(addr); } diff --git a/src/uint256.h b/src/uint256.h index eb0066fa27..8a9af8ba04 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -55,6 +55,16 @@ public: return ret; } + double getdouble() const + { + double ret = 0.0; + double fact = 1.0; + for (int i = 0; i < WIDTH; i++) { + ret += fact * pn[i]; + fact *= 4294967296.0; + } + return ret; + } base_uint& operator=(uint64 b) { |