From 47d455dd55be855e4cc691c32f687f723d9247ee Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kview/kviewcanvas/config/Makefile.am | 16 ++ kview/kviewcanvas/config/confmodules.cpp | 145 ++++++++++ kview/kviewcanvas/config/confmodules.h | 51 ++++ kview/kviewcanvas/config/defaults.h | 46 ++++ kview/kviewcanvas/config/generalconfigwidget.ui | 300 +++++++++++++++++++++ kview/kviewcanvas/config/kviewcanvasconfig.desktop | 118 ++++++++ 6 files changed, 676 insertions(+) create mode 100644 kview/kviewcanvas/config/Makefile.am create mode 100644 kview/kviewcanvas/config/confmodules.cpp create mode 100644 kview/kviewcanvas/config/confmodules.h create mode 100644 kview/kviewcanvas/config/defaults.h create mode 100644 kview/kviewcanvas/config/generalconfigwidget.ui create mode 100644 kview/kviewcanvas/config/kviewcanvasconfig.desktop (limited to 'kview/kviewcanvas/config') diff --git a/kview/kviewcanvas/config/Makefile.am b/kview/kviewcanvas/config/Makefile.am new file mode 100644 index 00000000..b22a1ad5 --- /dev/null +++ b/kview/kviewcanvas/config/Makefile.am @@ -0,0 +1,16 @@ +kde_module_LTLIBRARIES = kcm_kviewcanvasconfig.la +INCLUDES = $(all_includes) + +noinst_HEADERS = confmodules.h + +kcm_kviewcanvasconfig_la_SOURCES = generalconfigwidget.ui confmodules.cpp +kcm_kviewcanvasconfig_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -module -avoid-version +kcm_kviewcanvasconfig_la_LIBADD = $(LIB_KDEUI) + +kcm_kviewcanvasconfig_DATA = kviewcanvasconfig.desktop +kcm_kviewcanvasconfigdir = $(kde_servicesdir)/kconfiguredialog + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/kcm_kviewcanvasconfig.pot diff --git a/kview/kviewcanvas/config/confmodules.cpp b/kview/kviewcanvas/config/confmodules.cpp new file mode 100644 index 00000000..c5e47dac --- /dev/null +++ b/kview/kviewcanvas/config/confmodules.cpp @@ -0,0 +1,145 @@ +/* This file is part of the KDE project + Copyright (C) 2002-2003 Matthias Kretz + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#include "confmodules.h" +#include "generalconfigwidget.h" +#include "defaults.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +typedef KGenericFactory KViewCanvasConfigFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_kviewcanvasconfig, KViewCanvasConfigFactory( "kcm_kviewcanvasconfig" ) ) + +KViewCanvasConfig::KViewCanvasConfig( QWidget * parent, const char *, const QStringList & args ) + : KCModule( KViewCanvasConfigFactory::instance(), parent, args ) + , m_config( new KConfig( "kviewcanvasrc" ) ) +{ + QBoxLayout * layout = new QVBoxLayout( this ); + layout->setAutoAdd( true ); + + m_pWidget = new GeneralConfigWidget( this ); + m_pWidget->m_pMinWidth ->setRange( 1, 200 ); + m_pWidget->m_pMinHeight->setRange( 1, 200 ); + m_pWidget->m_pMaxWidth ->setRange( 1, 10000 ); + m_pWidget->m_pMaxHeight->setRange( 1, 10000 ); + + // clear m_items + m_items.clear(); + + for( unsigned int i = 1; i <= Defaults::numOfBlendEffects; ++i ) + { + QCheckListItem * item = new QCheckListItem( m_pWidget->m_pListView, i18n( Defaults::blendEffectDescription[ i ] ), QCheckListItem::CheckBox ); + m_items.append( item ); + } + + connect( m_pWidget->m_pListView, SIGNAL( clicked( QListViewItem * ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pListView, SIGNAL( spacePressed( QListViewItem * ) ), this, SLOT( configChanged() ) ); + + connect( m_pWidget->m_pSmoothScaling, SIGNAL( toggled( bool ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pKeepRatio, SIGNAL( toggled( bool ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pCenterImage, SIGNAL( toggled( bool ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_bgColor, SIGNAL( changed( const QColor & ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pMinWidth, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pMaxWidth, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pMinHeight, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pMaxHeight, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); + + load(); +} + +KViewCanvasConfig::~KViewCanvasConfig() +{ +} + +void KViewCanvasConfig::save() +{ + KConfigGroup cfgGroup( m_config, "Settings" ); + cfgGroup.writeEntry( "Smooth Scaling", m_pWidget->m_pSmoothScaling->isChecked() ); + cfgGroup.writeEntry( "Keep Aspect Ratio", m_pWidget->m_pKeepRatio->isChecked() ); + cfgGroup.writeEntry( "Center Image", m_pWidget->m_pCenterImage->isChecked() ); + + cfgGroup.writeEntry( "Background Color", m_pWidget->m_bgColor->color() ); + + cfgGroup.writeEntry( "Minimum Width" , m_pWidget->m_pMinWidth->value() ); + cfgGroup.writeEntry( "Minimum Height", m_pWidget->m_pMinHeight->value() ); + cfgGroup.writeEntry( "Maximum Width" , m_pWidget->m_pMaxWidth->value() ); + cfgGroup.writeEntry( "Maximum Height", m_pWidget->m_pMaxHeight->value() ); + + KConfigGroup cfgGroup2( m_config, "Blend Effects" ); + QCheckListItem *item = m_items.first(); + for( int i = 1; item; item = m_items.next(), ++i ) + cfgGroup2.writeEntry( QString::number( i ), item->isOn() ); + m_config->sync(); +} + +void KViewCanvasConfig::load() +{ + KConfigGroup cfgGroup( m_config, "Settings" ); + m_pWidget->m_pSmoothScaling->setChecked( cfgGroup.readBoolEntry( "Smooth Scaling", Defaults::smoothScaling ) ); + m_pWidget->m_pKeepRatio->setChecked( cfgGroup.readBoolEntry( "Keep Aspect Ratio", Defaults::keepAspectRatio ) ); + m_pWidget->m_pCenterImage->setChecked( cfgGroup.readBoolEntry( "Center Image", Defaults::centerImage ) ); + + m_pWidget->m_bgColor->setColor( cfgGroup.readColorEntry( "Background Color", &Defaults::bgColor ) ); + + m_pWidget->m_pMinWidth ->setValue( cfgGroup.readNumEntry( "Minimum Width" , Defaults::minSize.width() ) ); + m_pWidget->m_pMinHeight->setValue( cfgGroup.readNumEntry( "Minimum Height", Defaults::minSize.height() ) ); + m_pWidget->m_pMaxWidth ->setValue( cfgGroup.readNumEntry( "Maximum Width" , Defaults::maxSize.width() ) ); + m_pWidget->m_pMaxHeight->setValue( cfgGroup.readNumEntry( "Maximum Height", Defaults::maxSize.height() ) ); + + KConfigGroup cfgGroup2( m_config, "Blend Effects" ); + QCheckListItem * item = m_items.first(); + for( int i = 1; item; item = m_items.next(), ++i ) + item->setOn( cfgGroup2.readBoolEntry( QString::number( i ), false ) ); +} + +void KViewCanvasConfig::defaults() +{ + m_pWidget->m_pSmoothScaling->setChecked( Defaults::smoothScaling ); + m_pWidget->m_pKeepRatio->setChecked( Defaults::keepAspectRatio ); + m_pWidget->m_pCenterImage->setChecked( Defaults::centerImage ); + + m_pWidget->m_bgColor->setColor( Defaults::bgColor ); + + m_pWidget->m_pMinWidth ->setValue( Defaults::minSize.width() ); + m_pWidget->m_pMinHeight->setValue( Defaults::minSize.height() ); + m_pWidget->m_pMaxWidth ->setValue( Defaults::maxSize.width() ); + m_pWidget->m_pMaxHeight->setValue( Defaults::maxSize.height() ); + + QCheckListItem * item = m_items.first(); + for( int i = 1; item; item = m_items.next(), ++i ) + item->setOn( false ); + emit changed( true ); +} + +void KViewCanvasConfig::configChanged() +{ + emit changed( true ); +} + +// vim:sw=4:ts=4 + +#include "confmodules.moc" diff --git a/kview/kviewcanvas/config/confmodules.h b/kview/kviewcanvas/config/confmodules.h new file mode 100644 index 00000000..f7dfe262 --- /dev/null +++ b/kview/kviewcanvas/config/confmodules.h @@ -0,0 +1,51 @@ +/* This file is part of the KDE project + Copyright (C) 2002-2003 Matthias Kretz + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef CONFMODULES_H +#define CONFMODULES_H + +#include +#include + +class GeneralConfigWidget; +class QCheckListItem; +class KConfig; + +class KViewCanvasConfig : public KCModule +{ + Q_OBJECT + public: + KViewCanvasConfig( QWidget * parent, const char * name = 0, const QStringList & args = QStringList() ); + ~KViewCanvasConfig(); + + void load(); + void save(); + void defaults(); + + private slots: + void configChanged(); + + private: + KConfig * m_config; + GeneralConfigWidget * m_pWidget; + QPtrList m_items; +}; + +// vim:sw=4:ts=4 + +#endif // CONFMODULES_H diff --git a/kview/kviewcanvas/config/defaults.h b/kview/kviewcanvas/config/defaults.h new file mode 100644 index 00000000..0a92d651 --- /dev/null +++ b/kview/kviewcanvas/config/defaults.h @@ -0,0 +1,46 @@ +/* This file is part of the KDE project + Copyright (C) 2003 Matthias Kretz + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef DEFAULTS_H +#define DEFAULTS_H + +#include +#include +#include + +namespace Defaults { + static const bool smoothScaling = false; + static const bool keepAspectRatio = true; + static const bool centerImage = true; + static const QColor bgColor( Qt::black ); + static const QSize minSize( 1, 1 ); + static const QSize maxSize( 10000, 10000 ); + static const unsigned int numOfBlendEffects = 4; + static const char * blendEffectDescription[ 6 ] = { + I18N_NOOP( "No Blending" ), + I18N_NOOP( "Wipe From Left" ), + I18N_NOOP( "Wipe From Right" ), + I18N_NOOP( "Wipe From Top" ), + I18N_NOOP( "Wipe From Bottom" ), + I18N_NOOP( "Alpha Blend" ) + }; +} + +#endif // DEFAULTS_H + +// vim: sw=4 ts=4 diff --git a/kview/kviewcanvas/config/generalconfigwidget.ui b/kview/kviewcanvas/config/generalconfigwidget.ui new file mode 100644 index 00000000..b4646381 --- /dev/null +++ b/kview/kviewcanvas/config/generalconfigwidget.ui @@ -0,0 +1,300 @@ + +GeneralConfigWidget +Matthias Kretz <kretz@kde.org> + + + GeneralConfigWidget + + + + 0 + 0 + 398 + 327 + + + + + unnamed + + + 0 + + + + Layout4 + + + + unnamed + + + + m_pMinHeight + + + Minimum height: + + + 1 + + + 200 + + + The height of the image shown will not get smaller than the size you enter here. +A value of 10 would cause a 1x1 image to be stretched vertically by a factor of 10. + + + + + m_pMaxHeight + + + Maximum height: + + + 1 + + + 100000 + + + The height of the image shown will not get bigger than the size you enter here. +A value of 100 would cause a 1000x1000 image to be compressed vertically by a factor of 0.1. + + + + + m_pMinWidth + + + Minimum width: + + + 1 + + + 200 + + + The width of the image shown will not get smaller than the size you enter here. +A value of 10 would cause a 1x1 image to be stretched horizontally by a factor of 10. + + + + + m_pMaxWidth + + + Maximum width: + + + 1 + + + 100000 + + + The width of the image shown will not get bigger than the size you enter here. +A value of 100 would cause a 1000x1000 image to be compressed horizontally by a factor of 0.1. + + + + + Spacer3 + + + Horizontal + + + MinimumExpanding + + + + 0 + 0 + + + + + + Spacer2 + + + Horizontal + + + MinimumExpanding + + + + 0 + 0 + + + + + + + + layout3 + + + + unnamed + + + + TextLabel3 + + + Choose which blend effects should be used: + + + + + + Effect + + + true + + + true + + + + m_pListView + + + NoSelection + + + true + + + Every effect selected may be used to create a transition effect between the images. If you select multiple effects they will be chosen randomly. + + + + + + + layout4 + + + + unnamed + + + + m_pSmoothScaling + + + Use smooth scaling (high quality but slower) + + + + + m_pKeepRatio + + + Keep aspect ratio + + + If this is checked KView will always try to keep the aspect ratio. That means if the width is scaled with a factor x, the height is scaled with the same factor. + + + + + m_pCenterImage + + + Center image + + + + + + + groupBox3 + + + &Background Color + + + + unnamed + + + + m_bgColor + + + + 0 + 0 + 0 + 0 + + + + + 32 + 32 + + + + + + + + + spacer9 + + + Horizontal + + + Expanding + + + + 151 + 21 + + + + + + + + + m_pSmoothScaling + m_pKeepRatio + m_pCenterImage + m_pMinWidth + m_pMinHeight + m_pMaxWidth + m_pMaxHeight + m_pListView + + + kdialog.h + + + + + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + klistview.h + kcolorbutton.h + + diff --git a/kview/kviewcanvas/config/kviewcanvasconfig.desktop b/kview/kviewcanvas/config/kviewcanvasconfig.desktop new file mode 100644 index 00000000..7ce31c64 --- /dev/null +++ b/kview/kviewcanvas/config/kviewcanvasconfig.desktop @@ -0,0 +1,118 @@ +[Desktop Entry] +Icon=kview +Type=Service +ServiceTypes=KCModule + +X-KDE-ModuleType=Library +X-KDE-Library=kviewcanvasconfig +X-KDE-FactoryName=KViewCanvasConfigFactory +X-KDE-ParentApp=kview +X-KDE-ParentComponents=kviewcanvas +X-KDE-Weight=1 +X-KDE-CfgDlgHierarchy=Viewer + +Name=Viewer +Name[ar]=العارض +Name[bg]=Визуализатор +Name[br]=Gweler +Name[bs]=Preglednik +Name[ca]=Visualitzador +Name[cs]=Prohlížeč +Name[cy]=Gwelydd +Name[da]=Fremviser +Name[de]=Betrachter +Name[el]=Προβολέας +Name[eo]=Rigardilo +Name[es]=Visor +Name[et]=Näitaja +Name[eu]=Ikustailua +Name[fa]=مشاهده‌گر +Name[fi]=Näytin +Name[fr]=Afficheur +Name[gl]=Visor +Name[he]=מציג +Name[hi]=प्रदर्शक +Name[hu]=Nézegető +Name[is]=Birtir +Name[it]=Visore +Name[ja]=ビューア +Name[kk]=Кескінді қарау +Name[km]=កម្មវិធី​មើល +Name[lt]=Žiūriklis +Name[ms]=Pemapar +Name[nb]=Fremviser +Name[nds]=Kieker +Name[ne]=दर्शक +Name[nl]=Weergaveprogramma +Name[nn]=Framvisar +Name[pa]=ਦਰਸ਼ਕ +Name[pl]=Przeglądarka obrazków +Name[pt]=Visualizador +Name[pt_BR]=Visualizador +Name[ro]=Vizualizor +Name[ru]=Просмотрщик +Name[se]=Čájeheaddji +Name[sk]=Prehliadač +Name[sl]=Pregledovalnik +Name[sr]=Приказивач +Name[sr@Latn]=Prikazivač +Name[sv]=Visning +Name[ta]=காட்சி +Name[tg]=Намоишгар +Name[tr]=Görüntüleyici +Name[uk]=Переглядач +Name[uz]=Koʻruvchi +Name[uz@cyrillic]=Кўрувчи +Name[wa]=Håyneu +Name[zh_CN]=查看器 +Name[zh_HK]=檢視器 +Comment=General KViewCanvas Configuration +Comment[ar]=اعدادات KViewCanvas العامة +Comment[bg]=Общи настройки на визуализатора (KViewCanvas) +Comment[bs]=Opšte KViewCanvas postavke +Comment[ca]=Configuració general de KViewCanvas +Comment[cs]=Obecné nastavení KView +Comment[cy]=Ffurfweddiad Cyffredinol KGweldCynfas +Comment[da]=Generel indstilling af KViewCanvas +Comment[de]=Allgemeine Einstellungen für KViewCanvas +Comment[el]=Γενική ρύθμιση του KViewCanvas +Comment[eo]=Ĝenerala Agordo de KViewCanvas +Comment[es]=Configuración general de KViewCanvas +Comment[et]=KView lõuendite üldine seadistus +Comment[eu]=KViewCanvas konfigurazio orokorra +Comment[fa]=پیکربندی عمومی KViewCanvas +Comment[fi]=Yleiset KViewCanvas -asetukset +Comment[fr]=Configuration générale de KViewCanvas +Comment[gl]=Configuración xeral de KViewCanvas +Comment[he]=הגדרות KViewCanvas כלליות +Comment[hi]=सामान्य के-व्यू-केनवास कॉन्फ़िगरेशन +Comment[hu]=A KViewCanvas általános beállításai +Comment[is]=Almennar stillingar KViewCanvas +Comment[it]=Configurazione generale per KViewCanvas +Comment[ja]=KViewCanvas の一般的な設定 +Comment[kk]=KViewCanvas өрісінің жалпы баптаулары +Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​ទូទៅ​សម្រាប់ KViewCanvas +Comment[lt]=Bendrasis KViewCanvas konfigūravimas +Comment[ms]=Konfigurasi KViewCanvas Umum +Comment[nb]=Generelt oppsett av KViewCanvas +Comment[nds]=Allgemeen Instellen för KViewCanvas +Comment[ne]=साधारण केडीई दृश्य क्यानभास कन्फिगरेसन +Comment[nl]=Algemene KViewCanvas instellingen +Comment[nn]=Generelt oppsett av KViewCanvas +Comment[pl]=Ogólna konfiguracja KViewCanvas +Comment[pt]=Configuração Geral do KViewCanvas +Comment[pt_BR]=Configuração Geral do Canvas com o KView +Comment[ro]=Configurare KViewCanvas general +Comment[ru]=Общая настройка KViewCanvas +Comment[sk]=Všeobecné nastavenie KViewCanvas +Comment[sl]=Splošne nastavitve KViewCanvas +Comment[sr]=Општа подешавања за KViewCanvas +Comment[sr@Latn]=Opšta podešavanja za KViewCanvas +Comment[sv]=Allmän inställning av Kviews duk +Comment[ta]=பொதுவான கேகாட்சி சித்திரவடிவ வடிவமைப்பு +Comment[tg]=Танзимоти умумии KViewCanvas +Comment[tr]=Genel KView Ekran Ayarları +Comment[uk]=Загальні параметри KViewCanvas +Comment[zh_CN]=KViewCanvas 常规配置 +Comment[zh_HK]=一般 KViewCanvas 設定 +Comment[zh_TW]=一般 KViewCanvas 設定 -- cgit v1.2.1