From b000245ef5f1a84dae64bd89cfc336ffc93cd005 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 21 Mar 2010 21:07:12 +0000 Subject: [PATCH] merged branch 0.5.0 commits 2576, 2579, 2581-2583 into trunk git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2592 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/ft/ftcontroller.cc | 50 +++++-- libretroshare/src/ft/ftcontroller.h | 3 + libretroshare/src/ft/ftfilecreator.cc | 5 + libretroshare/src/ft/ftfilecreator.h | 3 +- libretroshare/src/ft/ftserver.cc | 8 ++ libretroshare/src/ft/ftserver.h | 3 + libretroshare/src/rsiface/rsfiles.h | 2 + retroshare-gui/src/gui/RetroShareLink.h | 57 +++++--- retroshare-gui/src/gui/ShareManager.cpp | 5 +- retroshare-gui/src/gui/TransfersDialog.cpp | 82 ++++------- retroshare-gui/src/gui/TransfersDialog.ui | 14 +- .../src/gui/settings/TransferPage.cpp | 75 +++------- .../src/gui/settings/TransferPage.h | 6 +- .../src/gui/settings/TransferPage.ui | 135 ++++++------------ 14 files changed, 201 insertions(+), 247 deletions(-) diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index eaca0383b..5a0045eb8 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -57,6 +57,7 @@ * #define CONTROL_DEBUG 1 * #define DEBUG_DWLQUEUE 1 *****/ +#define DEBUG_DWLQUEUE 1 static const uint32_t SAVE_TRANSFERS_DELAY = 61 ; // save transfer progress every 61 seconds. static const uint32_t INACTIVE_CHUNKS_CHECK_DELAY = 60 ; // time after which an inactive chunk is released @@ -410,16 +411,23 @@ void ftController::checkDownloadQueue() // Check for inactive transfers. // time_t now = time(NULL) ; + uint32_t nb_moved = 0 ; // don't move more files than the size of the queue. - for(std::map::const_iterator it(mDownloads.begin());it!=mDownloads.end();++it) + for(std::map::const_iterator it(mDownloads.begin());it!=mDownloads.end() && nb_moved <= _max_active_downloads;++it) if( it->second->mState != ftFileControl::QUEUED && it->second->mState != ftFileControl::PAUSED - && now - it->second->mCreator->lastRecvTimeStamp() > (time_t)MAX_TIME_INACTIVE_REQUEUED) + && now > it->second->mCreator->lastRecvTimeStamp() + (time_t)MAX_TIME_INACTIVE_REQUEUED) { +#ifdef DEBUG_DWLQUEUE + std::cerr << " - Inactive file " << it->second->mName << " at position " << it->second->mQueuePosition << " moved to end of the queue. mState=" << it->second->mState << ", time lapse=" << now - it->second->mCreator->lastRecvTimeStamp() << std::endl ; +#endif locked_bottomQueue(it->second->mQueuePosition) ; #ifdef DEBUG_DWLQUEUE - std::cerr << " - Inactive file " << it->second->mName << " moved to end of the queue" << std::endl ; + std::cerr << " new position: " << it->second->mQueuePosition << std::endl ; + std::cerr << " new state: " << it->second->mState << std::endl ; #endif + it->second->mCreator->resetRecvTimeStamp() ; // very important! + ++nb_moved ; } } @@ -454,7 +462,8 @@ void ftController::setQueueSize(uint32_t s) std::cerr << "Settign new queue size to " << s << std::endl ; #endif for(uint32_t p=std::min(s,old_s);p<=std::max(s,old_s);++p) - locked_checkQueueElement(p); + if(p < _queue.size()) + locked_checkQueueElement(p); } else std::cerr << "ftController::setQueueSize(): cannot set queue to size " << s << std::endl ; @@ -540,11 +549,6 @@ void ftController::locked_swapQueue(uint32_t pos1,uint32_t pos2) locked_checkQueueElement(pos2) ; } -//void ftController::checkQueueElements() -//{ -// for(uint32_t pos=0;pos<_queue.size();++pos) -// checkQueueElement(pos) ; -//} void ftController::locked_checkQueueElement(uint32_t pos) { _queue[pos]->mQueuePosition = pos ; @@ -1147,6 +1151,8 @@ bool ftController::FileRequest(std::string fname, std::string hash, ftFileCreator *fc = new ftFileCreator(savepath, size, hash); ftTransferModule *tm = new ftTransferModule(fc, mDataplex,this); + fc->setChunkStrategy(mDefaultChunkStrategy) ; + /* add into maps */ ftFileControl *ftfc = new ftFileControl(fname, savepath, destination, size, hash, flags, fc, tm, callbackCode); ftfc->mCreateTime = time(NULL); @@ -1726,6 +1732,7 @@ bool ftController::CancelCacheFile(RsPeerId id, std::string path, std::string ha const std::string download_dir_ss("DOWN_DIR"); const std::string partial_dir_ss("PART_DIR"); const std::string share_dwl_dir("SHARE_DWL_DIR"); +const std::string default_chunk_strategy_ss("DEFAULT_CHUNK_STRATEGY"); /* p3Config Interface */ @@ -1757,6 +1764,7 @@ std::list ftController::saveList(bool &cleanup) configMap[download_dir_ss] = getDownloadDirectory(); configMap[partial_dir_ss] = getPartialsDirectory(); configMap[share_dwl_dir] = mShareDownloadDir ? "YES" : "NO"; + configMap[default_chunk_strategy_ss] = (mDefaultChunkStrategy==FileChunksInfo::CHUNK_STRATEGY_STREAMING) ? "STREAMING" : "RANDOM"; RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet(); @@ -1940,15 +1948,39 @@ bool ftController::loadConfigMap(std::map &configMap) } } + if (configMap.end() != (mit = configMap.find(default_chunk_strategy_ss))) + { + if(mit->second == "STREAMING") + setDefaultChunkStrategy(FileChunksInfo::CHUNK_STRATEGY_STREAMING) ; + else if(mit->second == "RANDOM") + setDefaultChunkStrategy(FileChunksInfo::CHUNK_STRATEGY_RANDOM) ; + } + return true; } +FileChunksInfo::ChunkStrategy ftController::defaultChunkStrategy() +{ + RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ + return mDefaultChunkStrategy ; +} +void ftController::setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy S) +{ + RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ + mDefaultChunkStrategy = S ; + IndicateConfigChanged() ; +} + void ftController::setShareDownloadDirectory(bool value) { + RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ mShareDownloadDir = value; + IndicateConfigChanged() ; } bool ftController::getShareDownloadDirectory() { + RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ return mShareDownloadDir; } + diff --git a/libretroshare/src/ft/ftcontroller.h b/libretroshare/src/ft/ftcontroller.h index 2dd955f2e..ba1cf93cf 100644 --- a/libretroshare/src/ft/ftcontroller.h +++ b/libretroshare/src/ft/ftcontroller.h @@ -144,6 +144,8 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu bool alreadyHaveFile(const std::string& hash) ; bool setChunkStrategy(const std::string& hash,FileChunksInfo::ChunkStrategy s); + void setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy s); + FileChunksInfo::ChunkStrategy defaultChunkStrategy(); bool FileCancel(std::string hash); bool FileControl(std::string hash, uint32_t flags); @@ -265,6 +267,7 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu /* share incoming directory */ bool mShareDownloadDir; + FileChunksInfo::ChunkStrategy mDefaultChunkStrategy ; uint32_t _max_active_downloads ; // maximum number of simultaneous downloads }; diff --git a/libretroshare/src/ft/ftfilecreator.cc b/libretroshare/src/ft/ftfilecreator.cc index 6f19c7e96..d18faa286 100644 --- a/libretroshare/src/ft/ftfilecreator.cc +++ b/libretroshare/src/ft/ftfilecreator.cc @@ -58,6 +58,11 @@ time_t ftFileCreator::lastRecvTimeStamp() RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/ return _last_recv_time_t ; } +void ftFileCreator::resetRecvTimeStamp() +{ + RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/ + _last_recv_time_t = time(NULL) ; +} void ftFileCreator::closeFile() { diff --git a/libretroshare/src/ft/ftfilecreator.h b/libretroshare/src/ft/ftfilecreator.h index 88b3f7941..d44f02a21 100644 --- a/libretroshare/src/ft/ftfilecreator.h +++ b/libretroshare/src/ft/ftfilecreator.h @@ -76,8 +76,9 @@ class ftFileCreator: public ftFileProvider // removes the designated file source from the chunkmap. void removeFileSource(const std::string& peer_id) ; - // Returns the time stamp of the last data receive. + // Returns resets the time stamp of the last data receive. time_t lastRecvTimeStamp() ; + void resetRecvTimeStamp() ; // actually store data in the file, and update chunks info // diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 5bbbb552f..7e63f126f 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -272,6 +272,14 @@ bool ftServer::setChunkStrategy(const std::string& hash,FileChunksInfo::ChunkStr { return mFtController->setChunkStrategy(hash,s); } +void ftServer::setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy) +{ + mFtController->defaultChunkStrategy() ; +} +FileChunksInfo::ChunkStrategy ftServer::defaultChunkStrategy() +{ + return mFtController->defaultChunkStrategy() ; +} bool ftServer::FileCancel(std::string hash) { diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index b70c3808b..fd764d760 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -125,6 +125,9 @@ virtual bool FileCancel(std::string hash); virtual bool FileControl(std::string hash, uint32_t flags); virtual bool FileClearCompleted(); virtual bool setChunkStrategy(const std::string& hash,FileChunksInfo::ChunkStrategy s) ; +virtual void setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy) ; +virtual FileChunksInfo::ChunkStrategy defaultChunkStrategy() ; + /*** * Control of Downloads Priority. diff --git a/libretroshare/src/rsiface/rsfiles.h b/libretroshare/src/rsiface/rsfiles.h index 4accaa49a..141997cc3 100644 --- a/libretroshare/src/rsiface/rsfiles.h +++ b/libretroshare/src/rsiface/rsfiles.h @@ -113,6 +113,8 @@ class RsFiles virtual bool FileRequest(std::string fname, std::string hash, uint64_t size, std::string dest, uint32_t flags, std::list srcIds) = 0; virtual bool FileCancel(std::string hash) = 0; virtual bool setChunkStrategy(const std::string& hash,FileChunksInfo::ChunkStrategy) = 0; + virtual void setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy) = 0; + virtual FileChunksInfo::ChunkStrategy defaultChunkStrategy() = 0; virtual bool FileControl(std::string hash, uint32_t flags) = 0; virtual bool FileClearCompleted() = 0; diff --git a/retroshare-gui/src/gui/RetroShareLink.h b/retroshare-gui/src/gui/RetroShareLink.h index d1278cf5c..b3c5f93eb 100644 --- a/retroshare-gui/src/gui/RetroShareLink.h +++ b/retroshare-gui/src/gui/RetroShareLink.h @@ -49,11 +49,16 @@ class RetroShareLink /// returns the string retroshare://file|name|size|hash QString toString() const ; - /// returns the string retroshare://file|name|size|hash + /// returns the string name QString toHtml() const ; + /// returns the string retroshare://file|name|size|hash + QString toHtmlFull() const ; + QUrl toUrl() const ; bool valid() const { return _size > 0 ; } + + bool operator==(const RetroShareLink& l) const { return _hash == l._hash ; } private: void check() ; static bool checkHash(const QString& hash) ; @@ -68,32 +73,42 @@ class RetroShareLink /// This class handles the copy/paste of links. Every member is static to ensure unicity. /// I put no mutex, because all calls supposely com from the GUI thread. +/// +/// All links are stored in html format into the clipboard. Why? Because this allows to import +/// links from both the clipboard and the RS application, e.g. paste links from an internet forum. +/// This requires many clipboard parsing operations, but this is not a problem because this code is +/// not performances-critical. // class RSLinkClipboard { public: - static void copyLinks(const std::vector& links) - { - _links = links ; - } - static const std::vector& pasteLinks() - { - return _links ; - } - static QString toHtml() - { - QString res ; - for(uint32_t i=0;i<_links.size();++i) - res += _links[i].toHtml() + "
" ; + // Copy these links to the RS clipboard. Also copy them to the system clipboard + // + static void copyLinks(const std::vector& links) ; + + // Get the liste of pasted links, either from the internal RS links, or by default + // from the clipboard. + // + static std::vector pasteLinks() ; + + // Produces a list of links with no html structure. + static QString toString() ; + + // produces a list of html links that displays with the file names only + // + static QString toHtml(); + + // produces a list of html links that displays the full links + // + static QString toHtmlFull(); + + // Returns true is no links are found to paste. + // Useful for menus. + // + static bool empty(); - return res ; - } - static bool empty() - { - return _links.empty(); - } private: - static std::vector _links ; + static std::vector parseClipboard() ; }; diff --git a/retroshare-gui/src/gui/ShareManager.cpp b/retroshare-gui/src/gui/ShareManager.cpp index a0794942f..d14e29a16 100644 --- a/retroshare-gui/src/gui/ShareManager.cpp +++ b/retroshare-gui/src/gui/ShareManager.cpp @@ -104,7 +104,7 @@ void ShareManager::load() for(it = dirs.begin(); it != dirs.end(); it++,++row) { listWidget->insertRow(row) ; - listWidget->setItem(row,0,new QTableWidgetItem(QString::fromStdString((*it).filename))); + listWidget->setItem(row,0,new QTableWidgetItem(QString::fromUtf8((*it).filename.c_str()))); #ifdef USE_COMBOBOX QComboBox *cb = new QComboBox ; cb->addItem(QString("Network Wide")) ; @@ -173,8 +173,7 @@ void ShareManager::addShareDirectory() */ - QString qdir = QFileDialog::getExistingDirectory(this, tr("Select A Folder To Share"), "", - QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + QString qdir = QFileDialog::getExistingDirectory(this, tr("Select A Folder To Share"), "", QFileDialog::DontUseNativeDialog | QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); /* add it to the server */ std::string dir = qdir.toStdString(); diff --git a/retroshare-gui/src/gui/TransfersDialog.cpp b/retroshare-gui/src/gui/TransfersDialog.cpp index 5a1e329c5..22e9e6a10 100644 --- a/retroshare-gui/src/gui/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/TransfersDialog.cpp @@ -201,6 +201,7 @@ TransfersDialog::TransfersDialog(QWidget *parent) #endif + QObject::connect(ui._showCacheTransfers_CB,SIGNAL(toggled(bool)),this,SLOT(insertTransfers())) ; } @@ -663,50 +664,23 @@ void TransfersDialog::insertTransfers() // std::list dwlDetails; // rsFiles->getDwlDetails(dwlDetails); - //first clean the model in case some files are not download anymore - //remove items that are not fiends anymore - int removeIndex = 0; - while (removeIndex < DLListModel->rowCount()) { - std::string hash = DLListModel->item(removeIndex, ID)->data(Qt::EditRole).toString().toStdString(); - std::list::iterator downHashesIt; - bool found = false; - for (downHashesIt = downHashes.begin(); downHashesIt != downHashes.end(); downHashesIt++) { - if (hash == *downHashesIt) { - found = true; - break; - } - } -// if (!found) { -// //look in the queued files -// std::list::iterator dwlDetailsIt; -// for (dwlDetailsIt = dwlDetails.begin(); dwlDetailsIt != dwlDetails.end(); dwlDetailsIt++) { -// if (hash == dwlDetailsIt->hash) { -// found = true; -// break; -// } -// } -// } - if (!found) { - DLListModel->takeRow(removeIndex); - } else { - removeIndex++; - } - } + + + std::set used_hashes ; // clear all source peers. std::list::iterator it; - for (it = downHashes.begin(); it != downHashes.end(); it++) { + for (it = downHashes.begin(); it != downHashes.end(); it++) + { FileInfo info; if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) { //if file transfer is a cache file index file, don't show it continue; } - if ((info.flags & CB_CODE_CACHE)) { - /*(!_show_cache_transfers) &&*/ + if((info.flags & CB_CODE_CACHE) && !ui._showCacheTransfers_CB->isChecked()) continue; - } QString fileName = QString::fromUtf8(info.fname.c_str()); QString fileHash = QString::fromStdString(info.hash); @@ -763,6 +737,7 @@ void TransfersDialog::insertTransfers() pinfo.nb_chunks = pinfo.cmap._map.empty()?0:fcinfo.chunks.size() ; int addedRow = addItem("", fileName, fileHash, fileSize, pinfo, fileDlspeed, sources, status, priority, completed, remaining, downloadtime); + used_hashes.insert(info.hash) ; /* continue to next download item if no peers to add */ if (!info.peers.size()) continue; @@ -810,7 +785,7 @@ void TransfersDialog::insertTransfers() // std::cerr << std::endl ; // std::cerr << std::endl ; - std::cout << "adding peer " << peerName.toStdString() << " to row " << addedRow << ", hashfile and peerid=" << hashFileAndPeerId.toStdString() << std::endl ; +// std::cout << "adding peer " << peerName.toStdString() << " to row " << addedRow << ", hashfile and peerid=" << hashFileAndPeerId.toStdString() << std::endl ; int row_id = addPeerToItem(addedRow, peerName, hashFileAndPeerId, peerDlspeed, status, peerpinfo); used_rows.insert(row_id) ; @@ -825,31 +800,22 @@ void TransfersDialog::insertTransfers() if(used_rows.find(r) == used_rows.end()) dlItem->takeRow(r) ; } + // remove hashes that where not shown + //first clean the model in case some files are not download anymore + //remove items that are not fiends anymore + int removeIndex = 0; + while (removeIndex < DLListModel->rowCount()) + { + std::string hash = DLListModel->item(removeIndex, ID)->data(Qt::EditRole).toString().toStdString(); - /* here i will insert files from the download queue - which are - * not started yet and can't be find in FileDownloads - * */ - // std::list::iterator dit; - // for (dit = dwlDetails.begin(); dit != dwlDetails.end(); dit ++) - // { - //// switch (dit->priority) { - //// case 0: priority = tr("Low"); break; - //// case 1: priority = tr("Normal"); break; - //// case 2: priority = tr("High"); break; - //// case 3: priority = tr("Auto"); break; - //// default: priority = tr("Auto"); break; - //// } - // - // FileProgressInfo pinfo ; - // pinfo.progress = 0.0 ; - // pinfo.nb_chunks = 0 ; - // - // addItem("", QString::fromUtf8(dit->fname.c_str()), - // QString::fromStdString(dit->hash), dit->count, pinfo, 0, 0, - // tr("Queued"), "", 0, 0, 0); - // } - // + if(used_hashes.find(hash) == used_hashes.end()) + DLListModel->takeRow(removeIndex); + else + removeIndex++; + } + // Now show upload hashes + // std::list upHashes; rsFiles->FileUploads(upHashes); //first clean the model in case some files are not uploaded anymore @@ -881,7 +847,7 @@ void TransfersDialog::insertTransfers() if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info)) { continue; } - if (/*(!_show_cache_transfers) &&*/ (info.flags & CB_CODE_CACHE)) + if((info.flags & CB_CODE_CACHE) && !ui._showCacheTransfers_CB->isChecked()) continue ; std::list::iterator pit; diff --git a/retroshare-gui/src/gui/TransfersDialog.ui b/retroshare-gui/src/gui/TransfersDialog.ui index 3c39d21fc..a51faba20 100644 --- a/retroshare-gui/src/gui/TransfersDialog.ui +++ b/retroshare-gui/src/gui/TransfersDialog.ui @@ -602,6 +602,13 @@ p, li { white-space: pre-wrap; } + + + + Show cache transfers + + + @@ -658,9 +665,6 @@ p, li { white-space: pre-wrap; } false - - false - @@ -843,8 +847,8 @@ p, li { white-space: pre-wrap; } 0 0 - 98 - 28 + 578 + 113 diff --git a/retroshare-gui/src/gui/settings/TransferPage.cpp b/retroshare-gui/src/gui/settings/TransferPage.cpp index 32df7c720..e07a60cfd 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.cpp +++ b/retroshare-gui/src/gui/settings/TransferPage.cpp @@ -26,9 +26,9 @@ #include #include -#include "rsiface/rsiface.h" -#include "rsiface/rsfiles.h" -#include "rsiface/rspeers.h" +#include +#include +#include #include @@ -38,15 +38,15 @@ TransferPage::TransferPage(QWidget * parent, Qt::WFlags flags) /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); -// QTimer *timer = new QTimer(this); -// timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus())); -// timer->start(1000); - - updateStatus(); - ui._queueSize_SB->setValue(rsFiles->getQueueSize()) ; + if(rsFiles->defaultChunkStrategy() == FileChunksInfo::CHUNK_STRATEGY_STREAMING) + ui._defaultStrategy_CB->setCurrentIndex(0) ; + else + ui._defaultStrategy_CB->setCurrentIndex(1) ; + QObject::connect(ui._queueSize_SB,SIGNAL(valueChanged(int)),this,SLOT(updateQueueSize(int))) ; + QObject::connect(ui._defaultStrategy_CB,SIGNAL(activated(int)),this,SLOT(updateDefaultStrategy(int))) ; /* Hide platform specific features */ #ifdef Q_WS_WIN @@ -54,6 +54,20 @@ TransferPage::TransferPage(QWidget * parent, Qt::WFlags flags) #endif } +void TransferPage::updateDefaultStrategy(int i) +{ + switch(i) + { + case 0: rsFiles->setDefaultChunkStrategy(FileChunksInfo::CHUNK_STRATEGY_STREAMING) ; + break ; + + case 1: rsFiles->setDefaultChunkStrategy(FileChunksInfo::CHUNK_STRATEGY_RANDOM) ; + break ; + + default: ; + } +} + void TransferPage::updateQueueSize(int s) { rsFiles->setQueueSize(s) ; @@ -65,46 +79,3 @@ void TransferPage::closeEvent (QCloseEvent * event) } -/** Saves the changes on this page */ -bool -TransferPage::save(QString &errmsg) -{ - - /* save the server address */ - /* save local address */ - /* save the url for DNS access */ - - /* restart server */ - - /* save all? */ - //saveAddresses(); - return true; -} - -/** Loads the settings for this page */ -void TransferPage::load() -{ - - /* load up configuration from rsPeers */ -// RsPeerDetails detail; -// if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail)) -// { -// return; -// } - - -} - -/** Loads the settings for this page */ -void TransferPage::updateStatus() -{ - /* load up configuration from rsPeers */ -// RsPeerDetails detail; -// if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail)) -// { -// return; -// } -} - - - diff --git a/retroshare-gui/src/gui/settings/TransferPage.h b/retroshare-gui/src/gui/settings/TransferPage.h index f2a47ae51..5169f14a7 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.h +++ b/retroshare-gui/src/gui/settings/TransferPage.h @@ -36,13 +36,13 @@ class TransferPage: public ConfigPage ~TransferPage() {} /** Saves the changes on this page */ - bool save(QString &errmsg); + virtual bool save(QString &errmsg) {} /** Loads the settings for this page */ - void load(); + virtual void load() {} public slots: - void updateStatus(); void updateQueueSize(int) ; + void updateDefaultStrategy(int) ; private: diff --git a/retroshare-gui/src/gui/settings/TransferPage.ui b/retroshare-gui/src/gui/settings/TransferPage.ui index 6325eab7a..6cc79ba0b 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.ui +++ b/retroshare-gui/src/gui/settings/TransferPage.ui @@ -13,31 +13,36 @@ Form - - - - - 0 + + + + + Transfer options - - - Transfer - - - - - - Transfer options - - - + + + + + + Queue Size: - + + + + Default chunk strategy: + + + + + + + + true @@ -53,40 +58,10 @@ - - - - Maximum Download speed per file: - - - - - + + - false - - - kB/s - - - 100000 - - - 1024 - - - - - - - Default chunk strategy: - - - - - - - false + true @@ -100,46 +75,17 @@ - - - - false - - - Show Cache Transfers - - - - - - - - - Qt::Vertical - - - - 248 - 138 - - - - - - - - - F2F Routing - - - - - - true - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + + + + 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;"> @@ -148,11 +94,10 @@ p, li { white-space: pre-wrap; } <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 in the shared files dialog to be:</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 seen by your 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 are anonymously reachable through distant F2F tunnels.</li></ul></body></html> - - - - - + + + +