mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Added Export Cert to Contect menu
renamed View Button to Menu Added Add Friend and Export Cert to Menu Button git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1384 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
063c4bb44f
commit
a112c2d02a
5 changed files with 109 additions and 14 deletions
|
@ -59,11 +59,14 @@
|
||||||
#define IMAGE_PEERDETAILS ":/images/peerdetails_16x16.png"
|
#define IMAGE_PEERDETAILS ":/images/peerdetails_16x16.png"
|
||||||
#define IMAGE_AUTH ":/images/encrypted16.png"
|
#define IMAGE_AUTH ":/images/encrypted16.png"
|
||||||
#define IMAGE_MAKEFRIEND ":/images/user/add_user16.png"
|
#define IMAGE_MAKEFRIEND ":/images/user/add_user16.png"
|
||||||
|
#define IMAGE_EXPIORT ":/images/exportpeers_16x16.png"
|
||||||
|
|
||||||
/* Images for Status icons */
|
/* Images for Status icons */
|
||||||
#define IMAGE_AUTHED ":/images/accepted16.png"
|
#define IMAGE_AUTHED ":/images/accepted16.png"
|
||||||
#define IMAGE_DENIED ":/images/denied16.png"
|
#define IMAGE_DENIED ":/images/denied16.png"
|
||||||
#define IMAGE_TRUSTED ":/images/rs-2.png"
|
#define IMAGE_TRUSTED ":/images/rs-2.png"
|
||||||
|
|
||||||
|
|
||||||
RsCertId getNeighRsCertId(QTreeWidgetItem *i);
|
RsCertId getNeighRsCertId(QTreeWidgetItem *i);
|
||||||
|
|
||||||
/******
|
/******
|
||||||
|
@ -118,7 +121,7 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
||||||
QTreeWidgetItem * headerItem = ui.connecttreeWidget->headerItem();
|
QTreeWidgetItem * headerItem = ui.connecttreeWidget->headerItem();
|
||||||
headerItem->setTextAlignment(0, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(0, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(1, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(1, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(2, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(2, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(3, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(3, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(4, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(4, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(5, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(5, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
@ -126,15 +129,8 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
||||||
headerItem->setTextAlignment(7, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(7, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(8, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(8, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(9, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(9, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
|
||||||
/*networkview = new NetworkView(ui.networkviewTab);
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
|
||||||
layout->addWidget(networkview);
|
|
||||||
ui.networkviewTab->setLayout(layout);
|
|
||||||
layout->setSpacing( 0 );
|
|
||||||
layout->setMargin( 0 );*/
|
|
||||||
|
|
||||||
ui.networkTab->addTab(new NetworkView(),QString(tr("Network View")));
|
ui.networkTab->addTab(new NetworkView(),QString(tr("Network View")));
|
||||||
ui.networkTab->addTab(new TrustView(),QString(tr("Trust matrix")));
|
ui.networkTab->addTab(new TrustView(),QString(tr("Trust matrix")));
|
||||||
|
|
||||||
// Set Log infos
|
// Set Log infos
|
||||||
|
@ -142,7 +138,11 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
||||||
|
|
||||||
setLogInfo(tr("Welcome to RetroShare."), QString::fromUtf8("blue"));
|
setLogInfo(tr("Welcome to RetroShare."), QString::fromUtf8("blue"));
|
||||||
|
|
||||||
QMenu *menu = new QMenu(tr("View"));
|
QMenu *menu = new QMenu(tr("Menu"));
|
||||||
|
menu->addAction(ui.actionAddFriend);
|
||||||
|
//menu->addAction(ui.actionCopyKey);
|
||||||
|
menu->addAction(ui.actionExportKey);
|
||||||
|
menu->addSeparator();
|
||||||
menu->addAction(ui.actionTabsright);
|
menu->addAction(ui.actionTabsright);
|
||||||
menu->addAction(ui.actionTabswest);
|
menu->addAction(ui.actionTabswest);
|
||||||
menu->addAction(ui.actionTabssouth);
|
menu->addAction(ui.actionTabssouth);
|
||||||
|
@ -217,14 +217,22 @@ void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
|
||||||
connect( deleteCertAct, SIGNAL( triggered() ), this, SLOT( deleteCert() ) );
|
connect( deleteCertAct, SIGNAL( triggered() ), this, SLOT( deleteCert() ) );
|
||||||
contextMnu.addAction( deleteCertAct );
|
contextMnu.addAction( deleteCertAct );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( peer_id == rsPeers->getOwnId())
|
||||||
|
{
|
||||||
|
exportcertAct = new QAction(QIcon(IMAGE_EXPIORT), tr( "Export my Cert" ), this );
|
||||||
|
connect( exportcertAct , SIGNAL( triggered() ), this, SLOT( on_actionExportKey_activated() ) );
|
||||||
|
contextMnu.addAction( exportcertAct);
|
||||||
|
}
|
||||||
|
|
||||||
peerdetailsAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Peer details..." ), this );
|
peerdetailsAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Peer details..." ), this );
|
||||||
connect( peerdetailsAct , SIGNAL( triggered() ), this, SLOT( peerdetails() ) );
|
connect( peerdetailsAct , SIGNAL( triggered() ), this, SLOT( peerdetails() ) );
|
||||||
contextMnu.addAction( peerdetailsAct);
|
contextMnu.addAction( peerdetailsAct);
|
||||||
|
|
||||||
|
|
||||||
contextMnu.exec( mevent->globalPos() );
|
contextMnu.exec( mevent->globalPos() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,6 +620,73 @@ void NetworkDialog::authneighbour()
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Open a QFileDialog to browse for a pem/pqi file. */
|
||||||
|
void NetworkDialog::on_actionAddFriend_activated()
|
||||||
|
{
|
||||||
|
/* Create a new input dialog, which allows users to create files, too */
|
||||||
|
QFileDialog *dialog = new QFileDialog(this, tr("Select a pem/pqi File"));
|
||||||
|
//dialog->setDirectory(QFileInfo(ui.lineTorConfig->text()).absoluteDir());
|
||||||
|
//dialog->selectFile(QFileInfo(ui.lineTorConfig->text()).fileName());
|
||||||
|
dialog->setFileMode(QFileDialog::AnyFile);
|
||||||
|
dialog->setReadOnly(false);
|
||||||
|
|
||||||
|
/* Prompt the user to select a file or create a new one */
|
||||||
|
if (!dialog->exec() || dialog->selectedFiles().isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QString filename = QDir::convertSeparators(dialog->selectedFiles().at(0));
|
||||||
|
|
||||||
|
/* Check if the file exists */
|
||||||
|
QFile torrcFile(filename);
|
||||||
|
if (!QFileInfo(filename).exists()) {
|
||||||
|
/* The given file does not exist. Should we create it? */
|
||||||
|
int response = VMessageBox::question(this,
|
||||||
|
tr("File Not Found"),
|
||||||
|
tr("%1 does not exist. Would you like to create it?")
|
||||||
|
.arg(filename),
|
||||||
|
VMessageBox::Yes, VMessageBox::No);
|
||||||
|
|
||||||
|
if (response == VMessageBox::No) {
|
||||||
|
/* Don't create it. Just bail. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* Attempt to create the specified file */
|
||||||
|
if (!torrcFile.open(QIODevice::WriteOnly)) {
|
||||||
|
VMessageBox::warning(this,
|
||||||
|
tr("Failed to Create File"),
|
||||||
|
tr("Unable to create %1 [%2]").arg(filename)
|
||||||
|
.arg(torrcFile.errorString()),
|
||||||
|
VMessageBox::Ok);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//ui.lineTorConfig->setText(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NetworkDialog::on_actionExportKey_activated()
|
||||||
|
{
|
||||||
|
qDebug() << " exportcert";
|
||||||
|
|
||||||
|
QString qdir = QFileDialog::getSaveFileName(this,
|
||||||
|
"Please choose a filename",
|
||||||
|
QDir::homePath(),
|
||||||
|
"RetroShare Certificate (*.pqi)");
|
||||||
|
|
||||||
|
if ( rsPeers->SaveCertificateToFile(rsPeers->getOwnId(), qdir.toStdString()) )
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("RetroShare"),
|
||||||
|
tr("Certificate file successfully created"),
|
||||||
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("RetroShare"),
|
||||||
|
tr("Sorry, certificate file creation failed"),
|
||||||
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update Log Info information
|
// Update Log Info information
|
||||||
void NetworkDialog::setLogInfo(QString info, QColor color) {
|
void NetworkDialog::setLogInfo(QString info, QColor color) {
|
||||||
static unsigned int nbLines = 0;
|
static unsigned int nbLines = 0;
|
||||||
|
|
|
@ -68,6 +68,10 @@ private slots:
|
||||||
|
|
||||||
void authneighbour();
|
void authneighbour();
|
||||||
void addneighbour();
|
void addneighbour();
|
||||||
|
|
||||||
|
void on_actionAddFriend_activated();
|
||||||
|
//void on_actionCopyKey_activated();
|
||||||
|
void on_actionExportKey_activated();
|
||||||
|
|
||||||
void on_actionClearLog_triggered();
|
void on_actionClearLog_triggered();
|
||||||
void displayInfoLogMenu(const QPoint& pos);
|
void displayInfoLogMenu(const QPoint& pos);
|
||||||
|
@ -101,6 +105,7 @@ private:
|
||||||
QAction* makefriendAct;
|
QAction* makefriendAct;
|
||||||
QAction* authAct;
|
QAction* authAct;
|
||||||
QAction* loadcertAct;
|
QAction* loadcertAct;
|
||||||
|
QAction* exportcertAct;
|
||||||
|
|
||||||
/* connection dialog */
|
/* connection dialog */
|
||||||
ConnectDialog *connectdialog;
|
ConnectDialog *connectdialog;
|
||||||
|
|
|
@ -98,7 +98,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<widget class="QPushButton" name="viewButton">
|
<widget class="QPushButton" name="viewButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>View</string>
|
<string>Menu</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -531,6 +531,21 @@ p, li { white-space: pre-wrap; }
|
||||||
<string>Set Tabs Triangular</string>
|
<string>Set Tabs Triangular</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionAddFriend">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add Friend</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionCopyKey">
|
||||||
|
<property name="text">
|
||||||
|
<string>Copy My Key to Clipboard</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionExportKey">
|
||||||
|
<property name="text">
|
||||||
|
<string>Export My Key</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="images.qrc"/>
|
<include location="images.qrc"/>
|
||||||
|
|
|
@ -106,7 +106,7 @@ SearchDialog::SearchDialog(QWidget *parent)
|
||||||
ui.AdvancedSearchPanel->hide();
|
ui.AdvancedSearchPanel->hide();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
connect(ui.toggleAdvancedSearchBtn, SIGNAL(toggled(bool)), this, SLOT(toggleAdvancedSearchDialog(bool)));
|
connect(ui.toggleAdvancedSearchBtn, SIGNAL(clicked()), this, SLOT(showAdvSearchDialog()));
|
||||||
//connect(ui.focusAdvSearchDialogBtn, SIGNAL(clicked()), this, SLOT(showAdvSearchDialog()));
|
//connect(ui.focusAdvSearchDialogBtn, SIGNAL(clicked()), this, SLOT(showAdvSearchDialog()));
|
||||||
|
|
||||||
/* End Advanced Search Panel specifics */
|
/* End Advanced Search Panel specifics */
|
||||||
|
|
|
@ -740,7 +740,7 @@ p, li { white-space: pre-wrap; }
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Toggle advanced searching on and off.</string>
|
<string>Open advanced searching</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
|
@ -756,7 +756,7 @@ p, li { white-space: pre-wrap; }
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue