Commit 64b49560 authored by Lukas Appelhans's avatar Lukas Appelhans

More input stuff

parent 2b61f4e6
......@@ -19,6 +19,8 @@
#include <kdebug.h>
#include <kio/global.h>
#include <qcoreapplication.h>
#include <klocale.h>
#include <iostream>
RemoveOperation::RemoveOperation(QObject * parent)
: QObject(parent)
......@@ -110,13 +112,14 @@ void RemoveOperation::validationFinished(bool valid)
out << "Size of packages about to be removed: " << KIO::convertSize(removeSize) << endl;
out.flush();
out << "Continue with installation?[y/n]";
out << "Continue with installation?[Y/n]";
out.flush();
//std::string input;
//getline(std::cin, input);
//if (input != "y")
// return;
kDebug() << "Let's remove";
std::string input;
getline(std::cin, input);
if (!input.empty() && input != i18n("y").toStdString()) {
QCoreApplication::instance()->quit();
return;
}
connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(progressChanged(int)), SLOT(showProgress(int)));
connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(finished()), SLOT(finished()));
AkabeiClient::Backend::instance()->transactionHandler()->process();
......
......@@ -21,6 +21,7 @@
#include <QDir>
#include <akabeioperationrunner.h>
#include <QCoreApplication>
#include <iostream>
//FIXME: There is actually a bunch of code duplication with SyncOperation and RemoveOperation... maybe we can create something that is used in all of them :)
......@@ -97,13 +98,14 @@ void UpgradeOperation::validationFinished(bool valid)
out << i18n("Installed size: %1", KIO::convertSize(installSize)) << endl;
out.flush();
out << i18n("Continue with installation?[y/n]");
out << i18n("Continue with installation?[Y/n]");
out.flush();
//std::string input;
//getline(std::cin, input);
//if (input != "y")
// return;
kDebug() << "Let's install";
std::string input;
getline(std::cin, input);
if (!input.empty() && input != i18n("y").toStdString()) {
QCoreApplication::instance()->quit();
return;
}
connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(progressChanged(int)), SLOT(showProgress(int)));
connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(finished()), SLOT(finished()));
AkabeiClient::Backend::instance()->transactionHandler()->process();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment