mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
Added to use QListWidget for Display signers, removed QTextBrowser
Added context menu for Signers QListWidget with Copy Peer Name. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3131 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c5eade329b
commit
2d839b031b
3 changed files with 66 additions and 30 deletions
|
@ -51,7 +51,7 @@ ConfCertDialog::ConfCertDialog(QWidget *parent, Qt::WFlags flags)
|
||||||
connect(ui.denyFriendButton, SIGNAL(clicked()), this, SLOT(denyFriend()));
|
connect(ui.denyFriendButton, SIGNAL(clicked()), this, SLOT(denyFriend()));
|
||||||
connect(ui.signKeyButton, SIGNAL(clicked()), this, SLOT(signGPGKey()));
|
connect(ui.signKeyButton, SIGNAL(clicked()), this, SLOT(signGPGKey()));
|
||||||
connect(ui.trusthelpButton, SIGNAL(clicked()), this, SLOT(showHelpDialog()));
|
connect(ui.trusthelpButton, SIGNAL(clicked()), this, SLOT(showHelpDialog()));
|
||||||
|
connect(ui.signers_listWidget, SIGNAL(customContextMenuRequested( QPoint ) ), this, SLOT( listWidgetContextMenuPopup( QPoint ) ) );
|
||||||
|
|
||||||
ui.applyButton->setToolTip(tr("Apply and Close"));
|
ui.applyButton->setToolTip(tr("Apply and Close"));
|
||||||
}
|
}
|
||||||
|
@ -286,11 +286,11 @@ void ConfCertDialog::loadDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.signers->clear() ;
|
ui.signers_listWidget->clear() ;
|
||||||
for(std::list<std::string>::const_iterator it(detail.gpgSigners.begin());it!=detail.gpgSigners.end();++it) {
|
for(std::list<std::string>::const_iterator it(detail.gpgSigners.begin());it!=detail.gpgSigners.end();++it) {
|
||||||
RsPeerDetails signerDetail;
|
RsPeerDetails signerDetail;
|
||||||
if (rsPeers->getGPGDetails(*it, signerDetail)) {
|
if (rsPeers->getGPGDetails(*it, signerDetail)) {
|
||||||
ui.signers->append(QString::fromStdString(signerDetail.name));
|
ui.signers_listWidget->addItem(QString::fromStdString(signerDetail.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -385,15 +385,39 @@ void ConfCertDialog::signGPGKey() {
|
||||||
* topic. */
|
* topic. */
|
||||||
void ConfCertDialog::showHelpDialog()
|
void ConfCertDialog::showHelpDialog()
|
||||||
{
|
{
|
||||||
showHelpDialog(QString("trust"));
|
showHelpDialog(QString("trust"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**< Shows the help browser and displays the given help <b>topic</b>. */
|
/**< Shows the help browser and displays the given help <b>topic</b>. */
|
||||||
void ConfCertDialog::showHelpDialog(const QString &topic)
|
void ConfCertDialog::showHelpDialog(const QString &topic)
|
||||||
{
|
{
|
||||||
static HelpBrowser *helpBrowser = 0;
|
static HelpBrowser *helpBrowser = 0;
|
||||||
if (!helpBrowser)
|
if (!helpBrowser)
|
||||||
helpBrowser = new HelpBrowser(this);
|
helpBrowser = new HelpBrowser(this);
|
||||||
helpBrowser->showWindow(topic);
|
helpBrowser->showWindow(topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfCertDialog::listWidgetContextMenuPopup( const QPoint &pos)
|
||||||
|
{
|
||||||
|
QListWidgetItem *CurrentItem = ui.signers_listWidget->currentItem();
|
||||||
|
if ( ! CurrentItem )
|
||||||
|
return;
|
||||||
|
|
||||||
|
QMenu menu( this );
|
||||||
|
QAction *copyPeer = new QAction(tr("Copy Peer Name"), this );
|
||||||
|
connect( copyPeer , SIGNAL( triggered() ), this, SLOT( copyToClipboard() ) );
|
||||||
|
menu.addAction(copyPeer );
|
||||||
|
menu.exec(QCursor::pos());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfCertDialog::copyToClipboard( )
|
||||||
|
{
|
||||||
|
QListWidgetItem *CurrentItem = ui.signers_listWidget->currentItem();
|
||||||
|
if ( ! CurrentItem )
|
||||||
|
return;
|
||||||
|
|
||||||
|
QClipboard * cb = QApplication::clipboard();
|
||||||
|
QString text = CurrentItem->text();
|
||||||
|
cb->setText( text, QClipboard::Clipboard );
|
||||||
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@ class ConfCertDialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void show(const std::string& id) ;
|
static void show(const std::string& id) ;
|
||||||
static void showTrust(const std::string& id) ;
|
static void showTrust(const std::string& id) ;
|
||||||
|
|
||||||
static ConfCertDialog *instance() ;
|
static ConfCertDialog *instance() ;
|
||||||
signals:
|
signals:
|
||||||
|
@ -47,10 +47,10 @@ private:
|
||||||
/** Default destructor */
|
/** Default destructor */
|
||||||
|
|
||||||
|
|
||||||
void loadId(std::string id);
|
void loadId(std::string id);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
void setInfo(std::string name,
|
void setInfo(std::string name,
|
||||||
std::string trust,
|
std::string trust,
|
||||||
std::string org,
|
std::string org,
|
||||||
std::string loc,
|
std::string loc,
|
||||||
|
@ -58,16 +58,17 @@ void setInfo(std::string name,
|
||||||
std::string signers);
|
std::string signers);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private slots:
|
|
||||||
/** Overloaded QWidget.show */
|
|
||||||
void show();
|
|
||||||
void showTrust();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent (QCloseEvent * event);
|
void closeEvent (QCloseEvent * event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
/** Overloaded QWidget.show */
|
||||||
|
void show();
|
||||||
|
void showTrust();
|
||||||
|
|
||||||
|
void listWidgetContextMenuPopup( const QPoint &pos);
|
||||||
|
|
||||||
void closeinfodlg();
|
void closeinfodlg();
|
||||||
void applyDialog();
|
void applyDialog();
|
||||||
void makeFriend();
|
void makeFriend();
|
||||||
|
@ -78,17 +79,17 @@ private slots:
|
||||||
/** Called when a child window requests the given help <b>topic</b>. */
|
/** Called when a child window requests the given help <b>topic</b>. */
|
||||||
void showHelpDialog(const QString &topic);
|
void showHelpDialog(const QString &topic);
|
||||||
|
|
||||||
|
void copyToClipboard();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/** Loads the saved connectidialog settings */
|
void loadDialog();
|
||||||
// void loadSettings();
|
|
||||||
|
|
||||||
void loadDialog();
|
std::string mId;
|
||||||
|
bool isPGPId;
|
||||||
|
|
||||||
std::string mId;
|
/** Qt Designer generated object */
|
||||||
bool isPGPId;
|
Ui::ConfCertDialog ui;
|
||||||
/** Qt Designer generated object */
|
|
||||||
Ui::ConfCertDialog ui;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>489</width>
|
<width>489</width>
|
||||||
<height>485</height>
|
<height>505</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="stabWidget">
|
<widget class="QTabWidget" name="stabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
|
@ -250,7 +250,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QListWidget" name="ipAddressList"/>
|
<widget class="QListWidget" name="ipAddressList">
|
||||||
|
<property name="contextMenuPolicy">
|
||||||
|
<enum>Qt::DefaultContextMenu</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::MultiSelection</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer>
|
<spacer>
|
||||||
|
@ -433,7 +440,11 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="_11">
|
<layout class="QVBoxLayout" name="_11">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextBrowser" name="signers"/>
|
<widget class="QListWidget" name="signers_listWidget">
|
||||||
|
<property name="contextMenuPolicy">
|
||||||
|
<enum>Qt::CustomContextMenu</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue