included <typeinfo>
authorinsilmaril
Tue, 16 Oct 2007 09:53:22 +0000
changeset 600a9fe976e01a6
parent 599 e1d06cd563da
child 601 54475d6f006a
included <typeinfo>
exports.cpp
mainwindow.cpp
mainwindow.h
mapeditor.cpp
     1.1 --- a/exports.cpp	Tue Oct 16 09:53:22 2007 +0000
     1.2 +++ b/exports.cpp	Tue Oct 16 09:53:22 2007 +0000
     1.3 @@ -151,26 +151,29 @@
     1.4  		// Make indentstring
     1.5  		for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
     1.6  
     1.7 -		if (bo->getDepth()==0)
     1.8 +		if (!bo->hasHiddenExportParent() )
     1.9  		{
    1.10 -			ts << (bo->getHeading()+ "\n");
    1.11 -			for (j=0;j<bo->getHeading().length();j++) ts<<"=";
    1.12 -			ts << "\n";
    1.13 -		} else 	if (bo->getDepth()==1)
    1.14 -			ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n");
    1.15 -		else	if (bo->getDepth()==2)
    1.16 -			ts << (actIndent + " * " + bo->getHeading()+ "\n");
    1.17 -		else	if (bo->getDepth()==3)
    1.18 -			ts << (actIndent + " o " + bo->getHeading()+ "\n");
    1.19 -		else	
    1.20 -			ts << (actIndent + " - " + bo->getHeading()+ "\n");
    1.21 -		
    1.22 -		// If necessary, write note
    1.23 -		if (!bo->getNote().isEmpty())
    1.24 -		{
    1.25 -			s =bo->getNoteASCII();
    1.26 -			s=s.replace ("\n","\n"+actIndent);
    1.27 -			ts << (s+"\n\n");
    1.28 +			if (bo->getDepth()==0)
    1.29 +			{
    1.30 +				ts << (bo->getHeading()+ "\n");
    1.31 +				for (j=0;j<bo->getHeading().length();j++) ts<<"=";
    1.32 +				ts << "\n";
    1.33 +			} else 	if (bo->getDepth()==1)
    1.34 +				ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n");
    1.35 +			else	if (bo->getDepth()==2)
    1.36 +				ts << (actIndent + " * " + bo->getHeading()+ "\n");
    1.37 +			else	if (bo->getDepth()==3)
    1.38 +				ts << (actIndent + " o " + bo->getHeading()+ "\n");
    1.39 +			else	
    1.40 +				ts << (actIndent + " - " + bo->getHeading()+ "\n");
    1.41 +			
    1.42 +			// If necessary, write note
    1.43 +			if (!bo->getNote().isEmpty())
    1.44 +			{
    1.45 +				s =bo->getNoteASCII();
    1.46 +				s=s.replace ("\n","\n"+actIndent);
    1.47 +				ts << (s+"\n\n");
    1.48 +			}
    1.49  		}
    1.50  		bo=bo->next();
    1.51  		actIndent="";
    1.52 @@ -201,20 +204,23 @@
    1.53  	bo=mapCenter->first();
    1.54  	while (bo) 
    1.55  	{
    1.56 -		// If necessary, write note
    1.57 -		if (!bo->getNote().isEmpty())
    1.58 +		if (!bo->hasHiddenExportParent() )
    1.59  		{
    1.60 -			s =bo->getNoteASCII();
    1.61 -			s=s.replace ("\n","\n"+actIndent);
    1.62 -			ts << ("\""+s+"\",");
    1.63 -		} else
    1.64 -			ts <<"\"\",";
    1.65 +			// If necessary, write note
    1.66 +			if (!bo->getNote().isEmpty())
    1.67 +			{
    1.68 +				s =bo->getNoteASCII();
    1.69 +				s=s.replace ("\n","\n"+actIndent);
    1.70 +				ts << ("\""+s+"\",");
    1.71 +			} else
    1.72 +				ts <<"\"\",";
    1.73  
    1.74 -		// Make indentstring
    1.75 -		for (i=0;i<bo->getDepth();i++) actIndent+= "\"\",";
    1.76 +			// Make indentstring
    1.77 +			for (i=0;i<bo->getDepth();i++) actIndent+= "\"\",";
    1.78  
    1.79 -		// Write heading
    1.80 -		ts << actIndent << "\"" << bo->getHeading()<<"\""<<endl;
    1.81 +			// Write heading
    1.82 +			ts << actIndent << "\"" << bo->getHeading()<<"\""<<endl;
    1.83 +		}
    1.84  		
    1.85  		bo=bo->next();
    1.86  		actIndent="";
    1.87 @@ -340,27 +346,30 @@
    1.88    BranchObj *bo;
    1.89    bo=mapCenter->first();
    1.90    while (bo) {
    1.91 -	if (bo->getDepth()==0);
    1.92 -	else if (bo->getDepth()==1) {
    1.93 -	  ts << ("\\chapter{" + bo->getHeading()+ "}\n");
    1.94 -	}
    1.95 -	else if (bo->getDepth()==2) {
    1.96 -	  ts << ("\\section{" + bo->getHeading()+ "}\n");
    1.97 -	}
    1.98 -	else if (bo->getDepth()==3) {
    1.99 -	  ts << ("\\subsection{" + bo->getHeading()+ "}\n");
   1.100 -	}
   1.101 -	else if (bo->getDepth()==4) {
   1.102 -	  ts << ("\\subsubsection{" + bo->getHeading()+ "}\n");
   1.103 -	}
   1.104 -	else {
   1.105 -	  ts << ("\\paragraph*{" + bo->getHeading()+ "}\n");
   1.106 -	}
   1.107 -	
   1.108 -	// If necessary, write note
   1.109 -	if (!bo->getNote().isEmpty()) {
   1.110 -	  ts << (bo->getNoteASCII());
   1.111 -	  ts << ("\n");
   1.112 +	if (!bo->hasHiddenExportParent() )
   1.113 +	{
   1.114 +		if (bo->getDepth()==0);
   1.115 +		else if (bo->getDepth()==1) {
   1.116 +		  ts << ("\\chapter{" + bo->getHeading()+ "}\n");
   1.117 +		}
   1.118 +		else if (bo->getDepth()==2) {
   1.119 +		  ts << ("\\section{" + bo->getHeading()+ "}\n");
   1.120 +		}
   1.121 +		else if (bo->getDepth()==3) {
   1.122 +		  ts << ("\\subsection{" + bo->getHeading()+ "}\n");
   1.123 +		}
   1.124 +		else if (bo->getDepth()==4) {
   1.125 +		  ts << ("\\subsubsection{" + bo->getHeading()+ "}\n");
   1.126 +		}
   1.127 +		else {
   1.128 +		  ts << ("\\paragraph*{" + bo->getHeading()+ "}\n");
   1.129 +		}
   1.130 +		
   1.131 +		// If necessary, write note
   1.132 +		if (!bo->getNote().isEmpty()) {
   1.133 +		  ts << (bo->getNoteASCII());
   1.134 +		  ts << ("\n");
   1.135 +		}
   1.136  	}
   1.137      bo=bo->next();
   1.138     }
   1.139 @@ -386,22 +395,25 @@
   1.140      bo=current->getFirstBranch();
   1.141      if (bo)
   1.142      {
   1.143 -        // Start list
   1.144 -        r+="<text:list text:style-name=\"vym-list\">\n";
   1.145 -        while (bo)
   1.146 -        {
   1.147 -			r+="<text:list-item><text:p >";
   1.148 -			r+=quotemeta(bo->getHeading());
   1.149 -			// If necessary, write note
   1.150 -			if (!bo->getNote().isEmpty())
   1.151 -				r+=bo->getNoteOpenDoc();
   1.152 -			r+="</text:p>";
   1.153 -			r+=buildList (bo);	// recursivly add deeper branches
   1.154 -			r+="</text:list-item>\n";
   1.155 -			i++;
   1.156 -			bo=current->getBranchNum(i);
   1.157 -        }
   1.158 -        r+="</text:list>\n";
   1.159 +		if (!bo->hasHiddenExportParent() )
   1.160 +		{
   1.161 +			// Start list
   1.162 +			r+="<text:list text:style-name=\"vym-list\">\n";
   1.163 +			while (bo)
   1.164 +			{
   1.165 +				r+="<text:list-item><text:p >";
   1.166 +				r+=quotemeta(bo->getHeading());
   1.167 +				// If necessary, write note
   1.168 +				if (!bo->getNote().isEmpty())
   1.169 +					r+=bo->getNoteOpenDoc();
   1.170 +				r+="</text:p>";
   1.171 +				r+=buildList (bo);	// recursivly add deeper branches
   1.172 +				r+="</text:list-item>\n";
   1.173 +				i++;
   1.174 +				bo=current->getBranchNum(i);
   1.175 +			}
   1.176 +			r+="</text:list>\n";
   1.177 +		}
   1.178      }
   1.179      return r;
   1.180  }
   1.181 @@ -424,7 +436,7 @@
   1.182      int j=0;
   1.183  
   1.184  	// Walk sections
   1.185 -	while (sectionBO)
   1.186 +	while (sectionBO && !sectionBO->hasHiddenExportParent() )
   1.187  	{
   1.188  		if (useSections)
   1.189  		{
   1.190 @@ -442,7 +454,7 @@
   1.191  		// Walk mainpages
   1.192  		pagesBO=sectionBO->getFirstBranch();
   1.193  		j=0;
   1.194 -		while (pagesBO)
   1.195 +		while (pagesBO && !pagesBO->hasHiddenExportParent() )
   1.196  		{
   1.197  			// Add page with list of items
   1.198  			onePage=pageTemplate;
     2.1 --- a/mainwindow.cpp	Tue Oct 16 09:53:22 2007 +0000
     2.2 +++ b/mainwindow.cpp	Tue Oct 16 09:53:22 2007 +0000
     2.3 @@ -158,6 +158,8 @@
     2.4  		#endif
     2.5  		settings.setValue( p,s);
     2.6  
     2.7 +	// width of xLinksMenu
     2.8 +	xLinkMenuWidth=60;
     2.9  	
    2.10  	// Create tab widget which holds the maps
    2.11  	tabWidget= new QTabWidget (this);
    2.12 @@ -643,7 +645,6 @@
    2.13  
    2.14  	a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this);
    2.15  	a->setStatusTip ( tr( "Edit URL" ) );
    2.16 -	//a->setShortcut (Qt::SHIFT + Qt::CTRL + Qt::Key_U );
    2.17  	a->setShortcut ( Qt::Key_U );
    2.18  	a->setShortcutContext (Qt::WindowShortcut);
    2.19  	actionListBranches.append(a);
    2.20 @@ -658,7 +659,7 @@
    2.21  	actionListBranches.append(a);
    2.22  	addAction(a);
    2.23      connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) );
    2.24 -	actionEditURL=a;
    2.25 +	actionEditLocalURL=a;
    2.26  	
    2.27  	a = new QAction( tr( "Use heading for URL","Edit menu" ), this);
    2.28  	a->setStatusTip ( tr( "Use heading of selected branch as URL" ));
    2.29 @@ -1501,6 +1502,7 @@
    2.30  		branchLinksContextMenu->addAction ( actionEditOpenURLTab );
    2.31  		branchLinksContextMenu->addAction ( actionEditOpenMultipleURLTabs );
    2.32  		branchLinksContextMenu->addAction ( actionEditURL );
    2.33 +		branchLinksContextMenu->addAction ( actionEditLocalURL );
    2.34  		branchLinksContextMenu->addAction ( actionEditHeading2URL );
    2.35  		branchLinksContextMenu->addAction ( actionEditBugzilla2URL );
    2.36  		if (settings.value( "/mainwindow/showTestMenu",false).toBool() )
    2.37 @@ -3411,8 +3413,8 @@
    2.38  					if (bot)
    2.39  					{
    2.40  						s=bot->getHeading();
    2.41 -						if (s.length()>25)
    2.42 -							s=s.left(25)+"...";
    2.43 +						if (s.length()>xLinkMenuWidth)
    2.44 +							s=s.left(xLinkMenuWidth)+"...";
    2.45  						branchXLinksContextMenuFollow->addAction (s);
    2.46  						branchXLinksContextMenuEdit->addAction (s);
    2.47  					}	
     3.1 --- a/mainwindow.h	Tue Oct 16 09:53:22 2007 +0000
     3.2 +++ b/mainwindow.h	Tue Oct 16 09:53:22 2007 +0000
     3.3 @@ -10,7 +10,7 @@
     3.4  #include "mapeditor.h"
     3.5  #include "simplescripteditor.h"
     3.6  #include "texteditor.h"
     3.7 -//#include "xml.h"
     3.8 +
     3.9  
    3.10  class Main : public QMainWindow 
    3.11  {
    3.12 @@ -236,6 +236,8 @@
    3.13  
    3.14  	QColor currentColor;
    3.15  
    3.16 +	int xLinkMenuWidth;
    3.17 +
    3.18  	QMenu *recentFilesMenu;
    3.19  	enum { MaxRecentFiles = 9 };
    3.20      QAction *recentFileActions[MaxRecentFiles];
     4.1 --- a/mapeditor.cpp	Tue Oct 16 09:53:22 2007 +0000
     4.2 +++ b/mapeditor.cpp	Tue Oct 16 09:53:22 2007 +0000
     4.3 @@ -1765,7 +1765,7 @@
     4.4  {
     4.5  	// should be called before and after exports
     4.6  	// depending on the settings
     4.7 -	if (b && settings.value("/export/useHideExport","yes")=="yes")
     4.8 +	if (b && settings.value("/export/useHideExport","true")=="true")
     4.9  		setHideTmpMode (BranchObj::HideExport);
    4.10  	else	
    4.11  		setHideTmpMode (BranchObj::HideNone);