[rkward-cvs] rkward/rkward/misc rkerrordialog.cpp,1.2,1.3 rkerrordialog.h,1.1,1.2

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


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

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

Index: rkerrordialog.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/misc/rkerrordialog.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** rkerrordialog.h	18 Aug 2004 12:14:24 -0000	1.1
--- rkerrordialog.h	18 Oct 2005 15:54:04 -0000	1.2
***************
*** 36,41 ****
  
      ~RKErrorDialog ();
! 	
  	void newError (const QString &error);
  public slots:
  // so we can easily keep track of whether the dialog is alive or not
--- 36,45 ----
  
      ~RKErrorDialog ();
! 
  	void newError (const QString &error);
+ /** usually you will call newError instead. However, if in case of an error, you also want to show the regular output, use this function to add output. The output is added to the internal error_log, but the dialog is not shown until you call newError (). */
+ 	void newOutput (const QString &output);
+ /** you don't need this, unless you feed regular output to the dialog using newOutput. */
+ 	void resetOutput ();
  public slots:
  // so we can easily keep track of whether the dialog is alive or not
***************
*** 52,55 ****
--- 56,60 ----
  	QString text;
  	QString caption;
+ 	QString stored_output;
  };
  

Index: rkerrordialog.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/misc/rkerrordialog.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rkerrordialog.cpp	6 Sep 2004 15:27:26 -0000	1.2
--- rkerrordialog.cpp	18 Oct 2005 15:54:04 -0000	1.3
***************
*** 39,42 ****
--- 39,54 ----
  }
  
+ void RKErrorDialog::newOutput (const QString &output) {
+ 	if (dialog) {
+ 		error_log->append (output);
+ 	} else {
+ 		stored_output.append (output);
+ 	}
+ }
+ 
+ void RKErrorDialog::resetOutput () {
+ 	stored_output = QString::null;
+ }
+ 
  void RKErrorDialog::dialogDestroyed () {
  	dialog = 0;
***************
*** 57,60 ****
--- 69,74 ----
  	error_log = new QTextEdit (dialog);
  	error_log->setReadOnly (true);
+ 	error_log->append (stored_output);
+ 	stored_output = QString::null;
  	vbox->addWidget (error_log);
  	





More information about the rkward-tracker mailing list