diff options
Diffstat (limited to 'kitchensync/src')
109 files changed, 0 insertions, 9011 deletions
diff --git a/kitchensync/src/CMakeL10n.txt b/kitchensync/src/CMakeL10n.txt deleted file mode 100644 index 9520b5e6a..000000000 --- a/kitchensync/src/CMakeL10n.txt +++ /dev/null @@ -1,9 +0,0 @@ -##### create translation templates ############## - -tde_l10n_create_template( "kitchensync" ) - -tde_l10n_create_template( - CATALOG "desktop_files/kitchensync.desktop/" - SOURCES kitchensync.desktop - DESTINATION "${CMAKE_SOURCE_DIR}/translations" -) diff --git a/kitchensync/src/CMakeLists.txt b/kitchensync/src/CMakeLists.txt deleted file mode 100644 index 18e76a0a7..000000000 --- a/kitchensync/src/CMakeLists.txt +++ /dev/null @@ -1,77 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_import( libkmime ) -tde_import( ktnef ) -tde_import( libkcal ) -tde_import( libtdepim ) - -add_subdirectory( about ) -add_subdirectory( pics ) - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/libtdepim - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### other data ################################ - -tde_create_translated_desktop( kitchensync.desktop ) -install( FILES kitchensyncui.rc kitchensync_part.rc DESTINATION ${DATA_INSTALL_DIR}/kitchensync ) - - -##### libkitchensyncpart (module) ############### - -tde_add_kpart( libkitchensyncpart AUTOMOC - SOURCES part.cpp - LINK kitchensync-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) - -##### kitchensync (executable) ################## - -tde_add_executable( kitchensync AUTOMOC - SOURCES main.cpp mainwindow.cpp - LINK kitchensync-shared - DESTINATION ${BIN_INSTALL_DIR} -) - - -##### kitchensync (shared) ###################### - -tde_add_library( kitchensync SHARED AUTOMOC - SOURCES - aboutpage.cpp mainwidget.cpp groupconfigdialog.cpp groupconfig.cpp - groupitem.cpp groupview.cpp memberconfig.cpp syncprocess.cpp - syncprocessmanager.cpp connectionwidgets.cpp pluginpicker.cpp - configgui.cpp configguiblank.cpp configguifile.cpp memberinfo.cpp - groupconfigcommon.cpp kwidgetlist.cpp configguipalm.cpp - conflictdialog.cpp singleconflictdialog.cpp addresseediffalgo.cpp - calendardiffalgo.cpp htmldiffalgodisplay.cpp genericdiffalgo.cpp - multiconflictdialog.cpp configguiirmc.cpp configguisyncmlobex.cpp - configguisyncmlhttp.cpp configguiopie.cpp configguignokii.cpp - configguigcalendar.cpp configguildap.cpp configguigpe.cpp - configguijescs.cpp configguievo2.cpp configguimoto.cpp - configguisynce.cpp configguisunbird.cpp - VERSION 0.0.0 - LINK qopensync-shared tdepim-shared tdehtml-shared - DESTINATION ${LIB_INSTALL_DIR} -) diff --git a/kitchensync/src/Makefile.am b/kitchensync/src/Makefile.am deleted file mode 100644 index acfaf5303..000000000 --- a/kitchensync/src/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -SUBDIRS = about pics - -INCLUDES = -I$(top_srcdir)/kitchensync/src \ - -I$(top_srcdir)/kitchensync \ - -I$(top_srcdir)/libtdepim \ - -I$(top_srcdir) \ - $(all_includes) - -# Application -bin_PROGRAMS = kitchensync - -kitchensync_SOURCES = main.cpp mainwindow.cpp -kitchensync_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kitchensync_LDADD = libkitchensync.la - -xdg_apps_DATA = kitchensync.desktop - -# Library -lib_LTLIBRARIES = libkitchensync.la - -libkitchensync_la_SOURCES = aboutpage.cpp mainwidget.cpp groupconfigdialog.cpp \ - groupconfig.cpp groupitem.cpp groupview.cpp memberconfig.cpp \ - syncprocess.cpp syncprocessmanager.cpp connectionwidgets.cpp \ - pluginpicker.cpp configgui.cpp configguiblank.cpp configguifile.cpp \ - memberinfo.cpp groupconfigcommon.cpp kwidgetlist.cpp \ - configguipalm.cpp conflictdialog.cpp singleconflictdialog.cpp \ - addresseediffalgo.cpp calendardiffalgo.cpp \ - htmldiffalgodisplay.cpp genericdiffalgo.cpp multiconflictdialog.cpp \ - configguiirmc.cpp \ - configguisyncmlobex.cpp configguisyncmlhttp.cpp configguiopie.cpp \ - configguignokii.cpp configguigcalendar.cpp configguildap.cpp configguigpe.cpp \ - configguijescs.cpp configguievo2.cpp configguimoto.cpp configguisynce.cpp \ - configguisunbird.cpp -libkitchensync_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined -libkitchensync_la_LIBADD = $(LIB_TDEIO) $(LIB_TDEHTML) $(top_builddir)/kitchensync/libqopensync/libqopensync.la \ - $(LIB_TDEABC) $(top_builddir)/libtdepim/libtdepim.la $(top_builddir)/libkcal/libkcal.la \ - $(LIB_TQT) - -# KPart -kde_module_LTLIBRARIES = libkitchensyncpart.la - -libkitchensyncpart_la_SOURCES = part.cpp -libkitchensyncpart_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined -libkitchensyncpart_la_LIBADD = $(LIB_TDEPARTS) libkitchensync.la $(LIB_TQT) $(LIB_TDEIO) $(LIB_TDEHTML) $(LIB_TDEABC) $(LIB_TDECORE) $(LIB_TDEUI) - -# Resources -kitchensyncdatadir = $(kde_datadir)/kitchensync -kitchensyncdata_DATA = kitchensyncui.rc kitchensync_part.rc - -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp *.h -o $(podir)/kitchensync.pot diff --git a/kitchensync/src/about/CMakeLists.txt b/kitchensync/src/about/CMakeLists.txt deleted file mode 100644 index 1381982b1..000000000 --- a/kitchensync/src/about/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -install( FILES - top-right-kitchensync.png main.html kitchensync.css - DESTINATION ${DATA_INSTALL_DIR}/kitchensync/about ) diff --git a/kitchensync/src/about/Makefile.am b/kitchensync/src/about/Makefile.am deleted file mode 100644 index 6a4c77c59..000000000 --- a/kitchensync/src/about/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -about_DATA = \ - top-right-kitchensync.png \ - main.html \ - kitchensync.css - -aboutdir = $(kde_datadir)/kitchensync/about diff --git a/kitchensync/src/about/kitchensync.css b/kitchensync/src/about/kitchensync.css deleted file mode 100644 index c37ba7f79..000000000 --- a/kitchensync/src/about/kitchensync.css +++ /dev/null @@ -1,27 +0,0 @@ - -#headerR { - position: absolute; - right: 0px; - width: 430px; - height: 131px; - background-image: url(top-right-kontact.png); -} - -#title { - right: 125px; -} - -#tagline { - right: 125px; -} - -#boxCenter { - background-image: url(box-center-kontact.png); - background-repeat: no-repeat; - background-color: #dfe7f3; - background-position: bottom right; -} - -#subtext { - font-style: italic; -} diff --git a/kitchensync/src/about/main.html b/kitchensync/src/about/main.html deleted file mode 100644 index 8f948ffac..000000000 --- a/kitchensync/src/about/main.html +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta name="generator" content= - "HTML Tidy for Linux/x86 (vers 1st August 2004), see www.w3.org" /> - - <style type="text/css"> - /*<![CDATA[*/ - @import "%1"; /* kde_infopage.css */ - %1 /* maybe @import "kde_infopage_rtl.css"; */ - @import "kitchensync.css"; - body {font-size: %1px;} - /*]]>*/ - </style> - - <title>KitchenSync</title> -</head> - -<body> - <div id="header"> - <div id="headerL"/> - <div id="headerR"/> - - <div id="title"> - %2 <!-- KitchenSync --> - </div> - - <div id="tagline"> - %3 <!-- Catchphrase --> - </div> - </div> - - <!-- the bar --> - <div id="bar"> - <div id="barT"><div id="barTL"/><div id="barTR"/><div id="barTC"/></div> - <div id="barL"> - <div id="barR"> - <div id="barCenter" class="bar_text"> - %4<!-- KitchenSync is ... --> - </div> - </div> - </div> - <div id="barB"><div id="barBL"/><div id="barBR"/><div id="barBC"/></div> - </div> - - <!-- the main text box --> - <div id="box"> - <div id="boxT"><div id="boxTL"/><div id="boxTR"/><div id="boxTC"/></div> - <div id="boxL"> - <div id="boxR"> - <div id="boxCenter"> - <!--Welcome to KitchenSync--> - %5 - </div> - </div> - </div> - <div id="boxB"><div id="boxBL"/><div id="boxBR"/><div id="boxBC"/></div> - </div> - - <div id="footer"><div id="footerL"/><div id="footerR"/></div> -</body> -</html> diff --git a/kitchensync/src/about/top-right-kitchensync.png b/kitchensync/src/about/top-right-kitchensync.png Binary files differdeleted file mode 100644 index 9e169d8b5..000000000 --- a/kitchensync/src/about/top-right-kitchensync.png +++ /dev/null diff --git a/kitchensync/src/aboutpage.cpp b/kitchensync/src/aboutpage.cpp deleted file mode 100644 index 4de6987e7..000000000 --- a/kitchensync/src/aboutpage.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <tqfile.h> -#include <tqlayout.h> - -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <tdehtml_part.h> -#include <tdehtmlview.h> -#include <kiconloader.h> -#include <tdelocale.h> -#include <krun.h> -#include <kstandarddirs.h> - -#include "aboutpage.h" - -static TQString readFile( const TQString &fileName ) -{ - TQFile file( fileName ); - if ( !file.open( IO_ReadOnly ) ) { - kdDebug() << "Unable to open file '" << fileName << "'" << endl; - return TQCString(); - } - - TQString content = TQString::fromUtf8( file.readAll() ); - - file.close(); - - return content; -} - -AboutPage::AboutPage( TQWidget *parent ) - : TQWidget( parent, "AboutPage" ) -{ - TQVBoxLayout *layout = new TQVBoxLayout( this ); - - TQString location = locate( "data", "kitchensync/about/main.html" ); - TQString content = readFile( location ); - content = content.arg( locate( "data", "libtdepim/about/kde_infopage.css" ) ); - if ( kapp->reverseLayout() ) - content = content.arg( "@import \"%1\";" ).arg( locate( "data", "libtdepim/about/kde_infopage_rtl.css" ) ); - else - content = content.arg( "" ); - - TDEHTMLPart *part = new TDEHTMLPart( this ); - layout->addWidget( part->view() ); - - part->begin( KURL( location ) ); - - TQString appName( i18n( "TDE KitchenSync" ) ); - TQString catchPhrase( i18n( "Get Synchronized!" ) ); - TQString quickDescription( i18n( "The TDE Synchronization Tool" ) ); - - part->write( content.arg( TQFont().pointSize() + 2 ).arg( appName ) - .arg( catchPhrase ).arg( quickDescription ).arg( htmlText() ) ); - part->end(); - - connect( part->browserExtension(), - TQT_SIGNAL( openURLRequest( const KURL&, const KParts::URLArgs& ) ), - TQT_SLOT( handleUrl( const KURL& ) ) ); - - connect( part->browserExtension(), - TQT_SIGNAL( createNewWindow( const KURL&, const KParts::URLArgs& ) ), - TQT_SLOT( handleUrl( const KURL& ) ) ); -} - -void AboutPage::handleUrl( const KURL &url ) -{ - if ( url.protocol() == "exec" ) { - if ( url.path() == "/addGroup" ) - emit addGroup(); - } else - new KRun( url, this ); -} - -TQString AboutPage::htmlText() const -{ - TDEIconLoader *iconloader = TDEGlobal::iconLoader(); - int iconSize = iconloader->currentSize( TDEIcon::Desktop ); - - TQString handbook_icon_path = iconloader->iconPath( "contents2", TDEIcon::Desktop ); - TQString html_icon_path = iconloader->iconPath( "text-html", TDEIcon::Desktop ); - TQString wizard_icon_path = iconloader->iconPath( "wizard", TDEIcon::Desktop ); - - TQString info = i18n( "<h2 style='text-align:center; margin-top: 0px;'>Welcome to KitchenSync %1</h2>" - "<p>%1</p>" - "<table align=\"center\">" - "<tr><td><a href=\"%1\"><img width=\"%1\" height=\"%1\" src=\"%1\" /></a></td>" - "<td><a href=\"%1\">%1</a><br><span id=\"subtext\"><nobr>%1</td></tr>" - "<tr><td><a href=\"%1\"><img width=\"%1\" height=\"%1\" src=\"%1\" /></a></td>" - "<td><a href=\"%1\">%1</a><br><span id=\"subtext\"><nobr>%1</td></tr>" - "<tr><td><a href=\"%1\"><img width=\"%1\" height=\"%1\" src=\"%1\" /></a></td>" - "<td><a href=\"%1\">%1</a><br><span id=\"subtext\"><nobr>%1</td></tr>" - "</table>" ) - .arg( kapp->aboutData()->version() ) - .arg( i18n( "KitchenSync synchronizes your e-mail, addressbook, calendar, to-do list and more." ) ) - .arg( "help:/kitchensync" ) - .arg( iconSize ) - .arg( iconSize ) - .arg( handbook_icon_path ) - .arg( "help:/kitchensync" ) - .arg( i18n( "Read Manual" ) ) - .arg( i18n( "Learn more about KitchenSync and its components" ) ) - .arg( "http://pim.kde.org" ) - .arg( iconSize ) - .arg( iconSize ) - .arg( html_icon_path ) - .arg( "http://pim.kde.org" ) - .arg( i18n( "Visit KitchenSync Website" ) ) - .arg( i18n( "Access online resources and tutorials" ) ) - .arg( "exec:/addGroup" ) - .arg( iconSize ) - .arg( iconSize ) - .arg( wizard_icon_path ) - .arg( "exec:/addGroup" ) - .arg( i18n( "Add Synchronization Group" ) ) - .arg( i18n( "Create group of devices for synchronization" ) ); - - return info; -} - -#include "aboutpage.moc" diff --git a/kitchensync/src/aboutpage.h b/kitchensync/src/aboutpage.h deleted file mode 100644 index b364e0fea..000000000 --- a/kitchensync/src/aboutpage.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 ABOUTPAGE_H -#define ABOUTPAGE_H - -#include <kurl.h> - -#include <tqwidget.h> - -class AboutPage : public TQWidget -{ - Q_OBJECT - - - public: - AboutPage( TQWidget *parent ); - - signals: - void addGroup(); - - private slots: - void handleUrl( const KURL& ); - - private: - TQString htmlText() const; -}; - -#endif diff --git a/kitchensync/src/addresseediffalgo.cpp b/kitchensync/src/addresseediffalgo.cpp deleted file mode 100644 index e9847284c..000000000 --- a/kitchensync/src/addresseediffalgo.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - This file is part of libtdepim. - - Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> - - 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 <tdeabc/vcardconverter.h> - -#include "addresseediffalgo.h" - -using namespace KSync; - -static bool compareString( const TQString &left, const TQString &right ) -{ - if ( left.isEmpty() && right.isEmpty() ) - return true; - else - return left == right; -} - -AddresseeDiffAlgo::AddresseeDiffAlgo( const TDEABC::Addressee &leftAddressee, - const TDEABC::Addressee &rightAddressee ) - : mLeftAddressee( leftAddressee ), mRightAddressee( rightAddressee ) -{ -} - -AddresseeDiffAlgo::AddresseeDiffAlgo( const TQString &leftAddressee, - const TQString &rightAddressee ) -{ - TDEABC::VCardConverter converter; - - mLeftAddressee = converter.parseVCard( leftAddressee ); - mRightAddressee = converter.parseVCard( rightAddressee ); -} - -void AddresseeDiffAlgo::run() -{ - begin(); - - if ( !compareString( mLeftAddressee.uid(), mRightAddressee.uid() ) ) - conflictField( TDEABC::Addressee::uidLabel(), mLeftAddressee.uid(), mRightAddressee.uid() ); - - if ( !compareString( mLeftAddressee.name(), mRightAddressee.name() ) ) - conflictField( TDEABC::Addressee::nameLabel(), mLeftAddressee.name(), mRightAddressee.name() ); - - if ( !compareString( mLeftAddressee.formattedName(), mRightAddressee.formattedName() ) ) - conflictField( TDEABC::Addressee::formattedNameLabel(), mLeftAddressee.formattedName(), mRightAddressee.formattedName() ); - - if ( !compareString( mLeftAddressee.familyName(), mRightAddressee.familyName() ) ) - conflictField( TDEABC::Addressee::familyNameLabel(), mLeftAddressee.familyName(), mRightAddressee.familyName() ); - - if ( !compareString( mLeftAddressee.givenName(), mRightAddressee.givenName() ) ) - conflictField( TDEABC::Addressee::givenNameLabel(), mLeftAddressee.givenName(), mRightAddressee.givenName() ); - - if ( !compareString( mLeftAddressee.additionalName(), mRightAddressee.additionalName() ) ) - conflictField( TDEABC::Addressee::additionalNameLabel(), mLeftAddressee.additionalName(), mRightAddressee.additionalName() ); - - if ( !compareString( mLeftAddressee.prefix(), mRightAddressee.prefix() ) ) - conflictField( TDEABC::Addressee::prefixLabel(), mLeftAddressee.prefix(), mRightAddressee.prefix() ); - - if ( !compareString( mLeftAddressee.suffix(), mRightAddressee.suffix() ) ) - conflictField( TDEABC::Addressee::suffixLabel(), mLeftAddressee.suffix(), mRightAddressee.suffix() ); - - if ( !compareString( mLeftAddressee.nickName(), mRightAddressee.nickName() ) ) - conflictField( TDEABC::Addressee::nickNameLabel(), mLeftAddressee.nickName(), mRightAddressee.nickName() ); - - if ( mLeftAddressee.birthday() != mRightAddressee.birthday() ) - conflictField( TDEABC::Addressee::birthdayLabel(), mLeftAddressee.birthday().toString(), - mRightAddressee.birthday().toString() ); - - if ( !compareString( mLeftAddressee.mailer(), mRightAddressee.mailer() ) ) - conflictField( TDEABC::Addressee::mailerLabel(), mLeftAddressee.mailer(), mRightAddressee.mailer() ); - - if ( mLeftAddressee.timeZone() != mRightAddressee.timeZone() ) - conflictField( TDEABC::Addressee::timeZoneLabel(), mLeftAddressee.timeZone().asString(), mRightAddressee.timeZone().asString() ); - - if ( mLeftAddressee.geo() != mRightAddressee.geo() ) - conflictField( TDEABC::Addressee::geoLabel(), mLeftAddressee.geo().asString(), mRightAddressee.geo().asString() ); - - if ( !compareString( mLeftAddressee.title(), mRightAddressee.title() ) ) - conflictField( TDEABC::Addressee::titleLabel(), mLeftAddressee.title(), mRightAddressee.title() ); - - if ( !compareString( mLeftAddressee.role(), mRightAddressee.role() ) ) - conflictField( TDEABC::Addressee::roleLabel(), mLeftAddressee.role(), mRightAddressee.role() ); - - if ( !compareString( mLeftAddressee.organization(), mRightAddressee.organization() ) ) - conflictField( TDEABC::Addressee::organizationLabel(), mLeftAddressee.organization(), mRightAddressee.organization() ); - - if ( !compareString( mLeftAddressee.note(), mRightAddressee.note() ) ) - conflictField( TDEABC::Addressee::noteLabel(), mLeftAddressee.note(), mRightAddressee.note() ); - - if ( !compareString( mLeftAddressee.productId(), mRightAddressee.productId() ) ) - conflictField( TDEABC::Addressee::productIdLabel(), mLeftAddressee.productId(), mRightAddressee.productId() ); - - if ( !compareString( mLeftAddressee.sortString(), mRightAddressee.sortString() ) ) - conflictField( TDEABC::Addressee::sortStringLabel(), mLeftAddressee.sortString(), mRightAddressee.sortString() ); - - if ( mLeftAddressee.secrecy() != mRightAddressee.secrecy() ) { - conflictField( TDEABC::Addressee::secrecyLabel(), mLeftAddressee.secrecy().asString(), mRightAddressee.secrecy().asString() ); - } - if ( mLeftAddressee.url()!= mRightAddressee.url() ) - conflictField( TDEABC::Addressee::urlLabel(), mLeftAddressee.url().prettyURL(), - mRightAddressee.url().prettyURL() ); - - if ( mLeftAddressee.logo() != mRightAddressee.logo() ) { - } - - if ( mLeftAddressee.photo() != mRightAddressee.photo() ) { - } - - diffList( "emails", mLeftAddressee.emails(), mRightAddressee.emails() ); - - diffList( "Phone Numbers", mLeftAddressee.phoneNumbers(), mRightAddressee.phoneNumbers() ); - diffList( "Addresses", mLeftAddressee.addresses(), mRightAddressee.addresses() ); - - end(); -} - -TQString AddresseeDiffAlgo::toString( const TDEABC::PhoneNumber &number ) -{ - return number.number(); -} - -TQString AddresseeDiffAlgo::toString( const TDEABC::Address &addr ) -{ - return addr.formattedAddress(); -} - -template <class L> -void AddresseeDiffAlgo::diffList( const TQString &id, - const TQValueList<L> &left, const TQValueList<L> &right ) -{ - for ( uint i = 0; i < left.count(); ++i ) { - if ( right.find( left[ i ] ) == right.end() ) - additionalLeftField( id, toString( left[ i ] ) ); - } - - for ( uint i = 0; i < right.count(); ++i ) { - if ( left.find( right[ i ] ) == left.end() ) - additionalRightField( id, toString( right[ i ] ) ); - } -} diff --git a/kitchensync/src/addresseediffalgo.h b/kitchensync/src/addresseediffalgo.h deleted file mode 100644 index 2cf33eea8..000000000 --- a/kitchensync/src/addresseediffalgo.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - This file is part of libtdepim. - - Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> - - 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 KSYNC_ADDRESSEEDIFFALGO_H -#define KSYNC_ADDRESSEEDIFFALGO_H - -#include <tdeabc/addressee.h> -#include <libtdepim/diffalgo.h> - -using namespace KPIM; - -namespace KSync { - -class AddresseeDiffAlgo : public DiffAlgo -{ - public: - AddresseeDiffAlgo( const TDEABC::Addressee &leftAddressee, const TDEABC::Addressee &rightAddressee ); - AddresseeDiffAlgo( const TQString &leftAddressee, const TQString &rightAddressee ); - - void run(); - - private: - template <class L> - void diffList( const TQString &id, const TQValueList<L> &left, const TQValueList<L> &right ); - - TQString toString( const TDEABC::PhoneNumber &number ); - TQString toString( const TDEABC::Address &address ); - - TDEABC::Addressee mLeftAddressee; - TDEABC::Addressee mRightAddressee; -}; - -} - -#endif diff --git a/kitchensync/src/calendardiffalgo.cpp b/kitchensync/src/calendardiffalgo.cpp deleted file mode 100644 index 8d925322b..000000000 --- a/kitchensync/src/calendardiffalgo.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* - This file is part of libtdepim. - - Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> - - 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 <tdelocale.h> - -#include <libkcal/kcalversion.h> - -#include "calendardiffalgo.h" - -using namespace KSync; - -#ifndef KDE_USE_FINAL -static bool compareString( const TQString &left, const TQString &right ) -{ - if ( left.isEmpty() && right.isEmpty() ) - return true; - else - return left == right; -} -#endif - -static TQString toString( KCal::Attendee *attendee ) -{ - return attendee->name() + "<" + attendee->email() + ">"; -} - -static TQString toString( KCal::Alarm * ) -{ - return TQString(); -} - -static TQString toString( KCal::Incidence * ) -{ - return TQString(); -} - -static TQString toString( KCal::Attachment * ) -{ - return TQString(); -} - -static TQString toString( const TQDate &date ) -{ - return date.toString(); -} - -static TQString toString( const TQDateTime &dateTime ) -{ - return dateTime.toString(); -} - -static TQString toString( const TQString str ) -{ - return str; -} - -static TQString toString( bool value ) -{ - if ( value ) - return i18n( "Yes" ); - else - return i18n( "No" ); -} - -CalendarDiffAlgo::CalendarDiffAlgo( KCal::Incidence *leftIncidence, - KCal::Incidence *rightIncidence ) - : mLeftIncidence( leftIncidence ), mRightIncidence( rightIncidence ) -{ -} - -void CalendarDiffAlgo::run() -{ - begin(); - - diffIncidenceBase( mLeftIncidence, mRightIncidence ); - diffIncidence( mLeftIncidence, mRightIncidence ); - - KCal::Event *leftEvent = dynamic_cast<KCal::Event*>( mLeftIncidence ); - KCal::Event *rightEvent = dynamic_cast<KCal::Event*>( mRightIncidence ); - if ( leftEvent && rightEvent ) { - diffEvent( leftEvent, rightEvent ); - } else { - KCal::Todo *leftTodo = dynamic_cast<KCal::Todo*>( mLeftIncidence ); - KCal::Todo *rightTodo = dynamic_cast<KCal::Todo*>( mRightIncidence ); - if ( leftTodo && rightTodo ) { - diffTodo( leftTodo, rightTodo ); - } - } - - end(); -} - -void CalendarDiffAlgo::diffIncidenceBase( KCal::IncidenceBase *left, KCal::IncidenceBase *right ) -{ - diffList( i18n( "Attendees" ), left->attendees(), right->attendees() ); - - if ( left->dtStart() != right->dtStart() ) - conflictField( i18n( "Start time" ), left->dtStartStr(), right->dtStartStr() ); - - if ( !compareString( left->organizer().fullName(), right->organizer().fullName() ) ) - conflictField( i18n( "Organizer" ), left->organizer().fullName(), right->organizer().fullName() ); - - if ( !compareString( left->uid(), right->uid() ) ) - conflictField( i18n( "UID" ), left->uid(), right->uid() ); - - if ( left->doesFloat() != right->doesFloat() ) - conflictField( i18n( "Is floating" ), toString( left->doesFloat() ), toString( right->doesFloat() ) ); - - if ( left->hasDuration() != right->hasDuration() ) - conflictField( i18n( "Has duration" ), toString( left->hasDuration() ), toString( right->hasDuration() ) ); - - if ( left->duration() != right->duration() ) - conflictField( i18n( "Duration" ), TQString::number( left->duration() ), TQString::number( right->duration() ) ); -} - -void CalendarDiffAlgo::diffIncidence( KCal::Incidence *left, KCal::Incidence *right ) -{ - if ( !compareString( left->description(), right->description() ) ) - conflictField( i18n( "Description" ), left->description(), right->description() ); - - if ( !compareString( left->summary(), right->summary() ) ) - conflictField( i18n( "Summary" ), left->summary(), right->summary() ); - - if ( left->status() != right->status() ) - conflictField( i18n( "Status" ), left->statusStr(), right->statusStr() ); - - if ( left->secrecy() != right->secrecy() ) - conflictField( i18n( "Secrecy" ), toString( left->secrecy() ), toString( right->secrecy() ) ); - - if ( left->priority() != right->priority() ) - conflictField( i18n( "Priority" ), toString( left->priority() ), toString( right->priority() ) ); - - if ( !compareString( left->location(), right->location() ) ) - conflictField( i18n( "Location" ), left->location(), right->location() ); - - diffList( i18n( "Categories" ), left->categories(), right->categories() ); - diffList( i18n( "Alarms" ), left->alarms(), right->alarms() ); - diffList( i18n( "Resources" ), left->resources(), right->resources() ); - diffList( i18n( "Relations" ), left->relations(), right->relations() ); - diffList( i18n( "Attachments" ), left->attachments(), right->attachments() ); -#if LIBKCAL_IS_VERSION( 1, 3, 1 ) - diffList( i18n( "Exception Dates" ), left->recurrence()->exDates(), right->recurrence()->exDates() ); - diffList( i18n( "Exception Times" ), left->recurrence()->exDateTimes(), right->recurrence()->exDateTimes() ); -#endif - // TODO: recurrence dates and date/times, exrules, rrules - - if ( left->created() != right->created() ) - conflictField( i18n( "Created" ), left->created().toString(), right->created().toString() ); - - if ( !compareString( left->relatedToUid(), right->relatedToUid() ) ) - conflictField( i18n( "Related Uid" ), left->relatedToUid(), right->relatedToUid() ); -} - -void CalendarDiffAlgo::diffEvent( KCal::Event *left, KCal::Event *right ) -{ - if ( left->hasEndDate() != right->hasEndDate() ) - conflictField( i18n( "Has End Date" ), toString( left->hasEndDate() ), toString( right->hasEndDate() ) ); - - if ( left->dtEnd() != right->dtEnd() ) - conflictField( i18n( "End Date" ), left->dtEndStr(), right->dtEndStr() ); - - // TODO: check transparency -} - -void CalendarDiffAlgo::diffTodo( KCal::Todo *left, KCal::Todo *right ) -{ - if ( left->hasStartDate() != right->hasStartDate() ) - conflictField( i18n( "Has Start Date" ), toString( left->hasStartDate() ), toString( right->hasStartDate() ) ); - - if ( left->hasDueDate() != right->hasDueDate() ) - conflictField( i18n( "Has Due Date" ), toString( left->hasDueDate() ), toString( right->hasDueDate() ) ); - - if ( left->dtDue() != right->dtDue() ) - conflictField( i18n( "Due Date" ), left->dtDue().toString(), right->dtDue().toString() ); - - if ( left->hasCompletedDate() != right->hasCompletedDate() ) - conflictField( i18n( "Has Complete Date" ), toString( left->hasCompletedDate() ), toString( right->hasCompletedDate() ) ); - - if ( left->percentComplete() != right->percentComplete() ) - conflictField( i18n( "Complete" ), TQString::number( left->percentComplete() ), TQString::number( right->percentComplete() ) ); - - if ( left->completed() != right->completed() ) - conflictField( i18n( "Completed" ), toString( left->completed() ), toString( right->completed() ) ); -} - -template <class L> -void CalendarDiffAlgo::diffList( const TQString &id, - const TQValueList<L> &left, const TQValueList<L> &right ) -{ - for ( uint i = 0; i < left.count(); ++i ) { - if ( right.find( left[ i ] ) == right.end() ) - additionalLeftField( id, toString( left[ i ] ) ); - } - - for ( uint i = 0; i < right.count(); ++i ) { - if ( left.find( right[ i ] ) == left.end() ) - additionalRightField( id, toString( right[ i ] ) ); - } -} diff --git a/kitchensync/src/calendardiffalgo.h b/kitchensync/src/calendardiffalgo.h deleted file mode 100644 index 1d9497b90..000000000 --- a/kitchensync/src/calendardiffalgo.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of libtdepim. - - Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> - - 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 KSYNC_CALENDARDIFFALGO_H -#define KSYNC_CALENDARDIFFALGO_H - -#include <libkcal/event.h> -#include <libkcal/todo.h> -#include <libtdepim/diffalgo.h> - -using namespace KPIM; - -namespace KSync { - -class CalendarDiffAlgo : public DiffAlgo -{ - public: - CalendarDiffAlgo( KCal::Incidence *leftIncidence, KCal::Incidence *rightIncidence ); - - void run(); - - private: - template <class L> - void diffList( const TQString &id, const TQValueList<L> &left, const TQValueList<L> &right ); - - void diffIncidenceBase( KCal::IncidenceBase*, KCal::IncidenceBase* ); - void diffIncidence( KCal::Incidence*, KCal::Incidence* ); - void diffEvent( KCal::Event*, KCal::Event* ); - void diffTodo( KCal::Todo*, KCal::Todo* ); - - KCal::Incidence *mLeftIncidence; - KCal::Incidence *mRightIncidence; -}; - -} - -#endif diff --git a/kitchensync/src/configgui.cpp b/kitchensync/src/configgui.cpp deleted file mode 100644 index 6a41032eb..000000000 --- a/kitchensync/src/configgui.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "configgui.h" - - -#include "configguiblank.h" -#include "configguifile.h" -#include "configguignokii.h" -#include "configguigpe.h" -#include "configguiirmc.h" -#include "configguildap.h" -#include "configguiopie.h" -#include "configguipalm.h" -#include "configguisyncmlhttp.h" -#include "configguisyncmlobex.h" -#include "configguigcalendar.h" -#include "configguijescs.h" -#include "configguievo2.h" -#include "configguimoto.h" -#include "configguisynce.h" -#include "configguisunbird.h" - -#include "memberinfo.h" - -#include <kdialog.h> -#include <tdelocale.h> -#include <klineedit.h> - -#include <tqlayout.h> -#include <tqlabel.h> -#include <tqtextedit.h> - -ConfigGui::ConfigGui( const QSync::Member &member, TQWidget *parent ) - : TQWidget( parent ), mMember( member ) -{ - mTopLayout = new TQVBoxLayout( this ); - mTopLayout->setSpacing( KDialog::spacingHint() ); - mTopLayout->setMargin( KDialog::marginHint() ); - - TQBoxLayout *nameLayout = new TQHBoxLayout( mTopLayout ); - - TQLabel *label = new TQLabel( i18n("Name:"), this ); - nameLayout->addWidget( label ); - - mNameEdit = new KLineEdit( this ); - nameLayout->addWidget( mNameEdit ); -} - -void ConfigGui::setInstanceName( const TQString &t ) -{ - mNameEdit->setText( t ); -} - -TQString ConfigGui::instanceName() const -{ - return mNameEdit->text(); -} - -ConfigGui *ConfigGui::Factory::create( const QSync::Member &member, - TQWidget *parent ) -{ - TQString name = member.pluginName(); - if ( name == "file-sync" ) { - return new ConfigGuiFile( member, parent ); - } else if ( name == "palm-sync" ) { - return new ConfigGuiPalm( member, parent ); - } else if ( name == "irmc-sync" ) { - return new ConfigGuiIRMC( member, parent ); - } else if ( name == "syncml-obex-client" ) { - return new ConfigGuiSyncmlObex( member, parent ); - } else if ( name == "syncml-http-server" ) { - return new ConfigGuiSyncmlHttp( member, parent ); - } else if ( name == "opie-sync" ) { - return new ConfigGuiOpie( member, parent ); - } else if ( name == "gnokii-sync" ) { - return new ConfigGuiGnokii( member, parent ); - } else if ( name == "gpe-sync" ) { - return new ConfigGuiGpe( member, parent ); - } else if ( name == "google-calendar" ) { - return new ConfigGuiGoogleCalendar( member, parent ); - } else if ( name == "ldap-sync" ) { - return new ConfigGuiLdap( member, parent ); - } else if ( name == "tdepim-sync" ) { - return new ConfigGuiBlank( member, parent ); - } else if ( name == "jescs-sync" ) { - return new ConfigGuiJescs( member, parent ); - } else if ( name == "evo2-sync" ) { - return new ConfigGuiEvo2( member, parent ); - } else if ( name == "moto-sync" ) { - return new ConfigGuiMoto( member, parent ); - } else if ( name == "synce-plugin" ) { - return new ConfigGuiSynce( member, parent ); - } else if ( name == "sunbird-sync" ) { - return new ConfigGuiSunbird( member, parent ); - } else { - return new ConfigGuiXml( member, parent ); - } -} - - -ConfigGuiXml::ConfigGuiXml( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - mTextEdit = new TQTextEdit( this ); - topLayout()->addWidget( mTextEdit ); -} - -void ConfigGuiXml::load( const TQString &xml ) -{ - mTextEdit->setText( xml ); -} - -TQString ConfigGuiXml::save() const -{ - return mTextEdit->text(); -} diff --git a/kitchensync/src/configgui.h b/kitchensync/src/configgui.h deleted file mode 100644 index 6b7b1b105..000000000 --- a/kitchensync/src/configgui.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 CONFIGGUI_H -#define CONFIGGUI_H - -#include <libqopensync/member.h> - -#include <tqwidget.h> - -class TQBoxLayout; -class KLineEdit; -class TQTextEdit; - -class ConfigGui : public TQWidget -{ - public: - ConfigGui( const QSync::Member &, TQWidget *parent ); - - class Factory - { - public: - static ConfigGui *create( const QSync::Member &, TQWidget *parent ); - }; - - void setInstanceName( const TQString & ); - TQString instanceName() const; - - virtual void load( const TQString &xml ) = 0; - virtual TQString save() const = 0; - - QSync::Member member() const { return mMember; } - - TQBoxLayout *topLayout() const { return mTopLayout; } - - private: - QSync::Member mMember; - - TQBoxLayout *mTopLayout; - KLineEdit *mNameEdit; -}; - -class ConfigGuiXml : public ConfigGui -{ - public: - ConfigGuiXml( const QSync::Member &, TQWidget *parent ); - - void load( const TQString & ); - TQString save() const; - - private: - TQTextEdit *mTextEdit; -}; - -#endif diff --git a/kitchensync/src/configguiblank.cpp b/kitchensync/src/configguiblank.cpp deleted file mode 100644 index b16c1f839..000000000 --- a/kitchensync/src/configguiblank.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2006 Daniel Gollub <dgollub@suse.de> - - 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. - - 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 "configguiblank.h" - -#include <tdelocale.h> - -#include <tqlabel.h> -#include <tqlayout.h> - -ConfigGuiBlank::ConfigGuiBlank( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - TQLabel *label = new TQLabel( i18n( "This member/plugin needs no configuration." ), this ); - topLayout()->addWidget( label ); -} - -void ConfigGuiBlank::load( const TQString& ) -{ -} - -TQString ConfigGuiBlank::save() const -{ - TQString xml = "<config></config>"; - return xml; -} diff --git a/kitchensync/src/configguiblank.h b/kitchensync/src/configguiblank.h deleted file mode 100644 index e2048ac79..000000000 --- a/kitchensync/src/configguiblank.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2006 Daniel Gollub <dgollub@suse.de> - - 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. - - 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 CONFIGGUIBLANK_H -#define CONFIGGUIBLANK_H - -#include "configgui.h" - -class ConfigGuiBlank : public ConfigGui -{ - public: - ConfigGuiBlank( const QSync::Member &member, TQWidget *parent = 0 ); - - void load( const TQString &xml ); - TQString save() const; -}; - -#endif diff --git a/kitchensync/src/configguievo2.cpp b/kitchensync/src/configguievo2.cpp deleted file mode 100644 index fb7116cbc..000000000 --- a/kitchensync/src/configguievo2.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 "configguievo2.h" - -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqstring.h> - -#include <kurlrequester.h> -#include <kurl.h> -#include <tdefile.h> -#include <kdialog.h> -#include <tdelocale.h> - -ConfigGuiEvo2::ConfigGuiEvo2( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); -} - -void ConfigGuiEvo2::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "address_path" ) { - mAddressPath->setURL( element.text() ); - } else if ( element.tagName() == "calendar_path" ) { - mCalendarPath->setURL( element.text() ) ; - } else if ( element.tagName() == "tasks_path" ) { - mTasksPath->setURL( element.text() ); - } - } -} - -TQString ConfigGuiEvo2::save() const -{ - TQString config = "<config>\n"; - - config += TQString( "<address_path>%1</address_path>\n" ).arg( mAddressPath->url() ); - config += TQString( "<calendar_path>%1</calendar_path>\n" ).arg( mCalendarPath->url() ); - config += TQString( "<tasks_path>%1</tasks_path>\n" ).arg( mTasksPath->url() ); - - config += "</config>"; - - return config; -} - -void ConfigGuiEvo2::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 3, KDialog::spacingHint() ); - layout->setMargin( KDialog::marginHint() ); - - layout->addWidget( new TQLabel( i18n( "Address Book location:" ), this ), 0, 0 ); - mAddressPath = new KURLRequester( this ); - mAddressPath->setMode( KFile::Directory ); - layout->addMultiCellWidget( mAddressPath, 0, 0, 1, 2 ); - - layout->addWidget( new TQLabel( i18n( "Calendar location:" ), this ), 1, 0 ); - mCalendarPath = new KURLRequester( this ); - mCalendarPath->setMode( KFile::Directory ); - layout->addMultiCellWidget( mCalendarPath, 1, 1, 1, 2 ); - - layout->addWidget( new TQLabel( i18n( "Task list location:" ), this ), 2, 0 ); - mTasksPath = new KURLRequester( this ); - mTasksPath->setMode( KFile::Directory ); - layout->addMultiCellWidget( mTasksPath, 2, 2, 1, 2 ); -} diff --git a/kitchensync/src/configguievo2.h b/kitchensync/src/configguievo2.h deleted file mode 100644 index 7e3a17679..000000000 --- a/kitchensync/src/configguievo2.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 CONFIGGUIEVO2_H -#define CONFIGGUIEVO2_H - -#include "configgui.h" - -class KURLRequester; - -class ConfigGuiEvo2 : public ConfigGui -{ - public: - ConfigGuiEvo2( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - - TQString save() const; - - private: - void initGUI(); - - KURLRequester *mAddressPath; - KURLRequester *mCalendarPath; - KURLRequester *mTasksPath; -}; - -#endif diff --git a/kitchensync/src/configguifile.cpp b/kitchensync/src/configguifile.cpp deleted file mode 100644 index 22767ab83..000000000 --- a/kitchensync/src/configguifile.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "configguifile.h" - -#include <kurlrequester.h> -#include <tdelocale.h> -#include <kdialog.h> - -#include <tqlayout.h> -#include <tqcheckbox.h> -#include <tqlabel.h> -#include <tqdom.h> - -ConfigGuiFile::ConfigGuiFile( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - TQBoxLayout *filenameLayout = new TQHBoxLayout( topLayout() ); - - TQLabel *label = new TQLabel( i18n("Directory name:"), this ); - filenameLayout->addWidget( label ); - - mFilename = new KURLRequester( this ); - mFilename->setMode( KFile::Directory | KFile::LocalOnly ); - filenameLayout->addWidget( mFilename ); - - TQBoxLayout *recursiveLayout = new TQHBoxLayout( topLayout() ); - - mRecursive = new TQCheckBox( i18n("Sync all subdirectories"), this ); - recursiveLayout->addWidget( mRecursive ); - - topLayout()->addStretch( 1 ); -} - -void ConfigGuiFile::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode n; - for( n = docElement.firstChild(); !n.isNull(); n = n.nextSibling() ) { - TQDomElement e = n.toElement(); - if ( e.tagName() == "path" ) { - mFilename->setURL( e.text() ); - } else if ( e.tagName() == "recursive" ) { - mRecursive->setChecked( e.text() == "TRUE" ); - } - } -} - -TQString ConfigGuiFile::save() const -{ - TQString xml; - xml = "<config>"; - xml += "<path>" + mFilename->url() + "</path>"; - xml += "<recursive>"; - if ( mRecursive->isChecked() ) xml += "TRUE"; - else xml += "FALSE"; - xml += "</recursive>"; - xml += "</config>"; - - return xml; -} diff --git a/kitchensync/src/configguifile.h b/kitchensync/src/configguifile.h deleted file mode 100644 index db9385223..000000000 --- a/kitchensync/src/configguifile.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 CONFIGGUIFILE_H -#define CONFIGGUIFILE_H - -#include "configgui.h" - -class KURLRequester; -class TQCheckBox; - -class ConfigGuiFile : public ConfigGui -{ - public: - ConfigGuiFile( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - KURLRequester *mFilename; - TQCheckBox *mRecursive; -}; - -#endif diff --git a/kitchensync/src/configguigcalendar.cpp b/kitchensync/src/configguigcalendar.cpp deleted file mode 100644 index 8fb4fd0e5..000000000 --- a/kitchensync/src/configguigcalendar.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - Copyright (c) 2006 Eduardo Habkost <ehabkost@raisama.net> - - 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. - - 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 "configguigcalendar.h" - -#include <tdelocale.h> - -#include <tqlayout.h> -#include <tqlabel.h> -#include <tqdom.h> -#include <tqlineedit.h> - -ConfigGuiGoogleCalendar::ConfigGuiGoogleCalendar( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - TQBoxLayout *userLayout = new TQHBoxLayout( topLayout() ); - - TQLabel *userLbl= new TQLabel( i18n("Username:"), this ); - userLayout->addWidget(userLbl); - - mUsername = new TQLineEdit(this); - userLayout->addWidget(mUsername); - - - TQBoxLayout *passLayout = new TQHBoxLayout( topLayout() ); - - TQLabel *passLbl = new TQLabel( i18n("Password:"), this ); - passLayout->addWidget(passLbl); - - mPassword = new TQLineEdit(this); - mPassword->setEchoMode(TQLineEdit::Password); - passLayout->addWidget(mPassword); - - topLayout()->addWidget(new TQLabel( i18n("Please notice that currently the password is stored as plain text in the plugin configuration file"), this )); - - TQBoxLayout *urlLayout = new TQHBoxLayout( topLayout() ); - TQLabel *urlLbl = new TQLabel( i18n("Calendar URL:"), this ); - urlLayout->addWidget(urlLbl); - - mUrl = new TQLineEdit(this); - urlLayout->addWidget(mUrl); - - topLayout()->addStretch( 1 ); -} - -void ConfigGuiGoogleCalendar::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode n; - for( n = docElement.firstChild(); !n.isNull(); n = n.nextSibling() ) { - TQDomElement e = n.toElement(); - if ( e.tagName() == "username" ) { - mUsername->setText(e.text()); - } else if ( e.tagName() == "password" ) { - mPassword->setText(e.text()); - } else if ( e.tagName() == "url" ) { - mUrl->setText(e.text()); - } - } -} - -TQString ConfigGuiGoogleCalendar::save() const -{ - TQDomDocument doc; - TQDomElement root = doc.createElement("config"); - doc.appendChild(root); - - TQDomElement un = doc.createElement("username"); - root.appendChild(un); - un.appendChild(doc.createTextNode(mUsername->text())); - - TQDomElement pass = doc.createElement("password"); - root.appendChild(pass); - pass.appendChild(doc.createTextNode(mPassword->text())); - - TQDomElement url = doc.createElement("url"); - root.appendChild(url); - url.appendChild(doc.createTextNode(mUrl->text())); - - //TODO: Implement me! - return doc.toString(); -} diff --git a/kitchensync/src/configguigcalendar.h b/kitchensync/src/configguigcalendar.h deleted file mode 100644 index 198cf77ca..000000000 --- a/kitchensync/src/configguigcalendar.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - Copyright (c) 2006 Eduardo Habkost <ehabkost@raisama.net> - - 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. - - 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 CONFIGGUIGCALENDAR_H -#define CONFIGGUIGCALENDAR_H - -#include "configgui.h" - -class TQLineEdit; - -class ConfigGuiGoogleCalendar : public ConfigGui -{ - public: - ConfigGuiGoogleCalendar( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - TQLineEdit *mUsername; - TQLineEdit *mPassword; - TQLineEdit *mUrl; -}; - -#endif diff --git a/kitchensync/src/configguignokii.cpp b/kitchensync/src/configguignokii.cpp deleted file mode 100644 index cd392cb67..000000000 --- a/kitchensync/src/configguignokii.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2006 David Förster <david@dfoerster.de> - - 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. - - 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 "configguignokii.h" - -#include <tdelocale.h> -#include <kdialog.h> -#include <kcombobox.h> - -#include <kdebug.h> - -#include <tqlayout.h> -#include <tqlabel.h> -#include <tqlineedit.h> -#include <tqcombobox.h> -#include <tqdom.h> -#include <tqvbox.h> - -ConfigGuiGnokii::ConfigGuiGnokii( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - TQGridLayout *layout = new TQGridLayout( topLayout() ); - - // Model - TQLabel *label = new TQLabel( i18n("Model:"), this ); - layout->addWidget( label, 0, 0 ); - - mModel = new KComboBox( true, this ); - layout->addWidget( mModel, 0, 1 ); - mModel->insertItem( "2110" ); - mModel->insertItem( "3110" ); - mModel->insertItem( "6110" ); - mModel->insertItem( "6110" ); - mModel->insertItem( "6160" ); - mModel->insertItem( "6230" ); - mModel->insertItem( "6230i" ); - mModel->insertItem( "6510" ); - mModel->insertItem( "7110" ); - mModel->insertItem( "AT" ); - // This one requires the gnapplet and rfcomm_channel - mModel->insertItem( "3650" ); - mModel->insertItem( "6600" ); - mModel->insertItem( "gnapplet" ); - mModel->insertItem( "symbian" ); - mModel->insertItem( "sx1" ); - - connect( mModel, TQT_SIGNAL (activated( int ) ), - this, TQT_SLOT( slotModelChanged () ) ); - - // Connection - label = new TQLabel( i18n("Connection:"), this ); - layout->addWidget( label, 1, 0 ); - - mConnection = new TQComboBox( this ); - layout->addWidget( mConnection, 1, 1 ); - - connect( mConnection, TQT_SIGNAL (activated( int ) ), - this, TQT_SLOT( slotConnectionChanged ( int ) ) ); - - // this is a list of all connection types accepted by the gnokii-sync plugin - mConnectionTypes.append( ConnectionType( "bluetooth", i18n( "Bluetooth" ) ) ); - mConnectionTypes.append( ConnectionType( "irda", i18n( "IrDA" ) ) ); - mConnectionTypes.append( ConnectionType( "serial", i18n( "Serial" ) ) ); - mConnectionTypes.append( ConnectionType( "infrared", i18n( "Infrared" ) ) ); - mConnectionTypes.append( ConnectionType( "tcp", i18n( "TCP" ) ) ); - mConnectionTypes.append( ConnectionType( "dku2", i18n( "USB (nokia_dku2)" ) ) ); - mConnectionTypes.append( ConnectionType( "dku2libusb", i18n( "USB (libusb)" ) ) ); - mConnectionTypes.append( ConnectionType( "dau9p", i18n( "Serial (DAU9P cable)" ) ) ); - mConnectionTypes.append( ConnectionType( "dlr3p", i18n( "Serial (DLR3P cable)" ) ) ); - mConnectionTypes.append( ConnectionType( "tekram", i18n( "Tekram Ir-Dongle" ) ) ); - mConnectionTypes.append( ConnectionType( "m2bus", i18n( "Serial (M2BUS protocol)" ) ) ); - - ConnectionTypeList::ConstIterator it; - for ( it = mConnectionTypes.begin(); it != mConnectionTypes.end(); it++ ) { - mConnection->insertItem( (*it).second ); - } - - TQVBox *connectionWidget = new TQVBox( this ); - connectionWidget->setMargin( KDialog::marginHint() ); - connectionWidget->setSpacing( 5 ); - - mBluetooth = new BluetoothWidget( connectionWidget ); - mBluetooth->hide(); - - layout->addMultiCellWidget( connectionWidget, 2, 2, 0, 1 ); - - // Port - mPortLabel = new TQLabel( i18n("Port:"), this ); - layout->addWidget( mPortLabel, 2, 0 ); - mPortLabel->hide(); - - mPort = new KComboBox( true, this ); - layout->addWidget( mPort, 2, 1 ); - mPort->hide(); - - mPort->insertItem( "/dev/ircomm0" ); - mPort->insertItem( "/dev/ircomm1" ); - mPort->insertItem( "/dev/ttyS0" ); - mPort->insertItem( "/dev/ttyS1" ); - mPort->insertItem( "/dev/ttyUSB0" ); - mPort->insertItem( "/dev/ttyUSB1" ); - - layout->setColStretch( 1, 1 ); - - topLayout()->addStretch( 1 ); -} - -void ConfigGuiGnokii::slotConnectionChanged( int nth ) -{ - mPort->hide(); - mPortLabel->hide(); - mBluetooth->hide(); - - // Bluetooth - if ( nth == 0 ) { - mBluetooth->show(); - slotModelChanged(); - - if ( !mPort->currentText().isEmpty() ) - mBluetooth->setAddress( mPort->currentText() ); - - // dku2libusb - } else if ( nth == 6 ) { - // No widget needed. - } else { - mPort->show(); - mPortLabel->show(); - } - -} - -void ConfigGuiGnokii::slotModelChanged() -{ - mBluetooth->hideChannel(); - - if ( mModel->currentText() == "gnapplet" - || mModel->currentText() == "symbian" - || mModel->currentText() == "3650" - || mModel->currentText() == "6600" - || mModel->currentText() == "sx1") - mBluetooth->showChannel(); - else - mBluetooth->setChannel(""); -} - -void ConfigGuiGnokii::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode n; - for( n = docElement.firstChild(); !n.isNull(); n = n.nextSibling() ) { - TQDomElement e = n.toElement(); - if ( e.tagName() == "connection" ) { - for ( uint i = 0; i < mConnectionTypes.count(); i++ ) { - if ( mConnectionTypes[i].first == e.text()) { - mConnection->setCurrentItem( i ); - slotConnectionChanged( i ); - break; - } - } - } else if ( e.tagName() == "port" ) { - mPort->setCurrentText( e.text() ); - } else if ( e.tagName() == "model" ) { - mModel->setCurrentText( e.text() ); - } else if ( e.tagName() == "rfcomm_channel" ) { - mBluetooth->setChannel( e.text() ); - mBluetooth->showChannel(); - } - } -} - -TQString ConfigGuiGnokii::save() const -{ - TQString xml; - xml = "<config>"; - - ConnectionTypeList::ConstIterator it; - for ( it = mConnectionTypes.begin(); it != mConnectionTypes.end(); it++ ) { - if ( mConnection->currentText() == (*it).second ) { - xml += "<connection>" + (*it).first + "</connection>"; - break; - } - } - - if ( (*it).first == "bluetooth" ) - xml += "<port>" + mBluetooth->address() + "</port>"; - else if ( (*it).first == "dku2libusb" ) - xml += "<port>" + TQString("FF:FF:FF:FF:FF:FF") + "</port>"; // Only place holder for libgnokii - else - xml += "<port>" + mPort->currentText() + "</port>"; - - // model - xml += "<model>" + mModel->currentText() + "</model>"; - - // rfcomm_channel - if ( !mBluetooth->channel().isNull() ) - xml += "<rfcomm_channel>" + mBluetooth->channel() + "</rfcomm_channel>"; - - xml += "</config>"; - - return xml; -} - -#include "configguignokii.moc" diff --git a/kitchensync/src/configguignokii.h b/kitchensync/src/configguignokii.h deleted file mode 100644 index 9dbbdd9ab..000000000 --- a/kitchensync/src/configguignokii.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2006 David Förster <david@dfoerster.de> - - 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. - - 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 CONFIGGUIGNOKII_H -#define CONFIGGUIGNOKII_H - -#include "configgui.h" -#include "connectionwidgets.h" - -#include <tqvaluelist.h> -#include <tqpair.h> - -class TQLabel; -class TQLineEdit; -class TQComboBox; - -class ConfigGuiGnokii : public ConfigGui -{ - Q_OBJECT - - - public: - ConfigGuiGnokii( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - TQComboBox *mConnection; - KComboBox *mPort; - TQLabel *mPortLabel; - KComboBox *mModel; - - BluetoothWidget *mBluetooth; - - typedef TQPair<TQString, TQString> ConnectionType; - typedef TQValueList<ConnectionType> ConnectionTypeList; - ConnectionTypeList mConnectionTypes; - - protected slots: - void slotConnectionChanged( int nth ); - void slotModelChanged(); - -}; - -#endif diff --git a/kitchensync/src/configguigpe.cpp b/kitchensync/src/configguigpe.cpp deleted file mode 100644 index 4dce7d9b1..000000000 --- a/kitchensync/src/configguigpe.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 "configguigpe.h" - -#include <tqcheckbox.h> -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqspinbox.h> - -#include <kcombobox.h> -#include <kdialog.h> -#include <klineedit.h> -#include <tdelocale.h> - -ConfigGuiGpe::ConfigGuiGpe( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); - - mConnectionMode->insertItem( i18n( "Local" ) ); - mConnectionMode->insertItem( i18n( "Ssh" ) ); -} - -void ConfigGuiGpe::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "use_local" ) { - if ( element.text().toInt() == 1 ) - mConnectionMode->setCurrentItem( 0 ); - else - mConnectionMode->setCurrentItem( 1 ); - } else if ( element.tagName() == "handheld_ip" ) { - mIP->setText( element.text() ); - } else if ( element.tagName() == "handheld_port" ) { - mPort->setValue( element.text().toInt() ); - } else if ( element.tagName() == "handheld_user" ) { - mUser->setText( element.text() ); - } - } -} - -TQString ConfigGuiGpe::save() const -{ - TQString config = "<config>"; - - config += TQString( "<use_local>%1</use_local>" ).arg( mConnectionMode->currentItem() == 0 ); - config += TQString( "<use_ssh>%1</use_ssh>" ).arg( mConnectionMode->currentItem() == 1 ); - config += TQString( "<handheld_ip>%1</handheld_ip>" ).arg( mIP->text() ); - config += TQString( "<handheld_port>%1</handheld_port>" ).arg( mPort->value() ); - config += TQString( "<handheld_user>%1</handheld_user>" ).arg( mUser->text() ); - - config += "</config>"; - - return config; -} - -void ConfigGuiGpe::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 4, KDialog::spacingHint() ); - layout->setMargin( KDialog::marginHint() ); - - layout->addWidget( new TQLabel( i18n( "Connection Mode:" ), this ), 0, 0 ); - mConnectionMode = new KComboBox( this ); - layout->addMultiCellWidget( mConnectionMode, 0, 0, 0, 3 ); - - layout->addWidget( new TQLabel( i18n( "IP Address:" ), this ), 1, 0 ); - mIP = new KLineEdit( this ); - mIP->setInputMask( "000.000.000.000" ); - layout->addWidget( mIP, 1, 1 ); - - layout->addWidget( new TQLabel( i18n( "Port:" ), this ), 1, 2, TQt::AlignRight ); - mPort = new TQSpinBox( 1, 65536, 1, this ); - layout->addWidget( mPort, 1, 3 ); - - layout->addWidget( new TQLabel( i18n( "User:" ), this ), 2, 0 ); - mUser = new KLineEdit( this ); - layout->addMultiCellWidget( mUser, 2, 2, 1, 3 ); -} diff --git a/kitchensync/src/configguigpe.h b/kitchensync/src/configguigpe.h deleted file mode 100644 index e1fc10c6e..000000000 --- a/kitchensync/src/configguigpe.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 CONFIGGUIGPE_H -#define CONFIGGUIGPE_H - -#include "configgui.h" - -class TQSpinBox; - -class KComboBox; -class KLineEdit; - -class ConfigGuiGpe : public ConfigGui -{ - public: - ConfigGuiGpe( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - void initGUI(); - - KComboBox *mConnectionMode; - - KLineEdit *mIP; - TQSpinBox *mPort; - KLineEdit *mUser; -}; - -#endif diff --git a/kitchensync/src/configguiirmc.cpp b/kitchensync/src/configguiirmc.cpp deleted file mode 100644 index 331f9daab..000000000 --- a/kitchensync/src/configguiirmc.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <kcombobox.h> -#include <kdialog.h> -#include <tdeglobal.h> -#include <kiconloader.h> -#include <kinputdialog.h> -#include <klineedit.h> -#include <tdelocale.h> -#include <tdemessagebox.h> - -#include <kdebug.h> - -#include <tqapplication.h> -#include <tqeventloop.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpushbutton.h> -#include <tqspinbox.h> -#include <tqtabwidget.h> -#include <tqtooltip.h> -#include <tqvbox.h> - -#include "configguiirmc.h" - -ConfigGuiIRMC::ConfigGuiIRMC( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); - - mConnectionType->insertItem( i18n( "Bluetooth" ) ); - mConnectionType->insertItem( i18n( "InfraRed (IR)" ) ); - mConnectionType->insertItem( i18n( "Cable" ) ); - - connect( mConnectionType, TQT_SIGNAL( activated( int ) ), - this, TQT_SLOT( connectionTypeChanged( int ) ) ); - - connectionTypeChanged( 0 ); -} - -void ConfigGuiIRMC::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for ( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "connectmedium" ) { - if ( element.text() == "bluetooth" ) { - mConnectionType->setCurrentItem( 0 ); - connectionTypeChanged( 0 ); - } else if ( element.text() == "ir" ) { - mConnectionType->setCurrentItem( 1 ); - connectionTypeChanged( 1 ); - } else if ( element.text() == "cable" ) { - mConnectionType->setCurrentItem( 2 ); - connectionTypeChanged( 2 ); - } - } else if (element.tagName() == "btunit" ) { - mBluetoothWidget->setAddress( element.text() ); - } else if (element.tagName() == "btchannel" ) { - mBluetoothWidget->setChannel( element.text() ); - } else if (element.tagName() == "donttellsync" ) { - mDontTellSync->setChecked( element.text() == "true" ); - } - - - } - - mIRWidget->load( docElement ); - mCableWidget->load( docElement ); -} - -TQString ConfigGuiIRMC::save() const -{ - TQDomDocument doc; - TQDomElement config = doc.createElement( "config" ); - doc.appendChild( config ); - - TQDomElement element = doc.createElement( "connectmedium" ); - if ( mConnectionType->currentItem() == 0 ) - element.appendChild( doc.createTextNode( "bluetooth" ) ); - if ( mConnectionType->currentItem() == 1 ) - element.appendChild( doc.createTextNode( "ir" ) ); - if ( mConnectionType->currentItem() == 2 ) - element.appendChild( doc.createTextNode( "cable" ) ); - - config.appendChild( element ); - - if ( mConnectionType->currentItem() == 0 ) { - TQDomElement btunit = doc.createElement( "btunit" ); - if ( !mBluetoothWidget->address().isEmpty() ) - btunit.appendChild( doc.createTextNode( mBluetoothWidget->address() ) ); - - TQDomElement btchannel = doc.createElement( "btchannel" ); - if ( !mBluetoothWidget->channel().isEmpty() ) - btchannel.appendChild( doc.createTextNode( mBluetoothWidget->channel() ) ); - - config.appendChild( btunit ); - config.appendChild( btchannel ); - } - - if ( mDontTellSync->isChecked() ) { - TQDomElement dontellsync = doc.createElement( "donttellsync" ); - dontellsync.appendChild( doc.createTextNode( "true" ) ); - config.appendChild( dontellsync ); - } - - mIRWidget->save( doc, config ); - mCableWidget->save( doc, config ); - - return doc.toString(); -} - -void ConfigGuiIRMC::connectionTypeChanged( int type ) -{ - mBluetoothWidget->hide(); - mIRWidget->hide(); - mCableWidget->hide(); - - if ( type == 0 ) - mBluetoothWidget->show(); - else if ( type == 1 ) - mIRWidget->show(); - else - mCableWidget->show(); -} - -void ConfigGuiIRMC::initGUI() -{ - TQTabWidget *tabWidget = new TQTabWidget( this ); - topLayout()->addWidget( tabWidget ); - - TQVBox *connectionWidget = new TQVBox( tabWidget ); - connectionWidget->setMargin( KDialog::marginHint() ); - connectionWidget->setSpacing( 5 ); - - tabWidget->addTab( connectionWidget, i18n( "Connection" ) ); - - mConnectionType = new KComboBox( connectionWidget ); - TQToolTip::add( mConnectionType, i18n( "Select your connection type." ) ); - - mBluetoothWidget = new BluetoothWidget( connectionWidget ); - mBluetoothWidget->hide(); - - mIRWidget = new IRWidget( connectionWidget ); - mIRWidget->hide(); - - mCableWidget = new CableWidget( connectionWidget ); - mCableWidget->hide(); - - connectionWidget->setStretchFactor( mBluetoothWidget, 1 ); - connectionWidget->setStretchFactor( mIRWidget, 1 ); - connectionWidget->setStretchFactor( mCableWidget, 1 ); - - TQVBox *optionsWidget = new TQVBox( tabWidget ); - optionsWidget->setMargin( KDialog::marginHint() ); - optionsWidget->setSpacing( 5 ); - - tabWidget->addTab( optionsWidget, i18n( "Options" ) ); - - TQHBox *optionBox = new TQHBox( optionsWidget ); - optionBox->setSpacing( KDialog::spacingHint() ); - - TQLabel *label = new TQLabel( i18n( "Don't send OBEX UUID (IRMC-SYNC)" ), optionBox ); - mDontTellSync = new TQCheckBox( optionBox ); - TQToolTip::add( mDontTellSync, i18n( "Don't send OBEX UUID while connecting. Needed for older IrMC based mobile phones." ) ); - label->setBuddy( mDontTellSync ); - -} - -#include "configguiirmc.moc" diff --git a/kitchensync/src/configguiirmc.h b/kitchensync/src/configguiirmc.h deleted file mode 100644 index a76dd782a..000000000 --- a/kitchensync/src/configguiirmc.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 CONFIGGUIIRMC_H -#define CONFIGGUIIRMC_H - -#include <tqcheckbox.h> -#include <tqdom.h> - -#include "configgui.h" -#include "connectionwidgets.h" - -class KComboBox; -class KLineEdit; -class TQCheckBox; -class TQPushButton; -class TQSpinBox; - -class ConfigGuiIRMC : public ConfigGui -{ - Q_OBJECT - - - public: - ConfigGuiIRMC( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - protected slots: - void connectionTypeChanged( int type ); - - private: - void initGUI(); - - KComboBox *mConnectionType; - TQCheckBox *mDontTellSync; - - BluetoothWidget *mBluetoothWidget; - IRWidget *mIRWidget; - CableWidget *mCableWidget; -}; - -#endif diff --git a/kitchensync/src/configguijescs.cpp b/kitchensync/src/configguijescs.cpp deleted file mode 100644 index c4167bb3a..000000000 --- a/kitchensync/src/configguijescs.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 "configguijescs.h" - -#include <tqcheckbox.h> -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> - -#include <klineedit.h> -#include <kdialog.h> -#include <tdelocale.h> - -ConfigGuiJescs::ConfigGuiJescs( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); -} - -void ConfigGuiJescs::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "url" ) { - mUrl->setText( element.text() ); - } else if ( element.tagName() == "username" ) { - mUsername->setText( element.text() ); - } else if ( element.tagName() == "password" ) { - mPassword->setText( element.text() ); - } else if ( element.tagName() == "del_notify" ) { - mDelNotify->setChecked( element.text() == "1" ); - } - } -} - -TQString ConfigGuiJescs::save() const -{ - int delNotifyState; - TQString config = "<config>\n"; - - config += TQString( "<url>%1</url>\n" ).arg( mUrl->text() ); - config += TQString( "<username>%1</username>\n" ).arg( mUsername->text() ); - config += TQString( "<password>%1</password>\n" ).arg( mPassword->text() ); - if ( mDelNotify->isChecked() ) { delNotifyState = 1; - } else { delNotifyState = 0; - } - config += TQString( "<del_notify>%1</del_notify>\n" ).arg( delNotifyState ); - - config += "</config>"; - - return config; -} - -void ConfigGuiJescs::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 3, KDialog::spacingHint() ); - layout->setMargin( KDialog::marginHint() ); - - layout->addWidget( new TQLabel( i18n( "URL:" ), this ), 0, 0 ); - mUrl = new KLineEdit( this ); - layout->addMultiCellWidget( mUrl, 0, 0, 1, 2 ); - - layout->addWidget( new TQLabel( i18n( "Username:" ), this ), 1, 0 ); - mUsername = new KLineEdit( this ); - layout->addMultiCellWidget( mUsername, 1, 1, 1, 2 ); - - layout->addWidget( new TQLabel( i18n( "Password:" ), this ), 2, 0 ); - mPassword = new KLineEdit( this ); - mPassword->setEchoMode( KLineEdit::Password ); - layout->addMultiCellWidget( mPassword, 2, 2, 1, 2 ); - - mDelNotify = new TQCheckBox( this ); - mDelNotify->setText( "Notify attendees about event/task deletion" ); - layout->addMultiCellWidget( mDelNotify, 3, 3, 0, 2 ); -} diff --git a/kitchensync/src/configguijescs.h b/kitchensync/src/configguijescs.h deleted file mode 100644 index 1667900c9..000000000 --- a/kitchensync/src/configguijescs.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 CONFIGGUIJESCS_H -#define CONFIGGUIJESCS_H - -#include "configgui.h" - -class KLineEdit; -class TQCheckBox; - -class ConfigGuiJescs : public ConfigGui -{ - public: - ConfigGuiJescs( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - - TQString save() const; - - private: - void initGUI(); - - KLineEdit *mUrl; - KLineEdit *mUsername; - KLineEdit *mPassword; - TQCheckBox *mDelNotify; -}; - -#endif diff --git a/kitchensync/src/configguildap.cpp b/kitchensync/src/configguildap.cpp deleted file mode 100644 index 1b1c3622c..000000000 --- a/kitchensync/src/configguildap.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 "configguildap.h" - -#include <tqcheckbox.h> -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqspinbox.h> - -#include <kcombobox.h> -#include <kdialog.h> -#include <klineedit.h> -#include <tdelocale.h> - -ConfigGuiLdap::ConfigGuiLdap( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); - - mSearchScope->insertItem( i18n( "Base" ) ); - mSearchScope->insertItem( i18n( "One" ) ); - mSearchScope->insertItem( i18n( "Sub" ) ); -} - -void ConfigGuiLdap::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "servername" ) { - mLdapWidget->setHost( element.text() ); - } else if ( element.tagName() == "serverport" ) { - mLdapWidget->setPort( element.text().toInt() ); - } else if ( element.tagName() == "binddn" ) { - mLdapWidget->setBindDN( element.text() ); - } else if ( element.tagName() == "password" ) { - mLdapWidget->setPassword( element.text() ); - } else if ( element.tagName() == "anonymous" ) { - mLdapWidget->setAuthAnon( element.text().toInt() == 1 ); - } else if ( element.tagName() == "searchbase" ) { - mLdapWidget->setDn( element.text() ); - } else if ( element.tagName() == "searchfilter" ) { - mLdapWidget->setFilter( element.text() ); - } else if ( element.tagName() == "storebase" ) { - mLdapWidget->setDn( element.text() ); - } else if ( element.tagName() == "keyattr" ) { - mKeyAttribute->setText( element.text() ); - } else if ( element.tagName() == "scope" ) { - TQStringList list; - list << "base" << "one" << "sub"; - for ( uint i = 0; i < list.count(); ++i ) - if ( list[ i ] == element.text() ) - mSearchScope->setCurrentItem( i ); - - } else if ( element.tagName() == "authmech" ) { - if ( element.text() == "SIMPLE" ) { - mLdapWidget->setAuthSimple( true ); - } - } else if ( element.tagName() == "encryption" ) { - mEncryption->setChecked( element.text().toInt() == 1 ); - } else if ( element.tagName() == "ldap_read" ) { - mReadLdap->setChecked( element.text().toInt() == 1 ); - } else if ( element.tagName() == "ldap_write" ) { - mWriteLdap->setChecked( element.text().toInt() == 1 ); - } - } -} - -TQString ConfigGuiLdap::save() const -{ - TQString config = "<config>\n"; - - config += TQString( "<servername>%1</servername>\n" ).arg( mLdapWidget->host() ); - config += TQString( "<serverport>%1</serverport>\n" ).arg( mLdapWidget->port() ); - config += TQString( "<binddn>%1</binddn>\n" ).arg( mLdapWidget->bindDN() ); - config += TQString( "<password>%1</password>\n" ).arg( mLdapWidget->password() ); - config += TQString( "<anonymous>%1</anonymous>\n" ).arg( mLdapWidget->isAuthAnon() ? "1" : "0" ); - config += TQString( "<searchbase>%1</searchbase>\n" ).arg( mLdapWidget->dn() ); - config += TQString( "<searchfilter>%1</searchfilter>\n" ).arg( mLdapWidget->filter() ); - config += TQString( "<storebase>%1</storebase>\n" ).arg( mLdapWidget->dn() ); - config += TQString( "<keyattr>%1</keyattr>\n" ).arg( mKeyAttribute->text() ); - - TQStringList scopes; - scopes << "base" << "one" << "sub"; - - config += TQString( "<scope>%1</scope>\n" ).arg( scopes[ mSearchScope->currentItem() ] ); - - config += TQString( "<authmech>SIMPLE</authmech>\n" ); - config += TQString( "<encryption>%1</encryption>\n" ).arg( mEncryption->isChecked() ? "1" : "0" ); - - config += TQString( "<ldap_read>%1</ldap_read>\n" ).arg( mReadLdap->isChecked() ? "1" : "0" ); - config += TQString( "<ldap_write>%1</ldap_write>\n" ).arg( mWriteLdap->isChecked() ? "1" : "0" ); - - config += "</config>"; - - return config; -} - -void ConfigGuiLdap::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 4, KDialog::spacingHint() ); - layout->setMargin( KDialog::marginHint() ); - - mLdapWidget = new TDEABC::LdapConfigWidget( TDEABC::LdapConfigWidget::W_HOST | - TDEABC::LdapConfigWidget::W_PORT | - TDEABC::LdapConfigWidget::W_USER | - TDEABC::LdapConfigWidget::W_PASS | - TDEABC::LdapConfigWidget::W_BINDDN | - TDEABC::LdapConfigWidget::W_DN | - TDEABC::LdapConfigWidget::W_FILTER | - TDEABC::LdapConfigWidget::W_AUTHBOX, this ); - - mKeyAttribute = new KLineEdit( this ); - mSearchScope = new KComboBox( this ); - mEncryption = new TQCheckBox( i18n( "Use encryption" ), this ); - mReadLdap = new TQCheckBox( i18n( "Load data from LDAP" ), this ); - mWriteLdap = new TQCheckBox( i18n( "Save data to LDAP" ), this ); - - layout->addMultiCellWidget( mLdapWidget, 0, 9, 0, 3 ); - layout->addWidget( new TQLabel( i18n( "Key Attribute:" ), this ), 10, 0 ); - layout->addMultiCellWidget( mKeyAttribute, 10, 10, 1, 2 ); - layout->addWidget( new TQLabel( i18n( "Search Scope:" ), this ), 11, 0 ); - layout->addMultiCellWidget( mSearchScope, 11, 11, 1, 2 ); - layout->addWidget( mEncryption, 12, 0 ); - layout->addWidget( mReadLdap, 13, 0 ); - layout->addWidget( mWriteLdap, 13, 3 ); - -} - -#include "configguildap.moc" diff --git a/kitchensync/src/configguildap.h b/kitchensync/src/configguildap.h deleted file mode 100644 index 81b8857b7..000000000 --- a/kitchensync/src/configguildap.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 CONFIGGUILDAP_H -#define CONFIGGUILDAP_H - -#include "configgui.h" -#include "tdeabc/ldapconfigwidget.h" - -class TQCheckBox; -class TQLabel; -class TQSpinBox; - -namespace TDEABC { - class LdapConfigWidget; -} -class KComboBox; -class KLineEdit; - -class ConfigGuiLdap : public ConfigGui -{ - Q_OBJECT - - - public: - ConfigGuiLdap( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - void initGUI(); - - TDEABC::LdapConfigWidget *mLdapWidget; - KLineEdit *mKeyAttribute; - KComboBox *mSearchScope; - TQCheckBox *mEncryption; - TQCheckBox *mReadLdap; - TQCheckBox *mWriteLdap; - -}; - -#endif diff --git a/kitchensync/src/configguimoto.cpp b/kitchensync/src/configguimoto.cpp deleted file mode 100644 index bcb9bd59c..000000000 --- a/kitchensync/src/configguimoto.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 "configguimoto.h" - -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> - -#include <klineedit.h> -#include <kdialog.h> -#include <tdelocale.h> - -ConfigGuiMoto::ConfigGuiMoto( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); -} - -void ConfigGuiMoto::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "device" ) { - mDeviceString->setText( element.text() ); - } - } -} - -TQString ConfigGuiMoto::save() const -{ - TQString config = "<config>\n"; - - config += TQString( "<device>%1</device>\n" ).arg( mDeviceString->text() ); - - config += "</config>"; - - return config; -} - -void ConfigGuiMoto::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 3, KDialog::spacingHint() ); - layout->setMargin( KDialog::marginHint() ); - - layout->addWidget( new TQLabel( i18n( "Device String:" ), this ), 0, 0 ); - mDeviceString = new KLineEdit( this ); - layout->addMultiCellWidget( mDeviceString, 0, 0, 1, 2 ); -} diff --git a/kitchensync/src/configguimoto.h b/kitchensync/src/configguimoto.h deleted file mode 100644 index cd588facf..000000000 --- a/kitchensync/src/configguimoto.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 CONFIGGUIMOTO_H -#define CONFIGGUIMOTO_H - -#include "configgui.h" - -class KLineEdit; - -class ConfigGuiMoto : public ConfigGui -{ - public: - ConfigGuiMoto( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - void initGUI(); - - KLineEdit *mDeviceString; -}; - -#endif diff --git a/kitchensync/src/configguiopie.cpp b/kitchensync/src/configguiopie.cpp deleted file mode 100644 index 33bf9e08c..000000000 --- a/kitchensync/src/configguiopie.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2006 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 "configguiopie.h" - -#include <tdelocale.h> - -#include <tqcombobox.h> -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqlineedit.h> -#include <tqspinbox.h> - -ConfigGuiOpie::ConfigGuiOpie( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - TQGridLayout *layout = new TQGridLayout( topLayout() ); - - TQLabel *label = new TQLabel( i18n("Device IP:"), this ); - layout->addWidget( label, 0, 0 ); - - mDeviceIP = new TQLineEdit( this ); - mDeviceIP->setInputMask( "000.000.000.000" ); - label->setBuddy( mDeviceIP ); - layout->addWidget( mDeviceIP, 0, 1 ); - - label = new TQLabel( i18n("Device Type:"), this ); - layout->addWidget( label, 1, 0 ); - - mDeviceType = new TQComboBox( this ); - label->setBuddy( mDeviceType ); - layout->addWidget( mDeviceType, 1, 1 ); - - label = new TQLabel( i18n("Username:"), this ); - layout->addWidget( label, 2, 0 ); - - mUserName = new TQLineEdit( this ); - label->setBuddy( mUserName ); - layout->addWidget( mUserName, 2, 1 ); - - label = new TQLabel( i18n("Password:"), this ); - layout->addWidget( label, 3, 0 ); - - mPassword = new TQLineEdit( this ); - mPassword->setEchoMode( TQLineEdit::Password ); - label->setBuddy( mPassword ); - layout->addWidget( mPassword, 3, 1 ); - - label = new TQLabel( i18n("Protocol:"), this ); - layout->addWidget( label, 4, 0 ); - - mConnectionType = new TQComboBox( this ); - label->setBuddy( mConnectionType ); - layout->addWidget( mConnectionType, 4, 1 ); - - label = new TQLabel( i18n("Port:"), this ); - layout->addWidget( label, 5, 0 ); - - mPort = new TQSpinBox( this ); - mPort->setRange( 0, 65335 ); - label->setBuddy( mPort ); - layout->addWidget( mPort, 5, 1 ); - - mDeviceType->insertItem( i18n("Opie/OpenZaurus") ); - mDeviceType->insertItem( i18n("TQtopia2") ); - - mConnectionType->insertItem( i18n("SCP") ); - mConnectionType->insertItem( i18n("FTP") ); - - topLayout()->addStretch( 1 ); -} - -void ConfigGuiOpie::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode n; - for( n = docElement.firstChild(); !n.isNull(); n = n.nextSibling() ) { - TQDomElement e = n.toElement(); - if ( e.tagName() == "username" ) { - mUserName->setText( e.text() ); - } else if ( e.tagName() == "password" ) { - mPassword->setText( e.text() ); - } else if ( e.tagName() == "url" ) { - mDeviceIP->setText( e.text() ); - } else if ( e.tagName() == "port" ) { - mPort->setValue( e.text().toInt() ); - } else if ( e.tagName() == "device" ) { - if ( e.text() == "opie" ) - mDeviceType->setCurrentItem( 0 ); - else - mDeviceType->setCurrentItem( 1 ); - } else if ( e.tagName() == "conntype" ) { - if ( e.text() == "scp" ) - mConnectionType->setCurrentItem( 0 ); - else - mConnectionType->setCurrentItem( 1 ); - } - } -} - -TQString ConfigGuiOpie::save() const -{ - TQString xml; - xml = "<config>"; - xml += "<username>" + mUserName->text() + "</username>"; - xml += "<password>" + mPassword->text() + "</password>"; - xml += "<url>" + mDeviceIP->text() + "</url>"; - xml += "<device>" + TQString( mDeviceType->currentItem() == 0 ? "opie" : "qtopia2" ) + "</device>"; - xml += "<port>" + TQString::number( mPort->value() ) + "</port>"; - xml += "<conntype>" + TQString( mConnectionType->currentItem() == 0 ? "scp" : "ftp" ) + "</conntype>"; - xml += "</config>"; - - return xml; -} diff --git a/kitchensync/src/configguiopie.h b/kitchensync/src/configguiopie.h deleted file mode 100644 index e90f4acfe..000000000 --- a/kitchensync/src/configguiopie.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2006 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 CONFIGGUIOPIE_H -#define CONFIGGUIOPIE_H - -#include "configgui.h" - -class TQComboBox; -class TQLineEdit; -class TQSpinBox; - -class ConfigGuiOpie : public ConfigGui -{ - public: - ConfigGuiOpie( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - TQLineEdit *mDeviceIP; - TQComboBox *mDeviceType; - TQLineEdit *mUserName; - TQLineEdit *mPassword; - TQComboBox *mConnectionType; - TQSpinBox *mPort; -}; - -#endif diff --git a/kitchensync/src/configguipalm.cpp b/kitchensync/src/configguipalm.cpp deleted file mode 100644 index ee85ba294..000000000 --- a/kitchensync/src/configguipalm.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <kcombobox.h> -#include <kdialog.h> -#include <klineedit.h> -#include <tdelocale.h> - -#include <tqbuttongroup.h> -#include <tqcheckbox.h> -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqradiobutton.h> -#include <tqspinbox.h> -#include <tqtabwidget.h> - -#include "configguipalm.h" - -ConfigGuiPalm::ConfigGuiPalm( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); - - mDevice->insertItem( "/dev/pilot" ); - mDevice->insertItem( "/dev/ttyUSB0" ); - mDevice->insertItem( "/dev/ttyUSB1" ); - mDevice->insertItem( "/dev/ttyUSB2" ); - mDevice->insertItem( "/dev/ttyUSB3" ); - - mSpeed->insertItem( "9600" ); - mSpeed->insertItem( "19200" ); - mSpeed->insertItem( "38400" ); - mSpeed->insertItem( "57600" ); - mSpeed->insertItem( "115200" ); -} - -void ConfigGuiPalm::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "sockaddr" ) { - mDevice->setCurrentText( element.text() ); - } else if ( element.tagName() == "speed" ) { - mSpeed->setCurrentText( element.text() ); - } else if ( element.tagName() == "timeout" ) { - mTimeout->setValue( element.text().toInt() ); - } else if ( element.tagName() == "username" ) { - mUserName->setText( element.text() ); - } else if ( element.tagName() == "mismatch" ) { - switch ( element.text().toInt() ) { - case 0: - mSyncAlways->setChecked( true ); - break; - case 2: - mSyncAbort->setChecked( true ); - break; - case 1: - default: - mSyncAsk->setChecked( true ); - break; - } - } else if ( element.tagName() == "popup" ) { - mPopup->setChecked( element.text() == "1" ); - } - } -} - -TQString ConfigGuiPalm::save() const -{ - TQString config = "<config>"; - - config += "<sockaddr>" + mDevice->currentText() + "</sockaddr>"; - config += "<username>" + mUserName->text() + "</username>"; - config += "<timeout>" + TQString::number( mTimeout->value() ) + "</timeout>"; - config += "<type>0</type>"; - config += "<speed>" + mSpeed->currentText() + "</speed>"; - config += "<id>0</id>"; - config += "<codepage>cp1252</codepage>"; - config += "<popup>" + TQString( mPopup->isChecked() ? "1" : "0" ) + "</popup>"; - - TQString popup; - if ( mSyncAlways->isChecked() ) - popup = "0"; - else if ( mSyncAsk->isChecked() ) - popup = "1"; - else if ( mSyncAbort->isChecked() ) - popup = "2"; - - config += "<mismatch>" + popup + "</mismatch>"; - - config += "</config>"; - - return config; -} - -void ConfigGuiPalm::initGUI() -{ - TQFont boldFont = font(); - boldFont.setBold( true ); - - TQTabWidget *tabWidget = new TQTabWidget( this ); - - TQWidget *connectionWidget = new TQWidget( tabWidget ); - TQVBoxLayout *connectionLayout = new TQVBoxLayout( connectionWidget, - KDialog::marginHint(), KDialog::spacingHint() ); - - TQLabel *label = new TQLabel( i18n( "Connection" ), connectionWidget ); - label->setFont( boldFont ); - connectionLayout->addWidget( label ); - - TQGridLayout *gridLayout = new TQGridLayout( connectionLayout, 3, 2, KDialog::spacingHint() ); - gridLayout->setMargin( KDialog::marginHint() ); - - gridLayout->addWidget( new TQLabel( i18n( "Port:" ), connectionWidget ), 0, 0 ); - gridLayout->addWidget( new TQLabel( i18n( "Speed:" ), connectionWidget ), 1, 0 ); - gridLayout->addWidget( new TQLabel( i18n( "Timeout:" ), connectionWidget ), 2, 0 ); - - mDevice = new KComboBox( true, connectionWidget ); - mSpeed = new KComboBox( connectionWidget ); - mTimeout = new TQSpinBox( 1, 60, 1, connectionWidget ); - mTimeout->setSuffix( i18n( " sec" ) ); - - gridLayout->addWidget( mDevice, 0, 1 ); - gridLayout->addWidget( mSpeed, 1, 1 ); - gridLayout->addWidget( mTimeout, 2, 1 ); - gridLayout->setColStretch( 1, 1 ); - - label = new TQLabel( i18n( "User" ), connectionWidget ); - label->setFont( boldFont ); - connectionLayout->addWidget( label ); - - gridLayout = new TQGridLayout( connectionLayout, 1, 2, KDialog::spacingHint() ); - gridLayout->setMargin( KDialog::marginHint() ); - - gridLayout->addWidget( new TQLabel( i18n( "Username:" ), connectionWidget ), 0, 0 ); - - mUserName = new KLineEdit( connectionWidget ); - gridLayout->addWidget( mUserName, 0, 1 ); - - label = new TQLabel( i18n( "What to do if Username does not match" ), connectionWidget ); - label->setFont( boldFont ); - connectionLayout->addWidget( label ); - - gridLayout = new TQGridLayout( connectionLayout, 1, 2, KDialog::spacingHint() ); - gridLayout->setMargin( KDialog::marginHint() ); - - TQButtonGroup *buttonGroup = new TQButtonGroup( 1, Qt::Horizontal, connectionWidget ); - buttonGroup->setExclusive( true ); - buttonGroup->setFrameStyle( TQFrame::NoFrame ); - mSyncAlways = new TQRadioButton( i18n( "Sync Anyway" ), buttonGroup ); - mSyncAsk = new TQRadioButton( i18n( "Ask What To Do" ), buttonGroup ); - mSyncAbort = new TQRadioButton( i18n( "Abort Sync" ), buttonGroup ); - - gridLayout->addMultiCellWidget( buttonGroup, 0, 0, 0, 1 ); - - connectionLayout->addStretch( 1 ); - tabWidget->addTab( connectionWidget, i18n( "Connection" ) ); - - TQWidget *optionWidget = new TQWidget( tabWidget ); - TQVBoxLayout *optionLayout = new TQVBoxLayout( optionWidget, - KDialog::marginHint(), KDialog::spacingHint() ); - - label = new TQLabel( i18n( "Hotsync Notification" ), optionWidget ); - label->setFont( boldFont ); - optionLayout->addWidget( label ); - - gridLayout = new TQGridLayout( optionLayout, 1, 2, KDialog::spacingHint() ); - gridLayout->setMargin( KDialog::marginHint() ); - - mPopup = new TQCheckBox( i18n( "Popup when interaction is required" ), optionWidget ); - gridLayout->addMultiCellWidget( mPopup, 0, 0, 0, 1 ); - - optionLayout->addStretch( 1 ); - tabWidget->addTab( optionWidget, i18n( "Options" ) ); - - topLayout()->addWidget( tabWidget ); -} diff --git a/kitchensync/src/configguipalm.h b/kitchensync/src/configguipalm.h deleted file mode 100644 index 354e5a29f..000000000 --- a/kitchensync/src/configguipalm.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 CONFIGGUIPALM_H -#define CONFIGGUIPALM_H - -#include "configgui.h" - -class KComboBox; -class KLineEdit; -class TQCheckBox; -class TQRadioButton; -class TQSpinBox; - -class ConfigGuiPalm : public ConfigGui -{ - public: - ConfigGuiPalm( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - void initGUI(); - - KComboBox *mDevice; - KComboBox *mSpeed; - TQSpinBox *mTimeout; - - KLineEdit *mUserName; - - TQRadioButton *mSyncAlways; - TQRadioButton *mSyncAsk; - TQRadioButton *mSyncAbort; - - TQCheckBox *mPopup; - KComboBox *mVerbosity; - KComboBox *mCodePage; -}; - -#endif diff --git a/kitchensync/src/configguisunbird.cpp b/kitchensync/src/configguisunbird.cpp deleted file mode 100644 index 7623e4132..000000000 --- a/kitchensync/src/configguisunbird.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 "configguisunbird.h" - -#include <tqdom.h> -#include <tqtabwidget.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqbuttongroup.h> -#include <tqcheckbox.h> -#include <tqsizepolicy.h> -#include <tqptrlist.h> -#include <tqspinbox.h> -#include <tqwidget.h> - -#include <kurlrequester.h> -#include <klineedit.h> -#include <kpushbutton.h> -#include <kdialog.h> -#include <tdelocale.h> -#include <tdefile.h> - -ConfigGuiSunbird::ConfigGuiSunbird( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - TQTabWidget *tabWidget = new TQTabWidget( this ); - topLayout()->addWidget( tabWidget ); - - mLocalWidget = new TQWidget( tabWidget ); - mLocalLayout = new TQVBoxLayout( mLocalWidget, KDialog::spacingHint() ); - - mWebdavWidget = new TQWidget( tabWidget ); - mWebdavLayout = new TQVBoxLayout( mWebdavWidget, KDialog::spacingHint() ); - - tabWidget->addTab( mLocalWidget, i18n( "Local Calendars" ) ); - tabWidget->addTab( mWebdavWidget, i18n( "WebDAV Calendars" ) ); - - KPushButton *mLocalAddButton = new KPushButton( mLocalWidget ); - mLocalAddButton->setText( i18n( "Add new calendar" ) ); - mLocalAddButton->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); - mLocalLayout->addWidget( mLocalAddButton ); - connect( mLocalAddButton, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( addLocalCalendar() ) ); - - KPushButton *mWebdavAddButton = new KPushButton( mWebdavWidget ); - mWebdavAddButton->setText( i18n( "Add new calendar" ) ); - mWebdavAddButton->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); - mWebdavLayout->addWidget( mWebdavAddButton ); - connect( mWebdavAddButton, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( addWebdavCalendar() ) ); - - mLocalSpacer = new TQSpacerItem( 20, 40, TQSizePolicy::Expanding ); - mLocalLayout->addItem( mLocalSpacer ); - mWebdavSpacer = new TQSpacerItem( 20, 40, TQSizePolicy::Expanding ); - mWebdavLayout->addItem( mWebdavSpacer ); -} - -void ConfigGuiSunbird::load( const TQString &xml ) -{ - TQString path; - TQString url; - TQString username; - TQString password; - TQString defaultcal; - TQString days; - - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "file" ) { - TQDomAttr pathAttr = element.attributeNode( "path" ); - path = pathAttr.value(); - TQDomAttr defaultAttr = element.attributeNode( "default" ); - defaultcal = defaultAttr.value(); - TQDomAttr daysAttr = element.attributeNode( "deletedaysold" ); - days = daysAttr.value(); - - LocalCalendar *cal = new LocalCalendar( path, defaultcal, days, mLocalWidget ); - mLocalLayout->removeItem( mLocalSpacer ); - cal->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); - mLocalLayout->addWidget( cal ); - mLocalLayout->addItem( mLocalSpacer ); - mLocalList.append( cal ); - - connect( cal, TQT_SIGNAL( deleteRequest( LocalCalendar* ) ), TQT_SLOT( delLocalCalendar( LocalCalendar* ) ) ); - cal->show(); - } else if ( element.tagName() == "webdav" ) { - TQDomAttr urlAttr = element.attributeNode( "url" ); - url = urlAttr.value(); - TQDomAttr unameAttr = element.attributeNode( "username" ); - username = unameAttr.value(); - TQDomAttr pwordAttr = element.attributeNode( "password" ); - password = pwordAttr.value(); - TQDomAttr defaultAttr = element.attributeNode( "default" ); - defaultcal = defaultAttr.value(); - TQDomAttr daysAttr = element.attributeNode( "deletedaysold" ); - days = daysAttr.value(); - - WebdavCalendar *cal = new WebdavCalendar( username, password, - url, defaultcal, days, mWebdavWidget ); - mWebdavLayout->removeItem( mWebdavSpacer ); - cal->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); - mWebdavLayout->addWidget( cal ); - mWebdavLayout->addItem( mWebdavSpacer ); - mWebdavList.append( cal ); - - connect( cal, TQT_SIGNAL( deleteRequest( WebdavCalendar* ) ), TQT_SLOT( delWebdavCalendar( WebdavCalendar* ) ) ); - cal->show(); - } - } -} - -TQString ConfigGuiSunbird::save() const -{ - TQString config = "<config>\n"; - - for ( uint i = 0; i < mLocalList.count(); ++i ) { - LocalCalendar *lcal = mLocalList[ i ]; - config += TQString( "<file " ); - config += TQString( "path=\"%1\" " ).arg( lcal->mPathRequester->url() ); - - if ( lcal->mDaysCheckBox->isChecked() ) { - config += TQString( "deletedaysold=\"%1\" " ).arg( lcal->mDaysSpinBox->value() ); - } - if ( lcal->mDefaultCheckBox->isChecked() ) { - config += TQString( "default=\"1\" " ); - } - config += TQString( "/>\n" ); - } - - for ( uint i = 0; i < mWebdavList.count(); ++i ) { - WebdavCalendar *wcal = mWebdavList[ i ]; - config += TQString( "<webdav " ); - config += TQString( "username=\"%1\" " ).arg( wcal->mUsername->text() ); - config += TQString( "password=\"%1\" " ).arg( wcal->mPassword->text() ); - config += TQString( "url=\"%1\" " ).arg( wcal->mUrl->text() ); - - if ( wcal->mDaysCheckBox->isChecked() ) { - config += TQString( "deletedaysold=\"%1\" " ).arg( wcal->mDaysSpinBox->value() ); - } - if ( wcal->mDefaultCheckBox->isChecked() ) { - config += TQString( "default=\"1\" " ); - } - config += TQString( "/>\n" ); - } - config += "</config>"; - - return config; -} - -void ConfigGuiSunbird::addLocalCalendar() -{ - LocalCalendar *cal = new LocalCalendar( mLocalWidget ); - mLocalLayout->removeItem( mLocalSpacer ); - cal->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); - mLocalLayout->addWidget( cal ); - mLocalLayout->addItem( mLocalSpacer ); - mLocalList.append( cal ); - - connect( cal, TQT_SIGNAL( deleteRequest( LocalCalendar* ) ), TQT_SLOT( delLocalCalendar( LocalCalendar* ) ) ); - cal->show(); -} - -void ConfigGuiSunbird::delLocalCalendar( LocalCalendar *calendar ) -{ - mLocalList.remove( calendar ); - calendar->deleteLater(); -} - -void ConfigGuiSunbird::addWebdavCalendar() -{ - WebdavCalendar *cal = new WebdavCalendar( mWebdavWidget ); - mWebdavLayout->removeItem( mWebdavSpacer ); - cal->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); - mWebdavLayout->addWidget( cal ); - mWebdavLayout->addItem( mWebdavSpacer ); - mWebdavList.append( cal ); - - connect( cal, TQT_SIGNAL( deleteRequest( WebdavCalendar* ) ), TQT_SLOT( delWebdavCalendar( WebdavCalendar* ) ) ); - cal->show(); -} - -void ConfigGuiSunbird::delWebdavCalendar( WebdavCalendar *calendar ) -{ - mWebdavList.remove( calendar ); - calendar->deleteLater(); -} - -LocalCalendar::LocalCalendar( TQWidget *parent ) - : TQWidget( parent ) -{ - initGui(); -} - -LocalCalendar::LocalCalendar( const TQString &path, const TQString &defaultcal, const TQString &days, TQWidget *parent ) - : TQWidget( parent ) -{ - initGui(); - - mPathRequester->setURL( path ); - mDefaultCheckBox->setChecked( defaultcal.toInt() == 1 ); - - if ( !days.isEmpty() ) { - mDaysCheckBox->setChecked( true ); - mDaysSpinBox->setEnabled( true ); - mDaysSpinBox->setValue( days.toInt() ); - } -} - -void LocalCalendar::initGui() -{ - TQBoxLayout *bottomLayout = new TQHBoxLayout(); - - mDaysCheckBox = new TQCheckBox( this ); - mDaysCheckBox->setText( i18n( "Sync only events newer than" ) ); - - mDaysSpinBox = new TQSpinBox( this ); - mDaysSpinBox->setDisabled( true ); - mDaysSpinBox->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); - - connect( mDaysCheckBox, TQT_SIGNAL( toggled( bool ) ), - this, TQT_SLOT( toggleDays( bool ) ) ); - - bottomLayout->addWidget( mDaysCheckBox ); - bottomLayout->addWidget( mDaysSpinBox ); - bottomLayout->addWidget( new TQLabel( i18n( "day(s)" ), this ) ); - - TQGridLayout *localLayout = new TQGridLayout( this ); - - mPathRequester = new KURLRequester( this ); - - KPushButton *removeButton = new KPushButton( this ); - removeButton->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); - removeButton->setText( i18n( "Remove" ) ); - connect( removeButton, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( deleteWidget() ) ); - - mDefaultCheckBox = new TQCheckBox( this ); - mDefaultCheckBox->setText( i18n( "Set as Default" ) ); - - localLayout->addItem( new TQSpacerItem( 40, 20, TQSizePolicy::Expanding ), 0, 0 ); - localLayout->addWidget( new TQLabel( i18n( "Location:" ), this ), 1, 0 ); - localLayout->addWidget( mPathRequester, 1, 1 ); - localLayout->addItem( new TQSpacerItem( 40, 20, TQSizePolicy::Fixed ), 1, 2 ); - localLayout->addWidget( removeButton, 1, 3 ); - localLayout->addMultiCellLayout( bottomLayout, 2, 2, 0, 2 ); - localLayout->addWidget( mDefaultCheckBox, 2, 3 ); -} - -void LocalCalendar::deleteWidget() -{ - emit deleteRequest( this ); -} - -WebdavCalendar::WebdavCalendar( TQWidget *parent ) - : TQWidget( parent ) -{ - initGui(); -}; - -WebdavCalendar::WebdavCalendar( const TQString &username, const TQString &password, const TQString &url, - const TQString &defaultcal, const TQString &days, TQWidget *parent ) - : TQWidget( parent ) -{ - initGui(); - - mUsername->setText( username ); - mPassword->setText( password ); - mUrl->setText( url ); - mDefaultCheckBox->setChecked( defaultcal.toInt() == 1 ); - - if ( !days.isEmpty() ) { - mDaysCheckBox->setChecked( true ); - mDaysSpinBox->setEnabled( true ); - mDaysSpinBox->setValue( days.toInt() ); - } -} - -void WebdavCalendar::initGui() -{ - TQBoxLayout *bottomLayout = new TQHBoxLayout(); - - mDaysCheckBox = new TQCheckBox( this ); - mDaysCheckBox->setText( i18n( "Sync only events newer than" ) ); - - mDaysSpinBox = new TQSpinBox( this ); - mDaysSpinBox->setDisabled( true ); - mDaysSpinBox->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); - - connect( mDaysCheckBox, TQT_SIGNAL( toggled( bool ) ), - this, TQT_SLOT( toggleDays( bool ) ) ); - - bottomLayout->addWidget( mDaysCheckBox ); - bottomLayout->addWidget( mDaysSpinBox ); - bottomLayout->addWidget( new TQLabel( i18n( "day(s)" ), this ) ); - - TQGridLayout *webdavLayout = new TQGridLayout(); - - mUrl = new KLineEdit( this ); - mUsername = new KLineEdit( this ); - mPassword = new KLineEdit( this ); - mPassword->setEchoMode( KLineEdit::Password ); - - KPushButton *removeButton = new KPushButton( this ); - removeButton->setText( i18n( "Remove" ) ); - connect( removeButton, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( deleteWidget() ) ); - - mDefaultCheckBox = new TQCheckBox( this ); - mDefaultCheckBox->setText( i18n( "Set as Default" ) ); - - webdavLayout->addWidget( new TQLabel( i18n( "Location:" ), this ), 0, 0 ); - webdavLayout->addWidget( mUrl, 0, 1 ); - webdavLayout->addItem( new TQSpacerItem( 40, 20, TQSizePolicy::Fixed ), 0, 2 ); - webdavLayout->addWidget( removeButton, 0, 3 ); - webdavLayout->addMultiCellLayout( bottomLayout, 1, 1, 0, 1 ); - webdavLayout->addWidget( mDefaultCheckBox, 1, 3 ); - - TQGridLayout *mainLayout = new TQGridLayout( this ); - mainLayout->addItem( new TQSpacerItem( 40, 20, TQSizePolicy::Fixed ), 0, 0 ); - mainLayout->addMultiCellLayout( webdavLayout, 1, 1, 0, 4 ); - mainLayout->addWidget( new TQLabel( i18n( "Username:" ), this ), 2, 0 ); - mainLayout->addWidget( mUsername, 2, 1 ); - mainLayout->addItem( new TQSpacerItem( 40, 20, TQSizePolicy::Fixed ), 2, 2 ); - mainLayout->addWidget( new TQLabel( i18n( "Password:" ), this ), 2, 3 ); - mainLayout->addWidget( mPassword, 2, 4 ); -} - -void WebdavCalendar::deleteWidget() -{ - emit deleteRequest( this ); -} - -void LocalCalendar::toggleDays( bool state ) -{ - mDaysSpinBox->setEnabled( state ); -} - -void WebdavCalendar::toggleDays( bool state ) -{ - mDaysSpinBox->setEnabled( state ); -} - -#include "configguisunbird.moc" diff --git a/kitchensync/src/configguisunbird.h b/kitchensync/src/configguisunbird.h deleted file mode 100644 index 67d61bf6c..000000000 --- a/kitchensync/src/configguisunbird.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 CONFIGGUISUNBIRD_H -#define CONFIGGUISUNBIRD_H - -#include "configgui.h" - -class TQWidget; -class TQSpinBox; -class TQCheckBox; -class TQVBoxLayout; -class TQSpacerItem; -class TQSignalMapper; - -class KURLRequester; -class KPushButton; -class KLineEdit; - -class LocalCalendar : public TQWidget -{ - Q_OBJECT - - - public: - LocalCalendar( TQWidget *parent = 0 ); - LocalCalendar( const TQString &path, - const TQString &defaultcal, - const TQString &days, TQWidget *parent = 0 ); - - KURLRequester *mPathRequester; - TQCheckBox *mDaysCheckBox; - TQSpinBox *mDaysSpinBox; - TQCheckBox *mDefaultCheckBox; - - signals: - void deleteRequest( LocalCalendar* ); - - private slots: - void deleteWidget(); - void toggleDays( bool days ); - - private: - void initGui(); -}; - -class WebdavCalendar : public TQWidget -{ - Q_OBJECT - - - public: - WebdavCalendar( TQWidget *parent = 0 ); - WebdavCalendar( const TQString &username, - const TQString &password, - const TQString &url, - const TQString &defaultcal, - const TQString &days, TQWidget *parent = 0 ); - - KLineEdit *mUrl; - TQCheckBox *mDaysCheckBox; - TQSpinBox *mDaysSpinBox; - TQCheckBox *mDefaultCheckBox; - KLineEdit *mUsername; - KLineEdit *mPassword; - - signals: - void deleteRequest( WebdavCalendar* ); - - private slots: - void deleteWidget(); - void toggleDays( bool state ); - - private: - void initGui(); -}; - -class ConfigGuiSunbird : public ConfigGui -{ - Q_OBJECT - - - public: - ConfigGuiSunbird( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - - TQString save() const; - - public slots: - void addLocalCalendar(); - void addWebdavCalendar(); - - void delLocalCalendar( LocalCalendar* ); - void delWebdavCalendar( WebdavCalendar* ); - - private: - TQValueList<LocalCalendar*> mLocalList; - TQValueList<WebdavCalendar*> mWebdavList; - - TQWidget *mLocalWidget; - TQWidget *mWebdavWidget; - - TQVBoxLayout *mLocalLayout; - TQVBoxLayout *mWebdavLayout; - - KPushButton *mLocalAddButton; - KPushButton *mWebdavAddButton; - - TQSpacerItem *mLocalSpacer; - TQSpacerItem *mWebdavSpacer; -}; - -#endif diff --git a/kitchensync/src/configguisynce.cpp b/kitchensync/src/configguisynce.cpp deleted file mode 100644 index 8a09c385a..000000000 --- a/kitchensync/src/configguisynce.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 "configguisynce.h" - -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqcheckbox.h> - -#include <klineedit.h> -#include <kdialog.h> -#include <tdelocale.h> - -ConfigGuiSynce::ConfigGuiSynce( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); -} - -void ConfigGuiSynce::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "contact" ) { - mContacts->setChecked( element.text().toInt() == 1 ); - } else if ( element.tagName() == "todos" ) { - mTodos->setChecked( element.text().toInt() == 1 ); - } else if ( element.tagName() == "calendar" ) { - mCalendar->setChecked( element.text().toInt() == 1 ); - } else if ( element.tagName() == "file" ) { - mFile->setText( element.text() ); - } - } -} - -TQString ConfigGuiSynce::save() const -{ - TQString config = "<config>\n"; - - config += TQString( "<contact>%1</contact>\n" ).arg( mContacts->isChecked() ? "1" : "0" ); - config += TQString( "<todos>%1</todos>\n" ).arg( mTodos->isChecked() ? "1" : "0" ); - config += TQString( "<calendar>%1</calendar>\n" ).arg( mCalendar->isChecked() ? "1" : "0" ); - config += TQString( "<file>%1</file>\n" ).arg( mFile->text() ); - - config += "</config>"; - - return config; -} - -void ConfigGuiSynce::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 2, KDialog::spacingHint() ); - layout->setMargin( KDialog::marginHint() ); - - mContacts = new TQCheckBox( this ); - mContacts->setText( "Sync Contacts" ); - layout->addMultiCellWidget( mContacts, 0, 0, 0, 1 ); - - mTodos = new TQCheckBox( this ); - mTodos->setText( "Sync \'Todo\' items" ); - layout->addMultiCellWidget( mTodos, 1, 1, 0, 1 ); - - mCalendar = new TQCheckBox( this ); - mCalendar->setText( "Sync Calendar" ); - layout->addMultiCellWidget( mCalendar, 2, 2, 0, 1 ); - - layout->addWidget( new TQLabel( i18n( "File:" ), this ), 3, 0 ); - mFile = new KLineEdit( this ); - layout->addWidget( mFile, 3, 1 ); -} diff --git a/kitchensync/src/configguisynce.h b/kitchensync/src/configguisynce.h deleted file mode 100644 index 680b1b128..000000000 --- a/kitchensync/src/configguisynce.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Anirudh Ramesh <abattoir@abattoir.in> - - 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. - - 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 CONFIGGUISYNCE_H -#define CONFIGGUISYNCE_H - -#include "configgui.h" - -class TQCheckBox; - -class KLineEdit; - -class ConfigGuiSynce : public ConfigGui -{ - public: - ConfigGuiSynce( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - - TQString save() const; - - private: - void initGUI(); - - TQCheckBox *mContacts; - TQCheckBox *mTodos; - TQCheckBox *mCalendar; - KLineEdit *mFile; -}; - -#endif diff --git a/kitchensync/src/configguisyncmlhttp.cpp b/kitchensync/src/configguisyncmlhttp.cpp deleted file mode 100644 index 6f91d2fad..000000000 --- a/kitchensync/src/configguisyncmlhttp.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "configguisyncmlhttp.h" - -#include <kcombobox.h> -#include <kdialog.h> -#include <klineedit.h> -#include <tdelocale.h> -#include <kurlrequester.h> - -#include <tqcheckbox.h> -#include <tqdom.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqspinbox.h> -#include <tqtabwidget.h> -#include <tqvbox.h> - -ConfigGuiSyncmlHttp::ConfigGuiSyncmlHttp( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ), mUrl( 0 ), mPort( 0 ) -{ - - TQTabWidget *tabWidget = new TQTabWidget( this ); - topLayout()->addWidget( tabWidget ); - - // Connection - TQWidget *connectionWidget = new TQWidget( tabWidget ); - TQVBoxLayout *connectionLayout = new TQVBoxLayout( connectionWidget, - KDialog::marginHint(), KDialog::spacingHint() ); - - tabWidget->addTab( connectionWidget, i18n( "Connection" ) ); - - mGridLayout = new TQGridLayout( connectionLayout ); - - TQLabel *label = new TQLabel( i18n("Port:"), connectionWidget ); - mGridLayout->addWidget( label, 0, 0 ); - - mPort = new TQSpinBox( connectionWidget ); - mPort->setMinValue( 1 ); - mPort->setMaxValue( 65536 ); - mGridLayout->addWidget( mPort, 0, 1 ); - - // Database - TQWidget *databaseWidget = new TQWidget( tabWidget ); - TQVBoxLayout *databaseLayout = new TQVBoxLayout( databaseWidget, - KDialog::marginHint(), KDialog::spacingHint() ); - - tabWidget->addTab( databaseWidget, i18n( "Databases" ) ); - - mGridLayout = new TQGridLayout( databaseLayout ); - addLineEdit( databaseWidget, i18n("Contact Database:"), &mContactDb, 0 ); - addLineEdit( databaseWidget, i18n("Calendar Database:"), &mCalendarDb, 1 ); - addLineEdit( databaseWidget, i18n("Note Database:"), &mNoteDb, 2 ); - - mContactDb->insertItem( "addressbook" ); - mContactDb->insertItem( "contacts" ); - - mCalendarDb->insertItem( "agenda" ); - mCalendarDb->insertItem( "calendar" ); - - mNoteDb->insertItem( "notes" ); - - - // Options - TQWidget *optionWidget = new TQWidget( tabWidget ); - TQVBoxLayout *optionLayout = new TQVBoxLayout( optionWidget, - KDialog::marginHint(), KDialog::spacingHint() ); - - tabWidget->addTab( optionWidget, i18n( "Options" ) ); - - mGridLayout = new TQGridLayout( optionLayout ); - - label = new TQLabel( i18n("User name:"), optionWidget ); - mGridLayout->addWidget( label, 0, 0 ); - - mUsername = new KLineEdit( optionWidget ); - mGridLayout->addWidget( mUsername, 0, 1 ); - - label = new TQLabel( i18n("Password:"), optionWidget ); - mGridLayout->addWidget( label, 1, 0 ); - - mPassword = new KLineEdit( optionWidget ); - mPassword->setEchoMode( TQLineEdit::Password ); - mGridLayout->addWidget( mPassword, 1, 1 ); - - - mUseStringTable = new TQCheckBox( i18n("Use String Table"), optionWidget ); - mGridLayout->addMultiCellWidget( mUseStringTable, 2, 2, 0, 1 ); - - mOnlyReplace = new TQCheckBox( i18n("Only Replace Entries"), optionWidget ); - mGridLayout->addMultiCellWidget( mOnlyReplace, 3, 3, 0, 1 ); - - // Url - label = new TQLabel( i18n("URL:"), optionWidget ); - mGridLayout->addWidget( label, 4, 0 ); - - mUrl = new KLineEdit( optionWidget ); - mGridLayout->addWidget( mUrl, 4, 1 ); - - // recvLimit - label = new TQLabel( i18n("Receive Limit:"), optionWidget ); - mGridLayout->addWidget( label, 5, 0 ); - - mRecvLimit = new TQSpinBox( optionWidget ); - mRecvLimit->setMinValue( 1 ); - mRecvLimit->setMaxValue( 65536 ); - mGridLayout->addWidget( mRecvLimit, 5, 1 ); - - // maxObjSize - label = new TQLabel( i18n("Maximum Object Size"), optionWidget ); - mGridLayout->addWidget( label, 6, 0 ); - - mMaxObjSize = new TQSpinBox( optionWidget ); - mMaxObjSize->setMinValue( 1 ); - mMaxObjSize->setMaxValue( 65536 ); - mGridLayout->addWidget( mMaxObjSize, 6, 1 ); - - topLayout()->addStretch( 1 ); -} - -void ConfigGuiSyncmlHttp::addLineEdit( TQWidget *parent, const TQString &text, KComboBox **edit, int row ) -{ - TQLabel *label = new TQLabel( text, parent); - mGridLayout->addWidget( label, row, 0 ); - - *edit = new KComboBox( true, parent ); - mGridLayout->addWidget( *edit, row, 1 ); -} - -void ConfigGuiSyncmlHttp::load( const TQString &xml ) -{ - TQDomDocument document; - document.setContent( xml ); - - TQDomElement docElement = document.documentElement(); - TQDomNode node; - - for ( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "username" ) { - mUsername->setText( element.text() ); - } else if ( element.tagName() == "password" ) { - mPassword->setText( element.text() ); - } else if ( element.tagName() == "url" ) { - if ( mUrl ) - mUrl->setText( element.text() ); - } else if ( element.tagName() == "port" ) { - if ( mPort ) - mPort->setValue( element.text().toInt() ); - } else if ( element.tagName() == "recvLimit" ) { - if ( mRecvLimit ) - mRecvLimit->setValue( element.text().toInt() ); - } else if ( element.tagName() == "maxObjSize" ) { - if ( mMaxObjSize ) - mMaxObjSize->setValue( element.text().toInt() ); - } else if ( element.tagName() == "usestringtable" ) { - mUseStringTable->setChecked( element.text() == "1" ); - } else if ( element.tagName() == "onlyreplace" ) { - mOnlyReplace->setChecked( element.text() == "1" ); - } else if ( element.tagName() == "contact_db" ) { - mContactDb->setCurrentText( element.text() ); - } else if ( element.tagName() == "calendar_db" ) { - mCalendarDb->setCurrentText( element.text() ); - } else if ( element.tagName() == "note_db" ) { - mNoteDb->setCurrentText( element.text() ); - } - } -} - -TQString ConfigGuiSyncmlHttp::save() const -{ - TQString xml; - xml = "<config>\n"; - xml += "<username>" + mUsername->text() + "</username>\n"; - xml += "<password>" + mPassword->text() + "</password>\n"; - - xml += "<url>" + mUrl->text() + "</url>\n"; - xml += "<port>" + TQString::number( mPort->value() ) + "</port>\n"; - // Receive Limit - xml += "<recvLimit>" + TQString::number( mRecvLimit->value() ) + "</recvLimit>\n"; - - // Maximal Object Size - xml += "<maxObjSize>" + TQString::number( mMaxObjSize->value() ) + "</maxObjSize>\n"; - - xml += "<usestringtable>"; - if ( mUseStringTable->isChecked() ) - xml += "1"; - else - xml += "0"; - xml += "</usestringtable>\n"; - - xml += "<onlyreplace>"; - if ( mOnlyReplace->isChecked() ) - xml += "1"; - else - xml += "0"; - xml += "</onlyreplace>\n"; - - xml += "<contact_db>" + mContactDb->currentText() + "</contact_db>\n"; - xml += "<calendar_db>" + mCalendarDb->currentText() + "</calendar_db>\n"; - xml += "<note_db>" + mNoteDb->currentText() + "</note_db>\n"; - xml += "</config>"; - - return xml; -} - -#include "configguisyncmlhttp.moc" - diff --git a/kitchensync/src/configguisyncmlhttp.h b/kitchensync/src/configguisyncmlhttp.h deleted file mode 100644 index aad3a9378..000000000 --- a/kitchensync/src/configguisyncmlhttp.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 CONFIGGUISYNCML_H -#define CONFIGGUISYNCML_H - -#include <tqdom.h> - -#include "configgui.h" - -class TQCheckBox; -class TQComboBox; -class TQGridLayout; -class TQSpinBox; -class KComboBox; -class KLineEdit; - -class ConfigGuiSyncmlHttp : public ConfigGui -{ - - Q_OBJECT - - - public: - ConfigGuiSyncmlHttp( const QSync::Member &, TQWidget *parent ); - - void load( const TQString &xml ); - TQString save() const; - - private: - TQGridLayout *mGridLayout; - - KLineEdit *mUsername; - KLineEdit *mPassword; - KLineEdit *mUrl; - TQSpinBox *mPort; - TQCheckBox *mUseStringTable; - TQCheckBox *mOnlyReplace; - - TQSpinBox *mRecvLimit; - TQSpinBox *mMaxObjSize; - - KComboBox *mContactDb; - KComboBox *mCalendarDb; - KComboBox *mNoteDb; - - protected slots: - void addLineEdit( TQWidget *parent, const TQString &text, KComboBox **edit, int row ); -}; - -#endif diff --git a/kitchensync/src/configguisyncmlobex.cpp b/kitchensync/src/configguisyncmlobex.cpp deleted file mode 100644 index 4074787ae..000000000 --- a/kitchensync/src/configguisyncmlobex.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - Copyright (c) 2006 Daniel Gollub <dgollub@suse.de> - - 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. - - 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 "configguisyncmlobex.h" - -#include <kcombobox.h> -#include <kdialog.h> -#include <klineedit.h> -#include <tdelocale.h> -#include <kurlrequester.h> - -#include <tqlayout.h> -#include <tqcheckbox.h> -#include <tqcombobox.h> -#include <tqlabel.h> -#include <tqdom.h> -#include <tqspinbox.h> -#include <tqtabwidget.h> -#include <tqvbox.h> - -ConfigGuiSyncmlObex::ConfigGuiSyncmlObex( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - TQTabWidget *tabWidget = new TQTabWidget( this ); - topLayout()->addWidget( tabWidget ); - - // Connection - TQVBox *connectionWidget = new TQVBox( this ); - connectionWidget->setMargin( KDialog::marginHint() ); - connectionWidget->setSpacing( 5 ); - - tabWidget->addTab( connectionWidget, i18n( "Connection" ) ); - - mConnection = new KComboBox( connectionWidget ); - - connect( mConnection, TQT_SIGNAL (activated( int ) ), - this, TQT_SLOT( slotConnectionChanged ( int ) ) ); - - mConnectionTypes.append( ConnectionType( 2, i18n( "Bluetooth" ) ) ); - mConnectionTypes.append( ConnectionType( 5, i18n( "USB" ) ) ); - - ConnectionTypeList::ConstIterator it; - for ( it = mConnectionTypes.begin(); it != mConnectionTypes.end(); it++ ) - mConnection->insertItem( (*it).second ); - - mBluetooth = new BluetoothWidget( connectionWidget ); - mBluetooth->hide(); - - mUsb = new UsbWidget( connectionWidget ); - mUsb->hide(); - - connectionWidget->setStretchFactor( mBluetooth, 1 ); - connectionWidget->setStretchFactor( mUsb, 1 ); - - // Databases - TQWidget *databaseWidget = new TQWidget( tabWidget ); - TQVBoxLayout *databaseLayout = new TQVBoxLayout( databaseWidget, - KDialog::marginHint(), KDialog::spacingHint() ); - - tabWidget->addTab( databaseWidget, i18n( "Databases" ) ); - - mGridLayout = new TQGridLayout( databaseLayout ); - addLineEdit( databaseWidget, i18n("Contact Database:"), &mContactDb, 0 ); - addLineEdit( databaseWidget, i18n("Calendar Database:"), &mCalendarDb, 1 ); - addLineEdit( databaseWidget, i18n("Note Database:"), &mNoteDb, 2 ); - - mContactDb->insertItem( "addressbook" ); - mContactDb->insertItem( "contacts" ); - - mCalendarDb->insertItem( "agenda" ); - mCalendarDb->insertItem( "calendar" ); - - mNoteDb->insertItem( "notes" ); - - // Options - TQWidget *optionsWidget = new TQWidget( tabWidget ); - TQVBoxLayout *optionsLayout = new TQVBoxLayout( optionsWidget, - KDialog::marginHint(), KDialog::spacingHint() ); - - tabWidget->addTab( optionsWidget, i18n( "Options" ) ); - - mGridLayout = new TQGridLayout( optionsLayout ); - - TQLabel *label = new TQLabel( i18n("User name:"), optionsWidget ); - mGridLayout->addWidget( label, 0, 0 ); - - mUsername = new KLineEdit( optionsWidget ); - mGridLayout->addWidget( mUsername, 0, 1 ); - - label = new TQLabel( i18n("Password:"), optionsWidget ); - mGridLayout->addWidget( label, 1, 0 ); - - mPassword = new KLineEdit( optionsWidget ); - mPassword->setEchoMode( TQLineEdit::Password ); - mGridLayout->addWidget( mPassword, 1, 1 ); - - mUseStringTable = new TQCheckBox( i18n("Use String Table"), optionsWidget ); - mGridLayout->addMultiCellWidget( mUseStringTable, 2, 2, 0, 1 ); - - mOnlyReplace = new TQCheckBox( i18n("Only Replace Entries"), optionsWidget ); - mGridLayout->addMultiCellWidget( mOnlyReplace, 3, 3, 0, 1 ); - - // SynML Version - label = new TQLabel( i18n("SyncML Version:"), optionsWidget ); - mGridLayout->addWidget( label, 4, 0 ); - - mSyncmlVersion = new TQComboBox( optionsWidget ); - mGridLayout->addWidget( mSyncmlVersion, 4, 1 ); - - mSyncmlVersions.append( SyncmlVersion( 0, i18n( "1.0" ) ) ); - mSyncmlVersions.append( SyncmlVersion( 1, i18n( "1.1" ) ) ); - mSyncmlVersions.append( SyncmlVersion( 2, i18n( "1.2" ) ) ); - - SyncmlVersionList::ConstIterator itVersion; - for ( itVersion = mSyncmlVersions.begin(); itVersion != mSyncmlVersions.end(); itVersion++ ) - mSyncmlVersion->insertItem( (*itVersion).second ); - - // WBXML - mWbxml = new TQCheckBox( i18n("WAP Binary XML"), optionsWidget ); - mGridLayout->addMultiCellWidget( mWbxml, 12, 12, 0, 1 ); - - // Identifier - label = new TQLabel( i18n("Software Identifier:"), optionsWidget ); - mGridLayout->addWidget( label, 13, 0 ); - - mIdentifier = new KComboBox( true, optionsWidget ); - mGridLayout->addWidget( mIdentifier, 13, 1 ); - - mIdentifier->insertItem( "" ); - mIdentifier->insertItem( "PC Suite" ); - - // recvLimit - label = new TQLabel( i18n("Receive Limit:"), optionsWidget ); - mGridLayout->addWidget( label, 14, 0 ); - - mRecvLimit = new TQSpinBox( optionsWidget ); - mRecvLimit->setMinValue( 1 ); - mRecvLimit->setMaxValue( 65536 ); - mGridLayout->addWidget( mRecvLimit, 14, 1 ); - - // maxObjSize - label = new TQLabel( i18n("Maximum Object Size"), optionsWidget ); - mGridLayout->addWidget( label, 15, 0 ); - - mMaxObjSize = new TQSpinBox( optionsWidget ); - mMaxObjSize->setMinValue( 1 ); - mMaxObjSize->setMaxValue( 65536 ); - mGridLayout->addWidget( mMaxObjSize, 15, 1 ); - - topLayout()->addStretch( 1 ); -} - -void ConfigGuiSyncmlObex::slotConnectionChanged( int pos ) -{ - mUsb->hide(); - mBluetooth->hide(); - - if ( pos == 0 ) - mBluetooth->show(); - else if ( pos == 1 ) - mUsb->show(); -} - -void ConfigGuiSyncmlObex::load( const TQString &xml ) -{ - TQDomDocument document; - document.setContent( xml ); - - TQDomElement docElement = document.documentElement(); - - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "username" ) { - mUsername->setText( element.text() ); - } else if ( element.tagName() == "password" ) { - mPassword->setText( element.text() ); - } else if ( element.tagName() == "type" ) { - for ( uint i = 0; i < mConnectionTypes.count(); i++ ) { - if ( mConnectionTypes[i].first == element.text().toInt() ) { - mConnection->setCurrentItem( i ); - slotConnectionChanged( i ); - break; - } - } - } else if ( element.tagName() == "version" ) { - for ( uint i = 0; i < mSyncmlVersions.count(); i++ ) { - if ( mSyncmlVersions[i].first == element.text().toInt() ) { - mSyncmlVersion->setCurrentItem( i ); - break; - } - } - } else if ( element.tagName() == "bluetooth_address" ) { - if ( mBluetooth ) mBluetooth->setAddress( element.text() ); - } else if ( element.tagName() == "bluetooth_channel" ) { - if ( mBluetooth ) mBluetooth->setChannel( element.text() ); - } else if ( element.tagName() == "identifier" ) { - if ( mIdentifier ) mIdentifier->setCurrentText( element.text() ); - } else if ( element.tagName() == "interface" ) { - if ( mUsb ) mUsb->setInterface( element.text().toInt() ); - } else if ( element.tagName() == "wbxml" ) { - if ( mWbxml) mWbxml->setChecked( element.text() == "1" ); - } else if ( element.tagName() == "recvLimit" ) { - if ( mRecvLimit ) mRecvLimit->setValue( element.text().toInt() ); - } else if ( element.tagName() == "maxObjSize" ) { - if ( mMaxObjSize ) mMaxObjSize->setValue( element.text().toInt() ); - } else if ( element.tagName() == "usestringtable" ) { - mUseStringTable->setChecked( element.text() == "1" ); - } else if ( element.tagName() == "onlyreplace" ) { - mOnlyReplace->setChecked( element.text() == "1" ); - } else if ( element.tagName() == "contact_db" ) { - mContactDb->setCurrentText( element.text() ); - } else if ( element.tagName() == "calendar_db" ) { - mCalendarDb->setCurrentText( element.text() ); - } else if ( element.tagName() == "note_db" ) { - mNoteDb->setCurrentText( element.text() ); - } - } -} - -TQString ConfigGuiSyncmlObex::save() const -{ - TQString xml; - xml = "<config>\n"; - xml += "<username>" + mUsername->text() + "</username>\n"; - xml += "<password>" + mPassword->text() + "</password>\n"; - ConnectionTypeList::ConstIterator it; - for ( it = mConnectionTypes.begin(); it != mConnectionTypes.end(); it++ ) { - if ( mConnection->currentText() == (*it).second ) { - xml += "<type>" + TQString("%1").arg((*it).first) + "</type>\n"; - break; - } - } - - // Bluetooth Address - xml += "<bluetooth_address>" + mBluetooth->address() + "</bluetooth_address>\n"; - - // Bluetooth Channel - xml += "<bluetooth_channel>" + mBluetooth->channel() + "</bluetooth_channel>\n"; - - // USB Interface - xml += "<interface>" + TQString::number( mUsb->interface() ) +"</interface>\n"; - - // SyncML Version - SyncmlVersionList::ConstIterator itVersion; - for ( itVersion = mSyncmlVersions.begin(); itVersion != mSyncmlVersions.end(); itVersion++ ) { - if ( mSyncmlVersion->currentText() == (*itVersion).second ) { - xml += "<version>" + TQString("%1").arg((*itVersion).first) + "</version>\n"; - break; - } - } - - // (Software) Identifier - xml += "<identifier>" + mIdentifier->currentText() + "</identifier>\n"; - - // WBXML - xml += "<wbxml>"; - if ( mWbxml->isChecked() ) - xml += "1"; - else - xml += "0"; - xml += "</wbxml>\n"; - - // Receive Limit - xml += "<recvLimit>" + TQString::number( mRecvLimit->value() ) + "</recvLimit>\n"; - - // Maximal Object Size - xml += "<maxObjSize>" + TQString::number( mMaxObjSize->value() ) + "</maxObjSize>\n"; - - xml += "<usestringtable>"; - if ( mUseStringTable->isChecked() ) - xml += "1"; - else - xml += "0"; - xml += "</usestringtable>\n"; - - xml += "<onlyreplace>"; - if ( mOnlyReplace->isChecked() ) - xml += "1"; - else - xml += "0"; - xml += "</onlyreplace>\n"; - - xml += "<contact_db>" + mContactDb->currentText() + "</contact_db>\n"; - xml += "<calendar_db>" + mCalendarDb->currentText() + "</calendar_db>\n"; - xml += "<note_db>" + mNoteDb->currentText() + "</note_db>\n"; - xml += "</config>"; - - return xml; -} - -void ConfigGuiSyncmlObex::addLineEdit( TQWidget *parent, const TQString &text, KComboBox **edit, int row ) -{ - TQLabel *label = new TQLabel( text, parent ); - mGridLayout->addWidget( label, row, 0 ); - - *edit = new KComboBox( true, parent ); - mGridLayout->addWidget( *edit, row, 1 ); -} - -#include "configguisyncmlobex.moc" diff --git a/kitchensync/src/configguisyncmlobex.h b/kitchensync/src/configguisyncmlobex.h deleted file mode 100644 index 9c873db8d..000000000 --- a/kitchensync/src/configguisyncmlobex.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - Copyright (c) 2006 Daniel Gollub <dgollub@suse.de> - - 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. - - 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 CONFIGGUISYNCMLOBEX_H -#define CONFIGGUISYNCMLOBEX_H - -#include <tqdom.h> - -#include "configgui.h" -#include "connectionwidgets.h" - -class TQCheckBox; -class TQComboBox; -class TQGridLayout; -class TQSpinBox; -class KComboBox; -class KLineEdit; -class KURLRequester; - -class ConfigGuiSyncmlObex : public ConfigGui -{ - Q_OBJECT - - - public: - ConfigGuiSyncmlObex( const QSync::Member &, TQWidget *parent = 0 ); - - void load( const TQString &xml ); - TQString save() const; - - public slots: - void slotConnectionChanged( int pos ); - - private: - // Connection - typedef TQPair<int, TQString> ConnectionType; - typedef TQValueList<ConnectionType> ConnectionTypeList; - ConnectionTypeList mConnectionTypes; - - TQComboBox *mConnection; - BluetoothWidget *mBluetooth; - UsbWidget *mUsb; - - // Options - typedef TQPair<int, TQString> SyncmlVersion; - typedef TQValueList<SyncmlVersion> SyncmlVersionList; - SyncmlVersionList mSyncmlVersions; - - TQStringList mIdentiferList; - KLineEdit *mUsername; - KLineEdit *mPassword; - TQCheckBox *mUseStringTable; - TQCheckBox *mOnlyReplace; - TQSpinBox *mRecvLimit; - TQSpinBox *mMaxObjSize; - TQComboBox *mSyncmlVersion; - KComboBox *mIdentifier; - TQCheckBox *mWbxml; - - TQGridLayout *mGridLayout; - - KComboBox *mContactDb; - KComboBox *mCalendarDb; - KComboBox *mNoteDb; - - protected slots: - void addLineEdit( TQWidget *parent, const TQString &text, KComboBox **edit, int row ); -}; - -#endif diff --git a/kitchensync/src/conflictdialog.cpp b/kitchensync/src/conflictdialog.cpp deleted file mode 100644 index 39943ffe4..000000000 --- a/kitchensync/src/conflictdialog.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 "conflictdialog.h" - -ConflictDialog::ConflictDialog( QSync::SyncMapping &mapping, TQWidget *parent ) - : TQDialog( parent ), mMapping( mapping ) -{ -} diff --git a/kitchensync/src/conflictdialog.h b/kitchensync/src/conflictdialog.h deleted file mode 100644 index 2e48c0390..000000000 --- a/kitchensync/src/conflictdialog.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 CONFLICTDIALOG_H -#define CONFLICTDIALOG_H - -#include <tqdialog.h> - -#include <libqopensync/syncmapping.h> - -/** - Base class for SingleConflictDialog and MultiConflictDialog. - */ -class ConflictDialog : public TQDialog -{ - public: - ConflictDialog( QSync::SyncMapping &mapping, TQWidget *parent ); - - protected: - QSync::SyncMapping mMapping; -}; - -#endif diff --git a/kitchensync/src/connectionwidgets.cpp b/kitchensync/src/connectionwidgets.cpp deleted file mode 100644 index 37844be3d..000000000 --- a/kitchensync/src/connectionwidgets.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2006 Daniel Gollub <dgollub@suse.de> - - 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. - - 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 <kcombobox.h> -#include <kdialog.h> -#include <tdeglobal.h> -#include <kiconloader.h> -#include <kinputdialog.h> -#include <klineedit.h> -#include <tdelocale.h> -#include <tdemessagebox.h> - -#include <tqapplication.h> -#include <tqeventloop.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpushbutton.h> -#include <tqspinbox.h> -#include <tqtabwidget.h> -#include <tqtooltip.h> -#include <tqvbox.h> - -#include "connectionwidgets.h" - -BluetoothWidget::BluetoothWidget( TQWidget *parent ) - : TQWidget( parent ) -{ - TQGridLayout *layout = new TQGridLayout( this ); - - mAddress = new KLineEdit( this ); - mAddress->setInputMask( ">NN:NN:NN:NN:NN:NN;" ); - layout->addWidget( mAddress, 1, 0 ); - - TQLabel *label = new TQLabel( i18n( "Bluetooth address:" ), this ); - label->setBuddy( mAddress ); - layout->addWidget( label, 0, 0 ); - - mChannel = new KLineEdit( this ); - layout->addWidget( mChannel, 1, 1 ); - - mChannelLabel = new TQLabel( i18n( "Channel:" ), this ); - mChannelLabel->setBuddy( mChannel ); - layout->addWidget( mChannelLabel, 0, 1 ); - - layout->setRowStretch( 2, 1 ); -} - -void BluetoothWidget::hideChannel() -{ - mChannelLabel->hide(); - mChannel->hide(); -} - -void BluetoothWidget::showChannel() -{ - mChannelLabel->show(); - mChannel->show(); -} - -void BluetoothWidget::setAddress( const TQString address ) -{ - mAddress->setText( address ); -} - -void BluetoothWidget::setChannel( const TQString channel ) -{ - if ( mChannel ) - mChannel->setText( channel ); -} - -TQString BluetoothWidget::address() const -{ - return mAddress->text(); -} - -TQString BluetoothWidget::channel() const -{ - if ( mChannel->text().isEmpty() ) - return TQString(); - - return mChannel->text(); -} - -// FIXME - Only IrMC specific -IRWidget::IRWidget( TQWidget *parent ) - : TQWidget( parent ) -{ - TQGridLayout *layout = new TQGridLayout( this, 3, 3, 11, 3 ); - - mDevice = new KLineEdit( this ); - mSerialNumber = new KLineEdit( this ); - - layout->addWidget( mDevice, 1, 0 ); - layout->addWidget( mSerialNumber, 1, 1 ); - - TQLabel *label = new TQLabel( i18n( "Device Name:" ), this ); - label->setBuddy( mDevice ); - layout->addWidget( label, 0, 0 ); - - label = new TQLabel( i18n( "Serial Number:" ), this ); - label->setBuddy( mSerialNumber ); - layout->addWidget( label, 0, 1 ); - - layout->setRowStretch( 2, 1 ); -} - -void IRWidget::load( const TQDomElement &parent ) -{ - TQDomNode node; - for ( node = parent.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "irname" ) - mDevice->setText( element.text() ); - else if ( element.tagName() == "irserial" ) - mSerialNumber->setText( element.text() ); - } -} - -void IRWidget::save( TQDomDocument &doc, TQDomElement &parent ) -{ - TQDomElement element = doc.createElement( "irname" ); - element.appendChild( doc.createTextNode( mDevice->text() ) ); - parent.appendChild( element ); - - element = doc.createElement( "irserial" ); - element.appendChild( doc.createTextNode( mSerialNumber->text() ) ); - parent.appendChild( element ); -} - -// FIXME - Only IrMC specific -CableWidget::CableWidget( TQWidget *parent ) - : TQWidget( parent ) -{ - TQGridLayout *layout = new TQGridLayout( this, 3, 2, 11, 3 ); - - mManufacturer = new KComboBox( this ); - mDevice = new KComboBox( true, this ); - - layout->addWidget( mManufacturer, 0, 1 ); - layout->addWidget( mDevice, 1, 1 ); - - TQLabel *label = new TQLabel( i18n( "Device Manufacturer:" ), this ); - label->setBuddy( mManufacturer ); - layout->addWidget( label, 0, 0 ); - - label = new TQLabel( i18n( "Device:" ), this ); - label->setBuddy( mDevice ); - layout->addWidget( label, 1, 0 ); - - layout->setRowStretch( 2, 1 ); - - mManufacturer->insertItem( i18n( "SonyEricsson/Ericsson" ) ); - mManufacturer->insertItem( i18n( "Siemens" ) ); - - mDevice->insertItem( "/dev/ttyS0" ); - mDevice->insertItem( "/dev/ttyS1" ); - mDevice->insertItem( "/dev/ttyUSB0" ); - mDevice->insertItem( "/dev/ttyUSB1" ); -} - -void CableWidget::load( const TQDomElement &parent ) -{ - TQDomNode node; - for ( node = parent.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "cabletype" ) - mManufacturer->setCurrentItem( element.text().toInt() ); - else if ( element.tagName() == "cabledev" ) - mDevice->setCurrentText( element.text() ); - } -} - -void CableWidget::save( TQDomDocument &doc, TQDomElement &parent ) -{ - TQDomElement element = doc.createElement( "cabletype" ); - element.appendChild( doc.createTextNode( TQString::number( mManufacturer->currentItem() ) ) ); - parent.appendChild( element ); - - element = doc.createElement( "cabledev" ); - element.appendChild( doc.createTextNode( mDevice->currentText() ) ); - parent.appendChild( element ); -} - -UsbWidget::UsbWidget( TQWidget *parent ) - : TQWidget( parent ) -{ - TQGridLayout *layout = new TQGridLayout( this, 3, 2, 11, 3); - - mInterface = new TQSpinBox( this ); - layout->addWidget( mInterface, 0, 1 ); - - TQLabel *label = new TQLabel( i18n( "USB Interface:" ), this ); - label->setBuddy( mInterface ); - layout->addWidget( label, 0, 0 ); - - layout->setRowStretch( 2, 1 ); -} - -void UsbWidget::setInterface( int interface ) -{ - mInterface->setValue( interface ); -} - -int UsbWidget::interface() const -{ - return mInterface->value(); -} - -#include "connectionwidgets.moc" diff --git a/kitchensync/src/connectionwidgets.h b/kitchensync/src/connectionwidgets.h deleted file mode 100644 index 4f51c168b..000000000 --- a/kitchensync/src/connectionwidgets.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2006 Daniel Gollub <dgollub@suse.de> - - 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. - - 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 CONNECTIONWIDGETS_H -#define CONNECTIONWIDGETS_H - -#include <tqdom.h> - -#include "configgui.h" - -class TQCheckBox; -class TQLabel; -class TQPushButton; -class TQSpinBox; - -class KComboBox; -class KLineEdit; - -class BluetoothWidget : public TQWidget -{ - Q_OBJECT - - - public: - BluetoothWidget( TQWidget *parent ); - - void hideChannel(); - void showChannel(); - - void setAddress( const TQString address ); - void setChannel( const TQString channel ); - TQString address() const; - TQString channel() const; - - private: - KLineEdit *mAddress; - KLineEdit *mChannel; - TQLabel *mChannelLabel; -}; - -class IRWidget : public TQWidget -{ - Q_OBJECT - - - public: - IRWidget( TQWidget *parent ); - - void load( const TQDomElement& ); - void save( TQDomDocument&, TQDomElement& ); - - private: - KLineEdit *mDevice; - KLineEdit *mSerialNumber; -}; - -class CableWidget : public TQWidget -{ - public: - CableWidget( TQWidget *parent ); - - void load( const TQDomElement& ); - void save( TQDomDocument&, TQDomElement& ); - - private: - KComboBox *mManufacturer; - KComboBox *mDevice; -}; - -class UsbWidget : public TQWidget -{ - public: - UsbWidget( TQWidget *parent ); - - int interface() const; - void setInterface( int interface ); - - private: - TQSpinBox *mInterface; -}; - -#endif // CONNECTIONWIDGETS_H diff --git a/kitchensync/src/genericdiffalgo.cpp b/kitchensync/src/genericdiffalgo.cpp deleted file mode 100644 index 5255c0968..000000000 --- a/kitchensync/src/genericdiffalgo.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - This file is part of libtdepim. - - Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> - - 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 <tqstringlist.h> - -#include <tdelocale.h> - -#include "genericdiffalgo.h" - -using namespace KSync; - -#define MAX( a, b ) ( a > b ? a : b ) - -#ifndef KDE_USE_FINAL -// With --enable-final, we get the (identical) compareString from -// addresseediffalgo.cpp -static bool compareString( const TQString &left, const TQString &right ) -{ - if ( left.isEmpty() && right.isEmpty() ) - return true; - else - return left == right; -} -#endif - -GenericDiffAlgo::GenericDiffAlgo( const TQString &leftData, const TQString &rightData ) - : mLeftData( leftData ), mRightData( rightData ) -{ -} - -void GenericDiffAlgo::run() -{ - begin(); - - TQStringList leftList = TQStringList::split( '\n', mLeftData, true ); - TQStringList rightList = TQStringList::split( '\n', mRightData, true ); - - uint lines = MAX( leftList.count(), rightList.count() ); - for ( uint i = 0; i < lines; ++i ) { - if ( i < leftList.count() && i < rightList.count() ) { - if ( !compareString( leftList[ i ], rightList[ i ] ) ) - conflictField( i18n( "Line %1" ).arg( i ), leftList[ i ], rightList[ i ] ); - } else if ( i < leftList.count() && i >= rightList.count() ) { - additionalLeftField( i18n( "Line %1" ).arg( i ), leftList[ i ] ); - } else if ( i >= leftList.count() && i < rightList.count() ) { - additionalRightField( i18n( "Line %1" ).arg( i ), rightList[ i ] ); - } - } - - end(); -} - diff --git a/kitchensync/src/genericdiffalgo.h b/kitchensync/src/genericdiffalgo.h deleted file mode 100644 index 424d9c4fd..000000000 --- a/kitchensync/src/genericdiffalgo.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of libtdepim. - - Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> - - 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 KSYNC_GENERICDIFFALGO_H -#define KSYNC_GENERICDIFFALGO_H - -#include <libtdepim/diffalgo.h> - -using namespace KPIM; - -namespace KSync { - -class GenericDiffAlgo : public DiffAlgo -{ - public: - GenericDiffAlgo( const TQString &left, const TQString &right ); - - void run(); - - private: - TQString mLeftData; - TQString mRightData; -}; - -} - -#endif diff --git a/kitchensync/src/groupconfig.cpp b/kitchensync/src/groupconfig.cpp deleted file mode 100644 index 9f961ddc1..000000000 --- a/kitchensync/src/groupconfig.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "groupconfig.h" - -#include "groupconfigcommon.h" -#include "memberconfig.h" -#include "memberinfo.h" -#include "pluginpicker.h" -#include "syncprocess.h" -#include "syncprocessmanager.h" - -#include <libqopensync/group.h> -#include <libqopensync/plugin.h> - -#include <kdialog.h> -#include <kiconloader.h> -#include <kjanuswidget.h> -#include <tdelocale.h> -#include <tdemessagebox.h> - - -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpushbutton.h> - -GroupConfig::GroupConfig( TQWidget *parent ) - : TQWidget( parent ) -{ - TQBoxLayout *topLayout = new TQVBoxLayout( this ); - topLayout->setSpacing( KDialog::spacingHint() ); - - TQFrame *titleFrame = new TQFrame( this ); - topLayout->addWidget( titleFrame ); - - titleFrame->setPaletteForegroundColor( colorGroup().light() ); - titleFrame->setPaletteBackgroundColor( colorGroup().mid() ); - - TQBoxLayout *nameLayout = new TQHBoxLayout( titleFrame ); - nameLayout->setMargin( 4 ); - - TQPixmap icon = TDEGlobal::iconLoader()->loadIcon( "kontact_summary", - TDEIcon::Desktop ); - - TQLabel *iconLabel = new TQLabel( titleFrame ); - iconLabel->setPixmap( icon ); - nameLayout->addWidget( iconLabel ); - - nameLayout->addSpacing( 8 ); - - TQLabel *label = new TQLabel( i18n("Group:"), titleFrame ); - TQFont font = label->font(); - font.setBold( true ); - font.setPointSize( font.pointSize() + 2 ); - label->setFont( font ); - nameLayout->addWidget( label ); - - mNameLabel = new TQLabel( titleFrame ); - font = mNameLabel->font(); - font.setBold( true ); - font.setPointSize( font.pointSize() + 2 ); - mNameLabel->setFont( font ); - nameLayout->addWidget( mNameLabel ); - - nameLayout->addStretch( 1 ); - - mMemberView = new KJanusWidget( this, 0, KJanusWidget::IconList ); - topLayout->addWidget( mMemberView ); - - TQBoxLayout *buttonLayout = new TQHBoxLayout( topLayout ); - - TQPushButton *addButton = new TQPushButton( i18n("Add Member..."), this ); - connect( addButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addMember() ) ); - buttonLayout->addWidget( addButton ); - - buttonLayout->addStretch( 1 ); - - icon = TDEGlobal::iconLoader()->loadIcon( "bookmark", TDEIcon::Desktop ); - TQFrame *page = mMemberView->addPage( i18n("Group"), - i18n("General Group Settings"), icon ); - TQBoxLayout *pageLayout = new TQVBoxLayout( page ); - - mCommonConfig = new GroupConfigCommon( page ); - pageLayout->addWidget( mCommonConfig ); -} - -void GroupConfig::setSyncProcess( SyncProcess *process ) -{ - mProcess = process; - - mNameLabel->setText( mProcess->group().name() ); - mCommonConfig->setSyncProcess( mProcess ); - - updateMembers(); -} - -void GroupConfig::updateMembers() -{ - TQValueList<MemberConfig *>::ConstIterator memberIt; - for ( memberIt = mMemberConfigs.begin(); memberIt != mMemberConfigs.end(); ++memberIt ) - (*memberIt)->saveData(); - - TQValueList<TQFrame *>::ConstIterator it2; - for ( it2 = mConfigPages.begin(); it2 != mConfigPages.end(); ++it2 ) { - mMemberView->removePage( *it2 ); - delete *it2; - } - mConfigPages.clear(); - mMemberConfigs.clear(); - - QSync::Group group = mProcess->group(); - QSync::Group::Iterator it( group.begin() ); - for ( ; it != group.end(); ++it ) { - QSync::Member member = *it; - MemberInfo mi( member ); - TQFrame *page = mMemberView->addPage( mi.name(), - TQString( "%1 (%2)" ).arg( mi.name() ).arg(member.pluginName()), mi.desktopIcon() ); - - TQBoxLayout *pageLayout = new TQVBoxLayout( page ); - mConfigPages.append( page ); - - MemberConfig *memberConfig = new MemberConfig( page, member ); - mMemberConfigs.append( memberConfig ); - pageLayout->addWidget( memberConfig ); - - memberConfig->loadData(); - } -} - -void GroupConfig::saveConfig() -{ - mProcess->group().save(); - - TQValueList<MemberConfig *>::ConstIterator it; - for ( it = mMemberConfigs.begin(); it != mMemberConfigs.end(); ++it ) - (*it)->saveData(); - - mCommonConfig->save(); - - mProcess->reinitEngine(); -} - -void GroupConfig::addMember() -{ - QSync::Plugin plugin = PluginPickerDialog::getPlugin( this ); - - if ( plugin.isValid() ) { - QSync::Result result = SyncProcessManager::self()->addMember( mProcess, plugin ); - if ( result.isError() ) { - KMessageBox::error( this, i18n("Error adding member %1\n%2\nType: %3") - .arg( plugin.name() ).arg( result.message() ).arg( result.type() ) ); - } else { - updateMembers(); - - // select last (added) page - int index = mMemberView->pageIndex( mConfigPages.last() ); - mMemberView->showPage( index ); - } - } -} - -#include "groupconfig.moc" diff --git a/kitchensync/src/groupconfig.h b/kitchensync/src/groupconfig.h deleted file mode 100644 index 6cf6da2e8..000000000 --- a/kitchensync/src/groupconfig.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 GROUPCONFIG_H -#define GROUPCONFIG_H - -#include <tqwidget.h> -#include <tqvaluelist.h> - -class TQFrame; -class TQLabel; -class KJanusWidget; - -class GroupConfigCommon; -class MemberConfig; -class SyncProcess; - -class GroupConfig : public TQWidget -{ - Q_OBJECT - - - public: - GroupConfig( TQWidget *parent ); - - void setSyncProcess( SyncProcess *process ); - - void updateMembers(); - - void saveConfig(); - - protected slots: - void addMember(); - - private: - TQLabel *mNameLabel; - - KJanusWidget *mMemberView; - - SyncProcess *mProcess; - - GroupConfigCommon *mCommonConfig; - TQValueList<MemberConfig *> mMemberConfigs; - TQValueList<TQFrame *> mConfigPages; -}; - -#endif diff --git a/kitchensync/src/groupconfigcommon.cpp b/kitchensync/src/groupconfigcommon.cpp deleted file mode 100644 index a3f898449..000000000 --- a/kitchensync/src/groupconfigcommon.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 <kdialog.h> -#include <klineedit.h> -#include <tdelocale.h> -#include <kdebug.h> - -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqcheckbox.h> - -#include <libqopensync/group.h> -#include <libqopensync/conversion.h> -#include <libqopensync/environment.h> - -#include "syncprocess.h" -#include "syncprocessmanager.h" - -#include "groupconfigcommon.h" - -ObjectTypeSelector::ObjectTypeSelector( TQWidget *parent ) - : TQWidget( parent ) -{ - TQGridLayout *layout = new TQGridLayout( this ); - layout->setMargin( 0 ); - - const QSync::Conversion conversion = SyncProcessManager::self()->environment()->conversion(); - - TQMap<TQString, TQString> objectTypeMap; - objectTypeMap.insert( "contact", i18n( "Contacts" ) ); - objectTypeMap.insert( "event", i18n( "Events" ) ); - objectTypeMap.insert( "todo", i18n( "To-dos" ) ); - objectTypeMap.insert( "note", i18n( "Notes" ) ); - - TQStringList objectTypes = conversion.objectTypes(); - - // reorder the entries so that contact and event are the first one - qHeapSort( objectTypes ); - - TQStringList reoderedObjectTypes, stack; - for ( uint i = 0; i < objectTypes.count(); ++i ) { - if ( objectTypes[ i ] == "contact" || objectTypes[ i ] == "event" ) - reoderedObjectTypes.append( objectTypes[ i ] ); - else - stack.append( objectTypes[ i ] ); - } - reoderedObjectTypes += stack; - - TQStringList::ConstIterator it; - - int row = 0; - int col = 0; - for( it = reoderedObjectTypes.begin(); it != reoderedObjectTypes.end(); ++it ) { - TQString objectType = *it; - - // Don't display object type "data". Object type "data" is a kind of wildcard - so don't filter * - if ( objectType == "data" ) - continue; - - TQCheckBox *objectCheckBox = new TQCheckBox( objectTypeMap[ objectType ], this ); - layout->addWidget( objectCheckBox, row, col ); - mObjectTypeChecks.insert( objectType, objectCheckBox ); - - col++; - if ( (row == 0 && col == 2) || col == 3 ) { - col = 0; - row++; - } - } -} - -void ObjectTypeSelector::load( const QSync::Group &group ) -{ - const QSync::GroupConfig config = group.config(); - - const TQStringList objectTypes = config.activeObjectTypes(); - - // Enable everything on the inital load - bool initialLoad = false; - if ( objectTypes.isEmpty() ) - initialLoad = true; - - TQMap<TQString, TQCheckBox*>::ConstIterator it; - for( it = mObjectTypeChecks.begin(); it != mObjectTypeChecks.end(); ++it ) { - TQCheckBox *check = it.data(); - check->setChecked( objectTypes.contains( it.key() ) || initialLoad ); - } -} - -void ObjectTypeSelector::save( QSync::Group group ) -{ - TQStringList objectTypes; - - TQMap<TQString,TQCheckBox *>::ConstIterator it; - for( it = mObjectTypeChecks.begin(); it != mObjectTypeChecks.end(); ++it ) { - TQCheckBox *check = it.data(); - if ( check->isChecked() ) - objectTypes.append( it.key() ); - } - - // Always add object type "data" - objectTypes.append( "data" ); - - QSync::GroupConfig config = group.config(); - config.setActiveObjectTypes( objectTypes ); -} - -GroupConfigCommon::GroupConfigCommon( TQWidget *parent ) - : TQWidget( parent ) -{ - TQGridLayout *layout = new TQGridLayout( this, 2, 2, KDialog::marginHint(), KDialog::spacingHint() ); - - layout->addWidget( new TQLabel( i18n( "Name:" ), this ), 0, 0 ); - - mGroupName = new KLineEdit( this ); - layout->addWidget( mGroupName, 0, 1 ); - - layout->addWidget( new TQLabel( i18n( "Object Types to be Synchronized:"), this ), 1, 0, TQt::AlignTop ); - - mObjectTypeSelector = new ObjectTypeSelector( this ); - layout->addWidget( mObjectTypeSelector, 1, 1 ); - - layout->setRowStretch( 2, 1 ); -} - -void GroupConfigCommon::setSyncProcess( SyncProcess *syncProcess ) -{ - mSyncProcess = syncProcess; - - mGroupName->setText( mSyncProcess->group().name() ); - mObjectTypeSelector->load( mSyncProcess->group() ); -} - -void GroupConfigCommon::save() -{ - mSyncProcess->group().setName( mGroupName->text() ); - mObjectTypeSelector->save( mSyncProcess->group() ); -} diff --git a/kitchensync/src/groupconfigcommon.h b/kitchensync/src/groupconfigcommon.h deleted file mode 100644 index 8b298316f..000000000 --- a/kitchensync/src/groupconfigcommon.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 GROUPCONFIGCOMMON_H -#define GROUPCONFIGCOMMON_H - -#include <tqwidget.h> -#include <tqmap.h> - -#include <libqopensync/group.h> - -class KLineEdit; -class SyncProcess; -class TQCheckBox; - -class ObjectTypeSelector : public TQWidget -{ - public: - ObjectTypeSelector( TQWidget *parent ); - - void load( const QSync::Group &group ); - void save( QSync::Group group ); - - private: - TQMap<TQString,TQCheckBox *> mObjectTypeChecks; -}; - -class GroupConfigCommon : public TQWidget -{ - public: - GroupConfigCommon( TQWidget *parent ); - - void setSyncProcess( SyncProcess *syncProcess ); - void save(); - - private: - KLineEdit *mGroupName; - ObjectTypeSelector *mObjectTypeSelector; - - SyncProcess *mSyncProcess; -}; - -#endif diff --git a/kitchensync/src/groupconfigdialog.cpp b/kitchensync/src/groupconfigdialog.cpp deleted file mode 100644 index 522e54b17..000000000 --- a/kitchensync/src/groupconfigdialog.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "groupconfigdialog.h" - -#include "groupconfig.h" - -#include <tdelocale.h> - -#include <tqlayout.h> - -GroupConfigDialog::GroupConfigDialog( TQWidget *parent, SyncProcess *process ) - : KDialogBase( parent, 0, true, i18n("Configure Synchronization Group"), - Ok ) -{ - TQFrame *topFrame = makeMainWidget(); - - TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); - - mConfigWidget = new GroupConfig( topFrame ); - topLayout->addWidget( mConfigWidget ); - - mConfigWidget->setSyncProcess( process ); - - setInitialSize( configDialogSize( "size_groupconfigdialog" ) ); -} - -GroupConfigDialog::~GroupConfigDialog() -{ - saveDialogSize( "size_groupconfigdialog" ); -} - -void GroupConfigDialog::slotOk() -{ - mConfigWidget->saveConfig(); - - accept(); -} - -#include "groupconfigdialog.moc" diff --git a/kitchensync/src/groupconfigdialog.h b/kitchensync/src/groupconfigdialog.h deleted file mode 100644 index 988c24872..000000000 --- a/kitchensync/src/groupconfigdialog.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 GROUPCONFIGDIALOG_H -#define GROUPCONFIGDIALOG_H - -#include <kdialogbase.h> - -class GroupConfig; -class SyncProcess; - -class GroupConfigDialog : public KDialogBase -{ - Q_OBJECT - - - public: - GroupConfigDialog( TQWidget *parent, SyncProcess * ); - ~GroupConfigDialog(); - - protected slots: - void slotOk(); - - private: - GroupConfig *mConfigWidget; -}; - -#endif diff --git a/kitchensync/src/groupitem.cpp b/kitchensync/src/groupitem.cpp deleted file mode 100644 index d87ac37ee..000000000 --- a/kitchensync/src/groupitem.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <tdeapplication.h> -#include <kdialog.h> -#include <tdeglobal.h> -#include <tdeglobalsettings.h> -#include <kiconloader.h> -#include <tdelocale.h> -#include <kpassivepopup.h> -#include <kurllabel.h> - -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpixmap.h> -#include <tqprogressbar.h> -#include <tqvbox.h> - -#include "memberinfo.h" -#include "multiconflictdialog.h" -#include "singleconflictdialog.h" -#include "syncprocessmanager.h" - -#include "groupitem.h" - -GroupItem::GroupItem( KWidgetList *parent, SyncProcess *process ) - : KWidgetListItem( parent ), mSyncProcess( process ), - mCallbackHandler( new QSync::CallbackHandler ), - mProcessedItems( 0 ), mMaxProcessedItems( 0 ), - mSynchronizing( false ) -{ - TQFont boldFont; - boldFont.setBold( true ); - boldFont.setPointSize( boldFont.pointSize() + 2 ); - - TQGridLayout *layout = new TQGridLayout( this, 4, 4, KDialog::marginHint(), KDialog::spacingHint() ); - - mBox = new TQVBox( this ); - mBox->setMargin( 5 ); - mProgressBar = new TQProgressBar( this ); - mProgressBar->setTotalSteps( 100 ); - - mTime = new TQLabel( this ); - mSyncAction = new KURLLabel( "exec:/sync", i18n( "Synchronize Now" ), this ); - mConfigureAction = new KURLLabel( "exec:/config", i18n( "Configure" ), this ); - - // header - TQHBox* hbox = new TQHBox( this ); - hbox->setMargin( 2 ); - - static TQPixmap icon; - if ( icon.isNull() ) - icon = TDEGlobal::iconLoader()->loadIcon( "kontact_summary", TDEIcon::Desktop ); - - mIcon = new TQLabel( hbox ); - mIcon->setPixmap( icon ); - mIcon->setFixedSize( mIcon->sizeHint() ); - mIcon->setPaletteBackgroundColor( colorGroup().mid() ); - - mGroupName = new TQLabel( hbox ); - mGroupName->setAlignment( AlignLeft | AlignVCenter ); - mGroupName->setIndent( KDialog::spacingHint() ); - mGroupName->setFont( boldFont ); - mGroupName->setPaletteForegroundColor( colorGroup().light() ); - mGroupName->setPaletteBackgroundColor( colorGroup().mid() ); - - mStatus = new TQLabel( hbox ); - mStatus->setAlignment( TQt::AlignRight ); - mStatus->setAlignment( AlignRight | AlignVCenter ); - mStatus->setIndent( KDialog::spacingHint() ); - mStatus->setFont( boldFont ); - mStatus->setPaletteForegroundColor( colorGroup().light() ); - mStatus->setPaletteBackgroundColor( colorGroup().mid() ); - mStatus->setText( i18n( "Ready" ) ); - - hbox->setPaletteBackgroundColor( colorGroup().mid() ); - hbox->setMaximumHeight( hbox->minimumSizeHint().height() ); - - layout->addMultiCellWidget( hbox, 0, 0, 0, 3 ); - layout->addMultiCellWidget( mBox, 1, 1, 0, 3 ); - layout->addWidget( mTime, 2, 0 ); - layout->addWidget( mSyncAction, 2, 1 ); - layout->addWidget( mConfigureAction, 2, 2 ); - layout->addWidget( mProgressBar, 2, 3 ); - layout->setColStretch( 0, 1 ); - layout->setRowStretch( 3, 1 ); - - setPaletteBackgroundColor( kapp->palette().active().base() ); - - connect( mCallbackHandler, TQT_SIGNAL( conflict( QSync::SyncMapping ) ), - this, TQT_SLOT( conflict( QSync::SyncMapping ) ) ); - connect( mCallbackHandler, TQT_SIGNAL( change( const QSync::SyncChangeUpdate& ) ), - this, TQT_SLOT( change( const QSync::SyncChangeUpdate& ) ) ); - connect( mCallbackHandler, TQT_SIGNAL( mapping( const QSync::SyncMappingUpdate& ) ), - this, TQT_SLOT( mapping( const QSync::SyncMappingUpdate& ) ) ); - connect( mCallbackHandler, TQT_SIGNAL( engine( const QSync::SyncEngineUpdate& ) ), - this, TQT_SLOT( engine( const QSync::SyncEngineUpdate& ) ) ); - connect( mCallbackHandler, TQT_SIGNAL( member( const QSync::SyncMemberUpdate& ) ), - this, TQT_SLOT( member( const QSync::SyncMemberUpdate& ) ) ); - connect( mSyncAction, TQT_SIGNAL( leftClickedURL() ), - this, TQT_SLOT( synchronize() ) ); - connect( mConfigureAction, TQT_SIGNAL( leftClickedURL() ), - this, TQT_SLOT( configure() ) ); - connect( mSyncProcess, TQT_SIGNAL( engineChanged( QSync::Engine* ) ), - this, TQT_SLOT( engineChanged( QSync::Engine* ) ) ); - - mCallbackHandler->setEngine( mSyncProcess->engine() ); - - setSelectionForegroundColor( TDEGlobalSettings::textColor() ); - setSelectionBackgroundColor( TDEGlobalSettings::alternateBackgroundColor() ); - - update(); -} - -GroupItem::~GroupItem() -{ - delete mCallbackHandler; - mCallbackHandler = 0; -} - -void GroupItem::update() -{ - clear(); - - mGroupName->setText( i18n( "Group: %1" ).arg( mSyncProcess->group().name() ) ); - - TQDateTime dateTime = mSyncProcess->group().lastSynchronization(); - if ( dateTime.isValid() ) - mTime->setText( i18n( "Last synchronized on: %1" ).arg( TDEGlobal::locale()->formatDateTime( dateTime ) ) ); - else - mTime->setText( i18n( "Not synchronized yet" ) ); - - mProgressBar->reset(); - mProgressBar->hide(); - - QSync::Group group = mSyncProcess->group(); - QSync::Group::Iterator memberIt( group.begin() ); - QSync::Group::Iterator memberEndIt( group.end() ); - - for ( ; memberIt != memberEndIt; ++memberIt ) { - MemberItem *item = new MemberItem( mBox, mSyncProcess, *memberIt ); - item->show(); - item->setStatusMessage( i18n( "Ready" ) ); - mMemberItems.append( item ); - } -} - -void GroupItem::clear() -{ - mGroupName->setText( TQString() ); - - TQValueList<MemberItem*>::Iterator it; - for ( it = mMemberItems.begin(); it != mMemberItems.end(); ++it ) - delete *it; - - mMemberItems.clear(); -} - -void GroupItem::conflict( QSync::SyncMapping mapping ) -{ - if ( mapping.changesCount() == 2 ) { - SingleConflictDialog dlg( mapping, this ); - dlg.exec(); - } else { - MultiConflictDialog dlg( mapping, this ); - dlg.exec(); - } -} - -void GroupItem::change( const QSync::SyncChangeUpdate &update ) -{ - switch ( update.type() ) { - case QSync::SyncChangeUpdate::Received: - mProcessedItems++; - mStatus->setText( i18n( "%1 entries read" ).arg( mProcessedItems ) ); - break; - case QSync::SyncChangeUpdate::ReceivedInfo: - mStatus->setText( i18n( "Receive information" ) ); - break; - case QSync::SyncChangeUpdate::Sent: - mProcessedItems--; - mStatus->setText( i18n( "%1 entries written" ).arg( mMaxProcessedItems - mProcessedItems ) ); - - mProgressBar->show(); - - { - int progress = 100; - if ( mMaxProcessedItems != 0 ) - progress = (mProcessedItems * 100) / mMaxProcessedItems; - - if ( progress < 0 ) - progress = 0; - - mProgressBar->setProgress( 100 - progress ); - } - break; - case QSync::SyncChangeUpdate::WriteError: - mStatus->setText( i18n( "Error" ) ); - KPassivePopup::message( update.result().message(), this ); - break; - case QSync::SyncChangeUpdate::ReceiveError: - mStatus->setText( i18n( "Error" ) ); - KPassivePopup::message( update.result().message(), this ); - break; - default: - mStatus->setText( TQString() ); - break; - } -} - -void GroupItem::mapping( const QSync::SyncMappingUpdate& ) -{ -} - -void GroupItem::engine( const QSync::SyncEngineUpdate &update ) -{ - switch ( update.type() ) { - case QSync::SyncEngineUpdate::EndPhaseConnected: - mStatus->setText( i18n( "Connected" ) ); - mProgressBar->setProgress( 0 ); - mSynchronizing = true; - mSyncAction->setText( "Abort Synchronization" ); - break; - case QSync::SyncEngineUpdate::EndPhaseRead: - mStatus->setText( i18n( "Data read" ) ); - break; - case QSync::SyncEngineUpdate::EndPhaseWrite: - mStatus->setText( i18n( "Data written" ) ); - mProgressBar->setProgress( 100 ); - mProcessedItems = mMaxProcessedItems = 0; - break; - case QSync::SyncEngineUpdate::EndPhaseDisconnected: - mStatus->setText( i18n( "Disconnected" ) ); - break; - case QSync::SyncEngineUpdate::Error: - mStatus->setText( i18n( "Synchronization failed" ) ); - KPassivePopup::message( update.result().message(), this ); - this->update(); - - mSynchronizing = false; - mSyncAction->setText( i18n( "Synchronize Now" ) ); - break; - case QSync::SyncEngineUpdate::SyncSuccessfull: - mStatus->setText( i18n( "Successfully synchronized" ) ); - mSyncProcess->group().setLastSynchronization( TQDateTime::currentDateTime() ); - mSyncProcess->group().save(); - this->update(); - - mSynchronizing = false; - mSyncAction->setText( i18n( "Synchronize Now" ) ); - break; - case QSync::SyncEngineUpdate::PrevUnclean: - mStatus->setText( i18n( "Previous synchronization failed" ) ); - break; - case QSync::SyncEngineUpdate::EndConflicts: - mStatus->setText( i18n( "Conflicts solved" ) ); - mMaxProcessedItems = mProcessedItems; - break; - default: - mStatus->setText( TQString() ); - break; - } -} - -void GroupItem::member( const QSync::SyncMemberUpdate &update ) -{ - TQValueList<MemberItem*>::Iterator it; - for ( it = mMemberItems.begin(); it != mMemberItems.end(); ++it ) { - if ( (*it)->member() == update.member() ) { - switch ( update.type() ) { - case QSync::SyncMemberUpdate::Connected: - (*it)->setStatusMessage( i18n( "Connected" ) ); - break; - case QSync::SyncMemberUpdate::SentChanges: - (*it)->setStatusMessage( i18n( "Changes read" ) ); - break; - case QSync::SyncMemberUpdate::CommittedAll: - (*it)->setStatusMessage( i18n( "Changes written" ) ); - break; - case QSync::SyncMemberUpdate::Disconnected: - (*it)->setStatusMessage( i18n( "Disconnected" ) ); - break; - case QSync::SyncMemberUpdate::ConnectError: - (*it)->setStatusMessage( i18n( "Error: %1" ).arg( update.result().message() ) ); - break; - case QSync::SyncMemberUpdate::GetChangesError: - (*it)->setStatusMessage( i18n( "Error: %1" ).arg( update.result().message() ) ); - break; - case QSync::SyncMemberUpdate::CommittedAllError: - (*it)->setStatusMessage( i18n( "Error: %1" ).arg( update.result().message() ) ); - break; - case QSync::SyncMemberUpdate::SyncDoneError: - (*it)->setStatusMessage( i18n( "Error: %1" ).arg( update.result().message() ) ); - break; - case QSync::SyncMemberUpdate::DisconnectedError: - (*it)->setStatusMessage( i18n( "Error: %1" ).arg( update.result().message() ) ); - break; - default: - break; - } - - return; - } - } -} - -void GroupItem::synchronize() -{ - if ( !mSynchronizing ) - emit synchronizeGroup( mSyncProcess ); - else - emit abortSynchronizeGroup( mSyncProcess ); -} - -void GroupItem::configure() -{ - emit configureGroup( mSyncProcess ); - - this->update(); -} - -void GroupItem::engineChanged( QSync::Engine *engine ) -{ - Q_ASSERT( engine ); - - mCallbackHandler->setEngine( engine ); - - this->update(); -} - -MemberItem::MemberItem( TQWidget *parent, SyncProcess *process, - const QSync::Member &member ) - : TQWidget( parent ), mSyncProcess( process ), mMember( member ) -{ - TQFont boldFont; - boldFont.setBold( true ); - - MemberInfo mi( member ); - - TQPixmap icon = mi.smallIcon(); - - QSync::Plugin plugin = member.plugin(); - - TQVBoxLayout *layout = new TQVBoxLayout( this ); - - TQHBox* box = new TQHBox( this ); - box->setMargin( 5 ); - box->setSpacing( 6 ); - layout->addWidget( box ); - - mIcon = new TQLabel( box ); - mIcon->setPixmap( icon ); - mIcon->setAlignment( TQt::AlignTop ); - mIcon->setFixedWidth( mIcon->sizeHint().width() ); - - TQVBox *nameBox = new TQVBox( box ); - mMemberName = new TQLabel( nameBox ); - mMemberName->setFont( boldFont ); - mDescription = new TQLabel( nameBox ); - - mStatus = new TQLabel( box ); - - mMemberName->setText( member.name() ); - mDescription->setText( plugin.longName() ); -} - -void MemberItem::setStatusMessage( const TQString &msg ) -{ - mStatus->setText( msg ); -} - -#include "groupitem.moc" diff --git a/kitchensync/src/groupitem.h b/kitchensync/src/groupitem.h deleted file mode 100644 index 469b8329b..000000000 --- a/kitchensync/src/groupitem.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 GROUPITEM_H -#define GROUPITEM_H - -#include "syncprocess.h" - -#include <libqopensync/callbackhandler.h> - -#include <kwidgetlist.h> - -namespace QSync { -class Engine; -} - -class MemberItem; -class KURLLabel; -class TQLabel; -class TQProgressBar; -class TQVBox; - -class GroupItem : public KWidgetListItem -{ - Q_OBJECT - - - public: - GroupItem( KWidgetList*, SyncProcess *syncProcess ); - ~GroupItem(); - - SyncProcess *syncProcess() const { return mSyncProcess; } - - void update(); - - void clear(); - - signals: - void synchronizeGroup( SyncProcess *syncProcess ); - void abortSynchronizeGroup( SyncProcess *syncProcess ); - void configureGroup( SyncProcess *syncProcess ); - - protected slots: - void conflict( QSync::SyncMapping ); - void change( const QSync::SyncChangeUpdate& ); - void mapping( const QSync::SyncMappingUpdate& ); - void engine( const QSync::SyncEngineUpdate& ); - void member( const QSync::SyncMemberUpdate& ); - - void synchronize(); - void configure(); - - void engineChanged( QSync::Engine *engine ); - - private: - SyncProcess *mSyncProcess; - QSync::CallbackHandler *mCallbackHandler; - TQValueList<MemberItem*> mMemberItems; - - TQLabel *mIcon; - TQLabel *mGroupName; - TQLabel *mStatus; - TQLabel *mTime; - KURLLabel *mSyncAction; - KURLLabel *mConfigureAction; - TQVBox *mBox; - TQProgressBar *mProgressBar; - - int mProcessedItems; - int mMaxProcessedItems; - bool mSynchronizing; -}; - -class MemberItem : public TQWidget -{ - public: - MemberItem( TQWidget *parent, SyncProcess *syncProcess, - const QSync::Member &member ); - - SyncProcess* syncProcess() const { return mSyncProcess; } - QSync::Member member() const { return mMember; } - - void setStatusMessage( const TQString &msg ); - - private: - SyncProcess *mSyncProcess; - QSync::Member mMember; - - TQLabel *mIcon; - TQLabel *mMemberName; - TQLabel *mDescription; - TQLabel *mStatus; -}; - -#endif diff --git a/kitchensync/src/groupview.cpp b/kitchensync/src/groupview.cpp deleted file mode 100644 index 8e1adf87e..000000000 --- a/kitchensync/src/groupview.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 <tqlayout.h> - -#include "aboutpage.h" -#include "groupitem.h" -#include "syncprocessmanager.h" - -#include "groupview.h" - -GroupView::GroupView( TQWidget *parent ) - : TQWidget( parent ), mAboutPage( 0 ) -{ - mLayout = new TQVBoxLayout( this ); - - mWidgetList = new KWidgetList( this ); - - mLayout->addWidget( mWidgetList ); -} - -SyncProcess* GroupView::selectedSyncProcess() const -{ - GroupItem *item = static_cast<GroupItem*>( mWidgetList->selectedItem() ); - if ( item ) - return item->syncProcess(); - else - return 0; -} - -void GroupView::clear() -{ - mWidgetList->clear(); -} - -void GroupView::updateView() -{ - clear(); - - if ( SyncProcessManager::self()->count() == 0 ) { - mWidgetList->hide(); - - if ( !mAboutPage ) { - mAboutPage = new AboutPage( this ); - mLayout->addWidget( mAboutPage ); - - connect( mAboutPage, TQT_SIGNAL( addGroup() ), TQT_SIGNAL( addGroup() ) ); - } - - mAboutPage->show(); - - } else { - if ( mAboutPage ) - mAboutPage->hide(); - mWidgetList->show(); - } - - for ( int i = 0; i < SyncProcessManager::self()->count(); ++i ) { - SyncProcess *process = SyncProcessManager::self()->at( i ); - - GroupItem *item = new GroupItem( mWidgetList, process ); - connect( item, TQT_SIGNAL( synchronizeGroup( SyncProcess* ) ), - TQT_SIGNAL( synchronizeGroup( SyncProcess* ) ) ); - connect( item, TQT_SIGNAL( abortSynchronizeGroup( SyncProcess* ) ), - TQT_SIGNAL( abortSynchronizeGroup( SyncProcess* ) ) ); - connect( item, TQT_SIGNAL( configureGroup( SyncProcess* ) ), - TQT_SIGNAL( configureGroup( SyncProcess* ) ) ); - - mWidgetList->appendItem( item ); - } -} - -void GroupView::updateSyncProcess( SyncProcess *syncProcess ) -{ - for ( int i = 0; i < (int)mWidgetList->count(); ++i ) { - GroupItem *item = static_cast<GroupItem*>( mWidgetList->item( i ) ); - if ( item && item->syncProcess() == syncProcess ) - item->update(); - } -} - -#include "groupview.moc" diff --git a/kitchensync/src/groupview.h b/kitchensync/src/groupview.h deleted file mode 100644 index 63a142790..000000000 --- a/kitchensync/src/groupview.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 GROUPVIEW_H -#define GROUPVIEW_H - -#include <kwidgetlist.h> - -class AboutPage; -class SyncProcess; -class TQVBoxLayout; - -class GroupView : public TQWidget -{ - Q_OBJECT - - - public: - GroupView( TQWidget *parent ); - - SyncProcess* selectedSyncProcess() const; - - void clear(); - - public slots: - void updateView(); - void updateSyncProcess( SyncProcess *process ); - - signals: - void addGroup(); - void synchronizeGroup( SyncProcess *syncProcess ); - void abortSynchronizeGroup( SyncProcess *syncProcess ); - void configureGroup( SyncProcess *syncProcess ); - - private: - AboutPage *mAboutPage; - KWidgetList *mWidgetList; - - TQVBoxLayout *mLayout; -}; - -#endif diff --git a/kitchensync/src/htmldiffalgodisplay.cpp b/kitchensync/src/htmldiffalgodisplay.cpp deleted file mode 100644 index d91b75909..000000000 --- a/kitchensync/src/htmldiffalgodisplay.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - This file is part of libtdepim. - - Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> - - 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 <tdeglobalsettings.h> - -#include "htmldiffalgodisplay.h" - -using namespace KSync; - -static TQString textToHTML( const TQString &text ) -{ - return TQStyleSheet::convertFromPlainText( text ); -} - -HTMLDiffAlgoDisplay::HTMLDiffAlgoDisplay( TQWidget *parent ) - : KTextBrowser( parent ) -{ - setWrapPolicy( TQTextEdit::AtWordBoundary ); - setVScrollBarMode( TQScrollView::AlwaysOff ); - setHScrollBarMode( TQScrollView::AlwaysOff ); -} - -void HTMLDiffAlgoDisplay::begin() -{ - clear(); - mText = ""; - - mText.append( "<html>" ); - mText.append( TQString( "<body text=\"%1\" bgcolor=\"%2\">" ) - .arg( TDEGlobalSettings::textColor().name() ) - .arg( TDEGlobalSettings::baseColor().name() ) ); - - mText.append( "<center><table>" ); - mText.append( TQString( "<tr><th></th><th align=\"center\">%1</th><td> </td><th align=\"center\">%2</th></tr>" ) - .arg( mLeftTitle ) - .arg( mRightTitle ) ); -} - -void HTMLDiffAlgoDisplay::end() -{ - mText.append( "</table></center>" - "</body>" - "</html>" ); - - setText( mText ); -} - -void HTMLDiffAlgoDisplay::setLeftSourceTitle( const TQString &title ) -{ - mLeftTitle = title; -} - -void HTMLDiffAlgoDisplay::setRightSourceTitle( const TQString &title ) -{ - mRightTitle = title; -} - -void HTMLDiffAlgoDisplay::additionalLeftField( const TQString &id, const TQString &value ) -{ - mText.append( TQString( "<tr><td align=\"right\"><b>%1:</b></td><td bgcolor=\"#9cff83\">%2</td><td></td><td></td></tr>" ) - .arg( id ) - .arg( textToHTML( value ) ) ); -} - -void HTMLDiffAlgoDisplay::additionalRightField( const TQString &id, const TQString &value ) -{ - mText.append( TQString( "<tr><td align=\"right\"><b>%1:</b></td><td></td><td></td><td bgcolor=\"#9cff83\">%2</td></tr>" ) - .arg( id ) - .arg( textToHTML( value ) ) ); -} - -void HTMLDiffAlgoDisplay::conflictField( const TQString &id, const TQString &leftValue, - const TQString &rightValue ) -{ - mText.append( TQString( "<tr><td align=\"right\"><b>%1:</b></td><td bgcolor=\"#ff8686\">%2</td><td></td><td bgcolor=\"#ff8686\">%3</td></tr>" ) - .arg( id ) - .arg( textToHTML( leftValue ) ) - .arg( textToHTML( rightValue ) ) ); -} diff --git a/kitchensync/src/htmldiffalgodisplay.h b/kitchensync/src/htmldiffalgodisplay.h deleted file mode 100644 index 0dd92f016..000000000 --- a/kitchensync/src/htmldiffalgodisplay.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - This file is part of libtdepim. - - Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> - - 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 KSYNC_HTMLDIFFALGODISPLAY_H -#define KSYNC_HTMLDIFFALGODISPLAY_H - -#include <ktextbrowser.h> -#include <libtdepim/diffalgo.h> - -using namespace KPIM; - -namespace KSync { - -class HTMLDiffAlgoDisplay : virtual public DiffAlgoDisplay, public KTextBrowser -{ - public: - HTMLDiffAlgoDisplay( TQWidget *parent ); - - void begin(); - void end(); - void setLeftSourceTitle( const TQString &title ); - void setRightSourceTitle( const TQString &title ); - void additionalLeftField( const TQString &id, const TQString &value ); - void additionalRightField( const TQString &id, const TQString &value ); - void conflictField( const TQString &id, const TQString &leftValue, - const TQString &rightValue ); - - private: - TQString mLeftTitle; - TQString mRightTitle; - TQString mText; -}; - -} - -#endif diff --git a/kitchensync/src/kitchensync.desktop b/kitchensync/src/kitchensync.desktop deleted file mode 100644 index 6b5bdff7c..000000000 --- a/kitchensync/src/kitchensync.desktop +++ /dev/null @@ -1,16 +0,0 @@ -[Desktop Entry] -Name=KitchenSync - -GenericName=Synchronization - -Exec=kitchensync -Icon=kitchensync -Type=Application -X-DocPath=kitchensync/index.html -Terminal=false -X-TDE-StartupNotify=true -X-DCOP-ServiceType=Unique -X-DCOP-ServiceName=kitchensync -X-TDE-ServiceTypes=KParts/ReadOnlyPart -X-TDE-Library=libkitchensyncpart -Categories=Qt;TDE;Utility;Telephony;X-TDE-Utilities-Peripherals; diff --git a/kitchensync/src/kitchensync_part.rc b/kitchensync/src/kitchensync_part.rc deleted file mode 100644 index 03a13ba6b..000000000 --- a/kitchensync/src/kitchensync_part.rc +++ /dev/null @@ -1,22 +0,0 @@ -<!DOCTYPE kpartgui> -<kpartgui name="kitchensync" version="1"> - <MenuBar> - <Menu name="file"> - <Action name="sync" /> - </Menu> - - <Menu name="groups"><text>&Groups</text> - <Action name="add_group" /> - <Action name="edit_group" /> - <Action name="delete_group" /> - </Menu> - </MenuBar> - - <ToolBar name="mainToolBar"><text>Main</text> - <Action name="sync" /> - <Separator /> - <Action name="add_group" /> - <Action name="edit_group" /> - <Action name="delete_group" /> - </ToolBar> -</kpartgui> diff --git a/kitchensync/src/kitchensyncui.rc b/kitchensync/src/kitchensyncui.rc deleted file mode 100644 index df2e49be0..000000000 --- a/kitchensync/src/kitchensyncui.rc +++ /dev/null @@ -1,22 +0,0 @@ -<!DOCTYPE kpartgui> -<kpartgui name="kitchensync" version="2"> - <MenuBar> - <Menu name="file"> - <Action name="sync" /> - </Menu> - - <Menu name="groups"><text>&Groups</text> - <Action name="add_group" /> - <Action name="edit_group" /> - <Action name="delete_group" /> - </Menu> - </MenuBar> - - <ToolBar name="mainToolBar"><text>Main</text> - <Action name="sync" /> - <Separator /> - <Action name="add_group" /> - <Action name="edit_group" /> - <Action name="delete_group" /> - </ToolBar> -</kpartgui> diff --git a/kitchensync/src/kwidgetlist.cpp b/kitchensync/src/kwidgetlist.cpp deleted file mode 100644 index f26f8d68e..000000000 --- a/kitchensync/src/kwidgetlist.cpp +++ /dev/null @@ -1,305 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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 <tqvbox.h> - -#include <tdeglobalsettings.h> - -#include "kwidgetlist.h" - -class KWidgetList::Private -{ - public: - Private() - : mSelectedItem( 0 ) - { - } - - TQValueList<KWidgetListItem*> mItems; - KWidgetListItem *mSelectedItem; - TQVBox *mBox; -}; - -KWidgetList::KWidgetList( TQWidget *parent, const char *name ) - : TQScrollView( parent, name ), - d( new Private ) -{ - d->mBox = new TQVBox( viewport() ); - addChild( d->mBox ); - - setResizePolicy( AutoOneFit ); - setFocusPolicy( TQ_StrongFocus ); - - viewport()->setFocus(); -} - -KWidgetList::~KWidgetList() -{ - clear(); - - delete d; - d = 0; -} - -uint KWidgetList::count() const -{ - return d->mItems.count(); -} - -void KWidgetList::appendItem( KWidgetListItem *item ) -{ - if ( !item ) - return; - - if ( !d->mItems.contains( item ) ) { - d->mItems.append( item ); - item->reparent( d->mBox, 0, TQPoint( 0, 0 ), true ); - item->setSelected( false ); - item->installEventFilter( this ); - - if ( d->mItems.count() == 1 ) { - d->mSelectedItem = item; - } else { - if ( !d->mSelectedItem ) - setSelected( item ); - else - d->mSelectedItem->setSelected( true ); - } - } -} - -void KWidgetList::removeItem( int index ) -{ - if ( index < 0 || index >= (int)d->mItems.count() ) - return; - - KWidgetListItem *item = d->mItems[ index ]; - d->mItems.remove( item ); - - if ( d->mSelectedItem == item ) { - // TODO: smarter selection - if ( !d->mItems.isEmpty() ) - setSelected( d->mItems.first() ); - else - d->mSelectedItem = 0; - } - - delete item; - - if ( d->mItems.count() == 1 ) - d->mItems.first()->setSelected( false ); -} - -void KWidgetList::takeItem( KWidgetListItem *item ) -{ - d->mItems.remove( item ); - item->reparent( 0, 0, TQPoint( 0, 0 ) ); - item->removeEventFilter( this ); - item->hide(); - - if ( d->mSelectedItem == item ) { - // TODO: smarter selection - if ( !d->mItems.isEmpty() ) - setSelected( d->mItems.first() ); - else - d->mSelectedItem = 0; - } -} - -void KWidgetList::setSelected( KWidgetListItem *item ) -{ - if ( !item ) - return; - - if ( d->mItems.contains( item ) == 0 ) - return; - - if ( d->mSelectedItem ) - d->mSelectedItem->setSelected( false ); - - item->setSelected( true ); - d->mSelectedItem = item; -} - -void KWidgetList::setSelected( int index ) -{ - setSelected( item( index ) ); -} - -bool KWidgetList::isSelected( KWidgetListItem *item ) const -{ - return ( d->mSelectedItem == item ); -} - -bool KWidgetList::isSelected( int index ) const -{ - return isSelected( item( index ) ); -} - -KWidgetListItem *KWidgetList::selectedItem() const -{ - return d->mSelectedItem; -} - -KWidgetListItem *KWidgetList::item( int index ) const -{ - if ( index < 0 || index >= (int)d->mItems.count() ) - return 0; - else - return d->mItems[ index ]; -} - -int KWidgetList::index( KWidgetListItem *item ) const -{ - return d->mItems.findIndex( item ); -} - -void KWidgetList::clear() -{ - TQValueList<KWidgetListItem*>::Iterator it; - for ( it = d->mItems.begin(); it != d->mItems.end(); ++it ) - delete *it; - - d->mItems.clear(); - - d->mSelectedItem = 0; -} - -void KWidgetList::setFocus() -{ - viewport()->setFocus(); -} - -bool KWidgetList::eventFilter( TQObject *object, TQEvent *event ) -{ - if ( event->type() == TQEvent::MouseButtonPress ) { - TQMouseEvent *mouseEvent = TQT_TQMOUSEEVENT( event ); - if ( mouseEvent->button() & Qt::LeftButton ) { - TQValueList<KWidgetListItem*>::Iterator it; - for ( it = d->mItems.begin(); it != d->mItems.end(); ++it ) { - if ( TQT_BASE_OBJECT(*it) == TQT_BASE_OBJECT(object) ) { - if ( d->mItems.count() != 1 ) { - setSelected( *it ); - emit selectionChanged( *it ); - } - return true; - } - } - } - } else if ( event->type() == TQEvent::MouseButtonDblClick ) { - TQValueList<KWidgetListItem*>::Iterator it; - for ( it = d->mItems.begin(); it != d->mItems.end(); ++it ) { - if ( TQT_BASE_OBJECT(*it) == TQT_BASE_OBJECT(object) ) { - if ( d->mItems.count() != 1 ) { - setSelected( *it ); - emit doubleClicked( *it ); - } - return true; - } - } - } else if ( event->type() == TQEvent::KeyPress ) { - TQKeyEvent *keyEvent = TQT_TQKEYEVENT( event ); - if ( keyEvent->key() == TQt::Key_Up ) { - if ( d->mSelectedItem == 0 ) { - if ( !d->mItems.isEmpty() ) { - setSelected( d->mItems.first() ); - return true; - } - } - - for ( int i = 0; i < (int)d->mItems.count(); ++i ) { - if ( d->mItems[ i ] == d->mSelectedItem ) { - if ( ( i - 1 ) >= 0 ) { - setSelected( d->mItems[ i - 1 ] ); - return true; - } - } - } - return true; - } else if ( keyEvent->key() == TQt::Key_Down ) { - if ( d->mSelectedItem == 0 ) { - if ( !d->mItems.isEmpty() ) { - setSelected( d->mItems.last() ); - return true; - } - } - - for ( int i = 0; i < (int)d->mItems.count(); ++i ) - if ( d->mItems[ i ] == d->mSelectedItem ) { - if ( ( i + 1 ) < (int)d->mItems.count() ) { - setSelected( d->mItems[ i + 1 ] ); - return true; - } - } - return true; - } - } - - return TQScrollView::eventFilter( object, event ); -} - -KWidgetListItem::KWidgetListItem( KWidgetList *parent, const char *name ) - : TQWidget( parent, name ) -{ - mForegroundColor = TDEGlobalSettings::textColor(); - mBackgroundColor = TDEGlobalSettings::baseColor(); - mSelectionForegroundColor = TDEGlobalSettings::highlightedTextColor(); - mSelectionBackgroundColor = TDEGlobalSettings::highlightColor(); - - setFocusPolicy( TQ_StrongFocus ); -} - -KWidgetListItem::~KWidgetListItem() -{ -} - -void KWidgetListItem::setSelected( bool select ) -{ - if ( select ) { - setPaletteForegroundColor( mSelectionForegroundColor ); - setPaletteBackgroundColor( mSelectionBackgroundColor ); - } else { - setPaletteForegroundColor( mForegroundColor ); - setPaletteBackgroundColor( mBackgroundColor ); - } -} - -void KWidgetListItem::setForegroundColor( const TQColor &color ) -{ - mForegroundColor = color; -} - -void KWidgetListItem::setBackgroundColor( const TQColor &color ) -{ - mBackgroundColor = color; -} - -void KWidgetListItem::setSelectionForegroundColor( const TQColor &color ) -{ - mSelectionForegroundColor = color; -} - -void KWidgetListItem::setSelectionBackgroundColor( const TQColor &color ) -{ - mSelectionBackgroundColor = color; -} - -#include "kwidgetlist.moc" diff --git a/kitchensync/src/kwidgetlist.h b/kitchensync/src/kwidgetlist.h deleted file mode 100644 index 54eaf88be..000000000 --- a/kitchensync/src/kwidgetlist.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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 KWIDGETLIST_H -#define KWIDGETLIST_H - -#include <tqscrollview.h> - -class KWidgetListItem; - -class KWidgetList : public TQScrollView -{ - Q_OBJECT - - - public: - KWidgetList( TQWidget *parent = 0, const char *name = 0 ); - ~KWidgetList(); - - uint count() const; - - void appendItem( KWidgetListItem *item ); - void removeItem( int index ); - void takeItem( KWidgetListItem *item ); - - void setSelected( KWidgetListItem *item ); - void setSelected( int index ); - - bool isSelected( KWidgetListItem *item ) const; - bool isSelected( int index ) const; - - KWidgetListItem *selectedItem() const; - KWidgetListItem *item( int index ) const; - - int index( KWidgetListItem *item ) const; - - virtual bool eventFilter( TQObject *object, TQEvent *event ); - - public slots: - void clear(); - virtual void setFocus(); - - signals: - void selectionChanged( KWidgetListItem *item ); - void doubleClicked( KWidgetListItem *item ); - - private: - class Private; - Private *d; -}; - -class KWidgetListItem : public TQWidget -{ - public: - KWidgetListItem( KWidgetList *parent, const char *name = 0 ); - ~KWidgetListItem(); - - void setSelected( bool selected ); - - protected: - void setForegroundColor( const TQColor& ); - void setBackgroundColor( const TQColor& ); - void setSelectionForegroundColor( const TQColor& ); - void setSelectionBackgroundColor( const TQColor& ); - - private: - TQColor mForegroundColor; - TQColor mBackgroundColor; - TQColor mSelectionForegroundColor; - TQColor mSelectionBackgroundColor; -}; - -#endif diff --git a/kitchensync/src/main.cpp b/kitchensync/src/main.cpp deleted file mode 100644 index d5a0c267c..000000000 --- a/kitchensync/src/main.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <kdebug.h> -#include <tdeaboutdata.h> -#include <tdecmdlineargs.h> -#include <kuniqueapplication.h> -#include <stdlib.h> - -#include "mainwidget.h" -#include "mainwindow.h" - -static TDECmdLineOptions options[] = -{ - TDECmdLineLastOption -}; - -int main( int argc, char **argv ) -{ - TDEAboutData *about = MainWidget::aboutData(); - - TDECmdLineArgs::init( argc, argv, about ); - TDECmdLineArgs::addCmdLineOptions( options ); - KUniqueApplication::addCmdLineOptions(); - - KUniqueApplication::addCmdLineOptions(); - - if( !KUniqueApplication::start() ) { - kdDebug() << "kitchensync already runs." << endl; - exit( 0 ); - }; - - KUniqueApplication app; - - TDEGlobal::locale()->insertCatalogue( "libkcal" ); - - MainWindow *mainWindow = new MainWindow; - mainWindow->show(); - - app.exec(); -} diff --git a/kitchensync/src/mainwidget.cpp b/kitchensync/src/mainwidget.cpp deleted file mode 100644 index 611c0a228..000000000 --- a/kitchensync/src/mainwidget.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "mainwidget.h" - -#include "groupconfigdialog.h" -#include "groupview.h" -#include "syncprocess.h" -#include "syncprocessmanager.h" - -#include <libqopensync/environment.h> - -#include <tdeaboutdata.h> -#include <tdeaction.h> -#include <kdebug.h> -#include <kinputdialog.h> -#include <tdelistview.h> -#include <tdelocale.h> -#include <tdemessagebox.h> -#include <kstdaction.h> -#include <kxmlguiclient.h> - -#include <tqlayout.h> - -MainWidget::MainWidget( KXMLGUIClient *guiClient, TQWidget *widget, const char *name ) - : TQWidget( widget, name ), mGUIClient( guiClient ) -{ - initGUI(); - initActions(); - - /** apply object type filter hack **/ - int count = SyncProcessManager::self()->count(); - for ( int i = 0; i < count; ++i ) { - SyncProcessManager::self()->at( i )->applyObjectTypeFilter(); - } - /** apply object type filter hack **/ - - mGroupView->updateView(); - - connect( SyncProcessManager::self(), TQT_SIGNAL( changed() ), - mGroupView, TQT_SLOT( updateView() ) ); - connect( SyncProcessManager::self(), TQT_SIGNAL( syncProcessChanged( SyncProcess* ) ), - mGroupView, TQT_SLOT( updateSyncProcess( SyncProcess* ) ) ); - - enableActions(); -} - -MainWidget::~MainWidget() -{ -} - -KXMLGUIClient *MainWidget::guiClient() const -{ - return mGUIClient; -} - -TDEAboutData *MainWidget::aboutData() -{ - TDEAboutData *about = new TDEAboutData( "kitchensync", I18N_NOOP( "KitchenSync" ), - "0.1", I18N_NOOP( "The TDE Syncing Application" ), - TDEAboutData::License_GPL_V2, - I18N_NOOP( "(c) 2005, The KDE PIM Team" ) ); - about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer" ), "tokoe@kde.org" ); - about->addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); - - return about; -} - -void MainWidget::initGUI() -{ - TQVBoxLayout *topLayout = new TQVBoxLayout( this ); - - mGroupView = new GroupView( this ); - topLayout->addWidget( mGroupView ); - - connect( mGroupView, TQT_SIGNAL( addGroup() ), TQT_SLOT( addGroup() ) ); - connect( mGroupView, TQT_SIGNAL( synchronizeGroup( SyncProcess* ) ), - TQT_SLOT( sync( SyncProcess* ) ) ); - connect( mGroupView, TQT_SIGNAL( abortSynchronizeGroup( SyncProcess* ) ), - TQT_SLOT( abortSync( SyncProcess* ) ) ); - connect( mGroupView, TQT_SIGNAL( configureGroup( SyncProcess* ) ), - TQT_SLOT( editGroup( SyncProcess* ) ) ); -} - -void MainWidget::initActions() -{ - mActionSynchronize = new TDEAction( i18n("Synchronize"), "hotsync", 0, TQT_TQOBJECT(this), TQT_SLOT( sync() ), - mGUIClient->actionCollection(), "sync" ); - mActionAddGroup = new TDEAction( i18n("Add Group..."), "document-new", 0, TQT_TQOBJECT(this), TQT_SLOT( addGroup() ), - mGUIClient->actionCollection(), "add_group" ); - mActionDeleteGroup = new TDEAction( i18n("Delete Group..."), "edit-delete", 0, TQT_TQOBJECT(this), TQT_SLOT( deleteGroup() ), - mGUIClient->actionCollection(), "delete_group" ); - mActionEditGroup = new TDEAction( i18n("Edit Group..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT( editGroup() ), - mGUIClient->actionCollection(), "edit_group" ); -} - -void MainWidget::enableActions() -{ - bool state = ( SyncProcessManager::self()->count() > 0 ); - - mActionSynchronize->setEnabled( state ); - mActionDeleteGroup->setEnabled( state ); - mActionEditGroup->setEnabled( state ); -} - -void MainWidget::addGroup() -{ - bool ok; - TQString name = KInputDialog::getText( i18n("Create Synchronization Group"), - i18n("Name for new synchronization group."), TQString(), &ok, this ); - if ( ok ) { - SyncProcessManager::self()->addGroup( name ); - enableActions(); - - SyncProcess *process = SyncProcessManager::self()->byGroupName( name ); - if ( process ) - editGroup( process ); - } -} - -void MainWidget::deleteGroup() -{ - SyncProcess *syncProcess = mGroupView->selectedSyncProcess(); - if ( syncProcess ) { - int result = KMessageBox::warningContinueCancel( this, - i18n("Delete synchronization group '%1'?").arg( syncProcess->group().name() ) ); - if ( result == KMessageBox::Continue ) { - SyncProcessManager::self()->remove( syncProcess ); - enableActions(); - } - } -} - -void MainWidget::editGroup() -{ - editGroup( mGroupView->selectedSyncProcess() ); -} - -void MainWidget::editGroup( SyncProcess *syncProcess ) -{ - if ( syncProcess ) { - GroupConfigDialog dlg( this, syncProcess ); - dlg.exec(); - - enableActions(); - } -} - -void MainWidget::sync() -{ - sync( mGroupView->selectedSyncProcess() ); -} - -void MainWidget::sync( SyncProcess *syncProcess ) -{ - if ( syncProcess ) { - syncProcess->reinitEngine(); - QSync::Result result = syncProcess->engine()->synchronize(); - if ( result ) { - tqDebug( "%s", result.message().latin1() ); - } else { - tqDebug( "synchronization worked" ); - } - } -} - -void MainWidget::abortSync( SyncProcess *syncProcess ) -{ - if ( syncProcess ) - syncProcess->engine()->abort(); -} - -#include "mainwidget.moc" diff --git a/kitchensync/src/mainwidget.h b/kitchensync/src/mainwidget.h deleted file mode 100644 index 879394503..000000000 --- a/kitchensync/src/mainwidget.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 MAINWIDGET_H -#define MAINWIDGET_H - -#include <libqopensync/engine.h> -#include <kdemacros.h> - -#include <tqwidget.h> - -class TDEAboutData; -class TDEAction; -class KXMLGUIClient; -class GroupView; -class SyncProcess; -class SyncProcessManager; - -namespace QSync { -class Environment; -} - -class KDE_EXPORT MainWidget : public TQWidget -{ - Q_OBJECT - - public: - MainWidget( KXMLGUIClient *guiClient, TQWidget *widget = 0, const char *name = 0 ); - ~MainWidget(); - - virtual KXMLGUIClient *guiClient() const; - static TDEAboutData *aboutData(); - - public slots: - void addGroup(); - void deleteGroup(); - void editGroup(); - void editGroup( SyncProcess *syncProcess ); - - void sync(); - void sync( SyncProcess *syncProcess ); - void abortSync( SyncProcess *syncProcess ); - - private: - void initGUI(); - void initActions(); - void enableActions(); - - KXMLGUIClient *mGUIClient; - TDEAction *mActionSynchronize; - TDEAction *mActionAddGroup; - TDEAction *mActionDeleteGroup; - TDEAction *mActionEditGroup; - - GroupView *mGroupView; -}; - -#endif diff --git a/kitchensync/src/mainwindow.cpp b/kitchensync/src/mainwindow.cpp deleted file mode 100644 index a267956d8..000000000 --- a/kitchensync/src/mainwindow.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <tdeaction.h> -#include <tdelocale.h> -#include <kstdaction.h> -#include <tdetoolbar.h> - -#include "mainwidget.h" - -#include "mainwindow.h" - -MainWindow::MainWindow() - : TDEMainWindow( 0 ) -{ - setWFlags( getWFlags() | WGroupLeader ); - - setCaption( i18n( "PIM Synchronization" ) ); - - mWidget = new MainWidget( this, this, "MainWidget" ); - - setCentralWidget( mWidget ); - - initActions(); - - createGUI( "kitchensyncui.rc", false ); - createGUI( 0 ); - - toolBar()->setIconText( TDEToolBar::IconTextBottom ); - - resize( 760, 530 ); // initial size - setAutoSaveSettings(); -} - -MainWindow::~MainWindow() -{ -} - -void MainWindow::initActions() -{ - KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection() ); -} - -#include "mainwindow.moc" diff --git a/kitchensync/src/mainwindow.h b/kitchensync/src/mainwindow.h deleted file mode 100644 index d3a0bb6e8..000000000 --- a/kitchensync/src/mainwindow.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 MAINWINDOW_H -#define MAINWINDOW_H - -#include <tdemainwindow.h> - -class MainWidget; - -/** - This class serves as the main window for Kitchensync. It handles the - menus, toolbars, and status bars. - */ -class MainWindow : public TDEMainWindow -{ - Q_OBJECT - - - public: - MainWindow(); - virtual ~MainWindow(); - - private: - void initActions(); - - MainWidget *mWidget; -}; - -#endif diff --git a/kitchensync/src/memberconfig.cpp b/kitchensync/src/memberconfig.cpp deleted file mode 100644 index 93e5f1ff4..000000000 --- a/kitchensync/src/memberconfig.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "memberconfig.h" - -#include "configgui.h" -#include "memberinfo.h" - -#include <tdelocale.h> -#include <tdemessagebox.h> - -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqtabwidget.h> - -MemberConfig::MemberConfig( TQWidget *parent, const QSync::Member &member ) - : TQWidget( parent ), mMember( member ) -{ - TQBoxLayout *topLayout = new TQVBoxLayout( this ); - - mGui = ConfigGui::Factory::create( member, this ); - topLayout->addWidget( mGui ); -} - -MemberConfig::~MemberConfig() -{ -} - -void MemberConfig::loadData() -{ - TQByteArray cfg; - QSync::Result error = mMember.configuration( cfg ); - - if ( error ) { - KMessageBox::error( this, - i18n("Unable to read config from plugin '%1':\n%2") - .arg( mMember.pluginName() ).arg( error.message() ) ); - } else { - TQString txt = TQString::fromUtf8( cfg.data(), cfg.size() ); - mGui->load( txt ); - MemberInfo mi( mMember ); - mGui->setInstanceName( mi.name() ); - } -} - -void MemberConfig::saveData() -{ - TQString txt = mGui->save(); - - if ( txt.isEmpty() ) { - KMessageBox::sorry( this, i18n("Configuration of %1 is empty.").arg( mMember.pluginName() ) ); - } else { - TQByteArray cfg = txt.utf8(); - cfg.truncate(cfg.size() - 1); /* discard NUL terminator */ - mMember.setConfiguration( cfg ); - mMember.setName( mGui->instanceName() ); - // TODO: Check for save() error. - mMember.save(); - } -} - -#include "memberconfig.moc" diff --git a/kitchensync/src/memberconfig.h b/kitchensync/src/memberconfig.h deleted file mode 100644 index b79fc6449..000000000 --- a/kitchensync/src/memberconfig.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 MEMBERCONFIG_H -#define MEMBERCONFIG_H - -#include <libqopensync/member.h> - -#include <tqwidget.h> - -class TQTextEdit; -class ConfigGui; - -class MemberConfig : public TQWidget -{ - Q_OBJECT - - - public: - MemberConfig( TQWidget *parent, const QSync::Member & ); - ~MemberConfig(); - - void loadData(); - void saveData(); - - private: - QSync::Member mMember; - - ConfigGui *mGui; -}; - -#endif diff --git a/kitchensync/src/memberinfo.cpp b/kitchensync/src/memberinfo.cpp deleted file mode 100644 index fb52c7a78..000000000 --- a/kitchensync/src/memberinfo.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "memberinfo.h" - -#include <tdeglobal.h> -#include <kiconloader.h> -#include <tdelocale.h> - -MemberInfo::MemberInfo( const QSync::Member &member ) - : mMember( member ) -{ -} - -TQPixmap MemberInfo::smallIcon() const -{ - return TDEGlobal::iconLoader()->loadIcon( iconName(), TDEIcon::Small ); -} - -TQPixmap MemberInfo::desktopIcon() const -{ - return TDEGlobal::iconLoader()->loadIcon( iconName(), TDEIcon::Desktop ); -} - -TQString MemberInfo::iconName() const -{ - return pluginIconName( mMember.pluginName() ); -} - -TQString MemberInfo::name() const -{ - static TQMap<TQString, TQString> nameMap; - if ( nameMap.isEmpty() ) { - nameMap.insert( "file-sync", i18n( "File" ) ); - nameMap.insert( "palm-sync", i18n( "Palm" ) ); - nameMap.insert( "tdepim-sync", i18n( "TDE PIM" ) ); - nameMap.insert( "tdeio-sync", i18n( "Remote File" ) ); - nameMap.insert( "irmc-sync", i18n( "Mobile Phone" ) ); - nameMap.insert( "evo2-sync", i18n( "Evolution" ) ); - nameMap.insert( "opie-sync", i18n( "Handheld" ) ); - nameMap.insert( "ldap-sync", i18n( "LDAP" ) ); - nameMap.insert( "syncml-obex-client", i18n( "Mobile Phone" ) ); - nameMap.insert( "syncml-http-server", i18n( "Mobile Phone" ) ); - nameMap.insert( "moto-sync", i18n( "Mobile Phone" ) ); - nameMap.insert( "gnokii-sync", i18n( "Mobile Phone" ) ); - nameMap.insert( "google-calendar", i18n( "Google Calendar" ) ); - nameMap.insert( "gpe-sync", i18n( "Handheld" ) ); - nameMap.insert( "sunbird-sync", i18n( "Sunbird Calendar" ) ); - nameMap.insert( "jescs-sync", i18n( "Java Enterprise System Calendar" ) ); - nameMap.insert( "synce-plugin", i18n( "WinCE Devices" ) ); - } - - if ( mMember.name().isEmpty() ) - return nameMap[ mMember.pluginName() ] + " (" + TQString::number( mMember.id() ) + ") "; - else - return mMember.name(); -} - -TQString MemberInfo::pluginIconName( const TQString &pluginName ) -{ - if ( pluginName == "file-sync" ) return "folder"; - if ( pluginName == "palm-sync" ) return "pda_black"; - if ( pluginName == "tdepim-sync" ) return "kontact"; - if ( pluginName == "tdeio-sync" ) return "network"; - if ( pluginName == "irmc-sync" ) return "mobile_phone"; - if ( pluginName == "evo2-sync" ) return "evolution"; - if ( pluginName == "opie-sync" ) return "pda_blue"; - if ( pluginName == "synce-plugin" ) return "pda_blue"; - if ( pluginName == "ldap-sync" ) return "contents2"; - if ( pluginName == "syncml-obex-client" ) return "mobile_phone"; - if ( pluginName == "syncml-http-server" ) return "pda_blue"; - if ( pluginName == "moto-sync" ) return "mobile_phone"; - if ( pluginName == "gnokii-sync" ) return "mobile_phone"; - if ( pluginName == "google-calendar" ) return "www"; - if ( pluginName == "gpe-sync" ) return "pda_blue"; - if ( pluginName == "sunbird-sync" ) return "www"; - if ( pluginName == "jescs-sync" ) return "www"; - - - return TQString(); -} diff --git a/kitchensync/src/memberinfo.h b/kitchensync/src/memberinfo.h deleted file mode 100644 index 8f0d7f4f7..000000000 --- a/kitchensync/src/memberinfo.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 MEMBERINFO_H -#define MEMBERINFO_H - -#include <libqopensync/member.h> - -#include <tqstring.h> -#include <tqpixmap.h> - -class MemberInfo -{ - public: - MemberInfo( const QSync::Member &member ); - - TQPixmap smallIcon() const; - TQPixmap desktopIcon() const; - - TQString iconName() const; - - TQString name() const; - - static TQString pluginIconName( const TQString &pluginName ); - - private: - QSync::Member mMember; -}; - -#endif diff --git a/kitchensync/src/multiconflictdialog.cpp b/kitchensync/src/multiconflictdialog.cpp deleted file mode 100644 index 608d33a85..000000000 --- a/kitchensync/src/multiconflictdialog.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <kdialog.h> -#include <tdelocale.h> -#include <kwidgetlist.h> - -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpushbutton.h> - -#include "memberinfo.h" - -#include "multiconflictdialog.h" - -class ChangeItem : public KWidgetListItem -{ - public: - ChangeItem( KWidgetList *parent, const QSync::SyncChange &change ) - : KWidgetListItem( parent ), - mChange( change ) - { - TQGridLayout *layout = new TQGridLayout( this, 2, 1, KDialog::marginHint(), KDialog::spacingHint() ); - - MemberInfo mi( change.member() ); - layout->addWidget( new TQLabel( mi.name(), this ), 0, 0 ); - - TQString type; - switch ( change.changeType() ) { - case QSync::SyncChange::UnknownChange: - type = i18n( "Unknown" ); - break; - case QSync::SyncChange::AddedChange: - type = i18n( "Added" ); - break; - case QSync::SyncChange::DeletedChange: - type = i18n( "Deleted" ); - break; - case QSync::SyncChange::ModifiedChange: - type = i18n( "Modified" ); - break; - case QSync::SyncChange::UnmodifiedChange: - default: - type = i18n( "Unmodified" ); - break; - } - - layout->addWidget( new TQLabel( type, this ), 1, 0 ); - } - - QSync::SyncChange change() const { return mChange; } - - private: - QSync::SyncChange mChange; -}; - -MultiConflictDialog::MultiConflictDialog( QSync::SyncMapping &mapping, TQWidget *parent ) - : ConflictDialog( mapping, parent ) -{ - initGUI(); - - for ( int i = 0; i < mMapping.changesCount(); ++i ) { - QSync::SyncChange change = mMapping.changeAt( i ); - if ( change.isValid() ) { - ChangeItem *item = new ChangeItem( mWidgetList, change ); - mWidgetList->appendItem( item ); - } - } - - mWidgetList->setFocus(); -} - -MultiConflictDialog::~MultiConflictDialog() -{ -} - -void MultiConflictDialog::useSelectedChange() -{ - ChangeItem *item = static_cast<ChangeItem*>( mWidgetList->selectedItem() ); - if ( !item ) - return; - - mMapping.solve( item->change() ); - - accept(); -} - -void MultiConflictDialog::duplicateChange() -{ - mMapping.duplicate(); - - accept(); -} - -void MultiConflictDialog::ignoreChange() -{ - mMapping.ignore(); - - accept(); -} - -void MultiConflictDialog::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( this, 3, 3, KDialog::marginHint(), KDialog::spacingHint() ); - - layout->addMultiCellWidget( new TQLabel( i18n( "A conflict has appeared, please solve it manually." ), this ), 0, 0, 0, 2 ); - - mWidgetList = new KWidgetList( this ); - layout->addMultiCellWidget( mWidgetList, 1, 1, 0, 2 ); - - TQPushButton *button = new TQPushButton( i18n( "Use Selected Item" ), this ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( useSelectedChange() ) ); - layout->addWidget( button, 2, 0 ); - - button = new TQPushButton( i18n( "Duplicate Items" ), this ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( duplicateChange() ) ); - layout->addWidget( button, 2, 1 ); - - button = new TQPushButton( i18n( "Ignore Conflict" ), this ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( ignoreChange() ) ); - layout->addWidget( button, 2, 2 ); -} - -#include "multiconflictdialog.moc" diff --git a/kitchensync/src/multiconflictdialog.h b/kitchensync/src/multiconflictdialog.h deleted file mode 100644 index 64455311e..000000000 --- a/kitchensync/src/multiconflictdialog.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 MULTICONFLICTDIALOG_H -#define MULTICONFLICTDIALOG_H - -#include "conflictdialog.h" - -class KWidgetList; - -class MultiConflictDialog : public ConflictDialog -{ - Q_OBJECT - - - public: - MultiConflictDialog( QSync::SyncMapping &mapping, TQWidget *parent ); - ~MultiConflictDialog(); - - private slots: - void useSelectedChange(); - void duplicateChange(); - void ignoreChange(); - - private: - void initGUI(); - - KWidgetList *mWidgetList; -}; - -#endif diff --git a/kitchensync/src/part.cpp b/kitchensync/src/part.cpp deleted file mode 100644 index c52b28aef..000000000 --- a/kitchensync/src/part.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <tqlayout.h> -#include <tqvbox.h> - -#include <tdeaction.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <kiconloader.h> -#include <kinstance.h> -#include <tdelocale.h> -#include <tdeparts/genericfactory.h> - -#include "mainwidget.h" - -#include "part.h" - -typedef KParts::GenericFactory< KitchenSyncPart > KitchenSyncFactory; -K_EXPORT_COMPONENT_FACTORY( libkitchensyncpart, KitchenSyncFactory ) - -KitchenSyncPart::KitchenSyncPart( TQWidget *parentWidget, const char *widgetName, - TQObject *parent, const char *name, - const TQStringList& ) - : KParts::ReadOnlyPart( parent, name ) -{ - setInstance( KitchenSyncFactory::instance() ); - - TQVBox *canvas = new TQVBox( parentWidget, widgetName ); - setWidget( canvas ); - - new MainWidget( this, canvas ); - - TDEGlobal::iconLoader()->addAppDir( "kitchensync" ); - - setXMLFile( "kitchensync_part.rc" ); -} - -KitchenSyncPart::~KitchenSyncPart() -{ - closeURL(); -} - -TDEAboutData *KitchenSyncPart::createAboutData() -{ - return MainWidget::aboutData(); -} - -void KitchenSyncPart::exit() -{ - delete this; -} - -bool KitchenSyncPart::openURL( const KURL &url ) -{ - emit setWindowCaption( url.prettyURL() ); - - return true; -} - -bool KitchenSyncPart::openFile() -{ - return true; -} - -void KitchenSyncPart::guiActivateEvent( KParts::GUIActivateEvent *e ) -{ - KParts::ReadOnlyPart::guiActivateEvent( e ); -} - -#include "part.moc" - diff --git a/kitchensync/src/part.h b/kitchensync/src/part.h deleted file mode 100644 index b799cea51..000000000 --- a/kitchensync/src/part.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 PART_H -#define PART_H - -#include <tdeparts/event.h> -#include <tdeparts/factory.h> -#include <tdeparts/part.h> - -class TDEAboutData; - -class KitchenSyncPart: public KParts::ReadOnlyPart -{ - Q_OBJECT - - - public: - KitchenSyncPart( TQWidget *parentWidget, const char *widgetName, - TQObject *parent, const char *name, const TQStringList& ); - virtual ~KitchenSyncPart(); - - static TDEAboutData *createAboutData(); - - virtual void exit(); - virtual bool openURL( const KURL &url ); - - protected: - virtual bool openFile(); - virtual void guiActivateEvent( KParts::GUIActivateEvent* ); -}; - -#endif diff --git a/kitchensync/src/pics/CMakeLists.txt b/kitchensync/src/pics/CMakeLists.txt deleted file mode 100644 index aeb0522e0..000000000 --- a/kitchensync/src/pics/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_install_icons( kitchensync ) -tde_install_icons( hotsync mobile_phone DESTINATION ${DATA_INSTALL_DIR}/kitchensync/icons ) diff --git a/kitchensync/src/pics/Makefile.am b/kitchensync/src/pics/Makefile.am deleted file mode 100644 index ddb7cc451..000000000 --- a/kitchensync/src/pics/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -kitchensyncicondir = $(kde_datadir)/kitchensync/icons -kitchensyncicon_ICON = hotsync mobile_phone - -KDE_ICON = kitchensync diff --git a/kitchensync/src/pics/cr128-app-mobile_phone.png b/kitchensync/src/pics/cr128-app-mobile_phone.png Binary files differdeleted file mode 100644 index bfdefe7a2..000000000 --- a/kitchensync/src/pics/cr128-app-mobile_phone.png +++ /dev/null diff --git a/kitchensync/src/pics/cr16-action-hotsync.png b/kitchensync/src/pics/cr16-action-hotsync.png Binary files differdeleted file mode 100644 index 1f779008c..000000000 --- a/kitchensync/src/pics/cr16-action-hotsync.png +++ /dev/null diff --git a/kitchensync/src/pics/cr16-app-mobile_phone.png b/kitchensync/src/pics/cr16-app-mobile_phone.png Binary files differdeleted file mode 100644 index d4dac16b3..000000000 --- a/kitchensync/src/pics/cr16-app-mobile_phone.png +++ /dev/null diff --git a/kitchensync/src/pics/cr22-action-hotsync.png b/kitchensync/src/pics/cr22-action-hotsync.png Binary files differdeleted file mode 100644 index 4f2faf573..000000000 --- a/kitchensync/src/pics/cr22-action-hotsync.png +++ /dev/null diff --git a/kitchensync/src/pics/cr32-action-hotsync.png b/kitchensync/src/pics/cr32-action-hotsync.png Binary files differdeleted file mode 100644 index 88603e5d5..000000000 --- a/kitchensync/src/pics/cr32-action-hotsync.png +++ /dev/null diff --git a/kitchensync/src/pics/cr32-app-mobile_phone.png b/kitchensync/src/pics/cr32-app-mobile_phone.png Binary files differdeleted file mode 100644 index f44973583..000000000 --- a/kitchensync/src/pics/cr32-app-mobile_phone.png +++ /dev/null diff --git a/kitchensync/src/pics/cr48-action-hotsync.png b/kitchensync/src/pics/cr48-action-hotsync.png Binary files differdeleted file mode 100644 index d2cbff525..000000000 --- a/kitchensync/src/pics/cr48-action-hotsync.png +++ /dev/null diff --git a/kitchensync/src/pics/cr48-app-mobile_phone.png b/kitchensync/src/pics/cr48-app-mobile_phone.png Binary files differdeleted file mode 100644 index 6d38be093..000000000 --- a/kitchensync/src/pics/cr48-app-mobile_phone.png +++ /dev/null diff --git a/kitchensync/src/pics/cr64-app-mobile_phone.png b/kitchensync/src/pics/cr64-app-mobile_phone.png Binary files differdeleted file mode 100644 index 41e852a68..000000000 --- a/kitchensync/src/pics/cr64-app-mobile_phone.png +++ /dev/null diff --git a/kitchensync/src/pics/hi16-app-kitchensync.png b/kitchensync/src/pics/hi16-app-kitchensync.png Binary files differdeleted file mode 100644 index 1f779008c..000000000 --- a/kitchensync/src/pics/hi16-app-kitchensync.png +++ /dev/null diff --git a/kitchensync/src/pics/hi22-app-kitchensync.png b/kitchensync/src/pics/hi22-app-kitchensync.png Binary files differdeleted file mode 100644 index 4f2faf573..000000000 --- a/kitchensync/src/pics/hi22-app-kitchensync.png +++ /dev/null diff --git a/kitchensync/src/pics/hi32-app-kitchensync.png b/kitchensync/src/pics/hi32-app-kitchensync.png Binary files differdeleted file mode 100644 index 88603e5d5..000000000 --- a/kitchensync/src/pics/hi32-app-kitchensync.png +++ /dev/null diff --git a/kitchensync/src/pics/hi48-app-kitchensync.png b/kitchensync/src/pics/hi48-app-kitchensync.png Binary files differdeleted file mode 100644 index d2cbff525..000000000 --- a/kitchensync/src/pics/hi48-app-kitchensync.png +++ /dev/null diff --git a/kitchensync/src/pluginpicker.cpp b/kitchensync/src/pluginpicker.cpp deleted file mode 100644 index 0b8692489..000000000 --- a/kitchensync/src/pluginpicker.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "pluginpicker.h" - -#include "memberinfo.h" -#include "syncprocessmanager.h" - -#include <libqopensync/environment.h> - -#include <kdialog.h> -#include <tdeglobal.h> -#include <kiconloader.h> -#include <tdelocale.h> - -#include <tqlabel.h> -#include <tqlayout.h> - -PluginItem::PluginItem( KWidgetList *list, const QSync::Plugin &plugin ) - : KWidgetListItem( list ), mPlugin( plugin ) -{ - TQString iconName = MemberInfo::pluginIconName( mPlugin.name() ); - TQGridLayout *layout = new TQGridLayout( this, 2, 2, KDialog::marginHint(), KDialog::spacingHint() ); - - TQLabel *icon = new TQLabel( this ); - icon->setPixmap( TDEGlobal::iconLoader()->loadIcon( iconName, TDEIcon::Desktop ) ); - icon->setFixedSize( icon->sizeHint() ); - - TQLabel *name = new TQLabel( plugin.longName(), this ); - TQLabel *description = new TQLabel( plugin.description(), this ); - - TQFont font = name->font(); - font.setBold( true ); - name->setFont( font ); - - layout->addWidget( icon, 0, 0 ); - layout->addWidget( name, 0, 1 ); - layout->addWidget( description, 1, 1 ); -} - - -PluginPicker::PluginPicker( TQWidget *parent ) - : TQWidget( parent ) -{ - TQBoxLayout *layout = new TQVBoxLayout( this ); - - mPluginList = new KWidgetList( this ); - layout->addWidget( mPluginList ); - - connect( mPluginList, TQT_SIGNAL( doubleClicked( KWidgetListItem* ) ), - TQT_SIGNAL( selected() ) ); - - updatePluginList(); - - mPluginList->setFocus(); -} - -void PluginPicker::updatePluginList() -{ - mPluginList->clear(); - - QSync::Environment *env = SyncProcessManager::self()->environment(); - - QSync::Environment::PluginIterator it( env->pluginBegin() ); - for( ; it != env->pluginEnd(); ++it ) { - QSync::Plugin plugin = *it; - mPluginList->appendItem( new PluginItem( mPluginList, plugin ) ); - } -} - -QSync::Plugin PluginPicker::selectedPlugin() const -{ - PluginItem *item = static_cast<PluginItem *>( mPluginList->selectedItem() ); - if ( item ) return item->plugin(); - else return QSync::Plugin(); -} - - -PluginPickerDialog::PluginPickerDialog( TQWidget *parent ) - : KDialogBase( parent, 0, true, i18n("Select Member Type"), Ok | Cancel ) -{ - TQFrame *topFrame = makeMainWidget(); - - TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); - - mPicker = new PluginPicker( topFrame ); - topLayout->addWidget( mPicker ); - - connect( mPicker, TQT_SIGNAL( selected() ), TQT_SLOT( slotOk() ) ); - - setInitialSize( TQSize( 460, 380 ) ); -} - -QSync::Plugin PluginPickerDialog::selectedPlugin() const -{ - return mPicker->selectedPlugin(); -} - -QSync::Plugin PluginPickerDialog::getPlugin( TQWidget *parent ) -{ - PluginPickerDialog dlg( parent ); - if ( dlg.exec() ) - return dlg.selectedPlugin(); - else - return QSync::Plugin(); -} - -void PluginPickerDialog::slotOk() -{ - accept(); -} - -void PluginPickerDialog::slotCancel() -{ - reject(); -} - -#include "pluginpicker.moc" diff --git a/kitchensync/src/pluginpicker.h b/kitchensync/src/pluginpicker.h deleted file mode 100644 index 04e8d9fb5..000000000 --- a/kitchensync/src/pluginpicker.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 PLUGINPICKER_H -#define PLUGINPICKER_H - -#include <libqopensync/plugin.h> - -#include <kdialogbase.h> -#include <kwidgetlist.h> - -#include <tqwidget.h> - -class PluginItem : public KWidgetListItem -{ - public: - PluginItem( KWidgetList *, const QSync::Plugin & ); - - QSync::Plugin plugin() const { return mPlugin; } - - private: - QSync::Plugin mPlugin; -}; - -class PluginPicker : public TQWidget -{ - Q_OBJECT - - - public: - PluginPicker( TQWidget *parent ); - - QSync::Plugin selectedPlugin() const; - - signals: - void selected(); - - protected: - void updatePluginList(); - - private: - KWidgetList *mPluginList; -}; - -class PluginPickerDialog : public KDialogBase -{ - Q_OBJECT - - - public: - PluginPickerDialog( TQWidget *parent ); - - QSync::Plugin selectedPlugin() const; - - static QSync::Plugin getPlugin( TQWidget *parent ); - - protected slots: - void slotOk(); - void slotCancel(); - - private: - PluginPicker *mPicker; -}; - -#endif diff --git a/kitchensync/src/singleconflictdialog.cpp b/kitchensync/src/singleconflictdialog.cpp deleted file mode 100644 index bac948351..000000000 --- a/kitchensync/src/singleconflictdialog.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <kdialog.h> -#include <tdelocale.h> - -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpushbutton.h> - -#include "addresseediffalgo.h" -#include "genericdiffalgo.h" -#include "htmldiffalgodisplay.h" -#include "memberinfo.h" - -#include "singleconflictdialog.h" - -SingleConflictDialog::SingleConflictDialog( QSync::SyncMapping &mapping, TQWidget *parent ) - : ConflictDialog( mapping, parent ), mDiffAlgo( 0 ) -{ - initGUI(); - - TQString format = mapping.changeAt( 0 ).objectFormatName(); - QSync::SyncChange leftChange = mapping.changeAt( 0 ); - QSync::SyncChange rightChange = mapping.changeAt( 1 ); - - if ( format == "file" ) { - mDiffAlgo = new KSync::GenericDiffAlgo( leftChange.data(), rightChange.data() ); - } else if ( format == "vcard" ) { - } else if ( format == "calendar" ) { - } else if ( format == "xml-contact" ) { - mDiffAlgo = new KSync::AddresseeDiffAlgo( leftChange.data(), rightChange.data() ); - } - - MemberInfo miLeft( leftChange.member() ); - mDiffAlgoDisplay->setLeftSourceTitle( miLeft.name() ); - MemberInfo miRight( rightChange.member() ); - mDiffAlgoDisplay->setRightSourceTitle( miRight.name() ); - - if ( mDiffAlgo ) { - mDiffAlgo->addDisplay( mDiffAlgoDisplay ); - mDiffAlgo->run(); - } -} - -SingleConflictDialog::~SingleConflictDialog() -{ - delete mDiffAlgo; - mDiffAlgo = 0; -} - -void SingleConflictDialog::useFirstChange() -{ - mMapping.solve( mMapping.changeAt( 0 ) ); - - accept(); -} - -void SingleConflictDialog::useSecondChange() -{ - mMapping.solve( mMapping.changeAt( 1 ) ); - - accept(); -} - -void SingleConflictDialog::duplicateChange() -{ - mMapping.duplicate(); - - accept(); -} - -void SingleConflictDialog::ignoreChange() -{ - mMapping.ignore(); - - accept(); -} - -void SingleConflictDialog::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( this, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); - - layout->addMultiCellWidget( new TQLabel( i18n( "A conflict has appeared, please solve it manually." ), this ), 0, 0, 0, 3 ); - mDiffAlgoDisplay = new KSync::HTMLDiffAlgoDisplay( this ); - - layout->addMultiCellWidget( mDiffAlgoDisplay, 1, 1, 0, 3 ); - - TQPushButton *button = new TQPushButton( i18n( "Use Item" ), this ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( useFirstChange() ) ); - layout->addWidget( button, 2, 0 ); - - button = new TQPushButton( i18n( "Duplicate Items" ), this ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( duplicateChange() ) ); - layout->addWidget( button, 2, 1 ); - - button = new TQPushButton( i18n( "Ignore Conflict" ), this ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( ignoreChange() ) ); - layout->addWidget( button, 2, 2 ); - - button = new TQPushButton( i18n( "Use Item" ), this ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( useSecondChange() ) ); - layout->addWidget( button, 2, 3 ); -} - -#include "singleconflictdialog.moc" diff --git a/kitchensync/src/singleconflictdialog.h b/kitchensync/src/singleconflictdialog.h deleted file mode 100644 index 4422a3c2a..000000000 --- a/kitchensync/src/singleconflictdialog.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 SINGLECONFLICTDIALOG_H -#define SINGLECONFLICTDIALOG_H - -#include "conflictdialog.h" -#include <libtdepim/diffalgo.h> - -using namespace KPIM; - -namespace KSync { -class HTMLDiffAlgoDisplay; -} - -class SingleConflictDialog : public ConflictDialog -{ - Q_OBJECT - - - public: - SingleConflictDialog( QSync::SyncMapping &mapping, TQWidget *parent ); - ~SingleConflictDialog(); - - private slots: - void useFirstChange(); - void useSecondChange(); - void duplicateChange(); - void ignoreChange(); - - private: - void initGUI(); - - DiffAlgo *mDiffAlgo; - KSync::HTMLDiffAlgoDisplay *mDiffAlgoDisplay; -}; - -#endif diff --git a/kitchensync/src/syncprocess.cpp b/kitchensync/src/syncprocess.cpp deleted file mode 100644 index 4e9c46b60..000000000 --- a/kitchensync/src/syncprocess.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 <libqopensync/engine.h> -#include <libqopensync/environment.h> - -#include <kdebug.h> -#include <tdelocale.h> - -#include "syncprocess.h" -#include "syncprocessmanager.h" - -using namespace QSync; - -SyncProcess::SyncProcess( const QSync::Group &group ) - : TQObject( 0, "SyncProcess" ) -{ - mGroup = group; - mEngine = new QSync::Engine( mGroup ); - - Result result = mEngine->initialize(); - if ( result.isError() ) - kdDebug() << "SyncProcess::SyncProcess: " << result.message() << endl; -} - -SyncProcess::~SyncProcess() -{ - mEngine->finalize(); - - delete mEngine; - mEngine = 0; -} - -TQString SyncProcess::groupStatus() const -{ - return i18n( "Ready" ); -} - -TQString SyncProcess::memberStatus( const QSync::Member& ) const -{ - return i18n( "Ready" ); -} - -QSync::Result SyncProcess::addMember( const QSync::Plugin &plugin ) -{ - QSync::Member member = mGroup.addMember(); - QSync::Result result = member.instance( plugin ); - - if ( !result.isError() ) - mGroup.save(); - - return result; -} - -void SyncProcess::reinitEngine() -{ - mEngine->finalize(); - delete mEngine; - mEngine = new QSync::Engine( mGroup ); - Result result = mEngine->initialize(); - if ( result.isError() ) - kdDebug() << "SyncProcess::reinitEngine: " << result.message() << endl; - - applyObjectTypeFilter(); - - emit engineChanged( mEngine ); -} - -void SyncProcess::applyObjectTypeFilter() -{ - const QSync::Conversion conversion = SyncProcessManager::self()->environment()->conversion(); - const TQStringList objectTypes = conversion.objectTypes(); - const TQStringList activeObjectTypes = mGroup.config().activeObjectTypes(); - - for ( uint i = 0; i < objectTypes.count(); ++i ) { - if ( activeObjectTypes.contains( objectTypes[ i ] ) ) { - kdDebug() << "Enabled object type: " << objectTypes[ i ] << endl; - /* - * This is not required. Also this lead to filtering problems when sync with "file-sync". - * Uncomment this line again when OpenSync is fixed! - * - * mGroup.setObjectTypeEnabled( objectTypes[ i ], true ); - */ - } else { - kdDebug() << "Disabled object type: " << objectTypes[ i ] << endl; - mGroup.setObjectTypeEnabled( objectTypes[ i ], false ); - } - } -} - -#include "syncprocess.moc" diff --git a/kitchensync/src/syncprocess.h b/kitchensync/src/syncprocess.h deleted file mode 100644 index f510875c5..000000000 --- a/kitchensync/src/syncprocess.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> - - 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. - - 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 SYNCPROCESS_H -#define SYNCPROCESS_H - -#include <tqobject.h> - -#include <libqopensync/group.h> - -namespace QSync { -class Engine; -} - -class SyncProcess : public TQObject -{ - Q_OBJECT - - - public: - SyncProcess( const QSync::Group &group ); - ~SyncProcess(); - - QSync::Group group() const { return mGroup; } - QSync::Engine* engine() const { return mEngine; } - - TQString groupStatus() const; - TQString memberStatus( const QSync::Member &member ) const; - - QSync::Result addMember( const QSync::Plugin &plugin ); - - void reinitEngine(); - - /** apply object type filter hack **/ - void applyObjectTypeFilter(); - - signals: - /** - This signal is emitted whenever the engine has changed ( reinitialized ). - */ - void engineChanged( QSync::Engine *engine ); - - private: - QSync::Group mGroup; - QSync::Engine *mEngine; -}; - -#endif diff --git a/kitchensync/src/syncprocessmanager.cpp b/kitchensync/src/syncprocessmanager.cpp deleted file mode 100644 index 0485e156f..000000000 --- a/kitchensync/src/syncprocessmanager.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 "syncprocessmanager.h" - -#include "syncprocess.h" - -#include <libqopensync/environment.h> - -#include <kstaticdeleter.h> -#include <tdemessagebox.h> -#include <tdelocale.h> - -static KStaticDeleter<SyncProcessManager> selfDeleter; - -SyncProcessManager *SyncProcessManager::mSelf = 0; - -SyncProcessManager *SyncProcessManager::self() -{ - if ( !mSelf ) { - selfDeleter.setObject( mSelf, new SyncProcessManager() ); - } - return mSelf; -} - -SyncProcessManager::SyncProcessManager() -{ - mEnvironment = new QSync::Environment; - QSync::Result result = mEnvironment->initialize(); - if ( result.isError() ) { - KMessageBox::error( 0, i18n("Error initializing OpenSync.\n%1") - .arg( result.message() ) ); - } else { - init( mEnvironment ); - } -} - -SyncProcessManager::~SyncProcessManager() -{ - TQValueList<SyncProcess*>::Iterator it; - for ( it = mProcesses.begin(); it != mProcesses.end(); ++it ) - delete *it; - - mProcesses.clear(); - - mEnvironment->finalize(); - delete mEnvironment; -} - -int SyncProcessManager::count() const -{ - return mProcesses.count(); -} - -SyncProcess* SyncProcessManager::at( int pos ) const -{ - if ( pos < 0 || pos >= (int)mProcesses.count() ) - return 0; - - return mProcesses[ pos ]; -} - -SyncProcess* SyncProcessManager::byGroup( const QSync::Group &group ) -{ - TQValueList<SyncProcess*>::Iterator it; - for ( it = mProcesses.begin(); it != mProcesses.end(); ++it ) - if ( (*it)->group() == group ) - return *it; - - return 0; -} - -SyncProcess* SyncProcessManager::byGroupName( const TQString &name ) -{ - TQValueList<SyncProcess*>::Iterator it; - for ( it = mProcesses.begin(); it != mProcesses.end(); ++it ) - if ( (*it)->group().name() == name ) - return *it; - - return 0; -} - -void SyncProcessManager::addGroup( const TQString &name ) -{ - SyncProcess* process = byGroupName( name ); - if ( !process ) { - QSync::Group group = mEnvironment->addGroup(); - group.setName( name ); - group.save(); - - mProcesses.append( new SyncProcess( group ) ); - - emit changed(); - } else - tqDebug( "Try to add duplicate" ); -} - -void SyncProcessManager::remove( SyncProcess *syncProcess ) -{ - if ( syncProcess ) { - mProcesses.remove( syncProcess ); - const QSync::Group group = syncProcess->group(); - delete syncProcess; - - mEnvironment->removeGroup( group ); - - emit changed(); - } -} - -void SyncProcessManager::init( QSync::Environment *environment ) -{ - QSync::Environment::GroupIterator it( environment->groupBegin() ); - for ( ; it != environment->groupEnd(); ++it ) { - /** - * We check whether the group is valid before we append them - * to mProcesses. That avoids crashes if the plugin of one of - * the members isn't loaded (e.g. not installed). - */ - const QSync::Group group = *it; - int count = group.memberCount(); - - bool isValid = true; - for ( int i = 0; i < count; ++i ) { - const QSync::Member member = group.memberAt( i ); - - if ( !member.isValid() ) { - isValid = false; - break; - } - } - - if ( isValid ) - mProcesses.append( new SyncProcess( *it ) ); - } - - emit changed(); -} - -QSync::Result SyncProcessManager::addMember( SyncProcess *process, - const QSync::Plugin &plugin ) -{ - Q_ASSERT( process ); - - QSync::Result result = process->addMember( plugin ); - if ( !result.isError() ) { - process->group().save(); - emit syncProcessChanged( process ); - } - - return result; -} - -#include "syncprocessmanager.moc" diff --git a/kitchensync/src/syncprocessmanager.h b/kitchensync/src/syncprocessmanager.h deleted file mode 100644 index 17adf19d9..000000000 --- a/kitchensync/src/syncprocessmanager.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> - - 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. - - 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 SYNCPROCESSMANAGER_H -#define SYNCPROCESSMANAGER_H - -#include <tqobject.h> - -#include <libqopensync/group.h> - -namespace QSync { -class Environment; -} - -class SyncProcess; - -class SyncProcessManager : public TQObject -{ - Q_OBJECT - - public: - static SyncProcessManager *self(); - - /** - Destroys the SyncProcessList. - */ - ~SyncProcessManager(); - - /** - Return OpenSync Environment. - */ - QSync::Environment *environment() const { return mEnvironment; } - - /** - Returns the number of SyncProcesses. - */ - int count() const; - - /** - Returns the SyncProcess at position @param pos. - */ - SyncProcess* at( int pos ) const; - - /** - Returns the SyncProcess with the given @param group. - */ - SyncProcess* byGroup( const QSync::Group &group ); - - /** - Returns the SyncProcess with the given group @param name. - */ - SyncProcess* byGroupName( const TQString &name ); - - /** - Adds a group with given @param name. - */ - void addGroup( const TQString &name ); - - /** - Removes the given @param sync process. - */ - void remove( SyncProcess *syncProcess ); - - /** - Adds @param plugin instance as member to the group of @param process. - */ - QSync::Result addMember( SyncProcess *process, const QSync::Plugin &plugin ); - - signals: - void changed(); - void syncProcessChanged( SyncProcess *process ); - - private: - SyncProcessManager(); - - void init( QSync::Environment *environment ); - - TQValueList<SyncProcess*> mProcesses; - QSync::Environment *mEnvironment; - - static SyncProcessManager *mSelf; -}; - -#endif diff --git a/kitchensync/src/xmldiffalgo.cpp b/kitchensync/src/xmldiffalgo.cpp deleted file mode 100644 index b5f4890fc..000000000 --- a/kitchensync/src/xmldiffalgo.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2006 Daniel Gollub <dgollub@suse.de> - - This program 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 "xmldiffalgo.h" - -#include <kdebug.h> - -using namespace KSync; - -#ifndef KDE_USE_FINAL -// With --enable-final, we get the (identical) compareString from -// addresseediffalgo.cpp -// -static bool compareString( const TQString &left, const TQString &right ) -{ - if ( left.isEmpty() && right.isEmpty() ) - return true; - else - return left == right; -} -#endif - -XmlDiffAlgo::XmlDiffAlgo( const TQString &leftXml, const TQString &rightXml ) -{ - kdDebug() << __func__ << " " << __LINE__ << endl; - - mLeftXml.setContent( leftXml ); - mRightXml.setContent( rightXml ); - -} - -XmlDiffAlgo::XmlDiffAlgo( const TQDomDocument &leftXml, const TQDomDocument &rightXml ) - : mLeftXml( leftXml ), mRightXml( rightXml ) -{ - kdDebug() << __func__ << " " << __LINE__ << endl; -} - -void XmlDiffAlgo::appendSingleNodes(TQDomElement &element, bool isLeft) -{ - TQDomNode node; - - for ( node = element.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement child = node.toElement(); - - if (isLeft) - additionalLeftField( node.nodeName(), child.text() ); - else - additionalRightField( node.nodeName(), child.text() ); - } - -} - -void XmlDiffAlgo::appendConflictNodes(TQDomElement &leftElement, TQDomElement &rightElement) -{ - TQDomNode left, right; - TQDomElement leftChild, rightChild; - - for ( left = leftElement.firstChild(); !left.isNull(); left = left.nextSibling() ) { - leftChild = left.toElement(); - - for ( right = rightElement.firstChild(); !right.isNull(); right = right.nextSibling() ) { - rightChild = right.toElement(); - - if ( leftChild.tagName() != rightChild.tagName() ) - continue; - - if (leftChild.text().isEmpty() || rightChild.text().isEmpty()) - continue; - - TQString id = leftChild.tagName(); - if (id == "Content") - id = left.parentNode().nodeName(); - - conflictField( id, leftChild.text(), rightChild.text() ); - - left.parentNode().removeChild( left ); - left = leftElement.firstChild(); - - right.parentNode().removeChild( right ); - right = rightElement.firstChild(); - - } - } -} - -void XmlDiffAlgo::compareNode(TQDomElement &leftElement, TQDomElement &rightElement) -{ - TQDomNode left, right; - TQDomElement leftChild, rightChild; - TQDomNodeList nlist; -top:; - - for ( left = leftElement.firstChild(); !left.isNull(); left = left.nextSibling() ) { - leftChild = left.toElement(); - - for ( right = rightElement.firstChild(); !right.isNull(); right = right.nextSibling() ) { - rightChild = right.toElement(); - - if (leftChild.tagName() != rightChild.tagName()) - continue; - - if ( left.childNodes().count() > 1 && right.childNodes().count() > 1 ) { - compareNode( leftChild, rightChild ); - - if ( !left.hasChildNodes() && !right.hasChildNodes() ) { - left.parentNode().removeChild( left ); - right.parentNode().removeChild( right ); - goto top; - } - - break; - } - - if ( leftChild.text() == rightChild.text() ) { - TQString id = leftChild.tagName(); - - if ( id == "Content" ) - id = left.parentNode().nodeName(); - - if ( id != "Type" ) - //matchingField( id, leftChild.text(), rightChild.text() ); - - left.parentNode().removeChild( left ); - right.parentNode().removeChild( right ); - goto top; - } - } - } - - appendConflictNodes(rightElement, leftElement); - - appendSingleNodes(rightElement, false); - appendSingleNodes(leftElement, true); -} - -void XmlDiffAlgo::run() -{ - kdDebug() << __func__ << endl; - begin(); - - TQDomElement leftElement = mLeftXml.documentElement(); - TQDomElement rightElement = mRightXml.documentElement(); - - compareNode( leftElement, rightElement ); - - end(); -} - diff --git a/kitchensync/src/xmldiffalgo.h b/kitchensync/src/xmldiffalgo.h deleted file mode 100644 index 8e3dcbfaa..000000000 --- a/kitchensync/src/xmldiffalgo.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - This file is part of KitchenSync - - Copyright (c) 2006 Daniel Gollub <dgollub@suse.de> - - This program 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 KSYNC_XMLDIFFALGO_H -#define KSYNC_XMLDIFFALGO_H - -#include <tqdom.h> - -#include <libtdepim/diffalgo.h> - -using namespace KPIM; - -namespace KSync { - -class XmlDiffAlgo : public DiffAlgo -{ - public: - XmlDiffAlgo( const TQString &leftXml, const TQString &rightXml ); - XmlDiffAlgo( const TQDomDocument &leftXml, const TQDomDocument &rightXml ); - - void run(); - - private: - void appendConflictNodes(TQDomElement &leftElement, TQDomElement &rightElement); - void appendSingleNodes(TQDomElement &element, bool isLeft); - - - void compareNode(TQDomElement &leftElement, TQDomElement &rightElement); - - TQDomDocument mLeftXml; - TQDomDocument mRightXml; -}; - -} - -#endif |