# HG changeset patch
# User insilmaril
# Date 1116401998 0
# Node ID dba9303a1a5cee3bd7910ebdbb3cb869f8034c7f
# Parent  1d092be4fe339c5d3337fe01600e7fda8685b71e
fixed some bugs in xlinks, more remove/insert functions
diff -r 1d092be4fe33 -r dba9303a1a5c demos/todo.vym
Binary file demos/todo.vym has changed
diff -r 1d092be4fe33 -r dba9303a1a5c exportxhtmldialog.ui
--- a/exportxhtmldialog.ui	Wed May 18 07:39:51 2005 +0000
+++ b/exportxhtmldialog.ui	Wed May 18 07:39:58 2005 +0000
@@ -8,8 +8,8 @@
         
             0
             0
-            582
-            599
+            614
+            757
         
     
     
@@ -27,7 +27,7 @@
         
         
             
-                layout33
+                layout17
             
             
                 
@@ -37,6 +37,14 @@
                     
                         textLabel1
                     
+                    
+                        
+                            1
+                            5
+                            0
+                            0
+                        
+                    
                     
                         Export to directory:
                     
@@ -45,11 +53,27 @@
                     
                         lineEditDir
                     
+                    
+                        
+                            7
+                            0
+                            0
+                            0
+                        
+                    
                 
                 
                     
                         browseExportDirButton
                     
+                    
+                        
+                            0
+                            0
+                            0
+                            0
+                        
+                    
                     
                         Browse
                     
@@ -148,83 +172,103 @@
             
             
                 
-                    layout7
+                    layout19
                 
                 
                     
-                        10
-                        30
-                        540
-                        84
+                        9
+                        24
+                        562
+                        31
                     
                 
-                
+                
                     
                         unnamed
                     
-                    
+                    
                         
-                            layout5
+                            textLabel1_2
                         
-                        
-                            
-                                unnamed
-                            
-                            
-                                
-                                    textLabel1_2
-                                
-                                
-                                    CSS:
-                                
-                            
-                            
-                                
-                                    lineEditCSS
-                                
-                            
-                            
-                                
-                                    browseCSSButton
-                                
-                                
-                                    Browse
-                                
-                            
-                        
+                        
+                            CSS:
+                        
+                        
+                            AlignVCenter|AlignRight
+                        
                     
-                    
+                    
                         
-                            layout6
+                            lineEditCSS
                         
-                        
-                            
-                                unnamed
-                            
-                            
-                                
-                                    textLabel2
-                                
-                                
-                                    XSL:
-                                
-                            
-                            
-                                
-                                    lineEditXSL
-                                
-                            
-                            
-                                
-                                    browseXSLButton
-                                
-                                
-                                    Browse
-                                
-                            
-                        
                     
-                
+                    
+                        
+                            browseCSSButton
+                        
+                        
+                            
+                                0
+                                0
+                                0
+                                0
+                            
+                        
+                        
+                            Browse
+                        
+                    
+                
+            
+            
+                
+                    layout20
+                
+                
+                    
+                        9
+                        64
+                        562
+                        31
+                    
+                
+                
+                    
+                        unnamed
+                    
+                    
+                        
+                            textLabel2
+                        
+                        
+                            XSL:
+                        
+                        
+                            AlignVCenter|AlignRight
+                        
+                    
+                    
+                        
+                            lineEditXSL
+                        
+                    
+                    
+                        
+                            browseXSLButton
+                        
+                        
+                            
+                                0
+                                0
+                                0
+                                0
+                            
+                        
+                        
+                            Browse
+                        
+                    
+                
             
         
         
@@ -234,96 +278,99 @@
             
                 Scripts
             
-            
+        
+        
+            
+                layout34
+            
+            
                 
-                    textLabel1_3
+                    unnamed
                 
-                
-                    
-                        12
-                        22
-                        110
-                        36
-                    
-                
-                
-                    Before export:
-                
-            
-            
-                
-                    lineEditPreScript
-                
-                
-                    
-                        128
-                        26
-                        322
-                        28
-                    
-                
-            
-            
-                
-                    browsePreExportButton
-                
-                
-                    
-                        456
-                        22
-                        94
-                        36
-                    
-                
-                
-                    Browse
-                
-            
-            
-                
-                    textLabel2_2
-                
-                
-                    
-                        11
-                        61
-                        99
-                        36
-                    
-                
-                
-                    After Export:
-                
-            
-            
-                
-                    lineEditPostScript
-                
-                
-                    
-                        116
-                        65
-                        333
-                        28
-                    
-                
-            
-            
-                
-                    browsePostExportButton
-                
-                
-                    
-                        455
-                        61
-                        94
-                        36
-                    
-                
-                
-                    Browse
-                
-            
+                
+                    
+                        textLabel2_2
+                    
+                    
+                        
+                            1
+                            5
+                            0
+                            0
+                        
+                    
+                    
+                        NoFrame
+                    
+                    
+                        After Export:
+                    
+                    
+                        AlignVCenter|AlignRight
+                    
+                
+                
+                    
+                        browsePostExportButton
+                    
+                    
+                        
+                            0
+                            0
+                            0
+                            0
+                        
+                    
+                    
+                        Browse
+                    
+                
+                
+                    
+                        lineEditPostScript
+                    
+                
+                
+                    
+                        browsePreExportButton
+                    
+                    
+                        
+                            0
+                            0
+                            0
+                            0
+                        
+                    
+                    
+                        Browse
+                    
+                
+                
+                    
+                        lineEditPreScript
+                    
+                
+                
+                    
+                        textLabel1_3
+                    
+                    
+                        
+                            1
+                            5
+                            0
+                            0
+                        
+                    
+                    
+                        Before export:
+                    
+                    
+                        AlignVCenter|AlignRight
+                    
+                
+            
         
         
             
@@ -338,7 +385,7 @@
             
                 
                     20
-                    31
+                    90
                 
             
         
@@ -458,18 +505,24 @@
         xslChanged()
     
     
+        warningsButton
+        toggled(bool)
+        ExportXHTMLDialog
+        warningsButtonPressed(bool)
+    
+    
+        saveSettingsInMapButton
+        toggled(bool)
+        ExportXHTMLDialog
+        saveSettingsInMapButtonPressed(bool)
+    
+    
         browsePreExportButton
         pressed()
         ExportXHTMLDialog
         browsePreExportButtonPressed()
     
     
-        browsePostExportButton
-        pressed()
-        ExportXHTMLDialog
-        browsePostExportButtonPressed()
-    
-    
         lineEditPreScript
         textChanged(const QString&)
         ExportXHTMLDialog
@@ -482,16 +535,10 @@
         postscriptChanged()
     
     
-        warningsButton
-        toggled(bool)
+        browsePostExportButton
+        pressed()
         ExportXHTMLDialog
-        warningsButtonPressed(bool)
-    
-    
-        saveSettingsInMapButton
-        toggled(bool)
-        ExportXHTMLDialog
-        saveSettingsInMapButtonPressed(bool)
+        browsePostExportButtonPressed()
     
 
 
diff -r 1d092be4fe33 -r dba9303a1a5c mainwindow.cpp
--- a/mainwindow.cpp	Wed May 18 07:39:51 2005 +0000
+++ b/mainwindow.cpp	Wed May 18 07:39:58 2005 +0000
@@ -372,6 +372,7 @@
     menuBar()->insertItem( tr( "&Edit" ), menu );
 
     QAction *a;
+	QAction *alt;
     a = new QAction( tr( "Undo" ), QPixmap( editundo_xpm ), tr( "&Undo" ), CTRL + Key_Z, this, "editUndo" );
     connect( a, SIGNAL( activated() ), this, SLOT( editUndo() ) );
 	a->setEnabled (false);
@@ -421,13 +422,19 @@
 	actionEditMoveDown=a;
 	
 
-    a = new QAction( tr( "Scroll branch" ), QPixmap(flag_scrolled_right_xpm), tr( "Scroll branch" ), Key_ScrollLock, this, "scroll" );
+	a = new QAction( tr( "Scroll branch" ), QPixmap(flag_scrolled_right_xpm), tr( "Scroll branch" ), Key_ScrollLock, this, "scroll" );
     connect( a, SIGNAL( activated() ), this, SLOT( editToggleScroll() ) );
-	a->setEnabled (false);
-    a->addTo( tb );
-    a->addTo( menu );
-	actionListBranches.append(a);
-	actionEditToggleScroll=a;
+	alt = new QAction( tr( "Scroll branch" ), QPixmap(flag_scrolled_right_xpm), tr( "Scroll branch" ), Key_S, this, "scroll" );
+    connect( alt, SIGNAL( activated() ), this, SLOT( editToggleScroll() ) );
+	#if defined(Q_OS_MACX)
+		actionEditToggleScroll=alt;
+	#else	
+		actionEditToggleScroll=a;
+	#endif	
+	actionEditToggleScroll->setEnabled (false);
+    actionEditToggleScroll->addTo( tb );
+    actionEditToggleScroll->addTo( menu );
+	actionListBranches.append(actionEditToggleScroll);
 	
     a = new QAction( tr( "Unscroll all" ), QPixmap(), tr( "Unscroll all scrolled branches" ), 0, this, "scroll" );
     connect( a, SIGNAL( activated() ), this, SLOT( editUnScrollAll() ) );
@@ -503,16 +510,18 @@
     // Shortcuts to modify heading:
     a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_Enter, this, "editHeading" );
     connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
-	a->setEnabled (false);
-    a->addTo ( menu );
 	actionListBranches.append(a);
-	actionEditHeading=a;
     a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_Return, this, "editHeading" );
     connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
 	actionListBranches.append(a);
 	actionEditHeading=a;
     a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_F2, this, "editHeading" );
     connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
+    a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_E, this, "editHeading" );
+    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
+	a->setEnabled (false);
+    a->addTo ( menu );
+	actionEditHeading=a;
 	actionListBranches.append(a);
     
     // Shortcut to delete selection
@@ -523,15 +532,17 @@
 	actionEditDelete=a;
     
     // Shortcut to add branch
-	#if defined (Q_OS_MACX)
-		a = new QAction( tr( "Add a branch as child of selection" ),tr( "Add branch as child" ), CTRL + Key_I, this, "newBranch" );
-	#else
+	alt = new QAction( tr( "Add a branch as child of selection" ),tr( "Add branch as child" ), Key_A, this, "newBranch" );
+    connect( alt, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
 		a = new QAction( tr( "Add a branch as child of selection" ),tr( "Add branch as child" ), Key_Insert, this, "newBranch" );
-	#endif
     connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
 	a->setEnabled (false);
 	actionListBranches.append(a);
-	actionEditAddBranch=a;
+	#if defined (Q_OS_MACX)
+		actionEditAddBranch=alt;
+	#else	
+		actionEditAddBranch=a;
+	#endif	
 
     // Add branch by inserting it at selection
 	a = new QAction( tr( "Add a branch by inserting and making selection its child" ),tr( "Add branch (insert)" ), ALT + Key_Insert, this, "newBranchHere" );
diff -r 1d092be4fe33 -r dba9303a1a5c mapeditor.cpp
--- a/mapeditor.cpp	Wed May 18 07:39:51 2005 +0000
+++ b/mapeditor.cpp	Wed May 18 07:39:58 2005 +0000
@@ -322,6 +322,9 @@
     selectionLast=NULL;
     movingObj=NULL;
 
+	defXLinkWidth=1;
+	defXLinkColor=QColor (230,230,230);
+
     mapChanged=false;
 	mapDefault=true;
 	mapUnsaved=false;
@@ -512,8 +515,8 @@
 		          attribut("backgroundColor", mapCanvas->backgroundColor().name() ) +
 		          attribut("linkStyle", ls ) +
 		          attribut("linkColor", defLinkColor.name() ) +
-		          attribut("xlinkColor", defXLinkColor.name() ) +
-		          attribut("xlinkWidth", QString().setNum(defXLinkWidth,10) ) +
+		          attribut("defXLinkColor", defXLinkColor.name() ) +
+		          attribut("defXLinkWidth", QString().setNum(defXLinkWidth,10) ) +
 		          colhint; 
 	s+=beginElement("vymmap",mapAttr);
 	incIndent();
@@ -864,7 +867,7 @@
 		double paperAspect = (double)metrics.width()   / (double)metrics.height();
 		double   mapAspect = (double)totalBBox.width() / (double)totalBBox.height();
 
-		QRect mapRect=mapCenter->getTotalBBox();
+		QRect mapRect=totalBBox;
 		QCanvasRectangle *frame=NULL;
 		QCanvasText *footerFN=NULL;
 		QCanvasText *footerDate=NULL;
@@ -874,14 +877,22 @@
 			if (printFrame) 
 			{
 				// Print frame around map
-				mapRect.setRect (mapRect.x()-10, mapRect.y()-10, 
-					mapRect.width()+20, mapRect.height()+20);
+				mapRect.setRect (totalBBox.x()-10, totalBBox.y()-10, 
+					totalBBox.width()+20, totalBBox.height()+20);
 				frame=new QCanvasRectangle (mapRect,mapCanvas);
 				frame->setBrush (QColor(white));
 				frame->setPen (QColor(black));
 				frame->setZ(0);
 				frame->show();    
 			}		
+			/* FIXME testing
+			QCanvasLine *l=new QCanvasLine (mapCanvas);
+			l->setPoints (0,0,mapRect.width(),mapRect.height());
+			l->setPen (QPen(QColor(black), 1));
+			l->setZ (200);
+			l->show();
+	*/
+
 			if (printFooter) 
 			{
 				// Print footer below map
@@ -899,10 +910,8 @@
 				footerDate->move (mapRect.x()+mapRect.width()-footerDate->boundingRect().width(), mapRect.y() + mapRect.height() );
 				footerDate->setZ(Z_TEXT);
 				footerDate->show();    
-				mapRect.setRect (mapRect.x(), mapRect.y(), 
-					mapRect.width(), mapRect.height()+20);
 			}
-			pp.setWindow (mapRect.x(), mapRect.y(), mapRect.width(), mapRect.height());
+			pp.setWindow (mapRect.x(), mapRect.y(), mapRect.width(), mapRect.height()+20);
 		}	else	
 		{
 			pp.setWindow (mapRect);
@@ -2395,6 +2404,8 @@
 {
 	linkstyle=ls;
 
+	setChanged();
+	saveState();
 	BranchObj *bo;
 	bo=mapCenter->first();
 	bo=bo->next();
@@ -2403,8 +2414,7 @@
 		bo->setLinkStyle(bo->getDefLinkStyle());
 		bo=bo->next();
 	}
-	//setChanged();
-	//saveState();
+	mapCenter->reposition();
 }
 
 LinkStyle MapEditor::getLinkStyle ()
@@ -2732,6 +2742,7 @@
 		{
 			EditXLinkDialog dia;
 			dia.setXLink (xlo);
+			dia.setSelection(selection);
 			if (dia.exec() == QDialog::Accepted)
 			{
 				if (dia.useSettingsGlobal() )
diff -r 1d092be4fe33 -r dba9303a1a5c tex/vym.tex
--- a/tex/vym.tex	Wed May 18 07:39:51 2005 +0000
+++ b/tex/vym.tex	Wed May 18 07:39:58 2005 +0000
@@ -718,6 +718,9 @@
         & -	&	insert branch and make selection its child& \\
         & -	&	restructured branch context menu	& \\
 				in a basic version (straight line)	& 2005-04-15\\
+        & -	&	Bugfix: Changing linkstyle now automatically redraws all
+				links again& \\
+        & -	&	New shortcuts (F1-F3) for use on Mac OS X& \\
 1.6.4	& -	&	xLinks (arbitrary connection between 2 branches) works
 				in a basic version (straight line)	& 2005-04-15\\
 1.6.3	& -	&	Bugfix: Saving of selection to a vym part (.vyp)	&2005-03-30\\
diff -r 1d092be4fe33 -r dba9303a1a5c version.h
--- a/version.h	Wed May 18 07:39:51 2005 +0000
+++ b/version.h	Wed May 18 07:39:58 2005 +0000
@@ -2,6 +2,6 @@
 #define VERSION_H
 
 #define __VYM_VERSION__ "1.6.5"
-#define __BUILD_DATE__ "May 4, 2005"
+#define __BUILD_DATE__ "May 17, 2005"
 
 #endif
diff -r 1d092be4fe33 -r dba9303a1a5c vym.pro
--- a/vym.pro	Wed May 18 07:39:51 2005 +0000
+++ b/vym.pro	Wed May 18 07:39:58 2005 +0000
@@ -1,74 +1,8 @@
-
-
-
-
-
-TARGET  = vym
-TRANSLATIONS += lang/vym_de.ts
-TRANSLATIONS += lang/vym_en.ts
-
-
-
-DESTROOT = /usr
-
-target.path = $${DESTROOT}/bin
-INSTALLS += target
-
-support.files = styles/ scripts/ icons/ lang/
-support.path = $${DESTROOT}/share/vym
-INSTALLS += support 
-
-doc.files = doc/*
-doc.path = $${DESTROOT}/share/doc/packages/vym
-INSTALLS += doc
-
-demo.files = demos/
-demo.path = $${DESTROOT}/share/vym
-INSTALLS += demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 TEMPLATE	= app
 LANGUAGE	= C++
 
 CONFIG	+= qt warn_on release
 
-
 HEADERS	+= branchobj.h \
 	exports.h \
 	findwindow.h \
@@ -95,6 +29,7 @@
 	xml.h \
 	settings.h \
 	options.h
+
 SOURCES	+= branchobj.cpp \
 	exports.cpp \
 	findwindow.cpp \
@@ -121,9 +56,74 @@
 	xml.cpp \
 	settings.cpp \
 	options.cpp
+
 FORMS	= exporthtmldialog.ui \
 	exportxhtmldialog.ui \
 	showtextdialog.ui \
 	extrainfodialog.ui \
 	editxlinkdialog.ui
 
+TARGET  = vym
+TRANSLATIONS += lang/vym_de.ts
+TRANSLATIONS += lang/vym_en.ts
+
+
+
+DESTROOT = /usr
+
+target.path = $${DESTROOT}/bin
+INSTALLS += target
+
+support.files = styles/ scripts/ icons/ lang/
+support.path = $${DESTROOT}/share/vym
+INSTALLS += support 
+
+doc.files = doc/*
+doc.path = $${DESTROOT}/share/doc/packages/vym
+INSTALLS += doc
+
+demo.files = demos/
+demo.path = $${DESTROOT}/share/vym
+INSTALLS += demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 1d092be4fe33 -r dba9303a1a5c xlinkobj.cpp
--- a/xlinkobj.cpp	Wed May 18 07:39:51 2005 +0000
+++ b/xlinkobj.cpp	Wed May 18 07:39:58 2005 +0000
@@ -38,11 +38,10 @@
 	visBranch=NULL;
 	xLinkState=undefinedXLink;
 
-	width=1;
 	color=QColor (180,180,180);
 	line=new QCanvasLine (canvas);
-	line->setPoints (0,0,200,200);
-	line->setPen (QPen(color, 1));
+	width=1;
+	line->setPen (QPen(color, width));
 	line->setZ (Z_XLINK);
 
 	poly=new QCanvasPolygon (canvas);
@@ -55,7 +54,6 @@
 void XLinkObj::copy (XLinkObj* other)
 {
 	// FIXME copy not used yet
-	cout << "LO::copy called\n";
 	MapObj::copy (other);
 	setVisibility (other->visible);
 	beginBranch=other->beginBranch;
@@ -198,6 +196,7 @@
 	{
 		beginPos=a;
 		endPos=b;
+		line->setPen (QPen(color, width));
 		line->setPoints (a.x(), a.y(), b.x(), b.y());
 	}
 }