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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Feb 5 00:23:38 UTC 2007


Revision: 1310
          http://svn.sourceforge.net/rkward/?rev=1310&view=rev
Author:   tfry
Date:     2007-02-04 16:23:37 -0800 (Sun, 04 Feb 2007)

Log Message:
-----------
Fix some problems with detached windows

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

Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp	2007-02-04 22:40:17 UTC (rev 1309)
+++ trunk/rkward/rkward/rkward.cpp	2007-02-05 00:23:37 UTC (rev 1310)
@@ -528,7 +528,7 @@
 
 	RKWorkplace::RKWorkplaceObjectList map = RKWorkplace::mainWorkplace ()->getObjectList ();
 	for (RKWorkplace::RKWorkplaceObjectList::const_iterator it = map.constBegin (); it != map.constEnd (); ++it){
-		if (!(*it)->close ()) {
+		if (!(*it)->close (true)) {
 			// If a child refuses to close, we return false.
 			slotSetStatusReady ();
 			return false;
@@ -589,7 +589,6 @@
 	RK_TRACE (APP);
 
 	RKWorkplace::mainWorkplace ()->openHelpWindow ("rkward://page/rkward_welcome", true);
-	topLevelWidget ()->raise ();
 }
 
 void RKWardMainWindow::slotNewDataFrame () {

Modified: trunk/rkward/rkward/windows/detachedwindowcontainer.cpp
===================================================================
--- trunk/rkward/rkward/windows/detachedwindowcontainer.cpp	2007-02-04 22:40:17 UTC (rev 1309)
+++ trunk/rkward/rkward/windows/detachedwindowcontainer.cpp	2007-02-05 00:23:37 UTC (rev 1310)
@@ -2,7 +2,7 @@
                           detachedwindowcontainer  -  description
                              -------------------
     begin                : Wed Oct 21 2005
-    copyright            : (C) 2005 by Thomas Friedrichsmeier
+    copyright            : (C) 2005, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -28,7 +28,7 @@
 #include "../rkglobals.h"
 #include "../debug.h"
 
-DetachedWindowContainer::DetachedWindowContainer (RKMDIWindow *widget_to_capture) : KParts::MainWindow  (RKWardMainWindow::getMain ()) {
+DetachedWindowContainer::DetachedWindowContainer (RKMDIWindow *widget_to_capture) : KParts::MainWindow  () {
 	RK_TRACE (APP);
 
 	setHelpMenuEnabled (false);
@@ -88,12 +88,11 @@
 	RK_TRACE (APP);
 
 	RKMDIWindow *window = static_cast<RKMDIWindow *> (centralWidget ());
-	if (window->close ()) {
+	if (window->close (true)) {
 		e->accept ();
 	} else {
 		e->ignore ();
 	}
 }
 
-
 #include "detachedwindowcontainer.moc"

Modified: trunk/rkward/rkward/windows/detachedwindowcontainer.h
===================================================================
--- trunk/rkward/rkward/windows/detachedwindowcontainer.h	2007-02-04 22:40:17 UTC (rev 1309)
+++ trunk/rkward/rkward/windows/detachedwindowcontainer.h	2007-02-05 00:23:37 UTC (rev 1310)
@@ -36,7 +36,6 @@
 	explicit DetachedWindowContainer (RKMDIWindow *widget_to_capture);
 /** destructor. Usually you don't call this explicitly, but rather delete/close the child view. The DetachedWindowContainer will then self destruct via viewDestroyed () */
 	~DetachedWindowContainer ();
-
 public slots:
 /** self-destruct, when child view is destroyed */
 	void viewDestroyed (QObject *view);

Modified: trunk/rkward/rkward/windows/rkworkplace.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkworkplace.cpp	2007-02-04 22:40:17 UTC (rev 1309)
+++ trunk/rkward/rkward/windows/rkworkplace.cpp	2007-02-05 00:23:37 UTC (rev 1310)
@@ -75,6 +75,7 @@
 
 void RKWorkplace::detachWindow (RKMDIWindow *window, bool was_attached) {
 	RK_TRACE (APP);
+	if (!window) return;
 	RK_ASSERT (windows.find (window) != windows.end ());		// Can't detach a window that is not registered
 
 	window->prepareToBeDetached ();
@@ -133,20 +134,23 @@
 void RKWorkplace::openHelpWindow (const KURL &url, bool only_once) {
 	RK_TRACE (APP);
 
-	RKHelpWindow *hw = new RKHelpWindow (view ());
-	if (!url.isEmpty ()) {
-		if (only_once) {
-			RKWorkplaceObjectList help_windows = getObjectList (RKMDIWindow::HelpWindow, RKMDIWindow::AnyState);
-			for (RKWorkplaceObjectList::const_iterator it = help_windows.constBegin (); it != help_windows.constEnd (); ++it) {
-				if (static_cast<RKHelpWindow *> (*it)->url ().equals (url, true)) {
-					(*it)->activate ();
-					return;
-				}
+	if (url.isEmpty ()) {
+		RK_ASSERT (false);
+		return;
+	}
+
+	if (only_once) {
+		RKWorkplaceObjectList help_windows = getObjectList (RKMDIWindow::HelpWindow, RKMDIWindow::AnyState);
+		for (RKWorkplaceObjectList::const_iterator it = help_windows.constBegin (); it != help_windows.constEnd (); ++it) {
+			if (static_cast<RKHelpWindow *> (*it)->url ().equals (url, true)) {
+				(*it)->activate ();
+				return;
 			}
 		}
-		hw->openURL (url);
 	}
 
+	RKHelpWindow *hw = new RKHelpWindow (view ());
+	hw->openURL (url);
 	addWindow (hw);
 }
 


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