Skip to content

Commit 84b695c

Browse files
author
Philip Kaufmann
committed
[Qt] allow deletion of payment-requests in sendcoins
- this adds a delete button for insecure and secure payment requests in the sendcoins dialog - it also enables the delete button even for single and empty entries, as this is much easier to handle and doesn't need to special case single entries - big parts of the ui file were changed, because I copied the delete button and had to delete the layout too and created it from scratch (which seems to cleanup the rows and colums in the layout also, which is nice IMHO)
1 parent d4cda96 commit 84b695c

File tree

5 files changed

+158
-130
lines changed

5 files changed

+158
-130
lines changed

src/qt/forms/sendcoinsentry.ui

Lines changed: 140 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<property name="autoFillBackground">
1717
<bool>false</bool>
1818
</property>
19-
<property name="currentIndex">
20-
<number>0</number>
21-
</property>
2219
<widget class="QFrame" name="SendCoins">
2320
<property name="toolTip">
2421
<string>This is a normal payment.</string>
@@ -33,20 +30,7 @@
3330
<property name="spacing">
3431
<number>12</number>
3532
</property>
36-
<item row="5" column="0">
37-
<widget class="QLabel" name="amountLabel">
38-
<property name="text">
39-
<string>A&amp;mount:</string>
40-
</property>
41-
<property name="alignment">
42-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
43-
</property>
44-
<property name="buddy">
45-
<cstring>payAmount</cstring>
46-
</property>
47-
</widget>
48-
</item>
49-
<item row="3" column="0">
33+
<item row="0" column="0">
5034
<widget class="QLabel" name="payToLabel">
5135
<property name="text">
5236
<string>Pay &amp;To:</string>
@@ -59,23 +43,7 @@
5943
</property>
6044
</widget>
6145
</item>
62-
<item row="5" column="1">
63-
<widget class="BitcoinAmountField" name="payAmount"/>
64-
</item>
65-
<item row="4" column="0">
66-
<widget class="QLabel" name="labellLabel">
67-
<property name="text">
68-
<string>&amp;Label:</string>
69-
</property>
70-
<property name="alignment">
71-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
72-
</property>
73-
<property name="buddy">
74-
<cstring>addAsLabel</cstring>
75-
</property>
76-
</widget>
77-
</item>
78-
<item row="3" column="1">
46+
<item row="0" column="1">
7947
<layout class="QHBoxLayout" name="payToLayout">
8048
<property name="spacing">
8149
<number>0</number>
@@ -85,9 +53,6 @@
8553
<property name="toolTip">
8654
<string>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</string>
8755
</property>
88-
<property name="maxLength">
89-
<number>34</number>
90-
</property>
9156
</widget>
9257
</item>
9358
<item>
@@ -127,7 +92,7 @@
12792
<item>
12893
<widget class="QToolButton" name="deleteButton">
12994
<property name="toolTip">
130-
<string>Remove this recipient</string>
95+
<string>Remove this entry</string>
13196
</property>
13297
<property name="text">
13398
<string/>
@@ -140,13 +105,42 @@
140105
</item>
141106
</layout>
142107
</item>
143-
<item row="4" column="1">
108+
<item row="1" column="0">
109+
<widget class="QLabel" name="labellLabel">
110+
<property name="text">
111+
<string>&amp;Label:</string>
112+
</property>
113+
<property name="alignment">
114+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
115+
</property>
116+
<property name="buddy">
117+
<cstring>addAsLabel</cstring>
118+
</property>
119+
</widget>
120+
</item>
121+
<item row="1" column="1">
144122
<widget class="QLineEdit" name="addAsLabel">
145123
<property name="toolTip">
146124
<string>Enter a label for this address to add it to the list of used addresses</string>
147125
</property>
148126
</widget>
149127
</item>
128+
<item row="2" column="0">
129+
<widget class="QLabel" name="amountLabel">
130+
<property name="text">
131+
<string>A&amp;mount:</string>
132+
</property>
133+
<property name="alignment">
134+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
135+
</property>
136+
<property name="buddy">
137+
<cstring>payAmount</cstring>
138+
</property>
139+
</widget>
140+
</item>
141+
<item row="2" column="1">
142+
<widget class="BitcoinAmountField" name="payAmount"/>
143+
</item>
150144
</layout>
151145
</widget>
152146
<widget class="QFrame" name="SendCoins_InsecurePaymentRequest">
@@ -581,60 +575,77 @@
581575
<property name="spacing">
582576
<number>12</number>
583577
</property>
584-
<item row="4" column="0">
585-
<widget class="QLabel" name="memoLabel_is">
578+
<item row="0" column="0">
579+
<widget class="QLabel" name="payToLabel_is">
586580
<property name="text">
587-
<string>Memo:</string>
581+
<string>Pay To:</string>
588582
</property>
589583
<property name="alignment">
590584
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
591585
</property>
592586
</widget>
593587
</item>
594-
<item row="5" column="0">
595-
<widget class="QLabel" name="amountLabel_is">
588+
<item row="0" column="1">
589+
<layout class="QHBoxLayout" name="payToLayout_is">
590+
<property name="spacing">
591+
<number>0</number>
592+
</property>
593+
<item>
594+
<widget class="QLabel" name="payTo_is"/>
595+
</item>
596+
<item>
597+
<widget class="QToolButton" name="deleteButton_is">
598+
<property name="toolTip">
599+
<string>Remove this entry</string>
600+
</property>
601+
<property name="text">
602+
<string/>
603+
</property>
604+
<property name="icon">
605+
<iconset resource="../bitcoin.qrc">
606+
<normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>
607+
</property>
608+
</widget>
609+
</item>
610+
</layout>
611+
</item>
612+
<item row="1" column="0">
613+
<widget class="QLabel" name="memoLabel_is">
596614
<property name="text">
597-
<string>Amount:</string>
615+
<string>Memo:</string>
598616
</property>
599617
<property name="alignment">
600618
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
601619
</property>
602620
</widget>
603621
</item>
604-
<item row="3" column="0">
605-
<widget class="QLabel" name="payToLabel_is">
622+
<item row="1" column="1">
623+
<widget class="QLabel" name="memoTextLabel_is">
624+
<property name="textFormat">
625+
<enum>Qt::PlainText</enum>
626+
</property>
627+
</widget>
628+
</item>
629+
<item row="2" column="0">
630+
<widget class="QLabel" name="amountLabel_is">
606631
<property name="text">
607-
<string>Pay To:</string>
632+
<string>A&amp;mount:</string>
608633
</property>
609634
<property name="alignment">
610635
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
611636
</property>
637+
<property name="buddy">
638+
<cstring>payAmount_is</cstring>
639+
</property>
612640
</widget>
613641
</item>
614-
<item row="5" column="2">
642+
<item row="2" column="1">
615643
<widget class="BitcoinAmountField" name="payAmount_is">
616644
<property name="acceptDrops">
617645
<bool>false</bool>
618646
</property>
619647
</widget>
620648
</item>
621-
<item row="3" column="2">
622-
<layout class="QHBoxLayout" name="payToLayout_is">
623-
<property name="spacing">
624-
<number>0</number>
625-
</property>
626-
<item>
627-
<widget class="QLabel" name="payTo_is"/>
628-
</item>
629-
</layout>
630-
</item>
631-
<item row="4" column="2">
632-
<widget class="QLabel" name="memoTextLabel_is">
633-
<property name="textFormat">
634-
<enum>Qt::PlainText</enum>
635-
</property>
636-
</widget>
637-
</item>
638649
</layout>
639650
</widget>
640651
<widget class="QFrame" name="SendCoins_SecurePaymentRequest">
@@ -1096,27 +1107,7 @@
10961107
<property name="spacing">
10971108
<number>12</number>
10981109
</property>
1099-
<item row="4" column="0">
1100-
<widget class="QLabel" name="memoLabel_s">
1101-
<property name="text">
1102-
<string>Memo:</string>
1103-
</property>
1104-
<property name="alignment">
1105-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
1106-
</property>
1107-
</widget>
1108-
</item>
1109-
<item row="5" column="0">
1110-
<widget class="QLabel" name="amountLabel_s">
1111-
<property name="text">
1112-
<string>Amount:</string>
1113-
</property>
1114-
<property name="alignment">
1115-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
1116-
</property>
1117-
</widget>
1118-
</item>
1119-
<item row="3" column="0">
1110+
<item row="0" column="0">
11201111
<widget class="QLabel" name="payToLabel_s">
11211112
<property name="text">
11221113
<string>Pay To:</string>
@@ -1126,14 +1117,7 @@
11261117
</property>
11271118
</widget>
11281119
</item>
1129-
<item row="5" column="2">
1130-
<widget class="BitcoinAmountField" name="payAmount_s">
1131-
<property name="acceptDrops">
1132-
<bool>false</bool>
1133-
</property>
1134-
</widget>
1135-
</item>
1136-
<item row="3" column="2">
1120+
<item row="0" column="1">
11371121
<layout class="QHBoxLayout" name="payToLayout_s">
11381122
<property name="spacing">
11391123
<number>0</number>
@@ -1145,30 +1129,86 @@
11451129
</property>
11461130
</widget>
11471131
</item>
1132+
<item>
1133+
<widget class="QToolButton" name="deleteButton_s">
1134+
<property name="toolTip">
1135+
<string>Remove this entry</string>
1136+
</property>
1137+
<property name="text">
1138+
<string/>
1139+
</property>
1140+
<property name="icon">
1141+
<iconset resource="../bitcoin.qrc">
1142+
<normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>
1143+
</property>
1144+
</widget>
1145+
</item>
11481146
</layout>
11491147
</item>
1150-
<item row="4" column="2">
1148+
<item row="1" column="0">
1149+
<widget class="QLabel" name="memoLabel_s">
1150+
<property name="text">
1151+
<string>Memo:</string>
1152+
</property>
1153+
<property name="alignment">
1154+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
1155+
</property>
1156+
</widget>
1157+
</item>
1158+
<item row="1" column="1">
11511159
<widget class="QLabel" name="memoTextLabel_s">
11521160
<property name="textFormat">
11531161
<enum>Qt::PlainText</enum>
11541162
</property>
11551163
</widget>
11561164
</item>
1165+
<item row="2" column="0">
1166+
<widget class="QLabel" name="amountLabel_s">
1167+
<property name="text">
1168+
<string>A&amp;mount:</string>
1169+
</property>
1170+
<property name="alignment">
1171+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
1172+
</property>
1173+
<property name="buddy">
1174+
<cstring>payAmount_s</cstring>
1175+
</property>
1176+
</widget>
1177+
</item>
1178+
<item row="2" column="1">
1179+
<widget class="BitcoinAmountField" name="payAmount_s">
1180+
<property name="acceptDrops">
1181+
<bool>false</bool>
1182+
</property>
1183+
</widget>
1184+
</item>
11571185
</layout>
11581186
</widget>
11591187
</widget>
11601188
<customwidgets>
11611189
<customwidget>
1162-
<class>BitcoinAmountField</class>
1190+
<class>QValidatedLineEdit</class>
11631191
<extends>QLineEdit</extends>
1164-
<header>bitcoinamountfield.h</header>
1192+
<header>qvalidatedlineedit.h</header>
11651193
</customwidget>
11661194
<customwidget>
1167-
<class>QValidatedLineEdit</class>
1195+
<class>BitcoinAmountField</class>
11681196
<extends>QLineEdit</extends>
1169-
<header>qvalidatedlineedit.h</header>
1197+
<header>bitcoinamountfield.h</header>
11701198
</customwidget>
11711199
</customwidgets>
1200+
<tabstops>
1201+
<tabstop>payTo</tabstop>
1202+
<tabstop>addressBookButton</tabstop>
1203+
<tabstop>pasteButton</tabstop>
1204+
<tabstop>deleteButton</tabstop>
1205+
<tabstop>addAsLabel</tabstop>
1206+
<tabstop>payAmount</tabstop>
1207+
<tabstop>payAmount_is</tabstop>
1208+
<tabstop>deleteButton_is</tabstop>
1209+
<tabstop>payAmount_s</tabstop>
1210+
<tabstop>deleteButton_s</tabstop>
1211+
</tabstops>
11721212
<resources>
11731213
<include location="../bitcoin.qrc"/>
11741214
</resources>

0 commit comments

Comments
 (0)