mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
clean up, removed not needed old ConnectionsDialog
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1843 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0837cc86ef
commit
0f69d49bde
@ -1,425 +0,0 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2006, crypton
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include "rshare.h"
|
||||
#include "common/vmessagebox.h"
|
||||
#include "ConnectionsDialog.h"
|
||||
#include "connect/ConnectDialog.h"
|
||||
#include "authdlg/AuthorizationDialog.h"
|
||||
#include "rsiface/rsiface.h"
|
||||
#include "rsiface/rstypes.h"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
#include <QContextMenuEvent>
|
||||
#include <QMenu>
|
||||
#include <QCursor>
|
||||
#include <QPoint>
|
||||
#include <QMouseEvent>
|
||||
#include <QPixmap>
|
||||
#include <QHeaderView>
|
||||
|
||||
/* Images for context menu icons */
|
||||
#define IMAGE_LOADCERT ":/images/loadcert16.png"
|
||||
#define IMAGE_PEERDETAILS ":/images/peerdetails_16x16.png"
|
||||
#define IMAGE_AUTH ":/images/encrypted16.png"
|
||||
/* Images for Status icons */
|
||||
#define IMAGE_AUTHED ":/images/dauthed.png"
|
||||
#define IMAGE_DENIED ":/images/ddeny.png"
|
||||
|
||||
RsCertId getNeighRsCertId(QTreeWidgetItem *i);
|
||||
|
||||
/****
|
||||
* #define CONN_DEBUG 1
|
||||
****/
|
||||
|
||||
/** Constructor */
|
||||
ConnectionsDialog::ConnectionsDialog(QWidget *parent)
|
||||
: MainPage(parent), connectdialog(NULL)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
connect( ui.connecttreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( connecttreeWidgetCostumPopupMenu( QPoint ) ) );
|
||||
|
||||
/* create a single connect dialog */
|
||||
connectdialog = new ConnectDialog();
|
||||
|
||||
/* hide the Tree +/- */
|
||||
ui.connecttreeWidget -> setRootIsDecorated( false );
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * _header = ui.connecttreeWidget->header () ;
|
||||
_header->setResizeMode (0, QHeaderView::Custom);
|
||||
_header->setResizeMode (1, QHeaderView::Interactive);
|
||||
_header->setResizeMode (2, QHeaderView::Interactive);
|
||||
_header->setResizeMode (3, QHeaderView::Interactive);
|
||||
_header->setResizeMode (4, QHeaderView::Interactive);
|
||||
_header->setResizeMode (5, QHeaderView::Interactive);
|
||||
_header->setResizeMode (6, QHeaderView::Interactive);
|
||||
_header->setResizeMode (7, QHeaderView::Interactive);
|
||||
_header->setResizeMode (8, QHeaderView::Interactive);
|
||||
_header->setResizeMode (9, QHeaderView::Interactive);
|
||||
_header->setResizeMode (10, QHeaderView::Interactive);
|
||||
|
||||
_header->resizeSection ( 0, 25 );
|
||||
_header->resizeSection ( 1, 100 );
|
||||
_header->resizeSection ( 2, 100 );
|
||||
_header->resizeSection ( 3, 100 );
|
||||
_header->resizeSection ( 4, 100 );
|
||||
_header->resizeSection ( 5, 200);
|
||||
_header->resizeSection ( 6, 100 );
|
||||
_header->resizeSection ( 7, 100 );
|
||||
_header->resizeSection ( 8, 100 );
|
||||
_header->resizeSection ( 9, 100 );
|
||||
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void ConnectionsDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
|
||||
{
|
||||
|
||||
QMenu contextMnu( this );
|
||||
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
|
||||
|
||||
peerdetailsAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Peer Details / Authenticate " ), this );
|
||||
connect( peerdetailsAct , SIGNAL( triggered() ), this, SLOT( peerdetails() ) );
|
||||
|
||||
//authAct = new QAction(QIcon(IMAGE_AUTH), tr( "Authenticate" ), this );
|
||||
//connect( authAct , SIGNAL( triggered() ), this, SLOT( peerdetails() ) );
|
||||
|
||||
loadcertAct = new QAction(QIcon(IMAGE_LOADCERT), tr( "Load Certificate" ), this );
|
||||
connect( loadcertAct , SIGNAL( triggered() ), this, SLOT( loadneighbour() ) );
|
||||
|
||||
|
||||
contextMnu.clear();
|
||||
contextMnu.addAction( peerdetailsAct);
|
||||
//contextMnu.addAction( authAct);
|
||||
contextMnu.addAction( loadcertAct);
|
||||
contextMnu.exec( mevent->globalPos() );
|
||||
}
|
||||
|
||||
/** Shows Peer Information/Auth Dialog */
|
||||
void ConnectionsDialog::peerdetails()
|
||||
{
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "ConnectionsDialog::peerdetails()" << std::endl;
|
||||
#endif
|
||||
|
||||
QTreeWidgetItem *wi = getCurrentNeighbour();
|
||||
if (!wi)
|
||||
return;
|
||||
|
||||
RsCertId id = getNeighRsCertId(wi);
|
||||
std::ostringstream out;
|
||||
out << id;
|
||||
|
||||
showpeerdetails(out.str());
|
||||
}
|
||||
|
||||
/** Shows Peer Information/Auth Dialog */
|
||||
void ConnectionsDialog::showpeerdetails(std::string id)
|
||||
{
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "ConnectionsDialog::showpeerdetails()" << std::endl;
|
||||
#endif
|
||||
|
||||
if ((connectdialog) && (connectdialog -> loadPeer(id)))
|
||||
{
|
||||
connectdialog->show();
|
||||
}
|
||||
}
|
||||
|
||||
/** Shows Connect Dialog */
|
||||
void ConnectionsDialog::showAuthDialog()
|
||||
{
|
||||
static AuthorizationDialog *authorizationdialog = new AuthorizationDialog();
|
||||
QTreeWidgetItem *wi = getCurrentNeighbour();
|
||||
if (!wi)
|
||||
return;
|
||||
|
||||
RsCertId id = getNeighRsCertId(wi);
|
||||
std::ostringstream out;
|
||||
out << id;
|
||||
authorizationdialog->setAuthCode(out.str(), wi->text(9).toStdString());
|
||||
authorizationdialog->show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** Open a QFileDialog to browse for a pem/pqi file. */
|
||||
void ConnectionsDialog::loadcert()
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include <sstream>
|
||||
|
||||
/* get the list of Neighbours from the RsIface. */
|
||||
void ConnectionsDialog::insertConnect()
|
||||
{
|
||||
rsiface->lockData(); /* Lock Interface */
|
||||
|
||||
std::map<RsCertId,NeighbourInfo>::const_iterator it;
|
||||
const std::map<RsCertId,NeighbourInfo> &neighs =
|
||||
rsiface->getNeighbourMap();
|
||||
|
||||
/* get a link to the table */
|
||||
QTreeWidget *connectWidget = ui.connecttreeWidget;
|
||||
|
||||
/* remove old items ??? */
|
||||
connectWidget->clear();
|
||||
connectWidget->setColumnCount(11);
|
||||
|
||||
QList<QTreeWidgetItem *> items;
|
||||
for(it = neighs.begin(); it != neighs.end(); it++)
|
||||
{
|
||||
/* make a widget per friend */
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
|
||||
|
||||
/* add all the labels */
|
||||
|
||||
/* (0) Status Icon */
|
||||
item -> setText(0, "");
|
||||
|
||||
/* (1) Accept/Deny */
|
||||
item -> setText(1, QString::fromStdString(it->second.acceptString));
|
||||
/* (2) Trust Level */
|
||||
item -> setText(2, QString::fromStdString(it->second.trustString));
|
||||
/* (3) Last Connect */
|
||||
item -> setText(3, QString::fromStdString(it->second.lastConnect));
|
||||
/* (4) Person */
|
||||
item -> setText(4, QString::fromStdString(it->second.name));
|
||||
|
||||
/* (5) Peer Address */
|
||||
item -> setText(5, QString::fromStdString(it->second.peerAddress));
|
||||
|
||||
/* Others */
|
||||
item -> setText(6, QString::fromStdString(it->second.org));
|
||||
item -> setText(7, QString::fromStdString(it->second.loc));
|
||||
item -> setText(8, QString::fromStdString(it->second.country));
|
||||
|
||||
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << it -> second.id;
|
||||
item -> setText(9, QString::fromStdString(out.str()));
|
||||
}
|
||||
|
||||
item -> setText(10, QString::fromStdString(it->second.authCode));
|
||||
|
||||
|
||||
/* change background */
|
||||
int i;
|
||||
if (it->second.acceptString == "Accept")
|
||||
{
|
||||
if (it->second.lastConnect != "Never")
|
||||
{
|
||||
/* bright green */
|
||||
for(i = 1; i < 11; i++)
|
||||
{
|
||||
item -> setBackground(i,QBrush(Qt::darkGreen));
|
||||
item -> setIcon(0,(QIcon(IMAGE_AUTHED)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i = 1; i < 11; i++)
|
||||
{
|
||||
item -> setBackground(i,QBrush(Qt::darkGreen));
|
||||
item -> setIcon(0,(QIcon(IMAGE_AUTHED)));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (it->second.trustLvl > 3)
|
||||
{
|
||||
for(i = 1; i < 11; i++)
|
||||
{
|
||||
item -> setBackground(i,QBrush(Qt::cyan));
|
||||
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
||||
}
|
||||
}
|
||||
else if (it->second.lastConnect != "Never")
|
||||
{
|
||||
for(i = 1; i < 11; i++)
|
||||
{
|
||||
item -> setBackground(i,QBrush(Qt::yellow));
|
||||
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i = 1; i < 11; i++)
|
||||
{
|
||||
item -> setBackground(i,QBrush(Qt::gray));
|
||||
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* add to the list */
|
||||
items.append(item);
|
||||
}
|
||||
|
||||
/* add the items in! */
|
||||
connectWidget->insertTopLevelItems(0, items);
|
||||
|
||||
rsiface->unlockData(); /* UnLock Interface */
|
||||
|
||||
connectWidget->update(); /* update display */
|
||||
|
||||
}
|
||||
|
||||
QTreeWidgetItem *ConnectionsDialog::getCurrentNeighbour()
|
||||
{
|
||||
/* get the current, and extract the Id */
|
||||
|
||||
/* get a link to the table */
|
||||
QTreeWidget *connectWidget = ui.connecttreeWidget;
|
||||
QTreeWidgetItem *item = connectWidget -> currentItem();
|
||||
if (!item)
|
||||
{
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "Invalid Current Item" << std::endl;
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Display the columns of this item. */
|
||||
std::ostringstream out;
|
||||
out << "CurrentNeighbourItem: " << std::endl;
|
||||
|
||||
for(int i = 1; i < 6; i++)
|
||||
{
|
||||
QString txt = item -> text(i);
|
||||
out << "\t" << i << ":" << txt.toStdString() << std::endl;
|
||||
}
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << out.str();
|
||||
#endif
|
||||
return item;
|
||||
}
|
||||
|
||||
/* Utility Fns */
|
||||
RsCertId getNeighRsCertId(QTreeWidgetItem *i)
|
||||
{
|
||||
RsCertId id = (i -> text(9)).toStdString();
|
||||
return id;
|
||||
}
|
||||
|
||||
/* So from the Neighbours Dialog we can call the following control Functions:
|
||||
* (1) Load Certificate NeighLoadCertificate(std::string file)
|
||||
* (2) Neigh Auth NeighAuthFriend(id, code)
|
||||
* (3) Neigh Add NeighAddFriend(id)
|
||||
*
|
||||
* All of these rely on the finding of the current Id.
|
||||
*/
|
||||
|
||||
std::string ConnectionsDialog::loadneighbour()
|
||||
{
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "ConnectionsDialog::loadneighbour()" << std::endl;
|
||||
#endif
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Certificate"), "",
|
||||
tr("Certificates (*.pqi *.pem)"));
|
||||
|
||||
std::string file = fileName.toStdString();
|
||||
std::string id;
|
||||
if (file != "")
|
||||
{
|
||||
rsicontrol->NeighLoadCertificate(file, id);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
void ConnectionsDialog::addneighbour()
|
||||
{
|
||||
QTreeWidgetItem *c = getCurrentNeighbour();
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "ConnectionsDialog::addneighbour()" << std::endl;
|
||||
#endif
|
||||
/*
|
||||
rsServer->NeighAddFriend(getNeighRsCertId(c));
|
||||
*/
|
||||
}
|
||||
|
||||
void ConnectionsDialog::authneighbour()
|
||||
{
|
||||
QTreeWidgetItem *c = getCurrentNeighbour();
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "ConnectionsDialog::authneighbour()" << std::endl;
|
||||
#endif
|
||||
/*
|
||||
RsAuthId code;
|
||||
rsServer->NeighAuthFriend(getNeighRsCertId(c), code);
|
||||
*/
|
||||
}
|
||||
|
@ -1,88 +0,0 @@
|
||||
/****************************************************************
|
||||
* RShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2006, crypton
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
|
||||
#ifndef _CONNECTIONSDIALOG_H
|
||||
#define _CONNECTIONSDIALOG_H
|
||||
|
||||
#include <QFileDialog>
|
||||
|
||||
//#include <config/rsharesettings.h>
|
||||
|
||||
#include "mainpage.h"
|
||||
#include "ui_ConnectionsDialog.h"
|
||||
|
||||
#include "connect/ConnectDialog.h"
|
||||
|
||||
|
||||
class ConnectionsDialog : public MainPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
ConnectionsDialog(QWidget *parent = 0);
|
||||
/** Default Destructor */
|
||||
|
||||
void insertConnect();
|
||||
void showpeerdetails(std::string id);
|
||||
|
||||
public slots:
|
||||
std::string loadneighbour();
|
||||
/* void loadneighbour(); */
|
||||
|
||||
private slots:
|
||||
|
||||
void showAuthDialog();
|
||||
|
||||
void peerdetails();
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void connecttreeWidgetCostumPopupMenu( QPoint point );
|
||||
|
||||
/** Called when user clicks "Load Cert" to choose location of a Cert file */
|
||||
void loadcert();
|
||||
|
||||
void authneighbour();
|
||||
void addneighbour();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
QTreeWidgetItem *getCurrentNeighbour();
|
||||
|
||||
/** Define the popup menus for the Context menu */
|
||||
QMenu* contextMnu;
|
||||
/** Defines the actions for the context menu */
|
||||
QAction* peerdetailsAct;
|
||||
QAction* authAct;
|
||||
QAction* loadcertAct;
|
||||
|
||||
/* connection dialog */
|
||||
ConnectDialog *connectdialog;
|
||||
|
||||
QTreeWidget *connecttreeWidget;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::ConnectionsDialog ui;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,703 +0,0 @@
|
||||
<ui version="4.0" >
|
||||
<class>ConnectionsDialog</class>
|
||||
<widget class="QWidget" name="ConnectionsDialog" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>510</width>
|
||||
<height>289</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="palette" >
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="WindowText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Button" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>208</red>
|
||||
<green>208</green>
|
||||
<blue>208</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Light" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Midlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>247</red>
|
||||
<green>247</green>
|
||||
<blue>247</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Dark" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Mid" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>139</red>
|
||||
<green>139</green>
|
||||
<blue>139</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Text" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="BrightText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="ButtonText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Base" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Shadow" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Highlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>128</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="HighlightedText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Link" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="LinkVisited" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="AlternateBase" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>231</red>
|
||||
<green>231</green>
|
||||
<blue>231</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="WindowText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Button" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>208</red>
|
||||
<green>208</green>
|
||||
<blue>208</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Light" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Midlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>247</red>
|
||||
<green>247</green>
|
||||
<blue>247</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Dark" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Mid" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>139</red>
|
||||
<green>139</green>
|
||||
<blue>139</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Text" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="BrightText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="ButtonText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Base" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Shadow" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Highlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>192</red>
|
||||
<green>192</green>
|
||||
<blue>192</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="HighlightedText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Link" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="LinkVisited" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="AlternateBase" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>231</red>
|
||||
<green>231</green>
|
||||
<blue>231</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="WindowText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Button" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>208</red>
|
||||
<green>208</green>
|
||||
<blue>208</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Light" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Midlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>247</red>
|
||||
<green>247</green>
|
||||
<blue>247</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Dark" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Mid" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>139</red>
|
||||
<green>139</green>
|
||||
<blue>139</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Text" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="BrightText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="ButtonText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Base" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Shadow" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Highlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>128</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="HighlightedText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Link" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="LinkVisited" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="AlternateBase" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<red>231</red>
|
||||
<green>231</green>
|
||||
<blue>231</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="font" >
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>50</weight>
|
||||
<italic>false</italic>
|
||||
<bold>false</bold>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
</font>
|
||||
</property>
|
||||
<property name="mouseTracking" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="contextMenuPolicy" >
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="leftMargin" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QGridLayout" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QGridLayout" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap" >
|
||||
<pixmap resource="images.qrc" >:/images/network16.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLabel" name="label_2" >
|
||||
<property name="text" >
|
||||
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Arial'; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt; font-weight:600;">Network:</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QTreeWidget" name="connecttreeWidget" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font" >
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>8</pointsize>
|
||||
<weight>50</weight>
|
||||
<italic>false</italic>
|
||||
<bold>false</bold>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
</font>
|
||||
</property>
|
||||
<property name="contextMenuPolicy" >
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="acceptDrops" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="lineWidth" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sortingEnabled" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>#</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Accept</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Trust</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Last Contact</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Peer Address</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Organisation</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Location</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Country</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Cert Id</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Auth Code</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="images.qrc" />
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@ -291,7 +291,7 @@ void NetworkDialog::peerdetails()
|
||||
void NetworkDialog::showpeerdetails(std::string id)
|
||||
{
|
||||
#ifdef NET_DEBUG
|
||||
std::cerr << "ConnectionsDialog::showpeerdetails()" << std::endl;
|
||||
std::cerr << "NetworkDialog::showpeerdetails()" << std::endl;
|
||||
#endif
|
||||
if ((connectdialog) && (connectdialog -> loadPeer(id)))
|
||||
{
|
||||
@ -584,7 +584,7 @@ RsCertId getNeighRsCertId(QTreeWidgetItem *i)
|
||||
std::string NetworkDialog::loadneighbour()
|
||||
{
|
||||
#ifdef NET_DEBUG
|
||||
std::cerr << "ConnectionsDialog::loadneighbour()" << std::endl;
|
||||
std::cerr << "NetworkDialog::loadneighbour()" << std::endl;
|
||||
#endif
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Certificate"), "",
|
||||
tr("Certificates (*.pqi *.pem)"));
|
||||
@ -602,7 +602,7 @@ void NetworkDialog::addneighbour()
|
||||
{
|
||||
QTreeWidgetItem *c = getCurrentNeighbour();
|
||||
#ifdef NET_DEBUG
|
||||
std::cerr << "ConnectionsDialog::addneighbour()" << std::endl;
|
||||
std::cerr << "NetworkDialog::addneighbour()" << std::endl;
|
||||
#endif
|
||||
/*
|
||||
rsServer->NeighAddFriend(getNeighRsCertId(c));
|
||||
@ -613,7 +613,7 @@ void NetworkDialog::authneighbour()
|
||||
{
|
||||
QTreeWidgetItem *c = getCurrentNeighbour();
|
||||
#ifdef NET_DEBUG
|
||||
std::cerr << "ConnectionsDialog::authneighbour()" << std::endl;
|
||||
std::cerr << "NetworkDialog::authneighbour()" << std::endl;
|
||||
#endif
|
||||
/*
|
||||
RsAuthId code;
|
||||
|
Loading…
Reference in New Issue
Block a user