Changeset - 98a2c6cae168
[Not reviewed]
default
0 3 0
Michael Guravage - 15 years ago 2010-11-30 10:51:27
michael.guravage@cwi.nl
Install imageformats folder alongside Windows executable.
Solicit supported image formats for file dialogue filter.

--
user: Michael Guravage <michael.guravage@cwi.nl>
branch 'default'
changed src/ChangeLog
changed src/VirtualLeaf-install-windows.nsi
changed src/canvas.cpp
3 files changed with 41 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/ChangeLog
Show inline comments
 
2010-11-30    <guravage@petitdru.sen.cwi.nl>
 

	
 
	* VirtualLeaf-install-windows.nsi: Include imageformats folder
 
	alongside executable.
 

	
 
	* canvas.cpp (snapshot): PNG is the default image format.
 

	
 
2010-11-29    <guravage@petitdru.sen.cwi.nl>
 

	
 
	* 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    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* mainbase.cpp (Save): Use format specified in function prototype.
src/VirtualLeaf-install-windows.nsi
Show inline comments
 
@@ -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
src/canvas.cpp
Show inline comments
 
@@ -47,6 +47,7 @@
 
#include <QDir>
 
#include <QFileInfo>
 
#include <QDebug>
 
#include <QImageWriter>
 

	
 
#include <set>
 

	
 
@@ -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;
 
    }
0 comments (0 inline, 0 general)