# HG changeset patch
# User insilmaril
# Date 1143623469 0
# Node ID 5d0cbeb02bf34c12480a5bbd61578719325b36ec
# Parent  7d91b35c1b6fff006ff540db6668648b44acf8d3
Use CTRL-Click to open URL in a tab (instead of ALT)

diff -r 7d91b35c1b6f -r 5d0cbeb02bf3 mainwindow.cpp
--- a/mainwindow.cpp	Tue Mar 28 20:04:04 2006 +0000
+++ b/mainwindow.cpp	Wed Mar 29 09:11:09 2006 +0000
@@ -522,7 +522,7 @@
 	a->setEnabled (false);
 	actionEditOpenURL=a;
 
-	a = new QAction( tr( "Open URL in new tab" ), QPixmap(), tr( "Open URL in new tab" ), ALT + Key_U, this, "urltab" );
+	a = new QAction( tr( "Open URL in new tab" ), QPixmap(), tr( "Open URL in new tab" ), CTRL + Key_U, this, "urltab" );
     connect( a, SIGNAL( activated() ), this, SLOT( editOpenURLTab() ) );
 	a->setEnabled (false);
 	actionEditOpenURLTab=a;
diff -r 7d91b35c1b6f -r 5d0cbeb02bf3 mapeditor.cpp
--- a/mapeditor.cpp	Tue Mar 28 20:04:04 2006 +0000
+++ b/mapeditor.cpp	Wed Mar 29 09:11:09 2006 +0000
@@ -1658,6 +1658,26 @@
 	return selection;
 }
 
+void MapEditor::unselect()
+{
+	if (selection) 
+	{
+		selectionLast=selection;
+		selection->unselect();
+		selection=NULL;
+	}
+}	
+
+void MapEditor::reselect()
+{
+	if (selectionLast)
+	{
+		selection=selectionLast;
+		selection->select();
+		selectionLast=NULL;
+	}
+}	
+
 bool MapEditor::select (const QString &s)
 {
 	LinkableMapObj *lmo=mapCenter->findObjBySelect(s);
@@ -1675,25 +1695,19 @@
 	return false;
 }
 
-void MapEditor::unselect()
+void MapEditor::select (LinkableMapObj *lmo)
 {
-	if (selection) 
+	if (lmo && selection != lmo)
 	{
-		selectionLast=selection;
-		selection->unselect();
-		selection=NULL;
+		// select the MapObj
+		if (selection) selection->unselect();
+		selection=lmo;
+		selection->select();
+			
+		adjustCanvasSize();
 	}
-}	
-
-void MapEditor::reselect()
-{
-	if (selectionLast)
-	{
-		selection=selectionLast;
-		selection->select();
-		selectionLast=NULL;
-	}
-}	
+
+}
 
 void MapEditor::selectNextBranch()
 {
@@ -3106,17 +3120,45 @@
     QPoint p = inverseWorldMatrix().map(e->pos());
     LinkableMapObj* lmo=mapCenter->findMapObj(p, NULL);
 	
+	//Take care of clickdesystem flags _or_ modifier modes
+	//
+	if (lmo && (typeid(*lmo)==typeid(BranchObj) ||
+		typeid(*lmo)==typeid(MapCenterObj) ))
+	{
+		QString foname=((BranchObj*)lmo)->getSystemFlagName(p);
+		if (!foname.isEmpty())
+		{
+			// systemFlag clicked
+			select (lmo);
+			if (foname=="url") 
+			{
+				if (e->state() & QMouseEvent::ControlButton)
+					mainWindow->editOpenURLTab();
+				else	
+					mainWindow->editOpenURL();
+			}	
+			else if (foname=="vymLink")
+			{
+				mainWindow->editOpenVymLink();
+				// tabWidget may change, better return now
+				// before segfaulting...
+			} else if (foname=="note")
+				mainWindow->windowToggleNoteEditor();
+			else if (foname=="hideInExport")		
+				toggleHideExport();
+			return;	
+		} 
+	} 
+	// No system flag clicked, take care of modmodes
+
 	// Special case: CTRL is pressed
 	if (e->state() & QMouseEvent::ControlButton)
 	{
 		if (actionModModeColor->isOn())
 		{
-			if (e->state() & QMouseEvent::ControlButton)
-			{
 				pickingColor=true;
 				setCursor (pickColorCursor);
 				return;
-			}
 		} 
 		if (actionModModeLink->isOn())
 		{	
@@ -3141,49 +3183,11 @@
 				tmpXLink->setVisibility (true);
 				return;
 			} 
-		}	
+		}
 	}
-
     if (lmo) 
-	{	// MapObj was found
-		if (selection != lmo)
-		{
-			// select the MapObj
-			if (selection) selection->unselect();
-			selection=lmo;
-			selection->select();
-				
-			adjustCanvasSize();
-		}
-
-		// Check, if systemFlag clicked
-		if (typeid(*selection)==typeid(BranchObj) ||
-			typeid(*selection)==typeid(MapCenterObj) )
-		{
-			QString foname=((BranchObj*)selection)->getSystemFlagName(p);
-			if (!foname.isEmpty())
-			{
-				// Do not move, if systemFlag clicked
-				if (foname=="url") 
-				{
-					if (e->state() & QMouseEvent::ControlButton)
-						mainWindow->editOpenURLTab();
-					else	
-						mainWindow->editOpenURL();
-				}	
-				else if (foname=="vymLink")
-				{
-					mainWindow->editOpenVymLink();
-					// tabWidget may change, better return now
-					// before segfaulting...
-					return;
-				} else if (foname=="note")
-					mainWindow->windowToggleNoteEditor();
-				else if (foname=="hideInExport")		
-					toggleHideExport();
-			}			
-		}	
-			
+	{	
+		select (lmo);
 		// Left Button	    Move Branches
 		if (e->button() == QMouseEvent::LeftButton )
 		{
diff -r 7d91b35c1b6f -r 5d0cbeb02bf3 mapeditor.h
--- a/mapeditor.h	Tue Mar 28 20:04:04 2006 +0000
+++ b/mapeditor.h	Wed Mar 29 09:11:09 2006 +0000
@@ -99,10 +99,11 @@
     void addNewBranchHere();		// insert and make selection its
     void deleteSelection();
 	LinkableMapObj* getSelection();	// returns selection
-	bool select(const QString &);	// Select 
 	void unselect();				// before changing current noteedit
 	void reselect();				// after  changing current noteedit
+	bool select(const QString &);	// Select 
 private:	
+	void select(LinkableMapObj*);	
 	void selectNextBranch();		// Increment number of branch
 	void selectPrevBranch();		// Decrement number of branch
 public:	
diff -r 7d91b35c1b6f -r 5d0cbeb02bf3 tex/vym.tex
--- a/tex/vym.tex	Tue Mar 28 20:04:04 2006 +0000
+++ b/tex/vym.tex	Wed Mar 29 09:11:09 2006 +0000
@@ -509,7 +509,7 @@
 	\includegraphics[width=0.5cm]{flag-url.png}
 \end{center}
 If you use konqueror as browser, \vym will remember the konqueror which
-was opened first by \vym. You can also press \key{Alt} and click to
+was opened first by \vym. You can also press \key{Ctrl} and click to
 open the link in a new tab then.
 
 If you want to keep bookmarks in a map, select a branch where you want