diff -r 06ab6df252fa -r 5f6e176e9718 mapeditor.cpp --- a/mapeditor.cpp Tue Sep 05 13:48:17 2006 +0000 +++ b/mapeditor.cpp Wed Sep 06 12:47:06 2006 +0000 @@ -223,21 +223,15 @@ hidemode=HideNone; - isInteractive=interactive; - if (isInteractive) - // Create temporary files - makeTmpDirs(); + isInteractive=interactive; // FIXME still needed? + + // Create temporary files + makeTmpDirs(); // Initially set movingCentre updateViewCenter(); - // For testing purposes create history window - historyWindow = new ShowTextDialog (this); - historyWindow->setCaption (fileName); - mapCenter->reposition(); // for positioning heading - - } MapEditor::~MapEditor() @@ -352,10 +346,12 @@ s=(((BranchObj*)lmo)->getHeading()); if (s=="") s="unnamed"; - return QString("branch (%1)").arg(s); + return QString("branch (%1)").arg(s); + //return QString("branch (%1)").arg(s); } if ((typeid(*lmo) == typeid(FloatImageObj) )) - return QString ("floatimage [%1]").arg(((FloatImageObj*)lmo)->getOriginalFilename()); + return QString ("floatimage [%1]").arg(((FloatImageObj*)lmo)->getOriginalFilename()); + //return QString ("floatimage [%1]").arg(((FloatImageObj*)lmo)->getOriginalFilename()); return QString("Unknown type has no name!"); } @@ -365,7 +361,7 @@ tmpMapDir=QDir::convertSeparators (tmpVymDir+QString("/mapeditor-%1").arg(mapNum)); histPath=QDir::convertSeparators (tmpMapDir+"/history"); QDir d; - d.mkdir (tmpMapDir,true); + d.mkdir (tmpMapDir); } QString MapEditor::saveToDir(const QString &tmpdir, const QString &prefix, bool writeflags, const QPoint &offset, LinkableMapObj *saveSel) @@ -430,7 +426,7 @@ s+=((BranchObj*)(saveSel))->saveToDir(tmpdir,prefix,offset); else if ( typeid(*saveSel) == typeid(FloatImageObj) ) // Save image - s+=((FloatImageObj*)(saveSel))->saveToDir(tmpdir,prefix,offset); + s+=((FloatImageObj*)(saveSel))->saveToDir(tmpdir,prefix); else if (selection && typeid(*selection)==typeid(BranchObj)) // Save selected branch is saved from mainwindow //FIXME maybe use "subtree" above? @@ -545,7 +541,6 @@ /* TODO remove after testing */ cout << "ME::saveState() begin"<append (comment); setChanged(); @@ -609,6 +604,8 @@ cout << " redoCom="<isVisible()) - historyWindow->hide(); + if (historyWindow.isVisible()) + historyWindow.hide(); else - historyWindow->show(); + historyWindow.show(); } @@ -865,7 +862,7 @@ mapName=fileName.left(fileName.findRev(".",-1,true) ); // Adjust history window - historyWindow->setCaption (fileName); + historyWindow.setCaption (__VYM " - " +tr("History for ")+fileName); } } @@ -3040,12 +3037,14 @@ break;; case QMessageBox::Cancel: // do nothing + delete (fd); return; break; } } fio->save (fd->selectedFile(),imageIO.getType (fd->selectedFilter() ) ); } + delete (fd); } }