added attributedelegate .h .cpp
authorinsilmaril
Mon, 03 Mar 2008 09:25:40 +0000
changeset 679d2f72e448522
parent 678 fd6d1292c4ad
child 680 8c6faaa1e2b1
added attributedelegate .h .cpp
demos/vym-projectplan.vym
mainwindow.cpp
mapeditor.cpp
mapeditor.h
version.h
     1.1 Binary file demos/vym-projectplan.vym has changed
     2.1 --- a/mainwindow.cpp	Mon Mar 03 09:25:40 2008 +0000
     2.2 +++ b/mainwindow.cpp	Mon Mar 03 09:25:40 2008 +0000
     2.3 @@ -1938,117 +1938,8 @@
     2.4  
     2.5  void Main::fileSave(MapEditor *me, const SaveMode &savemode)
     2.6  {
     2.7 -	/* FIXME moved to ME
     2.8 -	// Error codes
     2.9 -	ErrorCode err=success;
    2.10 -
    2.11 -	QString safeFilePath;
    2.12 -
    2.13  	if (!me) return;
    2.14 -	bool saveZipped=me->saveZipped();
    2.15 -
    2.16 -	// tmp dir for zipping 
    2.17 -	QString tmpZipDir;
    2.18 -	
    2.19 -	*/
    2.20 -	
    2.21 -
    2.22 -	if (!me) return;
    2.23 -
    2.24 -	// filename=unnamed, filepath="" in constructor of mapEditor
    2.25 -
    2.26 -	/* FIXME moved to ME
    2.27 -	if ( !fn.isEmpty() ) 
    2.28 -	{	
    2.29 -		// We have a filepath, go on saving			
    2.30 -
    2.31 -		// Look, if we should zip the data:
    2.32 -		if (!saveZipped)
    2.33 -		{
    2.34 -			QMessageBox mb( vymName,
    2.35 -				tr("The map %1\ndid not use the compressed "
    2.36 -				"vym file format.\nWriting it uncompressed will also write images \n"
    2.37 -				"and flags and thus may overwrite files in the "
    2.38 -				"given directory\n\nDo you want to write the map").arg(fn),
    2.39 -				QMessageBox::Warning,
    2.40 -				QMessageBox::Yes | QMessageBox::Default,
    2.41 -				QMessageBox::No ,
    2.42 -				QMessageBox::Cancel | QMessageBox::Escape);
    2.43 -			mb.setButtonText( QMessageBox::Yes, tr("compressed (vym default)") );
    2.44 -			mb.setButtonText( QMessageBox::No, tr("uncompressed") );
    2.45 -			mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
    2.46 -			switch( mb.exec() ) 
    2.47 -			{
    2.48 -				case QMessageBox::Yes:
    2.49 -					// save compressed (default file format)
    2.50 -					saveZipped=true;
    2.51 -					break;
    2.52 -				case QMessageBox::No:
    2.53 -					// save uncompressed
    2.54 -					saveZipped=false;
    2.55 -					break;
    2.56 -				case QMessageBox::Cancel:
    2.57 -					// do nothing
    2.58 -					return;
    2.59 -					break;
    2.60 -			}
    2.61 -			me->setZipped (saveZipped);
    2.62 -		}
    2.63 -
    2.64 -		// First backup existing file, we 
    2.65 -		// don't want to add to old zip archives
    2.66 -		QFile f(fn);
    2.67 -		if (f.exists())
    2.68 -		{
    2.69 -			if (actionSettingsWriteBackupFile->isOn())
    2.70 -			{
    2.71 -				QString bfn(fn + "~");
    2.72 -				QFile bf(bfn);
    2.73 -				if (bf.exists() && !bf.remove())
    2.74 -				{
    2.75 -					QMessageBox::warning(0, tr("Save Error"),
    2.76 -										 bfn + tr("\ncould not be removed before saving"));
    2.77 -				}
    2.78 -				else if (!f.rename(bfn))
    2.79 -				{
    2.80 -					QMessageBox::warning(0, tr("Save Error"),
    2.81 -										 fn + tr("\ncould not be renamed before saving"));
    2.82 -				}
    2.83 -			}
    2.84 -		}
    2.85 -
    2.86 -		if (saveZipped)
    2.87 -		{
    2.88 -			// Create temporary directory for packing
    2.89 -			bool ok;
    2.90 -			tmpZipDir=makeTmpDir (ok,"vym-zip");
    2.91 -			if (!ok)
    2.92 -			{
    2.93 -				QMessageBox::critical( 0, tr( "Critical Load Error" ),
    2.94 -				   tr("Couldn't create temporary directory before save\n"));
    2.95 -				return; 
    2.96 -			}
    2.97 -
    2.98 -			safeFilePath=me->getFilePath();
    2.99 -			me->setFilePath (tmpZipDir+"/"+
   2.100 -				me->getMapName()+ ".xml",
   2.101 -				safeFilePath);
   2.102 -			me->save (savemode);
   2.103 -			me->setFilePath (safeFilePath);
   2.104 -			
   2.105 -			zipDir (tmpZipDir,fn);
   2.106 -		} // save zipped
   2.107 -		else
   2.108 -		{
   2.109 -			// Save unzipped. 
   2.110 -			safeFilePath=me->getFilePath();
   2.111 -			me->setFilePath (fn, safeFilePath);
   2.112 -			me->save (savemode);
   2.113 -			me->setFilePath (safeFilePath);
   2.114 -		} // save zipped 	
   2.115 -	} // filepath available
   2.116 -	else
   2.117 -	*/
   2.118 +
   2.119  	if ( me->getFilePath().isEmpty() ) 
   2.120  	{
   2.121  		// We have  no filepath yet,
   2.122 @@ -2059,11 +1950,6 @@
   2.123  		fileSaveAs(savemode);
   2.124  	}
   2.125  
   2.126 -/* FIXME moved to ME
   2.127 -	if (saveZipped && !tmpZipDir.isEmpty())
   2.128 -		// Delete tmpDir
   2.129 -		removeDir (QDir(tmpZipDir));
   2.130 -*/
   2.131  	if (me->save (savemode)==success)
   2.132  	{
   2.133  		statusBar()->message( 
     3.1 --- a/mapeditor.cpp	Mon Mar 03 09:25:40 2008 +0000
     3.2 +++ b/mapeditor.cpp	Mon Mar 03 09:25:40 2008 +0000
     3.3 @@ -1702,7 +1702,7 @@
     3.4  
     3.5  ErrorCode MapEditor::save (const SaveMode &savemode)
     3.6  {
     3.7 -	cout <<"ME::save zipped="<<zipped<<endl;
     3.8 +	cout <<"ME::save "<<qPrintable (mapName)<<"  zipped="<<zipped<<endl; // FIXME debug
     3.9  	// Create mapName and fileDir
    3.10  	makeSubDirs (fileDir);
    3.11  	QString tmpZipDir;
    3.12 @@ -1831,6 +1831,7 @@
    3.13  	return err;
    3.14  }
    3.15  
    3.16 +/* FIXME not needed any longer
    3.17  void MapEditor::setZipped (bool z)
    3.18  {
    3.19  	zipped=z;
    3.20 @@ -1840,6 +1841,7 @@
    3.21  {
    3.22  	return zipped;
    3.23  }
    3.24 +*/
    3.25  
    3.26  void MapEditor::print()
    3.27  {
    3.28 @@ -5211,11 +5213,11 @@
    3.29  {
    3.30  	QDateTime now=QDateTime().currentDateTime();
    3.31  	/* FIXME debug
    3.32 -	*/
    3.33  	cout << "ME::autosave checking "<<qPrintable(filePath)<<"...\n"; 
    3.34  	cout << "fsaved: "<<qPrintable (fileChangedTime.toString())<<endl;
    3.35  	cout << "  fnow: "<<qPrintable (QFileInfo(filePath).lastModified().toString())<<endl;
    3.36  	cout << "  time: "<<qPrintable (now.toString())<<endl;
    3.37 +	*/
    3.38  	// Disable autosave, while we have gone back in history
    3.39  	int redosAvail=undoSet.readNumEntry (QString("/history/redosAvail"));
    3.40  	if (redosAvail>0) return;
     4.1 --- a/mapeditor.h	Mon Mar 03 09:25:40 2008 +0000
     4.2 +++ b/mapeditor.h	Mon Mar 03 09:25:40 2008 +0000
     4.3 @@ -165,8 +165,10 @@
     4.4  public:
     4.5  	/*! \brief Save the map to file */
     4.6      ErrorCode save(const SaveMode &);	
     4.7 +	/* FIXME no needed any longer
     4.8  	void setZipped(bool);		//!< Set or unset compression of map with zip save map zipped
     4.9  	bool saveZipped();			//!< True, if file will be saved zipped
    4.10 +	*/
    4.11      void print();				//!< Print the map
    4.12  	void setAntiAlias (bool);	//!< Set or unset antialiasing
    4.13  	void setSmoothPixmap(bool); //!< Set or unset smoothing of pixmaps
     5.1 --- a/version.h	Mon Mar 03 09:25:40 2008 +0000
     5.2 +++ b/version.h	Mon Mar 03 09:25:40 2008 +0000
     5.3 @@ -7,7 +7,7 @@
     5.4  #define __VYM_VERSION "1.11.6"
     5.5  //#define __VYM_CODENAME "Codename: 1.10.0-RC-3"
     5.6  #define __VYM_CODENAME "Codename: development version"
     5.7 -#define __VYM_BUILD_DATE "2008-02-27"
     5.8 +#define __VYM_BUILD_DATE "2008-02-29"
     5.9  
    5.10  
    5.11  bool checkVersion(const QString &);