From b363d2579af0a11b77e698aed2e1021c2233b644 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:50 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- tderesources/featureplan/CMakeLists.txt | 74 ++++++++++ tderesources/featureplan/Makefile.am | 61 +++++++++ tderesources/featureplan/benchmarkfeaturelist.cpp | 98 +++++++++++++ tderesources/featureplan/dumpfeaturelist.cpp | 102 ++++++++++++++ .../featureplan/kcal_resourcefeatureplan.cpp | 152 +++++++++++++++++++++ .../featureplan/kcal_resourcefeatureplan.desktop | 41 ++++++ .../featureplan/kcal_resourcefeatureplan.h | 68 +++++++++ .../featureplan/kcal_resourcefeatureplanconfig.cpp | 92 +++++++++++++ .../featureplan/kcal_resourcefeatureplanconfig.h | 54 ++++++++ .../featureplan/kcal_resourcefeatureplanplugin.cpp | 40 ++++++ tderesources/featureplan/kde-features.dtd | 25 ++++ tderesources/featureplan/kde-features.rng | 150 ++++++++++++++++++++ tderesources/featureplan/prefs.kcfgc | 9 ++ .../featureplan/tderesources_kcal_featureplan.kcfg | 20 +++ 14 files changed, 986 insertions(+) create mode 100644 tderesources/featureplan/CMakeLists.txt create mode 100644 tderesources/featureplan/Makefile.am create mode 100644 tderesources/featureplan/benchmarkfeaturelist.cpp create mode 100644 tderesources/featureplan/dumpfeaturelist.cpp create mode 100644 tderesources/featureplan/kcal_resourcefeatureplan.cpp create mode 100644 tderesources/featureplan/kcal_resourcefeatureplan.desktop create mode 100644 tderesources/featureplan/kcal_resourcefeatureplan.h create mode 100644 tderesources/featureplan/kcal_resourcefeatureplanconfig.cpp create mode 100644 tderesources/featureplan/kcal_resourcefeatureplanconfig.h create mode 100644 tderesources/featureplan/kcal_resourcefeatureplanplugin.cpp create mode 100644 tderesources/featureplan/kde-features.dtd create mode 100644 tderesources/featureplan/kde-features.rng create mode 100644 tderesources/featureplan/prefs.kcfgc create mode 100644 tderesources/featureplan/tderesources_kcal_featureplan.kcfg (limited to 'tderesources/featureplan') diff --git a/tderesources/featureplan/CMakeLists.txt b/tderesources/featureplan/CMakeLists.txt new file mode 100644 index 000000000..76e279c80 --- /dev/null +++ b/tderesources/featureplan/CMakeLists.txt @@ -0,0 +1,74 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +if( BUILD_KODE ) + set( KXML_COMPILER_EXECUTABLE ${CMAKE_BINARY_DIR}/kode/kxml_compiler/kxml_compiler ) + set( KXML_COMPILER_TARGET kxml_compiler ) +else( ) + find_program( KXML_COMPILER_EXECUTABLE + NAMES kxml_compiler + HINTS ${TDE_BIN_DIR} ${BIN_INSTALL_DIR} ) + if( NOT KXML_COMPILER_EXECUTABLE ) + tde_message_fatal( "kxml_compiler is NOT found.\n kode package is correctly installed?" ) + endif( ) +endif( ) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/libtdepim + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES + kcal_resourcefeatureplan.desktop + DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kcal ) + + +##### kcal_resourcefeatureplan (module) ######### + +tde_add_kpart( kcal_resourcefeatureplan AUTOMOC + SOURCES kcal_resourcefeatureplanplugin.cpp + LINK kcal_resourcefeatureplan-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### featureplancommon (static) ################ + +add_custom_command( + OUTPUT kde-features.h kde-features.cpp kde-features_parser.h kde-features_parser.cpp + COMMAND ${KXML_COMPILER_EXECUTABLE} --custom-parser ${CMAKE_CURRENT_SOURCE_DIR}/kde-features.rng >/dev/null + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/kde-features.rng ${KXML_COMPILER_TARGET} ) + +tde_add_library( featureplancommon STATIC_PIC + SOURCES + kde-features.cpp kde-features_parser.cpp prefs.kcfgc +) + + +##### kcal_resourcefeatureplan (shared) ######### + +tde_add_library( kcal_resourcefeatureplan SHARED AUTOMOC + SOURCES + kcal_resourcefeatureplan.cpp kcal_resourcefeatureplanconfig.cpp + VERSION 1.0.0 + LINK featureplancommon-static tdepim-shared + DESTINATION ${LIB_INSTALL_DIR} +) diff --git a/tderesources/featureplan/Makefile.am b/tderesources/featureplan/Makefile.am new file mode 100644 index 000000000..f37d5c6ba --- /dev/null +++ b/tderesources/featureplan/Makefile.am @@ -0,0 +1,61 @@ +INCLUDES = -I$(top_srcdir) $(all_includes) + +lib_LTLIBRARIES = libkcal_resourcefeatureplan.la + +noinst_LTLIBRARIES = libfeatureplancommon.la +libfeatureplancommon_la_SOURCES = kde-features.cpp kde-features_parser.cpp \ + prefs.kcfgc + +libkcal_resourcefeatureplan_la_SOURCES = kcal_resourcefeatureplan.cpp \ + kcal_resourcefeatureplanconfig.cpp +libkcal_resourcefeatureplan_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) \ + -version-info 1:0:0 -no-undefined +libkcal_resourcefeatureplan_la_LIBADD = libfeatureplancommon.la \ + $(top_builddir)/libkcal/libkcal.la \ + $(top_builddir)/libtdepim/libtdepim.la +libkcal_resourcefeatureplan_la_COMPILE_FIRST = kde-features.h prefs.h + + +kde_module_LTLIBRARIES = kcal_resourcefeatureplan.la + +kcal_resourcefeatureplan_la_SOURCES = kcal_resourcefeatureplanplugin.cpp +kcal_resourcefeatureplan_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kcal_resourcefeatureplan_la_LIBADD = libkcal_resourcefeatureplan.la +kcal_resourcefeatureplan_la_COMPILE_FIRST = kde-features.h prefs.h + +kcal_servicedir = $(kde_servicesdir)/tderesources/kcal +kcal_service_DATA = kcal_resourcefeatureplan.desktop + +check_PROGRAMS = dumpfeaturelist benchmarkfeaturelist + +dumpfeaturelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +dumpfeaturelist_LDADD = libfeatureplancommon.la $(LIB_TDECORE) +dumpfeaturelist_SOURCES = dumpfeaturelist.cpp +dumpfeaturelist_COMPILE_FIRST = kde-features.h + +benchmarkfeaturelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +benchmarkfeaturelist_LDADD = libfeatureplancommon.la $(LIB_TDECORE) +benchmarkfeaturelist_SOURCES = benchmarkfeaturelist.cpp +benchmarkfeaturelist_COMPILE_FIRST = kde-features.h + +kde-features.cpp: kde-features.h +kde-features_parser.h kde-features_parser.cpp: kde-features.h + +kde-features.h kde-features.cpp kde-features_parser.h kde-features_parser.cpp: $(srcdir)/kde-features.rng \ + $(top_builddir)/kode/kxml_compiler/kxml_compiler + $(top_builddir)/kode/kxml_compiler/kxml_compiler \ + --custom-parser $(srcdir)/kde-features.rng + +METASOURCES = AUTO +DISTCLEANFILES = kde-features.h kde-features.cpp \ + kde-features_parser.h kde-features_parser.cpp \ + kde-features.h.backup kde-features.cpp.backup \ + kde-features_parser.h.backup kde-features_parser.cpp.backup + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kres_featureplan.pot + +kcal_resourcefeatureplan.lo: kde-features_parser.h +kde-features.lo: kde-features.h +kde-features_parser.lo: kde-features_parser.h kde-features.h + diff --git a/tderesources/featureplan/benchmarkfeaturelist.cpp b/tderesources/featureplan/benchmarkfeaturelist.cpp new file mode 100644 index 000000000..f9f88c5cc --- /dev/null +++ b/tderesources/featureplan/benchmarkfeaturelist.cpp @@ -0,0 +1,98 @@ +/* + This file is part of tdepim. + + Copyright (c) 2004 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kde-features.h" +#include "kde-features_parser.h" + +#include +#include +#include +#include + +#include +#include + +#include + +static const KCmdLineOptions options[] = +{ + { "+featurelist", "Name of featurelist XML file", 0 }, + KCmdLineLastOption +}; + +void displayFeature( Feature *f ) +{ + std::cout << "FEATURE: " << f->summary().local8Bit() << std::endl; + Responsible::List r = f->responsibleList(); + Responsible::List::ConstIterator it; + for( it = r.begin(); it != r.end(); ++it ) { + std::cout << " RESPONSIBLE: " << (*it)->name().local8Bit() << " (" + << (*it)->email().local8Bit() << ")" << std::endl; + } + std::cout << " TARGET: " << f->target().local8Bit() << std::endl; + std::cout << " STATUS: " << f->status().local8Bit() << std::endl; +} + +void displayCategory( const TQValueList categories ) +{ + Category::List::ConstIterator it; + for( it = categories.begin(); it != categories.end(); ++it ) { + std::cout << "CATEGORY: " << (*it)->name().local8Bit() << std::endl; + + Feature::List features = (*it)->featureList(); + Feature::List::ConstIterator it2; + for( it2 = features.begin(); it2 != features.end(); ++it2 ) { + displayFeature( *it2 ); + } + + displayCategory( (*it)->categoryList() ); + } +} + +int main( int argc, char **argv ) +{ + TDEAboutData aboutData( "benchmarkfeaturelist", + "Benchmark for feature list XML parser", + "0.1" ); + TDECmdLineArgs::init( argc, argv, &aboutData ); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app( false, false ); + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + if ( args->count() != 1 ) { + args->usage( "Wrong number of arguments." ); + } + + TQString filename = TQFile::decodeName( args->arg( 0 ) ); + + for( int i = 0; i < 1; ++i ) { + FeaturesParser parser; + + Features *features = parser.parseFile( filename ); + + if ( !features ) { + kdError() << "Parse error" << endl; + return 1; + } + } +} diff --git a/tderesources/featureplan/dumpfeaturelist.cpp b/tderesources/featureplan/dumpfeaturelist.cpp new file mode 100644 index 000000000..a007b70dc --- /dev/null +++ b/tderesources/featureplan/dumpfeaturelist.cpp @@ -0,0 +1,102 @@ +/* + This file is part of tdepim. + + Copyright (c) 2004 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kde-features.h" +#include "kde-features_parser.h" + +#include +#include +#include +#include + +#include +#include + +#include + +static const KCmdLineOptions options[] = +{ + { "+featurelist", "Name of featurelist XML file", 0 }, + KCmdLineLastOption +}; + +void displayFeature( Feature *f ) +{ + std::cout << "FEATURE: " << f->summary().local8Bit() << std::endl; + Responsible::List r = f->responsibleList(); + Responsible::List::ConstIterator it; + for( it = r.begin(); it != r.end(); ++it ) { + std::cout << " RESPONSIBLE: " << (*it)->name().local8Bit() << " (" + << (*it)->email().local8Bit() << ")" << std::endl; + } + std::cout << " TARGET: " << f->target().local8Bit() << std::endl; + std::cout << " STATUS: " << f->status().local8Bit() << std::endl; +} + +void displayCategory( const TQValueList categories ) +{ + Category::List::ConstIterator it; + for( it = categories.begin(); it != categories.end(); ++it ) { + std::cout << "CATEGORY: " << (*it)->name().local8Bit() << std::endl; + + Feature::List features = (*it)->featureList(); + Feature::List::ConstIterator it2; + for( it2 = features.begin(); it2 != features.end(); ++it2 ) { + displayFeature( *it2 ); + } + + displayCategory( (*it)->categoryList() ); + } +} + +int main( int argc, char **argv ) +{ + TDEAboutData aboutData( "dumpfeaturelist", "Dump XML feature list to stdout", + "0.1" ); + TDECmdLineArgs::init( argc, argv, &aboutData ); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app( false, false ); + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + if ( args->count() != 1 ) { + args->usage( "Wrong number of arguments." ); + } + + TQString filename = TQFile::decodeName( args->arg( 0 ) ); + + FeaturesParser parser; + + Features *features = parser.parseFile( filename ); + + if ( !features ) { + kdError() << "Parse error" << endl; + } else { + TQValueList categories = features->categoryList(); + displayCategory( categories ); + + TQString out = filename + ".out"; + if ( !features->writeFile( out ) ) { + kdError() << "Write error" << endl; + } + } +} diff --git a/tderesources/featureplan/kcal_resourcefeatureplan.cpp b/tderesources/featureplan/kcal_resourcefeatureplan.cpp new file mode 100644 index 000000000..2bddc7fd9 --- /dev/null +++ b/tderesources/featureplan/kcal_resourcefeatureplan.cpp @@ -0,0 +1,152 @@ +/* + This file is part of tdepim. + + Copyright (c) 2004 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kcal_resourcefeatureplan.h" + +#include "kcal_resourcefeatureplanconfig.h" + +#include "kde-features.h" +#include "kde-features_parser.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace KCal; + +ResourceFeaturePlan::ResourceFeaturePlan( const TDEConfig *config ) + : ResourceCached( config ), mLock( true ) +{ + mPrefs = new Prefs; + + if ( config ) readConfig( config ); +} + +ResourceFeaturePlan::~ResourceFeaturePlan() +{ +} + +Prefs *ResourceFeaturePlan::prefs() +{ + return mPrefs; +} + +void ResourceFeaturePlan::readConfig( const TDEConfig * ) +{ + mPrefs->readConfig(); +} + +void ResourceFeaturePlan::writeConfig( TDEConfig *config ) +{ + ResourceCalendar::writeConfig( config ); + + mPrefs->writeConfig(); +} + +bool ResourceFeaturePlan::doLoad() +{ + kdDebug() << "ResourceFeaturePlan::load()" << endl; + + mCalendar.close(); + + FeaturesParser parser; + + Features *features = parser.parseFile( mPrefs->filename() ); + + if ( !features ) { + return false; + } else { + Category::List categories = features->categoryList(); + + KCal::Todo *masterTodo = new KCal::Todo; + masterTodo->setSummary( i18n("Feature Plan") ); + mCalendar.addTodo( masterTodo ); + + insertCategories( categories, masterTodo ); + } + + emit resourceChanged( this ); + + return true; +} + +void ResourceFeaturePlan::insertCategories( const Category::List &categories, + Todo *parent ) +{ + Category::List::ConstIterator it; + for( it = categories.begin(); it != categories.end(); ++it ) { + Category *c = *it; + + Todo *categoryTodo = new Todo; + categoryTodo->setSummary( c->name() ); + categoryTodo->setRelatedTo( parent ); + + insertCategories( c->categoryList(), categoryTodo ); + + Feature::List features = (*it)->featureList(); + Feature::List::ConstIterator it2; + for( it2 = features.begin(); it2 != features.end(); ++it2 ) { + Feature *f = *it2; + Todo *todo = new Todo; + + TQString summary = f->summary(); + int pos = summary.find( '\n' ); + if ( pos > 0 ) summary = summary.left( pos ) + "..."; + todo->setSummary( summary ); + + todo->setDescription( f->summary() ); + + todo->setRelatedTo( categoryTodo ); + + int completed; + if ( f->status() == "done" ) completed = 100; + else if ( f->status() == "inprogress" ) completed = 50; + else completed = 0; + todo->setPercentComplete( completed ); + + mCalendar.addTodo( todo ); + } + } +} + +bool ResourceFeaturePlan::doSave() +{ + return true; +} + +KABC::Lock *ResourceFeaturePlan::lock() +{ + return &mLock; +} + + +#include "kcal_resourcefeatureplan.moc" diff --git a/tderesources/featureplan/kcal_resourcefeatureplan.desktop b/tderesources/featureplan/kcal_resourcefeatureplan.desktop new file mode 100644 index 000000000..2bca3fbe4 --- /dev/null +++ b/tderesources/featureplan/kcal_resourcefeatureplan.desktop @@ -0,0 +1,41 @@ +[Desktop Entry] +Name=XML Feature Plan +Name[af]=XML eienskappe plan +Name[ca]=Pla de característiques XML +Name[cs]=XML plán vlastností +Name[da]=XML Funktionsplan +Name[el]=Σχέδιο χαρακτηριστικών XML +Name[eo]=XML-Trajtplano +Name[es]=Plan de características XML +Name[et]=XML võimaluste plaan +Name[eu]=XML eginbide plana +Name[fa]=نقشۀ ویژگی XML +Name[fi]=XML-ominaisuussuunnitelma +Name[fr]=Plan de fonctionnalités XML +Name[fy]=Funksjonaliteitsplanning yn XML +Name[gl]=Plan de Características en XML +Name[hu]=XML FeaturePlan +Name[is]=XML fídusa áætlun +Name[it]=Piano caratteristiche XML +Name[km]=គ្រោង​លក្ខណៈ​ពិសេស XML +Name[lt]=XML bruožų planas +Name[ms]=Pelan Cirian XML +Name[nds]=XML-Funkschonenplaan +Name[ne]=एक्सएमएल विशेषता योजना +Name[nl]=Functionaliteitsplanning in XML +Name[pl]=Plan funkcjonalności XML +Name[pt]=Plano de Funcionalidades em XML +Name[pt_BR]=Plano de Funcionalidades XML +Name[sk]=XML plán vlastností +Name[sl]=Načrt zmožnosti v XML +Name[sr]=XML план могућности +Name[sr@Latn]=XML plan mogućnosti +Name[ta]=XML பண்பு திட்டம் +Name[tr]=XML Özellik Planı +Name[zh_CN]=XML 特性计划 +Name[zh_TW]=XML 功能計畫 +X-TDE-Library=kcal_resourcefeatureplan +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=calendar +X-TDE-ResourceType=featureplan diff --git a/tderesources/featureplan/kcal_resourcefeatureplan.h b/tderesources/featureplan/kcal_resourcefeatureplan.h new file mode 100644 index 000000000..2808aef71 --- /dev/null +++ b/tderesources/featureplan/kcal_resourcefeatureplan.h @@ -0,0 +1,68 @@ + /* + This file is part of tdepim. + + Copyright (c) 2004 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KCAL_RESOURCEFEATUREPLAN_H +#define KCAL_RESOURCEFEATUREPLAN_H + +#include "prefs.h" + +#include "kde-features.h" + +#include + +#include + +#include +#include + +namespace KCal { + +/** + This class represents a featureplan (in KDE XML format) +*/ +class KDE_EXPORT ResourceFeaturePlan : public ResourceCached +{ + Q_OBJECT + + public: + ResourceFeaturePlan( const TDEConfig * ); + virtual ~ResourceFeaturePlan(); + + void readConfig( const TDEConfig *config ); + void writeConfig( TDEConfig *config ); + + Prefs *prefs(); + + bool doLoad(); + bool doSave(); + + KABC::Lock *lock(); + + protected: + void insertCategories( const Category::List &categories, Todo *parent ); + + private: + Prefs *mPrefs; + KABC::LockNull mLock; +}; + +} + +#endif diff --git a/tderesources/featureplan/kcal_resourcefeatureplanconfig.cpp b/tderesources/featureplan/kcal_resourcefeatureplanconfig.cpp new file mode 100644 index 000000000..55d12cbd9 --- /dev/null +++ b/tderesources/featureplan/kcal_resourcefeatureplanconfig.cpp @@ -0,0 +1,92 @@ +/* + This file is part of tdepim. + + Copyright (c) 2004 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "kcal_resourcefeatureplan.h" +#include "kcal_resourcefeatureplanconfig.h" + +using namespace KCal; + +ResourceFeaturePlanConfig::ResourceFeaturePlanConfig( TQWidget *parent, + const char *name ) + : KRES::ConfigWidget( parent, name ) +{ + TQGridLayout *topLayout = new TQGridLayout( this, 3, 2, 0, + KDialog::spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Filename:" ), this ); + mFilename = new KURLRequester( this ); + + topLayout->addWidget( label, 0, 0 ); + topLayout->addWidget( mFilename, 0, 1 ); + + label = new TQLabel( i18n( "Filter email:" ), this ); + mFilterEmail = new KLineEdit( this ); + + topLayout->addWidget( label, 1, 0 ); + topLayout->addWidget( mFilterEmail, 1, 1 ); + + mCvsCheck = new TQCheckBox( i18n("Use CVS"), this ); + + topLayout->addMultiCellWidget( mCvsCheck, 2, 2, 0, 1 ); +} + +void ResourceFeaturePlanConfig::loadSettings( KRES::Resource *res ) +{ + ResourceFeaturePlan *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceFeaturePlanConfig::loadSettings(): cast failed" << endl; + return; + } + + Prefs *p = resource->prefs(); + mFilename->setURL( p->filename() ); + mFilterEmail->setText( p->filterEmail() ); + mCvsCheck->setChecked( p->useCvs() ); +} + +void ResourceFeaturePlanConfig::saveSettings( KRES::Resource *res ) +{ + ResourceFeaturePlan *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceFeaturePlanConfig::saveSettings(): cast failed" << endl; + return; + } + + Prefs *p = resource->prefs(); + p->setFilename( mFilename->url() ); + p->setFilterEmail( mFilterEmail->text() ); + p->setUseCvs( mCvsCheck->isChecked() ); +} + +#include "kcal_resourcefeatureplanconfig.moc" diff --git a/tderesources/featureplan/kcal_resourcefeatureplanconfig.h b/tderesources/featureplan/kcal_resourcefeatureplanconfig.h new file mode 100644 index 000000000..aa00123f6 --- /dev/null +++ b/tderesources/featureplan/kcal_resourcefeatureplanconfig.h @@ -0,0 +1,54 @@ +/* + This file is part of tdepim. + + Copyright (c) 2004 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef RESOURCEFEATUREPLANCONFIG_H +#define RESOURCEFEATUREPLANCONFIG_H + +#include +#include + +class KLineEdit; +class KURLRequester; +class TQCheckBox; + +namespace KCal { + +class KDE_EXPORT ResourceFeaturePlanConfig : public KRES::ConfigWidget +{ + Q_OBJECT + + + public: + ResourceFeaturePlanConfig( TQWidget *parent = 0, const char *name = 0 ); + + public slots: + void loadSettings( KRES::Resource * ); + void saveSettings( KRES::Resource * ); + + private: + KURLRequester *mFilename; + KLineEdit *mFilterEmail; + TQCheckBox *mCvsCheck; +}; + +} + +#endif diff --git a/tderesources/featureplan/kcal_resourcefeatureplanplugin.cpp b/tderesources/featureplan/kcal_resourcefeatureplanplugin.cpp new file mode 100644 index 000000000..ae2759e46 --- /dev/null +++ b/tderesources/featureplan/kcal_resourcefeatureplanplugin.cpp @@ -0,0 +1,40 @@ +/* + This file is part of tdepim. + + Copyright (c) 2004 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kcal_resourcefeatureplan.h" +#include "kcal_resourcefeatureplanconfig.h" + +#include +#include + +using namespace KCal; + +typedef KRES::PluginFactory< ResourceFeaturePlan, ResourceFeaturePlanConfig > FeatureplanFactory; +// FIXME K_EXPORT_COMPONENT_FACTORY( kcal_resourcefeatureplan, FeatureplanFactory ) +// Problem: How to insert the catalogue! +extern "C" +{ + void* init_kcal_resourcefeatureplan() + { + TDEGlobal::locale()->insertCatalogue( "kres_featureplan" ); + return new FeatureplanFactory; + } +} diff --git a/tderesources/featureplan/kde-features.dtd b/tderesources/featureplan/kde-features.dtd new file mode 100644 index 000000000..732c447d2 --- /dev/null +++ b/tderesources/featureplan/kde-features.dtd @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tderesources/featureplan/kde-features.rng b/tderesources/featureplan/kde-features.rng new file mode 100644 index 000000000..89a31dcb4 --- /dev/null +++ b/tderesources/featureplan/kde-features.rng @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + inprogress + todo + done + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tderesources/featureplan/prefs.kcfgc b/tderesources/featureplan/prefs.kcfgc new file mode 100644 index 000000000..0866d4e38 --- /dev/null +++ b/tderesources/featureplan/prefs.kcfgc @@ -0,0 +1,9 @@ +# Code generation options for kconfig_compiler +File=tderesources_kcal_featureplan.kcfg +ClassName=Prefs +#NameSpace=KBB +Singleton=false +Mutators=true +GlobalEnums=true +#ItemAccessors=true +#SetUserTexts=true diff --git a/tderesources/featureplan/tderesources_kcal_featureplan.kcfg b/tderesources/featureplan/tderesources_kcal_featureplan.kcfg new file mode 100644 index 000000000..64d44ae58 --- /dev/null +++ b/tderesources/featureplan/tderesources_kcal_featureplan.kcfg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + -- cgit v1.2.1