diff --git a/retroshare-gui/src/gui/LinksDialog.cpp b/retroshare-gui/src/gui/LinksDialog.cpp index 9f3172fba..073525a4b 100644 --- a/retroshare-gui/src/gui/LinksDialog.cpp +++ b/retroshare-gui/src/gui/LinksDialog.cpp @@ -54,21 +54,22 @@ #define IMAGE_GOOD ":/images/filerating4.png" #define IMAGE_OK ":/images/filerating3.png" #define IMAGE_SUX ":/images/filerating2.png" -#define IMAGE_BADLINK ":/images/filerating1.png" -#define IMAGE_DOWNLOAD ":/images/download16.png" +#define IMAGE_BADLINK ":/images/filerating1.png" +#define IMAGE_NOCOMMENTRATING ":/images/filerating0.png" +#define IMAGE_DOWNLOAD ":/images/download16.png" /****** * #define LINKS_DEBUG 1 *****/ -/** Constructor */ -LinksDialog::LinksDialog(QWidget *parent) +/** Constructor */ +LinksDialog::LinksDialog(QWidget *parent) : MainPage(parent) -{ - /* Invoke the Qt Designer generated object setup routine */ - ui.setupUi(this); - - connect( ui.linkTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( linkTreeWidgetCostumPopupMenu( QPoint ) ) ); +{ + /* Invoke the Qt Designer generated object setup routine */ + ui.setupUi(this); + + connect( ui.linkTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( linkTreeWidgetCostumPopupMenu( QPoint ) ) ); /* link combos */ @@ -143,10 +144,10 @@ void LinksDialog::checkUpdate() void LinksDialog::linkTreeWidgetCostumPopupMenu( QPoint point ) { - QMenu contextMnu( this ); - QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier ); - - voteupAct = new QAction(QIcon(IMAGE_EXPORTFRIEND), tr( "Share Link Anonymously" ), this ); + QMenu contextMnu( this ); + QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier ); + + voteupAct = new QAction(QIcon(IMAGE_EXPORTFRIEND), tr( "Share Link Anonymously" ), this ); connect( voteupAct , SIGNAL( triggered() ), this, SLOT( voteup_anon() ) ); @@ -172,14 +173,14 @@ void LinksDialog::linkTreeWidgetCostumPopupMenu( QPoint point ) downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr("Download"), this); connect(downloadAct, SIGNAL(triggered()), this, SLOT(downloadSelected())); - contextMnu.clear(); + contextMnu.clear(); contextMnu.addAction(voteupAct); contextMnu.addSeparator(); contextMnu.addMenu(voteMenu); contextMnu.addSeparator(); contextMnu.addAction(downloadAct); - contextMnu.exec( mevent->globalPos() ); + contextMnu.exec( mevent->globalPos() ); } void LinksDialog::changedSortRank( int index ) @@ -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] "; } diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index ecd3e91a5..9b86ecd3f 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -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 */ diff --git a/retroshare-gui/src/gui/settings/DirectoriesPage.cpp b/retroshare-gui/src/gui/settings/DirectoriesPage.cpp index b0abcee42..c3b78ee65 100755 --- a/retroshare-gui/src/gui/settings/DirectoriesPage.cpp +++ b/retroshare-gui/src/gui/settings/DirectoriesPage.cpp @@ -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.addButton->setToolTip(tr("Add a Share Directory")); - ui.removeButton->setToolTip(tr("Remove Shared Directory")); 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::const_iterator it; - std::list dirs; + std::list::const_iterator it; + std::list dirs; rsFiles->getSharedDirectories(dirs); - if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory())) - { + bool found = false ; + for(std::list::const_iterator it(dirs.begin());it!=dirs.end();++it) + if((*it).filename == rsFiles->getDownloadDirectory()) + { + 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::const_iterator it; - std::list dirs; + std::list::const_iterator it; + std::list 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::const_iterator it; - std::list dirs; + std::list::const_iterator it; + std::list dirs; rsFiles->getSharedDirectories(dirs); - if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory())) - { + bool found = false ; + for(std::list::const_iterator it(dirs.begin());it!=dirs.end();++it) + if((*it).filename == rsFiles->getDownloadDirectory()) + { + found=true ; + break ; + } + if(!found) rsFiles->shareDownloadDirectory(); - } } } load(); @@ -196,14 +215,20 @@ void DirectoriesPage::shareDownloadDirectory(int state) { if (state == Qt::Checked) { - std::list::const_iterator it; - std::list dirs; + std::list::const_iterator it; + std::list dirs; rsFiles->getSharedDirectories(dirs); - if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory())) - { + bool found = false ; + for(std::list::const_iterator it(dirs.begin());it!=dirs.end();++it) + if((*it).filename == rsFiles->getDownloadDirectory()) + { + found=true ; + break ; + } + if(!found) rsFiles->shareDownloadDirectory(); - } + rsFiles->setShareDownloadDirectory(true); } else @@ -214,4 +239,3 @@ void DirectoriesPage::shareDownloadDirectory(int state) load(); } - diff --git a/retroshare-gui/src/gui/settings/DirectoriesPage.h b/retroshare-gui/src/gui/settings/DirectoriesPage.h index 960e78f40..3a7d0aafb 100755 --- a/retroshare-gui/src/gui/settings/DirectoriesPage.h +++ b/retroshare-gui/src/gui/settings/DirectoriesPage.h @@ -46,8 +46,12 @@ class DirectoriesPage: public QWidget private slots: - void addShareDirectory(); - void removeShareDirectory(); +#ifdef TO_REMOVE + void addShareDirectory(); + void removeShareDirectory(); +#endif + + void editDirectories() ; void setIncomingDirectory(); void setPartialsDirectory(); void shareDownloadDirectory(int state); diff --git a/retroshare-gui/src/gui/settings/DirectoriesPage.ui b/retroshare-gui/src/gui/settings/DirectoriesPage.ui index 7466ceaa9..5d3e9be3e 100755 --- a/retroshare-gui/src/gui/settings/DirectoriesPage.ui +++ b/retroshare-gui/src/gui/settings/DirectoriesPage.ui @@ -6,8 +6,8 @@ 0 0 - 452 - 349 + 477 + 439 @@ -509,102 +509,6 @@ 0 - - - - Shared Directories - - - - - - - - - - 34 - 34 - - - - - 34 - 34 - - - - - - - - :/images/directoryadd_24x24_shadow.png:/images/directoryadd_24x24_shadow.png - - - - 24 - 24 - - - - - - - - - 34 - 34 - - - - - 34 - 34 - - - - - - - - :/images/directoryremove_24x24_shadow.png:/images/directoryremove_24x24_shadow.png - - - - 24 - 24 - - - - - - - - Qt::Vertical - - - - 20 - 71 - - - - - - - - true - - - Automatically share incoming directory (Recommanded) - - - true - - - - - - @@ -695,14 +599,44 @@ + + + + Shared Directories + + + + + + + + + true + + + Automatically share incoming directory (Recommanded) + + + true + + + + + + + Edit Share + + + + + + incomingDir incomingButton dirList - addButton - removeButton diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index ec65e947b..8c50acb66 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -20,6 +20,8 @@ ****************************************************************/ #include "ServerPage.h" +#include + #include "rshare.h" #include @@ -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) ; diff --git a/retroshare-gui/src/gui/settings/ServerPage.h b/retroshare-gui/src/gui/settings/ServerPage.h index acb56908d..5535edc1f 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.h +++ b/retroshare-gui/src/gui/settings/ServerPage.h @@ -45,6 +45,7 @@ private slots: void saveAddresses(); void toggleUPnP(); void toggleIpDetermination(bool) ; + void showTurtleRouterDialog(); private: diff --git a/retroshare-gui/src/gui/settings/ServerPage.ui b/retroshare-gui/src/gui/settings/ServerPage.ui index 5f116934f..8e2dcae4d 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.ui +++ b/retroshare-gui/src/gui/settings/ServerPage.ui @@ -716,6 +716,67 @@ behind a firewall or a VPN. + + + F2F routing + + + + + + + + enable anonymous F2F routing + + + true + + + + + + + Show router statistics + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + true + + + <!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> + + + + +