Changeset View
Changeset View
Standalone View
Standalone View
conf/preferencesdialog.cpp
Show All 23 Lines | |||||
24 | PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skeleton, Okular::EmbedMode embedMode ) | 24 | PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skeleton, Okular::EmbedMode embedMode ) | ||
25 | : KConfigDialog( parent, QStringLiteral("preferences"), skeleton ) | 25 | : KConfigDialog( parent, QStringLiteral("preferences"), skeleton ) | ||
26 | { | 26 | { | ||
27 | setWindowModality( Qt::ApplicationModal ); | 27 | setWindowModality( Qt::ApplicationModal ); | ||
28 | 28 | | |||
29 | m_general = new DlgGeneral( this, embedMode ); | 29 | m_general = new DlgGeneral( this, embedMode ); | ||
30 | m_performance = new DlgPerformance( this ); | 30 | m_performance = new DlgPerformance( this ); | ||
31 | m_accessibility = new DlgAccessibility( this ); | 31 | m_accessibility = new DlgAccessibility( this ); | ||
32 | m_accessibilityPage = nullptr; | ||||
32 | m_presentation = nullptr; | 33 | m_presentation = nullptr; | ||
33 | m_annotations = nullptr; | 34 | m_annotations = nullptr; | ||
34 | m_annotationsPage = nullptr; | 35 | m_annotationsPage = nullptr; | ||
35 | m_editor = nullptr; | 36 | m_editor = nullptr; | ||
36 | #ifdef OKULAR_DEBUG_CONFIGPAGE | 37 | #ifdef OKULAR_DEBUG_CONFIGPAGE | ||
37 | m_debug = new DlgDebug( this ); | 38 | m_debug = new DlgDebug( this ); | ||
38 | #endif | 39 | #endif | ||
39 | 40 | | |||
40 | addPage( m_general, i18n("General"), QStringLiteral("okular"), i18n("General Options") ); | 41 | addPage( m_general, i18n("General"), QStringLiteral("okular"), i18n("General Options") ); | ||
41 | addPage( m_accessibility, i18n("Accessibility"), QStringLiteral("preferences-desktop-accessibility"), i18n("Accessibility Reading Aids") ); | 42 | m_accessibilityPage = addPage( m_accessibility, i18n("Accessibility"), QStringLiteral("preferences-desktop-accessibility"), i18n("Accessibility Reading Aids") ); | ||
42 | addPage( m_performance, i18n("Performance"), QStringLiteral("preferences-system-performance"), i18n("Performance Tuning") ); | 43 | addPage( m_performance, i18n("Performance"), QStringLiteral("preferences-system-performance"), i18n("Performance Tuning") ); | ||
43 | if( embedMode == Okular::ViewerWidgetMode ) | 44 | if( embedMode == Okular::ViewerWidgetMode ) | ||
44 | { | 45 | { | ||
45 | setWindowTitle( i18n("Configure Viewer") ); | 46 | setWindowTitle( i18n("Configure Viewer") ); | ||
46 | } | 47 | } | ||
47 | else | 48 | else | ||
48 | { | 49 | { | ||
49 | m_presentation = new DlgPresentation( this ); | 50 | m_presentation = new DlgPresentation( this ); | ||
50 | m_annotations = new DlgAnnotations( this ); | 51 | m_annotations = new DlgAnnotations( this ); | ||
51 | m_editor = new DlgEditor( this ); | 52 | m_editor = new DlgEditor( this ); | ||
52 | addPage( m_presentation, i18n("Presentation"), QStringLiteral("view-presentation"), | 53 | addPage( m_presentation, i18n("Presentation"), QStringLiteral("view-presentation"), | ||
53 | i18n("Options for Presentation Mode") ); | 54 | i18n("Options for Presentation Mode") ); | ||
54 | m_annotationsPage = addPage( m_annotations, i18n("Annotations"), | 55 | m_annotationsPage = addPage( m_annotations, i18n("Annotations"), | ||
55 | QStringLiteral("draw-freehand"), i18n("Annotation Options") ); | 56 | QStringLiteral("draw-freehand"), i18n("Annotation Options") ); | ||
56 | addPage( m_editor, i18n("Editor"), QStringLiteral("accessories-text-editor"), i18n("Editor Options") ); | 57 | addPage( m_editor, i18n("Editor"), QStringLiteral("accessories-text-editor"), i18n("Editor Options") ); | ||
57 | } | 58 | } | ||
58 | #ifdef OKULAR_DEBUG_CONFIGPAGE | 59 | #ifdef OKULAR_DEBUG_CONFIGPAGE | ||
59 | addPage( m_debug, "Debug", "system-run", "Debug options" ); | 60 | addPage( m_debug, "Debug", "system-run", "Debug options" ); | ||
60 | #endif | 61 | #endif | ||
61 | setHelp(QStringLiteral("configure"), QStringLiteral("okular")); | 62 | setHelp(QStringLiteral("configure"), QStringLiteral("okular")); | ||
62 | } | 63 | } | ||
63 | 64 | | |||
65 | void PreferencesDialog::switchToAccessibilityPage() | ||||
66 | { | ||||
67 | if ( m_accessibilityPage ) | ||||
68 | setCurrentPage( m_accessibilityPage ); | ||||
69 | } | ||||
70 | | ||||
64 | void PreferencesDialog::switchToAnnotationsPage() | 71 | void PreferencesDialog::switchToAnnotationsPage() | ||
65 | { | 72 | { | ||
66 | if ( m_annotationsPage ) | 73 | if ( m_annotationsPage ) | ||
67 | setCurrentPage( m_annotationsPage ); | 74 | setCurrentPage( m_annotationsPage ); | ||
68 | } | 75 | } |