{
virtual void start( const zypp::Url & file, zypp::Pathname localfile )
{
- if (gSettings.verbosity == VERBOSITY_MEDIUM || gData.show_media_progress_hack)
+ if (gSettings.verbosity < VERBOSITY_NORMAL)
+ return;
+ else if (gSettings.verbosity == VERBOSITY_MEDIUM || gData.show_media_progress_hack)
{
cout << CLEARLN << _("Downloading: ")
<< zypp::Pathname(file.getPathName()).basename()
virtual bool progress(int value, const zypp::Url & /*file*/)
{
+ if (gSettings.verbosity < VERBOSITY_NORMAL)
+ return true;
if (gData.show_media_progress_hack)
display_progress ("download", cout, "Downloading", value);
else
// not used anywhere in libzypp 3.20.0
virtual DownloadProgressReport::Action problem( const zypp::Url & /*file*/, DownloadProgressReport::Error error, const std::string & description )
{
- if (gData.show_media_progress_hack)
- display_done ("download", cout);
- else
- display_done ("download", cout_v);
+ if (gSettings.verbosity >= VERBOSITY_NORMAL)
+ {
+ if (gData.show_media_progress_hack)
+ display_done ("download", cout_n);
+ else
+ display_done ("download", cout_v);
+ }
display_error (error, description);
return DownloadProgressReport::ABORT;
}
// used only to finish, errors will be reported in media change callback (libzypp 3.20.0)
virtual void finish( const zypp::Url & /*file*/, Error error, const std::string & konreason )
{
- if (gData.show_media_progress_hack)
+ if (gSettings.verbosity < VERBOSITY_NORMAL)
+ return;
+ else if (gData.show_media_progress_hack)
display_done ("download", cout);
else
display_done ("download", cout_v);
// this is called too often. relax a bit.
static int last = -1;
if (last != value)
- display_progress ( "read-installed-packages", cout, _("Reading installed packages"), value);
+ display_progress ( "read-installed-packages", cout_n, _("Reading installed packages"), value);
last = value;
return true;
}
virtual void finish( Error error, const std::string & reason )
{
- display_done ("read-installed-packages", cout);
+ display_done ("read-installed-packages", cout_n);
display_error (error, reason);
}
};
virtual bool progress(int value, zypp::Resolvable::constPtr resolvable)
{
// TranslatorExplanation This text is a progress display label e.g. "Removing [42%]"
- display_progress ( "remove-resolvable", cout,
+ display_progress ( "remove-resolvable", cout_n,
_("Removing ") + resolvable->name() + string("-") + resolvable->edition().asString(), value);
return true;
}
// TranslatorExplanation This text is a progress display label e.g. "Installing foo-1.1.2 [42%]"
string s = boost::str(boost::format(_("Installing: %s-%s"))
% resolvable->name() % resolvable->edition());
- display_progress ( "install-resolvable", cout, s, value);
+ display_progress ( "install-resolvable", cout_n, s, value);
}
virtual void start( zypp::Resolvable::constPtr resolvable )
void tick( const zypp::ProgressData &data )
{
if ( data.reportAlive() )
- display_tick (zypp::str::numstring(data.numericId()), cout, data.name() );
+ display_tick (zypp::str::numstring(data.numericId()), cout_n, data.name() );
else
- display_progress ( zypp::str::numstring(data.numericId()), cout, data.name() , data.val() );
+ display_progress ( zypp::str::numstring(data.numericId()), cout_n, data.name() , data.val() );
}
virtual void start( const zypp::ProgressData &data )
virtual void finish( const zypp::ProgressData &data )
{
- display_done(zypp::str::numstring(data.numericId()), cout, data.name() );
+ display_done(zypp::str::numstring(data.numericId()), cout_n, data.name() );
}
};
void display_step(const zypp::ProgressData & pd)
{
- display_progress("repo", cout, "(" + _repo.name() + ") " + pd.name(), pd.val());
+ display_progress("repo", cout_n, "(" + _repo.name() + ") " + pd.name(), pd.val());
}
virtual bool progress(const zypp::ProgressData & pd)
virtual Action problem( zypp::Repository /*repo*/, Error error, const std::string & description )
{
- display_done ("repo", cout);
+ display_done ("repo", cout_n);
display_error (error, description);
return (Action) read_action_ari (ABORT);
}
display_step(100);
// many of these, avoid newline
if (boost::algorithm::starts_with (task, "Reading patch"))
- cout << '\r' << flush;
+ cout_n << '\r' << flush;
else
- display_done ("repo", cout);
+ display_done ("repo", cout_n);
display_error (error, reason);
}