diff --git a/contrib/dash-qt.pro b/contrib/dash-qt.pro index 51de7e3b..1431da9f 100644 --- a/contrib/dash-qt.pro +++ b/contrib/dash-qt.pro @@ -12,7 +12,6 @@ FORMS += \ ../src/qt/forms/openuridialog.ui \ ../src/qt/forms/optionsdialog.ui \ ../src/qt/forms/overviewpage.ui \ - ../src/qt/forms/overviewapage.ui \ ../src/qt/forms/receivecoinsdialog.ui \ ../src/qt/forms/receiverequestdialog.ui \ ../src/qt/forms/sendcoinsdialog.ui \ @@ -23,4 +22,6 @@ FORMS += \ RESOURCES += \ ../src/qt/dash.qrc -CONFIG+=c++11 +CONFIG += c++11 + + diff --git a/libhelpthehomelessconsensus.pc b/libhelpthehomelessconsensus.pc index 95317366..2ec97458 100644 --- a/libhelpthehomelessconsensus.pc +++ b/libhelpthehomelessconsensus.pc @@ -1,4 +1,5 @@ prefix=/home/devilking6105/Help-The-Homeless-Coin-0.14/depends/x86_64-w64-mingw32 + exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 7b6e2512..18935d5d 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -714,4 +714,4 @@ moc_%.cpp: %.h %.qm: %.ts @test -f $(LRELEASE) @$(MKDIR_P) $(@D) - $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@ + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@ \ No newline at end of file diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 60b567a4..6cad2142 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -232,6 +232,11 @@ class CMainParams : public CChainParams { consensus.devAddress = "hWrjjP7w4iE5tezxDG3jD7xCTmikw3Kgoy"; consensus.devAddressPubKey = "b027849d3febd03af8063fc9f1f1226fbe3eb74c"; consensus.nDevelopersFeeBegin = 250; + +/* consensus.FoundationAddress = "BB2BwSbDCqCqNsfc7FgWFJn4sRgnUt4tsM"; + consensus.FoundationPODSAddress = "BScSypUZVEEY4TMz1ehyyPcS5wrnMM7WPB"; + consensus.FoundationQTAddress = "BDcNYc8tGXmwD7QmLXbR1rk1qteTDVEjUD"; + consensus.BurnAddress = "B4T5ciTCkWauSqVAcVKy88ofjcSasUkSYU"; */ consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1544655600; @@ -410,6 +415,11 @@ class CTestNetParams : public CChainParams { consensus.devAddress = "yUDp1tj5hnnVYaZxpA94k2ZyDiG3hD46it"; consensus.devAddressPubKey = "56b02e0c24998c6d27a7603cc17be9cd62643825"; consensus.nDevelopersFeeBegin = 250; + + consensus.FoundationAddress = "yg7cUN19J8puigMMXfhv193S92EiSNe3Ag"; + consensus.FoundationPODSAddress = "ycGfUKh4itBzi4EGj2W8gxSEbLUGJqLFBZ"; + consensus.FoundationQTAddress = "yeKHKjBRDpcz6Ec8pHQhQXpkszJLp9ykMo"; + consensus.BurnAddress = "yTQvV7JLSpjtUXteGGaR3SXKV5tRqe9U1e"; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008 diff --git a/src/consensus/params.h b/src/consensus/params.h index b435c50b..3b25e3c0 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -147,6 +147,12 @@ struct Params { const char *devAddress; const char *devAddressPubKey; int nDevelopersFeeBegin; + + std::string FoundationAddress; + std::string FoundationPODSAddress; + std::string FoundationQTAddress; + std::string BurnAddress; + /** Block height and hash at which BIP34 becomes active */ int BIP34Height; uint256 BIP34Hash; diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 6e4ede3e..be739873 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -181,6 +181,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount bloc return true; } + // superblocks started // SEE IF THIS IS A VALID SUPERBLOCK diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index ff06205f..fd71a70b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -429,7 +429,7 @@ void BitcoinGUI::createActions() sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); #endif tabGroup->addAction(sendCoinsAction); - + sendCoinsMenuAction = new QAction(QIcon(":/icons/" + theme + "/send"), sendCoinsAction->text(), this); sendCoinsMenuAction->setStatusTip(sendCoinsAction->statusTip()); sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip()); @@ -448,6 +448,7 @@ void BitcoinGUI::createActions() receiveCoinsMenuAction = new QAction(QIcon(":/icons/" + theme + "/receiving_addresses"), receiveCoinsAction->text(), this); receiveCoinsMenuAction->setStatusTip(receiveCoinsAction->statusTip()); receiveCoinsMenuAction->setToolTip(receiveCoinsMenuAction->statusTip()); + historyAction = new QAction(QIcon(":/icons/" + theme + "/history"), tr("&Transactions"), this); historyAction->setStatusTip(tr("Browse transaction history")); @@ -576,7 +577,7 @@ void BitcoinGUI::createActions() openGraphAction->setEnabled(false); openPeersAction->setEnabled(false); openRepairAction->setEnabled(false); - + usedSendingAddressesAction = new QAction(QIcon(":/icons/" + theme + "/address-book"), tr("&Sending addresses..."), this); usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels")); usedReceivingAddressesAction = new QAction(QIcon(":/icons/" + theme + "/address-book"), tr("&Receiving addresses..."), this); @@ -592,7 +593,8 @@ void BitcoinGUI::createActions() showPrivateSendHelpAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&PrivateSend information"), this); showPrivateSendHelpAction->setMenuRole(QAction::NoRole); showPrivateSendHelpAction->setStatusTip(tr("Show the PrivateSend basic information")); - + + connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); @@ -600,7 +602,7 @@ void BitcoinGUI::createActions() connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked())); connect(showPrivateSendHelpAction, SIGNAL(triggered()), this, SLOT(showPrivateSendHelpClicked())); - + // Jump directly to tabs in RPC-console connect(openInfoAction, SIGNAL(triggered()), this, SLOT(showInfo())); connect(openRPCConsoleAction, SIGNAL(triggered()), this, SLOT(showConsole())); @@ -688,8 +690,10 @@ void BitcoinGUI::createMenuBar() tools->addSeparator(); tools->addAction(openConfEditorAction); tools->addAction(showBackupsAction); + } + QMenu *help = appMenuBar->addMenu(tr("&Help")); help->addAction(showHelpMessageAction); help->addAction(showPrivateSendHelpAction); @@ -710,6 +714,7 @@ void BitcoinGUI::createToolBars() toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); toolbar->addAction(overviewaAction); + QSettings settings; if (!fLiteMode && settings.value("fShowMasternodesTab").toBool() && masternodeAction) @@ -878,6 +883,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled) usedSendingAddressesAction->setEnabled(enabled); usedReceivingAddressesAction->setEnabled(enabled); openAction->setEnabled(enabled); + } void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle) @@ -1018,7 +1024,6 @@ void BitcoinGUI::openClicked() } } - void BitcoinGUI::gotoGovernancePage() { governanceAction->setChecked(true); @@ -1433,6 +1438,7 @@ void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event) // Accept only URIs if(event->mimeData()->hasUrls()) event->acceptProposedAction(); + } void BitcoinGUI::dropEvent(QDropEvent *event) @@ -1570,6 +1576,44 @@ void BitcoinGUI::detectShutdown() } } + +// Governance - Check to see if we should submit a proposal + /* nProposalModulus++; + if (nProposalModulus % 15 == 0 && !fLoadingIndex) + { + nProposalModulus = 0; + if (!msURL.empty()) + { + QString qNav = GUIUtil::TOQS(msURL); + msURL = std::string(); + QDesktopServices::openUrl(QUrl(qNav)); + } + if (fProposalNeedsSubmitted) + { + nProposalModulus = 0; + if(masternodeSync.IsSynced() && chainActive.Tip() && chainActive.Tip()->nHeight > (nProposalPrepareHeight + 6)) + { + fProposalNeedsSubmitted = false; + std::string sError; + std::string sGovObj; + bool fSubmitted = SubmitProposalToNetwork(uTxIdFee, nProposalStartTime, msProposalHex, sError, sGovObj); + if (!sError.empty()) + { + LogPrintf("Proposal Submission Problem: %s ", sError); + } + msProposalResult = fSubmitted ? "Submitted Proposal Successfully
( " + sGovObj + " )" : sError; + LogPrintf(" Proposal Submission Result: %s \n", msProposalResult.c_str()); + } + else + { + msProposalResult = "Waiting for block " + RoundToString(nProposalPrepareHeight + 6, 0) + " to submit pending proposal. "; + } + } + } + +} */ + + void BitcoinGUI::showProgress(const QString &title, int nProgress) { if (nProgress == 0) diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 405958e3..27f45d5e 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -10,6 +10,7 @@ #endif #include "amount.h" +#include "governancelist.h" #include #include @@ -135,6 +136,7 @@ class BitcoinGUI : public QMainWindow QAction *openAction; QAction *showHelpMessageAction; QAction *showPrivateSendHelpAction; + QSystemTrayIcon *trayIcon; QMenu *trayIconMenu; @@ -226,6 +228,7 @@ public Q_SLOTS: private Q_SLOTS: #ifdef ENABLE_WALLET + /** Switch to masternode page */ void gotoGovernancePage(); diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 0e7bfcf2..ffe7a99d 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -75,6 +75,7 @@ int ClientModel::getNumConnections(unsigned int flags) const return 0; } + void ClientModel::setMasternodeList(const CDeterministicMNList& mnList) { LOCK(cs_mnlinst); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index c9723d56..ba30a287 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -69,7 +69,7 @@ class ClientModel : public QObject void setMasternodeList(const CDeterministicMNList& mnList); CDeterministicMNList getMasternodeList() const; void refreshMasternodeList(); - + quint64 getTotalBytesRecv() const; quint64 getTotalBytesSent() const; diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui index ce8a6b09..6709c537 100644 --- a/src/qt/forms/receivecoinsdialog.ui +++ b/src/qt/forms/receivecoinsdialog.ui @@ -325,8 +325,6 @@ showRequestButton removeRequestButton - - - + diff --git a/src/qt/forms/sendcoinsentry.ui b/src/qt/forms/sendcoinsentry.ui index 768b997c..ba3efcdc 100644 --- a/src/qt/forms/sendcoinsentry.ui +++ b/src/qt/forms/sendcoinsentry.ui @@ -6,8 +6,8 @@ 0 0 - 729 - 150 + 753 + 451 @@ -36,6 +36,86 @@ 8 + + + + Message: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Enter a label for this address to add it to the list of used addresses + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 85 + + + + + + + + Qt::Horizontal + + + + + + + + + + + + The fee will be deducted from the amount being sent. The recipient will receive a lower amount of HTH than you enter in the amount field. If multiple recipients are selected, the fee is split equally. + + + S&ubtract fee from amount + + + + + + + + + Donate: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + A message that was attached to the HTH: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the HelpTheHomeless network. + + + Qt::PlainText + + + @@ -49,6 +129,32 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + &Label: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + addAsLabel + + + @@ -117,26 +223,6 @@ - - - - &Label: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - addAsLabel - - - - - - - Enter a label for this address to add it to the list of used addresses - - - @@ -150,48 +236,72 @@ - - - - - - - - - The fee will be deducted from the amount being sent. The recipient will receive a lower amount of HTH than you enter in the amount field. If multiple recipients are selected, the fee is split equally. - - - S&ubtract fee from amount - - - - - - - - - Message: + + + + + 0 + 0 + - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 675 + 50 + - - - - - - A message that was attached to the HTH: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the HelpTheHomeless network. + + + 16777215 + 16777215 + - - Qt::PlainText + + border-color: transparent; - - - - - - Qt::Horizontal + + QFrame::StyledPanel + + QFrame::Raised + + + + + 260 + 10 + 291 + 31 + + + + + 6 + + + 0 + + + + + + 258 + 16777215 + + + + Use your HTH Coins to Donate Today! + + + Qt::LeftToRight + + + Donate to Help The Homeless Worldwide! + + + + + @@ -1226,14 +1336,15 @@ - QValidatedLineEdit + BitcoinAmountField QLineEdit -
qvalidatedlineedit.h
+
bitcoinamountfield.h
+ 1
- BitcoinAmountField + QValidatedLineEdit QLineEdit -
bitcoinamountfield.h
+
qvalidatedlineedit.h
@@ -1248,8 +1359,6 @@ payAmount_s deleteButton_s - - - + diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 2a4416b8..d6a314ac 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -977,6 +977,17 @@ namespace GUIUtil { return strList.join(" "); } + std::string FROMQS(QString qs) +{ + std::string sOut = qs.toUtf8().constData(); + return sOut; +} + +QString TOQS(std::string s) +{ + QString str1 = QString::fromUtf8(s.c_str()); + return str1; +} QString formatServicesStr(quint64 mask) { diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 9e6aa271..24aaf89a 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -36,6 +36,9 @@ QT_END_NAMESPACE */ namespace GUIUtil { + QString TOQS(std::string s); + std::string FROMQS(QString qs); + // Create human-readable string from date QString dateTimeStr(const QDateTime &datetime); QString dateTimeStr(qint64 nTime); @@ -204,6 +207,7 @@ namespace GUIUtil /* Convert OS specific boost path to QString through UTF-8 */ QString boostPathToQString(const boost::filesystem::path &path); + /* Convert seconds into a QString with days, hours, mins, secs */ QString formatDurationStr(int secs); diff --git a/src/qt/proposaladddialog.cpp b/src/qt/proposaladddialog.cpp new file mode 100644 index 00000000..063761f4 --- /dev/null +++ b/src/qt/proposaladddialog.cpp @@ -0,0 +1,191 @@ +// Copyright (c) 2011-2015 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "proposaladddialog.h" +#include "ui_proposaladddialog.h" +#include "addressbookpage.h" +#include "addresstablemodel.h" +#include "bitcoinunits.h" +#include "guiutil.h" +#include "util.h" +#include "optionsmodel.h" +#include "timedata.h" +#include "platformstyle.h" +#include "receiverequestdialog.h" +#include "recentrequeststablemodel.h" +#include "governance.h" +#include "governance-vote.h" +#include "governance-classes.h" + +#include "walletmodel.h" +#include "validation.h" +/*#include "rpcpodc.h" +#include "rpcpog.h" */ +#include +#include +#include +#include +#include +#include + +ProposalAddDialog::ProposalAddDialog(const PlatformStyle *platformStyle, QWidget *parent) : + QDialog(parent), + ui(new Ui::ProposalAddDialog), + model(0), + platformStyle(platformStyle) +{ + ui->setupUi(this); + QString theme = GUIUtil::getThemeName(); + + if (!platformStyle->getImagesOnButtons()) { + ui->btnSubmit->setIcon(QIcon()); + } else { + ui->btnSubmit->setIcon(QIcon(":/icons/" + theme + "/receiving_addresses")); + } + + ui->cmbExpenseType->clear(); + ui->cmbExpenseType->addItem("Charity"); + ui->cmbExpenseType->addItem("PR"); + ui->cmbExpenseType->addItem("P2P"); + ui->cmbExpenseType->addItem("IT"); + } + + +void ProposalAddDialog::UpdateDisplay() +{ + int nNextHeight = CSuperblock(); + + std::string sInfo = "Note: Proposal Cost is 2500 " + CURRENCY_UNIT + ". Next Superblock at height: " + RoundToString(nNextHeight, 0) + "
Warning: You must unlock the wallet before submitting the proposal."; + + if (fProposalNeedsSubmitted) + { + sInfo += "
NOTE: You have a proposal waiting to be submitted.
Status: " + msProposalResult; + } + else if (!msProposalResult.empty()) + { + sInfo = "
NOTE: Your last proposal has been submitted.
Status: " + msProposalResult; + } + + ui->txtInfo->setText(GUIUtil::TOQS(sInfo)); +} + + +void ProposalAddDialog::setModel(WalletModel *model) +{ + this->model = model; + + if(model && model->getOptionsModel()) + { + UpdateDisplay(); + } +} + +ProposalAddDialog::~ProposalAddDialog() +{ + delete ui; +} + +void ProposalAddDialog::clear() +{ + ui->txtName->setText(""); + ui->txtURL->setText(""); + ui->txtAmount->setText(""); + ui->txtAddress->setText(""); +} + + +void ProposalAddDialog::on_btnSubmit_clicked() +{ + if(!model || !model->getOptionsModel()) + return; + std::string sName = GUIUtil::FROMQS(ui->txtName->text()); + std::string sAddress = GUIUtil::FROMQS(ui->txtAddress->text()); + std::string sAmount = GUIUtil::FROMQS(ui->txtAmount->text()); + std::string sURL = GUIUtil::FROMQS(ui->txtURL->text()); + std::string sError; + if (sName.length() < 3) sError += "Proposal Name must be populated. "; + CBitcoinAddress address(sAddress); + if (!address.IsValid()) sError += "Proposal Funding Address is invalid. "; + if (cdbl(sAmount,0) < 100) sError += "Proposal Amount is too low. "; + if (sURL.length() < 10) sError += "You must enter a discussion URL. "; + std::string sExpenseType = GUIUtil::FROMQS(ui->cmbExpenseType->currentText()); + if (sExpenseType.empty()) sError += "Expense Type must be chosen. "; + CAmount nBalance = GetRPCBalance(); + + if (fProposalNeedsSubmitted) + { + sError += "There is a proposal already being submitted (" + msProposalResult + "). Please wait until this proposal is sent before creating a new one. "; + } + else + { + if (nBalance < (2501*COIN)) sError += "Sorry balance too low to create proposal collateral. "; + } + + std::string sPrepareTxId; + std::string sHex; + int64_t unixStartTimestamp = GetAdjustedTime(); + int64_t unixEndTimestamp = GetAdjustedTime() + (60 * 60 * 24 * 30); + // Evo requires no spaces + sName = strReplace(sName, " ", "_"); + + if (sError.empty()) + { + // gobject prepare 0 1 EPOCH_TIME HEX + std::string sType = "1"; //Proposal + std::string sQ = "\""; + std::string sJson = "[[" + sQ + "proposal" + sQ + ",{"; + sJson += GJE("start_epoch", RoundToString(unixStartTimestamp, 0), true, false); + sJson += GJE("end_epoch", RoundToString(unixEndTimestamp, 0), true, false); + sJson += GJE("name", sName, true, true); + sJson += GJE("payment_address", sAddress, true, true); + sJson += GJE("payment_amount", sAmount, true, false); + sJson += GJE("type", sType, true, false); + sJson += GJE("expensetype", sExpenseType, true, true); + sJson += GJE("url", sURL, false, true); + sJson += "}]]"; + // make into hex + std::vector vchJson = std::vector(sJson.begin(), sJson.end()); + sHex = HexStr(vchJson.begin(), vchJson.end()); + // ASSEMBLE NEW GOVERNANCE OBJECT FROM USER PARAMETERS + uint256 hashParent = uint256(); + int nRevision = 1; + // CREATE A NEW COLLATERAL TRANSACTION FOR THIS SPECIFIC OBJECT + CGovernanceObject govobj(hashParent, nRevision, unixStartTimestamp, uint256(), sHex); + if((govobj.GetObjectType() == GOVERNANCE_OBJECT_TRIGGER) || (govobj.GetObjectType() == GOVERNANCE_OBJECT_WATCHDOG)) + { + sError = "Trigger and watchdog objects cannot be created from the UI yet."; + } + if (sError.empty()) + { + if(!govobj.IsValidLocally(sError, false)) + { + LogPrintf("Error while creating governance object %s, object not valid. Error: %s \n", sJson, sError); + sError += "Governance object is not valid - " + govobj.GetHash().ToString(); + } + + if (sError.empty()) + { + sPrepareTxId = CreateGovernanceCollateral(govobj.GetHash(), govobj.GetMinCollateralFee(), sError); + } + } + } + std::string sNarr = (sError.empty()) ? "Successfully Prepared Proposal " + sPrepareTxId + ". NOTE: You must wait 6 confirms for the proposal to be submitted. Please check back on this page periodically " + + " to ensure a successful transmission and that no error message is listed in the bottom area of the page. " + + "
WARNING: Do not shut down the core wallet until the proposal is submitted, otherwise you may lose your proposal submission and proposal collateral. " + +"

Thank you for using our Governance System." : sError; + if (sError.empty()) + { + // Set the proposal up to be submitted after 6 confirms using our Governance Service: + nProposalPrepareHeight = chainActive.Tip()->nHeight; + msProposalResult = "Submitting Proposal at height " + RoundToString(nProposalPrepareHeight + 6, 0) + "..."; + uTxIdFee = uint256S(sPrepareTxId); + nProposalStartTime = unixStartTimestamp; + msProposalHex = sHex; + fProposalNeedsSubmitted = true; + clear(); + } + QMessageBox::warning(this, tr("Proposal Add Result"), GUIUtil::TOQS(sNarr), QMessageBox::Ok, QMessageBox::Ok); + + UpdateDisplay(); +} diff --git a/src/qt/proposaladddialog.h b/src/qt/proposaladddialog.h new file mode 100644 index 00000000..56679642 --- /dev/null +++ b/src/qt/proposaladddialog.h @@ -0,0 +1,66 @@ +// Copyright (c) 2011-2015 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_QT_PROPOSALADDDIALOG_H +#define BITCOIN_QT_PROPOSALADDDIALOG_H + +#include "guiutil.h" + +#include +#include +#include +#include +#include +#include +#include + +class OptionsModel; +class PlatformStyle; +class WalletModel; + +namespace Ui { + class ProposalAddDialog; +} + +QT_BEGIN_NAMESPACE +class QModelIndex; +QT_END_NAMESPACE + +/** Dialog for Adding a Governance Proposal */ +class ProposalAddDialog : 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 ProposalAddDialog(const PlatformStyle *platformStyle, QWidget *parent = 0); + ~ProposalAddDialog(); + + void setModel(WalletModel *model); + void UpdateDisplay(); + +public Q_SLOTS: + void clear(); + +protected: + + +private: + Ui::ProposalAddDialog *ui; + GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; + WalletModel *model; + QMenu *contextMenu; + const PlatformStyle *platformStyle; + +private Q_SLOTS: + void on_btnSubmit_clicked(); +}; + +#endif // BITCOIN_QT_PROPOSALADDDIALOG_H diff --git a/src/qt/res/css/drkblue.css b/src/qt/res/css/drkblue.css index 6b775707..4209affb 100644 --- a/src/qt/res/css/drkblue.css +++ b/src/qt/res/css/drkblue.css @@ -2,10 +2,11 @@ /*************** GLOBAL STYLE*****************/ /****************************************************************************************/ + * { font-size: 12px; color: #34bcaa;; - } + } QMainWindow { @@ -433,7 +434,7 @@ font-weight: bold; } QComboBox:editable { - background:#977336; + background:#1e1d32; color:#34bcaa; border:0px solid transparent; } @@ -453,7 +454,7 @@ font-weight: bold; border-color: #4D458C; padding-right:1px; padding-left:1px; - color:#7E7E7E; + color:#debf12; } QComboBox QAbstractItemView::item { @@ -546,7 +547,7 @@ font-weight: bold; QAbstractSpinBox { border: 1px solid; padding: 3px 5px 3px 5px; - background: #1e1d32c; + background-color: #1e1d32c; min-height: 16px; color: #34bcaa; border-color: #1e1d32; @@ -746,6 +747,13 @@ QStatusBar QLabel { font-size:15px; } +QWidget .QFrame#frame_3 .QLine#lineSpendableBalance { + background-color: #debf12 !important; + } + +QWidget .QFrame#frame_3 .QLine#lineWatchBalance { + background-color: #debf12 !important; + } /*************** ########bottom status bar########*****************/ @@ -1073,6 +1081,17 @@ QStatusBar QLabel { } +/*** Donate Today **/ + + QStackedWidget#SendCoinsEntry .QFrame#frameDonate { + + border: 1px solid; + border-color: #4D458C; + + } + +/** End Donate Today **/ + /*************** ########scrollArea########*****************/ QDialog#SendCoinsDialog .QScrollArea#scrollArea .QWidget#scrollAreaWidgetContents { /* Send To Widget */ diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index ae9e9482..edbeb77d 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -52,8 +52,23 @@ SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *par connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); connect(ui->deleteButton_is, SIGNAL(clicked()), this, SLOT(deleteClicked())); connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked())); + connect(ui->chkDonate, SIGNAL(toggled(bool)), this, SLOT(updateFoundationAddress())); + } +void SendCoinsEntry::updateFoundationAddress() +{ + const CChainParams& chainparams = Params(); + bool bCheckedF = (ui->chkDonate->checkState() == Qt::Checked); + + if (bCheckedF) + { + ui->payTo->setText(GUIUtil::TOQS(chainparams.GetConsensus().FoundationPODSAddress)); + ui->payAmount->setFocus(); + } +} + + SendCoinsEntry::~SendCoinsEntry() { delete ui; @@ -172,6 +187,7 @@ SendCoinsRecipient SendCoinsEntry::getValue() recipient.amount = ui->payAmount->value(); recipient.message = ui->messageTextLabel->text(); recipient.fSubtractFeeFromAmount = (ui->checkboxSubtractFeeFromAmount->checkState() == Qt::Checked); + recipient.fDonate = (ui->chkDonate->checkState() == Qt::Checked); return recipient; } @@ -186,6 +202,7 @@ QWidget *SendCoinsEntry::setupTabChain(QWidget *prev) QWidget::setTabOrder(ui->addressBookButton, ui->pasteButton); QWidget::setTabOrder(ui->pasteButton, ui->deleteButton); return ui->deleteButton; + } void SendCoinsEntry::setValue(const SendCoinsRecipient &value) diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h index a8be670c..6671b13e 100644 --- a/src/qt/sendcoinsentry.h +++ b/src/qt/sendcoinsentry.h @@ -60,6 +60,7 @@ private Q_SLOTS: void on_addressBookButton_clicked(); void on_pasteButton_clicked(); void updateDisplayUnit(); + void updateFoundationAddress(); private: SendCoinsRecipient recipient; diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index 6abc45c3..b99e5221 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -108,6 +108,7 @@ void WalletFrame::showOutOfSyncWarning(bool fShow) i.value()->showOutOfSyncWarning(fShow); } + void WalletFrame::gotoGovernancePage() { QMap::const_iterator i; diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 095c94a1..83c262f4 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -58,6 +58,10 @@ class SendCoinsRecipient CAmount amount; // If from a payment request, this is used for storing the memo QString message; + + // DAC message or prayer + QString txtMessage; + bool fDonate; // If from a payment request, paymentRequest.IsInitialized() will be true PaymentRequestPlus paymentRequest; diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index eb5e886f..b2453611 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -70,18 +70,21 @@ WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent): hbox_buttons->addWidget(exportButton); vbox->addLayout(hbox_buttons); transactionsPage->setLayout(vbox); - + receiveCoinsPage = new ReceiveCoinsDialog(platformStyle); sendCoinsPage = new SendCoinsDialog(platformStyle); + usedSendingAddressesPage = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::SendingTab, this); usedReceivingAddressesPage = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this); + addWidget(overviewPage); addWidget(transactionsPage); addWidget(receiveCoinsPage); addWidget(sendCoinsPage); - addWidget(overviewAPage); + addWidget(overviewAPage); + QSettings settings; if (!fLiteMode && settings.value("fShowMasternodesTab").toBool()) { @@ -173,8 +176,10 @@ void WalletView::setWalletModel(WalletModel *_walletModel) governanceListPage->setWalletModel(_walletModel); receiveCoinsPage->setModel(_walletModel); sendCoinsPage->setModel(_walletModel); + proposalAddPage->setModel(_walletModel); usedReceivingAddressesPage->setModel(_walletModel->getAddressTableModel()); usedSendingAddressesPage->setModel(_walletModel->getAddressTableModel()); + if (_walletModel) { @@ -229,6 +234,7 @@ void WalletView::processNewTransaction(const QModelIndex& parent, int start, int Q_EMIT incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address, label); } + void WalletView::gotoGovernancePage() { QSettings settings; diff --git a/src/qt/walletview.h b/src/qt/walletview.h index 87292592..019921ff 100644 --- a/src/qt/walletview.h +++ b/src/qt/walletview.h @@ -27,6 +27,7 @@ class GovernancePage; + QT_BEGIN_NAMESPACE class QLabel; class QModelIndex; @@ -74,7 +75,7 @@ class WalletView : public QStackedWidget MasternodeList *masternodeListPage; OverviewAPage *overviewAPage; GovernanceList *governanceListPage; - + TransactionView *transactionView; QProgressDialog *progressDialog; @@ -83,6 +84,7 @@ class WalletView : public QStackedWidget public Q_SLOTS: + /** Switch to governance page */ void gotoGovernancePage(); /** Switch to private send page */ diff --git a/src/validation.h b/src/validation.h index 083dfaf4..47ec4e18 100644 --- a/src/validation.h +++ b/src/validation.h @@ -292,6 +292,7 @@ double ConvertBitsToDouble(unsigned int nBits); CAmount GetBlockSubsidy(int nBits, int nHeight, const Consensus::Params& consensusParams, bool fSuperblockPartOnly = false); CAmount GetMasternodePayment(int nHeight, CAmount blockValue); CAmount GetDevelopersPayment(int nHeight, CAmount blockValue); +CAmount GetBlockSubsidy(int nHeight, CAmount blockValue); /** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */ double GuessVerificationProgress(const ChainTxData& data, CBlockIndex* pindex); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index ef17e23d..49026792 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -174,6 +174,12 @@ struct CRecipient CScript scriptPubKey; CAmount nAmount; bool fSubtractFeeFromAmount; + // DAC: + + bool fDonate; + + std::string txtMessage; + // END OF DAC }; typedef std::map mapValue_t;