Browse Source

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
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
70b14636cd
  1. 6
      src/qt/addressbookpage.cpp
  2. 18
      src/qt/forms/addressbookpage.ui
  3. 4
      src/qt/forms/editaddressdialog.ui
  4. 22
      src/qt/forms/receivecoinsdialog.ui
  5. 82
      src/qt/forms/receiverequestdialog.ui
  6. 5
      src/qt/forms/sendcoinsentry.ui
  7. 6
      src/qt/forms/signverifymessagedialog.ui
  8. 12
      src/qt/receiverequestdialog.cpp
  9. 1
      src/qt/receiverequestdialog.h

6
src/qt/addressbookpage.cpp

@ -45,6 +45,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept())); connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept()));
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->tableView->setFocus(); ui->tableView->setFocus();
ui->closeButton->setText(tr("C&hoose"));
ui->exportButton->hide(); ui->exportButton->hide();
break; break;
case ForEditing: case ForEditing:
@ -90,8 +91,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
// Pass through accept action from button box connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
} }
AddressBookPage::~AddressBookPage() AddressBookPage::~AddressBookPage()
@ -268,7 +268,7 @@ void AddressBookPage::on_exportButton_clicked()
// CSV is currently the only supported format // CSV is currently the only supported format
QString filename = GUIUtil::getSaveFileName( QString filename = GUIUtil::getSaveFileName(
this, this,
tr("Export Address Book Data"), QString(), tr("Export Address List"), QString(),
tr("Comma separated file (*.csv)")); tr("Comma separated file (*.csv)"));
if (filename.isNull()) return; if (filename.isNull()) return;

18
src/qt/forms/addressbookpage.ui

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string></string> <string/>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
@ -60,7 +60,7 @@
<string>Create a new address</string> <string>Create a new address</string>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;New Address</string> <string>&amp;New</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../bitcoin.qrc"> <iconset resource="../bitcoin.qrc">
@ -74,7 +74,7 @@
<string>Copy the currently selected address to the system clipboard</string> <string>Copy the currently selected address to the system clipboard</string>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Copy Address</string> <string>&amp;Copy</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../bitcoin.qrc"> <iconset resource="../bitcoin.qrc">
@ -124,15 +124,9 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QPushButton" name="closeButton">
<property name="sizePolicy"> <property name="text">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <string>C&amp;lose</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>

4
src/qt/forms/editaddressdialog.ui

@ -32,7 +32,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="labelEdit"> <widget class="QLineEdit" name="labelEdit">
<property name="toolTip"> <property name="toolTip">
<string>The label associated with this address book entry</string> <string>The label associated with this address list entry</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -49,7 +49,7 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="addressEdit"> <widget class="QLineEdit" name="addressEdit">
<property name="toolTip"> <property name="toolTip">
<string>The address associated with this address book entry. This can only be modified for sending addresses.</string> <string>The address associated with this address list entry. This can only be modified for sending addresses.</string>
</property> </property>
</widget> </widget>
</item> </item>

22
src/qt/forms/receivecoinsdialog.ui

@ -30,13 +30,16 @@
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="BitcoinAmountField" name="reqAmount" native="true"> <widget class="BitcoinAmountField" name="reqAmount">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>80</width> <width>80</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>The amount to request</string>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
@ -50,7 +53,11 @@
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="QLineEdit" name="reqLabel"/> <widget class="QLineEdit" name="reqLabel">
<property name="toolTip">
<string>The label to associate with the receiving address</string>
</property>
</widget>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
@ -63,7 +70,11 @@
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="QLineEdit" name="reqMessage"/> <widget class="QLineEdit" name="reqMessage">
<property name="toolTip">
<string>The message to attach to payment request</string>
</property>
</widget>
</item> </item>
<item row="6" column="0"> <item row="6" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
@ -74,8 +85,11 @@
</item> </item>
<item row="6" column="1"> <item row="6" column="1">
<widget class="QCheckBox" name="reuseAddress"> <widget class="QCheckBox" name="reuseAddress">
<property name="toolTip">
<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>
</property>
<property name="text"> <property name="text">
<string>R&amp;euse an existing receiving address</string> <string>R&amp;euse an existing receiving address (not recommended)</string>
</property> </property>
</widget> </widget>
</item> </item>

82
src/qt/forms/receiverequestdialog.ui

@ -28,6 +28,9 @@
<height>300</height> <height>300</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>QR Code</string>
</property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::PlainText</enum> <enum>Qt::PlainText</enum>
</property> </property>
@ -53,6 +56,12 @@
<height>50</height> <height>50</height>
</size> </size>
</property> </property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="tabChangesFocus"> <property name="tabChangesFocus">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -64,22 +73,16 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<spacer name="horizontalSpacer"> <widget class="QPushButton" name="btnCopyURI">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Copy &amp;URI</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property> </property>
</spacer> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btnCopyURI"> <widget class="QPushButton" name="btnCopyAddress">
<property name="text"> <property name="text">
<string>Copy &amp;URI</string> <string>Copy &amp;Address</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -97,6 +100,26 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -109,5 +132,38 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections/> <connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ReceiveRequestDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>452</x>
<y>573</y>
</hint>
<hint type="destinationlabel">
<x>243</x>
<y>298</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ReceiveRequestDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>452</x>
<y>573</y>
</hint>
<hint type="destinationlabel">
<x>243</x>
<y>298</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>

5
src/qt/forms/sendcoinsentry.ui

@ -87,7 +87,7 @@
<item> <item>
<widget class="QToolButton" name="addressBookButton"> <widget class="QToolButton" name="addressBookButton">
<property name="toolTip"> <property name="toolTip">
<string>Choose address from address book</string> <string>Choose previously used address</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -137,7 +137,7 @@
<item row="4" column="1"> <item row="4" column="1">
<widget class="QValidatedLineEdit" name="addAsLabel"> <widget class="QValidatedLineEdit" name="addAsLabel">
<property name="toolTip"> <property name="toolTip">
<string>Enter a label for this address to add it to your address book</string> <string>Enter a label for this address to add it to the list of used addresses</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -674,7 +674,6 @@
<class>BitcoinAmountField</class> <class>BitcoinAmountField</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>
<header>bitcoinamountfield.h</header> <header>bitcoinamountfield.h</header>
<container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>QValidatedLineEdit</class> <class>QValidatedLineEdit</class>

6
src/qt/forms/signverifymessagedialog.ui

@ -20,7 +20,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tabSignMessage"> <widget class="QWidget" name="tabSignMessage">
<attribute name="title"> <attribute name="title">
@ -58,7 +58,7 @@
<item> <item>
<widget class="QPushButton" name="addressBookButton_SM"> <widget class="QPushButton" name="addressBookButton_SM">
<property name="toolTip"> <property name="toolTip">
<string>Choose an address from the address book</string> <string>Choose previously used address</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -271,7 +271,7 @@
<item> <item>
<widget class="QPushButton" name="addressBookButton_VM"> <widget class="QPushButton" name="addressBookButton_VM">
<property name="toolTip"> <property name="toolTip">
<string>Choose an address from the address book</string> <string>Choose previously used address</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>

12
src/qt/receiverequestdialog.cpp

@ -44,12 +44,15 @@ void QRImageWidget::mousePressEvent(QMouseEvent *event)
{ {
if(event->button() == Qt::LeftButton) if(event->button() == Qt::LeftButton)
{ {
event->accept();
QMimeData *mimeData = new QMimeData; QMimeData *mimeData = new QMimeData;
mimeData->setImageData(exportImage()); mimeData->setImageData(exportImage());
QDrag *drag = new QDrag(this); QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData); drag->setMimeData(mimeData);
drag->exec(); drag->exec();
} else {
QLabel::mousePressEvent(event);
} }
} }
@ -119,9 +122,9 @@ void ReceiveRequestDialog::update()
ui->btnSaveAs->setEnabled(false); ui->btnSaveAs->setEnabled(false);
QString html; QString html;
html += "<html><font face='verdana, arial, helvetica, sans-serif'>"; html += "<html><font face='verdana, arial, helvetica, sans-serif'>";
html += "<a href=\""+uri+"\">" + GUIUtil::HtmlEscape(uri) + "</a><br>";
html += "<br>";
html += "<b>"+tr("Payment information")+"</b><br>"; html += "<b>"+tr("Payment information")+"</b><br>";
html += "<b>"+tr("URI")+"</b>: ";
html += "<a href=\""+uri+"\">" + GUIUtil::HtmlEscape(uri) + "</a><br>";
html += "<b>"+tr("Address")+"</b>: " + GUIUtil::HtmlEscape(info.address) + "<br>"; html += "<b>"+tr("Address")+"</b>: " + GUIUtil::HtmlEscape(info.address) + "<br>";
if(info.amount) if(info.amount)
html += "<b>"+tr("Amount")+"</b>: " + BitcoinUnits::formatWithUnit(model->getDisplayUnit(), info.amount) + "<br>"; html += "<b>"+tr("Amount")+"</b>: " + BitcoinUnits::formatWithUnit(model->getDisplayUnit(), info.amount) + "<br>";
@ -173,3 +176,8 @@ void ReceiveRequestDialog::on_btnCopyURI_clicked()
QApplication::clipboard()->setText(uri, QClipboard::Selection); QApplication::clipboard()->setText(uri, QClipboard::Selection);
} }
void ReceiveRequestDialog::on_btnCopyAddress_clicked()
{
QApplication::clipboard()->setText(info.address, QClipboard::Clipboard);
QApplication::clipboard()->setText(info.address, QClipboard::Selection);
}

1
src/qt/receiverequestdialog.h

@ -44,6 +44,7 @@ public:
private slots: private slots:
void on_btnCopyURI_clicked(); void on_btnCopyURI_clicked();
void on_btnCopyAddress_clicked();
void update(); void update();

Loading…
Cancel
Save