diff -r 325958acb69b -r 494e8f40f0f7 mapeditor.cpp --- a/mapeditor.cpp Mon Oct 10 11:20:25 2005 +0000 +++ b/mapeditor.cpp Tue Jan 03 09:44:41 2006 +0000 @@ -27,15 +27,15 @@ #include "version.h" #include "api.h" +#include "editxlinkdialog.h" +#include "exports.h" +#include "extrainfodialog.h" +#include "linkablemapobj.h" +#include "mainwindow.h" +#include "misc.h" +#include "settings.h" +#include "texteditor.h" #include "xml.h" -#include "texteditor.h" -#include "linkablemapobj.h" -#include "exports.h" -#include "misc.h" -#include "mainwindow.h" -#include "extrainfodialog.h" -#include "editxlinkdialog.h" -#include "settings.h" extern TextEditor *textEditor; @@ -61,6 +61,7 @@ extern QAction *actionEditURL; extern QAction *actionEditHeading2URL; extern QAction *actionEditBugzilla2URL; +extern QAction *actionEditFATE2URL; extern QAction *actionEditOpenVymLink; extern QAction *actionEditVymLink; extern QAction *actionEditDeleteVymLink; @@ -96,6 +97,8 @@ extern QAction *actionFormatFrameRectangle; extern QActionGroup *actionGroupFormatLinkStyles; +extern QAction *actionFormatIncludeImagesVer; +extern QAction *actionFormatIncludeImagesHor; extern QAction *actionFormatHideLinkUnselected; extern QAction *actionFormatLinkStyleLine; extern QAction *actionFormatLinkStyleParabel; @@ -147,7 +150,7 @@ mapCenter->setVisibility (true); mapCenter->setMapEditor (this); mapCenter->setHeading (tr("New Map","Heading of mapcenter in new map")); - mapCenter->move(mapCanvas->width()/2-mapCenter->width()/2,mapCanvas->height()/2-mapCenter->width()/2); + mapCenter->move(mapCanvas->width()/2-mapCenter->width()/2,mapCanvas->height()/2-mapCenter->height()/2); printer=NULL; @@ -312,7 +315,6 @@ mapCanvas->resize (cw,ch); if ( (dx!=0) || (dy!=0) ) { - cout << "ME:: canvas="<moveAllBy(dx,dy); mapCenter->reposition(); @@ -1060,7 +1062,7 @@ void MapEditor::exportASCII() { // TODO still experimental - Export ex; + ExportBase ex; ex.setMapCenter(mapCenter); QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (ASCII)")); @@ -1082,7 +1084,7 @@ mb.setButtonText( QMessageBox::Yes, tr("Overwrite") ); mb.setButtonText( QMessageBox::No, tr("Cancel")); - Export ex; + ExportBase ex; switch( mb.exec() ) { case QMessageBox::Yes: @@ -1095,7 +1097,7 @@ } } ex.setPath (fd->selectedFile() ); - ex.exportMap(); + ex.exportXML(); } } @@ -1122,7 +1124,7 @@ mb.setButtonText( QMessageBox::Yes, tr("Overwrite") ); mb.setButtonText( QMessageBox::No, tr("Cancel")); - Export ex; + ExportLaTeX ex; switch( mb.exec() ) { case QMessageBox::Yes: @@ -1134,7 +1136,7 @@ break; } } - Export ex; + ExportLaTeX ex; ex.setPath (fd->selectedFile() ); ex.setMapCenter(mapCenter); ex.exportLaTeX(); @@ -1178,10 +1180,10 @@ } } */ - Export ex; + ExportOO ex; //ex.setPath (fd->selectedFile() ); ex.setMapCenter(mapCenter); - ex.exportOOPresentation(); + ex.exportPresentation(); // } } @@ -2357,6 +2359,19 @@ } } +void MapEditor::editFATE2URL() +{ + if (selection && (typeid(*selection) == typeid(BranchObj) || + typeid(*selection) == typeid(MapCenterObj)) ) + { + BranchObj *bo=(BranchObj*)selection; + QString url= "http://keeper.suse.de:8080/webfate/match/id?value=ID"+bo->getHeading(); + saveState("setURL (\""+bo->getURL()+"\")","setURL (\""+url+"\")"); + bo->setURL (url); + updateActions(); + } +} + void MapEditor::editVymLink() { if (selection && (typeid(*selection) == typeid(BranchObj) || @@ -2588,8 +2603,12 @@ default: break; } + actionFormatIncludeImagesVer->setOn + ( ((BranchObj*)selection)->getIncludeImagesVer()); + actionFormatIncludeImagesHor->setOn + ( ((BranchObj*)selection)->getIncludeImagesHor()); actionFormatHideLinkUnselected->setOn - ( selection->getHideLinkUnselected()); + (selection->getHideLinkUnselected()); } if ( (typeid(*selection) == typeid(FloatImageObj)) ) { @@ -2876,6 +2895,24 @@ } } +void MapEditor::setIncludeImagesVer(bool b) +{ + if (selection && + (typeid(*selection) == typeid(BranchObj)) || + (typeid(*selection) == typeid(MapCenterObj)) ) + ((BranchObj*)selection)->setIncludeImagesVer(b); + mapCenter->reposition(); +} + +void MapEditor::setIncludeImagesHor(bool b) +{ + if (selection && + (typeid(*selection) == typeid(BranchObj)) || + (typeid(*selection) == typeid(MapCenterObj)) ) + ((BranchObj*)selection)->setIncludeImagesHor(b); + mapCenter->reposition(); +} + void MapEditor::setHideLinkUnselected (bool b) { if (selection && @@ -3009,7 +3046,7 @@ void MapEditor::testFunction() { cout << "MapEditor::testFunction() called\n"; - load (clipboardDir+"/part.xml",ImportAdd); + mapCenter->move(mapCenter->x(),mapCenter->y()); } void MapEditor::ensureSelectionVisible() @@ -3234,11 +3271,6 @@ { FloatObj *fo=(FloatObj*)selection; saveState("move "+qpointToString(movingObj_orgPos),fo->getSelectString() ); - if (fo->getLinkStyle()==StyleUndef) - { - fo->setLinkStyle(fo->getDefLinkStyle()); - fo->setLinkColor(fo->getParObj()->getLinkColor()); - } fo->move (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() ); fo->setRelPos(); fo->reposition(); @@ -3264,11 +3296,7 @@ selection=(LinkableMapObj*)(fio); selection->select(); movingObj=(MapObj*)(fio); - // setLinkStyle calls updateLink, only set it once - if (fio->getLinkStyle()!=fio->getDefLinkStyle() ) - fio->setLinkStyle (fio->getDefLinkStyle()); } - // TODO if (typeid(*selection) == typeid(FloatTextObj)) } } else // selection != a FloatObj { @@ -3291,9 +3319,9 @@ if (lmosel->getOrientation() == OrientLeftOfCenter) // Add width of bbox here, otherwise alignRelTo will cause jumping around lmosel->move(p.x() -movingObj_start.x()+lmosel->getBBox().width(), - p.y()-movingObj_start.y() ); + p.y()-movingObj_start.y() +lmosel->getTopPad() ); else - lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() ); + lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() -lmosel->getTopPad()); } // reposition subbranch lmosel->reposition(); @@ -3316,7 +3344,7 @@ } else { lmosel->unsetParObjTmp(); - /* + /* FIXME not needed anymore? if (lmo &&(lmo==selection)) // Could link to myself (happens sometimes...) lmosel->unsetParObjTmp(); @@ -3403,6 +3431,13 @@ // Have we been moving something? if ( selection && movingObj ) { + // Moved FloatObj? Maybe we need to reposition + if(typeid(*selection)==typeid (FloatImageObj)) + { + selection->getParObj()->requestReposition(); + mapCenter->reposition(); + } + // Check if we are over another branch, but ignore // any found LMOs, which are FloatObjs dst=mapCenter->findMapObj(inverseWorldMatrix().map(e->pos() ),