[rkward-cvs] rkward/rkward/dialogs rkloadlibsdialog.cpp,1.15,1.16 rkloadlibsdialog.h,1.5,1.6

Thomas Friedrichsmeier tfry at users.sourceforge.net
Tue Oct 18 15:54:06 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/dialogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15220/rkward/dialogs

Modified Files:
	rkloadlibsdialog.cpp rkloadlibsdialog.h 
Log Message:
Better error handling in RKLoadLibsDialog::installDownloadedPackages

Index: rkloadlibsdialog.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/dialogs/rkloadlibsdialog.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** rkloadlibsdialog.cpp	14 Oct 2005 16:26:05 -0000	1.15
--- rkloadlibsdialog.cpp	18 Oct 2005 15:54:04 -0000	1.16
***************
*** 56,60 ****
  	layout->addWidget (new InstallPackagesWidget (this, page));
  
! 	error_dialog = new RKErrorDialog (i18n ("The R-backend has reported errors handling packages.\nA transcript of the errors are shown below."), i18n ("Error handling packages"), false);
  
  	setButtonText (KDialogBase::User1, i18n ("Configure Repositories"));
--- 56,61 ----
  	layout->addWidget (new InstallPackagesWidget (this, page));
  
! 	error_dialog = new RKErrorDialog (i18n ("The R-backend has reported errors handling packages.\nA transcript of the errors is shown below."), i18n ("Error handling packages"), false);
! 	installation_error_dialog = new RKErrorDialog (i18n ("There was an error or warning while installing the packages.\nPlease check the output below for more information."), i18n ("Error installing packages"), false);
  
  	setButtonText (KDialogBase::User1, i18n ("Configure Repositories"));
***************
*** 67,70 ****
--- 68,72 ----
  	RK_TRACE (DIALOGS);
  	delete error_dialog;
+ 	delete installation_error_dialog;
  }
  
***************
*** 160,167 ****
  
  	tempdir.setFilter (QDir::Files);
! 	
  	KProcess *proc = new KProcess;
  	if (become_root) {
! 		*proc << "kdesu";
  	};
  	*proc << "R" << "CMD" << "INSTALL";
--- 162,169 ----
  
  	tempdir.setFilter (QDir::Files);
! 
  	KProcess *proc = new KProcess;
  	if (become_root) {
! 		*proc << "kdesu" << "-t";
  	};
  	*proc << "R" << "CMD" << "INSTALL";
***************
*** 169,181 ****
  		*proc << tempdir.filePath (tempdir[i]).latin1 ();
  	}
! 		
! 	proc->start ();
  	connect (proc, SIGNAL (processExited (KProcess *)), this, SLOT (processExited (KProcess *)));
  	if (RKCancelDialog::showCancelDialog (i18n ("Installing packages..."), i18n ("Please, stand by while installing packages."), this, this, SIGNAL (installationComplete ())) == QDialog::Rejected) {
  		proc->kill ();
  	};
  	if ((!proc->normalExit ()) || (proc->exitStatus ())) {
! 		KMessageBox::error (this, i18n ("There was an error installing the packages. Please, check the output on stderr. Sorry, there is no better error-handling so far..."), i18n ("Error installing packages"));
  	}
  	delete proc;
  
--- 171,186 ----
  		*proc << tempdir.filePath (tempdir[i]).latin1 ();
  	}
! 
  	connect (proc, SIGNAL (processExited (KProcess *)), this, SLOT (processExited (KProcess *)));
+ 	connect (proc, SIGNAL (receivedStdout (KProcess *, char *, int)), this, SLOT (installationProcessOutput (KProcess *, char *, int)));
+ 	connect (proc, SIGNAL (receivedStderr (KProcess *, char *, int)), this, SLOT (installationProcessOutput (KProcess *, char *, int)));
+ 	proc->start (KProcess::NotifyOnExit, KProcess::AllOutput);
  	if (RKCancelDialog::showCancelDialog (i18n ("Installing packages..."), i18n ("Please, stand by while installing packages."), this, this, SIGNAL (installationComplete ())) == QDialog::Rejected) {
  		proc->kill ();
  	};
  	if ((!proc->normalExit ()) || (proc->exitStatus ())) {
! 		installation_error_dialog->newError (QString::null);		// to make sure it is shown
  	}
+ 	installation_error_dialog->resetOutput ();
  	delete proc;
  
***************
*** 212,215 ****
--- 217,225 ----
  }
  
+ void RKLoadLibsDialog::installationProcessOutput (KProcess *, char *buffer, int buflen) {
+ 	RK_TRACE (DIALOGS);
+ 	installation_error_dialog->newOutput (QCString (buffer, buflen));
+ }
+ 
  void RKLoadLibsDialog::processExited (KProcess *) {
  	RK_TRACE (DIALOGS);

Index: rkloadlibsdialog.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/dialogs/rkloadlibsdialog.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkloadlibsdialog.h	18 Sep 2005 15:17:52 -0000	1.5
--- rkloadlibsdialog.h	18 Oct 2005 15:54:04 -0000	1.6
***************
*** 68,71 ****
--- 68,72 ----
  	void childDeleted ();
  	void processExited (KProcess *);
+ 	void installationProcessOutput (KProcess *proc, char *buffer, int buflen);
  private:
  	void tryDestruct ();
***************
*** 75,78 ****
--- 76,80 ----
  friend class InstallPackagesWidget;
  	RKErrorDialog *error_dialog;
+ 	RKErrorDialog *installation_error_dialog;
  	RCommandChain *chain;
  	int num_child_widgets;





More information about the rkward-tracker mailing list