mapeditor.cpp
changeset 266 7d91b35c1b6f
parent 260 69d648a0a15b
child 267 5d0cbeb02bf3
     1.1 --- a/mapeditor.cpp	Mon Mar 27 20:21:58 2006 +0000
     1.2 +++ b/mapeditor.cpp	Tue Mar 28 20:04:04 2006 +0000
     1.3 @@ -59,6 +59,7 @@
     1.4  extern QAction *actionEditMoveDown;
     1.5  extern QAction *actionEditToggleScroll;
     1.6  extern QAction *actionEditOpenURL;
     1.7 +extern QAction *actionEditOpenURLTab;
     1.8  extern QAction *actionEditURL;
     1.9  extern QAction *actionEditHeading2URL;
    1.10  extern QAction *actionEditBugzilla2URL;
    1.11 @@ -2211,28 +2212,6 @@
    1.12  	EOFind=false;
    1.13  }
    1.14  
    1.15 -void MapEditor::openURL()
    1.16 -{
    1.17 -	if (selection )
    1.18 -	{
    1.19 -		if (typeid(*selection) == typeid(BranchObj) ||
    1.20 -			typeid(*selection) == typeid(MapCenterObj))
    1.21 -		{
    1.22 -			QString url=((BranchObj*)selection)->getURL();
    1.23 -
    1.24 -			QProcess *proc = new QProcess( this );
    1.25 -
    1.26 -			proc->addArgument( settings.readEntry("/vym/mainwindow/readerURL" ));
    1.27 -			proc->addArgument( url);
    1.28 -
    1.29 -			if ( !proc->start() ) 
    1.30 -				// error handling
    1.31 -				if (mainWindow->settingsURL() ) 
    1.32 -					openURL();
    1.33 -		}	
    1.34 -	}	
    1.35 -}
    1.36 -
    1.37  void MapEditor::editURL()
    1.38  {
    1.39  	if (selection && (typeid(*selection) == typeid(BranchObj) ||
    1.40 @@ -2253,6 +2232,15 @@
    1.41  	}
    1.42  }
    1.43  
    1.44 +QString MapEditor::getURL()
    1.45 +{
    1.46 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
    1.47 +			typeid(*selection) == typeid(MapCenterObj)) )
    1.48 +		return ((BranchObj*)selection)->getURL();
    1.49 +	else
    1.50 +		return "";
    1.51 +}
    1.52 +
    1.53  void MapEditor::editHeading2URL()
    1.54  {
    1.55  	if (selection && (typeid(*selection) == typeid(BranchObj) ||
    1.56 @@ -2531,10 +2519,15 @@
    1.57  				actionEditToggleScroll->setOn(false);
    1.58  
    1.59  			if ( bo->getURL().isEmpty() )
    1.60 +			{
    1.61  				actionEditOpenURL->setEnabled (false);
    1.62 +				actionEditOpenURLTab->setEnabled (false);
    1.63 +			}	
    1.64  			else	
    1.65 +			{
    1.66  				actionEditOpenURL->setEnabled (true);
    1.67 -
    1.68 +				actionEditOpenURLTab->setEnabled (true);
    1.69 +			}
    1.70  			if ( bo->getVymLink().isEmpty() )
    1.71  			{
    1.72  				actionEditOpenVymLink->setEnabled (false);
    1.73 @@ -3172,7 +3165,12 @@
    1.74  			{
    1.75  				// Do not move, if systemFlag clicked
    1.76  				if (foname=="url") 
    1.77 -					openURL();
    1.78 +				{
    1.79 +					if (e->state() & QMouseEvent::ControlButton)
    1.80 +						mainWindow->editOpenURLTab();
    1.81 +					else	
    1.82 +						mainWindow->editOpenURL();
    1.83 +				}	
    1.84  				else if (foname=="vymLink")
    1.85  				{
    1.86  					mainWindow->editOpenVymLink();