mapeditor.cpp
branchqt4-port
changeset 7 84f76a3876d7
parent 6 db50e4164311
child 9 f94317a94db1
     1.1 --- a/mapeditor.cpp	Wed Jun 14 14:43:18 2006 +0000
     1.2 +++ b/mapeditor.cpp	Tue Jul 04 12:10:56 2006 +0000
     1.3 @@ -130,8 +130,8 @@
     1.4  extern QMenu* branchContextMenu;
     1.5  extern QMenu* branchAddContextMenu;
     1.6  extern QMenu* branchRemoveContextMenu;
     1.7 -extern QMenu* branchLinksContextMenu;
     1.8 -extern QMenu* branchLinksContextMenuDup;
     1.9 +extern QMenu* branchLinksContextMenuEdit;
    1.10 +extern QMenu* branchLinksContextMenuFollow;
    1.11  extern QMenu* floatimageContextMenu;
    1.12  extern QMenu* saveImageFormatMenu;
    1.13  extern QMenu* canvasContextMenu;
    1.14 @@ -2517,7 +2517,6 @@
    1.15  
    1.16  void MapEditor::updateActions()
    1.17  {
    1.18 -return;  //FIXME testing
    1.19  	QAction *a;
    1.20  	if (getLinkColorHint()==HeadingColor) 
    1.21  		actionFormatLinkColorHint->setOn(true);
    1.22 @@ -2560,17 +2559,14 @@
    1.23  			// Take care of links
    1.24  			if (bo->countXLinks()==0)
    1.25  			{
    1.26 -				branchLinksContextMenu->clear();
    1.27 -				branchLinksContextMenu->insertItem ("No xLink available");
    1.28 -				branchLinksContextMenuDup->clear();
    1.29 -				branchLinksContextMenuDup->insertItem ("No xLink available");
    1.30 -				
    1.31 +				branchLinksContextMenuEdit->clear();
    1.32 +				branchLinksContextMenuFollow->clear();
    1.33  			} else
    1.34  			{
    1.35  				BranchObj *bot;
    1.36  				QString s;
    1.37 -				branchLinksContextMenu->clear();
    1.38 -				branchLinksContextMenuDup->clear();
    1.39 +				branchLinksContextMenuEdit->clear();
    1.40 +				branchLinksContextMenuFollow->clear();
    1.41  				for (int i=0; i<=bo->countXLinks();i++)
    1.42  				{
    1.43  					bot=bo->XLinkTargetAt(i);
    1.44 @@ -2579,8 +2575,8 @@
    1.45  						s=bot->getHeading();
    1.46  						if (s.length()>25)
    1.47  							s=s.left(25)+"...";
    1.48 -						branchLinksContextMenu->insertItem (s);
    1.49 -						branchLinksContextMenuDup->insertItem (s);
    1.50 +						branchLinksContextMenuFollow->addAction (s);
    1.51 +						branchLinksContextMenuEdit->addAction (s);
    1.52  					}	
    1.53  				}
    1.54  			}
    1.55 @@ -3070,6 +3066,7 @@
    1.56  
    1.57  void MapEditor::editXLink(int i)
    1.58  {
    1.59 +	qDebug ("ko.");
    1.60  	if (selection && 
    1.61  		(typeid(*selection) == typeid(BranchObj)) || 
    1.62  		(typeid(*selection) == typeid(MapCenterObj))  )