Rev 1092 | Rev 1100 | 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); |
1097 | cbradney | 62 | //qDebug(language); |
564 | cbradney | 63 | helpBrowsermainLayout = new QVBoxLayout( this); |
64 | buttonLayout = new QHBoxLayout; |
||
65 | buttonLayout->setSpacing( 6 ); |
||
66 | buttonLayout->setMargin( 2 ); |
||
3 | paul | 67 | |
564 | cbradney | 68 | homeButton = new QToolButton( this, "homeButton" ); |
69 | homeButton->setText( "" ); |
||
70 | homeButton->setPixmap(loadIcon("gohome.png")); |
||
786 | cbradney | 71 | homeButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed, homeButton->sizePolicy().hasHeightForWidth() ) ); |
564 | cbradney | 72 | buttonLayout->addWidget( homeButton ); |
3 | paul | 73 | |
564 | cbradney | 74 | histMenu = new QPopupMenu( this ); |
75 | backButton = new QToolButton( this, "backButton" ); |
||
76 | backButton->setPixmap(loadIcon("back.png")); |
||
786 | cbradney | 77 | backButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed, backButton->sizePolicy().hasHeightForWidth() ) ); |
564 | cbradney | 78 | backButton->setPopup(histMenu); |
79 | backButton->setPopupDelay(0); |
||
80 | buttonLayout->addWidget( backButton ); |
||
3 | paul | 81 | |
564 | cbradney | 82 | forwButton = new QToolButton( this, "forwButton" ); |
83 | forwButton->setPixmap(loadIcon("forward.png")); |
||
786 | cbradney | 84 | forwButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed, forwButton->sizePolicy().hasHeightForWidth() ) ); |
564 | cbradney | 85 | buttonLayout->addWidget( forwButton ); |
86 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
||
87 | buttonLayout->addItem( spacer ); |
||
560 | cbradney | 88 | helpBrowsermainLayout->addLayout( buttonLayout ); |
89 | |||
564 | cbradney | 90 | helpBrowserLayout = new QHBoxLayout; |
786 | cbradney | 91 | splitter = new QSplitter(this, "splitter"); |
92 | splitter->setChildrenCollapsible( false ); |
||
93 | helpBrowserLayout->addWidget( splitter ); |
||
560 | cbradney | 94 | |
786 | cbradney | 95 | tabWidget = new QTabWidget( splitter, "tabWidget" ); |
96 | //tabWidget = new QTabWidget( this, "tabWidget" ); |
||
97 | splitter->setResizeMode(tabWidget, QSplitter::Stretch ); |
||
98 | tabWidget->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Expanding, false) ); |
||
564 | cbradney | 99 | tabContents = new QWidget( tabWidget, "tabContents" ); |
100 | tabLayout = new QHBoxLayout( tabContents, 11, 6, "tabLayout"); |
||
560 | cbradney | 101 | |
564 | cbradney | 102 | listView = new QListView( tabContents, "listView" ); |
103 | listView->addColumn( tr( "Contents" ) ); |
||
1097 | cbradney | 104 | listView->addColumn( tr( "Link" ) , 0 ); |
105 | // listView->addColumn( tr( "Link" ) ); |
||
106 | listView->setColumnWidthMode( 0, QListView::Maximum ); |
||
107 | listView->setColumnWidthMode( 1, QListView::Manual ); |
||
560 | cbradney | 108 | listView->setSorting(-1,-1); |
109 | listView->setRootIsDecorated( true ); |
||
110 | listView->setSelectionMode(QListView::Single); |
||
111 | listView->setDefaultRenameAction(QListView::Reject); |
||
112 | listView->clear(); |
||
564 | cbradney | 113 | tabLayout->addWidget( listView ); |
114 | |||
115 | tabWidget->insertTab( tabContents, QString("Contents") ); |
||
786 | cbradney | 116 | //helpBrowserLayout->addWidget( tabWidget ); |
560 | cbradney | 117 | |
786 | cbradney | 118 | textBrowser = new QTextBrowser( splitter, "textBrowser" ); |
119 | splitter->setResizeMode(textBrowser, QSplitter::Stretch); |
||
120 | //textBrowser = new QTextBrowser( this, "textBrowser" ); |
||
121 | textBrowser->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Expanding, false ) ); |
||
564 | cbradney | 122 | textBrowser->setFrameShape( QTextBrowser::StyledPanel ); |
786 | cbradney | 123 | //helpBrowserLayout->addWidget( textBrowser ); |
564 | cbradney | 124 | helpBrowsermainLayout->addLayout( helpBrowserLayout ); |
560 | cbradney | 125 | |
564 | cbradney | 126 | languageChange(); |
127 | resize( QSize(602, 491).expandedTo(minimumSizeHint()) ); |
||
128 | clearWState( WState_Polished ); |
||
1092 | cbradney | 129 | loadMenu(); |
560 | cbradney | 130 | listView->header()->hide(); |
1092 | cbradney | 131 | jumpToHelpSection(jumpToSection, jumpToFile ); |
560 | cbradney | 132 | |
133 | connect( homeButton, SIGNAL( clicked() ), textBrowser, SLOT( home() ) ); |
||
134 | connect( forwButton, SIGNAL( clicked() ), textBrowser, SLOT( forward() ) ); |
||
135 | connect( backButton, SIGNAL( clicked() ), textBrowser, SLOT( backward() ) ); |
||
564 | cbradney | 136 | connect( histMenu, SIGNAL(activated(int)), this, SLOT(histChosen(int))); |
137 | connect( listView, SIGNAL(clicked( QListViewItem *)), this, SLOT(itemSelected( QListViewItem *))); |
||
560 | cbradney | 138 | } |
139 | |||
140 | HelpBrowser::~HelpBrowser() |
||
141 | { |
||
564 | cbradney | 142 | // no need to delete child widgets, Qt does it all for us |
560 | cbradney | 143 | } |
144 | |||
145 | void HelpBrowser::languageChange() |
||
146 | { |
||
564 | cbradney | 147 | setCaption( tr( "Scribus Online Help" ) ); |
148 | listView->header()->setLabel( 0, tr( "Contents" ) ); |
||
149 | listView->clear(); |
||
560 | cbradney | 150 | |
564 | cbradney | 151 | tabWidget->changeTab( tabContents, tr( "Contents" ) ); |
560 | cbradney | 152 | } |
153 | |||
154 | |||
155 | void HelpBrowser::sourceChanged(const QString& url) |
||
156 | { |
||
564 | cbradney | 157 | bool inList = false; |
158 | struct histd his; |
||
159 | QString title = ""; |
||
160 | title = textBrowser->documentTitle(); |
||
161 | if (title == "") |
||
162 | title = url; |
||
786 | cbradney | 163 | for (QMap<int, histd>::Iterator it = mHistory.begin(); it != mHistory.end(); ++it) |
564 | cbradney | 164 | { |
165 | if (it.data().Title == title) |
||
166 | inList = true; |
||
167 | } |
||
168 | if (!inList) |
||
169 | { |
||
170 | his.Title = title; |
||
171 | his.Url = url; |
||
172 | mHistory[histMenu->insertItem(title)] = his; |
||
173 | } |
||
174 | if (mHistory.count() > 15) |
||
175 | { |
||
176 | int itk = histMenu->idAt(0); |
||
177 | mHistory.remove(itk); |
||
178 | histMenu->removeItem(itk); |
||
179 | } |
||
560 | cbradney | 180 | } |
181 | |||
182 | void HelpBrowser::histChosen(int i) |
||
183 | { |
||
564 | cbradney | 184 | if (mHistory.contains(i)) |
185 | textBrowser->setSource(mHistory[i].Url); |
||
560 | cbradney | 186 | } |
187 | |||
1092 | cbradney | 188 | void HelpBrowser::jumpToHelpSection(QString jumpToSection, QString jumpToFile) |
560 | cbradney | 189 | { |
190 | QString toLoad; |
||
191 | |||
564 | cbradney | 192 | if (jumpToFile=="") |
193 | { |
||
872 | cbradney | 194 | QString pfad = DOCDIR; |
1092 | cbradney | 195 | toLoad = pfad + language + "/"; //clean this later to handle 5 char locales |
564 | cbradney | 196 | if (jumpToSection=="") |
197 | { |
||
1097 | cbradney | 198 | //toLoad+="index.html"; |
199 | toLoad+=listView->firstChild()->text(1); |
||
560 | cbradney | 200 | listView->setSelected( listView->firstChild(), true ); |
205 | Franz | 201 | } |
564 | cbradney | 202 | else if (jumpToSection=="scripter") |
203 | { |
||
560 | cbradney | 204 | toLoad+="scripter1.html"; |
205 | QListViewItemIterator it(listView); |
||
564 | cbradney | 206 | while (it.current()) |
207 | { |
||
560 | cbradney | 208 | if (it.current()->text(1)=="scripter1.html") |
209 | listView->setSelected( it.current(), true ); |
||
210 | if (it.current()->text(1)=="developers.html") |
||
211 | it.current()->setOpen( true ); |
||
212 | ++it; |
||
213 | } |
||
214 | } |
||
205 | Franz | 215 | } |
560 | cbradney | 216 | else |
564 | cbradney | 217 | toLoad=jumpToFile; |
3 | paul | 218 | |
560 | cbradney | 219 | loadHelp(toLoad); |
3 | paul | 220 | } |
221 | |||
560 | cbradney | 222 | void HelpBrowser::loadHelp(QString filename) |
68 | Franz | 223 | { |
75 | Franz | 224 | struct histd his; |
564 | cbradney | 225 | bool Avail = true; |
560 | cbradney | 226 | QString toLoad; |
564 | cbradney | 227 | QFileInfo fi; |
228 | fi = QFileInfo(filename); |
||
229 | if (fi.exists()) |
||
560 | cbradney | 230 | toLoad=filename; |
564 | cbradney | 231 | else |
232 | { |
||
872 | cbradney | 233 | QString pfad = DOCDIR; |
1092 | cbradney | 234 | |
872 | cbradney | 235 | toLoad = pfad + "en/index.html"; |
1092 | cbradney | 236 | language="en"; |
564 | cbradney | 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 | } |
||
243 | } |
||
244 | if (Avail) |
||
245 | { |
||
246 | textBrowser->setSource(toLoad); |
||
247 | his.Title = textBrowser->documentTitle(); |
||
248 | if (his.Title == "") |
||
249 | his.Title = toLoad; |
||
250 | his.Url = toLoad; |
||
251 | mHistory[histMenu->insertItem(his.Title)] = his; |
||
252 | } |
||
560 | cbradney | 253 | } |
254 | |||
1092 | cbradney | 255 | void HelpBrowser::loadMenu() |
560 | cbradney | 256 | { |
872 | cbradney | 257 | QString pfad = DOCDIR; |
786 | cbradney | 258 | QString toLoad; |
1092 | cbradney | 259 | QString pfad2 = pfad + language + "/menu.xml"; |
1097 | cbradney | 260 | //qDebug (pfad2); |
564 | cbradney | 261 | QFileInfo fi = QFileInfo(pfad2); |
786 | cbradney | 262 | |
793 | cbradney | 263 | if (fi.exists()) |
264 | toLoad=pfad2; |
||
265 | else |
||
266 | { |
||
872 | cbradney | 267 | toLoad = pfad + "en/menu.xml"; |
1092 | cbradney | 268 | language="en"; |
786 | cbradney | 269 | fi = QFileInfo(toLoad); |
270 | qDebug("Scribus help in your selected language does not exist, trying English. Otherwise, please visit http://docs.scribus.net."); |
||
271 | } |
||
272 | |||
560 | cbradney | 273 | if (fi.exists()) |
564 | cbradney | 274 | { |
560 | cbradney | 275 | QDomDocument doc( "menuentries" ); |
786 | cbradney | 276 | QFile file( toLoad ); |
560 | cbradney | 277 | if ( !file.open( IO_ReadOnly ) ) |
278 | return; |
||
564 | cbradney | 279 | if ( !doc.setContent( &file ) ) |
280 | { |
||
560 | cbradney | 281 | file.close(); |
282 | return; |
||
283 | } |
||
284 | file.close(); |
||
285 | |||
286 | QDomElement docElem = doc.documentElement(); |
||
287 | QDomNode n = docElem.firstChild(); |
||
288 | QListViewItem *qlvi=NULL, *qlvi2=NULL, *qlvi3=NULL, *qlvi4=NULL, *qlvi5=NULL, *qlvi6=NULL; |
||
1033 | cbradney | 289 | QListViewItem *tutorialsMenuItem; |
290 | bool haveTutorials=false; |
||
560 | cbradney | 291 | |
564 | cbradney | 292 | while( !n.isNull() ) |
293 | { |
||
560 | cbradney | 294 | QDomElement e = n.toElement(); // try to convert the node to an element. |
564 | cbradney | 295 | if( !e.isNull() ) |
296 | { |
||
297 | if (e.hasAttribute( "text" ) && e.hasAttribute( "file" )) |
||
298 | { |
||
560 | cbradney | 299 | QDomAttr textAttr = e.attributeNode( "text" ); |
300 | QDomAttr fileAttr = e.attributeNode( "file" ); |
||
301 | if (qlvi2==NULL) |
||
302 | qlvi=new QListViewItem(listView, textAttr.value(), fileAttr.value()); |
||
564 | cbradney | 303 | else |
1033 | cbradney | 304 | qlvi=new QListViewItem(listView, qlvi2, textAttr.value(), fileAttr.value()); |
305 | if (qlvi!=NULL && textAttr.value()=="Tutorials") |
||
564 | cbradney | 306 | { |
1033 | cbradney | 307 | haveTutorials=true; |
308 | tutorialsMenuItem=qlvi; |
||
560 | cbradney | 309 | } |
1033 | cbradney | 310 | |
560 | cbradney | 311 | if (qlvi!=NULL) |
312 | qlvi2=qlvi; |
||
313 | } |
||
314 | |||
315 | QDomNodeList nl=n.childNodes(); |
||
564 | cbradney | 316 | for(uint i=0 ; i<= nl.count() ; i++) |
317 | { |
||
560 | cbradney | 318 | QDomNode child=nl.item(i); |
564 | cbradney | 319 | if (child.isElement()) |
320 | { |
||
560 | cbradney | 321 | QDomElement ec = child.toElement(); |
564 | cbradney | 322 | if (!ec.isNull()) |
323 | { |
||
324 | if (ec.hasAttribute( "text" ) && ec.hasAttribute( "file" )) |
||
325 | { |
||
560 | cbradney | 326 | QDomAttr textAttr = ec.attributeNode( "text" ); |
327 | QDomAttr fileAttr = ec.attributeNode( "file" ); |
||
328 | if (qlvi4==NULL) |
||
329 | qlvi3=new QListViewItem(qlvi, textAttr.value(), fileAttr.value()); |
||
564 | cbradney | 330 | else |
1033 | cbradney | 331 | qlvi3=new QListViewItem(qlvi, qlvi4, textAttr.value(), fileAttr.value()); |
332 | if (qlvi3!=NULL && textAttr.value()=="Tutorials") |
||
564 | cbradney | 333 | { |
1033 | cbradney | 334 | haveTutorials=true; |
335 | tutorialsMenuItem=qlvi3; |
||
560 | cbradney | 336 | } |
337 | if (qlvi3!=NULL) |
||
338 | qlvi4=qlvi3; |
||
339 | } |
||
340 | //3rd level |
||
341 | QDomNodeList nl2=child.childNodes(); |
||
564 | cbradney | 342 | for(uint i=0 ; i<= nl2.count() ; i++) |
343 | { |
||
560 | cbradney | 344 | QDomNode childchild=nl2.item(i); |
564 | cbradney | 345 | if (childchild.isElement()) |
346 | { |
||
560 | cbradney | 347 | QDomElement ecc = childchild.toElement(); |
564 | cbradney | 348 | if (!ecc.isNull()) |
349 | { |
||
350 | if (ecc.hasAttribute( "text" ) && ecc.hasAttribute( "file" )) |
||
351 | { |
||
560 | cbradney | 352 | QDomAttr textAttr = ecc.attributeNode( "text" ); |
353 | QDomAttr fileAttr = ecc.attributeNode( "file" ); |
||
354 | if (qlvi6==NULL) |
||
355 | qlvi5=new QListViewItem(qlvi3, textAttr.value(), fileAttr.value()); |
||
564 | cbradney | 356 | else |
1033 | cbradney | 357 | qlvi5=new QListViewItem(qlvi3, qlvi6, textAttr.value(), fileAttr.value()); |
358 | if (qlvi5!=NULL && textAttr.value()=="Tutorials") |
||
564 | cbradney | 359 | { |
1033 | cbradney | 360 | haveTutorials=true; |
361 | tutorialsMenuItem=qlvi5; |
||
560 | cbradney | 362 | } |
363 | } |
||
364 | if (qlvi5!=NULL) |
||
365 | qlvi6=qlvi5; |
||
366 | } |
||
367 | } |
||
368 | } |
||
369 | } |
||
370 | } |
||
371 | } |
||
372 | } |
||
373 | n = n.nextSibling(); |
||
374 | } |
||
1033 | cbradney | 375 | //scan for installed tutorials |
376 | if (haveTutorials) |
||
377 | { |
||
378 | QString path = DOCDIR; |
||
1092 | cbradney | 379 | path += language + "/tutorials/"; |
1033 | cbradney | 380 | QDir dir(path, "*", QDir::Name, QDir::Dirs | QDir::NoSymLinks); |
381 | |||
382 | if (dir.exists() && (dir.count() != 0)) |
||
383 | { |
||
384 | for (uint i = 0; i < dir.count(); ++i) |
||
385 | { |
||
386 | if (dir[i]!="." && dir[i]!="..") |
||
387 | { |
||
1092 | cbradney | 388 | QString tutorialdir = "tutorials/" + dir[i] + "/"; |
1033 | cbradney | 389 | QFileInfo file(path + dir[i] + "/menu.xml"); |
390 | if (file.exists()) // menu.xml exists for tutorial |
||
391 | { |
||
392 | QDomDocument docTutorial( "tutorialmenuentries" ); |
||
393 | QFile fileTutorialMenu( file.filePath() ); |
||
394 | if ( !fileTutorialMenu.open( IO_ReadOnly ) ) |
||
395 | break; |
||
396 | if ( !docTutorial.setContent( &fileTutorialMenu ) ) |
||
397 | { |
||
398 | fileTutorialMenu.close(); |
||
399 | break; |
||
400 | } |
||
401 | fileTutorialMenu.close(); |
||
402 | |||
403 | QDomElement docElemTutorial = docTutorial.documentElement(); |
||
404 | QDomNode nTutorial = docElemTutorial.firstChild(); |
||
405 | QListViewItem *tutorialQLVI=NULL; |
||
406 | |||
407 | while( !nTutorial.isNull() ) |
||
408 | { |
||
409 | QDomElement eTutorial = nTutorial.toElement(); // try to convert the node to an element. |
||
410 | if( !eTutorial.isNull() ) |
||
411 | { |
||
412 | if (tutorialsMenuItem!=NULL && eTutorial.hasAttribute( "text" ) && eTutorial.hasAttribute( "file" )) |
||
413 | { |
||
414 | QDomAttr textAttr = eTutorial.attributeNode( "text" ); |
||
415 | QDomAttr fileAttr = eTutorial.attributeNode( "file" ); |
||
1092 | cbradney | 416 | tutorialQLVI=new QListViewItem(tutorialsMenuItem, textAttr.value(), tutorialdir + fileAttr.value()); |
1033 | cbradney | 417 | } |
418 | QDomNodeList nl=nTutorial.childNodes(); |
||
419 | QListViewItem *tutorialSubMenuItem, *tutorialSubMenuItemLast=NULL; |
||
1092 | cbradney | 420 | for(uint j=0 ; j<= nl.count() ; j++) |
1033 | cbradney | 421 | { |
1092 | cbradney | 422 | QDomNode child=nl.item(j); |
1033 | cbradney | 423 | if (child.isElement()) |
424 | { |
||
425 | QDomElement ec = child.toElement(); |
||
426 | if (!ec.isNull()) |
||
427 | { |
||
428 | if (ec.hasAttribute( "text" ) && ec.hasAttribute( "file" )) |
||
429 | { |
||
430 | QDomAttr textAttr = ec.attributeNode( "text" ); |
||
431 | QDomAttr fileAttr = ec.attributeNode( "file" ); |
||
432 | if (tutorialSubMenuItemLast==NULL) |
||
1092 | cbradney | 433 | tutorialSubMenuItem=new QListViewItem(tutorialQLVI, textAttr.value(), tutorialdir + fileAttr.value()); |
1033 | cbradney | 434 | else |
1092 | cbradney | 435 | tutorialSubMenuItem=new QListViewItem(tutorialQLVI, tutorialSubMenuItemLast, textAttr.value(), tutorialdir + fileAttr.value()); |
1033 | cbradney | 436 | if (tutorialSubMenuItem!=NULL) |
437 | tutorialSubMenuItemLast=tutorialSubMenuItem; |
||
438 | } |
||
439 | } |
||
440 | } |
||
441 | } |
||
442 | } |
||
443 | nTutorial = nTutorial.nextSibling(); |
||
444 | } |
||
445 | } |
||
446 | } |
||
447 | } |
||
448 | } |
||
449 | |||
450 | } |
||
205 | Franz | 451 | } |
68 | Franz | 452 | } |
453 | |||
560 | cbradney | 454 | void HelpBrowser::itemSelected(QListViewItem *item) |
68 | Franz | 455 | { |
560 | cbradney | 456 | if ( !item ) |
457 | return; |
||
1033 | cbradney | 458 | if (item->text(1)!=QString::null) |
459 | { |
||
460 | QString pfad = DOCDIR; |
||
1097 | cbradney | 461 | //QString filetoload="filetoload:" + pfad + language + "/" + item->text(1); |
462 | //qDebug(filetoload); |
||
1092 | cbradney | 463 | loadHelp(pfad + language + "/" + item->text(1)); |
1033 | cbradney | 464 | } |
68 | Franz | 465 | } |