Re: [PATCH] bug 3301 : selecting buttons (e.g. a citation) with the mouse opens dialog

2007-05-23 Thread Jean-Marc Lasgouttes
> "José" == José Matos <[EMAIL PROTECTED]> writes:

José> On Tuesday 22 May 2007 1:53:49 pm Jean-Marc Lasgouttes wrote:
>> Jose', do you want it for 1.5.0? The bug has been there for ages,
>> so it can wait for a later 1.5.x if you prefer.

José>   If it is in 1.4.x then the answer is yes (for 1.5.0). :-)

I applied it.

JMarc


Re: [PATCH] bug 3301 : selecting buttons (e.g. a citation) with the mouse opens dialog

2007-05-22 Thread Abdelrazak Younes

Jean-Marc Lasgouttes wrote:

This is a bug I already fixed in 1.4 for collapsable insets, but which
is quite annoying. I think the patch is correct (it is quite
straightforward), but further testing would not hurt.

Jose', do you want it for 1.5.0? The bug has been there for ages, so
it can wait for a later 1.5.x if you prefer.


I rememenber some report about this bug recently. I thought this fix was 
in for ages. It should definitly go in as it is easy and well understood.


Abdel.



Re: [PATCH] bug 3301 : selecting buttons (e.g. a citation) with the mouse opens dialog

2007-05-22 Thread José Matos
On Tuesday 22 May 2007 1:53:49 pm Jean-Marc Lasgouttes wrote:
> Jose', do you want it for 1.5.0? The bug has been there for ages, so
> it can wait for a later 1.5.x if you prefer.

  If it is in 1.4.x then the answer is yes (for 1.5.0). :-)

> JMarc

-- 
José Abílio


[PATCH] bug 3301 : selecting buttons (e.g. a citation) with the mouse opens dialog

2007-05-22 Thread Jean-Marc Lasgouttes

This is a bug I already fixed in 1.4 for collapsable insets, but which
is quite annoying. I think the patch is correct (it is quite
straightforward), but further testing would not hurt.

Jose', do you want it for 1.5.0? The bug has been there for ages, so
it can wait for a later 1.5.x if you prefer.

JMarc

Index: src/insets/InsetExternal.cpp
===
--- src/insets/InsetExternal.cpp	(révision 18366)
+++ src/insets/InsetExternal.cpp	(copie de travail)
@@ -450,7 +450,8 @@ void InsetExternal::doDispatch(Cursor & 
 		break;
 
 	case LFUN_MOUSE_RELEASE:
-		InsetExternalMailer(*this).showDialog(&cur.bv());
+		if (!cur.selection())
+			InsetExternalMailer(*this).showDialog(&cur.bv());
 		break;
 
 	default:
Index: src/insets/InsetGraphics.cpp
===
--- src/insets/InsetGraphics.cpp	(révision 18366)
+++ src/insets/InsetGraphics.cpp	(copie de travail)
@@ -201,7 +201,8 @@ void InsetGraphics::doDispatch(Cursor & 
 		break;
 
 	case LFUN_MOUSE_RELEASE:
-		InsetGraphicsMailer(*this).showDialog(&cur.bv());
+		if (!cur.selection())
+			InsetGraphicsMailer(*this).showDialog(&cur.bv());
 		break;
 
 	default:
Index: src/insets/InsetInclude.cpp
===
--- src/insets/InsetInclude.cpp	(révision 18366)
+++ src/insets/InsetInclude.cpp	(copie de travail)
@@ -141,7 +141,8 @@ void InsetInclude::doDispatch(Cursor & c
 		break;
 
 	case LFUN_MOUSE_RELEASE:
-		InsetIncludeMailer(*this).showDialog(&cur.bv());
+		if (!cur.selection()) 
+			InsetIncludeMailer(*this).showDialog(&cur.bv());
 		break;
 
 	default:
Index: src/insets/InsetRef.cpp
===
--- src/insets/InsetRef.cpp	(révision 18366)
+++ src/insets/InsetRef.cpp	(copie de travail)
@@ -45,21 +45,17 @@ InsetRef::InsetRef(InsetRef const & ir)
 void InsetRef::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
 	switch (cmd.action) {
-	case LFUN_MOUSE_PRESS:
+	case LFUN_MOUSE_RELEASE:
 		// Eventually trigger dialog with button 3 not 1
 		if (cmd.button() == mouse_button::button3)
-			lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getParam("reference")));
-		else {
-			InsetCommandMailer("ref", *this).showDialog(&cur.bv());
-			cur.undispatched();
-		}
-		return;
-
-	case LFUN_MOUSE_RELEASE:
-		return;
+			lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, 
+		  getParam("reference")));
+		else 
+			InsetCommand::doDispatch(cur, cmd);
+		break;
 
 	default:
-		return InsetCommand::doDispatch(cur, cmd);
+		InsetCommand::doDispatch(cur, cmd);
 	}
 }
 
Index: src/insets/InsetCommand.cpp
===
--- src/insets/InsetCommand.cpp	(révision 18366)
+++ src/insets/InsetCommand.cpp	(copie de travail)
@@ -133,7 +133,7 @@ void InsetCommand::doDispatch(Cursor & c
 	}
 
 	case LFUN_MOUSE_RELEASE: {
-		if (!mailer_name_.empty())
+		if (!mailer_name_.empty() && !cur.selection())
 			InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
 		break;
 	}
Index: src/insets/InsetVSpace.cpp
===
--- src/insets/InsetVSpace.cpp	(révision 18366)
+++ src/insets/InsetVSpace.cpp	(copie de travail)
@@ -73,7 +73,8 @@ void InsetVSpace::doDispatch(Cursor & cu
 	}
 
 	case LFUN_MOUSE_RELEASE:
-		InsetVSpaceMailer(*this).showDialog(&cur.bv());
+		if (!cur.selection())
+			InsetVSpaceMailer(*this).showDialog(&cur.bv());
 		break;
 
 	default: