aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-11-14 19:47:45 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-11-14 19:58:00 +0100
commit309f796b39d4ae7694c3f37a681c1ebcd1f58eda (patch)
tree2ad12f4d6bea1172f093067ade23fc11a56e13c5
parent6ad44f569335d57a56e5b28582255439980f9b73 (diff)
[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
-rw-r--r--src/qt/aboutdialog.h2
-rw-r--r--src/qt/addressbookpage.cpp15
-rw-r--r--src/qt/addressbookpage.h2
-rw-r--r--src/qt/askpassphrasedialog.h2
-rw-r--r--src/qt/bitcoingui.cpp14
-rw-r--r--src/qt/editaddressdialog.h2
-rw-r--r--src/qt/openuridialog.h2
-rw-r--r--src/qt/optionsdialog.h2
-rw-r--r--src/qt/rpcconsole.h2
-rw-r--r--src/qt/signverifymessagedialog.h2
-rw-r--r--src/qt/transactionview.cpp12
11 files changed, 31 insertions, 26 deletions
diff --git a/src/qt/aboutdialog.h b/src/qt/aboutdialog.h
index b02be74844..1b131c4dcc 100644
--- a/src/qt/aboutdialog.h
+++ b/src/qt/aboutdialog.h
@@ -19,7 +19,7 @@ class AboutDialog : public QDialog
Q_OBJECT
public:
- explicit AboutDialog(QWidget *parent = 0);
+ explicit AboutDialog(QWidget *parent);
~AboutDialog();
void setModel(ClientModel *model);
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp
index cc3afb2655..abda6c7981 100644
--- a/src/qt/addressbookpage.cpp
+++ b/src/qt/addressbookpage.cpp
@@ -158,6 +158,9 @@ void AddressBookPage::onCopyLabelAction()
void AddressBookPage::onEditAction()
{
+ if(!model)
+ return;
+
if(!ui->tableView->selectionModel())
return;
QModelIndexList indexes = ui->tableView->selectionModel()->selectedRows();
@@ -165,9 +168,9 @@ void AddressBookPage::onEditAction()
return;
EditAddressDialog dlg(
- tab == SendingTab ?
- EditAddressDialog::EditSendingAddress :
- EditAddressDialog::EditReceivingAddress);
+ tab == SendingTab ?
+ EditAddressDialog::EditSendingAddress :
+ EditAddressDialog::EditReceivingAddress, this);
dlg.setModel(model);
QModelIndex origIndex = proxyModel->mapToSource(indexes.at(0));
dlg.loadRow(origIndex.row());
@@ -180,9 +183,9 @@ void AddressBookPage::on_newAddress_clicked()
return;
EditAddressDialog dlg(
- tab == SendingTab ?
- EditAddressDialog::NewSendingAddress :
- EditAddressDialog::NewReceivingAddress, this);
+ tab == SendingTab ?
+ EditAddressDialog::NewSendingAddress :
+ EditAddressDialog::NewReceivingAddress, this);
dlg.setModel(model);
if(dlg.exec())
{
diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h
index a9192efc84..20beb51ec4 100644
--- a/src/qt/addressbookpage.h
+++ b/src/qt/addressbookpage.h
@@ -39,7 +39,7 @@ public:
ForEditing /**< Open address book for editing */
};
- explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0);
+ explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent);
~AddressBookPage();
void setModel(AddressTableModel *model);
diff --git a/src/qt/askpassphrasedialog.h b/src/qt/askpassphrasedialog.h
index 4c92afcd54..1119e0861f 100644
--- a/src/qt/askpassphrasedialog.h
+++ b/src/qt/askpassphrasedialog.h
@@ -27,7 +27,7 @@ public:
Decrypt /**< Ask passphrase and decrypt wallet */
};
- explicit AskPassphraseDialog(Mode mode, QWidget *parent = 0);
+ explicit AskPassphraseDialog(Mode mode, QWidget *parent);
~AskPassphraseDialog();
void accept();
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index a1becc12ec..a44627690f 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -10,12 +10,12 @@
#include "guiconstants.h"
#include "guiutil.h"
#include "notificator.h"
+#include "openuridialog.h"
#include "optionsdialog.h"
#include "optionsmodel.h"
#include "rpcconsole.h"
#include "walletframe.h"
#include "walletmodel.h"
-#include "openuridialog.h"
#ifdef Q_OS_MAC
#include "macdockiconhandler.h"
@@ -345,7 +345,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers());
connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
- // Receive and report messages from network/worker thread
+ // Receive and report messages from client model
connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int)));
rpcConsole->setClientModel(clientModel);
@@ -460,21 +460,25 @@ void BitcoinGUI::optionsClicked()
{
if(!clientModel || !clientModel->getOptionsModel())
return;
- OptionsDialog dlg;
+
+ OptionsDialog dlg(this);
dlg.setModel(clientModel->getOptionsModel());
dlg.exec();
}
void BitcoinGUI::aboutClicked()
{
- AboutDialog dlg;
+ if(!clientModel)
+ return;
+
+ AboutDialog dlg(this);
dlg.setModel(clientModel);
dlg.exec();
}
void BitcoinGUI::openClicked()
{
- OpenURIDialog dlg;
+ OpenURIDialog dlg(this);
if(dlg.exec())
{
emit receivedURI(dlg.getURI());
diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h
index a448c4b23f..6910c667cd 100644
--- a/src/qt/editaddressdialog.h
+++ b/src/qt/editaddressdialog.h
@@ -31,7 +31,7 @@ public:
EditSendingAddress
};
- explicit EditAddressDialog(Mode mode, QWidget *parent = 0);
+ explicit EditAddressDialog(Mode mode, QWidget *parent);
~EditAddressDialog();
void setModel(AddressTableModel *model);
diff --git a/src/qt/openuridialog.h b/src/qt/openuridialog.h
index 3b9ff0a8e1..28da7d6d9d 100644
--- a/src/qt/openuridialog.h
+++ b/src/qt/openuridialog.h
@@ -16,7 +16,7 @@ class OpenURIDialog : public QDialog
Q_OBJECT
public:
- explicit OpenURIDialog(QWidget *parent = 0);
+ explicit OpenURIDialog(QWidget *parent);
~OpenURIDialog();
QString getURI();
diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h
index 05234f645b..0181905a8c 100644
--- a/src/qt/optionsdialog.h
+++ b/src/qt/optionsdialog.h
@@ -21,7 +21,7 @@ class OptionsDialog : public QDialog
Q_OBJECT
public:
- explicit OptionsDialog(QWidget *parent = 0);
+ explicit OptionsDialog(QWidget *parent);
~OptionsDialog();
void setModel(OptionsModel *model);
diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h
index 1370d0b103..6fbf197728 100644
--- a/src/qt/rpcconsole.h
+++ b/src/qt/rpcconsole.h
@@ -19,7 +19,7 @@ class RPCConsole: public QDialog
Q_OBJECT
public:
- explicit RPCConsole(QWidget *parent = 0);
+ explicit RPCConsole(QWidget *parent);
~RPCConsole();
void setClientModel(ClientModel *model);
diff --git a/src/qt/signverifymessagedialog.h b/src/qt/signverifymessagedialog.h
index c741450b8a..bba861649a 100644
--- a/src/qt/signverifymessagedialog.h
+++ b/src/qt/signverifymessagedialog.h
@@ -18,7 +18,7 @@ class SignVerifyMessageDialog : public QDialog
Q_OBJECT
public:
- explicit SignVerifyMessageDialog(QWidget *parent = 0);
+ explicit SignVerifyMessageDialog(QWidget *parent);
~SignVerifyMessageDialog();
void setModel(WalletModel *model);
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp
index 428261693d..a0c3ce62aa 100644
--- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -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();