Browse Source

Disallow duplicate windows.

pull/1/head
Casey Rodarmor 7 years ago
parent
commit
5ffaaba3a1
  1. 6
      src/qt/bitcoingui.cpp
  2. 2
      src/qt/bitcoingui.h
  3. 21
      src/qt/walletview.cpp
  4. 3
      src/qt/walletview.h

6
src/qt/bitcoingui.cpp

@ -97,6 +97,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n @@ -97,6 +97,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
trayIconMenu(0),
notificator(0),
rpcConsole(0),
helpMessageDialog(0),
prevBlocks(0),
spinnerFrame(0),
platformStyle(platformStyle)
@ -132,6 +133,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n @@ -132,6 +133,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
#endif
rpcConsole = new RPCConsole(platformStyle, 0);
helpMessageDialog = new HelpMessageDialog(this, false);
#ifdef ENABLE_WALLET
if(enableWallet)
{
@ -590,9 +592,7 @@ void BitcoinGUI::aboutClicked() @@ -590,9 +592,7 @@ void BitcoinGUI::aboutClicked()
void BitcoinGUI::showHelpMessageClicked()
{
HelpMessageDialog *help = new HelpMessageDialog(this, false);
help->setAttribute(Qt::WA_DeleteOnClose);
help->show();
helpMessageDialog->show();
}
#ifdef ENABLE_WALLET

2
src/qt/bitcoingui.h

@ -28,6 +28,7 @@ class SendCoinsRecipient; @@ -28,6 +28,7 @@ class SendCoinsRecipient;
class UnitDisplayStatusBarControl;
class WalletFrame;
class WalletModel;
class HelpMessageDialog;
class CWallet;
@ -113,6 +114,7 @@ private: @@ -113,6 +114,7 @@ private:
QMenu *trayIconMenu;
Notificator *notificator;
RPCConsole *rpcConsole;
HelpMessageDialog *helpMessageDialog;
/** Keep track of previous number of blocks, to detect progress */
int prevBlocks;

21
src/qt/walletview.cpp

@ -56,6 +56,9 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent): @@ -56,6 +56,9 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent):
receiveCoinsPage = new ReceiveCoinsDialog(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(transactionsPage);
addWidget(receiveCoinsPage);
@ -115,6 +118,8 @@ void WalletView::setWalletModel(WalletModel *walletModel) @@ -115,6 +118,8 @@ void WalletView::setWalletModel(WalletModel *walletModel)
overviewPage->setWalletModel(walletModel);
receiveCoinsPage->setModel(walletModel);
sendCoinsPage->setModel(walletModel);
usedReceivingAddressesPage->setModel(walletModel->getAddressTableModel());
usedSendingAddressesPage->setModel(walletModel->getAddressTableModel());
if (walletModel)
{
@ -273,20 +278,20 @@ void WalletView::usedSendingAddresses() @@ -273,20 +278,20 @@ void WalletView::usedSendingAddresses()
{
if(!walletModel)
return;
AddressBookPage *dlg = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::SendingTab, this);
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->setModel(walletModel->getAddressTableModel());
dlg->show();
usedSendingAddressesPage->show();
usedSendingAddressesPage->raise();
usedSendingAddressesPage->activateWindow();
}
void WalletView::usedReceivingAddresses()
{
if(!walletModel)
return;
AddressBookPage *dlg = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this);
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->setModel(walletModel->getAddressTableModel());
dlg->show();
usedReceivingAddressesPage->show();
usedReceivingAddressesPage->raise();
usedReceivingAddressesPage->activateWindow();
}
void WalletView::showProgress(const QString &title, int nProgress)

3
src/qt/walletview.h

@ -18,6 +18,7 @@ class SendCoinsDialog; @@ -18,6 +18,7 @@ class SendCoinsDialog;
class SendCoinsRecipient;
class TransactionView;
class WalletModel;
class AddressBookPage;
QT_BEGIN_NAMESPACE
class QModelIndex;
@ -61,6 +62,8 @@ private: @@ -61,6 +62,8 @@ private:
QWidget *transactionsPage;
ReceiveCoinsDialog *receiveCoinsPage;
SendCoinsDialog *sendCoinsPage;
AddressBookPage *usedSendingAddressesPage;
AddressBookPage *usedReceivingAddressesPage;
TransactionView *transactionView;

Loading…
Cancel
Save