#include <zypp/Digest.h>
#include <zypp/Url.h>
+#include "zypper-callbacks.h"
#include "AliveCursor.h"
using zypp::media::MediaChangeReport;
MediaChangeReport::Error error,
const std::string & description )
{
- cout << "Please insert media [" << description << "] # " << mediumNr << ". Retry [y/n]: " << endl;
- if (readBoolAnswer())
+ // TranslatorExplanation don't translate letters 'y' and 'n' for now
+ std::string request = boost::str(boost::format(
+ _("Please insert media [%s] # %d and type 'y' to continue or 'n' to cancel the operation."))
+ % description % mediumNr);
+ if (read_bool_answer(request, false))
return MediaChangeReport::RETRY;
else
return MediaChangeReport::ABORT;
extern RuntimeData gData;
extern Settings gSettings;
-// return the default value on input failure
-// TODO make this locale dependent?
-bool read_bool_with_default (bool defval) {
- istream & stm = cin;
-
- string c = "";
- while (stm.good () && c != "y" && c != "Y" && c != "N" && c != "n")
- c = zypp::str::getline (stm, zypp::str::TRIM);
-
- if (c == "y" || c == "Y")
- return true;
- else if (c == "n" || c == "N")
- return false;
- else
- return defval;
-}
-
-// Read an answer (ynYN)
-// Defaults to 'false'
-bool readBoolAnswer()
-{
- return read_bool_with_default (false);
-}
-
void cond_init_target () {
static bool done = false;
#include "zypp/PoolItem.h"
#include "zypper-tabulator.h"
-bool readBoolAnswer();
-
/**
* Initialize rpm database on target, if not already initialized.
*/