1
- // Copyright (c) 2011-2018 The Bitcoin Core developers
1
+ // Copyright (c) 2011-2019 The Bitcoin Core developers
2
2
// Distributed under the MIT software license, see the accompanying
3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
@@ -46,8 +46,7 @@ bool WalletFrame::addWallet(WalletModel *walletModel)
46
46
return false ;
47
47
}
48
48
49
- const QString name = walletModel->getWalletName ();
50
- if (mapWalletViews.count (name) > 0 ) {
49
+ if (mapWalletViews.count (walletModel) > 0 ) {
51
50
return false ;
52
51
}
53
52
@@ -65,7 +64,7 @@ bool WalletFrame::addWallet(WalletModel *walletModel)
65
64
}
66
65
67
66
walletStack->addWidget (walletView);
68
- mapWalletViews[name ] = walletView;
67
+ mapWalletViews[walletModel ] = walletView;
69
68
70
69
// Ensure a walletView is able to show the main window
71
70
connect (walletView, &WalletView::showNormalIfMinimized, [this ]{
@@ -77,32 +76,32 @@ bool WalletFrame::addWallet(WalletModel *walletModel)
77
76
return true ;
78
77
}
79
78
80
- bool WalletFrame::setCurrentWallet (const QString& name )
79
+ bool WalletFrame::setCurrentWallet (WalletModel* wallet_model )
81
80
{
82
- if (mapWalletViews.count (name ) == 0 )
81
+ if (mapWalletViews.count (wallet_model ) == 0 )
83
82
return false ;
84
83
85
- WalletView *walletView = mapWalletViews.value (name );
84
+ WalletView *walletView = mapWalletViews.value (wallet_model );
86
85
walletStack->setCurrentWidget (walletView);
87
86
assert (walletView);
88
87
walletView->updateEncryptionStatus ();
89
88
return true ;
90
89
}
91
90
92
- bool WalletFrame::removeWallet (const QString &name )
91
+ bool WalletFrame::removeWallet (WalletModel* wallet_model )
93
92
{
94
- if (mapWalletViews.count (name ) == 0 )
93
+ if (mapWalletViews.count (wallet_model ) == 0 )
95
94
return false ;
96
95
97
- WalletView *walletView = mapWalletViews.take (name );
96
+ WalletView *walletView = mapWalletViews.take (wallet_model );
98
97
walletStack->removeWidget (walletView);
99
98
delete walletView;
100
99
return true ;
101
100
}
102
101
103
102
void WalletFrame::removeAllWallets ()
104
103
{
105
- QMap<QString , WalletView*>::const_iterator i;
104
+ QMap<WalletModel* , WalletView*>::const_iterator i;
106
105
for (i = mapWalletViews.constBegin (); i != mapWalletViews.constEnd (); ++i)
107
106
walletStack->removeWidget (i.value ());
108
107
mapWalletViews.clear ();
@@ -120,35 +119,35 @@ bool WalletFrame::handlePaymentRequest(const SendCoinsRecipient &recipient)
120
119
void WalletFrame::showOutOfSyncWarning (bool fShow )
121
120
{
122
121
bOutOfSync = fShow ;
123
- QMap<QString , WalletView*>::const_iterator i;
122
+ QMap<WalletModel* , WalletView*>::const_iterator i;
124
123
for (i = mapWalletViews.constBegin (); i != mapWalletViews.constEnd (); ++i)
125
124
i.value ()->showOutOfSyncWarning (fShow );
126
125
}
127
126
128
127
void WalletFrame::gotoOverviewPage ()
129
128
{
130
- QMap<QString , WalletView*>::const_iterator i;
129
+ QMap<WalletModel* , WalletView*>::const_iterator i;
131
130
for (i = mapWalletViews.constBegin (); i != mapWalletViews.constEnd (); ++i)
132
131
i.value ()->gotoOverviewPage ();
133
132
}
134
133
135
134
void WalletFrame::gotoHistoryPage ()
136
135
{
137
- QMap<QString , WalletView*>::const_iterator i;
136
+ QMap<WalletModel* , WalletView*>::const_iterator i;
138
137
for (i = mapWalletViews.constBegin (); i != mapWalletViews.constEnd (); ++i)
139
138
i.value ()->gotoHistoryPage ();
140
139
}
141
140
142
141
void WalletFrame::gotoReceiveCoinsPage ()
143
142
{
144
- QMap<QString , WalletView*>::const_iterator i;
143
+ QMap<WalletModel* , WalletView*>::const_iterator i;
145
144
for (i = mapWalletViews.constBegin (); i != mapWalletViews.constEnd (); ++i)
146
145
i.value ()->gotoReceiveCoinsPage ();
147
146
}
148
147
149
148
void WalletFrame::gotoSendCoinsPage (QString addr)
150
149
{
151
- QMap<QString , WalletView*>::const_iterator i;
150
+ QMap<WalletModel* , WalletView*>::const_iterator i;
152
151
for (i = mapWalletViews.constBegin (); i != mapWalletViews.constEnd (); ++i)
153
152
i.value ()->gotoSendCoinsPage (addr);
154
153
}
0 commit comments