diff -r 174dd40bf06a -r 790e3eff9980 mainwindow.cpp --- a/mainwindow.cpp Wed Mar 15 15:54:32 2006 +0000 +++ b/mainwindow.cpp Mon Mar 27 20:21:57 2006 +0000 @@ -160,6 +160,7 @@ extern QAction* actionSettingsPasteNewHeading; extern QAction* actionSettingsUseDelKey; extern QAction* actionSettingsUseFlagGroups; +extern QAction* actionSettingsUseHideExport; extern QPopupMenu* branchContextMenu; extern QPopupMenu* branchAddContextMenu; @@ -298,6 +299,7 @@ settings.writeEntry( "/vym/mapeditor/editmode/autoedit",actionSettingsAutoedit->isOn() ); settings.writeEntry( "/vym/mapeditor/editmode/useDelKey",actionSettingsUseDelKey->isOn() ); settings.writeEntry( "/vym/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() ); + settings.writeEntry( "/vym/export/useHideExport",actionSettingsUseHideExport->isOn() ); QString s; int maps=lastMaps.count(); @@ -1057,6 +1059,12 @@ a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useFlagGroups",true) ); a->addTo( menu ); actionSettingsUseFlagGroups=a; + + a= new QAction( tr( "Use hide flag during exports " ), QPixmap(), tr( "Use hide flags" ), 0, this, "hideexport" ); + a->setToggleAction(true); + a->setOn ( settings.readBoolEntry ("/vym/export/useHideExport",true) ); + a->addTo( menu ); + actionSettingsUseHideExport=a; } // Test Actions @@ -1863,7 +1871,8 @@ void Main::fileExportHTML() { - if (currentMapEditor()) + MapEditor *me=currentMapEditor(); + if (me) { ExportHTMLDialog dia(this); @@ -1872,8 +1881,10 @@ QString dir=dia.getDir(); if (reallyWriteDirectory(dir) ) { - currentMapEditor()->exportXML (dia.getDir() ); - dia.doExport(currentMapEditor()->getMapName() ); + me->setExportMode (true); + me->exportXML (dia.getDir() ); + dia.doExport(me->getMapName() ); + me->setExportMode (false); } } } @@ -1881,12 +1892,13 @@ void Main::fileExportXHTML() { + MapEditor *me=currentMapEditor(); QString dir; - if (currentMapEditor()) + if (me) { ExportXHTMLDialog dia(this); - dia.setFilePath (currentMapEditor()->getFilePath() ); - dia.setMapName (currentMapEditor()->getMapName() ); + dia.setFilePath (me->getFilePath() ); + dia.setMapName (me->getMapName() ); dia.readSettings(); if (dia.exec()==QDialog::Accepted) @@ -1902,10 +1914,10 @@ if (ok) { - currentMapEditor()->exportXML (dia.getDir() ); - dia.doExport(currentMapEditor()->getMapName() ); + me->exportXML (dia.getDir() ); + dia.doExport(me->getMapName() ); if (dia.hasChanged()) - currentMapEditor()->setChanged(); + me->setChanged(); } } } @@ -1913,12 +1925,13 @@ void Main::fileExportImage(int item) { - if (currentMapEditor()) + MapEditor *me=currentMapEditor(); + if (me) { QString fn = QFileDialog::getSaveFileName( QString::null, "Image (*.bmp *.jpg *.pbm *.pgm *.png *.ppm *xbm *.xpm)", this ); if ( !fn.isEmpty() ) - currentMapEditor()->exportImage(fn,item); + me->exportImage(fn,item); else statusBar()->message( tr("Couldn't save %1").arg(fn), statusbarTime ); @@ -1927,34 +1940,47 @@ void Main::fileExportASCII() { - if (currentMapEditor()) + MapEditor *me=currentMapEditor(); + if (me) { ExportASCII ex; - ex.setMapCenter(currentMapEditor()->getMapCenter()); + ex.setMapCenter(me->getMapCenter()); ex.addFilter ("TXT (*.txt)"); ex.setCaption(__VYM " -" +tr("Export as ASCII")+" "+tr("(still experimental)")); - if (ex.execDialog() ) ex.doExport(); + if (ex.execDialog() ) + { + me->setExportMode(true); + ex.doExport(); + me->setExportMode(false); + } } } void Main::fileExportLaTeX() { - if (currentMapEditor()) + MapEditor *me=currentMapEditor(); + if (me) { ExportLaTeX ex; - ex.setMapCenter(currentMapEditor()->getMapCenter()); + ex.setMapCenter(me->getMapCenter()); ex.addFilter ("Tex (*.tex)"); ex.setCaption(__VYM " -" +tr("Export as LaTeX")+" "+tr("(still experimental)")); - if (ex.execDialog() ) ex.doExport(); + if (ex.execDialog() ) + { + me->setExportMode(true); + ex.doExport(); + me->setExportMode(false); + } } } void Main::fileExportKDEBookmarks() { ExportKDEBookmarks ex; - if (currentMapEditor()) + MapEditor *me=currentMapEditor(); + if (me) { - ex.setMapCenter (currentMapEditor()->getMapCenter() ); + ex.setMapCenter (me->getMapCenter() ); ex.doExport(); } } @@ -1962,12 +1988,18 @@ void Main::fileExportTaskjuggler() { ExportTaskjuggler ex; - if (currentMapEditor()) + MapEditor *me=currentMapEditor(); + if (me) { - ex.setMapCenter (currentMapEditor()->getMapCenter() ); + ex.setMapCenter (me->getMapCenter() ); ex.setCaption ( __VYM " - "+tr("Export to")+" Taskjuggler"+tr("(still experimental)")); ex.addFilter ("Taskjuggler (*.tjp)"); - if (ex.execDialog()) ex.doExport(); + if (ex.execDialog() ) + { + me->setExportMode(true); + ex.doExport(); + me->setExportMode(false); + } } }