Stefan Schimanski wrote:
Am 02.06.2007 um 18:28 schrieb Richard Heck:
Regarding this bug: http://bugzilla.lyx.org/show_bug.cgi?id=3794.

It seems to me something needs to be done about this soon. The question is what. I'd propose doing two things: (i) The Close Window menu entry should be disabled if there is only one window open; (ii) Perhaps it should be renamed to something like Close View. This is going to be confusing for people, and already is.
Close Window is correct. Close View would be confusing. View sounds like "Close TAB" IMO, "View" is no known term in GUIs, but is very technical (i.e. Model<->View). But one maybe should change the "Close" into "Close file foo" (that's the way many Mac apps do it if you have multiview capabilities). And greying it out is also ok (although on Mac usually you can really close the last window without quitting the app).
The attached patch does the greying out. OK to commit?

This leaves the question whether having both "Close" and "Close Window" is confusing. Stefan is right in what he says here: Close View is bad. But could "Close" become "Close File"? and, if so, should "Save" become "Save File"? Or do we just expect people to figure this out fairly quickly?

Richard

--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Index: LyXFunc.cpp
===================================================================
--- LyXFunc.cpp	(revision 18641)
+++ LyXFunc.cpp	(working copy)
@@ -18,6 +18,7 @@
  */
 
 #include <config.h>
+#include <vector>
 
 #include "LyXFunc.h"
 
@@ -628,6 +629,12 @@
 		flag.setOnOff(current);
 		break;
 	}
+	
+	case LFUN_WINDOW_CLOSE: {
+		enable = (theApp()->gui().viewIds().size() > 1);
+		break;
+	}
+
 	// this one is difficult to get right. As a half-baked
 	// solution, we consider only the first action of the sequence
 	case LFUN_COMMAND_SEQUENCE: {
@@ -688,7 +695,6 @@
 	case LFUN_BUFFER_NEXT:
 	case LFUN_BUFFER_PREVIOUS:
 	case LFUN_WINDOW_NEW:
-	case LFUN_WINDOW_CLOSE:
 	case LFUN_LYX_QUIT:
 		// these are handled in our dispatch()
 		break;

Reply via email to