diff -r e7acede0377c -r 0e994bf2346b mapeditor.cpp --- a/mapeditor.cpp Wed Mar 15 13:53:53 2006 +0000 +++ b/mapeditor.cpp Wed Mar 15 13:53:53 2006 +0000 @@ -80,7 +80,6 @@ extern QAction *actionEditSelectFirst; extern QAction *actionEditSelectLast; extern QAction *actionEditLoadImage; -extern QAction *actionEditToggleFloatExport; extern QAction* actionFormatPickColor; extern QAction* actionFormatColorBranch; @@ -339,11 +338,6 @@ d.mkdir (tmpMapDir,true); } -void MapEditor::delTmpDirs() -{ - removeDir (QDir(tmpMapDir)); -} - QString MapEditor::saveToDir(const QString &tmpdir, const QString &prefix, bool writeflags, const QPoint &offset, LinkableMapObj *saveSelection) { // tmpdir temporary directory to which data will be written @@ -2297,16 +2291,37 @@ } } +void MapEditor::setHideExport() +{ + if (selection && (typeid(*selection) == typeid(BranchObj) || + typeid(*selection) == typeid(MapCenterObj)) || + (typeid(*selection)==typeid(FloatImageObj)) + ) + { + saveState(); //TODO undoCommand + OrnamentedObj *oo=(OrnamentedObj*)selection; + oo->setHideInExport(actionEditToggleHideExport->isOn()); + updateActions(); + mapCenter->reposition(); + adjustCanvasSize(); + canvas()->update(); + } +} + void MapEditor::toggleHideExport() { if (selection && (typeid(*selection) == typeid(BranchObj) || - typeid(*selection) == typeid(MapCenterObj)) //|| -// (typeid(*selection)==typeid(FloatImageObj)) + typeid(*selection) == typeid(MapCenterObj)) || + (typeid(*selection)==typeid(FloatImageObj)) ) { saveState(); //TODO undoCommand - BranchObj *bo=(BranchObj*)selection; - bo->setHideInExport(actionEditToggleHideExport->isOn()); + OrnamentedObj *oo=(OrnamentedObj*)selection; + if (oo->hideInExport()) + oo->setHideInExport(false); + else + oo->setHideInExport(true); + actionEditToggleHideExport->setOn (oo->hideInExport()); updateActions(); mapCenter->reposition(); adjustCanvasSize(); @@ -2468,6 +2483,12 @@ standardFlagsDefault->setEnabled (true); + actionEditToggleScroll->setEnabled (true); + if ( bo->isScrolled() ) + actionEditToggleScroll->setOn(true); + else + actionEditToggleScroll->setOn(false); + if ( bo->getURL().isEmpty() ) actionEditOpenURL->setEnabled (false); else @@ -2494,7 +2515,6 @@ for (a=actionListBranches.first();a;a=actionListBranches.next()) a->setEnabled(true); actionEditDelete->setEnabled (true); - actionEditToggleFloatExport->setEnabled (false); switch (selection->getFrameType()) { case NoFrame: @@ -2515,12 +2535,15 @@ } if ( (typeid(*selection) == typeid(FloatImageObj)) ) { + FloatObj *fo=(FloatImageObj*)selection; standardFlagsDefault->setEnabled (false); actionEditOpenURL->setEnabled (false); actionEditOpenVymLink->setEnabled (false); actionEditDeleteVymLink->setEnabled (false); - actionEditToggleHideExport->setEnabled (false); + actionEditToggleHideExport->setEnabled (true); + actionEditToggleHideExport->setOn (fo->hideInExport() ); + actionEditCopy->setEnabled (true); actionEditCut->setEnabled (true); @@ -2528,8 +2551,6 @@ for (a=actionListBranches.first();a;a=actionListBranches.next()) a->setEnabled(false); actionEditDelete->setEnabled (true); - actionEditToggleFloatExport->setOn - ( ((FloatImageObj*)selection)->getFloatExport() ); actionFormatHideLinkUnselected->setOn ( selection->getHideLinkUnselected()); } @@ -2544,12 +2565,12 @@ for (a=actionListBranches.first();a;a=actionListBranches.next()) a->setEnabled(false); + actionEditToggleScroll->setEnabled (true); actionEditOpenURL->setEnabled (false); actionEditOpenVymLink->setEnabled (false); actionEditDeleteVymLink->setEnabled (false); actionEditHeading2URL->setEnabled (false); actionEditDelete->setEnabled (false); - actionEditToggleFloatExport->setEnabled (false); } } @@ -2786,17 +2807,6 @@ } } -void MapEditor::toggleFloatExport() -{ - if (selection && - (typeid(*selection) == typeid(FloatImageObj))|| - (typeid(*selection) == typeid(FloatObj)) ) - { - FloatImageObj *fio=((FloatImageObj*)selection); - fio->setFloatExport (actionEditToggleFloatExport->isOn() ); - } -} - void MapEditor::setFrame(const FrameType &t) { if (selection && @@ -2960,6 +2970,7 @@ void MapEditor::testFunction() { cout << "MapEditor::testFunction() called\n"; + mapCenter->reposition(); adjustCanvasSize(); /* @@ -3106,18 +3117,16 @@ // Do not move, if systemFlag clicked if (foname=="url") openURL(); - else - if (foname=="vymLink") - { - mainWindow->editOpenVymLink(); - // tabWidget may change, better return now - // before segfaulting... - return; - } else - if (foname=="note") - mainWindow->windowToggleNoteEditor(); - else - if (foname=="hideInExport") toggleHideExport(); + else if (foname=="vymLink") + { + mainWindow->editOpenVymLink(); + // tabWidget may change, better return now + // before segfaulting... + return; + } else if (foname=="note") + mainWindow->windowToggleNoteEditor(); + else if (foname=="hideInExport") + toggleHideExport(); } }