diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index 4032a0c05..60e31b908 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -35,6 +35,11 @@ * */ +#ifdef WINDOWS_SYS +#include "util/rswin.h" +#endif +#include "util/rsdiscspace.h" + #include "ft/ftcontroller.h" #include "ft/ftfilecreator.h" @@ -52,6 +57,7 @@ #include "serialiser/rsconfigitems.h" #include +#include /****** * #define CONTROL_DEBUG 1 @@ -1782,6 +1788,7 @@ 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"); +const std::string free_space_limit_ss("FREE_SPACE_LIMIT"); /* p3Config Interface */ @@ -1815,6 +1822,11 @@ std::list ftController::saveList(bool &cleanup) configMap[share_dwl_dir] = mShareDownloadDir ? "YES" : "NO"; configMap[default_chunk_strategy_ss] = (mDefaultChunkStrategy==FileChunksInfo::CHUNK_STRATEGY_STREAMING) ? "STREAMING" : "RANDOM"; + std::ostringstream s ; + s << RsDiscSpace::freeSpaceLimit(); + + configMap[free_space_limit_ss] = s.str() ; + RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet(); /* Convert to TLV */ @@ -2013,9 +2025,33 @@ bool ftController::loadConfigMap(std::map &configMap) std::cerr << "**** ERROR ***: Unknown value for default chunk strategy in keymap." << std::endl ; } + if (configMap.end() != (mit = configMap.find(free_space_limit_ss))) + { + std::istringstream in(mit->second) ; + uint32_t size ; + + in >> size ; + + std::cerr << "have read a size limit of " << size <<" MB" << std::endl ; + + RsDiscSpace::setFreeSpaceLimit(size) ; + } return true; } +void ftController::setFreeDiskSpaceLimit(uint32_t size_in_mb) +{ + RsDiscSpace::setFreeSpaceLimit(size_in_mb) ; + + IndicateConfigChanged() ; +} + + +uint32_t ftController::freeDiskSpaceLimit() const +{ + return RsDiscSpace::freeSpaceLimit() ; +} + FileChunksInfo::ChunkStrategy ftController::defaultChunkStrategy() { RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ diff --git a/libretroshare/src/ft/ftcontroller.h b/libretroshare/src/ft/ftcontroller.h index 9fa4c1988..87d05ff09 100644 --- a/libretroshare/src/ft/ftcontroller.h +++ b/libretroshare/src/ft/ftcontroller.h @@ -146,6 +146,8 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu bool setChunkStrategy(const std::string& hash,FileChunksInfo::ChunkStrategy s); void setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy s); FileChunksInfo::ChunkStrategy defaultChunkStrategy(); + uint32_t freeDiskSpaceLimit() const ; + void setFreeDiskSpaceLimit(uint32_t size_in_mb) ; bool FileCancel(std::string hash); bool FileControl(std::string hash, uint32_t flags); diff --git a/libretroshare/src/ft/ftfilecreator.cc b/libretroshare/src/ft/ftfilecreator.cc index d18faa286..292dc4729 100644 --- a/libretroshare/src/ft/ftfilecreator.cc +++ b/libretroshare/src/ft/ftfilecreator.cc @@ -1,6 +1,7 @@ #include "ftfilecreator.h" #include #include +#include /******* * #define FILE_DEBUG 1 @@ -93,6 +94,9 @@ bool ftFileCreator::addFileData(uint64_t offset, uint32_t chunk_size, void *data /* dodgey checking outside of mutex... much check again inside FileAttrs(). */ /* Check File is open */ + if(!RsDiscSpace::checkForDiscSpace(RS_PARTIALS_DIRECTORY)) + return false ; + RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/ if (fd == NULL) diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 2e7627952..05235dcae 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); } +uint32_t ftServer::freeDiskSpaceLimit()const +{ + return mFtController->freeDiskSpaceLimit() ; +} +void ftServer::setFreeDiskSpaceLimit(uint32_t s) +{ + mFtController->setFreeDiskSpaceLimit(s) ; +} void ftServer::setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy s) { mFtController->setDefaultChunkStrategy(s) ; diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index fd764d760..7753a172e 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -127,6 +127,8 @@ virtual bool FileClearCompleted(); virtual bool setChunkStrategy(const std::string& hash,FileChunksInfo::ChunkStrategy s) ; virtual void setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy) ; virtual FileChunksInfo::ChunkStrategy defaultChunkStrategy() ; +virtual uint32_t freeDiskSpaceLimit() const ; +virtual void setFreeDiskSpaceLimit(uint32_t size_in_mb) ; /*** diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index a34b36cd1..51f093d07 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -289,6 +289,7 @@ HEADERS += dbase/cachestrapper.h \ tcponudp/udplayer.h \ tcponudp/udpsorter.h \ upnp/upnphandler.h \ + util/rsdiscspace.h \ util/rsdebug.h \ util/rsdir.h \ util/rsnet.h \ @@ -406,6 +407,7 @@ SOURCES += \ tcponudp/udpsorter.cc \ tcponudp/tou_net.cc \ tcponudp/udplayer.cc \ + util/rsdiscspace.cc \ util/rsdebug.cc \ util/rsdir.cc \ util/rsnet.cc \ diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index 15068ea79..4bdc1495e 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -31,6 +31,7 @@ #include "pqi/pqistore.h" #include "pqi/pqinotify.h" #include +#include #include "serialiser/rsconfigitems.h" @@ -86,6 +87,9 @@ void p3ConfigMgr::tick() void p3ConfigMgr::saveConfiguration() { + if(!RsDiscSpace::checkForDiscSpace(RS_CONFIG_DIRECTORY)) + return ; + RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/ #ifdef CONFIG_DEBUG diff --git a/libretroshare/src/rsiface/rsfiles.h b/libretroshare/src/rsiface/rsfiles.h index 141997cc3..09ccc354e 100644 --- a/libretroshare/src/rsiface/rsfiles.h +++ b/libretroshare/src/rsiface/rsfiles.h @@ -115,6 +115,8 @@ class RsFiles virtual bool setChunkStrategy(const std::string& hash,FileChunksInfo::ChunkStrategy) = 0; virtual void setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy) = 0; virtual FileChunksInfo::ChunkStrategy defaultChunkStrategy() = 0; + virtual uint32_t freeDiskSpaceLimit() const =0; + virtual void setFreeDiskSpaceLimit(uint32_t size_in_mb) =0; virtual bool FileControl(std::string hash, uint32_t flags) = 0; virtual bool FileClearCompleted() = 0; diff --git a/libretroshare/src/rsiface/rsiface.h b/libretroshare/src/rsiface/rsiface.h index 052288876..48165ef2c 100644 --- a/libretroshare/src/rsiface/rsiface.h +++ b/libretroshare/src/rsiface/rsiface.h @@ -207,6 +207,7 @@ class NotifyBase virtual void notifyPeerHasNewAvatar(std::string peer_id) { (void)peer_id; } virtual void notifyOwnAvatarChanged() {} virtual void notifyOwnStatusMessageChanged() {} + virtual void notifyDiskFull(uint32_t /* location */,uint32_t /* size limit in MB */) {} virtual std::string askForPassword(const std::string& key_details,bool prev_is_bad) { return "" ;} }; diff --git a/libretroshare/src/rsiface/rstypes.h b/libretroshare/src/rsiface/rstypes.h index d2fe053cb..9bd8d2e22 100644 --- a/libretroshare/src/rsiface/rstypes.h +++ b/libretroshare/src/rsiface/rstypes.h @@ -47,6 +47,12 @@ const uint32_t FT_STATE_COMPLETE = 0x0004 ; const uint32_t FT_STATE_QUEUED = 0x0005 ; const uint32_t FT_STATE_PAUSED = 0x0006 ; +// These constants are used by RsDiscSpace +// +const uint32_t RS_PARTIALS_DIRECTORY = 0x0000 ; +const uint32_t RS_DOWNLOAD_DIRECTORY = 0x0001 ; +const uint32_t RS_CONFIG_DIRECTORY = 0x0002 ; + class TransferInfo { public: diff --git a/libretroshare/src/util/rsdiscspace.cc b/libretroshare/src/util/rsdiscspace.cc new file mode 100644 index 000000000..9055b5518 --- /dev/null +++ b/libretroshare/src/util/rsdiscspace.cc @@ -0,0 +1,181 @@ +/* + * libretroshare/src/util: rsdiscspace.cc + * + * Universal Networking Header for RetroShare. + * + * Copyright 2010-2010 by Cyril Soler. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License Version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Please report all bugs and problems to "csoler@users.sourceforge.net". + * + */ + +#include +#include +#include +#include +#include "rsdiscspace.h" +#include +#ifndef WIN32 +#include +#endif + +#define DELAY_BETWEEN_CHECKS 2 + +/* + * #define DEBUG_RSDISCSPACE + */ +#define DEBUG_RSDISCSPACE + +time_t RsDiscSpace::_last_check[3] = { 0,0,0 } ; +uint32_t RsDiscSpace::_size_limit_mb = 50 ; +uint32_t RsDiscSpace::_current_size[3] = { 10000,10000,10000 } ; +bool RsDiscSpace::_last_res[3] = { true,true,true }; +RsMutex RsDiscSpace::_mtx ; + +bool RsDiscSpace::crossSystemDiskStats(const char *file, uint64_t& free_blocks, uint64_t& block_size) +{ +#if defined(WIN32) || defined(MINGW) || defined(__CYGWIN__) + + DWORD dwFreeClusters; + DWORD dwBytesPerSector; + DWORD dwSectorPerCluster; + DWORD dwTotalClusters; + +#ifdef WIN_CROSS_UBUNTU + wchar_t szDrive[4]; + szDrive[0] = file[0] ; + szDrive[1] = file[1] ; + szDrive[2] = file[2] ; +#else + char szDrive[4] = ""; + + char *pszFullPath = _fullpath (NULL, file, 0); + if (pszFullPath == 0) { + std::cerr << "Size estimate failed for drive (_fullpath) " << szDrive << std::endl ; + return false; + } + _splitpath (pszFullPath, szDrive, NULL, NULL, NULL); + free (pszFullPath); +#endif + szDrive[3] = 0; + + if (!GetDiskFreeSpace (szDrive, &dwSectorPerCluster, &dwBytesPerSector, &dwFreeClusters, &dwTotalClusters)) + { + std::cerr << "Size estimate failed for drive " << szDrive << std::endl ; + return false; + } + + free_blocks = dwFreeClusters ; + block_size = dwSectorPerCluster * dwBytesPerSector ; +#else + struct statvfs64 buf; + + if (0 != statvfs64 (file, &buf)) + { + std::cerr << "Size estimate failed for file " << file << std::endl ; + return false; + } + +#ifdef __APPLE__ + free_blocks = buf.f_bavail; + block_size = buf.f_frsize ; +#else + free_blocks = buf.f_bavail; + block_size = buf.f_bsize ; +#endif + +#endif + return true ; +} + +bool RsDiscSpace::checkForDiscSpace(RsDiscSpace::DiscLocation loc) +{ + RsStackMutex m(_mtx) ; // Locked + + time_t now = time(NULL) ; + + if(_last_check[loc]+DELAY_BETWEEN_CHECKS < now) + { + uint64_t free_blocks,block_size ; + int rs = false; + +#ifdef DEBUG_RSDISCSPACE + std::cerr << "Size determination:" << std::endl ; +#endif + switch(loc) + { + case RS_DOWNLOAD_DIRECTORY: rs = crossSystemDiskStats(rsFiles->getDownloadDirectory().c_str(),free_blocks,block_size) ; +#ifdef DEBUG_RSDISCSPACE + std::cerr << " path = " << rsFiles->getDownloadDirectory() << std::endl ; +#endif + break ; + + case RS_PARTIALS_DIRECTORY: rs = crossSystemDiskStats(rsFiles->getPartialsDirectory().c_str(),free_blocks,block_size) ; +#ifdef DEBUG_RSDISCSPACE + std::cerr << " path = " << rsFiles->getPartialsDirectory() << std::endl ; +#endif + break ; + + case RS_CONFIG_DIRECTORY: rs = crossSystemDiskStats(RsInit::RsConfigDirectory().c_str(),free_blocks,block_size) ; +#ifdef DEBUG_RSDISCSPACE + std::cerr << " path = " << RsInit::RsConfigDirectory() << std::endl ; +#endif + break ; + } + + if(!rs) + { + std::cerr << "Determination of free disc space failed ! Be careful !" << std::endl ; + return true ; + } + _last_check[loc] = now ; + + // Now compute the size in megabytes + // + _current_size[loc] = uint32_t(block_size * free_blocks / (uint64_t)(1024*1024)) ; // on purpose integer division + +#ifdef DEBUG_RSDISCSPACE + std::cerr << " blocks available = " << free_blocks << std::endl ; + std::cerr << " blocks size = " << block_size << std::endl ; + std::cerr << " free MBs = " << _current_size[loc] << std::endl ; +#endif + } + + bool res = _current_size[loc] > _size_limit_mb ; + + if(_last_res[loc] && !res) + rsicontrol->getNotify().notifyDiskFull(loc,_size_limit_mb) ; + + _last_res[loc] = res ; + + return res ; +} + +void RsDiscSpace::setFreeSpaceLimit(uint32_t size_in_mb) +{ + RsStackMutex m(_mtx) ; // Locked + + _size_limit_mb = size_in_mb ; +} + +uint32_t RsDiscSpace::freeSpaceLimit() +{ + RsStackMutex m(_mtx) ; // Locked + + return _size_limit_mb ; +} + diff --git a/libretroshare/src/util/rsdiscspace.h b/libretroshare/src/util/rsdiscspace.h new file mode 100644 index 000000000..27a5b717c --- /dev/null +++ b/libretroshare/src/util/rsdiscspace.h @@ -0,0 +1,59 @@ +/* + * libretroshare/src/util: rsdiscspace.h + * + * Universal Networking Header for RetroShare. + * + * Copyright 2010-2010 by Cyril Soler. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License Version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Please report all bugs and problems to "csoler@users.sourceforge.net". + * + */ + +#pragma once + +#include +#include +#include + +class RsDiscSpace +{ + public: + typedef uint32_t DiscLocation ; + + // Returns false is the disc space is lower than the given size limit, true otherwise. + // When the size limit is reached, this class calls notify to warn the user (possibly + // with a popup window). + // + static bool checkForDiscSpace(DiscLocation loc) ; + + // Allow the user to specify his own size limit. Should not be too low, especially not 0 MB ;-) + // 10MB to 100MB are sensible values. + // + static void setFreeSpaceLimit(uint32_t mega_bytes) ; + static uint32_t freeSpaceLimit() ; + + private: + static bool crossSystemDiskStats(const char *file, uint64_t& free_blocks, uint64_t& block_size) ; + + static RsMutex _mtx ; + + static time_t _last_check[3] ; + static uint32_t _size_limit_mb ; + static uint32_t _current_size[3] ; + static bool _last_res[3] ; +}; + diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 1e2c11e11..1a8425c8b 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -183,11 +183,11 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) ui.stackPages->add(messagesDialog = new MessagesDialog(ui.stackPages), messageAction = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp)); - #ifndef RS_RELEASE_VERSION +#ifndef RS_RELEASE_VERSION ChannelFeed *channelFeed = NULL; ui.stackPages->add(channelFeed = new ChannelFeed(ui.stackPages), createPageAction(QIcon(IMAGE_CHANNELS), tr("Channels"), grp)); - #endif +#endif #ifdef BLOGS BlogsDialog *blogsFeed = NULL; @@ -285,6 +285,28 @@ MainWindow::~MainWindow() #endif } +void MainWindow::displayDiskSpaceWarning(int loc,int size_limit_mb) +{ + QString locString ; + switch(loc) + { + case RS_PARTIALS_DIRECTORY: locString = "Partials" ; + break ; + + case RS_CONFIG_DIRECTORY: locString = "Config" ; + break ; + + case RS_DOWNLOAD_DIRECTORY: locString = "Download" ; + break ; + + default: + std::cerr << "Error: " << __PRETTY_FUNCTION__ << " was called with an unknown parameter loc=" << loc << std::endl ; + return ; + } + QMessageBox::critical(NULL,tr("Low disk space warning"), + tr("The disk space used by your ")+locString +tr(" directory is running low (Less than ")+QString::number(size_limit_mb)+tr("MB). \n\n RetroShare will now safely suspend config files saving and transfers. \n\n Please make some free space, then click Ok.")) ; +} + /** Creates a tray icon with a context menu and adds it to the system * notification area. */ void MainWindow::createTrayIcon() diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index 84a37f5e0..82065fb48 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -105,6 +105,7 @@ public slots: void updateHashingInfo(const QString&) ; void displayErrorMessage(int,int,const QString&) ; void postModDirectories(bool update_local); + void displayDiskSpaceWarning(int loc,int size_limit_mb) ; protected: void closeEvent(QCloseEvent *); diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index f3a2a012d..d88e3e1c0 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -56,6 +56,13 @@ std::string NotifyQt::askForPassword(const std::string& key_details,bool prev_is return res ; } +void NotifyQt::notifyDiskFull(uint32_t loc,uint32_t size_in_mb) +{ + std::cerr << "Notifyqt:: notified that disk is full" << std::endl ; + + emit diskFull(loc,size_in_mb) ; +} + void NotifyQt::notifyOwnStatusMessageChanged() { #ifdef NOTIFY_DEBUG diff --git a/retroshare-gui/src/gui/notifyqt.h b/retroshare-gui/src/gui/notifyqt.h index 2723afb63..9c5b11705 100644 --- a/retroshare-gui/src/gui/notifyqt.h +++ b/retroshare-gui/src/gui/notifyqt.h @@ -40,6 +40,8 @@ class NotifyQt: public QObject, public NotifyBase virtual void notifyPeerHasNewAvatar(std::string peer_id) ; virtual void notifyOwnAvatarChanged() ; virtual void notifyOwnStatusMessageChanged() ; + virtual void notifyDiskFull(uint32_t loc,uint32_t size_in_mb) ; + virtual std::string askForPassword(const std::string& key_details,bool prev_is_bad) ; @@ -63,6 +65,7 @@ class NotifyQt: public QObject, public NotifyBase void ownAvatarChanged() const ; void ownStatusMessageChanged() const ; void errorOccurred(int,int,const QString&) const ; + void diskFull(int,int) const ; public slots: diff --git a/retroshare-gui/src/gui/settings/TransferPage.cpp b/retroshare-gui/src/gui/settings/TransferPage.cpp index e07a60cfd..796bd2e8f 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.cpp +++ b/retroshare-gui/src/gui/settings/TransferPage.cpp @@ -45,8 +45,11 @@ TransferPage::TransferPage(QWidget * parent, Qt::WFlags flags) else ui._defaultStrategy_CB->setCurrentIndex(1) ; + ui._diskSpaceLimit_SB->setValue(rsFiles->freeDiskSpaceLimit()) ; + QObject::connect(ui._queueSize_SB,SIGNAL(valueChanged(int)),this,SLOT(updateQueueSize(int))) ; QObject::connect(ui._defaultStrategy_CB,SIGNAL(activated(int)),this,SLOT(updateDefaultStrategy(int))) ; + QObject::connect(ui._diskSpaceLimit_SB,SIGNAL(valueChanged(int)),this,SLOT(updateDiskSizeLimit(int))) ; /* Hide platform specific features */ #ifdef Q_WS_WIN @@ -68,6 +71,11 @@ void TransferPage::updateDefaultStrategy(int i) } } +void TransferPage::updateDiskSizeLimit(int s) +{ + rsFiles->setFreeDiskSpaceLimit(s) ; +} + void TransferPage::updateQueueSize(int s) { rsFiles->setQueueSize(s) ; diff --git a/retroshare-gui/src/gui/settings/TransferPage.h b/retroshare-gui/src/gui/settings/TransferPage.h index ce8cf1007..7540560bd 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.h +++ b/retroshare-gui/src/gui/settings/TransferPage.h @@ -43,6 +43,7 @@ class TransferPage: public ConfigPage public slots: void updateQueueSize(int) ; void updateDefaultStrategy(int) ; + void updateDiskSizeLimit(int) ; private: diff --git a/retroshare-gui/src/gui/settings/TransferPage.ui b/retroshare-gui/src/gui/settings/TransferPage.ui index 6cc79ba0b..10513b743 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.ui +++ b/retroshare-gui/src/gui/settings/TransferPage.ui @@ -19,11 +19,11 @@ Transfer options - + - + @@ -38,6 +38,13 @@ + + + + Safety disk space limit : + + + @@ -75,6 +82,28 @@ + + + + + + + MB + + + 10 + + + 1000 + + + 10 + + + 50 + + + @@ -92,7 +121,7 @@ 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; 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;">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> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -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> diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index aef079eb1..cabcd3f11 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -143,6 +143,7 @@ int main(int argc, char *argv[]) std::cerr << "connecting signals and slots" << std::endl ; QObject::connect(notify,SIGNAL(gotTurtleSearchResult(qulonglong,FileDetail)),w->searchDialog ,SLOT(updateFiles(qulonglong,FileDetail))) ; QObject::connect(notify,SIGNAL(hashingInfoChanged(const QString&)),w ,SLOT(updateHashingInfo(const QString&))) ; + QObject::connect(notify,SIGNAL(diskFull(int,int)) ,w ,SLOT(displayDiskSpaceWarning(int,int))) ; QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->sharedfilesDialog ,SLOT(preModDirectories(bool) )) ; QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->sharedfilesDialog ,SLOT(postModDirectories(bool) )) ; QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w ,SLOT(postModDirectories(bool) )) ;