[rkward-cvs] SF.net SVN: rkward: [885] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Oct 19 15:25:48 UTC 2006


Revision: 885
          http://svn.sourceforge.net/rkward/?rev=885&view=rev
Author:   tfry
Date:     2006-10-19 08:25:41 -0700 (Thu, 19 Oct 2006)

Log Message:
-----------
Properly raise editor if object is already being edited.

Modified Paths:
--------------
    trunk/rkward/TODO
    trunk/rkward/rkward/rkward.h
    trunk/rkward/rkward/windows/rkmdiwindow.h
    trunk/rkward/rkward/windows/rkworkplace.cpp

Modified: trunk/rkward/TODO
===================================================================
--- trunk/rkward/TODO	2006-10-19 15:10:32 UTC (rev 884)
+++ trunk/rkward/TODO	2006-10-19 15:25:41 UTC (rev 885)
@@ -102,8 +102,6 @@
 				rm (x); x <- function () {}
 				(object list remains the same, watch was not active, but symbol changed)
 				- will need to put an extra notification inside .rk.watch.globalenv ()? Will that get run?
-			- deal with data changes in edited objects
-			- object (list) updates should be run in a substack to ensure they are done in time
 	- RExpressionObject as an abstraction for R-Expressions (i.e. manually edited expressions).
 		- It will be possible to "store" these in the RObjectList and select them just like any other object
 		- RKVarslot will allow editing the selected value by hand (or just typing the name in)

Modified: trunk/rkward/rkward/rkward.h
===================================================================
--- trunk/rkward/rkward/rkward.h	2006-10-19 15:10:32 UTC (rev 884)
+++ trunk/rkward/rkward/rkward.h	2006-10-19 15:25:41 UTC (rev 885)
@@ -58,18 +58,7 @@
 class KMdiToolViewAccessor;
 
 /**
-* The base class for RKward application windows. It sets up the main
-* window and reads the config file as well as providing a menubar, toolbar
-* and statusbar. An instance of RKwardView creates your center view, which is connected
-* to the window's Doc object.
-* RKwardApp reimplements the methods that KMainWindow provides for main window handling and supports
-* full session management as well as using KActions.
-* @see KMainWindow
-* @see KApplication
-* @see KConfig
-*
-* @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
-* @version KDevelop version 1.2 code generation
+The main class of rkward. This is where all strings are tied togther, controlls the initialization, and there are some of the most important slots for user actions. All real work is done elsewhere.
 */
 
 

Modified: trunk/rkward/rkward/windows/rkmdiwindow.h
===================================================================
--- trunk/rkward/rkward/windows/rkmdiwindow.h	2006-10-19 15:10:32 UTC (rev 884)
+++ trunk/rkward/rkward/windows/rkmdiwindow.h	2006-10-19 15:25:41 UTC (rev 885)
@@ -61,6 +61,9 @@
 	virtual QString getRDescription () = 0;
 /** Reimplemented from QWidget::setCaption () to emit the signal captionChanged () when the caption is changed. */
 	void setCaption (const QString &caption);
+/** Is this window attached (or detached)?
+ at returns true if attached, false if detached */
+	bool isAttached () { return (state == Attached); };
 signals:
 /** This signal is emitted, whenever the window caption was changed.
 @param RKMDIWindow* a pointer to this window */

Modified: trunk/rkward/rkward/windows/rkworkplace.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkworkplace.cpp	2006-10-19 15:10:32 UTC (rev 884)
+++ trunk/rkward/rkward/windows/rkworkplace.cpp	2006-10-19 15:25:41 UTC (rev 885)
@@ -157,25 +157,22 @@
 	RObject *iobj = object;
 	RKEditor *ed = 0;
 	RKEditorDataFramePart *part = 0;
-	if (!object->objectOpened ()) {
+	RKEditor *existing_editor = object->objectOpened ();
+	if (!existing_editor) {
 		if (object->isDataFrame ()) {
 			part = new RKEditorDataFramePart (0);		// TODO: reverse creation logic, just as in the other classes!
 			ed = part->getEditor ();
 			// TODO: add child objects, too?
 			ed->openObject (object, initialize_to_empty);
 		} else if (object->isVariable () && object->getContainer ()->isDataFrame ()) {
-			if (!object->getContainer ()->objectOpened ()) { 
+			existing_editor = object->getContainer ()->objectOpened ();
+			if (!existing_editor) {
 				iobj = object->getContainer ();
 				part = new RKEditorDataFramePart (0);
 				ed = part->getEditor ();
 				// TODO: add child objects, too?
 				ed->openObject (iobj, initialize_to_empty);
 				// ed->focusObject (obj);
-			} else {
-				if (object->getContainer ()->objectOpened ()) {
-					object->getContainer ()->objectOpened ()->show ();
-					object->getContainer ()->objectOpened ()->raise ();
-				}
 			}
 		}
 
@@ -185,10 +182,16 @@
 			addWindow (ed);
 			ed->setFocus ();		// somehow we need to call this explicitely
 		}
-	} else {
-		object->objectOpened ()->show ();
-		object->objectOpened ()->raise ();
 	}
+
+	if (existing_editor) {		// not strictly an else. existing_editor may be reset inside the above if
+		if (existing_editor->isAttached ()) {
+			view ()->setActivePage (existing_editor);
+		} else {
+			object->getContainer ()->objectOpened ()->show ();
+			object->getContainer ()->objectOpened ()->raise ();
+		}
+	}
 	
 	return ed;
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list