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

@ -217,10 +217,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
ui.stackPages->add(linksDialog = new LinksDialog(ui.stackPages),
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;
ui.stackPages->add(forumsDialog = new ForumsDialog(ui.stackPages),
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));
#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),
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
@ -271,10 +270,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
#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()));
toolAct = ui.toolBarservice->toggleViewAction();

View file

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

View file

@ -34,14 +34,6 @@
<number>0</number>
</property>
<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" >
<string>Network</string>
</attribute>
@ -126,17 +118,17 @@ p, li { white-space: pre-wrap; }
</property>
<column>
<property name="text" >
<string>#</string>
<string/>
</property>
</column>
<column>
<property name="text" >
<string>Accept</string>
<string>Your trust</string>
</property>
</column>
<column>
<property name="text" >
<string>Trust</string>
<string>Peer's trust</string>
</property>
</column>
<column>
@ -191,14 +183,6 @@ p, li { white-space: pre-wrap; }
<number>0</number>
</property>
<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" >
<string>Log</string>
</attribute>
@ -235,14 +219,6 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<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" >
<string>Network View</string>
</attribute>

View file

@ -43,6 +43,7 @@ ServerDialog::ServerDialog(QWidget *parent)
_settings = new RshareSettings();
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
@ -51,6 +52,15 @@ ServerDialog::ServerDialog(QWidget *parent)
load();
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 */
#ifdef Q_WS_WIN
@ -58,6 +68,12 @@ ServerDialog::ServerDialog(QWidget *parent)
#endif
}
void ServerDialog::toggleIpDetermination(bool b)
{
rsPeers->allowServerIPDetermination(b) ;
ui.IPServersLV->setEnabled(b) ;
}
/** Saves the changes on this page */
bool
ServerDialog::save(QString &errmsg)

View file

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

View file

@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>409</width>
<height>373</height>
<height>406</height>
</rect>
</property>
<property name="sizePolicy" >
@ -488,22 +488,10 @@
<enum>Qt::NoContextMenu</enum>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>6</number>
</property>
<property name="topMargin" >
<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" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@ -578,7 +566,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@ -610,8 +598,8 @@
<property name="title" >
<string>Network Configuration</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
@ -683,18 +671,28 @@
</item>
</layout>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
<item>
<widget class="QCheckBox" name="allowIpDeterminationCB" >
<property name="toolTip" >
<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 name="sizeHint" >
<size>
<width>301</width>
<height>20</height>
</size>
<property name="text" >
<string>Allow RetroShare to ask my ip to these websites:</string>
</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>
</layout>
</widget>
@ -817,16 +815,7 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@ -856,16 +845,7 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@ -895,7 +875,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>

View file

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