From a10cc62099b4a0ca32209dc24a54990c3c8357b2 Mon Sep 17 00:00:00 2001 From: Ivan Loskutov Date: Tue, 5 Oct 2010 09:19:06 +0400 Subject: [PATCH] Fixed some bugs. --- src/calculateconfig.cpp | 10 ++++++++-- src/pageinstall.cpp | 16 ++++++++++++++-- src/pagemountpoints.cpp | 3 +++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/calculateconfig.cpp b/src/calculateconfig.cpp index c1e48aa..5066a29 100644 --- a/src/calculateconfig.cpp +++ b/src/calculateconfig.cpp @@ -100,8 +100,8 @@ bool CalculateConfig::getNewPartitioning() MapConfig confDisk; QProcess cl_install; - qDebug() << "Start cl-install -v --xml --filter (os_disk*|os_device*)"; - cl_install.start( "cl-install -v --xml --filter \"(os_disk*|os_device*)\" " ); + qDebug() << "Start cl-install -v --xml --filter (os_disk*|os_device*|os_install_disk*)"; + cl_install.start( "cl-install -v --xml --filter \"(os_disk*|os_device*|os_install_disk*)\" " ); if ( !cl_install.waitForStarted() ) return false; @@ -147,6 +147,12 @@ bool CalculateConfig::getNewPartitioning() m_Config.remove("os_disk_size"); m_Config["os_disk_size"] = confDisk["os_disk_size"]; + m_Config.remove("os_disk_mount"); + m_Config["os_disk_mount"] = confDisk["os_disk_mount"]; + + m_Config.remove("os_install_disk_perform_format"); + m_Config["os_install_disk_perform_format"] = confDisk["os_install_disk_perform_format"]; + return true; } diff --git a/src/pageinstall.cpp b/src/pageinstall.cpp index 0490995..9f47c66 100644 --- a/src/pageinstall.cpp +++ b/src/pageinstall.cpp @@ -9,6 +9,9 @@ #include +#include +#include + #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\\", ""); diff --git a/src/pagemountpoints.cpp b/src/pagemountpoints.cpp index 1179ffc..343b7bd 100644 --- a/src/pagemountpoints.cpp +++ b/src/pagemountpoints.cpp @@ -108,6 +108,8 @@ void PageMountPoints::retranslateUi() void PageMountPoints::show() { // get from CalculateConfig + getPartitions(); + showMountPoints(); m_tabMountPoints->setColumnWidth(0, 110); @@ -328,6 +330,7 @@ void PageMountPoints::getPartitions() CalculateConfig* clConf = CalculateConfig::instance(); + QStringList os_disk_dev = clConf->getValue("os_disk_dev").toStringList(); QStringList os_disk_format = clConf->getValue("os_disk_format").toStringList(); QStringList os_disk_name = clConf->getValue("os_disk_name").toStringList();