# HG changeset patch
# User insilmaril
# Date 1163671631 0
# Node ID d42881c25fb69339047064abe6367f767f021fd5
# Parent 39aa64b24375b453c03e295712ffd5ece28fc444
Version 1.8.59: More fixes in undo/redo area
diff -r 39aa64b24375 -r d42881c25fb6 branchobj.cpp
--- a/branchobj.cpp Mon Oct 30 12:39:37 2006 +0000
+++ b/branchobj.cpp Thu Nov 16 10:07:11 2006 +0000
@@ -389,7 +389,7 @@
// BranchObj can use color of heading
if (mapEditor)
- if (mapEditor->getLinkColorHint()==HeadingColor)
+ if (mapEditor->getMapLinkColorHint()==HeadingColor)
LinkableMapObj::setLinkColor (heading->getColor() );
else
LinkableMapObj::setLinkColor ();
diff -r 39aa64b24375 -r d42881c25fb6 demos/todo.vym
Binary file demos/todo.vym has changed
diff -r 39aa64b24375 -r d42881c25fb6 icons/cursor.xcf
Binary file icons/cursor.xcf has changed
diff -r 39aa64b24375 -r d42881c25fb6 lang/vym_de.ts
--- a/lang/vym_de.ts Mon Oct 30 12:39:37 2006 +0000
+++ b/lang/vym_de.ts Thu Nov 16 10:07:11 2006 +0000
@@ -420,7 +420,7 @@
Current bar in history hwindow
- Aktuelle Zustand
+ Aktueller Zustand
diff -r 39aa64b24375 -r d42881c25fb6 linkablemapobj.cpp
--- a/linkablemapobj.cpp Mon Oct 30 12:39:37 2006 +0000
+++ b/linkablemapobj.cpp Thu Nov 16 10:07:11 2006 +0000
@@ -201,7 +201,7 @@
{
if (!mapEditor) return StyleUndef;
- LinkStyle ls=mapEditor->getLinkStyle();
+ LinkStyle ls=mapEditor->getMapLinkStyle();
switch (ls)
{
case StyleLine:
@@ -354,7 +354,7 @@
// Overloaded in BranchObj and childs
// here only set default color
if (mapEditor)
- setLinkColor (mapEditor->getDefLinkColor());
+ setLinkColor (mapEditor->getMapDefLinkColor());
}
void LinkableMapObj::setLinkColor(QColor col)
diff -r 39aa64b24375 -r d42881c25fb6 main.cpp
--- a/main.cpp Mon Oct 30 12:39:37 2006 +0000
+++ b/main.cpp Thu Nov 16 10:07:11 2006 +0000
@@ -1,10 +1,5 @@
#include
-//#include
-//#include
-//#include
-//#include
#include
-//#include
#include "settings.h"
#include "options.h"
diff -r 39aa64b24375 -r d42881c25fb6 mainwindow.cpp
--- a/mainwindow.cpp Mon Oct 30 12:39:37 2006 +0000
+++ b/mainwindow.cpp Thu Nov 16 10:07:11 2006 +0000
@@ -1447,8 +1447,6 @@
branchAddContextMenu->addAction ( actionEditAddBranchAbove);
branchAddContextMenu->addAction ( actionEditAddBranchBelow );
branchAddContextMenu->addSeparator();
- branchAddContextMenu->addAction ( actionEditLoadImage);
- branchAddContextMenu->addSeparator();
branchAddContextMenu->addAction ( actionEditImportAdd );
branchAddContextMenu->addAction ( actionEditImportReplace );
@@ -1465,11 +1463,12 @@
branchContextMenu->addSeparator();
branchContextMenu->addAction ( actionFormatFrameNone );
branchContextMenu->addAction ( actionFormatFrameRectangle);
+ branchContextMenu->addAction ( actionFormatHideLinkUnselected );
branchContextMenu->addSeparator();
+ branchContextMenu->addAction ( actionEditLoadImage);
branchContextMenu->addAction ( actionFormatIncludeImagesVer );
branchContextMenu->addAction ( actionFormatIncludeImagesHor );
- branchContextMenu->addAction ( actionFormatHideLinkUnselected );
// Submenu for Links (URLs, vymLinks)
branchLinksContextMenu =new QMenu (this);
@@ -3003,42 +3002,42 @@
void Main::formatLinkStyleLine()
{
if (currentMapEditor())
- currentMapEditor()->setLinkStyle(StyleLine);
+ currentMapEditor()->setMapLinkStyle("StyleLine");
}
void Main::formatLinkStyleParabel()
{
if (currentMapEditor())
- currentMapEditor()->setLinkStyle(StyleParabel);
+ currentMapEditor()->setMapLinkStyle("StyleParabel");
}
void Main::formatLinkStylePolyLine()
{
if (currentMapEditor())
- currentMapEditor()->setLinkStyle(StylePolyLine);
+ currentMapEditor()->setMapLinkStyle("StylePolyLine");
}
void Main::formatLinkStylePolyParabel()
{
if (currentMapEditor())
- currentMapEditor()->setLinkStyle(StylePolyParabel);
+ currentMapEditor()->setMapLinkStyle("StylePolyParabel");
}
void Main::formatSelectBackColor()
{
if (currentMapEditor())
- currentMapEditor()->selectBackgroundColor();
+ currentMapEditor()->selectMapBackgroundColor();
}
void Main::formatSelectLinkColor()
{
if (currentMapEditor())
- currentMapEditor()->selectLinkColor();
+ currentMapEditor()->selectMapLinkColor();
}
void Main::formatToggleLinkColorHint()
{
- currentMapEditor()->toggleLinkColorHint();
+ currentMapEditor()->toggleMapLinkColorHint();
}
void Main::formatFrameNone()
@@ -3173,12 +3172,12 @@
actionViewToggleNoteEditor->setOn (textEditor->showWithMain());
QAction *a;
- if (me->getLinkColorHint()==HeadingColor)
+ if (me->getMapLinkColorHint()==HeadingColor)
actionFormatLinkColorHint->setOn(true);
else
actionFormatLinkColorHint->setOn(false);
- switch (me->getLinkStyle())
+ switch (me->getMapLinkStyle())
{
case StyleLine:
actionFormatLinkStyleLine->setOn(true);
@@ -3197,9 +3196,9 @@
}
QPixmap pix( 16, 16 );
- pix.fill( me->getBackgroundColor() );
+ pix.fill( me->getMapBackgroundColor() );
actionFormatBackColor->setIconSet( pix );
- pix.fill( me->getDefLinkColor() );
+ pix.fill( me->getMapDefLinkColor() );
actionFormatLinkColor->setIconSet( pix );
actionFileSave->setEnabled( me->isUnsaved() );
@@ -3415,7 +3414,6 @@
{
if (!currentMapEditor()) return;
currentMapEditor()->testFunction();
-
}
void Main::testCommand()
diff -r 39aa64b24375 -r d42881c25fb6 mapeditor.cpp
--- a/mapeditor.cpp Mon Oct 30 12:39:37 2006 +0000
+++ b/mapeditor.cpp Thu Nov 16 10:07:11 2006 +0000
@@ -91,13 +91,18 @@
linkstyle=StylePolyParabel;
// Create bitmap cursors, platform dependant
- #if defined(Q_OS_MACX)
- handOpenCursor=QCursor ( QPixmap(iconPath+"cursorhandopen16.png"),1,1 );
- pickColorCursor=QCursor ( QPixmap (iconPath+"cursorcolorpicker16.png"), 1,15 );
- #else
- handOpenCursor=QCursor (QPixmap(iconPath+"cursorhandopen.png"),1,1);
- pickColorCursor=QCursor ( QPixmap(iconPath+"cursorcolorpicker.png"), 5,27 );
- #endif
+ // FIXME should now work also on Mac...
+ //#if defined(Q_OS_MACX)
+ // HandOpenCursor=QCursor ( QPixmap(iconPath+"cursorhandopen16.png"),1,1 );
+ // PickColorCursor=QCursor ( QPixmap (iconPath+"cursorcolorpicker16.png"), 1,15 );
+ //#else
+ HandOpenCursor=QCursor (QPixmap(iconPath+"cursorhandopen.png"),1,1);
+ PickColorCursor=QCursor ( QPixmap(iconPath+"cursorcolorpicker.png"), 5,27 );
+ CopyCursor=QCursor ( QPixmap(iconPath+"cursorcopy.png"), 5,5 );
+ XLinkCursor=QCursor ( QPixmap(iconPath+"cursorxlink.png"), 5,27 );
+ //#endif
+
+ setFocusPolicy (Qt::StrongFocus);
pickingColor=false;
drawingLink=false;
@@ -122,7 +127,7 @@
fileName=tr("unnamed");
mapName="";
- stepsTotal=settings.readNumEntry("/mapeditor/stepsTotal",50);
+ stepsTotal=settings.readNumEntry("/mapeditor/stepsTotal",100);
undoSet.setEntry ("/history/stepsTotal",QString::number(stepsTotal));
// Initialize find routine
@@ -162,11 +167,6 @@
//cout <<"Destructor MapEditor\n";
}
-QColor MapEditor::getBackgroundColor()
-{
- return mapCanvas->backgroundColor();
-}
-
MapCenterObj* MapEditor::getMapCenter()
{
return mapCenter;
@@ -304,7 +304,7 @@
colhint=attribut("linkColorHint","HeadingColor");
QString mapAttr=attribut("version",__VYM_VERSION);
- if (!saveSel)
+ if (!saveSel || saveSel==mapCenter)
mapAttr+= attribut("author",mapCenter->getAuthor()) +
attribut("comment",mapCenter->getComment()) +
attribut("date",mapCenter->getDate()) +
@@ -324,7 +324,7 @@
FloatImageObj (mapCanvas).resetSaveCounter();
// Build xml recursivly
- if (!saveSel)
+ if (!saveSel || typeid (*saveSel) == typeid (MapCenterObj))
// Save complete map, if saveSel not set
s+=mapCenter->saveToDir(tmpdir,prefix,writeflags,offset);
else
@@ -338,6 +338,7 @@
else if (selection && typeid(*selection)==typeid(BranchObj))
// Save selected branch is saved from mainwindow //FIXME maybe use "subtree" above?
+ // FIXME is this possible at all? BO is already above...
s+=((BranchObj*)selection)->saveToDir(tmpdir,prefix,offset);
}
@@ -356,16 +357,6 @@
return s;
}
-void MapEditor::saveStateComplete(const QString &comment)
-{
- // Save complete map, Undo will replace whole map
- saveState (CompleteMap,
- "", "",
- "", "",
- comment,
- mapCenter);
-}
-
void MapEditor::saveStateChangingPart(LinkableMapObj *undoSel, LinkableMapObj* redoSel, const QString &rc, const QString &comment)
{
// save the selected part of the map, Undo will replace part of map
@@ -382,7 +373,7 @@
saveState (PartOfMap,
- undoSelection, "",
+ undoSelection, "addMapReplace (\"PATH\")",
redoSelection, rc,
comment,
undoSel);
@@ -397,7 +388,7 @@
}
QString undoSelection=redoSel->getParObj()->getSelectString();
QString redoSelection=redoSel->getSelectString();
- if (typeid(*redoSel) == typeid(BranchObj) && redoSel->getDepth()>1 )
+ if (typeid(*redoSel) == typeid(BranchObj) )
{
// save the selected branch of the map, Undo will insert part of map
saveState (PartOfMap,
@@ -405,15 +396,6 @@
redoSelection, "delete ()",
comment,
redoSel);
- } else if (typeid(*redoSel) == typeid(BranchObj) )
- {
- // save the selected mainbranch of the map, Undo will insert part of map
- saveState (PartOfMap,
- undoSelection, QString("addMapInsert (\"PATH\",%1)").arg(((BranchObj*)redoSel)->getNum()),
- redoSelection, "delete ()",
- comment,
- redoSel);
-
}
}
@@ -467,7 +449,7 @@
curStep++;
if (curStep>stepsTotal) curStep=1;
- QString backupXML;
+ QString backupXML="";
QString bakMapName=QDir::convertSeparators (QString("history-%1").arg(curStep));
QString bakMapDir=QDir::convertSeparators (tmpMapDir +"/"+bakMapName);
QString bakMapPath=QDir::convertSeparators(bakMapDir+"/map.xml");
@@ -478,9 +460,7 @@
makeSubDirs (bakMapDir);
// Save depending on how much needs to be saved
- if (!saveSel)
- backupXML="";
- else
+ if (saveSel)
backupXML=saveToDir (bakMapDir,mapName+"-",false, QPoint (),saveSel);
QString undoCommand="";
@@ -492,10 +472,8 @@
{
undoCommand=undoCom;
undoCommand.replace ("PATH",bakMapPath);
- } else
- {
- undoCommand="undoMap (\""+bakMapPath+"\")";
}
+
if (!backupXML.isEmpty())
// Write XML Data to disk
saveStringToDisk (QString(bakMapPath),backupXML);
@@ -529,6 +507,7 @@
cout << " undoSel="<getSelectString(),t);
}
} else if (com==QString("addMapInsert"))
{
@@ -818,6 +797,62 @@
{
paste();
}
+ } else if (com=="select")
+ {
+ if (api.checkParamCount(1))
+ {
+ s=api.parString(ok,0);
+ if (ok) select (s);
+ }
+ } else if (com=="setMapAuthor")
+ {
+ if (api.checkParamCount(1))
+ {
+ s=api.parString(ok,0);
+ if (ok) setMapAuthor (s);
+ }
+ } else if (com=="setMapComment")
+ {
+ if (api.checkParamCount(1))
+ {
+ s=api.parString(ok,0);
+ if (ok) setMapComment(s);
+ }
+ } else if (com=="setMapBackgroundColor")
+ {
+ if (!selection)
+ {
+ api.setError (Aborted,"Nothing selected");
+ } else if ( (typeid(*selection) != typeid(BranchObj) &&
+ typeid(*selection) != typeid(MapCenterObj)) )
+ {
+ api.setError (Aborted,"Type of selection is not a branch");
+ } else if (api.checkParamCount(1))
+ {
+ QColor c=api.parColor (ok,0);
+ if (ok) setMapBackgroundColor (c);
+ }
+ } else if (com=="setMapDefLinkColor")
+ {
+ if (!selection)
+ {
+ api.setError (Aborted,"Nothing selected");
+ } else if ( (typeid(*selection) != typeid(BranchObj) &&
+ typeid(*selection) != typeid(MapCenterObj)) )
+ {
+ api.setError (Aborted,"Type of selection is not a branch");
+ } else if (api.checkParamCount(1))
+ {
+ QColor c=api.parColor (ok,0);
+ if (ok) setMapDefLinkColor (c);
+ }
+ } else if (com=="setMapLinkStyle")
+ {
+ if (api.checkParamCount(1))
+ {
+ s=api.parString (ok,0);
+ if (ok) setMapLinkStyle(s);
+ }
} else if (com=="setHeading")
{
if (!selection)
@@ -915,20 +950,7 @@
bo->updateFlagsToolbar();
}
}
- // Internal commands
- } else if (com==QString("undoMap"))
- {
- if (api.checkParamCount(1))
- addMapReplaceInt("",api.parString (ok,0));
- } else if (com=="select")
- {
- if (api.checkParamCount(1))
- {
- s=api.parString(ok,0);
- if (ok) select (s);
- }
- }
- else
+ } else
{
api.setError (Aborted,"Unknown command");
}
@@ -1126,9 +1148,6 @@
{
int returnCode=0;
- // The SaveMode UndoCommand is not supported here
- if (savemode==UndoCommand) return 1;
-
// Create mapName and fileDir
makeSubDirs (fileDir);
QString fname;
@@ -2454,18 +2473,29 @@
}
}
-void MapEditor::selectBackgroundColor()
+void MapEditor::selectMapBackgroundColor()
{
QColor col = QColorDialog::getColor( mapCanvas->backgroundColor(), this );
if ( !col.isValid() ) return;
setBackgroundColor( col );
- //TODO undocomm
- saveStateComplete(QString("Set background color of map to %1").arg(col.name()));
}
-void MapEditor::setBackgroundColor(QColor c)
+
+void MapEditor::setMapBackgroundColor(QColor col)
{
- mapCanvas->setBackgroundColor (c);
+ QColor oldcol=mapCanvas->backgroundColor();
+ saveState(
+ selection,
+ QString ("setMapBackgroundColor (%1)").arg(oldcol.name()),
+ selection,
+ QString ("setMapBackgroundColor (%1)").arg(col.name()),
+ QString("Set background color of map to %1").arg(col.name()));
+ mapCanvas->setBackgroundColor (col);
+}
+
+QColor MapEditor::getMapBackgroundColor()
+{
+ return mapCanvas->backgroundColor();
}
QColor MapEditor::getCurrentHeadingColor()
@@ -2492,12 +2522,13 @@
typeid(*selection) == typeid(MapCenterObj))
{
BranchObj *bo=(BranchObj*)selection;
- saveStateChangingPart(
+ saveState(
selection,
+ QString ("colorItem (%1)").arg(bo->getColor().name()),
selection,
QString ("colorItem (%1)").arg(c.name()),
QString("Set color of %1 to %2").arg(getName(bo)).arg(c.name())
- ); //TODO with complete API: undoCommand
+ );
bo->setColor(c); // color branch
}
}
@@ -2918,9 +2949,8 @@
// Finally show dialog
if (dia.exec() == QDialog::Accepted)
{
- saveStateComplete("Edit info about map"); //TODO undoCommand
- mapCenter->setAuthor (dia.getAuthor() );
- mapCenter->setComment (dia.getComment() );
+ setMapAuthor (dia.getAuthor() );
+ setMapComment (dia.getComment() );
}
}
@@ -2938,11 +2968,48 @@
((BranchObj*)selection)->updateNoteFlag();
}
-void MapEditor::setLinkStyle (LinkStyle ls)
+void MapEditor::setMapAuthor (const QString &s)
{
- linkstyle=ls;
-
- saveStateComplete("Set link style"); // TODO undoCommand
+ saveState (
+ selection,
+ QString ("setMapAuthor (\"%1\")").arg(mapCenter->getAuthor()),
+ selection,
+ QString ("setMapAuthor (\"%1\")").arg(s),
+ QString ("Set author of map to \"%1\"").arg(s)
+ );
+ mapCenter->setAuthor (s);
+}
+
+void MapEditor::setMapComment (const QString &s)
+{
+ saveState (
+ selection,
+ QString ("setMapComment (\"%1\")").arg(mapCenter->getComment()),
+ selection,
+ QString ("setMapComment (\"%1\")").arg(s),
+ QString ("Set comment of map")
+ );
+ mapCenter->setComment (s);
+}
+
+void MapEditor::setMapLinkStyle (const QString & s)
+{
+ saveStateChangingPart (
+ mapCenter,
+ mapCenter,
+ QString("setMapLinkStyle (\"%1\")").arg(s),
+ QString("Set map link style (\"%1\")").arg(s)
+ );
+
+ if (s=="StyleLine")
+ linkstyle=StyleLine;
+ else if (s=="StyleParabel")
+ linkstyle=StyleParabel;
+ else if (s=="StylePolyLine")
+ linkstyle=StylePolyLine;
+ else
+ linkstyle=StylePolyParabel;
+
BranchObj *bo;
bo=mapCenter->first();
bo=bo->next();
@@ -2954,20 +3021,20 @@
mapCenter->reposition();
}
-LinkStyle MapEditor::getLinkStyle ()
+LinkStyle MapEditor::getMapLinkStyle ()
{
return linkstyle;
}
-void MapEditor::setLinkColor(QColor c)
+void MapEditor::setMapDefLinkColor(QColor c)
{
defLinkColor=c;
updateActions();
}
-void MapEditor::setLinkColorHint()
+void MapEditor::setMapLinkColorHintInt()
{
- // called from setLinkColorHint(lch) or at end of parse
+ // called from setMapLinkColorHint(lch) or at end of parse
BranchObj *bo;
bo=mapCenter->first();
while (bo)
@@ -2977,13 +3044,13 @@
}
}
-void MapEditor::setLinkColorHint(LinkColorHint lch)
+void MapEditor::setMapLinkColorHint(LinkColorHint lch)
{
linkcolorhint=lch;
- setLinkColorHint();
+ setMapLinkColorHintInt();
}
-void MapEditor::toggleLinkColorHint()
+void MapEditor::toggleMapLinkColorHint()
{
if (linkcolorhint==HeadingColor)
linkcolorhint=DefaultColor;
@@ -2998,42 +3065,48 @@
}
}
-LinkColorHint MapEditor::getLinkColorHint()
+LinkColorHint MapEditor::getMapLinkColorHint()
{
return linkcolorhint;
}
-QColor MapEditor::getDefLinkColor()
+QColor MapEditor::getMapDefLinkColor()
{
return defLinkColor;
}
-void MapEditor::setDefXLinkColor(QColor col)
+void MapEditor::setMapDefXLinkColor(QColor col)
{
defXLinkColor=col;
}
-QColor MapEditor::getDefXLinkColor()
+QColor MapEditor::getMapDefXLinkColor()
{
return defXLinkColor;
}
-void MapEditor::setDefXLinkWidth (int w)
+void MapEditor::setMapDefXLinkWidth (int w)
{
defXLinkWidth=w;
}
-int MapEditor::getDefXLinkWidth()
+int MapEditor::getMapDefXLinkWidth()
{
return defXLinkWidth;
}
-void MapEditor::selectLinkColor()
+void MapEditor::selectMapLinkColor()
{
QColor col = QColorDialog::getColor( defLinkColor, this );
if ( !col.isValid() ) return;
- setLinkColor( col );
- saveStateComplete(QString("Set link color to %1").arg(col.name())); //TODO undoCommand
+ saveState (
+ selection,
+ QString("setMapDefLinkColor (\"%1\")").arg(getMapDefLinkColor().name()),
+ selection,
+ QString("setMapDefLinkColor (\"%1\")").arg(col.name()),
+ QString("Set link color to %1").arg(col.name())
+ );
+ setMapDefLinkColor( col );
}
@@ -3326,12 +3399,12 @@
{
if (dia.useSettingsGlobal() )
{
- setDefXLinkColor (xlo->getColor() );
- setDefXLinkWidth (xlo->getWidth() );
+ setMapDefXLinkColor (xlo->getColor() );
+ setMapDefXLinkWidth (xlo->getWidth() );
}
if (dia.deleteXLink())
((BranchObj*)selection)->deleteXLinkAt(i);
- saveStateComplete("Edit xLink"); //TODO undoCommand
+ //saveStateComplete("Edit xLink"); //FIXME undoCommand
}
}
}
@@ -3459,6 +3532,34 @@
e->accept();
}
+void MapEditor::keyPressEvent(QKeyEvent* e)
+{
+ if (e->modifiers() && Qt::ControlModifier)
+ {
+ switch (mainWindow->getModMode())
+ {
+ case ModModeColor:
+ setCursor (PickColorCursor);
+ break;
+ case ModModeCopy:
+ setCursor (CopyCursor);
+ break;
+ case ModModeXLink:
+ setCursor (XLinkCursor);
+ break;
+ default :
+ setCursor (Qt::ArrowCursor);
+ break;
+ }
+ }
+}
+
+void MapEditor::keyReleaseEvent(QKeyEvent* e)
+{
+ if (!(e->modifiers() && Qt::ControlModifier))
+ setCursor (Qt::ArrowCursor);
+}
+
void MapEditor::contentsMousePressEvent(QMouseEvent* e)
{
// Ignore right clicks, these will go to context menus
@@ -3510,7 +3611,7 @@
if (mainWindow->getModMode()==ModModeColor)
{
pickingColor=true;
- setCursor (pickColorCursor);
+ setCursor (PickColorCursor);
return;
}
if (mainWindow->getModMode()==ModModeXLink)
@@ -3582,7 +3683,7 @@
movingObj_start=e->globalPos();
movingCont_start=QPoint (contentsX(), contentsY() );
movingVec=QPoint(0,0);
- setCursor(handOpenCursor);
+ setCursor(HandOpenCursor);
}
}
}
@@ -3629,7 +3730,7 @@
if (typeid(*fo) == typeid(FloatImageObj))
{
//TODO undocom
- saveStateComplete(QString("Relink %1 to %2").arg(getName(fo)).arg(getName(lmo) ) );
+ //saveStateComplete(QString("Relink %1 to %2").arg(getName(fo)).arg(getName(lmo) ) );
FloatImageObj *fio=(FloatImageObj*)(fo);
((BranchObj*)(lmo))->addFloatImage (fio);
fio->unselect();
@@ -3756,7 +3857,7 @@
tmpXLink->setEnd ( ((BranchObj*)(dst)) );
tmpXLink->updateXLink();
tmpXLink->activate();
- saveStateComplete(QString("Activate xLink from %1 to %2").arg(getName(tmpXLink->getBegin())).arg(getName(tmpXLink->getEnd())) ); //TODO undoCommand
+ //saveStateComplete(QString("Activate xLink from %1 to %2").arg(getName(tmpXLink->getBegin())).arg(getName(tmpXLink->getEnd())) ); //FIXME undoCommand
} else
{
delete(tmpXLink);
@@ -4064,7 +4165,7 @@
if (update)
{
//FIXME saveState has to be called earlier for each of the drops...
- saveStateComplete("Drop Event"); //TODO undo Command
+ //saveStateComplete("Drop Event"); //TODO undo Command
mapCenter->reposition();
adjustCanvasSize();
canvas()->update();
diff -r 39aa64b24375 -r d42881c25fb6 mapeditor.h
--- a/mapeditor.h Mon Oct 30 12:39:37 2006 +0000
+++ b/mapeditor.h Thu Nov 16 10:07:11 2006 +0000
@@ -20,7 +20,6 @@
public:
MapEditor(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
~MapEditor();
- QColor getBackgroundColor();
MapCenterObj* getMapCenter();
Q3Canvas* getCanvas();
void adjustCanvasSize();// adjust canvas size to map and scrollview
@@ -30,7 +29,6 @@
QString getName(LinkableMapObj*); // Get e.g. heading or filename
void makeTmpDirs(); // create temporary directories
QString saveToDir(const QString&,const QString &,bool, const QPoint &,LinkableMapObj*);
- void saveStateComplete (const QString &);
void saveStateChangingPart (LinkableMapObj *, LinkableMapObj *, const QString &, const QString &);
void saveStateRemovingPart (LinkableMapObj *, const QString &);
void saveState(LinkableMapObj *, const QString &, LinkableMapObj *, const QString &, const QString &);
@@ -121,8 +119,9 @@
void selectRightBranch();
void selectFirstBranch();
void selectLastBranch();
- void selectBackgroundColor();
- void setBackgroundColor(QColor);
+ void selectMapBackgroundColor();
+ void setMapBackgroundColor(QColor);
+ QColor getMapBackgroundColor();
QColor getCurrentHeadingColor();
void colorItem(QColor);
void colorBranch(QColor);
@@ -148,19 +147,21 @@
void editMapInfo(); // dialog to enter author, ...
void updateActions(); // update e.g. format buttons
void updateNoteFlag(); // when TextEditor changes
- void setLinkStyle (LinkStyle); // Set style of link
- LinkStyle getLinkStyle (); // requested in LMO
- void setLinkColor(QColor); // default color of links
- void setLinkColorHint(); // color of links
- void setLinkColorHint(LinkColorHint); // color of links
- LinkColorHint getLinkColorHint();
- QColor getDefLinkColor();
- void setDefXLinkColor(QColor);
- QColor getDefXLinkColor();
- void setDefXLinkWidth (int);
- int getDefXLinkWidth();
- void toggleLinkColorHint(); // after changing linkStyles
- void selectLinkColor();
+ void setMapAuthor (const QString &);
+ void setMapComment(const QString &);
+ void setMapLinkStyle (const QString &); // Set style of link
+ LinkStyle getMapLinkStyle (); // requested in LMO
+ void setMapDefLinkColor(QColor); // default color of links
+ void setMapLinkColorHintInt(); // color of links
+ void setMapLinkColorHint(LinkColorHint);// color of links
+ LinkColorHint getMapLinkColorHint();
+ QColor getMapDefLinkColor();
+ void setMapDefXLinkColor(QColor);
+ QColor getMapDefXLinkColor();
+ void setMapDefXLinkWidth (int);
+ int getMapDefXLinkWidth();
+ void toggleMapLinkColorHint(); // after changing linkStyles
+ void selectMapLinkColor();
void toggleScroll();
void unScrollAll();
void loadFloatImage ();
@@ -183,6 +184,8 @@
void ensureSelectionVisible();
virtual void updateViewCenter(); // needed for zooming
virtual void contentsContextMenuEvent ( QContextMenuEvent *e );
+ virtual void keyPressEvent(QKeyEvent*);
+ virtual void keyReleaseEvent(QKeyEvent*);
virtual void contentsMousePressEvent(QMouseEvent*);
virtual void contentsMouseReleaseEvent(QMouseEvent*);
virtual void contentsMouseDoubleClickEvent(QMouseEvent*);
@@ -203,8 +206,10 @@
LinkColorHint linkcolorhint;// use heading color or own color
LinkStyle linkstyle; // default style for links
- QCursor handOpenCursor; // cursor while moving canvas view
- QCursor pickColorCursor; // cursor while picking color
+ QCursor HandOpenCursor; // cursor while moving canvas view
+ QCursor PickColorCursor; // cursor while picking color
+ QCursor CopyCursor; // cursor while picking color
+ QCursor XLinkCursor; // cursor while picking color
bool pickingColor;
bool drawingLink; // true while creating a link
bool copyingObj; // true while creating a link
diff -r 39aa64b24375 -r d42881c25fb6 ornamentedobj.cpp
--- a/ornamentedobj.cpp Mon Oct 30 12:39:37 2006 +0000
+++ b/ornamentedobj.cpp Thu Nov 16 10:07:11 2006 +0000
@@ -86,10 +86,10 @@
void OrnamentedObj::setLinkColor()
{
- if (mapEditor->getLinkColorHint()==HeadingColor)
+ if (mapEditor->getMapLinkColorHint()==HeadingColor)
LinkableMapObj::setLinkColor (heading->getColor());
else
- LinkableMapObj::setLinkColor (mapEditor->getDefLinkColor());
+ LinkableMapObj::setLinkColor (mapEditor->getMapDefLinkColor());
}
void OrnamentedObj::setColor (QColor col)
diff -r 39aa64b24375 -r d42881c25fb6 version.h
--- a/version.h Mon Oct 30 12:39:37 2006 +0000
+++ b/version.h Thu Nov 16 10:07:11 2006 +0000
@@ -4,8 +4,8 @@
#include
#define __VYM "VYM"
-#define __VYM_VERSION "1.8.58"
-#define __BUILD_DATE "October 25, 2006"
+#define __VYM_VERSION "1.8.59"
+#define __BUILD_DATE "November 14, 2006"
bool checkVersion(const QString &);
diff -r 39aa64b24375 -r d42881c25fb6 vym.pro
--- a/vym.pro Mon Oct 30 12:39:37 2006 +0000
+++ b/vym.pro Thu Nov 16 10:07:11 2006 +0000
@@ -100,6 +100,7 @@
QT += xml
TARGET = vym
+
TRANSLATIONS += lang/vym_de.ts
TRANSLATIONS += lang/vym_en.ts
TRANSLATIONS += lang/vym_es.ts
diff -r 39aa64b24375 -r d42881c25fb6 xml.cpp
--- a/xml.cpp Mon Oct 30 12:39:37 2006 +0000
+++ b/xml.cpp Thu Nov 16 10:07:11 2006 +0000
@@ -74,7 +74,8 @@
mc->setVersion(atts.value( "version" ));
}
- if (loadMode==NewMap)
+ if (loadMode==NewMap ||
+ (loadMode==ImportReplace && me->getSelection()==mc))
{
if (!atts.value( "author").isEmpty() )
{
@@ -92,37 +93,27 @@
if (!atts.value( "linkColorHint").isEmpty() )
{
if (atts.value("linkColorHint")=="HeadingColor")
- me->setLinkColorHint(HeadingColor);
+ me->setMapLinkColorHint(HeadingColor);
else
- me->setLinkColorHint(DefaultColor);
+ me->setMapLinkColorHint(DefaultColor);
}
if (!atts.value( "linkStyle").isEmpty() )
{
- QString s=atts.value("linkStyle");
- if (s=="StyleLine")
- me->setLinkStyle(StyleLine);
- else
- if (s=="StyleParabel")
- me->setLinkStyle(StyleParabel);
- else
- if (s=="StylePolyLine")
- me->setLinkStyle(StylePolyLine);
- else
- me->setLinkStyle(StylePolyParabel);
+ me->setMapLinkStyle(atts.value("linkStyle"));
}
if (!atts.value( "linkColor").isEmpty() )
{
col.setNamedColor(atts.value("linkColor"));
- me->setLinkColor(col);
+ me->setMapDefLinkColor(col);
}
if (!atts.value( "defXLinkColor").isEmpty() )
{
col.setNamedColor(atts.value("defXLinkColor"));
- me->setDefXLinkColor(col);
+ me->setMapDefXLinkColor(col);
}
if (!atts.value( "defXLinkWidth").isEmpty() )
{
- me->setDefXLinkWidth(atts.value("defXLinkWidth").toInt ());
+ me->setMapDefXLinkWidth(atts.value("defXLinkWidth").toInt ());
}
}
} else if ( eName == "select" && state == StateMap )