mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-15 18:09:32 -04:00
Added context menu action for "Edit Identity"
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7323 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
31ee64a4f8
commit
14b55a720c
3 changed files with 56 additions and 2 deletions
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QMenu>
|
||||||
|
|
||||||
#include "IdDialog.h"
|
#include "IdDialog.h"
|
||||||
#include "gui/gxs/GxsIdTreeWidgetItem.h"
|
#include "gui/gxs/GxsIdTreeWidgetItem.h"
|
||||||
|
@ -61,6 +62,8 @@
|
||||||
#define RSID_FILTER_PSEUDONYMS 0x0008
|
#define RSID_FILTER_PSEUDONYMS 0x0008
|
||||||
#define RSID_FILTER_ALL 0xffff
|
#define RSID_FILTER_ALL 0xffff
|
||||||
|
|
||||||
|
#define IMAGE_EDIT ":/images/edit_16.png"
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
IdDialog::IdDialog(QWidget *parent)
|
IdDialog::IdDialog(QWidget *parent)
|
||||||
: RsGxsUpdateBroadcastPage(rsIdentity, parent)
|
: RsGxsUpdateBroadcastPage(rsIdentity, parent)
|
||||||
|
@ -125,7 +128,10 @@ IdDialog::IdDialog(QWidget *parent)
|
||||||
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.todoPushButton, SIGNAL(clicked()), this, SLOT(todo()));
|
||||||
connect(ui.toolButton_EditId, SIGNAL(clicked()), this, SLOT(editIdentity()));
|
connect(ui.toolButton_EditId, SIGNAL(clicked()), this, SLOT(editIdentity()));
|
||||||
|
connect(ui.editIdentity, SIGNAL(triggered()), this, SLOT(editIdentity()));
|
||||||
|
|
||||||
connect(ui.treeWidget_IdList, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelection()));
|
connect(ui.treeWidget_IdList, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelection()));
|
||||||
|
connect(ui.treeWidget_IdList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(IdListCustomPopupMenu(QPoint)));
|
||||||
|
|
||||||
connect(ui.filterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterComboBoxChanged()));
|
connect(ui.filterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterComboBoxChanged()));
|
||||||
connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
|
connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
|
||||||
|
@ -148,6 +154,8 @@ IdDialog::IdDialog(QWidget *parent)
|
||||||
|
|
||||||
/* Setup tree */
|
/* Setup tree */
|
||||||
ui.treeWidget_IdList->sortByColumn(RSID_COL_NICKNAME, Qt::AscendingOrder);
|
ui.treeWidget_IdList->sortByColumn(RSID_COL_NICKNAME, Qt::AscendingOrder);
|
||||||
|
ui.treeWidget_IdList->setContextMenuPolicy(Qt::CustomContextMenu) ;
|
||||||
|
|
||||||
|
|
||||||
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
||||||
|
|
||||||
|
@ -489,6 +497,7 @@ void IdDialog::insertIdDetails(uint32_t token)
|
||||||
// No Delete Ids yet!
|
// No Delete Ids yet!
|
||||||
mStateHelper->setWidgetEnabled(ui.toolButton_Delete, /*true*/ false);
|
mStateHelper->setWidgetEnabled(ui.toolButton_Delete, /*true*/ false);
|
||||||
mStateHelper->setWidgetEnabled(ui.toolButton_EditId, true);
|
mStateHelper->setWidgetEnabled(ui.toolButton_EditId, true);
|
||||||
|
ui.editIdentity->setEnabled(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -496,6 +505,7 @@ void IdDialog::insertIdDetails(uint32_t token)
|
||||||
mStateHelper->setWidgetEnabled(ui.toolButton_Reputation, /*true*/ false);
|
mStateHelper->setWidgetEnabled(ui.toolButton_Reputation, /*true*/ false);
|
||||||
mStateHelper->setWidgetEnabled(ui.toolButton_Delete, false);
|
mStateHelper->setWidgetEnabled(ui.toolButton_Delete, false);
|
||||||
mStateHelper->setWidgetEnabled(ui.toolButton_EditId, false);
|
mStateHelper->setWidgetEnabled(ui.toolButton_EditId, false);
|
||||||
|
ui.editIdentity->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now fill in the reputation information */
|
/* now fill in the reputation information */
|
||||||
|
@ -720,3 +730,14 @@ void IdDialog::loadRequest(const TokenQueue * /*queue*/, const TokenRequest &req
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IdDialog::IdListCustomPopupMenu( QPoint )
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
QMenu contextMnu( this );
|
||||||
|
|
||||||
|
contextMnu.addAction(ui.editIdentity);
|
||||||
|
|
||||||
|
contextMnu.exec(QCursor::pos());
|
||||||
|
}
|
|
@ -59,6 +59,9 @@ private slots:
|
||||||
|
|
||||||
void todo();
|
void todo();
|
||||||
void modifyReputation();
|
void modifyReputation();
|
||||||
|
|
||||||
|
/** Create the context popup menu and it's submenus */
|
||||||
|
void IdListCustomPopupMenu( QPoint point );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void requestIdDetails(RsGxsGroupId &id);
|
void requestIdDetails(RsGxsGroupId &id);
|
||||||
|
|
|
@ -39,7 +39,16 @@
|
||||||
<enum>QFrame::Sunken</enum>
|
<enum>QFrame::Sunken</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -194,7 +203,16 @@
|
||||||
<enum>QFrame::Sunken</enum>
|
<enum>QFrame::Sunken</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -652,6 +670,18 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
<action name="editIdentity">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../images.qrc">
|
||||||
|
<normaloff>:/images/edit_16.png</normaloff>:/images/edit_16.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Edit Identity</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Edit Identity</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue