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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Feb 19 13:15:35 UTC 2007


Revision: 1414
          http://svn.sourceforge.net/rkward/?rev=1414&view=rev
Author:   tfry
Date:     2007-02-19 05:15:35 -0800 (Mon, 19 Feb 2007)

Log Message:
-----------
Start implementing window activation tracking (still far away from something useful)

Modified Paths:
--------------
    trunk/rkward/rkward/rkconsole.cpp
    trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp
    trunk/rkward/rkward/windows/rkcommandlog.cpp
    trunk/rkward/rkward/windows/rkhtmlwindow.cpp
    trunk/rkward/rkward/windows/rkmdiwindow.cpp
    trunk/rkward/rkward/windows/rkmdiwindow.h
    trunk/rkward/rkward/windows/rkwindowcatcher.cpp

Modified: trunk/rkward/rkward/rkconsole.cpp
===================================================================
--- trunk/rkward/rkward/rkconsole.cpp	2007-02-19 12:03:13 UTC (rev 1413)
+++ trunk/rkward/rkward/rkconsole.cpp	2007-02-19 13:15:35 UTC (rev 1414)
@@ -128,6 +128,7 @@
 	
 	setCaption (i18n ("R Console"));
 	part = new RKConsolePart (this);
+	initializeActivationSignals ();
 	initializeActions (part->actionCollection ());
 
 	nprefix = "> ";
@@ -326,7 +327,11 @@
 	tab_key_pressed_before = false;
 }
 
-bool RKConsole::eventFilter (QObject *, QEvent *e) {
+bool RKConsole::eventFilter (QObject *o, QEvent *e) {
+	if (o == getPart ()) {
+		return RKMDIWindow::eventFilter (o, e);
+	}
+
 	if (e->type () == QEvent::KeyPress) {
 		QKeyEvent *k = (QKeyEvent *)e;
 		return handleKeyPress (k);

Modified: trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp	2007-02-19 12:03:13 UTC (rev 1413)
+++ trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp	2007-02-19 13:15:35 UTC (rev 1414)
@@ -2,7 +2,7 @@
                           rkcommandeditorwindow  -  description
                              -------------------
     begin                : Mon Aug 30 2004
-    copyright            : (C) 2004, 2006 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2006, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -74,6 +74,7 @@
 	RKCommonFunctions::moveContainer (m_doc, "Menu", "tools", "edit", true);
 
 	m_doc->insertChildClient (new RKCommandEditorWindowPart (m_view, this));
+	initializeActivationSignals ();
 	setFocusProxy (m_view);
 
 	QHBoxLayout *pLayout = new QHBoxLayout( this, 0, -1, "layout");

Modified: trunk/rkward/rkward/windows/rkcommandlog.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkcommandlog.cpp	2007-02-19 12:03:13 UTC (rev 1413)
+++ trunk/rkward/rkward/windows/rkcommandlog.cpp	2007-02-19 13:15:35 UTC (rev 1414)
@@ -73,6 +73,7 @@
 	command_input_shown = 0;
 
 	part = new RKCommandLogPart (this);
+//	initializeActivationSignals ();
 }
 
 RKCommandLog::~RKCommandLog(){

Modified: trunk/rkward/rkward/windows/rkhtmlwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkhtmlwindow.cpp	2007-02-19 12:03:13 UTC (rev 1413)
+++ trunk/rkward/rkward/windows/rkhtmlwindow.cpp	2007-02-19 13:15:35 UTC (rev 1414)
@@ -47,6 +47,7 @@
 	scroll_position=-1;
 	
 	khtmlpart = new KHTMLPart (this, 0, 0, 0, KHTMLPart::BrowserViewGUI);
+	initializeActivationSignals ();
 	khtmlpart->setSelectable (true);
 	setFocusProxy (khtmlpart->widget ());
 	

Modified: trunk/rkward/rkward/windows/rkmdiwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkmdiwindow.cpp	2007-02-19 12:03:13 UTC (rev 1413)
+++ trunk/rkward/rkward/windows/rkmdiwindow.cpp	2007-02-19 13:15:35 UTC (rev 1414)
@@ -19,6 +19,8 @@
 
 #include <qapplication.h>
 
+#include <kparts/event.h>
+
 #include "rkworkplace.h"
 #include "rkworkplaceview.h"
 
@@ -106,4 +108,27 @@
 	RK_ASSERT (!isToolWindow ());
 }
 
+bool RKMDIWindow::eventFilter (QObject *watched, QEvent *e) {
+	RK_TRACE (APP);
+
+#warning TODO
+	RK_ASSERT (watched == getPart ());
+	if (KParts::PartActivateEvent::test (e)) {
+		KParts::PartActivateEvent *ev = static_cast<KParts::PartActivateEvent *> (e);
+		if (ev->activated ()) {
+			qDebug ("activated: %s", getDescription ().latin1 ());
+		} else {
+			qDebug ("deactivated: %s", getDescription ().latin1 ());
+		}
+	}
+	return FALSE;
+}
+
+void RKMDIWindow::initializeActivationSignals () {
+	RK_TRACE (APP);
+
+	RK_ASSERT (getPart ());
+	getPart ()->installEventFilter (this);
+}
+
 #include "rkmdiwindow.moc"

Modified: trunk/rkward/rkward/windows/rkmdiwindow.h
===================================================================
--- trunk/rkward/rkward/windows/rkmdiwindow.h	2007-02-19 12:03:13 UTC (rev 1413)
+++ trunk/rkward/rkward/windows/rkmdiwindow.h	2007-02-19 13:15:35 UTC (rev 1414)
@@ -86,11 +86,13 @@
 	virtual bool close (bool also_delete);
 /** For tool windows only (and perhaps for KDE3 only): set the wrapper widget that should be shown/raised on activation */
 	void setToolWrapper (KMdiToolViewAccessor *wrapper_widget) { wrapper = wrapper_widget; };
+	bool eventFilter (QObject *watched, QEvent *e);
 signals:
 /** This signal is emitted, whenever the window caption was changed.
 @param RKMDIWindow* a pointer to this window */
 	void captionChanged (RKMDIWindow *);
 protected:
+	void initializeActivationSignals ();
 friend class RKWorkplace;
 /** type of this window */
 	Type type;

Modified: trunk/rkward/rkward/windows/rkwindowcatcher.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkwindowcatcher.cpp	2007-02-19 12:03:13 UTC (rev 1413)
+++ trunk/rkward/rkward/windows/rkwindowcatcher.cpp	2007-02-19 13:15:35 UTC (rev 1414)
@@ -92,6 +92,7 @@
 
 	error_dialog = new RKRErrorDialog (i18n ("An error occurred"), i18n ("An error occurred"));
 	part = new RKCaughtX11WindowPart (this);
+	initializeActivationSignals ();
 	setFocusPolicy (QWidget::ClickFocus);
 
 	QVBoxLayout *layout = new QVBoxLayout (this);


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