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

More input stuff

parent 2b61f4e6
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <kdebug.h> #include <kdebug.h>
#include <kio/global.h> #include <kio/global.h>
#include <qcoreapplication.h> #include <qcoreapplication.h>
#include <klocale.h>
#include <iostream>
RemoveOperation::RemoveOperation(QObject * parent) RemoveOperation::RemoveOperation(QObject * parent)
: QObject(parent) : QObject(parent)
...@@ -110,13 +112,14 @@ void RemoveOperation::validationFinished(bool valid) ...@@ -110,13 +112,14 @@ void RemoveOperation::validationFinished(bool valid)
out << "Size of packages about to be removed: " << KIO::convertSize(removeSize) << endl; out << "Size of packages about to be removed: " << KIO::convertSize(removeSize) << endl;
out.flush(); out.flush();
out << "Continue with installation?[y/n]"; out << "Continue with installation?[Y/n]";
out.flush(); out.flush();
//std::string input; std::string input;
//getline(std::cin, input); getline(std::cin, input);
//if (input != "y") if (!input.empty() && input != i18n("y").toStdString()) {
// return; QCoreApplication::instance()->quit();
kDebug() << "Let's remove"; return;
}
connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(progressChanged(int)), SLOT(showProgress(int))); connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(progressChanged(int)), SLOT(showProgress(int)));
connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(finished()), SLOT(finished())); connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(finished()), SLOT(finished()));
AkabeiClient::Backend::instance()->transactionHandler()->process(); AkabeiClient::Backend::instance()->transactionHandler()->process();
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <QDir> #include <QDir>
#include <akabeioperationrunner.h> #include <akabeioperationrunner.h>
#include <QCoreApplication> #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 :) //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) ...@@ -97,13 +98,14 @@ void UpgradeOperation::validationFinished(bool valid)
out << i18n("Installed size: %1", KIO::convertSize(installSize)) << endl; out << i18n("Installed size: %1", KIO::convertSize(installSize)) << endl;
out.flush(); out.flush();
out << i18n("Continue with installation?[y/n]"); out << i18n("Continue with installation?[Y/n]");
out.flush(); out.flush();
//std::string input; std::string input;
//getline(std::cin, input); getline(std::cin, input);
//if (input != "y") if (!input.empty() && input != i18n("y").toStdString()) {
// return; QCoreApplication::instance()->quit();
kDebug() << "Let's install"; return;
}
connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(progressChanged(int)), SLOT(showProgress(int))); connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(progressChanged(int)), SLOT(showProgress(int)));
connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(finished()), SLOT(finished())); connect(AkabeiClient::Backend::instance()->transactionHandler(), SIGNAL(finished()), SLOT(finished()));
AkabeiClient::Backend::instance()->transactionHandler()->process(); 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