# HG changeset patch # User insilmaril # Date 1182179418 0 # Node ID 244e309b404775f281ed0ad9703dad10779715c3 # Parent 731728086341d999659f2207ab3ed09814f8fe19 1.8.73 - beta testing diff -r 731728086341 -r 244e309b4047 demos/liveform.vym Binary file demos/liveform.vym has changed diff -r 731728086341 -r 244e309b4047 demos/todo.vym Binary file demos/todo.vym has changed diff -r 731728086341 -r 244e309b4047 mainwindow.cpp --- a/mainwindow.cpp Thu Jun 14 10:21:46 2007 +0000 +++ b/mainwindow.cpp Mon Jun 18 15:10:18 2007 +0000 @@ -869,7 +869,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleLine() ) ); formatMenu->addAction (a); actionFormatLinkStyleLine=a; - a= new QAction( tr( "Linkstyle Parabel" ), actionGroupFormatLinkStyles); + a= new QAction( tr( "Linkstyle Curve" ), actionGroupFormatLinkStyles); a->setStatusTip (tr( "Line" )); a->setToggleAction(true); connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleParabel() ) ); @@ -881,7 +881,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyLine() ) ); formatMenu->addAction (a); actionFormatLinkStylePolyLine=a; - a= new QAction( tr( "Linkstyle Thick Parabel" ), actionGroupFormatLinkStyles); + a= new QAction( tr( "Linkstyle Thick Curve" ), actionGroupFormatLinkStyles); a->setStatusTip (tr( "PolyParabel" ) ); a->setToggleAction(true); a->setChecked (true); @@ -1434,7 +1434,7 @@ a= new QAction( tr( "Delete key","Settings action" ), this); a->setStatusTip( tr( "Delete key for deleting branches" )); a->setToggleAction(true); - a->setOn ( settings.value ("/mapeditor/editmode/useDelKey",false).toBool() ); + a->setOn ( settings.value ("/mapeditor/editmode/useDelKey",true).toBool() ); settingsMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleDelKey() ) ); actionSettingsUseDelKey=a; @@ -1483,6 +1483,11 @@ connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) ); helpMenu->addAction (a); + a = new QAction( tr( "Open VYM example maps ","Help action" ), this ); + a->setStatusTip( tr( "Open VYM example maps " )); + connect( a, SIGNAL( triggered() ), this, SLOT( helpDemo() ) ); + helpMenu->addAction (a); + a = new QAction( tr( "About VYM","Help action" ), this); a->setStatusTip( tr( "About VYM")+vymName); connect( a, SIGNAL( triggered() ), this, SLOT( helpAbout() ) ); @@ -1583,7 +1588,7 @@ actionFormatLinkColor->addTo( canvasContextMenu ); actionFormatSelectionColor->addTo( canvasContextMenu ); actionFormatBackColor->addTo( canvasContextMenu ); - actionFormatBackImage->addTo( canvasContextMenu ); + // actionFormatBackImage->addTo( canvasContextMenu ); //FIXME makes vym too slow: postponed for later version // Menu for last opened files // Create actions @@ -3730,6 +3735,34 @@ } +void Main::helpDemo() +{ + QStringList filters; + filters <<"VYM example map (*.vym)"; + QFileDialog *fd=new QFileDialog( this); + fd->setDir (QDir(vymBaseDir.path()+"/demos")); + fd->setFileMode (QFileDialog::ExistingFiles); + fd->setFilters (filters); + fd->setCaption(vymName+ " - " +tr("Load vym example map")); + fd->show(); + + QString fn; + if ( fd->exec() == QDialog::Accepted ) + { + lastFileDir=fd->directory().path(); + QStringList flist = fd->selectedFiles(); + QStringList::Iterator it = flist.begin(); + while( it != flist.end() ) + { + fn = *it; + fileLoad(*it, NewMap); + ++it; + } + } + delete (fd); +} + + void Main::helpAbout() { AboutDialog ad; diff -r 731728086341 -r 244e309b4047 mainwindow.h --- a/mainwindow.h Thu Jun 14 10:21:46 2007 +0000 +++ b/mainwindow.h Mon Jun 18 15:10:18 2007 +0000 @@ -204,6 +204,7 @@ void testCommand(); void helpDoc(); + void helpDemo(); void helpAbout(); void helpAboutQT(); diff -r 731728086341 -r 244e309b4047 mapeditor.cpp --- a/mapeditor.cpp Thu Jun 14 10:21:46 2007 +0000 +++ b/mapeditor.cpp Mon Jun 18 15:10:18 2007 +0000 @@ -310,6 +310,12 @@ return s; } +QString MapEditor::getHistoryDir() +{ + QString histName=QDir::convertSeparators (QString("history-%1").arg(curStep)); + return QDir::convertSeparators (tmpMapDir +"/"+histName); +} + void MapEditor::saveState(const SaveMode &savemode, const QString &undoSelection, const QString &undoCom, const QString &redoSelection, const QString &redoCom, const QString &comment, LinkableMapObj *saveSel) { // Main saveState @@ -324,18 +330,17 @@ if (curStep>stepsTotal) curStep=1; QString backupXML=""; - QString bakMapName=QDir::convertSeparators (QString("history-%1").arg(curStep)); - QString bakMapDir=QDir::convertSeparators (tmpMapDir +"/"+bakMapName); - QString bakMapPath=QDir::convertSeparators(bakMapDir+"/map.xml"); - - // Create bakMapDir if not available - QDir d(bakMapDir); + QString histDir=getHistoryDir(); + QString bakMapPath=QDir::convertSeparators(histDir+"/map.xml"); + + // Create histDir if not available + QDir d(histDir); if (!d.exists()) - makeSubDirs (bakMapDir); + makeSubDirs (histDir); // Save depending on how much needs to be saved if (saveSel) - backupXML=saveToDir (bakMapDir,mapName+"-",false, QPointF (),saveSel); + backupXML=saveToDir (histDir,mapName+"-",false, QPointF (),saveSel); QString undoCommand=""; if (savemode==UndoCommand) @@ -1699,7 +1704,7 @@ { // Copy to history QString s=sel->getSelectString(); - saveState (PartOfMap, s, "nop ()", s, "copy ()","Copy to clipboard",sel ); + saveState (PartOfMap, s, "nop ()", s, "copy ()","Copy selection to clipboard",sel ); curClipboard=curStep; } @@ -4451,10 +4456,9 @@ BranchObj *sel=xelection.getBranch(); if (sel) { - foreach (QString format,event->mimeData()->formats()) - { - cout << "Dropped format: "<mimeData()->formats()) + cout << "MapEditor: Dropped format: "< uris; @@ -4604,7 +4608,10 @@ { FloatImageObj *fio=bo->addFloatImage(); fio->load(img); - fio->setOriginalFilename("Image added by Drag and Drop"); // FIXME savestate missing + fio->setOriginalFilename("No original filename (image added by dropevent)"); + QString s=bo->getSelectString(); + saveState (PartOfMap, s, "nop ()", s, "copy ()","Copy dropped image to clipboard",fio ); + saveState (fio,"delete ()", bo,QString("paste(%1)").arg(curStep),"Pasting dropped image"); mapCenter->reposition(); scene()->update(); } diff -r 731728086341 -r 244e309b4047 mapeditor.h --- a/mapeditor.h Thu Jun 14 10:21:46 2007 +0000 +++ b/mapeditor.h Mon Jun 18 15:10:18 2007 +0000 @@ -55,6 +55,12 @@ */ QString saveToDir (const QString &tmpdir, const QString &prefix, bool writeflags, const QPointF &offset, LinkableMapObj *saveSel); + /*! \brief Get directory, where current step in history is save + + saveState creates a directory for each step in history. This function returns the + path of the current directory + */ + QString getHistoryDir(); /*! \brief Save the current changes in map diff -r 731728086341 -r 244e309b4047 version.h --- a/version.h Thu Jun 14 10:21:46 2007 +0000 +++ b/version.h Mon Jun 18 15:10:18 2007 +0000 @@ -4,10 +4,10 @@ #include #define __VYM_NAME "VYM" -#define __VYM_VERSION "1.8.72" -//#define __VYM_CODENAME "Codename: 1.9.0-beta-1" -#define __VYM_CODENAME "Codename: development version" -#define __VYM_BUILD_DATE "June 14, 2007" +#define __VYM_VERSION "1.8.73" +#define __VYM_CODENAME "Codename: 1.9.0-beta-1" +//#define __VYM_CODENAME "Codename: development version" +#define __VYM_BUILD_DATE "June 18, 2007" bool checkVersion(const QString &);