added contextmenu to follow links
authorinsilmaril
Tue Feb 08 14:07:19 2005 +0000 (2005-02-08)
changeset 899db3eaa21237
parent 88 9771028de303
child 90 10f3d35dcbad
added contextmenu to follow links
Makefile
branchobj.cpp
branchobj.h
demos/todo.vym
icons/icons.xcf
icons/modecolor.xpm
icons/modelink.xpm
linkobj.cpp
linkobj.h
main.cpp
mainwindow.cpp
mainwindow.h
mapeditor.cpp
mapeditor.h
version.h
     1.1 --- a/Makefile	Mon Jan 31 09:47:43 2005 +0000
     1.2 +++ b/Makefile	Tue Feb 08 14:07:19 2005 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4  #############################################################################
     1.5  # Makefile for building: vym
     1.6 -# Generated by qmake (1.07a) (Qt 3.3.1) on: Mon Jan 31 00:05:28 2005
     1.7 +# Generated by qmake (1.07a) (Qt 3.3.1) on: Mon Feb  7 11:52:57 2005
     1.8  # Project:  vym.pro
     1.9  # Template: app
    1.10  # Command: $(QMAKE) -o Makefile vym.pro
    1.11 @@ -12,14 +12,14 @@
    1.12  CXX      = g++
    1.13  LEX      = flex
    1.14  YACC     = yacc
    1.15 -CFLAGS   = -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC  -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT
    1.16 -CXXFLAGS = -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC  -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT
    1.17 +CFLAGS   = -pipe -O2 -fmessage-length=0 -Wall -fPIC -Wall -W -O2 -fmessage-length=0 -Wall -fPIC  -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT
    1.18 +CXXFLAGS = -pipe -O2 -fmessage-length=0 -Wall -fPIC -Wall -W -O2 -fmessage-length=0 -Wall -fPIC  -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT
    1.19  LEXFLAGS = 
    1.20  YACCFLAGS= -d
    1.21  INCPATH  = -I/usr/lib/qt3/mkspecs/linux-g++ -I. -I/usr/include -I$(QTDIR)/include
    1.22  LINK     = g++
    1.23  LFLAGS   = 
    1.24 -LIBS     = $(SUBLIBS) -L/usr/lib/ -L$(QTDIR)/lib/ -L/usr/X11R6/lib/ -lqt-mt -lXext -lX11 -lm
    1.25 +LIBS     = $(SUBLIBS) -L/usr/lib64/ -L$(QTDIR)/lib64/ -L/usr/X11R6/lib64/ -lqt-mt -lXext -lX11 -lm
    1.26  AR       = ar cqs
    1.27  RANLIB   = 
    1.28  MOC      = $(QTDIR)/bin/moc
    1.29 @@ -199,7 +199,7 @@
    1.30  $(MOC): 
    1.31  	( cd $(QTDIR)/src/moc && $(MAKE) )
    1.32  
    1.33 -Makefile: vym.pro  /usr/lib/qt3/mkspecs/linux-g++/qmake.conf /usr/lib/qt3/lib/libqt-mt.prl
    1.34 +Makefile: vym.pro  /usr/lib/qt3/mkspecs/linux-g++/qmake.conf /usr/lib/qt3/lib64/libqt-mt.prl
    1.35  	$(QMAKE) -o Makefile vym.pro
    1.36  qmake: 
    1.37  	@$(QMAKE) -o Makefile vym.pro
    1.38 @@ -684,9 +684,10 @@
    1.39  
    1.40  moc_texteditor.o: moc_texteditor.cpp  texteditor.h 
    1.41  
    1.42 -moc_exporthtmldialog.o: moc_exporthtmldialog.cpp  exporthtmldialog.h 
    1.43 +moc_exporthtmldialog.o: moc_exporthtmldialog.cpp  exporthtmldialog.h showtextdialog.h
    1.44  
    1.45 -moc_exportxhtmldialog.o: moc_exportxhtmldialog.cpp  exportxhtmldialog.h 
    1.46 +moc_exportxhtmldialog.o: moc_exportxhtmldialog.cpp  exportxhtmldialog.h process.h \
    1.47 +		showtextdialog.h
    1.48  
    1.49  moc_showtextdialog.o: moc_showtextdialog.cpp  showtextdialog.h 
    1.50  
     2.1 --- a/branchobj.cpp	Mon Jan 31 09:47:43 2005 +0000
     2.2 +++ b/branchobj.cpp	Tue Feb 08 14:07:19 2005 +0000
     2.3 @@ -181,6 +181,11 @@
     2.4  	return floatimage.count();
     2.5  }
     2.6  
     2.7 +int BranchObj::countLinks()
     2.8 +{
     2.9 +	return link.count();
    2.10 +}
    2.11 +
    2.12  void BranchObj::setParObjTmp(LinkableMapObj* lmo, QPoint m, int off)
    2.13  {
    2.14  	// Temporary link to lmo
    2.15 @@ -807,6 +812,14 @@
    2.16  	return link.count();
    2.17  }
    2.18  
    2.19 +BranchObj* BranchObj::linkTargetAt (int i)
    2.20 +{
    2.21 +	if (link.at(i))
    2.22 +		return link.at(i)->otherBranch (this);
    2.23 +	else
    2.24 +		return NULL;
    2.25 +}
    2.26 +
    2.27  LinkableMapObj* BranchObj::addFloatImage ()
    2.28  {
    2.29  	FloatImageObj *newfi=new FloatImageObj (canvas,this);
     3.1 --- a/branchobj.h	Mon Jan 31 09:47:43 2005 +0000
     3.2 +++ b/branchobj.h	Tue Feb 08 14:07:19 2005 +0000
     3.3 @@ -28,6 +28,7 @@
     3.4  	virtual int getFloatImageNum(FloatImageObj*);		
     3.5  	virtual int countBranches();		
     3.6  	virtual int countFloatImages();		
     3.7 +	virtual int countLinks();		
     3.8      virtual void setParObjTmp (LinkableMapObj*,QPoint,int);// Only for moving Obj around
     3.9  	virtual void unsetParObjTmp();			// reuse original ParObj
    3.10  
    3.11 @@ -66,6 +67,7 @@
    3.12  	virtual void removeLink (LinkObj*);
    3.13  	virtual void deleteLink (LinkObj*);
    3.14  	virtual int countLink ();
    3.15 +	virtual BranchObj* linkTargetAt (int);
    3.16  	virtual LinkableMapObj* addFloatImage();
    3.17  	virtual LinkableMapObj* addFloatImage(FloatImageObj*);
    3.18  	virtual void removeFloatImage(FloatImageObj*);
     4.1 Binary file demos/todo.vym has changed
     5.1 Binary file icons/icons.xcf has changed
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/icons/modecolor.xpm	Tue Feb 08 14:07:19 2005 +0000
     6.3 @@ -0,0 +1,48 @@
     6.4 +/* XPM */
     6.5 +static char * mode_color_xpm[] = {
     6.6 +"32 32 13 1",
     6.7 +" 	c None",
     6.8 +".	c #FF0000",
     6.9 +"+	c #0026FF",
    6.10 +"@	c #5519AA",
    6.11 +"#	c #BF0940",
    6.12 +"$	c #AA0D55",
    6.13 +"%	c #C60839",
    6.14 +"&	c #8E1171",
    6.15 +"*	c #391EC6",
    6.16 +"=	c #1C22E3",
    6.17 +"-	c #71158E",
    6.18 +";	c #E3041C",
    6.19 +">	c #DB0524",
    6.20 +"                                ",
    6.21 +"                        .....   ",
    6.22 +"                     ...        ",
    6.23 +"  ..         +++++++@.          ",
    6.24 +"    .......#$$%&+++*&%#.....    ",
    6.25 +"    ..     +++=%-+*;@=+         ",
    6.26 +"  ..       +++++$+;*+++         ",
    6.27 +"           +++++;$*++++         ",
    6.28 +"           ++++$%@++++++        ",
    6.29 +"           +++*;@%-+++++  ...   ",
    6.30 +"           +++@@++$;@@@%..      ",
    6.31 +"          ++++%@+++*@%....      ",
    6.32 +"   .....  @=+*$+++++++++  ..    ",
    6.33 +"        ...%$;*+++++++++        ",
    6.34 +"      ..>*&%++++++++++++        ",
    6.35 +"         -%=++++++++++++        ",
    6.36 +"       ...+++++++++++++         ",
    6.37 +"   ...      +++++++++++         ",
    6.38 +"            +++++++++++         ",
    6.39 +"            ++++++++++          ",
    6.40 +"           +++++++++++          ",
    6.41 +"            +++++++++           ",
    6.42 +"  ..... .... ...++....          ",
    6.43 +"  . . . .  . . +.+.++           ",
    6.44 +"  . . . .  . . +.+..+           ",
    6.45 +"  .   . .  . . .++.             ",
    6.46 +"  .   . .... ...++....          ",
    6.47 +"                                ",
    6.48 +"                                ",
    6.49 +"                                ",
    6.50 +"                                ",
    6.51 +"                                "};
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/icons/modelink.xpm	Tue Feb 08 14:07:19 2005 +0000
     7.3 @@ -0,0 +1,48 @@
     7.4 +/* XPM */
     7.5 +static char * mode_link_xpm[] = {
     7.6 +"32 32 13 1",
     7.7 +" 	c None",
     7.8 +".	c #FF0000",
     7.9 +"+	c #0026FF",
    7.10 +"@	c #5519AA",
    7.11 +"#	c #BF0940",
    7.12 +"$	c #AA0D55",
    7.13 +"%	c #C60839",
    7.14 +"&	c #8E1171",
    7.15 +"*	c #391EC6",
    7.16 +"=	c #1C22E3",
    7.17 +"-	c #71158E",
    7.18 +";	c #E3041C",
    7.19 +">	c #DB0524",
    7.20 +"                                ",
    7.21 +"                        .....   ",
    7.22 +"                     ...        ",
    7.23 +"  ..                @.          ",
    7.24 +"    .......#$$%&   *&%#.....    ",
    7.25 +"    ..        =%- *;@=          ",
    7.26 +"  ..            $ ;*            ",
    7.27 +"                ;$*             ",
    7.28 +"               $%@              ",
    7.29 +"              *;@%-       ...   ",
    7.30 +"              @@  $;@@@%..      ",
    7.31 +"              %@   *@%....      ",
    7.32 +"   .....  @= *$           ..    ",
    7.33 +"        ...%$;*                 ",
    7.34 +"      ..>*&%                    ",
    7.35 +"         -%=                    ",
    7.36 +"       ...                      ",
    7.37 +"   ...                          ",
    7.38 +"                                ",
    7.39 +"                                ",
    7.40 +"                                ",
    7.41 +"                                ",
    7.42 +"  ..... .... ...  ....          ",
    7.43 +"  . . . .  . .  . .             ",
    7.44 +"  . . . .  . .  . ..            ",
    7.45 +"  .   . .  . . .  .             ",
    7.46 +"  .   . .... ...  ....          ",
    7.47 +"                                ",
    7.48 +"                                ",
    7.49 +"                                ",
    7.50 +"                                ",
    7.51 +"                                "};
     8.1 --- a/linkobj.cpp	Mon Jan 31 09:47:43 2005 +0000
     8.2 +++ b/linkobj.cpp	Tue Feb 08 14:07:19 2005 +0000
     8.3 @@ -136,6 +136,16 @@
     8.4  	}
     8.5  }
     8.6  
     8.7 +BranchObj* LinkObj::otherBranch(BranchObj* thisBranch)
     8.8 +{
     8.9 +	if (!beginBranch && !endBranch)
    8.10 +		return NULL;
    8.11 +	if (thisBranch==beginBranch)
    8.12 +		return endBranch;
    8.13 +	else	
    8.14 +		return beginBranch;
    8.15 +}
    8.16 +
    8.17  void LinkObj::positionBBox()
    8.18  {
    8.19  }
     9.1 --- a/linkobj.h	Mon Jan 31 09:47:43 2005 +0000
     9.2 +++ b/linkobj.h	Tue Feb 08 14:07:19 2005 +0000
     9.3 @@ -20,6 +20,7 @@
     9.4  	void deactivate();			// removes those pointers
     9.5  	bool isUsed();				// true, if at least on branch uses it
     9.6  	void updateLink();
     9.7 +	BranchObj* otherBranch (BranchObj*);
     9.8  	void positionBBox();
     9.9  	void calcBBoxSize();
    9.10  	void setVisibility (bool);
    10.1 --- a/main.cpp	Mon Jan 31 09:47:43 2005 +0000
    10.2 +++ b/main.cpp	Tue Feb 08 14:07:19 2005 +0000
    10.3 @@ -50,6 +50,7 @@
    10.4  QAction *actionEditSelectLast;
    10.5  QAction *actionEditLoadImage;
    10.6  QAction *actionEditToggleFloatExport;
    10.7 +QAction *actionEditNoLink;
    10.8  
    10.9  QAction *actionFormatColor;		
   10.10  QAction *actionFormatPickColor;		
   10.11 @@ -59,6 +60,10 @@
   10.12  QAction *actionFormatLinkColorHint;
   10.13  QAction *actionFormatLinkColor;		
   10.14  
   10.15 +QActionGroup *actionGroupModModes;
   10.16 +QAction *actionModModeColor;
   10.17 +QAction *actionModModeLink;
   10.18 +
   10.19  QActionGroup *actionGroupFormatFrameTypes;
   10.20  QAction *actionFormatFrameNone;
   10.21  QAction *actionFormatFrameRectangle;
   10.22 @@ -78,6 +83,7 @@
   10.23  QAction *actionSettingsUseDelKey;
   10.24  
   10.25  QPopupMenu *branchContextMenu;
   10.26 +QPopupMenu *branchLinksContextMenu;
   10.27  QPopupMenu *floatimageContextMenu;
   10.28  QPopupMenu *saveImageFormatMenu;
   10.29  QPopupMenu *canvasContextMenu;
    11.1 --- a/mainwindow.cpp	Mon Jan 31 09:47:43 2005 +0000
    11.2 +++ b/mainwindow.cpp	Tue Feb 08 14:07:19 2005 +0000
    11.3 @@ -37,6 +37,8 @@
    11.4  #include "icons/viewzoomreset.xpm"
    11.5  #include "icons/viewzoomin.xpm"
    11.6  #include "icons/viewzoomout.xpm"
    11.7 +#include "icons/modecolor.xpm"
    11.8 +#include "icons/modelink.xpm"
    11.9  #include "icons/vym-48x48.xpm"
   11.10  #include "icons/flag-note.xpm"
   11.11  #include "icons/flag-url.xpm"
   11.12 @@ -88,6 +90,7 @@
   11.13  extern QAction *actionEditSelectLast;
   11.14  extern QAction *actionEditLoadImage;
   11.15  extern QAction *actionEditToggleFloatExport;
   11.16 +extern QAction *actionEditNoLink;
   11.17  
   11.18  extern QAction* actionFormatColor;
   11.19  extern QAction* actionFormatPickColor;
   11.20 @@ -97,6 +100,10 @@
   11.21  extern QAction* actionFormatBackColor;
   11.22  extern QAction* actionFormatLinkColor;
   11.23  
   11.24 +extern QActionGroup* actionGroupModModes;
   11.25 +extern QAction* actionModModeColor;
   11.26 +extern QAction* actionModModeLink;
   11.27 +
   11.28  extern QActionGroup *actionGroupFormatFrameTypes;
   11.29  extern QAction *actionFormatFrameNone;
   11.30  extern QAction *actionFormatFrameRectangle;
   11.31 @@ -117,6 +124,7 @@
   11.32  extern QAction* actionSettingsUseDelKey;
   11.33  
   11.34  extern QPopupMenu* branchContextMenu;
   11.35 +extern QPopupMenu* branchLinksContextMenu;
   11.36  extern QPopupMenu* floatimageContextMenu;
   11.37  extern QPopupMenu* saveImageFormatMenu;
   11.38  extern QPopupMenu* canvasContextMenu;
   11.39 @@ -189,6 +197,7 @@
   11.40      setupEditActions();
   11.41      setupFormatActions();
   11.42      setupViewActions();
   11.43 +    setupModeActions();
   11.44  	setupFlagActions();
   11.45      setupSettingsActions();
   11.46  	setupContextMenus();
   11.47 @@ -476,7 +485,9 @@
   11.48  	actionEditHeading=a;
   11.49      a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_Return, this, "editHeading" );
   11.50      connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
   11.51 -    //a->addTo ( menu );
   11.52 +	actionEditHeading=a;
   11.53 +    a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_F2, this, "editHeading" );
   11.54 +    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
   11.55      
   11.56      // Shortcut to delete selection
   11.57      a = new QAction( tr( "Delete Selection" ),tr( "Delete Selection" ), Key_Delete, this, "deleteBranch" );
   11.58 @@ -554,6 +565,11 @@
   11.59      a = new QAction( tr( "Add Image" ),tr( "Add Image" ), 0, this, "loadImage" );
   11.60      connect( a, SIGNAL( activated() ), this, SLOT( editLoadImage() ) );
   11.61  	actionEditLoadImage=a;
   11.62 +
   11.63 +	// inserted into branchLinksContextMenu, if no link is available.
   11.64 +    a = new QAction( tr( "No link available" ),tr( "No link available" ), 0, this, "noLink" );
   11.65 +	a->setEnabled (false);
   11.66 +	actionEditNoLink=a;
   11.67  }
   11.68  
   11.69  // Format Actions
   11.70 @@ -675,6 +691,29 @@
   11.71      a->addTo( menu );
   11.72  }
   11.73  
   11.74 +// Mode Actions
   11.75 +void Main::setupModeActions()
   11.76 +{
   11.77 +    //QPopupMenu *menu = new QPopupMenu( this );
   11.78 +    //menuBar()->insertItem( tr( "&Mode (using modifiers)" ), menu );
   11.79 +
   11.80 +    QToolBar *tb = new QToolBar( this );
   11.81 +    tb->setLabel( "Modes (using modifiers)" );
   11.82 +    QAction *a;
   11.83 +	actionGroupModModes=new QActionGroup ( this, "formatLinkStyles");
   11.84 +	actionGroupModModes->setExclusive (true);
   11.85 +    a= new QAction( tr( "Use modifier to color branches" ), QPixmap(mode_color_xpm), tr( "Linkstyle Line" ), Key_C, actionGroupModModes, "modModeColor" );
   11.86 +	a->setToggleAction(true);
   11.87 +	a->addTo (tb);
   11.88 +	a->setOn(true);
   11.89 +	actionModModeColor=a;
   11.90 +    a= new QAction( tr( "Use modifier to draw links" ), QPixmap(mode_link_xpm), tr( "Linkstyle Line" ), Key_L, actionGroupModModes, "modModeLink" );
   11.91 +
   11.92 +	a->setToggleAction(true);
   11.93 +	a->addTo (tb);
   11.94 +	actionModModeLink=a;
   11.95 +}
   11.96 +
   11.97  // Flag Actions
   11.98  void Main::setupFlagActions()
   11.99  {
  11.100 @@ -799,6 +838,13 @@
  11.101  	branchContextMenu->insertSeparator();	
  11.102  	actionGroupFormatFrameTypes->addTo( branchContextMenu );
  11.103  
  11.104 +	// Context Menu for links in a branch menu
  11.105 +	// This will be populated "on demand" in MapEditor::updateActions
  11.106 +	branchContextMenu->insertSeparator();	
  11.107 +	branchLinksContextMenu =new QPopupMenu (this);
  11.108 +	branchContextMenu->insertItem ("Goto Link",branchLinksContextMenu);
  11.109 +	connect( branchLinksContextMenu, SIGNAL( activated(int) ), this, SLOT( editFollowLink(int ) ) );
  11.110 +
  11.111  	// Context menu for floatimage
  11.112  	floatimageContextMenu =new QPopupMenu (this);
  11.113  	saveImageFormatMenu=new QPopupMenu (this);
  11.114 @@ -1933,6 +1979,12 @@
  11.115  		currentMapEditor()->toggleFloatExport();
  11.116  }
  11.117  
  11.118 +void Main::editFollowLink(int item)
  11.119 +{
  11.120 +	if (currentMapEditor())
  11.121 +		currentMapEditor()->followLink(branchLinksContextMenu->indexOf(item));
  11.122 +}
  11.123 +
  11.124  void Main::formatSelectColor()
  11.125  {
  11.126  	if (currentMapEditor())
  11.127 @@ -2057,6 +2109,15 @@
  11.128  		currentMapEditor()->adjustCanvasSize();
  11.129  	}	
  11.130  }
  11.131 +
  11.132 +void Main::modModeColor()
  11.133 +{
  11.134 +}
  11.135 +
  11.136 +void Main::modModeLink()
  11.137 +{
  11.138 +}
  11.139 +
  11.140  bool Main::settingsPDF()
  11.141  {
  11.142  	// Default browser is set in constructor
    12.1 --- a/mainwindow.h	Mon Jan 31 09:47:43 2005 +0000
    12.2 +++ b/mainwindow.h	Tue Feb 08 14:07:19 2005 +0000
    12.3 @@ -38,6 +38,7 @@
    12.4      void setupEditActions();
    12.5      void setupFormatActions();
    12.6      void setupViewActions();
    12.7 +    void setupModeActions();
    12.8      void setupWindowActions();
    12.9      void setupFlagActions();
   12.10      void setupSettingsActions();
   12.11 @@ -114,6 +115,7 @@
   12.12      void editLoadImage();
   12.13      void editSaveImage(int);
   12.14      void editToggleFloatExport();
   12.15 +    void editFollowLink (int);
   12.16  
   12.17      void formatSelectColor();
   12.18      void formatPickColor();
   12.19 @@ -134,6 +136,9 @@
   12.20      void viewZoomIn();
   12.21      void viewZoomOut();
   12.22  
   12.23 +	void modModeColor();
   12.24 +	void modModeLink();
   12.25 +
   12.26  public slots:
   12.27  	bool settingsPDF();
   12.28  	bool settingsURL();
    13.1 --- a/mapeditor.cpp	Mon Jan 31 09:47:43 2005 +0000
    13.2 +++ b/mapeditor.cpp	Tue Feb 08 14:07:19 2005 +0000
    13.3 @@ -87,6 +87,7 @@
    13.4  extern QAction *actionEditSelectLast;
    13.5  extern QAction *actionEditLoadImage;
    13.6  extern QAction *actionEditToggleFloatExport;
    13.7 +extern QAction *actionEditNoLink;
    13.8  
    13.9  extern QAction* actionFormatPickColor;
   13.10  extern QAction* actionFormatColorBranch;
   13.11 @@ -95,6 +96,10 @@
   13.12  extern QAction *actionFormatBackColor;
   13.13  extern QAction *actionFormatLinkColor;
   13.14  
   13.15 +extern QActionGroup* actionGroupModModes;
   13.16 +extern QAction* actionModModeColor;
   13.17 +extern QAction* actionModModeLink;
   13.18 +
   13.19  extern QActionGroup *actionGroupFormatFrameTypes;
   13.20  extern QAction *actionFormatFrameNone;
   13.21  extern QAction *actionFormatFrameRectangle;
   13.22 @@ -113,6 +118,7 @@
   13.23  extern QAction *actionSettingsPasteNewHeading;
   13.24  
   13.25  extern QPopupMenu *branchContextMenu;
   13.26 +extern QPopupMenu *branchLinksContextMenu;
   13.27  extern QPopupMenu *floatimageContextMenu;
   13.28  extern QPopupMenu *saveImageFormatMenu;
   13.29  extern QPopupMenu *exportImageFormatMenu;
   13.30 @@ -300,9 +306,6 @@
   13.31  		pickColorCursor=QCursor ( cursorcolorpicker_xpm, 5,27 ); 
   13.32  	#endif
   13.33  
   13.34 -	modifierMode=pickColorMode;
   13.35 -	//modifierMode=linkObjectsMode;	// FIXME testing
   13.36 -
   13.37  	pickingColor=false;
   13.38  
   13.39      editingBO=NULL;
   13.40 @@ -2229,9 +2232,34 @@
   13.41  		if ( (typeid(*selection) == typeid(BranchObj)) || 
   13.42  			(typeid(*selection) == typeid(MapCenterObj))  )
   13.43  		{
   13.44 +			BranchObj *bo=(BranchObj*)(selection);
   13.45 +			// Take care of links
   13.46 +			if (bo->countLinks()==0)
   13.47 +			{
   13.48 +				branchLinksContextMenu->clear();
   13.49 +				branchLinksContextMenu->insertItem ("No link available");
   13.50 +				
   13.51 +			} else
   13.52 +			{
   13.53 +				BranchObj *bot;
   13.54 +				QString s;
   13.55 +				branchLinksContextMenu->clear();
   13.56 +				for (int i=0; i<=bo->countLinks();i++)
   13.57 +				{
   13.58 +					bot=bo->linkTargetAt(i);
   13.59 +					if (bot)
   13.60 +					{
   13.61 +						s=bot->getHeading();
   13.62 +						if (s.length()>25)
   13.63 +							s=s.left(25)+"...";
   13.64 +						branchLinksContextMenu->insertItem (s);
   13.65 +					}	
   13.66 +				}
   13.67 +			}
   13.68 +
   13.69  			standardFlagsDefault->setEnabled (true);
   13.70  
   13.71 -			if ( ((BranchObj*)(selection))->getURL().isEmpty() )
   13.72 +			if ( bo->getURL().isEmpty() )
   13.73  				actionEditOpenURL->setEnabled (false);
   13.74  			else	
   13.75  				actionEditOpenURL->setEnabled (true);
   13.76 @@ -2239,7 +2267,7 @@
   13.77  			actionEditHeading2URL->setEnabled (true);	
   13.78  			actionEditBugzilla2URL->setEnabled (true);	
   13.79  
   13.80 -			if ( ((BranchObj*)(selection))->getVymLink().isEmpty() )
   13.81 +			if ( bo->getVymLink().isEmpty() )
   13.82  			{
   13.83  				actionEditOpenVymLink->setEnabled (false);
   13.84  				actionEditDeleteVymLink->setEnabled (false);
   13.85 @@ -2643,13 +2671,24 @@
   13.86  	}	
   13.87  }
   13.88  
   13.89 +void MapEditor::followLink(int i)
   13.90 +{
   13.91 +	cout << "ME::followLink "<<i<<endl;
   13.92 +	BranchObj *bo=((BranchObj*)(selection))->linkTargetAt(i);
   13.93 +	if (bo) 
   13.94 +	{
   13.95 +		cout << "follow to "<<bo->getHeading()<<endl;
   13.96 +		selection->unselect();
   13.97 +		selection=bo;
   13.98 +		selection->select();
   13.99 +		ensureSelectionVisible();
  13.100 +	}
  13.101 +}
  13.102 +
  13.103  void MapEditor::testFunction()
  13.104  {
  13.105  	cout << "MapEditor::testFunction() called\n";
  13.106 -	if (modifierMode==pickColorMode)
  13.107 -		modifierMode=linkObjectsMode;
  13.108 -	else	
  13.109 -		modifierMode=pickColorMode;
  13.110 +	branchLinksContextMenu->setEnabled (false);
  13.111  }
  13.112  
  13.113  void MapEditor::ensureSelectionVisible()
  13.114 @@ -2728,7 +2767,7 @@
  13.115  	// Special case: CTRL is pressed
  13.116  	if (e->state() & QMouseEvent::ControlButton)
  13.117  	{
  13.118 -		if (modifierMode==pickColorMode)
  13.119 +		if (actionModModeColor->isOn())
  13.120  		{
  13.121  			if (e->state() & QMouseEvent::ControlButton)
  13.122  			{
  13.123 @@ -2737,21 +2776,21 @@
  13.124  				return;
  13.125  			}
  13.126  		} 
  13.127 -		if (modifierMode==linkObjectsMode)
  13.128 +		if (actionModModeLink->isOn())
  13.129  		{	
  13.130 -			if (lmo && 
  13.131 -				(typeid(*lmo) == typeid(BranchObj)) || 
  13.132 -				(typeid(*lmo) == typeid(MapCenterObj))  )
  13.133 +			if (selection && 
  13.134 +				((typeid(*selection) == typeid(BranchObj)) || 
  13.135 +				(typeid(*selection) == typeid(MapCenterObj)))  )
  13.136  			{
  13.137  				drawingLink=true;
  13.138  				linkingObj_src=selection;
  13.139  				tmpLink=new LinkObj (mapCanvas);
  13.140 -				tmpLink->setBegin ( ((BranchObj*)(lmo)) );
  13.141 +				tmpLink->setBegin ( ((BranchObj*)(selection)) );
  13.142  				tmpLink->setEnd   (p);
  13.143  				tmpLink->updateLink();
  13.144  				tmpLink->setVisibility (true);
  13.145  				return;
  13.146 -			}	
  13.147 +			} 
  13.148  		}	
  13.149  	}
  13.150  
  13.151 @@ -2826,6 +2865,7 @@
  13.152      // Move the selected MapObj
  13.153      if ( selection && movingObj) 
  13.154      {	
  13.155 +		ensureVisible (p.x(),p.y());
  13.156  		
  13.157  		// Now move the selection, but add relative position 
  13.158  		// (movingObj_start) where selection was chosen with 
  13.159 @@ -2909,7 +2949,7 @@
  13.160  				} 
  13.161  				// reposition subbranch
  13.162  				lmosel->reposition();	
  13.163 -				ensureSelectionVisible();
  13.164 +				//ensureSelectionVisible();
  13.165  
  13.166  				if (lmo && (lmo!=selection) &&  
  13.167  					(typeid(*lmo) == typeid(BranchObj) ||
    14.1 --- a/mapeditor.h	Mon Jan 31 09:47:43 2005 +0000
    14.2 +++ b/mapeditor.h	Tue Feb 08 14:07:19 2005 +0000
    14.3 @@ -11,8 +11,6 @@
    14.4  #include "mapcenterobj.h"
    14.5  #include "misc.h"
    14.6  
    14.7 -enum ModifierMode {pickColorMode,linkObjectsMode};
    14.8 -
    14.9  class MapEditor : public QCanvasView , public xmlObj {
   14.10      Q_OBJECT
   14.11  
   14.12 @@ -130,6 +128,7 @@
   14.13      void importDir(BranchObj *,QDir);
   14.14  public:	
   14.15      void importDir();
   14.16 +	void followLink (int);
   14.17      void testFunction();				// FIXME just testing
   14.18  
   14.19  protected:
   14.20 @@ -154,8 +153,6 @@
   14.21  	LinkColorHint linkcolorhint;// use heading color or own color
   14.22  	LinkStyle linkstyle;		// default style for links
   14.23  
   14.24 -	ModifierMode modifierMode;	// pick color or link objects?
   14.25 -
   14.26      QCursor handOpenCursor;		// cursor while moving canvas view
   14.27  	QCursor pickColorCursor;	// cursor while picking color 
   14.28  	bool pickingColor;
    15.1 --- a/version.h	Mon Jan 31 09:47:43 2005 +0000
    15.2 +++ b/version.h	Tue Feb 08 14:07:19 2005 +0000
    15.3 @@ -1,7 +1,7 @@
    15.4  #ifndef VERSION_H 
    15.5  #define VERSION_H
    15.6  
    15.7 -#define __VYM_VERSION__ "1.6.1"
    15.8 -#define __BUILD_DATE__ "January 31, 2005"
    15.9 +#define __VYM_VERSION__ "1.6.2"
   15.10 +#define __BUILD_DATE__ "February 8, 2005"
   15.11  
   15.12  #endif