[rkward-cvs] rkward/rkward rkeditormanager.cpp,1.7,1.8 rkeditormanager.h,1.6,1.7 rkoutputwindow.cpp,1.6,1.7 rkoutputwindow.h,1.5,1.6 rkward.cpp,1.94,1.95 rkward.h,1.43,1.44 rkwardui.rc,1.23,1.24

Thomas Friedrichsmeier tfry at users.sourceforge.net
Fri Sep 16 16:08:13 UTC 2005


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

Modified Files:
	rkeditormanager.cpp rkeditormanager.h rkoutputwindow.cpp 
	rkoutputwindow.h rkward.cpp rkward.h rkwardui.rc 
Log Message:
Added a Window-menu with Window->Close, etc. No everything working properly so far.

Index: rkoutputwindow.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkoutputwindow.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkoutputwindow.h	20 Apr 2005 12:14:56 -0000	1.5
--- rkoutputwindow.h	16 Sep 2005 16:08:11 -0000	1.6
***************
*** 18,21 ****
--- 18,22 ----
  #define RKOUTPUTWINDOW_H
  
+ #if 0
  #include "misc/rktogglewidget.h"
  
***************
*** 44,47 ****
  	KHTMLPart *khtmlpart;
  };
! 
  #endif
--- 45,48 ----
  	KHTMLPart *khtmlpart;
  };
! #endif
  #endif

Index: rkward.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** rkward.h	15 Sep 2005 21:03:27 -0000	1.43
--- rkward.h	16 Sep 2005 16:08:11 -0000	1.44
***************
*** 177,192 ****
  	void slotStatusReady ();
  
- 	/** shows/hides the RKWatch-window */
- 	void slotShowRKWatch ();
- 	
- 	/** shows/hides the RKWatch-window */
- 	void slotShowRKOutput ();
- 
- 	/** shows/hides the RObjectBrowser-window */
- 	void slotShowRObjectBrowser ();
- 	
- 	/** called when a togglable window was closed. Updates the corresponding actions */
- 	void slotToggleWindowClosed ();
- 	
  	/** configures RKward-settings */
  	void slotConfigure ();
--- 177,180 ----
***************
*** 204,207 ****
--- 192,202 ----
  	void slotViewActivated (KMdiChildView *window);
  	void slotOpenRecentCommandEditor(const KURL&);
+ 
+ /** close current window (Windows->Close) */
+ 	void slotCloseWindow ();
+ /** close current window (Windows->Close) */
+ 	void slotCloseAllWindows ();
+ /** detach current window (Windows->Detach) */
+ 	void slotDetachWindow ();
  private:
  	/** the configuration object of the application */
***************
*** 236,242 ****
  	KToggleAction* viewToolBar;
  	KToggleAction* viewStatusBar;
! 	KToggleAction* showRKWatch;
! 	KToggleAction* showRKOutput;
! 	KToggleAction* showRObjectBrowser;
  	
  	KAction* interruptCommand;
--- 231,238 ----
  	KToggleAction* viewToolBar;
  	KToggleAction* viewStatusBar;
! 
! 	KAction* window_close;
! 	KAction* window_close_all;
! 	KAction* window_detach;
  	
  	KAction* interruptCommand;

Index: rkeditormanager.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkeditormanager.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkeditormanager.h	14 Sep 2005 21:07:06 -0000	1.6
--- rkeditormanager.h	16 Sep 2005 16:08:11 -0000	1.7
***************
*** 54,64 ****
  
  /// returns the currently active editor
- //	RKEditor *currentEditor ();
  	void setEditorName (RKEditor *editor, const QString &new_name);
! 	
! //	int numEditors ();
! signals:
! 	void editorClosed ();
! 	void editorOpened ();
  protected:
  	void rCommandDone (RCommand *command);
--- 54,60 ----
  
  /// returns the currently active editor
  	void setEditorName (RKEditor *editor, const QString &new_name);
! public slots:
! 	void editorDestroyed (QObject* editor);
  protected:
  	void rCommandDone (RCommand *command);

Index: rkoutputwindow.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkoutputwindow.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkoutputwindow.cpp	27 Feb 2005 10:38:56 -0000	1.6
--- rkoutputwindow.cpp	16 Sep 2005 16:08:11 -0000	1.7
***************
*** 17,20 ****
--- 17,22 ----
  #include "rkoutputwindow.h"
  
+ #if 0
+ 
  #include <qlayout.h>
  #include <qpopupmenu.h>
***************
*** 89,91 ****
--- 91,95 ----
  }
  
+ 
  #include "rkoutputwindow.moc"
+ #endif

Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.94
retrieving revision 1.95
diff -C2 -d -r1.94 -r1.95
*** rkward.cpp	15 Sep 2005 21:03:27 -0000	1.94
--- rkward.cpp	16 Sep 2005 16:08:11 -0000	1.95
***************
*** 224,227 ****
--- 224,228 ----
  		} else if (result->result == StartupDialog::EmptyTable) {
  			RObject *object = RKGlobals::rObjectList ()->createNewChild (i18n ("my.data"), 0, true, true);
+ 			// usually an explicit call to activateView should not be necessary. Somehow however, here, it is.
  			RKGlobals::editorManager ()->editObject (object, true);
  		}
***************
*** 298,322 ****
  	fileSaveWorkspaceAs->setText (i18n ("Save Workspace As"));
  	//file_load_libs = new KAction (i18n ("Libraries"), 0, 0, this, SLOT (slotFileLoadLibs ()), actionCollection (), "file_load_libs");
! 	close_all_editors = new KAction (i18n ("Close All Editors"), 0, 0, this, SLOT(slotCloseAllEditors ()), actionCollection (), "close_all_editors");
! 	close_all_editors->setEnabled (false);
  	filePrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection(), "file_printx");
  	filePrint->setEnabled (false);
  	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());
  	viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());
- 	showRKWatch = new KToggleAction (i18n ("Console"), 0, 0, this, SLOT(slotShowRKWatch ()), actionCollection(), "windows_rkwatch");
- 	showRKOutput = new KToggleAction (i18n ("Output"), 0, 0, this, SLOT(slotShowRKOutput ()), actionCollection(), "windows_rkoutput");
- 	showRObjectBrowser = new KToggleAction (i18n ("Workspace"), 0, 0, this, SLOT(slotShowRObjectBrowser ()), actionCollection(), "windows_robjectbrowser");
  	
  	interruptCommand = new KAction (i18n ("Interrupt running command"), 0, 0, this, SLOT (slotInterruptCommand ()), actionCollection (), "interrupt");
  	interruptCommand->setIcon("player_stop");
  
  
! 
! 	file_load_libs = new KAction (i18n ("Configure Packages"), 0, 0, this, SLOT (slotFileLoadLibs ()), actionCollection (), "file_load_libs");	
! 	configure = new KAction (i18n ("Configure RKWard"), 0, 0, this, SLOT(slotConfigure ()), actionCollection(), "configure");
  	
  	new_data_frame->setStatusText (i18n ("Creates new empty dataset and opens it for editing"));
--- 299,322 ----
  	fileSaveWorkspaceAs->setText (i18n ("Save Workspace As"));
  	//file_load_libs = new KAction (i18n ("Libraries"), 0, 0, this, SLOT (slotFileLoadLibs ()), actionCollection (), "file_load_libs");
! 
  	filePrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection(), "file_printx");
  	filePrint->setEnabled (false);
  	fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection(), "file_quitx");
+ 	file_load_libs = new KAction (i18n ("Configure Packages"), 0, 0, this, SLOT (slotFileLoadLibs ()), actionCollection (), "file_load_libs");	
  
  
  	viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), actionCollection());
  	viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());
  	
  	interruptCommand = new KAction (i18n ("Interrupt running command"), 0, 0, this, SLOT (slotInterruptCommand ()), actionCollection (), "interrupt");
  	interruptCommand->setIcon("player_stop");
  
+ 	close_all_editors = new KAction (i18n ("Close All Data"), 0, 0, this, SLOT (slotCloseAllEditors ()), actionCollection (), "close_all_editors");
+ 	window_close = new KAction (i18n ("Close"), 0, KShortcut ("Crtl+W"), this, SLOT (slotCloseWindow ()), actionCollection (), "window_close");
+ 	window_close_all = new KAction (i18n ("Close All Windows"), 0, 0, this, SLOT (slotCloseAllWindows ()), actionCollection (), "window_close_all");
+ 	window_detach = new KAction (i18n ("Detach"), 0, 0, this, SLOT (slotDetachWindow ()), actionCollection (), "window_detach");
+ 	outputShow= new KAction (i18n ("Show &Output"), 0, 0, this, SLOT (slotOutputShow ()), actionCollection (), "output_show");
  
! 	configure = new KAction (i18n ("Configure RKWard"), 0, 0, this, SLOT (slotConfigure ()), actionCollection (), "configure");
  	
  	new_data_frame->setStatusText (i18n ("Creates new empty dataset and opens it for editing"));
***************
*** 586,595 ****
  }
  
- void RKwardApp::slotCloseAllEditors () {
- 	RK_TRACE (APP);
- 
- 	RKGlobals::editorManager ()->closeAll ();
- }
- 
  void RKwardApp::slotFilePrint()
  {
--- 586,589 ----
***************
*** 669,694 ****
  }
  
! void RKwardApp::slotShowRKWatch () {
  	RK_TRACE (APP);
! 	//RKGlobals::rInterface ()->watch->setShown (showRKWatch->isChecked ());
  }
  
! void RKwardApp::slotShowRKOutput () {
  	RK_TRACE (APP);
! 	//output->setShown (showRKOutput->isChecked ());
  }
  
! void RKwardApp::slotShowRObjectBrowser () {
  	RK_TRACE (APP);
! 	//object_browser->setShown (showRObjectBrowser->isChecked ());
  }
  
! void RKwardApp::slotToggleWindowClosed () {
  	RK_TRACE (APP);
! 	/*showRKWatch->setChecked (RKGlobals::rInterface ()->watch->isShown ());
! 	showRKOutput->setChecked (output->isShown ());
! 	showRObjectBrowser->setChecked (object_browser->isShown ());*/
  }
  
  void RKwardApp::newOutput () {
  	RK_TRACE (APP);
--- 663,708 ----
  }
  
! void RKwardApp::slotCloseWindow () {
  	RK_TRACE (APP);
! 
! 	if (!activeWindow ()) {
! 		qDebug ("no active window");
! 	}
! 
! 	closeActiveView ();
! 
! /*	KMdiChildView *w = activeWindow ();
! 
! 	if (w) {
! 		RK_TRACE (APP);
! 		removeWindowFromMdi (w);
! 		delete w;
! 	} */
  }
  
! void RKwardApp::slotCloseAllWindows () {
  	RK_TRACE (APP);
! 
! 	closeAllViews ();
! 	// editor windows somehow are not recognized by closeAllViews ()
! 	RKGlobals::editorManager()->closeAll ();
  }
  
! void RKwardApp::slotCloseAllEditors () {
  	RK_TRACE (APP);
! 
! 	RKGlobals::editorManager ()->closeAll ();
  }
  
! void RKwardApp::slotDetachWindow () {
  	RK_TRACE (APP);
! 
! 	if (activeWindow ()) {
! 		RK_TRACE (APP);
! 		detachWindow (activeWindow ());
! 	}
  }
  
+ 
  void RKwardApp::newOutput () {
  	RK_TRACE (APP);

Index: rkeditormanager.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkeditormanager.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rkeditormanager.cpp	14 Sep 2005 21:07:06 -0000	1.7
--- rkeditormanager.cpp	16 Sep 2005 16:08:11 -0000	1.8
***************
*** 68,72 ****
  		if (ed) {
  			setEditorName (ed, iobj->getShortName ());
- 			emit (editorOpened ());
  
  			RCommand *command = new RCommand (".rk.editor.opened (" + iobj->getFullName() + ")", RCommand::App | RCommand::Sync);
--- 68,71 ----
***************
*** 117,122 ****
  	RCommand *command = new RCommand (".rk.editor.closed (" + object->getFullName() + ")", RCommand::App | RCommand::Sync);
  	RKGlobals::rInterface ()->issueCommand (command, 0);
- 	
- 	emit (editorClosed ());
  }
  
--- 116,119 ----
***************
*** 132,140 ****
  	RK_TRACE (APP);
  
! 	for (QValueList<RKEditor*>::const_iterator it = editors.begin (); it != editors.end (); ++it) {
! 		closeEditor (*it);
! 	}
  
! 	editors.clear ();
  }
  
--- 129,139 ----
  	RK_TRACE (APP);
  
! 	QValueList<RKEditor*>::const_iterator it = editors.begin ();
  
! 	while (it != editors.end ()){
! 		RKEditor *ed = *it;
! 		++it;
! 		RKGlobals::rkApp ()->closeWindow (ed);		// will be removed from list of editors in editorDestroyed ()
! 	}
  }
  
***************
*** 163,166 ****
--- 162,166 ----
  	ed->setIcon (SmallIcon ("spreadsheet"));
  	editors.append (ed);
+ 	connect (ed, SIGNAL (destroyed (QObject*)), this, SLOT (editorDestroyed (QObject*)));
  	RKGlobals::rkApp ()->activateGUI (ed->getPart ());
  
***************
*** 168,170 ****
--- 168,178 ----
  }
  
+ void RKEditorManager::editorDestroyed (QObject* editor) {
+ 	RK_TRACE (APP);
+ 
+ 	QValueList<RKEditor*>::iterator it = editors.find (static_cast<RKEditor*> (editor));
+ 	if (it != editors.end ()) editors.erase (it);
+ 
+ }
+ 
  #include "rkeditormanager.moc"

Index: rkwardui.rc
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwardui.rc,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** rkwardui.rc	15 Sep 2005 21:03:27 -0000	1.23
--- rkwardui.rc	16 Sep 2005 16:08:11 -0000	1.24
***************
*** 36,44 ****
  	</Menu>
  
- 	<Menu name="output"><text>&Output</text>
- 		<Separator/>
- 		<Action name="output_show"/>
- 	</Menu>   
- 	
  	<Menu name="run"><text>&Run</text>
  		<Merge/>
--- 36,39 ----
***************
*** 47,55 ****
  	</Menu>   
   
  	<Menu name="settings"><text>&Settings</text>
  		<Action name="file_load_libs"/>
! 		<Action name="configure"></Action>
  	</Menu>
!  	<Merge/>
  </MenuBar>
  <ToolBar fullWidth="true" name="mainToolBar">
--- 42,61 ----
  	</Menu>   
   
+ 	<Menu name="windows"><text>&Windows</text>
+ 		<Action name="output_show"/>
+ 		<Separator/>
+ 		<Action name="window_close"/>
+ 		<Action name="window_close_all"/>
+ 		<Action name="close_all_editors"/>
+ 		<Separator/>
+ 		<Action name="window_detach"/>
+ 	</Menu>
+ 	
  	<Menu name="settings"><text>&Settings</text>
  		<Action name="file_load_libs"/>
! 		<Action name="configure"/>
  	</Menu>
! 
! 	<Merge/>
  </MenuBar>
  <ToolBar fullWidth="true" name="mainToolBar">





More information about the rkward-tracker mailing list