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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Aug 7 16:15:31 UTC 2009


Revision: 2606
          http://rkward.svn.sourceforge.net/rkward/?rev=2606&view=rev
Author:   tfry
Date:     2009-08-07 16:15:31 +0000 (Fri, 07 Aug 2009)

Log Message:
-----------
The old double-click has long been broken, so let's replace it with something useful, instead.

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/windows/robjectbrowser.cpp

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2009-08-07 16:05:59 UTC (rev 2605)
+++ trunk/rkward/ChangeLog	2009-08-07 16:15:31 UTC (rev 2606)
@@ -1,3 +1,4 @@
+- Double-clicking an item in the object browser now opens an object viewer, or (if possible) editor
 - Safeguard against removal of essential packages via the GUI
 - Add context menu action to unload packages in the object browser window
 - Add shortcut to the load / unload packages dialog also in the workspace menu

Modified: trunk/rkward/rkward/windows/robjectbrowser.cpp
===================================================================
--- trunk/rkward/rkward/windows/robjectbrowser.cpp	2009-08-07 16:05:59 UTC (rev 2605)
+++ trunk/rkward/rkward/windows/robjectbrowser.cpp	2009-08-07 16:15:31 UTC (rev 2606)
@@ -33,7 +33,6 @@
 
 #include "../rkward.h"
 #include "rkhelpsearchwindow.h"
-#include "rkcommandeditorwindow.h"
 #include "../rkglobals.h"
 #include "../core/robjectlist.h"
 #include "../core/renvironmentobject.h"
@@ -266,13 +265,11 @@
 	if (!object) return;
 	if (object == RObjectList::getObjectList ()) return;
 
-#warning this will never work, as the object browser is active in this case!
-	QWidget *w = RKWorkplace::mainWorkplace ()->activeWindow (RKMDIWindow::Attached);
-	if (!w) return;
-
-	RKCommandEditorWindow *cw = qobject_cast<RKCommandEditorWindow*> (w);
-	if (cw) {
-		cw->insertText (object->getFullName ());
+	if (object->canEdit () && RKWorkplace::mainWorkplace ()->canEditObject (object)) {
+		RKWorkplace::mainWorkplace ()->editObject (object);
+	} else {
+		RKWorkplace::mainWorkplace ()->flushAllData ();
+		RKWorkplace::mainWorkplace ()->newObjectViewer (object);
 	}
 }
 


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