Added 'performance' dialog. Code still not in place. Need to implement all

options now. Changed some options inside kpdf.kcfg (KConfigXT configuration
description).

svn path=/branches/kpdf_experiments/kdegraphics/kpdf/; revision=360658
remotes/origin/kpdf-experiments
Enrico Ros 22 years ago
parent 0f7917bf94
commit c051a6d137
  1. 5
      kpdf/conf/Makefile.am
  2. 54
      kpdf/conf/dlgaccessibility.ui
  3. 50
      kpdf/conf/dlgaccessibility.ui.h
  4. 24
      kpdf/conf/dlggeneral.ui
  5. 160
      kpdf/conf/dlgperformance.ui
  6. 37
      kpdf/conf/dlgperformance.ui.h
  7. 22
      kpdf/conf/kpdf.kcfg
  8. 3
      kpdf/conf/preferencesdialog.cpp
  9. 2
      kpdf/conf/preferencesdialog.h
  10. 2
      kpdf/pageview.cpp

@ -1,8 +1,7 @@
noinst_LTLIBRARIES = libconf.la
libconf_la_SOURCES = dlggeneral.ui dlgaccessibility.ui \
preferencesdialog.cpp \
settings.kcfgc
libconf_la_SOURCES = dlggeneral.ui dlgperformance.ui dlgaccessibility.ui \
preferencesdialog.cpp settings.kcfgc
INCLUDES = -I$(srcdir)/.. $(all_includes)

@ -24,7 +24,7 @@
</property>
<widget class="QButtonGroup">
<property name="name">
<cstring>buttonGroup1</cstring>
<cstring>kcfg_RenderMode</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
@ -46,7 +46,7 @@
<cstring>radioNormal</cstring>
</property>
<property name="text">
<string>Normal</string>
<string>Normal (default)</string>
</property>
<property name="checked">
<bool>true</bool>
@ -54,7 +54,7 @@
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout4</cstring>
<cstring>layout5</cstring>
</property>
<hbox>
<property name="name">
@ -102,6 +102,20 @@
<string></string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1_2</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>(needs restart)</string>
</property>
<property name="buddy" stdset="0">
<cstring>kcfg_PaperColor</cstring>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer7_2</cstring>
@ -114,7 +128,7 @@
</property>
<property name="sizeHint">
<size>
<width>180</width>
<width>30</width>
<height>20</height>
</size>
</property>
@ -455,41 +469,13 @@
<connection>
<sender>radioNormal</sender>
<signal>toggled(bool)</signal>
<receiver>DlgAccessibility</receiver>
<slot>radioNormal_toggled(bool)</slot>
</connection>
<connection>
<sender>radioInverted</sender>
<signal>toggled(bool)</signal>
<receiver>DlgAccessibility</receiver>
<slot>radioInverted_toggled(bool)</slot>
</connection>
<connection>
<sender>radioRecolor</sender>
<signal>toggled(bool)</signal>
<receiver>DlgAccessibility</receiver>
<slot>radioRecolor_toggled(bool)</slot>
</connection>
<connection>
<sender>radioContrast</sender>
<signal>toggled(bool)</signal>
<receiver>DlgAccessibility</receiver>
<slot>radioContrast_toggled(bool)</slot>
<receiver>textLabel1_2</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections>
<includes>
<include location="global" impldecl="in implementation">kdialog.h</include>
<include location="local" impldecl="in implementation">dlgaccessibility.ui.h</include>
</includes>
<slots>
<slot>radioNormal_toggled( bool on )</slot>
<slot>radioInverted_toggled( bool on )</slot>
<slot>radioRecolor_toggled( bool on )</slot>
<slot>radioContrast_toggled( bool on )</slot>
</slots>
<functions>
<function access="private">init()</function>
</functions>
<layoutdefaults spacing="5" margin="11"/>
<includehints>
<includehint>kcolorbutton.h</includehint>

@ -1,50 +0,0 @@
/***************************************************************************
* 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 );
}

@ -9,7 +9,7 @@
<x>0</x>
<y>0</y>
<width>266</width>
<height>161</height>
<height>109</height>
</rect>
</property>
<property name="caption">
@ -96,28 +96,6 @@
<string>Alt+H</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_TempUseCompositing</cstring>
</property>
<property name="text">
<string>USE COMPOSITE</string>
</property>
<property name="accel">
<string></string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_TempDrawBoundaries</cstring>
</property>
<property name="text">
<string>DRAW BOUNDARIES</string>
</property>
<property name="accel">
<string></string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer3</cstring>

@ -0,0 +1,160 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>DlgPerformance</class>
<widget class="QWidget">
<property name="name">
<cstring>DlgPerformance</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>350</width>
<height>218</height>
</rect>
</property>
<property name="caption">
<string>DlgPerformance</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>0</number>
</property>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox1</cstring>
</property>
<property name="title">
<string>CPU Usage</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_UseCompositing</cstring>
</property>
<property name="text">
<string>Enable transparency and other effects (default)</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_TempDrawBoundaries</cstring>
</property>
<property name="text">
<string>(TEMP) DRAW BOUNDARIES</string>
</property>
<property name="accel">
<string></string>
</property>
</widget>
</vbox>
</widget>
<widget class="QButtonGroup">
<property name="name">
<cstring>kcfg_MemoryLevel</cstring>
</property>
<property name="title">
<string>Memory Usage</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QRadioButton">
<property name="name">
<cstring>lowRadio</cstring>
</property>
<property name="text">
<string>Low</string>
</property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>normalRadio</cstring>
</property>
<property name="text">
<string>Normal (default)</string>
</property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>aggressiveRadio</cstring>
</property>
<property name="text">
<string>Aggressive</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>descLabel</cstring>
</property>
<property name="text">
<string>...</string>
</property>
<property name="textFormat">
<enum>PlainText</enum>
</property>
<property name="alignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
</vbox>
</widget>
<spacer>
<property name="name">
<cstring>spacer3</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>90</height>
</size>
</property>
</spacer>
</vbox>
</widget>
<connections>
<connection>
<sender>lowRadio</sender>
<signal>toggled(bool)</signal>
<receiver>DlgPerformance</receiver>
<slot>lowRadio_toggled(bool)</slot>
</connection>
<connection>
<sender>normalRadio</sender>
<signal>toggled(bool)</signal>
<receiver>DlgPerformance</receiver>
<slot>normalRadio_toggled(bool)</slot>
</connection>
<connection>
<sender>aggressiveRadio</sender>
<signal>toggled(bool)</signal>
<receiver>DlgPerformance</receiver>
<slot>aggressiveRadio_toggled(bool)</slot>
</connection>
</connections>
<includes>
<include location="global" impldecl="in implementation">kdialog.h</include>
<include location="local" impldecl="in implementation">dlgperformance.ui.h</include>
</includes>
<slots>
<slot>lowRadio_toggled( bool on )</slot>
<slot>normalRadio_toggled( bool on )</slot>
<slot>aggressiveRadio_toggled( bool on )</slot>
</slots>
<functions>
<function access="private">init()</function>
</functions>
<layoutdefaults spacing="6" margin="11"/>
</UI>

@ -0,0 +1,37 @@
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
#include <klocale.h>
void DlgPerformance::init()
{
QFont labelFont = descLabel->font();
labelFont.setBold( true );
descLabel->setFont( labelFont );
}
void DlgPerformance::lowRadio_toggled( bool on )
{
if ( on ) descLabel->setText( i18n("Keeps used memory as low as possible. Don't reuse anything. (for systems with low memory)") );
}
void DlgPerformance::normalRadio_toggled( bool on )
{
if ( on ) descLabel->setText( i18n("A good compromise between memory usage and speed gain. Preload next page and boost searches. (for systems with 256MB of memory typically)") );
}
void DlgPerformance::aggressiveRadio_toggled( bool on )
{
if ( on ) descLabel->setText( i18n("Keeps everything in mempory. Preload next pages. Boost searches. (for systems with more than 512MB of memory)") );
}

@ -15,9 +15,13 @@
<default>Normal</default>
<choices>
<choice name="Normal" />
<choice name="pad_paper_color" />
<choice name="Inverted" />
<choice name="Recolor" />
<choice name="pad_fg_color" />
<choice name="pad_bg_color" />
<choice name="BlackWhite" />
<choice name="pad_contrast" />
</choices>
</entry>
<entry key="RecolorForeground" type="Color" >
@ -61,17 +65,19 @@
</group>
<group name="Performance" >
<entry key="MemoryLevel" type="Enum" >
<values>
<value>Low</value>
<value>Normal</value>
<value>Aggressive</value>
</values>
<default>Normal</default>
<choices>
<choice name="Low" />
<choice name="Normal" />
<choice name="Aggressive" />
<choice name="pad_description" />
</choices>
</entry>
<entry key="UseCompositing" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="Temp" >
<entry key="TempUseCompositing" type="Bool" >
<default>false</default>
</entry>
<entry key="TempDrawBoundaries" type="Bool" >
<default>false</default>
</entry>

@ -11,6 +11,7 @@
// single config pages
#include "dlggeneral.h"
#include "dlgperformance.h"
#include "dlgaccessibility.h"
// reimplementing this
@ -20,8 +21,10 @@ PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skelet
: KConfigDialog( parent, "preferences", skeleton )
{
m_general = new DlgGeneral(0);
m_performance = new DlgPerformance(0);
m_accessibility = new DlgAccessibility(0);
addPage( m_general, i18n("General"), "gohome", i18n("General Options") );
addPage( m_performance, i18n("Performance"), "launch", i18n("Performance Tuning") );
addPage( m_accessibility, i18n("Accessibility"), "viewmag", i18n("Reading Aids") );
}

@ -17,6 +17,7 @@ class QWidget;
class KConfigSkeleton;
class DlgGeneral;
class DlgPerformance;
class DlgAccessibility;
class PreferencesDialog : public KConfigDialog
@ -34,6 +35,7 @@ class PreferencesDialog : public KConfigDialog
private:
DlgGeneral * m_general;
DlgPerformance * m_performance;
DlgAccessibility * m_accessibility;
};

@ -331,7 +331,7 @@ void PageView::viewportPaintEvent( QPaintEvent * pe )
continue;
}
if ( Settings::tempUseCompositing() )
if ( Settings::useCompositing() )
{
// create pixmap and open a painter over it
QPixmap doubleBuffer( contentsRect.size() );

Loading…
Cancel
Save