Rev 1097 | Rev 1103 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
564 | cbradney | 1 | /*************************************************************************** |
2 | * Copyright (C) 2004 by Craig Bradney * |
||
3 | * cbradney@zip.com.au * |
||
4 | * * |
||
5 | * This program is free software; you can redistribute it and/or modify * |
||
6 | * it under the terms of the GNU General Public License as published by * |
||
7 | * the Free Software Foundation; either version 2 of the License, or * |
||
8 | * (at your option) any later version. * |
||
9 | * * |
||
10 | * This program is distributed in the hope that it will be useful, * |
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
13 | * GNU General Public License for more details. * |
||
14 | * * |
||
15 | * You should have received a copy of the GNU General Public License * |
||
16 | * along with this program; if not, write to the * |
||
17 | * Free Software Foundation, Inc., * |
||
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||
19 | ***************************************************************************/ |
||
560 | cbradney | 20 | |
3 | paul | 21 | #include "helpbrowser.h" |
22 | #include "helpbrowser.moc" |
||
560 | cbradney | 23 | |
3 | paul | 24 | #include <qvariant.h> |
560 | cbradney | 25 | #include <qpushbutton.h> |
26 | #include <qtabwidget.h> |
||
27 | #include <qwidget.h> |
||
28 | #include <qheader.h> |
||
29 | #include <qlistview.h> |
||
30 | #include <qtextbrowser.h> |
||
31 | #include <qlayout.h> |
||
3 | paul | 32 | #include <qtooltip.h> |
560 | cbradney | 33 | #include <qtoolbutton.h> |
34 | #include <qwhatsthis.h> |
||
3 | paul | 35 | #include <qimage.h> |
36 | #include <qpixmap.h> |
||
560 | cbradney | 37 | #include <qpopupmenu.h> |
38 | #include <qfileinfo.h> |
||
3 | paul | 39 | #include <qtextcodec.h> |
560 | cbradney | 40 | #include <qdom.h> |
1033 | cbradney | 41 | #include <qdir.h> |
786 | cbradney | 42 | #include <qsplitter.h> |
128 | Franz | 43 | |
617 | cbradney | 44 | #ifdef _MSC_VER |
1033 | cbradney | 45 | #if (_MSC_VER >= 1200) |
46 | #include "win-config.h" |
||
47 | #endif |
||
128 | Franz | 48 | #else |
1033 | cbradney | 49 | #include "config.h" |
128 | Franz | 50 | #endif |
51 | |||
3 | paul | 52 | extern QPixmap loadIcon(QString nam); |
53 | |||
560 | cbradney | 54 | |
564 | cbradney | 55 | HelpBrowser::HelpBrowser( QWidget* parent, QString caption, QString guiLanguage, QString jumpToSection, QString jumpToFile) |
56 | : QWidget( parent, "Help", WType_TopLevel | WDestructiveClose ) |
||
3 | paul | 57 | { |
560 | cbradney | 58 | QString fileName; |
564 | cbradney | 59 | mHistory.clear(); |
60 | struct histd his; |
||
1092 | cbradney | 61 | language = guiLanguage=="" ? "en" : guiLanguage.left(2); |
564 | cbradney | 62 | helpBrowsermainLayout = new QVBoxLayout( this); |
63 | buttonLayout = new QHBoxLayout; |
||
64 | buttonLayout->setSpacing( 6 ); |
||
65 | buttonLayout->setMargin( 2 ); |
||
3 | paul | 66 | |
564 | cbradney | 67 | homeButton = new QToolButton( this, "homeButton" ); |
68 | homeButton->setText( "" ); |
||
69 | homeButton->setPixmap(loadIcon("gohome.png")); |
||
786 | cbradney | 70 | homeButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed, homeButton->sizePolicy().hasHeightForWidth() ) ); |
564 | cbradney | 71 | buttonLayout->addWidget( homeButton ); |
3 | paul | 72 | |
564 | cbradney | 73 | histMenu = new QPopupMenu( this ); |
74 | backButton = new QToolButton( this, "backButton" ); |
||
75 | backButton->setPixmap(loadIcon("back.png")); |
||
786 | cbradney | 76 | backButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed, backButton->sizePolicy().hasHeightForWidth() ) ); |
564 | cbradney | 77 | backButton->setPopup(histMenu); |
78 | backButton->setPopupDelay(0); |
||
79 | buttonLayout->addWidget( backButton ); |
||
3 | paul | 80 | |
564 | cbradney | 81 | forwButton = new QToolButton( this, "forwButton" ); |
82 | forwButton->setPixmap(loadIcon("forward.png")); |
||
786 | cbradney | 83 | forwButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed, forwButton->sizePolicy().hasHeightForWidth() ) ); |
564 | cbradney | 84 | buttonLayout->addWidget( forwButton ); |
85 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
||
86 | buttonLayout->addItem( spacer ); |
||
560 | cbradney | 87 | helpBrowsermainLayout->addLayout( buttonLayout ); |
88 | |||
564 | cbradney | 89 | helpBrowserLayout = new QHBoxLayout; |
786 | cbradney | 90 | splitter = new QSplitter(this, "splitter"); |
91 | splitter->setChildrenCollapsible( false ); |
||
92 | helpBrowserLayout->addWidget( splitter ); |
||
560 | cbradney | 93 | |
786 | cbradney | 94 | tabWidget = new QTabWidget( splitter, "tabWidget" ); |
95 | //tabWidget = new QTabWidget( this, "tabWidget" ); |
||
96 | splitter->setResizeMode(tabWidget, QSplitter::Stretch ); |
||
97 | tabWidget->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Expanding, false) ); |
||
564 | cbradney | 98 | tabContents = new QWidget( tabWidget, "tabContents" ); |
99 | tabLayout = new QHBoxLayout( tabContents, 11, 6, "tabLayout"); |
||
560 | cbradney | 100 | |
564 | cbradney | 101 | listView = new QListView( tabContents, "listView" ); |
102 | listView->addColumn( tr( "Contents" ) ); |
||
1097 | cbradney | 103 | listView->addColumn( tr( "Link" ) , 0 ); |
104 | // listView->addColumn( tr( "Link" ) ); |
||
105 | listView->setColumnWidthMode( 0, QListView::Maximum ); |
||
106 | listView->setColumnWidthMode( 1, QListView::Manual ); |
||
560 | cbradney | 107 | listView->setSorting(-1,-1); |
108 | listView->setRootIsDecorated( true ); |
||
109 | listView->setSelectionMode(QListView::Single); |
||
110 | listView->setDefaultRenameAction(QListView::Reject); |
||
111 | listView->clear(); |
||
564 | cbradney | 112 | tabLayout->addWidget( listView ); |
113 | |||
114 | tabWidget->insertTab( tabContents, QString("Contents") ); |
||
786 | cbradney | 115 | //helpBrowserLayout->addWidget( tabWidget ); |
560 | cbradney | 116 | |
786 | cbradney | 117 | textBrowser = new QTextBrowser( splitter, "textBrowser" ); |
118 | splitter->setResizeMode(textBrowser, QSplitter::Stretch); |
||
119 | //textBrowser = new QTextBrowser( this, "textBrowser" ); |
||
120 | textBrowser->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Expanding, false ) ); |
||
564 | cbradney | 121 | textBrowser->setFrameShape( QTextBrowser::StyledPanel ); |
786 | cbradney | 122 | //helpBrowserLayout->addWidget( textBrowser ); |
564 | cbradney | 123 | helpBrowsermainLayout->addLayout( helpBrowserLayout ); |
560 | cbradney | 124 | |
564 | cbradney | 125 | languageChange(); |
126 | resize( QSize(602, 491).expandedTo(minimumSizeHint()) ); |
||
127 | clearWState( WState_Polished ); |
||
1092 | cbradney | 128 | loadMenu(); |
560 | cbradney | 129 | listView->header()->hide(); |
1092 | cbradney | 130 | jumpToHelpSection(jumpToSection, jumpToFile ); |
560 | cbradney | 131 | |
132 | connect( homeButton, SIGNAL( clicked() ), textBrowser, SLOT( home() ) ); |
||
133 | connect( forwButton, SIGNAL( clicked() ), textBrowser, SLOT( forward() ) ); |
||
134 | connect( backButton, SIGNAL( clicked() ), textBrowser, SLOT( backward() ) ); |
||
564 | cbradney | 135 | connect( histMenu, SIGNAL(activated(int)), this, SLOT(histChosen(int))); |
136 | connect( listView, SIGNAL(clicked( QListViewItem *)), this, SLOT(itemSelected( QListViewItem *))); |
||
560 | cbradney | 137 | } |
138 | |||
139 | HelpBrowser::~HelpBrowser() |
||
140 | { |
||
564 | cbradney | 141 | // no need to delete child widgets, Qt does it all for us |
560 | cbradney | 142 | } |
143 | |||
144 | void HelpBrowser::languageChange() |
||
145 | { |
||
564 | cbradney | 146 | setCaption( tr( "Scribus Online Help" ) ); |
147 | listView->header()->setLabel( 0, tr( "Contents" ) ); |
||
148 | listView->clear(); |
||
560 | cbradney | 149 | |
564 | cbradney | 150 | tabWidget->changeTab( tabContents, tr( "Contents" ) ); |
560 | cbradney | 151 | } |
152 | |||
153 | |||
154 | void HelpBrowser::sourceChanged(const QString& url) |
||
155 | { |
||
564 | cbradney | 156 | bool inList = false; |
157 | struct histd his; |
||
158 | QString title = ""; |
||
159 | title = textBrowser->documentTitle(); |
||
160 | if (title == "") |
||
161 | title = url; |
||
786 | cbradney | 162 | for (QMap<int, histd>::Iterator it = mHistory.begin(); it != mHistory.end(); ++it) |
564 | cbradney | 163 | { |
164 | if (it.data().Title == title) |
||
165 | inList = true; |
||
166 | } |
||
167 | if (!inList) |
||
168 | { |
||
169 | his.Title = title; |
||
170 | his.Url = url; |
||
171 | mHistory[histMenu->insertItem(title)] = his; |
||
172 | } |
||
173 | if (mHistory.count() > 15) |
||
174 | { |
||
175 | int itk = histMenu->idAt(0); |
||
176 | mHistory.remove(itk); |
||
177 | histMenu->removeItem(itk); |
||
178 | } |
||
560 | cbradney | 179 | } |
180 | |||
181 | void HelpBrowser::histChosen(int i) |
||
182 | { |
||
564 | cbradney | 183 | if (mHistory.contains(i)) |
184 | textBrowser->setSource(mHistory[i].Url); |
||
560 | cbradney | 185 | } |
186 | |||
1092 | cbradney | 187 | void HelpBrowser::jumpToHelpSection(QString jumpToSection, QString jumpToFile) |
560 | cbradney | 188 | { |
189 | QString toLoad; |
||
190 | |||
564 | cbradney | 191 | if (jumpToFile=="") |
192 | { |
||
872 | cbradney | 193 | QString pfad = DOCDIR; |
1092 | cbradney | 194 | toLoad = pfad + language + "/"; //clean this later to handle 5 char locales |
564 | cbradney | 195 | if (jumpToSection=="") |
196 | { |
||
1097 | cbradney | 197 | //toLoad+="index.html"; |
198 | toLoad+=listView->firstChild()->text(1); |
||
560 | cbradney | 199 | listView->setSelected( listView->firstChild(), true ); |
205 | Franz | 200 | } |
564 | cbradney | 201 | else if (jumpToSection=="scripter") |
202 | { |
||
560 | cbradney | 203 | toLoad+="scripter1.html"; |
204 | QListViewItemIterator it(listView); |
||
564 | cbradney | 205 | while (it.current()) |
206 | { |
||
560 | cbradney | 207 | if (it.current()->text(1)=="scripter1.html") |
208 | listView->setSelected( it.current(), true ); |
||
209 | if (it.current()->text(1)=="developers.html") |
||
210 | it.current()->setOpen( true ); |
||
211 | ++it; |
||
212 | } |
||
213 | } |
||
205 | Franz | 214 | } |
560 | cbradney | 215 | else |
564 | cbradney | 216 | toLoad=jumpToFile; |
3 | paul | 217 | |
560 | cbradney | 218 | loadHelp(toLoad); |
3 | paul | 219 | } |
220 | |||
560 | cbradney | 221 | void HelpBrowser::loadHelp(QString filename) |
68 | Franz | 222 | { |
75 | Franz | 223 | struct histd his; |
564 | cbradney | 224 | bool Avail = true; |
560 | cbradney | 225 | QString toLoad; |
564 | cbradney | 226 | QFileInfo fi; |
227 | fi = QFileInfo(filename); |
||
1100 | cbradney | 228 | if (fi.fileName().length()>0) |
564 | cbradney | 229 | { |
1100 | cbradney | 230 | if (fi.exists()) |
231 | toLoad=filename; |
||
232 | else |
||
564 | cbradney | 233 | { |
1100 | cbradney | 234 | QString pfad = DOCDIR; |
235 | toLoad = pfad + "en/index.html"; |
||
236 | language="en"; |
||
237 | fi = QFileInfo(toLoad); |
||
238 | if (!fi.exists()) |
||
239 | { |
||
240 | textBrowser->setText("<h2>"+ tr("Sorry, no manual available! Please see: http://docs.scribus.net for updated docs\nand www.scribus.net for downloads.")+"</h2>"); |
||
241 | Avail = false; |
||
242 | } |
||
564 | cbradney | 243 | } |
244 | } |
||
1100 | cbradney | 245 | else |
246 | Avail=false; |
||
564 | cbradney | 247 | if (Avail) |
248 | { |
||
249 | textBrowser->setSource(toLoad); |
||
250 | his.Title = textBrowser->documentTitle(); |
||
251 | if (his.Title == "") |
||
252 | his.Title = toLoad; |
||
253 | his.Url = toLoad; |
||
254 | mHistory[histMenu->insertItem(his.Title)] = his; |
||
255 | } |
||
560 | cbradney | 256 | } |
257 | |||
1092 | cbradney | 258 | void HelpBrowser::loadMenu() |
560 | cbradney | 259 | { |
872 | cbradney | 260 | QString pfad = DOCDIR; |
786 | cbradney | 261 | QString toLoad; |
1092 | cbradney | 262 | QString pfad2 = pfad + language + "/menu.xml"; |
564 | cbradney | 263 | QFileInfo fi = QFileInfo(pfad2); |
786 | cbradney | 264 | |
793 | cbradney | 265 | if (fi.exists()) |
266 | toLoad=pfad2; |
||
267 | else |
||
268 | { |
||
872 | cbradney | 269 | toLoad = pfad + "en/menu.xml"; |
1092 | cbradney | 270 | language="en"; |
786 | cbradney | 271 | fi = QFileInfo(toLoad); |
272 | qDebug("Scribus help in your selected language does not exist, trying English. Otherwise, please visit http://docs.scribus.net."); |
||
273 | } |
||
274 | |||
560 | cbradney | 275 | if (fi.exists()) |
564 | cbradney | 276 | { |
560 | cbradney | 277 | QDomDocument doc( "menuentries" ); |
786 | cbradney | 278 | QFile file( toLoad ); |
560 | cbradney | 279 | if ( !file.open( IO_ReadOnly ) ) |
280 | return; |
||
564 | cbradney | 281 | if ( !doc.setContent( &file ) ) |
282 | { |
||
560 | cbradney | 283 | file.close(); |
284 | return; |
||
285 | } |
||
286 | file.close(); |
||
287 | |||
288 | QDomElement docElem = doc.documentElement(); |
||
289 | QDomNode n = docElem.firstChild(); |
||
290 | QListViewItem *qlvi=NULL, *qlvi2=NULL, *qlvi3=NULL, *qlvi4=NULL, *qlvi5=NULL, *qlvi6=NULL; |
||
1033 | cbradney | 291 | QListViewItem *tutorialsMenuItem; |
292 | bool haveTutorials=false; |
||
560 | cbradney | 293 | |
564 | cbradney | 294 | while( !n.isNull() ) |
295 | { |
||
560 | cbradney | 296 | QDomElement e = n.toElement(); // try to convert the node to an element. |
564 | cbradney | 297 | if( !e.isNull() ) |
298 | { |
||
299 | if (e.hasAttribute( "text" ) && e.hasAttribute( "file" )) |
||
300 | { |
||
560 | cbradney | 301 | QDomAttr textAttr = e.attributeNode( "text" ); |
302 | QDomAttr fileAttr = e.attributeNode( "file" ); |
||
303 | if (qlvi2==NULL) |
||
304 | qlvi=new QListViewItem(listView, textAttr.value(), fileAttr.value()); |
||
564 | cbradney | 305 | else |
1033 | cbradney | 306 | qlvi=new QListViewItem(listView, qlvi2, textAttr.value(), fileAttr.value()); |
307 | if (qlvi!=NULL && textAttr.value()=="Tutorials") |
||
564 | cbradney | 308 | { |
1033 | cbradney | 309 | haveTutorials=true; |
310 | tutorialsMenuItem=qlvi; |
||
560 | cbradney | 311 | } |
1033 | cbradney | 312 | |
560 | cbradney | 313 | if (qlvi!=NULL) |
314 | qlvi2=qlvi; |
||
315 | } |
||
316 | |||
317 | QDomNodeList nl=n.childNodes(); |
||
564 | cbradney | 318 | for(uint i=0 ; i<= nl.count() ; i++) |
319 | { |
||
560 | cbradney | 320 | QDomNode child=nl.item(i); |
564 | cbradney | 321 | if (child.isElement()) |
322 | { |
||
560 | cbradney | 323 | QDomElement ec = child.toElement(); |
564 | cbradney | 324 | if (!ec.isNull()) |
325 | { |
||
326 | if (ec.hasAttribute( "text" ) && ec.hasAttribute( "file" )) |
||
327 | { |
||
560 | cbradney | 328 | QDomAttr textAttr = ec.attributeNode( "text" ); |
329 | QDomAttr fileAttr = ec.attributeNode( "file" ); |
||
330 | if (qlvi4==NULL) |
||
331 | qlvi3=new QListViewItem(qlvi, textAttr.value(), fileAttr.value()); |
||
564 | cbradney | 332 | else |
1033 | cbradney | 333 | qlvi3=new QListViewItem(qlvi, qlvi4, textAttr.value(), fileAttr.value()); |
334 | if (qlvi3!=NULL && textAttr.value()=="Tutorials") |
||
564 | cbradney | 335 | { |
1033 | cbradney | 336 | haveTutorials=true; |
337 | tutorialsMenuItem=qlvi3; |
||
560 | cbradney | 338 | } |
339 | if (qlvi3!=NULL) |
||
340 | qlvi4=qlvi3; |
||
341 | } |
||
342 | //3rd level |
||
343 | QDomNodeList nl2=child.childNodes(); |
||
564 | cbradney | 344 | for(uint i=0 ; i<= nl2.count() ; i++) |
345 | { |
||
560 | cbradney | 346 | QDomNode childchild=nl2.item(i); |
564 | cbradney | 347 | if (childchild.isElement()) |
348 | { |
||
560 | cbradney | 349 | QDomElement ecc = childchild.toElement(); |
564 | cbradney | 350 | if (!ecc.isNull()) |
351 | { |
||
352 | if (ecc.hasAttribute( "text" ) && ecc.hasAttribute( "file" )) |
||
353 | { |
||
560 | cbradney | 354 | QDomAttr textAttr = ecc.attributeNode( "text" ); |
355 | QDomAttr fileAttr = ecc.attributeNode( "file" ); |
||
356 | if (qlvi6==NULL) |
||
357 | qlvi5=new QListViewItem(qlvi3, textAttr.value(), fileAttr.value()); |
||
564 | cbradney | 358 | else |
1033 | cbradney | 359 | qlvi5=new QListViewItem(qlvi3, qlvi6, textAttr.value(), fileAttr.value()); |
360 | if (qlvi5!=NULL && textAttr.value()=="Tutorials") |
||
564 | cbradney | 361 | { |
1033 | cbradney | 362 | haveTutorials=true; |
363 | tutorialsMenuItem=qlvi5; |
||
560 | cbradney | 364 | } |
365 | } |
||
366 | if (qlvi5!=NULL) |
||
367 | qlvi6=qlvi5; |
||
368 | } |
||
369 | } |
||
370 | } |
||
371 | } |
||
372 | } |
||
373 | } |
||
374 | } |
||
375 | n = n.nextSibling(); |
||
376 | } |
||
1033 | cbradney | 377 | //scan for installed tutorials |
378 | if (haveTutorials) |
||
379 | { |
||
380 | QString path = DOCDIR; |
||
1092 | cbradney | 381 | path += language + "/tutorials/"; |
1033 | cbradney | 382 | QDir dir(path, "*", QDir::Name, QDir::Dirs | QDir::NoSymLinks); |
383 | |||
384 | if (dir.exists() && (dir.count() != 0)) |
||
385 | { |
||
386 | for (uint i = 0; i < dir.count(); ++i) |
||
387 | { |
||
388 | if (dir[i]!="." && dir[i]!="..") |
||
389 | { |
||
1092 | cbradney | 390 | QString tutorialdir = "tutorials/" + dir[i] + "/"; |
1033 | cbradney | 391 | QFileInfo file(path + dir[i] + "/menu.xml"); |
392 | if (file.exists()) // menu.xml exists for tutorial |
||
393 | { |
||
394 | QDomDocument docTutorial( "tutorialmenuentries" ); |
||
395 | QFile fileTutorialMenu( file.filePath() ); |
||
396 | if ( !fileTutorialMenu.open( IO_ReadOnly ) ) |
||
397 | break; |
||
398 | if ( !docTutorial.setContent( &fileTutorialMenu ) ) |
||
399 | { |
||
400 | fileTutorialMenu.close(); |
||
401 | break; |
||
402 | } |
||
403 | fileTutorialMenu.close(); |
||
404 | |||
405 | QDomElement docElemTutorial = docTutorial.documentElement(); |
||
406 | QDomNode nTutorial = docElemTutorial.firstChild(); |
||
407 | QListViewItem *tutorialQLVI=NULL; |
||
408 | |||
409 | while( !nTutorial.isNull() ) |
||
410 | { |
||
411 | QDomElement eTutorial = nTutorial.toElement(); // try to convert the node to an element. |
||
412 | if( !eTutorial.isNull() ) |
||
413 | { |
||
414 | if (tutorialsMenuItem!=NULL && eTutorial.hasAttribute( "text" ) && eTutorial.hasAttribute( "file" )) |
||
415 | { |
||
416 | QDomAttr textAttr = eTutorial.attributeNode( "text" ); |
||
417 | QDomAttr fileAttr = eTutorial.attributeNode( "file" ); |
||
1092 | cbradney | 418 | tutorialQLVI=new QListViewItem(tutorialsMenuItem, textAttr.value(), tutorialdir + fileAttr.value()); |
1033 | cbradney | 419 | } |
420 | QDomNodeList nl=nTutorial.childNodes(); |
||
421 | QListViewItem *tutorialSubMenuItem, *tutorialSubMenuItemLast=NULL; |
||
1092 | cbradney | 422 | for(uint j=0 ; j<= nl.count() ; j++) |
1033 | cbradney | 423 | { |
1092 | cbradney | 424 | QDomNode child=nl.item(j); |
1033 | cbradney | 425 | if (child.isElement()) |
426 | { |
||
427 | QDomElement ec = child.toElement(); |
||
428 | if (!ec.isNull()) |
||
429 | { |
||
430 | if (ec.hasAttribute( "text" ) && ec.hasAttribute( "file" )) |
||
431 | { |
||
432 | QDomAttr textAttr = ec.attributeNode( "text" ); |
||
433 | QDomAttr fileAttr = ec.attributeNode( "file" ); |
||
434 | if (tutorialSubMenuItemLast==NULL) |
||
1092 | cbradney | 435 | tutorialSubMenuItem=new QListViewItem(tutorialQLVI, textAttr.value(), tutorialdir + fileAttr.value()); |
1033 | cbradney | 436 | else |
1092 | cbradney | 437 | tutorialSubMenuItem=new QListViewItem(tutorialQLVI, tutorialSubMenuItemLast, textAttr.value(), tutorialdir + fileAttr.value()); |
1033 | cbradney | 438 | if (tutorialSubMenuItem!=NULL) |
439 | tutorialSubMenuItemLast=tutorialSubMenuItem; |
||
440 | } |
||
441 | } |
||
442 | } |
||
443 | } |
||
444 | } |
||
445 | nTutorial = nTutorial.nextSibling(); |
||
446 | } |
||
447 | } |
||
448 | } |
||
449 | } |
||
450 | } |
||
451 | |||
452 | } |
||
205 | Franz | 453 | } |
68 | Franz | 454 | } |
455 | |||
560 | cbradney | 456 | void HelpBrowser::itemSelected(QListViewItem *item) |
68 | Franz | 457 | { |
560 | cbradney | 458 | if ( !item ) |
459 | return; |
||
1033 | cbradney | 460 | if (item->text(1)!=QString::null) |
461 | { |
||
462 | QString pfad = DOCDIR; |
||
1092 | cbradney | 463 | loadHelp(pfad + language + "/" + item->text(1)); |
1033 | cbradney | 464 | } |
68 | Franz | 465 | } |