Notes work again (to some degree)
authorinsilmaril
Thu, 26 Mar 2009 07:50:32 +0000
changeset 747008e72977ab8
parent 746 ee6b0f3a4c2f
child 748 edb78a44240b
Notes work again (to some degree)
branchitem.cpp
branchitem.h
version.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/branchitem.cpp	Thu Mar 26 07:50:32 2009 +0000
     1.3 @@ -0,0 +1,116 @@
     1.4 +#include "branchitem.h"
     1.5 +#include "branchobj.h"
     1.6 +
     1.7 +#include <iostream>
     1.8 +using namespace std;
     1.9 +
    1.10 +BranchItem::BranchItem(const QList<QVariant> &data, TreeItem *parent):TreeItem (data,parent)
    1.11 +{
    1.12 +	cout << "Constr. BranchItem\n";
    1.13 +}
    1.14 +
    1.15 +BranchItem::~BranchItem()
    1.16 +{
    1.17 +	cout << "Destr. BranchItem\n";
    1.18 +    qDeleteAll(childItems);
    1.19 +}
    1.20 +
    1.21 +QString BranchItem::saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset)
    1.22 +{
    1.23 +	// Cloudy stuff can be hidden during exports
    1.24 +	if (hidden) return "";
    1.25 +
    1.26 +    QString s,a;
    1.27 +	BranchObj *bo=(BranchObj*)lmo;
    1.28 +
    1.29 +	/* FIXME-1
    1.30 +	// Update of note is usually done while unselecting a branch
    1.31 +	if (isNoteInEditor) getNoteFromTextEditor();
    1.32 +	
    1.33 +	QString scrolledAttr;
    1.34 +	if (scrolled) 
    1.35 +		scrolledAttr=attribut ("scrolled","yes");
    1.36 +	else
    1.37 +		scrolledAttr="";
    1.38 +
    1.39 +	// save area, if not scrolled
    1.40 +	QString areaAttr;
    1.41 +	if (!((BranchObj*)(parObj))->isScrolled() )
    1.42 +	{
    1.43 +		areaAttr=
    1.44 +			attribut("x1",QString().setNum(absPos.x()-offset.x())) +
    1.45 +			attribut("y1",QString().setNum(absPos.y()-offset.y())) +
    1.46 +			attribut("x2",QString().setNum(absPos.x()+width()-offset.x())) +
    1.47 +			attribut("y2",QString().setNum(absPos.y()+height()-offset.y()));
    1.48 +
    1.49 +	} else
    1.50 +		areaAttr="";
    1.51 +	
    1.52 +	// Providing an ID for a branch makes export to XHTML easier
    1.53 +	QString idAttr;
    1.54 +	if (countXLinks()>0)
    1.55 +		idAttr=attribut ("id",model->getSelectString(this)); //TODO directly access model
    1.56 +	else
    1.57 +		idAttr="";
    1.58 +
    1.59 +	*/
    1.60 +    s=beginElement ("branch" 
    1.61 +	//	+getOrnXMLAttr() 
    1.62 +	//	+scrolledAttr 
    1.63 +	//	+areaAttr 
    1.64 +	//	+idAttr 
    1.65 +	//	+getIncludeImageAttr() 
    1.66 +		);
    1.67 +    incIndent();
    1.68 +
    1.69 +	// save heading
    1.70 +    s+=valueElement("heading", getHeading(),
    1.71 +		attribut ("textColor",QColor( bo->getColor()).name()));
    1.72 +
    1.73 +/*
    1.74 +	// Save frame
    1.75 +	if (frame->getFrameType()!=FrameObj::NoFrame) 
    1.76 +		s+=frame->saveToDir ();
    1.77 +
    1.78 +	// save names of flags set
    1.79 +	s+=standardFlags->saveToDir(tmpdir,prefix,0);
    1.80 +	
    1.81 +	// Save FloatImages
    1.82 +	for (int i=0; i<floatimage.size(); ++i)
    1.83 +		s+=floatimage.at(i)->saveToDir (tmpdir,prefix);
    1.84 +*/
    1.85 +
    1.86 +	// save note
    1.87 +	if (!note.isEmpty() )
    1.88 +		s+=note.saveToDir();
    1.89 +	
    1.90 +	// Save branches
    1.91 +	TreeItem *ti=getFirstBranch();
    1.92 +	TreeItem *last=getLastBranch();
    1.93 +	while (ti && ti!=last) 
    1.94 +		s+=ti->saveToDir(tmpdir,prefix,offset);
    1.95 +
    1.96 +	/*
    1.97 +	// Save XLinks
    1.98 +	QString ol;	// old link
    1.99 +	QString cl;	// current link
   1.100 +	for (int i=0; i<xlink.size(); ++i)
   1.101 +	{
   1.102 +		cl=xlink.at(i)->saveToDir();
   1.103 +		if (cl!=ol)
   1.104 +		{
   1.105 +			s+=cl;
   1.106 +			ol=cl;
   1.107 +		} else
   1.108 +		{
   1.109 +			qWarning (QString("Ignoring of duplicate xLink in %1").arg(getHeading()));
   1.110 +		}
   1.111 +	}	
   1.112 +	*/
   1.113 +
   1.114 +    decIndent();
   1.115 +    s+=endElement   ("branch");
   1.116 +    return s;
   1.117 +}
   1.118 +
   1.119 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/branchitem.h	Thu Mar 26 07:50:32 2009 +0000
     2.3 @@ -0,0 +1,18 @@
     2.4 +#ifndef BRANCHITEM_H
     2.5 +#define BRANCHITEM_H
     2.6 +
     2.7 +#include "treeitem.h"
     2.8 +
     2.9 +class QString;
    2.10 +
    2.11 +class BranchItem:public TreeItem
    2.12 +{
    2.13 +public:
    2.14 +    BranchItem(const QList<QVariant> &data, TreeItem *parent = 0);
    2.15 +    ~BranchItem();
    2.16 +
    2.17 +	QString saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset);
    2.18 +
    2.19 +};
    2.20 +
    2.21 +#endif
     3.1 --- a/version.h	Thu Mar 26 07:49:17 2009 +0000
     3.2 +++ b/version.h	Thu Mar 26 07:50:32 2009 +0000
     3.3 @@ -7,7 +7,7 @@
     3.4  #define __VYM_VERSION "1.13.0"
     3.5  //#define __VYM_CODENAME "Codename: RC-1"
     3.6  #define __VYM_CODENAME "Codename: development version"
     3.7 -#define __VYM_BUILD_DATE "2009-03-24"
     3.8 +#define __VYM_BUILD_DATE "2009-03-26"
     3.9  
    3.10  
    3.11  bool checkVersion(const QString &);