[rkward-cvs] rkward/rkward rkward.cpp,1.93,1.94 rkward.h,1.42,1.43 rkwardui.rc,1.22,1.23

Thomas Friedrichsmeier tfry at users.sourceforge.net
Thu Sep 15 21:03:29 UTC 2005


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

Modified Files:
	rkward.cpp rkward.h rkwardui.rc 
Log Message:
Added a KPart wrapper for RKHelpWindow. Next we can add some generic functionality such as Window->Close(All), Window->Detach, etc.

Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -d -r1.93 -r1.94
*** rkward.cpp	15 Sep 2005 11:50:03 -0000	1.93
--- rkward.cpp	15 Sep 2005 21:03:27 -0000	1.94
***************
*** 72,76 ****
  #include "agents/rkloadagent.h"
  #include "windows/rkcommandeditorwindow.h"
! #include "windows/rkhelpwindow.h"
  #include "khelpdlg.h"
  #include "rkconsole.h"
--- 72,76 ----
  #include "agents/rkloadagent.h"
  #include "windows/rkcommandeditorwindow.h"
! #include "windows/rkhtmlwindowpart.h"
  #include "khelpdlg.h"
  #include "rkconsole.h"
***************
*** 304,310 ****
  	fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection(), "file_quitx");
  
! 	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");
! 
  
  	viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), actionCollection());
--- 304,308 ----
  	fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection(), "file_quitx");
  
! 	outputShow= new KAction (i18n ("&Show"), 0, 0, this, SLOT (slotOutputShow ()), actionCollection (), "output_show");
  
  	viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), actionCollection());
***************
*** 322,327 ****
  	configure = new KAction (i18n ("Configure RKWard"), 0, 0, this, SLOT(slotConfigure ()), actionCollection(), "configure");
  	
- 	helpFunction = new KAction (i18n ("&Function reference"), KShortcut ("F2"), this, SLOT(slotFunctionReference ()), actionCollection(), "function_reference");
- 	
  	new_data_frame->setStatusText (i18n ("Creates new empty dataset and opens it for editing"));
  	fileOpenWorkspace->setStatusText(i18n("Opens an existing document"));
--- 320,323 ----
***************
*** 697,701 ****
  void RKwardApp::newOutput () {
  	RK_TRACE (APP);
! 	refreshOutput (RKSettingsModuleOutput::autoShow (), RKSettingsModuleOutput::autoRaise ());
  }
  
--- 693,697 ----
  void RKwardApp::newOutput () {
  	RK_TRACE (APP);
! 	RKHTMLWindowPart::refreshOutput (RKSettingsModuleOutput::autoShow (), RKSettingsModuleOutput::autoRaise ());
  }
  
***************
*** 838,846 ****
  }
  
! void RKwardApp::openHTML(KURL url) {
! 	RKHelpWindow *help = new RKHelpWindow(this,"help");
! 	help->openURL (url);	
! 	help->setIcon(SmallIcon("help"));
! 	addWindow( help );
  }
  
--- 834,839 ----
  }
  
! void RKwardApp::openHTML(const KURL &url) {
! 	RKHTMLWindowPart::openHTML (url, false);
  }
  
***************
*** 849,861 ****
  }
  
- void RKwardApp::slotFunctionReference()
- {
- 	if (! activeWindow()->inherits("RKCommandEditorWindow"))
- 		return;
- 	((RKCommandEditorWindow*) activeWindow())->showHelp();
- }
- 
- 
- 
  /*!
      \fn RKwardApp::slotOutputShow()
--- 842,845 ----
***************
*** 863,919 ****
   */
  void RKwardApp::slotOutputShow () {
! 	refreshOutput (true, true);
! }
! 
! 
! /*!
!     \fn RKwardApp::slotOutputFlush()
! 	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, false);
! 	}
! }
! 
! void RKwardApp::refreshOutput (bool show, bool raise) {
! 	KMdiChildView* outp = outputView();
! 	if (outp){
! 		if (raise) {
! 			activateView (outp);
! 		}
! 		// do we need this if?
! 		if (outp->inherits ("RKHelpWindow")) static_cast<RKHelpWindow*> (outp)->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()
! 	Returns a pointer to the output MDI child view.
!  */
! KMdiChildView* RKwardApp::outputView()
! {
! 	KMdiChildView* result = 0;
! 	KMdiIterator<KMdiChildView*>* it = createIterator();
! 	for ( it->first(); !it->isDone(); it->next() )
! 	{
! 		if ((QString)it->currentItem()->name() == "output" && it->currentItem() != 0){
! 			result = it->currentItem();
! 		}
! 	}
! 	deleteIterator(it);
! 
! 	return(result);
  }
  
--- 847,851 ----
   */
  void RKwardApp::slotOutputShow () {
! 	RKHTMLWindowPart::refreshOutput (true, true);
  }
  

Index: rkward.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** rkward.h	15 Sep 2005 11:50:03 -0000	1.42
--- rkward.h	15 Sep 2005 21:03:27 -0000	1.43
***************
*** 95,100 ****
  	void fileOpenNoSave (const KURL &url);
  	void fileOpenAskSave (const KURL &url);
- 	void openHTML(KURL url);
  	void openHTMLHelp (const QString &url);
  
  /** returns a pointer to the menu-list (in essence the menu-bar) */
--- 95,100 ----
  	void fileOpenNoSave (const KURL &url);
  	void fileOpenAskSave (const KURL &url);
  	void openHTMLHelp (const QString &url);
+ 	void openHTML (const KURL &url);
  
  /** returns a pointer to the menu-list (in essence the menu-bar) */
***************
*** 204,208 ****
  	void slotViewActivated (KMdiChildView *window);
  	void slotOpenRecentCommandEditor(const KURL&);
- 	void slotFunctionReference();
  private:
  	/** the configuration object of the application */
--- 204,207 ----
***************
*** 234,239 ****
  
  	KAction* outputShow;
- 	KAction* outputFlush;
- 	KAction* outputRefresh;
  
  	KToggleAction* viewToolBar;
--- 233,236 ----
***************
*** 246,251 ****
  	KAction* configure;
  	
- 	KAction* helpFunction;
- 
  	friend class RKSettingsModule;
  	friend class RKSettingsModulePlugins;
--- 243,246 ----
***************
*** 282,286 ****
  private slots:
  	void slotOutputShow();
- 	void slotOutputFlush();
  };
  
--- 277,280 ----

Index: rkwardui.rc
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwardui.rc,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** rkwardui.rc	15 Sep 2005 11:50:03 -0000	1.22
--- rkwardui.rc	15 Sep 2005 21:03:27 -0000	1.23
***************
*** 39,45 ****
  		<Separator/>
  		<Action name="output_show"/>
- 		<Action name="output_refresh"/>
- 		<Separator/>
- 		<Action name="output_flush"/>
  	</Menu>   
  	
--- 39,42 ----
***************
*** 54,60 ****
  		<Action name="configure"></Action>
  	</Menu>
- 	<Menu name="help"><text>&Help</text>
- 		<Action name="function_reference"></Action>
- 	</Menu>
   	<Merge/>
  </MenuBar>
--- 51,54 ----





More information about the rkward-tracker mailing list