Show unconfirmed balance on overview page
[novacoin.git] / src / qt / sendcoinsdialog.cpp
index 8050baf..4adda7e 100644 (file)
@@ -1,6 +1,7 @@
 #include "sendcoinsdialog.h"
 #include "ui_sendcoinsdialog.h"
 #include "walletmodel.h"
+#include "addresstablemodel.h"
 #include "guiutil.h"
 
 #include "addressbookpage.h"
@@ -20,8 +21,10 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent, const QString &address) :
 {
     ui->setupUi(this);
 #if QT_VERSION >= 0x040700
+    ui->payTo->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"));
     ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book"));
 #endif
+
     GUIUtil::setupAddressWidget(ui->payTo, this);
 
     // Set initial send-to address if provided
@@ -113,11 +116,13 @@ void SendCoinsDialog::on_pasteButton_clicked()
 
 void SendCoinsDialog::on_addressBookButton_clicked()
 {
-    AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab);
+    AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this);
     dlg.setModel(model->getAddressTableModel());
-    dlg.exec();
-    ui->payTo->setText(dlg.getReturnValue());
-    ui->payAmount->setFocus();
+    if(dlg.exec())
+    {
+        ui->payTo->setText(dlg.getReturnValue());
+        ui->payAmount->setFocus();
+    }
 }
 
 void SendCoinsDialog::on_buttonBox_rejected()
@@ -127,7 +132,7 @@ void SendCoinsDialog::on_buttonBox_rejected()
 
 void SendCoinsDialog::on_payTo_textChanged(const QString &address)
 {
-    ui->addAsLabel->setText(model->labelForAddress(address));
+    ui->addAsLabel->setText(model->getAddressTableModel()->labelForAddress(address));
 }
 
 void SendCoinsDialog::clear()
@@ -136,6 +141,7 @@ void SendCoinsDialog::clear()
     ui->addAsLabel->setText(QString());
     ui->payAmount->setText(QString());
     ui->payTo->setFocus();
+    ui->sendButton->setDefault(true);
 }
 
 void SendCoinsDialog::reject()