mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 19:49:28 +00:00
Receive: show address index
This commit is contained in:
parent
b93d61a164
commit
371aef9de0
3 changed files with 11 additions and 4 deletions
|
@ -26,9 +26,9 @@ ReceiveWidget::ReceiveWidget(Wallet *wallet, QWidget *parent)
|
||||||
|
|
||||||
ui->addresses->setModel(m_proxyModel);
|
ui->addresses->setModel(m_proxyModel);
|
||||||
ui->addresses->setColumnHidden(SubaddressModel::isUsed, true);
|
ui->addresses->setColumnHidden(SubaddressModel::isUsed, true);
|
||||||
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Address, QHeaderView::Stretch);
|
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Index, QHeaderView::ResizeToContents);
|
||||||
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Label, QHeaderView::ResizeToContents);
|
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Address, QHeaderView::ResizeToContents);
|
||||||
ui->addresses->header()->setMinimumSectionSize(200);
|
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Label, QHeaderView::Stretch);
|
||||||
|
|
||||||
connect(ui->addresses->selectionModel(), &QItemSelectionModel::currentChanged, [=](QModelIndex current, QModelIndex prev){
|
connect(ui->addresses->selectionModel(), &QItemSelectionModel::currentChanged, [=](QModelIndex current, QModelIndex prev){
|
||||||
this->updateQrCode();
|
this->updateQrCode();
|
||||||
|
|
|
@ -96,6 +96,10 @@ QVariant SubaddressModel::data(const QModelIndex &index, int role) const
|
||||||
QVariant SubaddressModel::parseSubaddressRow(const Monero::SubaddressRow &subaddress, const QModelIndex &index, int role) const
|
QVariant SubaddressModel::parseSubaddressRow(const Monero::SubaddressRow &subaddress, const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
|
case Index:
|
||||||
|
{
|
||||||
|
return "#" + QString::number(subaddress.getRowId());
|
||||||
|
}
|
||||||
case Address:
|
case Address:
|
||||||
{
|
{
|
||||||
QString address = QString::fromStdString(subaddress.getAddress());
|
QString address = QString::fromStdString(subaddress.getAddress());
|
||||||
|
@ -123,6 +127,8 @@ QVariant SubaddressModel::headerData(int section, Qt::Orientation orientation, i
|
||||||
if (orientation == Qt::Horizontal)
|
if (orientation == Qt::Horizontal)
|
||||||
{
|
{
|
||||||
switch(section) {
|
switch(section) {
|
||||||
|
case Index:
|
||||||
|
return QString("#");
|
||||||
case Address:
|
case Address:
|
||||||
return QString("Address");
|
return QString("Address");
|
||||||
case Label:
|
case Label:
|
||||||
|
|
|
@ -19,7 +19,8 @@ class SubaddressModel : public QAbstractTableModel
|
||||||
public:
|
public:
|
||||||
enum ModelColumn
|
enum ModelColumn
|
||||||
{
|
{
|
||||||
Address = 0,
|
Index = 0,
|
||||||
|
Address,
|
||||||
Label,
|
Label,
|
||||||
isUsed,
|
isUsed,
|
||||||
COUNT
|
COUNT
|
||||||
|
|
Loading…
Reference in a new issue