diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2010-11-30 + + * VirtualLeaf-install-windows.nsi: Include imageformats folder + alongside executable. + + * canvas.cpp (snapshot): PNG is the default image format. + +2010-11-29 + + * canvas.cpp (snapshot): Query and display supported snapshot file + formats. + + * VirtualLeaf-install-windows.nsi: To facilitate debugging I added + the debug versions of all the windows DLLs. + 2010-10-19 * mainbase.cpp (Save): Use format specified in function prototype. diff --git a/src/VirtualLeaf-install-windows.nsi b/src/VirtualLeaf-install-windows.nsi --- a/src/VirtualLeaf-install-windows.nsi +++ b/src/VirtualLeaf-install-windows.nsi @@ -131,7 +131,6 @@ section "Virtual Leaf executable" # Is the pegging of these DLLs to a specific QT version a problem? file C:\Qt\2010.02.1\mingw\bin\mingwm10.dll file C:\Qt\2010.02.1\mingw\bin\libgcc_s_dw2-1.dll - file C:\Qt\2010.02.1\qt\bin\Qt3Support4.dll file C:\Qt\2010.02.1\qt\bin\QtCore4.dll file C:\Qt\2010.02.1\qt\bin\QtGui4.dll @@ -146,7 +145,19 @@ section "Virtual Leaf executable" # point the new shortcut at the program VirtualLeaf createShortCut "$SMPROGRAMS\VirtualLeaf.lnk" "$INSTDIR\bin\VirtualLeaf.exe" sectionEnd - + +section "Image Formats" + # define the output path for the Qt Image Formats + setOutPath $INSTDIR\bin\imageformats + file C:\Qt\2010.02.1\qt\plugins\imageformats\qgif4.dll + file C:\Qt\2010.02.1\qt\plugins\imageformats\qico4.dll + file C:\Qt\2010.02.1\qt\plugins\imageformats\qjpeg4.dll + file C:\Qt\2010.02.1\qt\plugins\imageformats\qmng4.dll + file C:\Qt\2010.02.1\qt\plugins\imageformats\qsvg4.dll + file C:\Qt\2010.02.1\qt\plugins\imageformats\qtiff4.dll +sectionEnd + + section "Virtual Leaf plugins" # define the output path for the Virtual Leaf models setOutPath $INSTDIR\bin\models diff --git a/src/canvas.cpp b/src/canvas.cpp --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -728,14 +729,23 @@ void Main::saveStateXML() void Main::snapshot() { +#ifdef QDEBUG + qDebug() << "Supported Image Formats: " << QImageWriter::supportedImageFormats() << endl; +#endif stopSimulation(); Q3FileDialog *fd = new Q3FileDialog( this, "Save snapshot", TRUE ); fd->setDir(par.datadir); fd->setMode( Q3FileDialog::AnyFile ); - fd->setFilter( "Image files (*.pdf *.png *.jpg *.tif)"); + + QString supported_file_formats = " .pdf"; + foreach (QString format, QImageWriter::supportedImageFormats()){ + supported_file_formats += (" ." + format); + } + + fd->setFilter("Image files (" + supported_file_formats + " )"); + QString fileName; - if ( fd->exec() == QDialog::Accepted ) { fileName = fd->selectedFile(); @@ -744,7 +754,7 @@ void Main::snapshot() QString extension = fi.suffix(); if (extension.isEmpty()) { - extension = "jpg"; + extension = "png"; fileName += "."; fileName += extension; }