[rkward-cvs] rkward/rkward rkwatch.cpp,1.39,1.40 rkwatch.h,1.18,1.19

Thomas Friedrichsmeier tfry at users.sourceforge.net
Mon Oct 24 19:29:45 UTC 2005


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

Modified Files:
	rkwatch.cpp rkwatch.h 
Log Message:
Add setting for maximum number of lines in watch

Index: rkwatch.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwatch.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** rkwatch.cpp	16 Oct 2005 21:40:55 -0000	1.39
--- rkwatch.cpp	24 Oct 2005 19:29:42 -0000	1.40
***************
*** 79,84 ****
  	}
  
! 	watch->append ("---------------------------\n");
! 	watch->append (i18n ("Issuing command:\n"));
  	watch->setItalic (true);
  
--- 79,83 ----
  	}
  
! 	watch->append ("\n");
  	watch->setItalic (true);
  
***************
*** 92,96 ****
  		}
  	}
! 	RK_TRACE (APP);
  }
  
--- 91,96 ----
  		}
  	}
! 
! 	linesAdded ();
  }
  
***************
*** 125,131 ****
  		watch->setColor (Qt::blue);
  	}
! 	
! 	watch->append ("---------------------------\n");
! 	watch->append (i18n ("Got reply:"));
      watch->setBold (true);
  
--- 125,129 ----
  		watch->setColor (Qt::blue);
  	}
! 
      watch->setBold (true);
  
***************
*** 144,157 ****
  	watch->setBold (false);	
  	watch->setColor (Qt::black);
! 	
! 	
  	if (RKSettingsModuleWatch::shouldRaiseWindow (command)) {
! 		show ();
! 		raise ();
  	}
  }
  
  
  
  
  void RKwatch::configureWatch () {
--- 142,169 ----
  	watch->setBold (false);	
  	watch->setColor (Qt::black);
! 
! 	linesAdded ();
! 
  	if (RKSettingsModuleWatch::shouldRaiseWindow (command)) {
! 		if (!(command->type () & RCommand::Console)) {
! 			emit (raiseWatch ());
! 		}
  	}
  }
  
+ void RKwatch::linesAdded () {
+ 	RK_TRACE (APP);
  
+ // limit number of lines shown
+ 	if (RKSettingsModuleWatch::maxLogLines ()) {
+ 		uint c = (uint) watch->paragraphs ();
+ 		for (uint ui = c; ui > RKSettingsModuleWatch::maxLogLines (); --ui) {
+ 			watch->removeParagraph (0);
+ 		}
+ 	}
  
+ // scroll to bottom
+ 	watch->scrollToBottom ();
+ }
  
  void RKwatch::configureWatch () {
***************
*** 160,164 ****
  }
  
- 
  void RKwatch::clearWatch () {
  	RK_TRACE (APP);
--- 172,175 ----

Index: rkwatch.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwatch.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** rkwatch.h	16 Oct 2005 21:40:55 -0000	1.18
--- rkwatch.h	24 Oct 2005 19:29:42 -0000	1.19
***************
*** 53,56 ****
--- 53,58 ----
  private:
  	void addInputNoCheck (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 ();
  
  	QTextEdit *watch;





More information about the rkward-tracker mailing list