X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fqt%2Fbitcoingui.cpp;h=5db27fe744d3c03225db01a4467919c04481da25;hp=d7bc45857058d01a4c59c8c07b550eb66461842d;hb=91c0b9419a644cb6f72d05711fcfec5aeb348f3f;hpb=c1d5ebeb9f92b2248063ea0415f1d5564386c06d diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index d7bc458..5db27fe 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -26,6 +26,7 @@ #include "guiutil.h" #include "ui_interface.h" #include "rpcconsole.h" +#include "mintingview.h" #ifdef Q_OS_MAC #include "macdockiconhandler.h" @@ -116,6 +117,12 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); + mintingPage = new QWidget(this); + QVBoxLayout *vboxMinting = new QVBoxLayout(); + mintingView = new MintingView(this); + vboxMinting->addWidget(mintingView); + mintingPage->setLayout(vboxMinting); + addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); @@ -127,6 +134,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); + centralWidget->addWidget(mintingPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); @@ -234,10 +242,16 @@ void BitcoinGUI::createActions() historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); + mintingAction = new QAction(QIcon(":/icons/history"), tr("&Minting"), this); + mintingAction->setToolTip(tr("Show your minting capacity")); + mintingAction->setCheckable(true); + mintingAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); + tabGroup->addAction(mintingAction); + addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this); addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setCheckable(true); - addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); + addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6)); tabGroup->addAction(addressBookAction); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); @@ -248,6 +262,8 @@ void BitcoinGUI::createActions() connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); + connect(mintingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); + connect(mintingAction, SIGNAL(triggered()), this, SLOT(gotoMintingPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); @@ -363,6 +379,7 @@ void BitcoinGUI::createToolBars() toolbar->addAction(sendCoinsAction); toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); + toolbar->addAction(mintingAction); toolbar->addAction(addressBookAction); QToolBar *toolbar2 = addToolBar(tr("Actions toolbar")); @@ -422,6 +439,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) // Put transaction list in tabs transactionView->setModel(walletModel); + mintingView->setModel(walletModel); overviewPage->setModel(walletModel); addressBookPage->setModel(walletModel->getAddressTableModel()); @@ -845,6 +863,17 @@ void BitcoinGUI::gotoHistoryPage() connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked())); } +void BitcoinGUI::gotoMintingPage() +{ + mintingAction->setChecked(true); + centralWidget->setCurrentWidget(mintingPage); + + exportAction->setEnabled(true); + disconnect(exportAction, SIGNAL(triggered()), 0, 0); + connect(exportAction, SIGNAL(triggered()), mintingView, SLOT(exportClicked())); +} + + void BitcoinGUI::gotoAddressBookPage() { addressBookAction->setChecked(true);