[rkward-cvs] rkward/rkward rkwatch.cpp, 1.46, 1.47 rkwatch.h, 1.22, 1.23

Thomas Friedrichsmeier tfry at users.sourceforge.net
Wed Sep 13 10:28:52 UTC 2006


Update of /cvsroot/rkward/rkward/rkward
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18217/rkward

Modified Files:
	rkwatch.cpp rkwatch.h 
Log Message:
Do not raise watch more than once for a single command

Index: rkwatch.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwatch.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** rkwatch.cpp	10 Sep 2006 23:45:40 -0000	1.46
--- rkwatch.cpp	13 Sep 2006 10:28:48 -0000	1.47
***************
*** 53,56 ****
--- 53,57 ----
  	clearWatch ();
  
+ 	last_raised_command = 0;
  	command_input_shown = 0;
  }
***************
*** 87,97 ****
  	watch->append (command->command () + "\n");
  
! 	if (RKSettingsModuleWatch::shouldRaiseWindow (command)) {
! 		if (!(command->type () & RCommand::Console)) {
! 			emit (raiseWatch ());
! 		}
! 	}
! 
  	linesAdded ();
  	watch->setItalic (false);
  
--- 88,94 ----
  	watch->append (command->command () + "\n");
  
! 	checkRaiseWatch (command);
  	linesAdded ();
+ 
  	watch->setItalic (false);
  
***************
*** 114,128 ****
  	watch->insert (output);
  
! 	if (RKSettingsModuleWatch::shouldRaiseWindow (command)) {
! 		if (!(command->type () & RCommand::Console)) {
! 			emit (raiseWatch ());
! 		}
! 	}
! 
  	linesAdded ();
  	watch->setBold (false);
  	watch->setColor (Qt::black);
  }
  
  void RKwatch::newOutput (RCommand *command, ROutput *output_fragment) {
  	RK_TRACE (APP);
--- 111,131 ----
  	watch->insert (output);
  
! 	checkRaiseWatch (command);
  	linesAdded ();
+ 
  	watch->setBold (false);
  	watch->setColor (Qt::black);
  }
  
+ void RKwatch::checkRaiseWatch (RCommand *command) {
+ 	// called during output. do not trace
+ 	if (command == last_raised_command) return;
+ 	if (!RKSettingsModuleWatch::shouldRaiseWindow (command)) return;
+ 	if (command->type () & RCommand::Console) return;
+ 
+ 	last_raised_command = command;
+ 	emit (raiseWatch ());
+ }
+ 
  void RKwatch::newOutput (RCommand *command, ROutput *output_fragment) {
  	RK_TRACE (APP);
***************
*** 189,194 ****
  void RKwatch::clearWatch () {
  	RK_TRACE (APP);
! 	
! 	
  	watch->setText (QString::null);
  
--- 192,196 ----
  void RKwatch::clearWatch () {
  	RK_TRACE (APP);
! 
  	watch->setText (QString::null);
  

Index: rkwatch.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwatch.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** rkwatch.h	10 Sep 2006 23:45:40 -0000	1.22
--- rkwatch.h	13 Sep 2006 10:28:48 -0000	1.23
***************
*** 59,66 ****
--- 59,69 ----
  	void addInputNoCheck (RCommand *command);
  	void addOutputNoCheck (RCommand *command, const QString &output);
+ 	void checkRaiseWatch (RCommand *command);
  /** internal helper function, called whenever a line/lines have been added. Check whether log is longer than maximum setting. Scroll to the bottom */
  	void linesAdded ();
  /** A pointer to the last command the input (i.e. the command itself) was shown for. Used to keep track of whether a command's input should be shown or not */
  	RCommand *command_input_shown;
+ /** On a given command, the watch should not be raised more than once */
+ 	RCommand *last_raised_command;
  
  	QTextEdit *watch;





More information about the rkward-tracker mailing list