mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added rating icons to show on first columns too
update settings with latest changes from Preferences git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1543 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6972bc1cb8
commit
43b6505512
@ -55,6 +55,7 @@
|
||||
#define IMAGE_OK ":/images/filerating3.png"
|
||||
#define IMAGE_SUX ":/images/filerating2.png"
|
||||
#define IMAGE_BADLINK ":/images/filerating1.png"
|
||||
#define IMAGE_NOCOMMENTRATING ":/images/filerating0.png"
|
||||
#define IMAGE_DOWNLOAD ":/images/download16.png"
|
||||
|
||||
/******
|
||||
@ -411,30 +412,35 @@ void LinksDialog::updateLinks()
|
||||
{
|
||||
peerScore = "[+2] ";
|
||||
child -> setIcon(0,(QIcon(IMAGE_GREAT)));
|
||||
item -> setIcon(0,(QIcon(IMAGE_GREAT)));
|
||||
//peerScore = "[+2 Great Link] ";
|
||||
}
|
||||
else if (cit->score == 1)
|
||||
{
|
||||
peerScore = "[+1] ";
|
||||
child -> setIcon(0,(QIcon(IMAGE_GOOD)));
|
||||
item -> setIcon(0,(QIcon(IMAGE_GOOD)));
|
||||
//peerScore = "[+1 Good] ";
|
||||
}
|
||||
else if (cit->score == 0)
|
||||
{
|
||||
peerScore = "[+0] ";
|
||||
child -> setIcon(0,(QIcon(IMAGE_OK)));
|
||||
item -> setIcon(0,(QIcon(IMAGE_OK)));
|
||||
//peerScore = "[+0 Okay] ";
|
||||
}
|
||||
else if (cit->score == -1)
|
||||
{
|
||||
peerScore = "[-1] ";
|
||||
child -> setIcon(0,(QIcon(IMAGE_SUX)));
|
||||
item -> setIcon(0,(QIcon(IMAGE_SUX)));
|
||||
//peerScore = "[-1 Not Worth It] ";
|
||||
}
|
||||
else //if (cit->score < -1)
|
||||
{
|
||||
peerScore = "[-2 BAD] ";
|
||||
child -> setIcon(0,(QIcon(IMAGE_BADLINK)));
|
||||
item -> setIcon(0,(QIcon(IMAGE_BADLINK)));
|
||||
//peerScore = "[-2 BAD Link] ";
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
#endif
|
||||
|
||||
#ifdef NEWSETTINGS
|
||||
addAction(new QAction(QIcon(IMAGE_OPTIONS), tr("Options"), ui.toolBar_2), SLOT(showSettings()));
|
||||
addAction(new QAction(QIcon(IMAGE_OPTIONS), tr("Options"), ui.toolBar), SLOT(showSettings()));
|
||||
#endif
|
||||
|
||||
/* Select the first action */
|
||||
|
@ -20,6 +20,8 @@
|
||||
****************************************************************/
|
||||
|
||||
#include "DirectoriesPage.h"
|
||||
#include "gui/ShareManager.h"
|
||||
|
||||
#include "rshare.h"
|
||||
#include "rsiface/rsfiles.h"
|
||||
|
||||
@ -34,14 +36,16 @@ DirectoriesPage::DirectoriesPage(QWidget * parent, Qt::WFlags flags)
|
||||
|
||||
load();
|
||||
|
||||
connect(ui.addButton, SIGNAL(clicked( bool ) ), this , SLOT( addShareDirectory() ) );
|
||||
connect(ui.removeButton, SIGNAL(clicked( bool ) ), this , SLOT( removeShareDirectory() ) );
|
||||
connect(ui.incomingButton, SIGNAL(clicked( bool ) ), this , SLOT( setIncomingDirectory() ) );
|
||||
connect(ui.partialButton, SIGNAL(clicked( bool ) ), this , SLOT( setPartialsDirectory() ) );
|
||||
connect(ui.checkBox, SIGNAL(stateChanged(int)), this, SLOT(shareDownloadDirectory(int)));
|
||||
connect(ui.editButton, SIGNAL(clicked()), this, SLOT(editDirectories()));
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
ui.addButton->setToolTip(tr("Add a Share Directory"));
|
||||
ui.removeButton->setToolTip(tr("Remove Shared Directory"));
|
||||
#endif
|
||||
|
||||
ui.incomingButton->setToolTip(tr("Browse"));
|
||||
ui.partialButton->setToolTip(tr("Browse"));
|
||||
|
||||
@ -66,24 +70,34 @@ DirectoriesPage::closeEvent (QCloseEvent * event)
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void DirectoriesPage::editDirectories()
|
||||
{
|
||||
ShareManager::showYourself() ;
|
||||
}
|
||||
|
||||
|
||||
/** Saves the changes on this page */
|
||||
bool
|
||||
DirectoriesPage::save(QString &errmsg)
|
||||
bool DirectoriesPage::save(QString &errmsg)
|
||||
{
|
||||
/* this is usefull especially when shared incoming files is
|
||||
* default option and when the user don't check/uncheck the
|
||||
* checkBox, so no signal is emitted to update the shared list */
|
||||
if (ui.checkBox->isChecked())
|
||||
{
|
||||
std::list<std::string>::const_iterator it;
|
||||
std::list<std::string> dirs;
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
|
||||
bool found = false ;
|
||||
for(std::list<SharedDirInfo>::const_iterator it(dirs.begin());it!=dirs.end();++it)
|
||||
if((*it).filename == rsFiles->getDownloadDirectory())
|
||||
{
|
||||
rsFiles->shareDownloadDirectory();
|
||||
found=true ;
|
||||
break ;
|
||||
}
|
||||
if(!found)
|
||||
rsFiles->shareDownloadDirectory();
|
||||
|
||||
rsFiles->setShareDownloadDirectory(true);
|
||||
}
|
||||
else
|
||||
@ -93,14 +107,13 @@ DirectoriesPage::save(QString &errmsg)
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/** Loads the settings for this page */
|
||||
void DirectoriesPage::load()
|
||||
{
|
||||
std::list<std::string>::const_iterator it;
|
||||
std::list<std::string> dirs;
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
/* get a link to the table */
|
||||
@ -112,16 +125,16 @@ void DirectoriesPage::load()
|
||||
for(it = dirs.begin(); it != dirs.end(); it++)
|
||||
{
|
||||
/* (0) Dir Name */
|
||||
listWidget->addItem(QString::fromStdString(*it));
|
||||
listWidget->addItem(QString::fromStdString((*it).filename));
|
||||
}
|
||||
|
||||
ui.incomingDir->setText(QString::fromStdString(rsFiles->getDownloadDirectory()));
|
||||
ui.partialsDir->setText(QString::fromStdString(rsFiles->getPartialsDirectory()));
|
||||
|
||||
listWidget->update(); /* update display */
|
||||
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void DirectoriesPage::addShareDirectory()
|
||||
{
|
||||
|
||||
@ -154,6 +167,7 @@ void DirectoriesPage::removeShareDirectory()
|
||||
load();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void DirectoriesPage::setIncomingDirectory()
|
||||
{
|
||||
@ -166,14 +180,19 @@ void DirectoriesPage::setIncomingDirectory()
|
||||
rsFiles->setDownloadDirectory(dir);
|
||||
if (ui.checkBox->isChecked())
|
||||
{
|
||||
std::list<std::string>::const_iterator it;
|
||||
std::list<std::string> dirs;
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
|
||||
bool found = false ;
|
||||
for(std::list<SharedDirInfo>::const_iterator it(dirs.begin());it!=dirs.end();++it)
|
||||
if((*it).filename == rsFiles->getDownloadDirectory())
|
||||
{
|
||||
rsFiles->shareDownloadDirectory();
|
||||
found=true ;
|
||||
break ;
|
||||
}
|
||||
if(!found)
|
||||
rsFiles->shareDownloadDirectory();
|
||||
}
|
||||
}
|
||||
load();
|
||||
@ -196,14 +215,20 @@ void DirectoriesPage::shareDownloadDirectory(int state)
|
||||
{
|
||||
if (state == Qt::Checked)
|
||||
{
|
||||
std::list<std::string>::const_iterator it;
|
||||
std::list<std::string> dirs;
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
|
||||
bool found = false ;
|
||||
for(std::list<SharedDirInfo>::const_iterator it(dirs.begin());it!=dirs.end();++it)
|
||||
if((*it).filename == rsFiles->getDownloadDirectory())
|
||||
{
|
||||
rsFiles->shareDownloadDirectory();
|
||||
found=true ;
|
||||
break ;
|
||||
}
|
||||
if(!found)
|
||||
rsFiles->shareDownloadDirectory();
|
||||
|
||||
rsFiles->setShareDownloadDirectory(true);
|
||||
}
|
||||
else
|
||||
@ -214,4 +239,3 @@ void DirectoriesPage::shareDownloadDirectory(int state)
|
||||
load();
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,8 +46,12 @@ class DirectoriesPage: public QWidget
|
||||
|
||||
private slots:
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void addShareDirectory();
|
||||
void removeShareDirectory();
|
||||
#endif
|
||||
|
||||
void editDirectories() ;
|
||||
void setIncomingDirectory();
|
||||
void setPartialsDirectory();
|
||||
void shareDownloadDirectory(int state);
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>452</width>
|
||||
<height>349</height>
|
||||
<width>477</width>
|
||||
<height>439</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -509,102 +509,6 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Shared Directories</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<item row="0" column="0" rowspan="3">
|
||||
<widget class="QListWidget" name="dirList"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="addButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/directoryadd_24x24_shadow.png</normaloff>:/images/directoryadd_24x24_shadow.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="removeButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/directoryremove_24x24_shadow.png</normaloff>:/images/directoryremove_24x24_shadow.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>71</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Automatically share incoming directory (Recommanded)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
@ -695,14 +599,44 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Shared Directories</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QListWidget" name="dirList"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Automatically share incoming directory (Recommanded)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="editButton">
|
||||
<property name="text">
|
||||
<string>Edit Share</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>incomingDir</tabstop>
|
||||
<tabstop>incomingButton</tabstop>
|
||||
<tabstop>dirList</tabstop>
|
||||
<tabstop>addButton</tabstop>
|
||||
<tabstop>removeButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
|
@ -20,6 +20,8 @@
|
||||
****************************************************************/
|
||||
|
||||
#include "ServerPage.h"
|
||||
#include <gui/TurtleRouterDialog.h>
|
||||
|
||||
#include "rshare.h"
|
||||
|
||||
#include <iostream>
|
||||
@ -38,6 +40,10 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
|
||||
|
||||
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
|
||||
connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
|
||||
connect( ui._showTurtleDialogPB,SIGNAL(clicked()),this,SLOT( showTurtleRouterDialog() )) ;
|
||||
|
||||
ui._enableTurtleCB->setChecked(true) ;
|
||||
ui._enableTurtleCB->setEnabled(false) ;
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
@ -62,6 +68,11 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
|
||||
#endif
|
||||
}
|
||||
|
||||
void ServerPage::showTurtleRouterDialog()
|
||||
{
|
||||
TurtleRouterDialog::showUp() ;
|
||||
}
|
||||
|
||||
void ServerPage::toggleIpDetermination(bool b)
|
||||
{
|
||||
rsPeers->allowServerIPDetermination(b) ;
|
||||
|
@ -45,6 +45,7 @@ private slots:
|
||||
void saveAddresses();
|
||||
void toggleUPnP();
|
||||
void toggleIpDetermination(bool) ;
|
||||
void showTurtleRouterDialog();
|
||||
|
||||
|
||||
private:
|
||||
|
@ -716,6 +716,67 @@ behind a firewall or a VPN.</string>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>F2F routing</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_enableTurtleCB">
|
||||
<property name="text">
|
||||
<string>enable anonymous F2F routing</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="_showTurtleDialogPB">
|
||||
<property name="text">
|
||||
<string>Show router statistics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<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:8pt; font-weight:600;">RetroShare</span><span style=" font-size:8pt;"> is capable of transfering data and search requests between peers that are not necessarily friends. This traffic however only transits through a connected list of friends and is anonymous.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p>
|
||||
<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:8pt;">If want to you use </span><span style=" font-size:8pt; font-weight:600;">RetroShare</span><span style=" font-size:8pt;"> to anonymously share and download files, leaving this checked drastically increases your download scope, and participate into the overall network bandwidth. </span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p>
|
||||
<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:8pt;">You can separately setup share flags for each shared directory:</span></p>
|
||||
<ul style="-qt-list-indent: 1;"><li style=" font-size:8pt;" style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Browsable by friends</span>: files are browsable from your direct friends.</li>
|
||||
<li style=" font-size:8pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Anonymously shared</span>: files can be downloaded by anybody through anonymous tunnels.</li></ul></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
|
Loading…
Reference in New Issue
Block a user