@ -10,26 +10,17 @@
# include "addressbookpage.h"
# include "addressbookpage.h"
# include "sendcoinsdialog.h"
# include "sendcoinsdialog.h"
# include "signverifymessagedialog.h"
# include "signverifymessagedialog.h"
# include "optionsdialog.h"
# include "aboutdialog.h"
# include "clientmodel.h"
# include "clientmodel.h"
# include "walletmodel.h"
# include "walletmodel.h"
# include "editaddressdialog.h"
# include "optionsmodel.h"
# include "optionsmodel.h"
# include "transactiondescdialog.h"
# include "addresstablemodel.h"
# include "transactionview.h"
# include "transactionview.h"
# include "overviewpage.h"
# include "overviewpage.h"
# include "bitcoinunits.h"
# include "guiconstants.h"
# include "askpassphrasedialog.h"
# include "askpassphrasedialog.h"
# include "guiutil.h"
# include "ui_interface.h"
# include "ui_interface.h"
# include <QVBoxLayout>
# include <QVBoxLayout>
# include <QActionGroup>
# include <QActionGroup>
# include <QAction>
# include <QAction>
# include <QLabel>
# include <QDesktopServices>
# include <QDesktopServices>
# include <QFileDialog>
# include <QFileDialog>
@ -37,13 +28,8 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
QStackedWidget ( parent ) ,
QStackedWidget ( parent ) ,
gui ( _gui ) ,
gui ( _gui ) ,
clientModel ( 0 ) ,
clientModel ( 0 ) ,
walletModel ( 0 ) ,
walletModel ( 0 )
encryptWalletAction ( 0 ) ,
changePassphraseAction ( 0 )
{
{
// Create actions for the toolbar, menu bar and tray/dock icon
createActions ( ) ;
// Create tabs
// Create tabs
overviewPage = new OverviewPage ( ) ;
overviewPage = new OverviewPage ( ) ;
@ -88,74 +74,6 @@ WalletView::~WalletView()
{
{
}
}
void WalletView : : createActions ( )
{
QActionGroup * tabGroup = new QActionGroup ( this ) ;
overviewAction = new QAction ( QIcon ( " :/icons/overview " ) , tr ( " &Overview " ) , this ) ;
overviewAction - > setStatusTip ( tr ( " Show general overview of wallet " ) ) ;
overviewAction - > setToolTip ( overviewAction - > statusTip ( ) ) ;
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 - > setStatusTip ( tr ( " Send coins to a Bitcoin address " ) ) ;
sendCoinsAction - > setToolTip ( sendCoinsAction - > statusTip ( ) ) ;
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 - > setStatusTip ( tr ( " Show the list of addresses for receiving payments " ) ) ;
receiveCoinsAction - > setToolTip ( receiveCoinsAction - > statusTip ( ) ) ;
receiveCoinsAction - > setCheckable ( true ) ;
receiveCoinsAction - > setShortcut ( QKeySequence ( Qt : : ALT + Qt : : Key_3 ) ) ;
tabGroup - > addAction ( receiveCoinsAction ) ;
historyAction = new QAction ( QIcon ( " :/icons/history " ) , tr ( " &Transactions " ) , this ) ;
historyAction - > setStatusTip ( tr ( " Browse transaction history " ) ) ;
historyAction - > setToolTip ( historyAction - > statusTip ( ) ) ;
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 - > setStatusTip ( tr ( " Edit the list of stored addresses and labels " ) ) ;
addressBookAction - > setToolTip ( addressBookAction - > statusTip ( ) ) ;
addressBookAction - > setCheckable ( true ) ;
addressBookAction - > setShortcut ( QKeySequence ( Qt : : ALT + Qt : : Key_5 ) ) ;
tabGroup - > addAction ( addressBookAction ) ;
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 ( ) ) ) ;
encryptWalletAction = new QAction ( QIcon ( " :/icons/lock_closed " ) , tr ( " &Encrypt Wallet... " ) , this ) ;
encryptWalletAction - > setStatusTip ( tr ( " Encrypt the private keys that belong to your wallet " ) ) ;
encryptWalletAction - > setCheckable ( true ) ;
backupWalletAction = new QAction ( QIcon ( " :/icons/filesave " ) , tr ( " &Backup Wallet... " ) , this ) ;
backupWalletAction - > setStatusTip ( tr ( " Backup wallet to another location " ) ) ;
changePassphraseAction = new QAction ( QIcon ( " :/icons/key " ) , tr ( " &Change Passphrase... " ) , this ) ;
changePassphraseAction - > setStatusTip ( tr ( " Change the passphrase used for wallet encryption " ) ) ;
signMessageAction = new QAction ( QIcon ( " :/icons/edit " ) , tr ( " Sign &message... " ) , this ) ;
signMessageAction - > setStatusTip ( tr ( " Sign messages with your Bitcoin addresses to prove you own them " ) ) ;
verifyMessageAction = new QAction ( QIcon ( " :/icons/transaction_0 " ) , tr ( " &Verify message... " ) , this ) ;
verifyMessageAction - > setStatusTip ( tr ( " Verify messages to ensure they were signed with specified Bitcoin addresses " ) ) ;
exportAction = new QAction ( QIcon ( " :/icons/export " ) , tr ( " &Export... " ) , this ) ;
exportAction - > setStatusTip ( tr ( " Export the data in the current tab to a file " ) ) ;
exportAction - > setToolTip ( exportAction - > statusTip ( ) ) ;
connect ( encryptWalletAction , SIGNAL ( triggered ( bool ) ) , this , SLOT ( encryptWallet ( bool ) ) ) ;
connect ( backupWalletAction , SIGNAL ( triggered ( ) ) , this , SLOT ( backupWallet ( ) ) ) ;
connect ( changePassphraseAction , SIGNAL ( triggered ( ) ) , this , SLOT ( changePassphrase ( ) ) ) ;
connect ( signMessageAction , SIGNAL ( triggered ( ) ) , this , SLOT ( gotoSignMessageTab ( ) ) ) ;
connect ( verifyMessageAction , SIGNAL ( triggered ( ) ) , this , SLOT ( gotoVerifyMessageTab ( ) ) ) ;
}
void WalletView : : setBitcoinGUI ( BitcoinGUI * gui )
void WalletView : : setBitcoinGUI ( BitcoinGUI * gui )
{
{
this - > gui = gui ;
this - > gui = gui ;
@ -222,50 +140,50 @@ void WalletView::incomingTransaction(const QModelIndex& parent, int start, int /
void WalletView : : gotoOverviewPage ( )
void WalletView : : gotoOverviewPage ( )
{
{
o verviewAction- > setChecked ( true ) ;
gui - > getO verviewAction( ) - > setChecked ( true ) ;
setCurrentWidget ( overviewPage ) ;
setCurrentWidget ( overviewPage ) ;
exportAction - > setEnabled ( false ) ;
gui - > g etE xportAction( ) - > setEnabled ( false ) ;
disconnect ( exportAction , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
disconnect ( gui - > g etE xportAction( ) , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
}
}
void WalletView : : gotoHistoryPage ( )
void WalletView : : gotoHistoryPage ( )
{
{
historyAction - > setChecked ( true ) ;
gui - > getHistoryAction ( ) - > setChecked ( true ) ;
setCurrentWidget ( transactionsPage ) ;
setCurrentWidget ( transactionsPage ) ;
exportAction - > setEnabled ( true ) ;
gui - > g etE xportAction( ) - > setEnabled ( true ) ;
disconnect ( exportAction , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
disconnect ( gui - > g etE xportAction( ) , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
connect ( exportAction , SIGNAL ( triggered ( ) ) , transactionView , SLOT ( exportClicked ( ) ) ) ;
connect ( gui - > g etE xportAction( ) , SIGNAL ( triggered ( ) ) , transactionView , SLOT ( exportClicked ( ) ) ) ;
}
}
void WalletView : : gotoAddressBookPage ( )
void WalletView : : gotoAddressBookPage ( )
{
{
a ddressBookAction- > setChecked ( true ) ;
gui - > getA ddressBookAction( ) - > setChecked ( true ) ;
setCurrentWidget ( addressBookPage ) ;
setCurrentWidget ( addressBookPage ) ;
exportAction - > setEnabled ( true ) ;
gui - > g etE xportAction( ) - > setEnabled ( true ) ;
disconnect ( exportAction , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
disconnect ( gui - > g etE xportAction( ) , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
connect ( exportAction , SIGNAL ( triggered ( ) ) , addressBookPage , SLOT ( exportClicked ( ) ) ) ;
connect ( gui - > g etE xportAction( ) , SIGNAL ( triggered ( ) ) , addressBookPage , SLOT ( exportClicked ( ) ) ) ;
}
}
void WalletView : : gotoReceiveCoinsPage ( )
void WalletView : : gotoReceiveCoinsPage ( )
{
{
receiveCoinsAction - > setChecked ( true ) ;
gui - > getReceiveCoinsAction ( ) - > setChecked ( true ) ;
setCurrentWidget ( receiveCoinsPage ) ;
setCurrentWidget ( receiveCoinsPage ) ;
exportAction - > setEnabled ( true ) ;
gui - > g etE xportAction( ) - > setEnabled ( true ) ;
disconnect ( exportAction , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
disconnect ( gui - > g etE xportAction( ) , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
connect ( exportAction , SIGNAL ( triggered ( ) ) , receiveCoinsPage , SLOT ( exportClicked ( ) ) ) ;
connect ( gui - > g etE xportAction( ) , SIGNAL ( triggered ( ) ) , receiveCoinsPage , SLOT ( exportClicked ( ) ) ) ;
}
}
void WalletView : : gotoSendCoinsPage ( QString addr )
void WalletView : : gotoSendCoinsPage ( QString addr )
{
{
s endCoinsAction- > setChecked ( true ) ;
gui - > getS endCoinsAction( ) - > setChecked ( true ) ;
setCurrentWidget ( sendCoinsPage ) ;
setCurrentWidget ( sendCoinsPage ) ;
exportAction - > setEnabled ( false ) ;
gui - > g etE xportAction( ) - > setEnabled ( false ) ;
disconnect ( exportAction , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
disconnect ( gui - > g etE xportAction( ) , SIGNAL ( triggered ( ) ) , 0 , 0 ) ;
if ( ! addr . isEmpty ( ) )
if ( ! addr . isEmpty ( ) )
sendCoinsPage - > setAddress ( addr ) ;
sendCoinsPage - > setAddress ( addr ) ;