diff -r 30cd58b70d02 -r 16b250a57c17 mapeditor.cpp --- a/mapeditor.cpp Tue Jul 19 15:57:49 2005 +0000 +++ b/mapeditor.cpp Fri Jul 22 15:38:06 2005 +0000 @@ -592,6 +592,7 @@ void MapEditor::saveState(const SaveMode &savemode, LinkableMapObj *undoSel, const QString &undoCom) { + setChanged(); if (savemode==UndoCommand) { undoCommand=undoCom; @@ -832,7 +833,6 @@ // (map state is set later at end of load...) } else { - setChanged(); saveState(selection); } @@ -1029,7 +1029,7 @@ l->setPen (QPen(QColor(black), 1)); l->setZ (200); l->show(); - */ + */ if (printFooter) { @@ -1137,6 +1137,9 @@ void MapEditor::exportASCII() { // FIXME still experimental + Export ex; + ex.setMapCenter(mapCenter); + QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (ASCII)")); fd->addFilter ("TXT (*.txt)"); fd->setCaption("VYM - Export (ASCII) (still experimental)"); @@ -1162,21 +1165,14 @@ { case QMessageBox::Yes: // save - if (!ex.setOutputDir ("out")) - { - QMessageBox::critical (0,tr("Critical Export Error "),tr("Couldn't create directory ") + "out"); - return; - } break;; case QMessageBox::Cancel: - // do nothing + // return, do nothing return; break; } } - Export ex; ex.setPath (fd->selectedFile() ); - ex.setMapCenter(mapCenter); ex.exportMap(); } } @@ -1288,15 +1284,6 @@ // Finish open lineEdits if (lineedit) finishedLineEditNoSave(); - // Unselect - /*FIXME testing - if (selection) - { - selection->unselect(); - selection=NULL; - } - */ - parseAtom (undoCommand); mapCenter->reposition(); @@ -1414,7 +1401,6 @@ void MapEditor::paste() { - setChanged(); saveState(selection); pasteNoSave(); mapCenter->reposition(); @@ -1423,7 +1409,6 @@ void MapEditor::cut() { - setChanged(); saveState(selection->getParObj()); copy(); cutNoSave(); @@ -1448,7 +1433,6 @@ BranchObj* par; if (typeid(*selection) == typeid(BranchObj) ) { - setChanged(); saveState("moveBranchDown ()"); bo=(BranchObj*)(selection); par=(BranchObj*)(bo->getParObj()); @@ -1469,7 +1453,6 @@ BranchObj* par; if (typeid(*selection) == typeid(BranchObj) ) { - setChanged(); saveState("moveBranchUp ()"); bo=(BranchObj*)(selection); par=(BranchObj*)(bo->getParObj()); @@ -1490,7 +1473,6 @@ (typeid(*selection) == typeid(BranchObj) || typeid(*selection) == typeid(MapCenterObj) ) ) { - setChanged(); saveState("setHeading (\""+((BranchObj*)(selection))->getHeading()+"\")"); ensureSelectionVisible(); @@ -1532,7 +1514,6 @@ (typeid(*selection) == typeid(BranchObj) || typeid(*selection) == typeid(MapCenterObj) ) ) { - setChanged(); saveState(selection); BranchObj* bo1 = (BranchObj*) (selection); @@ -1598,7 +1579,6 @@ if (selection && (typeid(*selection) == typeid(BranchObj) ) ) { - setChanged(); saveState(selection); BranchObj* bo1 = (BranchObj*) (selection); @@ -1647,7 +1627,6 @@ if (selection && typeid(*selection) ==typeid(BranchObj) ) { - setChanged(); saveState(selection->getParObj()); BranchObj* bo=dynamic_cast (selection); BranchObj* par=(BranchObj*)(bo->getParObj()); @@ -1662,7 +1641,6 @@ } if (selection && typeid(*selection) ==typeid(FloatImageObj) ) { - setChanged(); saveState(selection->getParObj()); FloatImageObj* fio=dynamic_cast (selection); BranchObj* par=(BranchObj*)(fio->getParObj()); @@ -2104,7 +2082,7 @@ QColor col = QColorDialog::getColor( mapCanvas->backgroundColor(), this ); if ( !col.isValid() ) return; setBackgroundColor( col ); - setChanged(); + saveState(); } void MapEditor::setBackgroundColor(QColor c) @@ -2133,7 +2111,6 @@ if (typeid(*selection) == typeid(BranchObj) || typeid(*selection) == typeid(MapCenterObj)) { - setChanged(); saveState(selection); BranchObj *bo=(BranchObj*)(selection); bo->setColor(actColor, false); // color links, color childs @@ -2148,7 +2125,6 @@ if (typeid(*selection) == typeid(BranchObj) || typeid(*selection) == typeid(MapCenterObj)) { - setChanged(); saveState(selection); BranchObj *bo=(BranchObj*)(selection); bo->setColor(actColor, true); // color links, color childs @@ -2161,7 +2137,6 @@ { if (selection) { - setChanged(); saveState(selection); ((BranchObj*)(selection))->toggleStandardFlag (f,actionSettingsUseFlagGroups); } @@ -2280,7 +2255,7 @@ // user entered something and pressed OK ((BranchObj*)(selection))->setURL (text); updateActions(); - setChanged(); + saveState(); //FIXME undoCommand } } } @@ -2293,7 +2268,7 @@ BranchObj *b=(BranchObj*)(selection); b->setURL (b->getHeading()); updateActions(); - setChanged(); + saveState(); //FIXME undoCommand } } @@ -2305,7 +2280,7 @@ BranchObj *b=(BranchObj*)(selection); b->setURL ("https://bugzilla.novell.com/show_bug.cgi?id="+b->getHeading()); updateActions(); - setChanged(); + saveState(); //FIXME undoCommand } } @@ -2328,7 +2303,7 @@ mapCenter->reposition(); adjustCanvasSize(); canvas()->update(); - setChanged(); + saveState(); //FIXME undoCommand } } @@ -2342,7 +2317,7 @@ mapCenter->reposition(); adjustCanvasSize(); canvas()->update(); - setChanged(); + saveState(); //FIXME undoCommand } } @@ -2361,7 +2336,6 @@ { if (selection && (typeid(*selection) == typeid(BranchObj) )) { - setChanged(); saveState(selection->getParObj()); QString sel=selection->getSelectString(); BranchObj* bo=(BranchObj*)(selection); @@ -2377,7 +2351,6 @@ { if (selection && (typeid(*selection) == typeid(BranchObj) )) { - setChanged(); saveState(selection->getParObj()); ((BranchObj*)(selection))->removeChilds(); mapCenter->reposition(); @@ -2424,7 +2397,7 @@ { mapCenter->setAuthor (dia.getAuthor() ); mapCenter->setComment (dia.getComment() ); - setChanged(); + saveState(); //FIXME undoCommand } } @@ -2577,7 +2550,6 @@ { linkstyle=ls; - setChanged(); saveState(); BranchObj *bo; bo=mapCenter->first(); @@ -2672,7 +2644,8 @@ QColor col = QColorDialog::getColor( defLinkColor, this ); if ( !col.isValid() ) return; setLinkColor( col ); - setChanged(); + saveState(); //FIXME undoCommand + } void MapEditor::toggleScroll() @@ -2682,7 +2655,6 @@ BranchObj *bo=((BranchObj*)(selection)); if (bo->countBranches()==0) return; if (bo->getDepth()==0) return; - setChanged(); saveState(selection); bo->toggleScroll(); adjustCanvasSize(); @@ -2722,7 +2694,6 @@ QString fn; if ( fd->exec() == QDialog::Accepted ) { - setChanged(); saveState(selection); QString fn=fd->selectedFile(); lastImageDir=fn.left(fn.findRev ("/")); @@ -2929,7 +2900,7 @@ } if (dia.deleteXLink()) ((BranchObj*)(selection))->deleteXLinkAt(i); - setChanged(); + saveState(); //FIXME undoCommand } } } @@ -3163,7 +3134,6 @@ if (typeid(*selection) == typeid(FloatImageObj)) { - setChanged(); saveState("move "+qpointToString(movingObj_orgPos)); FloatObj *fo=(FloatObj*)(selection); if (fo->getLinkStyle()==StyleUndef) @@ -3185,6 +3155,7 @@ { if (typeid(*fo) == typeid(FloatImageObj)) { + saveState(); FloatImageObj *fio=(FloatImageObj*)(fo); ((BranchObj*)(lmo))->addFloatImage (fio); fio->unselect(); @@ -3215,7 +3186,6 @@ if (lmosel->getDepth()==1) { // depth==1, mainbranch - setChanged(); saveState("move "+qpointToString(movingObj_orgPos)); lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() ); } else @@ -3324,8 +3294,7 @@ tmpXLink->setEnd ( ((BranchObj*)(dst)) ); tmpXLink->updateXLink(); tmpXLink->activate(); - setChanged(); - + saveState(); //FIXME undoCommand } else { delete(tmpXLink); @@ -3362,7 +3331,6 @@ if (dst ) { BranchObj* bs=((BranchObj*)(selection)); - setChanged(); saveState ("linkBranchToPos (\""+ (bs->getParObj())->getSelectString()+ "\","+ @@ -3415,7 +3383,6 @@ if (selection) selection->unselect(); selection=lmo; selection->select(); - setChanged(); saveState(selection); editHeading(); } @@ -3588,7 +3555,7 @@ if (update) { - setChanged(); + saveState(); //FIXME undo Command mapCenter->reposition(); adjustCanvasSize(); canvas()->update(); @@ -3603,7 +3570,6 @@ (typeid(*selection) == typeid(MapCenterObj)) ) { BranchObj *bo=((BranchObj*)(selection)); - setChanged(); saveState(selection); //QString fn=fd->selectedFile(); //lastImageDir=fn.left(fn.findRev ("/"));