#include <zypp/KeyRing.h>
#include <zypp/Digest.h>
+#include "AliveCursor.h"
#include "zmart-misc.h"
///////////////////////////////////////////////////////////////////
{
virtual bool askUserToAcceptUnsignedFile( const std::string &file )
{
- cout << "\x1B 2K\r" << file << " is unsigned, continue? [y/n]: ";
+ cout << CLEARLN << file << " is unsigned, continue? [y/n]: " << flush;
return readBoolAnswer();
}
if ( geteuid() != 0 )
return false;
- cout << "\x1B 2K\r" << "Import key " << key.id() << " in trusted keyring? [y/n]: ";
+ cout << CLEARLN << "Import key " << key.id() << " in trusted keyring? [y/n]: " << flush;
return readBoolAnswer();
}
virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &id )
{
- cout << "\x1B 2K\r" << file << " is signed with an unknown key id: " << id << ", continue? [y/n]: ";
+ cout << CLEARLN << file << " is signed with an unknown key id: " << id << ", continue? [y/n]: " << flush;
return readBoolAnswer();
}
virtual bool askUserToTrustKey( const PublicKey &key )
{
- cout << "\x1B 2K\r" << "Do you want to trust key id " << key.id() << " " << key.name() << " fingerprint:" << key.fingerprint() << " ? [y/n]: " ;
+ cout << CLEARLN << "Do you want to trust key id " << key.id() << " " << key.name() << " fingerprint:" << key.fingerprint() << " ? [y/n]: " << flush;
return readBoolAnswer();
}
virtual bool askUserToAcceptVerificationFailed( const std::string &file,const PublicKey &key )
void display_step( zypp::Resolvable::constPtr resolvable, int value )
{
- cout << "\x1B 2K\r" << _cursor << " Installing " << resolvable << " [" << value << " %] ";
+ cout << CLEARLN << _cursor << " Installing " << resolvable << " [" << value << " %] " << flush;
++_cursor;
}
void display_step( const std::string &what, int value )
{
- cout << "\x1B 2K\r" << _cursor << " " << what << " [" << value << " %] ";
+ cout << CLEARLN << _cursor << " " << what << " [" << value << " %] " << flush;
++_cursor;
}
virtual bool progressDeltaDownload( int value )
{
display_step( "Downloading delta " + _delta.asString(), value );
+ return true;
}
virtual void problemDeltaDownload( const std::string &description )
void display_step( int value )
{
- cout << "\x1B 2K\r" << _cursor << " " << _task << " [" << value << " %] ";
+ cout << CLEARLN << _cursor << " " << _task << " [" << value << " %] " << flush;
++_cursor;
}