Fixed HideExport bug, changed pre- and postscript in XHTML export dialog
authorinsilmaril
Tue, 04 Dec 2007 12:32:59 +0000
changeset 628d7d0708b1c60
parent 627 513107d1ed59
child 629 92bebad145d2
Fixed HideExport bug, changed pre- and postscript in XHTML export dialog
attributewidget.ui
branchobj.cpp
branchobj.h
demos/vym-projectplan.vym
exportxhtmldialog.ui
floatimageobj.cpp
highlighter.cpp
mainwindow.cpp
mapcenterobj.cpp
mapeditor.cpp
mapeditor.h
ornamentedobj.cpp
ornamentedobj.h
tex/vym.changelog
version.h
vym.pro
     1.1 --- a/attributewidget.ui	Tue Dec 04 12:32:56 2007 +0000
     1.2 +++ b/attributewidget.ui	Tue Dec 04 12:32:59 2007 +0000
     1.3 @@ -17,6 +17,13 @@
     1.4      <number>0</number>
     1.5     </property>
     1.6     <item>
     1.7 +    <widget class="QPushButton" name="pushButton" >
     1.8 +     <property name="text" >
     1.9 +      <string/>
    1.10 +     </property>
    1.11 +    </widget>
    1.12 +   </item>
    1.13 +   <item>
    1.14      <widget class="QComboBox" name="keyComboBox" >
    1.15       <property name="sizePolicy" >
    1.16        <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
     2.1 --- a/branchobj.cpp	Tue Dec 04 12:32:56 2007 +0000
     2.2 +++ b/branchobj.cpp	Tue Dec 04 12:32:59 2007 +0000
     2.3 @@ -740,12 +740,14 @@
     2.4  
     2.5  void BranchObj::setHideTmp (HideTmpMode mode)
     2.6  {
     2.7 -	if (mode==HideExport && hasHiddenExportParent())
     2.8 +	if (mode==HideExport && (hideExport|| hasHiddenExportParent() ) )
     2.9  	{
    2.10 +		// Hide stuff according to hideExport flag and parents
    2.11  		setVisibility (false);
    2.12  		hidden=true;
    2.13  	}else
    2.14  	{
    2.15 +		// Do not hide, but still take care of scrolled status
    2.16  		if (hasScrolledParent(this))
    2.17  			setVisibility (false);
    2.18  		else
    2.19 @@ -753,6 +755,7 @@
    2.20  		hidden=false;
    2.21  	}	
    2.22  
    2.23 +	// And take care of my childs
    2.24  	for (int i=0; i<branch.size(); ++i)
    2.25  		branch.at(i)->setHideTmp (mode);
    2.26  }
    2.27 @@ -760,9 +763,9 @@
    2.28  bool BranchObj::hasHiddenExportParent()
    2.29  {
    2.30  	// Calls parents recursivly to
    2.31 -	// find out, if we are temp. hidden
    2.32 +	// find out, if we or parents are temp. hidden
    2.33  
    2.34 -	if (hideExport) return true;
    2.35 +	if (hidden || hideExport) return true;
    2.36  
    2.37  	BranchObj* bo=(BranchObj*)parObj;
    2.38  	if (bo) 
    2.39 @@ -807,7 +810,7 @@
    2.40  		idAttr="";
    2.41  
    2.42      s=beginElement ("branch" 
    2.43 -		+getOrnAttr() 
    2.44 +		+getOrnXMLAttr() 
    2.45  		+scrolledAttr 
    2.46  		+areaAttr 
    2.47  		+idAttr 
     3.1 --- a/branchobj.h	Tue Dec 04 12:32:56 2007 +0000
     3.2 +++ b/branchobj.h	Tue Dec 04 12:32:59 2007 +0000
     3.3 @@ -11,14 +11,16 @@
     3.4  
     3.5  /*! \brief A branch visible in the map */
     3.6  
     3.7 +/*! If HideExport is used, this branch and its childs will be hidden in export */
     3.8 +enum HideTmpMode {HideNone, HideExport};
     3.9 +
    3.10 +
    3.11  /////////////////////////////////////////////////////////////////////////////
    3.12  class BranchObj:public OrnamentedObj {
    3.13  public:
    3.14  	/*! New branches will get use same color for heading as parent */
    3.15  	enum BranchModification {NewBranch, MovedBranch};
    3.16  
    3.17 -	/*! If HideExport is used, this branch and its childs will be hidden in export */
    3.18 -	enum HideTmpMode {HideNone, HideExport};
    3.19  
    3.20      BranchObj ();
    3.21      BranchObj (QGraphicsScene*);
     4.1 Binary file demos/vym-projectplan.vym has changed
     5.1 --- a/exportxhtmldialog.ui	Tue Dec 04 12:32:56 2007 +0000
     5.2 +++ b/exportxhtmldialog.ui	Tue Dec 04 12:32:59 2007 +0000
     5.3 @@ -381,7 +381,7 @@
     5.4           </widget>
     5.5          </item>
     5.6          <item>
     5.7 -         <widget class="QLineEdit" name="lineEditPostScript" />
     5.8 +         <widget class="QLineEdit" name="lineEditPreScript" />
     5.9          </item>
    5.10          <item>
    5.11           <widget class="QPushButton" name="browsePreExportButton" >
    5.12 @@ -441,7 +441,7 @@
    5.13           </widget>
    5.14          </item>
    5.15          <item>
    5.16 -         <widget class="QLineEdit" name="lineEditPreScript" />
    5.17 +         <widget class="QLineEdit" name="lineEditPostScript" />
    5.18          </item>
    5.19          <item>
    5.20           <widget class="QPushButton" name="browsePostExportButton" >
     6.1 --- a/floatimageobj.cpp	Tue Dec 04 12:32:56 2007 +0000
     6.2 +++ b/floatimageobj.cpp	Tue Dec 04 12:32:59 2007 +0000
     6.3 @@ -193,7 +193,7 @@
     6.4  	QString nameAttr=attribut ("orgName",originalFilename);
     6.5  
     6.6      return singleElement ("floatimage",  
     6.7 -		getOrnAttr() 
     6.8 +		getOrnXMLAttr() 
     6.9  		+useOrientAttr 
    6.10  		+saveInMapAttr 
    6.11  		+exportAttr  
     7.1 --- a/highlighter.cpp	Tue Dec 04 12:32:56 2007 +0000
     7.2 +++ b/highlighter.cpp	Tue Dec 04 12:32:59 2007 +0000
     7.3 @@ -85,6 +85,7 @@
     7.4  					<< "\\bsetURL\\b" 
     7.5  					<< "\\bsetVymLink\\b" 
     7.6  					<< "\\bsetFlag\\b" 
     7.7 +					<< "\\bsortChildren\\b" 
     7.8  					<< "\\btoggleFlag\\b" 
     7.9  					<< "\\bunscroll\\b" 
    7.10  					<< "\\bunscrollChilds\\b" 
     8.1 --- a/mainwindow.cpp	Tue Dec 04 12:32:56 2007 +0000
     8.2 +++ b/mainwindow.cpp	Tue Dec 04 12:32:59 2007 +0000
     8.3 @@ -1395,7 +1395,7 @@
     8.4      a = new QAction( tr( "Autosave","Settings action"), this);
     8.5      a->setStatusTip( tr( "Autosave"));
     8.6  	a->setToggleAction(true);
     8.7 -	a->setOn ( settings.value ("/mapeditor/autosave/use",true).toBool());
     8.8 +	a->setOn ( settings.value ("/mapeditor/autosave/use",false).toBool());
     8.9      connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveToggle() ) );
    8.10  	settingsMenu->addAction (a);
    8.11  	actionSettingsAutosaveToggle=a;
    8.12 @@ -1406,8 +1406,8 @@
    8.13  	settingsMenu->addAction (a);
    8.14  	actionSettingsAutosaveTime=a;
    8.15  
    8.16 -    a = new QAction( tr( "Backup file","Settings action"), this);
    8.17 -    a->setStatusTip( tr( "Write backup file"));
    8.18 +    a = new QAction( tr( "Write backup file on save","Settings action"), this);
    8.19 +    a->setStatusTip( tr( "Write backup file on save"));
    8.20  	a->setToggleAction(true);
    8.21  	a->setOn ( settings.value ("/mainwindow/writeBackupFile",false).toBool());
    8.22      connect( a, SIGNAL( triggered() ), this, SLOT( settingsWriteBackupFileToggle() ) );
    8.23 @@ -2845,11 +2845,22 @@
    8.24  	*/
    8.25  }
    8.26  
    8.27 +#include "attribute.h"
    8.28  #include "attributedialog.h"
    8.29  void Main::editAttribute()
    8.30  {
    8.31 -	AttributeDialog dia;
    8.32 -	dia.exec();
    8.33 +	MapEditor *me=currentMapEditor();
    8.34 +	if (me)
    8.35 +	{
    8.36 +		BranchObj *bo=me->getSelectedBranch();
    8.37 +		if (bo)
    8.38 +		{
    8.39 +			AttributeDialog dia(this);
    8.40 +			dia.setTable (me->attributeTable() );
    8.41 +			dia.setBranch (bo);
    8.42 +			dia.exec();
    8.43 +		}
    8.44 +	}	
    8.45  	/*
    8.46  	if (currentMapEditor())
    8.47  	{
    8.48 @@ -3472,12 +3483,11 @@
    8.49  
    8.50  	if(currentMapEditor())
    8.51  	{
    8.52 -		LinkableMapObj *sel=currentMapEditor()->getSelection();
    8.53 -		if (sel && (typeid(*sel) == typeid(BranchObj) ||
    8.54 -		           typeid(*sel) == typeid(MapCenterObj)))
    8.55 +		BranchObj *bo=currentMapEditor()->getSelectedBranch();
    8.56 +		if (bo) 
    8.57  		{
    8.58  			branchPropertyWindow->setMapEditor(currentMapEditor());
    8.59 -			branchPropertyWindow->setBranch((BranchObj*)sel);
    8.60 +			branchPropertyWindow->setBranch(bo);
    8.61  			return;
    8.62  		}
    8.63  		
     9.1 --- a/mapcenterobj.cpp	Tue Dec 04 12:32:56 2007 +0000
     9.2 +++ b/mapcenterobj.cpp	Tue Dec 04 12:32:59 2007 +0000
     9.3 @@ -137,7 +137,7 @@
     9.4  	QString linkAttr=getLinkAttr();
     9.5  
     9.6      s=beginElement ("mapcenter" 
     9.7 -		+getOrnAttr() 
     9.8 +		+getOrnXMLAttr() 
     9.9  		+areaAttr 
    9.10  		+idAttr 
    9.11  		+getIncludeImageAttr() );
    10.1 --- a/mapeditor.cpp	Tue Dec 04 12:32:56 2007 +0000
    10.2 +++ b/mapeditor.cpp	Tue Dec 04 12:32:59 2007 +0000
    10.3 @@ -130,7 +130,7 @@
    10.4  	blockReposition=false;
    10.5  	blockSaveState=false;
    10.6  
    10.7 -	hidemode=BranchObj::HideNone;
    10.8 +	hidemode=HideNone;
    10.9  
   10.10  	// Create temporary files
   10.11  	makeTmpDirs();
   10.12 @@ -153,6 +153,20 @@
   10.13  
   10.14  	// Network
   10.15  	netstate=Offline;
   10.16 +
   10.17 +	// Attributes
   10.18 +	attrTable= new AttributeTable();
   10.19 +	attrTable->addKey ("Key A - Priority");
   10.20 +	attrTable->addValue ("Key A","P 1");
   10.21 +	attrTable->addValue ("Key A","P 2");
   10.22 +	attrTable->addValue ("Key A","P 3");
   10.23 +	attrTable->addValue ("Key A","P 4");
   10.24 +	attrTable->addKey ("Key B");
   10.25 +	attrTable->addValue ("Key B","w1");
   10.26 +	attrTable->addValue ("Key B","w2");
   10.27 +	attrTable->addKey ("Key Prio");
   10.28 +	attrTable->addValue ("Key Prio","Prio 1");
   10.29 +	attrTable->addValue ("Key Prio","Prio 2");
   10.30  }
   10.31  
   10.32  MapEditor::~MapEditor()
   10.33 @@ -1765,7 +1779,7 @@
   10.34  	return pix;
   10.35  }
   10.36  
   10.37 -void MapEditor::setHideTmpMode (BranchObj::HideTmpMode mode)
   10.38 +void MapEditor::setHideTmpMode (HideTmpMode mode)
   10.39  {
   10.40  	hidemode=mode;
   10.41  	mapCenter->setHideTmp (hidemode);
   10.42 @@ -1773,7 +1787,7 @@
   10.43  	scene()->update();
   10.44  }
   10.45  
   10.46 -BranchObj::HideTmpMode MapEditor::getHideTmpMode()
   10.47 +HideTmpMode MapEditor::getHideTmpMode()
   10.48  {
   10.49  	return hidemode;
   10.50  }
   10.51 @@ -1783,9 +1797,9 @@
   10.52  	// should be called before and after exports
   10.53  	// depending on the settings
   10.54  	if (b && settings.value("/export/useHideExport","true")=="true")
   10.55 -		setHideTmpMode (BranchObj::HideExport);
   10.56 +		setHideTmpMode (HideExport);
   10.57  	else	
   10.58 -		setHideTmpMode (BranchObj::HideNone);
   10.59 +		setHideTmpMode (HideNone);
   10.60  }
   10.61  
   10.62  void MapEditor::exportASCII(QString fname,bool askName)
   10.63 @@ -4158,6 +4172,11 @@
   10.64  	}
   10.65  }
   10.66  
   10.67 +AttributeTable* MapEditor::attributeTable()
   10.68 +{
   10.69 +	return attrTable;
   10.70 +}
   10.71 +
   10.72  void MapEditor::testFunction1()
   10.73  {
   10.74  /*
   10.75 @@ -4194,12 +4213,20 @@
   10.76  	
   10.77  void MapEditor::testFunction2()
   10.78  {
   10.79 +	// Toggle hidemode
   10.80 +	if (hidemode==HideExport)
   10.81 +		setHideTmpMode (HideNone);
   10.82 +	else	
   10.83 +		setHideTmpMode (HideExport);
   10.84 +		
   10.85 +/*
   10.86  	LinkableMapObj *lmo=xelection.getBranch();
   10.87  	if (lmo) 
   10.88  	{
   10.89  		cout << "LMO::id="<<lmo->getID().ascii()<<endl;
   10.90  		cout << " BO::id="<<((BranchObj*)lmo)->getID().ascii()<<endl;
   10.91  	}	
   10.92 +*/	
   10.93  }
   10.94  
   10.95  void MapEditor::contextMenuEvent ( QContextMenuEvent * e )
    11.1 --- a/mapeditor.h	Tue Dec 04 12:32:56 2007 +0000
    11.2 +++ b/mapeditor.h	Tue Dec 04 12:32:59 2007 +0000
    11.3 @@ -143,8 +143,8 @@
    11.4  	void setSmoothPixmap(bool); //!< Set or unset smoothing of pixmaps
    11.5  private:
    11.6      QPixmap getPixmap();
    11.7 -	void setHideTmpMode (BranchObj::HideTmpMode);	// temporary hide stuff
    11.8 -	BranchObj::HideTmpMode getHideTmpMode();		// temporary hide stuff
    11.9 +	void setHideTmpMode (HideTmpMode);	// temporary hide stuff
   11.10 +	HideTmpMode getHideTmpMode();		// temporary hide stuff
   11.11  public:
   11.12  	/*! Set or unset temporary hiding of objects during export  */
   11.13  	void setExportMode (bool);
   11.14 @@ -321,6 +321,7 @@
   11.15      void importDir();
   11.16  	void followXLink (int);
   11.17  	void editXLink (int);
   11.18 +	AttributeTable* attributeTable();
   11.19      void testFunction1();					// just testing new stuff
   11.20      void testFunction2();					// just testing new stuff
   11.21  											// set /mainwindo/showTestMenu=true...
   11.22 @@ -400,6 +401,8 @@
   11.23  
   11.24  	Parser parser;				// Parser stuff for scripting
   11.25  
   11.26 +	AttributeTable *attrTable;
   11.27 +
   11.28  	bool printFrame;			// Print frame around map
   11.29  	bool printFooter;			// Print footer below map
   11.30  
   11.31 @@ -426,10 +429,7 @@
   11.32  	bool EOFind;				// true, if search failed
   11.33  
   11.34  	QPoint exportOffset;		// set before export, used in save
   11.35 -	BranchObj::HideTmpMode hidemode;	// true while exporting to hide some stuff
   11.36 -
   11.37 -	QList <Attribute> attributes;	// List with attributes
   11.38 -
   11.39 +	HideTmpMode hidemode;	// true while exporting to hide some stuff
   11.40  
   11.41  	// Network connections **Experimental**
   11.42  	NetState netstate;			// offline, client, server
    12.1 --- a/ornamentedobj.cpp	Tue Dec 04 12:32:56 2007 +0000
    12.2 +++ b/ornamentedobj.cpp	Tue Dec 04 12:32:59 2007 +0000
    12.3 @@ -57,6 +57,8 @@
    12.4  	standardFlags->clone(standardFlagsDefault);
    12.5  	standardFlags->setName ("standardFlags");
    12.6  
    12.7 +	attributes.clear();
    12.8 +
    12.9  	frame = new FrameObj (scene);
   12.10  
   12.11  	hideExport=false;
   12.12 @@ -342,6 +344,16 @@
   12.13  	return vymLink;
   12.14  }
   12.15  
   12.16 +QList <Attribute> OrnamentedObj::getAttributes()
   12.17 +{
   12.18 +	return attributes;
   12.19 +}
   12.20 +
   12.21 +
   12.22 +void OrnamentedObj::setAttributes (const QList <Attribute> &al)
   12.23 +{
   12.24 +	attributes=al;
   12.25 +}
   12.26  
   12.27  void OrnamentedObj::clearStandardFlags()
   12.28  {
   12.29 @@ -459,7 +471,7 @@
   12.30  	return hidden;
   12.31  }	
   12.32  
   12.33 -QString OrnamentedObj::getOrnAttr()
   12.34 +QString OrnamentedObj::getOrnXMLAttr()
   12.35  {
   12.36  	QString posAttr;
   12.37  
    13.1 --- a/ornamentedobj.h	Tue Dec 04 12:32:56 2007 +0000
    13.2 +++ b/ornamentedobj.h	Tue Dec 04 12:32:59 2007 +0000
    13.3 @@ -1,6 +1,7 @@
    13.4  #ifndef ORNAMENTEDOBJ_H
    13.5  #define ORNAMENTEDOBJ_H
    13.6  
    13.7 +#include "attribute.h"
    13.8  #include "frameobj.h"
    13.9  #include "linkablemapobj.h"
   13.10  
   13.11 @@ -58,11 +59,16 @@
   13.12      virtual QString getNoteASCII(const QString &indent, const int &width); // returns note	(ASCII)
   13.13      virtual QString getNoteASCII();			// returns note	(ASCII)
   13.14      virtual QString getNoteOpenDoc();		// returns note	(OpenDoc)
   13.15 +
   13.16      virtual void setURL (QString);
   13.17      virtual QString getURL ();
   13.18 +
   13.19      virtual void setVymLink (QString);
   13.20      virtual QString getVymLink ();
   13.21  
   13.22 +	virtual QList <Attribute> getAttributes ();
   13.23 +	virtual void setAttributes (const QList <Attribute> &al);
   13.24 +
   13.25  	virtual void clearStandardFlags();
   13.26  	virtual void toggleStandardFlag(QString, bool exclusive=false);
   13.27  	virtual void activateStandardFlag(QString);
   13.28 @@ -76,7 +82,7 @@
   13.29  	virtual void setHideInExport(bool);		// set export of object (and childs)
   13.30  	virtual bool hideInExport();
   13.31  	virtual bool isHidden ();
   13.32 -	virtual QString getOrnAttr();			// get attributes for saveToDir
   13.33 +	virtual QString getOrnXMLAttr();		// get attributes for saveToDir
   13.34  
   13.35  protected:
   13.36      HeadingObj *heading;			// Heading
   13.37 @@ -88,6 +94,8 @@
   13.38  	QRectF ornamentsBBox;			// bbox of flags and heading
   13.39  	QString url;					// url to external doc
   13.40  	QString vymLink;				// path to another map
   13.41 +	QList <Attribute> attributes;	// List with attributes
   13.42 +
   13.43  	bool hideExport;				// hide in exports if set
   13.44  	bool hidden;					// true if temporary hidden
   13.45  };
    14.1 --- a/tex/vym.changelog	Tue Dec 04 12:32:56 2007 +0000
    14.2 +++ b/tex/vym.changelog	Tue Dec 04 12:32:59 2007 +0000
    14.3 @@ -1,3 +1,13 @@
    14.4 +-------------------------------------------------------------------
    14.5 +Tue Dec  4 11:46:02 CET 2007 - uwedr@suse.de
    14.6 +
    14.7 +- Bugfix: Temporary hide stuff during export 
    14.8 +
    14.9 +-------------------------------------------------------------------
   14.10 +Mon Dec  3 20:57:15 CET 2007 - uwedr@suse.de
   14.11 +
   14.12 +- Bugfix: (Maint.) Exchanged pre- and postscript in XHTML Export dialog
   14.13 +
   14.14  -------------------------------------------------------------------
   14.15  Fri Nov  9 10:44:59 CET 2007 - uwedr@suse.de
   14.16  
    15.1 --- a/version.h	Tue Dec 04 12:32:56 2007 +0000
    15.2 +++ b/version.h	Tue Dec 04 12:32:59 2007 +0000
    15.3 @@ -7,7 +7,7 @@
    15.4  #define __VYM_VERSION "1.11.3"
    15.5  //#define __VYM_CODENAME "Codename: 1.10.0-RC-3"
    15.6  #define __VYM_CODENAME "Codename: development version"
    15.7 -#define __VYM_BUILD_DATE "2007-11-09"
    15.8 +#define __VYM_BUILD_DATE "2007-12-04"
    15.9  
   15.10  
   15.11  bool checkVersion(const QString &);
    16.1 --- a/vym.pro	Tue Dec 04 12:32:56 2007 +0000
    16.2 +++ b/vym.pro	Tue Dec 04 12:32:59 2007 +0000
    16.3 @@ -118,7 +118,6 @@
    16.4  
    16.5  FORMS = \
    16.6  	attributewidget.ui \
    16.7 -	attributedialog.ui \
    16.8  	branchpropwindow.ui \
    16.9  	exportxhtmldialog.ui \
   16.10  	extrainfodialog.ui \