# HG changeset patch # User insilmaril # Date 1192528402 0 # Node ID a9fe976e01a684c22adc66eb65d818499a5c6769 # Parent e1d06cd563da54606723b69cfd920f029ebbf7f4 included diff -r e1d06cd563da -r a9fe976e01a6 exports.cpp --- a/exports.cpp Tue Oct 16 09:53:22 2007 +0000 +++ b/exports.cpp Tue Oct 16 09:53:22 2007 +0000 @@ -151,26 +151,29 @@ // Make indentstring for (i=0;igetDepth();i++) actIndent+= indentPerDepth; - if (bo->getDepth()==0) + if (!bo->hasHiddenExportParent() ) { - ts << (bo->getHeading()+ "\n"); - for (j=0;jgetHeading().length();j++) ts<<"="; - ts << "\n"; - } else if (bo->getDepth()==1) - ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n"); - else if (bo->getDepth()==2) - ts << (actIndent + " * " + bo->getHeading()+ "\n"); - else if (bo->getDepth()==3) - ts << (actIndent + " o " + bo->getHeading()+ "\n"); - else - ts << (actIndent + " - " + bo->getHeading()+ "\n"); - - // If necessary, write note - if (!bo->getNote().isEmpty()) - { - s =bo->getNoteASCII(); - s=s.replace ("\n","\n"+actIndent); - ts << (s+"\n\n"); + if (bo->getDepth()==0) + { + ts << (bo->getHeading()+ "\n"); + for (j=0;jgetHeading().length();j++) ts<<"="; + ts << "\n"; + } else if (bo->getDepth()==1) + ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n"); + else if (bo->getDepth()==2) + ts << (actIndent + " * " + bo->getHeading()+ "\n"); + else if (bo->getDepth()==3) + ts << (actIndent + " o " + bo->getHeading()+ "\n"); + else + ts << (actIndent + " - " + bo->getHeading()+ "\n"); + + // If necessary, write note + if (!bo->getNote().isEmpty()) + { + s =bo->getNoteASCII(); + s=s.replace ("\n","\n"+actIndent); + ts << (s+"\n\n"); + } } bo=bo->next(); actIndent=""; @@ -201,20 +204,23 @@ bo=mapCenter->first(); while (bo) { - // If necessary, write note - if (!bo->getNote().isEmpty()) + if (!bo->hasHiddenExportParent() ) { - s =bo->getNoteASCII(); - s=s.replace ("\n","\n"+actIndent); - ts << ("\""+s+"\","); - } else - ts <<"\"\","; + // If necessary, write note + if (!bo->getNote().isEmpty()) + { + s =bo->getNoteASCII(); + s=s.replace ("\n","\n"+actIndent); + ts << ("\""+s+"\","); + } else + ts <<"\"\","; - // Make indentstring - for (i=0;igetDepth();i++) actIndent+= "\"\","; + // Make indentstring + for (i=0;igetDepth();i++) actIndent+= "\"\","; - // Write heading - ts << actIndent << "\"" << bo->getHeading()<<"\""<getHeading()<<"\""<next(); actIndent=""; @@ -340,27 +346,30 @@ BranchObj *bo; bo=mapCenter->first(); while (bo) { - if (bo->getDepth()==0); - else if (bo->getDepth()==1) { - ts << ("\\chapter{" + bo->getHeading()+ "}\n"); - } - else if (bo->getDepth()==2) { - ts << ("\\section{" + bo->getHeading()+ "}\n"); - } - else if (bo->getDepth()==3) { - ts << ("\\subsection{" + bo->getHeading()+ "}\n"); - } - else if (bo->getDepth()==4) { - ts << ("\\subsubsection{" + bo->getHeading()+ "}\n"); - } - else { - ts << ("\\paragraph*{" + bo->getHeading()+ "}\n"); - } - - // If necessary, write note - if (!bo->getNote().isEmpty()) { - ts << (bo->getNoteASCII()); - ts << ("\n"); + if (!bo->hasHiddenExportParent() ) + { + if (bo->getDepth()==0); + else if (bo->getDepth()==1) { + ts << ("\\chapter{" + bo->getHeading()+ "}\n"); + } + else if (bo->getDepth()==2) { + ts << ("\\section{" + bo->getHeading()+ "}\n"); + } + else if (bo->getDepth()==3) { + ts << ("\\subsection{" + bo->getHeading()+ "}\n"); + } + else if (bo->getDepth()==4) { + ts << ("\\subsubsection{" + bo->getHeading()+ "}\n"); + } + else { + ts << ("\\paragraph*{" + bo->getHeading()+ "}\n"); + } + + // If necessary, write note + if (!bo->getNote().isEmpty()) { + ts << (bo->getNoteASCII()); + ts << ("\n"); + } } bo=bo->next(); } @@ -386,22 +395,25 @@ bo=current->getFirstBranch(); if (bo) { - // Start list - r+="\n"; - while (bo) - { - r+=""; - r+=quotemeta(bo->getHeading()); - // If necessary, write note - if (!bo->getNote().isEmpty()) - r+=bo->getNoteOpenDoc(); - r+=""; - r+=buildList (bo); // recursivly add deeper branches - r+="\n"; - i++; - bo=current->getBranchNum(i); - } - r+="\n"; + if (!bo->hasHiddenExportParent() ) + { + // Start list + r+="\n"; + while (bo) + { + r+=""; + r+=quotemeta(bo->getHeading()); + // If necessary, write note + if (!bo->getNote().isEmpty()) + r+=bo->getNoteOpenDoc(); + r+=""; + r+=buildList (bo); // recursivly add deeper branches + r+="\n"; + i++; + bo=current->getBranchNum(i); + } + r+="\n"; + } } return r; } @@ -424,7 +436,7 @@ int j=0; // Walk sections - while (sectionBO) + while (sectionBO && !sectionBO->hasHiddenExportParent() ) { if (useSections) { @@ -442,7 +454,7 @@ // Walk mainpages pagesBO=sectionBO->getFirstBranch(); j=0; - while (pagesBO) + while (pagesBO && !pagesBO->hasHiddenExportParent() ) { // Add page with list of items onePage=pageTemplate; diff -r e1d06cd563da -r a9fe976e01a6 mainwindow.cpp --- a/mainwindow.cpp Tue Oct 16 09:53:22 2007 +0000 +++ b/mainwindow.cpp Tue Oct 16 09:53:22 2007 +0000 @@ -158,6 +158,8 @@ #endif settings.setValue( p,s); + // width of xLinksMenu + xLinkMenuWidth=60; // Create tab widget which holds the maps tabWidget= new QTabWidget (this); @@ -643,7 +645,6 @@ a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this); a->setStatusTip ( tr( "Edit URL" ) ); - //a->setShortcut (Qt::SHIFT + Qt::CTRL + Qt::Key_U ); a->setShortcut ( Qt::Key_U ); a->setShortcutContext (Qt::WindowShortcut); actionListBranches.append(a); @@ -658,7 +659,7 @@ actionListBranches.append(a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) ); - actionEditURL=a; + actionEditLocalURL=a; a = new QAction( tr( "Use heading for URL","Edit menu" ), this); a->setStatusTip ( tr( "Use heading of selected branch as URL" )); @@ -1501,6 +1502,7 @@ branchLinksContextMenu->addAction ( actionEditOpenURLTab ); branchLinksContextMenu->addAction ( actionEditOpenMultipleURLTabs ); branchLinksContextMenu->addAction ( actionEditURL ); + branchLinksContextMenu->addAction ( actionEditLocalURL ); branchLinksContextMenu->addAction ( actionEditHeading2URL ); branchLinksContextMenu->addAction ( actionEditBugzilla2URL ); if (settings.value( "/mainwindow/showTestMenu",false).toBool() ) @@ -3411,8 +3413,8 @@ if (bot) { s=bot->getHeading(); - if (s.length()>25) - s=s.left(25)+"..."; + if (s.length()>xLinkMenuWidth) + s=s.left(xLinkMenuWidth)+"..."; branchXLinksContextMenuFollow->addAction (s); branchXLinksContextMenuEdit->addAction (s); } diff -r e1d06cd563da -r a9fe976e01a6 mainwindow.h --- a/mainwindow.h Tue Oct 16 09:53:22 2007 +0000 +++ b/mainwindow.h Tue Oct 16 09:53:22 2007 +0000 @@ -10,7 +10,7 @@ #include "mapeditor.h" #include "simplescripteditor.h" #include "texteditor.h" -//#include "xml.h" + class Main : public QMainWindow { @@ -236,6 +236,8 @@ QColor currentColor; + int xLinkMenuWidth; + QMenu *recentFilesMenu; enum { MaxRecentFiles = 9 }; QAction *recentFileActions[MaxRecentFiles]; diff -r e1d06cd563da -r a9fe976e01a6 mapeditor.cpp --- a/mapeditor.cpp Tue Oct 16 09:53:22 2007 +0000 +++ b/mapeditor.cpp Tue Oct 16 09:53:22 2007 +0000 @@ -1765,7 +1765,7 @@ { // should be called before and after exports // depending on the settings - if (b && settings.value("/export/useHideExport","yes")=="yes") + if (b && settings.value("/export/useHideExport","true")=="true") setHideTmpMode (BranchObj::HideExport); else setHideTmpMode (BranchObj::HideNone);