Changeset View
Changeset View
Standalone View
Standalone View
conf/dlgaccessibility.cpp
1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2006 by Pino Toscano <toscano.pino@tiscali.it> * | 2 | * Copyright (C) 2006 by Pino Toscano <toscano.pino@tiscali.it> * | ||
3 | * * | 3 | * * | ||
4 | * This program is free software; you can redistribute it and/or modify * | 4 | * This program is free software; you can redistribute it and/or modify * | ||
5 | * it under the terms of the GNU General Public License as published by * | 5 | * it under the terms of the GNU General Public License as published by * | ||
6 | * the Free Software Foundation; either version 2 of the License, or * | 6 | * the Free Software Foundation; either version 2 of the License, or * | ||
7 | * (at your option) any later version. * | 7 | * (at your option) any later version. * | ||
8 | ***************************************************************************/ | 8 | ***************************************************************************/ | ||
9 | 9 | | |||
10 | #include "dlgaccessibility.h" | 10 | #include "dlgaccessibility.h" | ||
11 | 11 | | |||
12 | #include "ui_dlgaccessibilitybase.h" | 12 | #include "ui_dlgaccessibilitybase.h" | ||
13 | 13 | | |||
14 | #include "settings.h" | ||||
15 | | ||||
16 | #ifdef HAVE_SPEECH | ||||
17 | #include <QtTextToSpeech> | ||||
18 | #endif | ||||
19 | | ||||
14 | DlgAccessibility::DlgAccessibility( QWidget * parent ) | 20 | DlgAccessibility::DlgAccessibility( QWidget * parent ) | ||
15 | : QWidget( parent ), m_selected( 0 ) | 21 | : QWidget( parent ), m_selected( 0 ) | ||
16 | { | 22 | { | ||
17 | m_dlg = new Ui_DlgAccessibilityBase(); | 23 | m_dlg = new Ui_DlgAccessibilityBase(); | ||
18 | m_dlg->setupUi( this ); | 24 | m_dlg->setupUi( this ); | ||
19 | 25 | | |||
20 | // ### not working yet, hide for now | 26 | // ### not working yet, hide for now | ||
21 | m_dlg->kcfg_HighlightImages->hide(); | 27 | m_dlg->kcfg_HighlightImages->hide(); | ||
22 | 28 | | |||
23 | m_color_pages.append( m_dlg->page_invert ); | 29 | m_color_pages.append( m_dlg->page_invert ); | ||
24 | m_color_pages.append( m_dlg->page_paperColor ); | 30 | m_color_pages.append( m_dlg->page_paperColor ); | ||
25 | m_color_pages.append( m_dlg->page_darkLight ); | 31 | m_color_pages.append( m_dlg->page_darkLight ); | ||
26 | m_color_pages.append( m_dlg->page_bw ); | 32 | m_color_pages.append( m_dlg->page_bw ); | ||
27 | foreach ( QWidget * page, m_color_pages ) | 33 | foreach ( QWidget * page, m_color_pages ) | ||
28 | page->hide(); | 34 | page->hide(); | ||
29 | m_color_pages[ m_selected ]->show(); | 35 | m_color_pages[ m_selected ]->show(); | ||
30 | 36 | | |||
37 | #ifdef HAVE_SPEECH | ||||
38 | // Populate tts engines | ||||
39 | const QStringList engines = QTextToSpeech::availableEngines(); | ||||
40 | for (const QString &engine: engines) { | ||||
41 | m_dlg->kcfg_ttsEngine->addItem (engine); | ||||
42 | } | ||||
43 | m_dlg->kcfg_ttsEngine->setProperty("kcfg_property", QByteArray("currentText")); | ||||
44 | #else | ||||
45 | m_dlg->speechBox->hide(); | ||||
46 | #endif | ||||
47 | | ||||
31 | connect(m_dlg->kcfg_RenderMode, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &DlgAccessibility::slotColorMode); | 48 | connect(m_dlg->kcfg_RenderMode, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &DlgAccessibility::slotColorMode); | ||
32 | } | 49 | } | ||
33 | 50 | | |||
34 | DlgAccessibility::~DlgAccessibility() | 51 | DlgAccessibility::~DlgAccessibility() | ||
35 | { | 52 | { | ||
36 | delete m_dlg; | 53 | delete m_dlg; | ||
37 | } | 54 | } | ||
38 | 55 | | |||
Show All 9 Lines |