vymmodel.cpp
changeset 825 1ad892c1a709
parent 824 36eb4b8f409e
child 829 832e96c9abb6
     1.1 --- a/vymmodel.cpp	Thu Feb 25 11:03:52 2010 +0000
     1.2 +++ b/vymmodel.cpp	Tue Mar 02 13:59:19 2010 +0000
     1.3 @@ -4258,14 +4258,21 @@
     1.4  	}
     1.5  }
     1.6  
     1.7 -void VymModel::exportHTML (const QString &dir, bool askForName)	//FIXME-2 own dialogue missing and also option to save settings in map
     1.8 -{
     1.9 -	ExportHTMLDialog dia(NULL);	
    1.10 +void VymModel::exportHTML (const QString &dir, bool useDialog)	
    1.11 +{
    1.12 +	ExportHTML ex (this);
    1.13 +	ex.setDir (dir);
    1.14 +	ex.doExport(useDialog);
    1.15 +}
    1.16 +
    1.17 +void VymModel::exportXHTML (const QString &dir, bool askForName)
    1.18 +{
    1.19 +	ExportXHTMLDialog dia(NULL);
    1.20  	dia.setFilePath (filePath );
    1.21  	dia.setMapName (mapName );
    1.22  	dia.readSettings();
    1.23  	if (dir!="") dia.setDir (dir);
    1.24 -	QDir d;
    1.25 +
    1.26  	bool ok=true;
    1.27  	
    1.28  	if (askForName)
    1.29 @@ -4274,7 +4281,7 @@
    1.30  			ok=false;
    1.31  		else	
    1.32  		{
    1.33 -			d=dia.getDir();
    1.34 +			QDir d (dia.getDir());
    1.35  			// Check, if warnings should be used before overwriting
    1.36  			// the output directory
    1.37  			if (d.exists() && d.count()>0)
    1.38 @@ -4285,75 +4292,21 @@
    1.39  					"The directory %1 is not empty.\n"
    1.40  					"Do you risk to overwrite some of its contents?").arg(d.path() ));
    1.41  				warn.setCaption("Warning: Directory not empty");
    1.42 -				warn.setShowAgainName("mainwindow/export-XML-overwrite-dir");
    1.43 +				warn.setShowAgainName("mainwindow/overwrite-dir-xhtml");
    1.44  
    1.45  				if (warn.exec()!=QDialog::Accepted) ok=false;
    1.46  			}
    1.47  		}	
    1.48  	}
    1.49 +
    1.50  	if (ok)
    1.51  	{
    1.52 -		// Hide stuff during export, if settings want this
    1.53 -		setExportMode (true);
    1.54 -
    1.55 -		ExportHTML ex (this);
    1.56 -		ex.setFile (d.path()+"/"+mapName+".html");
    1.57 -		//qDebug()<< "VM::exportHTML  writing "<<ex.getFile();
    1.58 -		ex.setCSSPath(dia.getCSSPath() );
    1.59 -		ex.doExport();
    1.60 -		setExportMode (false);
    1.61 -
    1.62 -		//dia.doExport(mapName );
    1.63 +		exportXML (dia.getDir(),false );
    1.64 +		dia.doExport(mapName );
    1.65  		//if (dia.hasChanged()) setChanged();
    1.66 -
    1.67 -		// Write image, too
    1.68 -		exportImage (d.path()+"/"+mapName+".png",false,"PNG");
    1.69 -
    1.70  	}
    1.71  }
    1.72  
    1.73 -void VymModel::exportXHTML (const QString &dir, bool askForName)
    1.74 -{
    1.75 -			ExportXHTMLDialog dia(NULL);
    1.76 -			dia.setFilePath (filePath );
    1.77 -			dia.setMapName (mapName );
    1.78 -			dia.readSettings();
    1.79 -			if (dir!="") dia.setDir (dir);
    1.80 -
    1.81 -			bool ok=true;
    1.82 -			
    1.83 -			if (askForName)
    1.84 -			{
    1.85 -				if (dia.exec()!=QDialog::Accepted) 
    1.86 -					ok=false;
    1.87 -				else	
    1.88 -				{
    1.89 -					QDir d (dia.getDir());
    1.90 -					// Check, if warnings should be used before overwriting
    1.91 -					// the output directory
    1.92 -					if (d.exists() && d.count()>0)
    1.93 -					{
    1.94 -						WarningDialog warn;
    1.95 -						warn.showCancelButton (true);
    1.96 -						warn.setText(QString(
    1.97 -							"The directory %1 is not empty.\n"
    1.98 -							"Do you risk to overwrite some of its contents?").arg(d.path() ));
    1.99 -						warn.setCaption("Warning: Directory not empty");
   1.100 -						warn.setShowAgainName("mainwindow/overwrite-dir-xhtml");
   1.101 -
   1.102 -						if (warn.exec()!=QDialog::Accepted) ok=false;
   1.103 -					}
   1.104 -				}	
   1.105 -			}
   1.106 -
   1.107 -			if (ok)
   1.108 -			{
   1.109 -				exportXML (dia.getDir(),false );
   1.110 -				dia.doExport(mapName );
   1.111 -				//if (dia.hasChanged()) setChanged();
   1.112 -			}
   1.113 -}
   1.114 -
   1.115  void VymModel::exportOOPresentation(const QString &fn, const QString &cf)
   1.116  {
   1.117  	ExportOO ex;
   1.118 @@ -4695,7 +4648,7 @@
   1.119  }
   1.120  
   1.121  
   1.122 -void VymModel::animate()	//FIXME-2 animation causes flicker after cut/undo cut ?!?
   1.123 +void VymModel::animate()	
   1.124  {
   1.125  	animationTimer->stop();
   1.126  	BranchObj *bo;
   1.127 @@ -4724,7 +4677,6 @@
   1.128  
   1.129  void VymModel::startAnimation(BranchObj *bo, const QPointF &start, const QPointF &dest)
   1.130  {
   1.131 -	qDebug()<<"Start animation for "<<bo->getTreeItem()<<getHeading();
   1.132  	if (start==dest) return;
   1.133  	if (bo && bo->getTreeItem()->depth()>0) 
   1.134  	{