Commit 93fc5f2e authored by Enrico Ros's avatar Enrico Ros
Browse files

Added accessibility settings. We should take care of rendering/color

problems for partially blind and similar problems or even simple annoyances

svn path=/branches/kpdf_experiments/kdegraphics/kpdf/; revision=358599
parent a5bcf557
noinst_LTLIBRARIES = libconf.la
libconf_la_SOURCES = dlggeneral.ui preferencesdialog.cpp \
libconf_la_SOURCES = dlggeneral.ui dlgaccessibility.ui \
preferencesdialog.cpp \
settings.kcfgc
INCLUDES = -I$(srcdir)/.. $(all_includes)
......
This diff is collapsed.
/***************************************************************************
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "settings.h"
void DlgAccessibility::init()
{
switch ( Settings::renderMode() )
{
case Settings::EnumRenderMode::Normal:
radioNormal->setChecked( true );
break;
case Settings::EnumRenderMode::Inverted:
radioInverted->setChecked( true );
break;
case Settings::EnumRenderMode::Recolor:
radioRecolor->setChecked( true );
break;
case Settings::EnumRenderMode::BlackWhite:
radioContrast->setChecked( true );
break;
}
}
void DlgAccessibility::radioNormal_toggled( bool on )
{
if ( on ) Settings::setRenderMode( Settings::EnumRenderMode::Normal );
}
void DlgAccessibility::radioInverted_toggled( bool on )
{
if ( on ) Settings::setRenderMode( Settings::EnumRenderMode::Inverted );
}
void DlgAccessibility::radioRecolor_toggled( bool on )
{
if ( on ) Settings::setRenderMode( Settings::EnumRenderMode::Recolor );
}
void DlgAccessibility::radioContrast_toggled( bool on )
{
if ( on ) Settings::setRenderMode( Settings::EnumRenderMode::BlackWhite );
}
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>DlgNetwork</class>
<class>DlgGeneral</class>
<widget class="QWidget">
<property name="name">
<cstring>DlgNetwork</cstring>
<cstring>DlgGeneral</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>332</width>
<height>315</height>
<width>187</width>
<height>29</height>
</rect>
</property>
<property name="caption">
<string>DlgNetwork</string>
<string>DlgGeneral</string>
</property>
<vbox>
<property name="name">
......@@ -24,294 +24,15 @@
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_DownloadAtStartup</cstring>
<cstring>kcfg_youDontEvenKnowMe</cstring>
</property>
<property name="text">
<string>Start downloading files immediately after startup</string>
<string>You don't even know me..</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_LimitDownloads</cstring>
</property>
<property name="text">
<string>Limit maximum downloads</string>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout19</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer row="0" column="0" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer16_2_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>16</width>
<height>40</height>
</size>
</property>
</spacer>
<spacer row="0" column="2" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer19</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
<widget class="KIntSpinBox" row="0" column="3">
<property name="name">
<cstring>kcfg_MaxConnections</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="minValue">
<number>1</number>
</property>
</widget>
<widget class="QLabel" row="1" column="1">
<property name="name">
<cstring>lbl_maxnum_2</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Downloads from the same server:</string>
</property>
</widget>
<widget class="KIntSpinBox" row="1" column="3">
<property name="name">
<cstring>kcfg_MaxConnectionsServer</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="minValue">
<number>1</number>
</property>
</widget>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>lbl_maxnum</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Total downloads number:</string>
</property>
</widget>
</grid>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_ReconnectOnBroken</cstring>
</property>
<property name="text">
<string>Reconnect on error or broken connection</string>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout14</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="1" column="1">
<property name="name">
<cstring>lb_after_2</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Retry after:</string>
</property>
</widget>
<spacer row="0" column="2" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer2_3</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>90</width>
<height>50</height>
</size>
</property>
</spacer>
<widget class="KIntSpinBox" row="1" column="3">
<property name="name">
<cstring>kcfg_ReconnectDelay</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string> sec</string>
</property>
<property name="maxValue">
<number>3600</number>
</property>
<property name="minValue">
<number>1</number>
</property>
<property name="value">
<number>60</number>
</property>
</widget>
<widget class="KIntSpinBox" row="0" column="3">
<property name="name">
<cstring>kcfg_ReconnectRetries</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="minValue">
<number>1</number>
</property>
</widget>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>lb_retries_2</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Number of retries:</string>
</property>
</widget>
<spacer row="0" column="0" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer16_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>16</width>
<height>40</height>
</size>
</property>
</spacer>
</grid>
</widget>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox5</cstring>
</property>
<property name="title">
<string>After completing downloads</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_AutoShutdown</cstring>
</property>
<property name="text">
<string>Auto shutdown</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_AutoDisconnect</cstring>
</property>
<property name="text">
<string>Auto disconnect</string>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout9</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer16</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QLabel">
<property name="name">
<cstring>lb_autoDisconnect</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Disconnect command:</string>
</property>
</widget>
<widget class="KLineEdit">
<property name="name">
<cstring>kcfg_DisconnectCommand</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>kppp -k</string>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<spacer>
<property name="name">
<cstring>spacer20</cstring>
<cstring>spacer9</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
......@@ -321,75 +42,13 @@
</property>
<property name="sizeHint">
<size>
<width>180</width>
<height>16</height>
<width>20</width>
<height>21</height>
</size>
</property>
</spacer>
</vbox>
</widget>
<connections>
<connection>
<sender>kcfg_AutoDisconnect</sender>
<signal>toggled(bool)</signal>
<receiver>lb_autoDisconnect</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_AutoDisconnect</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_DisconnectCommand</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ReconnectOnBroken</sender>
<signal>toggled(bool)</signal>
<receiver>lb_retries_2</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ReconnectOnBroken</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_ReconnectRetries</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ReconnectOnBroken</sender>
<signal>toggled(bool)</signal>
<receiver>lb_after_2</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ReconnectOnBroken</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_ReconnectDelay</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_LimitDownloads</sender>
<signal>toggled(bool)</signal>
<receiver>lbl_maxnum</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_LimitDownloads</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_MaxConnections</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_LimitDownloads</sender>
<signal>toggled(bool)</signal>
<receiver>lbl_maxnum_2</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_LimitDownloads</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_MaxConnectionsServer</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections>
<includes>
<include location="global" impldecl="in implementation">kdialog.h</include>
</includes>
......
......@@ -5,16 +5,31 @@
<entry key="PaperColor" type="Color" >
<default code="true" >Qt::white</default>
</entry>
<entry key="HilightLinks" type="Bool" >
<entry key="HighlightLinks" type="Bool" >
<default>false</default>
</entry>
<entry key="RenderMode" type="Enum" >
<values>
<value>Normal</value>
<value>Inverted</value>
<value>Recolor</value>
<value>Contrast</value>
</values>
<default>Normal</default>
<choices>
<choice name="Normal" />
<choice name="Inverted" />
<choice name="Recolor" />
<choice name="BlackWhite" />
</choices>
</entry>
<entry key="HighlightImages" type="Bool" >
<default>false</default>
</entry>
<entry key="RecolorForeground" type="Color" >
<default code="true" >Qt::black</default>
</entry>
<entry key="RecolorBackground" type="Color" >
<default code="true" >Qt::white</default>
</entry>
<entry key="BWTreshold" type="UInt" >
<default>5</default>
<min>1</min>
<max>10</max>
</entry>
</group>
<group name="General" />
......
......@@ -10,10 +10,8 @@
#include <klocale.h>
// single config pages
/*
#include "dlggeneral.h"
#include "dlgaccessibility.h"
*/
// reimplementing this
#include "preferencesdialog.h"
......@@ -21,11 +19,9 @@
PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skeleton )
: KConfigDialog( parent, "preferences", skeleton )
{
/*
m_general = new DlgGeneral(0);
m_accessibility = new DlgAccessibility(0);
addPage( m_general, i18n("General"), "looknfeel", i18n("General setup") );
addPage( m_accessibility, i18n("Accessibility"), "folder_open", i18n("Read aids") );
*/
addPage( m_general, i18n("General"), "gohome", i18n("General Options") );
addPage( m_accessibility, i18n("Accessibility"), "viewmag", i18n("Reading Aids") );
}
......@@ -16,6 +16,9 @@
class QWidget;
class KConfigSkeleton;
class DlgGeneral;
class DlgAccessibility;
class PreferencesDialog : public KConfigDialog
{
......@@ -30,8 +33,8 @@ class PreferencesDialog : public KConfigDialog
// bool isDefault(); // In order to correctly disable/enable Defaults button
private:
class DlgGeneral * m_general;
class DlgAccessibility * m_accessibility;
DlgGeneral * m_general;
DlgAccessibility * m_accessibility;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment