diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index fd71a70b..e939054a 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -139,6 +139,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
prevBlocks(0),
spinnerFrame(0),
governanceAction(0),
+ externalDonate(0),
platformStyle(_platformStyle)
{
/* Open CSS when configured */
@@ -595,6 +596,11 @@ void BitcoinGUI::createActions()
showPrivateSendHelpAction->setStatusTip(tr("Show the PrivateSend basic information"));
+ // HTHW Donate
+ externalDonate = new QAction(QIcon(":/icons/" + theme + "/about"), tr("Donate To HTHW"), this);
+ externalDonate->setStatusTip(tr("Donate to Help The Homeless Worldwide"));
+
+
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
@@ -603,6 +609,10 @@ void BitcoinGUI::createActions()
connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked()));
connect(showPrivateSendHelpAction, SIGNAL(triggered()), this, SLOT(showPrivateSendHelpClicked()));
+
+ // HTHW Donate
+ connect(externalDonate, SIGNAL(triggered()), this, SLOT(openDonate()));
+
// Jump directly to tabs in RPC-console
connect(openInfoAction, SIGNAL(triggered()), this, SLOT(showInfo()));
connect(openRPCConsoleAction, SIGNAL(triggered()), this, SLOT(showConsole()));
@@ -693,6 +703,8 @@ void BitcoinGUI::createMenuBar()
}
+ QMenu* donate = appMenuBar->addMenu(tr("&HTHW Donate"));
+ donate->addAction(externalDonate);
QMenu *help = appMenuBar->addMenu(tr("&Help"));
help->addAction(showHelpMessageAction);
@@ -1024,6 +1036,23 @@ void BitcoinGUI::openClicked()
}
}
+void BitcoinGUI::openDonate()
+{
+ openExternalURL("https://helpthehomelessworldwide.org/donate");
+}
+
+void BitcoinGUI::openExternalURL(QString url)
+{
+ QMessageBox::StandardButton reply = QMessageBox::question(this, tr("Notice – External Link"),
+ QStringLiteral("This action will open up the following website in your default browser:
HTH PayPal Donation Page
To continue, hit your Enter key or press Ok.
Remember, never share your personal information or private keys on any social website.").arg(url),
+ QMessageBox::Cancel | QMessageBox::Ok,
+ QMessageBox::Ok);
+
+ if (reply == QMessageBox::Ok) {
+ QDesktopServices::openUrl(QUrl(url));
+ }
+}
+
void BitcoinGUI::gotoGovernancePage()
{
governanceAction->setChecked(true);
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 27f45d5e..0763d909 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -103,6 +103,7 @@ class BitcoinGUI : public QMainWindow
QMenuBar *appMenuBar;
+ QAction* externalDonate;
QAction *governanceAction;
QAction* overviewaAction;
QAction *overviewAction;
@@ -259,6 +260,9 @@ private Q_SLOTS:
void aboutClicked();
/** Show debug window */
void showDebugWindow();
+ /** Open external URL */
+ void openDonate();
+ void openExternalURL(QString url = "");
/** Show debug window and set focus to the appropriate tab */
void showInfo();
diff --git a/src/qt/forms/sendcoinsentry.ui b/src/qt/forms/sendcoinsentry.ui
index ba3efcdc..2a2f2e73 100644
--- a/src/qt/forms/sendcoinsentry.ui
+++ b/src/qt/forms/sendcoinsentry.ui
@@ -268,7 +268,7 @@
- 260
+ 10
10
291
31
@@ -302,6 +302,57 @@
+
+
+
+ 380
+ 10
+ 120
+ 30
+
+
+
+
+ 100
+ 30
+
+
+
+
+ 120
+ 30
+
+
+
+ Visit Help The Homeless Coin Explorer and Track Your HTH Coins
+
+
+ border-style: solid;
+border-width: 2px;
+border-color: #34bcaa;
+border-radius: 10px;
+font-size: 11px;
+
+
+ HTH PayPal
+
+
+
+
+
+ 510
+ 15
+ 161
+ 21
+
+
+
+ Donate using PayPal!
+
+
+ Qt::AlignCenter
+
+
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp
index edbeb77d..bf11631b 100644
--- a/src/qt/sendcoinsentry.cpp
+++ b/src/qt/sendcoinsentry.cpp
@@ -15,6 +15,7 @@
#include
#include
+#include
SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) :
QStackedWidget(parent),
@@ -285,3 +286,10 @@ bool SendCoinsEntry::updateLabel(const QString &address)
return false;
}
+
+
+void SendCoinsEntry::on_pushButton_Donate_clicked() { // HTH Partners
+
+ QDesktopServices::openUrl(QUrl("https://www.paypal.com/donate/?token=FobylA07oFyKxjbW63UkRTP5eZETbFORbodTooL86A-C7cAfVJOUE-MBCM2dM80l_sBm00&country.x=US&locale.x=US", QUrl::TolerantMode));
+
+}
diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h
index 6671b13e..35b76f3c 100644
--- a/src/qt/sendcoinsentry.h
+++ b/src/qt/sendcoinsentry.h
@@ -61,6 +61,7 @@ private Q_SLOTS:
void on_pasteButton_clicked();
void updateDisplayUnit();
void updateFoundationAddress();
+ void on_pushButton_Donate_clicked();
private:
SendCoinsRecipient recipient;