/***************************************************************************
                          coptionsimpl.cpp  -  description
                             -------------------
    begin                : Sun Dec 3 2000
    copyright            : (C) 2000 by Olaf Lueg, Adam Kreuschner
    email                : olaf.lueg@t-online.de, kreuschner@dvoid.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "coptionsimpl.h"

// kde include
#include <klocale.h>
#include <kglobal.h>
#include <kiconloader.h>
#include <kstdaction.h>
#include <kaboutdialog.h>
#include <kfiledialog.h>
#include <kstddirs.h>
#include <kio/passdlg.h>
#include <kmessagebox.h>
#include <khelpmenu.h>
#include <kpopupmenu.h>
#include <ktoolbar.h>
#include <kaboutdata.h>

// qt include
#include <qiconview.h>
#include <qdir.h>
#include <qlineedit.h>
#include <qmultilineedit.h>
#include <qtoolbutton.h>
#include <qcheckbox.h>
#include <qpopupmenu.h>

// my include
#include "logviewimpl.h"
#include "fileviewimpl.h"

COptionsImpl::COptionsImpl(QWidget *parent, const char *name,bool modal, WFlags fl) : COptions(parent,name,modal,fl) {

  // app description
  static const char *description = I18N_NOOP("KRPMBuilder");
	aboutData = new KAboutData( "krpmbuilder", I18N_NOOP("KRPMBuilder"),
	VERSION, description, KAboutData::License_GPL,
	"(c) 2002, Olaf Lueg & Adam Kreuschner", 0, "http://home.t-online.de/home/olaf.lueg/krpmbuilder.html", "kreuschner@dvoid.org");
	aboutData->addAuthor("Olaf Lueg",0, "olaf.lueg@t-online.de");
	aboutData->addAuthor("Adam Kreuschner",0, "kreuschner@dvoid.org");

	KIconLoader load;
	setIcon(load.loadIcon("run.png",KIcon::User));
	setMinimumSize(610,410);
	// create the widgets, Base Widget is Frame14
	RPMView =  new RPMWidgetImpl(Frame14);
	RPMView->hide();
	RPMBuildView = new RPMBuildWidgetImpl(Frame14);
	RPMBuildView->hide();
	deleteContents();
	setpasswd = true;
	//Create the LogView and hide it;
	LogView = new LogViewImpl(Frame14);
  LogView->strArch->insertStringList(*(LogView->archList));
  LogView->StopButton->hide();
	LogView->hide();
	// create the fileview
	fileView = new FileViewImpl(Frame14);
	fileView->hide();
	
	//Create the Helpmenu
  men = new KHelpMenu(this,aboutData, false);
	menu = new KPopupMenu(this);
  menu->insertItem(men->menu());
	HelpButton->setPopup(menu);

	// connections
	connect(LogView,SIGNAL(runRPM()),this,SLOT(slotRunRPM()));
	connect(LogView,SIGNAL(stopRPM()),this,SLOT(slotStop()));
	connect(LogView,SIGNAL(createSpec()),this,SLOT(slotCreateSpec()));
	connect(fileView,SIGNAL(createSpec()),this,SLOT(slotCreateSpecialSpec()));
	connect(fileView,SIGNAL(executeRpm()),this,SLOT(slotRunRPM()));	

}

COptionsImpl::~COptionsImpl(){

}
/**Show the selected Widget */
/* Called from IconView  */
void COptionsImpl::new_slot(QIconViewItem* item){
	QString str = item->text();
	if(str == i18n("Project")){
		RPMView->hide();
		RPMBuildView->hide();
		fileView->hide();
		LogView->hide();	
	}
	if(str == i18n("General")){
		RPMView->show();
		RPMBuildView->hide();
		fileView->hide();
		LogView->hide();	
	}
	if(str == i18n("Advanced")){
		RPMView->hide();
		RPMBuildView->show();
		fileView->hide();
		LogView->hide();	
	}				
	if(str == i18n("Build Package")){
		RPMView->hide();
		RPMBuildView->hide();
		fileView->hide();
		LogView->show();
	}
	if(str == i18n("Build From Files")){
		RPMView->hide();
		RPMBuildView->hide();
		LogView->hide();
		fileView->show();
		fileView->resize(Frame14->width(),Frame14->height());
	}				
}
/**Show the About Dialog  */
void COptionsImpl::slotAbout(){
}
/**  */
void COptionsImpl::showAbout(){

}
/**  */
void COptionsImpl::deleteContents(){
// set some widget strings
	RPMBuildView->strBuildRoot->setText("%{_tmppath}/build-root-%{name}");
	strCopyright->setText("GPL");
	RPMView->strDescription->setText("");
	RPMView->strDistribution->setText("");
  RPMView->strGroup->insertStringList(*(RPMView->groupList));
	RPMBuildView->strConfigure->setText("--prefix=%{prefix}");
	RPMBuildView->strCFLAGS->setText("$RPM_OPT_FLAGS");
	RPMBuildView->strCXXFLAGS->setText("$RPM_OPT_FLAGS");
	strProjectName->setText("");
	strPackager->setText("");
	RPMBuildView->strPrefix->setText("/usr");
	RPMView->strProvides->setText("");
  RPMView->strRequires->setText("");
	strRelease->setText("");
	RPMBuildView->strSource->setText("%{name}-%{version}.tar.gz");
	RPMBuildView->strPatch->setText("");
	RPMView->strSummary->setText("");
	strUrl->setText("");
	RPMView->strVendor->setText("");
	strVersion->setText("");
	strSpec = "";
	setCaption("KRPMBuilder - "+i18n("Untitled"));
}
/**Executes the rpm command  */
void COptionsImpl::slotRunRPM(){
//	QString konsole = KStandardDirs::findExe("konsole");
	if(strSpecPath.isEmpty()){
	KURL url=KFileDialog::getOpenURL(strSpecPath,
        i18n("*.spec|Spec files"), this, i18n("Open Spec file..."));
  strSpecPath = url.path();
 }
//	if(proc != NULL) {delete proc;}

  // clear the log output
  LogView->strText->clear();
	proc = new KShellProcess();
	
/*
  QString strCommand;

	if(RPMBuildView->SuperUser->isChecked()){
	// run an Super-User
		strCommand = "rpm -ba ";
		(*proc) << "su";
		(*proc) << "-c";
		(*proc) << strCommand + strSpecPath ;
		debug(strCommand+strSpecPath);
	}
	else{
*/
		(*proc) << "rpm" << "-ba" << "--target" << LogView->strArch->currentText() << strSpecPath;
		setpasswd = false;
		
//	}
	LogView->ExecuteButton->setEnabled(false);
	LogView->ExecuteButton->hide();
	LogView->CreateButton->setEnabled(false);
	LogView->StopButton->setEnabled(true);
  LogView->StopButton->show();
	LogView->strArch->setEnabled(false);
	//connections
	connect(proc,SIGNAL(receivedStderr(KProcess *,char *,int)),this,SLOT(insertData(KProcess *,char *,int)));
	connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),this,SLOT(insertData(KProcess *,char *,int)));
	connect(proc,SIGNAL(processExited(KProcess*)),this,SLOT(slotExitProc(KProcess*)));
	//start the process
	proc->start(KProcess::NotifyOnExit,KProcess::All);
	
}

/**Create the spec file  */
void COptionsImpl::slotCreateSpec(){

  KURL url;
  QString filename;
  /////////////////////////////////////////////////
  // TODO: Add your document opening code here
  /////////////////////////////////////////////////

  url = KFileDialog::getOpenURL(strSpecPath, i18n("*.spec|Spec files"), this, i18n("Save Spec file..."));


  filename = url.path();
  filename = filename.stripWhiteSpace();

  if(filename.isEmpty()){
    return;
  }
  if(!filename.contains(".spec",false)){
    filename += ".spec";
  }
  strSpecPath = filename;

  debug(filename);
  QFile f(filename);
  f.remove(filename);
  f.flush();
  f.close();
  f.open(IO_ReadWrite);
  QString str;

  //check for all needed options and create spec file
  if(!strProjectName->text().stripWhiteSpace().isEmpty() &&
     !RPMView->strSummary->text().stripWhiteSpace().isEmpty() &&
     !strVersion->text().stripWhiteSpace().isEmpty() &&
     !strRelease->text().stripWhiteSpace().isEmpty() &&
     !RPMBuildView->strSource->text().stripWhiteSpace().isEmpty() &&
     !RPMView->strGroup->currentText().stripWhiteSpace().isEmpty() &&
     !RPMBuildView->strBuildRoot->text().stripWhiteSpace().isEmpty() &&
     !RPMView->strDescription->text().stripWhiteSpace().isEmpty() ) {

    str = "Name: " + strProjectName->text().stripWhiteSpace() +
          "\nSummary: " + RPMView->strSummary->text().stripWhiteSpace() +
          "\nVersion: " + strVersion->text().stripWhiteSpace() +
          "\nRelease: " + strRelease->text().stripWhiteSpace() +
          "\nLicense: " + strCopyright->text().stripWhiteSpace() +
          "\nGroup: " + RPMView->strGroup->currentText().stripWhiteSpace() +
          "\nSource: " + RPMBuildView->strSource->text().stripWhiteSpace();
    if(!RPMBuildView->strPatch->text().stripWhiteSpace().isEmpty()) {
      str += "\nPatch: " + RPMBuildView->strPatch->text().stripWhiteSpace();
    }
    str += "\nBuildRoot: " + RPMBuildView->strBuildRoot->text().stripWhiteSpace();
  }
  else{
  	KMessageBox::error(this,i18n("Some options are missing"),i18n("Error"));
  	return;
  }
  if(!RPMView->strProvides->text().stripWhiteSpace().isEmpty()){
  	str += "\nProvides: "+ RPMView->strProvides->text().stripWhiteSpace();
  }
  if(!RPMView->strRequires->text().stripWhiteSpace().isEmpty()){
  	str += "\nRequires: "+ RPMView->strRequires->text().stripWhiteSpace();
  }
  if(!strPackager->text().stripWhiteSpace().isEmpty()){
  	str += "\nPackager: " +strPackager->text().stripWhiteSpace();
  }
  if(!RPMView->strDistribution->text().stripWhiteSpace().isEmpty()){
  	str += "\nDistribution: "+RPMView->strDistribution->text().stripWhiteSpace();
  }
  if(!RPMBuildView->strPrefix->text().stripWhiteSpace().isEmpty()){
  	str += "\nPrefix: "+ RPMBuildView->strPrefix->text().stripWhiteSpace();
  }
  if(!strUrl->text().stripWhiteSpace().isEmpty()){
  	str += "\nUrl: " + strUrl->text().stripWhiteSpace();
  }
  if(!RPMView->strVendor->text().stripWhiteSpace().isEmpty()){
  	str += "\nVendor: " + RPMView->strVendor->text().stripWhiteSpace();
  }
  // empty line
  str += "\n";

/*  if(!strAuthor->text().stripWhiteSpace().isEmpty()){
  	str += "\nAuthor: " + strAuthor->text().stripWhiteSpace();
  	} */

  str += "\n%description\n" + RPMView->strDescription->text().stripWhiteSpace();
  // empty line
  str += "\n";
  str += "\n%prep\n";
  str += "rm -rf $RPM_BUILD_ROOT \nmkdir $RPM_BUILD_ROOT";
  // empty line
  str += "\n";
  str += "\n%setup -q\n";
  if(!RPMBuildView->strPatch->text().stripWhiteSpace().isEmpty()) {
     str += "\n%patch -p1 -b .userinstall\n";
  }
  // empty line
  str += "\n";
  str += "%build\n";
  str += "CFLAGS=\"" + RPMBuildView->strCFLAGS->text().stripWhiteSpace() + "\" ";
  str += "CXXFLAGS=\"" + RPMBuildView->strCXXFLAGS->text().stripWhiteSpace() + "\" \\\n";
  str += "./configure " + RPMBuildView->strConfigure->text().stripWhiteSpace() + "\nmake -j 2\n";
  // empty line
  str += "\n";
  str += "%install\n";
  str += "make DESTDIR=$RPM_BUILD_ROOT install-strip\n\n";
  str += "cd $RPM_BUILD_ROOT\n\n";
  str += "\nfind . -type d -fprint $RPM_BUILD_DIR/file.list.%{name}.dirs";
  str += "\nfind . -type f -fprint $RPM_BUILD_DIR/file.list.%{name}.files.tmp";
  str += "\nsed '/\\/man\\//s/$/.gz/g' $RPM_BUILD_DIR/file.list.%{name}.files.tmp > $RPM_BUILD_DIR/file.list.%{name}.files";
  str += "\nfind . -type l -fprint $RPM_BUILD_DIR/file.list.%{name}.libs";
  str += "\nsed '1,2d;s,^\\.,\\%attr(-\\,root\\,root) \\%dir ,' $RPM_BUILD_DIR/file.list.%{name}.dirs > $RPM_BUILD_DIR/file.list.%{name}";
  str += "\nsed 's,^\\.,\\%attr(-\\,root\\,root) ,' $RPM_BUILD_DIR/file.list.%{name}.files >> $RPM_BUILD_DIR/file.list.%{name}";
  str += "\nsed 's,^\\.,\\%attr(-\\,root\\,root) ,' $RPM_BUILD_DIR/file.list.%{name}.libs >> $RPM_BUILD_DIR/file.list.%{name}";
  // empty line
  str += "\n";
  str += "\n%clean\n";
  str += "rm -rf $RPM_BUILD_ROOT\n";
  str += "rm -rf $RPM_BUILD_DIR/file.list.%{name}\n";
  str += "rm -rf $RPM_BUILD_DIR/file.list.%{name}.libs\n";
  str += "rm -rf $RPM_BUILD_DIR/file.list.%{name}.files\n";
  str += "rm -rf $RPM_BUILD_DIR/file.list.%{name}.files.tmp\n";
  str += "rm -rf $RPM_BUILD_DIR/file.list.%{name}.dirs\n";
  // empty line
  str += "\n";
  str += "%files -f ../file.list.%{name}\n";
  str += "%defattr(-,root,root,0755)\n";
  // write the strings to file
  if(f.writeBlock(str,strlen(str)) == -1){
  	KMessageBox::error(this,i18n("Could not write to the file !\n\n")+filename);
		f.close();
		return;
  }
  f.flush();
  f.close();

}

/** Creates a spec file without a sourcefile, use the selected files */
void COptionsImpl::slotCreateSpecialSpec(){

  KURL url;
  QString filename;

  url = KFileDialog::getOpenURL(strSpecPath,
        i18n("*.spec|Spec files"), this, i18n("Save Spec file..."));


  filename = url.path();
  filename = filename.stripWhiteSpace();

  if(filename.isEmpty()){
    return;
  }
  if(!filename.contains(".spec",false)){
    filename += ".spec";
  }
  strSpecPath = filename;

  debug(filename);
  QFile f(filename);
  f.remove(filename);
  f.flush();
  f.close();
  f.open(IO_ReadWrite);
  QString str;

  //check for all needed options
  if(!strProjectName->text().stripWhiteSpace().isEmpty() &&
     !RPMView->strSummary->text().stripWhiteSpace().isEmpty() &&
     !strVersion->text().stripWhiteSpace().isEmpty() &&
     !strRelease->text().stripWhiteSpace().isEmpty() &&
     !RPMView->strGroup->currentText().stripWhiteSpace().isEmpty() &&
     !RPMView->strDescription->text().stripWhiteSpace().isEmpty() ) {

    str = "Name: "+strProjectName->text().stripWhiteSpace() +
          "\nSummary: "+RPMView->strSummary->text().stripWhiteSpace() +
          "\nVersion: " + strVersion->text().stripWhiteSpace() +
          "\nRelease: " + strRelease->text().stripWhiteSpace() +
          "\nLicense: " + strCopyright->text().stripWhiteSpace() +
          "\nGroup: " + RPMView->strGroup->currentText().stripWhiteSpace();
  }
  else{
  	KMessageBox::error(this,i18n("Some options are missing"),i18n("Error"));
  	return;
  }
  if(!strPackager->text().stripWhiteSpace().isEmpty()){
  	str += "\nPackager: " +strPackager->text().stripWhiteSpace();
  }
  if(!RPMView->strDistribution->text().stripWhiteSpace().isEmpty()){
  	str += "\nDistribution: "+RPMView->strDistribution->text().stripWhiteSpace();
  }
  if(!RPMBuildView->strPrefix->text().stripWhiteSpace().isEmpty()){
  	str += "\nPrefix: "+ RPMBuildView->strPrefix->text().stripWhiteSpace();
  }
  if(!RPMView->strProvides->text().stripWhiteSpace().isEmpty()){
  	str += "\nProvides: "+ RPMView->strProvides->text().stripWhiteSpace();
  }
  if(!RPMView->strRequires->text().stripWhiteSpace().isEmpty()){
  	str += "\nRequires: "+ RPMView->strRequires->text().stripWhiteSpace();
  }
  if(!strUrl->text().stripWhiteSpace().isEmpty()){
  	str += "\nUrl: " + strUrl->text().stripWhiteSpace();
  }
  if(!RPMView->strVendor->text().stripWhiteSpace().isEmpty()){
  	str += "\nVendor: " + RPMView->strVendor->text().stripWhiteSpace();
  }
  // empty line
  str += "\n";
  str += "\n%description\n" + RPMView->strDescription->text().stripWhiteSpace();
  // empty line
  str += "\n";
  str += "\n%files\n";
  QStringList list = fileView->getFiles();
  for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
       str += (*it).latin1();
       str +="\n";
  }
  if(f.writeBlock(str,strlen(str)) == -1){
  	KMessageBox::error(this,i18n("Could not write to the file !\n\n")+filename);
		f.close();
		return;
  }
  f.flush();
  f.close();
}


/**Open an existing file  */
void COptionsImpl::slotFileOpen(){
 	currentFile = KFileDialog::getOpenURL(strSpecPath,
      i18n("*.krpm|KRPMBuilder files"), this, i18n("Open KRPMBuilder project..."));
	KConfig *config = new KConfig(currentFile.path());
	QFileInfo fileInfo(currentFile.path());
	if(!fileInfo.isReadable()){
	  if(!currentFile.path().isEmpty()) {
      KMessageBox::error(0,i18n("You do not have read permission to this file "),i18n("Sorry"));
    }
  	return;
  }
  config->setDollarExpansion(false);
  deleteContents();
	config->setGroup("General");
//	strAuthor->setText(config->readEntry("Author",""));
	RPMBuildView->strBuildRoot->setText(config->readEntry("BuildRoot","/var/tmp/build-root"));
	strCopyright->setText(config->readEntry("Copyright","GPL"));
	RPMView->strDescription->setText(config->readEntry("Description","nice app"));
	RPMView->strDistribution->setText(config->readEntry("Distribution",""));
//	strEmail				= config->readEntry("E-Mail","");
	RPMView->strGroup->setEditText(config->readEntry("Group",""));
	
	// strMake changed since version 0.3  <- start
	RPMBuildView->strConfigure->setText(config->readEntry("Configure","--prefix=%{prefix}"));
	RPMBuildView->strCFLAGS->setText(config->readEntry("CFLAGS","$RPM_OPT_FLAGS"));
	RPMBuildView->strCXXFLAGS->setText(config->readEntry("CXXFLAGS","$RPM_OPT_FLAGS"));
	// -> end
		
//	RPMBuildView->strMake->setText(config->readEntry("Make","CFLAGS=\"$RPM_OPT_FLAGS\" CXXFLAGS=\"$RPM_OPT_FLAGS\" ./configure --prefix=%{prefix}"));
	strProjectName->setText(config->readEntry("Name",""));
	strPackager->setText(config->readEntry("Packager",""));
	RPMBuildView->strPrefix->setText(config->readEntry("Prefix",""));
	RPMView->strProvides->setText(config->readEntry("Provides",""));
	RPMView->strRequires->setText(config->readEntry("Requires",""));
	strRelease->setText(config->readEntry("Release",""));
	RPMBuildView->strSource->setText(config->readEntry("Source",""));
	RPMBuildView->strPatch->setText(config->readEntry("Patch",""));
	RPMView->strSummary->setText(config->readEntry("Summary",""));
	strUrl->setText(config->readEntry("Url",""));
	RPMView->strVendor->setText(config->readEntry("Vendor",""));
	strVersion->setText(config->readEntry("Version",""));
	strSpecPath					= config->readEntry("SPEC","");
	setCaption("KRPMBuilder - "+currentFile.path());
	// read file list
	QStringList list;
	list = config->readListEntry("Files");
	for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
       fileView->insertFile((*it).latin1());
    }
	list.clear();
	delete config;	

}
/**Save the current work  */
void COptionsImpl::slotFileSave(){

  QString filename;

  currentFile = KFileDialog::getOpenURL(currentFile.path(),i18n("*.krpm|KRPMBuilder files"),
                                        this, i18n("Save KRPMBuilder project..."));

  filename = currentFile.path();
  filename = filename.stripWhiteSpace();

  if(filename.isEmpty()){
//   KMessageBox::sorry(this,i18n("You must specify a file name"),i18n("Error"));
    return;
  }
  if(!filename.contains(".krpm",false)){
    filename += ".krpm";
  }
  currentFile = filename;

  KConfig *config = new KConfig(currentFile.path());
	QFileInfo fileInfo(currentFile.path());
	if(fileInfo.exists()){
		if(!fileInfo.isWritable()){
			KMessageBox::error(0,i18n("You do not have write permission to this file "),i18n("Sorry"));
  		return;
  	}
  }
  config->setDollarExpansion(false);
	config->setGroup("General");
//	config->writeEntry("Author",strAuthor->text());
	config->writeEntry("BuildRoot",RPMBuildView->strBuildRoot->text().stripWhiteSpace());
	config->writeEntry("Copyright",strCopyright->text().stripWhiteSpace());
	config->writeEntry("Description",RPMView->strDescription->text().stripWhiteSpace());
	config->writeEntry("Distribution",RPMView->strDistribution->text().stripWhiteSpace());
//	config->writeEntry("E-Mail",strEmail);
	config->writeEntry("Group",RPMView->strGroup->currentText().stripWhiteSpace());
	// new options in version 0.3
	config->writeEntry("Configure",RPMBuildView->strConfigure->text().stripWhiteSpace());
	config->writeEntry("CFLAGS",RPMBuildView->strCFLAGS->text().stripWhiteSpace());	
	config->writeEntry("CXXFLAGS",RPMBuildView->strCXXFLAGS->text().stripWhiteSpace());

	config->writeEntry("Name",strProjectName->text().stripWhiteSpace());	
	config->writeEntry("Packager",strPackager->text().stripWhiteSpace());
	config->writeEntry("Prefix",RPMBuildView->strPrefix->text().stripWhiteSpace());
	config->writeEntry("Provides",RPMView->strProvides->text().stripWhiteSpace());
	config->writeEntry("Requires",RPMView->strRequires->text().stripWhiteSpace());
	config->writeEntry("Release",strRelease->text().stripWhiteSpace());
	config->writeEntry("Source",RPMBuildView->strSource->text().stripWhiteSpace());
  config->writeEntry("Patch",RPMBuildView->strPatch->text().stripWhiteSpace());
	config->writeEntry("Summary",RPMView->strSummary->text().stripWhiteSpace());
	config->writeEntry("Url",strUrl->text().stripWhiteSpace());
	config->writeEntry("Vendor",RPMView->strVendor->text().stripWhiteSpace());
	config->writeEntry("Version",strVersion->text().stripWhiteSpace());
	config->writeEntry("SPEC",strSpecPath);
	// write the file list
	config->writeEntry("Files",fileView->getFiles());
	config->sync();
  modified=false;
  setCaption("KRPMBuilder - "+currentFile.path());
  delete config;
}
/**  */
void COptionsImpl::slotImport(){
}
/**Creates a new   */
void COptionsImpl::slotCreateNew(){
	deleteContents();
	
}
/**  */
void COptionsImpl::slotExitProc(KProcess*){
	LogView->ExecuteButton->setEnabled(true);
	LogView->ExecuteButton->show();
	LogView->CreateButton->setEnabled(true);
	LogView->StopButton->setEnabled(false);
  LogView->StopButton->hide();
	LogView->strArch->setEnabled(true);
	setpasswd = true;
}
/**Called from KProcess   */
void COptionsImpl::insertData(KProcess *p, char *buf, int len){
	QString strOutput = buf;
	strOutput = strOutput.left(len);
	
	// Not longer supported
/*	if(bi.contains(":") && setpasswd){
		KIO::PassDlg dlg(0,i18n("User Authentification"),true,0,i18n("Please enter root Password"),"root","");
		dlg.setEnableUserField(false);
		dlg.exec();
		proc->writeStdin(dlg.password(),dlg.password().length());
		p->closeStdin();
		setpasswd = false;
		} */
	LogView->insertData(strOutput);
}
/**Stop the current KProcess - doesn't work - FIXME  */
void COptionsImpl::slotStop(){
	proc->kill(SIGTERM);
}
/**Show the LogView  */
void COptionsImpl::slotLogView(){

}
