Cleaned the gui a little bit:

- added a checkbox to control the use of external servers for ip determination.
- put back Network on the left
- put channels out of RS_RELEASE_VERSION, as it's not working yet.
- NetworkDialog:
	- set the info in columns about trust to be more explicit
	- changed dark green into light green to comply with colors in the trust matrix (it's also more readable in light green)
	- corrected trust strings that appeared in the Last Contact column
- changed "generate certificate" in connect friends wizard into "export my certificate..." which is more appropriate



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1113 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-04-05 13:04:18 +00:00
parent afb51d5d31
commit 4bb497a905
16 changed files with 145 additions and 136 deletions

View File

@ -123,11 +123,23 @@ p3ConnectMgr::p3ConnectMgr(p3AuthMgr *am)
ownState.name = mAuthMgr->getName(ownState.id); ownState.name = mAuthMgr->getName(ownState.id);
ownState.netMode = RS_NET_MODE_UDP; ownState.netMode = RS_NET_MODE_UDP;
} }
mExtAddrFinder = NULL ; use_extr_addr_finder = true ;
mExtAddrFinder = new ExtAddrFinder ;
return; return;
} }
void p3ConnectMgr::getIPServersList(std::list<std::string>& ip_servers)
{
mExtAddrFinder->getIPServersList(ip_servers);
}
void p3ConnectMgr::setIPServersEnabled(bool b)
{
use_extr_addr_finder = b ;
std::cerr << "p3ConnectMgr: setIPServers to " << b << std::endl ;
}
void p3ConnectMgr::setOwnNetConfig(uint32_t netMode, uint32_t visState) void p3ConnectMgr::setOwnNetConfig(uint32_t netMode, uint32_t visState)
{ {
@ -406,9 +418,6 @@ void p3ConnectMgr::netTick()
uint32_t netStatus = mNetStatus; uint32_t netStatus = mNetStatus;
if(mExtAddrFinder == NULL)
mExtAddrFinder = new ExtAddrFinder ;
connMtx.unlock(); /* UNLOCK MUTEX */ connMtx.unlock(); /* UNLOCK MUTEX */
switch(netStatus) switch(netStatus)
@ -579,7 +588,7 @@ void p3ConnectMgr::netUdpCheck()
#endif #endif
struct sockaddr_in tmpip ; struct sockaddr_in tmpip ;
if (udpExtAddressCheck() || (mUpnpAddrValid) || mExtAddrFinder->hasValidIP(&tmpip)) if (udpExtAddressCheck() || (mUpnpAddrValid) || (use_extr_addr_finder && mExtAddrFinder->hasValidIP(&tmpip)))
{ {
bool extValid = false; bool extValid = false;
bool extAddrStable = false; bool extAddrStable = false;
@ -605,7 +614,7 @@ void p3ConnectMgr::netUdpCheck()
extAddr = mStunExtAddr; extAddr = mStunExtAddr;
extAddrStable = mStunAddrStable; extAddrStable = mStunAddrStable;
} }
else if(mExtAddrFinder->hasValidIP(&tmpip)) else if(use_extr_addr_finder && mExtAddrFinder->hasValidIP(&tmpip))
{ {
extValid = true; extValid = true;
extAddr = tmpip ; extAddr = tmpip ;

View File

@ -186,6 +186,10 @@ bool getUPnPState();
bool getUPnPEnabled(); bool getUPnPEnabled();
bool getDHTEnabled(); bool getDHTEnabled();
bool getIPServersEnabled() { return use_extr_addr_finder ;}
void setIPServersEnabled(bool b) ;
void getIPServersList(std::list<std::string>& ip_servers) ;
bool getNetStatusOk(); bool getNetStatusOk();
bool getNetStatusUpnpOk(); bool getNetStatusUpnpOk();
bool getNetStatusDhtOk(); bool getNetStatusDhtOk();
@ -350,6 +354,7 @@ private:
std::list<pqiMonitor *> clients; std::list<pqiMonitor *> clients;
ExtAddrFinder *mExtAddrFinder ; ExtAddrFinder *mExtAddrFinder ;
bool use_extr_addr_finder ;
/* external Address determination */ /* external Address determination */
bool mUpnpAddrValid, mStunAddrValid; bool mUpnpAddrValid, mStunAddrValid;

View File

@ -144,6 +144,10 @@ virtual bool setExtAddress( std::string id, std::string addr, uint16_t port) =
virtual bool setNetworkMode(std::string id, uint32_t netMode) = 0; virtual bool setNetworkMode(std::string id, uint32_t netMode) = 0;
virtual bool setVisState(std::string id, uint32_t vis) = 0; virtual bool setVisState(std::string id, uint32_t vis) = 0;
virtual void getIPServersList(std::list<std::string>& ip_servers) = 0;
virtual void allowServerIPDetermination(bool) = 0;
virtual bool getAllowServerIPDetermination() = 0 ;
/* Auth Stuff */ /* Auth Stuff */
virtual std::string GetRetroshareInvite() = 0; virtual std::string GetRetroshareInvite() = 0;

View File

@ -459,6 +459,19 @@ bool p3Peers::connectAttempt(std::string id)
return mConnMgr->retryConnect(id); return mConnMgr->retryConnect(id);
} }
void p3Peers::getIPServersList(std::list<std::string>& ip_servers)
{
mConnMgr->getIPServersList(ip_servers) ;
}
void p3Peers::allowServerIPDetermination(bool b)
{
mConnMgr->setIPServersEnabled(b) ;
}
bool p3Peers::getAllowServerIPDetermination()
{
return mConnMgr->getIPServersEnabled() ;
}
bool p3Peers::setLocalAddress(std::string id, std::string addr_str, uint16_t port) bool p3Peers::setLocalAddress(std::string id, std::string addr_str, uint16_t port)
{ {
#ifdef P3PEERS_DEBUG #ifdef P3PEERS_DEBUG

View File

@ -67,6 +67,10 @@ virtual bool setExtAddress(std::string id, std::string addr, uint16_t port);
virtual bool setNetworkMode(std::string id, uint32_t netMode); virtual bool setNetworkMode(std::string id, uint32_t netMode);
virtual bool setVisState(std::string id, uint32_t mode); virtual bool setVisState(std::string id, uint32_t mode);
virtual void getIPServersList(std::list<std::string>& ip_servers) ;
virtual void allowServerIPDetermination(bool) ;
virtual bool getAllowServerIPDetermination() ;
/* Auth Stuff */ /* Auth Stuff */
virtual std::string GetRetroshareInvite(); virtual std::string GetRetroshareInvite();

View File

@ -120,31 +120,24 @@ static void getPage(const std::string& server_name,std::string& page)
} }
extern "C" void* doExtAddrSearch(void *p) void* doExtAddrSearch(void *p)
{ {
static const int nb_ipservers = 4 ;
const std::string servers[nb_ipservers] = {
"checkip.dyndns.org",
"www.showmyip.com",
"showip.net",
"www.displaymyip.com"
};
std::vector<std::string> res ; std::vector<std::string> res ;
ExtAddrFinder *af = (ExtAddrFinder*)p ; ExtAddrFinder *af = (ExtAddrFinder*)p ;
for(int i=0;i<nb_ipservers;++i) for(std::list<std::string>::const_iterator it(af->_ip_servers.begin());it!=af->_ip_servers.end();++it)
{ {
std::string page ; std::string page ;
getPage(servers[i],page) ; getPage(*it,page) ;
std::string ip = scan_ip(page) ; std::string ip = scan_ip(page) ;
if(ip != "") if(ip != "")
res.push_back(ip) ; res.push_back(ip) ;
#ifdef EXTADDRSEARCH_DEBUG #ifdef EXTADDRSEARCH_DEBUG
std::cout << "ip found through " << servers[i] << ": \"" << ip << "\"" << std::endl ; std::cout << "ip found through " << *it << ": \"" << ip << "\"" << std::endl ;
#endif #endif
} }
if(res.empty()) if(res.empty())
@ -244,6 +237,11 @@ ExtAddrFinder::ExtAddrFinder()
_addr = (sockaddr_in*)malloc(sizeof(sockaddr_in)) ; _addr = (sockaddr_in*)malloc(sizeof(sockaddr_in)) ;
_ip_servers.push_back(std::string( "checkip.dyndns.org" )) ;
_ip_servers.push_back(std::string( "www.showmyip.com" )) ;
_ip_servers.push_back(std::string( "showip.net" )) ;
_ip_servers.push_back(std::string( "www.displaymyip.com")) ;
start_request() ; start_request() ;
} }

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include <list>
#include <string>
#include "util/rsthreads.h" #include "util/rsthreads.h"
struct sockaddr ; struct sockaddr ;
@ -11,11 +13,16 @@ class ExtAddrFinder
~ExtAddrFinder() ; ~ExtAddrFinder() ;
bool hasValidIP(struct sockaddr_in *addr) ; bool hasValidIP(struct sockaddr_in *addr) ;
void getIPServersList(std::list<std::string>& ip_servers) { ip_servers = _ip_servers ; }
void start_request() ; void start_request() ;
private:
friend void* doExtAddrSearch(void *p) ;
RsMutex _addrMtx ; RsMutex _addrMtx ;
struct sockaddr_in *_addr ; struct sockaddr_in *_addr ;
bool *_found ; bool *_found ;
bool *_searching ; bool *_searching ;
std::list<std::string> _ip_servers ;
}; };

View File

@ -217,10 +217,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
ui.stackPages->add(linksDialog = new LinksDialog(ui.stackPages), ui.stackPages->add(linksDialog = new LinksDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_LINKS), tr("Links Cloud"), grp)); createPageAction(QIcon(IMAGE_LINKS), tr("Links Cloud"), grp));
ChannelFeed *channelFeed = NULL;
ui.stackPages->add(channelFeed = new ChannelFeed(ui.stackPages),
createPageAction(QIcon(IMAGE_CHANNELS), tr("Channel Feed"), grp));
ForumsDialog *forumsDialog = NULL; ForumsDialog *forumsDialog = NULL;
ui.stackPages->add(forumsDialog = new ForumsDialog(ui.stackPages), ui.stackPages->add(forumsDialog = new ForumsDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp)); createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
@ -240,6 +236,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp)); createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
#endif #endif
NewsFeed *newsFeed = NULL;
ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
createPageAction(QIcon(IMAGE_NEWSFEED), tr("News Feed"), grp));
ui.stackPages->add(pluginsPage = new PluginsPage(ui.stackPages), ui.stackPages->add(pluginsPage = new PluginsPage(ui.stackPages),
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp)); createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
@ -271,10 +270,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
#else #else
NewsFeed *newsFeed = NULL;
ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
createPageAction(QIcon(IMAGE_NEWSFEED), tr("News Feed"), grp));
addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow())); addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow()));
toolAct = ui.toolBarservice->toggleViewAction(); toolAct = ui.toolBarservice->toggleViewAction();

View File

@ -300,29 +300,23 @@ void NetworkDialog::insertConnect()
/* (1) Accept/Deny */ /* (1) Accept/Deny */
if (detail.state & RS_PEER_STATE_FRIEND) if (detail.state & RS_PEER_STATE_FRIEND)
{ item -> setText(1, tr("Trusted"));
item -> setText(1, tr("Accept"));
}
else else
{ item -> setText(1, tr("Denied"));
item -> setText(1, tr("Deny"));
}
item -> setText(2,QString::fromStdString( RsPeerTrustString(detail.trustLvl))); if (rsPeers->isTrustingMe(detail.id) || detail.lastConnect>0)
item -> setText(2,QString("Is trusting me"));
else
item -> setText(2,QString("Unknown"));
/* (3) Last Connect */ /* (3) Last Connect */
{ {
std::ostringstream out; std::ostringstream out;
// Show anouncement if a friend never was connected. // Show anouncement if a friend never was connected.
if (detail.lastConnect==0 ) { if (detail.lastConnect==0 )
if(detail.state & RS_PEER_STATE_FRIEND) { item -> setText(3, QString("Never seen"));
out << "Friend never seen"; else
item -> setText(3, QString::fromStdString(out.str())); {
} else {
// Show that there is no Trust
item -> setText(3, QString::fromStdString(RsPeerTrustString(detail.trustLvl)));
}
} else {
// Dont Show a timestamp in RS calculate the day // Dont Show a timestamp in RS calculate the day
QDateTime datum = QDateTime::fromTime_t(detail.lastConnect); QDateTime datum = QDateTime::fromTime_t(detail.lastConnect);
// out << datum.toString(Qt::LocalDate); // out << datum.toString(Qt::LocalDate);
@ -372,16 +366,11 @@ void NetworkDialog::insertConnect()
if (detail.state & RS_PEER_STATE_FRIEND) if (detail.state & RS_PEER_STATE_FRIEND)
{ {
if (detail.lastConnect < 10000) /* 3 hours? */ if (detail.lastConnect < 10000) /* 3 hours? */
{
/* bright green */
backgrndcolor=Qt::darkGreen;
item -> setIcon(0,(QIcon(IMAGE_AUTHED))); item -> setIcon(0,(QIcon(IMAGE_AUTHED)));
}
else else
{
backgrndcolor=Qt::darkGreen;
item -> setIcon(0,(QIcon(IMAGE_AUTHED))); item -> setIcon(0,(QIcon(IMAGE_AUTHED)));
}
backgrndcolor=Qt::green;
} }
else else
{ {
@ -389,7 +378,6 @@ void NetworkDialog::insertConnect()
{ {
backgrndcolor=Qt::magenta; backgrndcolor=Qt::magenta;
item -> setIcon(0,(QIcon(IMAGE_TRUSTED))); item -> setIcon(0,(QIcon(IMAGE_TRUSTED)));
item -> setText(2,QString("Is trusting you"));
for(int k=0;k<8;++k) for(int k=0;k<8;++k)
item -> setToolTip(k,QString::fromStdString(detail.name) + QString(tr(" is trusting you. \nRight-click and select 'make friend' to be able to connect."))) ; item -> setToolTip(k,QString::fromStdString(detail.name) + QString(tr(" is trusting you. \nRight-click and select 'make friend' to be able to connect."))) ;
} }
@ -413,9 +401,8 @@ void NetworkDialog::insertConnect()
// Color each Background column in the Network Tab except the first one => 1-9 // Color each Background column in the Network Tab except the first one => 1-9
// whith the determinated color // whith the determinated color
for(int i = 1; i <10; i++) for(int i = 1; i <10; i++)
{
item -> setBackground(i,QBrush(backgrndcolor)); item -> setBackground(i,QBrush(backgrndcolor));
}
/* add to the list */ /* add to the list */
items.append(item); items.append(item);
} }
@ -426,10 +413,10 @@ void NetworkDialog::insertConnect()
{ {
QTreeWidgetItem *self_item = new QTreeWidgetItem((QTreeWidget*)0); QTreeWidgetItem *self_item = new QTreeWidgetItem((QTreeWidget*)0);
self_item->setText(1,"Accept"); self_item->setText(1,"N/A");
self_item->setText(2,"Good"); self_item->setText(2,"N/A");
self_item->setText(3,"0"); self_item->setText(3,"N/A");
self_item->setText(4,QString::fromStdString(pd.name)) ; self_item->setText(4,QString::fromStdString(pd.name) + " (yourself)") ;
std::ostringstream out; std::ostringstream out;
out << pd.localAddr << ":" << pd.localPort << "/" << pd.extAddr << ":" << pd.extPort; out << pd.localAddr << ":" << pd.localPort << "/" << pd.extAddr << ":" << pd.extPort;
@ -442,7 +429,7 @@ void NetworkDialog::insertConnect()
// Color each Background column in the Network Tab except the first one => 1-9 // Color each Background column in the Network Tab except the first one => 1-9
for(int i=1;i<10;++i) for(int i=1;i<10;++i)
{ {
self_item->setBackground(i,QBrush(Qt::darkGreen)); self_item->setBackground(i,QBrush(Qt::green));
} }
self_item->setIcon(0,(QIcon(IMAGE_AUTHED))); self_item->setIcon(0,(QIcon(IMAGE_AUTHED)));
items.append(self_item); items.append(self_item);

View File

@ -34,14 +34,6 @@
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="networkTab" > <widget class="QWidget" name="networkTab" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>564</width>
<height>411</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>Network</string> <string>Network</string>
</attribute> </attribute>
@ -126,17 +118,17 @@ p, li { white-space: pre-wrap; }
</property> </property>
<column> <column>
<property name="text" > <property name="text" >
<string>#</string> <string/>
</property> </property>
</column> </column>
<column> <column>
<property name="text" > <property name="text" >
<string>Accept</string> <string>Your trust</string>
</property> </property>
</column> </column>
<column> <column>
<property name="text" > <property name="text" >
<string>Trust</string> <string>Peer's trust</string>
</property> </property>
</column> </column>
<column> <column>
@ -191,14 +183,6 @@ p, li { white-space: pre-wrap; }
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="log_tab" > <widget class="QWidget" name="log_tab" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>558</width>
<height>115</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>Log</string> <string>Log</string>
</attribute> </attribute>
@ -235,14 +219,6 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="networkviewTab" > <widget class="QWidget" name="networkviewTab" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>564</width>
<height>411</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>Network View</string> <string>Network View</string>
</attribute> </attribute>

View File

@ -43,6 +43,7 @@ ServerDialog::ServerDialog(QWidget *parent)
_settings = new RshareSettings(); _settings = new RshareSettings();
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) ); connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
QTimer *timer = new QTimer(this); QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus())); timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
@ -51,6 +52,15 @@ ServerDialog::ServerDialog(QWidget *parent)
load(); load();
updateStatus(); updateStatus();
bool b = rsPeers->getAllowServerIPDetermination() ;
ui.allowIpDeterminationCB->setChecked(b) ;
ui.IPServersLV->setEnabled(b) ;
std::list<std::string> ip_servers ;
rsPeers->getIPServersList(ip_servers) ;
for(std::list<std::string>::const_iterator it(ip_servers.begin());it!=ip_servers.end();++it)
ui.IPServersLV->addItem(QString::fromStdString(*it)) ;
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
@ -58,6 +68,12 @@ ServerDialog::ServerDialog(QWidget *parent)
#endif #endif
} }
void ServerDialog::toggleIpDetermination(bool b)
{
rsPeers->allowServerIPDetermination(b) ;
ui.IPServersLV->setEnabled(b) ;
}
/** Saves the changes on this page */ /** Saves the changes on this page */
bool bool
ServerDialog::save(QString &errmsg) ServerDialog::save(QString &errmsg)

View File

@ -49,6 +49,7 @@ public slots:
private slots: private slots:
void saveAddresses(); void saveAddresses();
void toggleUPnP(); void toggleUPnP();
void toggleIpDetermination(bool) ;
private: private:

View File

@ -6,7 +6,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>409</width> <width>409</width>
<height>373</height> <height>406</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
@ -488,22 +488,10 @@
<enum>Qt::NoContextMenu</enum> <enum>Qt::NoContextMenu</enum>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="leftMargin" > <property name="margin" >
<number>6</number> <number>6</number>
</property> </property>
<property name="topMargin" > <property name="spacing" >
<number>6</number>
</property>
<property name="rightMargin" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>6</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
@ -578,7 +566,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -610,8 +598,8 @@
<property name="title" > <property name="title" >
<string>Network Configuration</string> <string>Network Configuration</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QVBoxLayout" name="verticalLayout" >
<item row="0" column="0" > <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<item> <item>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
@ -683,18 +671,28 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0" > <item>
<spacer> <widget class="QCheckBox" name="allowIpDeterminationCB" >
<property name="orientation" > <property name="toolTip" >
<enum>Qt::Vertical</enum> <string>If you unckeck this, RetroShare can only determine your IP
when you connect to somebody. Leaving this checked helps
connecting when you have few friends. It also helps if you're
behind a firewall or a VPN.</string>
</property> </property>
<property name="sizeHint" > <property name="text" >
<size> <string>Allow RetroShare to ask my ip to these websites:</string>
<width>301</width>
<height>20</height>
</size>
</property> </property>
</spacer> <property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="IPServersLV" >
<property name="editTriggers" >
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -817,16 +815,7 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin" > <property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -856,16 +845,7 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin" > <property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -895,7 +875,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>

View File

@ -292,7 +292,7 @@ CertificatePage::CertificatePage(QWidget *parent)
userFileLabel->setWordWrap(true); userFileLabel->setWordWrap(true);
userFileCreateButton = new QPushButton; userFileCreateButton = new QPushButton;
userFileCreateButton->setText("Generate certificate"); userFileCreateButton->setText("Export my certificate...");
connect(userFileCreateButton, SIGNAL( clicked() ), connect(userFileCreateButton, SIGNAL( clicked() ),
this, SLOT( generateCertificateCalled())); this, SLOT( generateCertificateCalled()));
@ -302,7 +302,7 @@ CertificatePage::CertificatePage(QWidget *parent)
userFileFrame = new QGroupBox; userFileFrame = new QGroupBox;
userFileFrame->setFlat(true); userFileFrame->setFlat(true);
userFileFrame->setTitle("Generate certificate"); userFileFrame->setTitle("Export my certificate...");
userFileFrame->setLayout(userFileLayout); userFileFrame->setLayout(userFileLayout);
friendFileLabel = new QLabel(tr("Specify path to your friend's " friendFileLabel = new QLabel(tr("Specify path to your friend's "

View File

@ -144,6 +144,10 @@ virtual bool setExtAddress( std::string id, std::string addr, uint16_t port) =
virtual bool setNetworkMode(std::string id, uint32_t netMode) = 0; virtual bool setNetworkMode(std::string id, uint32_t netMode) = 0;
virtual bool setVisState(std::string id, uint32_t vis) = 0; virtual bool setVisState(std::string id, uint32_t vis) = 0;
virtual void getIPServersList(std::list<std::string>& ip_servers) = 0;
virtual void allowServerIPDetermination(bool) = 0;
virtual bool getAllowServerIPDetermination() = 0 ;
/* Auth Stuff */ /* Auth Stuff */
virtual std::string GetRetroshareInvite() = 0; virtual std::string GetRetroshareInvite() = 0;

View File

@ -56,9 +56,11 @@ struct TurtleFileInfo
class RsTurtle class RsTurtle
{ {
public: public:
RsTurtle() {} RsTurtle() { _sharing_strategy = SHARE_ENTIRE_NETWORK ;}
virtual ~RsTurtle() {} virtual ~RsTurtle() {}
enum FileSharingStrategy { SHARE_ENTIRE_NETWORK, SHARE_FRIENDS_ONLY } ;
// Lauches a search request through the pipes, and immediately returns // Lauches a search request through the pipes, and immediately returns
// the request id, which will be further used by the gui to store results // the request id, which will be further used by the gui to store results
// as they come back. // as they come back.
@ -70,6 +72,14 @@ class RsTurtle
// initialization process. // initialization process.
// //
virtual void turtleDownload(const std::string& file_hash) = 0 ; virtual void turtleDownload(const std::string& file_hash) = 0 ;
// Sets the file sharing strategy. It concerns all local files. It would
// be better to handle this for each file, of course.
void setFileSharingStrategy(FileSharingStrategy f) { _sharing_strategy = f ; }
protected:
FileSharingStrategy _sharing_strategy ;
}; };
#endif #endif