[rkward-cvs] rkward/rkward Makefile.am,1.50,1.51 rkward.cpp,1.59,1.60 rkwatch.cpp,1.32,1.33 rkwatch.h,1.12,1.13

Pierre ecoch at users.sourceforge.net
Sun Feb 27 16:21:46 UTC 2005


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

Modified Files:
	Makefile.am rkward.cpp rkwatch.cpp rkwatch.h 
Log Message:
New console.

Index: rkwatch.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwatch.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** rkwatch.cpp	24 Nov 2004 23:46:53 -0000	1.32
--- rkwatch.cpp	27 Feb 2005 16:21:44 -0000	1.33
***************
*** 25,28 ****
--- 25,29 ----
  #include "rkeditormanager.h"
  #include "windows/rkcommandeditorwindow.h"
+ #include "rkconsole.h"
  
  #include <qtextedit.h>
***************
*** 52,57 ****
  	watch->setReadOnly (true);
  	
! 	commands = new RKCommandEditor (layout_widget);
! 	bottom_hbox->addWidget (commands);
  	
  	// add run & reset buttons
--- 53,60 ----
  	watch->setReadOnly (true);
  	
! 	console = new RKConsole(layout_widget);
! 	bottom_hbox->addWidget (console);
! 	connect (console, SIGNAL (commandSubmitted (QString)), this, SLOT (submitConsoleCommand (QString)));
! 	
  	
  	// add run & reset buttons
***************
*** 59,68 ****
  	bottom_hbox->addLayout (button_hbox);
  	
- 	submit = new QPushButton(i18n ("&Run"), layout_widget);
- 	connect (submit, SIGNAL (clicked ()), this, SLOT (submitCommand ()));
- 	button_hbox->addWidget (submit);
- 	
- 
- 	
  	interrupt_command = new QPushButton (i18n ("&Interrupt"), layout_widget);
  	connect (interrupt_command, SIGNAL (clicked ()), this, SLOT (interruptCommand ()));
--- 62,65 ----
***************
*** 80,94 ****
  	menu->insertItem (i18n ("Watch"), watch_menu);
  
- 	QPopupMenu *commands_menu = new QPopupMenu (this);
- 	commands_menu->insertItem (i18n ("&Open new editor window"), this, SLOT (openEditor ()));
- 	commands_menu->insertSeparator ();
- 	commands_menu->insertItem (i18n ("Configure Editor"), this, SLOT (configureEditor ()));
- 	menu->insertItem (i18n ("Commands"), commands_menu);
- 	
- 	menu->insertSeparator ();
- 	
- 	QPopupMenu *help_menu = new QPopupMenu (this);
- 	help_menu->setItemEnabled (help_menu->insertItem (i18n ("Sorry, no help available so far"), 0, 0), false);
- 	menu->insertItem (i18n ("Help"), help_menu);
  	menu->setFixedHeight (menu->height ());
  	
--- 77,80 ----
***************
*** 148,151 ****
--- 134,138 ----
  		user_command = 0;
  		interrupt_command->setEnabled (false);
+ 		console->addOutput(command->output (), command->error ());
  	}
  	if (!RKSettingsModuleWatch::shouldShowOutput (command)) {
***************
*** 184,188 ****
  	watch->setBold (false);	
  	watch->setColor (Qt::black);
! 
  	if (RKSettingsModuleWatch::shouldRaiseWindow (command)) {
  		show ();
--- 171,176 ----
  	watch->setBold (false);	
  	watch->setColor (Qt::black);
! 	
! 	
  	if (RKSettingsModuleWatch::shouldRaiseWindow (command)) {
  		show ();
***************
*** 197,213 ****
  }
  
- void RKwatch::submitCommand () {
- 	RK_TRACE (APP);
- 	RKGlobals::editorManager ()->flushAll ();
- 	if (! commands->text ().isEmpty()){
- 		r_inter->issueCommand (user_command = new RCommand (commands->text (), RCommand::User));
- 		interrupt_command->setEnabled (true);
- 	}
- 	
- 	commands->setText ("");
- 	commands->setFocus ();
- }
- 
- 
  
  void RKwatch::configureWatch () {
--- 185,188 ----
***************
*** 216,231 ****
  }
  
- void RKwatch::configureEditor () {
- 	RK_TRACE (APP);
- 	commands->configure ();
- }
- 
- void RKwatch::openEditor () {
- 	RK_TRACE (APP);
- 	new RKCommandEditorWindow (0);
- }
  
  void RKwatch::clearWatch () {
  	RK_TRACE (APP);
  	watch->setText ("");
  
--- 191,200 ----
  }
  
  
  void RKwatch::clearWatch () {
  	RK_TRACE (APP);
+ 	
+ 	console->flush ();
+ 	
  	watch->setText ("");
  
***************
*** 235,236 ****
--- 204,215 ----
  	watch->setWordWrap (QTextEdit::NoWrap);
  }
+ 
+ void RKwatch::submitConsoleCommand (QString c)
+ {
+ 	RK_TRACE (APP);
+ 	if (! c.isEmpty()){
+ 		r_inter->issueCommand (user_command = new RCommand (c, RCommand::User));
+ 		interrupt_command->setEnabled (true);
+ 	}
+ }
+ 

Index: rkwatch.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwatch.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** rkwatch.h	25 Oct 2004 15:43:14 -0000	1.12
--- rkwatch.h	27 Feb 2005 16:21:44 -0000	1.13
***************
*** 29,32 ****
--- 29,33 ----
  class QTextEdit;
  class RKCommandEditor;
+ class RKConsole;
  
  /**
***************
*** 46,59 ****
  /** Clears commands-textedit */
  	void interruptCommand ();
- /** Submits commands in commands-textedit */
- 	void submitCommand ();
  /** configures the watch-window */
  	void configureWatch ();
- /** configures the editor-window */
- 	void configureEditor ();
- /** opens a new editor-window */
- 	void openEditor ();
  /** clears the watch-window */
  	void clearWatch ();
  private:
  	void addInputNoCheck (RCommand *command);
--- 47,57 ----
  /** Clears commands-textedit */
  	void interruptCommand ();
  /** configures the watch-window */
  	void configureWatch ();
  /** clears the watch-window */
  	void clearWatch ();
+ /** Submits command from the RKConsole */
+ 	void submitConsoleCommand (QString c);
+ 
  private:
  	void addInputNoCheck (RCommand *command);
***************
*** 61,64 ****
--- 59,63 ----
  	RInterface *r_inter;
  
+ 	RKConsole *console;
  	RKCommandEditor *commands;
  	QTextEdit *watch;

Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/Makefile.am,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** Makefile.am	25 Feb 2005 22:28:26 -0000	1.50
--- Makefile.am	27 Feb 2005 16:21:44 -0000	1.51
***************
*** 5,10 ****
  
  rkward_SOURCES = rkwatch.cpp rkward.cpp main.cpp rkoutputwindow.cpp \
! 	rkcommandeditor.cpp rkglobals.cpp robjectbrowser.cpp rkeditormanager.cpp robjectviewer.cpp \
! 	helpdlg.ui khelpdlg.cpp rkhelpdock.cpp
  rkward_LDADD = $(top_builddir)/rkward/windows/libwindows.a \
  	$(top_builddir)/rkward/agents/libagents.a $(top_builddir)/rkward/dialogs/libdialogs.a \
--- 5,10 ----
  
  rkward_SOURCES = rkwatch.cpp rkward.cpp main.cpp rkoutputwindow.cpp \
! 		rkcommandeditor.cpp rkglobals.cpp robjectbrowser.cpp rkeditormanager.cpp robjectviewer.cpp \
! 		helpdlg.ui khelpdlg.cpp rkhelpdock.cpp rkconsole.cpp
  rkward_LDADD = $(top_builddir)/rkward/windows/libwindows.a \
  	$(top_builddir)/rkward/agents/libagents.a $(top_builddir)/rkward/dialogs/libdialogs.a \
***************
*** 72,76 ****
  
  noinst_HEADERS = debug.h rkcommandeditor.h rkglobals.h robjectbrowser.h \
! 	rkeditormanager.h robjectviewer.h khelpdlg.h rkhelpdock.h
  phpfilesdir = $(kde_datadir)/rkward/phpfiles
  
--- 72,76 ----
  
  noinst_HEADERS = debug.h rkcommandeditor.h rkglobals.h robjectbrowser.h \
! 		rkeditormanager.h robjectviewer.h khelpdlg.h rkhelpdock.h rkconsole.h
  phpfilesdir = $(kde_datadir)/rkward/phpfiles
  

Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** rkward.cpp	27 Feb 2005 10:38:56 -0000	1.59
--- rkward.cpp	27 Feb 2005 16:21:44 -0000	1.60
***************
*** 853,857 ****
  	{
  		KMessageBox::messageBox(this,KMessageBox::Information,
! 				"You specified a file that is not on local system","Cannot open file");
  		return;
  	}
--- 853,857 ----
  	{
  		KMessageBox::messageBox(this,KMessageBox::Information,
! 				i18n ("You specified a file that is not on local system"), i18n ("Cannot open file"));
  		return;
  	}
***************
*** 861,870 ****
  	if (!editor->openURL(url))
  	{
! 		QString errstr = "Unable to open ";
  		
  		errstr += url.prettyURL();
  		
  		KMessageBox::messageBox(this,KMessageBox::Error,
! 				errstr,"Error!");
  		delete editor;
  		return;
--- 861,870 ----
  	if (!editor->openURL(url))
  	{
! 		QString errstr = i18n ("Unable to open ");
  		
  		errstr += url.prettyURL();
  		
  		KMessageBox::messageBox(this,KMessageBox::Error,
! 				errstr, i18n ("Error!"));
  		delete editor;
  		return;





More information about the rkward-tracker mailing list