# HG changeset patch
# User insilmaril
# Date 1204536340 0
# Node ID d2f72e4485223c8e167833e4ecaed10d5375a156
# Parent  fd6d1292c4ada54606030b57c44843bbd702a99d
added attributedelegate .h .cpp

diff -r fd6d1292c4ad -r d2f72e448522 demos/vym-projectplan.vym
Binary file demos/vym-projectplan.vym has changed
diff -r fd6d1292c4ad -r d2f72e448522 mainwindow.cpp
--- a/mainwindow.cpp	Mon Mar 03 09:25:40 2008 +0000
+++ b/mainwindow.cpp	Mon Mar 03 09:25:40 2008 +0000
@@ -1938,117 +1938,8 @@
 
 void Main::fileSave(MapEditor *me, const SaveMode &savemode)
 {
-	/* FIXME moved to ME
-	// Error codes
-	ErrorCode err=success;
-
-	QString safeFilePath;
-
 	if (!me) return;
-	bool saveZipped=me->saveZipped();
-
-	// tmp dir for zipping 
-	QString tmpZipDir;
-	
-	*/
-	
-
-	if (!me) return;
-
-	// filename=unnamed, filepath="" in constructor of mapEditor
-
-	/* FIXME moved to ME
-	if ( !fn.isEmpty() ) 
-	{	
-		// We have a filepath, go on saving			
-
-		// Look, if we should zip the data:
-		if (!saveZipped)
-		{
-			QMessageBox mb( vymName,
-				tr("The map %1\ndid not use the compressed "
-				"vym file format.\nWriting it uncompressed will also write images \n"
-				"and flags and thus may overwrite files in the "
-				"given directory\n\nDo you want to write the map").arg(fn),
-				QMessageBox::Warning,
-				QMessageBox::Yes | QMessageBox::Default,
-				QMessageBox::No ,
-				QMessageBox::Cancel | QMessageBox::Escape);
-			mb.setButtonText( QMessageBox::Yes, tr("compressed (vym default)") );
-			mb.setButtonText( QMessageBox::No, tr("uncompressed") );
-			mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
-			switch( mb.exec() ) 
-			{
-				case QMessageBox::Yes:
-					// save compressed (default file format)
-					saveZipped=true;
-					break;
-				case QMessageBox::No:
-					// save uncompressed
-					saveZipped=false;
-					break;
-				case QMessageBox::Cancel:
-					// do nothing
-					return;
-					break;
-			}
-			me->setZipped (saveZipped);
-		}
-
-		// First backup existing file, we 
-		// don't want to add to old zip archives
-		QFile f(fn);
-		if (f.exists())
-		{
-			if (actionSettingsWriteBackupFile->isOn())
-			{
-				QString bfn(fn + "~");
-				QFile bf(bfn);
-				if (bf.exists() && !bf.remove())
-				{
-					QMessageBox::warning(0, tr("Save Error"),
-										 bfn + tr("\ncould not be removed before saving"));
-				}
-				else if (!f.rename(bfn))
-				{
-					QMessageBox::warning(0, tr("Save Error"),
-										 fn + tr("\ncould not be renamed before saving"));
-				}
-			}
-		}
-
-		if (saveZipped)
-		{
-			// Create temporary directory for packing
-			bool ok;
-			tmpZipDir=makeTmpDir (ok,"vym-zip");
-			if (!ok)
-			{
-				QMessageBox::critical( 0, tr( "Critical Load Error" ),
-				   tr("Couldn't create temporary directory before save\n"));
-				return; 
-			}
-
-			safeFilePath=me->getFilePath();
-			me->setFilePath (tmpZipDir+"/"+
-				me->getMapName()+ ".xml",
-				safeFilePath);
-			me->save (savemode);
-			me->setFilePath (safeFilePath);
-			
-			zipDir (tmpZipDir,fn);
-		} // save zipped
-		else
-		{
-			// Save unzipped. 
-			safeFilePath=me->getFilePath();
-			me->setFilePath (fn, safeFilePath);
-			me->save (savemode);
-			me->setFilePath (safeFilePath);
-		} // save zipped 	
-	} // filepath available
-	else
-	*/
+
 	if ( me->getFilePath().isEmpty() ) 
 	{
 		// We have  no filepath yet,
@@ -2059,11 +1950,6 @@
 		fileSaveAs(savemode);
 	}
 
-/* FIXME moved to ME
-	if (saveZipped && !tmpZipDir.isEmpty())
-		// Delete tmpDir
-		removeDir (QDir(tmpZipDir));
-*/
 	if (me->save (savemode)==success)
 	{
 		statusBar()->message( 
diff -r fd6d1292c4ad -r d2f72e448522 mapeditor.cpp
--- a/mapeditor.cpp	Mon Mar 03 09:25:40 2008 +0000
+++ b/mapeditor.cpp	Mon Mar 03 09:25:40 2008 +0000
@@ -1702,7 +1702,7 @@
 
 ErrorCode MapEditor::save (const SaveMode &savemode)
 {
-	cout <<"ME::save zipped="<<zipped<<endl;
+	cout <<"ME::save "<<qPrintable (mapName)<<"  zipped="<<zipped<<endl; // FIXME debug
 	// Create mapName and fileDir
 	makeSubDirs (fileDir);
 	QString tmpZipDir;
@@ -1831,6 +1831,7 @@
 	return err;
 }
 
+/* FIXME not needed any longer
 void MapEditor::setZipped (bool z)
 {
 	zipped=z;
@@ -1840,6 +1841,7 @@
 {
 	return zipped;
 }
+*/
 
 void MapEditor::print()
 {
@@ -5211,11 +5213,11 @@
 {
 	QDateTime now=QDateTime().currentDateTime();
 	/* FIXME debug
-	*/
 	cout << "ME::autosave checking "<<qPrintable(filePath)<<"...\n"; 
 	cout << "fsaved: "<<qPrintable (fileChangedTime.toString())<<endl;
 	cout << "  fnow: "<<qPrintable (QFileInfo(filePath).lastModified().toString())<<endl;
 	cout << "  time: "<<qPrintable (now.toString())<<endl;
+	*/
 	// Disable autosave, while we have gone back in history
 	int redosAvail=undoSet.readNumEntry (QString("/history/redosAvail"));
 	if (redosAvail>0) return;
diff -r fd6d1292c4ad -r d2f72e448522 mapeditor.h
--- a/mapeditor.h	Mon Mar 03 09:25:40 2008 +0000
+++ b/mapeditor.h	Mon Mar 03 09:25:40 2008 +0000
@@ -165,8 +165,10 @@
 public:
 	/*! \brief Save the map to file */
     ErrorCode save(const SaveMode &);	
+	/* FIXME no needed any longer
 	void setZipped(bool);		//!< Set or unset compression of map with zip save map zipped
 	bool saveZipped();			//!< True, if file will be saved zipped
+	*/
     void print();				//!< Print the map
 	void setAntiAlias (bool);	//!< Set or unset antialiasing
 	void setSmoothPixmap(bool); //!< Set or unset smoothing of pixmaps
diff -r fd6d1292c4ad -r d2f72e448522 version.h
--- a/version.h	Mon Mar 03 09:25:40 2008 +0000
+++ b/version.h	Mon Mar 03 09:25:40 2008 +0000
@@ -7,7 +7,7 @@
 #define __VYM_VERSION "1.11.6"
 //#define __VYM_CODENAME "Codename: 1.10.0-RC-3"
 #define __VYM_CODENAME "Codename: development version"
-#define __VYM_BUILD_DATE "2008-02-27"
+#define __VYM_BUILD_DATE "2008-02-29"
 
 
 bool checkVersion(const QString &);