[rkward-cvs] rkward/rkward Makefile.am,1.56,1.57 khelpdlg.cpp,1.8,1.9 rkward.cpp,1.90,1.91 rkward.h,1.39,1.40

Thomas Friedrichsmeier tfry at users.sourceforge.net
Wed Sep 14 16:32:27 UTC 2005


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

Modified Files:
	Makefile.am khelpdlg.cpp rkward.cpp rkward.h 
Log Message:
Implemented R_EditFile(s), R_ShowFiles, R_ChooseFile, R_Cleanup, R_Suicide.
Override for q () and quit () in R.
Make help (...)-calls open HTML-help in rkward-HTML-window (via DCOP).

Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** rkward.cpp	14 Sep 2005 12:06:01 -0000	1.90
--- rkward.cpp	14 Sep 2005 16:32:25 -0000	1.91
***************
*** 40,43 ****
--- 40,44 ----
  #include <kdockwidget.h>
  #include <kmultitabbar.h>
+ #include <dcopclient.h>
  
  // include files for the kate part. Some may not be useful
***************
*** 85,89 ****
  #include "agents/showedittextfileagent.h"	// TODO: see below: needed purely for linking!
  
! RKwardApp::RKwardApp (KURL *load_url, QWidget* , const char* name) : KMdiMainFrm (0, name, KMdi::IDEAlMode) {
  	ShowEditTextFileAgent::showEditFiles (0);		// TODO: AAAAAAAARGGGH!!!! It won't link without this bogus line!!!
  
--- 86,90 ----
  #include "agents/showedittextfileagent.h"	// TODO: see below: needed purely for linking!
  
! RKwardApp::RKwardApp (KURL *load_url) : KMdiMainFrm (0, 0, KMdi::IDEAlMode), DCOPObject ("rkwardapp") {
  	ShowEditTextFileAgent::showEditFiles (0);		// TODO: AAAAAAAARGGGH!!!! It won't link without this bogus line!!!
  
***************
*** 146,149 ****
--- 147,155 ----
  	// the builder updates (recreates) the GUI
  	connect( m_manager, SIGNAL( activePartChanged( KParts::Part * ) ), this, SLOT( createGUI( KParts::Part * ) ) );
+ 
+ 	if (!kapp->dcopClient ()->isRegistered ()) {
+ 		kapp->dcopClient ()->registerAs ("rkward");
+ 		kapp->dcopClient ()->setDefaultObject (objId ());
+ 	}
  }
  
***************
*** 492,516 ****
  	RK_TRACE (APP);
  	
! 	QValueList<KMdiChildView *> children;
! 	for(KMdiChildView *w = m_pDocumentViews->first();w;w= m_pDocumentViews->next()){
! 		children.append(w);
  	}
! 	QValueListIterator<KMdiChildView *> childIt;
! 	for (childIt = children.begin(); childIt != children.end(); ++childIt) {
! 		if ((*childIt)->inherits("RKCommandEditorWindow") ) {
! 			if (! (*childIt)->close()) {
! 				//If a child refuses to close, we return false.
! 				return false;
  			}
  		}
  	}
- 	
- 	
- 	if (RKGlobals::rObjectList ()->isEmpty ()) return true;
- 
- 	int res;
- 	res = KMessageBox::questionYesNoCancel (this, i18n ("Do you want to save the workspace?"), i18n ("Save Workspace?"));
- 	if (res == KMessageBox::No) return true;
- 	if (res == KMessageBox::Yes) new RKSaveAgent (RKGlobals::rObjectList ()->getWorkspaceURL (), false, RKSaveAgent::Quit);
  
  	return false;
--- 498,529 ----
  	RK_TRACE (APP);
  	
! 	bool quit = true;
! 
! 	if (!RKGlobals::rObjectList ()->isEmpty ()) {
! 		int res;
! 		res = KMessageBox::questionYesNoCancel (this, i18n ("Quitting RKWard: Do you want to save the workspace?\nPress Cancel, if you do not want to quit"), i18n ("Save Workspace?"));
! 		if (res == KMessageBox::Yes) {
! 			new RKSaveAgent (RKGlobals::rObjectList ()->getWorkspaceURL (), false, RKSaveAgent::Quit);
! 		} else if (res != KMessageBox::No) {
! 			quit = false;
! 		}
  	}
! 
! 	if (quit) {
! 		QValueList<KMdiChildView *> children;
! 		for(KMdiChildView *w = m_pDocumentViews->first();w;w= m_pDocumentViews->next()){
! 			children.append(w);
! 		}
! 		QValueListIterator<KMdiChildView *> childIt;
! 		for (childIt = children.begin(); childIt != children.end(); ++childIt) {
! 			if ((*childIt)->inherits("RKCommandEditorWindow") ) {
! 				if (! (*childIt)->close()) {
! 					//If a child refuses to close, we return false.
! 					return false;
! 				}
  			}
  		}
+ 		return true;
  	}
  
  	return false;
***************
*** 1080,1085 ****
  }
  
! void RKwardApp::openHTML(KURL url)
! {
  	RKHelpWindow *help = new RKHelpWindow(this,"help");
  	help->openURL (url);	
--- 1093,1097 ----
  }
  
! void RKwardApp::openHTML(KURL url) {
  	RKHelpWindow *help = new RKHelpWindow(this,"help");
  	help->openURL (url);	
***************
*** 1088,1092 ****
  }
  
! 
  
  void RKwardApp::slotFunctionReference()
--- 1100,1106 ----
  }
  
! void RKwardApp::openHTMLHelp (const QString & url) {
! 	openHTML (url);
! }
  
  void RKwardApp::slotFunctionReference()

Index: rkward.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** rkward.h	14 Sep 2005 12:06:01 -0000	1.39
--- rkward.h	14 Sep 2005 16:32:25 -0000	1.40
***************
*** 24,27 ****
--- 24,38 ----
  #endif
  
+ #include <dcopobject.h>
+ 
+ /** This base provides the DCOP-Interface for RKWardApp */
+ class RKWardDCOPInterface : virtual public DCOPObject {
+ 	K_DCOP
+ 	k_dcop:
+ 
+ 	virtual void openHTMLHelp (const QString &url) = 0;
+ };
+ 
+ 
  // include files for Qt
  
***************
*** 70,80 ****
  
  
! class RKwardApp : public KMdiMainFrm, virtual public KParts::PartBase
! {
! Q_OBJECT
  public:
  	/** construtor of RKwardApp, calls all init functions to create the application.
  	*/
! 	RKwardApp(KURL *load_url=0, QWidget* parent=0, const char* name=0);
  	~RKwardApp();
  
--- 81,90 ----
  
  
! class RKwardApp : public KMdiMainFrm, virtual public KParts::PartBase, virtual public RKWardDCOPInterface {
! 	Q_OBJECT
  public:
  	/** construtor of RKwardApp, calls all init functions to create the application.
  	*/
! 	RKwardApp(KURL *load_url=0);
  	~RKwardApp();
  
***************
*** 86,89 ****
--- 96,100 ----
  	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) */

Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/Makefile.am,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** Makefile.am	14 Sep 2005 12:06:01 -0000	1.56
--- Makefile.am	14 Sep 2005 16:32:25 -0000	1.57
***************
*** 6,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 rkconsole.cpp
  
  rkward_LDADD = $(top_builddir)/rkward/windows/libwindows.a \
--- 6,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 rkconsole.cpp rkward.skel
  
  rkward_LDADD = $(top_builddir)/rkward/windows/libwindows.a \

Index: khelpdlg.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/khelpdlg.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** khelpdlg.cpp	24 Apr 2005 16:16:09 -0000	1.8
--- khelpdlg.cpp	14 Sep 2005 16:32:25 -0000	1.9
***************
*** 158,161 ****
--- 158,162 ----
  	} 
  	else if (command->getFlags () == GET_HELP_URL) {
+ 		RK_ASSERT (command->stringVectorLength ());
  		url.setPath(command->getStringVector ()[0]);
  		if (QFile::exists( url.path() )) {





More information about the rkward-tracker mailing list