Skip to content

Commit 70b1463

Browse files
committed
qt: general polish after adding new receive flow
- We no longer have an address book, but "address lists", update message accordingly - Add tooltips here and there - Clarify text on buttons - add Copy Address button to receive request dialog
1 parent 33a2feb commit 70b1463

9 files changed

+114
-42
lines changed

src/qt/addressbookpage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
4545
connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept()));
4646
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
4747
ui->tableView->setFocus();
48+
ui->closeButton->setText(tr("C&hoose"));
4849
ui->exportButton->hide();
4950
break;
5051
case ForEditing:
@@ -90,8 +91,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
9091

9192
connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
9293

93-
// Pass through accept action from button box
94-
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
94+
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(accept()));
9595
}
9696

9797
AddressBookPage::~AddressBookPage()
@@ -268,7 +268,7 @@ void AddressBookPage::on_exportButton_clicked()
268268
// CSV is currently the only supported format
269269
QString filename = GUIUtil::getSaveFileName(
270270
this,
271-
tr("Export Address Book Data"), QString(),
271+
tr("Export Address List"), QString(),
272272
tr("Comma separated file (*.csv)"));
273273

274274
if (filename.isNull()) return;

src/qt/forms/addressbookpage.ui

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
14-
<string></string>
14+
<string/>
1515
</property>
1616
<layout class="QVBoxLayout" name="verticalLayout">
1717
<item>
@@ -60,7 +60,7 @@
6060
<string>Create a new address</string>
6161
</property>
6262
<property name="text">
63-
<string>&amp;New Address</string>
63+
<string>&amp;New</string>
6464
</property>
6565
<property name="icon">
6666
<iconset resource="../bitcoin.qrc">
@@ -74,7 +74,7 @@
7474
<string>Copy the currently selected address to the system clipboard</string>
7575
</property>
7676
<property name="text">
77-
<string>&amp;Copy Address</string>
77+
<string>&amp;Copy</string>
7878
</property>
7979
<property name="icon">
8080
<iconset resource="../bitcoin.qrc">
@@ -124,15 +124,9 @@
124124
</widget>
125125
</item>
126126
<item>
127-
<widget class="QDialogButtonBox" name="buttonBox">
128-
<property name="sizePolicy">
129-
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
130-
<horstretch>0</horstretch>
131-
<verstretch>0</verstretch>
132-
</sizepolicy>
133-
</property>
134-
<property name="standardButtons">
135-
<set>QDialogButtonBox::Ok</set>
127+
<widget class="QPushButton" name="closeButton">
128+
<property name="text">
129+
<string>C&amp;lose</string>
136130
</property>
137131
</widget>
138132
</item>

src/qt/forms/editaddressdialog.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<item row="0" column="1">
3333
<widget class="QLineEdit" name="labelEdit">
3434
<property name="toolTip">
35-
<string>The label associated with this address book entry</string>
35+
<string>The label associated with this address list entry</string>
3636
</property>
3737
</widget>
3838
</item>
@@ -49,7 +49,7 @@
4949
<item row="1" column="1">
5050
<widget class="QLineEdit" name="addressEdit">
5151
<property name="toolTip">
52-
<string>The address associated with this address book entry. This can only be modified for sending addresses.</string>
52+
<string>The address associated with this address list entry. This can only be modified for sending addresses.</string>
5353
</property>
5454
</widget>
5555
</item>

src/qt/forms/receivecoinsdialog.ui

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@
3030
</widget>
3131
</item>
3232
<item row="3" column="1">
33-
<widget class="BitcoinAmountField" name="reqAmount" native="true">
33+
<widget class="BitcoinAmountField" name="reqAmount">
3434
<property name="minimumSize">
3535
<size>
3636
<width>80</width>
3737
<height>0</height>
3838
</size>
3939
</property>
40+
<property name="toolTip">
41+
<string>The amount to request</string>
42+
</property>
4043
</widget>
4144
</item>
4245
<item row="4" column="0">
@@ -50,7 +53,11 @@
5053
</widget>
5154
</item>
5255
<item row="4" column="1">
53-
<widget class="QLineEdit" name="reqLabel"/>
56+
<widget class="QLineEdit" name="reqLabel">
57+
<property name="toolTip">
58+
<string>The label to associate with the receiving address</string>
59+
</property>
60+
</widget>
5461
</item>
5562
<item row="5" column="0">
5663
<widget class="QLabel" name="label_3">
@@ -63,7 +70,11 @@
6370
</widget>
6471
</item>
6572
<item row="5" column="1">
66-
<widget class="QLineEdit" name="reqMessage"/>
73+
<widget class="QLineEdit" name="reqMessage">
74+
<property name="toolTip">
75+
<string>The message to attach to payment request</string>
76+
</property>
77+
</widget>
6778
</item>
6879
<item row="6" column="0">
6980
<widget class="QLabel" name="label_4">
@@ -74,8 +85,11 @@
7485
</item>
7586
<item row="6" column="1">
7687
<widget class="QCheckBox" name="reuseAddress">
88+
<property name="toolTip">
89+
<string>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</string>
90+
</property>
7791
<property name="text">
78-
<string>R&amp;euse an existing receiving address</string>
92+
<string>R&amp;euse an existing receiving address (not recommended)</string>
7993
</property>
8094
</widget>
8195
</item>

src/qt/forms/receiverequestdialog.ui

Lines changed: 69 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
<height>300</height>
2929
</size>
3030
</property>
31+
<property name="toolTip">
32+
<string>QR Code</string>
33+
</property>
3134
<property name="textFormat">
3235
<enum>Qt::PlainText</enum>
3336
</property>
@@ -53,6 +56,12 @@
5356
<height>50</height>
5457
</size>
5558
</property>
59+
<property name="frameShape">
60+
<enum>QFrame::NoFrame</enum>
61+
</property>
62+
<property name="frameShadow">
63+
<enum>QFrame::Plain</enum>
64+
</property>
5665
<property name="tabChangesFocus">
5766
<bool>true</bool>
5867
</property>
@@ -64,22 +73,16 @@
6473
<item>
6574
<layout class="QHBoxLayout" name="horizontalLayout">
6675
<item>
67-
<spacer name="horizontalSpacer">
68-
<property name="orientation">
69-
<enum>Qt::Horizontal</enum>
70-
</property>
71-
<property name="sizeHint" stdset="0">
72-
<size>
73-
<width>40</width>
74-
<height>20</height>
75-
</size>
76+
<widget class="QPushButton" name="btnCopyURI">
77+
<property name="text">
78+
<string>Copy &amp;URI</string>
7679
</property>
77-
</spacer>
80+
</widget>
7881
</item>
7982
<item>
80-
<widget class="QPushButton" name="btnCopyURI">
83+
<widget class="QPushButton" name="btnCopyAddress">
8184
<property name="text">
82-
<string>Copy &amp;URI</string>
85+
<string>Copy &amp;Address</string>
8386
</property>
8487
</widget>
8588
</item>
@@ -97,6 +100,26 @@
97100
</property>
98101
</widget>
99102
</item>
103+
<item>
104+
<spacer name="horizontalSpacer_2">
105+
<property name="orientation">
106+
<enum>Qt::Horizontal</enum>
107+
</property>
108+
<property name="sizeHint" stdset="0">
109+
<size>
110+
<width>40</width>
111+
<height>20</height>
112+
</size>
113+
</property>
114+
</spacer>
115+
</item>
116+
<item>
117+
<widget class="QDialogButtonBox" name="buttonBox">
118+
<property name="standardButtons">
119+
<set>QDialogButtonBox::Close</set>
120+
</property>
121+
</widget>
122+
</item>
100123
</layout>
101124
</item>
102125
</layout>
@@ -109,5 +132,38 @@
109132
</customwidget>
110133
</customwidgets>
111134
<resources/>
112-
<connections/>
135+
<connections>
136+
<connection>
137+
<sender>buttonBox</sender>
138+
<signal>rejected()</signal>
139+
<receiver>ReceiveRequestDialog</receiver>
140+
<slot>reject()</slot>
141+
<hints>
142+
<hint type="sourcelabel">
143+
<x>452</x>
144+
<y>573</y>
145+
</hint>
146+
<hint type="destinationlabel">
147+
<x>243</x>
148+
<y>298</y>
149+
</hint>
150+
</hints>
151+
</connection>
152+
<connection>
153+
<sender>buttonBox</sender>
154+
<signal>accepted()</signal>
155+
<receiver>ReceiveRequestDialog</receiver>
156+
<slot>accept()</slot>
157+
<hints>
158+
<hint type="sourcelabel">
159+
<x>452</x>
160+
<y>573</y>
161+
</hint>
162+
<hint type="destinationlabel">
163+
<x>243</x>
164+
<y>298</y>
165+
</hint>
166+
</hints>
167+
</connection>
168+
</connections>
113169
</ui>

src/qt/forms/sendcoinsentry.ui

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<item>
8888
<widget class="QToolButton" name="addressBookButton">
8989
<property name="toolTip">
90-
<string>Choose address from address book</string>
90+
<string>Choose previously used address</string>
9191
</property>
9292
<property name="text">
9393
<string/>
@@ -137,7 +137,7 @@
137137
<item row="4" column="1">
138138
<widget class="QValidatedLineEdit" name="addAsLabel">
139139
<property name="toolTip">
140-
<string>Enter a label for this address to add it to your address book</string>
140+
<string>Enter a label for this address to add it to the list of used addresses</string>
141141
</property>
142142
</widget>
143143
</item>
@@ -674,7 +674,6 @@
674674
<class>BitcoinAmountField</class>
675675
<extends>QLineEdit</extends>
676676
<header>bitcoinamountfield.h</header>
677-
<container>1</container>
678677
</customwidget>
679678
<customwidget>
680679
<class>QValidatedLineEdit</class>

src/qt/forms/signverifymessagedialog.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<item>
2121
<widget class="QTabWidget" name="tabWidget">
2222
<property name="currentIndex">
23-
<number>0</number>
23+
<number>1</number>
2424
</property>
2525
<widget class="QWidget" name="tabSignMessage">
2626
<attribute name="title">
@@ -58,7 +58,7 @@
5858
<item>
5959
<widget class="QPushButton" name="addressBookButton_SM">
6060
<property name="toolTip">
61-
<string>Choose an address from the address book</string>
61+
<string>Choose previously used address</string>
6262
</property>
6363
<property name="text">
6464
<string/>
@@ -271,7 +271,7 @@
271271
<item>
272272
<widget class="QPushButton" name="addressBookButton_VM">
273273
<property name="toolTip">
274-
<string>Choose an address from the address book</string>
274+
<string>Choose previously used address</string>
275275
</property>
276276
<property name="text">
277277
<string/>

src/qt/receiverequestdialog.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@ void QRImageWidget::mousePressEvent(QMouseEvent *event)
4444
{
4545
if(event->button() == Qt::LeftButton)
4646
{
47+
event->accept();
4748
QMimeData *mimeData = new QMimeData;
4849
mimeData->setImageData(exportImage());
4950

5051
QDrag *drag = new QDrag(this);
5152
drag->setMimeData(mimeData);
5253
drag->exec();
54+
} else {
55+
QLabel::mousePressEvent(event);
5356
}
5457
}
5558

@@ -119,9 +122,9 @@ void ReceiveRequestDialog::update()
119122
ui->btnSaveAs->setEnabled(false);
120123
QString html;
121124
html += "<html><font face='verdana, arial, helvetica, sans-serif'>";
122-
html += "<a href=\""+uri+"\">" + GUIUtil::HtmlEscape(uri) + "</a><br>";
123-
html += "<br>";
124125
html += "<b>"+tr("Payment information")+"</b><br>";
126+
html += "<b>"+tr("URI")+"</b>: ";
127+
html += "<a href=\""+uri+"\">" + GUIUtil::HtmlEscape(uri) + "</a><br>";
125128
html += "<b>"+tr("Address")+"</b>: " + GUIUtil::HtmlEscape(info.address) + "<br>";
126129
if(info.amount)
127130
html += "<b>"+tr("Amount")+"</b>: " + BitcoinUnits::formatWithUnit(model->getDisplayUnit(), info.amount) + "<br>";
@@ -173,3 +176,8 @@ void ReceiveRequestDialog::on_btnCopyURI_clicked()
173176
QApplication::clipboard()->setText(uri, QClipboard::Selection);
174177
}
175178

179+
void ReceiveRequestDialog::on_btnCopyAddress_clicked()
180+
{
181+
QApplication::clipboard()->setText(info.address, QClipboard::Clipboard);
182+
QApplication::clipboard()->setText(info.address, QClipboard::Selection);
183+
}

src/qt/receiverequestdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class ReceiveRequestDialog : public QDialog
4444

4545
private slots:
4646
void on_btnCopyURI_clicked();
47+
void on_btnCopyAddress_clicked();
4748

4849
void update();
4950

0 commit comments

Comments
 (0)