mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-17 01:24:15 -05:00
added new column for owner name/ID
This commit is contained in:
parent
756ded0b5d
commit
e369ba3504
3 changed files with 35 additions and 22 deletions
|
|
@ -398,7 +398,8 @@ IdDialog::IdDialog(QWidget *parent)
|
|||
/* Setup tree */
|
||||
//ui->idTreeWidget->sortByColumn(RsIdentityListModel::COLUMN_THREAD_NAME, Qt::AscendingOrder);
|
||||
|
||||
ui->idTreeWidget->setColumnHidden(RsIdentityListModel::COLUMN_THREAD_OWNER, true);
|
||||
ui->idTreeWidget->setColumnHidden(RsIdentityListModel::COLUMN_THREAD_OWNER_ID, true);
|
||||
ui->idTreeWidget->setColumnHidden(RsIdentityListModel::COLUMN_THREAD_OWNER_NAME, true);
|
||||
ui->idTreeWidget->setColumnHidden(RsIdentityListModel::COLUMN_THREAD_ID, true);
|
||||
|
||||
ui->idTreeWidget->setItemDelegate(new RSElidedItemDelegate());
|
||||
|
|
@ -2054,7 +2055,8 @@ void IdDialog::headerContextMenuRequested(QPoint)
|
|||
};
|
||||
|
||||
addEntry(tr("Id"),RsIdentityListModel::COLUMN_THREAD_ID);
|
||||
addEntry(tr("Owner"),RsIdentityListModel::COLUMN_THREAD_OWNER);
|
||||
addEntry(tr("Owner Id"),RsIdentityListModel::COLUMN_THREAD_OWNER_ID);
|
||||
addEntry(tr("Owner Name"),RsIdentityListModel::COLUMN_THREAD_OWNER_NAME);
|
||||
addEntry(tr("Reputation"),RsIdentityListModel::COLUMN_THREAD_REPUTATION);
|
||||
|
||||
//addEntry(tr("Name"),RsIdentityListModel::COLUMN_THREAD_NAME);
|
||||
|
|
|
|||
|
|
@ -300,11 +300,14 @@ QVariant RsIdentityListModel::headerData(int section, Qt::Orientation /*orientat
|
|||
{
|
||||
case COLUMN_THREAD_NAME: return tr("Name");
|
||||
case COLUMN_THREAD_ID: return tr("Id");
|
||||
case COLUMN_THREAD_REPUTATION: return tr("Reputation");
|
||||
case COLUMN_THREAD_OWNER: return tr("Owner");
|
||||
case COLUMN_THREAD_REPUTATION: return QVariant();
|
||||
case COLUMN_THREAD_OWNER_ID: return tr("Owner Id");
|
||||
case COLUMN_THREAD_OWNER_NAME: return tr("Owner");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
if(role == Qt::DecorationRole && section == COLUMN_THREAD_REPUTATION)
|
||||
return QIcon(":/icons/flag-green.png");
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
|
@ -480,11 +483,12 @@ QVariant RsIdentityListModel::sizeHintRole(const EntryIndex& e,int col) const
|
|||
case COLUMN_THREAD_NAME: return QVariant( QSize(x_factor * 70 , y_factor*14*1.1f ));
|
||||
case COLUMN_THREAD_ID: return QVariant( QSize(x_factor * 175, y_factor*14*1.1f ));
|
||||
case COLUMN_THREAD_REPUTATION: return QVariant( QSize(x_factor * 20 , y_factor*14*1.1f ));
|
||||
case COLUMN_THREAD_OWNER: return QVariant( QSize(x_factor * 70 , y_factor*14*1.1f ));
|
||||
case COLUMN_THREAD_OWNER_NAME: return QVariant( QSize(x_factor * 70 , y_factor*14*1.1f ));
|
||||
case COLUMN_THREAD_OWNER_ID: return QVariant( QSize(x_factor * 70 , y_factor*14*1.1f ));
|
||||
}
|
||||
}
|
||||
|
||||
QVariant RsIdentityListModel::treePathRole(const EntryIndex& entry,int column) const
|
||||
QVariant RsIdentityListModel::treePathRole(const EntryIndex& entry,int /*column*/) const
|
||||
{
|
||||
if(entry.type == ENTRY_TYPE_CATEGORY)
|
||||
return QString::number((int)entry.category_index);
|
||||
|
|
@ -498,7 +502,8 @@ QVariant RsIdentityListModel::sortRole(const EntryIndex& entry,int column) const
|
|||
case COLUMN_THREAD_REPUTATION: return decorationRole(entry,column);
|
||||
|
||||
case COLUMN_THREAD_ID:
|
||||
case COLUMN_THREAD_OWNER:
|
||||
case COLUMN_THREAD_OWNER_ID:
|
||||
case COLUMN_THREAD_OWNER_NAME:
|
||||
case COLUMN_THREAD_NAME: [[__fallthrough__]];
|
||||
default:
|
||||
return displayRole(entry,column);
|
||||
|
|
@ -632,7 +637,12 @@ QVariant RsIdentityListModel::displayRole(const EntryIndex& e, int col) const
|
|||
{
|
||||
case COLUMN_THREAD_NAME: return QVariant(QString::fromUtf8(det.mNickname.c_str()));
|
||||
case COLUMN_THREAD_ID: return QVariant(QString::fromStdString(det.mId.toStdString()) );
|
||||
case COLUMN_THREAD_OWNER: if(det.mPgpId.isNull())
|
||||
case COLUMN_THREAD_OWNER_NAME: if(det.mPgpId.isNull())
|
||||
return QVariant();
|
||||
else
|
||||
return QVariant(QString::fromStdString(rsPeers->getGPGName(det.mPgpId)) );
|
||||
|
||||
case COLUMN_THREAD_OWNER_ID: if(det.mPgpId.isNull())
|
||||
return QVariant();
|
||||
else
|
||||
return QVariant(QString::fromStdString(det.mPgpId.toStdString()) );
|
||||
|
|
|
|||
|
|
@ -45,9 +45,10 @@ public:
|
|||
enum Columns {
|
||||
COLUMN_THREAD_NAME = 0x00,
|
||||
COLUMN_THREAD_ID = 0x01,
|
||||
COLUMN_THREAD_OWNER = 0x02,
|
||||
COLUMN_THREAD_REPUTATION = 0x03,
|
||||
COLUMN_THREAD_NB_COLUMNS = 0x04
|
||||
COLUMN_THREAD_OWNER_NAME = 0x02,
|
||||
COLUMN_THREAD_OWNER_ID = 0x03,
|
||||
COLUMN_THREAD_REPUTATION = 0x04,
|
||||
COLUMN_THREAD_NB_COLUMNS = 0x05
|
||||
};
|
||||
|
||||
enum Roles{ SortRole = Qt::UserRole+1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue