mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-01 11:21:25 -05:00
added latest update to IdDialog from defnax
This commit is contained in:
parent
11fb0bacc8
commit
fc94cf2c2d
@ -130,7 +130,6 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
|
|
||||||
/* Connect signals */
|
/* Connect signals */
|
||||||
connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(addIdentity()));
|
connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(addIdentity()));
|
||||||
connect(ui->todoPushButton, SIGNAL(clicked()), this, SLOT(todo()));
|
|
||||||
|
|
||||||
connect(ui->removeIdentity, SIGNAL(triggered()), this, SLOT(removeIdentity()));
|
connect(ui->removeIdentity, SIGNAL(triggered()), this, SLOT(removeIdentity()));
|
||||||
connect(ui->editIdentity, SIGNAL(triggered()), this, SLOT(editIdentity()));
|
connect(ui->editIdentity, SIGNAL(triggered()), this, SLOT(editIdentity()));
|
||||||
@ -169,8 +168,7 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
QTreeWidgetItem *headerItem = ui->idTreeWidget->headerItem();
|
QTreeWidgetItem *headerItem = ui->idTreeWidget->headerItem();
|
||||||
QString headerText = headerItem->text(RSID_COL_NICKNAME);
|
QString headerText = headerItem->text(RSID_COL_NICKNAME);
|
||||||
ui->filterLineEdit->addFilter(QIcon(), headerText, RSID_COL_NICKNAME, QString("%1 %2").arg(tr("Search"), headerText));
|
ui->filterLineEdit->addFilter(QIcon(), headerText, RSID_COL_NICKNAME, QString("%1 %2").arg(tr("Search"), headerText));
|
||||||
headerText = headerItem->text(RSID_COL_KEYID);
|
ui->filterLineEdit->addFilter(QIcon(), tr("ID"), RSID_COL_KEYID, tr("Search ID"));
|
||||||
ui->filterLineEdit->addFilter(QIcon(), headerItem->text(RSID_COL_KEYID), RSID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText));
|
|
||||||
|
|
||||||
/* Setup tree */
|
/* Setup tree */
|
||||||
ui->idTreeWidget->sortByColumn(RSID_COL_NICKNAME, Qt::AscendingOrder);
|
ui->idTreeWidget->sortByColumn(RSID_COL_NICKNAME, Qt::AscendingOrder);
|
||||||
@ -178,6 +176,8 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
ui->idTreeWidget->enableColumnCustomize(true);
|
ui->idTreeWidget->enableColumnCustomize(true);
|
||||||
ui->idTreeWidget->setColumnCustomizable(RSID_COL_NICKNAME, false);
|
ui->idTreeWidget->setColumnCustomizable(RSID_COL_NICKNAME, false);
|
||||||
ui->idTreeWidget->setColumnHidden(RSID_COL_IDTYPE, true);
|
ui->idTreeWidget->setColumnHidden(RSID_COL_IDTYPE, true);
|
||||||
|
ui->idTreeWidget->setColumnHidden(RSID_COL_KEYID, true);
|
||||||
|
|
||||||
/* Set initial column width */
|
/* Set initial column width */
|
||||||
int fontWidth = QFontMetricsF(ui->idTreeWidget->font()).width("W");
|
int fontWidth = QFontMetricsF(ui->idTreeWidget->font()).width("W");
|
||||||
ui->idTreeWidget->setColumnWidth(RSID_COL_NICKNAME, 14 * fontWidth);
|
ui->idTreeWidget->setColumnWidth(RSID_COL_NICKNAME, 14 * fontWidth);
|
||||||
@ -192,12 +192,6 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
mStateHelper->setActive(IDDIALOG_IDDETAILS, false);
|
mStateHelper->setActive(IDDIALOG_IDDETAILS, false);
|
||||||
mStateHelper->setActive(IDDIALOG_REPLIST, false);
|
mStateHelper->setActive(IDDIALOG_REPLIST, false);
|
||||||
|
|
||||||
// Hiding RepList until that part is finished.
|
|
||||||
//ui->treeWidget_RepList->setVisible(false);
|
|
||||||
|
|
||||||
#ifndef UNFINISHED
|
|
||||||
ui->todoPushButton->hide() ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QString hlp_str = tr(
|
QString hlp_str = tr(
|
||||||
" <h1><img width=\"32\" src=\":/icons/help_64.png\"> Identities</h1> \
|
" <h1><img width=\"32\" src=\":/icons/help_64.png\"> Identities</h1> \
|
||||||
@ -221,9 +215,6 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
// load settings
|
// load settings
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
|
||||||
// hide reputation sice it's currently unused
|
|
||||||
//ui->reputationGroupBox->hide();
|
|
||||||
//ui->tweakGroupBox->hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IdDialog::~IdDialog()
|
IdDialog::~IdDialog()
|
||||||
@ -235,14 +226,6 @@ IdDialog::~IdDialog()
|
|||||||
delete(mIdQueue);
|
delete(mIdQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdDialog::todo()
|
|
||||||
{
|
|
||||||
QMessageBox::information(this, "Todo",
|
|
||||||
"<b>Open points:</b><ul>"
|
|
||||||
"<li>Reputation"
|
|
||||||
"</ul>");
|
|
||||||
}
|
|
||||||
|
|
||||||
void IdDialog::processSettings(bool load)
|
void IdDialog::processSettings(bool load)
|
||||||
{
|
{
|
||||||
Settings->beginGroup("IdDialog");
|
Settings->beginGroup("IdDialog");
|
||||||
@ -491,7 +474,10 @@ void IdDialog::insertIdList(uint32_t token)
|
|||||||
}
|
}
|
||||||
if (vit == datavector.end())
|
if (vit == datavector.end())
|
||||||
{
|
{
|
||||||
|
if(item != allItem && item != contactsItem)
|
||||||
|
{
|
||||||
delete(item);
|
delete(item);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!fillIdListItem(*vit, item, ownPgpId, accept))
|
if (!fillIdListItem(*vit, item, ownPgpId, accept))
|
||||||
{
|
{
|
||||||
@ -527,9 +513,10 @@ void IdDialog::insertIdList(uint32_t token)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//int itemCount = item->childCount();
|
||||||
|
|
||||||
/* count items */
|
/* count items */
|
||||||
ui->label_count->setText( "(" + QString::number(ui->idTreeWidget->topLevelItemCount()) + ")" );
|
//ui->label_count->setText( "(" + QString::number(itemCount) + ")" );
|
||||||
|
|
||||||
filterIds();
|
filterIds();
|
||||||
|
|
||||||
@ -938,7 +925,8 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
|
|||||||
rsIdentity->getOwnIds(own_identities) ;
|
rsIdentity->getOwnIds(own_identities) ;
|
||||||
|
|
||||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||||
if (item) {
|
|
||||||
|
if(item != allItem && item != contactsItem) {
|
||||||
uint32_t item_flags = item->data(RSID_COL_KEYID,Qt::UserRole).toUInt() ;
|
uint32_t item_flags = item->data(RSID_COL_KEYID,Qt::UserRole).toUInt() ;
|
||||||
|
|
||||||
if(!(item_flags & RSID_FILTER_OWNED_BY_YOU))
|
if(!(item_flags & RSID_FILTER_OWNED_BY_YOU))
|
||||||
@ -981,7 +969,7 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
|
|||||||
rsIdentity->getIdDetails(RsGxsId(keyId), details);
|
rsIdentity->getIdDetails(RsGxsId(keyId), details);
|
||||||
|
|
||||||
QAction *addContact = contextMnu.addAction(QIcon(), tr("Add to Contacts"), this, SLOT(addtoContacts()));
|
QAction *addContact = contextMnu.addAction(QIcon(), tr("Add to Contacts"), this, SLOT(addtoContacts()));
|
||||||
QAction *removeContact = contextMnu.addAction(QIcon(), tr("Remove from Contacts"), this, SLOT(removefromContacts()));
|
QAction *removeContact = contextMnu.addAction(QIcon(":/images/cancel.png"), tr("Remove from Contacts"), this, SLOT(removefromContacts()));
|
||||||
|
|
||||||
|
|
||||||
if(details.mFlags & RS_IDENTITY_FLAGS_IS_A_CONTACT)
|
if(details.mFlags & RS_IDENTITY_FLAGS_IS_A_CONTACT)
|
||||||
@ -1018,12 +1006,13 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
|
|
||||||
contextMnu.addAction(ui->editIdentity);
|
contextMnu.addAction(ui->editIdentity);
|
||||||
contextMnu.addAction(ui->removeIdentity);
|
contextMnu.addAction(ui->removeIdentity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ private slots:
|
|||||||
|
|
||||||
void updateSelection();
|
void updateSelection();
|
||||||
|
|
||||||
void todo();
|
|
||||||
void modifyReputation();
|
void modifyReputation();
|
||||||
|
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
|
@ -111,13 +111,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="todoPushButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Todo</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="helpButton">
|
<widget class="QToolButton" name="helpButton">
|
||||||
<property name="focusPolicy">
|
<property name="focusPolicy">
|
||||||
@ -221,6 +214,18 @@
|
|||||||
<property name="contextMenuPolicy">
|
<property name="contextMenuPolicy">
|
||||||
<enum>Qt::CustomContextMenu</enum>
|
<enum>Qt::CustomContextMenu</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>22</width>
|
||||||
|
<height>22</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="indentation">
|
||||||
|
<number>24</number>
|
||||||
|
</property>
|
||||||
<property name="sortingEnabled">
|
<property name="sortingEnabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -229,7 +234,7 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Identity name</string>
|
<string>Persons</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
@ -713,7 +718,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>todoPushButton</tabstop>
|
|
||||||
<tabstop>idTreeWidget</tabstop>
|
<tabstop>idTreeWidget</tabstop>
|
||||||
<tabstop>lineEdit_Nickname</tabstop>
|
<tabstop>lineEdit_Nickname</tabstop>
|
||||||
<tabstop>lineEdit_KeyId</tabstop>
|
<tabstop>lineEdit_KeyId</tabstop>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user