Skip to content

Commit

Permalink
Merge pull request #6594
Browse files Browse the repository at this point in the history
5ffaaba Disallow duplicate windows. (Casey Rodarmor)
  • Loading branch information
laanwj committed Sep 8, 2015
2 parents 1d133d9 + 5ffaaba commit 878ea69
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/qt/bitcoingui.cpp
Expand Up @@ -97,6 +97,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
trayIconMenu(0), trayIconMenu(0),
notificator(0), notificator(0),
rpcConsole(0), rpcConsole(0),
helpMessageDialog(0),
prevBlocks(0), prevBlocks(0),
spinnerFrame(0), spinnerFrame(0),
platformStyle(platformStyle) platformStyle(platformStyle)
Expand Down Expand Up @@ -132,6 +133,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
#endif #endif


rpcConsole = new RPCConsole(platformStyle, 0); rpcConsole = new RPCConsole(platformStyle, 0);
helpMessageDialog = new HelpMessageDialog(this, false);
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if(enableWallet) if(enableWallet)
{ {
Expand Down Expand Up @@ -590,9 +592,7 @@ void BitcoinGUI::aboutClicked()


void BitcoinGUI::showHelpMessageClicked() void BitcoinGUI::showHelpMessageClicked()
{ {
HelpMessageDialog *help = new HelpMessageDialog(this, false); helpMessageDialog->show();
help->setAttribute(Qt::WA_DeleteOnClose);
help->show();
} }


#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
Expand Down
2 changes: 2 additions & 0 deletions src/qt/bitcoingui.h
Expand Up @@ -28,6 +28,7 @@ class SendCoinsRecipient;
class UnitDisplayStatusBarControl; class UnitDisplayStatusBarControl;
class WalletFrame; class WalletFrame;
class WalletModel; class WalletModel;
class HelpMessageDialog;


class CWallet; class CWallet;


Expand Down Expand Up @@ -113,6 +114,7 @@ class BitcoinGUI : public QMainWindow
QMenu *trayIconMenu; QMenu *trayIconMenu;
Notificator *notificator; Notificator *notificator;
RPCConsole *rpcConsole; RPCConsole *rpcConsole;
HelpMessageDialog *helpMessageDialog;


/** Keep track of previous number of blocks, to detect progress */ /** Keep track of previous number of blocks, to detect progress */
int prevBlocks; int prevBlocks;
Expand Down
21 changes: 13 additions & 8 deletions src/qt/walletview.cpp
Expand Up @@ -56,6 +56,9 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent):
receiveCoinsPage = new ReceiveCoinsDialog(platformStyle); receiveCoinsPage = new ReceiveCoinsDialog(platformStyle);
sendCoinsPage = new SendCoinsDialog(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(overviewPage);
addWidget(transactionsPage); addWidget(transactionsPage);
addWidget(receiveCoinsPage); addWidget(receiveCoinsPage);
Expand Down Expand Up @@ -115,6 +118,8 @@ void WalletView::setWalletModel(WalletModel *walletModel)
overviewPage->setWalletModel(walletModel); overviewPage->setWalletModel(walletModel);
receiveCoinsPage->setModel(walletModel); receiveCoinsPage->setModel(walletModel);
sendCoinsPage->setModel(walletModel); sendCoinsPage->setModel(walletModel);
usedReceivingAddressesPage->setModel(walletModel->getAddressTableModel());
usedSendingAddressesPage->setModel(walletModel->getAddressTableModel());


if (walletModel) if (walletModel)
{ {
Expand Down Expand Up @@ -273,20 +278,20 @@ void WalletView::usedSendingAddresses()
{ {
if(!walletModel) if(!walletModel)
return; return;
AddressBookPage *dlg = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::SendingTab, this);
dlg->setAttribute(Qt::WA_DeleteOnClose); usedSendingAddressesPage->show();
dlg->setModel(walletModel->getAddressTableModel()); usedSendingAddressesPage->raise();
dlg->show(); usedSendingAddressesPage->activateWindow();
} }


void WalletView::usedReceivingAddresses() void WalletView::usedReceivingAddresses()
{ {
if(!walletModel) if(!walletModel)
return; return;
AddressBookPage *dlg = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this);
dlg->setAttribute(Qt::WA_DeleteOnClose); usedReceivingAddressesPage->show();
dlg->setModel(walletModel->getAddressTableModel()); usedReceivingAddressesPage->raise();
dlg->show(); usedReceivingAddressesPage->activateWindow();
} }


void WalletView::showProgress(const QString &title, int nProgress) void WalletView::showProgress(const QString &title, int nProgress)
Expand Down
3 changes: 3 additions & 0 deletions src/qt/walletview.h
Expand Up @@ -18,6 +18,7 @@ class SendCoinsDialog;
class SendCoinsRecipient; class SendCoinsRecipient;
class TransactionView; class TransactionView;
class WalletModel; class WalletModel;
class AddressBookPage;


QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QModelIndex; class QModelIndex;
Expand Down Expand Up @@ -61,6 +62,8 @@ class WalletView : public QStackedWidget
QWidget *transactionsPage; QWidget *transactionsPage;
ReceiveCoinsDialog *receiveCoinsPage; ReceiveCoinsDialog *receiveCoinsPage;
SendCoinsDialog *sendCoinsPage; SendCoinsDialog *sendCoinsPage;
AddressBookPage *usedSendingAddressesPage;
AddressBookPage *usedReceivingAddressesPage;


TransactionView *transactionView; TransactionView *transactionView;


Expand Down

0 comments on commit 878ea69

Please sign in to comment.