Changeset View
Changeset View
Standalone View
Standalone View
core/ModuleView.cpp
Show All 25 Lines | |||||
26 | #include <QProcess> | 26 | #include <QProcess> | ||
27 | #include <QKeyEvent> | 27 | #include <QKeyEvent> | ||
28 | #include <QWhatsThis> | 28 | #include <QWhatsThis> | ||
29 | #include <QScrollArea> | 29 | #include <QScrollArea> | ||
30 | #include <QStyle> | 30 | #include <QStyle> | ||
31 | #include <QVBoxLayout> | 31 | #include <QVBoxLayout> | ||
32 | #include <QPushButton> | 32 | #include <QPushButton> | ||
33 | #include <QLoggingCategory> | 33 | #include <QLoggingCategory> | ||
34 | #include <QDesktopServices> | ||||
34 | #include <QDialogButtonBox> | 35 | #include <QDialogButtonBox> | ||
35 | 36 | | |||
36 | #include <KPageWidget> | 37 | #include <KPageWidget> | ||
37 | #include <KAuthorized> | 38 | #include <KAuthorized> | ||
38 | #include <KMessageBox> | 39 | #include <KMessageBox> | ||
39 | #include <KCModuleInfo> | 40 | #include <KCModuleInfo> | ||
40 | #include <KCModuleProxy> | 41 | #include <KCModuleProxy> | ||
41 | #include <KStandardGuiItem> | 42 | #include <KStandardGuiItem> | ||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Line(s) | 319 | { | |||
320 | if( !activeModule ) { | 321 | if( !activeModule ) { | ||
321 | return; | 322 | return; | ||
322 | } | 323 | } | ||
323 | 324 | | |||
324 | QString docPath = activeModule->docPath(); | 325 | QString docPath = activeModule->docPath(); | ||
325 | if( docPath.isEmpty() ) { | 326 | if( docPath.isEmpty() ) { | ||
326 | return; | 327 | return; | ||
327 | } | 328 | } | ||
328 | QUrl url( QStringLiteral("help:/")+docPath ); | 329 | | ||
329 | QProcess::startDetached(QStringLiteral("khelpcenter"), QStringList() << url.url()); | 330 | // UrlHandler from KGUIAddons sets a handler for help:/ urls, which opens khelpcenter | ||
331 | // if it's available or falls back to opening the relevant page at docs.kde.org | ||||
332 | QDesktopServices::openUrl(QUrl(QStringLiteral("help:/") + docPath)); | ||||
330 | } | 333 | } | ||
331 | 334 | | |||
332 | void ModuleView::activeModuleChanged(KPageWidgetItem * current, KPageWidgetItem * previous) | 335 | void ModuleView::activeModuleChanged(KPageWidgetItem * current, KPageWidgetItem * previous) | ||
333 | { | 336 | { | ||
334 | d->mPageWidget->blockSignals(true); | 337 | d->mPageWidget->blockSignals(true); | ||
335 | d->mPageWidget->setCurrentPage(previous); | 338 | d->mPageWidget->setCurrentPage(previous); | ||
336 | KCModuleProxy * previousModule = d->mPages.value(previous); | 339 | KCModuleProxy * previousModule = d->mPages.value(previous); | ||
337 | if( resolveChanges(previousModule) ) { | 340 | if( resolveChanges(previousModule) ) { | ||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |