[rkward-cvs] rkward/rkward rkoutputwindow.h,1.4,1.5 rkward.cpp,1.78,1.79 rkward.h,1.32,1.33

Thomas Friedrichsmeier tfry at users.sourceforge.net
Wed Apr 20 12:14:58 UTC 2005


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

Modified Files:
	rkoutputwindow.h rkward.cpp rkward.h 
Log Message:
Don't crash when refreshing output for/from a plugin. Autoshow output according to user setting

Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** rkward.cpp	19 Apr 2005 06:48:06 -0000	1.78
--- rkward.cpp	20 Apr 2005 12:14:56 -0000	1.79
***************
*** 61,65 ****
  #include "misc/rkmenulist.h"
  #include "plugin/rkpluginhandle.h"
! #include "rkoutputwindow.h"
  #include "settings/rksettings.h"
  #include "settings/rksettingsmoduleplugins.h"
--- 61,65 ----
  #include "misc/rkmenulist.h"
  #include "plugin/rkpluginhandle.h"
! //#include "rkoutputwindow.h"
  #include "settings/rksettings.h"
  #include "settings/rksettingsmoduleplugins.h"
***************
*** 115,119 ****
  	setEnabledActions(true);
  
- 	
  	RKGlobals::manager = new RKEditorManager ();
  	KMdiChildView * editorManagerView = createWrapper(RKGlobals::editorManager (), i18n( "Data editor"), i18n( "Data editor"));
--- 115,118 ----
***************
*** 162,169 ****
  	object_browser = new RObjectBrowser ();
  	
- 	/*output = new RKOutputWindow (0);
- 	output->showMaximized ();
- 	output->hide ();*/
- 
  	QString dummy = i18n("Before you start bashing at it: please note that this is merely a technology preview release. You might actually be able to use it for some very simple tasks, but chances are it's of hardly any practical value so far. It does not do much good. It might do some very bad things (don't let it touch valuable data!). It's lacking in many respects. If you would like to help improve it, or simply get in contact, visit:\nhttp://rkward.sourceforge.net\nAll comments are welcome.");
  	KMessageBox::information (this, dummy, i18n("Before you complain..."), "state_of_rkward");
--- 161,164 ----
***************
*** 208,219 ****
  	addToolWindow(console,KDockWidget::DockBottom, getMainDockWidget(), 10);
  	
- 	/*
- 	Now obsolete:
- 
- 	output->setIcon(SmallIcon("text_block"));
- 	output->setName("output"); 
- 	addToolWindow(output,KDockWidget::DockBottom, getMainDockWidget(), 10);*/
- 	
- 	
  	helpDlg = new KHelpDlg(0);
  	helpDlg->setIcon(SmallIcon("help"));
--- 203,206 ----
***************
*** 225,231 ****
  	addToolWindow(konsole,KDockWidget::DockBottom, getMainDockWidget(), 10);
  
- 	
  	// just to initialize the window-actions according to whether they're shown on startup or not
! 	slotToggleWindowClosed ();
  }
  
--- 212,217 ----
  	addToolWindow(konsole,KDockWidget::DockBottom, getMainDockWidget(), 10);
  
  	// just to initialize the window-actions according to whether they're shown on startup or not
! 	//slotToggleWindowClosed ();
  }
  
***************
*** 368,374 ****
  
  
! 	outputShow= new KAction (i18n ("&Show"), 0, 0, this, SLOT (slotOutputShow ()), actionCollection (), "output_show");
  	outputFlush= new KAction (i18n ("&Flush"), 0, 0, this, SLOT (slotOutputFlush ()), actionCollection (), "output_flush");
- 	outputRefresh= new KAction (i18n ("&Refresh"), 0, 0, this, SLOT (slotOutputRefresh ()), actionCollection (), "output_refresh");
  
  
--- 354,359 ----
  
  
! 	outputShow= new KAction (i18n ("&Show / Refresh"), 0, 0, this, SLOT (slotOutputShow ()), actionCollection (), "output_show");
  	outputFlush= new KAction (i18n ("&Flush"), 0, 0, this, SLOT (slotOutputFlush ()), actionCollection (), "output_flush");
  
  
***************
*** 846,858 ****
  void RKwardApp::newOutput () {
  	RK_TRACE (APP);
! 	output->checkNewInput ();
! 	slotOutputRefresh() ;
! 	/*if (RKSettingsModuleOutput::autoShow ()) {
! 		output->show ();
! 		showRKOutput->setChecked (true);
! 		if (RKSettingsModuleOutput::autoRaise ()) {
! 			output->raise ();
! 		}
! 	}*/
  }
  
--- 831,835 ----
  void RKwardApp::newOutput () {
  	RK_TRACE (APP);
! 	refreshOutput (RKSettingsModuleOutput::autoShow ());
  }
  
***************
*** 1166,1183 ****
  	Show html output.
   */
! void RKwardApp::slotOutputShow()
! {
! 
! 	KMdiChildView* outp = outputView();
! 	if (outp){
! 		activateView(outp);
! 	}
! 	else {
! 		RKHelpWindow *out = new RKHelpWindow(this,"output",true);
! 		KURL url(RKSettingsModuleLogfiles::filesPath() + "/rk_out.html");
! 		out->openURL (url);	
! 		out->setIcon(SmallIcon("text_block"));
! 		addWindow( out );
! 	}
  }
  
--- 1143,1148 ----
  	Show html output.
   */
! void RKwardApp::slotOutputShow () {
! 	refreshOutput (true);
  }
  
***************
*** 1187,1222 ****
  	Empties output.
   */
! void RKwardApp::slotOutputFlush()
! {
  	int res = KMessageBox::questionYesNo (this, i18n ("Do you really want to flush the ouput? It won't be possible to restore it."), i18n ("Flush output?"));
  	if (res==KMessageBox::Yes) {
  		QFile out_file (RKSettingsModuleLogfiles::filesPath () + "/rk_out.html");
  		out_file.remove ();
! 		slotOutputRefresh();
  	}
  }
  
! 
! /*!
!     \fn RKwardApp::slotOutputRefresh()
! 	Refresh output.
!  */
! void RKwardApp::slotOutputRefresh()
! {
  	KMdiChildView* outp = outputView();
  	if (outp){
  		activateView(outp);
! 	}
! 	else {
! 		return;
! 	}
! 
! 	// Lets be cautious about what we get.
! 	if ( activeWindow()->inherits("RKHelpWindow"))
  		((RKHelpWindow*) activeWindow())->refresh();
! 
  }
  
- 
  /*!
      \fn RKwardApp::outputView()
--- 1152,1182 ----
  	Empties output.
   */
! void RKwardApp::slotOutputFlush () {
  	int res = KMessageBox::questionYesNo (this, i18n ("Do you really want to flush the ouput? It won't be possible to restore it."), i18n ("Flush output?"));
  	if (res==KMessageBox::Yes) {
  		QFile out_file (RKSettingsModuleLogfiles::filesPath () + "/rk_out.html");
  		out_file.remove ();
! 		refreshOutput (false);
  	}
  }
  
! void RKwardApp::refreshOutput (bool show) {
  	KMdiChildView* outp = outputView();
  	if (outp){
  		activateView(outp);
! 		// let's also refresh the output - can't do any harm
! 		if ( activeWindow()->inherits("RKHelpWindow"))
  		((RKHelpWindow*) activeWindow())->refresh();
! 	} else {
! 		if (show) {
! 			RKHelpWindow *out = new RKHelpWindow(this,"output",true);
! 			KURL url(RKSettingsModuleLogfiles::filesPath() + "/rk_out.html");
! 			out->openURL (url);	
! 			out->setIcon(SmallIcon("text_block"));
! 			addWindow( out );
! 		}
! 	}
  }
  
  /*!
      \fn RKwardApp::outputView()

Index: rkward.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** rkward.h	15 Apr 2005 21:38:08 -0000	1.32
--- rkward.h	20 Apr 2005 12:14:56 -0000	1.33
***************
*** 39,43 ****
  class RKMenu;
  class QTimer;
! class RKOutputWindow;
  class RObjectBrowser;
  class RKSettingsModule;
--- 39,43 ----
  class RKMenu;
  class QTimer;
! //class RKOutputWindow;
  class RObjectBrowser;
  class RKSettingsModule;
***************
*** 247,255 ****
      KAction* editPasteToTable;
  
! KAction* outputShow;
! KAction* outputFlush;
! KAction* outputRefresh;
! 
! 
  
      KToggleAction* viewToolBar;
--- 247,253 ----
      KAction* editPasteToTable;
  
! 	KAction* outputShow;
! 	KAction* outputFlush;
! 	KAction* outputRefresh;
  
      KToggleAction* viewToolBar;
***************
*** 282,286 ****
  	QTimer *startup_timer;
  	
- 	RKOutputWindow *output;
  	RObjectBrowser *object_browser;
  	KHelpDlg *helpDlg;
--- 280,283 ----
***************
*** 312,317 ****
  
  
! 
! 
  signals:
      void childWindowCloseRequest(KMdiChildView * window);
--- 309,315 ----
  
  
! /** refreshes the output.
! 	@param show if set to true, the output-window will be shown / raised. If set to false, the visibility will not be changed */
! 	void refreshOutput (bool show);
  signals:
      void childWindowCloseRequest(KMdiChildView * window);
***************
*** 319,323 ****
      void slotOutputShow();
      void slotOutputFlush();
-     void slotOutputRefresh();
  };
   
--- 317,320 ----

Index: rkoutputwindow.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkoutputwindow.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rkoutputwindow.h	27 Feb 2005 10:38:56 -0000	1.4
--- rkoutputwindow.h	20 Apr 2005 12:14:56 -0000	1.5
***************
*** 26,29 ****
--- 26,30 ----
  The Window where RK displays the (formatted) output
  
+ Note: This class is currently inactive! -> TODO
  @author Thomas Friedrichsmeier
  */





More information about the rkward-tracker mailing list