diff --git a/src/ConsoleStatCalc.cc b/src/ConsoleStatCalc.cc index d1093148..df5fe404 100644 --- a/src/ConsoleStatCalc.cc +++ b/src/ConsoleStatCalc.cc @@ -229,7 +229,8 @@ void printProgressSummary } // namespace ConsoleStatCalc::ConsoleStatCalc(time_t summaryInterval, bool humanReadable): - summaryInterval_(summaryInterval) + summaryInterval_(summaryInterval), + readoutVisibility_(true) { if(humanReadable) { sizeFormatter_.reset(new AbbrevSizeFormatter()); @@ -276,7 +277,11 @@ ConsoleStatCalc::calculateStat(const DownloadEngine* e) sizeFormatter); std::cout << "\n"; } - + } + if(!readoutVisibility_) { + return; + } + if(e->getRequestGroupMan()->countRequestGroup() > 0) { SharedHandle firstRequestGroup = e->getRequestGroupMan()->getRequestGroup(0); diff --git a/src/ConsoleStatCalc.h b/src/ConsoleStatCalc.h index d13f34fe..dd134e43 100644 --- a/src/ConsoleStatCalc.h +++ b/src/ConsoleStatCalc.h @@ -62,12 +62,18 @@ private: time_t summaryInterval_; SharedHandle sizeFormatter_; + bool readoutVisibility_; public: ConsoleStatCalc(time_t summaryInterval, bool humanReadable = true); virtual ~ConsoleStatCalc() {} virtual void calculateStat(const DownloadEngine* e); + + void setReadoutVisibility(bool visibility) + { + readoutVisibility_ = visibility; + } }; typedef SharedHandle ConsoleStatCalcHandle; diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index 59555e6e..b3030154 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -561,6 +561,14 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() op->hide(); handlers.push_back(op); } + { + SharedHandle op(new BooleanOptionHandler + (PREF_SHOW_CONSOLE_READOUT, + TEXT_SHOW_CONSOLE_READOUT, + A2_V_TRUE)); + op->addTag(TAG_ADVANCED); + handlers.push_back(op); + } { SharedHandle op(new NumberOptionHandler (PREF_STOP, diff --git a/src/main.cc b/src/main.cc index 6b9fefbc..81e5391a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -94,8 +94,11 @@ SharedHandle getStatCalc(const SharedHandle