From 1c5fe136243e5c0b0fafa786bc5ae39465ef1517 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 31 Mar 2006 15:14:47 +0000 Subject: [PATCH] Convert the Accessibility and Performance configuration pages to Qt4. Drawback: they still have a Q3ButtonGroup, I need a replacement for it... svn path=/branches/work/kde4/playground/graphics/okular/; revision=525009 --- CMakeLists.txt | 9 +- conf/dlgaccessibility.cpp | 19 ++ conf/dlgaccessibility.h | 26 ++ conf/dlgaccessibility.ui | 576 ----------------------------------- conf/dlgaccessibilitybase.ui | 408 +++++++++++++++++++++++++ conf/dlgperformance.cpp | 43 +++ conf/dlgperformance.h | 33 ++ conf/dlgperformance.ui | 281 ----------------- conf/dlgperformance.ui.h | 38 --- conf/dlgperformancebase.ui | 270 ++++++++++++++++ 10 files changed, 803 insertions(+), 900 deletions(-) create mode 100644 conf/dlgaccessibility.cpp create mode 100644 conf/dlgaccessibility.h delete mode 100644 conf/dlgaccessibility.ui create mode 100644 conf/dlgaccessibilitybase.ui create mode 100644 conf/dlgperformance.cpp create mode 100644 conf/dlgperformance.h delete mode 100644 conf/dlgperformance.ui delete mode 100644 conf/dlgperformance.ui.h create mode 100644 conf/dlgperformancebase.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index 108766436..d70e7baad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,17 +14,16 @@ include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_D set(oKularconf_SRCS ${CMAKE_SOURCE_DIR}/okular/conf/preferencesdialog.cpp + ${CMAKE_SOURCE_DIR}/okular/conf/dlgaccessibility.cpp ${CMAKE_SOURCE_DIR}/okular/conf/dlggeneral.cpp + ${CMAKE_SOURCE_DIR}/okular/conf/dlgperformance.cpp ${CMAKE_SOURCE_DIR}/okular/conf/dlgpresentation.cpp ) -kde4_add_ui3_files(oKularconf_SRCS - ${CMAKE_SOURCE_DIR}/okular/conf/dlgaccessibility.ui - ${CMAKE_SOURCE_DIR}/okular/conf/dlgperformance.ui -) - kde4_add_ui_files(oKularconf_SRCS + ${CMAKE_SOURCE_DIR}/okular/conf/dlgaccessibilitybase.ui ${CMAKE_SOURCE_DIR}/okular/conf/dlggeneralbase.ui + ${CMAKE_SOURCE_DIR}/okular/conf/dlgperformancebase.ui ${CMAKE_SOURCE_DIR}/okular/conf/dlgpresentationbase.ui ) diff --git a/conf/dlgaccessibility.cpp b/conf/dlgaccessibility.cpp new file mode 100644 index 000000000..7872e1f0c --- /dev/null +++ b/conf/dlgaccessibility.cpp @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (C) 2006 by Pino Toscano * + * * + * 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 "dlgaccessibilitybase.h" + +#include "dlgaccessibility.h" + +DlgAccessibility::DlgAccessibility( QWidget * parent ) + : QWidget( parent ) +{ + m_dlg = new Ui_DlgAccessibilityBase(); + m_dlg->setupUi( this ); +} diff --git a/conf/dlgaccessibility.h b/conf/dlgaccessibility.h new file mode 100644 index 000000000..b91dc5a67 --- /dev/null +++ b/conf/dlgaccessibility.h @@ -0,0 +1,26 @@ +/*************************************************************************** + * Copyright (C) 2006 by Pino Toscano * + * * + * 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. * + ***************************************************************************/ + +#ifndef _DLGACCESSIBILITY_H +#define _DLGACCESSIBILITY_H + +#include + +class Ui_DlgAccessibilityBase; + +class DlgAccessibility : public QWidget +{ + public: + DlgAccessibility( QWidget * parent = 0 ); + + protected: + Ui_DlgAccessibilityBase * m_dlg; +}; + +#endif diff --git a/conf/dlgaccessibility.ui b/conf/dlgaccessibility.ui deleted file mode 100644 index a9f6495dd..000000000 --- a/conf/dlgaccessibility.ui +++ /dev/null @@ -1,576 +0,0 @@ - -DlgAccessibility - - - DlgAccessibility - - - - 0 - 0 - 376 - 364 - - - - - unnamed - - - 0 - - - - kcfg_HighlightImages - - - Draw border around &Images - - - - - kcfg_HighlightLinks - - - Draw border around &Links - - - - - kcfg_ChangeColors - - - - 5 - 4 - 0 - 0 - - - - Change &Colors - - - true - - - false - - - - unnamed - - - - warn - - - - 5 - 4 - 0 - 0 - - - - - 80 - 0 - 0 - - - - Warning: these options can badly affect drawing speed. - - - PlainText - - - - - kcfg_RenderMode - - - false - - - - 5 - 4 - 0 - 0 - - - - NoFrame - - - 0 - - - - - - - unnamed - - - 0 - - - - radioInverted - - - &Invert colors - - - true - - - - - radioNormal - - - Change &paper color - - - - - layout5 - - - - unnamed - - - - spacer14_3 - - - Horizontal - - - Fixed - - - - 16 - 20 - - - - - - textLabel1 - - - false - - - Paper color: - - - kcfg_PaperColor - - - - - kcfg_PaperColor - - - false - - - - - - - - spacer7_2 - - - Horizontal - - - Expanding - - - - 30 - 20 - - - - - - - - radioRecolor - - - &Change dark and light colors - - - - - layout2 - - - - unnamed - - - 0 - - - - spacer12_2 - - - Horizontal - - - Expanding - - - - 48 - 21 - - - - - - kcfg_RecolorBackground - - - false - - - - - - - - spacer14_2 - - - Horizontal - - - Fixed - - - - 16 - 20 - - - - - - kcfg_RecolorForeground - - - false - - - - - - - - spacer12 - - - Horizontal - - - Expanding - - - - 48 - 21 - - - - - - textLabel3_2 - - - false - - - Light color: - - - - - spacer14 - - - Horizontal - - - Fixed - - - - 16 - 20 - - - - - - textLabel3 - - - false - - - Dark color: - - - - - - - radioContrast - - - Convert to &black and white - - - - - layout5 - - - - unnamed - - - - textLabel2_2 - - - false - - - Contrast: - - - - - spacer10_2 - - - Horizontal - - - Expanding - - - - 48 - 21 - - - - - - spacer11_2 - - - Horizontal - - - Fixed - - - - 16 - 20 - - - - - - spacer11 - - - Horizontal - - - Fixed - - - - 16 - 20 - - - - - - spacer10 - - - Horizontal - - - Expanding - - - - 48 - 21 - - - - - - kcfg_BWContrast - - - false - - - - 7 - 0 - 0 - 0 - - - - 1 - - - Horizontal - - - - - kcfg_BWThreshold - - - false - - - - 7 - 0 - 0 - 0 - - - - 16 - - - Horizontal - - - - - textLabel2 - - - false - - - Threshold: - - - - - - - - - - - - - radioRecolor - toggled(bool) - textLabel3 - setEnabled(bool) - - - radioRecolor - toggled(bool) - kcfg_RecolorForeground - setEnabled(bool) - - - radioRecolor - toggled(bool) - textLabel3_2 - setEnabled(bool) - - - radioRecolor - toggled(bool) - kcfg_RecolorBackground - setEnabled(bool) - - - radioContrast - toggled(bool) - textLabel2 - setEnabled(bool) - - - radioContrast - toggled(bool) - kcfg_BWThreshold - setEnabled(bool) - - - radioNormal - toggled(bool) - textLabel1 - setEnabled(bool) - - - radioNormal - toggled(bool) - kcfg_PaperColor - setEnabled(bool) - - - radioContrast - toggled(bool) - textLabel2_2 - setEnabled(bool) - - - radioContrast - toggled(bool) - kcfg_BWContrast - setEnabled(bool) - - - kcfg_ChangeColors - toggled(bool) - kcfg_RenderMode - setEnabled(bool) - - - - kdialog.h - - - - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - - diff --git a/conf/dlgaccessibilitybase.ui b/conf/dlgaccessibilitybase.ui new file mode 100644 index 000000000..d2db346b5 --- /dev/null +++ b/conf/dlgaccessibilitybase.ui @@ -0,0 +1,408 @@ + + + + + DlgAccessibilityBase + + + + 0 + 0 + 445 + 380 + + + + + 9 + + + 6 + + + + + Draw border around &Images + + + + + + + Draw border around &Links + + + + + + + true + + + Change &Colors + + + true + + + false + + + + 9 + + + 6 + + + + + + 5 + 4 + 0 + 0 + + + + Warning: these options can badly affect drawing speed. + + + Qt::PlainText + + + true + + + + + + + + 5 + 4 + 0 + 0 + + + + + + + Qt::Vertical + + + + 0 + + + 0 + + + + + &Invert colors + + + true + + + + + + + Change &paper color + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + Paper color: + + + kcfg_PaperColor + + + + + + + + + + + + &Change dark and light colors + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + Dark color: + + + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + Light color: + + + + + + + + + + + + Convert to &black and white + + + + + + + 0 + + + 5 + + + + + Contrast: + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 48 + 21 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 48 + 21 + + + + + + + + + 7 + 0 + 0 + 0 + + + + 1 + + + Qt::Horizontal + + + + + + + + 7 + 0 + 0 + 0 + + + + 16 + + + Qt::Horizontal + + + + + + + Threshold: + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 16 + + + + + + + + qPixmapFromMimeSource + + + KColorButton + QWidget +
kcolorbutton.h
+ 1 + +
+ + Q3ButtonGroup + +
Qt3Support/Q3ButtonGroup
+ 1 + +
+
+ + +
diff --git a/conf/dlgperformance.cpp b/conf/dlgperformance.cpp new file mode 100644 index 000000000..7d26af65f --- /dev/null +++ b/conf/dlgperformance.cpp @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2006 by Pino Toscano * + * * + * 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 "dlgperformancebase.h" + +#include "dlgperformance.h" + +DlgPerformance::DlgPerformance( QWidget * parent ) + : QWidget( parent ) +{ + m_dlg = new Ui_DlgPerformanceBase(); + m_dlg->setupUi( this ); + + connect( m_dlg->lowRadio, SIGNAL( toggled( bool ) ), this, SLOT( lowRadio_toggled( bool ) ) ); + connect( m_dlg->normalRadio, SIGNAL( toggled( bool ) ), this, SLOT( normalRadio_toggled( bool ) ) ); + connect( m_dlg->aggressiveRadio, SIGNAL( toggled( bool ) ), this, SLOT( aggressiveRadio_toggled( bool ) ) ); +} + +void DlgPerformance::lowRadio_toggled( bool on ) +{ + if ( on ) + m_dlg->descLabel->setText( i18n("Keeps used memory as low as possible. Do not reuse anything. (For systems with low memory.)") ); +} + +void DlgPerformance::normalRadio_toggled( bool on ) +{ + if ( on ) + m_dlg->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 ) + m_dlg->descLabel->setText( i18n("Keeps everything in memory. Preload next pages. Boost searches. (For systems with more than 512MB of memory.)") ); +} + +#include "dlgperformance.moc" diff --git a/conf/dlgperformance.h b/conf/dlgperformance.h new file mode 100644 index 000000000..642250bdb --- /dev/null +++ b/conf/dlgperformance.h @@ -0,0 +1,33 @@ +/*************************************************************************** + * Copyright (C) 2006 by Pino Toscano * + * * + * 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. * + ***************************************************************************/ + +#ifndef _DLGPERFORMANCE_H +#define _DLGPERFORMANCE_H + +#include + +class Ui_DlgPerformanceBase; + +class DlgPerformance : public QWidget +{ + Q_OBJECT + + public: + DlgPerformance( QWidget * parent = 0 ); + + protected slots: + void lowRadio_toggled( bool on ); + void normalRadio_toggled( bool on ); + void aggressiveRadio_toggled( bool on ); + + protected: + Ui_DlgPerformanceBase * m_dlg; +}; + +#endif diff --git a/conf/dlgperformance.ui b/conf/dlgperformance.ui deleted file mode 100644 index f1d1d2bed..000000000 --- a/conf/dlgperformance.ui +++ /dev/null @@ -1,281 +0,0 @@ - -DlgPerformance - - - DlgPerformance - - - - 0 - 0 - 284 - 222 - - - - - unnamed - - - 0 - - - - groupBox1 - - - - 5 - 4 - 0 - 0 - - - - CPU Usage - - - - unnamed - - - - layout9 - - - - unnamed - - - - kcfg_EnableCompositing - - - Enable &transparency effects - - - - - kcfg_EnableThreading - - - Enable &background generation - - - - - - - layout6_2 - - - - unnamed - - - - pixmapLabel1_2 - - - - 0 - 0 - 0 - 0 - - - - "kcmprocessor", 32 - - - - - spacer7_2 - - - Vertical - - - Minimum - - - - 21 - 1 - - - - - - - - - - kcfg_MemoryLevel - - - - 5 - 4 - 0 - 0 - - - - Memory Usage - - - - unnamed - - - - descLabel - - - - - - PlainText - - - AlignVCenter - - - true - - - - - layout5 - - - - unnamed - - - - lowRadio - - - &Low - - - - - normalRadio - - - &Normal (default) - - - - - aggressiveRadio - - - &Aggressive - - - - - - - layout6 - - - - unnamed - - - - pixmapLabel1 - - - - 0 - 0 - 0 - 0 - - - - "kcmmemory", 32 - - - - - spacer7 - - - Vertical - - - Minimum - - - - 21 - 1 - - - - - - - - - - spacer1 - - - Vertical - - - Expanding - - - - 21 - 16 - - - - - - - - lowRadio - toggled(bool) - DlgPerformance - lowRadio_toggled(bool) - - - normalRadio - toggled(bool) - DlgPerformance - normalRadio_toggled(bool) - - - aggressiveRadio - toggled(bool) - DlgPerformance - aggressiveRadio_toggled(bool) - - - - kdialog.h - kiconloader.h - dlgperformance.ui.h - - - lowRadio_toggled( bool on ) - normalRadio_toggled( bool on ) - aggressiveRadio_toggled( bool on ) - - - init() - -DesktopIcon - - diff --git a/conf/dlgperformance.ui.h b/conf/dlgperformance.ui.h deleted file mode 100644 index 4a13310e0..000000000 --- a/conf/dlgperformance.ui.h +++ /dev/null @@ -1,38 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by Enrico Ros * - * * - * 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 - -// The purpose of this file is only to display a sort of descriptive text -// when the user clicks on each memory profile. - -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. Do not 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 memory. Preload next pages. Boost searches. (For systems with more than 512MB of memory.)") ); -} diff --git a/conf/dlgperformancebase.ui b/conf/dlgperformancebase.ui new file mode 100644 index 000000000..84fcb5609 --- /dev/null +++ b/conf/dlgperformancebase.ui @@ -0,0 +1,270 @@ + + + + + DlgPerformanceBase + + + + 0 + 0 + 305 + 287 + + + + + 9 + + + 6 + + + + + CPU Usage + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + 0 + + + 6 + + + + + Enable &transparency effects + + + + + + + Enable &background generation + + + + + + + + + 0 + + + 6 + + + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 21 + 1 + + + + + + + + + + + + + + + + 5 + 4 + 0 + 0 + + + + Memory Usage + + + Qt::Vertical + + + + 0 + + + 0 + + + + + 0 + + + 6 + + + + + 0 + + + 6 + + + + + &Low + + + + + + + &Normal (default) + + + + + + + &Aggressive + + + + + + + + + 0 + + + 6 + + + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 21 + 1 + + + + + + + + + + + + + + + Qt::PlainText + + + Qt::AlignVCenter + + + true + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 284 + 4 + + + + + + + + DesktopIcon + + + Q3ButtonGroup + +
Qt3Support/Q3ButtonGroup
+ 1 + +
+
+ + kiconloader.h + + + +