Changeset View
Changeset View
Standalone View
Standalone View
navigator.cpp
Show All 31 Lines | |||||
32 | #include <KDesktopFile> | 32 | #include <KDesktopFile> | ||
33 | #include <KLineEdit> | 33 | #include <KLineEdit> | ||
34 | #include <KMessageBox> | 34 | #include <KMessageBox> | ||
35 | #include <KProcess> | 35 | #include <KProcess> | ||
36 | #include <KProtocolInfo> | 36 | #include <KProtocolInfo> | ||
37 | #include <KServiceGroup> | 37 | #include <KServiceGroup> | ||
38 | #include <KServiceTypeTrader> | 38 | #include <KServiceTypeTrader> | ||
39 | #include <KShell> | 39 | #include <KShell> | ||
40 | #include <KLocalizedString> | ||||
40 | 41 | | |||
41 | #include "navigatoritem.h" | 42 | #include "navigatoritem.h" | ||
42 | #include "navigatorappitem.h" | 43 | #include "navigatorappitem.h" | ||
43 | #include "navigatorappgroupitem.h" | 44 | #include "navigatorappgroupitem.h" | ||
44 | #include "searchwidget.h" | 45 | #include "searchwidget.h" | ||
45 | #include "searchengine.h" | 46 | #include "searchengine.h" | ||
46 | #include "searchhandler.h" | 47 | #include "searchhandler.h" | ||
47 | #include "docmetainfo.h" | 48 | #include "docmetainfo.h" | ||
▲ Show 20 Lines • Show All 310 Lines • ▼ Show 20 Line(s) | 351 | { | |||
358 | 359 | | |||
359 | item->setExpanded( !item->isExpanded() ); | 360 | item->setExpanded( !item->isExpanded() ); | ||
360 | 361 | | |||
361 | QUrl url ( item->entry()->url() ); | 362 | QUrl url ( item->entry()->url() ); | ||
362 | 363 | | |||
363 | 364 | | |||
364 | 365 | | |||
365 | if ( url.scheme() == QLatin1String("khelpcenter") ) { | 366 | if ( url.scheme() == QLatin1String("khelpcenter") ) { | ||
366 | mView->closeUrl(); | 367 | mView->stop(); | ||
367 | History::self().updateCurrentEntry( mView ); | 368 | History::self().updateCurrentEntry( mView ); | ||
368 | History::self().createEntry(); | 369 | History::self().createEntry(); | ||
369 | showOverview( item, url ); | 370 | showOverview( item, url ); | ||
370 | } else { | 371 | } else { | ||
371 | 372 | | |||
372 | emit itemSelected( url.url() ); | 373 | emit itemSelected( url.url() ); | ||
373 | } | 374 | } | ||
374 | } | 375 | } | ||
Show All 24 Lines | 390 | { | |||
399 | NavigatorItem *item = | 400 | NavigatorItem *item = | ||
400 | static_cast<NavigatorItem *>( mContentsTree->currentItem() ); | 401 | static_cast<NavigatorItem *>( mContentsTree->currentItem() ); | ||
401 | 402 | | |||
402 | if ( item ) showOverview( item, url ); | 403 | if ( item ) showOverview( item, url ); | ||
403 | } | 404 | } | ||
404 | 405 | | |||
405 | void Navigator::showOverview( NavigatorItem *item, const QUrl &url ) | 406 | void Navigator::showOverview( NavigatorItem *item, const QUrl &url ) | ||
406 | { | 407 | { | ||
407 | mView->beginInternal( url ); | | |||
408 | | ||||
409 | QString title,name,content; | 408 | QString title,name,content; | ||
410 | uint childCount; | 409 | uint childCount; | ||
411 | 410 | | |||
412 | if ( item ) { | 411 | if ( item ) { | ||
413 | title = item->entry()->name(); | 412 | title = item->entry()->name(); | ||
414 | name = item->entry()->name(); | 413 | name = item->entry()->name(); | ||
415 | 414 | | |||
416 | QString info = item->entry()->info(); | 415 | QString info = item->entry()->info(); | ||
Show All 12 Lines | 426 | if ( childCount > 0 ) { | |||
429 | if ( item ) child = item; | 428 | if ( item ) child = item; | ||
430 | else child = mContentsTree->invisibleRootItem(); | 429 | else child = mContentsTree->invisibleRootItem(); | ||
431 | 430 | | |||
432 | content += createChildrenList( child, 0 ); | 431 | content += createChildrenList( child, 0 ); | ||
433 | } | 432 | } | ||
434 | else | 433 | else | ||
435 | content += QLatin1String("<p></p>"); | 434 | content += QLatin1String("<p></p>"); | ||
436 | 435 | | |||
437 | mView->write( mView->grantleeFormatter()->formatOverview( title, name, content ) ); | 436 | mView->setInternalHtml( mView->grantleeFormatter()->formatOverview( title, name, content ), url ); | ||
438 | 437 | | |||
439 | mView->end(); | | |||
440 | } | 438 | } | ||
441 | 439 | | |||
442 | QString Navigator::createChildrenList( QTreeWidgetItem *child, int level ) | 440 | QString Navigator::createChildrenList( QTreeWidgetItem *child, int level ) | ||
443 | { | 441 | { | ||
444 | QString t; | 442 | QString t; | ||
445 | 443 | | |||
446 | t += QLatin1String("<ul>\n"); | 444 | t += QLatin1String("<ul>\n"); | ||
447 | 445 | | |||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |