mainwindow.cpp
changeset 94 6783e13bb05d
parent 93 31c6ce8efbc7
child 95 f688a9913724
     1.1 --- a/mainwindow.cpp	Thu Mar 24 21:10:38 2005 +0000
     1.2 +++ b/mainwindow.cpp	Sat Apr 09 22:50:08 2005 +0000
     1.3 @@ -92,7 +92,6 @@
     1.4  extern QAction *actionEditSelectLast;
     1.5  extern QAction *actionEditLoadImage;
     1.6  extern QAction *actionEditToggleFloatExport;
     1.7 -extern QAction *actionEditNoLink;
     1.8  
     1.9  extern QAction* actionFormatColor;
    1.10  extern QAction* actionFormatPickColor;
    1.11 @@ -128,6 +127,7 @@
    1.12  
    1.13  extern QPopupMenu* branchContextMenu;
    1.14  extern QPopupMenu* branchLinksContextMenu;
    1.15 +extern QPopupMenu* branchLinksContextMenuDup;
    1.16  extern QPopupMenu* floatimageContextMenu;
    1.17  extern QPopupMenu* saveImageFormatMenu;
    1.18  extern QPopupMenu* canvasContextMenu;
    1.19 @@ -572,10 +572,6 @@
    1.20      connect( a, SIGNAL( activated() ), this, SLOT( editLoadImage() ) );
    1.21  	actionEditLoadImage=a;
    1.22  
    1.23 -	// inserted into branchLinksContextMenu, if no link is available.
    1.24 -    a = new QAction( tr( "No link available" ),tr( "No link available" ), 0, this, "noLink" );
    1.25 -	a->setEnabled (false);
    1.26 -	actionEditNoLink=a;
    1.27  }
    1.28  
    1.29  // Format Actions
    1.30 @@ -856,8 +852,12 @@
    1.31  	// This will be populated "on demand" in MapEditor::updateActions
    1.32  	branchContextMenu->insertSeparator();	
    1.33  	branchLinksContextMenu =new QPopupMenu (this);
    1.34 -	branchContextMenu->insertItem ("Goto Link",branchLinksContextMenu);
    1.35 +	branchContextMenu->insertItem (tr("Goto Link"),branchLinksContextMenu);
    1.36  	connect( branchLinksContextMenu, SIGNAL( activated(int) ), this, SLOT( editFollowLink(int ) ) );
    1.37 +	
    1.38 +	branchLinksContextMenuDup =new QPopupMenu (this);
    1.39 +	branchContextMenu->insertItem (tr("Edit Link"),branchLinksContextMenuDup);
    1.40 +	connect( branchLinksContextMenuDup, SIGNAL( activated(int) ), this, SLOT( editEditLink(int ) ) );
    1.41  
    1.42  	// Context menu for floatimage
    1.43  	floatimageContextMenu =new QPopupMenu (this);
    1.44 @@ -1537,8 +1537,9 @@
    1.45  			fileSave(savemode);
    1.46  
    1.47  			// Set name of tab
    1.48 -			tabWidget->setTabLabel (currentMapEditor(),
    1.49 -				currentMapEditor()->getFileName() );
    1.50 +			if (savemode==CompleteMap)
    1.51 +				tabWidget->setTabLabel (currentMapEditor(),
    1.52 +					currentMapEditor()->getFileName() );
    1.53  			return;
    1.54  		} 
    1.55  	}
    1.56 @@ -1999,6 +2000,12 @@
    1.57  		currentMapEditor()->followLink(branchLinksContextMenu->indexOf(item));
    1.58  }
    1.59  
    1.60 +void Main::editEditLink(int item)
    1.61 +{
    1.62 +	if (currentMapEditor())
    1.63 +		currentMapEditor()->editLink(branchLinksContextMenuDup->indexOf(item));
    1.64 +}
    1.65 +
    1.66  void Main::formatSelectColor()
    1.67  {
    1.68  	if (currentMapEditor())