5 #if defined(HAVE_CONFIG_H) 22 #include <QMessageBox> 23 #include <QSortFilterProxyModel> 60 case SendingTab: setWindowTitle(tr(
"Choose the address to send coins to"));
break;
61 case ReceivingTab: setWindowTitle(tr(
"Choose the address to receive coins with"));
break;
63 connect(
ui->
tableView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(accept()));
64 ui->
tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
72 case SendingTab: setWindowTitle(tr(
"Sending addresses"));
break;
73 case ReceivingTab: setWindowTitle(tr(
"Receiving addresses"));
break;
80 ui->
labelExplanation->setText(tr(
"These are your Fabcoin addresses for sending payments. Always check the amount and the receiving address before sending coins."));
84 ui->
labelExplanation->setText(tr(
"These are your Fabcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction."));
90 QAction *copyAddressAction =
new QAction(tr(
"&Copy Address"),
this);
91 QAction *copyLabelAction =
new QAction(tr(
"Copy &Label"),
this);
92 QAction *editAction =
new QAction(tr(
"&Edit"),
this);
97 contextMenu->addAction(copyAddressAction);
98 contextMenu->addAction(copyLabelAction);
99 contextMenu->addAction(editAction);
102 contextMenu->addSeparator();
107 connect(editAction, SIGNAL(triggered()),
this, SLOT(
onEditAction()));
112 connect(
ui->
closeButton, SIGNAL(clicked()),
this, SLOT(accept()));
122 this->
model = _model;
129 proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
130 proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
145 ui->
tableView->sortByColumn(0, Qt::AscendingOrder);
148 #if QT_VERSION < 0x050000 160 connect(_model, SIGNAL(rowsInserted(QModelIndex,
int,
int)),
this, SLOT(
selectNewAddress(QModelIndex,
int,
int)));
182 QModelIndexList indexes =
ui->
tableView->selectionModel()->selectedRows();
183 if(indexes.isEmpty())
191 QModelIndex origIndex =
proxyModel->mapToSource(indexes.at(0));
215 if(!table->selectionModel())
218 QModelIndexList indexes = table->selectionModel()->selectedRows();
219 if(!indexes.isEmpty())
221 table->model()->removeRow(indexes.at(0).row());
229 if(!table->selectionModel())
232 if(table->selectionModel()->hasSelection())
261 if(!table->selectionModel() || !table->model())
267 for (
const QModelIndex& index : indexes) {
268 QVariant
address = table->model()->data(index);
278 QDialog::done(retval);
285 tr(
"Export Address List"), QString(),
286 tr(
"Comma separated file (*.csv)"),
nullptr);
288 if (filename.isNull())
298 if(!writer.
write()) {
299 QMessageBox::critical(
this, tr(
"Exporting Failed"),
300 tr(
"There was an error trying to save the address list to %1. Please try again.").arg(filename));
void on_newAddress_clicked()
Create a new address for receiving coins and / or add a new address book entry.
void onCopyLabelAction()
Copy label of currently selected address entry to clipboard (no button)
void addColumn(const QString &title, int column, int role=Qt::EditRole)
QModelIndex index(int row, int column, const QModelIndex &parent) const
QString getAddress() const
#define SetObjectStyleSheet(object, name)
void setModel(AddressTableModel *model)
void onEditAction()
Edit currently selected address entry (no button)
AddressTableModel * model
QPushButton * copyAddress
AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent)
QSortFilterProxyModel * proxyModel
void on_exportButton_clicked()
Export button clicked.
Open address book for editing.
Open address book to pick address.
Export a Qt table model to a CSV file.
QString newAddressToSelect
static const QString Send
Specifies send address.
void selectNewAddress(const QModelIndex &parent, int begin, int)
New entry/entries were added to address table.
QPushButton * closeButton
void setModel(AddressTableModel *model)
void setupUi(QWidget *AddressBookPage)
QPushButton * deleteAddress
void on_copyAddress_clicked()
Copy address of currently selected address entry to clipboard.
Widget that shows a list of sending or receiving addresses.
Qt model of the address book in the core.
void selectionChanged()
Set button states based on selected tab and selection.
QPushButton * exportButton
void setModel(const QAbstractItemModel *model)
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when ...
static const QString Receive
Specifies receive address.
Dialog for editing an address and associated information.
struct evm_uint160be address(struct evm_env *env)
void copyEntryData(QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
void contextualMenu(const QPoint &point)
Spawn contextual menu (right mouse menu) for address book entry.
QLabel * labelExplanation
void on_deleteAddress_clicked()
Delete currently selected address entry.
bool write()
Perform export of the model to CSV.
Type of address (Send or Receive)