diff -r 138c2cdc02fd -r 6691000c3262 mapeditor.cpp --- a/mapeditor.cpp Tue Jan 24 15:09:48 2006 +0000 +++ b/mapeditor.cpp Tue Jan 24 15:09:48 2006 +0000 @@ -373,7 +373,7 @@ if (linkcolorhint==HeadingColor) colhint=attribut("linkColorHint","HeadingColor"); - QString mapAttr=attribut("version",__VYM_VERSION__); + QString mapAttr=attribut("version",__VYM_VERSION); if (!saveSelection) mapAttr+= attribut("author",mapCenter->getAuthor()) + attribut("comment",mapCenter->getComment()) + @@ -1065,9 +1065,9 @@ ExportBase ex; ex.setMapCenter(mapCenter); - QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (ASCII)")); + QFileDialog *fd=new QFileDialog( this, __VYM " - " +tr("Export (ASCII)")); fd->addFilter ("TXT (*.txt)"); - fd->setCaption("VYM - Export (ASCII) (still experimental)"); + fd->setCaption(__VYM " -" +tr("Export (ASCII) (still experimental)")); fd->setMode( QFileDialog::AnyFile ); fd->show(); @@ -1075,7 +1075,7 @@ { if (QFile (fd->selectedFile()).exists() ) { - QMessageBox mb( "VYM", + QMessageBox mb( __VYM, tr("The file %1 exists already.\nDo you want to overwrite it?").arg(fd->selectedFile()), QMessageBox::Warning, QMessageBox::Yes | QMessageBox::Default, @@ -1104,9 +1104,9 @@ void MapEditor::exportLaTeX() { // TODO still experimental - QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (LaTex)")); + QFileDialog *fd=new QFileDialog( this, __VYM " - " +tr("Export (LaTex)")); fd->addFilter ("TEX (*.tex)"); - fd->setCaption("VYM - Export (LaTex) (still experimental)"); + fd->setCaption(__VYM " - " + tr("Export (LaTex) (still experimental)")); fd->setMode( QFileDialog::AnyFile ); fd->show(); @@ -1143,48 +1143,13 @@ } } -void MapEditor::exportOOPresentation() +void MapEditor::exportOOPresentation(const QString &fn, const QString &cf) { - // TODO still experimental - /* - QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (Open Office 1.3.x Presentation)")); - fd->addFilter ("Open Office 1.3.x presentation (*.sxi)"); - fd->setCaption("VYM - Export (Open Office 1.3.x presentation) (still experimental)"); - fd->setMode( QFileDialog::AnyFile ); - fd->show(); - - if ( fd->exec() == QDialog::Accepted ) - { - if (QFile (fd->selectedFile()).exists() ) - { - QMessageBox mb( "VYM", - tr("The file ") + fd->selectedFile() + - tr(" exists already. Do you want to overwrite it?"), - QMessageBox::Warning, - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::Cancel | QMessageBox::Escape, - QMessageBox::NoButton ); - - mb.setButtonText( QMessageBox::Yes, tr("Overwrite") ); - mb.setButtonText( QMessageBox::No, tr("Cancel")); - Export ex; - switch( mb.exec() ) - { - case QMessageBox::Yes: - // save - break;; - case QMessageBox::Cancel: - // do nothing - return; - break; - } - } - */ - ExportOO ex; - //ex.setPath (fd->selectedFile() ); - ex.setMapCenter(mapCenter); - ex.exportPresentation(); -// } + ExportOO ex; + ex.setPath (fn); + ex.setConfigFile(cf); + ex.setMapCenter(mapCenter); + ex.exportPresentation(); } @@ -2204,7 +2169,7 @@ if (typeid(*selection) == typeid(BranchObj) || typeid(*selection) == typeid(MapCenterObj)) { - saveState(selection); + saveState(selection); //TODO undoCommand BranchObj *bo=(BranchObj*)selection; bo->setColor(actColor, true); // color links, color childs } @@ -2378,9 +2343,9 @@ typeid(*selection) == typeid(MapCenterObj)) ) { BranchObj *bo=(BranchObj*)selection; - QFileDialog *fd=new QFileDialog( this,tr("VYM - Link to another map")); + QFileDialog *fd=new QFileDialog( this,__VYM " - " +tr("Link to another map")); fd->addFilter (QString (tr("vym map") + " (*.vym)")); - fd->setCaption(tr("VYM - Link to another map")); + fd->setCaption(__VYM " - " +tr("Link to another map")); if (! bo->getVymLink().isEmpty() ) fd->setSelection( bo->getVymLink() ); fd->show(); @@ -2792,13 +2757,14 @@ { BranchObj *bo=((BranchObj*)selection); - QFileDialog *fd=new QFileDialog( this,tr("vym - load image")); + QFileDialog *fd=new QFileDialog( this,QString ("vym - ")+tr("Load image")); + fd->setMode (QFileDialog::ExistingFiles); fd->addFilter (QString (tr("Images") + " (*.png *.bmp *.xbm *.jpg *.png *.xpm *.gif *.pnm)")); ImagePreview *p =new ImagePreview (fd); fd->setContentsPreviewEnabled( TRUE ); fd->setContentsPreview( p, p ); fd->setPreviewMode( QFileDialog::Contents ); - fd->setCaption(tr("vym - Load image")); + fd->setCaption(__VYM " - " +tr("Load image")); fd->setDir (lastImageDir); fd->show(); @@ -2806,12 +2772,19 @@ if ( fd->exec() == QDialog::Accepted ) { saveState(selection); - QString fn=fd->selectedFile(); lastImageDir=fn.left(fn.findRev ("/")); - bo->addFloatImage(); - // TODO check if load was successful - bo->getLastFloatImage()->load(fn); - bo->getLastFloatImage()->setOriginalFilename(fn); + QStringList flist = fd->selectedFiles(); + QStringList::Iterator it = flist.begin(); + while( it != flist.end() ) + { + fn = *it; + bo->addFloatImage(); + // TODO check if load was successful + bo->getLastFloatImage()->load(*it); + bo->getLastFloatImage()->setOriginalFilename(fn); + ++it; + } + mapCenter->reposition(); adjustCanvasSize(); canvas()->update(); @@ -2836,7 +2809,7 @@ fd->addFilter ("GIF (*.gif)"); fd->addFilter ("PNM (*.pnm)"); fd->addFilter (QString (tr("Images") + " (*.png *.bmp *.xbm *.jpg *.png *.xpm *.gif *.pnm)")); - fd->setCaption(tr("vym - Save image as %1").arg(fmt)); + fd->setCaption(__VYM " - " +tr("Save image as %1").arg(fmt)); fd->setMode( QFileDialog::AnyFile ); fd->setSelection (fio->getOriginalFilename()); fd->show(); @@ -2846,7 +2819,7 @@ { if (QFile (fd->selectedFile()).exists() ) { - QMessageBox mb( "VYM", + QMessageBox mb( __VYM, tr("The file %1 exists already.\n" "Do you want to overwrite it?").arg(fd->selectedFile()), QMessageBox::Warning, @@ -2981,10 +2954,10 @@ (typeid(*selection) == typeid(BranchObj)) || (typeid(*selection) == typeid(MapCenterObj)) ) { - QFileDialog *fd=new QFileDialog( this,tr("VYM - Choose directory structur to import")); + QFileDialog *fd=new QFileDialog( this,__VYM " - " +tr("Choose directory structure to import")); fd->setMode (QFileDialog::DirectoryOnly); fd->addFilter (QString (tr("vym map") + " (*.vym)")); - fd->setCaption(tr("VYM - Choose directory structur to import")); + fd->setCaption(__VYM " - " +tr("Choose directory structure to import")); fd->show(); QString fn; @@ -3046,7 +3019,10 @@ void MapEditor::testFunction() { cout << "MapEditor::testFunction() called\n"; - mapCenter->move(mapCenter->x(),mapCenter->y()); + if (selection && (typeid(*selection) == typeid(BranchObj))) + { + cout << "Note:\n"<<((BranchObj*)selection)->getNoteOpenDoc()<