Permalink
Browse files

Embed S4C as gui widget

  • Loading branch information...
Tranz5 committed Aug 31, 2014
1 parent c485f39 commit 05625df83bcae0b4bb9d52773957cf2480bf5654
View
@@ -263,6 +263,13 @@ void BitcoinGUI::createActions()
blockAction->setCheckable(true);
tabGroup->addAction(blockAction);
charityAction = new QAction(QIcon(":/icons/send"), tr("Stake For &Charity"), this);
charityAction->setStatusTip(tr("Enable Stake For Charity"));
charityAction->setToolTip(charityAction->statusTip());
charityAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
charityAction->setCheckable(true);
tabGroup->addAction(charityAction);
blocksIconAction = new QAction(QIcon(""), tr("Current &Block Info"), this);
blocksIconAction->setStatusTip(tr("Get Current Block Information"));
blocksIconAction->setToolTip(blocksIconAction->statusTip());
@@ -311,9 +318,7 @@ void BitcoinGUI::createActions()
aboutAction->setStatusTip(tr("Show information about HoboNickels"));
aboutAction->setMenuRole(QAction::AboutRole);
charityAction = new QAction(QIcon(":/icons/send"), tr("Stake For &Charity"), this);
charityAction->setStatusTip(tr("Enable Stake For Charity"));
charityAction->setToolTip(charityAction->statusTip());
aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this);
aboutQtAction->setStatusTip(tr("Show information about Qt"));
@@ -463,6 +468,7 @@ void BitcoinGUI::createToolBars()
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(charityAction);
QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
View
@@ -18,6 +18,7 @@ class SignVerifyMessageDialog;
class Notificator;
class RPCConsole;
class BlockBrowser;
class StakeForCharityDialog;
class CWallet;
class CWalletManager;
@@ -73,6 +74,8 @@ class BitcoinGUI : public QMainWindow
ClientModel *clientModel;
CWalletManager *walletManager;
BlockBrowser *blockBrowser;
StakeForCharityDialog *stakeForCharityDialog;
QMap<QString, WalletModel*> mapWalletModels;
QListWidget *walletList;
WalletStack *walletStack;
View
@@ -8,7 +8,7 @@
StakeForCharityDialog::StakeForCharityDialog(QWidget *parent) :
QDialog(parent),
QWidget(parent),
ui(new Ui::StakeForCharityDialog),
model(0)
{
@@ -125,8 +125,3 @@ void StakeForCharityDialog::on_disableButton_clicked()
ui->message->setText(tr("Stake for Charity is now off"));
return;
}
void StakeForCharityDialog::on_closeButton_clicked()
{
close();
}
View
@@ -1,7 +1,7 @@
#ifndef CHARITYDIALOG_H
#define CHARITYDIALOG_H
#include <QDialog>
#include <QWidget>
namespace Ui {
class StakeForCharityDialog;
@@ -11,7 +11,7 @@ class WalletModel;
QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
class StakeForCharityDialog : public QDialog
class StakeForCharityDialog : public QWidget
{
Q_OBJECT
@@ -24,7 +24,6 @@ class StakeForCharityDialog : public QDialog
private slots:
void on_enableButton_clicked();
void on_disableButton_clicked();
void on_closeButton_clicked();
void on_addressBookButton_clicked();
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StakeForCharityDialog</class>
<widget class="QDialog" name="StakeForCharityDialog">
<widget class="QWidget" name="StakeForCharityDialog">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
@@ -136,7 +139,7 @@ Please enter percentage to give and HoboNickels address to give to. Min and Max
<widget class="QPushButton" name="disableButton">
<property name="geometry">
<rect>
<x>120</x>
<x>160</x>
<y>240</y>
<width>75</width>
<height>23</height>
@@ -149,19 +152,6 @@ Please enter percentage to give and HoboNickels address to give to. Min and Max
<string>Disable</string>
</property>
</widget>
<widget class="QPushButton" name="closeButton">
<property name="geometry">
<rect>
<x>220</x>
<y>240</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
<widget class="QPushButton" name="addressBookButton">
<property name="geometry">
<rect>
View
@@ -211,8 +211,9 @@ void WalletStack::unlockWalletForMint()
void WalletStack::charityClicked(QString addr)
{
WalletView *walletView = (WalletView*)currentWidget();
if (walletView) walletView->charityClicked(addr);
QMap<QString, WalletView*>::const_iterator i;
for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)
i.value()->charityClicked(addr);
}
void WalletStack::setEncryptionStatus()
View
@@ -24,6 +24,7 @@ class SignVerifyMessageDialog;
class Notificator;
class RPCConsole;
class BlockBrowser;
class StakeForCharityDialog;
class CWalletManager;
View
@@ -71,14 +71,16 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
signVerifyMessageDialog = new SignVerifyMessageDialog(gui);
stakeForCharityDialog = new StakeForCharityDialog(gui);
stakeForCharityDialog = new StakeForCharityDialog(this);
addWidget(overviewPage);
addWidget(transactionsPage);
addWidget(addressBookPage);
addWidget(receiveCoinsPage);
addWidget(sendCoinsPage);
addWidget(blockBrowser);
addWidget(stakeForCharityDialog);
// Clicking on a transaction on the overview page simply sends you to transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui, SLOT(gotoHistoryPage()));
@@ -147,12 +149,21 @@ void WalletView::createActions()
blockAction->setCheckable(true);
tabGroup->addAction(blockAction);
charityAction = new QAction(QIcon(":/icons/send"), tr("Stake For &Charity"), this);
charityAction->setStatusTip(tr("Enable Stake For Charity"));
charityAction->setToolTip(charityAction->statusTip());
charityAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
charityAction->setCheckable(true);
tabGroup->addAction(charityAction);
connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockBrowser()));
connect(charityAction, SIGNAL(triggered()), this, SLOT(charityClicked()));
encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this);
encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet"));
@@ -670,10 +681,13 @@ void WalletView::unlockWalletForMint()
void WalletView::charityClicked(QString addr)
{
stakeForCharityDialog->show();
charityAction->setChecked(true);
setCurrentWidget(stakeForCharityDialog);
if(!addr.isEmpty())
stakeForCharityDialog->setAddress(addr);
gui->exportAction->setEnabled(false);
disconnect(gui->exportAction, SIGNAL(triggered()), 0, 0);
}
void WalletView::getStakeWeight(uint64& nMinWeight, uint64& nMaxWeight, uint64& nWeight)
View
@@ -100,6 +100,7 @@ class WalletView : public QStackedWidget
QAction *aboutQtAction;
QAction *openRPCConsoleAction;
QAction *blockAction;
QAction *charityAction;
TransactionView *transactionView;
@@ -151,7 +152,7 @@ public slots:
void lockWallet();
/** Ask for passphrase to unlock wallet for the session to mint */
void unlockWalletForMint();
void charityClicked(QString addr);
void charityClicked(QString addr = "");
void setEncryptionStatus();
/** Add up all loaded wallets and show total balance */

0 comments on commit 05625df

Please sign in to comment.