[Qt] make most Windows appear centered on main GUI

- remove default value for parent variable in dialogs, which should appear
  centered over main GUI and pass appropriate value
- add some addition NULL pointer checks
This commit is contained in:
Philip Kaufmann
2013-11-14 19:47:45 +01:00
parent 6ad44f5693
commit 309f796b39
11 changed files with 31 additions and 26 deletions

View File

@@ -83,14 +83,12 @@ TransactionView::TransactionView(QWidget *parent) :
addressWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
addressWidget->setPlaceholderText(tr("Enter address or label to search"));
#endif
hlayout->addWidget(addressWidget);
amountWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
amountWidget->setPlaceholderText(tr("Min amount"));
#endif
#ifdef Q_OS_MAC
@@ -355,10 +353,10 @@ void TransactionView::editLabel()
// Determine type of address, launch appropriate editor dialog type
QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
EditAddressDialog dlg(type==AddressTableModel::Receive
? EditAddressDialog::EditReceivingAddress
: EditAddressDialog::EditSendingAddress,
this);
EditAddressDialog dlg(
type == AddressTableModel::Receive
? EditAddressDialog::EditReceivingAddress
: EditAddressDialog::EditSendingAddress, this);
dlg.setModel(addressBook);
dlg.loadRow(idx);
dlg.exec();
@@ -367,7 +365,7 @@ void TransactionView::editLabel()
{
// Add sending address
EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,
this);
this);
dlg.setModel(addressBook);
dlg.setAddress(address);
dlg.exec();