1.8.66 Various fixes
authorinsilmaril
Mon, 12 Feb 2007 09:28:47 +0000
changeset 427fb74fa7bfb4c
parent 426 e0a3449f4458
child 428 9ae68208e2ff
1.8.66 Various fixes
demos/todo.vym
linkablemapobj.cpp
mainwindow.cpp
mapeditor.cpp
mapeditor.h
tex/vym.changelog
texteditor.cpp
texteditor.h
version.h
     1.1 Binary file demos/todo.vym has changed
     2.1 --- a/linkablemapobj.cpp	Mon Feb 12 09:28:46 2007 +0000
     2.2 +++ b/linkablemapobj.cpp	Mon Feb 12 09:28:47 2007 +0000
     2.3 @@ -500,6 +500,7 @@
     2.4  	double vy=p2y - p1y;
     2.5  
     2.6  	// Draw the horizontal line below heading (from ChildPos to ParPos)
     2.7 +	//bottomline->prepareGeometryChange();
     2.8  	bottomline->setLine (QLine (qRound(childPos.x()),
     2.9  		qRound(childPos.y()),
    2.10  		qRound(p1x),
    2.11 @@ -517,6 +518,7 @@
    2.12  	switch (style)
    2.13  	{
    2.14  		case StyleLine:
    2.15 +			//l->prepareGeometryChange();
    2.16  			l->setLine( QLine(qRound (parPos.x()),
    2.17  				qRound(parPos.y()),
    2.18  				qRound(p2x),
    2.19 @@ -525,13 +527,17 @@
    2.20  		case StyleParabel:	
    2.21  			parabel (pa0, p1x,p1y,p2x,p2y);
    2.22  			for (int i=0; i<segment.size(); ++i)
    2.23 +			{
    2.24 +				//segment.at(i)->prepareGeometryChange();
    2.25  				segment.at(i)->setLine(QLineF( pa0.at(i).x(), pa0.at(i).y(),pa0.at(i+1).x(),pa0.at(i+1).y()));
    2.26 +			}	
    2.27  			break;
    2.28  		case StylePolyLine:
    2.29  			pa0.clear();
    2.30  			pa0<<QPointF (qRound(p2x+tp.x()), qRound(p2y+tp.y()));
    2.31  			pa0<<QPointF (qRound(p2x-tp.x()), qRound(p2y-tp.y()));
    2.32  			pa0<<QPointF (qRound (parPos.x()), qRound(parPos.y()) );
    2.33 +			//p->prepareGeometryChange();
    2.34  			p->setPolygon(QPolygonF (pa0));
    2.35  			break;
    2.36  		case StylePolyParabel:	
    2.37 @@ -542,6 +548,7 @@
    2.38  				pa0 << QPointF (pa1.at(i));
    2.39  			for (int i=0;i<=arcsegs;i++)
    2.40  				pa0 << QPointF (pa2.at(arcsegs-i));
    2.41 +			//p->prepareGeometryChange();
    2.42  			p->setPolygon(QPolygonF (pa0));
    2.43  			break;
    2.44  		default:
    2.45 @@ -682,6 +689,7 @@
    2.46  
    2.47  void LinkableMapObj::setSelBox()
    2.48  {
    2.49 +	//selbox->prepareGeometryChange();
    2.50  	selbox->setRect (clickBox);
    2.51  }
    2.52  
     3.1 --- a/mainwindow.cpp	Mon Feb 12 09:28:46 2007 +0000
     3.2 +++ b/mainwindow.cpp	Mon Feb 12 09:28:47 2007 +0000
     3.3 @@ -3424,7 +3424,8 @@
     3.4  	if(currentMapEditor())
     3.5  	{
     3.6  		LinkableMapObj *sel=currentMapEditor()->getSelection();
     3.7 -		if (sel && typeid(*sel) == typeid(BranchObj))
     3.8 +		if (sel && (typeid(*sel) == typeid(BranchObj) ||
     3.9 +		           typeid(*sel) == typeid(MapCenterObj)))
    3.10  		{
    3.11  			branchPropertyWindow->show();
    3.12  			branchPropertyWindow->setMapEditor(currentMapEditor());
     4.1 --- a/mapeditor.cpp	Mon Feb 12 09:28:46 2007 +0000
     4.2 +++ b/mapeditor.cpp	Mon Feb 12 09:28:47 2007 +0000
     4.3 @@ -710,6 +710,19 @@
     4.4  		{	
     4.5  			paste();
     4.6  		}	
     4.7 +	} else if (com=="scroll")
     4.8 +	{
     4.9 +		if (xelection.isEmpty() )
    4.10 +		{
    4.11 +			api.setError (Aborted,"Nothing selected");
    4.12 +		} else if (! selb )
    4.13 +		{				  
    4.14 +			api.setError (Aborted,"Type of selection is not a branch");
    4.15 +		} else if (api.checkParamCount(0))
    4.16 +		{	
    4.17 +			if (!scrollBranch ())	
    4.18 +				api.setError (Aborted,"Could not scroll branch");
    4.19 +		}	
    4.20  	} else if (com=="select")
    4.21  	{
    4.22  		if (api.checkParamCount(1))
    4.23 @@ -835,8 +848,20 @@
    4.24  				selb->updateFlagsToolbar();
    4.25  			}	
    4.26  		}
    4.27 -	}	
    4.28 -	else if (com=="unsetFlag")
    4.29 +	} else if (com=="unscroll")
    4.30 +	{
    4.31 +		if (xelection.isEmpty() )
    4.32 +		{
    4.33 +			api.setError (Aborted,"Nothing selected");
    4.34 +		} else if (! selb )
    4.35 +		{				  
    4.36 +			api.setError (Aborted,"Type of selection is not a branch");
    4.37 +		} else if (api.checkParamCount(0))
    4.38 +		{	
    4.39 +			if (!unscrollBranch ())	
    4.40 +				api.setError (Aborted,"Could not unscroll branch");
    4.41 +		}	
    4.42 +	} else if (com=="unsetFlag")
    4.43  	{
    4.44  		if (xelection.isEmpty() )
    4.45  		{
    4.46 @@ -2765,8 +2790,13 @@
    4.47  
    4.48  void MapEditor::updateNoteFlag()
    4.49  {
    4.50 +	setChanged();
    4.51  	BranchObj *bo=xelection.getBranch();
    4.52 -	if (bo) bo->updateNoteFlag();
    4.53 +	if (bo) 
    4.54 +	{
    4.55 +		bo->updateNoteFlag();
    4.56 +		mainWindow->updateActions();
    4.57 +	}	
    4.58  }
    4.59  
    4.60  void MapEditor::setMapAuthor (const QString &s)
    4.61 @@ -2911,24 +2941,17 @@
    4.62  
    4.63  }
    4.64  
    4.65 -void MapEditor::toggleScroll()
    4.66 +bool MapEditor::scrollBranch()
    4.67  {
    4.68  	BranchObj *bo=xelection.getBranch();
    4.69 -	if (xelection.type()==Branch )
    4.70 +	if (bo)
    4.71  	{
    4.72 -		if (bo->countBranches()==0) return;
    4.73 -		if (bo->getDepth()==0) return;
    4.74 +		if (bo->isScrolled()) return false;
    4.75 +		if (bo->countBranches()==0) return false;
    4.76 +		if (bo->getDepth()==0) return false;
    4.77  		QString u,r;
    4.78 -		if (bo->isScrolled())
    4.79 -		{
    4.80 -			r="unscroll";
    4.81 -			u="scroll";
    4.82 -		}	
    4.83 -		else	
    4.84 -		{
    4.85 -			u="scroll";
    4.86 -			r="unscroll";
    4.87 -		}	
    4.88 +		r="scroll";
    4.89 +		u="unscroll";
    4.90  		saveState(
    4.91  			bo,
    4.92  			QString ("%1 ()").arg(u),
    4.93 @@ -2938,6 +2961,45 @@
    4.94  		);
    4.95  		bo->toggleScroll();
    4.96  		scene()->update();
    4.97 +		return true;
    4.98 +	}	
    4.99 +	return false;
   4.100 +}
   4.101 +
   4.102 +bool MapEditor::unscrollBranch()
   4.103 +{
   4.104 +	BranchObj *bo=xelection.getBranch();
   4.105 +	if (bo)
   4.106 +	{
   4.107 +		if (!bo->isScrolled()) return false;
   4.108 +		if (bo->countBranches()==0) return false;
   4.109 +		if (bo->getDepth()==0) return false;
   4.110 +		QString u,r;
   4.111 +		u="scroll";
   4.112 +		r="unscroll";
   4.113 +		saveState(
   4.114 +			bo,
   4.115 +			QString ("%1 ()").arg(u),
   4.116 +			bo,
   4.117 +			QString ("%1 ()").arg(r),
   4.118 +			QString ("%1 %2").arg(r).arg(getName(bo))
   4.119 +		);
   4.120 +		bo->toggleScroll();
   4.121 +		scene()->update();
   4.122 +		return true;
   4.123 +	}	
   4.124 +	return false;
   4.125 +}
   4.126 +
   4.127 +void MapEditor::toggleScroll()
   4.128 +{
   4.129 +	BranchObj *bo=xelection.getBranch();
   4.130 +	if (xelection.type()==Branch )
   4.131 +	{
   4.132 +		if (bo->isScrolled())
   4.133 +			unscrollBranch ();
   4.134 +		else
   4.135 +			scrollBranch ();
   4.136  	}
   4.137  }
   4.138  
     5.1 --- a/mapeditor.h	Mon Feb 12 09:28:46 2007 +0000
     5.2 +++ b/mapeditor.h	Mon Feb 12 09:28:47 2007 +0000
     5.3 @@ -158,6 +158,8 @@
     5.4  	int getMapDefXLinkWidth();
     5.5  	void toggleMapLinkColorHint();			// after changing linkStyles
     5.6      void selectMapLinkColor();
     5.7 +	bool scrollBranch();
     5.8 +	bool unscrollBranch();
     5.9      void toggleScroll();
    5.10      void unScrollAll();
    5.11  	void loadFloatImage ();
     6.1 --- a/tex/vym.changelog	Mon Feb 12 09:28:46 2007 +0000
     6.2 +++ b/tex/vym.changelog	Mon Feb 12 09:28:47 2007 +0000
     6.3 @@ -1,9 +1,12 @@
     6.4  -------------------------------------------------------------------
     6.5 -Wed Jan 29 17:27:31 CET 2007 - uwedr
     6.6 +Wed Feb 07 17:27:31 CET 2007 - uwedr
     6.7  
     6.8  - Version: 1.8.66
     6.9  - Feature: Using a new class to select objects
    6.10  - Bugfix: Remember last directory before  ASCII/LaTeX export
    6.11 +- Bugfix: Editing in NoteEditor now updates actions (save) again
    6.12 +- Bugfix: Deleting last branch automatically unscrolls parent now
    6.13 +- Bugfix: Scroll/Unscroll has undo/redo now
    6.14  
    6.15  -------------------------------------------------------------------
    6.16  Fri Jan 19 22:53:27 CET 2007 - uwe
     7.1 --- a/texteditor.cpp	Mon Feb 12 09:28:46 2007 +0000
     7.2 +++ b/texteditor.cpp	Mon Feb 12 09:28:47 2007 +0000
     7.3 @@ -52,6 +52,7 @@
     7.4  	setupSettingsActions();
     7.5  	
     7.6  	// Various states
     7.7 +	blockChangedSignal=false;
     7.8  	setInactive();
     7.9  
    7.10  	// Load Settings
    7.11 @@ -523,15 +524,17 @@
    7.12  		else
    7.13  			setState (filledEditor);
    7.14  	// SLOT is LinkableMapObj, which will update systemFlag
    7.15 -	emit (textHasChanged() );
    7.16 +	if (!blockChangedSignal) emit (textHasChanged() );
    7.17  }
    7.18  
    7.19  
    7.20  void TextEditor::setText(QString t)
    7.21  {
    7.22 +	blockChangedSignal=true;
    7.23  	e->setReadOnly(false);
    7.24  	e->setText(t);
    7.25  	enableActions();
    7.26 +	blockChangedSignal=false;
    7.27  }
    7.28  
    7.29  void TextEditor::setInactive()
     8.1 --- a/texteditor.h	Mon Feb 12 09:28:46 2007 +0000
     8.2 +++ b/texteditor.h	Mon Feb 12 09:28:47 2007 +0000
     8.3 @@ -87,6 +87,7 @@
     8.4  	QBrush inactivePaper;	// depending on the state
     8.5  	EditorState state;
     8.6  	bool showwithmain;		// same visibility as mainwindow?
     8.7 +	bool blockChangedSignal;
     8.8  
     8.9  	QFont varFont;
    8.10  	QFont fixedFont;
     9.1 --- a/version.h	Mon Feb 12 09:28:46 2007 +0000
     9.2 +++ b/version.h	Mon Feb 12 09:28:47 2007 +0000
     9.3 @@ -5,7 +5,7 @@
     9.4  
     9.5  #define __VYM_NAME "VYM"
     9.6  #define __VYM_VERSION "1.8.66"
     9.7 -#define __VYM_BUILD_DATE "January 29, 2007"
     9.8 +#define __VYM_BUILD_DATE "February 07, 2007"
     9.9  
    9.10  
    9.11  bool checkVersion(const QString &);