File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -144,3 +144,28 @@ void SendRecipientsListModel::clear()
144
144
Q_EMIT currentRecipientChanged ();
145
145
Q_EMIT currentIndexChanged ();
146
146
}
147
+
148
+ void SendRecipientsListModel::clearToFront ()
149
+ {
150
+ bool count_changed = false ;
151
+ while (m_recipients.size () > 1 ) {
152
+ delete m_recipients.at (1 );
153
+ m_recipients.removeAt (1 );
154
+ count_changed = true ;
155
+ }
156
+
157
+ if (count_changed) {
158
+ Q_EMIT countChanged ();
159
+ }
160
+
161
+ if (m_totalAmount != m_recipients[0 ]->amount ()->satoshi ()) {
162
+ m_totalAmount = m_recipients[0 ]->amount ()->satoshi ();
163
+ Q_EMIT totalAmountChanged ();
164
+ }
165
+
166
+ if (m_current != 0 ) {
167
+ m_current = 0 ;
168
+ Q_EMIT currentRecipientChanged ();
169
+ Q_EMIT currentIndexChanged ();
170
+ }
171
+ }
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ class SendRecipientsListModel : public QAbstractListModel
38
38
Q_INVOKABLE void prev ();
39
39
Q_INVOKABLE void remove ();
40
40
Q_INVOKABLE void clear ();
41
+ Q_INVOKABLE void clearToFront ();
41
42
42
43
int currentIndex () const { return m_current + 1 ; }
43
44
void setCurrentIndex (int row);
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ PageStack {
34
34
id: settings
35
35
property alias coinControlEnabled: sendOptionsPopup .coinControlEnabled
36
36
property alias multipleRecipientsEnabled: sendOptionsPopup .multipleRecipientsEnabled
37
+
38
+ onMultipleRecipientsEnabledChanged: {
39
+ if (! multipleRecipientsEnabled) {
40
+ root .wallet .recipients .clearToFront ()
41
+ }
42
+ }
37
43
}
38
44
39
45
ScrollView {
You can’t perform that action at this time.
0 commit comments