mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 23:36:59 -05: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
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QMenu>
|
||||
|
||||
#include "IdDialog.h"
|
||||
#include "gui/gxs/GxsIdTreeWidgetItem.h"
|
||||
@ -61,6 +62,8 @@
|
||||
#define RSID_FILTER_PSEUDONYMS 0x0008
|
||||
#define RSID_FILTER_ALL 0xffff
|
||||
|
||||
#define IMAGE_EDIT ":/images/edit_16.png"
|
||||
|
||||
/** Constructor */
|
||||
IdDialog::IdDialog(QWidget *parent)
|
||||
: RsGxsUpdateBroadcastPage(rsIdentity, parent)
|
||||
@ -125,7 +128,10 @@ IdDialog::IdDialog(QWidget *parent)
|
||||
connect(ui.toolButton_NewId, SIGNAL(clicked()), this, SLOT(addIdentity()));
|
||||
connect(ui.todoPushButton, SIGNAL(clicked()), this, SLOT(todo()));
|
||||
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(customContextMenuRequested(QPoint)), this, SLOT(IdListCustomPopupMenu(QPoint)));
|
||||
|
||||
connect(ui.filterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterComboBoxChanged()));
|
||||
connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
|
||||
@ -148,6 +154,8 @@ IdDialog::IdDialog(QWidget *parent)
|
||||
|
||||
/* Setup tree */
|
||||
ui.treeWidget_IdList->sortByColumn(RSID_COL_NICKNAME, Qt::AscendingOrder);
|
||||
ui.treeWidget_IdList->setContextMenuPolicy(Qt::CustomContextMenu) ;
|
||||
|
||||
|
||||
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
||||
|
||||
@ -489,6 +497,7 @@ void IdDialog::insertIdDetails(uint32_t token)
|
||||
// No Delete Ids yet!
|
||||
mStateHelper->setWidgetEnabled(ui.toolButton_Delete, /*true*/ false);
|
||||
mStateHelper->setWidgetEnabled(ui.toolButton_EditId, true);
|
||||
ui.editIdentity->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -496,6 +505,7 @@ void IdDialog::insertIdDetails(uint32_t token)
|
||||
mStateHelper->setWidgetEnabled(ui.toolButton_Reputation, /*true*/ false);
|
||||
mStateHelper->setWidgetEnabled(ui.toolButton_Delete, false);
|
||||
mStateHelper->setWidgetEnabled(ui.toolButton_EditId, false);
|
||||
ui.editIdentity->setEnabled(false);
|
||||
}
|
||||
|
||||
/* now fill in the reputation information */
|
||||
@ -720,3 +730,14 @@ void IdDialog::loadRequest(const TokenQueue * /*queue*/, const TokenRequest &req
|
||||
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 modifyReputation();
|
||||
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void IdListCustomPopupMenu( QPoint point );
|
||||
|
||||
private:
|
||||
void requestIdDetails(RsGxsGroupId &id);
|
||||
|
@ -39,7 +39,16 @@
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<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>
|
||||
</property>
|
||||
<item>
|
||||
@ -194,7 +203,16 @@
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<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>
|
||||
</property>
|
||||
<item>
|
||||
@ -652,6 +670,18 @@
|
||||
</widget>
|
||||
</item>
|
||||
</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>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user