[rkward-cvs] rkward/rkward rkconsole.cpp,1.22,1.23 rkconsole.h,1.16,1.17 rkward.cpp,1.124,1.125

Thomas Friedrichsmeier tfry at users.sourceforge.net
Wed Apr 12 12:36:05 UTC 2006


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

Modified Files:
	rkconsole.cpp rkconsole.h rkward.cpp 
Log Message:
Avoid emptry line at the top in the Console. Make incomplete Console commands interruptable

Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -C2 -d -r1.124 -r1.125
*** rkward.cpp	10 Apr 2006 21:36:16 -0000	1.124
--- rkward.cpp	12 Apr 2006 12:36:03 -0000	1.125
***************
*** 308,311 ****
--- 308,312 ----
  	fileQuit->setStatusText(i18n("Quits the application"));
  	help_invoke_r_help->setStatusText (i18n ("Shows the R help index"));
+ 	show_help_search->setStatusText (i18n ("Shows/raises the R Help Search window"));
  
  	actionCollection ()->setHighlightingEnabled (true);

Index: rkconsole.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkconsole.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** rkconsole.cpp	12 Apr 2006 08:48:01 -0000	1.22
--- rkconsole.cpp	12 Apr 2006 12:36:03 -0000	1.23
***************
*** 57,62 ****
  #endif
  	layout->addWidget (view);
! 	doc->setText ("");
! 		
  	view->setDynWordWrap (false);
  
--- 57,61 ----
  #endif
  	layout->addWidget (view);
! 
  	view->setDynWordWrap (false);
  
***************
*** 144,150 ****
  
  	current_command = 0;
- 
- 
- 
  }
  
--- 143,146 ----
***************
*** 313,317 ****
  void RKConsole::cursorAtTheEnd () {
  	RK_TRACE (APP);
! 	view->	setCursorPosition (doc->numLines() -1, editInterface(doc)->textLine (doc->numLines() -1).length());
  	view->scrollDown ();
  }
--- 309,313 ----
  void RKConsole::cursorAtTheEnd () {
  	RK_TRACE (APP);
! 	view->setCursorPosition (doc->numLines() -1, editInterface(doc)->textLine (doc->numLines() -1).length());
  	view->scrollDown ();
  }
***************
*** 473,476 ****
--- 469,475 ----
  	doc->clear ();
  	tryNextInBatch ();
+ 	// need this HACK to remove empty line at start
+ 	selectionInterface (doc)->setSelection (0, 0, 1, 0);
+ 	selectionInterface (doc)->removeSelectedText ();
  }
  
***************
*** 508,517 ****
  }
  
! bool RKConsole::hasSelectedText(){
! 	return(selectionInterface(doc)->hasSelection());
  }
  
! void RKConsole::unplugAction(QString action, KActionCollection* ac)
! {
  	KAction* a = ac->action(action);
  	if( a ){
--- 507,516 ----
  }
  
! bool RKConsole::hasSelectedText() {
! 	RK_TRACE (APP);
! 	return (selectionInterface (doc)->hasSelection ());
  }
  
! void RKConsole::unplugAction(QString action, KActionCollection* ac) {
  	KAction* a = ac->action(action);
  	if( a ){
***************
*** 521,527 ****
--- 520,538 ----
  
  int RKConsole::currentCursorPositionInCommand(){
+ 	RK_TRACE (APP);
  	return(currentCursorPosition() - prefix.length());
  }
  
+ void RKConsole::resetIncompleteCommand () {
+ 	RK_TRACE (APP);
+ 
+ 	RK_ASSERT (command_incomplete);
+ 	prefix = nprefix;
+ 	command_incomplete = false;
+ 	incomplete_command = QString::null;
+ 
+ 	tryNextInBatch (true);
+ }
+ 
  
  ///################### END RKConsole ########################
***************
*** 565,578 ****
  	RK_TRACE (APP);
  
! 	interrupt_command->setEnabled (busy);
  }
  
  void RKConsolePart::slotInterruptCommand () {
  	RK_TRACE (APP);
! 	RK_ASSERT (console->current_command);
! 	qDebug("was here");
  
  	console->commands_batch.clear ();
! 	RKGlobals::rInterface ()->cancelCommand (console->current_command);
  	setDoingCommand (false);
  }
--- 576,593 ----
  	RK_TRACE (APP);
  
! 	interrupt_command->setEnabled (busy || console->command_incomplete);
  }
  
  void RKConsolePart::slotInterruptCommand () {
  	RK_TRACE (APP);
! 	RK_ASSERT (console->current_command || console->command_incomplete);
! 	RK_DO (qDebug("received interrupt signal in console"), APP, DL_DEBUG);
  
  	console->commands_batch.clear ();
! 	if (console->command_incomplete) {
! 		console->resetIncompleteCommand ();
! 	} else {
! 		RKGlobals::rInterface ()->cancelCommand (console->current_command);
! 	}
  	setDoingCommand (false);
  }

Index: rkconsole.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkconsole.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** rkconsole.h	12 Apr 2006 08:48:01 -0000	1.16
--- rkconsole.h	12 Apr 2006 12:36:03 -0000	1.17
***************
*** 60,63 ****
--- 60,65 ----
  /** Returns TRUE if some text is selected; otherwise returns FALSE.  */
  	bool hasSelectedText();
+ /** interrupt the current incomplete command (if any) */
+ 	void resetIncompleteCommand ();
  protected:
  /** Constructor. Protected. Construct an RKConsolePart instead */





More information about the rkward-tracker mailing list