summaryrefslogtreecommitdiffstats
path: root/kpilot/conduits/recordconduit
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kpilot/conduits/recordconduit
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
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/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpilot/conduits/recordconduit')
-rw-r--r--kpilot/conduits/recordconduit/Makefile.am15
-rw-r--r--kpilot/conduits/recordconduit/factory.cc144
-rw-r--r--kpilot/conduits/recordconduit/factory.h40
-rw-r--r--kpilot/conduits/recordconduit/record-conduit.desktop93
-rw-r--r--kpilot/conduits/recordconduit/settings.kcfg22
-rw-r--r--kpilot/conduits/recordconduit/settings.kcfgc7
-rw-r--r--kpilot/conduits/recordconduit/setup_base.ui158
7 files changed, 479 insertions, 0 deletions
diff --git a/kpilot/conduits/recordconduit/Makefile.am b/kpilot/conduits/recordconduit/Makefile.am
new file mode 100644
index 000000000..33ceb8540
--- /dev/null
+++ b/kpilot/conduits/recordconduit/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES= $(PISOCK_INCLUDE) -I$(top_srcdir)/kpilot/lib $(all_includes)
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = record-conduit.desktop
+
+kde_module_LTLIBRARIES = conduit_record.la
+
+
+conduit_record_la_SOURCES = settings.kcfgc setup_base.ui factory.cc
+conduit_record_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+conduit_record_la_LIBADD = ../../lib/libkpilot.la $(LIB_KDEUI)
+
+kde_kcfg_DATA = settings.kcfg
diff --git a/kpilot/conduits/recordconduit/factory.cc b/kpilot/conduits/recordconduit/factory.cc
new file mode 100644
index 000000000..8015763d1
--- /dev/null
+++ b/kpilot/conduits/recordconduit/factory.cc
@@ -0,0 +1,144 @@
+/* KPilot
+**
+** Copyright (C) 2005 by Adriaan de Groot
+**
+** This file defines the factory for the recordconduit plugin.
+*/
+
+/*
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU Lesser General Public License as published by
+** the Free Software Foundation; either version 2.1 of the License, or
+** (at your option) any later version.
+**
+** 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 Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public License
+** along with this program in a file called COPYING; if not, write to
+** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+** MA 02110-1301, USA.
+*/
+
+/*
+** Bug reports and questions can be sent to kde-pim@kde.org
+*/
+
+#include "options.h"
+
+#include <qtabwidget.h>
+#include <qlineedit.h>
+#include <qcheckbox.h>
+
+#include <kconfig.h>
+#include <kinstance.h>
+#include <kaboutdata.h>
+
+#include "pluginfactory.h"
+#include "pilotDatabase.h"
+#include "recordConduit.h"
+
+#include "setup_base.h"
+#include "factory.h"
+#include "settings.h"
+
+
+class ConduitConfig : public ConduitConfigBase
+{
+public:
+ ConduitConfig(QWidget *parent=0L, const char *n=0L);
+ virtual void commit();
+ virtual void load();
+protected:
+ RecordWidget *fConfigWidget;
+ KAboutData *fAbout;
+} ;
+
+ConduitConfig::ConduitConfig(QWidget *p, const char *n) :
+ ConduitConfigBase(p,n),
+ fConfigWidget(new RecordWidget(p))
+{
+ FUNCTIONSETUP;
+ fConduitName = i18n("Record Conduit");
+ fAbout = new KAboutData("recordConduit",
+ I18N_NOOP("Record Conduit for KPilot"),
+ KPILOT_VERSION,
+ I18N_NOOP("Configures the Record Conduit for KPilot"),
+ KAboutData::License_GPL,
+ "(C) 2005, Adriaan de Groot");
+ fAbout->addAuthor("Adriaan de Groot",
+ I18N_NOOP("Primary Author"),
+ "groot@kde.org",
+ "http://people.fruitsalad.org/adridg/");
+
+ ConduitConfigBase::addAboutPage(fConfigWidget->tabWidget,fAbout);
+ fWidget=fConfigWidget;
+ QObject::connect(fConfigWidget->fLogMessage,SIGNAL(textChanged(const QString&)),
+ this,SLOT(modified()));
+ QObject::connect(fConfigWidget->fDatabases,SIGNAL(textChanged(const QString&)),
+ this,SLOT(modified()));
+ QObject::connect(fConfigWidget->fFailImmediately,SIGNAL(toggled(bool)),
+ this,SLOT(modified()));
+}
+
+/* virtual */ void ConduitConfig::commit()
+{
+ FUNCTIONSETUP;
+
+#ifdef DEBUG
+ DEBUGKPILOT << fname
+ << ": Message="
+ << fConfigWidget->fLogMessage->text()
+ << endl;
+ DEBUGKPILOT << fname
+ << ": Databases="
+ << fConfigWidget->fDatabases->text()
+ << endl;
+#endif
+
+ ConduitSettings::setLogMessage( fConfigWidget->fLogMessage->text() );
+ ConduitSettings::setDatabases( fConfigWidget->fDatabases->text() );
+ ConduitSettings::setFailImmediately( fConfigWidget->fFailImmediately->isChecked());
+ ConduitSettings::self()->writeConfig();
+ unmodified();
+}
+
+/* virtual */ void ConduitConfig::load()
+{
+ FUNCTIONSETUP;
+ ConduitSettings::self()->readConfig();
+
+ fConfigWidget->fLogMessage->setText( ConduitSettings::logMessage() );
+ fConfigWidget->fDatabases->setText( ConduitSettings::databases().join(",") );
+ fConfigWidget->fFailImmediately->setChecked( ConduitSettings::failImmediately() );
+
+#ifdef DEBUG
+ DEBUGKPILOT << fname
+ << ": Read Message="
+ << fConfigWidget->fLogMessage->text()
+ << endl;
+ DEBUGKPILOT << fname
+ << ": Read Database="
+ << fConfigWidget->fDatabases->text()
+ << endl;
+#endif
+
+ unmodified();
+}
+
+typedef PilotDatabase PilotDatabaseContainer;
+
+typedef RecordConduit<PilotRecord, PilotDatabaseContainer, PilotRecord, PilotAppInfoBase, NullMapper<PilotRecord> > RecordAction;
+
+extern "C"
+{
+
+void *init_conduit_record()
+{
+ return new ConduitFactory<ConduitConfig,RecordAction>(0,"recordconduit");
+}
+
+}
+
diff --git a/kpilot/conduits/recordconduit/factory.h b/kpilot/conduits/recordconduit/factory.h
new file mode 100644
index 000000000..6d35d4db1
--- /dev/null
+++ b/kpilot/conduits/recordconduit/factory.h
@@ -0,0 +1,40 @@
+#ifndef KPILOT_RECORD_FACTORY_H
+#define KPILOT_RECORD_FACTORY_H
+/* factory.h KPilot
+**
+** Copyright (C) 2005 by Adriaan de Groot
+**
+** This is the factory for the recordconduit, which uses the
+** template class RecordConduit for demonstration purposes.
+*/
+
+/*
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU Lesser General Public License as published by
+** the Free Software Foundation; either version 2.1 of the License, or
+** (at your option) any later version.
+**
+** 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 Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public License
+** along with this program in a file called COPYING; if not, write to
+** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+** MA 02110-1301, USA.
+*/
+
+/*
+** Bug reports and questions can be sent to kde-pim@kde.org
+*/
+
+
+extern "C"
+{
+
+void *init_conduit_record();
+
+}
+
+#endif
diff --git a/kpilot/conduits/recordconduit/record-conduit.desktop b/kpilot/conduits/recordconduit/record-conduit.desktop
new file mode 100644
index 000000000..55c953d17
--- /dev/null
+++ b/kpilot/conduits/recordconduit/record-conduit.desktop
@@ -0,0 +1,93 @@
+[Desktop Entry]
+Type=Service
+Name=Records (Experimental)
+Name[af]=Rekords (Eksperimenteel)
+Name[bg]=Записи (Експериментално)
+Name[ca]=Registres (Experimental)
+Name[cs]=Záznamy (experimentální)
+Name[da]=Indspilninger (eksperimentel)
+Name[de]=Einträge (Experimentell)
+Name[el]=Εγγραφές (Πειραματικό)
+Name[es]=Registros (Experimental)
+Name[et]=Kirjed (eksperimentaalne)
+Name[fr]=Enregistrements (expérimental)
+Name[fy]=Opnames (eksperimenteel)
+Name[gl]=Grava (Experimental)
+Name[hu]=Rekordok (kísérleti)
+Name[is]=Færslur (á tilraunastigi)
+Name[it]=Record (sperimentale)
+Name[ja]=レコード (実験中)
+Name[kk]=Жазулар (Эксперименталдық)
+Name[km]=កំណត់​ត្រា (ពិសោធន៍)
+Name[lt]=Įrašai (eksperimentinis)
+Name[nb]=Records (Eksperimentell)
+Name[nds]=Logbook (warrt utprobeert)
+Name[ne]=रेकर्ड (प्रयोगात्मक)
+Name[nl]=Opnames (experimenteel)
+Name[pl]=Wpisy (eksperymentalne)
+Name[pt]=Registos (Experimental)
+Name[pt_BR]=Registros (Experimental)
+Name[ru]=Записи (экспериментально)
+Name[sk]=Záznamy (Experimentálne)
+Name[sl]=Zapisi (poskusno)
+Name[sr]=Слогови (експериментално)
+Name[sr@Latn]=Slogovi (eksperimentalno)
+Name[sv]=Inspelningar (experimentell)
+Name[tr]=Kayıtlar (Deneysel)
+Name[uk]=Записи (експериментальний)
+Name[zh_CN]=记录(试验性)
+Name[zh_TW]=紀錄(實驗性)
+Comment=This conduit does nothing.
+Comment[af]=Hierdie pad doen niks
+Comment[bg]=Това нещо прави нищо
+Comment[bs]=Ovaj conduit ne radi ništa.
+Comment[ca]=Aquest conducte no fa res.
+Comment[cs]=Toto propojení nedělá nic.
+Comment[cy]=Nid yw'r cwndid yma yn gwneud unrhyw beth.
+Comment[da]=Denne kanal gør ingenting.
+Comment[de]=Diese Erweiterung (Conduit) ist ohne Funktion
+Comment[el]=Αυτός ο σύνδεσμος δεν κάνει τίποτα.
+Comment[eo]=Tiu kanalo faras nenion.
+Comment[et]=See kanal ei tee mitte kui midagi.
+Comment[eu]=Kanal honek ez du ezer egiten.
+Comment[fa]=این لوله هیچ چیز ندارد.
+Comment[fi]=Tämä yhdyskäytävä ei tee mitään.
+Comment[fr]=Ce canal ne fait rien.
+Comment[fy]=Dit conduit docht neat.
+Comment[ga]=Ní dhéanann an seoladán seo faic.
+Comment[gl]=Este conducto non fai nada.
+Comment[hi]=यह कन्ड्यूइट कुछ नहीं करता है.
+Comment[hu]=Ez a csatoló üres, csak tesztelési célokat szolgál
+Comment[is]=Þessi rás gerir ekki neitt.
+Comment[it]=Questo conduit non fa nulla.
+Comment[ja]=このコンジットは未知です。
+Comment[ka]=ეს არხი არაფერს არ აკეთებს.
+Comment[kk]=Ештеңе істемейтін арна.
+Comment[km]=បំពង់​នេះ​មិន​ធ្វើ​អ្វី​ទាំងអស់ ។
+Comment[lt]=Šis kanalas nieko neatlieka.
+Comment[mk]=Овој канал не прави ништо.
+Comment[ms]=Saluran ini tidak berbuat apa-apa.
+Comment[nb]=Denne kanalen gjør ingenting.
+Comment[nds]=Disse Kanaal deit gor nix.
+Comment[ne]=यो कन्ड्युटले केही पनि गर्दैन ।
+Comment[nl]=Dit conduit doet niets.
+Comment[nn]=Denne koplinga gjer ingenting.
+Comment[pl]=Ten łącznik nic nie robi.
+Comment[pt]=Esta conduta não faz nada.
+Comment[pt_BR]=Este conduíte não faz coisa alguma.
+Comment[ro]=Această conductă nu face nimic.
+Comment[ru]=Канал, который ничего не делает.
+Comment[sk]=Táto spojka nič nerobí.
+Comment[sl]=Ta veznik ne počne ničesar.
+Comment[sr]=Овај провод не ради ништа.
+Comment[sr@Latn]=Ovaj provod ne radi ništa.
+Comment[sv]=Den här kanalen gör ingenting.
+Comment[ta]=இந்த காப்புக் குழாய் ஒன்றும் செய்யாது
+Comment[tg]=Канале, ки дар ҳолати шурӯъ нест.
+Comment[tr]=Bu kanal herhangi bir işlem yapmaz.
+Comment[uk]=Цей акведук нічого не робить.
+Comment[zh_CN]=此管道不做任何事。
+Comment[zh_TW]=不做任何事。
+Implemented=file
+ServiceTypes=KPilotConduit
+X-KDE-Library=conduit_record
diff --git a/kpilot/conduits/recordconduit/settings.kcfg b/kpilot/conduits/recordconduit/settings.kcfg
new file mode 100644
index 000000000..7fc2180df
--- /dev/null
+++ b/kpilot/conduits/recordconduit/settings.kcfg
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="kpilotrc"/>
+ <group name="RecordConduit">
+ <entry name="FailImmediately" key="FailNow" type="Bool">
+ <label>Whether the conduit should immediately bail out with an error</label>
+ <default>false</default>
+ </entry>
+ <entry name="LogMessage" type="String">
+ <label>The error message if the null conduit is supposed to fail</label>
+ <default>KPilot was here.</default>
+ </entry>
+ <entry name="Databases" type="StringList">
+ <label>Databases that are skipped on sync</label>
+ <default></default>
+ </entry>
+ </group>
+
+</kcfg>
diff --git a/kpilot/conduits/recordconduit/settings.kcfgc b/kpilot/conduits/recordconduit/settings.kcfgc
new file mode 100644
index 000000000..8a2b4f356
--- /dev/null
+++ b/kpilot/conduits/recordconduit/settings.kcfgc
@@ -0,0 +1,7 @@
+File=settings.kcfg
+ClassName= ConduitSettings
+Singleton=true
+ItemAccessors=true
+Mutators=true
+GlobalEnums=true
+SetUserTexts=true
diff --git a/kpilot/conduits/recordconduit/setup_base.ui b/kpilot/conduits/recordconduit/setup_base.ui
new file mode 100644
index 000000000..126d3ff20
--- /dev/null
+++ b/kpilot/conduits/recordconduit/setup_base.ui
@@ -0,0 +1,158 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>RecordWidget</class>
+<comment>A tabWidget for configuring
+the Record-conduit settings.</comment>
+<author>Adriaan de Groot</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>342</width>
+ <height>163</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>570</width>
+ <height>270</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Null-Conduit Options</string>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <property name="layoutSpacing" stdset="0">
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget2</cstring>
+ </property>
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>fLogMessage</cstring>
+ </property>
+ <property name="text">
+ <string>KPilot was here.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;qt&gt;Enter the message to add to the Sync Log on your Pilot here.&lt;/qt&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Log message:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fLogMessage</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Databases:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fDatabases</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>fDatabases</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;qt&gt;The Null-conduit can be attached to several databases, effectively preventing them from Syncing. Enter the database names here.&lt;/qt&gt;</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>fFailImmediately</cstring>
+ </property>
+ <property name="text">
+ <string>Simulate failure</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Force the conduit to simulate a failure to perform the HotSync.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>tabWidget</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>