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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Sep 21 18:20:51 UTC 2006


Revision: 758
          http://svn.sourceforge.net/rkward/?rev=758&view=rev
Author:   tfry
Date:     2006-09-21 11:20:41 -0700 (Thu, 21 Sep 2006)

Log Message:
-----------
Adding API mockup for new RKWorkplace class

Modified Paths:
--------------
    trunk/rkward/rkward/misc/Makefile.am
    trunk/rkward/rkward/windows/detachedwindowcontainer.cpp
    trunk/rkward/rkward/windows/detachedwindowcontainer.h

Added Paths:
-----------
    trunk/rkward/rkward/misc/rkworkplace.cpp
    trunk/rkward/rkward/misc/rkworkplace.h

Modified: trunk/rkward/rkward/misc/Makefile.am
===================================================================
--- trunk/rkward/rkward/misc/Makefile.am	2006-09-21 18:19:57 UTC (rev 757)
+++ trunk/rkward/rkward/misc/Makefile.am	2006-09-21 18:20:41 UTC (rev 758)
@@ -3,8 +3,8 @@
 noinst_LIBRARIES =  libmisc.a
 libmisc_a_SOURCES = rkerrordialog.cpp rkspinbox.cpp \
 			getfilenamewidget.cpp rkobjectlistview.cpp rkcanceldialog.cpp xmlhelper.cpp \
-	multistringselector.cpp rkcommonfunctions.cpp rkprogresscontrol.cpp
+	multistringselector.cpp rkcommonfunctions.cpp rkprogresscontrol.cpp rkworkplace.cpp
 noinst_HEADERS = rkerrordialog.h rkspinbox.h getfilenamewidget.h \
 	rkobjectlistview.h rkcanceldialog.h xmlhelper.h multistringselector.h \
-	rkcommonfunctions.h rkprogresscontrol.h
+	rkcommonfunctions.h rkprogresscontrol.h rkworkplace.h
 

Added: trunk/rkward/rkward/misc/rkworkplace.cpp
===================================================================
--- trunk/rkward/rkward/misc/rkworkplace.cpp	                        (rev 0)
+++ trunk/rkward/rkward/misc/rkworkplace.cpp	2006-09-21 18:20:41 UTC (rev 758)
@@ -0,0 +1,21 @@
+/***************************************************************************
+                          rkworkplace  -  description
+                             -------------------
+    begin                : Thu Sep 21 2006
+    copyright            : (C) 2006 by Thomas Friedrichsmeier
+    email                : tfry at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "rkworkplace.h"
+
+
+#include "rkworkplace.moc"

Added: trunk/rkward/rkward/misc/rkworkplace.h
===================================================================
--- trunk/rkward/rkward/misc/rkworkplace.h	                        (rev 0)
+++ trunk/rkward/rkward/misc/rkworkplace.h	2006-09-21 18:20:41 UTC (rev 758)
@@ -0,0 +1,90 @@
+/***************************************************************************
+                          rkworkplace  -  description
+                             -------------------
+    begin                : Thu Sep 21 2006
+    copyright            : (C) 2006 by Thomas Friedrichsmeier
+    email                : tfry at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef RKWORKPLACE_H
+#define RKWORKPLACE_H
+
+#include <qvaluelist.h>
+#include <qstring.h>
+
+#include <kurl.h>
+
+#include "../rbackend/rcommandreceiver.h"
+
+class KMdiChildView;
+class RObject;
+class RCommandChain;
+
+/** This class (only one instance will probably be around) keeps track of which windows are opened in the
+workplace, which are detached, etc. Will replace RKEditorManager. TODO: maybe this class can also keep track of the active view more reliably than KMDI-framework does? */
+class RKWorkPlace : public QObject, public RCommandReceiver {
+	Q_OBJECT
+public:
+	RKWorkPlace (QObject *parent);
+	~RKWorkPlace ();
+
+	enum RKWorkPlaceObjectType {
+		EditorWindow=1,
+		CommandEditorWindow=2,
+		OutputWindow=3,
+		HelpWindo=4
+	};
+
+	struct RKWorkPlaceObject {
+		KMdiChildView *view;
+		RKWorkPlaceObjectType type;
+		QString location_or_name;
+		bool detached;
+	};
+
+	typedef QValueList<RKWorkPlaceObject *> RKWorkPlaceObjectList;
+
+	RKWorkPlaceObjectList getObjectList ();
+
+	void detachView (KMdiChildView *view);
+
+	void openScriptEditor (const KURL &url=KURL ());
+	void openHelpWindow (const KURL &url=KURL ());
+	void openOutputWindow (const KURL &url=KURL ());
+
+	bool canEditObject (RObject *object);
+	void editObject (RObject *object, bool initialize_to_empty=false);
+
+	void flushAllData ();
+	void closeAll ();
+	void closeAllData ();
+
+	void saveWorkplace (RCommandChain *chain=0);
+	void restoreWorkplace (RCommandChain *chain=0);
+signals:
+	void lastWindowClosed ();
+public slots:
+	// TODO: eventually, this class should do all the work, not just receive the signals
+	void viewDetached (KMdiChildView *view);
+	void viewAttached (KMdiChildView *view);
+
+	void viewDestroyed (KMdiChildView *view);
+
+	void updateViewCaption (KMdiChildView *view);
+protected:
+	void rCommandDone (RCommand *command);
+private:
+	RKWorkPlaceObjectList attached_windows;
+	RKWorkPlaceObjectList detached_windows;
+};
+
+#endif

Modified: trunk/rkward/rkward/windows/detachedwindowcontainer.cpp
===================================================================
--- trunk/rkward/rkward/windows/detachedwindowcontainer.cpp	2006-09-21 18:19:57 UTC (rev 757)
+++ trunk/rkward/rkward/windows/detachedwindowcontainer.cpp	2006-09-21 18:20:41 UTC (rev 758)
@@ -51,6 +51,8 @@
 	connect (widget_to_capture, SIGNAL (destroyed (QObject *)), this, SLOT (viewDestroyed (QObject *)));
 	connect (widget_to_capture, SIGNAL (windowCaptionChanged (const QString&)), this, SLOT (setCaption (const QString&)));
 	setCaption (widget_to_capture->caption ());	// has to come after createGUI!
+
+	emit (detached (widget_to_capture));
 }
 
 DetachedWindowContainer::~DetachedWindowContainer () {
@@ -75,6 +77,9 @@
 	RKGlobals::rkApp ()->m_manager->addPart (part);
 	view->show ();
 	view->setFocus ();
+
+	emit (reattached (view));
+
 	delete this;
 }
 

Modified: trunk/rkward/rkward/windows/detachedwindowcontainer.h
===================================================================
--- trunk/rkward/rkward/windows/detachedwindowcontainer.h	2006-09-21 18:19:57 UTC (rev 757)
+++ trunk/rkward/rkward/windows/detachedwindowcontainer.h	2006-09-21 18:20:41 UTC (rev 758)
@@ -41,6 +41,9 @@
 
 /** static list of all detached windows */
 	static QPtrList<KMdiChildView> *detachedWindows () { return &detached_windows; };
+signals:
+	void detached (KMdiChildView *widget);
+	void reattached (KMdiChildView *widget);
 public slots:
 /** self-destruct, when child view is destroyed */
 	void viewDestroyed (QObject *view);


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