mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-30 09:48:59 -04:00
Add Remove Only Selected in Network Keyring.
This commit is contained in:
parent
bcafd06748
commit
457206272c
3 changed files with 37 additions and 13 deletions
|
@ -133,6 +133,7 @@ void NetworkDialog::connectTreeWidgetCostumPopupMenu( QPoint /*point*/ )
|
||||||
contextMnu->addAction(QIcon(IMAGE_PEERDETAILS), tr("Profile details..."), this, SLOT(peerdetails()));
|
contextMnu->addAction(QIcon(IMAGE_PEERDETAILS), tr("Profile details..."), this, SLOT(peerdetails()));
|
||||||
contextMnu->addSeparator() ;
|
contextMnu->addSeparator() ;
|
||||||
contextMnu->addAction(QIcon(), tr("Remove unused keys..."), this, SLOT(removeUnusedKeys()));
|
contextMnu->addAction(QIcon(), tr("Remove unused keys..."), this, SLOT(removeUnusedKeys()));
|
||||||
|
contextMnu->addAction(QIcon(), tr("Remove this key"), this, SLOT(removeSelectedKeys()));
|
||||||
|
|
||||||
contextMnu->exec(QCursor::pos());
|
contextMnu->exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
@ -168,6 +169,23 @@ void NetworkDialog::removeUnusedKeys()
|
||||||
tr("The selected keys below haven't been used in the last 3 months. \nDo you want to delete them permanently ? \n\nNotes: Your old keyring will be backed up.\n The removal may fail when running multiple Retroshare instances on the same machine."),FriendSelectionWidget::MODUS_CHECK,FriendSelectionWidget::SHOW_GPG | FriendSelectionWidget::SHOW_NON_FRIEND_GPG,
|
tr("The selected keys below haven't been used in the last 3 months. \nDo you want to delete them permanently ? \n\nNotes: Your old keyring will be backed up.\n The removal may fail when running multiple Retroshare instances on the same machine."),FriendSelectionWidget::MODUS_CHECK,FriendSelectionWidget::SHOW_GPG | FriendSelectionWidget::SHOW_NON_FRIEND_GPG,
|
||||||
pre_selected) ;
|
pre_selected) ;
|
||||||
|
|
||||||
|
removeKeys(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkDialog::removeSelectedKeys()
|
||||||
|
{
|
||||||
|
QModelIndexList l = ui.connectTreeWidget->selectionModel()->selection().indexes();
|
||||||
|
if(l.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::set<RsPgpId> selected;
|
||||||
|
selected.insert(RsPgpId(ui.connectTreeWidget->model()->data(ui.connectTreeWidget->model()->index(l.begin()->row(), COLUMN_PEERID)).toString().toStdString()));
|
||||||
|
|
||||||
|
removeKeys(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkDialog::removeKeys(std::set<RsPgpId> selected)
|
||||||
|
{
|
||||||
std::cerr << "Removing these keys from the keyring: " << std::endl;
|
std::cerr << "Removing these keys from the keyring: " << std::endl;
|
||||||
for(std::set<RsPgpId>::const_iterator it(selected.begin());it!=selected.end();++it)
|
for(std::set<RsPgpId>::const_iterator it(selected.begin());it!=selected.end();++it)
|
||||||
std::cerr << " " << *it << std::endl;
|
std::cerr << " " << *it << std::endl;
|
||||||
|
|
|
@ -68,6 +68,7 @@ protected:
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void removeUnusedKeys() ;
|
void removeUnusedKeys() ;
|
||||||
|
void removeSelectedKeys() ;
|
||||||
void makeFriend() ;
|
void makeFriend() ;
|
||||||
void denyFriend() ;
|
void denyFriend() ;
|
||||||
void peerdetails();
|
void peerdetails();
|
||||||
|
@ -86,6 +87,8 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
void removeKeys(std::set<RsPgpId> selected) ;
|
||||||
|
|
||||||
/* Color definitions (for standard see qss.default) */
|
/* Color definitions (for standard see qss.default) */
|
||||||
QColor mBackgroundColorSelf;
|
QColor mBackgroundColorSelf;
|
||||||
QColor mBackgroundColorOwnSign;
|
QColor mBackgroundColorOwnSign;
|
||||||
|
|
|
@ -185,7 +185,7 @@ int FriendSelectionWidget::addColumn(const QString &title)
|
||||||
return column;
|
return column;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendSelectionWidget::showEvent(QShowEvent *e)
|
void FriendSelectionWidget::showEvent(QShowEvent */*e*/)
|
||||||
{
|
{
|
||||||
if(gxsIds.empty())
|
if(gxsIds.empty())
|
||||||
loadIdentities();
|
loadIdentities();
|
||||||
|
@ -838,6 +838,9 @@ void FriendSelectionWidget::contextMenuRequested(const QPoint &/*pos*/)
|
||||||
contextMenu->addAction(QIcon(), tr("Mark all"), this, SLOT(selectAll()));
|
contextMenu->addAction(QIcon(), tr("Mark all"), this, SLOT(selectAll()));
|
||||||
contextMenu->addAction(QIcon(), tr("Mark none"), this, SLOT(deselectAll()));
|
contextMenu->addAction(QIcon(), tr("Mark none"), this, SLOT(deselectAll()));
|
||||||
}
|
}
|
||||||
|
if (mListModus == MODUS_CHECK) {
|
||||||
|
contextMenu->addAction(QIcon(), tr("Mark none"), this, SLOT(deselectAll()));
|
||||||
|
}
|
||||||
|
|
||||||
if (!mContextMenuActions.isEmpty()) {
|
if (!mContextMenuActions.isEmpty()) {
|
||||||
bool addSeparator = false;
|
bool addSeparator = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue