|
|
|
@ -9,6 +9,9 @@
|
|
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
|
|
#include "calculateconfig.h"
|
|
|
|
|
|
|
|
|
|
PageInstall::PageInstall() :
|
|
|
|
@ -22,7 +25,10 @@ PageInstall::~PageInstall()
|
|
|
|
|
{
|
|
|
|
|
if ( m_clProc )
|
|
|
|
|
{
|
|
|
|
|
m_clProc->kill();
|
|
|
|
|
qDebug() << "Terminate cl-install";
|
|
|
|
|
//m_clProc->terminate();
|
|
|
|
|
::kill( m_clProc->pid(), SIGINT);
|
|
|
|
|
m_clProc->waitForFinished(1000);
|
|
|
|
|
delete m_clProc;
|
|
|
|
|
m_clProc = 0;
|
|
|
|
|
}
|
|
|
|
@ -136,7 +142,7 @@ void PageInstall::onError(QProcess::ProcessError error)
|
|
|
|
|
{
|
|
|
|
|
m_Progress->setMinimum(0);
|
|
|
|
|
m_Progress->setMaximum(100);
|
|
|
|
|
qDebug() << "failed to run process 'calculate' error=" << error ;
|
|
|
|
|
qDebug() << "failed to run process 'cl-install' error=" << error ;
|
|
|
|
|
onFinish(-error);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -146,6 +152,12 @@ void PageInstall::showStdOut()
|
|
|
|
|
{
|
|
|
|
|
QString str = m_clProc->readAllStandardOutput();
|
|
|
|
|
|
|
|
|
|
QFile std_log("/var/log/calculate/cl-install-gui_stdlog.txt");
|
|
|
|
|
if ( std_log.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append) )
|
|
|
|
|
{
|
|
|
|
|
std_log.write( (str + "\n").toLocal8Bit() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// skip fan (/|\-)
|
|
|
|
|
str.replace("\x08/", "");
|
|
|
|
|
str.replace("\x08\\", "");
|
|
|
|
|