6 #if defined(HAVE_CONFIG_H) 22 #include <QMessageBox> 23 #include <QSortFilterProxyModel> 40 ui->
newAddress->setIcon(QIcon(
":/icons/" + theme +
"/add"));
41 ui->
copyAddress->setIcon(QIcon(
":/icons/" + theme +
"/editcopy"));
51 case SendingTab: setWindowTitle(tr(
"Choose the address to send coins to"));
break;
52 case ReceivingTab: setWindowTitle(tr(
"Choose the address to receive coins with"));
break;
54 connect(
ui->
tableView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(accept()));
55 ui->
tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
63 case SendingTab: setWindowTitle(tr(
"Sending addresses"));
break;
64 case ReceivingTab: setWindowTitle(tr(
"Receiving addresses"));
break;
71 ui->
labelExplanation->setText(tr(
"These are your Dash addresses for sending payments. Always check the amount and the receiving address before sending coins."));
75 ui->
labelExplanation->setText(tr(
"These are your Dash addresses for receiving payments. It is recommended to use a new receiving address for each transaction."));
81 QAction *copyAddressAction =
new QAction(tr(
"&Copy Address"),
this);
82 QAction *copyLabelAction =
new QAction(tr(
"Copy &Label"),
this);
83 QAction *editAction =
new QAction(tr(
"&Edit"),
this);
98 connect(editAction, SIGNAL(triggered()),
this, SLOT(
onEditAction()));
103 connect(
ui->
closeButton, SIGNAL(clicked()),
this, SLOT(accept()));
120 proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
121 proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
136 ui->
tableView->sortByColumn(0, Qt::AscendingOrder);
139 #if QT_VERSION < 0x050000 151 connect(
model, SIGNAL(rowsInserted(QModelIndex,
int,
int)),
this, SLOT(
selectNewAddress(QModelIndex,
int,
int)));
173 QModelIndexList indexes =
ui->
tableView->selectionModel()->selectedRows();
174 if(indexes.isEmpty())
182 QModelIndex origIndex =
proxyModel->mapToSource(indexes.at(0));
206 if(!table->selectionModel())
209 QModelIndexList indexes = table->selectionModel()->selectedRows();
210 if(!indexes.isEmpty())
212 table->model()->removeRow(indexes.at(0).row());
220 if(!table->selectionModel())
223 if(table->selectionModel()->hasSelection())
252 if(!table->selectionModel() || !table->model())
258 Q_FOREACH (
const QModelIndex& index, indexes) {
259 QVariant address = table->model()->data(index);
276 tr(
"Export Address List"), QString(),
277 tr(
"Comma separated file (*.csv)"), NULL);
279 if (filename.isNull())
289 if(!writer.
write()) {
290 QMessageBox::critical(
this, tr(
"Exporting Failed"),
291 tr(
"There was an error trying to save the address list to %1. Please try again.").arg(filename));
void selectNewAddress(const QModelIndex &parent, int begin, int)
static const QString Send
static const QString Receive
void setModel(AddressTableModel *model)
QPushButton * exportButton
void setModel(const QAbstractItemModel *model)
QLabel * labelExplanation
QPushButton * copyAddress
void on_deleteAddress_clicked()
AddressTableModel * model
void copyEntryData(QAbstractItemView *view, int column, int role)
QString getAddress() const
void addColumn(const QString &title, int column, int role=Qt::EditRole)
QModelIndex index(int row, int column, const QModelIndex &parent) const
QPushButton * closeButton
QString newAddressToSelect
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
void on_copyAddress_clicked()
void setupUi(QWidget *AddressBookPage)
QPushButton * deleteAddress
void contextualMenu(const QPoint &point)
QSortFilterProxyModel * proxyModel
void on_exportButton_clicked()
AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent)
void on_newAddress_clicked()
void setModel(AddressTableModel *model)