Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
djangoeh committed Jun 21, 2014
1 parent b4accd7 commit 23b538d
Show file tree
Hide file tree
Showing 58 changed files with 2,211 additions and 140 deletions.
3 changes: 2 additions & 1 deletion doc/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Guerillacoin 0.4.4 BETA
Guerillacoin 1.0.1 BETA

Copyright (c) 2013 NovaCoin Developers
Copyright (c) 2011-2012 PPCoin Developers
Copyright (c) 2014 Guerillacoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
Expand Down
5 changes: 3 additions & 2 deletions guerillacoin-qt.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = guerillacoin-qt
VERSION = 0.7.5
VERSION = 1.0.1
INCLUDEPATH += src src/json src/qt
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
CONFIG += no_include_pwd
Expand Down Expand Up @@ -310,7 +310,8 @@ FORMS += \
src/qt/forms/sendcoinsentry.ui \
src/qt/forms/askpassphrasedialog.ui \
src/qt/forms/rpcconsole.ui \
src/qt/forms/optionsdialog.ui
src/qt/forms/optionsdialog.ui \
src/qt/forms/simplesend.ui

contains(USE_QRCODE, 1) {
HEADERS += src/qt/qrcodedialog.h
Expand Down
2 changes: 1 addition & 1 deletion share/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SetCompressor /SOLID lzma

# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 1.0.0.0
!define VERSION 1.0.1.0
!define COMPANY "Guerillacoin project"
!define URL http://www.guerillacoin.com/

Expand Down
2 changes: 1 addition & 1 deletion src/json/json_spirit_writer_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace json_spirit
template< class String_type >
String_type non_printable_to_string( unsigned int c )
{
typedef typename String_type::value_type Char_type;
// typedef typename String_type::value_type Char_type;

String_type result( 6, '\\' );

Expand Down
11 changes: 6 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ uint256 WantedByOrphan(const CBlock* pblockOrphan)
int64_t GetProofOfWorkReward(int64_t nFees)
{
int64_t nSubsidy = 0;
if(pindexBest->nHeight <= 10000)
if(pindexBest->nHeight <= LAST_POW_BLOCK)
nSubsidy = 750 * COIN;

if (fDebug && GetBoolArg("-printcreation"))
Expand All @@ -989,10 +989,11 @@ int64_t GetProofOfWorkReward(int64_t nFees)
uint64_t GetInterestRate(bool wholeCents)
{
double weight = GetPoSKernelPS();
if(weight < 512)
weight = 512;
uint64_t rate = std::max(COIN_YEAR_REWARD,
static_cast<int64_t>(COIN_YEAR_REWARD * log(weight / 512.0)));
uint64_t rate = COIN_YEAR_REWARD;
if(weight > 16384)
rate = std::max(COIN_YEAR_REWARD,
std::min(static_cast<int64_t>(COIN_YEAR_REWARD * log(weight / 16384.0)),
8*COIN_YEAR_REWARD));
return wholeCents ? 100 * rate : rate;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CInv;
class CRequestTracker;
class CNode;

static const int LAST_POW_BLOCK = 10000;
static const int LAST_POW_BLOCK = fTestNet ? 750 : 5000;

static const unsigned int MAX_BLOCK_SIZE = 1000000;
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
Expand Down
5 changes: 4 additions & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,11 @@ void StakeMiner(CWallet *pwallet)
if (fShutdown)
return;

if (pindexBest->nHeight < LAST_POW_BLOCK)
while (pindexBest->nHeight < LAST_POW_BLOCK) {
MilliSleep(1000);
if (fShutdown)
return;
}

while (pwallet->IsLocked())
{
Expand Down
22 changes: 16 additions & 6 deletions src/qt/bitcoin.qrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<RCC>
<qresource prefix="/icons">
<file alias="bitcoin">res/icons/guerillacoin-80.png</file>
<file alias="address-book">res/icons/address-book.png</file>
<file alias="quit">res/icons/quit.png</file>
<file alias="send">res/icons/send.png</file>
<file alias="toolbar">res/icons/guerillacoin-16.png</file>
<file alias="address-book">res/icons/address.png</file>
<file alias="address">res/icons/address.png</file>
<file alias="quit">res/icons/quit.png</file>
<file alias="send">res/icons/send.png</file>
<file alias="send_off">res/icons/send_off.png</file>
<file alias="receive_off">res/icons/receive_off.png</file>
<file alias="address_off">res/icons/address_off.png</file>
<file alias="overview_off">res/icons/overview_off.png</file>
<file alias="history_off">res/icons/history_off.png</file>
<file alias="toolbar">res/icons/guerillacoin-16.png</file>
<file alias="connect_0">res/icons/connect0_16.png</file>
<file alias="connect_1">res/icons/connect1_16.png</file>
<file alias="connect_2">res/icons/connect2_16.png</file>
Expand All @@ -19,8 +25,9 @@
<file alias="transaction_4">res/icons/clock4.png</file>
<file alias="transaction_5">res/icons/clock5.png</file>
<file alias="options">res/icons/configure.png</file>
<file alias="receiving_addresses">res/icons/receive.png</file>
<file alias="editpaste">res/icons/editpaste.png</file>
<file alias="receiving_addresses">res/icons/receive.png</file>
<file alias="receive">res/icons/receive.png</file>
<file alias="editpaste">res/icons/editpaste.png</file>
<file alias="editcopy">res/icons/editcopy.png</file>
<file alias="add">res/icons/add.png</file>
<file alias="bitcoin_testnet">res/icons/guerillacoin-80.png</file>
Expand Down Expand Up @@ -92,4 +99,7 @@
<file alias="zh_CN">locale/bitcoin_zh_CN.qm</file>
<file alias="zh_TW">locale/bitcoin_zh_TW.qm</file>
</qresource>
<qresource prefix="/text">
<file>res/text/style.qss</file>
</qresource>
</RCC>
69 changes: 56 additions & 13 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <QStatusBar>
#include <QLabel>
#include <QLineEdit>
#include <QInputDialog>
#include <QPushButton>
#include <QLocale>
#include <QMessageBox>
Expand Down Expand Up @@ -97,11 +98,30 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
createMenuBar();

// Create the toolbars
createToolBars();
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
createToolBars(toolbar);

// Create the tray icon (or setup the dock icon)
createTrayIcon();

QPalette p;
p.setColor(QPalette::Window, QColor(0x22, 0x22, 0x22));
p.setColor(QPalette::Button, QColor(0x22, 0x22, 0x22));
p.setColor(QPalette::Mid, QColor(0x22, 0x22, 0x22));
p.setColor(QPalette::Base, QColor(0x22, 0x22, 0x22));
p.setColor(QPalette::AlternateBase, QColor(0x22, 0x22, 0x22));
setPalette(p);
QFile style(":/text/res/text/style.qss");
style.open(QFile::ReadOnly);
setStyleSheet(QString::fromUtf8(style.readAll()));

/* don't override the background color of the toolbar on mac os x due to
the whole component it resides on not being paintable
*/
#ifdef Q_OS_MAC
toolbar->setStyleSheet("QToolBar { background-color: transparent; border: 0px solid black; padding: 3px; }");
#endif

// Create tabs
overviewPage = new OverviewPage();

Expand All @@ -120,6 +140,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
signVerifyMessageDialog = new SignVerifyMessageDialog(this);

centralWidget = new QStackedWidget(this);
centralWidget->setObjectName("central");
centralWidget->addWidget(overviewPage);
centralWidget->addWidget(transactionsPage);
centralWidget->addWidget(addressBookPage);
Expand All @@ -131,7 +152,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
statusBar();

// Status bar notification icons
QFrame *frameBlocks = new QFrame();
QFrame *frameBlocks = new QFrame();
frameBlocks->setObjectName("frameBlocks");
frameBlocks->setContentsMargins(0,0,0,0);
frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
Expand Down Expand Up @@ -166,6 +188,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
progressBar->setAlignment(Qt::AlignCenter);
progressBar->setVisible(false);



// Override style sheet for progress bar for styles that have a segmented progress bar,
// as they make the text unreadable (workaround for issue #1071)
// See https://qt-project.org/doc/qt-4.8/gallery.html
Expand Down Expand Up @@ -208,35 +232,42 @@ BitcoinGUI::~BitcoinGUI()
#endif
}

static QIcon makeIcon(QString _s)
{
QIcon ret(":/icons/" + _s + "_off");
ret.addFile(":/icons/" + _s, QSize(), QIcon::Normal, QIcon::On);
return ret;
}

void BitcoinGUI::createActions()
{
QActionGroup *tabGroup = new QActionGroup(this);

overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this);
overviewAction = new QAction(makeIcon("overview"), tr("&overview"), this);
overviewAction->setToolTip(tr("Show general overview of wallet"));
overviewAction->setCheckable(true);
overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
tabGroup->addAction(overviewAction);

sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this);
sendCoinsAction = new QAction(makeIcon("send"), tr("&send"), this);
sendCoinsAction->setToolTip(tr("Send coins to a Guerillacoin address"));
sendCoinsAction->setCheckable(true);
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
tabGroup->addAction(sendCoinsAction);

receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this);
receiveCoinsAction = new QAction(makeIcon("receive"), tr("&receive"), this);
receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments"));
receiveCoinsAction->setCheckable(true);
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
tabGroup->addAction(receiveCoinsAction);

historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this);
historyAction = new QAction(makeIcon("history"), tr("&transactions"), this);
historyAction->setToolTip(tr("Browse transaction history"));
historyAction->setCheckable(true);
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(historyAction);

addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this);
addressBookAction = new QAction(makeIcon("address"), tr("&addresses"), this);
addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels"));
addressBookAction->setCheckable(true);
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
Expand Down Expand Up @@ -300,6 +331,11 @@ void BitcoinGUI::createActions()
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab()));
}

void BitcoinGUI::changeStyleSheet()
{
setStyleSheet(QInputDialog::getText(this, "Change Stylesheet", "Sheet", QLineEdit::Normal, styleSheet()));
}

void BitcoinGUI::createMenuBar()
{
#ifdef Q_OS_MAC
Expand Down Expand Up @@ -334,19 +370,14 @@ void BitcoinGUI::createMenuBar()
help->addAction(aboutQtAction);
}

void BitcoinGUI::createToolBars()
void BitcoinGUI::createToolBars(QToolBar* toolbar)
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
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)
Expand Down Expand Up @@ -919,6 +950,14 @@ void BitcoinGUI::toggleHidden()
showNormalIfMinimized(true);
}

double GetStrength(uint64_t nWeight)
{
double networkWeight = GetPoSKernelPS();
if (nWeight == 0 && networkWeight == 0)
return 0;
return nWeight / (static_cast<double>(nWeight) + networkWeight);
}

void BitcoinGUI::updateWeight()
{
if (!pwalletMain)
Expand All @@ -935,13 +974,17 @@ void BitcoinGUI::updateWeight()
uint64_t nMinWeight = 0, nMaxWeight = 0;
pwalletMain->GetStakeWeight(*pwalletMain, nMinWeight, nMaxWeight, nWeight);

// TODO: refactor this
overviewPage->setStrength(GetStrength(nWeight));
overviewPage->setInterestRate(GetInterestRate(true));
}

void BitcoinGUI::updateStakingIcon()
{
if (pindexBest != NULL && pindexBest->nHeight < LAST_POW_BLOCK)
{
labelStakingIcon->setToolTip(tr("Not staking because blockchain is still in the proof-of-work phase"));
overviewPage->setStrength(0);
return;
}
updateWeight();
Expand Down
4 changes: 3 additions & 1 deletion src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class BitcoinGUI : public QMainWindow
QAction *lockWalletAction;
QAction *aboutQtAction;
QAction *openRPCConsoleAction;
QAction *setStyleSheetAction;

QSystemTrayIcon *trayIcon;
Notificator *notificator;
Expand All @@ -110,7 +111,7 @@ class BitcoinGUI : public QMainWindow
/** Create the menu bar and sub-menus. */
void createMenuBar();
/** Create the toolbars */
void createToolBars();
void createToolBars(QToolBar* toolbar);
/** Create system tray (notification) icon */
void createTrayIcon();

Expand Down Expand Up @@ -178,6 +179,7 @@ private slots:
void unlockWallet();

void lockWallet();
void changeStyleSheet();

/** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */
void showNormalIfMinimized(bool fToggleHidden = false);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ QDateTime ClientModel::getLastBlockDate() const
if (pindexBest)
return QDateTime::fromTime_t(pindexBest->GetBlockTime());
else
return QDateTime::fromTime_t(1393221600); // Genesis block's time
return QDateTime::fromTime_t(1403119678); // Genesis block's time
}

void ClientModel::updateTimer()
Expand Down
29 changes: 29 additions & 0 deletions src/qt/forms/aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@
<property name="windowTitle">
<string>About Guerillacoin</string>
</property>
<property name="styleSheet">
<string notr="true">QDialog {
background-color: #222;
}

QLabel {
color: white;
}

QPushButton, QToolButton {
border: 4px solid #111;
border-radius: 12px;
background-color: #111;
color: white;
padding: 6px;
margin: 6px;
}
QPushButton:pressed, QToolButton:checked {
color: #cca000;
}
QPushButton:pressed, QToolButton:pressed {
border-color: #cca000;
color: #cca000;
}
QPushButton:disabled, QToolButton:disabled {
color: #444;
background-color: #222;
}</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
Expand Down
Loading

0 comments on commit 23b538d

Please sign in to comment.