QortalOS Brooklyn for Raspberry Pi 4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1012 B

/*
SPDX-FileCopyrightText: 2020 Alexander Lohnau <[email protected]>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "AbstractJob.h"
#include <KLocalizedString>
#include <KTerminalLauncherJob>
void AbstractJob::runScriptInTerminal(const QString &script, const QString &pwd)
{
auto job = new KTerminalLauncherJob(script);
job->setWorkingDirectory(pwd);
connect(job, &KJob::result, [this, job]() {
if (job->error()) {
Q_EMIT error(xi18nc("@info:status", "Failed to run install script in terminal <message>%1</message>", job->errorString()));
} else {
Q_EMIT finished();
}
});
job->start();
}
QString AbstractJob::terminalCloseMessage(bool install)
{
if (install) {
return i18nc("@info", "Installation executed successfully, you may now close this window");
} else {
return i18nc("@info", "Uninstallation executed successfully, you may now close this window");
}
}
#include "AbstractJob.moc"