summaryrefslogtreecommitdiffstats
path: root/kpilot/kpilot
diff options
context:
space:
mode:
Diffstat (limited to 'kpilot/kpilot')
-rw-r--r--kpilot/kpilot/CMakeLists.txt180
-rw-r--r--kpilot/kpilot/Icons/CMakeLists.txt4
-rw-r--r--kpilot/kpilot/Icons/Makefile.am19
-rw-r--r--kpilot/kpilot/Icons/busysync.pngbin2872 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-action-backup.pngbin747 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-action-busysync.pngbin705 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-action-fastsync.pngbin705 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-action-fullsync.pngbin674 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-action-hotsync.pngbin701 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-action-listsync.pngbin427 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-action-nosync.pngbin844 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-action-restore.pngbin787 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr16-app-kpilotDaemon.pngbin712 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-action-backup.pngbin1036 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-action-busysync.pngbin1119 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-action-fastsync.pngbin1052 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-action-fullsync.pngbin994 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-action-hotsync.pngbin984 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-action-listsync.pngbin628 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-action-nosync.pngbin1462 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-action-restore.pngbin1060 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr22-app-kpilotDaemon.pngbin1151 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr32-action-fastsync.pngbin1638 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr32-action-fullsync.pngbin1577 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr32-action-hotsync.pngbin1647 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr32-action-listsync.pngbin972 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr32-app-kpilotDaemon.pngbin1836 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr48-action-fastsync.pngbin2768 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr48-action-fullsync.pngbin2675 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr48-action-hotsync.pngbin2769 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr48-action-listsync.pngbin1608 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr48-app-kpilotDaemon.pngbin3228 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr64-action-kpilotaddress.pngbin5176 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr64-action-kpilotbhotsync.pngbin5163 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr64-action-kpilotcalendar.pngbin5187 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr64-action-kpilotdb.pngbin4988 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr64-action-kpilotfileinstaller.pngbin4489 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr64-action-kpilotknotes.pngbin4808 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/cr64-action-kpilottodo.pngbin4526 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/fastsync.pngbin1052 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/hi16-app-kpilot.pngbin712 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/hi22-app-kpilot.pngbin1151 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/hi32-app-kpilot.pngbin1836 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/hi48-app-kpilot.pngbin3228 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/hotsync.pngbin3832 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/kpilot-splash.pngbin68819 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/mini-kpilot.pngbin1126 -> 0 bytes
-rw-r--r--kpilot/kpilot/Icons/nosync.pngbin844 -> 0 bytes
-rw-r--r--kpilot/kpilot/Makefile-standalone167
-rw-r--r--kpilot/kpilot/Makefile.am104
-rw-r--r--kpilot/kpilot/addressEditor.cc271
-rw-r--r--kpilot/kpilot/addressEditor.h87
-rw-r--r--kpilot/kpilot/addressWidget.cc733
-rw-r--r--kpilot/kpilot/addressWidget.h144
-rw-r--r--kpilot/kpilot/conduitConfigDialog.cc849
-rw-r--r--kpilot/kpilot/conduitConfigDialog.h112
-rw-r--r--kpilot/kpilot/datebookWidget.cc133
-rw-r--r--kpilot/kpilot/datebookWidget.h66
-rw-r--r--kpilot/kpilot/dbAppInfoEditor.cc105
-rw-r--r--kpilot/kpilot/dbAppInfoEditor.h51
-rw-r--r--kpilot/kpilot/dbFlagsEditor.cc157
-rw-r--r--kpilot/kpilot/dbFlagsEditor.h56
-rw-r--r--kpilot/kpilot/dbFlagsEditor_base.ui376
-rw-r--r--kpilot/kpilot/dbFlagsEditor_base.ui.h24
-rw-r--r--kpilot/kpilot/dbRecordEditor.cc235
-rw-r--r--kpilot/kpilot/dbRecordEditor.h94
-rw-r--r--kpilot/kpilot/dbRecordEditor_base.ui151
-rw-r--r--kpilot/kpilot/dbSelectionDialog.cc144
-rw-r--r--kpilot/kpilot/dbSelectionDialog.h60
-rw-r--r--kpilot/kpilot/dbSelection_base.ui80
-rw-r--r--kpilot/kpilot/dbviewerWidget.cc440
-rw-r--r--kpilot/kpilot/dbviewerWidget.h91
-rw-r--r--kpilot/kpilot/fileInstallWidget.cc304
-rw-r--r--kpilot/kpilot/fileInstallWidget.h92
-rw-r--r--kpilot/kpilot/fileInstaller.cc184
-rw-r--r--kpilot/kpilot/fileInstaller.h82
-rw-r--r--kpilot/kpilot/hotSync.cc1156
-rw-r--r--kpilot/kpilot/hotSync.h175
-rw-r--r--kpilot/kpilot/internalEditorAction.cc394
-rw-r--r--kpilot/kpilot/internalEditorAction.h68
-rw-r--r--kpilot/kpilot/kpilot.cc1136
-rw-r--r--kpilot/kpilot/kpilot.desktop86
-rw-r--r--kpilot/kpilot/kpilot.gifbin295 -> 0 bytes
-rw-r--r--kpilot/kpilot/kpilot.h214
-rw-r--r--kpilot/kpilot/kpilot.kcfg186
-rw-r--r--kpilot/kpilot/kpilot.magic12
-rw-r--r--kpilot/kpilot/kpilot.upd34
-rw-r--r--kpilot/kpilot/kpilotConfig.cc346
-rw-r--r--kpilot/kpilot/kpilotConfig.h126
-rw-r--r--kpilot/kpilot/kpilotConfigDialog.cc528
-rw-r--r--kpilot/kpilot/kpilotConfigDialog.h134
-rw-r--r--kpilot/kpilot/kpilotConfigDialog_backup.ui207
-rw-r--r--kpilot/kpilot/kpilotConfigDialog_device.ui189
-rw-r--r--kpilot/kpilot/kpilotConfigDialog_startup.ui118
-rw-r--r--kpilot/kpilot/kpilotConfigDialog_sync.ui171
-rw-r--r--kpilot/kpilot/kpilotConfigDialog_viewers.ui149
-rw-r--r--kpilot/kpilot/kpilotConfigWizard.cc233
-rw-r--r--kpilot/kpilot/kpilotConfigWizard.h58
-rw-r--r--kpilot/kpilot/kpilotConfigWizard_address.kcfgc7
-rw-r--r--kpilot/kpilot/kpilotConfigWizard_app.ui112
-rw-r--r--kpilot/kpilot/kpilotConfigWizard_notes.kcfgc7
-rw-r--r--kpilot/kpilot/kpilotConfigWizard_user.ui168
-rw-r--r--kpilot/kpilot/kpilotConfigWizard_vcal.kcfgc7
-rw-r--r--kpilot/kpilot/kpilotDCOP.h75
-rw-r--r--kpilot/kpilot/kpilotProbeDialog.cc363
-rw-r--r--kpilot/kpilot/kpilotProbeDialog.h102
-rw-r--r--kpilot/kpilot/kpilotSettings.kcfgc7
-rw-r--r--kpilot/kpilot/kpilot_config.desktop156
-rw-r--r--kpilot/kpilot/kpilotconduit.desktop59
-rw-r--r--kpilot/kpilot/kpilotdaemon.desktop42
-rw-r--r--kpilot/kpilot/kpilotui.rc53
-rw-r--r--kpilot/kpilot/kroupware.cc311
-rw-r--r--kpilot/kpilot/kroupware.h87
-rw-r--r--kpilot/kpilot/listCat.cc272
-rw-r--r--kpilot/kpilot/listCat.h229
-rw-r--r--kpilot/kpilot/listItems.cc242
-rw-r--r--kpilot/kpilot/listItems.h114
-rw-r--r--kpilot/kpilot/logFile.cc128
-rw-r--r--kpilot/kpilot/logFile.h64
-rw-r--r--kpilot/kpilot/logWidget.cc396
-rw-r--r--kpilot/kpilot/logWidget.h90
-rw-r--r--kpilot/kpilot/loggerDCOP.h58
-rw-r--r--kpilot/kpilot/main-config.cc0
-rw-r--r--kpilot/kpilot/main-test.cc437
-rw-r--r--kpilot/kpilot/memoWidget.cc803
-rw-r--r--kpilot/kpilot/memoWidget.h112
-rw-r--r--kpilot/kpilot/pilot-addresses.c362
-rw-r--r--kpilot/kpilot/pilotComponent.cc190
-rw-r--r--kpilot/kpilot/pilotComponent.h141
-rw-r--r--kpilot/kpilot/pilotDaemon.cc1404
-rw-r--r--kpilot/kpilot/pilotDaemon.h279
-rw-r--r--kpilot/kpilot/pilotDaemonDCOP.h103
-rw-r--r--kpilot/kpilot/stamp-h.in0
-rw-r--r--kpilot/kpilot/syncCalendar.cc87
-rw-r--r--kpilot/kpilot/todoEditor.cc173
-rw-r--r--kpilot/kpilot/todoEditor.h74
-rw-r--r--kpilot/kpilot/todoEditor_base.ui180
-rw-r--r--kpilot/kpilot/todoWidget.cc608
-rw-r--r--kpilot/kpilot/todoWidget.h167
139 files changed, 0 insertions, 19584 deletions
diff --git a/kpilot/kpilot/CMakeLists.txt b/kpilot/kpilot/CMakeLists.txt
deleted file mode 100644
index 9be24467..00000000
--- a/kpilot/kpilot/CMakeLists.txt
+++ /dev/null
@@ -1,180 +0,0 @@
-link_directories(${CMAKE_BINARY_DIR}/lib ${CMAKE_CURRENT_BINARY_DIR})
-
-# Don't forget to include output directory, otherwise
-# the UI file won't be wrapped!
-include_directories(
- ${CMAKE_BINARY_DIR}/lib
- ${CMAKE_SOURCE_DIR}/lib
- ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-
-###
-#
-# Settings (KConfigXT) shared between various parts of KPilot
-#
-set(settings_SRC
- kpilotConfig.cc
-)
-
-kde3_add_kcfg_files(settings_SRC kpilotSettings.kcfgc)
-
-###
-#
-# The KCM for KPilot, used by the config dialog and the embedding in Kontact
-#
-set(kcmpilot_SRCS
- ${settings_SRC}
- kpilotConfigWizard.cc
- dbSelectionDialog.cc
- kpilotConfigDialog.cc
- conduitConfigDialog.cc
- kpilotProbeDialog.cc
-)
-
-set(kcmpilot_KCFGS
- kpilotConfigWizard_address.kcfgc
- kpilotConfigWizard_notes.kcfgc
- kpilotConfigWizard_vcal.kcfgc
-)
-
-set(kcmpilot_UIS
- kpilotConfigDialog_device.ui
- kpilotConfigDialog_sync.ui
- kpilotConfigDialog_startup.ui
- kpilotConfigDialog_viewers.ui
- kpilotConfigDialog_backup.ui
- kpilotConfigWizard_user.ui
- kpilotConfigWizard_app.ui
- dbSelection_base.ui
-)
-
-kde3_add_ui_files(kcmpilot_SRCS ${kcmpilot_UIS})
-kde3_add_kcfg_files(kcmpilot_SRCS ${kcmpilot_KCFGS})
-kde3_add_dcop_stubs(kcmpilot_SRCS pilotDaemonDCOP.h)
-kde3_automoc(${kcmpilot_SRCS})
-
-# Now add these generated files to the ADD_LIBRARY step
-# If this is NOT done, then the ui_*.h files will not be generated
-add_library(kcm_kpilot SHARED ${kcmpilot_SRCS})
-set_target_properties(kcm_kpilot PROPERTIES
- LOCATION ${KDE3_PLUGIN_INSTALL_DIR}
- PREFIX ""
-)
-
-###
-#
-# Most simple daemon-like application: kpilotTest, which
-# runs whatever the command-line tells it to.
-#
-set(kpilotTest_SRCS
- ${settings_SRC}
- hotSync.cc
- logWidget.cc
- pilotComponent.cc
- main-test.cc
-)
-# Acts as a receiver for DCOP log messages
-kde3_add_dcop_skels(kpilotTest_SRCS loggerDCOP.h)
-
-kde3_automoc(${kpilotTest_SRCS})
-add_executable(kpilotTest ${kpilotTest_SRCS})
-target_link_libraries(kpilotTest ${QT_LIBRARIES} kpilot kdeui kio)
-kpilot_rpath(kpilotTest)
-
-###
-#
-# The real KPilot daemon.
-#
-set(kpilotDaemon_SRCS
- ${settings_SRC}
- hotSync.cc
- fileInstaller.cc
- internalEditorAction.cc
- logFile.cc
- pilotDaemon.cc
-)
-# Both sends and receives DCOP log messages. Talks to KPilot.
-kde3_add_dcop_skels(kpilotDaemon_SRCS loggerDCOP.h pilotDaemonDCOP.h)
-kde3_add_dcop_stubs(kpilotDaemon_SRCS loggerDCOP.h kpilotDCOP.h)
-kde3_automoc(${kpilotDaemon_SRCS})
-add_executable(kpilotDaemon ${kpilotDaemon_SRCS})
-target_link_libraries(kpilotDaemon ${QT_LIBRARIES} kpilot kdeui kio)
-kpilot_rpath(kpilotDaemon)
-
-###
-#
-# The KPilot executable (viewer / editor / configuration).
-#
-set(kpilot_SRCS
- ${settings_SRC}
- logWidget.cc
- kpilot.cc
- dbviewerWidget.cc
- dbFlagsEditor.cc
- dbRecordEditor.cc
- dbAppInfoEditor.cc
- pilotComponent.cc
- memoWidget.cc
- addressWidget.cc
- addressEditor.cc
- datebookWidget.cc
- todoWidget.cc
- todoEditor.cc
- fileInstaller.cc
- fileInstallWidget.cc
- listItems.cc
-)
-
-set(kpilot_UIS
- dbFlagsEditor_base.ui
- todoEditor_base.ui
-)
-
-kde3_add_ui_files(kpilot_SRCS ${kpilot_UIS})
-# Talks to the daemon. Listens as itself.
-kde3_add_dcop_skels(kpilot_SRCS loggerDCOP.h kpilotDCOP.h)
-kde3_add_dcop_stubs(kpilot_SRCS pilotDaemonDCOP.h)
-kde3_automoc(${kpilot_SRCS})
-add_executable(kpilot_bin ${kpilot_SRCS})
-target_link_libraries(kpilot_bin ${QT_LIBRARIES} kpilot kutils kdeui kio)
-kpilot_rpath(kpilot_bin)
-set_target_properties(kpilot_bin PROPERTIES
- OUTPUT_NAME kpilot
-)
-
-######################### INSTALL STUFF #######################################
-
-kde3_install_libtool_file(kcm_kpilot)
-
-install(
- TARGETS kcm_kpilot kpilot_bin kpilotDaemon
- LIBRARY DESTINATION ${KDE3_PLUGIN_INSTALL_DIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
-)
-
-install( FILES kpilotui.rc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/apps/kpilot)
-
-install(
- FILES kpilot.desktop kpilotdaemon.desktop DESTINATION ${KDE3_XDG_APPS_DIR}
-)
-
-install(
- FILES kpilotconduit.desktop DESTINATION ${KDE3_SERVICETYPES_DIR}
-)
-
-install(
- FILES kpilot_config.desktop DESTINATION ${KDE3_SERVICES_DIR}
-)
-
-install (
- FILES kpilot.upd
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/apps/kconf_update
-)
-
-install(
- FILES kpilot.kcfg DESTINATION ${KDE3_KCFG_DIR}
-)
-
-add_subdirectory(Icons)
diff --git a/kpilot/kpilot/Icons/CMakeLists.txt b/kpilot/kpilot/Icons/CMakeLists.txt
deleted file mode 100644
index b0be5caa..00000000
--- a/kpilot/kpilot/Icons/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-kde3_install_icons_custom( hicolor )
-
-install( FILES kpilot-splash.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/apps/kpilot/pics/)
diff --git a/kpilot/kpilot/Icons/Makefile.am b/kpilot/kpilot/Icons/Makefile.am
deleted file mode 100644
index 9dc8ffcc..00000000
--- a/kpilot/kpilot/Icons/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-METASOURCES = AUTO
-
-kpilotDaemonicondir = $(kde_datadir)/kpilot/icons
-kpilotDaemonicon_ICON = hotsync busysync nosync
-
-kpiloticondir = $(kde_datadir)/kpilot/icons
-kpiloticon_ICON = backup fastsync fullsync listsync restore \
- kpilotaddress \
- kpilotknotes \
- kpilotfileinstaller \
- kpilotdb \
- kpilotcalendar \
- kpilottodo \
- kpilotbhotsync
-
-KDE_ICON = kpilot kpilotDaemon
-
-kpilotpicsdir = $(kde_datadir)/kpilot/pics
-kpilotpics_DATA = kpilot-splash.png
diff --git a/kpilot/kpilot/Icons/busysync.png b/kpilot/kpilot/Icons/busysync.png
deleted file mode 100644
index 189ec1b1..00000000
--- a/kpilot/kpilot/Icons/busysync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-action-backup.png b/kpilot/kpilot/Icons/cr16-action-backup.png
deleted file mode 100644
index da55d07d..00000000
--- a/kpilot/kpilot/Icons/cr16-action-backup.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-action-busysync.png b/kpilot/kpilot/Icons/cr16-action-busysync.png
deleted file mode 100644
index 66e8837c..00000000
--- a/kpilot/kpilot/Icons/cr16-action-busysync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-action-fastsync.png b/kpilot/kpilot/Icons/cr16-action-fastsync.png
deleted file mode 100644
index 6eca11fa..00000000
--- a/kpilot/kpilot/Icons/cr16-action-fastsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-action-fullsync.png b/kpilot/kpilot/Icons/cr16-action-fullsync.png
deleted file mode 100644
index d6501b5b..00000000
--- a/kpilot/kpilot/Icons/cr16-action-fullsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-action-hotsync.png b/kpilot/kpilot/Icons/cr16-action-hotsync.png
deleted file mode 100644
index bdcaf824..00000000
--- a/kpilot/kpilot/Icons/cr16-action-hotsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-action-listsync.png b/kpilot/kpilot/Icons/cr16-action-listsync.png
deleted file mode 100644
index 817f34ca..00000000
--- a/kpilot/kpilot/Icons/cr16-action-listsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-action-nosync.png b/kpilot/kpilot/Icons/cr16-action-nosync.png
deleted file mode 100644
index 61bf3bda..00000000
--- a/kpilot/kpilot/Icons/cr16-action-nosync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-action-restore.png b/kpilot/kpilot/Icons/cr16-action-restore.png
deleted file mode 100644
index 69af2c81..00000000
--- a/kpilot/kpilot/Icons/cr16-action-restore.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr16-app-kpilotDaemon.png b/kpilot/kpilot/Icons/cr16-app-kpilotDaemon.png
deleted file mode 100644
index f37c5ffc..00000000
--- a/kpilot/kpilot/Icons/cr16-app-kpilotDaemon.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-action-backup.png b/kpilot/kpilot/Icons/cr22-action-backup.png
deleted file mode 100644
index d1ab921d..00000000
--- a/kpilot/kpilot/Icons/cr22-action-backup.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-action-busysync.png b/kpilot/kpilot/Icons/cr22-action-busysync.png
deleted file mode 100644
index 71f5ba9c..00000000
--- a/kpilot/kpilot/Icons/cr22-action-busysync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-action-fastsync.png b/kpilot/kpilot/Icons/cr22-action-fastsync.png
deleted file mode 100644
index 926b3bf5..00000000
--- a/kpilot/kpilot/Icons/cr22-action-fastsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-action-fullsync.png b/kpilot/kpilot/Icons/cr22-action-fullsync.png
deleted file mode 100644
index ea3b8d52..00000000
--- a/kpilot/kpilot/Icons/cr22-action-fullsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-action-hotsync.png b/kpilot/kpilot/Icons/cr22-action-hotsync.png
deleted file mode 100644
index 11eceb43..00000000
--- a/kpilot/kpilot/Icons/cr22-action-hotsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-action-listsync.png b/kpilot/kpilot/Icons/cr22-action-listsync.png
deleted file mode 100644
index 3453a1f7..00000000
--- a/kpilot/kpilot/Icons/cr22-action-listsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-action-nosync.png b/kpilot/kpilot/Icons/cr22-action-nosync.png
deleted file mode 100644
index 3728404f..00000000
--- a/kpilot/kpilot/Icons/cr22-action-nosync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-action-restore.png b/kpilot/kpilot/Icons/cr22-action-restore.png
deleted file mode 100644
index 8b183f8d..00000000
--- a/kpilot/kpilot/Icons/cr22-action-restore.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr22-app-kpilotDaemon.png b/kpilot/kpilot/Icons/cr22-app-kpilotDaemon.png
deleted file mode 100644
index 4a1baeba..00000000
--- a/kpilot/kpilot/Icons/cr22-app-kpilotDaemon.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr32-action-fastsync.png b/kpilot/kpilot/Icons/cr32-action-fastsync.png
deleted file mode 100644
index f6a07151..00000000
--- a/kpilot/kpilot/Icons/cr32-action-fastsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr32-action-fullsync.png b/kpilot/kpilot/Icons/cr32-action-fullsync.png
deleted file mode 100644
index 158b23e9..00000000
--- a/kpilot/kpilot/Icons/cr32-action-fullsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr32-action-hotsync.png b/kpilot/kpilot/Icons/cr32-action-hotsync.png
deleted file mode 100644
index 8316a161..00000000
--- a/kpilot/kpilot/Icons/cr32-action-hotsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr32-action-listsync.png b/kpilot/kpilot/Icons/cr32-action-listsync.png
deleted file mode 100644
index a6b5268b..00000000
--- a/kpilot/kpilot/Icons/cr32-action-listsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr32-app-kpilotDaemon.png b/kpilot/kpilot/Icons/cr32-app-kpilotDaemon.png
deleted file mode 100644
index 5b44f689..00000000
--- a/kpilot/kpilot/Icons/cr32-app-kpilotDaemon.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr48-action-fastsync.png b/kpilot/kpilot/Icons/cr48-action-fastsync.png
deleted file mode 100644
index 23d353f7..00000000
--- a/kpilot/kpilot/Icons/cr48-action-fastsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr48-action-fullsync.png b/kpilot/kpilot/Icons/cr48-action-fullsync.png
deleted file mode 100644
index d1be74d1..00000000
--- a/kpilot/kpilot/Icons/cr48-action-fullsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr48-action-hotsync.png b/kpilot/kpilot/Icons/cr48-action-hotsync.png
deleted file mode 100644
index dfc98ff4..00000000
--- a/kpilot/kpilot/Icons/cr48-action-hotsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr48-action-listsync.png b/kpilot/kpilot/Icons/cr48-action-listsync.png
deleted file mode 100644
index b3384e4b..00000000
--- a/kpilot/kpilot/Icons/cr48-action-listsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr48-app-kpilotDaemon.png b/kpilot/kpilot/Icons/cr48-app-kpilotDaemon.png
deleted file mode 100644
index 85710e5f..00000000
--- a/kpilot/kpilot/Icons/cr48-app-kpilotDaemon.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr64-action-kpilotaddress.png b/kpilot/kpilot/Icons/cr64-action-kpilotaddress.png
deleted file mode 100644
index a73e1482..00000000
--- a/kpilot/kpilot/Icons/cr64-action-kpilotaddress.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr64-action-kpilotbhotsync.png b/kpilot/kpilot/Icons/cr64-action-kpilotbhotsync.png
deleted file mode 100644
index c01b6e8e..00000000
--- a/kpilot/kpilot/Icons/cr64-action-kpilotbhotsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr64-action-kpilotcalendar.png b/kpilot/kpilot/Icons/cr64-action-kpilotcalendar.png
deleted file mode 100644
index 6bbe65db..00000000
--- a/kpilot/kpilot/Icons/cr64-action-kpilotcalendar.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr64-action-kpilotdb.png b/kpilot/kpilot/Icons/cr64-action-kpilotdb.png
deleted file mode 100644
index f14bd858..00000000
--- a/kpilot/kpilot/Icons/cr64-action-kpilotdb.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr64-action-kpilotfileinstaller.png b/kpilot/kpilot/Icons/cr64-action-kpilotfileinstaller.png
deleted file mode 100644
index 39837225..00000000
--- a/kpilot/kpilot/Icons/cr64-action-kpilotfileinstaller.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr64-action-kpilotknotes.png b/kpilot/kpilot/Icons/cr64-action-kpilotknotes.png
deleted file mode 100644
index ecf90278..00000000
--- a/kpilot/kpilot/Icons/cr64-action-kpilotknotes.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/cr64-action-kpilottodo.png b/kpilot/kpilot/Icons/cr64-action-kpilottodo.png
deleted file mode 100644
index 2d5275c5..00000000
--- a/kpilot/kpilot/Icons/cr64-action-kpilottodo.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/fastsync.png b/kpilot/kpilot/Icons/fastsync.png
deleted file mode 100644
index 926b3bf5..00000000
--- a/kpilot/kpilot/Icons/fastsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/hi16-app-kpilot.png b/kpilot/kpilot/Icons/hi16-app-kpilot.png
deleted file mode 100644
index f37c5ffc..00000000
--- a/kpilot/kpilot/Icons/hi16-app-kpilot.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/hi22-app-kpilot.png b/kpilot/kpilot/Icons/hi22-app-kpilot.png
deleted file mode 100644
index 4a1baeba..00000000
--- a/kpilot/kpilot/Icons/hi22-app-kpilot.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/hi32-app-kpilot.png b/kpilot/kpilot/Icons/hi32-app-kpilot.png
deleted file mode 100644
index 5b44f689..00000000
--- a/kpilot/kpilot/Icons/hi32-app-kpilot.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/hi48-app-kpilot.png b/kpilot/kpilot/Icons/hi48-app-kpilot.png
deleted file mode 100644
index 85710e5f..00000000
--- a/kpilot/kpilot/Icons/hi48-app-kpilot.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/hotsync.png b/kpilot/kpilot/Icons/hotsync.png
deleted file mode 100644
index 62025ef7..00000000
--- a/kpilot/kpilot/Icons/hotsync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/kpilot-splash.png b/kpilot/kpilot/Icons/kpilot-splash.png
deleted file mode 100644
index fadf0d21..00000000
--- a/kpilot/kpilot/Icons/kpilot-splash.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/mini-kpilot.png b/kpilot/kpilot/Icons/mini-kpilot.png
deleted file mode 100644
index 550c8f37..00000000
--- a/kpilot/kpilot/Icons/mini-kpilot.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Icons/nosync.png b/kpilot/kpilot/Icons/nosync.png
deleted file mode 100644
index 61bf3bda..00000000
--- a/kpilot/kpilot/Icons/nosync.png
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/Makefile-standalone b/kpilot/kpilot/Makefile-standalone
deleted file mode 100644
index fbaa7a77..00000000
--- a/kpilot/kpilot/Makefile-standalone
+++ /dev/null
@@ -1,167 +0,0 @@
-# Makefile for a standalone kpilotConfig
-
-QTDIR=/usr/lib/qt-2.3.0
-KDEDIR=/vol/kde/kde-2.2
-
-MOC=$(QTDIR)/bin/moc
-UIC=$(QTDIR)/bin/uic
-DCOPIDL=$(KDEDIR)/bin/dcopidl
-DCOPIDL2CPP=$(KDEDIR)/bin/dcopidl2cpp
-
-CXX=g++
-CXXFLAGS=-DDEBUG -DDEBUG_CERR
-# INCLUDES=-I$(QTDIR)/include -I$(KDEDIR)/include
-#
-# Or, for stupid RH 7.1 systems:
-INCLUDES=-I$(QTDIR)/include -I$(KDEDIR)/include -I../lib
-LDFLAGS=-L$(KDEDIR)/lib -Wl,-R -Wl,$(KDEDIR)/lib \
- -L$(QTDIR)/lib -Wl,-R -Wl,$(QTDIR)/lib \
- -L../lib/.libs
-
-CONFIG_DISTDIR=kpilotConfig-0.2
-CONFIG_OBJS=kpilotConfig.o \
- kpilotConfigDialog.o kpilotConfigDialog_base.o \
- conduitConfigDialog.o conduitConfigDialog_base.o \
- main-config.o
-CONFIG_MOCS=kpilotConfigDialog_base.moc kpilotConfigDialog.moc \
- conduitConfigDialog.moc conduitConfigDialog_base.moc
-
-CONFIG_EXTRA=kpilotConfigDialog_base.ui conduitConfigDialog_base.ui
-CONFIG_LIBS=-lkdeui -lkfile -lkdecore -lqt -lkpilot
-
-TEST_DISTDIR=kpilotTest-0.2
-TEST_OBJS=kpilotConfig.o \
- pilotComponent.o logWidget.o \
- hotSync.o interactiveSync.o main-test.o
-TEST_MOCS= pilotComponent.moc logWidget.moc \
- interactiveSync.moc hotSync.moc
-TEST_EXTRA=pilotUser.h
-TEST_LIBS=-lkpilot -lkfile -lkdeui -lqt -lpisock
-
-KPILOT_DISTDIR=kpilot-4.2.9
-KPILOT_OBJS= pilotDaemonDCOP_stub.o \
- kpilotDCOP_skel.o \
- kpilot.o kpilotConfig.o \
- kpilotConfigDialog.o kpilotConfigDialog_base.o \
- pilotComponent.o logWidget.o memoWidget.o addressWidget.o \
- addressEditor.o \
- listItems.o \
- fileInstaller.o fileInstallWidget.o \
- conduitConfigDialog.o conduitConfigDialog_base.o
-KPILOT_MOCS=pilotComponent.moc logWidget.moc memoWidget.moc addressWidget.moc \
- fileInstaller.moc addressEditor.moc \
- fileInstallWidget.moc \
- kpilotConfigDialog_base.moc kpilotConfigDialog.moc \
- kpilot.moc
-KPILOT_EXTRA=kpilotConfigDialog_base.ui conduitConfigDialog_base.ui \
- pilotDaemonDCOP.h kpilotDCOP.h \
- pilotAppCategory.h pilotDatabase.h kpilot_on_pp.h
-KPILOT_LIBS=-lkfile -lkdeui -lqt -lkpilot -lpisock
-
-DAEMON_DISTDIR=kpilotDaemon-4.2.9
-DAEMON_OBJS= pilotDaemonDCOP_skel.o kpilotDCOP_stub.o \
- pilotDaemon.o kpilotConfig.o \
- fileInstaller.o \
- hotSync.o interactiveSync.o
-DAEMON_MOCS=pilotDaemon.moc \
- fileInstaller.moc
-DAEMON_EXTRA=pilotDaemonDCOP.h kpilotDCOP.h pilotUser.h \
- hotsync.h busysync.h
-DAEMON_LIBS=-lkfile -lkdeui -lqt -lkpilot -lpisock
-
-DISTFILES=kpilotConfig.tar.gz kpilotTest.tar.gz kpilot.tar.gz kpilotDaemon.tar.gz
-
-all : kpilotConfig kpilotTest kpilot kpilotDaemon
-
-kpilotConfig : $(CONFIG_MOCS) $(CONFIG_OBJS)
- g++ -o $@ $(CONFIG_OBJS) $(LDFLAGS) $(CONFIG_LIBS)
-
-kpilotTest : $(TEST_MOCS) $(TEST_OBJS)
- g++ -o $@ $(TEST_OBJS) $(LDFLAGS) $(TEST_LIBS)
-
-kpilot : $(KPILOT_MOCS) $(KPILOT_OBJS)
- g++ -o $@ $(KPILOT_OBJS) $(LDFLAGS) $(KPILOT_LIBS)
-
-kpilotDaemon : $(DAEMON_MOCS) $(DAEMON_OBJS)
- g++ -o $@ $(DAEMON_OBJS) $(LDFLAGS) $(DAEMON_LIBS)
-
-clean :
- rm -f $(CONFIG_OBJS) $(CONFIG_MOCS) $(KPILOT_OBJS) $(DAEMON_OBJS)
- rm -f $(TEST_OBJS) $(TEST_MOCS) $(KPILOT_MOCS) $(DAEMON_MOCS)
- rm -f $(DISTFILES)
-
-dist : $(DISTFILES)
-
-kpilotConfig.tar.gz :
- test -d $(CONFIG_DISTDIR) || mkdir $(CONFIG_DISTDIR)
- sed -e 's/^all *:.*/all : kpilotConfig/' Makefile-standalone \
- > $(CONFIG_DISTDIR)/Makefile
- -cp $(CONFIG_OBJS:%.o=%.cc) $(CONFIG_OBJS:%.o=%.h) $(CONFIG_DISTDIR)
- -cp $(CONFIG_EXTRA) $(CONFIG_DISTDIR)
- tar cvzf $@ $(CONFIG_DISTDIR)
- -rm -f $(CONFIG_DISTDIR)/*
- -rmdir $(CONFIG_DISTDIR)
-
-kpilotTest.tar.gz :
- test -d $(TEST_DISTDIR) || mkdir $(TEST_DISTDIR)
- sed -e 's/^all *:.*/all : kpilotTest/' Makefile-standalone \
- > $(TEST_DISTDIR)/Makefile
- -cp $(TEST_OBJS:%.o=%.cc) $(TEST_OBJS:%.o=%.h) $(TEST_DISTDIR)
- -cp $(TEST_EXTRA) $(TEST_DISTDIR)
- tar cvzf $@ $(TEST_DISTDIR)
- -rm -f $(TEST_DISTDIR)/*
- -rmdir $(TEST_DISTDIR)
-
-kpilot.tar.gz :
- test -d $(KPILOT_DISTDIR) || mkdir $(KPILOT_DISTDIR)
- sed -e 's/^all *:.*/all : kpilot/' Makefile-standalone \
- > $(KPILOT_DISTDIR)/Makefile
- -cp $(KPILOT_OBJS:%.o=%.cc) $(KPILOT_OBJS:%.o=%.h) $(KPILOT_DISTDIR)
- -cp $(KPILOT_EXTRA) $(KPILOT_DISTDIR)
- tar cvzf $@ $(KPILOT_DISTDIR)
- -rm -f $(KPILOT_DISTDIR)/*
- -rmdir $(KPILOT_DISTDIR)
-
-kpilotDaemon.tar.gz :
- test -d $(DAEMON_DISTDIR) || mkdir $(DAEMON_DISTDIR)
- sed -e 's/^all *:.*/all : kpilotDaemon/' Makefile-standalone \
- > $(DAEMON_DISTDIR)/Makefile
- -cp $(DAEMON_OBJS:%.o=%.cc) $(DAEMON_OBJS:%.o=%.h) $(DAEMON_DISTDIR)
- -cp $(DAEMON_EXTRA) $(DAEMON_DISTDIR)
- tar cvzf $@ $(DAEMON_DISTDIR)
- -rm -f $(DAEMON_DISTDIR)/*
- -rmdir $(DAEMON_DISTDIR)
-
-conduitConfigDialog_base.cc : conduitConfigDialog_base.h conduitConfigDialog_base.ui
- echo '#include <klocale.h>' > $@
- $(UIC) -tr i18n -i conduitConfigDialog_base.h conduitConfigDialog_base.ui | \
- sed -e "s,i18n( \"\" ),QString::null,g" >> $@
- echo '#include "conduitConfigDialog_base.moc"' >> $@
-
-conduitConfigDialog_base.h : conduitConfigDialog_base.ui
- $(UIC) -o $@ $<
-
-kpilotConfigDialog_base.cc : kpilotConfigDialog_base.h kpilotConfigDialog_base.ui
- echo '#include <klocale.h>' > $@
- $(UIC) -tr i18n -i kpilotConfigDialog_base.h kpilotConfigDialog_base.ui | \
- sed -e "s,i18n( \"\" ),QString::null,g" >> $@
- echo '#include "kpilotConfigDialog_base.moc"' >> $@
-
-kpilotConfigDialog_base.h : kpilotConfigDialog_base.ui
- $(UIC) -o $@ $<
-
-
-%.kidl : %.h
- $(DCOPIDL) $< > $@ || ( rm -f $@ ; /bin/false )
-
-%_stub.cc : %.kidl
- $(DCOPIDL2CPP) --c++-suffix cc --no-skel $<
-
-%_skel.cc : %.kidl
- $(DCOPIDL2CPP) --c++-suffix cc --no-stub $<
-
-%.o : %.cc
- g++ -c $(CXXFLAGS) $(INCLUDES) -o $@ $<
-
-%.moc : %.h
- $(MOC) -o $@ $<
diff --git a/kpilot/kpilot/Makefile.am b/kpilot/kpilot/Makefile.am
deleted file mode 100644
index a5b49091..00000000
--- a/kpilot/kpilot/Makefile.am
+++ /dev/null
@@ -1,104 +0,0 @@
-### Makefile.am for KPilot
-###
-### This is a bit of a mess, but that's partly because we build two
-### executables and one library from the sources in this dir.
-###
-###
-###
-
-SUBDIRS = Icons
-
-noinst_LTLIBRARIES = libconfiguration.la
-noinst_PROGRAMS = kpilotTest
-bin_PROGRAMS = kpilot kpilotDaemon
-kde_module_LTLIBRARIES = kcm_kpilot.la
-
-METASOURCES = AUTO
-
-INCLUDES= $(PISOCK_INCLUDE) -I$(top_srcdir)/kpilot/lib $(all_includes)
-
-libconfiguration_la_SOURCES = kpilotConfig.cc kpilotSettings.kcfgc
-libconfiguration_la_LDFLAGS = $(PISOCK_LDFLAGS) $(all_libraries)
-
-kcm_kpilot_la_SOURCES = pilotDaemonDCOP.stub kpilotConfigDialog.cc \
- kpilotConfigDialog_device.ui \
- kpilotConfigDialog_sync.ui \
- kpilotConfigDialog_startup.ui \
- kpilotConfigDialog_viewers.ui \
- kpilotConfigDialog_backup.ui \
- conduitConfigDialog.cc \
- kpilotProbeDialog.cc \
- kpilotConfigWizard_address.kcfgc \
- kpilotConfigWizard_notes.kcfgc \
- kpilotConfigWizard_vcal.kcfgc \
- kpilotConfigWizard_user.ui \
- kpilotConfigWizard_app.ui \
- kpilotConfigWizard.cc \
- dbSelectionDialog.cc dbSelection_base.ui
-kcm_kpilot_la_LDFLAGS = $(PISOCK_LDFLAGS) $(all_libraries) -module -avoid-version -no-undefined
-kcm_kpilot_la_LIBADD = $(LIB_KFILE) $(PISOCK_LIB) \
- ../lib/libkpilot.la \
- libconfiguration.la
-
-
-kpilot_SOURCES = \
- pilotDaemonDCOP.stub kpilotDCOP.skel loggerDCOP.skel \
- kpilot.cc \
- pilotComponent.cc logWidget.cc memoWidget.cc \
- addressWidget.cc addressEditor.cc \
- dbviewerWidget.cc dbFlagsEditor.cc dbFlagsEditor_base.ui \
- dbRecordEditor.cc dbAppInfoEditor.cc \
- datebookWidget.cc \
- todoWidget.cc todoEditor.cc todoEditor_base.ui \
- fileInstaller.cc fileInstallWidget.cc \
- listItems.cc
-kpilot_COMPILE_FIRST = kpilotSettings.h
-
-
-kpilotDaemon_SOURCES = \
- pilotDaemonDCOP.skel kpilotDCOP.stub loggerDCOP.stub loggerDCOP.skel \
- pilotDaemon.cc logFile.cc \
- hotSync.cc internalEditorAction.cc \
- fileInstaller.cc
-
-kpilotTest_SOURCES = \
- logWidget.cc pilotComponent.cc \
- hotSync.cc internalEditorAction.cc \
- loggerDCOP.skel \
- main-test.cc
-
-
-kpilot_LDFLAGS = $(PISOCK_LDFLAGS) $(all_libraries) $(KDE_RPATH)
-kpilotDaemon_LDFLAGS = $(PISOCK_LDFLAGS) $(all_libraries) $(KDE_RPATH)
-kpilotTest_LDFLAGS = $(PISOCK_LDFLAGS) $(all_libraries) $(KDE_RPATH)
-
-
-# the libraries to link against. Be aware of the order. First the libraries,
-# that depend on the following ones.
-kpilot_LDADD = $(LIB_KFILE) $(PISOCK_LIB) -lkutils \
- ../lib/libkpilot.la libconfiguration.la
-kpilotDaemon_LDADD = $(LIB_KFILE) $(PISOCK_LIB) \
- ../lib/libkpilot.la libconfiguration.la
-kpilotTest_LDADD = $(LIB_KFILE) $(PISOCK_LIB) \
- ../lib/libkpilot.la libconfiguration.la
-
-xdg_apps_DATA = kpilot.desktop kpilotdaemon.desktop
-kde_kcfg_DATA = kpilot.kcfg
-kde_services_DATA = kpilot_config.desktop
-
-servicetypedir = $(kde_servicetypesdir)
-servicetype_DATA = kpilotconduit.desktop
-
-rcdir = $(kde_datadir)/kpilot
-rc_DATA = kpilotui.rc
-
-update_DATA = kpilot.upd
-updatedir = $(kde_datadir)/kconf_update
-
-DOXYGEN_REFERENCES = kdeui kpilot/lib
-include $(top_srcdir)/admin/Doxyfile.am
-
-### Some additional dependencies:
-
-kpilotConfigDialog.lo : kpilotSettings.h
-
diff --git a/kpilot/kpilot/addressEditor.cc b/kpilot/kpilot/addressEditor.cc
deleted file mode 100644
index cfab322e..00000000
--- a/kpilot/kpilot/addressEditor.cc
+++ /dev/null
@@ -1,271 +0,0 @@
-// -*- C++ -*-
-/* KPilot
-**
-** Copyright (C) 2000 by Dan Pilone
-**
-** This is a dialog window that edits one single address record.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#ifndef _KPILOT_OPTIONS_H
-#include "options.h"
-#endif
-
-#ifndef QLINEEDIT_H
-#include <tqlineedit.h>
-#endif
-#ifndef QLAYOUT_H
-#include <tqlayout.h>
-#endif
-#ifndef QLABEL_H
-#include <tqlabel.h>
-#endif
-#ifndef _KDEBUG_H
-#include <kdebug.h>
-#endif
-
-#ifndef _KPILOT_PILOTADDRESS_H
-#include "pilotAddress.h"
-#endif
-
-#include "addressEditor.moc"
-
-
-AddressEditor::AddressEditor(PilotAddress * p,
- PilotAddressInfo *appInfo,
- TQWidget * parent,
- const char *name) :
- KDialogBase(KDialogBase::Plain,
- i18n("Address Editor"),
- Ok | Cancel, Cancel,
- parent, name, false /* non-modal */ ),
- fDeleteOnCancel(p == 0L),
- fAddress(p),
- fAppInfo(appInfo)
-{
- FUNCTIONSETUP;
-
- initLayout();
- fillFields();
-
- connect(parent, TQT_SIGNAL(recordChanged(PilotAddress *)),
- this, TQT_SLOT(updateRecord(PilotAddress *)));
-
-}
-
-AddressEditor::~AddressEditor()
-{
- FUNCTIONSETUP;
-
- if (fDeleteOnCancel && fAddress)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Deleting private address record." << endl;
-#endif
-
- delete fAddress;
-
- fAddress = 0L;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Help! I'm deleting!" << endl;
-#endif
-}
-
-
-
-/*
- * Return phone label from AddressAppInfo + some sanity checking
- */
-TQString AddressEditor::phoneLabelText(PilotAddress * addr, const PhoneSlot &i)
-{
- FUNCTIONSETUP;
- if (!addr)
- {
- return i18n("Phone");
- }
-
- PilotAddressInfo::EPhoneType idx = addr->getPhoneType(i);
- TQString ret = fAppInfo->phoneLabel(idx) + CSL1(":");
-
- return ret;
-}
-
-
-
-void AddressEditor::fillFields()
-{
- FUNCTIONSETUP;
-
- if (fAddress == 0L)
- {
- fAddress = new PilotAddress();
- fDeleteOnCancel = true;
- }
-
- // phone labels
- unsigned int index = 0;
- for ( PhoneSlot i = PhoneSlot::begin(); i.isValid(); ++i,++index )
- {
- m_phoneLabel[index]->setText(phoneLabelText(fAddress, i));
- fPhoneField[index]->setText(fAddress->getField(i));
- }
-
- // fields
- fLastNameField->setText(fAddress->getField(entryLastname));
- fFirstNameField->setText(fAddress->getField(entryFirstname));
- fCompanyField->setText(fAddress->getField(entryCompany));
- fAddressField->setText(fAddress->getField(entryAddress));
- fCityField->setText(fAddress->getField(entryCity));
- fStateField->setText(fAddress->getField(entryState));
- fZipField->setText(fAddress->getField(entryZip));
- fCountryField->setText(fAddress->getField(entryCountry));
- fTitleField->setText(fAddress->getField(entryTitle));
- fCustom1Field->setText(fAddress->getField(entryCustom1));
- fCustom2Field->setText(fAddress->getField(entryCustom2));
- fCustom3Field->setText(fAddress->getField(entryCustom3));
- fCustom4Field->setText(fAddress->getField(entryCustom4));
-}
-
-
-
-
-#define MakeField(text,field,row,column) \
- t=new TQLabel(text,p); \
- field = new TQLineEdit(p); \
- field->setMinimumWidth(20*SPACING); \
- t->setBuddy(field); \
- grid->addWidget(t,row,column); \
- grid->addWidget(field,row,column+1);
-
-#define MakeFieldL(text,label,field,row,column) \
- label = new TQLabel(text,p); \
- field = new TQLineEdit(p); \
- field->setMinimumWidth(20*SPACING); \
- label->setBuddy(field); \
- grid->addWidget(label,row,column); \
- grid->addWidget(field,row,column+1);
-
-void AddressEditor::initLayout()
-{
- FUNCTIONSETUP;
-
- TQFrame *p = plainPage();
- TQGridLayout *grid = new TQGridLayout(p, 10, 5, 0, SPACING);
-
- TQLabel *t;
-
- MakeField(i18n("Last name:"), fLastNameField, 0, 0);
- MakeField(i18n("First name:"), fFirstNameField, 1, 0);
- MakeField(i18n("Title:"), fTitleField, 2, 0);
- MakeField(i18n("Company:"), fCompanyField, 3, 0);
-
- PhoneSlot slot = PhoneSlot::begin();
- for (int i = 0; slot.isValid(); ++i,++slot)
- {
- MakeFieldL(phoneLabelText(NULL, slot),
- m_phoneLabel[i], fPhoneField[i], 4 + i, 0);
- }
-
- MakeField(i18n("Address:"), fAddressField, 0, 4);
- MakeField(i18n("City:"), fCityField, 1, 4);
- MakeField(i18n("State:"), fStateField, 2, 4);
- MakeField(i18n("Zip code:"), fZipField, 3, 4);
- MakeField(i18n("Country:"), fCountryField, 4, 4);
- MakeField(i18n("Custom 1:"), fCustom1Field, 5, 4);
- MakeField(i18n("Custom 2:"), fCustom2Field, 6, 4);
- MakeField(i18n("Custom 3:"), fCustom3Field, 7, 4);
- MakeField(i18n("Custom 4:"), fCustom4Field, 8, 4);
-
- grid->addRowSpacing(9, SPACING);
- grid->addColSpacing(2, SPACING);
- grid->setRowStretch(9, 100);
- grid->setColStretch(2, 50);
-}
-
-/* slot */ void AddressEditor::slotCancel()
-{
- FUNCTIONSETUP;
-
- if (fDeleteOnCancel && fAddress)
- {
- delete fAddress;
-
- fAddress = 0L;
- }
- KDialogBase::slotCancel();
-}
-
-/* slot */ void AddressEditor::slotOk()
-{
- FUNCTIONSETUP;
-
- // Commit changes here
- fAddress->setField(entryLastname, fLastNameField->text());
- fAddress->setField(entryFirstname, fFirstNameField->text());
- fAddress->setField(entryCompany, fCompanyField->text());
- fAddress->setField(entryPhone1, fPhoneField[0]->text());
- fAddress->setField(entryPhone2, fPhoneField[1]->text());
- fAddress->setField(entryPhone3, fPhoneField[2]->text());
- fAddress->setField(entryPhone4, fPhoneField[3]->text());
- fAddress->setField(entryPhone5, fPhoneField[4]->text());
- fAddress->setField(entryAddress, fAddressField->text());
- fAddress->setField(entryCity, fCityField->text());
- fAddress->setField(entryState, fStateField->text());
- fAddress->setField(entryZip, fZipField->text());
- fAddress->setField(entryCountry, fCountryField->text());
- fAddress->setField(entryTitle, fTitleField->text());
- fAddress->setField(entryCustom1, fCustom1Field->text());
- fAddress->setField(entryCustom2, fCustom2Field->text());
- fAddress->setField(entryCustom3, fCustom3Field->text());
- fAddress->setField(entryCustom4, fCustom4Field->text());
-
- emit(recordChangeComplete(fAddress));
- KDialogBase::slotOk();
-}
-
-/* slot */ void AddressEditor::updateRecord(PilotAddress * p)
-{
- FUNCTIONSETUP;
- if (p != fAddress)
- {
- // Not meant for me
- //
- //
- return;
- }
-
- if (p->isDeleted())
- {
- delayedDestruct();
- return;
- }
- else
- {
- fillFields();
- }
-}
-
diff --git a/kpilot/kpilot/addressEditor.h b/kpilot/kpilot/addressEditor.h
deleted file mode 100644
index 6c4d1223..00000000
--- a/kpilot/kpilot/addressEditor.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// -*- C++ -*-
-/* addressEditor.h KPilot
-**
-** Copyright (C) 1998-2000 by Dan Pilone
-**
-** This is a dialog window that is used to edit a single address record.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#ifndef _KPILOT_ADDRESSEDITOR_H
-#define _KPILOT_ADDRESSEDITOR_H
-
-#include <kdialogbase.h>
-
-#include "pilotAddress.h"
-
-class TQLineEdit;
-
-class AddressEditor : public KDialogBase
-{
- Q_OBJECT
-
-
-public:
- AddressEditor(PilotAddress *address,
- PilotAddressInfo *appInfo,
- TQWidget *parent, const char *name=0L);
- ~AddressEditor();
-
-
-signals:
- void recordChangeComplete ( PilotAddress* );
-
-public slots:
- void slotOk();
- void slotCancel();
- void updateRecord(PilotAddress *);
-
-private:
- bool fDeleteOnCancel;
-
- PilotAddress* fAddress;
- PilotAddressInfo *fAppInfo;
- // entry fields
- TQLineEdit *fCustom4Field;
- TQLineEdit *fCustom3Field;
- TQLineEdit *fCustom2Field;
- TQLineEdit *fCustom1Field;
- TQLineEdit *fCountryField;
- TQLineEdit *fZipField;
- TQLineEdit *fStateField;
- TQLineEdit *fCityField;
- TQLineEdit *fAddressField;
- TQLineEdit *fPhoneField[5];
- TQLineEdit *fCompanyField;
- TQLineEdit *fTitleField;
- TQLineEdit *fFirstNameField;
- TQLineEdit *fLastNameField;
- // phone labels (changing!)
- TQLabel *m_phoneLabel[5];
-
- void initLayout();
- void fillFields();
- TQString phoneLabelText(PilotAddress *, const PhoneSlot &i);
-};
-#endif
-
diff --git a/kpilot/kpilot/addressWidget.cc b/kpilot/kpilot/addressWidget.cc
deleted file mode 100644
index e72b33ab..00000000
--- a/kpilot/kpilot/addressWidget.cc
+++ /dev/null
@@ -1,733 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-** Copyright (C) 2004 by Adriaan de Groot
-**
-** This file defines the addressWidget, that part of KPilot that
-** displays address records from the Pilot.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#ifndef _KPILOT_OPTIONS_H
-#include "options.h"
-#endif
-
-#include <iostream>
-#include <cstring>
-#include <cstdlib>
-
-#include <tqptrlist.h>
-#include <tqlistbox.h>
-#include <tqfile.h>
-#include <tqpushbutton.h>
-#include <tqtextstream.h>
-#include <tqlayout.h>
-#include <tqlabel.h>
-#include <tqmultilineedit.h>
-#include <tqcombobox.h>
-#include <tqwhatsthis.h>
-#include <tqtextview.h>
-#include <tqtextcodec.h>
-#include <tqregexp.h>
-
-#include <kapplication.h>
-#include <kmessagebox.h>
-#include <kdebug.h>
-#include <kfiledialog.h>
-
-#include "kpilotConfig.h"
-#include "listItems.h"
-#include "addressEditor.h"
-#include "pilotLocalDatabase.h"
-
-#include "addressWidget.moc"
-
-
-AddressWidget::AddressWidget(TQWidget * parent,
- const TQString & path) :
- PilotComponent(parent, "component_address", path),
- fAddrInfo(0L),
- fAddressAppInfo(0L),
- fPendingAddresses(0)
-{
- FUNCTIONSETUP;
-
- setupWidget();
- fAddressList.setAutoDelete(true);
-}
-
-AddressWidget::~AddressWidget()
-{
- FUNCTIONSETUP;
-}
-
-int AddressWidget::getAllAddresses(PilotDatabase * addressDB)
-{
- FUNCTIONSETUP;
-
- int currentRecord = 0;
- PilotRecord *pilotRec;
- PilotAddress *address;
-
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Reading AddressDB..." << endl;
-#endif
-
- while ((pilotRec = addressDB->readRecordByIndex(currentRecord)) != 0L)
- {
- if (!(pilotRec->isDeleted()) &&
- (!(pilotRec->isSecret()) || KPilotSettings::showSecrets()))
- {
- address = new PilotAddress(pilotRec);
- if (address == 0L)
- {
- WARNINGKPILOT << "Couldn't allocate record "
- << currentRecord++
- << endl;
- break;
- }
- fAddressList.append(address);
- }
- delete pilotRec;
-
- currentRecord++;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Total " << currentRecord << " records" << endl;
-#endif
-
- return currentRecord;
-}
-
-void AddressWidget::showComponent()
-{
- FUNCTIONSETUP;
- if ( fPendingAddresses>0 ) return;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Reading from directory " << dbPath() << endl;
-#endif
-
- PilotDatabase *addressDB =
- new PilotLocalDatabase(dbPath(), CSL1("AddressDB"));
-
- fAddressList.clear();
-
- if (addressDB->isOpen())
- {
- KPILOT_DELETE(fAddressAppInfo);
- fAddressAppInfo = new PilotAddressInfo(addressDB);
- populateCategories(fCatList, fAddressAppInfo->categoryInfo());
- getAllAddresses(addressDB);
-
- }
- else
- {
- populateCategories(fCatList, 0L);
- WARNINGKPILOT << "Could not open local AddressDB" << endl;
- }
-
- KPILOT_DELETE( addressDB );
-
- updateWidget();
-}
-
-void AddressWidget::hideComponent()
-{
- FUNCTIONSETUP;
- if (fPendingAddresses==0 )
- {
- fAddressList.clear();
- fListBox->clear();
-
- updateWidget();
- }
-}
-
-/* virtual */ bool AddressWidget::preHotSync(TQString &s)
-{
- FUNCTIONSETUP;
-
- if ( fPendingAddresses )
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": fPendingAddress="
- << fPendingAddresses
- << endl;
-#endif
-
-#if KDE_VERSION<220
- s = i18n("There are still %1 address editing windows open.")
- .arg(TQString::number(fPendingAddresses));
-#else
- s = i18n("There is still an address editing window open.",
- "There are still %n address editing windows open.",
- fPendingAddresses);
-#endif
- return false;
- }
-
- return true;
-}
-
-void AddressWidget::postHotSync()
-{
- FUNCTIONSETUP;
-
- if ( shown )
- {
- fAddressList.clear();
- showComponent();
- }
-}
-
-
-void AddressWidget::setupWidget()
-{
- FUNCTIONSETUP;
-
- TQLabel *label;
- TQGridLayout *grid = new TQGridLayout(this, 6, 4, SPACING);
-
- fCatList = new TQComboBox(this);
- grid->addWidget(fCatList, 0, 1);
- connect(fCatList, TQT_SIGNAL(activated(int)),
- this, TQT_SLOT(slotSetCategory(int)));
- TQWhatsThis::add(fCatList,
- i18n("<qt>Select the category of addresses to display here.</qt>"));
-
- label = new TQLabel(i18n("Category:"), this);
- label->setBuddy(fCatList);
- grid->addWidget(label, 0, 0);
-
- fListBox = new TQListBox(this);
- grid->addMultiCellWidget(fListBox, 1, 1, 0, 1);
- connect(fListBox, TQT_SIGNAL(highlighted(int)),
- this, TQT_SLOT(slotShowAddress(int)));
- connect(fListBox, TQT_SIGNAL(selected(int)),
- this, TQT_SLOT(slotEditRecord()));
- TQWhatsThis::add(fListBox,
- i18n("<qt>This list displays all the addresses "
- "in the selected category. Click on "
- "one to display it to the right.</qt>"));
-
- label = new TQLabel(i18n("Address info:"), this);
- grid->addWidget(label, 0, 2);
-
- // address info text view
- fAddrInfo = new TQTextView(this);
- grid->addMultiCellWidget(fAddrInfo, 1, 4, 2, 2);
-
- TQPushButton *button;
- TQString wt;
-
- fEditButton = new TQPushButton(i18n("Edit Record..."), this);
- grid->addWidget(fEditButton, 2, 0);
- connect(fEditButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditRecord()));
- wt = KPilotSettings::internalEditors() ?
- i18n("<qt>You can edit an address when it is selected.</qt>") :
- i18n("<qt><i>Editing is disabled by the 'internal editors' setting.</i></qt>");
- TQWhatsThis::add(fEditButton,wt);
-
- button = new TQPushButton(i18n("New Record..."), this);
- grid->addWidget(button, 2, 1);
- connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCreateNewRecord()));
- wt = KPilotSettings::internalEditors() ?
- i18n("<qt>Add a new address to the address book.</qt>") :
- i18n("<qt><i>Adding is disabled by the 'internal editors' setting.</i></qt>") ;
- TQWhatsThis::add(button, wt);
- button->setEnabled(KPilotSettings::internalEditors());
-
-
- fDeleteButton = new TQPushButton(i18n("Delete Record"), this);
- grid->addWidget(fDeleteButton, 3, 0);
- connect(fDeleteButton, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(slotDeleteRecord()));
- wt = KPilotSettings::internalEditors() ?
- i18n("<qt>Delete the selected address from the address book.</qt>") :
- i18n("<qt><i>Deleting is disabled by the 'internal editors' setting.</i></qt>") ;
-
- button = new TQPushButton(i18n("Export addresses to file","Export..."), this);
- grid->addWidget(button, 3,1);
- connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExport()));
- TQWhatsThis::add(button,
- i18n("<qt>Export all addresses in the selected category to CSV format.</qt>") );
-
- TQWhatsThis::add(fDeleteButton,wt);
-}
-
-void AddressWidget::updateWidget()
-{
- FUNCTIONSETUP;
-
- if( !fAddressAppInfo )
- return;
- int addressDisplayMode = KPilotSettings::addressDisplayMode();
-
- int listIndex = 0;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Display Mode=" << addressDisplayMode << endl;
-#endif
-
- int currentCatID = findSelectedCategory(fCatList,
- fAddressAppInfo->categoryInfo());
-
- fListBox->clear();
- fAddressList.first();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Adding records..." << endl;
-#endif
-
- while (fAddressList.current())
- {
- if ((currentCatID == -1) ||
- (fAddressList.current()->category() == currentCatID))
- {
- TQString title = createTitle(fAddressList.current(),
- addressDisplayMode);
-
- if (!title.isEmpty())
- {
- title.remove(TQRegExp(CSL1("\n.*")));
- PilotListItem *p = new PilotListItem(title,
- listIndex,
- fAddressList.current());
-
- fListBox->insertItem(p);
- }
- }
- listIndex++;
- fAddressList.next();
- }
-
- fListBox->sort();
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": " << listIndex << " records" << endl;
-#endif
-
- slotUpdateButtons();
-}
-
-
-
-TQString AddressWidget::createTitle(PilotAddress * address, int displayMode)
-{
- // FUNCTIONSETUP;
-
- TQString title;
-
- switch (displayMode)
- {
- case 1:
- if (!address->getField(entryCompany).isEmpty())
- {
- title.append(address->getField(entryCompany));
- }
- if (!address->getField(entryLastname).isEmpty())
- {
- if (!title.isEmpty())
- {
- title.append( CSL1(", "));
- }
-
- title.append(address->getField(entryLastname));
- }
- break;
- case 0:
- default:
- if (!address->getField(entryLastname).isEmpty())
- {
- title.append(address->getField(entryLastname));
- }
-
- if (!address->getField(entryFirstname).isEmpty())
- {
- if (!title.isEmpty())
- {
- title.append( CSL1(", "));
- }
- title.append(address->getField(entryFirstname));
- }
- break;
- }
-
- if (title.isEmpty()) // One last try
- {
- if (!fAddressList.current()->getField(entryCompany).isEmpty())
- {
- title.append(fAddressList.current()->
- getField(entryCompany));
- }
- if (title.isEmpty())
- {
- title = i18n("[unknown]");
- }
- }
-
- return title;
-}
-
-
-/* slot */ void AddressWidget::slotUpdateButtons()
-{
- FUNCTIONSETUP;
-
- bool enabled = (fListBox->currentItem() != -1);
-
- enabled &= KPilotSettings::internalEditors();
- fEditButton->setEnabled(enabled);
- fDeleteButton->setEnabled(enabled);
-}
-
-void AddressWidget::slotSetCategory(int)
-{
- FUNCTIONSETUP;
-
- updateWidget();
-}
-
-void AddressWidget::slotEditRecord()
-{
- FUNCTIONSETUP;
- if ( !shown ) return;
-
- int item = fListBox->currentItem();
-
- if (item == -1)
- return;
-
- PilotListItem *p = (PilotListItem *) fListBox->item(item);
- PilotAddress *selectedRecord = (PilotAddress *) p->rec();
-
- if (selectedRecord->id() == 0)
- {
- KMessageBox::error(0L,
- i18n("Cannot edit new records until "
- "HotSynced with Pilot."),
- i18n("HotSync Required"));
- return;
- }
-
- AddressEditor *editor = new AddressEditor(selectedRecord,
- fAddressAppInfo, this);
-
- connect(editor, TQT_SIGNAL(recordChangeComplete(PilotAddress *)),
- this, TQT_SLOT(slotUpdateRecord(PilotAddress *)));
- connect(editor, TQT_SIGNAL(cancelClicked()),
- this, TQT_SLOT(slotEditCancelled()));
- editor->show();
-
- fPendingAddresses++;
-}
-
-void AddressWidget::slotCreateNewRecord()
-{
- FUNCTIONSETUP;
- if ( !shown ) return;
-
- // Response to bug 18072: Don't even try to
- // add records to an empty or unopened database,
- // since we don't have the DBInfo stuff to deal with it.
- //
- //
- PilotDatabase *myDB = new PilotLocalDatabase(dbPath(), CSL1("AddressDB"));
-
- if (!myDB || !myDB->isOpen())
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Tried to open "
- << dbPath()
- << "/AddressDB"
- << " and got pointer @"
- << (long) myDB
- << " with status "
- << ( myDB ? myDB->isOpen() : false )
- << endl;
-#endif
-
- KMessageBox::sorry(this,
- i18n("You cannot add addresses to the address book "
- "until you have done a HotSync at least once "
- "to retrieve the database layout from your Pilot."),
- i18n("Cannot Add New Address"));
-
- if (myDB)
- KPILOT_DELETE( myDB );
-
- return;
- }
-
- AddressEditor *editor = new AddressEditor(0L,
- fAddressAppInfo, this);
-
- connect(editor, TQT_SIGNAL(recordChangeComplete(PilotAddress *)),
- this, TQT_SLOT(slotAddRecord(PilotAddress *)));
- connect(editor, TQT_SIGNAL(cancelClicked()),
- this, TQT_SLOT(slotEditCancelled()));
- editor->show();
-
- fPendingAddresses++;
-}
-
-void AddressWidget::slotAddRecord(PilotAddress * address)
-{
- FUNCTIONSETUP;
- if ( !shown && fPendingAddresses==0 ) return;
-
- int currentCatID = findSelectedCategory(fCatList,
- fAddressAppInfo->categoryInfo(), true);
-
-
- address->PilotRecordBase::setCategory(currentCatID);
- fAddressList.append(address);
- writeAddress(address);
- // TODO: Just add the new record to the lists
- updateWidget();
-
- // k holds the item number of the address just added.
- //
- //
- int k = fListBox->count() - 1;
-
- fListBox->setCurrentItem(k); // Show the newest one
- fListBox->setBottomItem(k);
-
- fPendingAddresses--;
- if ( !shown && fPendingAddresses==0 ) hideComponent();
-}
-
-void AddressWidget::slotUpdateRecord(PilotAddress * address)
-{
- FUNCTIONSETUP;
- if ( !shown && fPendingAddresses==0 ) return;
-
- writeAddress(address);
- int currentRecord = fListBox->currentItem();
-
- // TODO: Just change the record
- updateWidget();
- fListBox->setCurrentItem(currentRecord);
-
- emit(recordChanged(address));
-
- fPendingAddresses--;
- if ( !shown && fPendingAddresses==0 ) hideComponent();
-}
-
-void AddressWidget::slotEditCancelled()
-{
- FUNCTIONSETUP;
-
- fPendingAddresses--;
- if ( !shown && fPendingAddresses==0 ) hideComponent();
-}
-
-void AddressWidget::slotDeleteRecord()
-{
- FUNCTIONSETUP;
- if ( !shown ) return;
-
- int item = fListBox->currentItem();
-
- if (item == -1)
- return;
-
- PilotListItem *p = (PilotListItem *) fListBox->item(item);
- PilotAddress *selectedRecord = (PilotAddress *) p->rec();
-
- if (selectedRecord->id() == 0)
- {
- KMessageBox::error(this,
- i18n("New records cannot be deleted until "
- "HotSynced with pilot."),
- i18n("HotSync Required"));
- return;
- }
-
- if (KMessageBox::questionYesNo(this,
- i18n("Delete currently selected record?"),
- i18n("Delete Record?"), KStdGuiItem::del(), KStdGuiItem::cancel()) == KMessageBox::No)
- return;
-
- selectedRecord->setDeleted( true );
- writeAddress(selectedRecord);
- emit(recordChanged(selectedRecord));
- showComponent();
-}
-
-
-
-void AddressWidget::slotShowAddress(int which)
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- PilotListItem *p = (PilotListItem *) fListBox->item(which);
- PilotAddress *addr = (PilotAddress *) p->rec();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Showing "
- << addr->getField(entryLastname)
- << " "
- << addr->getField(entryFirstname)
- << endl;
-#endif
-
- TQString text(CSL1("<qt>"));
- text += addr->getTextRepresentation(fAddressAppInfo,Qt::RichText);
- text += CSL1("</qt>\n");
- fAddrInfo->setText(text);
-
- slotUpdateButtons();
-}
-
-
-
-void AddressWidget::writeAddress(PilotAddress * which,
- PilotDatabase * addressDB)
-{
- FUNCTIONSETUP;
-
- // Open a database (myDB) only if needed,
- // i.e. only if the passed-in addressDB
- // isn't valid.
- //
- //
- PilotDatabase *myDB = addressDB;
- bool usemyDB = false;
-
- if (myDB == 0L || !myDB->isOpen())
- {
- myDB = new PilotLocalDatabase(dbPath(), CSL1("AddressDB"));
- usemyDB = true;
- }
-
- // Still no valid address database...
- //
- //
- if (!myDB->isOpen())
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Address database is not open" <<
- endl;
-#endif
- return;
- }
-
-
- // Do the actual work.
- PilotRecord *pilotRec = which->pack();
-
- myDB->writeRecord(pilotRec);
- markDBDirty(CSL1("AddressDB"));
- delete pilotRec;
-
- // Clean up in the case that we allocated our own DB.
- //
- //
- if (usemyDB)
- {
- KPILOT_DELETE( myDB );
- }
-}
-
-#define plu_quiet 1
-#include "pilot-addresses.c"
-
-void AddressWidget::slotExport()
-{
- FUNCTIONSETUP;
- if( !fAddressAppInfo ) return;
- int currentCatID = findSelectedCategory(fCatList,
- fAddressAppInfo->categoryInfo());
-
- TQString prompt = (currentCatID==-1) ?
- i18n("Export All Addresses") :
- i18n("Export Address Category %1").arg(fAddressAppInfo->categoryName(currentCatID)) ;
-
-
- TQString saveFile = KFileDialog::getSaveFileName(
- TQString::null,
- CSL1("*.csv|Comma Separated Values"),
- this,
- prompt
- );
- if (saveFile.isEmpty())
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": No save file selected." << endl;
-#endif
- return;
- }
- if (TQFile::exists(saveFile) &&
- KMessageBox::warningContinueCancel(this,
- i18n("The file <i>%1</i> exists. Overwrite?").arg(saveFile),
- i18n("Overwrite File?"),
- i18n("Overwrite"))!=KMessageBox::Continue)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Overwrite file canceled." << endl;
-#endif
- return;
- }
-
- FILE *f = fopen(TQFile::encodeName(saveFile),"w");
- if (!f)
- {
- KMessageBox::sorry(this,
- i18n("The file <i>%1</i> could not be opened for writing.").arg(saveFile));
- return;
- }
- fAddressList.first();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Adding records..." << endl;
-#endif
-
- while (fAddressList.current())
- {
- const PilotAddress *a = fAddressList.current();
- if ((currentCatID == -1) ||
- (a->category() == currentCatID))
- {
- write_record_CSV(f, fAddressAppInfo->info(), a->address(),
- a->attributes(), a->category(), 0);
- }
- fAddressList.next();
- }
-
- fclose(f);
-}
-
diff --git a/kpilot/kpilot/addressWidget.h b/kpilot/kpilot/addressWidget.h
deleted file mode 100644
index 9a7b2a8c..00000000
--- a/kpilot/kpilot/addressWidget.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* addressWidget.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines the address-viewing widget used in KPilot
-** to display the Pilot's address records.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-#ifndef _KPILOT_ADDRESSWIDGET_H
-#define _KPILOT_ADDRESSWIDGET_H
-
-class TQMultiLineEdit;
-class TQListBox;
-class TQComboBox;
-class TQTextView;
-
-class PilotDatabase;
-
-
-#include "pilotComponent.h"
-#include "pilotAddress.h"
-
-class AddressWidget : public PilotComponent
-{
-Q_OBJECT
-
-public:
- AddressWidget(TQWidget* parent,const TQString& dbpath);
- ~AddressWidget();
-
- // Pilot Component Methods:
- virtual void showComponent();
- virtual void hideComponent();
- virtual bool preHotSync(TQString &);
- virtual void postHotSync();
-
-public slots:
- /**
- * Called when a particular address is selected. This slot displays
- * it in the viewer widget.
- */
- void slotShowAddress(int);
- void slotEditRecord();
- void slotCreateNewRecord();
- void slotDeleteRecord();
- void slotEditCancelled();
- void slotExport();
-
- void slotUpdateButtons(); // Enable/disable buttons
-
-signals:
- void recordChanged(PilotAddress *);
-
-protected slots:
- /**
- * When an edit window is closed, the corresponding record
- * is updated and possibly re-displayed.
- */
- void slotUpdateRecord(PilotAddress*);
-
- /**
- * Pop up an edit window for a new record.
- */
- void slotAddRecord(PilotAddress*);
-
- /**
- * Change category. This means that the display should be
- * cleared and that the list should be repopulated.
- */
- void slotSetCategory(int);
-
-private:
- void setupWidget();
- void updateWidget(); // Called with the lists have changed..
- void writeAddress(PilotAddress* which,PilotDatabase *db=0L);
-
- /**
- * getAllAddresses reads the database and places all
- * the addresses from the database in the list
- * in memory --- not the list on the screen.
- * @see fAddressList
- */
- int getAllAddresses(PilotDatabase *addressDB);
-
- /**
- * Create a sensible "title" for an address, composed
- * of first + last name if possible.
- */
- TQString createTitle(PilotAddress *,int displayMode);
-
- /**
- * We use a TQComboBox fCatList to hold the user-visible names
- * of all the categories. The TQTextView fAddrInfo is for
- * displaying the currently selected address, if any.
- * The TQListBox fListBox lists all the addresses in the
- * currently selected category.
- *
- * The entire address database is read into memory in the
- * QList fAddressList. We need the appinfo block from the
- * database to determine which categories there are; this
- * is held in fAddressAppInfo.
- *
- * The two buttons should speak for themselves.
- */
- TQComboBox *fCatList;
- TQTextView *fAddrInfo;
- PilotAddressInfo *fAddressAppInfo;
- TQPtrList<PilotAddress> fAddressList;
- TQListBox *fListBox;
- QPushButton *fEditButton,*fDeleteButton;
-
-protected:
- /**
- * Keep track of how many open address editing windows there
- * are. You can't sync when there are open windows.
- */
- int fPendingAddresses;
-
-public:
- typedef enum { PhoneNumberLength=16 } Constants ;
-};
-
-#endif
diff --git a/kpilot/kpilot/conduitConfigDialog.cc b/kpilot/kpilot/conduitConfigDialog.cc
deleted file mode 100644
index 3ea444d3..00000000
--- a/kpilot/kpilot/conduitConfigDialog.cc
+++ /dev/null
@@ -1,849 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2002-2004 by Adriaan de Groot
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a .ui-based configuration dialog for conduits.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <tqlistview.h>
-#include <tqlabel.h>
-#include <tqtooltip.h>
-#include <tqfile.h>
-#include <tqpushbutton.h>
-#include <tqhbox.h>
-#include <tqlayout.h>
-#include <tqwidgetstack.h>
-#include <tqvbox.h>
-#include <tqsplitter.h>
-#include <tqheader.h>
-#include <tqtimer.h>
-
-#include <kservice.h>
-#include <kservicetype.h>
-#include <kuserprofile.h>
-#include <kprocess.h>
-#include <kmessagebox.h>
-#include <kglobal.h>
-#include <kstandarddirs.h>
-#include <klibloader.h>
-#include <kseparator.h>
-#include <kconfigskeleton.h>
-#include <kdialogbase.h>
-
-#include "plugin.h"
-#include "kpilotConfig.h"
-#include "kpilotConfigDialog.h"
-
-#include "kpilotConfigWizard.h"
-
-#include "conduitConfigDialog.moc"
-
-#define CONDUIT_NAME (0)
-#define CONDUIT_COMMENT (1)
-#define CONDUIT_DESKTOP (2)
-#define CONDUIT_LIBRARY (3)
-#define CONDUIT_ORDER (4)
-
-
-extern "C"
-{
- KDE_EXPORT KCModule *create_kpilotconfig( TQWidget *parent, const char * )
- {
- FUNCTIONSETUP;
- return new ConduitConfigWidget( parent, "kcmkpilotconfig" );
- }
-
- KDE_EXPORT ConfigWizard *create_wizard(TQWidget *parent, int m)
- {
- FUNCTIONSETUP;
- return new ConfigWizard(parent,"Wizard", m);
- }
-}
-
-
-class ConduitTip : public QToolTip
-{
-public:
- ConduitTip(TQListView *parent);
- virtual ~ConduitTip();
-
-protected:
- virtual void maybeTip(const TQPoint &);
-
- TQListView *fListView;
-} ;
-
-
-ConduitTip::ConduitTip(TQListView *p) :
- TQToolTip(p->viewport(),0L),
- fListView(p)
-{
- FUNCTIONSETUP;
-}
-
-ConduitTip::~ConduitTip()
-{
- FUNCTIONSETUP;
-}
-
-/* virtual */ void ConduitTip::maybeTip(const TQPoint &p)
-{
- FUNCTIONSETUP;
-
- TQListViewItem *l = fListView->itemAt(p);
-
- if (!l) return;
-
- // ConduitListItem *q = static_cast<ConduitListItem *>(l);
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Tip over "
- << l->text(CONDUIT_NAME)
- << " with text "
- << l->text(CONDUIT_COMMENT)
- << endl;
-#endif
-
- TQString s = l->text(CONDUIT_COMMENT);
-
- if (s.isEmpty()) return;
- if (s.find(CSL1("<qt>"),0,false) == -1)
- {
- s.prepend(CSL1("<qt>"));
- s.append(CSL1("</qt>"));
- }
-
- tip(fListView->itemRect(l),s);
-}
-
-// implement our own check list items so we can detect if a given item was checked/unchecked. We need
-// this to prevent the modified signal if one only wants to display a conduit's config widget. Currently,
-// KListView doesn't provide any signal that indicates that the checked state of a checklist item was changed.
-class KPilotCheckListItem : public QCheckListItem
-{
-public:
- KPilotCheckListItem ( TQListViewItem * parent, const TQString & text, Type tt = RadioButtonController ) : TQCheckListItem(parent, text, tt),mOriginalState(false) {}
- ~KPilotCheckListItem() {}
-
- void setOriginalState(bool state) { mOriginalState=state; setOn(state);}
- bool isOriginalState() { return isOn() == mOriginalState; }
-
-protected:
- bool mOriginalState;
-};
-
-
-// Page numbers in the widget stack
-#define OLD_CONDUIT (1)
-#define BROKEN_CONDUIT (2)
-#define INTERNAL_CONDUIT (3)
-#define INTERNAL_EXPLN (4)
-#define CONDUIT_EXPLN (5)
-#define GENERAL_EXPLN (6)
-#define GENERAL_ABOUT (7)
-#define NEW_CONDUIT (8)
-
-
-/*
-** Create a page in the widget stack @p parent on page @p pageno,
-** bearing the given @p text. The remainder of the parameters are
-** for esoteric things like:
-** @p buttons set to non-null to include (and return) a TQHBox suitable
-** for displaying a row of buttons in on the page.
-** @p label set to non-null to return the TQLabel used to display @p text.
-*/
-static void addDescriptionPage(TQWidgetStack *parent,
- int pageno,
- const TQString &text,
- TQHBox **buttons = 0L,
- TQLabel **label = 0L)
-{
- TQVBox *v = new TQVBox(parent);
- TQLabel *l = 0L;
-
- v->setFrameShape(TQLabel::NoFrame);
- v->setMargin(SPACING);
-
- l = new TQLabel(v);
- l->setText(text);
- l->setAlignment(Qt::AlignLeft | Qt::AlignVCenter | Qt::ExpandTabs | Qt::WordBreak);
-
- if (label) { *label = l; }
-
- if (buttons)
- {
- *buttons = new TQHBox(v);
- l = new TQLabel(v);
- }
-
- parent->addWidget(v,pageno);
-}
-
-
-ConduitConfigWidgetBase::ConduitConfigWidgetBase(TQWidget *parent, const char *n) :
- KCModule(parent, n),
- fConduitList(0L),
- fStack(0L),
- fConfigureButton(0L),
- fConfigureWizard(0L),
- fConfigureKontact(0L),
- fActionDescription(0L)
-{
- FUNCTIONSETUP;
-
- TQWidget *w = 0L; // For spacing purposes only.
- TQHBox *btns = 0L;
-
- TQHBoxLayout *mainLayout = new TQHBoxLayout(this);
- mainLayout->setSpacing(10);
-
- // Create the left hand column
- fConduitList = new TQListView(this ,"ConduitList");
- fConduitList->addColumn(TQString::null);
- fConduitList->header()->hide();
- fConduitList->setSizePolicy(
- TQSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Preferred));
- mainLayout->addWidget(fConduitList);
-
- // Create the title
- TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, KDialog::spacingHint());
- // String below is just to make space; no need to translate.
- fTitleText = new TQLabel(CSL1("Conduit Setup - Addressbook"), this);
- TQFont titleFont(fTitleText->font());
- titleFont.setBold(true);
- fTitleText->setFont(titleFont);
- vbox->addWidget(fTitleText, 0, AlignLeft);
- vbox->addWidget(new KSeparator(TQFrame::HLine|TQFrame::Plain, this));
-
- // Right hand column
- fStack = new TQWidgetStack(this, "RightPart");
- vbox->addWidget(fStack, 10);
-
- mainLayout->addLayout(vbox);
-
- // First page in stack (right hand column)
- addDescriptionPage(fStack,BROKEN_CONDUIT,
- i18n("<qt>This conduit appears to be broken and cannot "
- "be configured.</qt>"));
-
- // Second page, now with layout in a single column
- //
- // Probably deprecated.
- //
- addDescriptionPage(fStack,OLD_CONDUIT,
- i18n("<qt>This is an old-style conduit.</qt>"),&btns);
- w = new TQWidget(btns);
- btns->setStretchFactor(w,50);
- fConfigureButton = new TQPushButton(btns);
- fConfigureButton->setText(i18n("Configure..."));
- w = new TQWidget(btns);
- btns->setStretchFactor(w,50);
-
- // Page 3
- addDescriptionPage(fStack,INTERNAL_CONDUIT,
- TQString::null,0L,&fActionDescription);
-
- // Page 5 - explanation about conduits
- addDescriptionPage(fStack,CONDUIT_EXPLN,
- i18n("<qt><i>Conduits</i> are external (possibly third-party) "
- "programs that perform synchronization actions. They may "
- "have individual configurations. Select a conduit to configure it, "
- "and enable it by clicking on its checkbox. "
- "</qt>"));
-
- // Page 6 - explanation about general setup
- addDescriptionPage(fStack,GENERAL_EXPLN,
- i18n("<qt><p>The <i>general</i> portion of KPilot's setup "
- "contains settings for your hardware and the way KPilot "
- "should display your data. For the basic setup, which should fulfill "
- "the need of most users, just use the setup wizard below.</p>"
- "If you need some special settings, this dialog provides all the options "
- "for fine-tuning KPilot. But be warned: The HotSync settings are "
- "various esoteric things.</p>"
- "<p>You can enable an action or conduit by clicking on its checkbox. "
- "Checked conduits will be run during a HotSync. "
- "Select a conduit to configure it.</p>"
- "</qt>"),&btns);
- w = new TQWidget(btns);
- btns->setStretchFactor(w,50);
- fConfigureWizard = new TQPushButton(i18n("Configuration Wizard"),btns);
- w = new TQWidget(btns);
- btns->setStretchFactor(w,50);
-
-
- fStack->addWidget(ConduitConfigBase::aboutPage(fStack,0L),GENERAL_ABOUT);
-}
-
-ConduitConfigWidget::ConduitConfigWidget(TQWidget *parent, const char *n,
- bool) :
- ConduitConfigWidgetBase(parent,n),
- fConfigure(0L),
- fCurrentConduit(0L),
- fGeneralPage(0L),
- fCurrentConfig(0L)
-{
- FUNCTIONSETUP;
-
- fConduitList->setSorting(-1);
- fConduitList->setRootIsDecorated(true);
- fConduitList->setTreeStepSize(10);
- // fConduitList->removeColumn(CONDUIT_COMMENT);
- fillLists();
-
- fConduitList->resize(fConduitList->sizeHint());
- fConduitList->setMinimumSize(fConduitList->sizeHint());
- fConduitList->setColumnWidth(0, fConduitList->sizeHint().width());
- fConduitList->setResizeMode(TQListView::AllColumns);
-
- fStack->resize(fStack->sizeHint()+TQSize(10,40));
- fStack->setMinimumSize(fStack->sizeHint()+TQSize(10,40));
-
- TQObject::connect(fConduitList,
- TQT_SIGNAL(selectionChanged(TQListViewItem *)),
- this,TQT_SLOT(selected(TQListViewItem *)));
- TQObject::connect(fConduitList,
- TQT_SIGNAL(clicked(TQListViewItem*)),
- this, TQT_SLOT(conduitsChanged(TQListViewItem*)));
-
- // Deprecated?
- TQObject::connect(fConfigureButton,
- TQT_SIGNAL(clicked()),
- this,TQT_SLOT(configure()));
-
- TQObject::connect(fConfigureWizard,TQT_SIGNAL(clicked()),
- this,TQT_SLOT(configureWizard()));
-
- fGeneralPage->setSelected(true);
- fConduitList->setCurrentItem(fGeneralPage);
- selected(fGeneralPage);
-
- (void) new ConduitTip(fConduitList);
- setButtons(Apply);
-
-}
-
-ConduitConfigWidget::~ConduitConfigWidget()
-{
- FUNCTIONSETUP;
- release();
-}
-
-void ConduitConfigWidget::fillLists()
-{
- FUNCTIONSETUP;
-
- // 3 QListViewItems for the three headings in the list
- TQListViewItem *general,*conduits;
-
- // And two generic pointers for the rest.
- TQListViewItem *q = 0L;
- KPilotCheckListItem *p = 0L;
-
- q = new TQListViewItem(fConduitList, i18n("About"));
- q->setText(CONDUIT_COMMENT, i18n("About KPilot. Credits."));
- q->setText(CONDUIT_LIBRARY, CSL1("general_about"));
-
- conduits = new TQListViewItem(fConduitList, i18n("Conduits"));
-
- general = new TQListViewItem( fConduitList, i18n("General Setup" ) );
- fGeneralPage = general;
-
- // Give them identifiers so they can be handled specially when selected.
- conduits->setText(CONDUIT_LIBRARY,CSL1("expln_conduits"));
- general->setText( CONDUIT_LIBRARY, CSL1("expln_general") );
-
- general->setText( CONDUIT_COMMENT,
- i18n("General setup of KPilot (User name, port, general sync settings)") );
- conduits->setText( CONDUIT_COMMENT,
- i18n("Actions for HotSync with individual configuration."));
-
- conduits->setOpen(true);
- general->setOpen(true);
-
-
- // Create entries under general.
-#define CE(a,b,c) q = new TQListViewItem(general,a) ; \
- q->setText(CONDUIT_COMMENT,b) ; \
- q->setText(CONDUIT_LIBRARY,c) ;
-
- CE(i18n("Startup and Exit"), i18n("Behavior at startup and exit."), CSL1("general_startexit") );
- CE(i18n("Viewers"), i18n("Viewer settings."), CSL1("general_view") );
- CE(i18n("Backup"),i18n("Special settings for backup."),CSL1("general_backup"));
- CE(i18n("HotSync"),i18n("Special behavior during HotSync."),CSL1("general_sync"));
- CE(i18n("Device"),i18n("Hardware settings and startup and exit options."),CSL1("general_setup"));
-
-#undef CE
-
-
- // List of installed (enabled) actions and conduits.
- TQStringList potentiallyInstalled = KPilotSettings::installedConduits();
-
- // Create internal conduits.
- //
- //
-
-#define IC(a,b,c) p = new KPilotCheckListItem(conduits,i18n(a),TQCheckListItem::CheckBox); \
- p->setText(CONDUIT_COMMENT,i18n(c)); \
- p->setText(CONDUIT_LIBRARY,CSL1("internal_" b)); \
- p->setText(CONDUIT_DESKTOP,CSL1("internal_" b)); \
- if (potentiallyInstalled.findIndex(p->text(CONDUIT_DESKTOP))>=0) \
- p->setOriginalState(true);
-
- IC("Install Files","fileinstall",
- "Install files that are dragged to KPilot onto the handheld.");
-#undef IC
-
-
-
- KServiceTypeProfile::OfferList offers =
- KServiceTypeProfile::offers(CSL1("KPilotConduit"));
-
- TQValueListIterator < KServiceOffer > availList(offers.begin());
- while (availList != offers.end())
- {
- KSharedPtr < KService > o = (*availList).service();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": "
- << o->desktopEntryName()
- << " = " << o->name() << endl;
-#endif
-
- if (!o->exec().isEmpty())
- {
- WARNINGKPILOT << "Old-style conduit found "
- << o->name()
- << endl;
- }
-
- p = new KPilotCheckListItem(conduits,
- o->name(),
- TQCheckListItem::CheckBox);
- p->setMultiLinesEnabled(true);
- p->setText(CONDUIT_COMMENT,o->comment());
- p->setText(CONDUIT_DESKTOP,o->desktopEntryName());
- p->setText(CONDUIT_LIBRARY,o->library());
-
- if (potentiallyInstalled.findIndex(o->desktopEntryName()) < 0)
- {
- p->setOriginalState(false);
- }
- else
- {
- p->setOriginalState(true);
- }
-
- ++availList;
- }
-}
-
-static void dumpConduitInfo(const KLibrary *lib)
-{
-#ifdef DEBUG
- FUNCTIONSETUP;
- DEBUGKPILOT << "Plugin version = " << PluginUtility::pluginVersion(lib) << endl;
- DEBUGKPILOT << "Plugin id = " << PluginUtility::pluginVersionString(lib) << endl;
-#endif
-}
-
-static ConduitConfigBase *handleGeneralPages(TQWidget *w, TQListViewItem *p)
-{
- ConduitConfigBase *o = 0L;
-
- TQString s = p->text(CONDUIT_LIBRARY) ;
-
- if (s.startsWith(CSL1("general_setup")))
- {
- o = new DeviceConfigPage( w, "generalSetup" );
- }
- else if (s.startsWith(CSL1("general_sync")))
- {
- o = new SyncConfigPage( w, "syncSetup" );
- }
- else if (s.startsWith(CSL1("general_view")))
- {
- o = new ViewersConfigPage( w, "viewSetup" );
- }
- else if (s.startsWith(CSL1("general_startexit")))
- {
- o = new StartExitConfigPage(w,"startSetup");
- }
- else if (s.startsWith(CSL1("general_backup")))
- {
- o = new BackupConfigPage(w,"backupSetup");
- }
-
- return o;
-}
-
-void ConduitConfigWidget::loadAndConfigure(TQListViewItem *p) // ,bool exec)
-{
- FUNCTIONSETUP;
-
- if (!p)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Executed NULL conduit?"
- << endl;
-#endif
- fStack->raiseWidget(GENERAL_EXPLN);
- return;
- }
-
- TQString libraryName = p->text(CONDUIT_LIBRARY);
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Executing conduit "
- << p->text(CONDUIT_NAME)
- << " (library " << libraryName << ")"
- << endl;
-#endif
-
-
- if (libraryName.isEmpty())
- {
- fStack->raiseWidget(BROKEN_CONDUIT);
- warnNoExec(p);
- return;
- }
-
- if (libraryName.startsWith(CSL1("internal_")))
- {
- fStack->raiseWidget(INTERNAL_CONDUIT);
- fActionDescription->setText(
- i18n("<qt>This is an internal action which has no "
- "configuration options. "
- "The action's description is: <i>%1</i> "
- "</qt>").arg(p->text(CONDUIT_COMMENT)));
- return;
- }
-
- if (libraryName == CSL1("expln_conduits"))
- {
- fStack->raiseWidget(CONDUIT_EXPLN);
- return;
- }
- if (libraryName == CSL1("expln_general"))
- {
- fStack->raiseWidget(GENERAL_EXPLN);
- return;
- }
-
- if (libraryName == CSL1("general_about"))
- {
- fStack->raiseWidget(GENERAL_ABOUT);
- return;
- }
-
- TQObject *o = 0L;
-
- // Page 4: General setup
- if (libraryName.startsWith(CSL1("general_")))
- {
- o = handleGeneralPages(fStack,p);
- }
- else
- {
- TQCString library = TQFile::encodeName(libraryName);
-
- KLibFactory *f = KLibLoader::self()->factory(library);
- if (!f)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": No conduit library "
- << library.data()
- << " [" << library.size() << "]"
- << " (" << libraryName << ")"
- << " found."
- << endl;
-#endif
- fStack->raiseWidget(BROKEN_CONDUIT);
- warnNoLibrary(p);
- return;
- }
-
- dumpConduitInfo(KLibLoader::self()->library(library));
-
- TQStringList a;
- a.append(CSL1("modal"));
-
- o = f->create(fStack, 0L, "ConduitConfigBase", a);
-
- if (!o)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Can't create ConduitConfigBase - must be old conduit."
- << endl;
-#endif
-
- KLibLoader::self()->unloadLibrary(
- library);
- fStack->raiseWidget(BROKEN_CONDUIT);
- warnNoLibrary(p);
- return;
- }
- }
-
- ConduitConfigBase *d = dynamic_cast<ConduitConfigBase *>(o);
-
- if (!d)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Can't cast to config base object."
- << endl;
-#endif
- fStack->raiseWidget(BROKEN_CONDUIT);
- warnNoLibrary(p);
- return;
- }
-
- // Remove the config widget from the stack before we can add the new one
- TQWidget *oldConfigWidget = fStack->widget( NEW_CONDUIT );
- if ( oldConfigWidget )
- {
- fStack->removeWidget( oldConfigWidget );
- KPILOT_DELETE( oldConfigWidget );
- }
- if (fStack->addWidget(d->widget(),NEW_CONDUIT)<0)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Can't add config widget to stack."
- << endl;
-#endif
- }
- else
- {
- d->load();
- fStack->raiseWidget(NEW_CONDUIT);
- d->widget()->show();
- fCurrentConfig=d;
- // make sure the changed signal is propagated to the KCM*Dialog
- // and the apply button is enabled correspondingly.
- connect(d, TQT_SIGNAL(changed(bool)), this, TQT_SIGNAL(changed(bool)));
- }
-}
-
-bool ConduitConfigWidget::release()
-{
- FUNCTIONSETUP;
- if (fCurrentConfig)
- {
- if (!fCurrentConfig->maybeSave())
- return false;
- fStack->raiseWidget(0);
- delete fCurrentConfig;
- }
- if (fCurrentConduit)
- {
- KLibLoader::self()->unloadLibrary(
- TQFile::encodeName(fCurrentConduit->text(CONDUIT_LIBRARY)));
- }
- fCurrentConduit=0L;
- fCurrentConfig=0L;
- return true;
-}
-
-void ConduitConfigWidget::unselect()
-{
- fConduitList->setSelected( fCurrentConduit, true );
- fConduitList->setCurrentItem( fCurrentConduit );
-}
-
-void ConduitConfigWidget::selected(TQListViewItem *p)
-{
- FUNCTIONSETUP;
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": "
- << ( p ? p->text(CONDUIT_NAME) : CSL1("None") )
- << endl;
-#endif
- if (p!=fCurrentConduit)
- {
- if (!release())
- {
- fConduitList->blockSignals(true);
- TQTimer::singleShot(1,this,TQT_SLOT(unselect()));
- return;
- }
- }
- fCurrentConduit=p;
- loadAndConfigure(p);
-// fStack->adjustSize();
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": New widget size "
- << fStack->size().width() << "x" << fStack->size().height() << endl;
- DEBUGKPILOT << fname << ": Current size "
- << size().width() << "x"
- << size().height() << endl;
-#endif
- emit sizeChanged();
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": New size "
- << size().width() << "x"
- << size().height() << endl;
-#endif
-
- // set the dialog title to the selected item
- TQListViewItem *pParent = p->parent();
- TQString title;
- title = pParent ? pParent->text(CONDUIT_NAME) + CSL1(" - ") : TQString() ;
- title += p ? p->text(CONDUIT_NAME) : i18n("KPilot Setup");
- fTitleText->setText(title);
-}
-
-void ConduitConfigWidget::configure()
-{
- loadAndConfigure(fConduitList->selectedItem());
-}
-
-void ConduitConfigWidget::warnNoExec(const TQListViewItem * p)
-{
- FUNCTIONSETUP;
-
- TQString msg = i18n("<qt>No library could be "
- "found for the conduit %1. This means that the "
- "conduit was not installed properly.</qt>")
- .arg(p->text(CONDUIT_NAME));
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": No library for "
- << p->text(CONDUIT_NAME) << endl;
-#endif
-
- KMessageBox::error(this, msg, i18n("Conduit Error"));
-}
-
-void ConduitConfigWidget::warnNoLibrary(const TQListViewItem *p)
-{
- FUNCTIONSETUP;
-
- TQString msg = i18n("<qt>There was a problem loading the library "
- "for the conduit %1. This means that the "
- "conduit was not installed properly.</qt>")
- .arg(p->text(CONDUIT_NAME));
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Can't load library for "
- << p->text(CONDUIT_NAME) << endl;
-#endif
-
- KMessageBox::error(this, msg, i18n("Conduit Error"));
-}
-
-void ConduitConfigWidget::save()
-{
- FUNCTIONSETUP;
-
- // Only new-style conduits and the general setup have changes that need to be commited
- // old-style conduits have their own config dlg which commits them itself
- if ( fStack->id( fStack->visibleWidget())==NEW_CONDUIT )
- {
- if (fCurrentConfig) fCurrentConfig->commit();
- }
-
- TQStringList activeConduits;
- TQListViewItemIterator it( fConduitList );
- while ( it.current() ) {
- KPilotCheckListItem*p = dynamic_cast<KPilotCheckListItem*>(it.current());
- if ( p )
- {
- p->setOriginalState( p->isOn() );
- if ( p->isOn() )
- activeConduits.append(p->text(CONDUIT_DESKTOP));
- }
- ++it;
- }
- KPilotSettings::setInstalledConduits(activeConduits);
- KPilotSettings::self()->writeConfig();
-}
-
-
-void ConduitConfigWidget::load()
-{
- FUNCTIONSETUP;
- KPilotSettings::self()->readConfig();
-
- TQStringList potentiallyInstalled = KPilotSettings::installedConduits();
- TQListViewItem*p = fConduitList->firstChild();
- while (p)
- {
- TQListViewItem*q = p->firstChild();
- while (q)
- {
- TQCheckListItem*qq=dynamic_cast<TQCheckListItem*>(q);
- if (qq)
- {
- qq->setOn(! (potentiallyInstalled.findIndex(qq->text(CONDUIT_DESKTOP))<0) );
- }
- q = q->nextSibling();
- }
- p=p->nextSibling();
- }
-
-
- // Only new-style conduits and the general setup have changes that need to be commited
- // old-style conduits have their own config dlg which commits them itself
- if ( fStack->id( fStack->visibleWidget())==NEW_CONDUIT )
- {
- if (fCurrentConfig) fCurrentConfig->load();
- }
-}
-
-
-void ConduitConfigWidget::conduitsChanged(TQListViewItem*item)
-{
- KPilotCheckListItem*i=dynamic_cast<KPilotCheckListItem*>(item);
- if (i)
- {
- if (!i->isOriginalState()) emit changed(true);
- }
-}
-
-void ConduitConfigWidget::reopenItem(TQListViewItem *i)
-{
- i->setOpen(true);
-}
-
-void ConduitConfigWidget::configureWizard()
-{
- FUNCTIONSETUP;
- ConfigWizard wiz(this, "Wizard");
- if (wiz.exec()) {
- KPilotSettings::self()->readConfig();
- load();
- }
-}
-
-
diff --git a/kpilot/kpilot/conduitConfigDialog.h b/kpilot/kpilot/conduitConfigDialog.h
deleted file mode 100644
index 9873e057..00000000
--- a/kpilot/kpilot/conduitConfigDialog.h
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef _KPILOT_CONDUITCONFIGDIALOG_H
-#define _KPILOT_CONDUITCONFIGDIALOG_H
-/* conduitConfigDialog.h KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a dialog that uses the .ui-defined widget for
-** configuring conduits.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-// #include "conduitConfigDialog_base.h"
-#include "kcmodule.h"
-
-class TQListView;
-class TQListViewItem;
-class TQPushButton;
-class TQLabel;
-class TQWidgetStack;
-class KProcess;
-class ConduitConfigBase;
-class ConduitConfig;
-
-class ConduitConfigWidgetBase : public KCModule
-{
-Q_OBJECT
-public:
- ConduitConfigWidgetBase(TQWidget *p=0L,const char *n=0L);
-
- TQListView *fConduitList;
- TQWidgetStack *fStack;
- TQPushButton *fConfigureButton;
- TQPushButton *fConfigureWizard,*fConfigureKontact;
- TQLabel *fActionDescription;
- TQLabel *fTitleText; // Dialog title above fStack
-} ;
-
-class ConduitConfigWidget : public ConduitConfigWidgetBase
-{
-Q_OBJECT
-public:
- ConduitConfigWidget(TQWidget *,
- const char *name=0L, bool ownButtons=false);
- virtual ~ConduitConfigWidget();
-
-protected:
- void fillLists();
-
- void warnNoExec(const TQListViewItem *);
- void warnNoLibrary(const TQListViewItem *);
-
- void loadAndConfigure(TQListViewItem *); // ,bool);
-
-public:
- /**
- * Get rid of the current conduit configuration widget,
- * saving changes if necessary. Returns false if the user
- * selects cancel for the action that is supposed to
- * release the conduit (ie. selecting a different one,
- * or closing the dialog.)
- */
- bool release();
- bool validate() {return release(); }
-
-public slots:
- virtual void save();
- virtual void load();
-// void slotOk();
-// void slotApply();
-
-signals:
- void selectionChanged(TQListViewItem *);
- void sizeChanged();
-
-protected slots:
- void configure();
- void configureWizard();
-
- void unselect(); // Helper slot when cancelling a change in selection
- void selected(TQListViewItem *);
- void conduitsChanged(TQListViewItem*);
- void reopenItem(TQListViewItem *);
-
-private:
- TQPushButton *fConfigure;
- TQListViewItem *fCurrentConduit;
- TQListViewItem *fGeneralPage;
- ConduitConfigBase *fCurrentConfig;
-};
-
-#endif
diff --git a/kpilot/kpilot/datebookWidget.cc b/kpilot/kpilot/datebookWidget.cc
deleted file mode 100644
index bc2dff5e..00000000
--- a/kpilot/kpilot/datebookWidget.cc
+++ /dev/null
@@ -1,133 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2003 by Dan Pilone.
-** Authored by Adriaan de Groot
-**
-** This is the viewer for datebook data.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include "options.h"
-
-
-#include <tqlayout.h>
-#include <tqdir.h>
-#include <tqpushbutton.h>
-
-#include <klistview.h>
-#include <kdatepicker.h>
-#include <kmessagebox.h>
-
-#include "datebookWidget.moc"
-
-DatebookWidget::DatebookWidget(TQWidget *parent, const TQString &dbpath) :
- PilotComponent(parent,"component_generic",dbpath)
-{
- FUNCTIONSETUP;
-
- TQGridLayout *g = new TQGridLayout(this,1,1,SPACING);
-
- fDatePicker = new KDatePicker( this, "fDatePicker" );
- fDatePicker->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, fDatePicker->sizePolicy().hasHeightForWidth() ) );
- g->addMultiCellWidget(fDatePicker,0,0,0,2);
-
- TQSpacerItem* spacer = new TQSpacerItem( 20, 180, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
- g->addItem( spacer, 1, 1 );
-
- fAddButton = new TQPushButton( i18n( "&Add..." ), this, "pushButton1" );
- g->addWidget( fAddButton, 2, 0 );
-
- fEditButton = new TQPushButton( i18n( "&Edit..." ), this, "pushButton2" );
- g->addWidget( fEditButton, 2, 1 );
-
- fDeleteButton = new TQPushButton( i18n( "&Delete..." ), this, "pushButton3" );
- g->addWidget( fDeleteButton, 2, 2 );
-
- fEventList = new KListView( this, "kListView1" );
- fEventList->addColumn( i18n( "Time" ) );
- fEventList->addColumn( i18n( "Al" ) );
- fEventList->addColumn( i18n( "Rec" ) );
- fEventList->addColumn( i18n( "Description" ) );
-// fEventList->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, fEventList->sizePolicy().hasHeightForWidth() ) );
- fEventList->setAllColumnsShowFocus( TRUE );
- fEventList->setShowSortIndicator( TRUE );
- fEventList->setResizeMode( KListView::/*LastColumn*/AllColumns );
- fEventList->setFullWidth( TRUE );
-// fEventList->setAlternateBackground( TQColor( 221, 146, 240 ) );
- g->addMultiCellWidget(fEventList, 0, 2, 3, 3);
-
- connect(fDatePicker, TQT_SIGNAL(dateChanged()), TQT_SLOT(slotDayChanged()));
- connect(fAddButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddEvent()));
- connect(fEditButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotEditEvent()));
- connect(fDeleteButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteEvent()));
-}
-
-DatebookWidget::~DatebookWidget()
-{
- FUNCTIONSETUP;
-}
-
-
-void DatebookWidget::showComponent()
-{
- FUNCTIONSETUP;
-
- // TODO: Open the calendar database
- // TODO: Initialize the current month
- // TODO: Fill the calendar and the event list
-}
-
-void DatebookWidget::hideComponent()
-{
- FUNCTIONSETUP;
-
- // TODO: Close the calendar database if open
- // TODO: clear the calendar and the event list
-}
-
-void DatebookWidget::slotDayChanged()
-{
- FUNCTIONSETUP;
- KMessageBox::information(this, CSL1("slotDayChanged"));
-}
-
-void DatebookWidget::slotAddEvent()
-{
- FUNCTIONSETUP;
- KMessageBox::information(this, CSL1("slotAddEvent"));
-}
-
-void DatebookWidget::slotEditEvent()
-{
- FUNCTIONSETUP;
- KMessageBox::information(this, CSL1("slotEditEvent"));
-}
-
-void DatebookWidget::slotDeleteEvent()
-{
- FUNCTIONSETUP;
- KMessageBox::information(this, CSL1("slotDeleteEvent"));
-}
-
-
diff --git a/kpilot/kpilot/datebookWidget.h b/kpilot/kpilot/datebookWidget.h
deleted file mode 100644
index 3b44a204..00000000
--- a/kpilot/kpilot/datebookWidget.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef _KPILOT_DATEBOOKWIDGET_H
-#define _KPILOT_DATEBOOKWIDGET_H
-/* datebookWidget.h KPilot
-**
-** Copyright (C) 2003 by Dan Pilone.
-** Authored by Adriaan de Groot
-**
-** This is the viewer widget for viewing datebook entries in
-** a marginally useful form.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "pilotComponent.h"
-
-class KDatePicker;
-class TQPushButton;
-class KListView;
-
-class DatebookWidget : public PilotComponent
-{
-Q_OBJECT
-
-public:
- DatebookWidget(TQWidget* parent, const TQString& dbpath);
- virtual ~DatebookWidget();
-
- // Pilot component methods
- void hideComponent();
- void showComponent();
-
-protected slots:
- void slotDayChanged();
- void slotAddEvent();
- void slotEditEvent();
- void slotDeleteEvent();
-
-private:
- KDatePicker*fDatePicker;
- TQPushButton*fAddButton;
- TQPushButton*fEditButton;
- TQPushButton*fDeleteButton;
- KListView*fEventList;
-};
-
-
-#endif
diff --git a/kpilot/kpilot/dbAppInfoEditor.cc b/kpilot/kpilot/dbAppInfoEditor.cc
deleted file mode 100644
index 2e9e4b5f..00000000
--- a/kpilot/kpilot/dbAppInfoEditor.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/* dbRecordEditor.cc KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-**/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <tqtextedit.h>
-#include <tqlabel.h>
-#include <kdialogbase.h>
-#include <kmessagebox.h>
-
-#include "dbAppInfoEditor.h"
-
-#include <khexedit/byteseditinterface.h>
-using namespace KHE;
-
-
-/*************************************************
-**************************************************/
-
-DBAppInfoEditor::DBAppInfoEditor(char*appInfoData, int l, TQWidget *parent) :
- KDialogBase(parent, "AppBlock Editor",false,
- i18n("Edit AppInfo Block"),
- Ok|Cancel),
- appInfo(appInfoData),
- len(l)
-{
- fAppInfoEdit = KHE::createBytesEditWidget( this, "fAppInfoEdit" );
- if( fAppInfoEdit )
- {
- // fetch the editor interface
- KHE::BytesEditInterface* fAppInfoEditIf = KHE::bytesEditInterface( fAppInfoEdit );
- Q_ASSERT( fAppInfoEditIf ); // This should not fail!
- if( fAppInfoEditIf )
- {
- fAppInfoEditIf->setData( (char*)appInfoData, l );
- fAppInfoEditIf->setMaxDataSize( l );
- // TODO_RK: Make the app info editable. I need to find a way
- // to sync the appInfoBlock to the handheld
- fAppInfoEditIf->setReadOnly( true );
- }
- }
- else
- {
- TQLabel*tmpW = new TQLabel( i18n("To view the Application info block data, please install a hex editor (e.g. khexedit from kdeutils)."), this );
- tmpW->setBackgroundMode( Qt::PaletteMid );
- tmpW->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak);
- tmpW->setFrameShape( TQFrame::Panel );
- tmpW->setFrameShadow( TQFrame::Sunken );
- fAppInfoEdit = tmpW;
- }
- setMainWidget( fAppInfoEdit );
- fillWidgets();
-}
-
-
-DBAppInfoEditor::~DBAppInfoEditor()
-{
-}
-
-void DBAppInfoEditor::slotOk()
-{
- KMessageBox::sorry(this, i18n("Changing the AppInfo block isn't yet supported by KPilot!"));
-/* if (KMessageBox::questionYesNo(this, i18n("Changing the AppInfo block "
- "might corrupt the whole database. \n\nReally assign the new AppInfo "
- "block?"), i18n("Changing AppInfo Block"), i18n("Assign"), KStdGuiItem::cancel())==KMessageBox::Yes)
- {
- // TODO: Copy the data over
- // TODO: set the length
- // (*len)=..;
- }*/
- KDialogBase::slotOk();
-}
-
-void DBAppInfoEditor::fillWidgets()
-{
- // FUNCTIONSETUP
-}
-
-
-
-#include "dbAppInfoEditor.moc"
diff --git a/kpilot/kpilot/dbAppInfoEditor.h b/kpilot/kpilot/dbAppInfoEditor.h
deleted file mode 100644
index cee9336a..00000000
--- a/kpilot/kpilot/dbAppInfoEditor.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _KPILOT_DBAPPINFOEDITOR_H
-#define _KPILOT_DBAPPINFOEDITOR_H
-/* dbAppInfoEditor.h KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-#include <kdialogbase.h>
-
-class TQWidget;
-
-class DBAppInfoEditor : public KDialogBase
-{
-Q_OBJECT
-public:
- DBAppInfoEditor(char*appInfoData, int l, TQWidget *parent = 0);
- ~DBAppInfoEditor();
- char*appInfo;
- int len;
-protected:
- void fillWidgets();
- TQWidget*fAppInfoEdit;
-protected slots:
- virtual void slotOk();
-};
-
-
-#endif
diff --git a/kpilot/kpilot/dbFlagsEditor.cc b/kpilot/kpilot/dbFlagsEditor.cc
deleted file mode 100644
index 89f14d03..00000000
--- a/kpilot/kpilot/dbFlagsEditor.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-**/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <pi-dlp.h>
-
-#include <tqlineedit.h>
-#include <tqcheckbox.h>
-#include <kdatewidget.h>
-#include <ktimewidget.h>
-#include <kmessagebox.h>
-
-#include "pilotRecord.h"
-#include "dbFlagsEditor.h"
-#include "dbFlagsEditor_base.h"
-
-
-DBFlagsEditor::DBFlagsEditor(DBInfo*dbinfo, TQWidget *parent) :
- KDialogBase(parent, "FlagsEditor",false,
- i18n("Edit Database Flags"), Ok|Cancel),
- dbi(dbinfo)
-{
- widget=new DBFlagsEditorWidget(this);
- setMainWidget(widget);
- fillWidgets();
-}
-
-
-DBFlagsEditor::~DBFlagsEditor()
-{
-}
-
-void DBFlagsEditor::slotOk()
-{
- if (KMessageBox::questionYesNo(this, i18n("Changing the database flags might corrupt the whole database, or make the data unusable. Do not change the values unless you are absolutely sure you know what you are doing.\n\nReally assign these new flags?"), i18n("Changing Database Flags"),i18n("Assign"),KStdGuiItem::cancel())==KMessageBox::Yes)
- {
- Pilot::toPilot(widget->fDBName->text(),dbi->name,33);
-
- char buff[5];
- strlcpy(buff, widget->fType->text().latin1(), 5);
- dbi->type=get_long(buff);
-
- strlcpy(buff, widget->fCreator->text().latin1(), 5);
- dbi->creator=get_long(buff);
-
-
-#define setflag(ctrl, flag) if (widget->ctrl->isChecked()) dbi->flags |=flag;\
- else dbi->flags &= ~flag;
-
- setflag(fRessourceDB, dlpDBFlagResource);
- setflag(fReadOnly, dlpDBFlagReadOnly);
- setflag(fBackupDB, dlpDBFlagBackup);
- setflag(fCopyProtect, dlpDBFlagCopyPrevention);
- setflag(fReset, dlpDBFlagReset);
-#undef setflag
-
- if (widget->fExcludeDB->isChecked())
- dbi->miscFlags |= dlpDBMiscFlagExcludeFromSync;
- else dbi->miscFlags &= ~dlpDBMiscFlagExcludeFromSync;
-
- TQDateTime ttime;
- ttime.setDate(widget->fCreationDate->date());
-#if KDE_IS_VERSION(3,1,9)
- ttime.setTime(widget->fCreationTime->time());
-#endif
- dbi->createDate=ttime.toTime_t();
-
- ttime.setDate(widget->fModificationDate->date());
-#if KDE_IS_VERSION(3,1,9)
- ttime.setTime(widget->fModificationTime->time());
-#endif
- dbi->modifyDate=ttime.toTime_t();
-
- ttime.setDate(widget->fBackupDate->date());
-#if KDE_IS_VERSION(3,1,9)
- ttime.setTime(widget->fBackupTime->time());
-#endif
- dbi->backupDate=ttime.toTime_t();
-
- KDialogBase::slotOk();
- }
-}
-
-void DBFlagsEditor::slotCancel()
-{
- KDialogBase::slotCancel();
-}
-
-void DBFlagsEditor::fillWidgets()
-{
- // FUNCTIONSETUP
-
- widget->fDBName->setText(TQString::fromLatin1(dbi->name));
-
- char buff[5];
- set_long(buff, dbi->type);
- buff[4]='\0';
- widget->fType->setText(TQString::fromLatin1(buff));
- set_long(buff, dbi->creator);
- buff[4]='\0';
- widget->fCreator->setText(TQString::fromLatin1(buff));
-
- widget->fRessourceDB->setChecked(dbi->flags & dlpDBFlagResource);
- widget->fReadOnly->setChecked(dbi->flags & dlpDBFlagReadOnly);
- widget->fBackupDB->setChecked(dbi->flags & dlpDBFlagBackup);
- widget->fCopyProtect->setChecked(dbi->flags & dlpDBFlagCopyPrevention);
-
- widget->fReset->setChecked(dbi->flags & dlpDBFlagReset);
- widget->fExcludeDB->setChecked(dbi->miscFlags & dlpDBMiscFlagExcludeFromSync);
-
- TQDateTime ttime;
- ttime.setTime_t(dbi->createDate);
- widget->fCreationDate->setDate(ttime.date());
-#if KDE_IS_VERSION(3,1,9)
- widget->fCreationTime->setTime(ttime.time());
-#endif
-
- ttime.setTime_t(dbi->modifyDate);
- widget->fModificationDate->setDate(ttime.date());
-#if KDE_IS_VERSION(3,1,9)
- widget->fModificationTime->setTime(ttime.time());
-#endif
-
- ttime.setTime_t(dbi->backupDate);
- widget->fBackupDate->setDate(ttime.date());
-#if KDE_IS_VERSION(3,1,9)
- widget->fBackupTime->setTime(ttime.time());
-#endif
-}
-
-
-#include "dbFlagsEditor.moc"
diff --git a/kpilot/kpilot/dbFlagsEditor.h b/kpilot/kpilot/dbFlagsEditor.h
deleted file mode 100644
index c5ad3c08..00000000
--- a/kpilot/kpilot/dbFlagsEditor.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef _KPILOT_DBFLAGSEDITOR_H
-#define _KPILOT_DBFLAGSEDITOR_H
-/* dbFlagsEditor.h KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-#include <kdialogbase.h>
-
-class DBFlagsEditorWidget;
-struct DBInfo;
-/**
-@author Reinhold Kainhofer
-*/
-class DBFlagsEditor : public KDialogBase
-{
-Q_OBJECT
-public:
- DBFlagsEditor(DBInfo*dbinfo=0L, TQWidget *parent = 0);
- ~DBFlagsEditor();
-
-protected:
- void fillWidgets();
- DBInfo*dbi;
- DBFlagsEditorWidget*widget;
-protected slots:
- virtual void slotOk();
- virtual void slotCancel();
-
-
-};
-
-#endif
diff --git a/kpilot/kpilot/dbFlagsEditor_base.ui b/kpilot/kpilot/dbFlagsEditor_base.ui
deleted file mode 100644
index ce00cf3b..00000000
--- a/kpilot/kpilot/dbFlagsEditor_base.ui
+++ /dev/null
@@ -1,376 +0,0 @@
-<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
-<class>DBFlagsEditorWidget</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>DBFlagsEditorWidget</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>465</width>
- <height>353</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fDBNameLabel</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Database &amp;name:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fDBName</cstring>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="3">
- <property name="name">
- <cstring>fCreatorLabel</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>&amp;Creator:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fCreator</cstring>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="0">
- <property name="name">
- <cstring>fTypeLabel</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>&amp;Type:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fType</cstring>
- </property>
- </widget>
- <widget class="QLineEdit" row="1" column="1" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fType</cstring>
- </property>
- <property name="maxLength">
- <number>4</number>
- </property>
- </widget>
- <widget class="QLineEdit" row="1" column="4" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fCreator</cstring>
- </property>
- <property name="maxLength">
- <number>4</number>
- </property>
- </widget>
- <widget class="QButtonGroup" row="2" column="0" rowspan="1" colspan="5">
- <property name="name">
- <cstring>fDBFlagsGroup</cstring>
- </property>
- <property name="title">
- <string>Database Flags</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QCheckBox" row="0" column="0">
- <property name="name">
- <cstring>fRessourceDB</cstring>
- </property>
- <property name="text">
- <string>&amp;Ressource database</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="1" column="0">
- <property name="name">
- <cstring>fReadOnly</cstring>
- </property>
- <property name="text">
- <string>Rea&amp;d-only</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="2" column="0">
- <property name="name">
- <cstring>fBackupDB</cstring>
- </property>
- <property name="text">
- <string>Database is &amp;backed up</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="3" column="0">
- <property name="name">
- <cstring>fCopyProtect</cstring>
- </property>
- <property name="text">
- <string>Copy &amp;protected</string>
- </property>
- </widget>
- <spacer row="4" column="0">
- <property name="name">
- <cstring>spacer4</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </grid>
- </widget>
- <widget class="QButtonGroup" row="2" column="5" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fMiscFlagsGroup</cstring>
- </property>
- <property name="title">
- <string>Misc Flags</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <spacer row="2" column="0">
- <property name="name">
- <cstring>spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>21</width>
- <height>60</height>
- </size>
- </property>
- </spacer>
- <widget class="QCheckBox" row="0" column="0">
- <property name="name">
- <cstring>fReset</cstring>
- </property>
- <property name="text">
- <string>Reset after &amp;installation</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="1" column="0">
- <property name="name">
- <cstring>fExcludeDB</cstring>
- </property>
- <property name="text">
- <string>E&amp;xclude from sync</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="QGroupBox" row="3" column="0" rowspan="1" colspan="7">
- <property name="name">
- <cstring>fTimeStampGroup</cstring>
- </property>
- <property name="title">
- <string>Time Stamps</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>fCreationLabel</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Cr&amp;eation time:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fCreationDate</cstring>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="0">
- <property name="name">
- <cstring>fModificationlabel</cstring>
- </property>
- <property name="text">
- <string>&amp;Modification time:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fModificationDate</cstring>
- </property>
- </widget>
- <widget class="QLabel" row="2" column="0">
- <property name="name">
- <cstring>fBackupLabel</cstring>
- </property>
- <property name="text">
- <string>Back&amp;up time:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fBackupDate</cstring>
- </property>
- </widget>
- <widget class="KTimeWidget" row="0" column="2">
- <property name="name">
- <cstring>fCreationTime</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy">
- <enum>StrongFocus</enum>
- </property>
- </widget>
- <widget class="KTimeWidget" row="1" column="2">
- <property name="name">
- <cstring>fModificationTime</cstring>
- </property>
- <property name="focusPolicy">
- <enum>StrongFocus</enum>
- </property>
- </widget>
- <widget class="KTimeWidget" row="2" column="2">
- <property name="name">
- <cstring>fBackupTime</cstring>
- </property>
- <property name="focusPolicy">
- <enum>StrongFocus</enum>
- </property>
- </widget>
- <widget class="KDateWidget" row="2" column="1">
- <property name="name">
- <cstring>fBackupDate</cstring>
- </property>
- <property name="focusPolicy">
- <enum>StrongFocus</enum>
- </property>
- </widget>
- <widget class="KDateWidget" row="1" column="1">
- <property name="name">
- <cstring>fModificationDate</cstring>
- </property>
- <property name="focusPolicy">
- <enum>StrongFocus</enum>
- </property>
- </widget>
- <widget class="KDateWidget" row="0" column="1">
- <property name="name">
- <cstring>fCreationDate</cstring>
- </property>
- <property name="focusPolicy">
- <enum>StrongFocus</enum>
- </property>
- </widget>
- </grid>
- </widget>
- <spacer row="1" column="6">
- <property name="name">
- <cstring>spacer1</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>180</width>
- <height>21</height>
- </size>
- </property>
- </spacer>
- <widget class="QLineEdit" row="0" column="2" rowspan="1" colspan="5">
- <property name="name">
- <cstring>fDBName</cstring>
- </property>
- <property name="maxLength">
- <number>34</number>
- </property>
- </widget>
- <spacer row="4" column="5">
- <property name="name">
- <cstring>spacer2</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>31</width>
- <height>70</height>
- </size>
- </property>
- </spacer>
- </grid>
-</widget>
-<tabstops>
- <tabstop>fDBName</tabstop>
- <tabstop>fType</tabstop>
- <tabstop>fCreator</tabstop>
- <tabstop>fRessourceDB</tabstop>
- <tabstop>fReadOnly</tabstop>
- <tabstop>fBackupDB</tabstop>
- <tabstop>fCopyProtect</tabstop>
- <tabstop>fReset</tabstop>
- <tabstop>fExcludeDB</tabstop>
- <tabstop>fCreationDate</tabstop>
- <tabstop>fCreationTime</tabstop>
- <tabstop>fModificationDate</tabstop>
- <tabstop>fModificationTime</tabstop>
- <tabstop>fBackupDate</tabstop>
- <tabstop>fBackupTime</tabstop>
-</tabstops>
-<includes>
- <include location="local" impldecl="in implementation">dbFlagsEditor_base.ui.h</include>
- <include location="system" impldecl="in implementation">kdatewidget.h</include>
-</includes>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/kpilot/kpilot/dbFlagsEditor_base.ui.h b/kpilot/kpilot/dbFlagsEditor_base.ui.h
deleted file mode 100644
index 189f09d1..00000000
--- a/kpilot/kpilot/dbFlagsEditor_base.ui.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/****************************************************************************
-** ui.h extension file, included from the uic-generated form implementation.
-**
-** If you wish to add, delete or rename functions or slots use
-** Qt Designer which will update this file, preserving your code. Create an
-** init() function in place of a constructor, and a destroy() function in
-** place of a destructor.
-*****************************************************************************/
-#ifndef KDE_VERSION
-#include <kdeversion.h>
-#endif
-
-#if KDE_IS_VERSION(3,1,90)
-#include <ktimewidget.h>
-#else
-#warning "Workaround for KTimeWidget in KDE 3.1"
-class KTimeWidget : public QWidget
-{
-public:
- KTimeWidget(TQWidget *p, const char *n) : TQWidget(p,n) {};
-} ;
-
-
-#endif
diff --git a/kpilot/kpilot/dbRecordEditor.cc b/kpilot/kpilot/dbRecordEditor.cc
deleted file mode 100644
index b3dfd8f7..00000000
--- a/kpilot/kpilot/dbRecordEditor.cc
+++ /dev/null
@@ -1,235 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-**/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <tqlineedit.h>
-#include <tqcheckbox.h>
-#include <tqtooltip.h>
-#include <tqwhatsthis.h>
-#include <tqbuttongroup.h>
-#include <tqlabel.h>
-#include <tqpushbutton.h>
-#include <tqlayout.h>
-
-#include <kmessagebox.h>
-
-#include "pilotRecord.h"
-#include "dbRecordEditor.h"
-//#include "dbRecordEditor_base.h"
-
-#include <khexedit/byteseditinterface.h>
-#include <khexedit/valuecolumninterface.h>
-#include <khexedit/charcolumninterface.h>
-using namespace KHE;
-
-
-
-DBRecordEditor::DBRecordEditor(PilotRecord*r, int n, TQWidget *parent)
- : KDialogBase(parent, "RecordEditor",false,i18n("Edit Record"),
- Ok|Cancel), rec(r), nr(n)
-{
-// fWidget=new DBRecordEditorBase(this);
- fWidget=new TQWidget(this);
- setMainWidget(fWidget);
- fBuffer = new char[4096];
-
- initWidgets();
- fillWidgets();
-}
-
-
-DBRecordEditor::~DBRecordEditor()
-{
- KPILOT_DELETE( fBuffer );
-}
-
-
-void DBRecordEditor::slotOk()
-{
- FUNCTIONSETUP;
- if (KMessageBox::questionYesNo(this, i18n("Changing the record data and flags might corrupt the whole record, or even make the database unusable. Do not change the values unless you are absolutely sure you know what you are doing.\n\nReally assign these new flags?"), i18n("Changing Record"),i18n("Assign"),KStdGuiItem::cancel())==KMessageBox::Yes)
- {
- int att=rec->attributes();
-#define setFlag(ctrl, flag) if (ctrl->isChecked()) att|=flag; else att &= ~flag;
- setFlag(fDirty, dlpRecAttrDirty);
- setFlag(fDeleted, dlpRecAttrDeleted);
- setFlag(fBusy, dlpRecAttrBusy);
- setFlag(fSecret, dlpRecAttrSecret);
- setFlag(fArchived, dlpRecAttrArchived);
- rec->setAttributes(att);
-#undef setFlag
-
- if ( fRecordDataIf->isModified() )
- {
- DEBUGKPILOT << "record data changed, new Length of record: " <<
- fRecordDataIf->dataSize() << endl;
- // take over data
- rec->setData( fRecordDataIf->data(), fRecordDataIf->dataSize() );
- }
-
- KDialogBase::slotOk();
- }
-}
-
-void DBRecordEditor::slotCancel()
-{
- KDialogBase::slotCancel();
-}
-
-void DBRecordEditor::languageChange()
-{
- fRecordIndexLabel->setText( tr2i18n( "Record index:" ) );
- fRecordIDLabel->setText( tr2i18n( "Record ID:" ) );
- fRecordIndex->setText( tr2i18n( "1" ) );
- fRecordID->setText( tr2i18n( "1" ) );
- fFlagsGroup->setTitle( tr2i18n( "Flags" ) );
- fDirty->setText( tr2i18n( "&Dirty" ) );
- fDeleted->setText( tr2i18n( "De&leted" ) );
- fBusy->setText( tr2i18n( "&Busy" ) );
- fSecret->setText( tr2i18n( "&Secret" ) );
- fArchived->setText( tr2i18n( "&Archived" ) );
-}
-
-void DBRecordEditor::initWidgets()
-{
- // FUNCTIONSETUP
-
- DBRecordEditorBaseLayout = new TQGridLayout( fWidget, 1, 1, 11, 6, "DBRecordEditorBaseLayout");
-
- fRecordIndexLabel = new TQLabel( fWidget, "fRecordIndexLabel" );
- DBRecordEditorBaseLayout->addWidget( fRecordIndexLabel, 0, 0 );
-
- fRecordIDLabel = new TQLabel( fWidget, "fRecordIDLabel" );
- DBRecordEditorBaseLayout->addWidget( fRecordIDLabel, 0, 2 );
-
- fRecordIndex = new TQLineEdit( fWidget, "fRecordIndex" );
- fRecordIndex->setReadOnly( TRUE );
-
- DBRecordEditorBaseLayout->addWidget( fRecordIndex, 0, 1 );
-
- fRecordID = new TQLineEdit( fWidget, "fRecordID" );
- fRecordID->setReadOnly( TRUE );
-
- DBRecordEditorBaseLayout->addWidget( fRecordID, 0, 3 );
-
- fFlagsGroup = new TQButtonGroup( fWidget, "fFlagsGroup" );
- fFlagsGroup->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5,
- (TQSizePolicy::SizeType)4, 0, 0, fFlagsGroup->sizePolicy().hasHeightForWidth() ) );
- fFlagsGroup->setColumnLayout(0, Qt::Vertical );
- fFlagsGroup->layout()->setSpacing( 6 );
- fFlagsGroup->layout()->setMargin( 11 );
- fFlagsGroupLayout = new TQGridLayout( fFlagsGroup->layout() );
- fFlagsGroupLayout->setAlignment( Qt::AlignTop );
-
- fDirty = new TQCheckBox( fFlagsGroup, "fDirty" );
- fFlagsGroupLayout->addWidget( fDirty, 0, 0 );
-
- fDeleted = new TQCheckBox( fFlagsGroup, "fDeleted" );
- fFlagsGroupLayout->addWidget( fDeleted, 1, 0 );
-
- fBusy = new TQCheckBox( fFlagsGroup, "fBusy" );
- fFlagsGroupLayout->addWidget( fBusy, 0, 1 );
-
- fSecret = new TQCheckBox( fFlagsGroup, "fSecret" );
- fFlagsGroupLayout->addMultiCellWidget( fSecret, 1, 1, 1, 2 );
-
- fArchived = new TQCheckBox( fFlagsGroup, "fArchived" );
- fFlagsGroupLayout->addWidget( fArchived, 0, 2 );
-
- DBRecordEditorBaseLayout->addMultiCellWidget( fFlagsGroup, 1, 1, 0, 3 );
-
- fRecordData = KHE::createBytesEditWidget( fWidget, "fRecordData" );
- if( fRecordData )
- {
- // fetch the editor interface
- fRecordDataIf = KHE::bytesEditInterface( fRecordData );
- Q_ASSERT( fRecordDataIf ); // This should not fail!
-
- KHE::ValueColumnInterface *ValueColumn = valueColumnInterface( fRecordData );
- if( ValueColumn )
- {
- ValueColumn->setNoOfBytesPerLine( 16 );
- ValueColumn->setResizeStyle( KHE::ValueColumnInterface::LockGrouping );
-// ValueColumn->setCoding( ValueColumnInterface::HexadecimalCoding );
-// ValueColumn->setByteSpacingWidth( 2 );
- ValueColumn->setNoOfGroupedBytes( 4 );
- ValueColumn->setGroupSpacingWidth( 8 );
- }
-
- KHE::CharColumnInterface *CharColumn = charColumnInterface( fRecordData );
- if( CharColumn )
- {
- CharColumn->setShowUnprintable( false );
-// CharColumn->setSubstituteChar( '*' );
- }
- }
- else
- {
- TQLabel*tmpW = new TQLabel( i18n("To view and edit the record data, please install a hex editor (e.g. kbytesedit from kdeutils)."), fWidget );
- tmpW->setBackgroundMode( Qt::PaletteMid );
- tmpW->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak);
- tmpW->setFrameShape( TQFrame::Panel );
- tmpW->setFrameShadow( TQFrame::Sunken );
- fRecordData = tmpW;
- fRecordDataIf = 0;
- }
-
- DBRecordEditorBaseLayout->addMultiCellWidget( fRecordData, 2, 2, 0, 3 );
-
- languageChange();
- resize( TQSize(600, 561).expandedTo(minimumSizeHint()) );
-}
-
-void DBRecordEditor::fillWidgets()
-{
- // FUNCTIONSETUP
-
- fRecordIndex->setText(TQString::number(nr));
- fRecordID->setText(TQString::number(rec->id()));
-
- int att=rec->attributes();
- fDirty->setChecked(att & dlpRecAttrDirty);
- fDeleted->setChecked(att & dlpRecAttrDeleted);
- fBusy->setChecked(att & dlpRecAttrBusy);
- fSecret->setChecked(att & dlpRecAttrSecret);
- fArchived->setChecked(att & dlpRecAttrArchived);
-
- if( fRecordDataIf )
- {
- int len = rec->size();
- memcpy( fBuffer, rec->data(), len );
- fRecordDataIf->setData( fBuffer, len, 4096 );
- fRecordDataIf->setMaxDataSize( 4096 );
- fRecordDataIf->setReadOnly( false );
- // We are managing the buffer ourselves:
- fRecordDataIf->setAutoDelete( false );
- }
-}
-
-
-#include "dbRecordEditor.moc"
diff --git a/kpilot/kpilot/dbRecordEditor.h b/kpilot/kpilot/dbRecordEditor.h
deleted file mode 100644
index 627af55f..00000000
--- a/kpilot/kpilot/dbRecordEditor.h
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef _KPILOT_DBRECORDEDITOR_H
-#define _KPILOT_DBRECORDEDITOR_H
-/* dbRecordEditor.h KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-#include <kdialogbase.h>
-
-class TQVBoxLayout;
-class TQHBoxLayout;
-class TQGridLayout;
-
-namespace KHE {
-class BytesEditInterface;
-}
-using namespace KHE;
-
-class TQButtonGroup;
-class TQCheckBox;
-class TQLabel;
-class TQLineEdit;
-
-class DBRecordEditorBase;
-class PilotRecord;
-
-/**
-@author Reinhold Kainhofer
-*/
-class DBRecordEditor : public KDialogBase
-{
-Q_OBJECT
-public:
- DBRecordEditor(PilotRecord*r=0L, int n=-1, TQWidget *parent = 0);
- ~DBRecordEditor();
-
-protected:
- TQLabel* fRecordIndexLabel;
- TQLabel* fRecordIDLabel;
- TQLineEdit* fRecordIndex;
- TQLineEdit* fRecordID;
- TQButtonGroup* fFlagsGroup;
- TQCheckBox* fDirty;
- TQCheckBox* fDeleted;
- TQCheckBox* fBusy;
- TQCheckBox* fSecret;
- TQCheckBox* fArchived;
- TQWidget* fRecordData;
- KHE::BytesEditInterface*fRecordDataIf;
-
-protected:
- TQGridLayout* DBRecordEditorBaseLayout;
- TQGridLayout* fFlagsGroupLayout;
-
-protected:
-// DBRecordEditorBase*fWidget;
- TQWidget*fWidget;
- char*fBuffer;
-protected slots:
- virtual void languageChange();
-protected:
- void initWidgets();
- void fillWidgets();
- PilotRecord*rec;
- int nr;
-protected slots:
- virtual void slotOk();
- virtual void slotCancel();
-};
-
-#endif
diff --git a/kpilot/kpilot/dbRecordEditor_base.ui b/kpilot/kpilot/dbRecordEditor_base.ui
deleted file mode 100644
index c9983743..00000000
--- a/kpilot/kpilot/dbRecordEditor_base.ui
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
-<class>DBRecordEditorBase</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>DBRecordEditorBase</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>600</width>
- <height>561</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>fRecordIndexLabel</cstring>
- </property>
- <property name="text">
- <string>Record index:</string>
- </property>
- </widget>
- <widget class="QLabel" row="0" column="2">
- <property name="name">
- <cstring>fRecordIDLabel</cstring>
- </property>
- <property name="text">
- <string>Record ID:</string>
- </property>
- </widget>
- <widget class="QLineEdit" row="0" column="1">
- <property name="name">
- <cstring>fRecordIndex</cstring>
- </property>
- <property name="text">
- <string>1</string>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QLineEdit" row="0" column="3">
- <property name="name">
- <cstring>fRecordID</cstring>
- </property>
- <property name="text">
- <string>1</string>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="4">
- <property name="name">
- <cstring>fFlagsGroup</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>4</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Flags</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QCheckBox" row="0" column="0">
- <property name="name">
- <cstring>fDirty</cstring>
- </property>
- <property name="text">
- <string>&amp;Dirty</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="1" column="0">
- <property name="name">
- <cstring>fDeleted</cstring>
- </property>
- <property name="text">
- <string>&amp;Deleted</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="0" column="1">
- <property name="name">
- <cstring>fBusy</cstring>
- </property>
- <property name="text">
- <string>Busy</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="1" column="1" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fSecret</cstring>
- </property>
- <property name="text">
- <string>&amp;Secret</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="0" column="2">
- <property name="name">
- <cstring>fArchived</cstring>
- </property>
- <property name="text">
- <string>&amp;Archived</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="KHE::KHexEdit" row="2" column="0" rowspan="1" colspan="4">
- <property name="name">
- <cstring>fRecordData</cstring>
- </property>
- </widget>
- </grid>
-</widget>
-<customwidgets>
- <customwidget>
- <class>KHE::KHexEdit</class>
- <sizehint>
- <width>-1</width>
- <height>-1</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- <pixmap>image0</pixmap>
- </customwidget>
-</customwidgets>
-<images>
- <image name="image0">
- <data format="XPM.GZ" length="2926">789c9d95594f32591086effd15c4ba3393fae895ee4ce6824540141011b7c95cf406a202caa6f065fefb549faaea0b24996fc623cb937aeb3d55754e871f67a587eb6ee9ecc7c96a1dada74929798e96a5b374339bedfefceb8f9f27a7b65da27fcb724bf6e96f27a783752929f516f32c070402289b3fc39d8203c3136157e276c1260eac0f0ade0907927f2d9c58261f929cad72be0cef8535ff5959e277c201ef0fa02cf1ae7022f9efca12ff301ca81e87c21a5f32db5acf95b0eebfcdd92e2be3a5b0fa7986435bfd6e981d99278c0ae6795c288b3e2b98e3036157d8f839961308af985df51b1b0e9dc0098ddf5a3811fd7dceaee52a370d475e28f9b7ca1c07539f67173c144e65be2fcae2d763f62d89df2acb7cc282393e57b6b9ff58d893fca632c7d1ccc78bbcd48b4c7cc2ec4bfdf0aa2cfbf50be6fa2c65d9af2aacfd2c94e53cccf9fa7645eb7794a59ebdb027fe5565895f09cb7e981a267f9febaf3117fab6702af599e7a5e2049e6dce1377c25affa6608e4786e34a58894dfc8b59f5f890731087e28f2de648fbdb16ccfd6c9465bf7365c732f12f61ed3f5016fd4a59f4e6790fddd00a5d137f638eb4bfa532df5ffc148ea4be5ac17c5ea9b2ecd72b98efff403893fa1accb12d5c5696fd4d7f6152c41f95c53f2a98f56b6597fbf3857da9b75e30fb5584b59fa78239de5596fd3e0be6fdccf311b99115f1fcdaccb12fe77927ac7e2365f1c382793e63e14cfccdf3132571e69b1f07e83327d23fbac2bee4d785d57f2a9c89de9c6fecaa1fce98135bf845b9e2189e2a07e6fee287b0cfcf3bce9525ff5d38927a1bcca9cc1b66ca528ff93d89d338e3f9e182b9c86f31a752ff609d2f847f5f83b5ea31c218137a4f8fac0cc738e10cd6d3b7189f718a2ff88a6f38c339ad05adfcf31d3f7089ab037d42ea356e708b9ff8853bdc6395de6b58c706ad736c1ee823f2de608b146dbcc08e8976f012afb04b3975ec1de853aa2457f749d5c16b1ce00d0ecdf75b1ce1dd11fd1b55d236cef7f8808ff88465b4d02676d03da29f51dd9e513fa28f150c3004246d07002288bfe9e7d45f0712f22635a490d15ef730361e3b389c67aedf2390ea3157e73dc333e9a6f042d13ebc7ed32f6882405d3ee1c678030ee10d6630a76f162c8ee8f37adeb14c0aaa0b3e68b725ac80a2b039a29f630db6e46bc127d5fd45de4b5226b0833d8ea07a445f871ae96dacc218ead08073c835136842eba8be016db830e77a419f21aca143f76c025b9ae7e5813ea35bd5a0731fd1c4877a7f614fde57d085deb7f31ad31dccf54fd087883ab7a88f6baabb45fdf760003707fa09ddd826f66048af1826f00a0bb3aa7009b73082bb03fd2faeffa7fff58cfffcbcfffdfbc93f7f7d62d7</data>
- </image>
-</images>
-<includes>
- <include location="local" impldecl="in implementation">dbRecordEditor_base.ui.h</include>
-</includes>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/kpilot/kpilot/dbSelectionDialog.cc b/kpilot/kpilot/dbSelectionDialog.cc
deleted file mode 100644
index 683b8a8c..00000000
--- a/kpilot/kpilot/dbSelectionDialog.cc
+++ /dev/null
@@ -1,144 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a dialog box that lets the
-** user select a set of databases (e.g. which databases
-** should be ignored when doing a backup)
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <tqlistview.h>
-#include <tqpushbutton.h>
-#include <klistview.h>
-#include <kmessagebox.h>
-#include <kpushbutton.h>
-#include <klineedit.h>
-
-#include "dbSelection_base.h"
-#include "dbSelectionDialog.moc"
-
-
-KPilotDBSelectionDialog::KPilotDBSelectionDialog(TQStringList &selectedDBs, TQStringList &deviceDBs,
- TQStringList &addedDBs, TQWidget *w, const char *n) :
- KDialogBase(w, n, true, TQString::null, KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, false),
- fSelectedDBs(selectedDBs),
- fAddedDBs(addedDBs),
- fDeviceDBs(deviceDBs)
-{
- FUNCTIONSETUP;
-
- fSelectionWidget = new KPilotDBSelectionWidget(this);
- setMainWidget(fSelectionWidget);
-
- // Fill the encodings list
- TQStringList items(deviceDBs);
- for ( TQStringList::Iterator it = fAddedDBs.begin(); it != fAddedDBs.end(); ++it ) {
- if (items.contains(*it)==0) items << (*it);
- }
- for ( TQStringList::Iterator it = fSelectedDBs.begin(); it != fSelectedDBs.end(); ++it ) {
- if (items.contains(*it)==0) items << (*it);
- }
- items.sort();
-
- for ( TQStringList::Iterator it = items.begin(); it != items.end(); ++it ) {
- TQCheckListItem*checkitem=new TQCheckListItem(fSelectionWidget->fDatabaseList,
- *it, TQCheckListItem::CheckBox);
- if (fSelectedDBs.contains(*it)) checkitem->setOn(true);
- }
-
- connect(fSelectionWidget->fNameEdit, TQT_SIGNAL(textChanged( const TQString & )),
- this, TQT_SLOT(slotTextChanged( const TQString &)));
- connect(fSelectionWidget->fAddButton, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(addDB()));
- connect(fSelectionWidget->fRemoveButton, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(removeDB()));
-}
-
-KPilotDBSelectionDialog::~KPilotDBSelectionDialog()
-{
- FUNCTIONSETUP;
-}
-
-void KPilotDBSelectionDialog::addDB()
-{
- FUNCTIONSETUP;
- TQString dbname(fSelectionWidget->fNameEdit->text());
- if (!dbname.isEmpty())
- {
- fSelectionWidget->fNameEdit->clear();
- new TQCheckListItem(fSelectionWidget->fDatabaseList, dbname,
- TQCheckListItem::CheckBox);
- fAddedDBs << dbname;
- }
-}
-
-void KPilotDBSelectionDialog::removeDB()
-{
- FUNCTIONSETUP;
- TQListViewItem*item(fSelectionWidget->fDatabaseList->selectedItem());
- if (item)
- {
- TQString dbname=item->text(0);
- if (fDeviceDBs.contains(dbname))
- {
- KMessageBox::error(this, i18n("This is a database that exists on the device. It was not added manually, so it can not removed from the list."), i18n("Database on Device"));
- }
- else
- {
- fSelectedDBs.remove(dbname);
- fAddedDBs.remove(dbname);
- KPILOT_DELETE(item);
- }
- }
- else
- {
- KMessageBox::information(this, i18n("You need to select a database to delete in the list."),i18n("No Database Selected"), CSL1("NoDBSelected"));
- }
-}
-
-TQStringList KPilotDBSelectionDialog::getSelectedDBs()
-{
- fSelectedDBs.clear();
-
- // update the list of selected databases
- TQListViewItemIterator it( fSelectionWidget->fDatabaseList );
- while ( it.current() ) {
- TQCheckListItem *item = dynamic_cast<TQCheckListItem*>(it.current());
- ++it;
-
- if ( item && item->isOn() )
- fSelectedDBs << item->text();
- }
-
- return fSelectedDBs;
-}
-
-void KPilotDBSelectionDialog::slotTextChanged( const TQString& dbname)
-{
- FUNCTIONSETUP;
- fSelectionWidget->fAddButton->setDisabled(dbname.isEmpty());
-}
diff --git a/kpilot/kpilot/dbSelectionDialog.h b/kpilot/kpilot/dbSelectionDialog.h
deleted file mode 100644
index ee0df63d..00000000
--- a/kpilot/kpilot/dbSelectionDialog.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef _KPILOT_DBSELECTIONDIALOG_H
-#define _KPILOT_DBSELECTIONDIALOG_H
-/* dbSelectionDialog.h KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a dialog box that lets the
-** user select a set of databases (e.g. which databases
-** should be ignored when doing a backup)
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include <kdialogbase.h>
-
-class KPilotDBSelectionWidget;
-
-class KPilotDBSelectionDialog : public KDialogBase
-{
-Q_OBJECT
-public:
- KPilotDBSelectionDialog(TQStringList &selectedDBs, TQStringList &deviceDBs,
- TQStringList &addedDBs, TQWidget *, const char *);
- virtual ~KPilotDBSelectionDialog();
-
- TQStringList getSelectedDBs();
- TQStringList getAddedDBs() const {return fAddedDBs; };
-private:
- TQStringList fSelectedDBs;
- TQStringList fAddedDBs;
- TQStringList fDeviceDBs;
-protected slots:
- void addDB();
- void removeDB();
- void slotTextChanged( const TQString& dbname);
-
-private:
- KPilotDBSelectionWidget *fSelectionWidget;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/dbSelection_base.ui b/kpilot/kpilot/dbSelection_base.ui
deleted file mode 100644
index d692ca34..00000000
--- a/kpilot/kpilot/dbSelection_base.ui
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
-<class>KPilotDBSelectionWidget</class>
-<author>Reinhold Kainhofer</author>
-<widget class="QWidget">
- <property name="name">
- <cstring>DBSelectionWidgetForm</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>318</width>
- <height>218</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="KListView" row="0" column="0" rowspan="1" colspan="3">
- <column>
- <property name="text">
- <string>Database</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- <property name="name">
- <cstring>fDatabaseList</cstring>
- </property>
- <property name="resizeMode">
- <enum>LastColumn</enum>
- </property>
- <property name="itemsRenameable">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="KPushButton" row="1" column="2">
- <property name="name">
- <cstring>fRemoveButton</cstring>
- </property>
- <property name="text">
- <string>&amp;Remove</string>
- </property>
- </widget>
- <widget class="KLineEdit" row="1" column="0">
- <property name="name">
- <cstring>fNameEdit</cstring>
- </property>
- </widget>
- <widget class="KPushButton" row="1" column="1">
- <property name="name">
- <cstring>fAddButton</cstring>
- </property>
- <property name="text">
- <string>&amp;Add</string>
- </property>
- </widget>
- </grid>
-</widget>
-<connections>
- <connection>
- <sender>fNameEdit</sender>
- <signal>returnPressed()</signal>
- <receiver>fAddButton</receiver>
- <slot>animateClick()</slot>
- </connection>
-</connections>
-<layoutdefaults spacing="6" margin="11"/>
-<includes>
- <include location="system" impldecl="in implementation">klistview.h</include>
- <include location="system" impldecl="in implementation">kpushbutton.h</include>
- <include location="system" impldecl="in implementation">klineedit.h</include>
- <include location="system" impldecl="in implementation">kpushbutton.h</include>
-</includes>
-</UI>
diff --git a/kpilot/kpilot/dbviewerWidget.cc b/kpilot/kpilot/dbviewerWidget.cc
deleted file mode 100644
index b5f04632..00000000
--- a/kpilot/kpilot/dbviewerWidget.cc
+++ /dev/null
@@ -1,440 +0,0 @@
-/* dbViewerWidget.cc KPilot
-**
-** Copyright (C) 2003 by Dan Pilone.
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-** Written 2003 by Reinhold Kainhofer and Adriaan de Groot
-**
-** This is the generic DB viewer widget.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include "options.h"
-
-#include <unistd.h>
-#include <stdio.h>
-
-#include <pi-file.h>
-#include <pi-dlp.h>
-
-#include <tqlayout.h>
-#include <tqdir.h>
-#include <tqregexp.h>
-#include <tqlistview.h>
-
-#include <klistbox.h>
-#include <ktextedit.h>
-#include <kpushbutton.h>
-#include <kcombobox.h>
-#include <kmessagebox.h>
-
-#include "listCat.h"
-#include "listItems.h"
-
-#include "dbviewerWidget.h"
-#include "pilotLocalDatabase.h"
-#include "pilotDatabase.h"
-#include "pilotRecord.h"
-#include "dbFlagsEditor.h"
-#include "dbRecordEditor.h"
-#include "dbAppInfoEditor.h"
-#include "kpilotConfig.h"
-
-
-#include "dbviewerWidget.moc"
-
-
-GenericDBWidget::GenericDBWidget(TQWidget *parent, const TQString &dbpath) :
- PilotComponent(parent,"component_generic",dbpath), fDB(0L)
-{
- FUNCTIONSETUP;
- setupWidget();
- fRecList.setAutoDelete(true);
-}
-
-
-void GenericDBWidget::setupWidget()
-{
- TQGridLayout *g = new TQGridLayout( this, 1, 1, SPACING);
-
- fDBList = new KListBox( this );
- g->addWidget( fDBList, 0, 0 );
- fDBType = new KComboBox( FALSE, this );
- g->addWidget( fDBType, 1, 0 );
- fDBType->insertItem( i18n( "All Databases" ) );
- fDBType->insertItem( i18n( "Only Applications (*.prc)" ) );
- fDBType->insertItem( i18n( "Only Databases (*.pdb)" ) );
-
- TQGridLayout *g1 = new TQGridLayout( 0, 1, 1);
- fDBInfo = new KTextEdit( this );
- fDBInfo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, fDBInfo->sizePolicy().hasHeightForWidth() ) );
- fDBInfo->setReadOnly( TRUE );
- g1->addWidget( fDBInfo, 0, 0 );
- fDBInfoButton = new KPushButton( i18n( "General Database &Information" ), this );
- g1->addWidget( fDBInfoButton, 1, 0 );
- fAppInfoButton = new KPushButton( i18n( "&Application Info Block (Categories etc.)" ), this );
- g1->addWidget( fAppInfoButton, 2, 0 );
-
- TQGridLayout *g2 = new TQGridLayout( 0, 1, 1);
- fRecordList = new KListView( this );
- g2->addMultiCellWidget( fRecordList, 0, 0, 0, 2 );
- fRecordList->addColumn(i18n("Rec. Nr."));
- fRecordList->addColumn(i18n("Length"));
- fRecordList->addColumn(i18n("Record ID"));
- fRecordList->setAllColumnsShowFocus(true);
- fRecordList->setResizeMode( KListView::LastColumn );
- fRecordList->setFullWidth( TRUE );
- fRecordList->setItemsMovable( FALSE );
-
- fAddRecord = new KPushButton( i18n("&Add..."), this );
- g2->addWidget( fAddRecord, 1, 0 );
- fEditRecord = new KPushButton( i18n("&Edit..."), this );
- g2->addWidget( fEditRecord, 1, 1 );
- fDeleteRecord = new KPushButton( i18n("&Delete"), this );
- g2->addWidget( fDeleteRecord, 1, 2 );
-
- g1->addLayout( g2, 3, 0 );
-
-
- g->addMultiCellLayout( g1, 0, 1, 1, 1 );
- resize( TQSize(682, 661).expandedTo(minimumSizeHint()) );
-
- connect(fDBList, TQT_SIGNAL(highlighted(const TQString &)),
- this, TQT_SLOT(slotSelected(const TQString &)));
- connect(fDBType, TQT_SIGNAL(activated(int)),
- this, TQT_SLOT(slotDBType(int)));
- connect(fDBInfoButton, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(slotShowDBInfo()));
- connect(fAppInfoButton, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(slotShowAppInfo()));
- connect(fAddRecord, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(slotAddRecord()));
- connect(fEditRecord, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(slotEditRecord()));
- connect(fDeleteRecord, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(slotDeleteRecord()));
- connect(fRecordList, TQT_SIGNAL(executed(TQListViewItem*)),
- this, TQT_SLOT(slotEditRecord(TQListViewItem*)));
-
-}
-
-GenericDBWidget::~GenericDBWidget()
-{
- FUNCTIONSETUP;
- if (fDB) KPILOT_DELETE(fDB);
-}
-
-
-void GenericDBWidget::showComponent()
-{
- FUNCTIONSETUP;
- fDBInfo->setText(TQString::null);
- slotDBType(0);
-
- fDBList->show();
- fDBInfo->show();
-}
-
-void GenericDBWidget::hideComponent()
-{
- reset();
-}
-
-void GenericDBWidget::slotSelected(const TQString &dbname)
-{
- FUNCTIONSETUP;
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Selected DB " << dbname << endl;
-#endif
- struct DBInfo dbinfo;
- TQString display;
- fRecList.clear();
- fRecordList->clear();
-
- if (fDB) KPILOT_DELETE(fDB);
- currentDB=dbname;
-
- if (!shown) return;
-
- if (dbname.endsWith(CSL1(".pdb")) || dbname.endsWith(CSL1(".PDB")))
- {
- // We are dealing with a database
- currentDBtype=eDatabase;
-
- currentDB.remove( TQRegExp(CSL1(".(pdb|PDB)$")) );
-
- fDB=new PilotLocalDatabase(dbPath(), currentDB, false);
- if (!fDB || !fDB->isOpen())
- {
- fDBInfo->setText(i18n("<B>Warning:</B> Cannot read "
- "database file %1.").arg(currentDB));
- return;
- }
- dbinfo=fDB->getDBInfo();
- display.append(i18n("<B>Database:</B> %1, %2 records<BR>")
- .arg(TQString::fromLatin1(dbinfo.name)).arg(fDB->recordCount()));
- char buff[5];
- set_long(buff, dbinfo.type);
- buff[4]='\0';
- TQString tp = TQString::fromLatin1(buff);
- set_long(buff, dbinfo.creator);
- buff[4]='\0';
- TQString cr = TQString::fromLatin1(buff);
- display.append(i18n("<B>Type:</B> %1, <B>Creator:</B> %2<br><br>").arg(tp).arg(cr));
-
- int currentRecord = 0;
- PilotRecord *pilotRec;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Reading database "<<dbname<<"..." << endl;
-#endif
-
- while ((pilotRec = fDB->readRecordByIndex(currentRecord)) != 0L)
- {
-// if (!(pilotRec->isDeleted()) )
- {
- PilotListViewItem*item=new PilotListViewItem(fRecordList,
- TQString::number(currentRecord), TQString::number(pilotRec->size()),
- TQString::number(pilotRec->id()),
- TQString::null,
- pilotRec->id(), pilotRec);
- item->setNumericCol(0, true);
- item->setNumericCol(1, true);
- item->setNumericCol(2, true);
- }
- fRecList.append(pilotRec);
-
- currentRecord++;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Total " << currentRecord << " records" << endl;
-#endif
-
- }
- else
- {
- // we are dealing with an application
- currentDBtype=eApplication;
-
- TQCString filename = TQFile::encodeName(dbPath() + CSL1("/") + dbname);
- const char *s = filename;
- struct pi_file *pf = pi_file_open(const_cast<char *>(s));
- if (!pf)
- {
- fDBInfo->setText(i18n("<B>Warning:</B> Cannot read "
- "application file %1.").arg(dbname));
- return;
- }
-#if PILOT_LINK_NUMBER < PILOT_LINK_0_12_0
- if (pi_file_get_info(pf,&dbinfo))
- {
- fDBInfo->setText(i18n("<B>Warning:</B> Cannot read "
- "application file %1.").arg(dbname));
- return;
- }
-#else
- pi_file_get_info(pf,&dbinfo);
-#endif
- display.append(i18n("<B>Application:</B> %1<BR><BR>").arg(dbname));
- }
- enableWidgets(currentDBtype==eDatabase);
-
- TQDateTime ttime;
-
- ttime.setTime_t(dbinfo.createDate);
- display.append(i18n("Created: %1<BR>").arg(ttime.toString()));
-
- ttime.setTime_t(dbinfo.modifyDate);
- display.append(i18n("Modified: %1<BR>").arg(ttime.toString()));
-
- ttime.setTime_t(dbinfo.backupDate);
- display.append(i18n("Backed up: %1<BR>").arg(ttime.toString()));
-
- fDBInfo->setText(display);
-}
-
-void GenericDBWidget::slotDBType(int mode)
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- reset();
-
- TQDir dir(dbPath());
- switch (mode)
- {
- case 1:
- dir.setNameFilter(CSL1("*.prc")); break;
- case 2:
- dir.setNameFilter(CSL1("*.pdb")); break;
- case 0:
- default:
- dir.setNameFilter(CSL1("*.pdb;*.prc")); break;
- }
- TQStringList l = dir.entryList();
- fDBList->insertStringList(l);
-}
-
-void GenericDBWidget::reset()
-{
- FUNCTIONSETUP;
- fDBList->clear();
- fDBInfo->clear();
- fRecordList->clear();
- if (fDB) KPILOT_DELETE(fDB);
- currentDB=TQString::null;
-}
-
-void GenericDBWidget::slotAddRecord()
-{
- FUNCTIONSETUP;
- pi_buffer_t *b = pi_buffer_new(0);
- PilotRecord *rec=new PilotRecord(b, 0, 0, 0);
- PilotListViewItem*item=new PilotListViewItem(fRecordList,
- TQString::number(-1), TQString::number(rec->size()),
- TQString::number(rec->id()), TQString::null,
- rec->id(), rec);
- if (slotEditRecord(item))
- {
- fRecList.append(rec);
- }
- else
- {
- KPILOT_DELETE(item);
- KPILOT_DELETE(rec);
- }
-}
-
-bool GenericDBWidget::slotEditRecord(TQListViewItem*item)
-{
- FUNCTIONSETUP;
- PilotListViewItem*currRecItem=dynamic_cast<PilotListViewItem*>(item);
- if (currRecItem)
- {
- PilotRecord*rec=(PilotRecord*)currRecItem->rec();
- int nr=currRecItem->text(0).toInt();
- DBRecordEditor*dlg=new DBRecordEditor(rec, nr, this);
- if (dlg->exec())
- {
- currRecItem->setText(1, TQString::number(rec->size()));
- currRecItem->setText(2, TQString::number(rec->id()));
- fRecordList->triggerUpdate();
- writeRecord(rec);
- KPILOT_DELETE(dlg);
- return true;
- }
- KPILOT_DELETE(dlg);
- }
- else
- {
- // Either nothing selected, or some error occurred...
- KMessageBox::information(this, i18n("You must select a record for editing."), i18n("No Record Selected"), CSL1("norecordselected"));
- }
- return false;
-}
-void GenericDBWidget::slotEditRecord()
-{
- slotEditRecord(fRecordList->selectedItem());
-}
-
-void GenericDBWidget::slotDeleteRecord()
-{
- FUNCTIONSETUP;
- PilotListViewItem*currRecItem=dynamic_cast<PilotListViewItem*>(fRecordList->selectedItem());
- if (currRecItem && (KMessageBox::questionYesNo(this, i18n("<qt>Do you really want to delete the selected record? This cannot be undone.<br><br>Delete record?<qt>"), i18n("Deleting Record"), KStdGuiItem::del(), KStdGuiItem::cancel())==KMessageBox::Yes) )
- {
- PilotRecord*rec=(PilotRecord*)currRecItem->rec();
- rec->setDeleted();
- writeRecord(rec);
- // fRecordList->triggerUpdate();
- KPILOT_DELETE(currRecItem);
- }
-}
-
-void GenericDBWidget::slotShowAppInfo()
-{
- FUNCTIONSETUP;
- if (!fDB) return;
- char*appBlock=new char[0xFFFF];
- int len=fDB->readAppBlock((unsigned char*)appBlock, 0xFFFF);
- DBAppInfoEditor*dlg=new DBAppInfoEditor(appBlock, len, this);
- if (dlg->exec())
- {
- fDB->writeAppBlock( (unsigned char*)(dlg->appInfo), dlg->len );
-
- KPilotConfig::addAppBlockChangedDatabase(getCurrentDB());
- KPilotSettings::writeConfig();
- }
- KPILOT_DELETE(dlg);
- delete[] appBlock;
-}
-
-void GenericDBWidget::slotShowDBInfo()
-{
- FUNCTIONSETUP;
- if ( !fDB || !shown ) return;
- DBInfo db=fDB->getDBInfo();
- DBFlagsEditor*dlg=new DBFlagsEditor(&db, this);
- if (dlg->exec())
- {
-#ifdef DEBUG
- DEBUGKPILOT<<"OK pressed, assiging DBInfo, flags="<<
- db.flags<<", miscFlag="<<db.miscFlags<<endl;
-#endif
- fDB->setDBInfo(db);
-
- KPilotConfig::addFlagsChangedDatabase(getCurrentDB());
- KPilotSettings::writeConfig();
-
- slotSelected(fDBList->currentText());
- }
- KPILOT_DELETE(dlg);
-}
-
-void GenericDBWidget::enableWidgets(bool enable)
-{
- //FUNCTIONSETUP;
- fDBInfoButton->setEnabled(enable);
- fAppInfoButton->setEnabled(enable);
- fRecordList->setEnabled(enable);
- fAddRecord->setEnabled(enable);
- fEditRecord->setEnabled(enable);
- fDeleteRecord->setEnabled(enable);
-}
-
-void GenericDBWidget::writeRecord(PilotRecord*r)
-{
- // FUNCTIONSETUP;
- if (fDB && r)
- {
- fDB->writeRecord(r);
- markDBDirty(getCurrentDB());
- }
-}
-
-
-
-
-
diff --git a/kpilot/kpilot/dbviewerWidget.h b/kpilot/kpilot/dbviewerWidget.h
deleted file mode 100644
index 877a8699..00000000
--- a/kpilot/kpilot/dbviewerWidget.h
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef _KPILOT_DBVIEWERWIDGET_H
-#define _KPILOT_DBVIEWERWIDGET_H
-/* dbViewerWidget.h KPilot
-**
-** Copyright (C) 2003 by Dan Pilone.
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-** Written 2003 by Reinhold Kainhofer and Adriaan de Groot
-**
-** This is the generic DB viewer widget.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "pilotComponent.h"
-
-class KListBox;
-class KTextEdit;
-class KPushButton;
-class KComboBox;
-class PilotLocalDatabase;
-class PilotRecord;
-class KListView;
-
-class GenericDBWidget : public PilotComponent
-{
-Q_OBJECT
-
-public:
- GenericDBWidget(TQWidget* parent, const TQString& dbpath);
- virtual ~GenericDBWidget();
-
- // Pilot component methods
- /* virtual */ void showComponent();
- /* virtual */ void hideComponent();
-
- TQString getCurrentDB() const { return currentDB; }
-protected:
- void setupWidget();
-
-protected slots:
- void slotSelected(const TQString &dbname);
- void slotDBType(int mode);
- void reset();
- void slotAddRecord();
- void slotEditRecord();
- bool slotEditRecord(TQListViewItem*);
- void slotDeleteRecord();
- void slotShowAppInfo();
- void slotShowDBInfo();
- void enableWidgets(bool enable);
- void writeRecord(PilotRecord*r);
-
-private:
- KListBox*fDBList;
- KComboBox*fDBType;
- KTextEdit*fDBInfo;
- KPushButton*fDBInfoButton, *fAppInfoButton;
- KListView*fRecordList;
- KPushButton*fAddRecord, *fEditRecord, *fDeleteRecord;
-
- enum eDBType {
- eDatabase,
- eApplication
- } currentDBtype;
-
- PilotLocalDatabase*fDB;
- TQString currentDB;
- TQPtrList<PilotRecord> fRecList;
-};
-
-
-#endif
diff --git a/kpilot/kpilot/fileInstallWidget.cc b/kpilot/kpilot/fileInstallWidget.cc
deleted file mode 100644
index 69909302..00000000
--- a/kpilot/kpilot/fileInstallWidget.cc
+++ /dev/null
@@ -1,304 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-**
-** This file defines the internal conduit "File Installer"
-** that accepts drags of URLs containing Palm DBs, prcs, and
-** such. It also does the HotSync part of installing files
-** on the Pilot.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#ifndef _KPILOT_OPTIONS_H
-#include "options.h"
-#endif
-
-#include <unistd.h>
-
-#include <tqlistbox.h>
-#include <tqstring.h>
-#include <tqlabel.h>
-#include <tqpushbutton.h>
-#include <tqlayout.h>
-#include <tqwhatsthis.h>
-#include <tqmultilineedit.h>
-#include <tqpixmap.h>
-#include <tqpopupmenu.h>
-
-#include <kfiledialog.h>
-#include <kurldrag.h>
-#include <kiconloader.h>
-#include <kiconview.h>
-#include <kglobal.h>
-#include <kurl.h>
-
-#include "kpilotConfig.h"
-#include "fileInstaller.h"
-
-
-#include "fileInstallWidget.moc"
-
-FileInstallWidget::FileInstallWidget(TQWidget * parent,
- const TQString & path) :
- PilotComponent(parent, "component_files", path),
- fSaveFileList(false),
- fInstaller(0L)
-{
- FUNCTIONSETUP;
-
- TQGridLayout *grid = new TQGridLayout(this, 5, 5, SPACING);
-
- TQLabel *label = new TQLabel(i18n("Files to install:"), this);
-
- grid->addWidget(label, 1, 1);
-
- TQPushButton *abutton;
-
- abutton = addButton = new TQPushButton(i18n("Add File..."), this);
- connect(abutton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddFile()));
- grid->addWidget(abutton, 3, 1);
- TQWhatsThis::add(abutton,
- i18n("<qt>Choose a file to add to the list of files to install.</qt>"));
-
- abutton = clearButton= new TQPushButton(i18n("Clear List"), this);
- connect(abutton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClearButton()));
- grid->addWidget(abutton, 4, 1);
- TQWhatsThis::add(abutton,
- i18n("<qt>Clear the list of files to install. No files will be installed.</qt>"));
-
- fIconView = new KIconView(this);
- connect(fIconView, TQT_SIGNAL(dropped(TQDropEvent *, const TQValueList<TQIconDragItem> &)),
- this, TQT_SLOT(slotDropEvent(TQDropEvent *, const TQValueList<TQIconDragItem> &)));
- grid->addMultiCellWidget(fIconView, 1, 4, 2, 3);
- TQWhatsThis::add(fIconView,
- i18n
- ("<qt>This lists files that will be installed on the Pilot during the next HotSync. Drag files here or use the Add button.</qt>"));
- fIconView->setAcceptDrops(true);
- fIconView->setSelectionMode(TQIconView::Extended);
- fIconView->viewport()->installEventFilter(this);
-
- grid->setRowStretch(2, 100);
- grid->setColStretch(2, 50);
- grid->setColStretch(2, 50);
- grid->addColSpacing(4, SPACING);
- grid->addRowSpacing(5, SPACING);
-
- fInstaller = new FileInstaller;
- connect(fInstaller, TQT_SIGNAL(filesChanged()),
- this, TQT_SLOT(refreshFileInstallList()));
-
-}
-
-FileInstallWidget::~FileInstallWidget()
-{
- KPILOT_DELETE(fInstaller);
-}
-
-static inline bool pdbOrPrc(const TQString &s)
-{
- return s.endsWith(CSL1(".pdb"),false) || s.endsWith(CSL1(".prc"),false) ;
-}
-
-void FileInstallWidget::dragEnterEvent(TQDragEnterEvent *event)
-{
- FUNCTIONSETUP;
-
- KURL::List urls;
- if(!KURLDrag::decode(event, urls)) {
- event->accept(false);
- return;
- }
-
- KURL::List::const_iterator it;
- TQString filename;
- for ( it = urls.begin(); it != urls.end(); ++it ) {
- filename = (*it).fileName();
- if(!pdbOrPrc(filename)) {
- event->accept(false);
- return;
- }
- }
- event->accept(true);
-}
-
-bool FileInstallWidget::eventFilter(TQObject *watched, TQEvent *event)
-{
- FUNCTIONSETUP;
-
- if(watched == fIconView->viewport())
- {
- if(event->type() == TQEvent::DragEnter) {
- dragEnterEvent(static_cast<TQDragEnterEvent*>(event));
- return true;
- }
-
- // We have to skip the DragMove event, because it seems to override the
- // accept state, when it is set to false by dragEnterEvent() (event->accept(false);)
- if(event->type() == TQEvent::DragMove) {
- return true;
- }
-
- if(event->type() == TQEvent::MouseButtonPress) {
- contextMenu(static_cast<TQMouseEvent*>(event));
- }
- }
-
- return false;
-}
-
-void FileInstallWidget::dropEvent(TQDropEvent * drop)
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- KURL::List list;
-
- if (!KURLDrag::decode(drop, list) || list.isEmpty())
- return;
-
-#ifdef DEBUG
- DEBUGKPILOT << ": Got " << list.first().prettyURL() << endl;
-#endif
-
- TQStringList files;
- for(KURL::List::ConstIterator it = list.begin(); it != list.end(); ++it)
- {
- if ((*it).isLocalFile())
- files << (*it).path();
- }
-
- fInstaller->addFiles(files, this );
-}
-
-void FileInstallWidget::slotDropEvent(TQDropEvent * drop, const TQValueList<TQIconDragItem> & /*lst*/)
-{
- FUNCTIONSETUP;
- dropEvent(drop);
-}
-
-void FileInstallWidget::slotClearButton()
-{
- FUNCTIONSETUP;
- fInstaller->clearPending();
-}
-
-void FileInstallWidget::showComponent()
-{
- FUNCTIONSETUP;
- refreshFileInstallList();
-}
-
-void FileInstallWidget::slotAddFile()
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- TQStringList fileNames = KFileDialog::getOpenFileNames(
- TQString::null, i18n("*.pdb *.prc|PalmOS Databases (*.pdb *.prc)"));
-
- for (TQStringList::Iterator fileName = fileNames.begin(); fileName != fileNames.end(); ++fileName)
- {
- fInstaller->addFile(*fileName, this );
- }
-}
-
-bool FileInstallWidget::preHotSync(TQString &)
-{
- FUNCTIONSETUP;
-
- fIconView->setEnabled(false);
- fInstaller->setEnabled(false);
- addButton->setEnabled(false);
- clearButton->setEnabled(false);
-
- return true;
-}
-
-void FileInstallWidget::postHotSync()
-{
- FUNCTIONSETUP;
-
- fInstaller->setEnabled(true);
- fIconView->setEnabled(true);
- addButton->setEnabled(true);
- clearButton->setEnabled(true);
- if (shown) refreshFileInstallList();
-}
-
-
-void FileInstallWidget::refreshFileInstallList()
-{
- FUNCTIONSETUP;
-
- TQStringList fileNames = fInstaller->fileNames();
- TQPixmap kpilotIcon = KGlobal::iconLoader()->loadIcon(CSL1("kpilot"), KIcon::Desktop);
-
- fIconView->clear();
-
- for (TQStringList::Iterator fileName = fileNames.begin(); fileName != fileNames.end(); ++fileName)
- {
- if(pdbOrPrc(*fileName))
- {
- new KIconViewItem(fIconView, *fileName, kpilotIcon);
- }
- else
- {
- new KIconViewItem(fIconView, *fileName);
- }
- }
-}
-
-void FileInstallWidget::contextMenu(TQMouseEvent *event)
-{
- FUNCTIONSETUP;
-
- if(event->button() == Qt::LeftButton)
- return;
-
- TQIconViewItem *item;
- TQStringList files;
- for(item = fIconView->firstItem(); item; item = item->nextItem())
- {
- if(item->isSelected())
- files.append(item->text());
- }
-
- TQPopupMenu popup(fIconView);
-
- item = fIconView->findItem(event->pos());
- if(item) {
- // Popup for the right clicked item
- popup.insertItem(i18n("Delete a single file item","Delete"), 10);
- }
-
- popup.insertItem(i18n("Delete selected files"), 11);
- if(files.empty())
- popup.setItemEnabled(11, false);
-
- int id = popup.exec(fIconView->viewport()->mapToGlobal(event->pos()));
- if(id == 10)
- fInstaller->deleteFile(item->text());
- else if(id == 11)
- fInstaller->deleteFiles(files);
-
-}
diff --git a/kpilot/kpilot/fileInstallWidget.h b/kpilot/kpilot/fileInstallWidget.h
deleted file mode 100644
index 4bc59468..00000000
--- a/kpilot/kpilot/fileInstallWidget.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef _KPILOT_FILEINSTALLWIDGET_H
-#define _KPILOT_FILEINSTALLWIDGET_H
-/* fileInstallWidget.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-**
-** This file defines the file install widget, which is the thing
-** that accepts file drags for later installation into the Pilot.
-**
-** This file also defines the log window widget, which logs
-** sync-messages during a HotSync.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "pilotComponent.h"
-
-class TQMultiLineEdit;
-class TQPushButton;
-class TQIconDragItem;
-
-class KIconView;
-class KPilotInstaller;
-class FileInstaller;
-
-class FileInstallWidget : public PilotComponent
-{
-Q_OBJECT
-
-public:
- FileInstallWidget(TQWidget* parent, const TQString& dbPath);
- virtual ~FileInstallWidget();
-
- // Pilot Component Methods:
- void showComponent();
- bool preHotSync(TQString &);
- void postHotSync();
-
-
-signals:
- void fileInstallWidgetDone();
-
-protected:
- void setSaveFileList(bool saveIt) { fSaveFileList = saveIt; }
- bool getSaveFileList() { return fSaveFileList; }
-
- /* virtual */ void dragEnterEvent(TQDragEnterEvent* event);
- /* virtual */ void dropEvent(TQDropEvent* drop);
- /* virtual */ bool eventFilter (TQObject *watched, TQEvent *event );
-
- void contextMenu(TQMouseEvent *event);
-
- KPilotInstaller* getPilotInstallerApp() { return fKPilotInstaller; }
-
-private:
- KIconView *fIconView;
- bool fSaveFileList;
-
- KPilotInstaller* fKPilotInstaller;
- FileInstaller *fInstaller;
- TQPushButton *clearButton,*addButton;
-
-protected slots:
- void slotClearButton();
- void slotAddFile();
-
- void slotDropEvent(TQDropEvent * drop, const TQValueList<TQIconDragItem> & lst);
-
-public slots:
- void refreshFileInstallList();
-};
-
-#endif
diff --git a/kpilot/kpilot/fileInstaller.cc b/kpilot/kpilot/fileInstaller.cc
deleted file mode 100644
index d46c67d2..00000000
--- a/kpilot/kpilot/fileInstaller.cc
+++ /dev/null
@@ -1,184 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-**
-** This is a class that does "the work" of adding and deleting
-** files in the pending_install directory of KPilot. It is used
-** by the fileInstallWidget and by the daemon's drag-and-drop
-** file accepter.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include "options.h"
-
-#include <unistd.h>
-
-#include <tqstring.h>
-#include <tqstrlist.h>
-#include <tqdir.h>
-
-#include <kglobal.h>
-#include <kstandarddirs.h>
-#include <kurl.h>
-#include <kio/netaccess.h>
-#include <kmessagebox.h>
-
-#include "fileInstaller.moc"
-
-FileInstaller::FileInstaller() :
- enabled(true)
-{
- FUNCTIONSETUP;
-
- fDirName = KGlobal::dirs()->saveLocation("data",
- CSL1("kpilot/pending_install/"));
- fPendingCopies = 0;
-
-}
-
-/* virtual */ FileInstaller::~FileInstaller()
-{
- FUNCTIONSETUP;
-}
-
-
-void FileInstaller::clearPending()
-{
- FUNCTIONSETUP;
-
- unsigned int i;
-
- TQDir installDir(fDirName);
-
- // Start from 2 to skip . and ..
- //
- for (i = 2; i < installDir.count(); i++)
- {
- TQFile::remove(fDirName + installDir[i]);
- }
-
- if (i > 2)
- {
- emit filesChanged();
- }
-}
-
-void FileInstaller::deleteFile(const TQString &file)
-{
- TQFile::remove(fDirName + file);
- emit filesChanged();
-}
-
-void FileInstaller::deleteFiles(const TQStringList &files)
-{
- if(files.empty())
- return;
-
- for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it)
- TQFile::remove(fDirName + *it);
-
- emit filesChanged();
-}
-
-/* virtual */ bool FileInstaller::runCopy(const TQString & s, TQWidget* w )
-{
- FUNCTIONSETUP;
-
- if(!(s.endsWith(CSL1(".pdb"), false) || s.endsWith(CSL1(".prc"), false))) {
- KMessageBox::detailedSorry(w, i18n("Cannot install %1").arg(s),
- i18n("Only PalmOS database files (like *.pdb and *.prc) can be installed by the file installer."));
- return false;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Copying " << s << endl;
-#endif
-
- KURL srcName;
- srcName.setPath(s);
- KURL destDir(fDirName + CSL1("/") + srcName.fileName());
-
-#if KDE_IS_VERSION(3,1,9)
- return KIO::NetAccess::copy(srcName, destDir, w);
-#else
- return KIO::NetAccess::copy(srcName,destDir);
-#endif
-}
-
-
-void FileInstaller::addFiles(const TQStringList & fileList, TQWidget* w)
-{
- FUNCTIONSETUP;
-
- if (!enabled) return;
-
- unsigned int succ = 0;
-
- for(TQStringList::ConstIterator it = fileList.begin();
- it != fileList.end(); ++it)
- {
- if (runCopy( *it, w ))
- succ++;
- }
-
- if (succ)
- {
- emit filesChanged();
- }
-}
-
-void FileInstaller::addFile( const TQString & file, TQWidget* w )
-{
- FUNCTIONSETUP;
-
- if (!enabled) return;
-
- if (runCopy(file, w))
- {
- emit(filesChanged());
- }
-}
-
-/* slot */ void FileInstaller::copyCompleted()
-{
- FUNCTIONSETUP;
-}
-
-const TQStringList FileInstaller::fileNames() const
-{
- FUNCTIONSETUP;
-
- TQDir installDir(fDirName);
-
- return installDir.entryList(TQDir::Files |
- TQDir::NoSymLinks | TQDir::Readable);
-}
-
-/* slot */ void FileInstaller::setEnabled(bool b)
-{
- FUNCTIONSETUP;
- enabled=b;
-}
-
-
diff --git a/kpilot/kpilot/fileInstaller.h b/kpilot/kpilot/fileInstaller.h
deleted file mode 100644
index 3009de77..00000000
--- a/kpilot/kpilot/fileInstaller.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* fileInstaller.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This is a class that does "the work" of adding and deleting
-** files in the pending_install directory of KPilot. It is used
-** by the fileInstallWidget and by the daemon's drag-and-drop
-** file accepter.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#ifndef _KPILOT_FILEINSTALLER_H
-#define _KPILOT_FILEINSTALLER_H
-
-#include <tqobject.h>
-
-
-class TQStringList;
-class TQString;
-
-class FileInstaller : public QObject
-{
- Q_OBJECT
-public:
- FileInstaller();
- virtual ~FileInstaller();
-
- void clearPending();
-
- void addFiles( const TQStringList&, TQWidget* w );
- void addFile( const TQString&, TQWidget* w );
-
- void deleteFile(const TQString &);
- void deleteFiles(const TQStringList &);
-
- /**
- * Returns information about this installer. Note particularly
- * that fileNames() returns only filenames, not paths. In particular,
- * you'll need to prepend dir()+"/" to get pathnames.
- */
- const TQString &dir() const { return fDirName; } ;
- const TQStringList fileNames() const ;
-
-
-
-protected:
- virtual bool runCopy( const TQString &src, TQWidget*w );
-
-public slots:
- void copyCompleted();
- void setEnabled(bool);
-
-signals:
- void filesChanged();
-private:
- TQString fDirName;
- int fPendingCopies;
- bool enabled;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/hotSync.cc b/kpilot/kpilot/hotSync.cc
deleted file mode 100644
index 7a4d3e44..00000000
--- a/kpilot/kpilot/hotSync.cc
+++ /dev/null
@@ -1,1156 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-** Copyright (C) 2006 Adriaan de Groot <groot@kde.org>
-**
-** This file defines SyncActions, which are used to perform some specific
-** task during a HotSync. Conduits are not included here, nor are
-** sync actions requiring user interaction. Those can be found in the
-** conduits subdirectory or interactiveSync.h.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org.
-*/
-
-
-#include "options.h"
-
-#include <time.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#include <pi-file.h>
-#include <pi-util.h>
-
-#include <tqtimer.h>
-#include <tqfile.h>
-#include <tqfileinfo.h>
-#include <tqdir.h>
-#include <tqvaluelist.h>
-#include <tqregexp.h>
-#include <tqstringlist.h>
-#include <tqthread.h>
-
-#include <kglobal.h>
-#include <kstandarddirs.h>
-#include <kapplication.h>
-#include <kmessagebox.h>
-
-#include "pilotUser.h"
-#include "pilotRecord.h"
-#include "actionQueue.h"
-#include "pilotSerialDatabase.h"
-#include "pilotLocalDatabase.h"
-#include "pilotDatabase.h"
-#include "kpilotSettings.h"
-
-#include "hotSync.moc"
-
-class BackupAction::Thread : public QThread
-{
-public:
- Thread( BackupAction *parent,
- KPilotLink *link,
- const TQString &filename,
- const DBInfo *info );
-
- enum {
- TerminateOK = TQEvent::User,
- TerminateFailure
- } ;
-
-protected:
- virtual void run();
-private:
- BackupAction *fParent;
- KPilotLink *fLink;
- TQString fFilename;
- struct DBInfo fDBInfo;
-} ;
-
-class BackupAction::Private
-{
-public:
- bool fFullBackup; ///< Is this a full backup (all DBs, not just changed ones)?
- TQStringList fNoBackupDBs;
- TQValueList<unsigned long> fNoBackupCreators;
- TQStringList fDeviceDBs;
-
- TQString fPreferBackupDir; ///< Directory to write backup in, overrides default
-
- // Remainder is used to hand around info during sync
-
- int fDBIndex; ///< Database number we're now doing
- TQString fBackupDir; ///< Directory to write backup in.
-
- /**
- * Add the database described by the info block to the list of
- * databases definitely found on the handheld.
- */
- void addDBInfo( const DBInfo *info )
- {
- FUNCTIONSETUP;
- fDBIndex = info->index + 1;
-
- // Each character of buff[] is written to
- char buff[7];
- buff[0] = '[';
- set_long( &buff[1], info->creator );
- buff[5] = ']';
- buff[6] = '\0';
- TQString creator = TQString::fromLatin1( buff );
-
- TQString dbname = Pilot::fromPilot( info->name, 32 );
-
- if ( !fDeviceDBs.contains( creator ) )
- {
- fDeviceDBs << creator;
- }
- if ( !fDeviceDBs.contains( dbname ) )
- {
- fDeviceDBs << dbname;
- }
-
- DEBUGKPILOT << fname << ": Added <" << dbname
- << "> " << creator << endl;
- }
-
-
- /**
- * Check if this database, described by @p info , should
- * be backed up (i.e. is allowed to be backed up by the
- * user settings for no-backup DBs).
- *
- * @return @c true if the database may be backed up.
- */
- bool allowBackup( const DBInfo *info ) const
- {
- // Special case - skip database Unsaved Preferences
- if ( (info->creator == pi_mktag('p','s','y','s')) &&
- (info->type == pi_mktag('p','r','e','f')) )
- {
- return false;
- }
-
- if (fNoBackupCreators.findIndex(info->creator) != -1)
- {
- return false;
- }
-
- // Now take wildcards into account
- TQString db = Pilot::fromPilot(info->name);
- for (TQStringList::const_iterator i = fNoBackupDBs.begin();
- i != fNoBackupDBs.end(); ++i)
- {
- TQRegExp re(*i,true,true); // Wildcard match
- if (re.exactMatch(db))
- {
- return false;
- }
- }
- return true;
- }
-
-} ;
-
-BackupAction::BackupAction(KPilotLink * p, bool full) :
- SyncAction(p, "backupAction"),
- fP( new Private ),
- fBackupThread( 0L )
-{
- FUNCTIONSETUP;
-
- fP->fFullBackup = full;
-}
-
-/* virtual */ TQString BackupAction::statusString() const
-{
- FUNCTIONSETUP;
- TQString s(CSL1("BackupAction="));
-
- switch (status())
- {
- case Init:
- s.append(CSL1("Init"));
- break;
- case Error:
- s.append(CSL1("Error"));
- break;
- case FullBackup:
- s.append(CSL1("FullBackup"));
- break;
- case FastBackup:
- s.append(CSL1("FastBackup"));
- break;
- case BackupEnded:
- s.append(CSL1("BackupEnded"));
- break;
- case BackupIncomplete:
- s.append(CSL1("BackupIncomplete"));
- break;
- case BackupComplete:
- s.append(CSL1("BackupComplete"));
- break;
- default:
- s.append(CSL1("(unknown "));
- s.append(TQString::number(status()));
- s.append(CSL1(")"));
- }
-
- return s;
-}
-
-void BackupAction::setDirectory( const TQString &p )
-{
- fP->fPreferBackupDir = p;
- if (!p.endsWith(CSL1("/")))
- {
- fP->fPreferBackupDir.append(CSL1("/"));
- }
-}
-
-static inline void initNoBackup(TQStringList &dbnames,
- TQValueList<unsigned long> &dbcreators)
-{
- FUNCTIONSETUP;
- dbnames.clear();
- dbcreators.clear();
-
- TQStringList configuredSkip = KPilotSettings::skipBackupDB();
- TQStringList::const_iterator e = configuredSkip.end();
- for (TQStringList::const_iterator i = configuredSkip.begin();
- i!= e; ++i)
- {
- TQString s = *i;
- if (s.startsWith(CSL1("[")) && s.endsWith(CSL1("]")))
- {
- if (s.length() != 6)
- {
- WARNINGKPILOT << "Creator ID " << s << " is malformed." << endl;
- }
- else
- {
- TQCString data = s.mid(1,4).latin1();
- unsigned long creator = pi_mktag(data[0],data[1],data[2],data[3]);
- dbcreators.append(creator);
- }
- }
- else
- {
- dbnames.append(s);
- }
- }
-
- DEBUGKPILOT << fname << ": Will skip databases "
- << dbnames.join(CSL1(",")) << endl;
- TQString creatorids;
- char buf[5];
- for (TQValueList<unsigned long>::const_iterator i = dbcreators.begin();
- i != dbcreators.end(); ++i)
- {
- unsigned long tag = *i;
- pi_untag(buf,tag);
- buf[4]=0;
- creatorids.append(CSL1("[%1]").arg(buf));
- }
- DEBUGKPILOT << fname << ": Will skip creators " << creatorids << endl;
-}
-
-/** Make sure that the backup directory @p backupDir
-* exists and is a directory; returns @c false
-* if this is not the case. This method will try
-* to create the directory if it doesn't exist yet.
-*/
-static inline bool checkBackupDirectory( const TQString &backupDir )
-{
- FUNCTIONSETUP;
- TQFileInfo fi(backupDir);
-
- if (fi.exists() && fi.isDir())
- {
- return true;
- }
-
- if (fi.exists() && !fi.isDir())
- {
- WARNINGKPILOT << "Requested backup directory "
- << backupDir
- << " exists but is not a directory."
- << endl;
- return false;
- }
-
- if ( !backupDir.endsWith("/") )
- {
- WARNINGKPILOT << "Backup dir does not end with a / "
- << endl;
- return false;
- }
-
- Q_ASSERT(!fi.exists());
-
- DEBUGKPILOT << fname
- << ": Creating directory " << backupDir << endl;
-
- KStandardDirs::makeDir( backupDir );
-
- fi = TQFileInfo(backupDir);
-
- return fi.exists() && fi.isDir();
-}
-
-
-/* virtual */ bool BackupAction::exec()
-{
- FUNCTIONSETUP;
-
- fP->fDeviceDBs = KPilotSettings::deviceDBs();
-
- if (fP->fPreferBackupDir.isEmpty())
- {
- fP->fBackupDir =
- KGlobal::dirs()->saveLocation("data",CSL1("kpilot/DBBackup/")) +
- deviceLink()->getPilotUser().name() + '/';
- }
- else
- {
- fP->fBackupDir = fP->fPreferBackupDir;
- }
-
- logMessage(i18n("Backup directory: %1.").arg(fP->fBackupDir));
-
- DEBUGKPILOT << fname
- << ": This Pilot user's name is \""
- << deviceLink()->getPilotUser().name() << "\"" << endl;
- DEBUGKPILOT << fname
- << ": Using backup dir: " << fP->fBackupDir << endl;
- DEBUGKPILOT << fname
- << ": Full Backup? " << fP->fFullBackup << endl;
-
-
- if (fP->fFullBackup)
- {
- fActionStatus = FullBackup;
- addSyncLogEntry(i18n("Full backup started."));
- }
- else
- {
- fActionStatus = FastBackup;
- addSyncLogEntry(i18n("Fast backup started"));
- }
-
- if (!checkBackupDirectory(fP->fBackupDir))
- {
- fActionStatus=BackupIncomplete;
- // Don't issue an error message, checkBackupDirectory
- // did this already...
- return false;
- }
-
- initNoBackup( fP->fNoBackupDBs, fP->fNoBackupCreators );
-
- fP->fDBIndex = 0;
- TQTimer::singleShot(0,this,TQT_SLOT(backupOneDB()));
- return true;
-}
-
-/* slot */ void BackupAction::backupOneDB()
-{
- FUNCTIONSETUP;
-
- struct DBInfo info;
-
- // TODO: make the progress reporting more accurate
- emit logProgress(TQString::null, fP->fDBIndex);
-
- if (openConduit() < 0)
- {
- addSyncLogEntry(i18n("Exiting on cancel."));
- endBackup();
- fActionStatus = BackupIncomplete;
- return;
- }
-
- // TODO: Is there a way to skip unchanged databases?
- int res = deviceLink()->getNextDatabase( fP->fDBIndex, &info );
- if (res < 0)
- {
- if ( fP->fFullBackup )
- {
- addSyncLogEntry( i18n("Full backup complete.") );
- }
- else
- {
- addSyncLogEntry( i18n("Fast backup complete.") );
- }
- endBackup();
- fActionStatus = BackupComplete;
- return;
- }
-
- fP->addDBInfo( &info );
-
- // see if user told us not to back this creator or database up...
- if (fP->allowBackup(&info))
- {
- // back up DB if this is a full backup *or* in non-full backups,
- // only backup data, not applications.
- if ( (fP->fFullBackup) || !PilotDatabase::isResource(&info) )
- {
- addSyncLogEntry(i18n("Backing up: %1").arg(Pilot::fromPilot(info.name)));
-
- if (!startBackupThread(&info))
- {
- WARNINGKPILOT << "Could not create local database for <"
- << info.name << ">" << endl;
- }
- else
- {
- // The thread has started, so we will be woken
- // up by it eventually when it is done. Do *NOT*
- // fall through to the single-shot timer below,
- // because that would return us to the backup
- // function too soon.
- return;
- }
- }
- else
- {
- // Just skip resource DBs during an update hotsync.
- DEBUGKPILOT << fname << ": Skipping database <" << info.name
- << "> (resource database)" << endl;
- }
- }
- else
- {
- DEBUGKPILOT << fname << ": Skipping database <" << info.name
- << "> (no-backup list)" << endl;
- TQString s = i18n("Skipping %1")
- .arg(Pilot::fromPilot(info.name));
- addSyncLogEntry(s);
- }
- TQTimer::singleShot(0,this,TQT_SLOT(backupOneDB()));
-}
-
-/**
- * This method will back up a single database from the Pilot to a directory on
- * our filesystem. If our user asks us to do a full backup, then we will unconditionally
- * copy the database file from the Pilot into the backup directory. Otherwise, we will
- * check to see if the database has any modified records in it on the pilot. If the
- * database has not changed on the Pilot, then there's nothing to backup and we return.
- *
- * @return @c true if the backup has started (in another thread).
- * You must wait on the thread to end with a User or User+1
- * type event and not start another backup thread.
- * @return @c false if there is no backup to do. Diagnostic messages
- * will already have been printed.
- */
-bool BackupAction::startBackupThread(DBInfo *info)
-{
- FUNCTIONSETUP;
-
- // now we look to see if the database on the pilot has at least one changed record
- // in it. we do this so that we don't waste time backing up a database that has
- // not changed. note: don't bother with this check if we're doing a full backup.
- if (!fP->fFullBackup)
- {
- // Check if this DB has modified records.
- PilotDatabase *serial=deviceLink()->database(info);
- if (!serial->isOpen())
- {
- WARNINGKPILOT << "Unable to open database <" << info->name << ">" << endl;
- KPILOT_DELETE(serial);
- addSyncLogEntry(i18n("Backup of %1 failed.\n")
- .arg(Pilot::fromPilot(info->name)));
- return false;
- }
-
- int index=0;
- PilotRecord*rec=serial->readNextModifiedRec(&index);
- if (!rec)
- {
- DEBUGKPILOT << fname << ": No modified records." << endl;
- KPILOT_DELETE(serial);
- return false;
- }
- // Exists, with modified records.
- KPILOT_DELETE(rec);
- KPILOT_DELETE(serial);
- }
-
-
- // if we're here then we are going to back this database up. do some basic sanity
- // checks and proceed....
- TQString databaseName(Pilot::fromPilot(info->name));
- databaseName.replace('/', '_');
-
- TQString fullBackupName = fP->fBackupDir + databaseName;
-
- if (PilotDatabase::isResource(info))
- {
- fullBackupName.append(CSL1(".prc"));
- }
- else
- {
- fullBackupName.append(CSL1(".pdb"));
- }
-
- DEBUGKPILOT << fname
- << ": Backing up database to: [" << fullBackupName << "]" << endl;
-
- /* Ensure that DB-open flag is not kept */
- info->flags &= ~dlpDBFlagOpen;
-
- if (fBackupThread)
- {
- WARNINGKPILOT << "Starting new backup thread before the old one is done." << endl;
- return false;
- }
-
- fBackupThread = new Thread(this,deviceLink(),fullBackupName,info);
- fBackupThread->start();
- return true;
-}
-
-/* virtual */ bool BackupAction::event( TQEvent *e )
-{
- if (e->type() == (TQEvent::Type)Thread::TerminateOK)
- {
- KPILOT_DELETE(fBackupThread);
- // This was a successful termination.
- addSyncLogEntry( i18n("... OK.\n"), false );
- TQTimer::singleShot(0,this,TQT_SLOT(backupOneDB()));
- return true;
- }
- if (e->type() == (TQEvent::Type)Thread::TerminateFailure)
- {
- KPILOT_DELETE(fBackupThread);
- // Unsuccessful termination.
- addSyncLogEntry( i18n("Backup failed.") );
- TQTimer::singleShot(0,this,TQT_SLOT(backupOneDB()));
- return true;
- }
- return SyncAction::event(e);
-}
-
-void BackupAction::endBackup()
-{
- FUNCTIONSETUP;
-
- fP->fDBIndex = (-1);
- fActionStatus = BackupEnded;
- fP->fDeviceDBs.sort();
- TQString old( TQString::null );
- TQStringList::Iterator itr = fP->fDeviceDBs.begin();
- while ( itr != fP->fDeviceDBs.end() ) {
- if ( old == *itr ) {
- itr = fP->fDeviceDBs.remove( itr );
- } else {
- old = *itr;
- ++itr;
- }
- }
- KPilotSettings::setDeviceDBs( fP->fDeviceDBs );
-
- emit syncDone(this);
-}
-
-FileInstallAction::FileInstallAction(KPilotLink * p,
- const TQString & d) :
- SyncAction(p, "fileInstall"),
- fDBIndex(-1),
- fTimer(0L),
- fDir(d)
-{
- FUNCTIONSETUP;
-}
-
-FileInstallAction::~FileInstallAction()
-{
- FUNCTIONSETUP;
-
- KPILOT_DELETE(fTimer);
-}
-
-/* virtual */ bool FileInstallAction::exec()
-{
- FUNCTIONSETUP;
-
- TQDir installDir(fDir);
- fList = installDir.entryList(TQDir::Files |
- TQDir::NoSymLinks | TQDir::Readable);
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Installing " << fList.count() << " files" << endl;
-#endif
-
- fDBIndex = 0;
- emit logMessage(i18n("[File Installer]"));
-
- // Possibly no files to install?
- if (!fList.count())
- {
- emit logMessage(i18n("No Files to install"));
- delayDone();
- return true;
- }
-
- fTimer = new TQTimer(this);
- TQObject::connect(fTimer, TQT_SIGNAL(timeout()),
- this, TQT_SLOT(installNextFile()));
-
- fTimer->start(0, false);
-
- emit logProgress(i18n("Installing one file",
- "Installing %n Files",fList.count()), 0);
- return true;
-}
-
-/* slot */ void FileInstallAction::installNextFile()
-{
- FUNCTIONSETUP;
-
- Q_ASSERT(fDBIndex >= 0);
- Q_ASSERT((unsigned) fDBIndex <= fList.count());
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Installing file index "
- << fDBIndex << " (of " << fList.count() << ")" << endl;
-#endif
-
- if ((!fList.count()) || ((unsigned) fDBIndex >= fList.count()))
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Peculiar file index, bailing out." << endl;
-#endif
- KPILOT_DELETE(fTimer);
- fDBIndex = (-1);
- emit logProgress(i18n("Done Installing Files"), 100);
- delayDone();
- return;
- }
-
- const TQString filePath = fDir + fList[fDBIndex];
- const TQString fileName = fList[fDBIndex];
-
- fDBIndex++;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Installing file " << filePath << endl;
-#endif
-
- TQString m = i18n("Installing %1").arg(fileName);
- emit logProgress(m,(100 * fDBIndex) / (fList.count()+1));
- m+=CSL1("\n");
- emit addSyncLogEntry(m,false /* Don't print in KPilot's log. */ );
-
- struct pi_file *f = 0L;
-
- // Check DB is ok, return false after warning user
- if (!resourceOK(fileName,filePath)) goto nextFile;
-
- f = pi_file_open(const_cast <char *>
- ((const char *) TQFile::encodeName(filePath)));
-
-
-#if PILOT_LINK_NUMBER < PILOT_LINK_0_12_0
- if (pi_file_install(f, pilotSocket(), 0) < 0)
-#else
- if (pi_file_install(f, pilotSocket(), 0, NULL) < 0)
-#endif
- {
- WARNINGKPILOT << "Failed to install." << endl;
-
-
- emit logError(i18n("Cannot install file &quot;%1&quot;.").
- arg(fileName));
- }
- else
- {
- TQFile::remove(filePath);
- }
-
-
-nextFile:
- if (f) pi_file_close(f);
- if (fDBIndex == -1)
- {
- fTimer->stop();
- delayDone();
- // emit syncDone(this);
- }
-}
-
-// Check that the given file path is a good resource
-// file - in particular that the resource name is ok.
-bool FileInstallAction::resourceOK(const TQString &fileName, const TQString &filePath)
-{
- FUNCTIONSETUP;
-
- if (!TQFile::exists(filePath))
- {
- emit logError(i18n("Unable to open file &quot;%1&quot;.").
- arg(fileName));
- return false;
- }
-
- struct pi_file *f = pi_file_open(const_cast <char *>
- ((const char *) TQFile::encodeName(filePath)));
-
- if (!f)
- {
- emit logError(i18n("Unable to open file &quot;%1&quot;.").
- arg(fileName));
- return false;
- }
-
- struct DBInfo info;
-#if PILOT_LINK_NUMBER < PILOT_LINK_0_12_0
- if (pi_file_get_info(f,&info) < 0)
- {
- emit logError(i18n("Unable to read file &quot;%1&quot;.").
- arg(fileName));
- return false;
- }
-#else
- pi_file_get_info(f,&info);
-#endif
-
- // Looks like strlen, but we can't be sure of a NUL
- // termination.
- info.name[sizeof(info.name)-1]=0;
- bool r = (strlen(info.name) < 32);
- pi_file_close(f);
-
- if (!r)
- {
- emit logError(i18n("The database in &quot;%1&quot; has a "
- "resource name that is longer than 31 characters. "
- "This suggests a bug in the tool used to create the database. "
- "KPilot cannot install this database.").arg(fileName));
- }
-
- return r;
-}
-
-/* virtual */ TQString FileInstallAction::statusString() const
-{
- FUNCTIONSETUP;
- if (fDBIndex < 0)
- {
- return TQString(CSL1("Idle"));
- }
- else
- {
- if ((unsigned) fDBIndex >= fList.count())
- {
- return TQString(CSL1("Index out of range"));
- }
- else
- {
- return TQString(CSL1("Installing %1")).arg(fList[fDBIndex]);
- }
- }
-}
-
-CheckUser::CheckUser(KPilotLink * p, TQWidget * vp):
- SyncAction(p, vp, "userCheck")
-{
- FUNCTIONSETUP;
-
-}
-
-CheckUser::~CheckUser()
-{
- FUNCTIONSETUP;
-}
-
-/* virtual */ bool CheckUser::exec()
-{
- FUNCTIONSETUP;
-
- TQString guiUserName = KPilotSettings::userName();
- TQString pilotUserName = fHandle->getPilotUser().name();
- bool pilotUserEmpty = pilotUserName.isEmpty();
- // 4 cases to handle:
- // guiUserName empty / not empty
- // pilotUserName empty / not empty
- //
- //
- if (guiUserName.isEmpty())
- {
- if (pilotUserEmpty)
- {
- TQString defaultUserName =
- i18n("A common name", "John Doe");
-
- TQString q = i18n("<qt>Neither KPilot nor the "
- "handheld have a username set. "
- "They <i>should</i> be set. "
- "Should KPilot set them to a default value "
- "(<i>%1</i>)?</qt>").arg(defaultUserName);
-
- if (questionYesNo(q, i18n("User Unknown") /* ,"askUserNone" */) ==
- KMessageBox::Yes)
- {
- KPilotSettings::setUserName(defaultUserName);
- fHandle->getPilotUser().setName(defaultUserName);
- guiUserName=defaultUserName;
- pilotUserName=defaultUserName;
- }
-
- }
- else
- {
- TQString q = i18n("<qt>The handheld has a username set "
- "(<i>%1</i>) but KPilot does not. Should "
- "KPilot use this username in future?</qt>").
- arg(pilotUserName);
-
- if (questionYesNo(q, i18n("User Unknown") /* ,"askUserSome" */ ) ==
- KMessageBox::Yes)
- {
- KPilotSettings::setUserName(pilotUserName);
- guiUserName=pilotUserName;
- }
- }
- }
- else
- {
- if (pilotUserEmpty)
- {
- TQString q = CSL1("<qt>");
- q += i18n("KPilot has a username set "
- "(<i>%1</i>) but the handheld does not. "
- "Should KPilot's username be set in the "
- "handheld as well?").arg(guiUserName);
- q += i18n("<br/>(<i>Note:</i> If your handheld "
- "has been reset to factory defaults, you "
- "should use <i>Restore</i> instead of a "
- "regular HotSync. Click on Cancel to "
- "stop this sync.)");
- q += CSL1("</qt>");
-
- int r = questionYesNoCancel(q, i18n("User Unknown"));
- switch (r)
- {
- case KMessageBox::Yes:
- DEBUGKPILOT << fname
- << ": Setting user name in pilot to "
- << guiUserName << endl;
- fHandle->getPilotUser().setName(guiUserName);
- pilotUserName=guiUserName;
- break;
- case KMessageBox::No:
- // Nothing to do .. continue with sync
- break;
- case KMessageBox::Cancel:
- default:
- return false;
- }
- }
- else
- {
- if (guiUserName != pilotUserName)
- {
- TQString q = i18n("<qt>The handheld thinks that "
- "the username is %1; "
- "however, KPilot says you are %2."
- "Which of these is the correct name?\n"
- "If you click on Cancel, the sync will proceed, "
- "but the usernames will not be changed.</qt>").
- arg(pilotUserName).
- arg(guiUserName);
-
- int r = questionYesNoCancel(q,
- i18n("User Mismatch"),
- TQString::null,
- 20,
- i18n("Use KPilot Name"),
- i18n("Use Handheld Name"));
- switch (r)
- {
- case KMessageBox::Yes:
- fHandle->getPilotUser().setName(guiUserName);
- pilotUserName=guiUserName;
- break;
- case KMessageBox::No:
- KPilotSettings::setUserName(pilotUserName);
- guiUserName=pilotUserName;
- break;
- case KMessageBox::Cancel:
- default:
- // TODO: cancel the sync... Or just don't change any user name?
- break;
- }
- }
- }
- }
-
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": User name set to pc <"
- << guiUserName
- << "> hh <"
- << fHandle->getPilotUser().name() << ">" << endl;
-#endif
-
- KPilotSettings::writeConfig();
-
- // Now we've established which user will be used,
- // fix the database location for local databases.
- //
- //
- TQString pathName = KGlobal::dirs()->saveLocation("data",
- CSL1("kpilot/DBBackup/"));
- if (!guiUserName.isEmpty())
- {
- pathName.append(guiUserName);
- pathName.append(CSL1("/"));
- }
- PilotLocalDatabase::setDBPath(pathName);
-
- delayDone();
- return true;
-}
-
-class RestoreInfo
-{
-public:
- struct DBInfo DBInfo;
- TQString path;
-} ;
-
-class RestoreAction::Private
-{
-public:
- TQString fPreferRestoreDir; /**< Preference setting where to get data from. */
-
- TQValueList<RestoreInfo> fDBList;
- TQTimer fTimer;
- TQValueList<RestoreInfo>::ConstIterator fDBIterator;
- int fDBIndex;
-};
-
-
-RestoreAction::RestoreAction(KPilotLink * p, TQWidget * visible ) :
- SyncAction(p, visible, "restoreAction")
-{
- FUNCTIONSETUP;
-
- fP = new Private;
-}
-
-void RestoreAction::setDirectory( const TQString &path )
-{
- fP->fPreferRestoreDir = path;
-}
-
-/* virtual */ bool RestoreAction::exec()
-{
- FUNCTIONSETUP;
-
- TQString dirname;
- if (fP->fPreferRestoreDir.isEmpty())
- {
- dirname = PilotLocalDatabase::getDBPath();
- }
- else
- {
- dirname = fP->fPreferRestoreDir;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Restoring user " << dirname << endl;
-#endif
-
- TQDir dir(dirname, TQString::null, TQDir::Name,
- TQDir::Files | TQDir::Readable | TQDir::NoSymLinks);
-
- if (!dir.exists())
- {
- WARNINGKPILOT << "Restore directory "
- << dirname << " does not exist." << endl;
- fActionStatus = Error;
- addSyncLogEntry(i18n("Restore directory does not exist.") +
- CSL1(" ") + i18n("Restore not performed."));
- return false;
- }
-
- dirname = dir.absPath();
- if (questionYesNo(i18n("<qt>Are you sure you want to completely "
- "restore your Pilot from the backup directory "
- "(<i>%1</i>)? This will erase any information "
- "you currently have on your Pilot.</qt>").
- arg(dirname),
- i18n("Restore Pilot")) != KMessageBox::Yes)
- {
- emit logError(i18n("Restore <i>not</i> performed."));
-
- addSyncLogEntry(i18n("Canceled by user.") + CSL1(" ") +
- i18n("Restore not performed."));
-
- // You might call this an error, but that causes
- // a frightening message in the log .. and the
- // user already _knows_ the restore didn't happen.
- // So instead, act as if everything was ok.
- delayDone();
- return true;
- }
-
-
- emit logProgress(i18n("Restoring %1...").arg(TQString::null),1);
-
- for (unsigned int i = 0; i < dir.count(); i++)
- {
- TQString s;
- RestoreInfo info;
-
- s = dirname + TQDir::separator() + dir[i];
-
- DEBUGKPILOT << fname
- << ": Adding " << s << " to restore list." << endl;
-
- if ( PilotLocalDatabase::infoFromFile( s, &info.DBInfo ) )
- {
- info.path = s;
- fP->fDBList.append(info);
- }
- else
- {
- WARNINGKPILOT << "Can't open " << s << endl;
- logMessage(i18n("File '%1' cannot be read.").arg(s));
- }
- }
-
- fP->fDBIndex = 0;
- fP->fDBIterator = fP->fDBList.begin();
- fActionStatus = InstallingFiles;
-
- TQObject::connect(&(fP->fTimer), TQT_SIGNAL(timeout()),
- this, TQT_SLOT(installNextFile()));
-
- fP->fTimer.start(0, false);
- return true;
-}
-
-/* slot */ void RestoreAction::installNextFile()
-{
- FUNCTIONSETUP;
-
- Q_ASSERT(fActionStatus == InstallingFiles);
-
-
- if (fP->fDBIterator == fP->fDBList.end())
- {
- fP->fTimer.stop();
-
- fActionStatus = Done;
- addSyncLogEntry(i18n("OK."));
- delayDone();
- return;
- }
-
- const RestoreInfo dbi = *(fP->fDBIterator);
- ++(fP->fDBIterator);
- ++(fP->fDBIndex);
-
- DEBUGKPILOT << fname << ": Trying to install " << dbi.path << endl;
-
- if (openConduit() < 0)
- {
- WARNINGKPILOT << "Restore apparently canceled." << endl;
- logMessage(i18n("Restore incomplete."));
- fActionStatus = Done;
- emit syncDone(this);
-
- return;
- }
-
- TQFileInfo databaseInfo(dbi.path);
- addSyncLogEntry(databaseInfo.fileName());
- emit logProgress(i18n("Restoring %1...").arg(databaseInfo.fileName()),
- (100*fP->fDBIndex) / (fP->fDBList.count()+1)) ;
-
- if ( !deviceLink()->installFiles( dbi.path, false /* don't delete */ ) )
- {
- WARNINGKPILOT << "Couldn't restore " << dbi.path << endl;
- logError(i18n("Cannot restore file `%1'.")
- .arg(databaseInfo.fileName()));
- }
-}
-
-/* virtual */ TQString RestoreAction::statusString() const
-{
- FUNCTIONSETUP;
- TQString s;
-
- switch (status())
- {
- case InstallingFiles:
- s.append(CSL1("Installing Files ("));
- s.append(TQString::number(fP->fDBIndex));
- s.append(CSL1(")"));
- break;
- case GettingFileInfo:
- s.append(CSL1("Getting File Info ("));
- s.append(TQString::number(fP->fDBIndex));
- s.append(CSL1(")"));
- break;
- default:
- return SyncAction::statusString();
- }
-
- return s;
-}
-
-
-
-BackupAction::Thread::Thread( BackupAction *parent,
- KPilotLink *link,
- const TQString &filename,
- const DBInfo *info )
-{
- fParent = parent;
- fLink = link;
- fFilename = filename;
- memcpy(&fDBInfo,info,sizeof(DBInfo));
-}
-
-void BackupAction::Thread::run()
-{
- if (fLink->retrieveDatabase(fFilename,&fDBInfo))
- {
- // Successful.
- TQApplication::postEvent( fParent, new TQEvent( (TQEvent::Type)TerminateOK ) );
- }
- else
- {
- // Failed
- TQApplication::postEvent( fParent, new TQEvent( (TQEvent::Type)TerminateFailure ) );
- }
-}
-
-
diff --git a/kpilot/kpilot/hotSync.h b/kpilot/kpilot/hotSync.h
deleted file mode 100644
index f100e639..00000000
--- a/kpilot/kpilot/hotSync.h
+++ /dev/null
@@ -1,175 +0,0 @@
-#ifndef _KPILOT_HOTSYNC_H
-#define _KPILOT_HOTSYNC_H
-/* hotSync.h KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-** Copyright (C) 2006 Adriaan de Groot <groot@kde.org>
-**
-** This file defines SyncActions, which are used to perform some specific
-** task during a HotSync. Conduits are not included here, nor are
-** sync actions requiring user interaction. Those can be found in the
-** conduits subdirectory or interactiveSync.h.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-class TQTimer;
-
-#include "syncAction.h"
-
-class CheckUser : public SyncAction
-{
-public:
- CheckUser(KPilotLink *p,TQWidget *w=0L);
- virtual ~CheckUser();
-
-protected:
- virtual bool exec();
-} ;
-
-
-class BackupAction : public SyncAction
-{
-Q_OBJECT
-
-public:
- /** Constructor. Back up all the databases on
- * the link to a directory on the local disk.
- * If @p full is @c true, then a full backup,
- * including applications, is done. Otherwise,
- * only user data is backed-up.
- *
- * @see setDirectory()
- */
- BackupAction(KPilotLink *, bool full);
-
- enum Status { Init,
- Error,
- FastBackup,
- FullBackup,
- BackupIncomplete,
- BackupEnded,
- BackupComplete
- } ;
- virtual TQString statusString() const;
-
- /** By default, a path based on the user name (either
- * on the handheld or set in KPilot) is used to
- * determine the backup directory name ( generally
- * $KDEHOME/share/apps/kpilot/DBBackup/_user_name_ ).
- * Use setDirectory() to change that and use a given
- * @p path as target for the backup. Use an empty
- * @p path to restore the default behavior of using
- * the username.
- */
- void setDirectory( const TQString &path );
-
- // Reimplemented to support threaded backup.
- virtual bool event( TQEvent *e );
-
-protected:
- virtual bool exec();
-
-private:
- /** Finish the backup and clean up resources. */
- void endBackup();
-
- /** Copy the database indicated by @p info to the local
- * disk; returns @c false on failure.
- */
- bool startBackupThread(DBInfo *info);
-
-private slots:
- /** Implementation detail: databases get backed-up
- * one at a time because the backup function in
- * pilot-link isn't threaded.
- */
- void backupOneDB();
-
-private:
- class Private;
- Private *fP;
- class Thread;
- Thread *fBackupThread;
-} ;
-
-class FileInstallAction : public SyncAction
-{
-Q_OBJECT
-public:
- FileInstallAction(KPilotLink *,
- const TQString &fileDir);
- virtual ~FileInstallAction();
-
- virtual TQString statusString() const;
-
-protected:
- virtual bool exec();
-
-protected slots:
- void installNextFile();
-
-private:
- int fDBIndex;
- TQTimer *fTimer;
- TQString fDir;
- TQStringList fList;
-
- // TODO: not const because it calls logError(), which is
- // non-const (but might be - can signals be const, anyway?)
- bool resourceOK(const TQString &, const TQString &) /* const */ ;
-} ;
-
-class RestoreAction : public SyncAction
-{
-Q_OBJECT
-public:
- RestoreAction(KPilotLink *,TQWidget *w=0L);
-
- typedef enum { InstallingFiles, GettingFileInfo,Done } Status;
- virtual TQString statusString() const;
-
- /** By default, a path based on the user name (either
- * on the handheld or set in KPilot) is used to
- * determine the restory directory name ( generally
- * $KDEHOME/share/apps/kpilot/DBBackup/_user_name_ ).
- * Use setDirectory() to change that and use a given
- * @p path as target for the source. Use an empty
- * @p path to restore the default behavior of using
- * the username.
- */
- void setDirectory( const TQString &path );
-
-protected:
- virtual bool exec();
-
-protected slots:
- void installNextFile();
-
-private:
- class Private;
- Private *fP;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/internalEditorAction.cc b/kpilot/kpilot/internalEditorAction.cc
deleted file mode 100644
index bc4bdb3e..00000000
--- a/kpilot/kpilot/internalEditorAction.cc
+++ /dev/null
@@ -1,394 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include <options.h>
-
-#include <tqtimer.h>
-#include <tqlayout.h>
-#include <tqlabel.h>
-#include <kmessagebox.h>
-#include <kdialog.h>
-#include <ktextedit.h>
-#include <kdialogbase.h>
-
-#include <pilotRecord.h>
-#include <pilotLocalDatabase.h>
-#include <pilotDatabase.h>
-#include <pilotSerialDatabase.h>
-#include "kpilotConfig.h"
-#include "internalEditorAction.h"
-
-#include <pilotAddress.h>
-#include <pilotMemo.h>
-#include <pilotDateEntry.h>
-#include <pilotTodoEntry.h>
-
-#include "khexedit/byteseditinterface.h"
-using namespace KHE;
-
-InternalEditorAction::InternalEditorAction(KPilotLink * p) :
- SyncAction(p, "internalSync")
-{
- FUNCTIONSETUP;
-}
-
-bool InternalEditorAction::exec()
-{
- FUNCTIONSETUP;
- emit logMessage(i18n("[Internal Editors]"));
- fInternalEditorSyncStatus=eSyncStarted;
- TQTimer::singleShot(0, this, TQT_SLOT(syncDirtyDB()));
- return true;
-}
-
-void InternalEditorAction::syncDirtyDB()
-{
- FUNCTIONSETUP;
-
- if (fInternalEditorSyncStatus!=eSyncDirtyDB)
- {
- fInternalEditorSyncStatus=eSyncDirtyDB;
- dirtyDBs=KPilotSettings::dirtyDatabases();
- emit logMessage(i18n("Databases with changed records: %1").arg(dirtyDBs.join(CSL1(", "))));
- dbIter=dirtyDBs.begin();
- }
- else
- {
- dbIter++;
- }
- if (dbIter==dirtyDBs.end())
- {
- KPilotSettings::setDirtyDatabases(TQStringList());
- KPilotConfig::sync();
- TQTimer::singleShot(0, this, TQT_SLOT(syncFlagsChangedDB()));
- return;
- }
-#ifdef DEBUG
- DEBUGKPILOT<<"syncDirtyDB for DB "<<(*dbIter)<<endl;
-#endif
- // open the local and the serial database and copy every
- // changed record from the PC to the handheld
-
- PilotRecord*rec=0L;
- PilotLocalDatabase*localDB=new PilotLocalDatabase(*dbIter, false);
- PilotDatabase *serialDB= deviceLink()->database(*dbIter);
- if (!localDB->isOpen() || !serialDB->isOpen())
- {
- emit logError(i18n("Unable to open the serial or local database for %1. "
- "Skipping it.").arg(*dbIter));
- goto nextDB;
- }
- while ( (rec=localDB->readNextModifiedRec()) )
- {
- int id=rec->id();
-#ifdef DEBUG
- DEBUGKPILOT<<"ID of modified record is "<<id<<endl;
- DEBUGKPILOT<<endl<<endl;
-#endif
- if (id>0)
- {
- PilotRecord*serrec=serialDB->readRecordById(id);
- if (serrec && (serrec->isModified()) )
- {
- bool kpilotOverrides=queryUseKPilotChanges(*dbIter, id, rec, serrec, localDB);
- if (kpilotOverrides)
- serialDB->writeRecord(rec);
- else
- localDB->writeRecord(serrec);
- }
- else
- serialDB->writeRecord(rec);
- }
- else
- {
-#ifdef DEBUG
- DEBUGKPILOT<<"Generating ID for Record "<<rec->id()<<" with data "<<endl;
- DEBUGKPILOT<<rec->data()<<endl;
- DEBUGKPILOT<<"-----------------------------------------"<<endl;
-#endif
- int id=serialDB->writeRecord(rec);
- rec->setID(id);
-#ifdef DEBUG
- DEBUGKPILOT<<"New ID is "<<id<<endl;
- DEBUGKPILOT<<endl<<endl<<endl;
-#endif
- //localDB->writeRecord(rec);
- localDB->updateID(id);
- }
- KPILOT_DELETE(rec);
- }
-
-nextDB:
- localDB->resetSyncFlags();
- KPILOT_DELETE(localDB);
- KPILOT_DELETE(serialDB);
- TQTimer::singleShot(0, this, TQT_SLOT(syncDirtyDB()));
-}
-
-bool InternalEditorAction::queryUseKPilotChanges(TQString dbName, recordid_t id, PilotRecord*localrec, PilotRecord*serialrec, PilotDatabase*db)
-{
- FUNCTIONSETUP;
- bool knownDB=true;
- TQString localEntry, serialEntry, recType(i18n("record"));
-
- if (dbName==CSL1("AddressDB") && db)
- {
- PilotAddressInfo info(db);
-
- PilotAddress localAddr(localrec);
- PilotAddress serialAddr(serialrec);
- localEntry=localAddr.getTextRepresentation(&info,Qt::RichText);
- serialEntry=serialAddr.getTextRepresentation(&info,Qt::RichText);
- recType=i18n("address");
- }
- else
- if (dbName==CSL1("ToDoDB") && db)
- {
- PilotToDoInfo info(db);
-
- PilotTodoEntry localTodo(localrec);
- PilotTodoEntry serialTodo(serialrec);
- localEntry=localTodo.getTextRepresentation(Qt::RichText);
- serialEntry=serialTodo.getTextRepresentation(Qt::RichText);
- recType=i18n("to-do entry");
- }
- else
- if (dbName==CSL1("MemoDB"))
- {
- PilotMemo localMemo(localrec);
- PilotMemo serialMemo(serialrec);
- localEntry=localMemo.getTextRepresentation(Qt::RichText);
- serialEntry=serialMemo.getTextRepresentation(Qt::RichText);
- recType=i18n("memo");
- }
- else
- if (dbName==CSL1("DatebookDB"))
- {
- PilotDateInfo info(db);
-
- PilotDateEntry localEvent(localrec);
- PilotDateEntry serialEvent(serialrec);
- localEntry=localEvent.getTextRepresentation(Qt::RichText);
- serialEntry=serialEvent.getTextRepresentation(Qt::RichText);
- recType=i18n("calendar entry");
- }
- else
- {
- knownDB=false;
- }
-
- TQString dialogText(i18n("The %1 with ID %2 of the database \"%3\" was changed "
- "on the handheld and in the internal editor. Shall the changes in KPilot be copied to the handheld, and so override the changes there?").
- arg(recType).arg(id).arg(dbName));
-
- KDialogBase*resdlg=new KDialogBase(0L, "internalresolutiondialog", true,
- i18n("Conflict in database %1").arg(*dbIter),
- KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true,
- i18n("Use KPilot"), i18n("Use Handheld") );
- resdlg->setButtonText(KDialogBase::Ok, i18n("Use &KPilot"));
- resdlg->setButtonText(KDialogBase::Cancel, i18n("Use &Handheld"));
-
- TQWidget*page=new TQWidget(resdlg);
- resdlg->setMainWidget(page);
- TQGridLayout*layout = new TQGridLayout( page, 1, 1);
-
- TQLabel *label=new TQLabel(dialogText, page);
- label->setAlignment( TQLabel::WordBreak );
- layout->addMultiCellWidget( label, 0,0, 0,1 );
-
- layout->addItem( new TQSpacerItem( 20, 10, TQSizePolicy::Minimum,
- TQSizePolicy::Fixed ), 1, 0 );
-
- if (knownDB)
- {
- label=new TQLabel(i18n("Entry in KPilot"), page);
- layout->addWidget( label, 2,0);
-
- KTextEdit*textBrowser = new KTextEdit(CSL1("<qt>")+localEntry+CSL1("</qt>"), TQString::null, page);
- textBrowser->setReadOnly(true);
- layout->addWidget( textBrowser, 3,0);
-
- label=new TQLabel(i18n("Entry on Handheld"), page);
- layout->addWidget( label, 2,1);
-
- textBrowser = new KTextEdit(CSL1("<qt>")+serialEntry+CSL1("</qt>"), TQString::null, page);
- textBrowser->setReadOnly(true);
- layout->addWidget( textBrowser, 3,1);
- }
- else
- {
- label=new TQLabel(i18n("Entry in KPilot"), page);
- layout->addMultiCellWidget( label, 2,2,0,1);
-
- // directly display the record's data:
- TQWidget *hexEdit = KHE::createBytesEditWidget( page, "LocalBufferEdit" );
- if( hexEdit )
- {
- KHE::BytesEditInterface* hexEditIf = KHE::bytesEditInterface( hexEdit );
- Q_ASSERT( hexEditIf ); // This should not fail!
- if( hexEditIf )
- {
- hexEditIf->setData( localrec->data(), localrec->size() );
-// Do we need the following call at all???
-// hexEditIf->setMaxDataSize( localrec->getLen() );
- hexEditIf->setReadOnly( true );
- }
- }
- else
- {
- TQLabel*tmpW = new TQLabel( i18n("To view and edit the record data, please install a hex editor (e.g. khexedit from kdeutils)."), page );
- tmpW->setBackgroundMode( Qt::PaletteMid );
- tmpW->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak);
- tmpW->setFrameShape( TQFrame::Panel );
- tmpW->setFrameShadow( TQFrame::Sunken );
- hexEdit = tmpW;
- }
- layout->addMultiCellWidget( hexEdit, 3,3,0,1);
-
- label=new TQLabel(i18n("Entry on Handheld"), page);
- layout->addMultiCellWidget( label, 4,4,0,1);
-
- // directly display the record's data:
- hexEdit = KHE::createBytesEditWidget( page, "SerialBufferEdit" );
- if( hexEdit )
- {
- KHE::BytesEditInterface* hexEditIf = KHE::bytesEditInterface( hexEdit );
- Q_ASSERT( hexEditIf ); // This should not fail!
- if( hexEditIf )
- {
- hexEditIf->setData( serialrec->data(), serialrec->size() );
-// Do we need the following call at all???
-// hexEditIf->setMaxDataSize( serialrec->getLen() );
- hexEditIf->setReadOnly( true );
- }
- }
- else
- {
- TQLabel*tmpW = new TQLabel( i18n("To view and edit the record data, please install a hex editor (e.g. khexedit from kdeutils)."), page );
- tmpW->setBackgroundMode( Qt::PaletteMid );
- tmpW->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak);
- tmpW->setFrameShape( TQFrame::Panel );
- tmpW->setFrameShadow( TQFrame::Sunken );
- hexEdit = tmpW;
- }
- layout->addMultiCellWidget( hexEdit, 5,5,0,1);
- }
-
- int res=resdlg->exec();
- KPILOT_DELETE(resdlg);
-
- return res==KDialogBase::Accepted;
-}
-
-
-void InternalEditorAction::syncFlagsChangedDB()
-{
- FUNCTIONSETUP;
- if (fInternalEditorSyncStatus!=eSyncFlagsChangedDB)
- {
- fInternalEditorSyncStatus=eSyncFlagsChangedDB;
- dirtyDBs=KPilotSettings::flagsChangedDatabases();
- emit logMessage(i18n("Databases with changed flags: %1").arg(dirtyDBs.join(CSL1(", "))));
- dbIter=dirtyDBs.begin();
- }
- else
- {
- dbIter++;
- }
- if (dbIter==dirtyDBs.end())
- {
- KPilotSettings::setFlagsChangedDatabases(TQStringList());
- KPilotConfig::sync();
- TQTimer::singleShot(0, this, TQT_SLOT(syncAppBlockChangedDB()));
- return;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT<<"syncFlagsChangedDB for DB "<<(*dbIter)<<endl;
-#endif
-emit logError(i18n("Setting the database flags on the handheld is not yet supported."));
-TQTimer::singleShot(0, this, TQT_SLOT(syncAppBlockChangedDB()));
-return;
-
- PilotLocalDatabase*localDB=new PilotLocalDatabase(*dbIter, false);
- PilotDatabase *serialDB=deviceLink()->database(*dbIter);
-
- // open the local and the serial database and copy the flags over
- // TODO: Implement the copying
- // TODO: Is there a way to detect if the flags were changed on the handheld?
-
- KPILOT_DELETE(localDB);
- KPILOT_DELETE(serialDB);
- TQTimer::singleShot(0, this, TQT_SLOT(syncAppBlockChangedDB()));
-}
-
-void InternalEditorAction::syncAppBlockChangedDB()
-{
- FUNCTIONSETUP;
- if (fInternalEditorSyncStatus!=eSyncAppBlockChangedDB)
- {
- fInternalEditorSyncStatus=eSyncAppBlockChangedDB;
- dirtyDBs=KPilotSettings::appBlockChangedDatabases();
- emit logMessage(i18n("Databases with changed AppBlock: %1").arg(dirtyDBs.join(CSL1(", "))));
- dbIter=dirtyDBs.begin();
- }
- else
- {
- dbIter++;
- }
- if (dbIter==dirtyDBs.end())
- {
- KPilotSettings::setAppBlockChangedDatabases(TQStringList());
- KPilotConfig::sync();
- TQTimer::singleShot(0, this, TQT_SLOT(cleanup()));
- return;
- }
-#ifdef DEBUG
- DEBUGKPILOT<<"syncAppBlockChangedDB for DB "<<(*dbIter)<<endl;
-#endif
-
- PilotLocalDatabase*localDB=new PilotLocalDatabase(*dbIter, false);
- PilotDatabase *serialDB=deviceLink()->database(*dbIter);
-
- unsigned char*appBlock=new unsigned char[0xFFFF];
- int len=localDB->readAppBlock(appBlock, 0xFFFF);
- // TODO: Check if the app block was changed on the handheld, and if so, do conflict resolution
- serialDB->writeAppBlock(appBlock, len);
-
- KPILOT_DELETE(localDB);
- KPILOT_DELETE(serialDB);
- TQTimer::singleShot(0, this, TQT_SLOT(syncAppBlockChangedDB()));
-}
-
-void InternalEditorAction::cleanup()
-{
- FUNCTIONSETUP;
- fInternalEditorSyncStatus=eSyncFinished;
- emit syncDone(this);
-}
-
-#include "internalEditorAction.moc"
diff --git a/kpilot/kpilot/internalEditorAction.h b/kpilot/kpilot/internalEditorAction.h
deleted file mode 100644
index ed26cb35..00000000
--- a/kpilot/kpilot/internalEditorAction.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef _INTERNALEDITORACTION_H_
-#define _INTERNALEDITORACTION_H_
-/* internalEditorAction.h KPilot
-**
-** Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include <tqstringlist.h>
-
-#include "syncAction.h"
-
-
-class InternalEditorAction : public SyncAction
-{
-Q_OBJECT
-
-public:
- InternalEditorAction(KPilotLink *);
- ~InternalEditorAction() {}
-
-protected:
- virtual bool exec();
-
-private:
-private slots:
- void syncDirtyDB();
- void syncFlagsChangedDB();
- void syncAppBlockChangedDB();
- void cleanup();
-
-private:
- bool queryUseKPilotChanges(TQString dbName, recordid_t id,
- PilotRecord*localrec, PilotRecord*serialrec, PilotDatabase*db);
- TQStringList dirtyDBs;
- TQStringList::Iterator dbIter;
- enum eInternalEditorSyncStatus {
- eSyncStarted,
- eSyncDirtyDB,
- eSyncFlagsChangedDB,
- eSyncAppBlockChangedDB,
- eSyncFinished
- } fInternalEditorSyncStatus;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/kpilot.cc b/kpilot/kpilot/kpilot.cc
deleted file mode 100644
index 4b38c509..00000000
--- a/kpilot/kpilot/kpilot.cc
+++ /dev/null
@@ -1,1136 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This is the main program in KPilot.
-**
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include "options.h"
-
-#include <tqfile.h>
-#include <tqptrlist.h>
-#include <tqstring.h>
-#include <tqvbox.h>
-#include <tqtimer.h>
-
-#include <kjanuswidget.h>
-#include <kurl.h>
-#include <kmessagebox.h>
-#include <kstatusbar.h>
-#include <kconfig.h>
-#include <kwin.h>
-#include <kcombobox.h>
-#include <kmenubar.h>
-#include <kstandarddirs.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kiconloader.h>
-#include <kdebug.h>
-#include <kaction.h>
-#include <kactionclasses.h>
-#include <kstdaction.h>
-#include <kuniqueapplication.h>
-#include <kkeydialog.h>
-#include <kedittoolbar.h>
-#include <kcmultidialog.h>
-#include <kprogress.h>
-#include <klibloader.h>
-
-
-#include "kpilotConfigDialog.h"
-#include "kpilotConfig.h"
-#include "kpilotConfigWizard.h"
-
-#include "pilotComponent.h"
-#include "pilotDatabase.h"
-
-#include "addressWidget.h"
-#include "memoWidget.h"
-#include "fileInstallWidget.h"
-#include "logWidget.h"
-#include "dbviewerWidget.h"
-#include "datebookWidget.h"
-#include "todoWidget.h"
-
-#include "conduitConfigDialog.h"
-
-#include "pilotDaemonDCOP.h"
-#include "pilotDaemonDCOP_stub.h"
-
-#include "kpilot.moc"
-
-class KPilotInstaller::KPilotPrivate
-{
-public:
- typedef TQPtrList<PilotComponent> ComponentList;
-
-private:
- ComponentList fPilotComponentList;
-
-public:
- ComponentList &list() { return fPilotComponentList; } ;
-} ;
-
-KPilotInstaller::KPilotInstaller() :
- DCOPObject("KPilotIface"),
- KMainWindow(0),
- fDaemonStub(new PilotDaemonDCOP_stub("kpilotDaemon",
- "KPilotDaemonIface")),
- fP(new KPilotPrivate),
- fQuitAfterCopyComplete(false),
- fManagingWidget(0L),
- fDaemonWasRunning(true),
- fAppStatus(Startup),
- fFileInstallWidget(0L),
- fLogWidget(0L)
-{
- FUNCTIONSETUP;
-
- readConfig();
- setupWidget();
-
- PilotRecord::allocationInfo();
- fConfigureKPilotDialogInUse = false;
-}
-
-KPilotInstaller::~KPilotInstaller()
-{
- FUNCTIONSETUP;
- killDaemonIfNeeded();
- delete fDaemonStub;
- PilotRecord::allocationInfo();
- (void) PilotDatabase::instanceCount();
-}
-
-void KPilotInstaller::killDaemonIfNeeded()
-{
- FUNCTIONSETUP;
- if (KPilotSettings::killDaemonAtExit())
- {
- if (!fDaemonWasRunning)
- {
- DEBUGKPILOT << fname << ": Killing daemon." << endl;
- getDaemon().quitNow();
- }
- }
-}
-
-void KPilotInstaller::startDaemonIfNeeded()
-{
- FUNCTIONSETUP;
-
- fAppStatus=WaitingForDaemon;
-
- TQString daemonError;
- TQCString daemonDCOP;
- int daemonPID;
-
- TQString s = getDaemon().statusString();
-
- DEBUGKPILOT << fname << ": Daemon status is "
- << ( s.isEmpty() ? CSL1("<none>") : s ) << endl;
-
- if ((s.isEmpty()) || (!getDaemon().ok()))
- {
- DEBUGKPILOT << fname
- << ": Daemon not responding, trying to start it."
- << endl;
- fLogWidget->addMessage(i18n("Starting the KPilot daemon ..."));
- fDaemonWasRunning = false;
- }
- else
- {
- fDaemonWasRunning = true;
- }
-
- if (!fDaemonWasRunning && KApplication::startServiceByDesktopName(
- CSL1("kpilotdaemon"),
- TQString::null, &daemonError, &daemonDCOP, &daemonPID
- , "0" /* no notify */
- ))
- {
- WARNINGKPILOT << ": Can't start daemon : " << daemonError << endl;
- if (fLogWidget)
- {
- fLogWidget->addMessage(i18n("Could not start the "
- "KPilot daemon. The system error message "
- "was: &quot;%1&quot;").arg(daemonError));
- }
- fAppStatus=Error;
- }
- else
- {
- DEBUGKPILOT << fname << ": Daemon status is " << s << endl;
- if (fLogWidget)
- {
- int wordoffset;
- s.remove(0,12);
- wordoffset=s.find(';');
- if (wordoffset>0) s.truncate(wordoffset);
-
- fLogWidget->addMessage(
- i18n("Daemon status is `%1'")
- .arg(s.isEmpty() ? i18n("not running") : s ));
- }
- fAppStatus=Normal;
- }
-}
-
-void KPilotInstaller::readConfig()
-{
- FUNCTIONSETUP;
-
- KPilotSettings::self()->readConfig();
-
- (void) Pilot::setupPilotCodec(KPilotSettings::encoding());
- (void) Pilot::setupPilotCodec(KPilotSettings::encoding());
-
- if (fLogWidget)
- {
- fLogWidget->addMessage(i18n("Using character set %1 on "
- "the handheld.")
- .arg(Pilot::codecName()));
- }
-}
-
-
-void KPilotInstaller::setupWidget()
-{
- FUNCTIONSETUP;
-
- setCaption(CSL1("KPilot"));
- setMinimumSize(500, 405);
-
-
- fManagingWidget = new KJanusWidget(this,"mainWidget",
- KJanusWidget::IconList);
- fManagingWidget->setMinimumSize(fManagingWidget->sizeHint());
- fManagingWidget->show();
- setCentralWidget(fManagingWidget);
- connect( fManagingWidget, TQT_SIGNAL( aboutToShowPage ( TQWidget* ) ),
- this, TQT_SLOT( slotAboutToShowComponent( TQWidget* ) ) );
-
- initIcons();
- initMenu();
- initComponents();
-
- setMinimumSize(sizeHint() + TQSize(10,60));
-
- createGUI(CSL1("kpilotui.rc"), false);
- setAutoSaveSettings();
-}
-
-void KPilotInstaller::initComponents()
-{
- FUNCTIONSETUP;
-
- TQString defaultDBPath = KPilotConfig::getDefaultDBPath();
-
- TQPixmap pixmap;
- TQString pixfile;
- TQWidget *w;
-
-#define ADDICONPAGE(a,b) \
- pixmap = KGlobal::iconLoader()->loadIcon(b, KIcon::Desktop, 64); \
- w = getManagingWidget()->addVBoxPage(a,TQString::null, pixmap) ;
-
- ADDICONPAGE(i18n("HotSync"),CSL1("kpilotbhotsync"));
- fLogWidget = new LogWidget(w);
- addComponentPage(fLogWidget, i18n("HotSync"));
- fLogWidget->setShowTime(true);
-
- ADDICONPAGE(i18n("To-do Viewer"),CSL1("kpilottodo"));
- addComponentPage(new TodoWidget(w,defaultDBPath),
- i18n("To-do Viewer"));
-
- ADDICONPAGE(i18n("Address Viewer"),CSL1("kpilotaddress"));
- addComponentPage(new AddressWidget(w,defaultDBPath),
- i18n("Address Viewer"));
-
- ADDICONPAGE(i18n("Memo Viewer"),CSL1("kpilotknotes"));
- addComponentPage(new MemoWidget(w, defaultDBPath),
- i18n("Memo Viewer"));
-
- ADDICONPAGE(i18n("File Installer"),CSL1("kpilotfileinstaller"));
- fFileInstallWidget = new FileInstallWidget(
- w,defaultDBPath);
- addComponentPage(fFileInstallWidget, i18n("File Installer"));
-
- ADDICONPAGE(i18n("Generic DB Viewer"),CSL1("kpilotdb"));
- addComponentPage(new GenericDBWidget(w,defaultDBPath),
- i18n("Generic DB Viewer"));
-
-#undef ADDICONPAGE
-
- TQTimer::singleShot(500,this,TQT_SLOT(initializeComponents()));
-}
-
-
-
-void KPilotInstaller::initIcons()
-{
- FUNCTIONSETUP;
-
-}
-
-
-
-void KPilotInstaller::slotAboutToShowComponent( TQWidget *c )
-{
- FUNCTIONSETUP;
- int ix = fManagingWidget->pageIndex( c );
- PilotComponent*compToShow = fP->list().at(ix);
- for ( PilotComponent *comp = fP->list().first(); comp; comp = fP->list().next() )
- {
- // Load/Unload the data needed
- comp->showKPilotComponent( comp == compToShow );
- }
-}
-
-void KPilotInstaller::slotSelectComponent(PilotComponent *c)
-{
- FUNCTIONSETUP;
- if (!c)
- {
- WARNINGKPILOT << "Not a widget." << endl;
- return;
- }
-
- TQObject *o = c->parent();
- if (!o)
- {
- WARNINGKPILOT << "Widget has no parent." << endl;
- return;
- }
-
- TQWidget *parent = dynamic_cast<TQWidget *>(o);
- if (!parent)
- {
- WARNINGKPILOT << "Widget's parent is not a widget." << endl;
- return;
- }
-
- int index = fManagingWidget->pageIndex(parent);
-
- if (index < 0)
- {
- WARNINGKPILOT << "Bogus index " << index << endl;
- return;
- }
-
- for ( PilotComponent *comp = fP->list().first(); comp; comp = fP->list().next() )
- {
- // Load/Unload the data needed
- comp->showKPilotComponent( comp == c );
- }
- fManagingWidget->showPage(index);
-}
-
-
-
-
-void KPilotInstaller::slotBackupRequested()
-{
- FUNCTIONSETUP;
- setupSync(SyncAction::SyncMode::eBackup,
- i18n("Next sync will be a backup. ") +
- i18n("Please press the HotSync button."));
-}
-
-void KPilotInstaller::slotRestoreRequested()
-{
- FUNCTIONSETUP;
- setupSync(SyncAction::SyncMode::eRestore,
- i18n("Next sync will restore the Pilot from backup. ") +
- i18n("Please press the HotSync button."));
-}
-
-void KPilotInstaller::slotHotSyncRequested()
-{
- FUNCTIONSETUP;
- setupSync(SyncAction::SyncMode::eHotSync,
- i18n("Next sync will be a regular HotSync. ") +
- i18n("Please press the HotSync button."));
-}
-
-void KPilotInstaller::slotFullSyncRequested()
-{
- FUNCTIONSETUP;
- setupSync(SyncAction::SyncMode::eFullSync,
- i18n("Next sync will be a Full Sync. ") +
- i18n("Please press the HotSync button."));
-}
-
-void KPilotInstaller::slotHHtoPCRequested()
-{
- FUNCTIONSETUP;
- setupSync(SyncAction::SyncMode::eCopyHHToPC,
- i18n("Next sync will copy Handheld data to PC. ") +
- i18n("Please press the HotSync button."));
-}
-
-void KPilotInstaller::slotPCtoHHRequested()
-{
- FUNCTIONSETUP;
- setupSync(SyncAction::SyncMode::eCopyPCToHH,
- i18n("Next sync will copy PC data to Handheld. ") +
- i18n("Please press the HotSync button."));
-}
-
-/* virtual DCOP */ ASYNC KPilotInstaller::daemonStatus(int i)
-{
- FUNCTIONSETUP;
- DEBUGKPILOT << fname << ": Received daemon message " << i << endl;
-
- switch(i)
- {
- case KPilotDCOP::StartOfHotSync :
- if (fAppStatus==Normal)
- {
- fAppStatus=WaitingForDaemon;
- componentPreSync();
- }
- break;
- case KPilotDCOP::EndOfHotSync :
- if (fAppStatus==WaitingForDaemon)
- {
- componentPostSync();
- fAppStatus=Normal;
- }
- break;
- case KPilotDCOP::DaemonQuit :
- if (fLogWidget)
- {
- fLogWidget->logMessage(i18n("The daemon has exited."));
- fLogWidget->logMessage(i18n("No further HotSyncs are possible."));
- fLogWidget->logMessage(i18n("Restart the daemon to HotSync again."));
- }
- fAppStatus=WaitingForDaemon;
- break;
- case KPilotDCOP::None :
- WARNINGKPILOT << "Unhandled status message " << i << endl;
- break;
- }
-}
-
-/* virtual DCOP*/ int KPilotInstaller::kpilotStatus()
-{
- return status();
-}
-
-bool KPilotInstaller::componentPreSync()
-{
- FUNCTIONSETUP;
-
- TQString reason;
- TQString rprefix(i18n("Cannot start a Sync now. %1"));
-
- for (fP->list().first();
- fP->list().current(); fP->list().next())
- {
- if (!fP->list().current()->preHotSync(reason))
- break;
- }
-
- if (!reason.isNull())
- {
- KMessageBox::sorry(this,
- rprefix.arg(reason),
- i18n("Cannot start Sync"));
- return false;
- }
- return true;
-}
-
-void KPilotInstaller::componentPostSync()
-{
- FUNCTIONSETUP;
-
- for (fP->list().first();
- fP->list().current(); fP->list().next())
- {
- fP->list().current()->postHotSync();
- }
-}
-
-void KPilotInstaller::setupSync(int kind, const TQString & message)
-{
- FUNCTIONSETUP;
-
- if (!componentPreSync())
- {
- return;
- }
- if (!message.isEmpty())
- {
- TQString m(message);
- if (fLogWidget)
- {
- fLogWidget->logMessage(m);
- }
- }
- getDaemon().requestSync(kind);
-}
-
-void KPilotInstaller::closeEvent(TQCloseEvent * e)
-{
- FUNCTIONSETUP;
-
- quit();
- e->accept();
-}
-
-void KPilotInstaller::initMenu()
-{
- FUNCTIONSETUP;
-
- KAction *a;
-
- KActionMenu *syncPopup;
-
- syncPopup = new KActionMenu(i18n("HotSync"), CSL1("kpilot"),
- actionCollection(), "popup_hotsync");
- syncPopup->setToolTip(i18n("Select the kind of HotSync to perform next."));
- syncPopup->setWhatsThis(i18n("Select the kind of HotSync to perform next. "
- "This applies only to the next HotSync; to change the default, use "
- "the configuration dialog."));
- connect(syncPopup, TQT_SIGNAL(activated()),
- this, TQT_SLOT(slotHotSyncRequested()));
-
- // File actions, keep this list synced with kpilotui.rc and pilotDaemon.cc
- a = new KAction(i18n("&HotSync"), CSL1("hotsync"), 0,
- this, TQT_SLOT(slotHotSyncRequested()),
- actionCollection(), "file_hotsync");
- a->setToolTip(i18n("Next HotSync will be normal HotSync."));
- a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
- "should be a normal HotSync."));
- syncPopup->insert(a);
-
- a = new KAction(i18n("Full&Sync"), CSL1("fullsync"), 0,
- this, TQT_SLOT(slotFullSyncRequested()),
- actionCollection(), "file_fullsync");
- a->setToolTip(i18n("Next HotSync will be a FullSync."));
- a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
- "should be a FullSync (check data on both sides)."));
- syncPopup->insert(a);
-
- a = new KAction(i18n("&Backup"), CSL1("backup"), 0,
- this, TQT_SLOT(slotBackupRequested()),
- actionCollection(), "file_backup");
- a->setToolTip(i18n("Next HotSync will be backup."));
- a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
- "should back up the Handheld to the PC."));
- syncPopup->insert(a);
-
- a = new KAction(i18n("&Restore"), CSL1("restore"), 0,
- this, TQT_SLOT(slotRestoreRequested()),
- actionCollection(), "file_restore");
- a->setToolTip(i18n("Next HotSync will be restore."));
- a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
- "should restore the Handheld from data on the PC."));
- syncPopup->insert(a);
-
- a = new KAction(i18n("Copy Handheld to PC"), TQString::null, 0,
- this, TQT_SLOT(slotHHtoPCRequested()),
- actionCollection(), "file_HHtoPC");
- a->setToolTip(i18n("Next HotSync will be backup."));
- a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
- "should copy all data from the Handheld to the PC, "
- "overwriting entries on the PC."));
- syncPopup->insert(a);
-
- a = new KAction(i18n("Copy PC to Handheld"), TQString::null, 0,
- this, TQT_SLOT(slotPCtoHHRequested()),
- actionCollection(), "file_PCtoHH");
- a->setToolTip(i18n("Next HotSync will copy PC to Handheld."));
- a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
- "should copy all data from the PC to the Handheld, "
- "overwriting entries on the Handheld."));
- syncPopup->insert(a);
-
-
-#if 0
- a = new KAction(i18n("&List Only"),CSL1("listsync"),0,
- this,TQT_SLOT(slotTestSyncRequested()),
- actionCollection(), "file_list");
- a->setToolTip(i18n("Next HotSync will list databases."));
- a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
- "should just list the files on the Handheld and do nothing "
- "else."));
- syncPopup->insert(a);
-#endif
-
-
- a = new KAction(i18n("Rese&t Link"),CSL1("reload"), 0,
- this, TQT_SLOT(slotResetLink()),
- actionCollection(),"file_reload");
- a->setToolTip(i18n("Reset the device connection."));
- a->setWhatsThis(i18n("Try to reset the daemon and its connection "
- "to the Handheld."));
-
-
- a = KStdAction::quit(this, TQT_SLOT(quit()), actionCollection());
- a->setWhatsThis(i18n("Quit KPilot, (and stop the daemon "
- "if configured that way)."));
-
- // View actions
-
- // Options actions
- createStandardStatusBarAction();
- setStandardToolBarMenuEnabled(true);
-
- (void) KStdAction::keyBindings(this, TQT_SLOT(optionsConfigureKeys()),
- actionCollection());
- (void) KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()),
- actionCollection());
- (void) KStdAction::preferences(this, TQT_SLOT(configure()),
- actionCollection());
-
- a = new KAction(i18n("Configuration &Wizard..."), CSL1("wizard"), 0,
- this, TQT_SLOT(configureWizard()),
- actionCollection(), "options_configure_wizard");
- a->setWhatsThis(i18n("Configure KPilot using the configuration wizard."));
-
-}
-
-void KPilotInstaller::fileInstalled(int)
-{
- FUNCTIONSETUP;
-}
-
-void KPilotInstaller::quit()
-{
- FUNCTIONSETUP;
-
- for (fP->list().first();
- fP->list().current(); fP->list().next())
- {
- TQString reason;
- if (!fP->list().current()->preHotSync(reason))
- {
- WARNINGKPILOT
- << "Couldn't save "
- << fP->list().current()->name()
- << endl;
- }
- }
-
- killDaemonIfNeeded();
- kapp->quit();
-}
-
-void KPilotInstaller::addComponentPage(PilotComponent * p,
- const TQString & name)
-{
- FUNCTIONSETUP;
-
- if (!p)
- {
- WARNINGKPILOT << "Adding NULL component?" << endl;
- return;
- }
-
- fP->list().append(p);
-
- // The first component added gets id 1, while the title
- // screen -- added elsewhere -- has id 0.
- //
- // fManagingWidget->addWidget(p, fP->list().count());
-
-
- const char *componentname = p->name("(none)");
- char *actionname = 0L;
- int actionnameLength = 0;
-
- if (strncmp(componentname, "component_", 10) == 0)
- {
- actionnameLength = strlen(componentname) - 10 + 8;
- actionname = new char[actionnameLength];
-
- strlcpy(actionname, "view_", actionnameLength);
- strlcat(actionname, componentname + 10, actionnameLength);
- }
- else
- {
- actionnameLength = strlen(componentname) + 8;
- actionname = new char[actionnameLength];
-
- strlcpy(actionname, "view_", actionnameLength);
- strlcat(actionname, componentname, actionnameLength);
- }
-
- KToggleAction *pt =
- new KToggleAction(name, /* "kpilot" -- component icon, */ 0,
- p, TQT_SLOT(slotShowComponent()),
- actionCollection(), actionname);
-
- pt->setExclusiveGroup(CSL1("view_menu"));
-
- connect(p, TQT_SIGNAL(showComponent(PilotComponent *)),
- this, TQT_SLOT(slotSelectComponent(PilotComponent *)));
-}
-
-/* slot */ void KPilotInstaller::initializeComponents()
-{
- FUNCTIONSETUP;
-
-/* for (PilotComponent *p = fP->list().first();
- p ; p = fP->list().next())
- {
- p->initialize();
- }*/
-}
-
-
-void KPilotInstaller::optionsConfigureKeys()
-{
- FUNCTIONSETUP;
- KKeyDialog::configure( actionCollection() );
-}
-
-void KPilotInstaller::optionsConfigureToolbars()
-{
- FUNCTIONSETUP;
- // use the standard toolbar editor
- // This was added in KDE 3.1
- saveMainWindowSettings( KGlobal::config(), autoSaveGroup() );
- KEditToolbar dlg(actionCollection());
- connect(&dlg, TQT_SIGNAL(newToolbarConfig()), this, TQT_SLOT(slotNewToolbarConfig()));
- dlg.exec();
-}
-
-
-void KPilotInstaller::slotNewToolbarConfig()
-{
- FUNCTIONSETUP;
- // recreate our GUI
- createGUI();
- applyMainWindowSettings( KGlobal::config(), autoSaveGroup() );
-}
-
-void KPilotInstaller::slotResetLink()
-{
- FUNCTIONSETUP;
- getDaemon().reloadSettings();
-}
-
-/*
-** Can't be a member function because it needs to be called even with no KPilotInstaller.
-*/
-static bool runConfigure(PilotDaemonDCOP_stub &daemon,TQWidget *parent)
-{
- FUNCTIONSETUP;
- bool ret = false;
-
- // Display the (modal) options page.
- //
- //
- int rememberedSync = daemon.nextSyncType();
- daemon.requestSync(0);
-
- KPilotSettings::self()->readConfig();
-
- KCMultiDialog *options = new KCMultiDialog( KDialogBase::Plain, i18n("Configuration"), parent, "KPilotPreferences", true );
- options->addModule( CSL1("kpilot_config.desktop") );
-
- if (!options)
- {
- WARNINGKPILOT << "Can't allocate KPilotOptions object" << endl;
- daemon.requestSync(rememberedSync);
- return false;
- }
-
- int r = options->exec();
-
- if ( r && options->result() )
- {
- DEBUGKPILOT << fname << ": Updating settings." << endl;
-
- // The settings are changed in the external module!!!
- KPilotSettings::self()->config()->sync();
- KPilotSettings::self()->readConfig();
-
- // Update the daemon to reflect new settings.
- // @TODO: This should also be done when pressing apply without
- // closing the dialog.
- //
- daemon.reloadSettings();
- ret = true;
- }
-
- KPILOT_DELETE(options);
- daemon.requestSync(rememberedSync);
-
- KPilotConfig::sync();
- return ret;
-}
-
-/*
- * Run the config wizard -- this takes a little library magic, and
- * it might fail entirely; returns false if no wizard could be run,
- * or true if the wizard runs (says nothing about it being OK'ed or
- * canceled, though).
- */
-typedef enum { Failed, OK, Cancel } WizardResult;
-static WizardResult runWizard(PilotDaemonDCOP_stub &daemon,TQWidget *parent)
-{
- FUNCTIONSETUP;
- WizardResult ret = Failed ;
- int rememberedSync = daemon.nextSyncType();
- daemon.requestSync(0);
-
- KPilotSettings::self()->readConfig();
- // Declarations at top because of goto's in this function
- ConfigWizard *(* f) (TQWidget *, int) = 0L ;
- ConfigWizard *w = 0L;
- KLibrary *l = KLibLoader::self()->library("kcm_kpilot");
-
- if (!l)
- {
- WARNINGKPILOT << "Couldn't load library!" << endl;
- goto sorry;
- }
-
- if (l->hasSymbol("create_wizard"))
- {
- f = ( ConfigWizard * (*) (TQWidget *, int) ) (l->symbol("create_wizard")) ;
- }
-
- if (!f)
- {
- WARNINGKPILOT << "No create_wizard() in library." << endl;
- goto sorry;
- }
-
- w = f(parent,ConfigWizard::Standalone);
- if (!w)
- {
- WARNINGKPILOT << "Can't create wizard." << endl;
- goto sorry;
- }
-
- if (w->exec())
- {
- KPilotSettings::self()->readConfig();
- ret = OK;
- }
- else
- {
- ret = Cancel;
- }
- KPILOT_DELETE(w);
-
-sorry:
- if (Failed == ret)
- {
- KMessageBox::sorry(parent,
- i18n("The library containing the configuration wizard for KPilot "
- "could not be loaded, and the wizard is not available. "
- "Please try to use the regular configuration dialog."),
- i18n("Wizard Not Available"));
- }
-
- if (OK == ret)
- {
- KPilotConfig::updateConfigVersion();
- KPilotSettings::writeConfig();
- KPilotConfig::sync();
- }
-
- daemon.requestSync(rememberedSync);
- return ret;
-}
-
-void KPilotInstaller::componentUpdate()
-{
- FUNCTIONSETUP;
-
- TQString defaultDBPath = KPilotConfig::getDefaultDBPath();
- bool dbPathChanged = false;
-
- for (fP->list().first();
- fP->list().current();
- fP->list().next())
- {
-// TODO_RK: update the current component to use the new settings
-// fP->list().current()->initialize();
- PilotComponent *p = fP->list().current();
- if (p && (p->dbPath() != defaultDBPath))
- {
- dbPathChanged = true;
- p->setDBPath(defaultDBPath);
- }
- }
-
- if (!dbPathChanged) // done if the username didn't change
- {
- return;
- }
-
- // Otherwise, need to re-load the databases
- //
- if (fLogWidget)
- {
- fLogWidget->logMessage(i18n("Changed username to `%1'.")
- .arg(KPilotSettings::userName()));
- fManagingWidget->showPage(0);
- slotAboutToShowComponent(fLogWidget);
- }
- else
- {
- int ix = fManagingWidget->activePageIndex();
- PilotComponent *component = 0L;
- if (ix>=0)
- {
- component = fP->list().at(ix);
- }
- if (component)
- {
- component->hideComponent(); // Throw away current data
- component->showComponent(); // Reload
- }
- }
-}
-
-/* virtual DCOP */ ASYNC KPilotInstaller::configureWizard()
-{
- FUNCTIONSETUP;
-
- if ( fAppStatus!=Normal || fConfigureKPilotDialogInUse )
- {
- if (fLogWidget)
- {
- fLogWidget->addMessage(i18n("Cannot run KPilot's configuration wizard right now (KPilot's UI is already busy)."));
- }
- return;
- }
- fAppStatus=UIBusy;
- fConfigureKPilotDialogInUse = true;
-
- if (runWizard(getDaemon(),this) == OK)
- {
- componentUpdate();
- }
-
- fConfigureKPilotDialogInUse = false;
- fAppStatus=Normal;
-}
-
-/* virtual DCOP */ ASYNC KPilotInstaller::configure()
-{
- FUNCTIONSETUP;
-
- if ( fAppStatus!=Normal || fConfigureKPilotDialogInUse )
- {
- if (fLogWidget)
- {
- fLogWidget->addMessage(i18n("Cannot configure KPilot right now (KPilot's UI is already busy)."));
- }
- return;
- }
- fAppStatus=UIBusy;
- fConfigureKPilotDialogInUse = true;
- if (runConfigure(getDaemon(),this))
- {
- componentUpdate();
- }
-
- fConfigureKPilotDialogInUse = false;
- fAppStatus=Normal;
-}
-
-
-/* static */ const char *KPilotInstaller::version(int kind)
-{
- FUNCTIONSETUP;
- // I don't think the program title needs to be translated. (ADE)
- //
- //
- if (kind)
- {
- return "kpilot.cc";
- }
- else
- {
- return "KPilot v" KPILOT_VERSION;
- }
-}
-
-// Command line options descriptions.
-//
-//
-//
-//
-static KCmdLineOptions kpilotoptions[] = {
- {"s", 0, 0},
- {"setup",
- I18N_NOOP("Setup the Pilot device, conduits and other parameters"),
- 0L},
- {"debug <level>", I18N_NOOP("Set debugging level"), "0"},
- KCmdLineLastOption
-};
-
-
-
-
-// "Regular" mode == 0
-// setup mode == 's'
-//
-// This is only changed by the --setup flag --
-// kpilot still does a setup the first time it is run.
-//
-//
-KPilotConfig::RunMode run_mode = KPilotConfig::Normal;
-
-
-
-int main(int argc, char **argv)
-{
- FUNCTIONSETUP;
-
- KAboutData about("kpilot", I18N_NOOP("KPilot"),
- KPILOT_VERSION,
- "KPilot - HotSync software for KDE\n\n",
- KAboutData::License_GPL,
- "(c) 1998-2000,2001, Dan Pilone (c) 2000-2006, Adriaan de Groot",
- 0L,
- "http://www.kpilot.org/"
- );
- about.addAuthor("Dan Pilone",
- I18N_NOOP("Project Leader"),
- "pilone@slac.com" );
- about.addAuthor("Adriaan de Groot",
- I18N_NOOP("Maintainer"),
- "groot@kde.org", "http://www.kpilot.org/");
- about.addAuthor("Reinhold Kainhofer",
- I18N_NOOP("Core and conduits developer"), "reinhold@kainhofer.com", "http://reinhold.kainhofer.com/Linux/");
- about.addAuthor("Jason 'vanRijn' Kasper",
- I18N_NOOP("Core and conduits developer"),
- "vR@movingparts.net", "http://movingparts.net/");
- about.addCredit("Preston Brown", I18N_NOOP("VCal conduit"));
- about.addCredit("Greg Stern", I18N_NOOP("Abbrowser conduit"));
- about.addCredit("Chris Molnar", I18N_NOOP("Expenses conduit"));
- about.addCredit("Jörn Ahrens", I18N_NOOP("Notepad conduit, Bugfixer"));
- about.addCredit("Heiko Purnhagen", I18N_NOOP("Bugfixer"));
- about.addCredit("Jörg Habenicht", I18N_NOOP("Bugfixer"));
- about.addCredit("Martin Junius",
- I18N_NOOP("XML GUI"),
- "mj@m-j-s.net", "http://www.m-j-s.net/kde/");
- about.addCredit("David Bishop",
- I18N_NOOP(".ui files"));
- about.addCredit("Aaron J. Seigo",
- I18N_NOOP("Bugfixer, coolness"));
- about.addCredit("Bertjan Broeksema",
- I18N_NOOP("VCalconduit state machine, CMake"));
-
- KCmdLineArgs::init(argc, argv, &about);
- KCmdLineArgs::addCmdLineOptions(kpilotoptions, "kpilot");
- KUniqueApplication::addCmdLineOptions();
- KCmdLineArgs *p = KCmdLineArgs::parsedArgs();
-
-#ifdef DEBUG
- KPilotConfig::getDebugLevel(p);
-#endif
-
-
- if (!KUniqueApplication::start())
- {
- return 0;
- }
- KUniqueApplication a(true, true);
-
-
- if (p->isSet("setup"))
- {
- run_mode = KPilotConfig::ConfigureKPilot;
- }
- else if (KPilotSettings::configVersion() < KPilotConfig::ConfigurationVersion)
- {
- WARNINGKPILOT << "KPilot configuration version "
- << KPilotConfig::ConfigurationVersion
- << " newer than stored version "
- << KPilotSettings::configVersion() << endl;
- // Only force a reconfigure and continue if the
- // user is expecting normal startup. Otherwise,
- // do the configuration they're explicitly asking for.
- run_mode = KPilotConfig::interactiveUpdate();
- if (run_mode == KPilotConfig::Cancel) return 1;
- }
-
-
- if ( (run_mode == KPilotConfig::ConfigureKPilot) ||
- (run_mode == KPilotConfig::ConfigureAndContinue) ||
- (run_mode == KPilotConfig::WizardAndContinue) )
- {
- DEBUGKPILOT << fname
- << ": Running setup first."
- << " (mode " << run_mode << ")" << endl;
- PilotDaemonDCOP_stub *daemon = new PilotDaemonDCOP_stub("kpilotDaemon","KPilotDaemonIface");
- bool r = false;
- if (run_mode == KPilotConfig::WizardAndContinue)
- {
- r = ( runWizard(*daemon,0L) == OK );
- }
- else
- {
- r = runConfigure(*daemon,0L);
- }
- delete daemon;
- if (!r) return 1;
- // User expected configure only.
- if (run_mode == KPilotConfig::ConfigureKPilot)
- {
- return 0;
- }
- }
-
- if (KPilotSettings::configVersion() < KPilotConfig::ConfigurationVersion)
- {
- WARNINGKPILOT << "Still not configured for use." << endl;
- KPilotConfig::sorryVersionOutdated( KPilotSettings::configVersion());
- return 1;
- }
-
-
- KPilotInstaller *tp = new KPilotInstaller();
-
- if (tp->status() == KPilotInstaller::Error)
- {
- KPILOT_DELETE(tp);
- return 1;
- }
-
- TQTimer::singleShot(0,tp,TQT_SLOT(startDaemonIfNeeded()));
-
- KGlobal::dirs()->addResourceType("pilotdbs",
- CSL1("share/apps/kpilot/DBBackup"));
- tp->show();
- a.setMainWidget(tp);
- return a.exec();
-}
-
-
diff --git a/kpilot/kpilot/kpilot.desktop b/kpilot/kpilot/kpilot.desktop
deleted file mode 100644
index 8d1a0ea9..00000000
--- a/kpilot/kpilot/kpilot.desktop
+++ /dev/null
@@ -1,86 +0,0 @@
-# KDE Config File
-[Desktop Entry]
-Name=KPilot
-Name[af]=Kpilot
-Name[eo]=Palm-Piloto
-Name[fr]=Palm Pilot
-Name[hi]=के-पायलट
-Name[lv]=KPilots
-Name[mk]=КПилот
-Name[ne]=केडीई पाइलट
-Name[pt_BR]=Ferramenta para PalmPilot
-Name[sv]=Kpilot
-Name[ta]=கேபைலட்
-Name[ven]=Mufhufhisi wa K
-Name[zu]=KUmshayeli webhanoyi
-GenericName=PalmPilot Tool
-GenericName[af]=Palmpilot Program
-GenericName[be]=Інструмэнт Palm Pilot
-GenericName[bg]=Връзка с PalmPilot
-GenericName[br]=Ostilh PalmPilot
-GenericName[bs]=Alati za PalmPilot
-GenericName[ca]=Eina PalmPilot
-GenericName[cs]=Nástroj pro PalmPilot
-GenericName[cy]=Erfyn PalmPilot
-GenericName[da]=Palm Pilot-værktøj
-GenericName[de]=Palm Pilot-Dienstprogramm
-GenericName[el]=Εργαλείο PalmPilot
-GenericName[eo]=Ilo por Palmpiloto
-GenericName[es]=Herramienta para Palm Pilot
-GenericName[et]=PalmPiloti rakendus
-GenericName[eu]=PalmPilot tresna
-GenericName[fa]=ابزار PalmPilot
-GenericName[fi]=Palm Pilot -työkalu
-GenericName[fr]=Outil pour le Palm Pilot
-GenericName[fy]=Palm Pilot-syngronisaasje
-GenericName[ga]=Uirlis PalmPilot
-GenericName[gl]=Ferramenta de PalmPilot
-GenericName[he]=כלי פאלם-פיילוט
-GenericName[hi]=पाम-पायलट औज़ार
-GenericName[hr]=Alat za Palm Pilota
-GenericName[hu]=PalmPilot-kezelő
-GenericName[is]=PalmPilot tól
-GenericName[it]=Strumento per PalmPilot
-GenericName[ja]=PalmPilot ツール
-GenericName[kk]=PalmPilot құрылғысы
-GenericName[km]=ឧបករណ៍ PalmPilot
-GenericName[lt]=PalmPilot įrankis
-GenericName[lv]=PalmPilota Rīks
-GenericName[mk]=Алатка за PalmPilot
-GenericName[ms]=Alat PalmPilot
-GenericName[mt]=Għodda għall-Palm Pilot
-GenericName[nb]=PalmPilot-verktøy
-GenericName[nds]=PalmPilot-Warktüüch
-GenericName[ne]=पाल्म पाइलट उपकरण
-GenericName[nl]=Palm Pilot-synchronisatie
-GenericName[nn]=Palm Pilot-verktøy
-GenericName[nso]=Sebereka sa PalmPilot
-GenericName[pl]=Palm Pilot
-GenericName[pt]=Ferramenta para o PalmPilot
-GenericName[pt_BR]=Ferramenta para o Palm Pilot
-GenericName[ro]=Utilitar PalmPilot
-GenericName[ru]=Синхронизация данных с Palm Pilot
-GenericName[sk]=Nástroj pre PalmPilot
-GenericName[sl]=Orodje za Palm Pilot
-GenericName[sr]=Алат за PalmPilot
-GenericName[sr@Latn]=Alat za PalmPilot
-GenericName[sv]=Verktyg för Palm Pilot
-GenericName[ta]=பாம் பைலட் கருவி
-GenericName[tg]=Синхронизатсияи маълумот аз PalmPilot
-GenericName[th]=เครื่องมือของเครื่องปาล์มไพล็อต
-GenericName[tr]=Palm Pilot Aracı
-GenericName[uk]=Засіб для PalmPilot
-GenericName[ven]=Tshishimuswa tsha mureili wa palm
-GenericName[vi]=Công cụ PalmPilot
-GenericName[xh]=Isixhobo se PalmPilot
-GenericName[zh_CN]=PalmPilot 工具
-GenericName[zh_TW]=PalmPilot 工具
-GenericName[zu]=Ithuluzi lesandla soMshayeli webhanoyi
-Exec=kpilot
-Icon=kpilot
-Type=Application
-DocPath=kpilot/index.html
-Terminal=false
-X-KDE-StartupNotify=true
-X-DCOP-ServiceType=Unique
-Categories=Qt;KDE;Utility;X-KDE-Utilities-Peripherals;Office;PDA;
diff --git a/kpilot/kpilot/kpilot.gif b/kpilot/kpilot/kpilot.gif
deleted file mode 100644
index 9cfe04ce..00000000
--- a/kpilot/kpilot/kpilot.gif
+++ /dev/null
Binary files differ
diff --git a/kpilot/kpilot/kpilot.h b/kpilot/kpilot/kpilot.h
deleted file mode 100644
index c0a0dca6..00000000
--- a/kpilot/kpilot/kpilot.h
+++ /dev/null
@@ -1,214 +0,0 @@
-#ifndef _KPILOT_KPILOT_H
-#define _KPILOT_KPILOT_H
-/* kpilot.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This is the main program in KPilot.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include <kmainwindow.h>
-
-
-class TQPopupMenu;
-class TQComboBox;
-class KAction;
-class KProgress;
-class KJanusWidget;
-
-class PilotDaemonDCOP_stub;
-class PilotComponent;
-class FileInstallWidget;
-class LogWidget;
-
-
-#include "kpilotDCOP.h"
-
-
-
-class KPilotInstaller : public KMainWindow, public KPilotDCOP
-{
-Q_OBJECT
-
-public:
- KPilotInstaller();
- KPilotInstaller(TQStrList& fileList);
- ~KPilotInstaller();
-
- /**
- * Return a string with the version identifier (ie.
- * "KPilot v3.1b11") if kind == 0; otherwise return
- * a "long" string about KPilot -- currently the
- * id of kpilot.o
- */
- static const char *version(int kind);
-
-
- // Adds 'name' to the pull down menu of components
- void addComponentPage(PilotComponent *, const TQString &name);
-
-
- KPilotStatus status() const { return fAppStatus; } ;
-
-
-protected:
- void closeEvent(TQCloseEvent *e);
- KJanusWidget *getManagingWidget() { return fManagingWidget; }
-
- /**
- * Provide access to the daemon's DCOP interface
- * through an object of the stub class.
- */
-protected:
- PilotDaemonDCOP_stub &getDaemon() { return *fDaemonStub; } ;
-private:
- PilotDaemonDCOP_stub *fDaemonStub;
-
- /**
- * Handle the functionality of kill-daemon-on-exit and
- * kill-daemon-if-started-by-my by killing it in those
- * cases.
- */
-protected:
- void killDaemonIfNeeded();
-
-public slots:
- /**
- * These are slots for the menu actions for each kind of
- * sync that can be requested.
- */
- void slotRestoreRequested();
- void slotBackupRequested();
- void slotHotSyncRequested();
- void slotFullSyncRequested();
- void slotHHtoPCRequested();
- void slotPCtoHHRequested();
-
- void startDaemonIfNeeded();
-
- /**
- * These are slots for the standard Configure ...
- * actions and not interesting. The show toolbar
- * functionality is in kdelibs starting with KDE 3.1,
- * but we need to remain backwards compatible.
- */
- void optionsConfigureKeys();
- void optionsConfigureToolbars();
-
-
-public:
- /**
- * This is the DCOP interface from the daemon to KPilot.
- */
- virtual ASYNC daemonStatus(int);
- virtual int kpilotStatus();
-
-public slots:
- /**
- * This is the DCOP interface from the daemon to KPilot
- * to configure KPilot.
- */
- virtual ASYNC configure();
- virtual ASYNC configureWizard();
-
-protected:
- void readConfig();
-
-
- /**
- * Run all the internal conduits' presync functions.
- */
- bool componentPreSync();
- void setupSync(int kind,const TQString& msg);
- void componentPostSync();
- /**
- * Run after a configuration change to force
- * the viewers to re-load data.
- */
- void componentUpdate();
-
- void initIcons();
- void initMenu();
- void setupWidget();
- void initComponents();
-
- /**
- * This is the private-d-pointer, KPilot style. Not everything
- * has moved there yet.
- */
- class KPilotPrivate;
- KPilotPrivate *fP;
-
-private:
- bool fQuitAfterCopyComplete; // Used for GUI-less interface
- KJanusWidget *fManagingWidget;
- bool fDaemonWasRunning;
-
- KPilotStatus fAppStatus;
-
- FileInstallWidget *fFileInstallWidget;
- LogWidget *fLogWidget;
-
- // Used to track if dialog is visible - needed for new DCOP calls
- bool fConfigureKPilotDialogInUse;
-
-
-protected slots:
- void quit();
- void fileInstalled(int which);
- void slotNewToolbarConfig();
-
- /**
- * Get the daemon to reset the link. This uses reloadSettings()
- * to achieve this result - the daemon calls reset() in there.
- */
- void slotResetLink();
-
- /**
- * Indicate that a particular component has been selected (through
- * whatever mechanism). This will make that component visible and
- * adjust any other user-visible state to indicate that that component
- * is now active.
- *
- * This should be called (possibly by the component itself!)
- * or activated through the signal mechanism.
- * */
- void slotSelectComponent( PilotComponent *c );
- void slotAboutToShowComponent( TQWidget *c );
-
- /**
- * Delayed initialization of the components.
- * This improves perceived startup time.
- */
- void initializeComponents();
-
-signals:
- void modeSelected(int selected);
-};
-
-
-
-
-#endif
diff --git a/kpilot/kpilot/kpilot.kcfg b/kpilot/kpilot/kpilot.kcfg
deleted file mode 100644
index 6b5ba723..00000000
--- a/kpilot/kpilot/kpilot.kcfg
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
- http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
- <include>kstandarddirs.h</include>
- <kcfgfile name="kpilotrc"/>
- <group name="General">
- <entry name="Debug" type="UInt">
- <label>
- </label>
- <default>0</default>
- </entry>
- <entry name="ConfigVersion" key="Configured" type="UInt">
- <label>
- </label>
- <default>0</default>
- </entry>
- <entry name="LastSyncTime" type="DateTime">
- <label>
- </label>
- <default>QDateTime()</default>
- </entry>
-
- <entry name="PilotDevice" type="String">
- <label>
- </label>
- <default>/dev/pilot</default>
- </entry>
- <entry name="PilotSpeed" type="UInt">
- <label>
- </label>
- <default>0</default>
- </entry>
- <entry name="Encoding" type="String">
- <label>
- </label>
- <default></default>
- </entry>
- <entry name="UserName" type="String">
- <label>
- </label>
- <default></default>
- </entry>
- <entry name="Workarounds" type="Enum">
- <choices>
- <choice name="eWorkaroundNone"/>
- <choice name="eWorkaroundUSB"/>
- </choices>
- <label></label>
- <default>eWorkaroundNone</default>
- </entry>
-
- <entry name="LogFileName" type="String">
- <label>
- </label>
- <default code="true">KGlobal::dirs()->saveLocation("data", "kpilot/").append("lastsync.log")</default>
- </entry>
- <entry name="StartDaemonAtLogin" type="Bool">
- <label>
- </label>
- <default>false</default>
- </entry>
- <entry name="KillDaemonAtExit" type="Bool">
- <label>
- </label>
- <default>false</default>
- </entry>
- <entry name="DockDaemon" type="Bool">
- <label>
- </label>
- <default>true</default>
- </entry>
- <entry name="QuitAfterSync" type="Bool">
- <label>
- </label>
- <default>false</default>
- </entry>
-
-
- <entry name="SyncType" type="UInt">
- <label>
- </label>
- <default>6</default>
- </entry>
- <entry name="FullSyncOnPCChange" type="Bool">
- <label>
- </label>
- <default>true</default>
- </entry>
- <entry name="ConflictResolution" type="UInt">
- <label>
- </label>
- <default>0</default>
- </entry>
-
-
-
- <entry name="InternalEditors" key="InternalEditorsWritable" type="Bool">
- <label>
- </label>
- <default>true</default>
- </entry>
- <entry name="ShowSecrets" type="Bool">
- <label>
- </label>
- <default>false</default>
- </entry>
- <entry name="SkipBackupDB" type="StringList">
- <label>Which databases not to backup.</label>
- <default>[Arng],[PmDB],[lnch],[a86k],FATFS,ImgFile-Foto,Jpeg-Foto,WifiCoreLib</default>
- </entry>
- <entry name="SkipRestoreDB" type="StringList">
- <label>
- </label>
- <default>[AvGo]</default>
- </entry>
- <entry name="BackupFrequency" type="UInt">
- <label></label>
- <default>0</default>
- </entry>
- <entry name="RunConduitsWithBackup" type="Bool">
- <label></label>
- <default>false</default>
- </entry>
- <entry name="DeviceDBs" type="StringList">
- <label>
- </label>
- <default></default>
- </entry>
- <entry name="AddedDBs" type="StringList">
- <label>
- </label>
- <default></default>
- </entry>
- <entry name="ScreenlockSecure" type="Bool">
- <label>Prevent HotSync when screen locked</label>
- <whatsthis>Turning this option on prevents syncing
- when the screen is locked. This is a security measure
- to prevent people from stealing your data through physical
- access to a Pilot device link to your machine.
- It doesn't work with screensavers other than KDE, though,
- so you will need to turn it off for other environments.</whatsthis>
- <default>true</default>
- </entry>
- </group>
-
- <group name="Conduit Names">
- <entry name="InstalledConduits" type="StringList">
- <label>
- </label>
- <default>abbrowser_conduit,internal_fileinstall,knotes-conduit,vcal-conduit,todo-conduit,mal_conduit,sysinfo_conduit</default>
- </entry>
- </group>
-
- <group name="Internal Editors">
- <entry name="AppBlockChangedDatabases" key="AppBlock Changed" type="StringList">
- <label>
- </label>
- </entry>
- <entry name="DirtyDatabases" key="Changed Databases" type="StringList">
- <label>
- </label>
- </entry>
- <entry name="FlagsChangedDatabases" key="Flags Changed" type="StringList">
- <label>
- </label>
- </entry>
- </group>
-
-
- <group name="Address Widget">
- <entry name="AddressDisplayMode" key="AddressDisplay" type="UInt">
- <label>
- </label>
- <default>0</default>
- </entry>
- <entry name="UseKeyField" type="Bool">
- <label>
- </label>
- <default>false</default>
- </entry>
- </group>
-
-
-</kcfg>
diff --git a/kpilot/kpilot/kpilot.magic b/kpilot/kpilot/kpilot.magic
deleted file mode 100644
index 4871f0f2..00000000
--- a/kpilot/kpilot/kpilot.magic
+++ /dev/null
@@ -1,12 +0,0 @@
-# start kpilot.magic
-# This must go at the end of $(kde_mimedir)/magic
-# PalmPilot Files
-0 string >\0
->0x20 beshort&0xffe7 0 palmpilot/database
->0x20 beshort&0xffe7 1
->>0x3c string appl palmpilot/application
->>0x3c string HACK palmpilot/hack
->>0x3c string libr palmpilot/library
->>0x3c string >\0 palmpilot/database
-# stop kpilot.magic
-
diff --git a/kpilot/kpilot/kpilot.upd b/kpilot/kpilot/kpilot.upd
deleted file mode 100644
index 1fbc36a6..00000000
--- a/kpilot/kpilot/kpilot.upd
+++ /dev/null
@@ -1,34 +0,0 @@
-Id=kdepim_3.3
-File=kpilotrc
-Group=<default>,General
-AllKeys
-# split up the kpilotrc into several config files, so the different processes
-# don't step on each other's toes
-Id=kdepim_3.3_SplitConfig
-File=kpilotrc,kpilot_addressconduitrc
-Group=Abbrowser-conduit,General
-AllKeys
-File=kpilotrc,kpilot_docconduitrc
-Group=DOC-conduit,General
-AllKeys
-File=kpilotrc,kpilot_notesconduitrc
-Group=KNotes-conduit,General
-AllKeys
-File=kpilotrc,kpilot_malconduitrc
-Group=MAL-conduit,General
-AllKeys
-File=kpilotDaemonrc,kpilot_malconduitrc
-Group=MAL-conduit,General
-AllKeys
-File=kpilotrc,kpilot_mailconduitrc
-Group=Popmail-conduit,General
-AllKeys
-File=kpilotrc,kpilot_sysinfoconduitrc
-Group=SysInfo-conduit,General
-AllKeys
-File=kpilotrc,kpilot_vcalconduitsrc
-Group=todoOptions,ToDo-Conduit
-AllKeys
-Group=vcalOptions,Calendar-Conduit
-AllKeys
-RemoveGroup=YAPS-conduit
diff --git a/kpilot/kpilot/kpilotConfig.cc b/kpilot/kpilot/kpilotConfig.cc
deleted file mode 100644
index 28589026..00000000
--- a/kpilot/kpilot/kpilotConfig.cc
+++ /dev/null
@@ -1,346 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This is all of KPilot's config-handling stuff.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <stdlib.h>
-
-#include <tqlineedit.h>
-#include <tqcombobox.h>
-#include <tqcheckbox.h>
-
-#include <kstandarddirs.h>
-#include <kconfig.h>
-#include <ksimpleconfig.h>
-#include <kcmdlineargs.h>
-#include <kmessagebox.h>
-#include <kglobalsettings.h>
-
-#include "kpilotSettings.h"
-#include "kpilotConfig.h"
-
-
-// This is a number indicating what configuration version
-// we're dealing with. Whenever new configuration options are
-// added that make it imperative for the user to take a
-// look at the configuration of KPilot (for example the
-// skipDB setting really needs user attention) we can change
-// (increase) this number.
-//
-//
-/* static */ const uint KPilotConfig::ConfigurationVersion = 443;
-
-/* static */ int KPilotConfig::getConfigVersion()
-{
- FUNCTIONSETUP;
-
- uint version = KPilotSettings::configVersion();
-
- if (version < ConfigurationVersion)
- {
- WARNINGKPILOT << "Config file has old version " << version << endl;
- }
- else
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Config file has version " << version << endl;
-#endif
- }
-
- return version;
-}
-
-/* static */ void KPilotConfig::updateConfigVersion()
-{
- FUNCTIONSETUP;
- KPilotSettings::setConfigVersion( ConfigurationVersion );
-}
-
-/* static */ TQString KPilotConfig::getDefaultDBPath()
-{
- FUNCTIONSETUP;
- TQString lastUser = KPilotSettings::userName();
- TQString dbsubpath = CSL1("kpilot/DBBackup/");
- TQString defaultDBPath = KGlobal::dirs()->
- saveLocation("data", dbsubpath + lastUser + CSL1("/"));
- return defaultDBPath;
-}
-
-/* static */ int KPilotConfig::getDebugLevel(KCmdLineArgs *p)
-{
- FUNCTIONSETUP;
-
- if (p)
- {
- if (p->isSet("debug"))
- {
- debug_level = p->getOption("debug").toInt();
- }
- }
-
- return debug_level;
-}
-
-static TQFont *thefont = 0L;
-
-/* static */ const TQFont & KPilotConfig::fixed()
-{
- FUNCTIONSETUP;
-
- if (!thefont)
- thefont = new TQFont(KGlobalSettings::fixedFont());
-
- return *thefont;
-}
-
-
-void KPilotConfig::addDirtyDatabase(TQString db)
-{
- FUNCTIONSETUP;
- TQStringList l(KPilotSettings::dirtyDatabases());
- if (!l.contains(db))
- {
- l.append(db);
- KPilotSettings::setDirtyDatabases(l);
- }
-}
-
-
-void KPilotConfig::addAppBlockChangedDatabase(TQString db)
-{
- TQStringList l(KPilotSettings::appBlockChangedDatabases());
- if (!l.contains(db))
- {
- l.append(db);
- KPilotSettings::setAppBlockChangedDatabases(l);
- }
-}
-
-void KPilotConfig::addFlagsChangedDatabase(TQString db)
-{
- TQStringList l(KPilotSettings::flagsChangedDatabases());
- if (!l.contains(db))
- {
- l.append(db);
- KPilotSettings::setFlagsChangedDatabases(l);
- }
-}
-
-
-
-
-/* static */ TQString KPilotConfig::versionDetails(int fileversion, bool run)
-{
- FUNCTIONSETUP;
- TQString s = CSL1("<qt><p>");
- s += i18n("The configuration file is outdated.");
- s += ' ';
- s += i18n("The configuration file has version %1, while KPilot "
- "needs version %2.").arg(fileversion).arg(ConfigurationVersion);
- if (run)
- {
- s += ' ';
- s += i18n("Please run KPilot and check the configuration carefully "
- "to update the file.");
- }
- s += CSL1("</p><p>");
- s += i18n("Important changes to watch for are:");
- s += ' ';
- if (fileversion < 440)
- {
- s += i18n("Renamed conduits, Kroupware and file installer have "
- "been made conduits as well.");
- s += ' ';
- s += i18n("Conflict resolution is now a global setting.");
- s += ' ';
- }
- if (fileversion < 443)
- {
- s += i18n("Changed format of no-backup databases.");
- s += ' ';
- }
- // Insert more recent additions here
-
-
- return s;
-}
-
-/* static */ void KPilotConfig::sorryVersionOutdated(int fileversion)
-{
- FUNCTIONSETUP;
- KMessageBox::detailedSorry(0L,
- i18n("The configuration file for KPilot is out-of "
- "date. Please run KPilot to update it."),
- KPilotConfig::versionDetails(fileversion,true),
- i18n("Configuration File Out-of Date"));
-}
-
-static void update440()
-{
- // Try to update conduit list
- {
- TQStringList conduits( KPilotSettings::installedConduits() );
- KConfig*c = KPilotSettings::self()->config();
-/// c->resetGroup();
- c->setGroup( TQString::null );
- bool installFiles = c->readBoolEntry("SyncFiles",true);
- if (installFiles) conduits.append( CSL1("internal_fileinstall") );
- c->deleteEntry("SyncFiles");
- KPilotSettings::setInstalledConduits(conduits);
- c->sync();
- if (installFiles)
- KMessageBox::information(0L,
- i18n("The settings for the file installer have been moved to the "
- "conduits configuration. Check the installed "
- "conduits list."),
- i18n("Settings Updated"));
-
- }
-
- // Check if individual conduits have conflict settings?
-
- // Search for old conduit libraries.
- {
- TQStringList foundlibs ;
- static const char *oldconduits[] = { "null", "address", "doc",
- "knotes", "sysinfo", "time", "todo", "vcal", 0L } ;
- const char **s = oldconduits;
- while (*s)
- {
- TQString libname = CSL1("kde3/lib%1conduit.so").arg(TQString::fromLatin1(*s));
- TQString foundlib = ::locate("lib",libname);
- if (!foundlib.isEmpty())
- {
- foundlibs.append(foundlib);
- }
- s++;
- }
-
- if (!foundlibs.isEmpty())
- KMessageBox::informationList(0L,
- i18n("<qt>The following old conduits were found on "
- "your system. It is a good idea to remove "
- "them and the associated <tt>.la</tt> "
- "and <tt>.so.0</tt> files.</qt>"),
- foundlibs,
- i18n("Old Conduits Found"));
- }
-}
-
-static void update443()
-{
- FUNCTIONSETUP;
-
- TQStringList skip = KPilotSettings::skipBackupDB();
- TQStringList fixSkip;
- bool fixedSome = false;
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Skip databases are: "
- << skip.join(CSL1(",")) << endl;
-#endif
-
- for (TQStringList::const_iterator i = skip.begin(); i!=skip.end(); ++i)
- {
- if ((*i).length()==4)
- {
- fixSkip.append(CSL1("[%1]").arg(*i));
- fixedSome = true;
- }
- else
- {
- fixSkip.append(*i);
- }
- }
-
- if (fixedSome)
- {
- KMessageBox::informationList(0L,
- i18n("<qt>The no backup databases listed in your configuration file "
- "have been adjusted to the new format. Database creator IDs "
- "have been changed to use square brackets []."),
- fixSkip,
- i18n("No Backup Databases Updated"));
- }
-}
-
-/* static */ KPilotConfig::RunMode KPilotConfig::interactiveUpdate()
-{
- FUNCTIONSETUP;
-
- int res = 0;
- unsigned int fileVersion = KPilotSettings::configVersion();
- // FIXME better config handling -> Move the config entries using kconf_update
-
- // It's OK if we're already at the required level.
- if (fileVersion >= KPilotConfig::ConfigurationVersion)
- {
- return Normal;
- }
-
- if (0 == fileVersion) // No config file at all
- {
- res = KMessageBox::questionYesNoCancel(0L,
- i18n("KPilot is not configured for use. You may use "
- "the configuration wizard or the normal configure dialog "
- "to configure KPilot."),
- i18n("Not Configured"),
- i18n("Use &Wizard"),
- i18n("Use &Dialog"));
- if (res == KMessageBox::Yes) return WizardAndContinue;
- if (res == KMessageBox::No) return ConfigureAndContinue;
-
- return Cancel;
- }
-
- res = KMessageBox::warningContinueCancel(0L,
- i18n("The configuration file for KPilot is out-of "
- "date. KPilot can update some parts of the "
- "configuration automatically. Do you wish to "
- "continue?"),
- i18n("Configuration File Out-of Date"));
- if (res!=KMessageBox::Continue) return Cancel;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Updating from "
- << fileVersion << " to " << ConfigurationVersion << endl;
-#endif
-
- if (fileVersion < 440) update440();
- if (fileVersion < 443) update443();
-
- KPilotConfig::updateConfigVersion();
- KPilotSettings::writeConfig();
- return ConfigureAndContinue;
-}
-
-void KPilotConfig::sync()
-{
- KPilotSettings::self()->config()->sync();
-}
diff --git a/kpilot/kpilot/kpilotConfig.h b/kpilot/kpilot/kpilotConfig.h
deleted file mode 100644
index bc15c0ac..00000000
--- a/kpilot/kpilot/kpilotConfig.h
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifndef _KPILOT_KPILOTCONFIG_H
-#define _KPILOT_KPILOTCONFIG_H
-/* kpilotConfig.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This class concentrates all the configuration
-** information for the various parts of KPilot.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include "kpilotSettings.h"
-
-class KCmdLineArgs;
-
-
-class KPilotConfig
-{
-public:
- typedef enum
- {
- Cancel=0,
- Normal,
- ConfigureKPilot,
- ConfigureConduits,
- ConfigureAndContinue,
- WizardAndContinue
- } RunMode;
-
- /**
- * @return TQString of default path for the BackupDB files
- * are located
- */
- static TQString getDefaultDBPath();
-
-
- // Conduit configuration information
- static void addDirtyDatabase(TQString db);
- static void addAppBlockChangedDatabase(TQString db);
- static void addFlagsChangedDatabase(TQString db);
-
- /**
- * This number can be changed every time a new
- * KPilot version is released that absolutely requires
- * the user to take a look at the configuration of
- * KPilot.
- */
- static const uint ConfigurationVersion;
-
- /**
- * Reads the configuration version from a configuration file.
- * TODO: Make this use the *standard* location.
- */
- static int getConfigVersion();
-
- /**
- * Write the current configuration version to the standard
- * location. @em Only call this after the KApplication object
- * is created, or crashes will result.
- */
- static void updateConfigVersion();
-
- /**
- * Warn the user that the config file is outdated.
- * versionDetails() returns a descriptive string. Pass in the
- * actual version of the config file. Set @p run to true to add an
- * admonition to run kpilot in config mode to fix this.
- * sorryVersionOutdated() uses KMessageBox to display it.
- */
- static TQString versionDetails(int fileversion, bool run);
- static void sorryVersionOutdated(int fileversion);
- /**
- * Update the config file as best we can, and inform the user.
- * Returns a suggested run mode if it's ok (ie. update finished, or
- * file was already up-to-date) and Cancel if the user cancels.
- * If the user cancels, it's probably best to _not_ continue with
- * anything, since the config is bogus.
- *
- * The suggested run mode might be anything - usually normal,
- * but might return ConfigureAndContinue as well.
- *
- * This function can call functions to update from different versions
- * to current; these are static in kpilotConfig.cc.
- */
- static RunMode interactiveUpdate();
-
- /**
- * Deal with --debug options.
- * @ret resulting debug level
- */
- static int getDebugLevel(KCmdLineArgs *p);
-
- /**
- * Returns the user's preference for the system-wide
- * fixed font.
- */
- static const TQFont& fixed() ;
-
- static void sync();
-} ;
-
-
-
-#endif
diff --git a/kpilot/kpilot/kpilotConfigDialog.cc b/kpilot/kpilot/kpilotConfigDialog.cc
deleted file mode 100644
index 34cf8247..00000000
--- a/kpilot/kpilot/kpilotConfigDialog.cc
+++ /dev/null
@@ -1,528 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2002-2004 by Adriaan de Groot
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a specialization of KPilotDeviceLink
-** that can actually handle some HotSync tasks, like backup
-** and restore. It does NOT do conduit stuff.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <pi-version.h>
-
-#include <tqcombobox.h>
-#include <tqcheckbox.h>
-#include <tqradiobutton.h>
-#include <tqpushbutton.h>
-#include <tqbuttongroup.h>
-#include <tqlineedit.h>
-#include <tqtabwidget.h>
-#include <tqspinbox.h>
-#include <tqfile.h>
-
-#include <kmessagebox.h>
-#include <kcharsets.h>
-#include <kstandarddirs.h>
-#include <kglobal.h>
-#include <kurl.h>
-#include <kio/netaccess.h>
-
-#include "kpilotConfig.h"
-#include "kpilotSettings.h"
-
-#include "kpilotConfigDialog_device.h"
-#include "kpilotConfigDialog_sync.h"
-#include "kpilotConfigDialog_startup.h"
-#include "kpilotConfigDialog_viewers.h"
-#include "kpilotConfigDialog_backup.h"
-#include "kpilotConfigDialog.moc"
-#include "syncAction.h"
-#include "dbSelectionDialog.h"
-
-/* virtual */ TQString ConfigPage::maybeSaveText() const
-{
- return i18n("<qt>The settings for configuration page <i>%1</i> have been changed. Do you "
- "want to save the changes before continuing?</qt>").arg(this->conduitName());
-}
-
-DeviceConfigPage::DeviceConfigPage(TQWidget * w, const char *n ) : ConfigPage( w, n )
-{
- FUNCTIONSETUP;
-
- fConfigWidget = new DeviceConfigWidget( w );
- // Fill the encodings list
- {
- TQStringList l = KGlobal::charsets()->descriptiveEncodingNames();
- for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it )
- {
- fConfigWidget->fPilotEncoding->insertItem(*it);
- }
- }
-
- fConfigWidget->resize(fConfigWidget->size());
- fWidget = fConfigWidget;
-
-#if PILOT_LINK_NUMBER < PILOT_LINK_0_10_0
- fConfigWidget->fPilotDevice->setMaxLength(13);
-#endif
-
-
-#define CM(a,b) connect(fConfigWidget->a,b,this,TQT_SLOT(modified()));
- CM(fPilotDevice, TQT_SIGNAL(textChanged(const TQString &)));
- CM(fPilotSpeed, TQT_SIGNAL(activated(int)));
- CM(fPilotEncoding, TQT_SIGNAL(textChanged(const TQString &)));
- CM(fUserName, TQT_SIGNAL(textChanged(const TQString &)));
- CM(fWorkaround, TQT_SIGNAL(activated(int)));
-#undef CM
-
- fConduitName = i18n("Device");
-}
-
-void DeviceConfigPage::load()
-{
- FUNCTIONSETUP;
- KPilotSettings::self()->readConfig();
-
- /* General tab in the setup dialog */
- fConfigWidget->fPilotDevice->setText(KPilotSettings::pilotDevice());
- fConfigWidget->fPilotSpeed->setCurrentItem(KPilotSettings::pilotSpeed());
- getEncoding();
- fConfigWidget->fUserName->setText(KPilotSettings::userName());
-
- switch(KPilotSettings::workarounds())
- {
- case KPilotSettings::eWorkaroundNone :
- fConfigWidget->fWorkaround->setCurrentItem(0);
- break;
- case KPilotSettings::eWorkaroundUSB :
- fConfigWidget->fWorkaround->setCurrentItem(1);
- break;
- default:
- WARNINGKPILOT << "Unknown workaround number "
- << (int) KPilotSettings::workarounds()
- << endl;
- KPilotSettings::setWorkarounds(KPilotSettings::eWorkaroundNone);
- fConfigWidget->fWorkaround->setCurrentItem(0);
- }
- unmodified();
-}
-
-/* virtual */ bool DeviceConfigPage::validate()
-{
- int r = KMessageBox::Yes;
-
-#if PILOT_LINK_NUMBER < PILOT_LINK_0_10_0
- TQString d = fConfigWidget->fPilotDevice->text();
-
- if (d.length() > 13)
- {
- r = KMessageBox::questionYesNo(
- fConfigWidget,
- i18n("<qt>The device name you entered (<i>%1</i>) "
- "is longer than 13 characters. This is "
- "probably unsupported and can cause problems. "
- "Are you sure you want to use this device name?</qt>")
- .arg(d),
- i18n("Device Name too Long"), i18n("Use"), i18n("Do Not Use")
- ) ;
- }
-#endif
-
- return KMessageBox::Yes == r;
-}
-
-/* virtual */ void DeviceConfigPage::commit()
-{
- FUNCTIONSETUP;
-
- // General page
- KPilotSettings::setPilotDevice(fConfigWidget->fPilotDevice->text());
- KPilotSettings::setPilotSpeed(fConfigWidget->fPilotSpeed->currentItem());
- setEncoding();
- KPilotSettings::setUserName(fConfigWidget->fUserName->text());
-
- switch(fConfigWidget->fWorkaround->currentItem())
- {
- case 0 : KPilotSettings::setWorkarounds(KPilotSettings::eWorkaroundNone); break;
- case 1 : KPilotSettings::setWorkarounds(KPilotSettings::eWorkaroundUSB); break;
- default :
- WARNINGKPILOT << "Unknown workaround number "
- << fConfigWidget->fWorkaround->currentItem()
- << endl;
- KPilotSettings::setWorkarounds(KPilotSettings::eWorkaroundNone);
-
- }
- KPilotConfig::updateConfigVersion();
- KPilotSettings::self()->writeConfig();
- unmodified();
-}
-
-/* slot */ void DeviceConfigPage::changePortType(int i)
-{
- FUNCTIONSETUP;
-
- switch (i)
- {
- case 0:
- fConfigWidget->fPilotSpeed->setEnabled(true);
- break;
- case 1:
- case 2:
- fConfigWidget->fPilotSpeed->setEnabled(false);
- break;
- default:
- WARNINGKPILOT << "Unknown port type " << i << endl;
- }
-}
-
-void DeviceConfigPage::getEncoding()
-{
- FUNCTIONSETUP;
- TQString e = KPilotSettings::encoding();
- if (e.isEmpty())
- fConfigWidget->fPilotEncoding->setCurrentText(CSL1("ISO8859-15"));
- else
- fConfigWidget->fPilotEncoding->setCurrentText(e);
-}
-
-void DeviceConfigPage::setEncoding()
-{
- FUNCTIONSETUP;
-
- TQString enc = fConfigWidget->fPilotEncoding->currentText();
- if (enc.isEmpty())
- {
- WARNINGKPILOT << "Empty encoding. Will ignore it." << endl;
- }
- else
- {
- KPilotSettings::setEncoding(enc);
- }
-}
-
-SyncConfigPage::SyncConfigPage(TQWidget * w, const char *n ) : ConfigPage( w, n )
-{
- FUNCTIONSETUP;
-
- fConfigWidget = new SyncConfigWidget( w );
- fConfigWidget->resize(fConfigWidget->size());
- fWidget = fConfigWidget;
-
-#define CM(a,b) connect(fConfigWidget->a,b,this,TQT_SLOT(modified()));
- CM(fSpecialSync, TQT_SIGNAL(activated(int)));
- CM(fFullSyncCheck, TQT_SIGNAL(toggled(bool)));
- CM(fScreenlockSecure, TQT_SIGNAL(toggled(bool)));
- CM(fConflictResolution, TQT_SIGNAL(activated(int)));
-#undef CM
-
- fConduitName = i18n("HotSync");
-}
-
-#define MENU_ITEM_COUNT (4)
-static SyncAction::SyncMode::Mode syncTypeMap[MENU_ITEM_COUNT] = {
- SyncAction::SyncMode::eHotSync,
- SyncAction::SyncMode::eFullSync,
- SyncAction::SyncMode::eCopyPCToHH,
- SyncAction::SyncMode::eCopyHHToPC
- } ;
-
-void SyncConfigPage::load()
-{
- FUNCTIONSETUP;
- KPilotSettings::self()->readConfig();
-
- /* Sync tab */
- int synctype=KPilotSettings::syncType();
- if (synctype<0) synctype=(int) SyncAction::SyncMode::eHotSync;
- for (unsigned int i=0; i<MENU_ITEM_COUNT; ++i)
- {
- if (syncTypeMap[i] == synctype)
- {
- fConfigWidget->fSpecialSync->setCurrentItem(i);
- synctype=-1;
- break;
- }
- }
- if (synctype != -1)
- {
- fConfigWidget->fSpecialSync->setCurrentItem(0); /* HotSync */
- }
-
- fConfigWidget->fFullSyncCheck->setChecked(KPilotSettings::fullSyncOnPCChange());
- fConfigWidget->fConflictResolution->setCurrentItem(KPilotSettings::conflictResolution());
- fConfigWidget->fScreenlockSecure->setChecked(KPilotSettings::screenlockSecure());
-
- unmodified();
-}
-
-/* virtual */ void SyncConfigPage::commit()
-{
- FUNCTIONSETUP;
-
- /* Sync tab */
- int synctype = -1;
- unsigned int selectedsync = fConfigWidget->fSpecialSync->currentItem();
- if (selectedsync < MENU_ITEM_COUNT)
- {
- synctype = syncTypeMap[selectedsync];
- }
- if (synctype < 0)
- {
- synctype = SyncAction::SyncMode::eHotSync;
- }
-
- KPilotSettings::setSyncType(synctype);
- KPilotSettings::setFullSyncOnPCChange(fConfigWidget->fFullSyncCheck->isChecked());
- KPilotSettings::setConflictResolution(fConfigWidget->fConflictResolution->currentItem());
- KPilotSettings::setScreenlockSecure(fConfigWidget->fScreenlockSecure->isChecked());
-
- KPilotConfig::updateConfigVersion();
- KPilotSettings::self()->writeConfig();
- unmodified();
-}
-
-
-BackupConfigPage::BackupConfigPage(TQWidget * w, const char *n ) : ConfigPage( w, n )
-{
- FUNCTIONSETUP;
-
- fConfigWidget = new BackupConfigWidget( w );
- fConfigWidget->resize(fConfigWidget->size());
- fWidget = fConfigWidget;
-
- connect(fConfigWidget->fBackupOnlyChooser, TQT_SIGNAL( clicked() ),
- TQT_SLOT( slotSelectNoBackupDBs() ) );
- connect(fConfigWidget->fSkipDBChooser, TQT_SIGNAL(clicked()),
- TQT_SLOT(slotSelectNoRestoreDBs()));
-
-#define CM(a,b) connect(fConfigWidget->a,b,this,TQT_SLOT(modified()));
- CM(fBackupOnly, TQT_SIGNAL(textChanged(const TQString &)));
- CM(fSkipDB, TQT_SIGNAL(textChanged(const TQString &)));
- CM(fBackupFrequency, TQT_SIGNAL(activated(int)));
-#undef CM
-
- fConduitName = i18n("Backup");
-}
-
-void BackupConfigPage::load()
-{
- FUNCTIONSETUP;
- KPilotSettings::self()->readConfig();
-
- /* Backup tab */
- fConfigWidget->fBackupOnly->setText(KPilotSettings::skipBackupDB().join(CSL1(",")));
- fConfigWidget->fSkipDB->setText(KPilotSettings::skipRestoreDB().join(CSL1(",")));
- fConfigWidget->fRunConduitsWithBackup->setChecked(KPilotSettings::runConduitsWithBackup());
-
- int backupfreq=KPilotSettings::backupFrequency();
-
- fConfigWidget->fBackupFrequency->setCurrentItem(backupfreq);
-
- unmodified();
-}
-
-/* virtual */ void BackupConfigPage::commit()
-{
- FUNCTIONSETUP;
-
- /* Backup tab */
- KPilotSettings::setSkipBackupDB(
- TQStringList::split(CSL1(","),fConfigWidget->fBackupOnly->text()));
- KPilotSettings::setSkipRestoreDB(
- TQStringList::split(CSL1(","),fConfigWidget->fSkipDB->text()));
- KPilotSettings::setRunConduitsWithBackup(fConfigWidget->fRunConduitsWithBackup->isChecked());
- KPilotSettings::setBackupFrequency(fConfigWidget->fBackupFrequency->currentItem());
-
- KPilotConfig::updateConfigVersion();
- KPilotSettings::self()->writeConfig();
- unmodified();
-}
-
-void BackupConfigPage::slotSelectNoBackupDBs()
-{
- FUNCTIONSETUP;
-
- TQStringList selectedDBs(TQStringList::split(',', fConfigWidget->fBackupOnly->text() ));
-
- TQStringList deviceDBs=KPilotSettings::deviceDBs();
- TQStringList addedDBs=KPilotSettings::addedDBs();
- KPilotDBSelectionDialog*dlg=new KPilotDBSelectionDialog(selectedDBs, deviceDBs, addedDBs, 0, "NoBackupDBs");
- if (dlg && (dlg->exec()==TQDialog::Accepted) )
- {
- fConfigWidget->fBackupOnly->setText(
- dlg->getSelectedDBs().join(CSL1(",")));
- KPilotSettings::setAddedDBs( dlg->getAddedDBs() );
- }
- KPILOT_DELETE(dlg);
-}
-
-void BackupConfigPage::slotSelectNoRestoreDBs()
-{
- FUNCTIONSETUP;
-
- TQStringList selectedDBs(TQStringList::split(',', fConfigWidget->fSkipDB->text() ));
-
- TQStringList deviceDBs=KPilotSettings::deviceDBs();
- TQStringList addedDBs=KPilotSettings::addedDBs();
- KPilotDBSelectionDialog*dlg=new KPilotDBSelectionDialog(selectedDBs, deviceDBs, addedDBs, 0, "NoRestoreDBs");
- if (dlg && (dlg->exec()==TQDialog::Accepted) )
- {
- fConfigWidget->fSkipDB->setText(
- dlg->getSelectedDBs().join(CSL1(",")));
- KPilotSettings::setAddedDBs( dlg->getAddedDBs() );
- }
- KPILOT_DELETE(dlg);
-}
-
-
-
-ViewersConfigPage::ViewersConfigPage(TQWidget * w, const char *n ) : ConfigPage( w, n )
-{
- FUNCTIONSETUP;
-
- fConfigWidget = new ViewersConfigWidget( w );
- fConfigWidget->resize(fConfigWidget->size());
- fWidget = fConfigWidget;
-
-#define CM(a,b) connect(fConfigWidget->a,b,this,TQT_SLOT(modified()));
- CM(fInternalEditors, TQT_SIGNAL(toggled(bool)));
- CM(fUseSecret, TQT_SIGNAL(toggled(bool)));
- CM(fAddressGroup, TQT_SIGNAL(clicked(int)));
- CM(fUseKeyField, TQT_SIGNAL(toggled(bool)));
-#undef CM
-
- fConduitName = i18n("Viewers");
-}
-
-void ViewersConfigPage::load()
-{
- FUNCTIONSETUP;
- KPilotSettings::self()->readConfig();
-
- fConfigWidget->fInternalEditors->setChecked( false /* KPilotSettings::internalEditors() */ );
- fConfigWidget->fUseSecret->setChecked(KPilotSettings::showSecrets());
- fConfigWidget->fAddressGroup->setButton(KPilotSettings::addressDisplayMode());
- fConfigWidget->fUseKeyField->setChecked(KPilotSettings::useKeyField());
- unmodified();
-}
-
-/* virtual */ void ViewersConfigPage::commit()
-{
- FUNCTIONSETUP;
-
- KPilotSettings::setInternalEditors( fConfigWidget->fInternalEditors->isChecked());
- KPilotSettings::setShowSecrets(fConfigWidget->fUseSecret->isChecked());
- KPilotSettings::setAddressDisplayMode(fConfigWidget->fAddressGroup->id(
- fConfigWidget->fAddressGroup->selected()));
- KPilotSettings::setUseKeyField(fConfigWidget->fUseKeyField->isChecked());
- KPilotConfig::updateConfigVersion();
- KPilotSettings::self()->writeConfig();
- unmodified();
-}
-
-
-
-
-
-
-
-
-
-StartExitConfigPage::StartExitConfigPage(TQWidget * w, const char *n ) : ConfigPage( w, n )
-{
- FUNCTIONSETUP;
-
- fConfigWidget = new StartExitConfigWidget( w );
- fConfigWidget->resize(fConfigWidget->size());
- fWidget = fConfigWidget;
-
-#define CM(a,b) connect(fConfigWidget->a,b,this,TQT_SLOT(modified()));
- CM(fStartDaemonAtLogin, TQT_SIGNAL(toggled(bool)));
- CM(fKillDaemonOnExit, TQT_SIGNAL(toggled(bool)));
- CM(fDockDaemon, TQT_SIGNAL(toggled(bool)));
- CM(fQuitAfterSync, TQT_SIGNAL(toggled(bool)));
-#undef CM
-
- fConduitName = i18n("Startup and Exit");
-}
-
-void StartExitConfigPage::load()
-{
- FUNCTIONSETUP;
- KPilotSettings::self()->readConfig();
-
- fConfigWidget->fStartDaemonAtLogin->setChecked(KPilotSettings::startDaemonAtLogin());
- fConfigWidget->fDockDaemon->setChecked(KPilotSettings::dockDaemon());
- fConfigWidget->fKillDaemonOnExit->setChecked(KPilotSettings::killDaemonAtExit());
- fConfigWidget->fQuitAfterSync->setChecked(KPilotSettings::quitAfterSync());
- unmodified();
-}
-
-
-/* virtual */ void StartExitConfigPage::commit()
-{
- FUNCTIONSETUP;
-
- TQString autostart = KGlobalSettings::autostartPath();
- TQString desktopfile = CSL1("kpilotdaemon.desktop");
- TQString desktopcategory = CSL1("kde/");
- TQString location = KGlobal::dirs()->findResource("xdgdata-apps",desktopcategory + desktopfile);
- if (location.isEmpty()) // Fallback to KDE 3.0?
- {
- location = KGlobal::dirs()->findResource("apps",desktopfile);
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Autostart=" << autostart << endl;
- DEBUGKPILOT << fname << ": desktop=" << desktopfile << endl;
- DEBUGKPILOT << fname << ": location=" << location << endl;
-#endif
-
- KPilotSettings::setStartDaemonAtLogin(fConfigWidget->fStartDaemonAtLogin->isChecked());
- if (KPilotSettings::startDaemonAtLogin())
- {
- if (!location.isEmpty())
- {
- KURL src;
- src.setPath(location);
- KURL dst;
- dst.setPath(autostart+desktopfile);
- KIO::NetAccess::file_copy(src,dst,-1 /* 0666? */,true /* overwrite */);
- }
- }
- else
- {
- TQFile::remove(autostart+desktopfile);
- }
- KPilotSettings::setDockDaemon(fConfigWidget->fDockDaemon->isChecked());
- KPilotSettings::setKillDaemonAtExit(fConfigWidget->fKillDaemonOnExit->isChecked());
- KPilotSettings::setQuitAfterSync(fConfigWidget->fQuitAfterSync->isChecked());
- KPilotConfig::updateConfigVersion();
- KPilotSettings::self()->writeConfig();
- unmodified();
-}
-
diff --git a/kpilot/kpilot/kpilotConfigDialog.h b/kpilot/kpilot/kpilotConfigDialog.h
deleted file mode 100644
index 11960f8d..00000000
--- a/kpilot/kpilot/kpilotConfigDialog.h
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef _KPILOT_KPILOTCONFIGDIALOG_H
-#define _KPILOT_KPILOTCONFIGDIALOG_H
-/* kpilotConfigDialog.h KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a specialization of KPilotDeviceLink
-** that can actually handle some HotSync tasks, like backup
-** and restore. It does NOT do conduit stuff.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "plugin.h"
-
-
-// class KPilotConfigWidget;
-class StartExitConfigWidget;
-class SyncConfigWidget;
-class DeviceConfigWidget;
-class ViewersConfigWidget;
-class BackupConfigWidget;
-
-class ConfigPage : public ConduitConfigBase
-{
-public:
- ConfigPage( TQWidget *w, const char *n ) : ConduitConfigBase(w,n) { } ;
-protected:
- // Override base class virtual function.
- virtual TQString maybeSaveText() const;
-} ;
-
-class DeviceConfigPage : public ConfigPage
-{
-Q_OBJECT
-public:
- DeviceConfigPage( TQWidget *, const char * );
-
-protected:
- virtual bool validate();
- virtual void load();
- virtual void commit();
-
-protected slots:
- void changePortType(int);
-
-private:
- DeviceConfigWidget *fConfigWidget;
-
- // Read and write the values of Encoding
- // and EncodingDD.
- void getEncoding();
- void setEncoding();
-} ;
-
-
-class KDE_EXPORT SyncConfigPage : public ConfigPage
-{
-public:
- SyncConfigPage( TQWidget *, const char * );
-
-protected:
- virtual void load();
- virtual void commit();
-
-private:
- SyncConfigWidget *fConfigWidget;
-} ;
-
-class BackupConfigPage : public ConfigPage
-{
-Q_OBJECT
-public:
- BackupConfigPage( TQWidget *, const char * );
-
-protected:
- virtual void load();
- virtual void commit();
-
-protected slots:
- void slotSelectNoBackupDBs();
- void slotSelectNoRestoreDBs();
-
-private:
- BackupConfigWidget *fConfigWidget;
-} ;
-
-class StartExitConfigPage : public ConfigPage
-{
-public:
- StartExitConfigPage( TQWidget *, const char * );
-
-protected:
- virtual void load();
- virtual void commit();
-
-private:
- StartExitConfigWidget *fConfigWidget;
-} ;
-
-class ViewersConfigPage : public ConfigPage
-{
-public:
- ViewersConfigPage( TQWidget *, const char * );
-
-protected:
- virtual void load();
- virtual void commit();
-
-private:
- ViewersConfigWidget *fConfigWidget;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/kpilotConfigDialog_backup.ui b/kpilot/kpilot/kpilotConfigDialog_backup.ui
deleted file mode 100644
index 9591c6c5..00000000
--- a/kpilot/kpilot/kpilotConfigDialog_backup.ui
+++ /dev/null
@@ -1,207 +0,0 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>BackupConfigWidget</class>
-<comment>A widget for editing HotSync-specific settings.</comment>
-<author>David Bishop</author>
-<widget class="QWidget">
- <property name="name">
- <cstring>BackupConfigForm</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>549</width>
- <height>424</height>
- </rect>
- </property>
- <property name="caption">
- <string>KPilot Options</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QGroupBox">
- <property name="name">
- <cstring>GroupBox23_2</cstring>
- </property>
- <property name="title">
- <string>Backup Frequency</string>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>TextLabel5_2</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Do &amp;backup:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fBackupFrequency</cstring>
- </property>
- </widget>
- <widget class="QComboBox">
- <item>
- <property name="text">
- <string>On every HotSync</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>On request only</string>
- </property>
- </item>
- <property name="name">
- <cstring>fBackupFrequency</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="QGroupBox">
- <property name="name">
- <cstring>GroupBox23</cstring>
- </property>
- <property name="title">
- <string>Databases</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>TextLabel5</cstring>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>&amp;No backup:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fBackupOnly</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;&lt;p&gt;Enter the databases types you wish to exclude from the backup operation here. Use this setting if backing up some databases crashes the handheld, or if you do not want a backup of some databases (like AvantGo pages).&lt;/p&gt;&lt;p&gt;Entries with square brackets [] are &lt;i&gt;creator codes&lt;/i&gt; like &lt;tt&gt;[lnch]&lt;/tt&gt; and can exclude a whole range of databases. Entries without the brackets list database names, and may include shell-style wildcards, like &lt;tt&gt;*_a68k&lt;/tt&gt;.&lt;/p&gt;&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="0">
- <property name="name">
- <cstring>TextLabel6</cstring>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Not &amp;restored:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fSkipDB</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;&lt;p&gt;Enter the databases types you wish to exclude from the restore operation here (like AvantGo databases). They will be skipped even if they exist in the set of backup databases on the handheld. If you still want to install an ignored database to the handheld, you can always manually install it to the handheld.&lt;/p&gt;&lt;p&gt;Entries with square brackets [] are &lt;i&gt;creator codes&lt;/i&gt; like &lt;tt&gt;[lnch]&lt;/tt&gt; and can exclude a whole range of databases. Entries without the brackets list database names, and may include shell-style wildcards, like &lt;tt&gt;*_a68k&lt;/tt&gt;.&lt;/p&gt;&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLineEdit" row="0" column="1">
- <property name="name">
- <cstring>fBackupOnly</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;&lt;p&gt;Enter the databases types you wish to exclude from the backup operation here. Use this setting if backing up some databases crashes the handheld, or if you do not want a backup of some databases (like AvantGo pages).&lt;/p&gt;&lt;p&gt;Entries with square brackets [] are &lt;i&gt;creator codes&lt;/i&gt; like &lt;tt&gt;[lnch]&lt;/tt&gt; and can exclude a whole range of databases. Entries without the brackets list database names, and may include shell-style wildcards, like &lt;tt&gt;*_a68k&lt;/tt&gt;.&lt;/p&gt;&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLineEdit" row="1" column="1">
- <property name="name">
- <cstring>fSkipDB</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;&lt;p&gt;Enter the databases types you wish to exclude from the restore operation here (like AvantGo databases). They will be skipped even if they exist in the set of backup databases on the handheld. If you still want to install an ignored database to the handheld, you can always manually install it to the handheld.&lt;/p&gt;&lt;p&gt;Entries with square brackets [] are &lt;i&gt;creator codes&lt;/i&gt; like &lt;tt&gt;[lnch]&lt;/tt&gt; and can exclude a whole range of databases. Entries without the brackets list database names, and may include shell-style wildcards, like &lt;tt&gt;*_a68k&lt;/tt&gt;.&lt;/p&gt;&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QPushButton" row="0" column="2">
- <property name="name">
- <cstring>fBackupOnlyChooser</cstring>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Click here to open the database selection dialog. This dialog allows you to check the databases you want to exclude from the backup from a list.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QPushButton" row="1" column="2">
- <property name="name">
- <cstring>fSkipDBChooser</cstring>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Click here to open the database selection dialog. This dialog allows you to select the databases you want to exclude from the restore operation from a list.&lt;/qt&gt;</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>fRunConduitsWithBackup</cstring>
- </property>
- <property name="text">
- <string>Run conduits durin&amp;g a backup sync</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to run the selected conduits before every backup. This makes sure the backup is up to date with the last changes from your PC.&lt;/qt&gt;</string>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer8</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>41</height>
- </size>
- </property>
- </spacer>
- </vbox>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/kpilot/kpilot/kpilotConfigDialog_device.ui b/kpilot/kpilot/kpilotConfigDialog_device.ui
deleted file mode 100644
index 20f840e8..00000000
--- a/kpilot/kpilot/kpilotConfigDialog_device.ui
+++ /dev/null
@@ -1,189 +0,0 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>DeviceConfigWidget</class>
-<comment>A widget for configuring the hardware device.</comment>
-<author>David Bishop</author>
-<widget class="QWidget">
- <property name="name">
- <cstring>DeviceForm</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>383</width>
- <height>334</height>
- </rect>
- </property>
- <property name="caption">
- <string>KPilot Options</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>TextLabel1</cstring>
- </property>
- <property name="text">
- <string>Pilot &amp;device:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fPilotDevice</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Enter the device the Pilot is attached to (for instance a serial or USB port) here. You can also use &lt;i&gt;/dev/pilot&lt;/i&gt;, and make that a symlink to the correct device. You need write permission to successfully synchronize with the handheld.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLineEdit" row="0" column="1" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fPilotDevice</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Enter the device the Pilot is attached to (for instance a serial or USB port) here. You can also use &lt;i&gt;/dev/pilot&lt;/i&gt;, and make that a symlink to the correct device. You need write permission to successfully synchronize with the handheld.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="0">
- <property name="name">
- <cstring>TextLabel4</cstring>
- </property>
- <property name="text">
- <string>&amp;Speed:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fPilotSpeed</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Select the speed of the serial connection to your handheld here. This has no meaning for USB devices. For an older model, choose 9600. Newer models may be able to handle speeds up to the maximum listed, 115200. You can experiment with the connection speed: the manual suggests starting at a speed of 19200 and trying faster speeds to see if they work.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLineEdit" row="4" column="1" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fUserName</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Enter your name here, as it appears in the Pilot's &amp;quot;Owner&amp;quot; setting.&lt;/qt&gt;</string>
- </property>
- </widget>
- <spacer row="5" column="2">
- <property name="name">
- <cstring>spacer1</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>90</height>
- </size>
- </property>
- </spacer>
- <widget class="QComboBox" row="1" column="1">
- <item>
- <property name="text">
- <string>9600</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>19200</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>38400</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>57600</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>115200</string>
- </property>
- </item>
- <property name="name">
- <cstring>fPilotSpeed</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Select the speed of the serial connection to your handheld here. This has no meaning for USB devices. For an older model, choose 9600. Newer models may be able to handle speeds up to the maximum listed, 115200. You can experiment with the connection speed: the manual suggests starting at a speed of 19200 and trying faster speeds to see if they work.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLabel" row="3" column="0">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="text">
- <string>En&amp;coding:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fPilotEncoding</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;PalmOS devices are available in many different languages. If your device uses a different encoding than ISO-latin1 (ISO8859-1), select the correct encoding here, in order to display special characters correctly.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLabel" row="4" column="0">
- <property name="name">
- <cstring>TextLabel2</cstring>
- </property>
- <property name="text">
- <string>Pilot &amp;user:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fUserName</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Enter your name here, as it appears in the Pilot's &amp;quot;Owner&amp;quot; setting.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QComboBox" row="3" column="1" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fPilotEncoding</cstring>
- </property>
- <property name="editable">
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;PalmOS devices are available in many different languages. If your device uses a different encoding than ISO-latin1 (ISO8859-1), select the correct encoding here, in order to display special characters correctly.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLabel" row="2" column="0">
- <property name="name">
- <cstring>textLabel1_2</cstring>
- </property>
- <property name="text">
- <string>&amp;Workarounds:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fWorkaround</cstring>
- </property>
- </widget>
- <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="2">
- <item>
- <property name="text">
- <string>None</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Zire 31, 72, Tungsten T5</string>
- </property>
- </item>
- <property name="name">
- <cstring>fWorkaround</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Workarounds enable special handling for specific devices. Most devices do not need special handling. However, the Zire&tm; 31, Zire 72 and Tungsten T5 &lt;i&gt;do&lt;/i&gt; have special needs, so if you are connecting such a device, please select the workaround for them.&lt;/qt&gt;</string>
- </property>
- </widget>
- </grid>
-</widget>
-<layoutdefaults spacing="6" margin="0"/>
-</UI>
diff --git a/kpilot/kpilot/kpilotConfigDialog_startup.ui b/kpilot/kpilot/kpilotConfigDialog_startup.ui
deleted file mode 100644
index 6445e6ea..00000000
--- a/kpilot/kpilot/kpilotConfigDialog_startup.ui
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>StartExitConfigWidget</class>
-<comment>A tabWidget for configuring
-KPilot's settings.</comment>
-<author>David Bishop</author>
-<widget class="QWidget">
- <property name="name">
- <cstring>StartExitForm</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>593</width>
- <height>323</height>
- </rect>
- </property>
- <property name="caption">
- <string>KPilot Options</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <widget class="QGroupBox" row="1" column="0">
- <property name="name">
- <cstring>groupBox4</cstring>
- </property>
- <property name="title">
- <string>Exit Options</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QCheckBox" row="1" column="0">
- <property name="name">
- <cstring>fKillDaemonOnExit</cstring>
- </property>
- <property name="text">
- <string>S&amp;top KPilot's system tray application on exit</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to stop the KPilot daemon when you quit KPilot (only if KPilot started the daemon itself).&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="0" column="0">
- <property name="name">
- <cstring>fQuitAfterSync</cstring>
- </property>
- <property name="text">
- <string>Quit &amp;after HotSync</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to stop both KPilot and the KPilot daemon after the HotSync finishes. This may be useful for systems where KPilot is started by the USB daemon.&lt;/qt&gt;</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="QGroupBox" row="0" column="0">
- <property name="name">
- <cstring>GroupBox1_2</cstring>
- </property>
- <property name="title">
- <string>Startup Options</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QCheckBox" row="0" column="0">
- <property name="name">
- <cstring>fStartDaemonAtLogin</cstring>
- </property>
- <property name="text">
- <string>&amp;Start KPilot at login</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to start up the KPilot daemon every time you log in to KDE.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="1" column="0">
- <property name="name">
- <cstring>fDockDaemon</cstring>
- </property>
- <property name="text">
- <string>S&amp;how KPilot in system tray</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to place a Kpilot icon in the system tray, which shows the daemon's status, and allows you to select the next sync type and to configure KPilot.&lt;/qt&gt;</string>
- </property>
- </widget>
- </grid>
- </widget>
- <spacer row="2" column="0">
- <property name="name">
- <cstring>spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>31</height>
- </size>
- </property>
- </spacer>
- </grid>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/kpilot/kpilot/kpilotConfigDialog_sync.ui b/kpilot/kpilot/kpilotConfigDialog_sync.ui
deleted file mode 100644
index 7571b197..00000000
--- a/kpilot/kpilot/kpilotConfigDialog_sync.ui
+++ /dev/null
@@ -1,171 +0,0 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>SyncConfigWidget</class>
-<comment>A widget for editing HotSync-specific settings.</comment>
-<author>David Bishop</author>
-<widget class="QWidget">
- <property name="name">
- <cstring>SyncConfigForm</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>593</width>
- <height>332</height>
- </rect>
- </property>
- <property name="caption">
- <string>KPilot Options</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <widget class="QCheckBox" row="1" column="1">
- <property name="name">
- <cstring>fFullSyncCheck</cstring>
- </property>
- <property name="text">
- <string>Do full sync when chan&amp;ging PCs</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to perform a full sync when your last sync was performed with another PC or system, to guarantee the completeness of your data.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QComboBox" row="0" column="1">
- <item>
- <property name="text">
- <string>HotSync (sync all changes)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>FullSync (sync also unchanged records)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Copy PC to Handheld</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Copy Handheld to PC</string>
- </property>
- </item>
- <property name="name">
- <cstring>fSpecialSync</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Select in this list the synchronization type that KPilot will use as default. Possible values are:&lt;br&gt;"HotSync", to run all selected conduits, and sync the databases with a modified flag set, updating the modified records only;&lt;br&gt;"FullSync" to run all selected conduits, and sync all databases, reading all records, and performing a full backup;&lt;br&gt;"Copy PC to handheld" to run all conduits and sync all databases, but instead of merging the information from both sources, copy the PC data to the handheld;&lt;br&gt;"Copy handheld to PC" to run all conduits and sync all databases, but instead of merging the information from both sources, copy the handheld data to the PC.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>textLabel1_2</cstring>
- </property>
- <property name="text">
- <string>&amp;Default sync:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fSpecialSync</cstring>
- </property>
- </widget>
- <spacer row="4" column="1">
- <property name="name">
- <cstring>spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>170</height>
- </size>
- </property>
- </spacer>
- <widget class="QComboBox" row="3" column="1">
- <item>
- <property name="text">
- <string>Ask User</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Do Nothing</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Handheld Overrides</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>PC Overrides</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Values From Last Sync (if possible)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Use Both Entries</string>
- </property>
- </item>
- <property name="name">
- <cstring>fConflictResolution</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Select in this list how conflicting entries (entries which were edited both on your handheld and on the PC) are resolved. Possibly values are "Ask User" to let you decide case by case, "Do Nothing" to allow the entries to be different, "PC overrides", "Handheld overrides", "Use values from last sync" and "Use both entries" to create a new entry on both the PC and handheld. Note that the conflict resolution option selected here can be overridden by conduits that have their own conflict resolution configuration.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLabel" row="3" column="0">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Conflict &amp;resolution:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fConflictResolution</cstring>
- </property>
- </widget>
- <widget class="QCheckBox" row="2" column="1">
- <property name="name">
- <cstring>fScreenlockSecure</cstring>
- </property>
- <property name="text">
- <string>Do not sync when screensaver is active</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to prevent KPilot from syncing your handheld while the screensaver is active: this is a security measure to prevent others from syncing &lt;i&gt;their&lt;/i&gt; handhelds with your data. This option must be disabled when you use a different desktop, since KPilot is not aware of screensavers other than KDE's.&lt;/qt&gt;</string>
- </property>
- </widget>
- </grid>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/kpilot/kpilot/kpilotConfigDialog_viewers.ui b/kpilot/kpilot/kpilotConfigDialog_viewers.ui
deleted file mode 100644
index 1be8b408..00000000
--- a/kpilot/kpilot/kpilotConfigDialog_viewers.ui
+++ /dev/null
@@ -1,149 +0,0 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>ViewersConfigWidget</class>
-<comment>A tabWidget for configuring
-KPilot's settings.</comment>
-<author>David Bishop</author>
-<widget class="QWidget">
- <property name="name">
- <cstring>ViewersForm</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>610</width>
- <height>325</height>
- </rect>
- </property>
- <property name="caption">
- <string>KPilot Options</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <widget class="QGroupBox">
- <property name="name">
- <cstring>groupBox2</cstring>
- </property>
- <property name="title">
- <string>Viewers</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>fInternalEditors</cstring>
- </property>
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Make internal viewers &amp;editable</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;The internal viewers can be read only or editable. The editable mode allows you to add new records, delete or edit the existing records and sync your modifications back to the handheld. Check this box to set the internal viewers to editable mode, uncheck to set them to read only mode.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>fUseSecret</cstring>
- </property>
- <property name="text">
- <string>&amp;Show private records</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to display in the internal viewers records that are marked &amp;quot;Private&amp;quot; in the Pilot.&lt;/qt&gt;</string>
- </property>
- </widget>
- </vbox>
- </widget>
- <widget class="QButtonGroup">
- <property name="name">
- <cstring>fAddressGroup</cstring>
- </property>
- <property name="title">
- <string>Address Viewer</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QRadioButton" row="0" column="0">
- <property name="name">
- <cstring>fNormalDisplay</cstring>
- </property>
- <property name="text">
- <string>Show as "&amp;Last, first"</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Select this option to display addresses in the internal address viewer sorted by last name, first name.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QRadioButton" row="1" column="0">
- <property name="name">
- <cstring>fCompanyDisplay</cstring>
- </property>
- <property name="text">
- <string>Show as "&amp;Company, last"</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Select this option to display addresses in the internal address viewer sorted by company name, last name.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="Line" row="2" column="0">
- <property name="name">
- <cstring>line1</cstring>
- </property>
- <property name="frameShape">
- <enum>HLine</enum>
- </property>
- <property name="frameShadow">
- <enum>Sunken</enum>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- </widget>
- <widget class="QCheckBox" row="3" column="0">
- <property name="name">
- <cstring>fUseKeyField</cstring>
- </property>
- <property name="text">
- <string>&amp;Use key field</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to combine all entries with the same last name in the internal address viewer.&lt;/qt&gt;</string>
- </property>
- </widget>
- </grid>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer1</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>41</height>
- </size>
- </property>
- </spacer>
- </vbox>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/kpilot/kpilot/kpilotConfigWizard.cc b/kpilot/kpilot/kpilotConfigWizard.cc
deleted file mode 100644
index 9df81b41..00000000
--- a/kpilot/kpilot/kpilotConfigWizard.cc
+++ /dev/null
@@ -1,233 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2004 by Reinhold Kainhofer
-**
-** A simple configuration wizard.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-//#include "options.h"
-
-#include <tqpushbutton.h>
-#include <tqbuttongroup.h>
-#include <tqcheckbox.h>
-#include <tqlineedit.h>
-
-#include <kmessagebox.h>
-#include <kglobal.h>
-#include <klocale.h>
-#include <kconfigskeleton.h>
-
-#include "kpilotConfig.h"
-#include "options.h"
-
-#include "kpilotConfigWizard_app.h"
-#include "kpilotConfigWizard_user.h"
-#include "kpilotConfigWizard_address.h"
-#include "kpilotConfigWizard_notes.h"
-#include "kpilotConfigWizard_vcal.h"
-
-
-#include "kpilotConfigWizard.moc"
-#include "kpilotProbeDialog.h"
-
-
-ConfigWizard::ConfigWizard(TQWidget *parent, const char *n, int m) :
- KWizard(parent, n),
- fMode((Mode)m)
-{
-// page1=new ConfigWizard_base1(this);
-// addPage( page1, i18n("Select Connection Type") );
- page2=new ConfigWizard_base2(this);
- addPage( page2, i18n("Pilot Info") );
- page3=new ConfigWizard_base3(this);
- addPage( page3, i18n("Application to Sync With") );
- setFinishEnabled( page3, true );
-
- setHelpEnabled( page2, false );
- setHelpEnabled( page3, false );
-
- connect( page2->fProbeButton, TQT_SIGNAL( pressed() ),
- this, TQT_SLOT( probeHandheld() ) );
-
- KPilotSettings::self()->readConfig();
- page2->fUserName->setText( KPilotSettings::userName() );
- page2->fDeviceName->setText( KPilotSettings::pilotDevice() );
- page2->fPilotRunningPermanently->setChecked( KPilotSettings::startDaemonAtLogin() );
-
-}
-
-ConfigWizard::~ConfigWizard()
-{
-}
-
-void ConfigWizard::accept()
-{
- FUNCTIONSETUP;
- TQString username( page2->fUserName->text() );
- TQString devicename( page2->fDeviceName->text() );
-// int devicetype( page1->fConnectionType->selectedId() );
- enum eSyncApp {
- eAppKDE=0,
- //eAppKontact,
- eAppEvolution,
- eAppNone
- } app;
- app=(eSyncApp)( page3->fAppType->selectedId() );
- bool keepPermanently( page2->fPilotRunningPermanently->isChecked() );
-#ifdef DEBUG
- DEBUGKPILOT<<fname<<"Keep permanently: "<<keepPermanently<<endl;
-#endif
-
- KPilotSettings::setPilotDevice( devicename );
- KPilotSettings::setUserName(username);
-// KPilotSettings::setEncoding("iso 8859-15");
- KPilotSettings::setDockDaemon( true );
- KPilotSettings::setKillDaemonAtExit( !keepPermanently);
- KPilotSettings::setQuitAfterSync( !keepPermanently );
- KPilotSettings::setStartDaemonAtLogin( keepPermanently );
- KPilotSettings::setSyncType(0);
- KPilotSettings::setFullSyncOnPCChange( true );
- KPilotSettings::setConflictResolution(0);
- if ( !mDBs.isEmpty() )
- KPilotSettings::setDeviceDBs( mDBs );
-
- KPilotWizard_vcalConfig*calendarConfig = new KPilotWizard_vcalConfig("Calendar");
- KPilotWizard_vcalConfig*todoConfig = new KPilotWizard_vcalConfig("ToDo");
- KPilotWizard_addressConfig*addressConfig = new KPilotWizard_addressConfig();
- KPilotWizard_notesConfig*notesConfig = new KPilotWizard_notesConfig();
- addressConfig->readConfig();
- notesConfig->readConfig();
- todoConfig->readConfig();
- calendarConfig->readConfig();
-
- TQStringList conduits = KPilotSettings::installedConduits();
- int version(0);
-#define APPEND_CONDUIT(a) if (!conduits.contains(a)) conduits.append(a)
- TQString applicationName(i18n("general KDE-PIM"));
- APPEND_CONDUIT("internal_fileinstall");
- APPEND_CONDUIT("todo-conduit");
- APPEND_CONDUIT("vcal-conduit");
- switch (app) {
- case eAppEvolution:
- applicationName=i18n("Gnome's PIM suite", "Evolution");
-
- // TODO: Once the Evolution abook resource is finished, enable it...
- conduits.remove("abbrowser_conduit");
- // addressConfig->setDefaults();
- // addressConfig->setAddressbookType( KPilotWizard_addressConfig::eAbookResource );
- //// addressConfig->revertToDefault("ArchiveDeleted");
- //// addressConfig->revertToDefault("ConflictResolution");
-
- // nothing to do for knotes conduit yet (evolution doesn't have notes)
- conduits.remove("knotes-conduit");
-
- // the vcalconduits use the same config file, so set the correct groups
- version = calendarConfig->conduitVersion();
- calendarConfig->setDefaults();
- calendarConfig->setCalendarType( KPilotWizard_vcalConfig::eCalendarLocal );
- calendarConfig->setCalendarFile( "$HOME/evolution/local/Calendar/calendar.ics" );
- calendarConfig->setConduitVersion( version );
- version = todoConfig->conduitVersion();
- todoConfig->setDefaults();
- todoConfig->setCalendarType( KPilotWizard_vcalConfig::eCalendarLocal );
- todoConfig->setCalendarFile( "$HOME/evolution/local/Tasks/tasks.ics" );
- todoConfig->setConduitVersion( version );
-
- KMessageBox::information(this, i18n("KPilot cannot yet synchronize the addressbook with Evolution, so the addressbook conduit was disabled.\nWhen syncing the calendar or to-do list using KPilot please quit Evolution before the sync, otherwise you will lose data."), i18n("Restrictions with Evolution"));
- break;
- case eAppNone:
- conduits.clear();
- APPEND_CONDUIT("internal_fileinstall");
- applicationName=i18n("Kpilot will sync with nothing","nothing (it will backup only)");
- break;
-// case eAppKontact:
- case eAppKDE:
- applicationName=i18n("KDE's PIM suite", "Kontact");
- default:
- APPEND_CONDUIT("knotes-conduit");
- APPEND_CONDUIT("abbrowser_conduit");
- // Set to the stdaddressbook, reset others to defaults
- addressConfig->setAddressbookType( KPilotWizard_addressConfig::eAbookResource );
- addressConfig->setArchiveDeleted( true );
- addressConfig->setConflictResolution( -1 );
- // nothing to do for knotes conduit yet
- // notesConfig->set...
- // the vcalconduits use the same config file, so set the correct groups
- int version = calendarConfig->conduitVersion();
- calendarConfig->setDefaults();
- calendarConfig->setCalendarType( KPilotWizard_vcalConfig::eCalendarResource );
- calendarConfig->setConduitVersion( version );
- version = todoConfig->conduitVersion();
- todoConfig->setDefaults();
- todoConfig->setCalendarType( KPilotWizard_vcalConfig::eCalendarResource );
- todoConfig->setConduitVersion( version );
- break;
- }
- addressConfig->writeConfig();
- notesConfig->writeConfig();
- todoConfig->writeConfig();
- calendarConfig->writeConfig();
-
- KPILOT_DELETE(addressConfig);
- KPILOT_DELETE(notesConfig);
- KPILOT_DELETE(todoConfig);
- KPILOT_DELETE(calendarConfig);
-
- KPilotSettings::setInstalledConduits( conduits );
-#undef APPEND_CONDUIT
-
- TQString finishMessage = i18n("KPilot is now configured to sync with %1.").arg(applicationName);
- if (fMode == InDialog)
- {
- finishMessage.append(CSL1("\n"));
- finishMessage.append(i18n(
- "The remaining options in the config dialog are advanced options and can "
- "be used to fine-tune KPilot."));
- }
-
- KMessageBox::information(this, finishMessage,
- i18n("Automatic Configuration Finished"));
- KPilotSettings::self()->writeConfig();
- TQDialog::accept();
-}
-
-void ConfigWizard::probeHandheld()
-{
- if ( KMessageBox::warningContinueCancel( this, i18n("Please put the handheld "
- "in the cradle, press the hotsync button and click on \"Continue\".\n\nSome "
- "kernel versions (Linux 2.6.x) have problems with the visor kernel module "
- "(for Sony Clie devices). Running an autodetection in that case might block "
- "the computer from doing hotsyncs until it is rebooted. In that case it might "
- "be advisable not to continue."),
- i18n("Handheld Detection") ) == KMessageBox::Continue ) {
- ProbeDialog *probeDialog = new ProbeDialog( this );
- if ( probeDialog->exec() && probeDialog->detected() ) {
- page2->fUserName->setText( probeDialog->userName() );
- page2->fDeviceName->setText( probeDialog->device() );
- mDBs = probeDialog->dbs();
- }
- KPILOT_DELETE(probeDialog);
- }
-}
-
diff --git a/kpilot/kpilot/kpilotConfigWizard.h b/kpilot/kpilot/kpilotConfigWizard.h
deleted file mode 100644
index 742df392..00000000
--- a/kpilot/kpilot/kpilotConfigWizard.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _KPILOT_CONFIGWIZARD_H
-#define _KPILOT_CONFIGWIZARD_H
-/* kpilotConfigWizard.h KPilot
-**
-** Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines kpilot's configuration wizard
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "kwizard.h"
-
-class ConfigWizard_base1;
-class ConfigWizard_base2;
-class ConfigWizard_base3;
-
-class ConfigWizard : public KWizard
-{
-Q_OBJECT
-public:
- enum Mode { InDialog=0, Standalone=1 } ;
-
- ConfigWizard(TQWidget *p=0L,const char *n=0L, int mode=(int)InDialog);
- ~ConfigWizard();
-
-protected slots:
- void probeHandheld();
-protected:
- void accept();
-// ConfigWizard_base1 *page1;
- ConfigWizard_base2 *page2;
- ConfigWizard_base3 *page3;
-
- Mode fMode;
- TQStringList mDBs;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/kpilotConfigWizard_address.kcfgc b/kpilot/kpilot/kpilotConfigWizard_address.kcfgc
deleted file mode 100644
index 884fd3af..00000000
--- a/kpilot/kpilot/kpilotConfigWizard_address.kcfgc
+++ /dev/null
@@ -1,7 +0,0 @@
-File=../conduits/abbrowserconduit/abbrowserconduit.kcfg
-ClassName=KPilotWizard_addressConfig
-Singleton=False
-ItemAccessors=true
-Mutators=true
-GlobalEnums=true
-SetUserTexts=true
diff --git a/kpilot/kpilot/kpilotConfigWizard_app.ui b/kpilot/kpilot/kpilotConfigWizard_app.ui
deleted file mode 100644
index 7a690f86..00000000
--- a/kpilot/kpilot/kpilotConfigWizard_app.ui
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>ConfigWizard_base3</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>ConfigWizard_base3</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>462</width>
- <height>404</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>textLabel6</cstring>
- </property>
- <property name="text">
- <string>Finally, you can configure KPilot specifically for some PIM applications, like Kontact (KDE's integrated PIM application) or Evolution (GNOME's integrated PIM application).
-
-Press "Finish" to setup KPilot according to the settings in this configuration Wizard.</string>
- </property>
- <property name="alignment">
- <set>WordBreak|AlignVCenter</set>
- </property>
- </widget>
- <widget class="QButtonGroup" row="2" column="0">
- <property name="name">
- <cstring>fAppType</cstring>
- </property>
- <property name="title">
- <string>Set Default Values for Syncing With</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>radioButton6</cstring>
- </property>
- <property name="text">
- <string>&amp;KDE-PIM suite (Kontact)</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>radioButton8</cstring>
- </property>
- <property name="text">
- <string>&amp;GNOME-PIM (Evolution)</string>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>radioButton4</cstring>
- </property>
- <property name="text">
- <string>No sync, just backup</string>
- </property>
- </widget>
- </vbox>
- </widget>
- <spacer row="3" column="0">
- <property name="name">
- <cstring>spacer5</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>120</height>
- </size>
- </property>
- </spacer>
- <spacer row="1" column="0">
- <property name="name">
- <cstring>spacer5_2</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Minimum</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>12</height>
- </size>
- </property>
- </spacer>
- </grid>
-</widget>
-<tabstops>
- <tabstop>radioButton6</tabstop>
-</tabstops>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/kpilot/kpilot/kpilotConfigWizard_notes.kcfgc b/kpilot/kpilot/kpilotConfigWizard_notes.kcfgc
deleted file mode 100644
index c343514f..00000000
--- a/kpilot/kpilot/kpilotConfigWizard_notes.kcfgc
+++ /dev/null
@@ -1,7 +0,0 @@
-File=../conduits/knotes/knotesconduit.kcfg
-ClassName=KPilotWizard_notesConfig
-Singleton=false
-ItemAccessors=true
-Mutators=true
-GlobalEnums=true
-SetUserTexts=true
diff --git a/kpilot/kpilot/kpilotConfigWizard_user.ui b/kpilot/kpilot/kpilotConfigWizard_user.ui
deleted file mode 100644
index b894cbba..00000000
--- a/kpilot/kpilot/kpilotConfigWizard_user.ui
+++ /dev/null
@@ -1,168 +0,0 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>ConfigWizard_base2</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>ConfigWizard_base2</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>512</width>
- <height>298</height>
- </rect>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="text">
- <string>This wizard will help you configure KPilot.</string>
- </property>
- <property name="alignment">
- <set>WordBreak|AlignVCenter</set>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel5</cstring>
- </property>
- <property name="text">
- <string>As a first step, we need to determine the user name and how the handheld is connected to the computer.</string>
- </property>
- <property name="alignment">
- <set>WordBreak|AlignVCenter</set>
- </property>
- </widget>
- <widget class="QGroupBox">
- <property name="name">
- <cstring>groupBox2</cstring>
- </property>
- <property name="title">
- <string>Handheld &amp;&amp; User Name</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;p&gt;You can either let KPilot detect these values automatically (for this you need your handheld ready and connected to the PC) or enter them manually.&lt;/p&gt;
-&lt;p&gt;Please enter the username exactly as set on the handheld. &lt;/p&gt;
-&lt;p&gt;If setting the device type manually (i.e., if automatic detection did not work for you), please look below for tips on choosing the right device name. {0...n} means a number from 0 up to a very large number, though usually just 255.
-&lt;p&gt;
-Serial Port: an old method of connection, used primarily by the original line of Palm Pilots, and various Palm-based cellphones. Device name will look like /dev/ttyS{0...n} (Linux) or /dev/cuaa{0...n} (FreeBSD).&lt;/p&gt;
-&lt;p&gt;
-USB Port: A newer style of connection, used by most newer Palms, Handsprings, and Sony Clies. Device name will look like /dev/ttyUSB{0...n} or /dev/usb/tts/{0...n} (Linux) or /dev/ucom{0...n} (FreeBSD). On Linux, definitely check both 0 and 1: newer devices tend to use 1; older devices tend to use 0.&lt;/p&gt;
-&lt;p&gt;
-Infrared: (pronounced infra-red) is a relatively slow connection type used solely as a last resort. Device name will be /dev/ircomm0 or /dev/ttyS{0...n} (Linux), or /dev/sio{0...n} (FreeBSD).&lt;/p&gt;
-&lt;p&gt;
-Bluetooth: A new connection method, this is used almost exclusively on new, high-end devices, like the Tungsten T3 or the Zire 72. Device name will be /dev/usb/ttub/{0...n} or /dev/ttyUB{0...n} (Linux), or /dev/ttyp{0...n} (FreeBSD).&lt;/p&gt;
-&lt;p&gt;
-Network: This has not been tested by any of the KPilot developers themselves (hardware donations always accepted!), but it has been reported that setting the device to "net:any" will work for network-enabled devices. However, this has also been known to lock KPilot up when doing anything other than just syncing. Use it with caution.
-&lt;/p&gt;</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="1" column="0">
- <property name="name">
- <cstring>textLabel3_2</cstring>
- </property>
- <property name="text">
- <string>&amp;Device:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fDeviceName</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Enter the device the Pilot is attached to (for instance a serial or USB port) here. You can also use &lt;i&gt;/dev/pilot&lt;/i&gt;, and make that a symlink to the correct device. Use the button below to automatically detect the device. You need write permission to successfully synchronize with the handheld.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QPushButton" row="2" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fProbeButton</cstring>
- </property>
- <property name="text">
- <string>&amp;Automatically Detect Handheld &amp;&amp; User Name</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Click this button to open the detection dialog. The wizard will try to automatically find and display the correct device and username for your handheld. If the wizard cannot retrieve this information, check if you have write permission for the device.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLineEdit" row="1" column="1">
- <property name="name">
- <cstring>fDeviceName</cstring>
- </property>
- <property name="text">
- <string>/dev/pilot</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Enter the device the Pilot is attached to (for instance a serial or USB port) here. You can also use &lt;i&gt;/dev/pilot&lt;/i&gt;, and make that a symlink to the correct device. Use the button below to automatically detect the device. You need write permission to successfully synchronize with the handheld.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLineEdit" row="0" column="1">
- <property name="name">
- <cstring>fUserName</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Enter your username here, as it appears in the Pilot's &amp;quot;Owner&amp;quot; setting, or use the button below to automatically detect it.&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>textLabel2_2</cstring>
- </property>
- <property name="text">
- <string>User na&amp;me:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fUserName</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Enter your username here, as it appears in the Pilot's &amp;quot;Owner&amp;quot; setting, or use the button below to automatically detect it.&lt;/qt&gt;</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>fPilotRunningPermanently</cstring>
- </property>
- <property name="text">
- <string>&amp;Start KPilot at login</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Check this box to make the kpilot daemon load when you first log in until you log out. That means (in theory), that you should not have to do anything other than connect your handheld and push "sync", and kpilot will appear and magically do your bidding. &lt;/qt&gt;</string>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer4</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>70</height>
- </size>
- </property>
- </spacer>
- </vbox>
-</widget>
-<tabstops>
- <tabstop>fUserName</tabstop>
- <tabstop>fDeviceName</tabstop>
- <tabstop>fProbeButton</tabstop>
- <tabstop>fPilotRunningPermanently</tabstop>
-</tabstops>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/kpilot/kpilot/kpilotConfigWizard_vcal.kcfgc b/kpilot/kpilot/kpilotConfigWizard_vcal.kcfgc
deleted file mode 100644
index 36141b8a..00000000
--- a/kpilot/kpilot/kpilotConfigWizard_vcal.kcfgc
+++ /dev/null
@@ -1,7 +0,0 @@
-File=../conduits/vcalconduit/vcalconduitbase.kcfg
-ClassName=KPilotWizard_vcalConfig
-Singleton=false
-ItemAccessors=true
-Mutators=true
-GlobalEnums=true
-SetUserTexts=true
diff --git a/kpilot/kpilot/kpilotDCOP.h b/kpilot/kpilot/kpilotDCOP.h
deleted file mode 100644
index a17e8a29..00000000
--- a/kpilot/kpilot/kpilotDCOP.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef _KPILOT_KPILOTDCOP_H
-#define _KPILOT_KPILOTDCOP_H
-/* kpilotDCOP.h KPilotDaemon
-**
-** Copyright (C) 2000 by Adriaan de Groot
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines the DCOP interface for KPilot.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include <dcopobject.h>
-
-
-class KPilotDCOP : virtual public DCOPObject
-{
- K_DCOP
-
-public:
- enum DaemonMessages {
- None=0,
- StartOfHotSync=1,
- EndOfHotSync=2,
- DaemonQuit=4 } ;
- enum KPilotStatus {
- Startup=1,
- WaitingForDaemon=2,
- Normal=10,
- UIBusy=100,
- Error=101 } ;
-
-k_dcop:
- /**
- * This is the method the daemon uses to report
- * changes in its state.
- */
- virtual ASYNC daemonStatus(int) = 0;
-
- /**
- * This is the method the daemon uses to popup
- * the configure dialog.
- */
- virtual ASYNC configure() = 0;
- virtual ASYNC configureWizard() = 0;
-
- /**
- * Report KPilot's state back to the daemon.
- */
- virtual int kpilotStatus() = 0;
-} ;
-
-
-
-#endif
diff --git a/kpilot/kpilot/kpilotProbeDialog.cc b/kpilot/kpilot/kpilotProbeDialog.cc
deleted file mode 100644
index fd7fcb3c..00000000
--- a/kpilot/kpilot/kpilotProbeDialog.cc
+++ /dev/null
@@ -1,363 +0,0 @@
-/* conduitConfigDialog.cc KPilot
-**
-** Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a .ui-based configuration dialog for conduits.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <tqlayout.h>
-#include <tqgroupbox.h>
-#include <tqlabel.h>
-#include <tqvbox.h>
-#include <tqtimer.h>
-#include <tqptrlist.h>
-#include <tqmap.h>
-#include <tqvaluelist.h>
-
-#include <kmessagebox.h>
-#include <kglobal.h>
-#include <klocale.h>
-#include <kconfigskeleton.h>
-#include <kapplication.h>
-#include <kprogress.h>
-
-#include "kpilotConfig.h"
-#include "pilotUser.h"
-#include "pilotSysInfo.h"
-#include "options.h"
-#include "kpilotdevicelink.h"
-
-#include "kpilotProbeDialog.moc"
-#include "pilotDaemonDCOP_stub.h"
-
-/*
-We can't connect to /dev/ttyUSB0 and /dev/ttyUSB1 at the same time, because that
-will lock up kpilot completely. In particular, it gets a connection on /dev/ttyUSB0,
-which it processes, and while processing, a connection on USB1 is also detected.
-However, when kpilot gets 'round to process it, the link is already closed, and
-pi_connect hangs forever.
-
-Now, I split up the list of devices to probe into three list, one holding /dev/pilot,
-the second holding all /dev/xxx0 and /dev/xxx2 (e.g. /dev/ttyUSB0 and /dev/ttyUSB2),
-and finally a third holding the remaining /dev/xxx1 and /dev/xxx3 devices. Each of
-these three sets of devices is activated for a few seconds, and then the next set is
-probed. This way, I ensure that kpilot never listens on /dev/ttyUSB0 and /dev/ttyUSB1
-at the same time.
-
-Now the first detection works fine. However, it seems the Linux kernel has another
-problem with /dev/ttyUSB0. I have a Clie, which uses ttyUSB0, and as soon as the
-wizard tries to listen on ttyUSB1 (after it detected the handheld on ttyUSB0 already),
-the kernel writes a warning message to the syslog:
-visor ttyUSB1: Device lied about number of ports, please use a lower one.
-
-If I continue autodetection once again afterwards, the visor module kind of crashes.
-lsmod shows an impossible usage count for the module:
-
-reinhold@einstein:/kde/builddir$ lsmod
-Module Size Used by
-visor 17164 4294967294
-usbserial 30704 1 visor
-
-After that, the kernel doesn't detect the device ever again (until the computer is rebooted),
-and the module can't be unloaded.
-*/
-
-
-ProbeDialog::ProbeDialog(TQWidget *parent, const char *n) :
- KDialogBase(parent, n, true, i18n("Autodetecting Your Handheld"), KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::User1, KDialogBase::Cancel, true, i18n("Restart Detection")),
- mDetected(false), mUserName(), mDevice()
-{
- FUNCTIONSETUP;
-
- TQVBox *mainWidget = makeVBoxMainWidget();
-
- fInfoText = new TQLabel( i18n( "KPilot is now trying to automatically detect the device of your handheld. Please press the hotsync button if you have not done so already." ), mainWidget, "fInfoText" );
- fInfoText->setAlignment( TQLabel::WordBreak );
-
- fStatusGroup = new TQGroupBox( i18n("Status"), mainWidget, "fStatusGroup" );
- fStatusGroup->setColumnLayout(0, Qt::Vertical );
- fStatusGroupLayout = new TQGridLayout( fStatusGroup->layout() );
-
- fStatus = new TQLabel( i18n("Autodetection not yet started..."), fStatusGroup, "fStatus" );
- fStatus->setAlignment( TQLabel::WordBreak );
- fStatusGroupLayout->addWidget( fStatus, 0, 0 );
-
- fProgress = new KProgress( 100, fStatusGroup, "fProgress" );
- fStatusGroupLayout->addWidget( fProgress, 1, 0 );
-
-
-
- fResultsGroup = new TQGroupBox( i18n( "Detected Values" ), mainWidget, "fResultsGroup" );
- fResultsGroup->setEnabled( FALSE );
- fResultsGroup->setColumnLayout(0, Qt::Vertical );
- fResultsGroupLayout = new TQGridLayout( fResultsGroup->layout() );
- fResultsGroupLayout->setAlignment( Qt::AlignTop );
-
- fUserLabel = new TQLabel( i18n( "Handheld user:" ), fResultsGroup, "fUserLabel" );
- fUserLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, fUserLabel->sizePolicy().hasHeightForWidth() ) );
- fResultsGroupLayout->addWidget( fUserLabel, 0, 0 );
-
- fDeviceLabel = new TQLabel( i18n( "Device:" ), fResultsGroup, "fDeviceLabel" );
- fResultsGroupLayout->addWidget( fDeviceLabel, 1, 0 );
-
- fUser = new TQLabel( i18n("[Not yet known]"), fResultsGroup, "fUser" );
- fResultsGroupLayout->addWidget( fUser, 0, 1 );
-
- fDevice = new TQLabel( i18n("[Not yet known]"), fResultsGroup, "fDevice" );
- fResultsGroupLayout->addWidget( fDevice, 1, 1 );
-
-
- resize( TQSize(459, 298).expandedTo(minimumSizeHint()) );
- clearWState( WState_Polished );
- enableButtonOK(false);
-
- mDevicesToProbe[0] << "/dev/pilot";
- mDevicesToProbe[1] <<"/dev/ttyS0"<<"/dev/ttyS2"
- <<"/dev/tts/0"<<"/dev/tts/2"
- <<"/dev/ttyUSB0"<<"/dev/ttyUSB2"
- <<"/dev/usb/tts/0"<<"/dev/usb/tts/2"
- <<"/dev/cuaa0"<<"/dev/cuaa2"
- <<"/dev/cuad0"<<"/dev/cuad2"
- <<"/dev/ucom0"<<"/dev/ucom2";
- mDevicesToProbe[2] <<"/dev/ttyS1"<<"/dev/ttyS3"
- <<"/dev/tts/1"<<"/dev/tts/3"
- <<"/dev/ttyUSB1"<<"/dev/ttyUSB3"
- <<"/dev/usb/tts/1"<<"/dev/usb/tts/3"
- <<"/dev/cuaa1"<<"/dev/cuaa3"
- <<"/dev/cuad1"<<"/dev/cuad3"
- <<"/dev/ucom1"<<"/dev/ucom3";
-
- fProcessEventsTimer = new TQTimer( this );
- fTimeoutTimer = new TQTimer( this );
- fProgressTimer = new TQTimer( this );
- fRotateLinksTimer = new TQTimer( this );
- connect( fProcessEventsTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(processEvents()) );
- connect( fTimeoutTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout()) );
- connect( fProgressTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT( progress()) );
- connect( fRotateLinksTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT( detect()) );
- connect( this, TQT_SIGNAL(finished()), this, TQT_SLOT(disconnectDevices()) );
-}
-
-ProbeDialog::~ProbeDialog()
-{
- FUNCTIONSETUP;
-}
-
-void ProbeDialog::processEvents()
-{
- FUNCTIONSETUP;
- KApplication::kApplication()->processEvents();
-}
-
-void ProbeDialog::progress()
-{
- fProgress->advance(1);
-}
-
-int ProbeDialog::exec()
-{
- mDetected = false;
- mUserName = TQString();
- mDevice = TQString();
- TQTimer::singleShot( 0, this, TQT_SLOT( startDetection() ) );
- return KDialogBase::exec();
-}
-
-void ProbeDialog::startDetection()
-{
- FUNCTIONSETUP;
-
- disconnectDevices();
- fProgress->setProgress(0);
- fStatus->setText( i18n("Starting detection...") );
- TQTimer::singleShot(0, this, TQT_SLOT(processEvents()) );
- processEvents();
- PilotDaemonDCOP_stub *daemonStub = new PilotDaemonDCOP_stub("kpilotDaemon", "KPilotDaemonIface");
- if (daemonStub) {
- daemonStub->stopListening();
- }
- KPILOT_DELETE(daemonStub);
- processEvents();
- if (!fTimeoutTimer->start( 30000, true ) )
- {
- WARNINGKPILOT << "Could not start fTimeoutTimer" << endl;
- }
- if (!fProcessEventsTimer->start( 100, false ) )
- {
- WARNINGKPILOT << "Could not start fProcessEventsTimer" << endl;
- }
- if (!fProgressTimer->start( 300, false) )
- {
- WARNINGKPILOT << "Could not start Progress timer" << endl;
- }
-
- KPilotDeviceLink*link;
- for (int i=0; i<3; i++)
- {
- TQStringList::iterator end(mDevicesToProbe[i].end());
- for (TQStringList::iterator it=mDevicesToProbe[i].begin(); it!=end; ++it)
- {
- link = new KPilotDeviceLink();
- link->setDevice((*it));
-#ifdef DEBUG
- DEBUGKPILOT<<"new kpilotDeviceLink for "<<(*it)<<endl;
-#endif
- mDeviceLinks[i].append( link );
- connect( link, TQT_SIGNAL(deviceReady(KPilotDeviceLink*)), this, TQT_SLOT(connection(KPilotDeviceLink*)) );
- processEvents();
- }
- }
- fStatus->setText( i18n("Waiting for handheld to connect...") );
- mProbeDevicesIndex=0;
-
- detect();
- if (!fRotateLinksTimer->start( 3000, false) )
- {
- WARNINGKPILOT << "Could not start Device link rotation timer" << endl;
- }
-}
-
-
-void ProbeDialog::detect(int i)
-{
- FUNCTIONSETUP;
-
- mProbeDevicesIndex = i;
- PilotLinkList::iterator end(mDeviceLinks[mProbeDevicesIndex].end());
-
- for (PilotLinkList::iterator it=mDeviceLinks[mProbeDevicesIndex].begin(); it!=end; ++it)
- {
- if (*it) (*it)->reset();
- }
-}
-
-void ProbeDialog::detect()
-{
- detect( (mProbeDevicesIndex+1)%3 );
-}
-
-void ProbeDialog::timeout()
-{
- disconnectDevices();
- if (!mDetected) {
- fStatus->setText( i18n("Timeout reached, could not detect a handheld.") );
- KMessageBox::information ( this, i18n("<qt>A handheld could not be detected. Possible check the following things:</p>"
- "<ul><li> Have you pressed the hotsync button on the handheld?\n"
- "<li> Make sure the device sits in the cradle correctly.\n"
- "<li> Make sure the cradle is correctly plugged in to the computer.\n"
- "<li> Have you checked that your device is actually supported by kpilot (see http://www.kpilot.org).\n"
- "</ul>"
- ), i18n("Automatic Detection Failed"), "AutoDetectionFailed");
- }
-}
-
-void ProbeDialog::connection( KPilotDeviceLink*lnk)
-{
- FUNCTIONSETUP;
-
- mActiveLink = lnk;
- if ( !mActiveLink ) return;
- const KPilotUser &usr( mActiveLink->getPilotUser() );
-
- mUserName = usr.name();
- mDevice = mActiveLink->pilotPath();
-
- fStatus->setText( i18n("Found a connected device on %1").arg(mDevice) );
- fUser->setText( mUserName );
- fDevice->setText( mDevice );
- mDetected = true;
-
- fResultsGroup->setEnabled( true );
- enableButtonOK(true);
-
- TQTimer::singleShot(0, this, TQT_SLOT(retrieveDBList()));
-}
-
-void ProbeDialog::retrieveDBList()
-{
- KPilotLink::DBInfoList dbs = mActiveLink->getDBList();
- mDBs.clear();
- char buff[7];
- buff[0] = '[';
-
- for ( KPilotLink::DBInfoList::ConstIterator i = dbs.begin();
- i != dbs.end(); ++i )
- {
- set_long( &buff[1], (*i).creator );
- buff[5] = ']';
- buff[6] = '\0';
- TQString cr( buff );
- mDBs << cr;
- mDBs << TQString( (*i).name );
- }
- mDBs.sort();
-
- TQString old( TQString::null );
- TQStringList::Iterator itr = mDBs.begin();
- while ( itr != mDBs.end() ) {
- if ( old == *itr ) {
- itr = mDBs.remove( itr );
- } else {
- old = *itr;
- ++itr;
- }
- }
-
- // End sync gracefully, but don't change settings on the handheld.
- mActiveLink->endSync( KPilotLink::NoUpdate );
-
- TQTimer::singleShot(0, this, TQT_SLOT(disconnectDevices()));
-}
-void ProbeDialog::disconnectDevices()
-{
- FUNCTIONSETUP;
-
- if (!mDetected) fStatus->setText( i18n("Disconnected from all devices") );
- fProcessEventsTimer->stop( );
- fTimeoutTimer->stop();
- fProgressTimer->stop();
- fRotateLinksTimer->stop();
- fProgress->setProgress(fProgress->totalSteps());
- for (int i=0; i<3; ++i)
- {
- PilotLinkList::iterator end(mDeviceLinks[i].end());
- for (PilotLinkList::iterator it=mDeviceLinks[i].begin(); it!=end; ++it)
- {
- (*it)->close();
- KPILOT_DELETE(*it);
- }
- mDeviceLinks[i].clear();
- }
-
-
- PilotDaemonDCOP_stub *daemonStub = new PilotDaemonDCOP_stub("kpilotDaemon", "KPilotDaemonIface");
- if (daemonStub)
- {
- daemonStub->startListening();
- }
- KPILOT_DELETE(daemonStub);
-}
-
diff --git a/kpilot/kpilot/kpilotProbeDialog.h b/kpilot/kpilot/kpilotProbeDialog.h
deleted file mode 100644
index d6fb1cbe..00000000
--- a/kpilot/kpilot/kpilotProbeDialog.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef _KPILOT_PROBEDIALOG_H
-#define _KPILOT_PROBEDIALOG_H
-/* kpilotConfigWizard.h KPilot
-**
-** Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines kpilot's configuration wizard
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "kdialogbase.h"
-
-class KPilotDeviceLink;
-class TQLabel;
-class TQGroupBox;
-class KProgress;
-class TQTimer;
-class TQGridLayout;
-template <class T> class TQValueList;
-template<class Key, class T> class TQMap;
-
-typedef TQValueList<KPilotDeviceLink*> PilotLinkList;
-
-typedef TQMap<TQString, KPilotDeviceLink*> PilotLinkMap;
-
-class ProbeDialog : public KDialogBase
-{
-Q_OBJECT
-public:
- ProbeDialog(TQWidget *p=0L,const char *n=0L);
- ~ProbeDialog();
-
- bool detected() const { return mDetected; }
- TQString userName() const { return mUserName; }
- TQString device() const { return mDevice; }
- TQStringList dbs() const { return mDBs; }
-
-
-protected slots:
- void startDetection();
- void timeout();
- void connection(KPilotDeviceLink*lnk);
- void retrieveDBList();
- void disconnectDevices();
- void processEvents();
- void progress();
- void detect();
- void detect(int i);
-public slots:
- int exec();
- void slotUser1 () { startDetection(); }
-protected:
- TQLabel* fInfoText;
- TQGroupBox* fResultsGroup;
- TQLabel* fUserLabel;
- TQLabel* fDeviceLabel;
- TQLabel* fUser;
- TQLabel* fDevice;
- TQGroupBox* fStatusGroup;
- TQLabel* fStatus;
- KProgress* fProgress;
-
- TQTimer* fProcessEventsTimer;
- TQTimer* fTimeoutTimer;
- TQTimer* fProgressTimer;
- TQTimer* fRotateLinksTimer;
-protected:
- TQGridLayout* fResultsGroupLayout;
- TQGridLayout* fStatusGroupLayout;
-
- TQStringList mDevicesToProbe[3];
- PilotLinkList mDeviceLinks[3];
- int mProbeDevicesIndex;
- KPilotDeviceLink *mActiveLink;
-
- bool mDetected;
- TQString mUserName;
- TQString mDevice;
- TQStringList mDBs;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/kpilotSettings.kcfgc b/kpilot/kpilot/kpilotSettings.kcfgc
deleted file mode 100644
index 5ee06e63..00000000
--- a/kpilot/kpilot/kpilotSettings.kcfgc
+++ /dev/null
@@ -1,7 +0,0 @@
-File=kpilot.kcfg
-ClassName=KPilotSettings
-Singleton=true
-ItemAccessors=true
-Mutators=true
-GlobalEnums=true
-SetUserTexts=true
diff --git a/kpilot/kpilot/kpilot_config.desktop b/kpilot/kpilot/kpilot_config.desktop
deleted file mode 100644
index 075e31cd..00000000
--- a/kpilot/kpilot/kpilot_config.desktop
+++ /dev/null
@@ -1,156 +0,0 @@
-[Desktop Entry]
-Icon=kpilot
-Type=Service
-ServiceTypes=KCModule
-
-X-KDE-ModuleType=Library
-X-KDE-Library=kpilot
-X-KDE-FactoryName=kpilotconfig
-X-KDE-HasReadOnlyMode=false
-X-KDE-ParentApp=kpilot
-X-KDE-ParentComponents=kpilot,kpilotDaemon,kontact_kpilotplugin
-
-Name=KPilot Configuration
-Name[af]=KPilot opstelling
-Name[ar]=إعداد KPilot
-Name[be]=Канфігурацыя KPilot
-Name[bg]=Настройване на KPilot
-Name[br]=Kefluniadur KPilot
-Name[bs]=KPilot podešavanje
-Name[ca]=Configuració de KPilot
-Name[cs]=Nastavení KPilotu
-Name[da]=KPilot indstilling
-Name[de]=KPilot-Einrichtung
-Name[el]=Ρύθμιση KPilot
-Name[eo]=KPilot-Agordo
-Name[es]=Configuración de KPilot
-Name[et]=KPiloti seadistamine
-Name[eu]=KPilot-en konfigurazioa
-Name[fa]=پیکربندی KPilot
-Name[fi]=KPilot-asetukset
-Name[fr]=Configuration de KPilot
-Name[fy]=KPilot ynstellings
-Name[ga]=Cumraíocht KPilot
-Name[gl]=Configuración de KPilot
-Name[hu]=A KPilot beállításai
-Name[is]=KPilot stillingar
-Name[it]=Configurazione KPilot
-Name[ja]=KPilot の設定
-Name[kk]=KPilot параметрлері
-Name[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ KPilot
-Name[lt]=Kpilot konfigūracija
-Name[mk]=Конфигурација на КПилот
-Name[ms]=Konfigurasi KPilot
-Name[nb]=KPilot oppsett
-Name[nds]=KPilot instellen
-Name[ne]=केडीई पाइलट कन्फिगरेसन
-Name[nl]=KPilot instellingen
-Name[nn]=KPilot-oppsett
-Name[pl]=konfiguracja KPilota
-Name[pt]=Configuração do KPilot
-Name[pt_BR]=Configuração do KPilot
-Name[ru]=Синхронизация с КПК
-Name[se]=KPilot-heivehus
-Name[sk]=Nastavenie KPilot
-Name[sl]=Nastavitve KPilota
-Name[sr]=KPilot подешавање
-Name[sr@Latn]=KPilot podešavanje
-Name[sv]=Inställning av Kpilot
-Name[ta]=Kபைலட் கட்டமைப்பு
-Name[tg]=Танзимоти KPilot
-Name[tr]=KPilot Yapılandırması
-Name[uk]=Налаштування KPilot
-Name[zh_CN]=KPilot 配置
-Name[zh_TW]=KPilot 設定
-Comment=KPilot Main Configuration
-Comment[af]=KPilot hoof opstelling
-Comment[bg]=Общи настройки на KPilot
-Comment[br]=Kefluniadur kentañ KPilot
-Comment[bs]=KPilot glavno podešavanje
-Comment[ca]=Configuració principal de KPilot
-Comment[cs]=Hlavní nastavení KPilotu
-Comment[da]=KPilot hovedindstilling
-Comment[de]=Grundeinrichtung für KPilot
-Comment[el]=Κύρια ρύθμιση του KPilot
-Comment[eo]=KPilot-Ĉefagordo
-Comment[es]=Configuración principal de KPilot
-Comment[et]=KPiloti põhiseadistused
-Comment[eu]=KPilot-en konfigurazio nagusia
-Comment[fa]=پیکربندی اصلی KPilot
-Comment[fi]=KPilotin pääasetukset
-Comment[fr]=Configuration principale de KPilot
-Comment[fy]=KPilot algemiene ynstellings
-Comment[ga]=Príomhchumraíocht KPilot
-Comment[gl]=Configuración Principal de KPilot
-Comment[hu]=A KPilot legfontosabb beállításai
-Comment[is]=Aðalstillingar KPilot
-Comment[it]=Configurazione principale di KPilot
-Comment[ja]=KPilot 主要設定
-Comment[kk]=KPilot негізгі параметрлері
-Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​សំខាន់ៗ​របស់ KPilot
-Comment[lt]=KPilot bendrasis konfigūravimas
-Comment[mk]=Главна конфигурација
-Comment[ms]=Konfigurasi Utama KPilot
-Comment[nb]=KPilot hovedoppsett
-Comment[nds]=Hööftinstellen för KPilot
-Comment[ne]=केडीई पाइलट मुख्य कन्फिगरेसन
-Comment[nl]=KPilot algemene instellingen
-Comment[nn]=KPilot hovudoppsett
-Comment[pl]=Główna konfiguracja KPilota
-Comment[pt]=Configuração Principal do KPilot
-Comment[pt_BR]=Configuração Principal do KPilot
-Comment[ru]=Общие параметры KPilot
-Comment[sk]=Hlavné nastavenie KPilot
-Comment[sl]=Glavne nastavitve KPilota
-Comment[sr]=Главна подешавања у KPilot-у
-Comment[sr@Latn]=Glavna podešavanja u KPilot-u
-Comment[sv]=Kpilots huvudinställning
-Comment[ta]=கேபைலட் முக்கிய கட்டமைப்பு
-Comment[tg]=Параметрҳои умумии KPilot
-Comment[tr]=KPilot Ana Yapılandırması
-Comment[uk]=Загальні параметри KPilot
-Comment[zh_CN]=KPilot 主要配置
-Comment[zh_TW]=KPilot 主設定
-Keywords=kpilot,main
-Keywords[bg]=общи, настройки, мобилен, мобилни, устройство, устройства, kpilot, main
-Keywords[ca]=kpilot,principal
-Keywords[cs]=kpilot,hlavní
-Keywords[da]=kpilot,hoved
-Keywords[de]=KPilot
-Keywords[el]=kpilot,κύρια
-Keywords[eo]=reto,dosieroj,dosierujoj
-Keywords[es]=kpilot,principal
-Keywords[et]=kpilot,peamine
-Keywords[eu]=kpilot,nagusia
-Keywords[fa]=kpilot ،اصلی
-Keywords[fi]=kpilot
-Keywords[fr]=kpilot,principal
-Keywords[fy]=kpilot,algemien
-Keywords[ga]=kpilot,príomh
-Keywords[gl]=kpilot,principal
-Keywords[hu]=kpilot,alap
-Keywords[is]=kpilot,aðal
-Keywords[it]=kpilot,principale
-Keywords[ja]=kpilot,主要
-Keywords[km]=kpilot,សំខាន់
-Keywords[lt]=kpilot,main,pagrindinis
-Keywords[mk]=kpilot,main.кпилот,главно
-Keywords[ms]=kpilot,utama
-Keywords[nb]=kpilot,hoved
-Keywords[nds]=KPilot,Hööft,Hööftinstellen,instellen
-Keywords[ne]=केडीई पाइलट, मुख्य
-Keywords[nl]=kpilot,algemeen
-Keywords[nn]=kpilot,hovud
-Keywords[pl]=kpilot,główna,konfiguracja
-Keywords[pt]=kpilot,principal
-Keywords[pt_BR]=kpilot,principal
-Keywords[ru]=kpilot,main,общие,настройки
-Keywords[sk]=kpilot,hlavné
-Keywords[sl]=kpilot,glavne
-Keywords[sr]=kpilot,главно
-Keywords[sr@Latn]=kpilot,glavno
-Keywords[sv]=kpilot, huvudinställning
-Keywords[ta]=கேபைலட்,முக்கிய
-Keywords[tg]=kpilot,main,умумӣ,танзимот
-Keywords[tr]=kpilot,ana
-Keywords[zh_CN]=kpilot,main,主要
diff --git a/kpilot/kpilot/kpilotconduit.desktop b/kpilot/kpilot/kpilotconduit.desktop
deleted file mode 100644
index 21214231..00000000
--- a/kpilot/kpilot/kpilotconduit.desktop
+++ /dev/null
@@ -1,59 +0,0 @@
-[Desktop Entry]
-Type=ServiceType
-X-KDE-ServiceType=KPilotConduit
-Comment=KPilot Conduit
-Comment[af]=Kpilot Pad
-Comment[az]=KPilot
-Comment[be]=Канал KPilot
-Comment[bg]=Приставка на KPilot
-Comment[ca]=Conducte KPilot
-Comment[cs]=Propojení Palm Pilota
-Comment[cy]=Cwndid KPilot
-Comment[da]=KPilot-kanal
-Comment[de]=KPilot-Abgleich (Conduit)
-Comment[el]=Σύνδεσμος KPilot
-Comment[eo]=KPiloto - kanalo
-Comment[es]=Conducto KPilot
-Comment[et]=KPiloti kanal
-Comment[eu]=KPilot kanala
-Comment[fa]=لولۀ KPilot
-Comment[fi]=KPilot-yhdyskäytävä
-Comment[fr]=Canal de KPilot
-Comment[ga]=Seoladán KPilot
-Comment[gl]=Conducto de KPilot
-Comment[he]=ממשק של KPilot
-Comment[hi]=के-पायलट कन्ड्यूइट
-Comment[hr]=KPilot veza
-Comment[hu]=KPilot-csatoló
-Comment[is]=KPilot rásir
-Comment[it]=Conduit KPilot
-Comment[ja]=KPilot コンジット
-Comment[kk]=KPilot арнасы
-Comment[km]=បំពង់ KPilot
-Comment[lt]=KPilot kanalas
-Comment[lv]=KPilot Ķēde
-Comment[mk]=Канал за КПилот
-Comment[ms]=Saluran KPilot
-Comment[nb]=KPilot-kanal
-Comment[nds]=KPilot-Kanaal (Synkroniseren)
-Comment[ne]=केडीई पाइलट कन्ड्युट
-Comment[nn]=KPilot-kopling
-Comment[nso]=Conduit ya KPilot
-Comment[pl]=Łącznik KPilota
-Comment[pt]=Conduta do KPilot
-Comment[pt_BR]=Conduíte do KPilot
-Comment[ro]=Conductă KPilot
-Comment[ru]=Канал KPilot
-Comment[sk]=KPilot rúra
-Comment[sl]=Veznik za KPilot
-Comment[sr]=KPilot провод
-Comment[sr@Latn]=KPilot provod
-Comment[sv]=Kpilot-kanal
-Comment[ta]=கேபைலட் காப்புக்குழாய்
-Comment[tg]=Канали KPilot
-Comment[tr]=KPilot Kanalı
-Comment[uk]=Акведук KPilot
-Comment[ven]=Conduit ya mureili wa K
-Comment[vi]=Truyền dẫn KPilot
-Comment[zh_CN]=KPilot 管道
-Comment[zu]=KUmshayeli webhanoyi Conduit
diff --git a/kpilot/kpilot/kpilotdaemon.desktop b/kpilot/kpilot/kpilotdaemon.desktop
deleted file mode 100644
index 917beab6..00000000
--- a/kpilot/kpilot/kpilotdaemon.desktop
+++ /dev/null
@@ -1,42 +0,0 @@
-# KDE Config File
-[Desktop Entry]
-Name=KPilotDaemon
-Name[af]=Kpilotdaemon
-Name[ar]=مراقب KPilot
-Name[az]=KPilotProgramı
-Name[da]=KPilotDæmon
-Name[de]=KPilot-Dienst
-Name[el]=Δαίμονας KPilot
-Name[eo]=KPiloto-demono
-Name[es]=Demonio de KPilot
-Name[et]=KPiloti deemon
-Name[he]=תהליך הרקע של KPilot
-Name[hi]=के-पायलट-डेमन
-Name[is]=KPilot þjónn
-Name[it]=Demone KPilot
-Name[ja]=KPilot デーモン
-Name[lt]=KPilot tarnyba
-Name[lv]=KPilotDēmons
-Name[ms]=Daemon KPilot
-Name[nds]=KPilot-Dämoon
-Name[ne]=केडीई पाइलट डेइमन
-Name[nso]=Daemon ya KPilot
-Name[pl]=demon KPilota
-Name[pt_BR]=Servidor do KPilot
-Name[ro]=Demon KPilot
-Name[ru]=Служба синхронизации КПК
-Name[sk]=KPilotDémon
-Name[sr]=KPilot демон
-Name[sr@Latn]=KPilot demon
-Name[sv]=Kpilotdemon
-Name[ta]=கேபைலட் டெமன்
-Name[tg]=Демони KPilot
-Name[ven]=Daemon ya Mureili wa K
-Name[zu]=KUmshayeli webhanoyi Daemon
-Exec=kpilotDaemon
-NoDisplay=true
-Icon=kpilot.xpm
-Type=Application
-Terminal=false
-X-DCOP-ServiceType=Unique
-Categories=Qt;KDE;Utility;Office;PDA;
diff --git a/kpilot/kpilot/kpilotui.rc b/kpilot/kpilot/kpilotui.rc
deleted file mode 100644
index d5e6ac42..00000000
--- a/kpilot/kpilot/kpilotui.rc
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-
-<kpartgui name="kpilot" version="5">
-<MenuBar>
- <Menu name="file" noMerge="1"><text>&amp;File</text>
- <!-- Keep this list synchronized with pilotDaemon.cc and kpilot.cc -->
- <Action name="file_hotsync" />
- <Action name="file_fullsync" />
- <Action name="file_backup" />
- <Action name="file_restore" />
- <Action name="file_HHtoPC" />
- <Action name="file_PCtoHH" />
- <Separator />
- <Action name="file_quit" />
- </Menu>
- <Menu name="settings" noMerge="1"><text>&amp;Settings</text>
- <Action name="options_show_statusbar" />
- <Action name="options_show_toolbar" />
- <Merge name="StandardToolBarMenuHandler" />
- <Separator />
- <Action name="options_configure_keybinding" />
- <Action name="options_configure_toolbars" />
- <Action name="options_configure" />
- <Action name="options_configure_wizard" />
- </Menu>
-</MenuBar>
-
-<Menu name="rb_popup">
- <Action name="file_hotsync" />
- <Action name="file_backup" />
- <Action name="file_restore" />
- <Separator />
-</Menu>
-
-<ToolBar name="mainToolBar"><text>Main Toolbar</text>
- <Action name="popup_hotsync" />
- <Action name="file_backup" />
- <Action name="file_reload" />
- <Separator />
-</ToolBar>
-
-</kpartgui>
-
-
-<!--
-Local Variables:
-mode: xml
-sgml-omittag: nil
-sgml-shorttag: t
-sgml-general-insert-case: lower
-End:
--->
-
diff --git a/kpilot/kpilot/kroupware.cc b/kpilot/kpilot/kroupware.cc
deleted file mode 100644
index 212df17d..00000000
--- a/kpilot/kpilot/kroupware.cc
+++ /dev/null
@@ -1,311 +0,0 @@
-/* KPilot
-**
-** Copyright still to be determined.
-**
-** This file defines the actions taken when KPilot
-** is Kroupware-enabled. Basically it just does a
-** little communication with the local Kroupware agent (KMail).
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <tqfile.h>
-
-#include <dcopclient.h>
-#include <ktempfile.h>
-
-
-#include <kapplication.h>
-#include "kroupware.h"
-#include "kpilotConfig.h"
-
-KroupwareSync::KroupwareSync(bool pre,int parts,KPilotDeviceLink *p) :
- SyncAction(p,pre ? "KroupwarePreSync" : "KroupwarePostSync"),
- fPre(pre),
- fParts(parts)
-{
-
-}
-
-/* virtual */ bool KroupwareSync::exec()
-{
- FUNCTIONSETUP;
- if (fPre)
- {
- preSync();
- }
- else
- {
- postSync();
- }
- // delayDone();
- emit syncDone(this);
- return true;
-}
-
-void KroupwareSync::cleanupConfig()
-{
- // tempfile check in case app has terminated during sync
- // TODO!!! Use sensitive groups/keys for the kroupware branch...
- KConfig* c = KPilotSettings::self()->config();
- c->setGroup("todoOptions");
- if ( c->hasKey( "CalFileBackup") ) {
- TQString fn = c->readPathEntry( "CalFileBackup" );
- if ( fn != CSL1("empty") ) {
- c->writePathEntry( "CalFile" ,fn );
- c->writeEntry( "CalFileBackup" , "empty" );
- }
- }
- c->setGroup("vcalOptions");
- if ( c->hasKey( "CalFileBackup") ) {
- TQString fn = c->readPathEntry( "CalFileBackup" );
- if ( fn != CSL1("empty") ) {
- c->writePathEntry( "CalFile" ,fn );
- c->writeEntry( "CalFileBackup" , "empty" );
- }
- }
- c->setGroup("Abbrowser-conduit");
- c->writeEntry( "KMailTempFile" , "empty" );
- KPilotSettings::writeConfig();
-}
-
-// For the log messages, I've added i18n to the
-// ones I consider relevant for the user. The rest is
-// really debug info, and shouldn't go to the normal
-// sync log for the user.
-//
-// TODO!!! better way to read the config options!
-void KroupwareSync::start_syncCal_TodosWithKMail( bool cal, bool todos )
-{
- if ( !cal && ! todos )
- return;
- KConfig*c = KPilotSettings::self()->config();
- DCOPClient *client = kapp->dcopClient();
- KTempFile tempfile;
- TQString filename = tempfile.name();
- TQByteArray data, reply_data;
- TQCString reply_type;
- TQDataStream arg(data, IO_WriteOnly);
- arg << filename;
- if (!client->call( "kmail" ,
- "KOrganizerSyncIface",
- "pullSyncData(TQString)",
- data,
- reply_type,
- reply_data)) {
- logMessage( CSL1("Calling KMail over DCOP failed!" ));
- logMessage(CSL1("Not syncing calendars with KMail"));
- logMessage(CSL1("Not syncing to-dos with KMail"));
- }
- else {
- logMessage(CSL1("Calling Cal/Todo over DCOP succeeded"));
- // now prepare for syncing
- _syncWithKMail = true;
- if ( todos ) {
- logMessage( i18n("Syncing to-dos with KMail" ));
- c->setGroup("todoOptions");
- TQString fn = c->readPathEntry( "CalFile" );
- c->writePathEntry( "CalFileBackup" ,fn );
- c->writePathEntry( "CalFile" ,filename );
- }
- else
- logMessage( CSL1("Not syncing todos with KMail" ));
- if ( cal ) {
- logMessage( i18n("Syncing calendar with KMail" ));
- c->setGroup("vcalOptions");
- TQString fn = c->readPathEntry( "CalFile" );
- c->writePathEntry( "CalFileBackup" ,fn );
- c->writePathEntry( "CalFile" ,filename );
- }
- else
- logMessage( CSL1("Not syncing calendar with KMail" ));
- }
- KPilotSettings::self()->writeConfig();
-}
-
-void KroupwareSync::start_syncAddWithKMail()
-{
- logMessage( CSL1("Syncing Addresses with KMail" ));
- DCOPClient *client = kapp->dcopClient();
- KTempFile tempfile;
- TQString filename = tempfile.name();
- TQByteArray data, reply_data;
- TQCString reply_type;
- TQDataStream arg(data, IO_WriteOnly);
- arg << filename;
- if (!client->call( "kmail" ,
- "KMailIface",
- "requestAddresses(TQString)",
- data,
- reply_type,
- reply_data)) {
- logMessage(CSL1("Calling KMail over DCOP failed!" ));
- logMessage(CSL1("Not syncing Addresses with KMail"));
- }
- else {
- // TODO!!! better config handling!
- KConfig*c = KPilotSettings::self()->config();
- logMessage(CSL1("Calling addresses over DCOP succeeded"));
- c->setGroup("Abbrowser-conduit");
- c->writePathEntry( "KMailTempFile" , filename );
- KPilotSettings::self()->writeConfig();
- }
-}
-void KroupwareSync::start_syncNotesWithKMail()
-{
- logMessage( i18n("Syncing Notes with Mail" ));
- logMessage( CSL1("Syncing Notes-sorry not implemented" ));
-}
-
-void KroupwareSync::end_syncCal_TodosWithKMail( bool cal, bool todos)
-{
- if ( !cal && ! todos )
- return;
- TQString filename;
- KConfig*c=KPilotSettings::self()->config();
- if ( todos ) {
- logMessage( i18n("Rewriting to-dos to KMail..." ));
- c->setGroup("todoOptions");
- filename = c->readPathEntry( "CalFile" );
- c->writePathEntry( "CalFile", c->readPathEntry( "CalFileBackup" ) );
- c->writeEntry( "CalFileBackup", "empty");
- }
- if ( cal ) {
- logMessage( i18n("Rewriting Calendar to KMail" ));
- c->setGroup("vcalOptions");
- filename = c->readPathEntry( "CalFile" );
- TQString tf = c->readPathEntry( "CalFileBackup" ) ;
- c->writePathEntry( "CalFile" , tf );
- c->writeEntry( "CalFileBackup" ,"empty");
- }
- KPilotSettings::writeConfig();
- if ( !filename.isEmpty() ) {
- logMessage(CSL1("Try to call KMail via DCOP to finish sync..."));
- // try DCOP connection to KMail
- DCOPClient *client = kapp->dcopClient();
- TQByteArray data, reply_data;
- TQCString reply_type;
- TQDataStream arg(data, IO_WriteOnly);
- arg << filename;
- if (!client->call( "kmail" /*"korganizer" kmdcop */,
- "KOrganizerSyncIface",
- "pushSyncData(TQString)",
- data,
- reply_type,
- reply_data)) {
- logMessage( CSL1("Calling KMail over DCOP failed!" ));
- logMessage( CSL1("Sync is not complete"));
- logMessage( CSL1("Data from Palm stored in file:"));
- logMessage(filename);
- } else {
- logMessage(CSL1("Calling over DCOP succeeded"));
- logMessage(CSL1("Sync to KMail has finished successfully"));
- }
- TQFile::remove( filename );
- }
-}
-void KroupwareSync::end_syncAddWithKMail()
-{
- logMessage( i18n("Syncing KMail with Addresses " ));
- DCOPClient *client = kapp->dcopClient();
- // TODO!! better config handling (KConfig XT)
- KConfig*c = KPilotSettings::self()->config();
- c->setGroup("Abbrowser-conduit");
- TQString filename = c->readPathEntry( "KMailTempFile" );
- c->writeEntry( "KMailTempFile" , "empty" );
- KPilotSettings::writeConfig();
- TQByteArray data, reply_data;
- TQCString reply_type;
- TQDataStream arg(data, IO_WriteOnly);
- arg << filename;
- arg << TQStringList();
- if (!client->call( "kmail" ,
- "KMailIface",
- "storeAddresses(TQString, TQStringList)",
- data,
- reply_type,
- reply_data)) {
- logMessage(CSL1("Calling KMail over DCOP failed!" ));
- logMessage(CSL1("Not syncing Addresses with KMail"));
- }
- else {
- logMessage(CSL1("Calling store addresses over DCOP succeeded"));
- }
- //TQFile::remove( filename );
-}
-void KroupwareSync::end_syncNotesWithKMail()
-{
- logMessage( i18n("Syncing KMail with Notes" ));
- logMessage( CSL1("Syncing Notes-sorry not implemented" ));
-}
-
-
-
-/* static */ bool KroupwareSync::startKMail(TQString *error)
-{
- FUNCTIONSETUP;
-
- TQCString kmdcop;
- TQString mess;
- int pid;
-
- return KApplication::startServiceByDesktopName(CSL1("kmail"),
- TQString::null,
- error,
- &kmdcop,
- &pid
- )==0;
-}
-
-
-void KroupwareSync::preSync()
-{
- cleanupConfig();
- start_syncCal_TodosWithKMail( fParts & Cal, fParts & Todo );
- if (fParts & Notes)
- {
- start_syncNotesWithKMail();
- }
- if (fParts & Address)
- {
- start_syncAddWithKMail();
- }
-}
-
-void KroupwareSync::postSync()
-{
- cleanupConfig();
- end_syncCal_TodosWithKMail( fParts & Cal, fParts & Todo );
- if (fParts & Notes)
- {
- end_syncNotesWithKMail();
- }
- if (fParts & Address)
- {
- end_syncAddWithKMail();
- }
-}
-
-
-
diff --git a/kpilot/kpilot/kroupware.h b/kpilot/kpilot/kroupware.h
deleted file mode 100644
index 1bec93ab..00000000
--- a/kpilot/kpilot/kroupware.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef _KPILOT_KROUPWARE_H
-#define _KPILOT_KROUPWARE_H
-/* kroupware.h KPilot
-**
-** Copyright still to be determined.
-**
-** This file defines the actions taken when KPilot
-** is Kroupware-enabled. Basically it just does a
-** little communication with the local Kroupware agent (KMail).
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "syncAction.h"
-
-class TQString;
-
-class KroupwareSync : public SyncAction
-{
-public:
- // Creates a pre- or post-sync action
- // depending on @p pre (pre==true makes
- // it a pre-sync action, pre==false makes
- // it a post-sync action).
- //
- // Which things it syncs is based on
- // @p parts, which is a bitwise OR of
- // values from the KroupwareParts enum.
- //
- KroupwareSync(bool pre,int parts,KPilotDeviceLink *p);
-
- enum KroupwareParts
- {
- Cal=1,
- Todo=2,
- Notes=4,
- Address=8
- } ;
-
-protected:
- virtual bool exec();
-
- void preSync(); // Functions to collect all the actions
- void postSync(); // together. Call {start,end}*().
-
-protected:
- bool fPre;
- int fParts;
-
-private:
- bool _syncWithKMail;
-
- void cleanupConfig();
- void start_syncCal_TodosWithKMail( bool cal, bool todos);
- void start_syncAddWithKMail();
- void start_syncNotesWithKMail();
- void end_syncCal_TodosWithKMail( bool cal, bool todos);
- void end_syncAddWithKMail();
- void end_syncNotesWithKMail();
-
-
-public:
- /* Try to start KMail. Returns true on success. */
- static bool startKMail(TQString *errormessage);
-} ;
-
-#endif
-
diff --git a/kpilot/kpilot/listCat.cc b/kpilot/kpilot/listCat.cc
deleted file mode 100644
index 6faa3efa..00000000
--- a/kpilot/kpilot/listCat.cc
+++ /dev/null
@@ -1,272 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2000-2001 by Adriaan de Groot
-**
-** This file defines a specialization of KListView that can
-** be used to sort some fixed set of object into some fixed
-** set of categories.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <tqpainter.h>
-#include <klocale.h>
-
-#include "listCat.moc"
-
-
-ListCategorizer::ListCategorizer(TQWidget * parent,
- const char *name) :
- KListView(parent, name),
- fStartOpen(false)
-{
- FUNCTIONSETUP;
- setupWidget();
-}
-
-ListCategorizer::ListCategorizer(const TQStringList & i,
- bool startOpen,
- TQWidget * parent,
- const char *name) :
- KListView(parent, name),
- fStartOpen(startOpen)
-{
- FUNCTIONSETUP;
- addCategories(i);
-}
-
-void ListCategorizer::addCategories(const TQStringList & l)
-{
- FUNCTIONSETUP;
- TQStringList::ConstIterator i;
-
- for (i = l.begin(); i != l.end(); ++i)
- {
- (void) addCategory(*i);
- }
-}
-
-TQListViewItem *ListCategorizer::addCategory(const TQString & name,
- const TQString & desc)
-{
- FUNCTIONSETUP;
- TQListViewItem *m = new TQListViewItem(this, name, desc);
-
- m->setSelectable(false);
- m->setOpen(fStartOpen);
- return m;
-}
-
-void ListCategorizer::setupWidget()
-{
- FUNCTIONSETUP;
- addColumn(i18n("Category"));
- addColumn(i18n("Description"));
- setItemsMovable(false);
- setDragEnabled(true);
- setAcceptDrops(true);
- setDropVisualizer(true);
- setRootIsDecorated(true);
-}
-
-/* virtual */ bool ListCategorizer::acceptDrag(TQDropEvent * event) const
-{
- FUNCTIONSETUP;
- if (!(event->source()))
- return false;
- TQListViewItem *p = itemAt(event->pos());
-
- if (!p)
- return false;
-
- return true;
-}
-
-/* virtual */ void ListCategorizer::contentsDropEvent(TQDropEvent * e)
-{
- FUNCTIONSETUP;
- cleanDropVisualizer();
-
- if (!acceptDrag(e))
- return;
- e->accept();
-
- TQListViewItem *p = itemAt(e->pos());
- TQListViewItem *selection = currentItem();
-
- if (!p)
- {
- WARNINGKPILOT << "Drop without a category!" << endl;
- return;
- }
-
- TQListViewItem *category = p->parent();
-
- if (!category)
- {
- category = p;
- }
-
- moveItem(selection, category, 0L);
-}
-
-/* virtual */ void ListCategorizer::startDrag()
-{
- FUNCTIONSETUP;
- TQListViewItem *p = currentItem();
-
- if (!p || !p->parent())
- return;
-
- KListView::startDrag();
-}
-
-TQStringList ListCategorizer::listSiblings(const TQListViewItem * p, int column) const
-{
- FUNCTIONSETUP;
- TQStringList l;
-
- while (p)
- {
- l.append(p->text(column));
- p = p->nextSibling();
- }
-
- return l;
-}
-
-TQListViewItem *ListCategorizer::findCategory(const TQString & category) const
-{
- FUNCTIONSETUP;
- TQListViewItem *p = firstChild();
-
- while (p)
- {
- if (p->text(0) == category)
- return p;
- p = p->nextSibling();
- }
-
- return 0L;
-}
-
-TQListViewItem *ListCategorizer::addItem(const TQString & category,
- const TQString & name, const TQString & description)
-{
- FUNCTIONSETUP;
- TQListViewItem *p = findCategory(category);
-
- if (!p)
- return 0L;
-
- return new TQListViewItem(p, name, description);
-}
-
-#define RVPAD (4)
-
-RichListViewItem::RichListViewItem(TQListViewItem *p,
- TQString l,
- int c) :
- TQListViewItem(p,l)
-{
- FUNCTIONSETUP;
-
- fColumns=c;
- fIsRich = new bool[c];
- fRect = new QRect[c];
-
- for (int i=0; i<c; i++)
- {
- fIsRich[i]=false;
- }
-}
-
-RichListViewItem::~RichListViewItem()
-{
- FUNCTIONSETUP;
-
- delete[] fIsRich;
- delete[] fRect;
-}
-
-void RichListViewItem::computeHeight(int c)
-{
- FUNCTIONSETUP;
-
- if (!fIsRich[c]) return;
-
- TQListView *v = listView();
-
- fRect[c] = v->fontMetrics().boundingRect(v->itemMargin()+RVPAD,0+RVPAD,
- v->columnWidth(c)-v->itemMargin()-RVPAD,300,
- AlignLeft | AlignTop | WordBreak,
- text(c));
-}
-
-
-/* virtual */ void RichListViewItem::setup()
-{
- FUNCTIONSETUP;
-
- TQListViewItem::setup();
-
- int h = height();
-
- for (int i=0; i<fColumns; i++)
- {
- computeHeight(i);
- h = kMax(h,fRect[i].height()+2*RVPAD);
- }
-
- setHeight(h);
-}
-
-
-/* virtual */ void RichListViewItem::paintCell(TQPainter *p,
- const TQColorGroup &gc,
- int column,
- int width,
- int alignment)
-{
- FUNCTIONSETUP;
-
- if ((!column) || (!fIsRich[column]))
- {
- TQListViewItem::paintCell(p,gc,column,width,alignment);
- return;
- }
-
- TQListView *v = listView();
-
- p->eraseRect(0,0,width,height());
- p->setBackgroundColor(gc.background());
- p->eraseRect(RVPAD,RVPAD,width-RVPAD,height()-RVPAD);
- p->setPen(gc.text());
- p->drawText(v->itemMargin()+RVPAD,0+RVPAD,
- width-v->itemMargin()-RVPAD,height()-RVPAD,
- AlignTop | AlignLeft | WordBreak,
- text(column),
- -1,
- &fRect[column]);
-}
diff --git a/kpilot/kpilot/listCat.h b/kpilot/kpilot/listCat.h
deleted file mode 100644
index 8ccaf0d4..00000000
--- a/kpilot/kpilot/listCat.h
+++ /dev/null
@@ -1,229 +0,0 @@
-#ifndef LISTCAT_H
-#define LISTCAT_H
-/* listCat.h KPilot
-**
-** Copyright (C) 2000-2001 by Adriaan de Groot
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-*/
-
-/** @file
-** This is a specialization of KListView to allow the user to
-** DnD a fixed set of objects into a fixed set of categories
-** (categories set at construction time). @em Deprecated, do not use.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include <klistview.h>
-class TQStringList;
-
-/**
- * This Widget extends KListView for a particular purpose:
- * sorting some items into some bins. This can be useful
- * for putting items in an enabled / disabled state, or
- * into categories, or configuring toolbars (putting
- * icons onto toolbars).
- *
- * You can use all of the standard KListView signals and
- * slots. You may in particular want to change the names
- * of the columns, for example:
- * @code
- * ListCategorizer *lc = new ListCategorizer(this,colors);
- * lc->setColumnText(0,i18n("Color"));
- * lc->setColumnText(1,i18n("HTML"));
- * TQListViewItem *stdKDE = lc->addCategory(i18n("Standard KDE"));
- * (void) new TQListViewItem(stdKDE,i18n("red"),"#FF0000");
- * @endcode
- * to set sensible column headers for a list of colors
- * and their HTML equivalents (although why you would want
- * to categorize colors is beyond me).
- *
- * @version $Id$
- */
-
-class ListCategorizer : public KListView
-{
- Q_OBJECT
-
-public:
- /**
- * Constructor.
- *
- * This creates a new empty ListCategorizer with
- * startOpen set to false. The parameters
- * @p parent and @p name are the usual Qt ones.
- */
- ListCategorizer(TQWidget *parent,
- const char *name = 0);
- /**
- * Constructor.
- *
- * This creates a ListCategorizer with the given @p categories
- * already inserted. In addition, this constructor lets you
- * specify whether or not startOpen is set.
- */
- ListCategorizer(const TQStringList& categories,
- bool startOpen,
- TQWidget *parent,
- const char *name = 0);
-
- /**
- * Add a list of categories to the ListCategorizer.
- * All the categories are added without descriptions;
- * use addCategory on a per-category basis for that.
- */
- void addCategories(const TQStringList&);
- /**
- * Add a category with name @p name and optional
- * @p description. This can be useful if you want
- * either a description for the category or want to
- * refer to this category in the future without
- * using findCategory().
- *
- * @return the TQListViewItem created for the category
- */
- TQListViewItem *addCategory(const TQString& name,
- const TQString& description = TQString::null);
- /**
- * Returns the list of names of the categories in
- * the ListCategorizer.
- */
- TQStringList categories() const
- {
- return listSiblings(firstChild());
- } ;
-
- /**
- * Add a single item to the category named @p category,
- * with name @p name and description set to @p description.
- * This might be a convenience function, but it's probably
- * more convenient to just use QListViewItem's
- * constructor. That way you can also hide more data in
- * the remaining columns.
- */
- TQListViewItem *addItem(const TQString& category,
- const TQString& name,
- const TQString& description = TQString::null);
- /**
- * Returns the list of strings in column @p column under
- * category @p category. You can do this to get, for example
- * the names of all the items categorized under a given
- * category, or, more usefully, set @p column to something
- * other that 0 (name) or 1 (description) to return the
- * TQStringList hidden in the non-visible columns.
- */
- TQStringList items(const TQString& category,int column=0) const
- {
- return listSiblings(findCategory(category),column);
- }
-
- /**
- * Given a category categoryName return the QListViewItem
- * that represents that category. Probably a useless function,
- * since just remembering the pointer addCategory gives
- * you is faster and uses hardly any memory.
- */
- TQListViewItem *findCategory(const TQString& categoryName) const;
- /**
- * Return the list of strings in column @p column of all siblings
- * of the given item @p p. If you remembered a pointer to a
- * category, you can use
- * @code
- * TQStringList l = lc->listSiblings(stdKDE->firstChild(),2);
- * @endcode
- * to get the list of strings in hidden column 2 under
- * the category you remembered.
- */
- TQStringList listSiblings(const TQListViewItem *p,int column=0) const;
-
- /**
- * @return whether new categories are inserted in an
- * open state or not.
- *
- * @see setStartOpen
- */
- bool startOpen() const { return fStartOpen; } ;
- /**
- * Enable categories being inserted in an open state.
- * It is disabled by default but may be set from the
- * constructor.
- */
- void setStartOpen(bool b) { fStartOpen=b; } ;
-
-protected:
- /**
- * Reimplemented to prevent categories from being dragged.
- */
- virtual bool acceptDrag (TQDropEvent* event) const;
- /**
- * Reimplemented to prevent categories from being dragged.
- */
- virtual void startDrag();
- /**
- * Reimplemented to prevent categories from being dragged.
- */
- virtual void contentsDropEvent (TQDropEvent*);
-
-
-
-private:
- /**
- * Call several KListView functions to set up useful
- * behavior for this particular class.
- */
- void setupWidget();
-
- bool fStartOpen:1;
-} ;
-
-
-class RichListViewItem : public QListViewItem
-{
-public:
- RichListViewItem(TQListViewItem *parent,
- TQString,
- int);
- virtual ~RichListViewItem();
-
- virtual void paintCell(TQPainter *,
- const TQColorGroup &,
- int column,
- int width,
- int alignment);
-
- virtual void setup();
-
- bool isRich(int c) const { return fIsRich[c]; } ;
- void setRich(int c,bool b) { fIsRich[c]=b; } ;
-
-protected:
- void computeHeight(int c);
-
-protected:
- bool *fIsRich;
- TQRect *fRect;
- int fColumns;
-
-} ;
-
-#endif
diff --git a/kpilot/kpilot/listItems.cc b/kpilot/kpilot/listItems.cc
deleted file mode 100644
index 9984f004..00000000
--- a/kpilot/kpilot/listItems.cc
+++ /dev/null
@@ -1,242 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003 by Reinhold Kainhofer
-**
-** Program description
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-
-#include <tqstring.h>
-#include <tqlistbox.h>
-#include <tqlistview.h>
-
-
-#ifndef _KPILOT_LISTITEMS_H
-#include "listItems.h"
-#endif
-
-#ifdef DEBUG
-/* static */ int PilotListItem::crt = 0;
-/* static */ int PilotListItem::del = 0;
-/* static */ int PilotListItem::count = 0;
-
-/* static */ void PilotListItem::counts()
-{
- FUNCTIONSETUP;
- DEBUGKPILOT << fname
- << ": created=" << crt << " deletions=" << del << endl;
-}
-#endif
-
-PilotListItem::PilotListItem(const TQString & text,
- recordid_t pilotid, void *r) :
- TQListBoxText(text),
- fid(pilotid),
- fr(r)
-{
- // FUNCTIONSETUP;
-#ifdef DEBUG
- crt++;
- count++;
- if (!(count & 0xff))
- counts();
-#endif
-}
-
-PilotListItem::~PilotListItem()
-{
- // FUNCTIONSETUP;
-#ifdef DEBUG
- del++;
- count++;
- if (!(count & 0xff))
- counts();
-#endif
-}
-
-
-
-
-#ifdef DEBUG
-/* static */ int PilotCheckListItem::crt = 0;
-/* static */ int PilotCheckListItem::del = 0;
-/* static */ int PilotCheckListItem::count = 0;
-
-/* static */ void PilotCheckListItem::counts()
-{
- FUNCTIONSETUP;
- DEBUGKPILOT << fname
- << ": created=" << crt << " deletions=" << del << endl;
-}
-#endif
-
-PilotCheckListItem::PilotCheckListItem(TQListView * parent, const TQString & text, recordid_t pilotid, void *r) :
- TQCheckListItem(parent, text, TQCheckListItem::CheckBox),
- fid(pilotid),
- fr(r)
-{
- // FUNCTIONSETUP;
-#ifdef DEBUG
- crt++;
- count++;
- if (!(count & 0xff))
- counts();
-#endif
-}
-
-PilotCheckListItem::~PilotCheckListItem()
-{
- // FUNCTIONSETUP;
-#ifdef DEBUG
- del++;
- count++;
- if (!(count & 0xff))
- counts();
-#endif
-}
-
-void PilotCheckListItem::stateChange ( bool on)
-{
- // FUNCTIONSETUP;
- TQCheckListItem::stateChange(on);
-
-}
-
-
-
-
-#ifdef DEBUG
-/* static */ int PilotListViewItem::crt = 0;
-/* static */ int PilotListViewItem::del = 0;
-/* static */ int PilotListViewItem::count = 0;
-
-/* static */ void PilotListViewItem::counts()
-{
- FUNCTIONSETUP;
- DEBUGKPILOT << fname
- << ": created=" << crt << " deletions=" << del << endl;
-}
-#endif
-
-PilotListViewItem::PilotListViewItem( TQListView * parent,
- TQString label1, TQString label2, TQString label3, TQString label4,
- recordid_t pilotid, void *r):
- TQListViewItem(parent, label1, label2, label3, label4,
- TQString::null, TQString::null, TQString::null, TQString::null),
- fid(pilotid),
- fr(r),
- d(new PilotListViewItemData)
-{
- // FUNCTIONSETUP;
- if (d) d->valCol=-1;
-#ifdef DEBUG
- crt++;
- count++;
- if (!(count & 0xff))
- counts();
-#endif
-}
-
-PilotListViewItem::~PilotListViewItem()
-{
- // FUNCTIONSETUP;
-#ifdef DEBUG
- del++;
- count++;
- if (!(count & 0xff))
- counts();
-#endif
-}
-void PilotListViewItem::setNumericCol(int col, bool numeric)
-{
- // FUNCTIONSETUP;
- if (numeric)
- {
- if (!numericCols.contains(col))
- numericCols.append(col);
- }
- else
- {
- if (numericCols.contains(col))
- numericCols.remove(col);
- }
-}
-
-unsigned long PilotListViewItem::colValue(int col, bool *ok) const
-{
-// FUNCTIONSETUP;
-/* if (!d)
- {
- d=new PilotListViewItemData;
- d->valCol=-1;
- }*/
- if (d->valCol!=col)
- {
- // Use true for ascending for now...
- d->val=key(col, true).toULong(&d->valOk);
- d->valCol=col;
- }
- if (ok) (*ok)=d->valOk;
- return d->val;
-}
-
-int PilotListViewItem::compare( TQListViewItem *i, int col, bool ascending ) const
-{
-// FUNCTIONSETUP;
- PilotListViewItem*item=dynamic_cast<PilotListViewItem*>(i);
-/*#ifdef DEBUG
- DEBUGKPILOT<<"Item of dyn cast: "<<item<<endl;
-#endif*/
- if (item && numericCols.contains(col))
- {
-/*#ifdef DEBUG
- DEBUGKPILOT<<"Comparing: col "<<col<<", Ascending: "<<ascending<<endl;
-#endif*/
- bool ok1, ok2;
- /// Do the toULong call just once if the sorting column changed:
- unsigned long l1=colValue(col, &ok1);
- unsigned long l2=item->colValue(col, &ok2);
-/*#ifdef DEBUG
- DEBUGKPILOT<<"l1="<<l1<<"(ok: "<<ok1<<"), l2="<<l2<<"(ok: "<<ok2<<")"<<endl;
-#endif*/
- if (ok1 && ok2)
- {
- // Returns -1 if this item is less than i, 0 if they are
- // equal and 1 if this item is greater than i.
- int res=0;
- if (l1<l2) res=-1;
- else if (l1>l2) res=1;
- //else res=0;
-/*#ifdef DEBUG
- DEBUGKPILOT<<"RESULT="<<res<<endl;
-#endif*/
- return res;
- }
- }
- return TQListViewItem::compare(i, col, ascending);
-}
-
diff --git a/kpilot/kpilot/listItems.h b/kpilot/kpilot/listItems.h
deleted file mode 100644
index 4987219f..00000000
--- a/kpilot/kpilot/listItems.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* listItems.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a subclasse of TQListBoxText that carries
-** additional information useful for Pilot records. In particular it
-** carries an int (for the pilot's uid?) and a void * (for pilotrecord?)
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#ifndef _KPILOT_LISTITEMS_H
-#define _KPILOT_LISTITEMS_H
-
-#include <tqlistview.h>
-#include <pi-dlp.h>
-
-class PilotListItem : public QListBoxText
-{
-public:
- PilotListItem(const TQString &text, recordid_t pilotid=0, void *r=0);
- virtual ~PilotListItem();
- recordid_t id() const {return fid;};
- const void *rec() const {return fr;};
-
-
-protected:
- recordid_t fid;
- void *fr;
-
-#ifdef DEBUG
-public:
- static void counts();
-private:
- static int crt,del,bal,count;
-#endif
-};
-
-class PilotCheckListItem : public QCheckListItem
-{
-public:
- PilotCheckListItem( TQListView * parent, const TQString & text, recordid_t pilotid=0, void *r=0);
- virtual ~PilotCheckListItem();
- recordid_t id() const {return fid;};
- const void *rec() const {return fr;};
-protected:
- virtual void stateChange ( bool );
- recordid_t fid;
- void *fr;
-#ifdef DEBUG
-public:
- static void counts();
-private:
- static int crt, del, bal, count;
-#endif
-};
-
-struct PilotListViewItemData
-{
- int valCol;
- bool valOk;
- unsigned long val;
-};
-
-class PilotListViewItem : public QListViewItem
-{
-public:
- PilotListViewItem( TQListView * parent,
- TQString label1, TQString label2 = TQString::null,
- TQString label3 = TQString::null, TQString label4 = TQString::null,
- recordid_t pilotid=0, void *r=0);
- virtual ~PilotListViewItem();
- recordid_t id() const {return fid;};
- const void *rec() const {return fr;};
-public:
- void setNumericCol(int col, bool numeric);
- int compare( TQListViewItem *i, int col, bool ascending ) const;
-protected:
- TQValueList<int> numericCols;
- recordid_t fid;
- void *fr;
- // Caching to make sorting faster:
- PilotListViewItemData*d;
- unsigned long colValue(int col, bool *ok) const;
-#ifdef DEBUG
-public:
- static void counts();
-private:
- static int crt, del, bal, count;
-#endif
-};
-
-
-#endif
diff --git a/kpilot/kpilot/logFile.cc b/kpilot/kpilot/logFile.cc
deleted file mode 100644
index b7868bfd..00000000
--- a/kpilot/kpilot/logFile.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2004 by Reinhold Kainhofer
-**
-** This file defines the log file class, which logs
-** sync-messages during a HotSync to a file.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org.
-*/
-
-#include "options.h"
-
-#include <tqfile.h>
-#include <tqtextstream.h>
-#include <tqdatetime.h>
-
-#include <pi-version.h>
-
-#ifndef PILOT_LINK_PATCH
-#define PILOT_LINK_PATCH "unknown"
-#endif
-#include "logFile.h"
-#include "kpilotConfig.h"
-
-#include "logFile.moc"
-
-
-LogFile::LogFile() : DCOPObject("LogIface"), TQObject(), fOutfile(0L), fSyncing(false)
-{
- FUNCTIONSETUP;
-}
-
-
-/* DCOP */ ASYNC LogFile::logStartSync()
-{
- FUNCTIONSETUP;
- // If a sync is already running (something went wrong then!), close that old log
- if (fSyncing) logEndSync();
-
- fOutfile = new TQFile(KPilotSettings::logFileName());
-
- if (!fOutfile || !fOutfile->open(IO_WriteOnly))
- {
- WARNINGKPILOT << "Unable to open log file " << KPilotSettings::logFileName() << endl;
- KPILOT_DELETE( fOutfile );
- fSyncing = false;
- return;
- }
-
- fSyncing = true;
- fLogStream.setDevice(fOutfile);
-
- fLogStream<<(CSL1("KPilot HotSync log, %1").arg(TQDateTime::currentDateTime().toString()))<<endl<<endl<<endl;
- fLogStream<<(CSL1("Version: KPilot %1").arg(TQString::fromLatin1(KPILOT_VERSION)))<<endl;
- fLogStream<<(CSL1("Version: pilot-link %1.%2.%3%4" )
- .arg(PILOT_LINK_VERSION).arg(PILOT_LINK_MAJOR).arg(PILOT_LINK_MINOR)
-#ifdef PILOT_LINK_PATCH
- .arg(TQString::fromLatin1(PILOT_LINK_PATCH))
-#else
- .arg(TQString())
-#endif
- )<<endl;
-#ifdef KDE_VERSION_STRING
- fLogStream<<(CSL1("Version: KDE %1" ).arg(TQString::fromLatin1(KDE_VERSION_STRING)) )<<endl;
-#endif
-#ifdef QT_VERSION_STR
- fLogStream<<(CSL1("Version: Qt %1" ).arg(TQString::fromLatin1(QT_VERSION_STR)) )<<endl;
-#endif
- fLogStream<<endl<<endl;
-
-}
-
-/* DCOP */ ASYNC LogFile::logEndSync()
-{
- if (fSyncing)
- {
- logMessage(i18n("HotSync finished."));
- fLogStream.unsetDevice();
- if (fOutfile) fOutfile->close();
- KPILOT_DELETE(fOutfile)
- fSyncing=false;
- }
-}
-
-/* DCOP */ ASYNC LogFile::logMessage(TQString s)
-{
- addMessage(s);
-}
-
-/* DCOP */ ASYNC LogFile::logError(TQString s)
-{
- addMessage(s);
-}
-
-/* DCOP */ ASYNC LogFile::logProgress(TQString, int)
-{
-}
-
-
-void LogFile::addMessage(const TQString & s)
-{
- FUNCTIONSETUP;
- if ( fSyncing && !s.isEmpty() )
- {
- fLogStream<<TQTime::currentTime().toString()<<" "<<s<<endl;
- }
-}
-
diff --git a/kpilot/kpilot/logFile.h b/kpilot/kpilot/logFile.h
deleted file mode 100644
index 93614c5b..00000000
--- a/kpilot/kpilot/logFile.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef _KPILOT_LOGFILE_H
-#define _KPILOT_LOGFILE_H
-/* logFile.h KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2004 by Reinhold Kainhofer
-**
-** This file defines the log window widget, which logs
-** sync-messages during a HotSync.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org.
-*/
-
-#include "loggerDCOP.h"
-#include "tqobject.h"
-
-class TQFile;
-class TQTextStream;
-
-class LogFile : public TQObject, public LoggerDCOP
-{
-Q_OBJECT
-
-public:
- LogFile();
- ~LogFile() { } ;
-
- /**
- * DCOP interface.
- */
- virtual ASYNC logStartSync();
- virtual ASYNC logEndSync();
- virtual ASYNC logError(TQString);
- virtual ASYNC logMessage(TQString);
- virtual ASYNC logProgress(TQString,int);
-
- void addMessage(const TQString &);
-
-private:
- TQFile*fOutfile;
- bool fSyncing;
- TQTextStream fLogStream;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/logWidget.cc b/kpilot/kpilot/logWidget.cc
deleted file mode 100644
index c7bddb61..00000000
--- a/kpilot/kpilot/logWidget.cc
+++ /dev/null
@@ -1,396 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-**
-** This file defines the log window widget, which logs
-** sync-messages during a HotSync.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org.
-*/
-
-#include "options.h"
-
-#include <tqfile.h>
-#include <tqlayout.h>
-#include <tqtextedit.h>
-#include <tqwhatsthis.h>
-#include <tqdatetime.h>
-#include <tqlabel.h>
-#include <tqpixmap.h>
-#include <tqtimer.h>
-#include <tqpushbutton.h>
-#include <tqhbox.h>
-#include <tqtextstream.h>
-#include <tqpainter.h>
-
-#include <kglobal.h>
-#include <kstandarddirs.h>
-#include <kprogress.h>
-#include <kfiledialog.h>
-#include <kmessagebox.h>
-
-#include <pi-version.h>
-
-#ifndef PILOT_LINK_PATCH
-#define PILOT_LINK_PATCH "unknown"
-#endif
-
-#include "logWidget.moc"
-
-#if QT_VERSION < 0x030100
-#define TE_EOL "<br/>"
-#else
-#define TE_EOL "\n"
-#endif
-
-
-LogWidget::LogWidget(TQWidget * parent) :
- DCOPObject("LogIface"),
- PilotComponent(parent, "component_log", TQString::null),
- fLog(0L),
- fShowTime(false),
- fSplash(0L),
- fLabel(0L),
- fProgress(0L),
- fButtonBox(0L)
-{
- FUNCTIONSETUP;
- TQGridLayout *grid = new TQGridLayout(this, 4, 4, SPACING);
-
- grid->addRowSpacing(0, SPACING);
- grid->addRowSpacing(1, 100);
- grid->addColSpacing(2, 100);
- grid->addRowSpacing(3, SPACING);
- grid->addColSpacing(0, SPACING);
- grid->addColSpacing(3, SPACING);
- grid->setRowStretch(1, 50);
- grid->setColStretch(2, 50);
-
- fLog = new TQTextEdit(this);
- fLog->setReadOnly(true);
- fLog->setWordWrap(TQTextEdit::WidgetWidth);
- fLog->setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary);
-#if QT_VERSION < 0x030100
- /* nothing, use AutoText */
-#else
- fLog->setTextFormat(Qt::LogText);
-#endif
-
- TQWhatsThis::add(fLog, i18n("<qt>This lists all the messages received "
- "during the current HotSync</qt>"));
- grid->addMultiCellWidget(fLog, 1, 1,1,2);
-
-
- TQString initialText ;
-
- initialText.append(CSL1("<b>Version:</b> KPilot %1" TE_EOL)
- .arg(TQString::fromLatin1(KPILOT_VERSION)));
- initialText.append(CSL1("<b>Version:</b> pilot-link %1.%2.%3%4" TE_EOL)
- .arg(PILOT_LINK_VERSION)
- .arg(PILOT_LINK_MAJOR)
- .arg(PILOT_LINK_MINOR)
-#ifdef PILOT_LINK_PATCH
- .arg(TQString::fromLatin1(PILOT_LINK_PATCH))
-#else
- .arg(TQString())
-#endif
- );
-#ifdef KDE_VERSION_STRING
- initialText.append(CSL1("<b>Version:</b> KDE %1" TE_EOL)
- .arg(TQString::fromLatin1(KDE_VERSION_STRING)));
-#endif
-#ifdef QT_VERSION_STR
- initialText.append(CSL1("<b>Version:</b> Qt %1" TE_EOL)
- .arg(TQString::fromLatin1(QT_VERSION_STR)));
-#endif
-
- initialText.append(CSL1(TE_EOL));
- initialText.append(i18n("<qt><b>HotSync Log</b></qt>"));
- initialText.append(CSL1(TE_EOL));
-
-#if KDE_IS_VERSION(3,3,0)
-#else
- initialText.append(CSL1(TE_EOL "<qt><b>KDE 3.2 is no longer supported. Please update to KDE 3.3 or later.</b></qt>" TE_EOL));
- initialText.append(CSL1(TE_EOL "<qt><b>You may be unable to do conflict resolution.</b></qt>" TE_EOL));
-#endif
-
- fLog->setText(initialText);
- fLog->scrollToBottom();
-
- TQHBox *h = new TQHBox(this);
- h->setSpacing(SPACING);
- TQPushButton *b = new TQPushButton(
- i18n("Clear the text of HotSync messages","Clear Log"),
- h);
- TQWhatsThis::add(b,i18n("<qt>Clears the list of messages from the "
- "current HotSync.</qt>"));
- connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(clearLog()));
-
- b = new TQPushButton(i18n("Save Log..."),h);
- TQWhatsThis::add(b,i18n("<qt>You can save the list of messages received "
- "during this HotSync to a file (for example for use in a "
- "bug report) by clicking here.</qt>"));
- connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(saveLog()));
-
- fButtonBox = h;
-
- grid->addMultiCellWidget(h,2,2,1,2);
-
- fLabel = new TQLabel(i18n("Sync progress:"),this);
- grid->addWidget(fLabel,3,1);
- fProgress = new KProgress(this);
- TQWhatsThis::add(fProgress,i18n("<qt>The (estimated) percentage "
- "completed in the current HotSync.</qt>"));
- grid->addWidget(fProgress,3,2);
-
-
- TQString splashPath =
- KGlobal::dirs()->findResource("data",
- CSL1("kpilot/kpilot-splash.png"));
-
- if (!splashPath.isEmpty() && TQFile::exists(splashPath))
- {
- fLog->hide();
- fLabel->hide();
- fProgress->hide();
-
- TQPixmap splash(splashPath);
- TQPainter painter(&splash);
- painter.setPen(TQColor(0, 255, 0));
-
- // This latin1() is ok; KPILOT_VERSION is a #define
- // of a constant string.
- int textWidth =fontMetrics().width(
- TQString::fromLatin1(KPILOT_VERSION)) ;
- int textHeight = fontMetrics().height();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Using text size "
- << textWidth << "x" << textHeight
- << endl;
-#endif
-
- painter.fillRect(splash.width() - 28 - textWidth,
- splash.height() - 6 - textHeight,
- textWidth + 6,
- textHeight + 4,
- black);
- painter.drawText(splash.width() - 25 - textWidth,
- splash.height() - 8,
- TQString::fromLatin1(KPILOT_VERSION));
- fSplash = new TQLabel(this);
- fSplash->setPixmap(splash);
- fSplash->setAlignment(AlignCenter);
- TQTimer::singleShot(3000,this,TQT_SLOT(hideSplash()));
- grid->addMultiCellWidget(fSplash,1,3,1,2);
- grid->addColSpacing(0,10);
- grid->setColStretch(1,50);
- grid->setColStretch(2,50);
- grid->addColSpacing(3,10);
- }
-
-}
-
-void LogWidget::addMessage(const TQString & s)
-{
- FUNCTIONSETUP;
-
- if (s.isEmpty()) return;
- if (!fLog) return;
- TQString t;
-
- if (fShowTime)
- {
- t.append(CSL1("<b>"));
- t.append(TQTime::currentTime().toString());
- t.append(CSL1("</b> "));
- }
-
- t.append(s);
-
-#if QT_VERSION < 0x030100
- t.append(TE_EOL);
- fLog->setText(fLog->text() + t);
-#else
- fLog->append(t);
-#endif
- fLog->scrollToBottom();
-}
-
-void LogWidget::addError(const TQString & s)
-{
- FUNCTIONSETUP;
-
- if (s.isEmpty()) return;
-
- WARNINGKPILOT << "KPilot error: " << s << endl;
-
- if (!fLog) return;
-
- TQString t;
-
- t.append(CSL1("<i>"));
- t.append(s);
- t.append(CSL1("</i>"));
-
- addMessage(t);
-}
-
-void LogWidget::addProgress(const TQString &s,int i)
-{
- FUNCTIONSETUP;
-
- if (!s.isEmpty()) logMessage(s);
-
- if ((i >= 0) && (i <= 100))
- {
- // setValue seems to be in both KDE2 and
- // KDE3, but is marked deprecated in KDE3.
- //
- //
-#ifdef KDE2
- fProgress->setValue(i);
-#else
- fProgress->setProgress(i);
-#endif
- }
-}
-
-void LogWidget::syncDone()
-{
- FUNCTIONSETUP;
-
- addMessage(i18n("<b>HotSync Finished.</b>"));
-}
-
-void LogWidget::hideSplash()
-{
- FUNCTIONSETUP;
-
- if (fSplash)
- {
- fSplash->hide();
- KPILOT_DELETE(fSplash);
- }
-
- fLog->show();
- fLabel->show();
- fProgress->show();
-}
-
-
-/* DCOP */ ASYNC LogWidget::logMessage(TQString s)
-{
- addMessage(s);
-}
-
-/* DCOP */ ASYNC LogWidget::logError(TQString s)
-{
- addError(s);
-}
-
-/* DCOP */ ASYNC LogWidget::logProgress(TQString s, int i)
-{
- addProgress(s,i);
-}
-
-/* DCOP */ ASYNC LogWidget::logStartSync()
-{
-}
-
-/* DCOP */ ASYNC LogWidget::logEndSync()
-{
-}
-
-/* slot */ void LogWidget::clearLog()
-{
- FUNCTIONSETUP;
-
- if (fLog)
- {
- fLog->setText(TQString::null);
- }
-}
-
-/* slot */ void LogWidget::saveLog()
-{
- FUNCTIONSETUP;
-
- bool finished = false;
-
- while (!finished)
- {
- TQString saveFileName = KFileDialog::getSaveFileName(
- TQString::null, /* default */
- CSL1("*.log"), /* show log files by default */
- this,
- i18n("Save Log"));
-
- if (saveFileName.isEmpty()) return;
- if (TQFile::exists(saveFileName))
- {
- int r = KMessageBox::warningYesNoCancel(
- this,
- i18n("The file exists. Do you want to "
- "overwrite it?"),
- i18n("File Exists"), i18n("Overwrite"), i18n("Do Not Overwrite"));
- if (r==KMessageBox::Yes)
- {
- finished=saveFile(saveFileName);
- }
-
- if (r==KMessageBox::Cancel) return;
- }
- else
- {
- finished=saveFile(saveFileName);
- }
- }
-}
-
-
-bool LogWidget::saveFile(const TQString &saveFileName)
-{
- FUNCTIONSETUP;
-
- TQFile f(saveFileName);
- if (!f.open(IO_WriteOnly))
- {
- int r = KMessageBox::questionYesNo(this,
- i18n("<qt>Cannot open the file &quot;%1&quot; "
- "for writing; try again?</qt>"),
- i18n("Cannot Save"), i18n("Try Again"), i18n("Do Not Try"));
-
- if (r==KMessageBox::Yes) return false;
- return true;
- }
- else
- {
- TQTextStream t(&f);
- t << fLog->text();
- }
-
- f.close();
- return true;
-}
-
diff --git a/kpilot/kpilot/logWidget.h b/kpilot/kpilot/logWidget.h
deleted file mode 100644
index 2f6be95b..00000000
--- a/kpilot/kpilot/logWidget.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef _KPILOT_LOGWIDGET_H
-#define _KPILOT_LOGWIDGET_H
-/* logWidget.h KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-**
-** This file defines the log window widget, which logs
-** sync-messages during a HotSync.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org.
-*/
-
-#include "loggerDCOP.h"
-#include "pilotComponent.h"
-
-class TQLabel;
-class TQTextEdit;
-class TQHBox;
-class KProgress;
-
-class LogWidget : public PilotComponent , public LoggerDCOP
-{
-Q_OBJECT
-
-public:
- LogWidget(TQWidget *);
- ~LogWidget() { } ;
-
- // Pilot Component Methods:
- //
- bool showTime() const { return fShowTime; } ;
- void setShowTime(bool b) { fShowTime=b; } ;
-
- /**
- * DCOP interface.
- */
- virtual ASYNC logError(TQString);
- virtual ASYNC logMessage(TQString);
- virtual ASYNC logProgress(TQString,int);
- virtual ASYNC logStartSync();
- virtual ASYNC logEndSync();
-
- // GUI customization hooks
- //
- //
- TQHBox *buttonBox() const { return fButtonBox; } ;
-
-public slots:
- void addMessage(const TQString &);
- void addError(const TQString &);
- void addProgress(const TQString &,int);
- void syncDone();
-
-private slots:
- void hideSplash();
- void clearLog();
- void saveLog();
-
-private:
- bool saveFile(const TQString &);
-
-private:
- TQTextEdit *fLog;
- bool fShowTime;
- TQLabel *fSplash;
- TQLabel *fLabel;
- KProgress *fProgress;
- TQHBox *fButtonBox;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/loggerDCOP.h b/kpilot/kpilot/loggerDCOP.h
deleted file mode 100644
index 3ea3101d..00000000
--- a/kpilot/kpilot/loggerDCOP.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _KPILOT_LOGWIDGETDCOP_H
-#define _KPILOT_LOGWIDGETDCOP_H
-/* logWidgetDCOP.h KPilotDaemon
-**
-** Copyright (C) 2000 by Adriaan de Groot
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines the DCOP interface for the generalized log widget.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include <dcopobject.h>
-
-
-class LoggerDCOP : virtual public DCOPObject
-{
- K_DCOP
-
-k_dcop:
- // Indicates the start of a sync process
- virtual ASYNC logStartSync() = 0 ;
- // Indicates the end of a sync process
- virtual ASYNC logEndSync() = 0 ;
- // Adds a single message to the log, with formatting
- // showing it's an error message.
- virtual ASYNC logError(TQString) = 0 ;
- // Adds a regular message.
- virtual ASYNC logMessage(TQString) = 0 ;
- // Adds a message if the string is non-null, and
- // sets the progress bar to @p n%. Limit @p n
- // to the range 0 .. 100.
- virtual ASYNC logProgress(TQString,int n) = 0 ;
-} ;
-
-
-
-#endif
diff --git a/kpilot/kpilot/main-config.cc b/kpilot/kpilot/main-config.cc
deleted file mode 100644
index e69de29b..00000000
--- a/kpilot/kpilot/main-config.cc
+++ /dev/null
diff --git a/kpilot/kpilot/main-test.cc b/kpilot/kpilot/main-test.cc
deleted file mode 100644
index f9c9fe80..00000000
--- a/kpilot/kpilot/main-test.cc
+++ /dev/null
@@ -1,437 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2001 by Dan Pilone
-** Copyright (C) 2001,2002,2003,2004 by Adriaan de Groot
-**
-** This is the main program for kpilotTest, which shows a SyncLog and
-** exercises the KPilotDeviceLink class. It's intended to test if the
-** Palm hardware and the KPilot software are functioning correctly to
-** some extent.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org.
-*/
-
-#include "options.h"
-
-#include <stdlib.h>
-#include <time.h>
-#include <iostream>
-
-#include <tqpushbutton.h>
-#include <tqhbox.h>
-#include <tqtimer.h>
-
-#include <kapplication.h>
-#include <klocale.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kservice.h>
-#include <kservicetype.h>
-#include <kuserprofile.h>
-
-#include <pi-version.h>
-
-#include "actionQueue.h"
-#include "actions.h"
-#include "kpilotdevicelink.h"
-#include "kpilotlocallink.h"
-#include "pilot.h"
-
-#include "kpilotConfig.h"
-#include "hotSync.h"
-
-
-static KCmdLineOptions generalOptions[] = {
- {"p",0,0},
- {"port <device>",
- I18N_NOOP("Path to Pilot device node"),
- "/dev/pilot"},
- {"l",0,0},
- {"list", I18N_NOOP("List DBs"), 0},
- {"b",0,0},
- {"backup <dest dir>", I18N_NOOP("Backup Pilot to <dest dir>"), 0},
- {"r",0,0},
- {"restore <src dir>", I18N_NOOP("Restore Pilot from backup"), 0},
- {"e",0,0},
- { "exec <filename>",
- I18N_NOOP("Run conduit from desktop file <filename>"),
- 0 },
- {"c",0,0},
- { "check <what>",
- I18N_NOOP("Run a specific check (with the device)"), "help"},
- {"s",0,0},
- { "show <what>",
- I18N_NOOP("Show KPilot configuration information"), "help"},
-#ifdef DEBUG
- { "debug <level>",
- I18N_NOOP("Set the debug level"), "1" },
-#endif
- KCmdLineLastOption
-} ;
-
-static KCmdLineOptions conduitOptions[] = {
- { "T",0,0},
- { "notest",
- I18N_NOOP("*Really* run the conduit, not in test mode."),
- 0 } ,
- { "F",0,0},
- { "local",
- I18N_NOOP("Run the conduit in file-test mode."),
- 0 } ,
- { "HHtoPC",
- I18N_NOOP("Copy Pilot to Desktop."),
- 0 } ,
- { "PCtoHH",
- I18N_NOOP("Copy Desktop to Pilot."),
- 0 } ,
- { "loop",
- I18N_NOOP("Repeated perform action - only useful for --list"),
- 0 } ,
- KCmdLineLastOption
-} ;
-
-/**
-*** Conduits - sync actions - for testing specific scenarios.
-**/
-
-
-
-KPilotLink *createLink( bool local )
-{
- FUNCTIONSETUP;
- if (!local)
- {
- return new KPilotDeviceLink(0, "deviceLink");
- }
- else
- {
- return new KPilotLocalLink(0, "localLink");
- }
-}
-
-/** If @p loop is true, then instead of quitting at end of
-* sync, wait for a new sync just like the real daemon does.
-*/
-void connectStack( KPilotLink *l, ActionQueue *a, bool loop = false )
-{
- FUNCTIONSETUP;
-
- if (l && a)
- {
- TQObject::connect(a, TQT_SIGNAL(syncDone(SyncAction *)),
- l, TQT_SLOT(close()));
- if (!loop)
- {
- TQObject::connect(a, TQT_SIGNAL(syncDone(SyncAction *)),
- kapp, TQT_SLOT(quit()));
- }
- else
- {
- TQObject::connect(a, TQT_SIGNAL(syncDone(SyncAction *)),
- l, TQT_SLOT(reset()));
- }
- TQObject::connect(l, TQT_SIGNAL(deviceReady(KPilotLink*)),
- a, TQT_SLOT(execConduit()));
- }
-}
-
-
-
-int exec(const TQString &device, const TQString &what, KCmdLineArgs *p)
-{
- FUNCTIONSETUP;
-
- // get --exec-conduit value
- if (what.isEmpty()) return 1;
- TQStringList l;
- l.append(what);
-
- SyncAction::SyncMode::Mode syncMode = SyncAction::SyncMode::eHotSync;
- if (p->isSet("HHtoPC")) syncMode = SyncAction::SyncMode::eCopyHHToPC;
- if (p->isSet("PCtoHH")) syncMode = SyncAction::SyncMode::eCopyPCToHH;
- SyncAction::SyncMode mode(syncMode,p->isSet("test"),p->isSet("local"));
-
- KPilotLink *link = createLink( p->isSet("local") );
- ActionQueue *syncStack = new ActionQueue( link );
- syncStack->queueInit();
- syncStack->addAction(new CheckUser( link ));
- syncStack->queueConduits(l,mode);
- syncStack->queueCleanup();
- connectStack(link,syncStack);
- link->reset(device);
- return kapp->exec();
-}
-
-int backup(const TQString &device, const TQString &what, KCmdLineArgs *p)
-{
- FUNCTIONSETUP;
- KPilotLink *link = createLink( p->isSet("local") );
- ActionQueue *syncStack = new ActionQueue( link );
- syncStack->queueInit();
- BackupAction *ba = new BackupAction( link, true /* full backup */ );
- ba->setDirectory( what );
- syncStack->addAction( ba );
- syncStack->queueCleanup();
- connectStack(link,syncStack);
- link->reset(device);
- return kapp->exec();
-}
-
-int restore(const TQString &device, const TQString &what, KCmdLineArgs *p)
-{
- FUNCTIONSETUP;
- KPilotLink *link = createLink( p->isSet("local") );
- ActionQueue *syncStack = new ActionQueue( link );
- syncStack->queueInit();
- RestoreAction *ra = new RestoreAction( link );
- ra->setDirectory( what );
- syncStack->addAction( ra );
- syncStack->queueCleanup();
- connectStack(link,syncStack);
- link->reset(device);
- return kapp->exec();
-}
-
-int listDB(const TQString &device, KCmdLineArgs *p)
-{
- FUNCTIONSETUP;
- KPilotLink *link = createLink( p->isSet("local") );
- ActionQueue *syncStack = new ActionQueue( link );
- syncStack->queueInit();
- syncStack->addAction( new TestLink( link ) );
- syncStack->queueCleanup();
- connectStack(link,syncStack, p->isSet("loop") );
- link->reset(device);
- return kapp->exec();
-}
-
-int check( const TQString &device, const TQString &what, KCmdLineArgs *p )
-{
- FUNCTIONSETUP;
-
- if ( "help" == what )
- {
- std::cout <<
-"You can use the --check option to kpilotTest to run various\n"
-"small checks that require the use of the device. These are:\n"
-"\thelp - show this help\n"
-"\tuser - check the user name on the handheld\n"
- << std::endl;
- return 0;
- }
-
- if ( "user" == what )
- {
- KPilotLink *link = createLink( p->isSet("local") );
- ActionQueue *syncStack = new ActionQueue( link );
- syncStack->queueInit();
- syncStack->addAction( new CheckUser( link ) );
- syncStack->queueCleanup();
- connectStack(link,syncStack);
- link->reset(device);
- return kapp->exec();
- }
-
- return 0;
-}
-
-void listConduits()
-{
- FUNCTIONSETUP;
-
- KServiceTypeProfile::OfferList offers =
- KServiceTypeProfile::offers(CSL1("KPilotConduit"));
-
- // Now actually fill the two list boxes, just make
- // sure that nothing gets listed in both.
- //
- //
- TQValueListIterator < KServiceOffer > availList(offers.begin());
- while (availList != offers.end())
- {
- KSharedPtr < KService > o = (*availList).service();
-
- std::cout << "File: " << o->desktopEntryName() << std::endl;
- std::cout << " Desc: " << o->name() << std::endl;
- if (!o->library().isEmpty())
- {
- std::cout << " Lib : "
- << o->library()
- << std::endl;
- }
-
- ++availList;
- }
-}
-
-int show( const TQString &what )
-{
- FUNCTIONSETUP;
-
- if ( "help" == what )
- {
- std::cout <<
-"Displays various bits of KPilot's internal settings. This\n"
-"does not require a device connection or a running KDE desktop.\n"
-"No change to data takes place. The following options are available\n"
-"for display:\n"
-"\thelp - displays this help\n"
-"\tconduits - displays the list of available conduits\n"
-"\tuser - displays the user name KPilot expects\n"
-"\tdevice - displays the device settings in KPilot\n"
-"\tdebug - displays internal numbers\n"
- << std::endl;
- return 0;
- }
-
- if ( "conduits" == what )
- {
- listConduits();
- return 0;
- }
-
- if ( "user" == what )
- {
- std::cout << "User: " << KPilotSettings::userName() << std::endl;
- return 0;
- }
-
- if ( "device" == what )
- {
- std::cout << "Device: " << KPilotSettings::pilotDevice()
- << "\nSpeed: " << KPilotSettings::pilotSpeed()
- << "\nEncoding: " << KPilotSettings::encoding()
- << "\nQuirks: " << KPilotSettings::workarounds()
- << std::endl;
- return 0;
- }
-
- if ( "debug" == what )
- {
- std::cout << "Debug: " << KPilotSettings::debug()
- << "\nConfig: " << KPilotSettings::configVersion()
- << std::endl;
- return 0;
- }
-
- std::cerr << "Unknown --show argument, use --show help for help.\n";
- return 1;
-}
-
-int main(int argc, char **argv)
-{
-#ifdef DEBUG
- debug_level = 1;
-#endif
- FUNCTIONSETUP;
- KAboutData about("kpilotTest",
- I18N_NOOP("KPilotTest"),
- KPILOT_VERSION,
- "KPilot Tester",
- KAboutData::License_GPL, "(C) 2001-2004, Adriaan de Groot");
- about.addAuthor("Adriaan de Groot",
- I18N_NOOP("KPilot Maintainer"),
- "groot@kde.org", "http://www.kpilot.org/");
-
- KCmdLineArgs::init(argc, argv, &about);
- KCmdLineArgs::addCmdLineOptions(generalOptions,
- I18N_NOOP("General"));
- KCmdLineArgs::addCmdLineOptions(conduitOptions,
- I18N_NOOP("Conduit Actions"),"conduit");
-
- KApplication::addCmdLineOptions();
-
- KCmdLineArgs *p = KCmdLineArgs::parsedArgs();
-
- bool needGUI = false;
-
- // Some versions need a GUI
- needGUI |= (p->isSet("check"));
- needGUI |= (p->isSet("exec")); // assume worst wrt. conduits
- needGUI |= (p->isSet("restore"));
-
- KApplication a(needGUI,needGUI);
-#ifdef DEBUG
- KPilotConfig::getDebugLevel(p);
- DEBUGKPILOT << fname << "Created KApplication." << endl;
-#endif
-
- Pilot::setupPilotCodec(KPilotSettings::encoding());
-
- TQString device( "/dev/pilot" );
-
- if ( p->isSet("port") )
- {
- device = p->getOption("port");
- }
-
- if ( p->isSet("check") )
- {
- return check( device, p->getOption("check"),
- KCmdLineArgs::parsedArgs("conduit") );
- }
-
- if ( p->isSet("show") )
- {
- return show( p->getOption("show") );
- }
-
- if ( p->isSet("exec") )
- {
- return exec( device, p->getOption("exec"),
- KCmdLineArgs::parsedArgs("conduit") );
- }
-
- if ( p->isSet("list") )
- {
- return listDB( device,
- KCmdLineArgs::parsedArgs("conduit") );
- }
-
- if ( p->isSet("backup") )
- {
- return backup( device, p->getOption("backup"),
- KCmdLineArgs::parsedArgs("conduit") );
- }
-
- if ( p->isSet("restore") )
- {
- return restore( device, p->getOption("restore"),
- KCmdLineArgs::parsedArgs("conduit") );
- }
-
-
-
- std::cout <<
-"Usage: kpilotTest [--port devicename] action\n\n"
-"Where action can be one of:\n"
-"\t--list - list the databases on the handheld\n"
-"\t--show (help | conduits | ...) - show configuration\n"
-"\t--check (help | user | ...) - check device\n"
-"\t--exec conduit - run a single conduit\n"
-"\t--backup - backup the device\n"
-"\t--restore - restore the device from backup\n"
- << std::endl;
- return 1;
-}
-
-
diff --git a/kpilot/kpilot/memoWidget.cc b/kpilot/kpilot/memoWidget.cc
deleted file mode 100644
index 143167ae..00000000
--- a/kpilot/kpilot/memoWidget.cc
+++ /dev/null
@@ -1,803 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2001 by David Bishop (XML stuff)
-** Copyright (C) 2004 by Adriaan de Groot
-**
-** This is the memo-viewing widget (internal conduit) used by KPilot.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <time.h>
-
-#include <pi-macros.h>
-#include <pi-dlp.h>
-
-#include <tqdir.h>
-#include <tqptrlist.h>
-#include <tqlistbox.h>
-#include <tqfile.h>
-#include <tqpushbutton.h>
-#include <tqlayout.h>
-#include <tqdom.h>
-#include <tqtextstream.h>
-#include <tqwhatsthis.h>
-#include <tqlabel.h>
-#include <tqdatetime.h>
-#include <tqptrlist.h>
-
-#include <kapplication.h>
-#include <kmessagebox.h>
-#include <kfiledialog.h>
-#include <kdeversion.h>
-#include <ktextedit.h>
-
-#include "kpilot.h"
-#include "kpilotConfig.h"
-#include "listItems.h"
-#include "pilotLocalDatabase.h"
-#include "pilotMemo.h"
-
-#include "memoWidget.moc"
-
-
-class MemoWidget::Private
-{
-public:
- Private() : fMemoAppInfo(0L) { } ;
- ~Private() { KPILOT_DELETE(fMemoAppInfo); } ;
-
- PilotMemoInfo *fMemoAppInfo;
- TQPtrList<PilotMemo> fMemoList;
-} ;
-
-
-MemoWidget::MemoWidget(TQWidget * parent,
- const TQString & path) :
- PilotComponent(parent, "component_memo", path),
- fTextWidget(0L),
- d(new Private()),
- lastSelectedMemo(-1)
-{
- FUNCTIONSETUP;
-
- setGeometry(0, 0,
- parent->geometry().width(), parent->geometry().height());
- setupWidget();
- d->fMemoList.setAutoDelete(true);
- slotUpdateButtons();
-}
-
-MemoWidget::~MemoWidget()
-{
- FUNCTIONSETUP;
- saveChangedMemo();
- KPILOT_DELETE(d);
-}
-
-
-// void MemoWidget::initializeMemos(PilotDatabase *memoDB)
-//
-// Reads all the memos from the local database and places them
-// in the selection screen.
-//
-
-void MemoWidget::initializeMemos(PilotDatabase * memoDB)
-{
- FUNCTIONSETUP;
-
-
- // ShowSecrets tells us to also list memos with an attribute of "Secret"
- // or "Private"
- //
- bool showSecrets = KPilotSettings::showSecrets();
-
- d->fMemoList.clear();
-
-
- int currentRecord = 0;
- PilotRecord *pilotRec;
- PilotMemo *memo;
-
- while ((pilotRec = memoDB->readRecordByIndex(currentRecord)) != NULL)
- {
- if (!pilotRec->isDeleted())
- {
- if ((!pilotRec->isSecret()) || showSecrets)
- {
- memo = new PilotMemo(pilotRec);
- d->fMemoList.append(memo);
-
-#ifdef DEBUG
- DEBUGKPILOT << fname <<
- ": Added memo "
- << currentRecord << endl;
-#endif
- }
- else
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname <<
- ": Skipped secret record " <<
- currentRecord << endl;
-#endif
- }
- }
- else
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname <<
- ": Skipped deleted record " <<
- currentRecord << endl;
-#endif
- }
-
- delete pilotRec;
-
- currentRecord++;
- }
-}
-
-
-void MemoWidget::showComponent()
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- // Get the local database - assume the call may fail and return
- // NULL, or the database object may be returned but unopened.
- //
- //
- PilotLocalDatabase *memoDB =
- new PilotLocalDatabase(dbPath(), CSL1("MemoDB"));
- if (memoDB == NULL || !memoDB->isOpen())
- {
- WARNINGKPILOT << "Can't open local database MemoDB\n";
-
- populateCategories(fCatList, 0L);
- updateWidget();
- return;
- }
-
- KPILOT_DELETE(d->fMemoAppInfo);
- d->fMemoAppInfo = new PilotMemoInfo(memoDB);
-
- d->fMemoAppInfo->dump();
- populateCategories(fCatList, d->fMemoAppInfo->categoryInfo());
- initializeMemos(memoDB);
-
- KPILOT_DELETE( memoDB );
-
- updateWidget();
-}
-
-void MemoWidget::hideComponent()
-{
- FUNCTIONSETUP;
- saveChangedMemo();
- fCatList->clear();
- fTextWidget->clear();
- d->fMemoList.clear();
- fListBox->clear();
- lastSelectedMemo = -1;
-}
-
-void MemoWidget::postHotSync()
-{
- FUNCTIONSETUP;
- d->fMemoList.clear();
- showComponent();
-}
-
-
-// void MemoWidget::setupWidget()
-//
-// Setup all the GUI components by allocating them.
-//
-//
-void MemoWidget::setupWidget()
-{
- FUNCTIONSETUP;
-
- TQLabel *label = NULL;
- TQPushButton *button = NULL;
- TQGridLayout *grid = new TQGridLayout(this, 5, 4, SPACING);
- TQString wt;
-
- fCatList = new TQComboBox(this);
- grid->addWidget(fCatList, 0, 1);
- connect(fCatList, TQT_SIGNAL(activated(int)),
- this, TQT_SLOT(slotSetCategory(int)));
- TQWhatsThis::add(fCatList,
- i18n("Select the category of addresses\n"
- "to display here."));
-
- (void) i18n("Memos:");
- label = new TQLabel(i18n("Category:"), this);
- label->setBuddy(fCatList);
- grid->addWidget(label, 0, 0);
-
- fListBox = new TQListBox(this);
- grid->addMultiCellWidget(fListBox, 1, 1, 0, 1);
- connect(fListBox, TQT_SIGNAL(highlighted(int)),
- this, TQT_SLOT(slotShowMemo(int)));
- connect(fListBox, TQT_SIGNAL(selectionChanged()),
- this,TQT_SLOT(slotUpdateButtons()));
- TQWhatsThis::add(fListBox,
- i18n("This list displays all the memos\n"
- "in the selected category. Click on\n"
- "one to display it to the right."));
-
- label = new TQLabel(i18n("Memo text:"), this);
- grid->addWidget(label, 0, 2);
-
- fTextWidget = new KTextEdit(this, "textArea");
- fTextWidget->setWordWrap(KTextEdit::WidgetWidth);
- fTextWidget->setTextFormat(Qt::PlainText);
- grid->addMultiCellWidget(fTextWidget, 1, 4, 2, 2);
- TQWhatsThis::add(fTextWidget,
- i18n("The text of the selected memo appears here."));
- fTextWidget->setReadOnly(!KPilotSettings::internalEditors());
-
- button = new TQPushButton(i18n("Import Memo..."), this);
- grid->addWidget(button, 2, 0);
- connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotImportMemo()));
- wt = KPilotSettings::internalEditors() ?
- i18n ("Read a text file and add it to the Pilot's memo database.") :
- i18n("<qt><i>Import is disabled by the 'internal editors' setting.</i></qt>");
- TQWhatsThis::add(button,wt);
-
- fExportButton = new TQPushButton(i18n("Export Memo..."), this);
- grid->addWidget(fExportButton, 2, 1);
- connect(fExportButton, TQT_SIGNAL(clicked()), this,
- TQT_SLOT(slotExportMemo()));
- TQWhatsThis::add(fExportButton,
- i18n("Write the selected memo to a file."));
-
- fDeleteButton = new TQPushButton(i18n("Delete Memo"), this);
- grid->addWidget(fDeleteButton, 3, 1);
- connect(fDeleteButton, TQT_SIGNAL(clicked()), this,
- TQT_SLOT(slotDeleteMemo()));
- wt = KPilotSettings::internalEditors() ?
- i18n("Delete the selected memo.") :
- i18n("<qt><i>Deleting is disabled by the 'internal editors' setting.</i></qt>") ;
- TQWhatsThis::add(fDeleteButton, wt);
-
- button = new TQPushButton(i18n("Add Memo"), this);
- grid->addWidget(button, 3, 0);
- connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddMemo()));
- TQWhatsThis::add(button,i18n("Add a new memo to the database."));
-}
-
-void MemoWidget::slotUpdateButtons()
-{
- FUNCTIONSETUP;
-
- bool highlight = false;
-
- if ((fListBox->currentItem() != -1) &&
- (fListBox->isSelected(fListBox->currentItem())))
- highlight=true;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Selected items " << highlight << endl;
-#endif
-
- if (fExportButton)
- {
- fExportButton->setEnabled(highlight);
- }
-
- // The remaining buttons are relevant only if the
- // internal editors are editable.
- highlight &= KPilotSettings::internalEditors() ;
- if (fDeleteButton)
- {
- fDeleteButton->setEnabled(highlight);
- }
-}
-
-void MemoWidget::slotSetCategory(int)
-{
- FUNCTIONSETUP;
- updateWidget();
-}
-
-void MemoWidget::slotDeleteMemo()
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- int item = fListBox->currentItem();
-
- if (item == -1)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": No current item selected\n";
-#endif
- return;
- }
- if (KMessageBox::questionYesNo(this,
- i18n("Delete currently selected memo?"),
- i18n("Delete Memo?"), KStdGuiItem::del(), KStdGuiItem::cancel()) != KMessageBox::Yes)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname <<
- ": User decided not to delete memo.\n";
-#endif
- return;
- }
-
- PilotListItem *p = (PilotListItem *) fListBox->item(item);
- PilotMemo *selectedMemo = (PilotMemo *) p->rec();
-
- if (selectedMemo->id() == 0x0)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Searching for record to delete (it's fresh)" << endl;
-#endif
- PilotLocalDatabase *memoDB = new PilotLocalDatabase(dbPath(), CSL1("MemoDB"));
- if (!memoDB || (!memoDB->isOpen()))
- {
- // Err.. peculiar.
- WARNINGKPILOT << "Can't open MemoDB" << endl;
- KMessageBox::sorry(this,
- i18n("Cannot open MemoDB to delete record."),
- i18n("Cannot Delete Memo"));
- return;
- }
- memoDB->resetDBIndex();
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Searching for new record." << endl;
-#endif
- const PilotRecord *r = 0L;
- while ((r = memoDB->findNextNewRecord()))
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": got record " << (void *) r << endl;
-#endif
- PilotMemo m(r);
- if (m.text() == selectedMemo->text())
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": I think I found the memo." << endl;
-#endif
- (const_cast<PilotRecord *>(r))->setDeleted(true);
- break;
- }
- }
- delete memoDB;
- }
- else
- {
- selectedMemo->setDeleted(true);
- writeMemo(selectedMemo);
- }
- d->fMemoList.remove(selectedMemo);
- delete p;
-}
-
-
-void MemoWidget::updateWidget()
-{
- FUNCTIONSETUP;
- if (!shown || !d->fMemoAppInfo ) return;
-
- if (fCatList->currentItem() == -1)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": No category selected.\n";
-#endif
- return;
- }
-
- int listIndex = 0;
- int currentCatID = findSelectedCategory(fCatList,
- d->fMemoAppInfo->categoryInfo(), false);
-
-
- fListBox->clear();
- d->fMemoList.first();
-
-
- // Iterate through all the memos and insert each memo
- // only if the category of the memo matches the selected category
- // (using -1 to mean "All")
- //
- //
- while (d->fMemoList.current())
- {
- PilotMemo *curr = d->fMemoList.current();
- if ((curr->category() == currentCatID) ||
- (currentCatID == -1))
- {
- PilotListItem *p =
- new PilotListItem(curr->shortTitle(),
- listIndex,
- curr);
-
- // List will delete the title of the memo,
- // so there's no memory leak here.
- //
- //
- fListBox->insertItem(p);
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Added memo "
- << curr->getTitle() << endl;
-#endif
- }
- else
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Skipped memo "
- << curr->getTitle() << endl;
-#endif
- }
-
- listIndex++;
- d->fMemoList.next();
- }
-
- fTextWidget->clear();
-
- slotUpdateButtons();
-
- lastSelectedMemo=-1;
-}
-
-void MemoWidget::showMemo(const PilotMemo *m)
-{
- FUNCTIONSETUP;
-
- int index = fListBox->count();
- for (int x = 0; x < index; x++)
- {
- PilotMemo *p = (PilotMemo *) ((PilotListItem *)fListBox->item(x))->rec();
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Memo @" << (void *) p <<endl;
- DEBUGKPILOT << fname << " :" << fListBox->item(x)->text() << endl;
-#endif
- if (m==p)
- {
- fListBox->setSelected(x,true);
- slotShowMemo(x);
- break;
- }
- }
-
-}
-
-void MemoWidget::slotShowMemo(int which)
-{
- FUNCTIONSETUP;
- if ( which == -1 ) return;
- if (!shown) return;
-
- slotUpdateButtons();
- if ( !fListBox->isSelected(which) )
- {
- // Handle unselecting a memo. This is easy.
- fTextWidget->blockSignals(true);
- fTextWidget->clear();
- fTextWidget->blockSignals(false);
- return;
- }
-
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Displaying memo " << which << endl;
-#endif
- fTextWidget->blockSignals(true);
- PilotListItem *p = (PilotListItem *) fListBox->item(which);
- PilotMemo *theMemo = (PilotMemo *) p->rec();
- fTextWidget->setText(theMemo->text());
- fTextWidget->blockSignals(false);
-}
-
-
-void MemoWidget::writeMemo(PilotMemo * which)
-{
- FUNCTIONSETUP;
- if (!shown) return;
- PilotRecord *pilotRec = which->pack();
- PilotDatabase *memoDB = new PilotLocalDatabase(dbPath(), CSL1("MemoDB"));
- memoDB->writeRecord(pilotRec);
- markDBDirty(CSL1("MemoDB"));
- KPILOT_DELETE( memoDB );
- KPILOT_DELETE( pilotRec );
-}
-
-void MemoWidget::saveChangedMemo()
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- if (-1 == lastSelectedMemo) return;
- if (!fTextWidget->isModified()) return;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Saving changed memo " << lastSelectedMemo << endl;
-#endif
-
- PilotListItem *p =
- (PilotListItem *) fListBox->item(lastSelectedMemo);
- PilotMemo *currentMemo = (PilotMemo *) p->rec();
-
-// TODO: overload setText in PilotMemo
- currentMemo->setText(Pilot::toPilot(fTextWidget->text()));
- writeMemo(currentMemo);
-}
-
-/* virtual */ bool MemoWidget::preHotSync(TQString &)
-{
- FUNCTIONSETUP;
- saveChangedMemo();
- return true;
-}
-
-bool MemoWidget::addMemo(const TQString &s, int category)
-{
- FUNCTIONSETUP;
-
- if (s.length() >= MemoWidget::MAX_MEMO_LEN)
- {
- return false;
- }
- if ((category<0) || (category>=(int)Pilot::CATEGORY_COUNT))
- {
- category=Pilot::Unfiled;
- }
-
- PilotMemo *aMemo = new PilotMemo();
- aMemo->setCategory(category);
- aMemo->setText(s);
-
- d->fMemoList.append(aMemo);
- writeMemo(aMemo);
- updateWidget();
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": New memo @" << (void *)aMemo << endl;
-#endif
- showMemo(aMemo);
- return true;
-}
-
-void MemoWidget::slotAddMemo()
-{
- FUNCTIONSETUP;
- int currentCatID = findSelectedCategory(fCatList,
- d->fMemoAppInfo->categoryInfo(), true);
- addMemo(TQDateTime::currentDateTime().toString(), currentCatID);
-}
-
-void MemoWidget::slotImportMemo()
-{
- FUNCTIONSETUP;
- if (!shown || !d->fMemoAppInfo ) return;
-
- int currentCatID = findSelectedCategory(fCatList,
- d->fMemoAppInfo->categoryInfo(), true);
-
- TQString fileName = KFileDialog::getOpenFileName();
-
- if (!fileName.isEmpty())
- {
- TQFile importFile(fileName);
-
- if (importFile.open(IO_ReadOnly) == FALSE)
- {
- // show error!
- return;
- }
-
- if (importFile.size() > MemoWidget::MAX_MEMO_LEN)
- {
- // Perhaps read first 64k?
- return;
- }
-
- TQTextStream stream(&importFile);
- TQString memoText = stream.read();
- addMemo(memoText, currentCatID);
- }
-}
-
-void MemoWidget::slotExportMemo()
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- int index = fListBox->numRows();
- if (index == 0)
- return;
-
- TQString data;
-
- const TQString filter = CSL1("*|Plain text output\n*.xml|XML output");
- TQString fileName;
-
- KFileDialog kfile( TQString::null , filter, fExportButton , "memoSave" , true );
- kfile.setOperationMode( KFileDialog::Saving );
-
- if ( kfile.exec() == TQDialog::Accepted ) {
- fileName = kfile.selectedFile();
- }
-
- if (fileName.isEmpty())
- return;
-
- TQPtrList<PilotListItem> menu_items;
-
- for (int x = 0; x < index; x++){
- if (fListBox->item(x)->isSelected()){
- menu_items.append((PilotListItem *) fListBox->item(x));
- }
- }
-
- if (kfile.currentFilter() == CSL1("*.xml") )
- {
- MemoWidget::saveAsXML( fileName , menu_items );
- }
- else
- {
- MemoWidget::saveAsText( fileName , menu_items );
- }
-
-
- return;
-}
-
-bool MemoWidget::saveAsText(const TQString &fileName,const TQPtrList<PilotListItem> &memo_list)
-{
- TQFile f( fileName );
- TQTextStream stream(&f);
-
- if ( TQFile::exists( fileName ) )
- {
- if( !f.open(IO_ReadWrite | IO_Append) )
- {
- return false;
- }
- }
- else
- {
- if( !f.open(IO_WriteOnly) )
- {
- return false;
- }
- }
-
- TQPtrListIterator<PilotListItem> it(memo_list);
- for ( ; it.current(); ++it )
- {
- PilotListItem *p = it.current();
- PilotMemo *theMemo = (PilotMemo *) p->rec();
- stream << theMemo->text() << endl;
- }
-
-
- return true;
-}
-
-bool MemoWidget::saveAsXML(const TQString &fileName,const TQPtrList<PilotListItem> &memo_list)
-{
- TQDomDocument doc( CSL1("kpilotmemos") );
- TQFile f( fileName );
- TQTextStream stream( &f );
- TQDomElement memos;
- int append = 0;
-
-
- if ( f.exists() )
- {
- if ( !f.open(IO_ReadOnly ) ) return false;
-
- if ( doc.setContent( &f ) )
- {
- //
- //
- //Only if QDom can read the .xml file and set the doc object to be populated with it's contents
- memos = doc.documentElement();
- if ( memos.tagName()!= CSL1("memos") )
- {
- return false;
- }
- //
- //
- //This is an XML Document but it isn't a valid KPilot-Memo xml document
- else
- {
- append = 1;
- }
- //
- //
- //This is a valid KPilot memo, and we will append the current memo to the xml
- }
- else
- {
- //
- //
- //We *couldn't* understand the xml. Return false!
- return false;
- }
- }
- else
- {
- if ( !f.open(IO_ReadWrite ) ) return false;
- //
- //
- //If there's no such file, we are not appending, just opening the file to read/write.
- }
-
- f.close();
- // These are temporary, and should be retrieved from the pilot stuff
- TQString mpilotid;
- mpilotid = "1";
- // End of temp variables
-
- if (append == 1)
- {
- memos = doc.documentElement();
- }
- else
- {
- memos = doc.createElement( CSL1("memos") );
- doc.appendChild ( memos );
- }
-
- TQPtrListIterator<PilotListItem> it(memo_list);
- for ( ; it.current(); ++it )
- {
- PilotListItem *p = it.current();
- PilotMemo *theMemo = (PilotMemo *) p->rec();
-
-
- TQDomElement memo = doc.createElement( CSL1("memo") );
- memo.setAttribute ( CSL1("pilotid") , mpilotid );
- memos.appendChild ( memo );
-
- //TQDomElement category = doc.createElement( "category" );
- //head.appendChild ( category );
- //
- //TQDomText categorytext = doc.createTextNode( memo->category() );
- //category.appendChild ( categorytext );
- //FIXME
-
- TQDomElement title = doc.createElement(CSL1("title" ));
- memo.appendChild ( title );
-
- TQDomText titletext = doc.createTextNode( theMemo->shortTitle() );
- title.appendChild ( titletext );
-
- TQDomText body = doc.createTextNode( theMemo->text() );
- memo.appendChild ( body );
- }
- if ( !f.open(IO_WriteOnly ) ) return false;
- stream << doc.toString();
- return true;
-}
-
diff --git a/kpilot/kpilot/memoWidget.h b/kpilot/kpilot/memoWidget.h
deleted file mode 100644
index 87038347..00000000
--- a/kpilot/kpilot/memoWidget.h
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef _KPILOT_MEMOWIDGET_H
-#define _KPILOT_MEMOWIDGET_H
-/* memoWidget.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-**
-** This is the memo viewer widget.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "pilotComponent.h"
-
-class KPilotInstaller;
-class TQListBox;
-class TQComboBox;
-class TQPushButton;
-class KTextEdit;
-
-class PilotMemo;
-class PilotListItem;
-
-class MemoWidget : public PilotComponent
-{
-Q_OBJECT
-
-public:
- MemoWidget(TQWidget* parent, const TQString& dbpath);
- virtual ~MemoWidget();
-
- // Pilot Component Methods:
- /* virtual */ void showComponent();
- /* virtual */ void hideComponent();
- /* virtual */ bool preHotSync(TQString &);
- /* virtual */ void postHotSync();
-
- // Added by David Bishop, please move to correct location!
- bool saveAsXML(const TQString &fileName,const TQPtrList<PilotListItem> &menu_item );
- bool saveAsText(const TQString &fileName,const TQPtrList<PilotListItem> &menu_item );
-
- typedef enum {
- MAX_MEMO_LEN = 8192
- } Constants ;
-
-protected:
- void initializeCategories(PilotDatabase *);
- void initializeMemos(PilotDatabase *);
-
- void saveChangedMemo();
-
- bool addMemo(const TQString &text, int category);
-
-public slots:
- /**
- * Called whenever the selected memo changes in order to:
- * - display it if necessary
- * - update which buttons are active, to prevent the delete
- * button from being active when it can't do anything.
- *
- */
- void slotShowMemo(int);
- void slotUpdateButtons();
-
- void slotImportMemo();
- void slotExportMemo();
- void slotDeleteMemo();
- void slotAddMemo();
- void slotSetCategory(int);
-
-protected:
- void showMemo(const PilotMemo *);
-
-
-private:
- void setupWidget();
- void updateWidget(); // Called with the lists have changed..
- void writeMemo(PilotMemo* which);
-
- class Private;
-
- TQComboBox* fCatList;
-
- KTextEdit* fTextWidget;
- Private *d;
- TQListBox* fListBox;
-
- TQPushButton *fExportButton,*fDeleteButton;
-
- int lastSelectedMemo;
-};
-
-
-#endif
diff --git a/kpilot/kpilot/pilot-addresses.c b/kpilot/kpilot/pilot-addresses.c
deleted file mode 100644
index 823a6825..00000000
--- a/kpilot/kpilot/pilot-addresses.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * pilot-addresses.c: Palm address transfer utility
- *
- * 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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include "pi-socket.h"
-#include "pi-dlp.h"
-#include "pi-address.h"
-#include "pi-header.h"
-
-/* These are indexes in the tabledelims array */
-enum terminators { term_newline=0,
- term_comma=1,
- term_semi=2,
- term_tab=3 } ;
-terminators tabledelim = term_comma;
-char tabledelims[4] = { '\n', ',', ';', '\t' };
-
-
-
-int realentry[21] =
- { 0, 1, 13, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20 };
-
-const char *tableheads[21] = {
- "Last name", /* 0 */
- "First name", /* 1 */
- "Title", /* 2 (real entry 13)*/
- "Company", /* 3 */
- "Phone1", /* 4 */
- "Phone2", /* 5 */
- "Phone3", /* 6 */
- "Phone4", /* 7 */
- "Phone5", /* 8 */
- "Address", /* 9 */
- "City", /* 10 */
- "State", /* 11 */
- "Zip Code", /* 12 */
- "Country", /* 13 */
- "Custom 1", /* 14 */
- "Custom 2", /* 15 */
- "Custom 3", /* 16 */
- "Custom 4", /* 17 */
- "Note", /* 18 */
- "Private", /* 19 */
- "Category" /* 20 */
-};
-
-int
- augment = 0,
- defaultcategory = 0;
-
-
-
-/***********************************************************************
- *
- * Function: inchar
- *
- * Summary: Turn the protected name back into the "original"
- * characters
- *
- * Parameters:
- *
- * Returns: Modified character, 'c'
- *
- ***********************************************************************/
-int inchar(FILE * in)
-{
- int c; /* switch */
-
- c = getc(in);
- if (c == '\\') {
- c = getc(in);
- switch (c) {
- case 'b':
- c = '\b';
- break;
- case 'f':
- c = '\f';
- break;
- case 'n':
- c = '\n';
- break;
- case 't':
- c = '\t';
- break;
- case 'r':
- c = '\r';
- break;
- case 'v':
- c = '\v';
- break;
- case '\\':
- c = '\\';
- break;
- default:
- ungetc(c, in);
- c = '\\';
- break;
- }
- }
- return c;
-}
-
-
-/***********************************************************************
- *
- * Function: read_field
- *
- * Summary: Reach each field of the CSV during read_file
- *
- * Parameters: dest <-> Buffer for storing field contents
- * in --> Inbound filehandle
- * length --> Size of buffer
- *
- * Returns: 0 for end of line
- * 1 for , termination
- * 2 for ; termination
- * 3 for \t termination
- * -1 on end of file
- *
- * Note that these correspond to indexes in the tabledelims
- * array, and should be preserved.
- *
- ***********************************************************************/
-int read_field(char *dest, FILE *in, size_t length)
-{
- int c;
-
- if (length<=1) return -1;
- /* reserve space for trailing NUL */
- length--;
-
- do { /* Absorb whitespace */
- c = getc(in);
- if(c == '\n') {
- *dest = 0;
- return term_newline;
- }
-
- } while ((c != EOF) && ((c == ' ') || (c == '\t') || (c == '\r')));
-
- if (c == '"') {
- c = inchar(in);
-
- while (c != EOF) {
- if (c == '"') {
- c = inchar(in);
- if (c != '"')
- break;
- }
- *dest++ = c;
- if (!(--length))
- break;
- c = inchar(in);
- }
- } else {
- while (c != EOF) {
- if ((c == '\n') || (c == tabledelims[tabledelim])) {
- break;
- }
- *dest++ = c;
- if (!(--length))
- break;
- c = inchar(in);
- }
- }
- *dest++ = '\0';
-
- /* Absorb whitespace */
- while ((c != EOF) && ((c == ' ') || (c == '\t')))
- c = getc(in);
-
- if (c == ',')
- return term_comma;
-
- else if (c == ';')
- return term_semi;
-
- else if (c == '\t')
- return term_tab;
-
- else if (c == EOF)
- return -1; /* No more */
- else
- return term_newline;
-}
-
-
-/***********************************************************************
- *
- * Function: outchar
- *
- * Summary: Protect each of the 'illegal' characters in the output
- *
- * Parameters: filehandle
- *
- * Returns: Nothing
- *
- ***********************************************************************/
-void outchar(char c, FILE * out)
-{
- switch (c) {
- case '"':
- putc('"', out);
- putc('"', out);
- break;
- case '\b':
- putc('\\', out);
- putc('b', out);
- break;
- case '\f':
- putc('\\', out);
- putc('f', out);
- break;
- case '\n':
- putc('\\', out);
- putc('n', out);
- break;
- case '\t':
- putc('\\', out);
- putc('t', out);
- break;
- case '\r':
- putc('\\', out);
- putc('r', out);
- break;
- case '\v':
- putc('\\', out);
- putc('v', out);
- break;
- case '\\':
- putc('\\', out);
- putc('\\', out);
- break;
- default:
- putc(c, out);
- break;
- }
-}
-
-
-/***********************************************************************
- *
- * Function: write_field
- *
- * Summary: Write out each field in the CSV
- *
- * Parameters: out --> output file handle
- * source --> NUL-terminated data to output
- * more --> delimiter number
- *
- * Returns:
- *
- ***********************************************************************/
-int write_field(FILE * out, const char *source, enum terminators more)
-{
- putc('"', out);
-
- while (*source) {
- outchar(*source, out);
- source++;
- }
- putc('"', out);
-
- putc(tabledelims[more], out);
- return 0;
-}
-
-
-
-
-/***********************************************************************
- *
- * Function: match_phone
- *
- * Summary: Find and match the 'phone' entries in 'buf'
- *
- * Parameters:
- *
- * Returns:
- *
- ***********************************************************************/
-int match_phone(char *buf, struct AddressAppInfo *aai)
-{
- int i;
-
- for (i = 0; i < 8; i++)
- if (strncasecmp(buf, aai->phoneLabels[i], sizeof(aai->phoneLabels[0])) == 0)
- return i;
- return atoi(buf); /* 0 is default */
-}
-
-
-
-/***********************************************************************
- *
- * Function: write_file
- *
- * Summary: Writes Address records in CSV format to <file>
- *
- * Parameters: filehandle
- *
- * Returns: 0
- *
- ***********************************************************************/
-
-void write_record_CSV(FILE *out, const struct AddressAppInfo *aai, const struct Address *addr, const int attribute, const int category, const int augment)
-{
- int j;
- char buffer[16];
-
- if (augment && (category || addr->showPhone)) {
- write_field(out,
- aai->category.name[category],
- term_semi);
- write_field(out,
- aai->phoneLabels[addr->phoneLabel[addr->showPhone]],
- term_semi);
- }
-
- for (j = 0; j < 19; j++) {
- if (addr->entry[realentry[j]]) {
- if (augment && (j >= 4) && (j <= 8)) {
- write_field(out,
- aai->phoneLabels[addr->phoneLabel
- [j - 4]], term_semi);
- }
- write_field(out, addr->entry[realentry[j]],
- tabledelim);
- } else {
- write_field(out, "", tabledelim);
- }
- }
-
- snprintf(buffer, sizeof(buffer), "%d", (attribute & dlpRecAttrSecret) ? 1 : 0);
- write_field(out, buffer, tabledelim);
-
- write_field(out,
- aai->category.name[category],
- term_newline);
-}
diff --git a/kpilot/kpilot/pilotComponent.cc b/kpilot/kpilot/pilotComponent.cc
deleted file mode 100644
index 0172a44e..00000000
--- a/kpilot/kpilot/pilotComponent.cc
+++ /dev/null
@@ -1,190 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines a base class for components -- internal conduits --
-** in KPilot. This includes a number of general utility functions.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include "options.h"
-
-#include <time.h>
-
-#include <pi-appinfo.h>
-
-#include <tqwidget.h>
-#include <tqcombobox.h>
-
-#include <kdebug.h>
-
-#include "kpilotConfig.h"
-#include "pilotRecord.h"
-#include "pilot.h"
-
-#include "pilotComponent.moc"
-
-PilotComponent::PilotComponent(TQWidget * parent,
- const char *id,
- const TQString & path) :
- TQWidget(parent, id),
- fDBPath(path),
- shown(false)
-{
- FUNCTIONSETUP;
-
- if (parent)
- {
- resize(parent->geometry().width(),
- parent->geometry().height());
- }
-
-}
-
-
-
-int PilotComponent::findSelectedCategory(TQComboBox * fCatList,
- struct CategoryAppInfo *info, bool AllIsUnfiled)
-{
- FUNCTIONSETUP;
-
- // Semantics of currentCatID are:
- //
- // >=0 is a specific category based on the text ->
- // category number mapping defined by the Pilot,
- // ==-1 means "All" category selected when
- // AllIsUnfiled is true.
- // == 0 == Unfiled means "All" category selected when
- // AllIsUnfiled is false.
- //
- //
- int currentCatID = 0;
-
- // If a category is deleted after others have been added, none of the
- // category numbers are changed. So we need to find the category number
- // for this category (this category is represented by the selected
- // *text*).
- //
- //
- // The top entry in the list is "All", so if the top item is
- // selected we can indicate that we are using the "All" category.
- //
- //
- if (fCatList->currentItem() == 0)
- {
- currentCatID = (-1);
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Category 'All' selected.\n";
-#endif
- }
- else
- {
- TQString selectedCategory =
- fCatList->text(fCatList->currentItem());
- currentCatID = Pilot::findCategory(info, selectedCategory, AllIsUnfiled);
- }
-
- if ((currentCatID == -1) && AllIsUnfiled)
- currentCatID = 0;
- return currentCatID;
-}
-
-
-void PilotComponent::populateCategories(TQComboBox * c,
- struct CategoryAppInfo *info)
-{
- FUNCTIONSETUP;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Combo box @"
- << (long) c << " and info @" << (long) info << endl;
-#endif
-
- c->clear();
-
- if (!info)
- goto CategoryAll;
-
- // Fill up the categories list box with
- // the categories defined by the user.
- // These presumably are in the language
- // the user uses, so no translation is necessary.
- //
- //
- for (unsigned int i = 0; i < Pilot::CATEGORY_COUNT; i++)
- {
- if (info->name[i][0])
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Adding category: "
- << info->name[i]
- << " with ID: " << (int) info->ID[i] << endl;
-#endif
-
- c->insertItem(Pilot::fromPilot(info->name[i]));
- }
- }
-
-CategoryAll:
- c->insertItem(i18n("All"), 0);
-}
-
-
-void PilotComponent::slotShowComponent()
-{
- FUNCTIONSETUP;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Showing component @" << (long) this << endl;
-#endif
-
- emit showComponent(this);
-}
-
-/* virtual */ bool PilotComponent::preHotSync(TQString &)
-{
- FUNCTIONSETUP;
-
- return true;
-}
-
-void PilotComponent::markDBDirty(const TQString db)
-{
- FUNCTIONSETUP;
- KPilotConfig::addDirtyDatabase(db);
- KPilotConfig::sync();
-}
-
-void PilotComponent::showKPilotComponent( bool toShow )
-{
- if ( toShow != shown )
- {
- shown = toShow;
- if (shown) showComponent();
- else hideComponent();
- }
-}
diff --git a/kpilot/kpilot/pilotComponent.h b/kpilot/kpilot/pilotComponent.h
deleted file mode 100644
index 4517acc7..00000000
--- a/kpilot/kpilot/pilotComponent.h
+++ /dev/null
@@ -1,141 +0,0 @@
-#ifndef _KPILOT_PILOTCOMPONENT_H
-#define _KPILOT_PILOTCOMPONENT_H
-/* pilotComponent.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** See the .cc file for an explanation of what this file is for.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-/**
- * Base class for any module to KPilot
- */
-#include <tqwidget.h>
-
-struct CategoryAppInfo;
-class TQComboBox;
-class TQString;
-
-class PilotComponent : public QWidget
-{
-Q_OBJECT
-friend class KPilotInstaller;
-
-public:
- PilotComponent(TQWidget* parent,
- const char *id,
- const TQString& dbPath);
-
- /**
- * Called when the component is shown in kpilot. It should
- * load the database and populate the widgets.
- */
- virtual void showComponent() {}
- /**
- * Called when the component is hidden in kpilot. It should
- * unload the databases and clean up to save memory. This method
- * can be called even if the component is not visible.
- * If there are some editing dlgs open, this needs to be deferred
- * until they are all closed. Then, one can explicitly call hideComponent().
- */
- virtual void hideComponent() {}
-
- /**
- * Set the shown variable to true or false, then call showComponent
- * or hideComponent.
- */
- void showKPilotComponent( bool toShow );
-
-
- /**
- * Get ready for a hotsync -- write any unflushed records
- * to disk, close windows, whatever. Returns false if it
- * is impossible to go into a sync now (due to open windows
- * or strange state.).
- *
- * The default implementation returns true.
- *
- * If the function returns false, it can also put a string
- * stating the reason why into @p s. This string will be
- * displayed to the user:
- * "Can't start HotSync. %1"
- * where %1 is replaced by s.
- */
- virtual bool preHotSync(TQString &s) ;
-
- /**
- * Reload data (possibly changed by the hotsync) etc. etc.
- */
- virtual void postHotSync() { } ;
-
-
-protected:
- /**
- * Look up the selected category from the combo box in the
- * Pilot's register of categories. We need this functon because
- * the combo box doesn't contain any reference to the category
- * ID, and we need that ID to do anything with the Pilot.
- *
- * If AllIsUnfiled is true, then when the user selects the
- * category "All" in the combo box (always the first category),
- * Unfiled (0) is returned. Otherwise if the category "All"
- * is selected -1 is returned. For all other categories
- * selected, their ID is returned. If nothing is selected,
- * behave as if "All" is selected.
- */
- int findSelectedCategory(TQComboBox *,
- CategoryAppInfo *,
- bool AllIsUnfiled=false);
-
- /**
- * Populate the combo box with the categories found in
- * the Pilot's application categories block. Erases
- * combo box's contents first.
- *
- * Always includes the category "All" as the first
- * entry in the combo box.
- *
- * If info is a NULL pointer, just put "All" in the combo box.
- */
- void populateCategories(TQComboBox *,
- CategoryAppInfo *info=0);
-
- void setDBPath(const TQString &path) { fDBPath = path; } ;
- const TQString& dbPath() const { return fDBPath; } ;
- void markDBDirty(const TQString db);
-
-public slots:
- void slotShowComponent();
-
-signals:
- void showComponent(PilotComponent *);
-
-private:
- TQString fDBPath;
-protected:
- bool shown;
-} ;
-
-#endif
diff --git a/kpilot/kpilot/pilotDaemon.cc b/kpilot/kpilot/pilotDaemon.cc
deleted file mode 100644
index 6541365d..00000000
--- a/kpilot/kpilot/pilotDaemon.cc
+++ /dev/null
@@ -1,1404 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2001-2004 by Adriaan de Groot
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This is the KPilot Daemon, which does the actual communication with
-** the Pilot and with the conduits.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <stdlib.h>
-
-#include <tqtimer.h>
-#include <tqtooltip.h>
-#include <tqpixmap.h>
-
-#include <kuniqueapplication.h>
-#include <kaboutapplication.h>
-#include <kcmdlineargs.h>
-#include <kwin.h>
-#include <kurl.h>
-#include <kpopupmenu.h>
-#include <kiconloader.h>
-#include <kdebug.h>
-#include <kprocess.h>
-#include <dcopclient.h>
-#include <kurldrag.h>
-#include <kservice.h>
-#include <kapplication.h>
-#include <khelpmenu.h>
-
-#include "pilotRecord.h"
-
-#include "fileInstaller.h"
-#include "pilotUser.h"
-#include "pilotDatabase.h"
-#include "kpilotlink.h"
-#include "kpilotdevicelink.h"
-#include "actionQueue.h"
-#include "actions.h"
-
-#include "hotSync.h"
-#include "internalEditorAction.h"
-#include "logFile.h"
-
-#include "kpilotConfig.h"
-
-
-#include "kpilotDCOP_stub.h"
-#include "kpilotDCOP.h"
-#include "loggerDCOP_stub.h"
-
-#include "pilotDaemon.moc"
-
-static KAboutData *aboutData = 0L;
-
-PilotDaemonTray::PilotDaemonTray(PilotDaemon * p) :
- KSystemTray(0, "pilotDaemon"),
- fSyncTypeMenu(0L),
- daemon(p),
- kap(0L),
- fBlinkTimer(0L)
-{
- FUNCTIONSETUP;
- setupWidget();
- setAcceptDrops(true);
-}
-
-/* virtual */ void PilotDaemonTray::dragEnterEvent(TQDragEnterEvent * e)
-{
- FUNCTIONSETUP;
- e->accept(KURLDrag::canDecode(e));
-}
-
-/* virtual */ void PilotDaemonTray::dropEvent(TQDropEvent * e)
-{
- FUNCTIONSETUP;
-
- KURL::List list;
-
- KURLDrag::decode(e, list);
-
- TQStringList files;
- for(KURL::List::ConstIterator it = list.begin(); it != list.end(); ++it)
- {
- if ((*it).isLocalFile())
- files << (*it).path();
- }
-
- daemon->addInstallFiles(files);
-}
-
-/* virtual */ void PilotDaemonTray::mousePressEvent(TQMouseEvent * e)
-{
- FUNCTIONSETUP;
-
- switch (e->button())
- {
- case RightButton:
- {
- KPopupMenu *menu = contextMenu();
- contextMenuAboutToShow(menu);
- menu->popup(e->globalPos());
- }
- break;
- case LeftButton:
- if (daemon) daemon->slotRunKPilot();
- break;
- default:
- KSystemTray::mousePressEvent(e);
- }
-}
-
-/* virtual */ void PilotDaemonTray::closeEvent(TQCloseEvent *)
-{
- FUNCTIONSETUP;
- daemon->quitNow();
-}
-
-void PilotDaemonTray::setupWidget()
-{
- FUNCTIONSETUP;
-
- KGlobal::iconLoader()->addAppDir( CSL1("kpilot") );
- icons[Normal] = loadIcon( CSL1("kpilotDaemon") );
- icons[Busy] = loadIcon( CSL1("busysync") );
- icons[NotListening] = loadIcon( CSL1("nosync") );
-
- slotShowNotListening();
- TQTimer::singleShot(2000,this,TQT_SLOT(slotShowNormal()));
-
- KPopupMenu *menu = contextMenu();
-
- menuKPilotItem = menu->insertItem(i18n("Start &KPilot"), daemon,
- TQT_SLOT(slotRunKPilot()));
- menuConfigureConduitsItem = menu->insertItem(i18n("&Configure KPilot..."),
- daemon, TQT_SLOT(slotRunConfig()));
- menu->insertSeparator();
-
- fSyncTypeMenu = new KPopupMenu(menu,"sync_type_menu");
- TQString once = i18n("Appended to names of sync types to indicate the sync will happen just one time"," (once)");
-#define MI(a) fSyncTypeMenu->insertItem( \
- SyncAction::SyncMode::name(SyncAction::SyncMode::a) + once, \
- (int)(SyncAction::SyncMode::a));
- fSyncTypeMenu->insertItem(i18n("Default (%1)")
- .arg(SyncAction::SyncMode::name((SyncAction::SyncMode::Mode)KPilotSettings::syncType())),
- 0);
- fSyncTypeMenu->insertSeparator();
-
- // Keep this synchronized with kpilotui.rc and kpilot.cc if at all possible.
- MI(eHotSync);
- MI(eFullSync);
- MI(eBackup);
- MI(eRestore);
- MI(eCopyHHToPC);
- MI(eCopyPCToHH);
-
- fSyncTypeMenu->setCheckable(true);
- fSyncTypeMenu->setItemChecked(0,true);
-#undef MI
- connect(fSyncTypeMenu,TQT_SIGNAL(activated(int)),daemon,TQT_SLOT(requestSync(int)));
- menu->insertItem(i18n("Next &Sync"),fSyncTypeMenu);
-
- KHelpMenu *help = new KHelpMenu(menu,aboutData);
- menu->insertItem(
- KGlobal::iconLoader()->loadIconSet(CSL1("help"),KIcon::Small,0,true),
- i18n("&Help"),help->menu(),false /* no whatsthis */);
-
-
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Finished getting icons" << endl;
-#endif
-}
-
-void PilotDaemonTray::slotShowAbout()
-{
- FUNCTIONSETUP;
-
- if (!kap)
- {
- kap = new KAboutApplication(0, "kpdab", false);
- }
-
- kap->show();
-}
-
-
-void PilotDaemonTray::enableRunKPilot(bool b)
-{
- FUNCTIONSETUP;
- contextMenu()->setItemEnabled(menuKPilotItem, b);
- contextMenu()->setItemEnabled(menuConfigureConduitsItem, b);
-}
-
-
-void PilotDaemonTray::changeIcon(IconShape i)
-{
- FUNCTIONSETUP;
- if (icons[i].isNull())
- {
- WARNINGKPILOT << "Icon #"<<i<<" is NULL!" << endl;
- }
- setPixmap(icons[i]);
- fCurrentIcon = i;
-}
-
-void PilotDaemonTray::slotShowNormal()
-{
- FUNCTIONSETUP;
- changeIcon(Normal);
-}
-
-void PilotDaemonTray::slotShowBusy()
-{
- FUNCTIONSETUP;
- changeIcon(Busy);
-}
-
-void PilotDaemonTray::slotShowNotListening()
-{
- FUNCTIONSETUP;
- changeIcon( NotListening );
-}
-
-void PilotDaemonTray::slotBusyTimer()
-{
- if (fCurrentIcon == Busy) changeIcon(Normal);
- else if (fCurrentIcon == Normal) changeIcon(Busy);
-}
-
-void PilotDaemonTray::startHotSync()
-{
- changeIcon(Busy);
- if (!fBlinkTimer)
- {
- fBlinkTimer = new TQTimer(this,"blink timer");
- }
- if (fBlinkTimer)
- {
- connect(fBlinkTimer,TQT_SIGNAL(timeout()),
- this,TQT_SLOT(slotBusyTimer()));
- fBlinkTimer->start(750,false);
- }
-}
-
-void PilotDaemonTray::endHotSync()
-{
- changeIcon(Normal);
- if (fBlinkTimer)
- {
- fBlinkTimer->stop();
- }
-}
-
-
-PilotDaemon::PilotDaemon() :
- DCOPObject("KPilotDaemonIface"),
- fDaemonStatus(INIT),
- fPostSyncAction(None),
- fPilotLink(0L),
- fNextSyncType(SyncAction::SyncMode::eHotSync,true),
- fSyncStack(0L),
- fTray(0L),
- fInstaller(0L),
- fLogFile(0L),
- fLogStub(new LoggerDCOP_stub("kpilot", "LogIface")),
- fLogFileStub(new LoggerDCOP_stub("kpilotDaemon", "LogIface")),
- fKPilotStub(new KPilotDCOP_stub("kpilot", "KPilotIface")),
- fTempDevice(TQString::null)
-{
- FUNCTIONSETUP;
-
- setupPilotLink();
- reloadSettings();
-
- if (fDaemonStatus == ERROR)
- {
- WARNINGKPILOT << "Connecting to device failed." << endl;
- return;
- }
-
- fInstaller = new FileInstaller;
- fLogFile = new LogFile;
- connect(fInstaller, TQT_SIGNAL(filesChanged()),
- this, TQT_SLOT(slotFilesChanged()));
-
- fNextSyncType.setMode( KPilotSettings::syncType() );
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": The daemon is ready with status "
- << statusString() << " (" << (int) fDaemonStatus << ")" << endl;
-#endif
-}
-
-PilotDaemon::~PilotDaemon()
-{
- FUNCTIONSETUP;
-
- KPILOT_DELETE(fPilotLink);
- KPILOT_DELETE(fSyncStack);
- KPILOT_DELETE(fInstaller);
-
- (void) PilotDatabase::instanceCount();
-}
-
-void PilotDaemon::addInstallFiles(const TQStringList &l)
-{
- FUNCTIONSETUP;
-
- fInstaller->addFiles( l, fTray );
-}
-
-int PilotDaemon::getPilotSpeed()
-{
- FUNCTIONSETUP;
-
- int speed = KPilotSettings::pilotSpeed();
-
- // Translate the speed entry in the
- // config file to something we can
- // put in the environment (for who?)
- //
- //
- const char *speedname = 0L;
-
- switch (speed)
- {
- case 0:
- speedname = "PILOTRATE=9600";
- break;
- case 1:
- speedname = "PILOTRATE=19200";
- break;
- case 2:
- speedname = "PILOTRATE=38400";
- break;
- case 3:
- speedname = "PILOTRATE=57600";
- break;
- case 4:
- speedname = "PILOTRATE=115200";
- break;
- default:
- speedname = "PILOTRATE=9600";
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Speed set to "
- << speedname << " (" << speed << ")" << endl;
-#endif
-
- putenv((char *) speedname);
-
- return speed;
-}
-
-
-void PilotDaemon::showTray()
-{
- FUNCTIONSETUP;
-
- if (!fTray)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": No tray icon to display!" << endl;
-#endif
-
- return;
- }
-
- // Copied from Klipper
- KWin::setSystemTrayWindowFor(fTray->winId(), 0);
- fTray->setGeometry(-100, -100, 42, 42);
- fTray->show();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Tray icon displayed." << endl;
-#endif
-
- updateTrayStatus();
-}
-
-/* DCOP ASYNC */ void PilotDaemon::setTempDevice(TQString d)
-{
- if ( !d.isEmpty() ){
- fTempDevice = d;
- if (fPilotLink)
- fPilotLink->setTempDevice( fTempDevice );
- reloadSettings();
- }
-}
-
-/* DCOP ASYNC */ void PilotDaemon::reloadSettings()
-{
- FUNCTIONSETUP;
-
- switch (fDaemonStatus)
- {
- case INIT:
- case HOTSYNC_END:
- case ERROR:
- case READY:
- case NOT_LISTENING:
- // It's OK to reload settings in these states.
- break;
- case HOTSYNC_START:
- case FILE_INSTALL_REQ:
- // Postpone the reload till the sync finishes.
- fPostSyncAction |= ReloadSettings;
- return;
- break;
- }
-
- // TODO: Is this bunch of calls really necessary to reload the settings???
- delete KPilotSettings::self();
- KPilotSettings::self()->config()->reparseConfiguration();
- KPilotSettings::self()->readConfig();
- getPilotSpeed();
-
- (void) Pilot::setupPilotCodec(KPilotSettings::encoding());
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Got configuration "
- << KPilotSettings::pilotDevice()
- << endl;
- DEBUGKPILOT << fname
- << ": Got conduit list "
- << (KPilotSettings::installedConduits().join(CSL1(",")))
- << endl;
-#endif
-
- requestSync(0);
-
-
- if (fPilotLink)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Resetting with device "
- << KPilotSettings::pilotDevice()
- << endl;
-#endif
-
- fPilotLink->reset( KPilotSettings::pilotDevice() );
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Using workarounds "
- << KPilotSettings::workarounds()
- << endl;
-#endif
- if ( KPilotSettings::workarounds() == KPilotSettings::eWorkaroundUSB )
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Using Zire31 USB workaround." << endl;
-#endif
- fPilotLink->setWorkarounds(true);
- }
- }
-
- if (KPilotSettings::dockDaemon())
- {
- if (!fTray)
- {
- fTray = new PilotDaemonTray(this);
- fTray->show();
- }
- else
- {
- fTray->show();
- }
- }
- else
- {
- if (fTray)
- {
- fTray->hide();
- delete fTray;
-
- fTray = 0L;
- }
- }
-
- updateTrayStatus();
- logProgress(TQString::null,0);
-}
-
-/* DCOP */ void PilotDaemon::stopListening()
-{
- fIsListening=false;
- fTray->changeIcon(PilotDaemonTray::NotListening);
- fDaemonStatus=NOT_LISTENING;
- fPilotLink->close();
-}
-
-/* DCOP */ void PilotDaemon::startListening()
-{
- fIsListening=true;
- fTray->changeIcon(PilotDaemonTray::Normal);
- fDaemonStatus=INIT;
- fPilotLink->reset();
-}
-
-/* DCOP */ TQString PilotDaemon::statusString()
-{
- FUNCTIONSETUP;
-
- TQString s = CSL1("PilotDaemon=");
- s.append(shortStatusString());
-
- s.append(CSL1("; NextSync="));
- s.append(fNextSyncType.name());
-
- s.append(CSL1(" ("));
- if (fPilotLink)
- {
- s.append(fPilotLink->statusString());
- }
- s.append(CSL1(");"));
-
- return s;
-}
-
-/* DCOP */ TQString PilotDaemon::shortStatusString()
-{
- TQString s;
-
- switch (status())
- {
- case INIT:
- s.append(CSL1("Waiting for sync"));
- break;
- case READY:
- s.append(CSL1("Listening on device"));
- break;
- case ERROR:
- s=CSL1("Error");
- break;
- case FILE_INSTALL_REQ:
- s=CSL1("Installing File");
- break;
- case HOTSYNC_END:
- s=CSL1("End of Hotsync");
- break;
- case HOTSYNC_START:
- s=CSL1("Syncing");
- break;
- case NOT_LISTENING:
- s.append(CSL1("Not Listening (stopped manually)"));
- break;
- }
-
- return s;
-}
-
-
-
-bool PilotDaemon::setupPilotLink()
-{
- FUNCTIONSETUP;
-
- KPILOT_DELETE(fPilotLink);
- fPilotLink = new KPilotDeviceLink( 0, 0, fTempDevice );
- if (!fPilotLink)
- {
- WARNINGKPILOT << "Can't get pilot link." << endl;
- return false;
- }
-
- TQObject::connect(fPilotLink, TQT_SIGNAL(deviceReady(KPilotLink*)),
- this, TQT_SLOT(startHotSync(KPilotLink*)));
- // connect the signals emitted by the pilotDeviceLink
- TQObject::connect(fPilotLink, TQT_SIGNAL(logError(const TQString &)),
- this, TQT_SLOT(logError(const TQString &)));
- TQObject::connect(fPilotLink, TQT_SIGNAL(logMessage(const TQString &)),
- this, TQT_SLOT(logMessage(const TQString &)));
- TQObject::connect(fPilotLink,
- TQT_SIGNAL(logProgress(const TQString &,int)),
- this, TQT_SLOT(logProgress(const TQString &,int)));
-
-
- return true;
-}
-
-
-/* DCOP ASYNC */ void PilotDaemon::quitNow()
-{
- FUNCTIONSETUP;
- // Using switch to make sure we cover all the cases.
- //
- //
- switch (fDaemonStatus)
- {
- case INIT:
- case HOTSYNC_END:
- case ERROR:
- case NOT_LISTENING:
- getKPilot().daemonStatus(KPilotDCOP::DaemonQuit);
- kapp->quit();
- break;
- case READY:
- case HOTSYNC_START:
- case FILE_INSTALL_REQ:
- fPostSyncAction |= Quit;
- break;
- }
- emitDCOPSignal( "kpilotDaemonStatusChanged()", TQByteArray() );
-}
-
-/* DCOP ASYNC */ void PilotDaemon::requestRegularSyncNext()
-{
- requestSync(SyncAction::SyncMode::eHotSync);
-}
-
-
-/* DCOP ASYNC */ void PilotDaemon::requestSync(int mode)
-{
- FUNCTIONSETUP;
-
- if ( 0==mode )
- {
- mode = KPilotSettings::syncType();
- }
-
- if ( !fNextSyncType.setMode(mode) )
- {
- WARNINGKPILOT << "Ignored fake sync type " << mode << endl;
- return;
- }
-
- updateTrayStatus();
-
- if (fTray && (fTray->fSyncTypeMenu))
- {
- for (int i=((int)SyncAction::SyncMode::eHotSync);
- i<=((int)SyncAction::SyncMode::eRestore) /* Restore */ ;
- ++i)
- {
- fTray->fSyncTypeMenu->setItemChecked(i,mode==i);
- }
- }
-
- getLogger().logMessage(i18n("Next HotSync will be: %1. ").arg(fNextSyncType.name()) +
- i18n("Please press the HotSync button."));
-}
-
-/* DCOP ASYNC */ void PilotDaemon::requestSyncType(TQString s)
-{
- FUNCTIONSETUP;
-
- // This checks unique prefixes of the names of the various sync types.
- if (s.startsWith(CSL1("H"))) requestSync(SyncAction::SyncMode::eHotSync);
- else if (s.startsWith(CSL1("Fu"))) requestSync(SyncAction::SyncMode::eFullSync);
- else if (s.startsWith(CSL1("B"))) requestSync(SyncAction::SyncMode::eBackup);
- else if (s.startsWith(CSL1("R"))) requestSync(SyncAction::SyncMode::eRestore);
- else if (s.startsWith(CSL1("T"))) { fNextSyncType.setOptions(true,false); }
- else if (s.startsWith(CSL1("CopyHHToPC"))) requestSync(SyncAction::SyncMode::eCopyHHToPC);
- else if (s.startsWith(CSL1("CopyPCToHH"))) requestSync(SyncAction::SyncMode::eCopyPCToHH);
- else if (s.startsWith(CSL1("D"))) requestSync(0);
- else
- {
- WARNINGKPILOT << "Unknown sync type " << ( s.isEmpty() ? CSL1("<none>") : s )
- << endl;
- }
-}
-
-/* DCOP ASYNC */ void PilotDaemon::requestSyncOptions(bool test, bool local)
-{
- if ( !fNextSyncType.setOptions(test,local) )
- {
- WARNINGKPILOT << "Nonsensical request for "
- << (test ? "test" : "notest")
- << ' '
- << (local ? "local" : "nolocal")
- << " in mode "
- << fNextSyncType.name() << endl;
- }
-}
-
-/* DCOP */ int PilotDaemon::nextSyncType() const
-{
- return fNextSyncType.mode();
-}
-
-/**
-* DCOP Functions reporting some status data, e.g. for the kontact plugin.
-*/
-TQDateTime PilotDaemon::lastSyncDate()
-{
- return KPilotSettings::lastSyncTime();
-}
-
-
-static TQDict<TQString> *conduitNameMap = 0L;
-
-static void fillConduitNameMap()
-{
- if ( !conduitNameMap )
- {
- conduitNameMap = new TQDict<TQString>;
- conduitNameMap->setAutoDelete(true);
- }
- conduitNameMap->clear();
-
- TQStringList l = KPilotSettings::installedConduits();
- // Fill with internal settings.
- if ( l.find( CSL1("internal_fileinstall") ) != l.end() ) {
- conduitNameMap->insert( CSL1("internal_fileinstall"),
- new TQString(i18n("File Installer")) );
- }
-
- TQStringList::ConstIterator end = l.end();
- for (TQStringList::ConstIterator i = l.begin(); i != end; ++i)
- {
- if (!conduitNameMap->find(*i))
- {
- TQString readableName = CSL1("<unknown>");
- KSharedPtr < KService > o = KService::serviceByDesktopName(*i);
- if (!o)
- {
- WARNINGKPILOT << "No service for " << *i << endl;
- }
- else
- {
- readableName = o->name();
- }
- conduitNameMap->insert( *i, new TQString(readableName) );
- }
- }
-}
-
-
-TQStringList PilotDaemon::configuredConduitList()
-{
- fillConduitNameMap();
-
- TQStringList keys;
-
- TQDictIterator<TQString> it(*conduitNameMap);
- for ( ; *it; ++it)
- {
- keys << it.currentKey();
- }
- keys.sort();
-
- TQStringList::ConstIterator end = keys.end();
- TQStringList result;
- for (TQStringList::ConstIterator i = keys.begin(); i != end; ++i)
- {
- result << *(conduitNameMap->find(*i));
- }
-
- return result;
-}
-
-TQString PilotDaemon::logFileName()
-{
- return KPilotSettings::logFileName();
-}
-
-TQString PilotDaemon::userName()
-{
- return KPilotSettings::userName();
-}
-TQString PilotDaemon::pilotDevice()
-{
- return KPilotSettings::pilotDevice();
-}
-
-bool PilotDaemon::killDaemonOnExit()
-{
- return KPilotSettings::killDaemonAtExit();
-}
-
-typedef enum { NotLocked=0, Locked=1, DCOPError=2 } KDesktopLockStatus;
-static KDesktopLockStatus isKDesktopLockRunning()
-{
- if (!KPilotSettings::screenlockSecure()) return NotLocked;
-
- DCOPClient *dcopptr = KApplication::kApplication()->dcopClient();
-
- // Can't tell, very weird, err on the side of safety.
- if (!dcopptr || !dcopptr->isAttached())
- {
- WARNINGKPILOT << "Could not make DCOP connection. "
- << "Assuming screensaver is active." << endl;
- return DCOPError;
- }
-
- TQByteArray data,returnValue;
- TQCString returnType;
-
- if (!dcopptr->call("kdesktop","KScreensaverIface","isBlanked()",
- data,returnType,returnValue,true))
- {
- WARNINGKPILOT << "Check for screensaver failed."
- << "Assuming screensaver is active." << endl;
- // Err on the side of safety again.
- return DCOPError;
- }
-
- if (returnType == "bool")
- {
- bool b;
- TQDataStream reply(returnValue,IO_ReadOnly);
- reply >> b;
- return (b ? Locked : NotLocked);
- }
- else
- {
- WARNINGKPILOT << "Strange return value from screensaver. "
- << "Assuming screensaver is active." << endl;
- // Err on the side of safety.
- return DCOPError;
- }
-}
-
-
-static void informOthers(KPilotDCOP_stub &kpilot,
- LoggerDCOP_stub &log,
- LoggerDCOP_stub &filelog)
-{
- kpilot.daemonStatus(KPilotDCOP::StartOfHotSync);
- log.logStartSync();
- filelog.logStartSync();
-}
-
-static bool isSyncPossible(ActionQueue *fSyncStack,
- KPilotLink *pilotLink,
- KPilotDCOP_stub &kpilot)
-{
- FUNCTIONSETUP;
-
- /**
- * If KPilot is busy with something - like configuring
- * conduit - then we shouldn't run a real sync, but
- * just tell the user that the sync couldn't run because
- * of that.
- */
- int kpilotstatus = kpilot.kpilotStatus();
- DCOPStub::Status callstatus = kpilot.status();
-
-#ifdef DEBUG
- if (callstatus != DCOPStub::CallSucceeded)
- {
- DEBUGKPILOT << fname <<
- ": Could not call KPilot for status." << endl;
- }
- else
- {
- DEBUGKPILOT << fname << ": KPilot status " << kpilotstatus << endl;
- }
-#endif
- /**
- * If the call fails, then KPilot is probably not running
- * and we can behave normally.
- */
- if ((callstatus == DCOPStub::CallSucceeded) &&
- (kpilotstatus != KPilotDCOP::WaitingForDaemon))
- {
- WARNINGKPILOT << "KPilot returned status " << kpilotstatus << endl;
-
- fSyncStack->queueInit();
- fSyncStack->addAction(new SorryAction(pilotLink));
- return false;
- }
-
- switch (isKDesktopLockRunning())
- {
- case NotLocked :
- break; /* Fall through to return true below */
- case Locked :
- fSyncStack->queueInit();
- fSyncStack->addAction(new SorryAction(pilotLink,
- i18n("HotSync is disabled while the screen is locked.")));
- return false;
- case DCOPError :
- fSyncStack->queueInit();
- fSyncStack->addAction(new SorryAction(pilotLink,
- i18n("HotSync is disabled because KPilot could not "
- "determine the state of the screen saver. You "
- "can disable this security feature by unchecking "
- "the 'do not sync when screensaver is active' box "
- "in the HotSync page of the configuration dialog.")));
- return false;
- }
-
- return true;
-}
-
-static void queueInstaller(ActionQueue *fSyncStack,
- KPilotLink *pilotLink,
- FileInstaller *fInstaller,
- const TQStringList &c)
-{
- if (c.findIndex(CSL1("internal_fileinstall")) >= 0)
- {
- fSyncStack->addAction(new FileInstallAction(pilotLink,fInstaller->dir()));
- }
-}
-
-static void queueEditors(ActionQueue *fSyncStack, KPilotLink *pilotLink)
-{
- if (KPilotSettings::internalEditors())
- {
- fSyncStack->addAction(new InternalEditorAction(pilotLink));
- }
-}
-
-static void queueConduits(ActionQueue *fSyncStack,
- const TQStringList &conduits,
- SyncAction::SyncMode e)
-{
- if (conduits.count() > 0)
- {
- fSyncStack->queueConduits(conduits,e);
- // TQString s = i18n("Conduit flags: ");
- // s.append(ConduitProxy::flagsForMode(e).join(CSL1(" ")));
- // logMessage(s);
- }
-}
-
-bool PilotDaemon::shouldBackup()
-{
-
- FUNCTIONSETUP;
-
- bool ret = false;
- int backupfreq = KPilotSettings::backupFrequency();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Backup Frequency is: [" << backupfreq <<
- "]. " << endl;
-#endif
-
- if ( (fNextSyncType == SyncAction::SyncMode::eHotSync) ||
- (fNextSyncType == SyncAction::SyncMode::eFullSync) )
- {
- /** If we're doing a Hot or Full sync, see if our user has
- * configured us to or to not always do a backup.
- */
- if ( backupfreq == SyncAction::eOnRequestOnly )
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Should not do backup..." << endl;
-#endif
- ret = false;
- }
- else if ( backupfreq == SyncAction::eEveryHotSync )
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Should do backup..." << endl;
-#endif
- ret = true;
- }
- }
-
- return ret;
-
-}
-
-
-/* slot */ void PilotDaemon::startHotSync(KPilotLink *pilotLink)
-{
- FUNCTIONSETUP;
-
- bool pcchanged=false; // If last PC to sync was a different one (implies full sync, normally)
- TQStringList conduits ; // list of conduits to run
- TQString s; // a generic string for stuff
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Starting Sync with type "
- << fNextSyncType.name() << endl;
- DEBUGKPILOT << fname << ": Status is " << shortStatusString() << endl;
- (void) PilotDatabase::instanceCount();
-#endif
-
- fDaemonStatus = HOTSYNC_START ;
- if (fTray)
- {
- fTray->startHotSync();
- }
- informOthers(getKPilot(),getLogger(),getFileLogger());
-
-
- // Queue to add all the actions for this sync to.
- fSyncStack = new ActionQueue(pilotLink);
-
- // Check if the sync is possible at all.
- if (!isSyncPossible(fSyncStack,pilotLink,getKPilot()))
- {
- // Sync is not possible now, sorry action was added to
- // the queue, and we run that -- skipping all the rest of the sync stuff.
- goto launch;
- }
-
- // Except when the user has requested a Restore, in which case she knows she doesn't
- // want to sync with a blank palm and then back up the result over her stored backup files,
- // do a Full Sync when changing the PC or using a different Palm Desktop app.
- if (fNextSyncType.mode() != SyncAction::SyncMode::eRestore)
- { // Use gethostid to determine , since JPilot uses 1+(2000000000.0*random()/(RAND_MAX+1.0))
- // as PC_ID, so using JPilot and KPilot is the same as using two different PCs
- KPilotUser &usr = pilotLink->getPilotUser();
- pcchanged = usr.getLastSyncPC() !=(unsigned long) gethostid();
-
- if (pcchanged)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": PC changed. Last sync PC: [" << usr.getLastSyncPC()
- << "], me: [" << (unsigned long) gethostid() << "]" << endl;
-#endif
- if ( KPilotSettings::fullSyncOnPCChange() )
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Setting sync mode to full sync. " << endl;
-#endif
- fNextSyncType = SyncAction::SyncMode::eFullSync;
- }
- else
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Not changing sync mode because of settings. " << endl;
-#endif
- }
- }
- }
-
- // Normal case: regular sync.
- fSyncStack->queueInit();
- fSyncStack->addAction(new CheckUser(pilotLink));
-
- conduits = KPilotSettings::installedConduits() ;
-
- if (fNextSyncType.isTest())
- {
- fSyncStack->addAction(new TestLink(pilotLink));
- }
- else
- {
- switch (fNextSyncType.mode())
- {
- case SyncAction::SyncMode::eBackup:
- if (KPilotSettings::runConduitsWithBackup() && (conduits.count() > 0))
- {
- queueConduits(fSyncStack,conduits,fNextSyncType);
- }
- fSyncStack->addAction(new BackupAction(pilotLink,true));
- break;
- case SyncAction::SyncMode::eRestore:
- fSyncStack->addAction(new RestoreAction(pilotLink));
- queueInstaller(fSyncStack,pilotLink,fInstaller,conduits);
- break;
- case SyncAction::SyncMode::eFullSync:
- case SyncAction::SyncMode::eHotSync:
- // first install the files, and only then do the conduits
- // (conduits might want to sync a database that will be installed
- queueInstaller(fSyncStack,pilotLink,fInstaller,conduits);
- queueEditors(fSyncStack,pilotLink);
- queueConduits(fSyncStack,conduits,fNextSyncType);
- // After running the conduits, install new databases
- queueInstaller(fSyncStack,pilotLink,fInstaller,conduits);
- // And sync the remaining databases if needed.
- if (shouldBackup())
- {
- fSyncStack->addAction(new BackupAction(pilotLink, (fNextSyncType == SyncAction::SyncMode::eFullSync)));
- }
- break;
- case SyncAction::SyncMode::eCopyPCToHH:
- queueConduits(fSyncStack,conduits,SyncAction::SyncMode::eCopyPCToHH);
- break;
- case SyncAction::SyncMode::eCopyHHToPC:
- queueConduits(fSyncStack,conduits,SyncAction::SyncMode::eCopyHHToPC);
- break;
- }
- }
-
-// Jump here to finalize the connections to the sync action
-// queue and start the actual sync.
-launch:
- fSyncStack->queueCleanup();
-
- TQObject::connect(fSyncStack, TQT_SIGNAL(logError(const TQString &)),
- this, TQT_SLOT(logError(const TQString &)));
- TQObject::connect(fSyncStack, TQT_SIGNAL(logMessage(const TQString &)),
- this, TQT_SLOT(logMessage(const TQString &)));
- TQObject::connect(fSyncStack,
- TQT_SIGNAL(logProgress(const TQString &,int)),
- this, TQT_SLOT(logProgress(const TQString &,int)));
-
- TQObject::connect(fSyncStack, TQT_SIGNAL(syncDone(SyncAction *)),
- this, TQT_SLOT(endHotSync()));
-
- TQTimer::singleShot(0,fSyncStack,TQT_SLOT(execConduit()));
-
- updateTrayStatus();
-}
-
-/* slot */ void PilotDaemon::logMessage(const TQString & s)
-{
- FUNCTIONSETUPL(2);
-
- getLogger().logMessage(s);
- getFileLogger().logMessage(s);
- updateTrayStatus(s);
-}
-
-/* slot */ void PilotDaemon::logError(const TQString & s)
-{
- FUNCTIONSETUP;
-
- getLogger().logError(s);
- getFileLogger().logError(s);
- updateTrayStatus(s);
-}
-
-/* slot */ void PilotDaemon::logProgress(const TQString & s, int i)
-{
- FUNCTIONSETUPL(2);
-
- getLogger().logProgress(s, i);
- getFileLogger().logProgress(s, i);
- if (!s.isEmpty()) updateTrayStatus(s);
-}
-
-/* slot */ void PilotDaemon::endHotSync()
-{
- FUNCTIONSETUP;
-
- if (fTray)
- {
- fTray->endHotSync();
- }
-
- KPILOT_DELETE(fSyncStack);
- fPilotLink->close();
-
- getLogger().logProgress(i18n("HotSync Completed.<br>"), 100);
- getFileLogger().logProgress(i18n("HotSync Completed.<br>"), 100);
- getLogger().logEndSync();
- getFileLogger().logEndSync();
- getKPilot().daemonStatus(KPilotDCOP::EndOfHotSync);
- KPilotSettings::setLastSyncTime(TQDateTime::currentDateTime());
- KPilotSettings::self()->writeConfig();
-
- fDaemonStatus = HOTSYNC_END;
-
- if (fPostSyncAction & Quit)
- {
- getKPilot().daemonStatus(KPilotDCOP::DaemonQuit);
- kapp->quit();
- }
- if (fPostSyncAction & ReloadSettings)
- {
- reloadSettings();
- }
- else
- {
- TQTimer::singleShot(10000,fPilotLink,TQT_SLOT(reset()));
- }
-
- fPostSyncAction = None;
- requestSync(0);
-
- (void) PilotDatabase::instanceCount();
-
- updateTrayStatus();
-}
-
-
-void PilotDaemon::slotFilesChanged()
-{
- FUNCTIONSETUP;
-}
-
-void PilotDaemon::slotRunKPilot()
-{
- FUNCTIONSETUP;
-
- TQString kpilotError;
- TQCString kpilotDCOP;
- int kpilotPID;
-
- if (KApplication::startServiceByDesktopName(CSL1("kpilot"),
- TQString::null, &kpilotError, &kpilotDCOP, &kpilotPID
-#if (KDE_VERSION >= 220)
- // Startup notification added in 2.2
- , ""
-#endif
- ))
- {
- WARNINGKPILOT << "Couldn't start KPilot! " << kpilotError << endl;
- }
- else
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Started KPilot with DCOP name "
- << kpilotDCOP << " (pid " << kpilotPID << ")" << endl;
-#endif
- }
-}
-
-void PilotDaemon::slotRunConfig()
-{
- FUNCTIONSETUP;
-
- // This function tries to send the raise() DCOP call to kpilot.
- // If it succeeds, we can assume kpilot is running and then try
- // to send the configure() DCOP call.
- // If it fails (probably because kpilot isn't running) it tries
- // to call kpilot via KProcess (using a command line switch to
- // only bring up the configure dialog).
- //
- // Implementing the function this way catches all cases.
- // ie 1 KPilot running with configure dialog open (raise())
- // 2 KPilot running with dialog NOT open (configureConduits())
- // 3 KPilot NOT running (KProcess)
-
- DCOPClient *client = kapp->dcopClient();
-
- // This DCOP call to kpilot's raise function solves the final case
- // ie when kpilot already has the dialog open
-
- if ( client->isApplicationRegistered( "kpilot" ) )
- {
- client->send("kpilot", "kpilot-mainwindow#1", "raise()",TQString::null);
- client->send("kpilot", "KPilotIface", "configure()", TQString::null);
- }
- else
- {
- // KPilot not running
- KProcess *p = new KProcess;
- *p << "kpilot" << "-s";
-
- p->start();
- }
-}
-
-void PilotDaemon::updateTrayStatus(const TQString &s)
-{
- if (!fTray) return;
-
- TQString tipText = CSL1("<qt>");
- tipText.append( s );
- tipText.append( CSL1(" ") );
- tipText.append( i18n("Next sync is %1.")
- .arg( fNextSyncType.name() ) );
- tipText.append( CSL1("</qt>") );
-
- TQToolTip::remove(fTray);
- TQToolTip::add(fTray,tipText);
- emitDCOPSignal( "kpilotDaemonStatusChanged()", TQByteArray() );
- // emit the same dcop signal but including the information needed by Kontact to update its kpilot summary widget
- TQByteArray data;
- TQDataStream arg(data, IO_WriteOnly);
- arg << lastSyncDate();
- arg << shortStatusString();
- arg << configuredConduitList();
- arg << logFileName();
- arg << userName();
- arg << pilotDevice();
- arg << killDaemonOnExit();
- emitDCOPSignal( "kpilotDaemonStatusDetails(TQDateTime,TQString,TQStringList,TQString,TQString,TQString,bool)", data );
-}
-
-static KCmdLineOptions daemonoptions[] = {
-#ifdef DEBUG
- {"debug <level>", I18N_NOOP("Set debugging level"), "0"},
-#endif
- { "device <device>", I18N_NOOP("Device to try first"), ""},
- {"fail-silently", I18N_NOOP("Exit instead of complaining about bad configuration files"), 0},
- KCmdLineLastOption
-} ;
-
-
-int main(int argc, char **argv)
-{
- FUNCTIONSETUP;
-
- KLocale::setMainCatalogue("kpilot");
-
- KAboutData about("kpilotDaemon",
- I18N_NOOP("KPilot Daemon"),
- KPILOT_VERSION,
- "KPilot - HotSync software for KDE\n\n",
- KAboutData::License_GPL,
- "(c) 1998-2000,2001, Dan Pilone (c) 2000-2004, Adriaan de Groot",
- 0L,
- "http://www.kpilot.org/"
- );
- about.addAuthor("Dan Pilone",
- I18N_NOOP("Project Leader"),
- "pilone@slac.com");
- about.addAuthor("Adriaan de Groot",
- I18N_NOOP("Maintainer"),
- "groot@kde.org", "http://www.kpilot.org/");
- about.addAuthor("Reinhold Kainhofer",
- I18N_NOOP("Developer"),
- "reinhold@kainhofer.com", "http://reinhold.kainhofer.com/Linux/");
- aboutData = &about;
-
-
- KCmdLineArgs::init(argc, argv, &about);
- KCmdLineArgs::addCmdLineOptions(daemonoptions,"kpilotconfig");
- KUniqueApplication::addCmdLineOptions();
- KCmdLineArgs *p = KCmdLineArgs::parsedArgs();
-
-#ifdef DEBUG
- KPilotConfig::getDebugLevel(p);
-#endif
- if (!KUniqueApplication::start())
- {
- if (p->isSet("device")){
- // tell the running kpilotDaemon to use
- // this device now
- DCOPClient d;
- TQString dev(p->getOption("device"));
- TQByteArray data;
- TQDataStream arg(data, IO_WriteOnly);
- arg << dev;
- if (d.attach()){
- d.send("kpilotDaemon", "KPilotDaemonIface", "setTempDevice(TQString)", data );
- d.detach();
- }
- }
- return 0;
- }
- KUniqueApplication a(true, true);
-
- // A block just to keep variables local.
- //
- //
- {
-// KPilotSettings::self()->config()->setReadOnly(false);
-
- if (KPilotSettings::configVersion() < KPilotConfig::ConfigurationVersion)
- {
- WARNINGKPILOT << "Is still not configured for use."
- << endl;
- if (!p->isSet("fail-silently"))
- {
- KPilotConfig::sorryVersionOutdated(KPilotSettings::configVersion());
- }
- return 1;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Configuration version "
- << KPilotSettings::configVersion() << endl;
-#endif
- }
-
-
- PilotDaemon *gPilotDaemon = new PilotDaemon();
-
- if (p->isSet("device"))
- gPilotDaemon->setTempDevice(p->getOption("device"));
-
- if (gPilotDaemon->status() == PilotDaemon::ERROR)
- {
- delete gPilotDaemon;
-
- gPilotDaemon = 0;
- WARNINGKPILOT << "Failed to start up daemon "
- "due to errors constructing it." << endl;
- return 2;
- }
-
- gPilotDaemon->showTray();
-
- return a.exec();
-}
-
-
-
diff --git a/kpilot/kpilot/pilotDaemon.h b/kpilot/kpilot/pilotDaemon.h
deleted file mode 100644
index 8b386ee4..00000000
--- a/kpilot/kpilot/pilotDaemon.h
+++ /dev/null
@@ -1,279 +0,0 @@
-#ifndef _KPILOT_PILOTDAEMON_H
-#define _KPILOT_PILOTDAEMON_H
-/* pilotDaemon.h KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** See the .cc file for an explanation of what this file is for.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include <ksystemtray.h>
-
-#include "kpilotlink.h"
-#include "syncAction.h"
-#include "pilotDaemonDCOP.h"
-
-class TQPixmap;
-class TQTimer;
-class KAboutApplication;
-class TQPopupMenu;
-
-class PilotDaemon;
-class ActionQueue;
-class FileInstaller;
-class LoggerDCOP_stub;
-class KPilotDCOP_stub;
-class LogFile;
-
-class KPilotLink;
-class KPilotDeviceLink;
-
-class PilotDaemonTray : public KSystemTray
-{
- Q_OBJECT
-
-friend class PilotDaemon;
-
-public:
- PilotDaemonTray(PilotDaemon *p);
-
- typedef enum { Normal, Busy, NotListening } IconShape ;
- void changeIcon(IconShape);
-
- void enableRunKPilot(bool);
-
- virtual void dragEnterEvent(TQDragEnterEvent *);
- virtual void dropEvent(TQDropEvent *);
-
-
-protected:
- void setupWidget();
- /**
- * Menu of sync types.
- */
- TQPopupMenu *fSyncTypeMenu;
-
-protected slots:
- void slotShowAbout();
- void slotShowBusy();
- void slotShowNormal();
- void slotShowNotListening();
- void slotBusyTimer();
-
- // "Regular" QT actions
- //
- //
- virtual void mousePressEvent(TQMouseEvent* e);
- virtual void closeEvent(TQCloseEvent *e);
-
-protected:
- void startHotSync();
- void endHotSync();
-
-private:
- TQPixmap icons[((int) NotListening) + 1];
- IconShape fCurrentIcon;
- PilotDaemon *daemon;
-
- /**
- * Remember which item in the context menu
- * is "Run KPilot" so we can enable / disable
- * it as necessary.
- */
- int menuKPilotItem;
-
- /**
- * Remember which item in the context menu
- * is "Configure Conduits" so we can enable / disable
- * it as necessary.
- */
- int menuConfigureConduitsItem;
-
- /**
- * Window for the "About KPilot" information.
- */
- KAboutApplication *kap;
-
- /**
- * Timer for blinking.
- */
- TQTimer *fBlinkTimer;
-
-} ;
-
-class PilotDaemon : public TQObject, virtual public PilotDaemonDCOP
-{
-Q_OBJECT
-
-// The tray must be our friend so that we can let it stop the daemon.
-friend class PilotDaemonTray;
-
-
-public:
- PilotDaemon();
- ~PilotDaemon();
-
- enum DaemonStatus
- {
- HOTSYNC_START, // Hotsync is running
- HOTSYNC_END, // Hotsync is cleaning up
- FILE_INSTALL_REQ, // A file is being saved for installation
- ERROR,
- READY, // Connected to device and ready for Sync
- INIT,
- NOT_LISTENING
- };
-
- DaemonStatus status() const { return fDaemonStatus; } ;
- /* DCOP */ virtual TQString statusString();
- /* DCOP */ virtual TQString shortStatusString();
-
- /**
- * Display the daemon's system tray icon
- * (if there is one, depending on the DockDaemon
- * setting in the config file)
- */
- void showTray();
- virtual void addInstallFiles(const TQStringList &);
-
- // The next few functions are the DCOP interface.
- // Some are also slots.
- //
-public slots:
- virtual ASYNC requestSync(int);
-public:
- virtual ASYNC requestSyncType(TQString);
- virtual ASYNC requestRegularSyncNext();
- virtual int nextSyncType() const;
- virtual ASYNC requestSyncOptions(bool,bool);
-
- virtual ASYNC quitNow();
- virtual ASYNC reloadSettings();
- virtual ASYNC setTempDevice(TQString d);
-
- virtual void stopListening();
- virtual void startListening();
- virtual bool isListening() { return fIsListening; }
- /**
- * Functions reporting same status data, e.g. for the kontact plugin.
- */
- virtual TQDateTime lastSyncDate();
- virtual TQStringList configuredConduitList();
- virtual TQString logFileName();
- virtual TQString userName();
- virtual TQString pilotDevice();
- virtual bool killDaemonOnExit();
-
-protected:
- DaemonStatus fDaemonStatus;
-
- enum postSyncActions {
- None=0,
- ReloadSettings = 1,
- Quit = 2
- } ;
- int fPostSyncAction;
-
-protected slots:
- void startHotSync( KPilotLink* lnk );
- void endHotSync();
-
- void logMessage(const TQString &);
- void logError(const TQString &);
- void logProgress(const TQString &,int);
-
-private:
- int getPilotSpeed();
-
- /**
- * Check whether we should do a backup. This is based on the
- * KPilotSettings::backupFrequency and uses
- * SyncAction::BackupFrequency. This will be expanded, hopefully,
- * to provide backup scheduling at some point.
- */
- bool shouldBackup();
-
- bool setupPilotLink();
-
- KPilotDeviceLink &getPilotLink() { return *fPilotLink; }
- KPilotDeviceLink *fPilotLink;
-
- SyncAction::SyncMode fNextSyncType;
-
- ActionQueue *fSyncStack;
-
- /**
- * This is a pointer to the (optional) docked
- * system tray icon for the daemon.
- */
- PilotDaemonTray *fTray;
-
- /**
- * Set or change the tooltip displayed by the tray icon.
- */
- void updateTrayStatus(const TQString &s=TQString::null);
-
- FileInstaller *fInstaller;
-
-protected slots:
- /**
- * Called after a file has been installed to notify any observers, like
- * KPilot, that files have been installed. [Here that means: copied
- * to the pending_install directory and thus *waiting* for
- * installation on the Palm]
- */
- void slotFilesChanged();
-
- /**
- * Start up KPilot.
- */
- void slotRunKPilot();
-
- /**
- * Run conduit configuration using "kpilot -c"
- */
- void slotRunConfig();
-
- /**
- * Provide access to KPilot's DCOP interface through a stub.
- */
-protected:
- LoggerDCOP_stub &getLogger() { return *fLogStub; } ;
- LoggerDCOP_stub &getFileLogger() { return *fLogFileStub; } ;
- KPilotDCOP_stub &getKPilot() { return *fKPilotStub; } ;
-
- LogFile *fLogFile;
- bool fIsListening;
-
-private:
- LoggerDCOP_stub *fLogStub;
- LoggerDCOP_stub *fLogFileStub;
- KPilotDCOP_stub *fKPilotStub;
- TQString fTempDevice;
-};
-
-
-#endif
diff --git a/kpilot/kpilot/pilotDaemonDCOP.h b/kpilot/kpilot/pilotDaemonDCOP.h
deleted file mode 100644
index b56a245b..00000000
--- a/kpilot/kpilot/pilotDaemonDCOP.h
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef PILOTDAEMONDCOP_H
-#define PILOTDAEMONDCOP_H
-/* pilotDaemonDCOP.h KPilotDaemon
-**
-** Copyright (C) 2000 by Adriaan de Groot
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines the DCOP interface for
-** the KPilotDaemon. The daemon has *two* interfaces:
-** one belonging with KUniqueApplication and this one.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include <dcopobject.h>
-#include <tqdatetime.h>
-#include <tqstringlist.h>
-
-class PilotDaemonDCOP : virtual public DCOPObject
-{
- K_DCOP
-public:
-k_dcop:
- /**
- * Start a HotSync. What kind of HotSync is determined
- * by the int parameter (use the enum in kpilot.kcfg, or
- * better yet, use requestSyncType and pass the name).
- * Using a value of 0 (zero, which isn't a legal mode for
- * sync actions) uses the configuration file default.
- */
- virtual ASYNC requestSync(int) = 0;
- /**
- * Request a particular kind of sync next; pass in the name
- * of a sync type instead.
- */
- virtual ASYNC requestSyncType(TQString) = 0;
- /** Shortcut for using requestSync(1) */
- virtual ASYNC requestRegularSyncNext() = 0;
- /** Query what type is set most recently. */
- virtual int nextSyncType() const = 0;
- /** Set the mix-ins (see SyncAction::SyncMode for details). */
- virtual ASYNC requestSyncOptions(bool test, bool local) = 0;
-
- /**
- * Functions for the KPilot UI, indicating what the daemon
- * should do.
- */
- virtual ASYNC quitNow() = 0;
- virtual ASYNC reloadSettings() = 0; // Indicate changed config file.
- virtual ASYNC setTempDevice(TQString d) =0; // use this device
- virtual void stopListening() = 0;
- virtual void startListening() = 0;
- virtual bool isListening() =0 ;
-
- /**
- * Functions requesting the status of the daemon.
- */
- virtual TQString statusString() = 0;
- virtual TQString shortStatusString() = 0;
-
- /**
- * Functions reporting same status data, e.g. for the kontact plugin.
- */
- virtual TQDateTime lastSyncDate() = 0;
- virtual TQStringList configuredConduitList() = 0;
- virtual TQString logFileName() = 0;
- virtual TQString userName() = 0;
- virtual TQString pilotDevice() = 0;
- virtual bool killDaemonOnExit() = 0;
-
- /**
- * Some other useful functionality
- */
- virtual void addInstallFiles(const TQStringList &) = 0;
-
-
-k_dcop_signals:
- void kpilotDaemonStatusChanged();
- // used to push status information
- void kpilotDaemonStatusDetails( TQDateTime, TQString, TQStringList, TQString, TQString, TQString, bool );
-} ;
-
-#endif
diff --git a/kpilot/kpilot/stamp-h.in b/kpilot/kpilot/stamp-h.in
deleted file mode 100644
index e69de29b..00000000
--- a/kpilot/kpilot/stamp-h.in
+++ /dev/null
diff --git a/kpilot/kpilot/syncCalendar.cc b/kpilot/kpilot/syncCalendar.cc
deleted file mode 100644
index 802ee354..00000000
--- a/kpilot/kpilot/syncCalendar.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2005 by Adriaan de Groot <groot@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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org.
-*/
-
-#include "options.h"
-
-#include <kpilotlink.h>
-#include <pilotDatabase.h>
-#include <pilotDateEntry.h>
-
-#include <libkcal/calendarlocal.h>
-#include <libkcal/event.h>
-
-
-typedef DatabaseInterpreter<KCal::Event,PilotDateEntry,PilotDateEntry::Mapper> DatebookDB;
-
-class CalendarDumper
-{
-public:
- CalendarDumper() {}
-
- KCal::CalendarLocal *retrieve(int fd);
- KCal::CalendarLocal *retrieve(const TQString &filename);
-
-protected:
- KCal::CalendarLocal *retrieve(DatebookDB *db);
-} ;
-
-
-
-KCal::CalendarLocal *CalendarDumper::retrieve(int fd)
-{
- PilotSerialDatabase sdb( fd, CSL1("DatebookDB") );
- DatebookDB db(&sdb);
- return retrieve(db);
-}
-
-KCal::CalendarLocal *CalendarDumped::retrieve(const TQString &fn)
-{
- PilotLocalDatabase ldb( fn );
- DatebookDB db(&ldb);
- return retrieve(db);
-}
-
-KCal::CalendarLocal *retrieve(DatebookDB *db)
-{
- KCal::CalendarLocal *cal = new CalendarLocal( TQString::null );
-
- int count = db->db()->recordCount();
-
- if (count < 1)
- {
- return cal;
- }
-
- for (int i=0; i<count; i++)
- {
- KCal::Event *e = db->readRecordByIndex(i);
- if (!e) continue;
- cal->addEvent(e);
- }
-
- return cal;
-}
diff --git a/kpilot/kpilot/todoEditor.cc b/kpilot/kpilot/todoEditor.cc
deleted file mode 100644
index d7017bb9..00000000
--- a/kpilot/kpilot/todoEditor.cc
+++ /dev/null
@@ -1,173 +0,0 @@
-// -*- C++ -*-
-/* KPilot
-**
-** Copyright (C) 2000 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This is a dialog window that edits one single todo record.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-
-#include "options.h"
-
-#include <tqcombobox.h>
-#include <tqlayout.h>
-#include <tqlabel.h>
-#include <tqtextedit.h>
-#include <tqcheckbox.h>
-
-#include <kdatewidget.h>
-
-#include "pilotTodoEntry.h"
-#include "todoEditor_base.h"
-#include "todoEditor.moc"
-
-
-TodoEditor::TodoEditor(PilotTodoEntry * p, struct ToDoAppInfo *appInfo,
- TQWidget * parent, const char *name) :
- KDialogBase(parent, name, false, i18n("To-do Editor"), Ok|Cancel),
- fDeleteOnCancel(p == 0L),
- fTodo(p),
- fAppInfo(appInfo)
-{
- FUNCTIONSETUP;
-
- fWidget=new TodoEditorBase(this);
- setMainWidget(fWidget);
- fillFields();
-
- connect(parent, TQT_SIGNAL(recordChanged(PilotTodoEntry *)),
- this, TQT_SLOT(updateRecord(PilotTodoEntry *)));
-
-}
-
-TodoEditor::~TodoEditor()
-{
- FUNCTIONSETUP;
-
- if (fDeleteOnCancel && fTodo)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Deleting private todo record." << endl;
-#endif
- delete fTodo;
- fTodo = 0L;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Help! I'm deleting!" << endl;
-#endif
-}
-
-
-
-void TodoEditor::fillFields()
-{
- FUNCTIONSETUP;
-
- if (fTodo == 0L)
- {
- fTodo = new PilotTodoEntry();
- fDeleteOnCancel = true;
- }
-
- fWidget->fDescription->setText(fTodo->getDescription());
- fWidget->fCompleted->setChecked(fTodo->getComplete());
- if (fTodo->getIndefinite())
- {
- fWidget->fHasEndDate->setChecked(false);
- }
- else
- {
- fWidget->fHasEndDate->setChecked(true);
- fWidget->fEndDate->setDate(readTm(fTodo->getDueDate()).date());
- }
- fWidget->fPriority->setCurrentItem(fTodo->getPriority());
-// fCategory->setCurrentItem(fTodo->getCategory()));
- fWidget->fNote->setText(fTodo->getNote());
-}
-
-
-
-/* slot */ void TodoEditor::slotCancel()
-{
- FUNCTIONSETUP;
-
- if (fDeleteOnCancel && fTodo)
- {
- delete fTodo;
-
- fTodo = 0L;
- }
- KDialogBase::slotCancel();
-}
-
-/* slot */ void TodoEditor::slotOk()
-{
- FUNCTIONSETUP;
-
- // Commit changes here
- fTodo->setDescription(fWidget->fDescription->text());
- fTodo->setComplete(fWidget->fCompleted->isChecked());
- if (fWidget->fHasEndDate->isChecked())
- {
- fTodo->setIndefinite(false);
- struct tm duedate=writeTm(fWidget->fEndDate->date());
- fTodo->setDueDate(duedate);
- }
- else
- {
- fTodo->setIndefinite(true);
- }
- fTodo->setPriority(fWidget->fPriority->currentItem());
-// fTodo->setCategory(fWidget->fCategory->currentItem());
- fTodo->setNote(fWidget->fNote->text());
-
- emit(recordChangeComplete(fTodo));
- KDialogBase::slotOk();
-}
-
-/* slot */ void TodoEditor::updateRecord(PilotTodoEntry * p)
-{
- FUNCTIONSETUP;
- if (p != fTodo)
- {
- // Not meant for me
- //
- //
- return;
- }
-
- if (p->isDeleted())
- {
- delayedDestruct();
- return;
- }
- else
- {
- fillFields();
- }
-}
-
diff --git a/kpilot/kpilot/todoEditor.h b/kpilot/kpilot/todoEditor.h
deleted file mode 100644
index 53dbb33c..00000000
--- a/kpilot/kpilot/todoEditor.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// -*- C++ -*-
-/* todoEditor.h KPilot
-**
-** Copyright (C) 1998-2000 by Dan Pilone
-**
-** This is a dialog window that is used to edit a single todo record.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#ifndef _KPILOT_TODOEDITOR_H
-#define _KPILOT_TODOEDITOR_H
-
-#include <kdialogbase.h>
-
-class PilotTodoEntry;
-struct ToDoAppInfo;
-
-class TQComboBox;
-class TQTextEdit;
-class TQCheckBox;
-class KDateWidget;
-class TodoEditorBase;
-
-class TodoEditor : public KDialogBase
-{
- Q_OBJECT
-
-
-public:
- TodoEditor(PilotTodoEntry *todo,
- struct ToDoAppInfo *appInfo,
- TQWidget *parent, const char *name=0L);
- ~TodoEditor();
-
-
-signals:
- void recordChangeComplete ( PilotTodoEntry* );
-
-public slots:
- void slotOk();
- void slotCancel();
- void updateRecord(PilotTodoEntry *);
-
-private:
- TodoEditorBase*fWidget;
- bool fDeleteOnCancel;
-
- PilotTodoEntry* fTodo;
- struct ToDoAppInfo *fAppInfo;
-
- void fillFields();
-};
-#endif
-
diff --git a/kpilot/kpilot/todoEditor_base.ui b/kpilot/kpilot/todoEditor_base.ui
deleted file mode 100644
index 9ed2d569..00000000
--- a/kpilot/kpilot/todoEditor_base.ui
+++ /dev/null
@@ -1,180 +0,0 @@
-<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
-<class>TodoEditorBase</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>TodoEditorBase</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>399</width>
- <height>263</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>fDescriptionLabel</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>&amp;Description:</string>
- </property>
- <property name="alignment">
- <set>AlignTop</set>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fDescription</cstring>
- </property>
- </widget>
- <widget class="QLabel" row="4" column="0">
- <property name="name">
- <cstring>fNoteLabel</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>&amp;Note:</string>
- </property>
- <property name="alignment">
- <set>AlignTop</set>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fNote</cstring>
- </property>
- </widget>
- <widget class="QLabel" row="2" column="2">
- <property name="name">
- <cstring>fCategoryLabel</cstring>
- </property>
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Ca&amp;tegory:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fCategory</cstring>
- </property>
- </widget>
- <widget class="QComboBox" row="2" column="3">
- <property name="name">
- <cstring>fCategory</cstring>
- </property>
- <property name="enabled">
- <bool>false</bool>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="2">
- <property name="name">
- <cstring>fPriorityLabel</cstring>
- </property>
- <property name="text">
- <string>&amp;Priority:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>fPriority</cstring>
- </property>
- </widget>
- <widget class="QComboBox" row="1" column="3">
- <item>
- <property name="text">
- <string>1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>3</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>4</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>5</string>
- </property>
- </item>
- <property name="name">
- <cstring>fPriority</cstring>
- </property>
- </widget>
- <widget class="QTextEdit" row="0" column="1" rowspan="1" colspan="3">
- <property name="name">
- <cstring>fDescription</cstring>
- </property>
- <property name="maximumSize">
- <size>
- <width>32767</width>
- <height>80</height>
- </size>
- </property>
- </widget>
- <widget class="QTextEdit" row="4" column="1" rowspan="1" colspan="3">
- <property name="name">
- <cstring>fNote</cstring>
- </property>
- </widget>
- <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fCompleted</cstring>
- </property>
- <property name="text">
- <string>&amp;Completed</string>
- </property>
- </widget>
- <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fHasEndDate</cstring>
- </property>
- <property name="text">
- <string>Has &amp;end date:</string>
- </property>
- </widget>
- <widget class="KDateWidget" row="3" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>fEndDate</cstring>
- </property>
- <property name="enabled">
- <bool>false</bool>
- </property>
- </widget>
- </grid>
-</widget>
-<connections>
- <connection>
- <sender>fHasEndDate</sender>
- <signal>toggled(bool)</signal>
- <receiver>fEndDate</receiver>
- <slot>setEnabled(bool)</slot>
- </connection>
-</connections>
-<layoutdefaults spacing="6" margin="11"/>
-<includes>
- <include location="system" impldecl="in implementation">kdatewidget.h</include>
-</includes>
-</UI>
diff --git a/kpilot/kpilot/todoWidget.cc b/kpilot/kpilot/todoWidget.cc
deleted file mode 100644
index 4e0e9394..00000000
--- a/kpilot/kpilot/todoWidget.cc
+++ /dev/null
@@ -1,608 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This file defines the todoWidget, that part of KPilot that
-** displays todo records from the Pilot.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-
-#include "options.h"
-
-#include <tqptrlist.h>
-#include <klistview.h>
-#include <tqpushbutton.h>
-#include <tqlayout.h>
-#include <tqlabel.h>
-#include <tqtextview.h>
-#include <tqcombobox.h>
-#include <tqwhatsthis.h>
-#include <tqtextcodec.h>
-
-#include <kmessagebox.h>
-
-#include "kpilotConfig.h"
-#include "todoEditor.h"
-#include "pilotLocalDatabase.h"
-#include "todoWidget.moc"
-
-
-
-
-TodoCheckListItem::TodoCheckListItem(TQListView*parent, const TQString&text,
- recordid_t pilotid, void*r):PilotCheckListItem(parent, text, pilotid, r)
-{
-
-}
-
-void TodoCheckListItem::stateChange(bool state)
-{
- TodoListView*par=dynamic_cast<TodoListView*>(listView());
- if (par) par->itemWasChecked(this, state);
-}
-
-
-
-TodoWidget::TodoWidget(TQWidget * parent,
- const TQString & path) :
- PilotComponent(parent, "component_todo", path),
- fTodoInfo(0L),
- fTodoAppInfo(0L),
- fTodoDB(0L),
- fPendingTodos(0)
-{
- FUNCTIONSETUP;
-
- setupWidget();
- fTodoList.setAutoDelete(true);
-
-}
-
-TodoWidget::~TodoWidget()
-{
- FUNCTIONSETUP;
- KPILOT_DELETE( fTodoDB );
-}
-
-int TodoWidget::getAllTodos(PilotDatabase * todoDB)
-{
- FUNCTIONSETUP;
-
- int currentRecord = 0;
- PilotRecord *pilotRec;
- PilotTodoEntry *todo;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Reading ToDoDB..." << endl;
-#endif
-
- while ((pilotRec = todoDB->readRecordByIndex(currentRecord)) != 0L)
- {
- if (!(pilotRec->isDeleted()) &&
- (!(pilotRec->isSecret()) || KPilotSettings::showSecrets()))
- {
- todo = new PilotTodoEntry(pilotRec);
- if (todo == 0L)
- {
- WARNINGKPILOT << "Couldn't allocate record "
- << currentRecord++
- << endl;
- break;
- }
- fTodoList.append(todo);
- }
- KPILOT_DELETE( pilotRec );
-
- currentRecord++;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Total " << currentRecord << " records" << endl;
-#endif
-
- return currentRecord;
-}
-
-void TodoWidget::showComponent()
-{
- FUNCTIONSETUP;
- if ( fPendingTodos>0 ) return;
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Reading from directory " << dbPath() << endl;
-#endif
-
- fTodoDB = new PilotLocalDatabase(dbPath(), CSL1("ToDoDB"));
-
- fTodoList.clear();
-
- if (fTodoDB->isOpen())
- {
- KPILOT_DELETE(fTodoAppInfo);
- fTodoAppInfo = new PilotToDoInfo(fTodoDB);
- populateCategories(fCatList, fTodoAppInfo->categoryInfo());
- getAllTodos(fTodoDB);
-
- }
- else
- {
- populateCategories(fCatList, 0L);
- WARNINGKPILOT << "Could not open local TodoDB" << endl;
- }
-
- KPILOT_DELETE( fTodoDB );
-
- updateWidget();
-}
-
-/* virtual */ bool TodoWidget::preHotSync(TQString &s)
-{
- FUNCTIONSETUP;
-
- if (fPendingTodos)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": fPendingTodo="
- << fPendingTodos
- << endl;
-#endif
-
-#if KDE_VERSION<220
- s = i18n("There are still %1 to-do editing windows open.")
- .arg(TQString::number(fPendingTodos));
-#else
- s = i18n("There is still a to-do editing window open.",
- "There are still %n to-do editing windows open.",
- fPendingTodos);
-#endif
- return false;
- }
-
- return true;
-}
-
-void TodoWidget::postHotSync()
-{
- FUNCTIONSETUP;
-
- fTodoList.clear();
- showComponent();
-}
-
-void TodoWidget::hideComponent()
-{
- FUNCTIONSETUP;
- if ( fPendingTodos==0 )
- {
- fTodoList.clear();
- fListBox->clear();
- KPILOT_DELETE( fTodoDB );
- }
-}
-
-void TodoWidget::setupWidget()
-{
- FUNCTIONSETUP;
-
- TQLabel *label;
- TQGridLayout *grid = new TQGridLayout(this, 6, 4, SPACING);
-
- fCatList = new TQComboBox(this);
- grid->addWidget(fCatList, 0, 1);
- connect(fCatList, TQT_SIGNAL(activated(int)),
- this, TQT_SLOT(slotSetCategory(int)));
- TQWhatsThis::add(fCatList,
- i18n("<qt>Select the category of to-dos to display here.</qt>"));
-
- label = new TQLabel(i18n("Category:"), this);
- label->setBuddy(fCatList);
- grid->addWidget(label, 0, 0);
-
- fListBox = new TodoListView(this);
- fListBox->addColumn( i18n( "To-do Item" ) );
- fListBox->setAllColumnsShowFocus( TRUE );
- fListBox->setResizeMode( KListView::LastColumn );
- fListBox->setFullWidth( TRUE );
- fListBox->setItemsMovable( FALSE );
- fListBox->setItemsRenameable (TRUE);
- grid->addMultiCellWidget(fListBox, 1, 1, 0, 1);
- connect(fListBox, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
- this, TQT_SLOT(slotShowTodo(TQListViewItem*)));
- connect(fListBox, TQT_SIGNAL(doubleClicked(TQListViewItem*)),
- this, TQT_SLOT(slotEditRecord(TQListViewItem*)));
- connect(fListBox, TQT_SIGNAL(returnPressed(TQListViewItem*)),
- this, TQT_SLOT(slotEditRecord(TQListViewItem*)));
- connect(fListBox, TQT_SIGNAL(itemChecked(TQCheckListItem*, bool)),
- this, TQT_SLOT(slotItemChecked(TQCheckListItem*, bool)));
- connect(fListBox, TQT_SIGNAL(itemRenamed(TQListViewItem*, const TQString &, int)),
- this, TQT_SLOT(slotItemRenamed(TQListViewItem*, const TQString &, int)));
- TQWhatsThis::add(fListBox,
- i18n("<qt>This list displays all the to-dos "
- "in the selected category. Click on "
- "one to display it to the right.</qt>"));
-
- label = new TQLabel(i18n("To-do info:"), this);
- grid->addWidget(label, 0, 2);
-
- // todo info text view
- fTodoInfo = new TQTextView(this);
- grid->addMultiCellWidget(fTodoInfo, 1, 4, 2, 2);
-
- TQPushButton *button;
- TQString wt;
-
- fEditButton = new TQPushButton(i18n("Edit Record..."), this);
- grid->addWidget(fEditButton, 2, 0);
- connect(fEditButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditRecord()));
-
- wt = KPilotSettings::internalEditors() ?
- i18n("<qt>You can edit a to-do when it is selected.</qt>") :
- i18n("<qt><i>Editing is disabled by the 'internal editors' setting.</i></qt>");
- TQWhatsThis::add(fEditButton,wt);
-
- button = new TQPushButton(i18n("New Record..."), this);
- grid->addWidget(button, 2, 1);
- connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCreateNewRecord()));
- wt = KPilotSettings::internalEditors() ?
- i18n("<qt>Add a new to-do to the to-do list.</qt>") :
- i18n("<qt><i>Adding new to-dos is disabled by the 'internal editors' setting.</i></qt>");
- TQWhatsThis::add(button, wt);
- button->setEnabled(KPilotSettings::internalEditors());
-
- fDeleteButton = new TQPushButton(i18n("Delete Record"), this);
- grid->addWidget(fDeleteButton, 3, 0);
- connect(fDeleteButton, TQT_SIGNAL(clicked()),
- this, TQT_SLOT(slotDeleteRecord()));
- wt = KPilotSettings::internalEditors() ?
- i18n("<qt>Delete the selected to-do from the to-do list.</qt>") :
- i18n("<qt><i>Deleting is disabled by the 'internal editors' setting.</i></qt>") ;
- TQWhatsThis::add(fDeleteButton,wt);
-}
-
-void TodoWidget::updateWidget()
-{
- FUNCTIONSETUP;
- if (!shown || !fTodoAppInfo ) return;
-
- int listIndex = 0;
-
- int currentCatID = findSelectedCategory(fCatList,
- fTodoAppInfo->categoryInfo());
-
- fListBox->clear();
- fTodoList.first();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Adding records..." << endl;
-#endif
-
- PilotTodoEntry*todo;
- while (fTodoList.current())
- {
- todo=fTodoList.current();
- if ((currentCatID == -1) ||
- (todo->category() == currentCatID))
- {
- TQString title = todo->getDescription();
-
- TodoCheckListItem*item=new TodoCheckListItem(fListBox, title,
- listIndex, todo);
- item->setOn(todo->getComplete());
- }
- listIndex++;
- fTodoList.next();
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": " << listIndex << " records" << endl;
-#endif
-
- slotUpdateButtons();
-}
-
-
-
-/* slot */ void TodoWidget::slotUpdateButtons()
-{
- FUNCTIONSETUP;
-
- bool enabled = (fListBox->currentItem() != 0L);
-
- enabled &= KPilotSettings::internalEditors() ;
-
- fEditButton->setEnabled(enabled);
- fDeleteButton->setEnabled(enabled);
-}
-
-void TodoWidget::slotSetCategory(int)
-{
- FUNCTIONSETUP;
-
- updateWidget();
-}
-
-void TodoWidget::slotEditRecord()
-{
- slotEditRecord(fListBox->currentItem());
-}
-void TodoWidget::slotEditRecord(TQListViewItem*item)
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- TodoCheckListItem*p = static_cast<TodoCheckListItem*>(item);
- if (!p) return;
- PilotTodoEntry *selectedRecord = (PilotTodoEntry *) p->rec();
-
- if (selectedRecord->id() == 0)
- {
- KMessageBox::error(0L,
- i18n("Cannot edit new records until "
- "HotSynced with Pilot."),
- i18n("HotSync Required"));
- return;
- }
-
- TodoEditor *editor = new TodoEditor(selectedRecord,
- fTodoAppInfo->info(), this);
-
- connect(editor, TQT_SIGNAL(recordChangeComplete(PilotTodoEntry *)),
- this, TQT_SLOT(slotUpdateRecord(PilotTodoEntry *)));
- connect(editor, TQT_SIGNAL(cancelClicked()),
- this, TQT_SLOT(slotEditCancelled()));
- editor->show();
-
- fPendingTodos++;
-}
-
-void TodoWidget::slotCreateNewRecord()
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- // Response to bug 18072: Don't even try to
- // add records to an empty or unopened database,
- // since we don't have the DBInfo stuff to deal with it.
- //
- //
- PilotDatabase *myDB = new PilotLocalDatabase(dbPath(), CSL1("ToDoDB"));
-
- if (!myDB || !myDB->isOpen())
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Tried to open "
- << dbPath()
- << "/ToDoDB"
- << " and got pointer @"
- << (void *) myDB
- << " with status "
- << ( myDB ? myDB->isOpen() : false )
- << endl;
-#endif
-
- KMessageBox::sorry(this,
- i18n("You cannot add to-dos to the to-do list "
- "until you have done a HotSync at least once "
- "to retrieve the database layout from your Pilot."),
- i18n("Cannot Add New To-do"));
-
- if (myDB)
- KPILOT_DELETE( myDB );
-
- return;
- }
-
- TodoEditor *editor = new TodoEditor(0L,
- fTodoAppInfo->info(), this);
-
- connect(editor, TQT_SIGNAL(recordChangeComplete(PilotTodoEntry *)),
- this, TQT_SLOT(slotAddRecord(PilotTodoEntry *)));
- connect(editor, TQT_SIGNAL(cancelClicked()),
- this, TQT_SLOT(slotEditCancelled()));
- editor->show();
-
- fPendingTodos++;
-}
-
-void TodoWidget::slotAddRecord(PilotTodoEntry * todo)
-{
- FUNCTIONSETUP;
- if ( !shown && fPendingTodos==0 ) return;
-
- int currentCatID = findSelectedCategory(fCatList,
- fTodoAppInfo->categoryInfo(), true);
-
-
- todo->PilotRecordBase::setCategory(currentCatID);
- fTodoList.append(todo);
- writeTodo(todo);
- // TODO: Just add the new record to the lists
- updateWidget();
-
- // k holds the item number of the todo just added.
- //
-// int k = fListBox->count() - 1;
-//
-// fListBox->setCurrentItem(k); // Show the newest one
-// fListBox->setBottomItem(k);
-
- fPendingTodos--;
- if ( !shown && fPendingTodos==0 ) hideComponent();
-}
-
-void TodoWidget::slotUpdateRecord(PilotTodoEntry * todo)
-{
- FUNCTIONSETUP;
- if ( !shown && fPendingTodos==0 ) return;
-
- writeTodo(todo);
- TodoCheckListItem* currentRecord = static_cast<TodoCheckListItem*>(fListBox->currentItem());
-
- // TODO: Just change the record
- updateWidget();
- fListBox->setCurrentItem(currentRecord);
-
- emit(recordChanged(todo));
-
- fPendingTodos--;
- if ( !shown && fPendingTodos==0 ) hideComponent();
-}
-
-void TodoWidget::slotEditCancelled()
-{
- FUNCTIONSETUP;
-
- fPendingTodos--;
- if ( !shown && fPendingTodos==0 ) hideComponent();
-}
-
-void TodoWidget::slotDeleteRecord()
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- TodoCheckListItem* p = static_cast<TodoCheckListItem*>(fListBox->currentItem());
- if (p == 0L) return;
-
- PilotTodoEntry *selectedRecord = (PilotTodoEntry *) p->rec();
-
- if (selectedRecord->id() == 0)
- {
- KMessageBox::error(this,
- i18n("New records cannot be deleted until "
- "HotSynced with pilot."),
- i18n("HotSync Required"));
- return;
- }
-
- if (KMessageBox::questionYesNo(this,
- i18n("Delete currently selected record?"),
- i18n("Delete Record?"), KStdGuiItem::del(), KStdGuiItem::cancel()) == KMessageBox::No)
- return;
-
- selectedRecord->setDeleted(true);
- writeTodo(selectedRecord);
- emit(recordChanged(selectedRecord));
- showComponent();
-}
-
-
-
-void TodoWidget::slotShowTodo(TQListViewItem*item)
-{
- FUNCTIONSETUP;
- if (!shown) return;
-
- TodoCheckListItem *p = dynamic_cast<TodoCheckListItem*>(item);
- if (!p) return;
- PilotTodoEntry *todo = (PilotTodoEntry *) p->rec();
-
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Showing "<< todo->getDescription()<<endl;
-#endif
-
- TQString text(CSL1("<qt>"));
- text += todo->getTextRepresentation(Qt::RichText);
- text += CSL1("</qt>\n");
- fTodoInfo->setText(text);
-
- slotUpdateButtons();
-}
-
-
-
-void TodoWidget::writeTodo(PilotTodoEntry * which,
- PilotDatabase * todoDB)
-{
- FUNCTIONSETUP;
-
- // Open a database (myDB) only if needed,
- // i.e. only if the passed-in todoDB
- // isn't valid.
- //
- //
- PilotDatabase *myDB = todoDB;
- bool usemyDB = false;
-
- if (myDB == 0L || !myDB->isOpen())
- {
- myDB = new PilotLocalDatabase(dbPath(), CSL1("ToDoDB"));
- usemyDB = true;
- }
-
- // Still no valid todo database...
- //
- //
- if (!myDB->isOpen())
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname << ": Todo database is not open" <<
- endl;
-#endif
- return;
- }
-
-
- // Do the actual work.
- PilotRecord *pilotRec = which->pack();
-
- myDB->writeRecord(pilotRec);
- markDBDirty(CSL1("ToDoDB"));
- KPILOT_DELETE(pilotRec);
-
-
- // Clean up in the case that we allocated our own DB.
- //
- //
- if (usemyDB)
- {
- KPILOT_DELETE(myDB);
- }
-}
-
-void TodoWidget::slotItemChecked(TQCheckListItem*item, bool on)
-{
- TodoCheckListItem*p = static_cast<TodoCheckListItem*>(item);
- if (!p) return;
- PilotTodoEntry *selectedRecord = (PilotTodoEntry *) p->rec();
- if (!selectedRecord) return;
- selectedRecord->setComplete(on);
- slotShowTodo(item);
-}
-
-void TodoWidget::slotItemRenamed(TQListViewItem*item, const TQString &txt, int nr)
-{
- TodoCheckListItem*p = static_cast<TodoCheckListItem*>(item);
- if (!p) return;
- PilotTodoEntry *selectedRecord = (PilotTodoEntry *) p->rec();
- if (!selectedRecord) return;
- if (nr==0)
- {
- selectedRecord->setDescription(txt);
- slotShowTodo(item);
- }
-}
diff --git a/kpilot/kpilot/todoWidget.h b/kpilot/kpilot/todoWidget.h
deleted file mode 100644
index 63ee3e86..00000000
--- a/kpilot/kpilot/todoWidget.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* todoWidget.h KPilot
-**
-** Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-
-** This file defines the todo-viewing widget used in KPilot
-** to display the Pilot's todo records.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-#ifndef _KPILOT_TODOWIDGET_H
-#define _KPILOT_TODOWIDGET_H
-
-class TQComboBox;
-class TQPushButton;
-class TQTextView;
-
-#include "pilotComponent.h"
-#include "pilotTodoEntry.h"
-#include "listItems.h"
-
-class TodoListView : public KListView
-{
-Q_OBJECT
-public:
- TodoListView(TQWidget * parent = 0, const char * name = 0 ):KListView(parent, name){};
- ~TodoListView() {};
-signals:
- void itemChecked(TQCheckListItem*item);
- void itemChecked(TQCheckListItem*item, bool on);
-//protected:
-public:
- void itemWasChecked(TQCheckListItem*item, bool on) {
- emit itemChecked(item);
- emit itemChecked(item, on);
- }
-};
-
-class TodoCheckListItem : public PilotCheckListItem
-{
-public:
- TodoCheckListItem(TQListView*parent, const TQString&text, recordid_t pilotid, void*r);
- ~TodoCheckListItem() {};
- virtual void stateChange(bool state);
-};
-
-class TodoWidget : public PilotComponent
-{
-Q_OBJECT
-
-public:
- TodoWidget(TQWidget* parent,const TQString& dbpath);
- ~TodoWidget();
-
- // Pilot Component Methods:
- virtual bool preHotSync(TQString &);
- virtual void postHotSync();
- virtual void showComponent();
- virtual void hideComponent();
-
-public slots:
- /**
- * Called when a particular todo is selected. This slot displays
- * it in the viewer widget.
- */
- void slotShowTodo(TQListViewItem*);
- void slotEditRecord(TQListViewItem*item);
- void slotEditRecord();
- void slotCreateNewRecord();
- void slotDeleteRecord();
- void slotEditCancelled();
-
- void slotUpdateButtons(); // Enable/disable buttons
-
-signals:
- void recordChanged(PilotTodoEntry *);
-
-protected slots:
- /**
- * When an edit window is closed, the corresponding record
- * is updated and possibly re-displayed.
- */
- void slotUpdateRecord(PilotTodoEntry*);
-
- /**
- * Pop up an edit window for a new record.
- */
- void slotAddRecord(PilotTodoEntry*);
-
- /**
- * Change category. This means that the display should be
- * cleared and that the list should be repopulated.
- */
- void slotSetCategory(int);
-
-
- void slotItemChecked(TQCheckListItem*item, bool on);
- void slotItemRenamed(TQListViewItem*item, const TQString &txt, int nr);
-private:
- void setupWidget();
- void updateWidget(); // Called with the lists have changed..
- void writeTodo(PilotTodoEntry* which,PilotDatabase *db=0L);
-
- /**
- * getAllTodos reads the database and places all
- * the todos from the database in the list
- * in memory --- not the list on the screen.
- * @see fTodoList
- */
- int getAllTodos(PilotDatabase *todoDB);
-
- /**
- * Create a sensible "title" for an todo, composed
- * of first + last name if possible.
- */
- TQString createTitle(PilotTodoEntry *,int displayMode);
-
- /**
- * We use a TQComboBox fCatList to hold the user-visible names
- * of all the categories. The TQTextView fTodoInfo is for
- * displaying the currently selected todo, if any.
- * The TQListView fListBox lists all the todoes in the
- * currently selected category.
- *
- * The entire todo database is read into memory in the
- * QList fTodoList. We need the appinfo block from the
- * database to determine which categories there are; this
- * is held in fTodoAppInfo.
- *
- * The two buttons should speak for themselves.
- */
- QComboBox *fCatList;
- QTextView *fTodoInfo;
- PilotToDoInfo *fTodoAppInfo;
- TQPtrList<PilotTodoEntry> fTodoList;
- TodoListView *fListBox;
- QPushButton *fEditButton,*fDeleteButton;
- PilotDatabase *fTodoDB;
-protected:
- /**
- * Keep track of how many open todo editing windows there
- * are. You can't sync when there are open windows.
- */
- int fPendingTodos;
-
-};
-
-#endif