diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-06-13 12:07:32 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-06-13 12:07:32 +0200 |
commit | e83474f2ebbae84394f0b86cfea977d3024bd33f (patch) | |
tree | 79beb7a74419dcf099df5f4bb03d0c780c6a1c49 /src/qt/addressbookdialog.cpp | |
parent | 249300aebe682dc1a7398794b14f0d6ebde0aee7 (diff) |
Address book: select action (edit/select) based on context
Diffstat (limited to 'src/qt/addressbookdialog.cpp')
-rw-r--r-- | src/qt/addressbookdialog.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/qt/addressbookdialog.cpp b/src/qt/addressbookdialog.cpp index 90950a6441..c716cd3eea 100644 --- a/src/qt/addressbookdialog.cpp +++ b/src/qt/addressbookdialog.cpp @@ -8,12 +8,24 @@ #include <QClipboard> #include <QDebug> -AddressBookDialog::AddressBookDialog(QWidget *parent) : +AddressBookDialog::AddressBookDialog(Mode mode, QWidget *parent) : QDialog(parent), ui(new Ui::AddressBookDialog), model(0) { ui->setupUi(this); + + switch(mode) + { + case ForSending: + connect(ui->receiveTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_buttonBox_accepted())); + connect(ui->sendTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_buttonBox_accepted())); + break; + case ForEditing: + connect(ui->receiveTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_editButton_clicked())); + connect(ui->sendTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_editButton_clicked())); + break; + } } AddressBookDialog::~AddressBookDialog() @@ -126,6 +138,7 @@ void AddressBookDialog::on_newAddressButton_clicked() void AddressBookDialog::on_tabWidget_currentChanged(int index) { + // Enable/disable buttons based on selected tab switch(index) { case SendingTab: @@ -166,3 +179,4 @@ void AddressBookDialog::on_buttonBox_accepted() reject(); } } + |