From 79fd2b2bbd9f842ce3c84c67e3314033a9cceea4 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:18:06 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- CMakeLists.txt | 4 +- ark/CMakeLists.txt | 6 +- ark/Makefile.am | 2 +- ark/arch.cpp | 2 +- ark/arj.cpp | 2 +- ark/ark_part.h | 8 +- ark/ark_part.rc | 2 +- ark/ark_part_readonly.rc | 2 +- ark/arkfactory.h | 2 +- ark/arkutils.cpp | 230 ---- ark/arkutils.h | 56 - ark/arkviewer.cpp | 2 +- ark/arkviewer.h | 2 +- ark/arkwidget.cpp | 2 +- ark/artdeutils.cpp | 230 ++++ ark/artdeutils.h | 56 + ark/extractiondialog.cpp | 2 +- ark/lha.cpp | 2 +- ark/mainwindow.cpp | 4 +- ark/mainwindow.h | 4 +- ark/rar.cpp | 2 +- ark/sevenzip.cpp | 2 +- ark/zoo.cpp | 2 +- doc/kwallet/CMakeLists.txt | 13 - doc/kwallet/Makefile.am | 4 - doc/kwallet/cr22-action-wallet_closed.png | Bin 997 -> 0 bytes doc/kwallet/cr22-action-wallet_open.png | Bin 1098 -> 0 bytes doc/kwallet/edit1.png | Bin 19314 -> 0 bytes doc/kwallet/edit2.png | Bin 26113 -> 0 bytes doc/kwallet/edit3.png | Bin 59244 -> 0 bytes doc/kwallet/index.docbook | 396 ------- doc/kwallet/kwalletmanager.png | Bin 11282 -> 0 bytes doc/kwallet/password1.png | Bin 19088 -> 0 bytes doc/kwallet/password2.png | Bin 21999 -> 0 bytes doc/tdewallet/CMakeLists.txt | 13 + doc/tdewallet/Makefile.am | 4 + doc/tdewallet/cr22-action-wallet_closed.png | Bin 0 -> 997 bytes doc/tdewallet/cr22-action-wallet_open.png | Bin 0 -> 1098 bytes doc/tdewallet/edit1.png | Bin 0 -> 19314 bytes doc/tdewallet/edit2.png | Bin 0 -> 26113 bytes doc/tdewallet/edit3.png | Bin 0 -> 59244 bytes doc/tdewallet/index.docbook | 396 +++++++ doc/tdewallet/password1.png | Bin 0 -> 19088 bytes doc/tdewallet/password2.png | Bin 0 -> 21999 bytes doc/tdewallet/tdewalletmanager.png | Bin 0 -> 11282 bytes kcalc/knumber/tests/Makefile.am | 2 +- kcharselect/Makefile.am | 2 +- kdelirc/kcmlirc/addaction.cpp | 2 +- kdelirc/kcmlirc/editaction.cpp | 2 +- kdelirc/kdelirc/Makefile.am | 2 +- kdessh/Makefile.am | 2 +- kdf/Makefile.am | 4 +- kedit/kedit.cpp | 44 +- kedit/kedit.h | 4 +- kfloppy/Makefile.am | 2 +- kgpg/CMakeLists.txt | 2 +- kgpg/Makefile.am | 4 +- khexedit/Makefile.am | 2 +- khexedit/optiondialog.cc | 2 +- khexedit/parts/kbytesedit/CMakeLists.txt | 2 +- khexedit/parts/kpart/CMakeLists.txt | 2 +- khexedit/parts/kpart/khebrowserextension.h | 2 +- khexedit/parts/kpart/khepart.h | 2 +- khexedit/parts/kpart/khepartfactory.h | 2 +- kjots/Makefile.am | 2 +- klaptopdaemon/Makefile.am | 10 +- kmilo/delli8k/README | 4 +- kmilo/kmilod/kmilod.cpp | 2 +- kregexpeditor/CMakeLists.txt | 2 +- kregexpeditor/KMultiFormListBox/CMakeLists.txt | 22 +- kregexpeditor/KMultiFormListBox/Makefile.am | 18 +- kregexpeditor/KMultiFormListBox/ccp.cpp | 2 +- .../kmultiformlistbox-multivisible.cpp | 305 ------ .../kmultiformlistbox-multivisible.h | 136 --- .../KMultiFormListBox/kmultiformlistbox-shower.h | 53 - .../kmultiformlistbox-windowed.cpp | 213 ---- .../KMultiFormListBox/kmultiformlistbox-windowed.h | 84 -- .../KMultiFormListBox/kmultiformlistbox.cpp | 104 -- .../KMultiFormListBox/kmultiformlistbox.h | 126 --- .../KMultiFormListBox/kmultiformlistboxentry.cpp | 44 - .../KMultiFormListBox/kmultiformlistboxentry.h | 74 -- .../KMultiFormListBox/kmultiformlistboxfactory.cpp | 26 - .../KMultiFormListBox/kmultiformlistboxfactory.h | 70 -- .../tdemultiformlistbox-multivisible.cpp | 305 ++++++ .../tdemultiformlistbox-multivisible.h | 136 +++ .../KMultiFormListBox/tdemultiformlistbox-shower.h | 53 + .../tdemultiformlistbox-windowed.cpp | 213 ++++ .../tdemultiformlistbox-windowed.h | 84 ++ .../KMultiFormListBox/tdemultiformlistbox.cpp | 104 ++ .../KMultiFormListBox/tdemultiformlistbox.h | 126 +++ .../KMultiFormListBox/tdemultiformlistboxentry.cpp | 44 + .../KMultiFormListBox/tdemultiformlistboxentry.h | 74 ++ .../tdemultiformlistboxfactory.cpp | 26 + .../KMultiFormListBox/tdemultiformlistboxfactory.h | 70 ++ kregexpeditor/KMultiFormListBox/widgetwindow.h | 2 +- kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp | 2 +- kregexpeditor/Makefile.am | 4 +- kregexpeditor/characterswidget.h | 2 +- kregexpeditor/qt-only/qt-only.pro | 22 +- ktimer/Makefile.am | 2 +- kwallet/CMakeLists.txt | 55 - kwallet/Makefile.am | 26 - kwallet/TODO | 13 - kwallet/allyourbase.cpp | 733 ------------- kwallet/allyourbase.h | 180 --- kwallet/hi128-app-kwalletmanager.png | Bin 24094 -> 0 bytes kwallet/hi128-app-kwalletmanager2.png | Bin 28434 -> 0 bytes kwallet/hi16-app-kwalletmanager.png | Bin 1209 -> 0 bytes kwallet/hi16-app-kwalletmanager2.png | Bin 1139 -> 0 bytes kwallet/hi22-app-kwalletmanager.png | Bin 1601 -> 0 bytes kwallet/hi32-app-kwalletmanager.png | Bin 3273 -> 0 bytes kwallet/hi32-app-kwalletmanager2.png | Bin 3225 -> 0 bytes kwallet/hi48-app-kwalletmanager.png | Bin 6355 -> 0 bytes kwallet/hi48-app-kwalletmanager2.png | Bin 6332 -> 0 bytes kwallet/hi64-app-kwalletmanager.png | Bin 9728 -> 0 bytes kwallet/hi64-app-kwalletmanager2.png | Bin 9702 -> 0 bytes kwallet/icons/CMakeLists.txt | 16 - kwallet/icons/Makefile.am | 5 - kwallet/icons/cr22-action-folder_closed.png | Bin 1149 -> 0 bytes kwallet/icons/cr22-action-folder_open.png | Bin 1349 -> 0 bytes kwallet/icons/cr22-action-wallet_closed.png | Bin 997 -> 0 bytes kwallet/icons/cr22-action-wallet_open.png | Bin 1098 -> 0 bytes kwallet/kbetterthankdialogbase.ui | 154 --- kwallet/kbetterthankdialogbase.ui.h | 50 - kwallet/konfigurator/CMakeLists.txt | 45 - kwallet/konfigurator/Makefile.am | 15 - kwallet/konfigurator/konfigurator.cpp | 323 ------ kwallet/konfigurator/konfigurator.h | 58 - kwallet/konfigurator/kwallet_config.desktop | 47 - kwallet/konfigurator/kwalletconfig.desktop | 152 --- kwallet/konfigurator/kwalletmanager_show.desktop | 60 - kwallet/konfigurator/walletconfigwidget.ui | 499 --------- kwallet/kwalleteditor.cpp | 1143 -------------------- kwallet/kwalleteditor.h | 111 -- kwallet/kwalleteditor.rc | 17 - kwallet/kwalletmanager-kwalletd.desktop | 60 - kwallet/kwalletmanager.cpp | 423 -------- kwallet/kwalletmanager.desktop | 63 -- kwallet/kwalletmanager.h | 85 -- kwallet/kwalletmanager.rc | 14 - kwallet/kwalletpopup.cpp | 110 -- kwallet/kwalletpopup.h | 55 - kwallet/kwmapeditor.cpp | 187 ---- kwallet/kwmapeditor.h | 62 -- kwallet/main.cpp | 100 -- kwallet/walletwidget.ui | 416 ------- superkaramba/src/Makefile.am | 2 +- superkaramba/src/karamba.cpp | 4 +- tdewallet/CMakeLists.txt | 55 + tdewallet/Makefile.am | 26 + tdewallet/TODO | 13 + tdewallet/allyourbase.cpp | 733 +++++++++++++ tdewallet/allyourbase.h | 180 +++ tdewallet/hi128-app-tdewalletmanager.png | Bin 0 -> 24094 bytes tdewallet/hi128-app-tdewalletmanager2.png | Bin 0 -> 28434 bytes tdewallet/hi16-app-tdewalletmanager.png | Bin 0 -> 1209 bytes tdewallet/hi16-app-tdewalletmanager2.png | Bin 0 -> 1139 bytes tdewallet/hi22-app-tdewalletmanager.png | Bin 0 -> 1601 bytes tdewallet/hi32-app-tdewalletmanager.png | Bin 0 -> 3273 bytes tdewallet/hi32-app-tdewalletmanager2.png | Bin 0 -> 3225 bytes tdewallet/hi48-app-tdewalletmanager.png | Bin 0 -> 6355 bytes tdewallet/hi48-app-tdewalletmanager2.png | Bin 0 -> 6332 bytes tdewallet/hi64-app-tdewalletmanager.png | Bin 0 -> 9728 bytes tdewallet/hi64-app-tdewalletmanager2.png | Bin 0 -> 9702 bytes tdewallet/icons/CMakeLists.txt | 16 + tdewallet/icons/Makefile.am | 5 + tdewallet/icons/cr22-action-folder_closed.png | Bin 0 -> 1149 bytes tdewallet/icons/cr22-action-folder_open.png | Bin 0 -> 1349 bytes tdewallet/icons/cr22-action-wallet_closed.png | Bin 0 -> 997 bytes tdewallet/icons/cr22-action-wallet_open.png | Bin 0 -> 1098 bytes tdewallet/kbetterthankdialogbase.ui | 154 +++ tdewallet/kbetterthankdialogbase.ui.h | 50 + tdewallet/konfigurator/CMakeLists.txt | 45 + tdewallet/konfigurator/Makefile.am | 15 + tdewallet/konfigurator/konfigurator.cpp | 323 ++++++ tdewallet/konfigurator/konfigurator.h | 58 + tdewallet/konfigurator/tdewallet_config.desktop | 47 + tdewallet/konfigurator/tdewalletconfig.desktop | 152 +++ .../konfigurator/tdewalletmanager_show.desktop | 60 + tdewallet/konfigurator/walletconfigwidget.ui | 499 +++++++++ tdewallet/kwalletmanager-tdewalletd.desktop | 60 + tdewallet/kwmapeditor.cpp | 187 ++++ tdewallet/kwmapeditor.h | 62 ++ tdewallet/main.cpp | 100 ++ tdewallet/tdewalleteditor.cpp | 1143 ++++++++++++++++++++ tdewallet/tdewalleteditor.h | 111 ++ tdewallet/tdewalleteditor.rc | 17 + tdewallet/tdewalletmanager.cpp | 423 ++++++++ tdewallet/tdewalletmanager.desktop | 63 ++ tdewallet/tdewalletmanager.h | 85 ++ tdewallet/tdewalletmanager.rc | 14 + tdewallet/tdewalletpopup.cpp | 110 ++ tdewallet/tdewalletpopup.h | 55 + tdewallet/walletwidget.ui | 416 +++++++ 194 files changed, 7332 insertions(+), 7332 deletions(-) delete mode 100644 ark/arkutils.cpp delete mode 100644 ark/arkutils.h create mode 100644 ark/artdeutils.cpp create mode 100644 ark/artdeutils.h delete mode 100644 doc/kwallet/CMakeLists.txt delete mode 100644 doc/kwallet/Makefile.am delete mode 100644 doc/kwallet/cr22-action-wallet_closed.png delete mode 100644 doc/kwallet/cr22-action-wallet_open.png delete mode 100644 doc/kwallet/edit1.png delete mode 100644 doc/kwallet/edit2.png delete mode 100644 doc/kwallet/edit3.png delete mode 100644 doc/kwallet/index.docbook delete mode 100644 doc/kwallet/kwalletmanager.png delete mode 100644 doc/kwallet/password1.png delete mode 100644 doc/kwallet/password2.png create mode 100644 doc/tdewallet/CMakeLists.txt create mode 100644 doc/tdewallet/Makefile.am create mode 100644 doc/tdewallet/cr22-action-wallet_closed.png create mode 100644 doc/tdewallet/cr22-action-wallet_open.png create mode 100644 doc/tdewallet/edit1.png create mode 100644 doc/tdewallet/edit2.png create mode 100644 doc/tdewallet/edit3.png create mode 100644 doc/tdewallet/index.docbook create mode 100644 doc/tdewallet/password1.png create mode 100644 doc/tdewallet/password2.png create mode 100644 doc/tdewallet/tdewalletmanager.png delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistbox.h delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp delete mode 100644 kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistbox-multivisible.cpp create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistbox-multivisible.h create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistbox-shower.h create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistbox-windowed.cpp create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistbox-windowed.h create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistbox.cpp create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistbox.h create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistboxentry.cpp create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistboxentry.h create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistboxfactory.cpp create mode 100644 kregexpeditor/KMultiFormListBox/tdemultiformlistboxfactory.h delete mode 100644 kwallet/CMakeLists.txt delete mode 100644 kwallet/Makefile.am delete mode 100644 kwallet/TODO delete mode 100644 kwallet/allyourbase.cpp delete mode 100644 kwallet/allyourbase.h delete mode 100644 kwallet/hi128-app-kwalletmanager.png delete mode 100644 kwallet/hi128-app-kwalletmanager2.png delete mode 100644 kwallet/hi16-app-kwalletmanager.png delete mode 100644 kwallet/hi16-app-kwalletmanager2.png delete mode 100644 kwallet/hi22-app-kwalletmanager.png delete mode 100644 kwallet/hi32-app-kwalletmanager.png delete mode 100644 kwallet/hi32-app-kwalletmanager2.png delete mode 100644 kwallet/hi48-app-kwalletmanager.png delete mode 100644 kwallet/hi48-app-kwalletmanager2.png delete mode 100644 kwallet/hi64-app-kwalletmanager.png delete mode 100644 kwallet/hi64-app-kwalletmanager2.png delete mode 100644 kwallet/icons/CMakeLists.txt delete mode 100644 kwallet/icons/Makefile.am delete mode 100644 kwallet/icons/cr22-action-folder_closed.png delete mode 100644 kwallet/icons/cr22-action-folder_open.png delete mode 100644 kwallet/icons/cr22-action-wallet_closed.png delete mode 100644 kwallet/icons/cr22-action-wallet_open.png delete mode 100644 kwallet/kbetterthankdialogbase.ui delete mode 100644 kwallet/kbetterthankdialogbase.ui.h delete mode 100644 kwallet/konfigurator/CMakeLists.txt delete mode 100644 kwallet/konfigurator/Makefile.am delete mode 100644 kwallet/konfigurator/konfigurator.cpp delete mode 100644 kwallet/konfigurator/konfigurator.h delete mode 100644 kwallet/konfigurator/kwallet_config.desktop delete mode 100644 kwallet/konfigurator/kwalletconfig.desktop delete mode 100644 kwallet/konfigurator/kwalletmanager_show.desktop delete mode 100644 kwallet/konfigurator/walletconfigwidget.ui delete mode 100644 kwallet/kwalleteditor.cpp delete mode 100644 kwallet/kwalleteditor.h delete mode 100644 kwallet/kwalleteditor.rc delete mode 100644 kwallet/kwalletmanager-kwalletd.desktop delete mode 100644 kwallet/kwalletmanager.cpp delete mode 100644 kwallet/kwalletmanager.desktop delete mode 100644 kwallet/kwalletmanager.h delete mode 100644 kwallet/kwalletmanager.rc delete mode 100644 kwallet/kwalletpopup.cpp delete mode 100644 kwallet/kwalletpopup.h delete mode 100644 kwallet/kwmapeditor.cpp delete mode 100644 kwallet/kwmapeditor.h delete mode 100644 kwallet/main.cpp delete mode 100644 kwallet/walletwidget.ui create mode 100644 tdewallet/CMakeLists.txt create mode 100644 tdewallet/Makefile.am create mode 100644 tdewallet/TODO create mode 100644 tdewallet/allyourbase.cpp create mode 100644 tdewallet/allyourbase.h create mode 100644 tdewallet/hi128-app-tdewalletmanager.png create mode 100644 tdewallet/hi128-app-tdewalletmanager2.png create mode 100644 tdewallet/hi16-app-tdewalletmanager.png create mode 100644 tdewallet/hi16-app-tdewalletmanager2.png create mode 100644 tdewallet/hi22-app-tdewalletmanager.png create mode 100644 tdewallet/hi32-app-tdewalletmanager.png create mode 100644 tdewallet/hi32-app-tdewalletmanager2.png create mode 100644 tdewallet/hi48-app-tdewalletmanager.png create mode 100644 tdewallet/hi48-app-tdewalletmanager2.png create mode 100644 tdewallet/hi64-app-tdewalletmanager.png create mode 100644 tdewallet/hi64-app-tdewalletmanager2.png create mode 100644 tdewallet/icons/CMakeLists.txt create mode 100644 tdewallet/icons/Makefile.am create mode 100644 tdewallet/icons/cr22-action-folder_closed.png create mode 100644 tdewallet/icons/cr22-action-folder_open.png create mode 100644 tdewallet/icons/cr22-action-wallet_closed.png create mode 100644 tdewallet/icons/cr22-action-wallet_open.png create mode 100644 tdewallet/kbetterthankdialogbase.ui create mode 100644 tdewallet/kbetterthankdialogbase.ui.h create mode 100644 tdewallet/konfigurator/CMakeLists.txt create mode 100644 tdewallet/konfigurator/Makefile.am create mode 100644 tdewallet/konfigurator/konfigurator.cpp create mode 100644 tdewallet/konfigurator/konfigurator.h create mode 100644 tdewallet/konfigurator/tdewallet_config.desktop create mode 100644 tdewallet/konfigurator/tdewalletconfig.desktop create mode 100644 tdewallet/konfigurator/tdewalletmanager_show.desktop create mode 100644 tdewallet/konfigurator/walletconfigwidget.ui create mode 100644 tdewallet/kwalletmanager-tdewalletd.desktop create mode 100644 tdewallet/kwmapeditor.cpp create mode 100644 tdewallet/kwmapeditor.h create mode 100644 tdewallet/main.cpp create mode 100644 tdewallet/tdewalleteditor.cpp create mode 100644 tdewallet/tdewalleteditor.h create mode 100644 tdewallet/tdewalleteditor.rc create mode 100644 tdewallet/tdewalletmanager.cpp create mode 100644 tdewallet/tdewalletmanager.desktop create mode 100644 tdewallet/tdewalletmanager.h create mode 100644 tdewallet/tdewalletmanager.rc create mode 100644 tdewallet/tdewalletpopup.cpp create mode 100644 tdewallet/tdewalletpopup.h create mode 100644 tdewallet/walletwidget.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d9d5cd..e376de1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,7 @@ option( BUILD_KMILO "Build kmilo" ${BUILD_ALL} ) option( BUILD_KREGEXPEDITOR "Build kregexpeditor" ${BUILD_ALL} ) option( BUILD_KSIM "Build ksim" ${BUILD_ALL} ) option( BUILD_KTIMER "Build ktimer" ${BUILD_ALL} ) -option( BUILD_KWALLET "Build kwallet" ${BUILD_ALL} ) +option( BUILD_KWALLET "Build tdewallet" ${BUILD_ALL} ) option( BUILD_SUPERKARAMBA "Build superkaramba" ${BUILD_ALL} ) @@ -173,7 +173,7 @@ tde_conditional_add_subdirectory( BUILD_KMILO kmilo ) tde_conditional_add_subdirectory( BUILD_KREGEXPEDITOR kregexpeditor ) tde_conditional_add_subdirectory( BUILD_KSIM ksim ) tde_conditional_add_subdirectory( BUILD_KTIMER ktimer ) -tde_conditional_add_subdirectory( BUILD_KWALLET kwallet ) +tde_conditional_add_subdirectory( BUILD_KWALLET tdewallet ) tde_conditional_add_subdirectory( BUILD_SUPERKARAMBA superkaramba ) diff --git a/ark/CMakeLists.txt b/ark/CMakeLists.txt index fa15179..c0ea58a 100644 --- a/ark/CMakeLists.txt +++ b/ark/CMakeLists.txt @@ -39,7 +39,7 @@ tde_add_library( ark_common STATIC_PIC tde_add_tdeinit_executable( ark AUTOMOC SOURCES main.cpp arkapp.cpp mainwindow.cpp - LINK ark_common-static khtml-shared + LINK ark_common-static tdehtml-shared ) @@ -49,12 +49,12 @@ tde_add_kpart( libarkpart AUTOMOC SOURCES ark_part.cpp arkfactory.cpp zip.cpp tar.cpp filelistview.cpp arch.cpp lha.cpp compressedfile.cpp zoo.cpp rar.cpp ar.cpp - arkutils.cpp archiveformatdlg.cpp + artdeutils.cpp archiveformatdlg.cpp arkwidget.cpp searchbar.cpp addition.ui extraction.ui general.ui arkviewer.cpp sevenzip.cpp extractiondialog.cpp ace.cpp tarlistingthread.cpp arj.cpp - LINK ark_common-static khtml-shared + LINK ark_common-static tdehtml-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/ark/Makefile.am b/ark/Makefile.am index 14f33f5..aa26f03 100644 --- a/ark/Makefile.am +++ b/ark/Makefile.am @@ -27,7 +27,7 @@ libarkpart_la_COMPILE_FIRST = settings.h libarkpart_la_SOURCES = ark_part.cpp arkfactory.cpp zip.cpp tar.cpp \ filelistview.cpp arch.cpp lha.cpp \ compressedfile.cpp zoo.cpp rar.cpp \ - ar.cpp arkutils.cpp archiveformatdlg.cpp \ + ar.cpp artdeutils.cpp archiveformatdlg.cpp \ arkwidget.cpp searchbar.cpp \ addition.ui extraction.ui general.ui \ arkviewer.cpp sevenzip.cpp extractiondialog.cpp \ diff --git a/ark/arch.cpp b/ark/arch.cpp index 18a589a..cd3d186 100644 --- a/ark/arch.cpp +++ b/ark/arch.cpp @@ -47,7 +47,7 @@ // ark includes #include "arch.h" #include "arkwidget.h" -#include "arkutils.h" +#include "artdeutils.h" #include "filelistview.h" // the archive types diff --git a/ark/arj.cpp b/ark/arj.cpp index 146df76..79574b1 100644 --- a/ark/arj.cpp +++ b/ark/arj.cpp @@ -42,7 +42,7 @@ #include "arj.h" #include "arkwidget.h" #include "settings.h" -#include "arkutils.h" +#include "artdeutils.h" #include "filelistview.h" ArjArch::ArjArch( ArkWidget *_gui, const TQString & _fileName ) diff --git a/ark/ark_part.h b/ark/ark_part.h index 6ec3202..1057395 100644 --- a/ark/ark_part.h +++ b/ark/ark_part.h @@ -23,10 +23,10 @@ #ifndef ARK_PART_H #define ARK_PART_H -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/ark/ark_part.rc b/ark/ark_part.rc index 086765f..44605ca 100644 --- a/ark/ark_part.rc +++ b/ark/ark_part.rc @@ -1,5 +1,5 @@ - + diff --git a/ark/ark_part_readonly.rc b/ark/ark_part_readonly.rc index 84f4f02..c325723 100644 --- a/ark/ark_part_readonly.rc +++ b/ark/ark_part_readonly.rc @@ -1,5 +1,5 @@ - + diff --git a/ark/arkfactory.h b/ark/arkfactory.h index 51b4933..5207ac4 100644 --- a/ark/arkfactory.h +++ b/ark/arkfactory.h @@ -21,7 +21,7 @@ #ifndef ARKFACTORY_H #define ARKFACTORY_H -#include +#include class ArkFactory : public KParts::Factory { diff --git a/ark/arkutils.cpp b/ark/arkutils.cpp deleted file mode 100644 index 52049d0..0000000 --- a/ark/arkutils.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* - - $Id$ - - ark -- archiver for the KDE project - - Copyright (C) - - 2002: Helio Chissini de Castro - 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com) - 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com) - 1999: Francois-Xavier Duranceau duranceau@kde.org - 1997-1999: Rob Palmbos palm9744@kettering.edu - 2003: Hans Petter Bieker - - 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 - -// C includes -#include -#include - -#include -#include -#include -#include - -#include -#include - -#ifdef _HPUX_SOURCE -#include -#endif - -// for statfs: -#ifdef BSD4_4 -#include -#elif defined(__linux__) -#include -#elif defined(__sun) -#include -#define STATFS statvfs -#elif defined(_AIX) -#include -#endif - -#ifndef STATFS -#define STATFS statfs -#endif - -// KDE includes -#include -#include -#include -#include - -// TQt includes -#include - -#include "arkutils.h" - -TQString ArkUtils::getTimeStamp(const TQString &_month, - const TQString &_day, - const TQString &_yearOrTime) -{ - // Make the date format sortable. - // Month is in _month, day is in _day. - // In _yearOrTime is either a year or a time. - // If it's March, we'll see the year for all dates up to October 1999. - // (five months' difference - e.g., if it's Apr, then get years up to Nov) - - char month[4]; - strncpy(month, _month.ascii(), 3); - month[3] = '\0'; - int nMonth = getMonth(month); - int nDay = _day.toInt(); - - kdDebug(1601) << "Month is " << nMonth << ", Day is " << nDay << endl; - - time_t t = time(0); - if (t == -1) - exit(1); - struct tm *now = localtime(&t); - int thisYear = now->tm_year + 1900; - int thisMonth = now->tm_mon + 1; - - TQString year, timestamp; - - if (_yearOrTime.contains(":")) - // it has a timestamp so we have to figure out the year - { - year.sprintf("%d", ArkUtils::getYear(nMonth, thisYear, thisMonth)); - timestamp = _yearOrTime; - } - else - { - year = _yearOrTime; - if (year.right(1) == " ") - year = year.left(4); - if (year.left(1) == " ") - year = year.right(4); - - timestamp = "??:??"; - } - - TQString retval; - retval.sprintf("%s-%.2d-%.2d %s", - year.utf8().data(), nMonth, nDay, - timestamp.utf8().data()); - return retval; -} - -int ArkUtils::getMonth(const char *strMonth) - // returns numeric value for three-char month string -{ - static char months[13][4] = { "", "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - int nIndex; - for (nIndex = 1; nIndex < 13; ++nIndex) - { - if (0 == strcmp(strMonth, months[nIndex])) - return nIndex; - } - return 0; -} - -// This function gets the year from an LHA or ls -l timestamp. -// Note: LHA doesn't seem to display the year if the file is more -// than 6 months into the future, so this will fail to give the correct -// year (of course it is hoped that there are not too many files lying -// around from the future). - -int ArkUtils::getYear(int theMonth, int thisYear, int thisMonth) -{ - int monthDiff = TQABS(thisMonth - theMonth); - if (monthDiff > 6) - return (thisYear - 1); - else - return thisYear; -} - -TQString ArkUtils::fixYear(const TQString& strYear) -{ - // returns 4-digit year by guessing from two-char year string. - // Remember: this is used for file timestamps. There probably aren't any - // files that were created before 1970, so that's our cutoff. Of course, - // in 2070 we'll have some problems.... - - if ( strYear.length() != 2 ) return strYear; - - bool ok; - int y = strYear.toInt( &ok ); - - if ( ok ) - { - if ( y > 70 ) - y += 1900; - else - y += 2000; - - return TQString::number( y ); - } - else - return TQString(); -} - -bool -ArkUtils::haveDirPermissions( const TQString &strFile ) -{ - return ( access( TQFile::encodeName( strFile ), W_OK ) == 0 ); -} - -bool -ArkUtils::diskHasSpace(const TQString &dir, TDEIO::filesize_t size) - // check if disk has enough space to accommodate (a) new file(s) of - // the given size in the partition containing the given directory -{ - kdDebug( 1601 ) << "diskHasSpace() " << "dir: " << dir << " Size: " << size << endl; - - struct STATFS buf; - if (STATFS(TQFile::encodeName(dir), &buf) == 0) - { - double nAvailable = (double)buf.f_bavail * buf.f_bsize; - if ( nAvailable < (double)size ) - { - KMessageBox::error(0, i18n("You have run out of disk space.")); - return false; - } - } - else - { - // something bad happened - kdWarning( 1601 ) << "diskHasSpace() failed" << endl; - // Q_ASSERT(0); - } - return true; -} - -TDEIO::filesize_t -ArkUtils::getSizes(TQStringList *list) -{ - TDEIO::filesize_t sum = 0; - TQString str; - KDE_struct_stat st; - - for ( TQStringList::Iterator it = list->begin(); it != list->end(); ++it) - { - str = *it; - str = str.right(str.length()-5); - if (KDE_stat(TQFile::encodeName(str), &st ) < 0) - continue; - sum += st.st_size; - } - return sum; -} diff --git a/ark/arkutils.h b/ark/arkutils.h deleted file mode 100644 index baed64b..0000000 --- a/ark/arkutils.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*-C++-*- emacs magic for .h files -/* - - $Id$ - - ark -- archiver for the KDE project - - Copyright (C) - - 1997-1999: Rob Palmbos palm9744@kettering.edu - 1999: Francois-Xavier Duranceau duranceau@kde.org - 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com) - 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com) - 2003: Hans Petter Bieker - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef ARKUTILS_H -#define ARKUTILS_H - -#include - -#include - -class TQStringList; - -// various functions for massaging timestamps -namespace ArkUtils -{ - int getYear(int theMonth, int thisYear, int thisMonth); - int getMonth(const char *strMonth); - TQString fixYear(const TQString& strYear); - - TQString getTimeStamp(const TQString &month, - const TQString &day, - const TQString &year); - bool haveDirPermissions(const TQString &strFile); - bool diskHasSpace(const TQString &dir, TDEIO::filesize_t size); - TDEIO::filesize_t getSizes(TQStringList *list); -} - -#endif diff --git a/ark/arkviewer.cpp b/ark/arkviewer.cpp index 13dbfbe..7a2dda9 100644 --- a/ark/arkviewer.cpp +++ b/ark/arkviewer.cpp @@ -22,7 +22,7 @@ #include "arkviewer.h" #include -#include +#include #include #include #include diff --git a/ark/arkviewer.h b/ark/arkviewer.h index 5fc3849..af04c80 100644 --- a/ark/arkviewer.h +++ b/ark/arkviewer.h @@ -23,7 +23,7 @@ */ #include -#include +#include class ArkViewer : public KDialogBase { diff --git a/ark/arkwidget.cpp b/ark/arkwidget.cpp index 5931f8b..c49760d 100644 --- a/ark/arkwidget.cpp +++ b/ark/arkwidget.cpp @@ -75,7 +75,7 @@ #include "extractiondialog.h" #include "arkwidget.h" #include "filelistview.h" -#include "arkutils.h" +#include "artdeutils.h" #include "archiveformatinfo.h" #include "compressedfile.h" #include "searchbar.h" diff --git a/ark/artdeutils.cpp b/ark/artdeutils.cpp new file mode 100644 index 0000000..dbf5395 --- /dev/null +++ b/ark/artdeutils.cpp @@ -0,0 +1,230 @@ +/* + + $Id$ + + ark -- archiver for the KDE project + + Copyright (C) + + 2002: Helio Chissini de Castro + 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com) + 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com) + 1999: Francois-Xavier Duranceau duranceau@kde.org + 1997-1999: Rob Palmbos palm9744@kettering.edu + 2003: Hans Petter Bieker + + 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 + +// C includes +#include +#include + +#include +#include +#include +#include + +#include +#include + +#ifdef _HPUX_SOURCE +#include +#endif + +// for statfs: +#ifdef BSD4_4 +#include +#elif defined(__linux__) +#include +#elif defined(__sun) +#include +#define STATFS statvfs +#elif defined(_AIX) +#include +#endif + +#ifndef STATFS +#define STATFS statfs +#endif + +// KDE includes +#include +#include +#include +#include + +// TQt includes +#include + +#include "artdeutils.h" + +TQString ArkUtils::getTimeStamp(const TQString &_month, + const TQString &_day, + const TQString &_yearOrTime) +{ + // Make the date format sortable. + // Month is in _month, day is in _day. + // In _yearOrTime is either a year or a time. + // If it's March, we'll see the year for all dates up to October 1999. + // (five months' difference - e.g., if it's Apr, then get years up to Nov) + + char month[4]; + strncpy(month, _month.ascii(), 3); + month[3] = '\0'; + int nMonth = getMonth(month); + int nDay = _day.toInt(); + + kdDebug(1601) << "Month is " << nMonth << ", Day is " << nDay << endl; + + time_t t = time(0); + if (t == -1) + exit(1); + struct tm *now = localtime(&t); + int thisYear = now->tm_year + 1900; + int thisMonth = now->tm_mon + 1; + + TQString year, timestamp; + + if (_yearOrTime.contains(":")) + // it has a timestamp so we have to figure out the year + { + year.sprintf("%d", ArkUtils::getYear(nMonth, thisYear, thisMonth)); + timestamp = _yearOrTime; + } + else + { + year = _yearOrTime; + if (year.right(1) == " ") + year = year.left(4); + if (year.left(1) == " ") + year = year.right(4); + + timestamp = "??:??"; + } + + TQString retval; + retval.sprintf("%s-%.2d-%.2d %s", + year.utf8().data(), nMonth, nDay, + timestamp.utf8().data()); + return retval; +} + +int ArkUtils::getMonth(const char *strMonth) + // returns numeric value for three-char month string +{ + static char months[13][4] = { "", "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + int nIndex; + for (nIndex = 1; nIndex < 13; ++nIndex) + { + if (0 == strcmp(strMonth, months[nIndex])) + return nIndex; + } + return 0; +} + +// This function gets the year from an LHA or ls -l timestamp. +// Note: LHA doesn't seem to display the year if the file is more +// than 6 months into the future, so this will fail to give the correct +// year (of course it is hoped that there are not too many files lying +// around from the future). + +int ArkUtils::getYear(int theMonth, int thisYear, int thisMonth) +{ + int monthDiff = TQABS(thisMonth - theMonth); + if (monthDiff > 6) + return (thisYear - 1); + else + return thisYear; +} + +TQString ArkUtils::fixYear(const TQString& strYear) +{ + // returns 4-digit year by guessing from two-char year string. + // Remember: this is used for file timestamps. There probably aren't any + // files that were created before 1970, so that's our cutoff. Of course, + // in 2070 we'll have some problems.... + + if ( strYear.length() != 2 ) return strYear; + + bool ok; + int y = strYear.toInt( &ok ); + + if ( ok ) + { + if ( y > 70 ) + y += 1900; + else + y += 2000; + + return TQString::number( y ); + } + else + return TQString(); +} + +bool +ArkUtils::haveDirPermissions( const TQString &strFile ) +{ + return ( access( TQFile::encodeName( strFile ), W_OK ) == 0 ); +} + +bool +ArkUtils::diskHasSpace(const TQString &dir, TDEIO::filesize_t size) + // check if disk has enough space to accommodate (a) new file(s) of + // the given size in the partition containing the given directory +{ + kdDebug( 1601 ) << "diskHasSpace() " << "dir: " << dir << " Size: " << size << endl; + + struct STATFS buf; + if (STATFS(TQFile::encodeName(dir), &buf) == 0) + { + double nAvailable = (double)buf.f_bavail * buf.f_bsize; + if ( nAvailable < (double)size ) + { + KMessageBox::error(0, i18n("You have run out of disk space.")); + return false; + } + } + else + { + // something bad happened + kdWarning( 1601 ) << "diskHasSpace() failed" << endl; + // Q_ASSERT(0); + } + return true; +} + +TDEIO::filesize_t +ArkUtils::getSizes(TQStringList *list) +{ + TDEIO::filesize_t sum = 0; + TQString str; + KDE_struct_stat st; + + for ( TQStringList::Iterator it = list->begin(); it != list->end(); ++it) + { + str = *it; + str = str.right(str.length()-5); + if (KDE_stat(TQFile::encodeName(str), &st ) < 0) + continue; + sum += st.st_size; + } + return sum; +} diff --git a/ark/artdeutils.h b/ark/artdeutils.h new file mode 100644 index 0000000..baed64b --- /dev/null +++ b/ark/artdeutils.h @@ -0,0 +1,56 @@ +// -*-C++-*- emacs magic for .h files +/* + + $Id$ + + ark -- archiver for the KDE project + + Copyright (C) + + 1997-1999: Rob Palmbos palm9744@kettering.edu + 1999: Francois-Xavier Duranceau duranceau@kde.org + 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com) + 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com) + 2003: Hans Petter Bieker + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef ARKUTILS_H +#define ARKUTILS_H + +#include + +#include + +class TQStringList; + +// various functions for massaging timestamps +namespace ArkUtils +{ + int getYear(int theMonth, int thisYear, int thisMonth); + int getMonth(const char *strMonth); + TQString fixYear(const TQString& strYear); + + TQString getTimeStamp(const TQString &month, + const TQString &day, + const TQString &year); + bool haveDirPermissions(const TQString &strFile); + bool diskHasSpace(const TQString &dir, TDEIO::filesize_t size); + TDEIO::filesize_t getSizes(TQStringList *list); +} + +#endif diff --git a/ark/extractiondialog.cpp b/ark/extractiondialog.cpp index 8057828..9974252 100644 --- a/ark/extractiondialog.cpp +++ b/ark/extractiondialog.cpp @@ -48,7 +48,7 @@ #include #include -#include "arkutils.h" +#include "artdeutils.h" #include "settings.h" ExtractionDialog::ExtractionDialog( TQWidget *parent, const char *name, diff --git a/ark/lha.cpp b/ark/lha.cpp index 045be09..f0074aa 100644 --- a/ark/lha.cpp +++ b/ark/lha.cpp @@ -49,7 +49,7 @@ #include "settings.h" #include "arch.h" #include "lha.h" -#include "arkutils.h" +#include "artdeutils.h" #include "filelistview.h" LhaArch::LhaArch( ArkWidget *_gui, const TQString & _fileName ) diff --git a/ark/mainwindow.cpp b/ark/mainwindow.cpp index 2c9a957..21ffb08 100644 --- a/ark/mainwindow.cpp +++ b/ark/mainwindow.cpp @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/ark/mainwindow.h b/ark/mainwindow.h index d448e8c..c878942 100644 --- a/ark/mainwindow.h +++ b/ark/mainwindow.h @@ -31,8 +31,8 @@ // KDE includes #include -#include -#include +#include +#include #include class ArkWidget; diff --git a/ark/rar.cpp b/ark/rar.cpp index 2b015f5..500b338 100644 --- a/ark/rar.cpp +++ b/ark/rar.cpp @@ -49,7 +49,7 @@ #include "arch.h" #include "settings.h" #include "rar.h" -#include "arkutils.h" +#include "artdeutils.h" #include "filelistview.h" RarArch::RarArch( ArkWidget *_gui, const TQString & _fileName ) diff --git a/ark/sevenzip.cpp b/ark/sevenzip.cpp index 3ddf02f..c683f67 100644 --- a/ark/sevenzip.cpp +++ b/ark/sevenzip.cpp @@ -39,7 +39,7 @@ #include "sevenzip.h" #include "arkwidget.h" #include "settings.h" -#include "arkutils.h" +#include "artdeutils.h" #include "filelistview.h" SevenZipArch::SevenZipArch( ArkWidget *gui, const TQString &filename ) diff --git a/ark/zoo.cpp b/ark/zoo.cpp index f94abdb..c9814b4 100644 --- a/ark/zoo.cpp +++ b/ark/zoo.cpp @@ -46,7 +46,7 @@ #include "arkwidget.h" #include "arch.h" #include "zoo.h" -#include "arkutils.h" +#include "artdeutils.h" #include "filelistview.h" static TQString fixTime( const TQString &_strTime ); diff --git a/doc/kwallet/CMakeLists.txt b/doc/kwallet/CMakeLists.txt deleted file mode 100644 index 7edec8e..0000000 --- a/doc/kwallet/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -################################################# -# -# (C) 2012 Golubev Alexander -# fatzer2 (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_create_handbook( DESTINATION kwallet ) - diff --git a/doc/kwallet/Makefile.am b/doc/kwallet/Makefile.am deleted file mode 100644 index 085981d..0000000 --- a/doc/kwallet/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ - -KDE_LANG = en -KDE_DOCS = AUTO - diff --git a/doc/kwallet/cr22-action-wallet_closed.png b/doc/kwallet/cr22-action-wallet_closed.png deleted file mode 100644 index 57558ac..0000000 Binary files a/doc/kwallet/cr22-action-wallet_closed.png and /dev/null differ diff --git a/doc/kwallet/cr22-action-wallet_open.png b/doc/kwallet/cr22-action-wallet_open.png deleted file mode 100644 index 55a447f..0000000 Binary files a/doc/kwallet/cr22-action-wallet_open.png and /dev/null differ diff --git a/doc/kwallet/edit1.png b/doc/kwallet/edit1.png deleted file mode 100644 index 1d0fe7c..0000000 Binary files a/doc/kwallet/edit1.png and /dev/null differ diff --git a/doc/kwallet/edit2.png b/doc/kwallet/edit2.png deleted file mode 100644 index 05b6dd8..0000000 Binary files a/doc/kwallet/edit2.png and /dev/null differ diff --git a/doc/kwallet/edit3.png b/doc/kwallet/edit3.png deleted file mode 100644 index 9292870..0000000 Binary files a/doc/kwallet/edit3.png and /dev/null differ diff --git a/doc/kwallet/index.docbook b/doc/kwallet/index.docbook deleted file mode 100644 index 96a9a59..0000000 --- a/doc/kwallet/index.docbook +++ /dev/null @@ -1,396 +0,0 @@ - -KWallet"> - KWallet Manager"> - - - - -]> - - - -The &kwallet; Handbook - - - -&George.Staikos; &George.Staikos.mail; - - -&Lauri.Watts; &Lauri.Watts.mail; - - -GeorgeStaikos -
staikos@kde.org
-Developer -
- -
- -&FDLNotice; - -2005-06-15 -1.0 - - - -The wallet subsytem provides a convenient and secure way to manage all your -passwords. - - - - - -KDE -Kwallet -passwords -forms - - -
- - -Introduction - -Computer users have a very large amount of data to manage, some of -which is sensitive. In particular, you will typically have many passwords -to manage. Remembering them is difficult, writing them down on paper or in -a text file is insecure, and using tools such at PGP is tedious and -inconvenient. - -&kwallet; saves this sensitive data for you in a strongly encrypted -file, accessible by all applications, and protected with a master -password that you define. - - -&kwallet; supports multiple wallets, so -for the most secure operation, you should use one wallet for local -passwords, and another for network passwords and form data. You can -configure this behavior in the &kwallet; &kcontrolcenter; module, however -the default setting is to store everything in one wallet. - - -A wallet is by default closed, which means that you must supply -a password to open it. Once the wallet is opened, the contents can -be accessed. - - - - -&kwalletmanager; - -&kwalletmanager; serves a number of functions. Firstly it allows you to see if -any wallets are open, which wallets those are, and which applications are -using each wallet. You can disconnect an application's access to a wallet -from within the &kwalletmanager;. - -You may also manage the wallets installed on the system, creating and -deleting wallets and manipulating their contents (changing keys, ...). - -Normally the &kwalletmanager; application is launched when -&kde; starts and remains in iconic form in the system tray. Alternatively, -when a wallet is opened, the &kwalletmanager; application will be -launched. A system tray icon indicates that a wallet is open: - - - - - - -When all -wallets are closed, the icon will reflect this by showing a closed -wallet: - - - - - - - - -Click once on the system tray wallet icon to display the &kwalletmanager; -window showing all available wallets as icons which reflect their -current status, either open or closed. - - - - - - - - - -The &kwalletmanager; Context Menu - -Right clicking on a wallet in the -&kwalletmanager; window offers -the following functions: - - - - -New Wallet... - -Create a new wallet. A dialog box will ask you -for the name of the new wallet that you want to create. - - - - -&Enter; -Open... - -Open the wallet. Opening the wallet causes the contents -of the wallet to be displayed in a new window where you can -add, delete, or modify the contents of the wallet. You may also -double click the wallet icon to cause it to open. If the wallet -is not already open, you will be requested to enter the password. -See below for details of using the wallet window. - - - - - - - - - - - - -Change Password - -Change the master password for the wallet. - - - - -Disconnect -Disconnect an application from the wallet. Currently -connected applications will appear in a submenu. - - - -Close -Force the wallet to be closed. - - - -Delete - -Delete the wallet - - - - - - -The Wallet Window - -Double clicking on a wallet in the &kwalletmanager; window will open a new -window displaying that wallet's contents. A wallet may contain any number -of folders, which allow storing of password information. By default a wallet -will contain folders named Form Data and Passwords. - - -The window has four panes: - - - - - - - - - -A summary of the contents of the current -folder -The folders contained in the wallet -The entries in the currently selected -folder -The contents of the selected folder entry - - -Folders may be added or deleted, and selecting a folder will update -the folder entry list and the summary display. Selecting a folder entry -will update the entry contents pane, and allow you to edit that -entry. - - - - - - - - -Entries may also be created or deleted via the context menu for the -folder contents. - -All folders and entries may be dragged and dropped into other wallets -or folders respectively. This allows a user to easily package up a new -wallet for transfer to another environment. For instance, a new wallet -could be created and copied onto a removable flash memory device. Important -passwords could be transferred there, so you have them available in other -locations. - - - - - - -Configuring &kwallet; - - -<guilabel>Wallet Preferences</guilabel> - -&kwallet; contains a small configuration panel with several options -that allow you to tune &kwallet; to your personal preferences. The -default settings for &kwallet; are sufficient for most users. - -Check the box to enable or disable the &kde; wallet subsystem -entirely. If this box is unchecked, then &kwallet; is entirely disabled and -none of the other options here have any effect, nor will &kwallet; record -any information, or offer to fill in forms for you. - - -<guilabel>Close Wallet</guilabel> - -Close when unused for: - -Close the current wallet after a period of inactivity. If you check this -option, set the period in the box, default is 10 minutes. When a wallet is -closed, the password is needed to access it again. - - - - -Close when screen saver starts - -Close the wallet as soon as the screensaver starts. When a wallet is -closed, the password is needed to access it again. - - - - -Close when last application stops using it - -Close the wallet as soon as applications that use it have stopped. Note -that your wallets will only be closed when all the applications that use it have -stopped. When a wallet is closed, the password is needed to access it -again. - - - - - -<guilabel>Automatic Wallet Selection</guilabel> - -Select wallet to use as default: - -Select which wallet you want to use as default wallet. - - - - -Different wallet for local passwords: - -If checked, choose a different wallet for local passwords. - - - - - -<guilabel>Wallet Manager</guilabel> - -Show manager in system tray - -Enable the wallet manager to have its icon in the system tray. - - - - -Hide System tray icon when last wallet -closes - -When there is no wallet in use anymore, remove the wallet icon from the -system tray. - - - - -Finally, there is a button labelled Launch Wallet -Manager, which does precisely that. - - - -<guilabel>Access Control</guilabel> - -There is only one option on this page: - - - -Prompt when an application accesses an open wallet - -Signal you when an application gains access to an open wallet. - - - - -Next there is a tree style view of the access controls for your wallets. - -&LMB; click on the + symbol beside a wallet name to -expand the tree. You will see the name of each application that has asked -for access to the wallet, and the policy you set for it. You cannot edit -policies here, or add them, but it is possible to delete an entry by &RMB; -clicking on it and choosing Delete From the -context menu that appears, or by simply selecting it and pressing the -Delete key. - - - - - - -Advanced Features - -Wallets can be dragged from the &kwalletmanager; window. This allows -you to drag the wallet to a file browser window, where you can choose to -copy, move, or link the wallet, as desired. - -You might use this to save a wallet to portable media, such as a -USB keychain, so that you can take your passwords with you to work or -on a vacation, and still have easy access to important sites. - -Future versions will have built-in functions for easy export or -copying of data to portable devices. - - - - -Credits and Licenses - -&kwallet; © 2003 &George.Staikos; -Documentation © &Lauri.Watts; and &George.Staikos; - - - -&underFDL; -&underGPL; - - - -&documentation.index; - -
- - diff --git a/doc/kwallet/kwalletmanager.png b/doc/kwallet/kwalletmanager.png deleted file mode 100644 index 67c7220..0000000 Binary files a/doc/kwallet/kwalletmanager.png and /dev/null differ diff --git a/doc/kwallet/password1.png b/doc/kwallet/password1.png deleted file mode 100644 index d5cb22a..0000000 Binary files a/doc/kwallet/password1.png and /dev/null differ diff --git a/doc/kwallet/password2.png b/doc/kwallet/password2.png deleted file mode 100644 index c116e93..0000000 Binary files a/doc/kwallet/password2.png and /dev/null differ diff --git a/doc/tdewallet/CMakeLists.txt b/doc/tdewallet/CMakeLists.txt new file mode 100644 index 0000000..d75cc35 --- /dev/null +++ b/doc/tdewallet/CMakeLists.txt @@ -0,0 +1,13 @@ +################################################# +# +# (C) 2012 Golubev Alexander +# fatzer2 (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +tde_create_handbook( DESTINATION tdewallet ) + diff --git a/doc/tdewallet/Makefile.am b/doc/tdewallet/Makefile.am new file mode 100644 index 0000000..085981d --- /dev/null +++ b/doc/tdewallet/Makefile.am @@ -0,0 +1,4 @@ + +KDE_LANG = en +KDE_DOCS = AUTO + diff --git a/doc/tdewallet/cr22-action-wallet_closed.png b/doc/tdewallet/cr22-action-wallet_closed.png new file mode 100644 index 0000000..57558ac Binary files /dev/null and b/doc/tdewallet/cr22-action-wallet_closed.png differ diff --git a/doc/tdewallet/cr22-action-wallet_open.png b/doc/tdewallet/cr22-action-wallet_open.png new file mode 100644 index 0000000..55a447f Binary files /dev/null and b/doc/tdewallet/cr22-action-wallet_open.png differ diff --git a/doc/tdewallet/edit1.png b/doc/tdewallet/edit1.png new file mode 100644 index 0000000..1d0fe7c Binary files /dev/null and b/doc/tdewallet/edit1.png differ diff --git a/doc/tdewallet/edit2.png b/doc/tdewallet/edit2.png new file mode 100644 index 0000000..05b6dd8 Binary files /dev/null and b/doc/tdewallet/edit2.png differ diff --git a/doc/tdewallet/edit3.png b/doc/tdewallet/edit3.png new file mode 100644 index 0000000..9292870 Binary files /dev/null and b/doc/tdewallet/edit3.png differ diff --git a/doc/tdewallet/index.docbook b/doc/tdewallet/index.docbook new file mode 100644 index 0000000..dcc9304 --- /dev/null +++ b/doc/tdewallet/index.docbook @@ -0,0 +1,396 @@ + +KWallet"> + KWallet Manager"> + + + + +]> + + + +The &tdewallet; Handbook + + + +&George.Staikos; &George.Staikos.mail; + + +&Lauri.Watts; &Lauri.Watts.mail; + + +GeorgeStaikos +
staikos@kde.org
+Developer +
+ +
+ +&FDLNotice; + +2005-06-15 +1.0 + + + +The wallet subsytem provides a convenient and secure way to manage all your +passwords. + + + + + +KDE +Kwallet +passwords +forms + + +
+ + +Introduction + +Computer users have a very large amount of data to manage, some of +which is sensitive. In particular, you will typically have many passwords +to manage. Remembering them is difficult, writing them down on paper or in +a text file is insecure, and using tools such at PGP is tedious and +inconvenient. + +&tdewallet; saves this sensitive data for you in a strongly encrypted +file, accessible by all applications, and protected with a master +password that you define. + + +&tdewallet; supports multiple wallets, so +for the most secure operation, you should use one wallet for local +passwords, and another for network passwords and form data. You can +configure this behavior in the &tdewallet; &kcontrolcenter; module, however +the default setting is to store everything in one wallet. + + +A wallet is by default closed, which means that you must supply +a password to open it. Once the wallet is opened, the contents can +be accessed. + + + + +&tdewalletmanager; + +&tdewalletmanager; serves a number of functions. Firstly it allows you to see if +any wallets are open, which wallets those are, and which applications are +using each wallet. You can disconnect an application's access to a wallet +from within the &tdewalletmanager;. + +You may also manage the wallets installed on the system, creating and +deleting wallets and manipulating their contents (changing keys, ...). + +Normally the &tdewalletmanager; application is launched when +&kde; starts and remains in iconic form in the system tray. Alternatively, +when a wallet is opened, the &tdewalletmanager; application will be +launched. A system tray icon indicates that a wallet is open: + + + + + + +When all +wallets are closed, the icon will reflect this by showing a closed +wallet: + + + + + + + + +Click once on the system tray wallet icon to display the &tdewalletmanager; +window showing all available wallets as icons which reflect their +current status, either open or closed. + + + + + + + + + +The &tdewalletmanager; Context Menu + +Right clicking on a wallet in the +&tdewalletmanager; window offers +the following functions: + + + + +New Wallet... + +Create a new wallet. A dialog box will ask you +for the name of the new wallet that you want to create. + + + + +&Enter; +Open... + +Open the wallet. Opening the wallet causes the contents +of the wallet to be displayed in a new window where you can +add, delete, or modify the contents of the wallet. You may also +double click the wallet icon to cause it to open. If the wallet +is not already open, you will be requested to enter the password. +See below for details of using the wallet window. + + + + + + + + + + + + +Change Password + +Change the master password for the wallet. + + + + +Disconnect +Disconnect an application from the wallet. Currently +connected applications will appear in a submenu. + + + +Close +Force the wallet to be closed. + + + +Delete + +Delete the wallet + + + + + + +The Wallet Window + +Double clicking on a wallet in the &tdewalletmanager; window will open a new +window displaying that wallet's contents. A wallet may contain any number +of folders, which allow storing of password information. By default a wallet +will contain folders named Form Data and Passwords. + + +The window has four panes: + + + + + + + + + +A summary of the contents of the current +folder +The folders contained in the wallet +The entries in the currently selected +folder +The contents of the selected folder entry + + +Folders may be added or deleted, and selecting a folder will update +the folder entry list and the summary display. Selecting a folder entry +will update the entry contents pane, and allow you to edit that +entry. + + + + + + + + +Entries may also be created or deleted via the context menu for the +folder contents. + +All folders and entries may be dragged and dropped into other wallets +or folders respectively. This allows a user to easily package up a new +wallet for transfer to another environment. For instance, a new wallet +could be created and copied onto a removable flash memory device. Important +passwords could be transferred there, so you have them available in other +locations. + + + + + + +Configuring &tdewallet; + + +<guilabel>Wallet Preferences</guilabel> + +&tdewallet; contains a small configuration panel with several options +that allow you to tune &tdewallet; to your personal preferences. The +default settings for &tdewallet; are sufficient for most users. + +Check the box to enable or disable the &kde; wallet subsystem +entirely. If this box is unchecked, then &tdewallet; is entirely disabled and +none of the other options here have any effect, nor will &tdewallet; record +any information, or offer to fill in forms for you. + + +<guilabel>Close Wallet</guilabel> + +Close when unused for: + +Close the current wallet after a period of inactivity. If you check this +option, set the period in the box, default is 10 minutes. When a wallet is +closed, the password is needed to access it again. + + + + +Close when screen saver starts + +Close the wallet as soon as the screensaver starts. When a wallet is +closed, the password is needed to access it again. + + + + +Close when last application stops using it + +Close the wallet as soon as applications that use it have stopped. Note +that your wallets will only be closed when all the applications that use it have +stopped. When a wallet is closed, the password is needed to access it +again. + + + + + +<guilabel>Automatic Wallet Selection</guilabel> + +Select wallet to use as default: + +Select which wallet you want to use as default wallet. + + + + +Different wallet for local passwords: + +If checked, choose a different wallet for local passwords. + + + + + +<guilabel>Wallet Manager</guilabel> + +Show manager in system tray + +Enable the wallet manager to have its icon in the system tray. + + + + +Hide System tray icon when last wallet +closes + +When there is no wallet in use anymore, remove the wallet icon from the +system tray. + + + + +Finally, there is a button labelled Launch Wallet +Manager, which does precisely that. + + + +<guilabel>Access Control</guilabel> + +There is only one option on this page: + + + +Prompt when an application accesses an open wallet + +Signal you when an application gains access to an open wallet. + + + + +Next there is a tree style view of the access controls for your wallets. + +&LMB; click on the + symbol beside a wallet name to +expand the tree. You will see the name of each application that has asked +for access to the wallet, and the policy you set for it. You cannot edit +policies here, or add them, but it is possible to delete an entry by &RMB; +clicking on it and choosing Delete From the +context menu that appears, or by simply selecting it and pressing the +Delete key. + + + + + + +Advanced Features + +Wallets can be dragged from the &tdewalletmanager; window. This allows +you to drag the wallet to a file browser window, where you can choose to +copy, move, or link the wallet, as desired. + +You might use this to save a wallet to portable media, such as a +USB keychain, so that you can take your passwords with you to work or +on a vacation, and still have easy access to important sites. + +Future versions will have built-in functions for easy export or +copying of data to portable devices. + + + + +Credits and Licenses + +&tdewallet; © 2003 &George.Staikos; +Documentation © &Lauri.Watts; and &George.Staikos; + + + +&underFDL; +&underGPL; + + + +&documentation.index; + +
+ + diff --git a/doc/tdewallet/password1.png b/doc/tdewallet/password1.png new file mode 100644 index 0000000..d5cb22a Binary files /dev/null and b/doc/tdewallet/password1.png differ diff --git a/doc/tdewallet/password2.png b/doc/tdewallet/password2.png new file mode 100644 index 0000000..c116e93 Binary files /dev/null and b/doc/tdewallet/password2.png differ diff --git a/doc/tdewallet/tdewalletmanager.png b/doc/tdewallet/tdewalletmanager.png new file mode 100644 index 0000000..67c7220 Binary files /dev/null and b/doc/tdewallet/tdewalletmanager.png differ diff --git a/kcalc/knumber/tests/Makefile.am b/kcalc/knumber/tests/Makefile.am index 857a6d8..faa3aa7 100644 --- a/kcalc/knumber/tests/Makefile.am +++ b/kcalc/knumber/tests/Makefile.am @@ -29,4 +29,4 @@ METASOURCES = AUTO knumbertest_SOURCES = knumbertest.cpp knumbertest_LDADD = ../libknumber.la $(LIB_QT) $(LIBGMP) -knumbertest_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +knumbertest_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor diff --git a/kcharselect/Makefile.am b/kcharselect/Makefile.am index f4f8ad6..38014b3 100644 --- a/kcharselect/Makefile.am +++ b/kcharselect/Makefile.am @@ -3,7 +3,7 @@ LDADD = $(LIB_KFILE) bin_PROGRAMS = kcharselect kcharselect_SOURCES = kcharselectdia.cc main.cc -kcharselect_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kcharselect_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kcharselect_METASOURCES = kcharselectdia.moc updatedir = $(kde_datadir)/kconf_update diff --git a/kdelirc/kcmlirc/addaction.cpp b/kdelirc/kcmlirc/addaction.cpp index d5df7ec..7281251 100644 --- a/kdelirc/kcmlirc/addaction.cpp +++ b/kdelirc/kcmlirc/addaction.cpp @@ -352,7 +352,7 @@ void AddAction::updateObjects() QCStringList theObjects = theClient->remoteObjects(*i); for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j) - if(*j != "ksycoca" && *j != "qt")// && getFunctions(*i, *j).count()) + if(*j != "tdesycoca" && *j != "qt")// && getFunctions(*i, *j).count()) new KListViewItem(a, *j); } updateFunctions(); diff --git a/kdelirc/kcmlirc/editaction.cpp b/kdelirc/kcmlirc/editaction.cpp index be113e6..3b38b0c 100644 --- a/kdelirc/kcmlirc/editaction.cpp +++ b/kdelirc/kcmlirc/editaction.cpp @@ -342,7 +342,7 @@ void EditAction::updateDCOPObjects() QCStringList theObjects = theClient->remoteObjects(nameProgramMap[theDCOPApplications->currentText()].utf8()); if(!theObjects.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPObjects->insertItem((*theAction).object()); for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j) - if(*j != "ksycoca" && *j != "qt" && AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], *j).count()) + if(*j != "tdesycoca" && *j != "qt" && AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], *j).count()) theDCOPObjects->insertItem(TQString::fromUtf8(*j)); updateDCOPFunctions(); } diff --git a/kdelirc/kdelirc/Makefile.am b/kdelirc/kdelirc/Makefile.am index a9796a6..764a620 100644 --- a/kdelirc/kdelirc/Makefile.am +++ b/kdelirc/kdelirc/Makefile.am @@ -34,7 +34,7 @@ INCLUDES = $(all_includes) METASOURCES = AUTO # the library search path. -libkdelirc_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +libkdelirc_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor # Uncomment the following two lines if you add a ui.rc file for your application to make use of # KDEs XML GUI builing diff --git a/kdessh/Makefile.am b/kdessh/Makefile.am index f69974f..f716244 100644 --- a/kdessh/Makefile.am +++ b/kdessh/Makefile.am @@ -6,7 +6,7 @@ INCLUDES= $(all_includes) ## kdessh bin_PROGRAMS = kdessh kdessh_SOURCES = kdessh.cpp sshdlg.cpp -kdessh_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kdessh_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kdessh_LDADD = $(LIB_TDEUI) -ltdesu kdessh_METASOURCES = AUTO noinst_HEADERS = sshdlg.h diff --git a/kdf/Makefile.am b/kdf/Makefile.am index 866e345..2ddf348 100644 --- a/kdf/Makefile.am +++ b/kdf/Makefile.am @@ -9,11 +9,11 @@ libkdf_common_la_SOURCES = kdfwidget.cpp kdfconfig.cpp mntconfig.cpp disklist.cp disks.cpp listview.cpp optiondialog.cpp stdoption.cpp kdf_SOURCES = kdf.cpp -kdf_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kdf_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kdf_LDADD = libkdf_common.la $(LIB_KFILE) kwikdisk_SOURCES = kwikdisk.cpp -kwikdisk_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kwikdisk_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kwikdisk_LDADD = libkdf_common.la $(LIB_KFILE) kde_module_LTLIBRARIES = kcm_kdf.la diff --git a/kedit/kedit.cpp b/kedit/kedit.cpp index 309dab9..f3a0cb4 100644 --- a/kedit/kedit.cpp +++ b/kedit/kedit.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include "ktextfiledlg.h" @@ -61,8 +61,8 @@ TQPtrList *TopLevel::windowList = 0; int default_open = TopLevel::OPEN_READWRITE; TopLevel::TopLevel (TQWidget *, const char *name) - : KMainWindow ( 0,name ), kspellconfigOptions(0), - eframe(0), newWindow(false), kspell(0) + : KMainWindow ( 0,name ), tdespellconfigOptions(0), + eframe(0), newWindow(false), tdespell(0) { if (!windowList) { @@ -385,24 +385,24 @@ void TopLevel::spellcheck() { if (!eframe) return; - if (kspell) return; // In progress + if (tdespell) return; // In progress statusBar()->changeItem(i18n("Spellcheck: Started."), ID_GENERAL); initSpellConfig(); - kspell = new KSpell(this, i18n("Spellcheck"), TQT_TQOBJECT(this), - TQT_SLOT( spell_started(KSpell *)), kspellconfigOptions); + tdespell = new KSpell(this, i18n("Spellcheck"), TQT_TQOBJECT(this), + TQT_SLOT( spell_started(KSpell *)), tdespellconfigOptions); - connect (kspell, TQT_SIGNAL ( death()), + connect (tdespell, TQT_SIGNAL ( death()), this, TQT_SLOT ( spell_finished( ))); - connect (kspell, TQT_SIGNAL (progress (unsigned int)), + connect (tdespell, TQT_SIGNAL (progress (unsigned int)), this, TQT_SLOT (spell_progress (unsigned int))); - connect (kspell, TQT_SIGNAL (misspelling (const TQString &, const TQStringList &, unsigned int)), + connect (tdespell, TQT_SIGNAL (misspelling (const TQString &, const TQStringList &, unsigned int)), eframe, TQT_SLOT (misspelling (const TQString &, const TQStringList &, unsigned int))); - connect (kspell, TQT_SIGNAL (corrected (const TQString &, const TQString &, unsigned int)), + connect (tdespell, TQT_SIGNAL (corrected (const TQString &, const TQString &, unsigned int)), eframe, TQT_SLOT (corrected (const TQString &, const TQString &, unsigned int))); - connect (kspell, TQT_SIGNAL (done(const TQString&)), + connect (tdespell, TQT_SIGNAL (done(const TQString&)), this, TQT_SLOT (spell_done(const TQString&))); } @@ -410,8 +410,8 @@ void TopLevel::spellcheck() void TopLevel::spell_started( KSpell *) { eframe->spellcheck_start(); - kspell->setProgressResolution(2); - kspell->check(eframe->text()); + tdespell->setProgressResolution(2); + tdespell->check(eframe->text()); } @@ -427,7 +427,7 @@ void TopLevel::spell_progress (unsigned int percent) void TopLevel::spell_done(const TQString& newtext) { eframe->spellcheck_stop(); - if (kspell->dlgResult() == 0) + if (tdespell->dlgResult() == 0) { eframe->setText( newtext); statusBar()->changeItem (i18n("Spellcheck: Aborted."), ID_GENERAL); @@ -436,7 +436,7 @@ void TopLevel::spell_done(const TQString& newtext) { statusBar()->changeItem (i18n("Spellcheck: Complete."), ID_GENERAL); } - kspell->cleanUp(); + tdespell->cleanUp(); } // Replace ISpell with the name of the actual spell checker. @@ -455,10 +455,10 @@ TQString TopLevel::replaceISpell(TQString msg, int client) void TopLevel::spell_finished( ) { - KSpell::spellStatus status = kspell->status(); - int client = kspellconfigOptions->client(); - delete kspell; - kspell = 0; + KSpell::spellStatus status = tdespell->status(); + int client = tdespellconfigOptions->client(); + delete tdespell; + tdespell = 0; if (status == KSpell::Error) { KMessageBox::sorry(this, replaceISpell(i18n("ISpell could not be started.\n" @@ -831,7 +831,7 @@ void TopLevel::showSettings() return; initSpellConfig(); - TDEConfigDialog* dialog = new SettingsDialog(this, "settings", Prefs::self(), kspellconfigOptions); + TDEConfigDialog* dialog = new SettingsDialog(this, "settings", Prefs::self(), tdespellconfigOptions); connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(updateSettings())); dialog->show(); @@ -839,8 +839,8 @@ void TopLevel::showSettings() void TopLevel::initSpellConfig() { - if (!kspellconfigOptions) - kspellconfigOptions = new KSpellConfig(0 , "SpellingSettings", 0, false ); + if (!tdespellconfigOptions) + tdespellconfigOptions = new KSpellConfig(0 , "SpellingSettings", 0, false ); } void TopLevel::search_again() diff --git a/kedit/kedit.h b/kedit/kedit.h index 56c4ccd..b931615 100644 --- a/kedit/kedit.h +++ b/kedit/kedit.h @@ -117,7 +117,7 @@ protected: void initSpellConfig(); private: - KSpellConfig *kspellconfigOptions; + KSpellConfig *tdespellconfigOptions; public: // Should not be! KEdit *eframe; @@ -138,7 +138,7 @@ private: TDEConfig *config; - KSpell *kspell; // Current spell checking object + KSpell *tdespell; // Current spell checking object /* * The source, the destination of the copy, and the open mode diff --git a/kfloppy/Makefile.am b/kfloppy/Makefile.am index 2cac206..57974ca 100644 --- a/kfloppy/Makefile.am +++ b/kfloppy/Makefile.am @@ -1,4 +1,4 @@ -kfloppy_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kfloppy_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kfloppy_LDADD = $(LIB_TDEUI) -lm INCLUDES = $(all_includes) diff --git a/kgpg/CMakeLists.txt b/kgpg/CMakeLists.txt index 4d976df..3bd5905 100644 --- a/kgpg/CMakeLists.txt +++ b/kgpg/CMakeLists.txt @@ -40,7 +40,7 @@ tde_add_executable( kgpg AUTOMOC keyexport.ui sourceselect.ui kgpgsettings.kcfgc conf_servers.ui conf_ui2.ui conf_misc.ui - LINK kabc-shared kutils-shared tdeprint-shared + LINK kabc-shared tdeutils-shared tdeprint-shared DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kgpg/Makefile.am b/kgpg/Makefile.am index 5af8eab..7cb6316 100644 --- a/kgpg/Makefile.am +++ b/kgpg/Makefile.am @@ -11,7 +11,7 @@ kgpg_SOURCES = kgpgoptions.cpp listkeys.cpp popuppublic.cpp kgpgview.cpp \ keyproperties.ui conf_encryption.ui conf_decryption.ui conf_gpg.ui dcopiface.skel \ keyinfowidget.cpp groupedit.ui kgpgrevokewidget.ui newkey.ui adduid.ui keyexport.ui \ sourceselect.ui kgpgsettings.kcfgc conf_servers.ui conf_ui2.ui conf_misc.ui -kgpg_LDADD = $(LIB_KIO) $(LIB_KABC) -lkutils -ltdeprint +kgpg_LDADD = $(LIB_KIO) $(LIB_KABC) -ltdeutils -ltdeprint pics_DATA= kgpg_anim.gif kgpg_docked.png kgpg_docked.gif kgpg_blank.png kgpg_fill.png picsdir=$(kde_datadir)/kgpg/pics @@ -28,7 +28,7 @@ kde_kcfg_DATA = kgpg.kcfg METASOURCES = AUTO # the library search path. -kgpg_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kgpg_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor appsdir = $(kde_datadir)/kgpg apps_DATA = kgpg.rc listkeys.rc tips diff --git a/khexedit/Makefile.am b/khexedit/Makefile.am index 87c0fe3..576c08b 100644 --- a/khexedit/Makefile.am +++ b/khexedit/Makefile.am @@ -20,7 +20,7 @@ draglabel.h progress.h hexeditstate.h chartabledialog.h hexdrag.h \ exportdialog.h fileinfodialog.h converterdialog.h listview.h searchbar.h khexedit_METASOURCES = AUTO -khexedit_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +khexedit_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor khexedit_LDADD = $(LIB_KIO) $(LIB_TDEPRINT) xdg_apps_DATA = khexedit.desktop diff --git a/khexedit/optiondialog.cc b/khexedit/optiondialog.cc index c33700c..b0360a3 100644 --- a/khexedit/optiondialog.cc +++ b/khexedit/optiondialog.cc @@ -426,7 +426,7 @@ void COptionDialog::setupFilePage( void ) { TQString text; TQFrame *page = addPage( i18n("Files"), i18n("File Management"), - BarIcon("kmultiple", KIcon::SizeMedium ) ); + BarIcon("tdemultiple", KIcon::SizeMedium ) ); TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); diff --git a/khexedit/parts/kbytesedit/CMakeLists.txt b/khexedit/parts/kbytesedit/CMakeLists.txt index 53f0cda..aece7ca 100644 --- a/khexedit/parts/kbytesedit/CMakeLists.txt +++ b/khexedit/parts/kbytesedit/CMakeLists.txt @@ -29,7 +29,7 @@ link_directories( tde_add_kpart( libkbyteseditwidget AUTOMOC SOURCES kbyteseditwidget.cpp DESTINATION ${PLUGIN_INSTALL_DIR} - LINK khexeditcommon-shared kparts-shared + LINK khexeditcommon-shared tdeparts-shared ) diff --git a/khexedit/parts/kpart/CMakeLists.txt b/khexedit/parts/kpart/CMakeLists.txt index af4d5b5..9efb479 100644 --- a/khexedit/parts/kpart/CMakeLists.txt +++ b/khexedit/parts/kpart/CMakeLists.txt @@ -29,7 +29,7 @@ link_directories( tde_add_kpart( libkhexedit2part AUTOMOC SOURCES khepart.cpp khebrowserextension.cpp khepartfactory.cpp - LINK khexeditcommon-shared kparts-shared + LINK khexeditcommon-shared tdeparts-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/khexedit/parts/kpart/khebrowserextension.h b/khexedit/parts/kpart/khebrowserextension.h index 3115b8e..8096bef 100644 --- a/khexedit/parts/kpart/khebrowserextension.h +++ b/khexedit/parts/kpart/khebrowserextension.h @@ -19,7 +19,7 @@ #define KHEBROWSEREXTENSION_H // kde specific -#include +#include namespace KHE { diff --git a/khexedit/parts/kpart/khepart.h b/khexedit/parts/kpart/khepart.h index 0ce0391..ccbd038 100644 --- a/khexedit/parts/kpart/khepart.h +++ b/khexedit/parts/kpart/khepart.h @@ -19,7 +19,7 @@ #define KHEPART_H // kde specific -#include +#include // app specific #include "kbigbuffer.h" diff --git a/khexedit/parts/kpart/khepartfactory.h b/khexedit/parts/kpart/khepartfactory.h index a411acb..9d12317 100644 --- a/khexedit/parts/kpart/khepartfactory.h +++ b/khexedit/parts/kpart/khepartfactory.h @@ -18,7 +18,7 @@ #ifndef KHEPARTFACTORY_H #define KHEPARTFACTORY_H -#include +#include class TDEInstance; class TDEAboutData; diff --git a/kjots/Makefile.am b/kjots/Makefile.am index 38f23df..cc0862b 100644 --- a/kjots/Makefile.am +++ b/kjots/Makefile.am @@ -1,5 +1,5 @@ INCLUDES = $(all_includes) -AM_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +AM_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor LDADD = $(LIB_KFILE) $(LIB_TDEPRINT) bin_PROGRAMS = kjots diff --git a/klaptopdaemon/Makefile.am b/klaptopdaemon/Makefile.am index bc58d54..bfcab8c 100644 --- a/klaptopdaemon/Makefile.am +++ b/klaptopdaemon/Makefile.am @@ -4,30 +4,30 @@ lib_LTLIBRARIES = libkcmlaptop.la SUBDIRS = pics applnk libkcmlaptop_la_SOURCES = portable.cpp smapidev.c daemon_state.cpp wake_laptop.cpp krichtextlabel.cpp -libkcmlaptop_la_LDFLAGS = $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +libkcmlaptop_la_LDFLAGS = $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor libkcmlaptop_la_LIBADD = $(LIB_TDEUI) MESSAGE_SOURCES = laptop_daemon.cpp kpcmcia.cpp xautolock.cc kpcmciainfo.cpp daemondock.cpp xautolock_diy.c xautolock_engine.c kded_klaptopdaemon_la_SOURCES = $(MESSAGE_SOURCES) laptop_daemon.skel -kded_klaptopdaemon_la_LDFLAGS = $(all_libraries) -module -avoid-version -lXtst $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kded_klaptopdaemon_la_LDFLAGS = $(all_libraries) -module -avoid-version -lXtst $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kded_klaptopdaemon_la_LIBADD = $(LIB_TDEUI) $(LIB_XSS) libkcmlaptop.la klaptop_acpi_helper_SOURCES = acpi_helper.cpp klaptop_acpi_helper_LDADD = $(LIB_QT) klaptop_check_SOURCES = laptop_check.cpp -klaptop_check_LDFLAGS = $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +klaptop_check_LDFLAGS = $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor klaptop_check_LDADD = $(LIB_KFILE) $(LIB_TDEUI) libkcmlaptop.la kcm_laptop_la_SOURCES = battery.cpp main.cpp pcmcia.cpp power.cpp warning.cpp \ acpi.cpp sony.cpp profile.cpp buttons.cpp apm.cpp -kcm_laptop_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -module +kcm_laptop_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -module kcm_laptop_la_LIBADD = $(LIB_KFILE) $(LIB_TDEUI) libkcmlaptop.la kcm_laptop_la_COMPILE_FIRST = crcresult.h AM_CPPFLAGS = $(all_includes) -AM_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +AM_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor KDE_OPTIONS = nofinal diff --git a/kmilo/delli8k/README b/kmilo/delli8k/README index 80ae5b0..7ece288 100644 --- a/kmilo/delli8k/README +++ b/kmilo/delli8k/README @@ -15,7 +15,7 @@ The code in this module is heavily based on: - the Thinkpad plug-in by Jonathan Riddell (jr@jriddell.org) Also, for the Dell specific implementations, code was taken from the -i8kutils package of Massimo Dal Zotto which can be +i8tdeutils package of Massimo Dal Zotto which can be downloaded from http://www.debian.org/~dz/i8k/ LICENSE: @@ -42,7 +42,7 @@ COMPATIBILITY: This plug-in should work on any Linux distribution that has the i8k module loaded or compiled into the kernel. Compatibility is really dependant on -the i8kutils package of Massimo Dal Zotto which can be +the i8tdeutils package of Massimo Dal Zotto which can be downloaded from http://www.debian.org/~dz/i8k/. Currently (20041122), this should support: diff --git a/kmilo/kmilod/kmilod.cpp b/kmilo/kmilod/kmilod.cpp index 1b777e2..fa2f4a8 100644 --- a/kmilo/kmilod/kmilod.cpp +++ b/kmilo/kmilod/kmilod.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include "kmilointerface.h" #include "defaultskin.h" diff --git a/kregexpeditor/CMakeLists.txt b/kregexpeditor/CMakeLists.txt index ee0eca5..1ebb963 100644 --- a/kregexpeditor/CMakeLists.txt +++ b/kregexpeditor/CMakeLists.txt @@ -77,7 +77,7 @@ tde_add_library( kregexpeditorcommon SHARED AUTOMOC emacsregexpconverter.cpp regexphighlighter.cpp util.cpp VERSION 1.0.0 - LINK kio-shared kmultiformlistbox-static + LINK kio-shared tdemultiformlistbox-static kwidgetstreamer-static DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/kregexpeditor/KMultiFormListBox/CMakeLists.txt b/kregexpeditor/KMultiFormListBox/CMakeLists.txt index 31f4b3e..67bfa33 100644 --- a/kregexpeditor/KMultiFormListBox/CMakeLists.txt +++ b/kregexpeditor/KMultiFormListBox/CMakeLists.txt @@ -27,14 +27,14 @@ add_definitions( ) -##### kmultiformlistbox (static) ################ - -tde_add_library( kmultiformlistbox STATIC_PIC AUTOMOC - SOURCES ccp.cpp kmultiformlistboxentry.cpp - kmultiformlistbox.cpp - kmultiformlistbox-multivisible.cpp - kmultiformlistboxfactory.cpp indexWindow.cpp - kmultiformlistbox-windowed.cpp +##### tdemultiformlistbox (static) ################ + +tde_add_library( tdemultiformlistbox STATIC_PIC AUTOMOC + SOURCES ccp.cpp tdemultiformlistboxentry.cpp + tdemultiformlistbox.cpp + tdemultiformlistbox-multivisible.cpp + tdemultiformlistboxfactory.cpp indexWindow.cpp + tdemultiformlistbox-windowed.cpp widgetwindow.cpp windowlistboxitem.cpp ) @@ -43,8 +43,8 @@ tde_add_library( kmultiformlistbox STATIC_PIC AUTOMOC install( FILES - kmultiformlistbox.h - kmultiformlistboxentry.h - kmultiformlistboxfactory.h + tdemultiformlistbox.h + tdemultiformlistboxentry.h + tdemultiformlistboxfactory.h DESTINATION ${INCLUDE_INSTALL_DIR} ) diff --git a/kregexpeditor/KMultiFormListBox/Makefile.am b/kregexpeditor/KMultiFormListBox/Makefile.am index 5ee885f..3f2a395 100644 --- a/kregexpeditor/KMultiFormListBox/Makefile.am +++ b/kregexpeditor/KMultiFormListBox/Makefile.am @@ -1,15 +1,15 @@ AM_CPPFLAGS = -DQT_NO_CAST_ASCII -noinst_LTLIBRARIES = libkmultiformlistbox.la +noinst_LTLIBRARIES = libtdemultiformlistbox.la INCLUDES= -I$(srcdir)/../KWidgetStreamer $(all_includes) -include_HEADERS = kmultiformlistboxentry.h kmultiformlistbox.h \ - kmultiformlistboxfactory.h -noinst_HEADERS = ccp.h indexWindow.h kmultiformlistbox-multivisible.h \ - kmultiformlistbox-windowed.h widgetwindow.h windowlistboxitem.h -libkmultiformlistbox_la_SOURCES = ccp.cpp kmultiformlistboxentry.cpp \ - kmultiformlistbox.cpp kmultiformlistbox-multivisible.cpp \ - kmultiformlistboxfactory.cpp indexWindow.cpp \ - kmultiformlistbox-windowed.cpp widgetwindow.cpp windowlistboxitem.cpp +include_HEADERS = tdemultiformlistboxentry.h tdemultiformlistbox.h \ + tdemultiformlistboxfactory.h +noinst_HEADERS = ccp.h indexWindow.h tdemultiformlistbox-multivisible.h \ + tdemultiformlistbox-windowed.h widgetwindow.h windowlistboxitem.h +libtdemultiformlistbox_la_SOURCES = ccp.cpp tdemultiformlistboxentry.cpp \ + tdemultiformlistbox.cpp tdemultiformlistbox-multivisible.cpp \ + tdemultiformlistboxfactory.cpp indexWindow.cpp \ + tdemultiformlistbox-windowed.cpp widgetwindow.cpp windowlistboxitem.cpp METASOURCES = AUTO diff --git a/kregexpeditor/KMultiFormListBox/ccp.cpp b/kregexpeditor/KMultiFormListBox/ccp.cpp index be65d35..8197d2c 100644 --- a/kregexpeditor/KMultiFormListBox/ccp.cpp +++ b/kregexpeditor/KMultiFormListBox/ccp.cpp @@ -19,7 +19,7 @@ // ccp = Cut-Copy-Paste //--------------------- -#include "kmultiformlistbox-multivisible.h" +#include "tdemultiformlistbox-multivisible.h" #include "ccp.h" #include #include diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp deleted file mode 100644 index 3dcab67..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ - -#ifdef TQT_ONLY - #include "compat.h" - #include -#else - #include - #include "kmultiformlistbox-multivisible.moc" -#endif - -#include "kmultiformlistbox-multivisible.h" -#include "indexWindow.h" -#include "ccp.h" - -#include - -const int indexButtonWidth = 16; -const int indexButtonHeight = 12; -const uchar indexButtonBits[] = { - 0x00, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x04, 0x02, 0x04, 0x02, 0xc4, 0x8a, - 0x24, 0x53, 0x14, 0x22, 0x14, 0x22, 0x24, 0x53, 0xce, 0x8a, 0x00, 0x00 -}; - - -KMultiFormListBoxMultiVisible::KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *fact, TQWidget *parent, const char *name) - : TQScrollView(parent, name) -{ - factory = fact; - - // Initialize the element list - elms = new WidgetList(); - - // Initialize the clipper. - enableClipper(true); - resizeContents(50,50); // This is required for proper functionality -} - - - -//---------------------------------------------------------------------- -// This function returns a list of the elements in the KMultiFormListBox widget. -//---------------------------------------------------------------------- -KMultiFormListBoxEntryList KMultiFormListBoxMultiVisible::elements() -{ - KMultiFormListBoxEntryList res; - for (TQWidget *child = elms->first(); child; child=elms->next()) { - if (strcmp(child->name(),"seperator") != 0) { - res.append((KMultiFormListBoxEntry *) child); - } - } - return res; -} - - -//---------------------------------------------------------------------- -// This function is called whenever the KMultiFormListBox widget is resized. It is -// necessary to ensure that the content of the clipper is resized. -//---------------------------------------------------------------------- -void KMultiFormListBoxMultiVisible::resizeEvent(TQResizeEvent *e) -{ - // The call of the super class ensures that the outer border is updated. - TQScrollView::resizeEvent(e); - - updateClipperContent(); -} - -void KMultiFormListBoxMultiVisible::updateClipperContent() -{ - // Extract the current size of the clipper - int ClipperWidth = clipper()->size().width(); - int ClipperHeight = clipper()->size().height(); - - // Initialize the calculation of the size of the new clipper. - int totalHeight = 0; - int maxWidth = ClipperWidth; - int count = 0; - - - // calculate the required size. - for (TQWidget *child = elms->first(); child; child=elms->next()) { - maxWidth = TQMAX(maxWidth, child->sizeHint().width()); - if (strcmp(child->name(), "seperator") != 0) { - totalHeight += child->sizeHint().height(); - count++; - } - else { - totalHeight += child->size().height(); - } - } - - // Calculate the extra height for the elements. - int extra = 0; - if (totalHeight < ClipperHeight && count != 0) { - extra = (ClipperHeight - totalHeight) / count; - totalHeight = ClipperHeight; - } - - // Now place the elements in the clipper. - int yPos = 0; - for (TQWidget *child2 = elms->first(); child2; child2=elms->next()) { - int h; - if ( strcmp(child2->name(),"seperator") != 0) { - h = child2->sizeHint().height(); - h += extra; - } - else { - h = child2->size().height(); - } - - moveChild(child2, 0,yPos); - - child2->resize(maxWidth,h); - yPos += h; - } - - // Finally call the resize procedure for the clipper to ensure that the - // new sizes is shown properly. - resizeContents(maxWidth, totalHeight); -} - - -void KMultiFormListBoxMultiVisible::addElement() -{ - addElement(0); -} - -void KMultiFormListBoxMultiVisible::addElement(KMultiFormListBoxEntry *after) -{ - KMultiFormListBoxEntry *elm = factory->create(viewport()); - insertElmIntoWidget(elm, after); -} - -void KMultiFormListBoxMultiVisible::append(KMultiFormListBoxEntry *elm) -{ - elm->reparent(viewport(), 0, TQPoint(0,0), false); - insertElmIntoWidget(elm, 0); -} - -void KMultiFormListBoxMultiVisible::delElement(TQWidget *elm) -{ - int index = elms->find(elm); - TQWidget *next = elms->at(index+1); - if (strcmp(next->name(),"seperator") != 0) { - elms->removeRef(next); - removeChild(next); - } - - elms->removeRef(elm); - removeChild(elm); - - updateClipperContent(); -} - -void KMultiFormListBoxMultiVisible::delAnElement() -{ - delElement(elms->at(0)); -} - -void KMultiFormListBoxMultiVisible::insertElmIntoWidget(KMultiFormListBoxEntry *elm, KMultiFormListBoxEntry *after) -{ - // Bind the index button if it exists. - if (elm->indexButton()) { - elm->indexButton()->setPixmap(TQBitmap(indexButtonWidth, indexButtonHeight, - indexButtonBits, true)); - connect(elm->indexButton(), TQT_SIGNAL(clicked()), elm, TQT_SLOT(acceptIndexButton())); - connect(elm, TQT_SIGNAL(gotoIndex(KMultiFormListBoxEntry *)), - this, TQT_SLOT(showIndexList(KMultiFormListBoxEntry *))); - } - - // Find the location to insert the new element. - int index = elms->count(); - if (after) { - index = elms->findRef(after); - } - - // Now show the new element. - elms->insert(index, elm); - elm->show(); - addChild(elm,0,0); // updateClipperContent will place the child correctly. - - TQWidget *sep = factory->separator(viewport()); - if (sep != 0) { - sep->setName("seperator"); - sep->show(); - addChild(sep,0,0); // updateClipperContent will place the child correctly. - elms->insert(index+1, sep); - } - - updateClipperContent(); - - showWidget(elm); // scroll to show the new widget. - - // install cut'n'paste functionallity - new CCP(this,elm); -} - - -//---------------------------------------------------------------------- -// This function shows the list of available Idx elements. -//---------------------------------------------------------------------- -void KMultiFormListBoxMultiVisible::showIndexList(KMultiFormListBoxEntry *elm) -{ - indexWindow *menu = new indexWindow(); - - // Insert the elements into the menu item. - for (TQWidget *child = elms->first(); child; child=elms->next()) { - if ( strcmp(child->name(), "seperator") != 0) { - TQString txt = ((KMultiFormListBoxEntry *) child)->idxString(); - menu->insertItem(txt); - } - } - - // Calculate the location of the window - TQPoint start; - int width; - elm->indexWindowPos(&start, &width); - - // Show the window. - int index = menu->exec(start,width); - - if (index != -1) { - for (TQWidget *child = elms->first(); child; child=elms->next()) { - if ( strcmp(child->name(), "seperator") != 0) { - - if (index == 0) { - showWidget((KMultiFormListBoxEntry *) child); - break; - } - index--; - } - } - } - delete menu; -} - -//---------------------------------------------------------------------- -// Scroll to the loaction of the given KMultiFormListBoxEntry element. -//---------------------------------------------------------------------- -void KMultiFormListBoxMultiVisible::showWidget(KMultiFormListBoxEntry *elm) -{ - setContentsPos(childX(elm), childY(elm)); -} - - -void KMultiFormListBoxMultiVisible::cut(KMultiFormListBoxEntry *elm) -{ - if (countElements(elms) == 1) { - KMessageBox::information(this, i18n("Due to a bug, it is not possible to remove the last element."), i18n("Internal Error") ); - return; - } - - TQDataStream stream(clipboard, IO_WriteOnly); - factory->toStream( TQT_TQOBJECT(elm), stream ); - delElement(elm); -} - -void KMultiFormListBoxMultiVisible::copy(KMultiFormListBoxEntry *elm) -{ - TQDataStream stream(clipboard, IO_WriteOnly); - factory->toStream(TQT_TQOBJECT(elm), stream); -} - -void KMultiFormListBoxMultiVisible::paste(KMultiFormListBoxEntry *oldElm) -{ - if (clipboard.size() == 0) { - KMessageBox::information(this, i18n("There is no element on the clipboard to paste in.")); - return; - } - - KMultiFormListBoxEntry *newElm = factory->create(viewport()); - TQDataStream stream( clipboard, IO_ReadOnly ); - factory->fromStream(stream, TQT_TQOBJECT(newElm)); - insertElmIntoWidget(newElm,oldElm); -} - - -int KMultiFormListBoxMultiVisible::countElements(WidgetList *elms) -{ - int count = 0; - - for (TQWidget *child = elms->first(); child; child=elms->next()) { - if (dynamic_cast(child)) - count++; - } - - return count; -} - - diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h deleted file mode 100644 index 04a3f75..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -// ------------------------------- Description ---------------------------- -// This is the KMultiFormListBox Widget. You do not need to inheret from this class, -// your interface to it will be through the methods `append` and `elements'. -// -// To make an instance of the widget, you need to inherit the classes -// `KMultiFormListBoxFactory' and `KMultiFormListBoxEntry'. -// ------------------------------------------------------------------------ -#ifndef __kmultiformlistboxmultivisble -#define __kmultiformlistboxmultivisble - -// -------------------------------- includes ------------------------------ -#include "kmultiformlistbox.h" -//------------------------------------------------------------------------- - -/** - @internal -*/ -class KMultiFormListBoxMultiVisible :public TQScrollView, KMultiFormListBoxShower { - -Q_OBJECT - - -friend class KMultiFormListBox; - -private: - /** - @param factory A factory used to generate the instances of KMultiFormListBoxEntry - class which is repeated in the KMultiFormListBox - @param parent A pointer to the parent widget - */ - KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *factory, TQWidget *parent = 0, const char *name = 0); - - /** - @return The elements in the KMultiFormListBox - */ - KMultiFormListBoxEntryList elements(); - void append(KMultiFormListBoxEntry *); - - TQWidget* qWidget() { return this; } - - -public slots: - - /** - This slot should be connected to a button which lets the user know that - he may get more elements in this KMultiFormListBox by pressing it. - The button should be labeled ``More Entries'' or something similar. - */ - void addElement(); // Adds an empty element to the KMultiFormListBox - - -protected slots: - - /** - When this slot is invoked then the Idx menu will be shown. - @param elm The KMultiFormListBoxEntry element where the Idx button was - pressed. This information is necessary to be able to calculate the - location where the drop down menu should be shown - */ - void showIndexList(KMultiFormListBoxEntry *elm); - -protected: - /** - Copies the element pointed to by which to the clipboard and removes it - from the interface. - This function is accessed from the class @ref CCP. - @param which A pointer to the element to cut. - */ - void cut(KMultiFormListBoxEntry *which); - - /** - Copies the element pointed to by which to the clipboard. - This function is accessed from the class @ref CCP. - @param which A pointer to the element to copied. - */ - void copy(KMultiFormListBoxEntry *which); - - /** - Paste the element from the clipboard to the KMultiFormListBox - This function is accessed from the class @ref CCP. - @param which A pointer to the KMultiFormListBoxEntry element which the - clipboard element should be inserted before,. - */ - void paste(KMultiFormListBoxEntry *which); - - /** - Inserts an empty KMultiFormListBoxEntry into the widget. - @param which A pointer to the element which the new empty widget - should be inserted before. - */ - - void addElement(KMultiFormListBoxEntry *); - - friend class CCP; - - virtual void resizeEvent(TQResizeEvent *); - void addElemBefore(KMultiFormListBoxEntry *newElm, TQWidget *existing); - void insertElmIntoWidget(KMultiFormListBoxEntry *elm, KMultiFormListBoxEntry *after); - void showWidget(KMultiFormListBoxEntry *elm); - void delElement(TQWidget *); - void delAnElement(); - void addElemBefore(KMultiFormListBoxEntry *newElm, KMultiFormListBoxEntry *existing); - void updateClipperContent(); - int countElements(WidgetList *); - - - -private: - // Instance variables - - KMultiFormListBoxFactory *factory; - WidgetList *elms; - TQPushButton *addBut; - TQByteArray clipboard; -}; - - -#endif /* kmultiformlistboxmultivisble */ - diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h deleted file mode 100644 index 15f3af5..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -#ifndef __kmultiformlistboxshower -#define __kmultiformlistboxshower - -// -------------------------------- includes ------------------------------ -//------------------------------------------------------------------------- -typedef TQPtrList KMultiFormListBoxEntryList ; - -/** - Abstract class defining the interface for widgets showing a number of @ref KMultiFormListBoxEntry. - - @internal -*/ -class KMultiFormListBoxShower { - -public: - virtual KMultiFormListBoxEntryList elements() = 0; - - /** Appends the given argument to the list */ - virtual void append(KMultiFormListBoxEntry *) = 0; - - /** Return the element as a TQWidget */ - virtual TQWidget* qWidget() = 0; - - /** Adds an empty element. */ - virtual void addElement() = 0; - - /** Deletes an element at the given index. */ - virtual void delElement(TQWidget *) = 0; - - /** Deletes any element from the list */ - virtual void delAnElement() = 0; -}; - - -#endif /* kmultiformlistboxshower */ - diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp deleted file mode 100644 index 8d3ffe3..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -#ifdef TQT_ONLY - #include "compat.h" -#else - #include - #include - #include - #include "kmultiformlistbox-windowed.moc" -#endif - -#include "widgetwindow.h" -#include "windowlistboxitem.h" - -KMultiFormListBoxWindowed::KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *parent, - bool showUpDownButtons, bool showHelpButton, - TQString addButtonText,const char *name) - : TQWidget( parent, name ) -{ - _layout = new TQVBoxLayout(this); - - TQHBoxLayout *innerLayout = new TQHBoxLayout(); - _layout->addLayout(innerLayout); - - _listbox = new KListBox(this,"listbox"); - _listbox->setSelectionMode(TQListBox::Single); - innerLayout->addWidget(_listbox); - - TQVBoxLayout *buttons = new TQVBoxLayout(); - innerLayout->addLayout(buttons); - - TQPushButton *but = new TQPushButton(addButtonText, this,"Add Button"); - buttons->addWidget(but,0); - connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(addNewElement())); - - but = new TQPushButton(i18n("Edit"), this,"Edit Button"); - buttons->addWidget(but,0); - connect(but,TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditSelected())); - connect(_listbox, TQT_SIGNAL(doubleClicked(TQListBoxItem *)), this, TQT_SLOT(slotEditSelected(TQListBoxItem *))); - _buttonList.append(but); - - but = new TQPushButton(i18n("Delete"), this, "Delete Button"); - buttons->addWidget(but,0); - connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteEntry())); - _buttonList.append(but); - - but = new TQPushButton(i18n("Copy"), this, "Copy Button"); - buttons->addWidget(but,0); - connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCopySelected())); - _buttonList.append(but); - - if (showUpDownButtons) { - but = new TQPushButton(i18n("Up"), this, "Up Button"); - buttons->addWidget(but, 0); - connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMoveItemUp())); - _buttonList.append(but); - - but = new TQPushButton(i18n("Down"), this, "Down Button"); - buttons->addWidget(but, 0); - connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMoveItemDown())); - _buttonList.append(but); - } - - if (showHelpButton) { - but = new KPushButton(KStdGuiItem::help(), this, "Help Button"); - buttons->addWidget(but, 0); - connect(but, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(showHelp())); - } - - buttons->addStretch(1); - _factory = factory; - slotUpdateButtonState(); - -} - -KMultiFormListBoxEntryList KMultiFormListBoxWindowed::elements() -{ - KMultiFormListBoxEntryList list; - for (unsigned int i=0; i < _listbox->count(); i++) { - WindowListboxItem *item = (WindowListboxItem *) _listbox->item(i); - list.append(item->entry()); - } - return list; -} - -void KMultiFormListBoxWindowed::delElement(TQWidget */*elm*/) -{ - // kdDebug() << "KMultiFormListBoxWindowed::delElement NOT YET IMPLEMENTED"<show(); - connect(widget, TQT_SIGNAL(finished()), this, TQT_SLOT(slotUpdateButtonState())); -} - -void KMultiFormListBoxWindowed::addElement() -{ - new WidgetWindow(_factory, _listbox); - slotUpdateButtonState(); -} - -void KMultiFormListBoxWindowed::slotEditSelected(TQListBoxItem *item) -{ - ((WindowListboxItem *) item)->displayWidget(); -} - -void KMultiFormListBoxWindowed::slotEditSelected() -{ - WindowListboxItem *item = selected(); - if (item) { - slotEditSelected(item); - } -} - -void KMultiFormListBoxWindowed::slotDeleteEntry() -{ - WindowListboxItem *item = selected(); - if (item) { - int answer = - KMessageBox::warningContinueCancel(0, i18n("Delete item \"%1\"?").arg(item->text()),i18n("Delete Item"),KStdGuiItem::del()); - if (answer == KMessageBox::Continue) { - delete item; - slotUpdateButtonState(); - } - } -} - -void KMultiFormListBoxWindowed::slotCopySelected() -{ - WindowListboxItem *item = selected(); - if (item) { - item->clone(); - } -} - -WindowListboxItem *KMultiFormListBoxWindowed::selected() -{ - int i = _listbox->currentItem(); - if (i == -1) { - return 0; - } else { - return (WindowListboxItem *) _listbox->item(i); - } -} - -void KMultiFormListBoxWindowed::slotMoveItemUp() -{ - WindowListboxItem *item = selected(); - if (item == 0) - return; - - int index = _listbox->index(item); - if (index != 0) { - _listbox->takeItem(item); - _listbox->insertItem(item, index-1); - _listbox->setCurrentItem(item); - } -} - -void KMultiFormListBoxWindowed::slotMoveItemDown() -{ - WindowListboxItem *item = selected(); - if (item == 0) - return; - - unsigned int index = _listbox->index(item); - if (index < _listbox->count()) { - _listbox->takeItem(item); - _listbox->insertItem(item, index+1); - _listbox->setCurrentItem(item); - } -} - -void KMultiFormListBoxWindowed::slotUpdateButtonState() -{ - bool on = (_listbox->count() != 0); - for (unsigned int i=0; i<_buttonList.count(); i++) { - _buttonList.at(i)->setEnabled(on); - } -} diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h deleted file mode 100644 index f86f6a4..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -#ifndef __kmultiformlistboxwindowed -#define __kmultiformlistboxwindowed - -#ifdef TQT_ONLY - #include "compat.h" - #include -#else - #include -#endif - -#include "kmultiformlistboxfactory.h" -#include "kmultiformlistbox.h" -class WindowListboxItem; - - -/** - This class implements the windowed look for a @ref KMultiFormListBox - - @internal -*/ -class KMultiFormListBoxWindowed :public TQWidget, KMultiFormListBoxShower { - -Q_OBJECT - - -friend class KMultiFormListBox; - -private: - KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *parent, - bool showUpDownButtons, bool showHelpButton, TQString addButtonText, - const char *name); - - KMultiFormListBoxEntryList elements(); - const KMultiFormListBoxEntryList elements() const; - void append(KMultiFormListBoxEntry *); - WindowListboxItem *selected(); - TQWidget* qWidget() { return this; } - - TQVBoxLayout* _layout; - KMultiFormListBoxFactory* _factory; - TQPtrList _buttonList; - KListBox* _listbox; - virtual void delElement(TQWidget *); // Deletes the given element - virtual void delAnElement(); - void addElement(); - - -public slots: - void addNewElement(); - -signals: - void showHelp(); - -private slots: - void slotEditSelected(); - void slotEditSelected(TQListBoxItem *item); - void slotCopySelected(); - void slotMoveItemUp(); - void slotMoveItemDown(); - void slotDeleteEntry(); - void slotUpdateButtonState(); - -}; - - -#endif /* kmultiformlistboxwindowed */ - diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp deleted file mode 100644 index 58b82da..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -#ifndef TQT_ONLY - #include "kmultiformlistbox.moc" -#endif - -#include "kmultiformlistbox-multivisible.h" -#include "kmultiformlistbox-windowed.h" - -KMultiFormListBox::KMultiFormListBox( KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp, TQWidget *parent, - bool showUpDownButtons, bool showHelpButton, TQString addButtonText, - const char *name ) : TQWidget( parent, name ) -{ - switch ( tp ) { - - case MultiVisible: - theWidget = new KMultiFormListBoxMultiVisible( factory, this, "KMultiFormListBox Widget" ); - break; - - case Windowed: - theWidget = new KMultiFormListBoxWindowed( factory, this, showUpDownButtons, - showHelpButton, addButtonText, "KMultiFormListBox Widget" ); - break; - } - - TQWidget *widget = theWidget->qWidget(); - - TQHBoxLayout *layout = new TQHBoxLayout( this ); - _factory = factory; - layout->addWidget( widget ); -} - -void KMultiFormListBox::append( KMultiFormListBoxEntry *element ) -{ - theWidget->append( element ); -} - -void KMultiFormListBox::addElement() -{ - theWidget->addElement(); -} - -KMultiFormListBoxEntryList KMultiFormListBox::elements() -{ - return theWidget->elements(); -} - -const KMultiFormListBoxEntryList KMultiFormListBox::elements() const -{ - return const_cast(this)->elements(); -} - -void KMultiFormListBox::slotChangeFace( KMultiFormListBoxType /*newFace*/ ) -{ - // TODO - // kdDebug() << "It's not possible yet to change the face on the fly." << endl - // << "Please let me (blackie@kde.org) know that you need it, and I'll work on it" << endl; -} - -void KMultiFormListBox::toStream( TQDataStream& stream ) const -{ - const KMultiFormListBoxEntryList elms = elements(); - stream << elms.count(); - for ( TQPtrListIterator it(elms); *it; ++it) - _factory->toStream( TQT_TQOBJECT(*it), stream ); -} - -void KMultiFormListBox::fromStream( TQDataStream& stream ) -{ - unsigned int fromCount, toCount; - stream >> fromCount; - - toCount = elements().count(); - - // adds/remove elements in the to list, to make it have the correct length. - for (unsigned int j=toCount; j< fromCount; ++j) { - addElement(); - } - for (unsigned int k=fromCount; k < toCount; ++k) { - theWidget->delAnElement(); - } - - KMultiFormListBoxEntryList elms = elements(); - for (TQPtrListIterator it(elms); *it; ++it) - _factory->fromStream( stream, TQT_TQOBJECT(*it) ); -} - - - diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h deleted file mode 100644 index 89a6d0a..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -#ifndef __kmultiformlistbox -#define __kmultiformlistbox - -#include "kmultiformlistboxfactory.h" -#include "kmultiformlistbox-shower.h" -#include "kmultiformlistboxentry.h" -#include -#include -#include - -#ifdef TQT_ONLY - #include "compat.h" -#else - #include -#endif - -class TQDataStream; - - -typedef TQPtrList KMultiFormListBoxEntryList ; -typedef TQPtrList WidgetList; -class KMultiFormListBoxMultiVisible; - -/** - The main class used to get an KMultiFormListBox widget. - - The KMultiFormListBox widget consist of a sub-widget which is repeated a - number of times, it is up to the end user to determine the number of times - the sub widget is repeated, and he may require an additional copy simply - by pressing a ``Add'' or ``More Entries'' button. The KMultiFormListBox - widget has two different faces (i.e. two different end user - interfaces). One (Windowed) will show a listbox from which the end user - can access each subwidget containing data by pressing the LMB on a name - for the element. The other face (MultiVisible) shows all the subwidgets in - one huge ``Listbox''. - - To use the KMultiFormListBox widget you must create a class which is inherited - from the @ref KMultiFormListBoxFactory class. This new class must override the - function `create'. This function must return a freshly made instance of - the class @ref KMultiFormListBoxEntry (or a subclass of this). The KMultiFormListBoxEntry - instance is the one inserted into the KMultiFormListBox widget (one instance for - each sub widget in the KMultiFormListBox widget). - - @author Jesper Kjr Pedersen - **/ -class KMultiFormListBox : public TQWidget { - -Q_OBJECT - - -public: - - enum KMultiFormListBoxType {MultiVisible, Windowed}; - - /** - @param factory A factory used to generate the instances of - KMultiFormListBoxEntry class which is repeated in the KMultiFormListBox - @param parent A pointer to the parent widget - **/ - KMultiFormListBox(KMultiFormListBoxFactory *factory, - KMultiFormListBoxType tp=Windowed, - TQWidget *parent = 0, bool showUpDownButtons = true, - bool showHelpButton = true, TQString addButtonText = i18n("Add"), - const char *name = 0); - - /** - @return The elements in the KMultiFormListBox. - **/ - KMultiFormListBoxEntryList elements(); - const KMultiFormListBoxEntryList elements() const; - - /** - TODO. - **/ - void append(KMultiFormListBoxEntry *); - - /** write data out to stream */ - void toStream( TQDataStream& stream ) const; - - /** reads data in from stream */ - void fromStream( TQDataStream& stream ); - -public slots: - - /** - Adds an empty element to the KMultiFormListBox. - - This slot is only required for the @ref MultiVisible face. It should - be connected to a button which lets the user know that he may get more - elements in this KMultiFormListBox by pressing it. The button should - be labeled ``More Entries'' or something similar. - **/ - void addElement(); // Adds an empty element to the KMultiFormListBox - - /** - Changes the face of the KMultiFormListBox. - @param face The new face of the KMultiFormListBox - **/ - void slotChangeFace(KMultiFormListBoxType newFace); - -private: - KMultiFormListBoxShower *theWidget; - KMultiFormListBoxFactory *_factory; - -}; - - -#endif /* kmultiformlistbox */ - diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp deleted file mode 100644 index 5631078..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ - -#ifndef TQT_ONLY - #include "kmultiformlistboxentry.moc" -#endif - -#include "kmultiformlistboxentry.h" -//---------------------------------------------------------------------- -// This function is needed to signal which of the KMultiFormListBox entries -// the Idx button was invoked from. -//---------------------------------------------------------------------- -void KMultiFormListBoxEntry::acceptIndexButton() -{ - emit gotoIndex(this); -} - - -void KMultiFormListBoxEntry::indexWindowPos(TQPoint *start, int *width) -{ - // Calculate the position of the value widgets left-buttom border - TQPoint global_point = valueWidget()->mapToGlobal(TQPoint(0,0)); - start->setX(global_point.x()); - start->setY(global_point.y() + valueWidget()->height()); - - // Calculate the width of the list. - global_point = indexButton()->mapToGlobal(TQPoint(0,0)); - *width = global_point.x() + indexButton()->width() - start->x(); -} diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h deleted file mode 100644 index b3750bb..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -#ifndef __kmultiformlistboxentry -#define __kmultiformlistboxentry - -#include -#include -#include - -/** - This widget must be the base class for an entry widget used in the @ref - KMultiFormListBox class. It is necessary for you to inherit this class to get any - information attached to the elements in the KMultiFormListBox. - - The KMultiFormListBox widget features a fast scrolling mechanism through the Idx - button. If you want to use this in you KMultiFormListBox, then you must do the - following: - @li Create a @ref TQPushButton as a sub-widget to your KMultiFormListBoxEntry. - @li Override the @ref indexButton method to return your TQPushButton - @li Override the @ref idxString to return a @ref TQString - with a textual representation of the content in this KMultiFormListBoxEntry. This - string will be used in the drop-down box which the user gets when he - presses the Idx button. - @li The drop down window must be aligned horizontal to some widget - (which should be next to the Idx button, to ensure a good looking GUI. The - position of the drop down widget may be specified in two ways: (1) - override the @ref valueWidget method to return a widget, to align with - (that is the upper right corner of the drop down window will be the - same as the lower right corner of this widget) or (2) override the @ref - indexWindowPos method to return a start point for the drop down window and - a width. - **/ -class KMultiFormListBoxEntry : public TQWidget -{ - Q_OBJECT - - -public: - KMultiFormListBoxEntry(TQWidget *parent, const char *name) : TQWidget(parent,name) {} - - virtual TQPushButton *indexButton() { return 0; } - virtual TQWidget *valueWidget() { return 0; } - - virtual void indexWindowPos(TQPoint *start, int *width); // both variables are return values. - - // This function must return a string representing the KMultiFormListBox. This is - // used when showing the fast-search menu available from the `Idx' button. - virtual TQString idxString() { return TQString::fromLatin1(""); } - -public slots: - void acceptIndexButton(); - -signals: - void gotoIndex(KMultiFormListBoxEntry *); - -}; - -#endif /* kmultiformlistboxentry */ - diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp deleted file mode 100644 index 08a800a..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -#include "kmultiformlistboxfactory.h" -#include - -TQWidget *KMultiFormListBoxFactory::separator(TQWidget *parent) { - TQFrame* sep = new TQFrame( parent ); - sep->setFrameStyle( TQFrame::HLine | TQFrame::Sunken); - sep->setLineWidth(1); - return sep; -} diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h deleted file mode 100644 index dc0bcce..0000000 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2002-2003 Jesper K. Pedersen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -// -------------------------------- includes ------------------------------ -#ifndef __kmultiformlistboxfactory -#define __kmultiformlistboxfactory -#include -#include "kwidgetstreamer.h" -class KMultiFormListBoxEntry; -//------------------------------------------------------------------------- - - -/** - Factory use to generate elements for the @ref KMultiFormListBox widget. - - To use an @ref KMultiFormListBox, one must inherit from the class KMultiFormListBoxFactory - and override the method @ref create. This method must return an empty - element for the KMultiFormListBox (that is an @ref KMultiFormListBoxEntry or a subclass of - it). - - If you dislike the default separator between each of the elements or - simply do not want a separator in the KMultiFormListBox, then you may override - the method @ref separator. -**/ -class KMultiFormListBoxFactory : public KWidgetStreamer -{ -public: - virtual ~KMultiFormListBoxFactory() {} - - /** - This method must be overridden in subclasses and must return an - ``empty'' instance of the @ref KMultiFormListBoxEntry class, or perhaps rather - a subclass of this class. This instance will be owned by the caller of - this function. - - @param parent A pointer to the parent of this KMultiFormListBoxEntry widget - returned. - @return A fresh @ref KMultiFormListBoxEntry to be used in an instance of the - @ref KMultiFormListBox class. - **/ - virtual KMultiFormListBoxEntry *create(TQWidget *parent) = 0; - - /** - This method is used to get a separator between the elements in an @ref - KMultiFormListBox. The widget returned from this method will be owned by the - caller. - - @param parent A pointer to the parent of the TQWidget returned. - @return A widget which must be used as a separator between the @ref - KMultiFormListBoxEntry elements in an @ref KMultiFormListBox. - **/ - virtual TQWidget *separator(TQWidget *parent); -}; - -#endif /* kmultiformlistbox */ - diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-multivisible.cpp b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-multivisible.cpp new file mode 100644 index 0000000..5c67526 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-multivisible.cpp @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ + +#ifdef TQT_ONLY + #include "compat.h" + #include +#else + #include + #include "tdemultiformlistbox-multivisible.moc" +#endif + +#include "tdemultiformlistbox-multivisible.h" +#include "indexWindow.h" +#include "ccp.h" + +#include + +const int indexButtonWidth = 16; +const int indexButtonHeight = 12; +const uchar indexButtonBits[] = { + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x04, 0x02, 0x04, 0x02, 0xc4, 0x8a, + 0x24, 0x53, 0x14, 0x22, 0x14, 0x22, 0x24, 0x53, 0xce, 0x8a, 0x00, 0x00 +}; + + +KMultiFormListBoxMultiVisible::KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *fact, TQWidget *parent, const char *name) + : TQScrollView(parent, name) +{ + factory = fact; + + // Initialize the element list + elms = new WidgetList(); + + // Initialize the clipper. + enableClipper(true); + resizeContents(50,50); // This is required for proper functionality +} + + + +//---------------------------------------------------------------------- +// This function returns a list of the elements in the KMultiFormListBox widget. +//---------------------------------------------------------------------- +KMultiFormListBoxEntryList KMultiFormListBoxMultiVisible::elements() +{ + KMultiFormListBoxEntryList res; + for (TQWidget *child = elms->first(); child; child=elms->next()) { + if (strcmp(child->name(),"seperator") != 0) { + res.append((KMultiFormListBoxEntry *) child); + } + } + return res; +} + + +//---------------------------------------------------------------------- +// This function is called whenever the KMultiFormListBox widget is resized. It is +// necessary to ensure that the content of the clipper is resized. +//---------------------------------------------------------------------- +void KMultiFormListBoxMultiVisible::resizeEvent(TQResizeEvent *e) +{ + // The call of the super class ensures that the outer border is updated. + TQScrollView::resizeEvent(e); + + updateClipperContent(); +} + +void KMultiFormListBoxMultiVisible::updateClipperContent() +{ + // Extract the current size of the clipper + int ClipperWidth = clipper()->size().width(); + int ClipperHeight = clipper()->size().height(); + + // Initialize the calculation of the size of the new clipper. + int totalHeight = 0; + int maxWidth = ClipperWidth; + int count = 0; + + + // calculate the required size. + for (TQWidget *child = elms->first(); child; child=elms->next()) { + maxWidth = TQMAX(maxWidth, child->sizeHint().width()); + if (strcmp(child->name(), "seperator") != 0) { + totalHeight += child->sizeHint().height(); + count++; + } + else { + totalHeight += child->size().height(); + } + } + + // Calculate the extra height for the elements. + int extra = 0; + if (totalHeight < ClipperHeight && count != 0) { + extra = (ClipperHeight - totalHeight) / count; + totalHeight = ClipperHeight; + } + + // Now place the elements in the clipper. + int yPos = 0; + for (TQWidget *child2 = elms->first(); child2; child2=elms->next()) { + int h; + if ( strcmp(child2->name(),"seperator") != 0) { + h = child2->sizeHint().height(); + h += extra; + } + else { + h = child2->size().height(); + } + + moveChild(child2, 0,yPos); + + child2->resize(maxWidth,h); + yPos += h; + } + + // Finally call the resize procedure for the clipper to ensure that the + // new sizes is shown properly. + resizeContents(maxWidth, totalHeight); +} + + +void KMultiFormListBoxMultiVisible::addElement() +{ + addElement(0); +} + +void KMultiFormListBoxMultiVisible::addElement(KMultiFormListBoxEntry *after) +{ + KMultiFormListBoxEntry *elm = factory->create(viewport()); + insertElmIntoWidget(elm, after); +} + +void KMultiFormListBoxMultiVisible::append(KMultiFormListBoxEntry *elm) +{ + elm->reparent(viewport(), 0, TQPoint(0,0), false); + insertElmIntoWidget(elm, 0); +} + +void KMultiFormListBoxMultiVisible::delElement(TQWidget *elm) +{ + int index = elms->find(elm); + TQWidget *next = elms->at(index+1); + if (strcmp(next->name(),"seperator") != 0) { + elms->removeRef(next); + removeChild(next); + } + + elms->removeRef(elm); + removeChild(elm); + + updateClipperContent(); +} + +void KMultiFormListBoxMultiVisible::delAnElement() +{ + delElement(elms->at(0)); +} + +void KMultiFormListBoxMultiVisible::insertElmIntoWidget(KMultiFormListBoxEntry *elm, KMultiFormListBoxEntry *after) +{ + // Bind the index button if it exists. + if (elm->indexButton()) { + elm->indexButton()->setPixmap(TQBitmap(indexButtonWidth, indexButtonHeight, + indexButtonBits, true)); + connect(elm->indexButton(), TQT_SIGNAL(clicked()), elm, TQT_SLOT(acceptIndexButton())); + connect(elm, TQT_SIGNAL(gotoIndex(KMultiFormListBoxEntry *)), + this, TQT_SLOT(showIndexList(KMultiFormListBoxEntry *))); + } + + // Find the location to insert the new element. + int index = elms->count(); + if (after) { + index = elms->findRef(after); + } + + // Now show the new element. + elms->insert(index, elm); + elm->show(); + addChild(elm,0,0); // updateClipperContent will place the child correctly. + + TQWidget *sep = factory->separator(viewport()); + if (sep != 0) { + sep->setName("seperator"); + sep->show(); + addChild(sep,0,0); // updateClipperContent will place the child correctly. + elms->insert(index+1, sep); + } + + updateClipperContent(); + + showWidget(elm); // scroll to show the new widget. + + // install cut'n'paste functionallity + new CCP(this,elm); +} + + +//---------------------------------------------------------------------- +// This function shows the list of available Idx elements. +//---------------------------------------------------------------------- +void KMultiFormListBoxMultiVisible::showIndexList(KMultiFormListBoxEntry *elm) +{ + indexWindow *menu = new indexWindow(); + + // Insert the elements into the menu item. + for (TQWidget *child = elms->first(); child; child=elms->next()) { + if ( strcmp(child->name(), "seperator") != 0) { + TQString txt = ((KMultiFormListBoxEntry *) child)->idxString(); + menu->insertItem(txt); + } + } + + // Calculate the location of the window + TQPoint start; + int width; + elm->indexWindowPos(&start, &width); + + // Show the window. + int index = menu->exec(start,width); + + if (index != -1) { + for (TQWidget *child = elms->first(); child; child=elms->next()) { + if ( strcmp(child->name(), "seperator") != 0) { + + if (index == 0) { + showWidget((KMultiFormListBoxEntry *) child); + break; + } + index--; + } + } + } + delete menu; +} + +//---------------------------------------------------------------------- +// Scroll to the loaction of the given KMultiFormListBoxEntry element. +//---------------------------------------------------------------------- +void KMultiFormListBoxMultiVisible::showWidget(KMultiFormListBoxEntry *elm) +{ + setContentsPos(childX(elm), childY(elm)); +} + + +void KMultiFormListBoxMultiVisible::cut(KMultiFormListBoxEntry *elm) +{ + if (countElements(elms) == 1) { + KMessageBox::information(this, i18n("Due to a bug, it is not possible to remove the last element."), i18n("Internal Error") ); + return; + } + + TQDataStream stream(clipboard, IO_WriteOnly); + factory->toStream( TQT_TQOBJECT(elm), stream ); + delElement(elm); +} + +void KMultiFormListBoxMultiVisible::copy(KMultiFormListBoxEntry *elm) +{ + TQDataStream stream(clipboard, IO_WriteOnly); + factory->toStream(TQT_TQOBJECT(elm), stream); +} + +void KMultiFormListBoxMultiVisible::paste(KMultiFormListBoxEntry *oldElm) +{ + if (clipboard.size() == 0) { + KMessageBox::information(this, i18n("There is no element on the clipboard to paste in.")); + return; + } + + KMultiFormListBoxEntry *newElm = factory->create(viewport()); + TQDataStream stream( clipboard, IO_ReadOnly ); + factory->fromStream(stream, TQT_TQOBJECT(newElm)); + insertElmIntoWidget(newElm,oldElm); +} + + +int KMultiFormListBoxMultiVisible::countElements(WidgetList *elms) +{ + int count = 0; + + for (TQWidget *child = elms->first(); child; child=elms->next()) { + if (dynamic_cast(child)) + count++; + } + + return count; +} + + diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-multivisible.h b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-multivisible.h new file mode 100644 index 0000000..5077496 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-multivisible.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +// ------------------------------- Description ---------------------------- +// This is the KMultiFormListBox Widget. You do not need to inheret from this class, +// your interface to it will be through the methods `append` and `elements'. +// +// To make an instance of the widget, you need to inherit the classes +// `KMultiFormListBoxFactory' and `KMultiFormListBoxEntry'. +// ------------------------------------------------------------------------ +#ifndef __tdemultiformlistboxmultivisble +#define __tdemultiformlistboxmultivisble + +// -------------------------------- includes ------------------------------ +#include "tdemultiformlistbox.h" +//------------------------------------------------------------------------- + +/** + @internal +*/ +class KMultiFormListBoxMultiVisible :public TQScrollView, KMultiFormListBoxShower { + +Q_OBJECT + + +friend class KMultiFormListBox; + +private: + /** + @param factory A factory used to generate the instances of KMultiFormListBoxEntry + class which is repeated in the KMultiFormListBox + @param parent A pointer to the parent widget + */ + KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *factory, TQWidget *parent = 0, const char *name = 0); + + /** + @return The elements in the KMultiFormListBox + */ + KMultiFormListBoxEntryList elements(); + void append(KMultiFormListBoxEntry *); + + TQWidget* qWidget() { return this; } + + +public slots: + + /** + This slot should be connected to a button which lets the user know that + he may get more elements in this KMultiFormListBox by pressing it. + The button should be labeled ``More Entries'' or something similar. + */ + void addElement(); // Adds an empty element to the KMultiFormListBox + + +protected slots: + + /** + When this slot is invoked then the Idx menu will be shown. + @param elm The KMultiFormListBoxEntry element where the Idx button was + pressed. This information is necessary to be able to calculate the + location where the drop down menu should be shown + */ + void showIndexList(KMultiFormListBoxEntry *elm); + +protected: + /** + Copies the element pointed to by which to the clipboard and removes it + from the interface. + This function is accessed from the class @ref CCP. + @param which A pointer to the element to cut. + */ + void cut(KMultiFormListBoxEntry *which); + + /** + Copies the element pointed to by which to the clipboard. + This function is accessed from the class @ref CCP. + @param which A pointer to the element to copied. + */ + void copy(KMultiFormListBoxEntry *which); + + /** + Paste the element from the clipboard to the KMultiFormListBox + This function is accessed from the class @ref CCP. + @param which A pointer to the KMultiFormListBoxEntry element which the + clipboard element should be inserted before,. + */ + void paste(KMultiFormListBoxEntry *which); + + /** + Inserts an empty KMultiFormListBoxEntry into the widget. + @param which A pointer to the element which the new empty widget + should be inserted before. + */ + + void addElement(KMultiFormListBoxEntry *); + + friend class CCP; + + virtual void resizeEvent(TQResizeEvent *); + void addElemBefore(KMultiFormListBoxEntry *newElm, TQWidget *existing); + void insertElmIntoWidget(KMultiFormListBoxEntry *elm, KMultiFormListBoxEntry *after); + void showWidget(KMultiFormListBoxEntry *elm); + void delElement(TQWidget *); + void delAnElement(); + void addElemBefore(KMultiFormListBoxEntry *newElm, KMultiFormListBoxEntry *existing); + void updateClipperContent(); + int countElements(WidgetList *); + + + +private: + // Instance variables + + KMultiFormListBoxFactory *factory; + WidgetList *elms; + TQPushButton *addBut; + TQByteArray clipboard; +}; + + +#endif /* tdemultiformlistboxmultivisble */ + diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-shower.h b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-shower.h new file mode 100644 index 0000000..03cec37 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-shower.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#ifndef __tdemultiformlistboxshower +#define __tdemultiformlistboxshower + +// -------------------------------- includes ------------------------------ +//------------------------------------------------------------------------- +typedef TQPtrList KMultiFormListBoxEntryList ; + +/** + Abstract class defining the interface for widgets showing a number of @ref KMultiFormListBoxEntry. + + @internal +*/ +class KMultiFormListBoxShower { + +public: + virtual KMultiFormListBoxEntryList elements() = 0; + + /** Appends the given argument to the list */ + virtual void append(KMultiFormListBoxEntry *) = 0; + + /** Return the element as a TQWidget */ + virtual TQWidget* qWidget() = 0; + + /** Adds an empty element. */ + virtual void addElement() = 0; + + /** Deletes an element at the given index. */ + virtual void delElement(TQWidget *) = 0; + + /** Deletes any element from the list */ + virtual void delAnElement() = 0; +}; + + +#endif /* tdemultiformlistboxshower */ + diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-windowed.cpp b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-windowed.cpp new file mode 100644 index 0000000..35627d6 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-windowed.cpp @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#ifdef TQT_ONLY + #include "compat.h" +#else + #include + #include + #include + #include "tdemultiformlistbox-windowed.moc" +#endif + +#include "widgetwindow.h" +#include "windowlistboxitem.h" + +KMultiFormListBoxWindowed::KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *parent, + bool showUpDownButtons, bool showHelpButton, + TQString addButtonText,const char *name) + : TQWidget( parent, name ) +{ + _layout = new TQVBoxLayout(this); + + TQHBoxLayout *innerLayout = new TQHBoxLayout(); + _layout->addLayout(innerLayout); + + _listbox = new KListBox(this,"listbox"); + _listbox->setSelectionMode(TQListBox::Single); + innerLayout->addWidget(_listbox); + + TQVBoxLayout *buttons = new TQVBoxLayout(); + innerLayout->addLayout(buttons); + + TQPushButton *but = new TQPushButton(addButtonText, this,"Add Button"); + buttons->addWidget(but,0); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(addNewElement())); + + but = new TQPushButton(i18n("Edit"), this,"Edit Button"); + buttons->addWidget(but,0); + connect(but,TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditSelected())); + connect(_listbox, TQT_SIGNAL(doubleClicked(TQListBoxItem *)), this, TQT_SLOT(slotEditSelected(TQListBoxItem *))); + _buttonList.append(but); + + but = new TQPushButton(i18n("Delete"), this, "Delete Button"); + buttons->addWidget(but,0); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteEntry())); + _buttonList.append(but); + + but = new TQPushButton(i18n("Copy"), this, "Copy Button"); + buttons->addWidget(but,0); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCopySelected())); + _buttonList.append(but); + + if (showUpDownButtons) { + but = new TQPushButton(i18n("Up"), this, "Up Button"); + buttons->addWidget(but, 0); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMoveItemUp())); + _buttonList.append(but); + + but = new TQPushButton(i18n("Down"), this, "Down Button"); + buttons->addWidget(but, 0); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMoveItemDown())); + _buttonList.append(but); + } + + if (showHelpButton) { + but = new KPushButton(KStdGuiItem::help(), this, "Help Button"); + buttons->addWidget(but, 0); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(showHelp())); + } + + buttons->addStretch(1); + _factory = factory; + slotUpdateButtonState(); + +} + +KMultiFormListBoxEntryList KMultiFormListBoxWindowed::elements() +{ + KMultiFormListBoxEntryList list; + for (unsigned int i=0; i < _listbox->count(); i++) { + WindowListboxItem *item = (WindowListboxItem *) _listbox->item(i); + list.append(item->entry()); + } + return list; +} + +void KMultiFormListBoxWindowed::delElement(TQWidget */*elm*/) +{ + // kdDebug() << "KMultiFormListBoxWindowed::delElement NOT YET IMPLEMENTED"<show(); + connect(widget, TQT_SIGNAL(finished()), this, TQT_SLOT(slotUpdateButtonState())); +} + +void KMultiFormListBoxWindowed::addElement() +{ + new WidgetWindow(_factory, _listbox); + slotUpdateButtonState(); +} + +void KMultiFormListBoxWindowed::slotEditSelected(TQListBoxItem *item) +{ + ((WindowListboxItem *) item)->displayWidget(); +} + +void KMultiFormListBoxWindowed::slotEditSelected() +{ + WindowListboxItem *item = selected(); + if (item) { + slotEditSelected(item); + } +} + +void KMultiFormListBoxWindowed::slotDeleteEntry() +{ + WindowListboxItem *item = selected(); + if (item) { + int answer = + KMessageBox::warningContinueCancel(0, i18n("Delete item \"%1\"?").arg(item->text()),i18n("Delete Item"),KStdGuiItem::del()); + if (answer == KMessageBox::Continue) { + delete item; + slotUpdateButtonState(); + } + } +} + +void KMultiFormListBoxWindowed::slotCopySelected() +{ + WindowListboxItem *item = selected(); + if (item) { + item->clone(); + } +} + +WindowListboxItem *KMultiFormListBoxWindowed::selected() +{ + int i = _listbox->currentItem(); + if (i == -1) { + return 0; + } else { + return (WindowListboxItem *) _listbox->item(i); + } +} + +void KMultiFormListBoxWindowed::slotMoveItemUp() +{ + WindowListboxItem *item = selected(); + if (item == 0) + return; + + int index = _listbox->index(item); + if (index != 0) { + _listbox->takeItem(item); + _listbox->insertItem(item, index-1); + _listbox->setCurrentItem(item); + } +} + +void KMultiFormListBoxWindowed::slotMoveItemDown() +{ + WindowListboxItem *item = selected(); + if (item == 0) + return; + + unsigned int index = _listbox->index(item); + if (index < _listbox->count()) { + _listbox->takeItem(item); + _listbox->insertItem(item, index+1); + _listbox->setCurrentItem(item); + } +} + +void KMultiFormListBoxWindowed::slotUpdateButtonState() +{ + bool on = (_listbox->count() != 0); + for (unsigned int i=0; i<_buttonList.count(); i++) { + _buttonList.at(i)->setEnabled(on); + } +} diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-windowed.h b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-windowed.h new file mode 100644 index 0000000..b2c0484 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox-windowed.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#ifndef __tdemultiformlistboxwindowed +#define __tdemultiformlistboxwindowed + +#ifdef TQT_ONLY + #include "compat.h" + #include +#else + #include +#endif + +#include "tdemultiformlistboxfactory.h" +#include "tdemultiformlistbox.h" +class WindowListboxItem; + + +/** + This class implements the windowed look for a @ref KMultiFormListBox + + @internal +*/ +class KMultiFormListBoxWindowed :public TQWidget, KMultiFormListBoxShower { + +Q_OBJECT + + +friend class KMultiFormListBox; + +private: + KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *parent, + bool showUpDownButtons, bool showHelpButton, TQString addButtonText, + const char *name); + + KMultiFormListBoxEntryList elements(); + const KMultiFormListBoxEntryList elements() const; + void append(KMultiFormListBoxEntry *); + WindowListboxItem *selected(); + TQWidget* qWidget() { return this; } + + TQVBoxLayout* _layout; + KMultiFormListBoxFactory* _factory; + TQPtrList _buttonList; + KListBox* _listbox; + virtual void delElement(TQWidget *); // Deletes the given element + virtual void delAnElement(); + void addElement(); + + +public slots: + void addNewElement(); + +signals: + void showHelp(); + +private slots: + void slotEditSelected(); + void slotEditSelected(TQListBoxItem *item); + void slotCopySelected(); + void slotMoveItemUp(); + void slotMoveItemDown(); + void slotDeleteEntry(); + void slotUpdateButtonState(); + +}; + + +#endif /* tdemultiformlistboxwindowed */ + diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistbox.cpp b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox.cpp new file mode 100644 index 0000000..33eda27 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox.cpp @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#ifndef TQT_ONLY + #include "tdemultiformlistbox.moc" +#endif + +#include "tdemultiformlistbox-multivisible.h" +#include "tdemultiformlistbox-windowed.h" + +KMultiFormListBox::KMultiFormListBox( KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp, TQWidget *parent, + bool showUpDownButtons, bool showHelpButton, TQString addButtonText, + const char *name ) : TQWidget( parent, name ) +{ + switch ( tp ) { + + case MultiVisible: + theWidget = new KMultiFormListBoxMultiVisible( factory, this, "KMultiFormListBox Widget" ); + break; + + case Windowed: + theWidget = new KMultiFormListBoxWindowed( factory, this, showUpDownButtons, + showHelpButton, addButtonText, "KMultiFormListBox Widget" ); + break; + } + + TQWidget *widget = theWidget->qWidget(); + + TQHBoxLayout *layout = new TQHBoxLayout( this ); + _factory = factory; + layout->addWidget( widget ); +} + +void KMultiFormListBox::append( KMultiFormListBoxEntry *element ) +{ + theWidget->append( element ); +} + +void KMultiFormListBox::addElement() +{ + theWidget->addElement(); +} + +KMultiFormListBoxEntryList KMultiFormListBox::elements() +{ + return theWidget->elements(); +} + +const KMultiFormListBoxEntryList KMultiFormListBox::elements() const +{ + return const_cast(this)->elements(); +} + +void KMultiFormListBox::slotChangeFace( KMultiFormListBoxType /*newFace*/ ) +{ + // TODO + // kdDebug() << "It's not possible yet to change the face on the fly." << endl + // << "Please let me (blackie@kde.org) know that you need it, and I'll work on it" << endl; +} + +void KMultiFormListBox::toStream( TQDataStream& stream ) const +{ + const KMultiFormListBoxEntryList elms = elements(); + stream << elms.count(); + for ( TQPtrListIterator it(elms); *it; ++it) + _factory->toStream( TQT_TQOBJECT(*it), stream ); +} + +void KMultiFormListBox::fromStream( TQDataStream& stream ) +{ + unsigned int fromCount, toCount; + stream >> fromCount; + + toCount = elements().count(); + + // adds/remove elements in the to list, to make it have the correct length. + for (unsigned int j=toCount; j< fromCount; ++j) { + addElement(); + } + for (unsigned int k=fromCount; k < toCount; ++k) { + theWidget->delAnElement(); + } + + KMultiFormListBoxEntryList elms = elements(); + for (TQPtrListIterator it(elms); *it; ++it) + _factory->fromStream( stream, TQT_TQOBJECT(*it) ); +} + + + diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistbox.h b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox.h new file mode 100644 index 0000000..1151581 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistbox.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#ifndef __tdemultiformlistbox +#define __tdemultiformlistbox + +#include "tdemultiformlistboxfactory.h" +#include "tdemultiformlistbox-shower.h" +#include "tdemultiformlistboxentry.h" +#include +#include +#include + +#ifdef TQT_ONLY + #include "compat.h" +#else + #include +#endif + +class TQDataStream; + + +typedef TQPtrList KMultiFormListBoxEntryList ; +typedef TQPtrList WidgetList; +class KMultiFormListBoxMultiVisible; + +/** + The main class used to get an KMultiFormListBox widget. + + The KMultiFormListBox widget consist of a sub-widget which is repeated a + number of times, it is up to the end user to determine the number of times + the sub widget is repeated, and he may require an additional copy simply + by pressing a ``Add'' or ``More Entries'' button. The KMultiFormListBox + widget has two different faces (i.e. two different end user + interfaces). One (Windowed) will show a listbox from which the end user + can access each subwidget containing data by pressing the LMB on a name + for the element. The other face (MultiVisible) shows all the subwidgets in + one huge ``Listbox''. + + To use the KMultiFormListBox widget you must create a class which is inherited + from the @ref KMultiFormListBoxFactory class. This new class must override the + function `create'. This function must return a freshly made instance of + the class @ref KMultiFormListBoxEntry (or a subclass of this). The KMultiFormListBoxEntry + instance is the one inserted into the KMultiFormListBox widget (one instance for + each sub widget in the KMultiFormListBox widget). + + @author Jesper Kjr Pedersen + **/ +class KMultiFormListBox : public TQWidget { + +Q_OBJECT + + +public: + + enum KMultiFormListBoxType {MultiVisible, Windowed}; + + /** + @param factory A factory used to generate the instances of + KMultiFormListBoxEntry class which is repeated in the KMultiFormListBox + @param parent A pointer to the parent widget + **/ + KMultiFormListBox(KMultiFormListBoxFactory *factory, + KMultiFormListBoxType tp=Windowed, + TQWidget *parent = 0, bool showUpDownButtons = true, + bool showHelpButton = true, TQString addButtonText = i18n("Add"), + const char *name = 0); + + /** + @return The elements in the KMultiFormListBox. + **/ + KMultiFormListBoxEntryList elements(); + const KMultiFormListBoxEntryList elements() const; + + /** + TODO. + **/ + void append(KMultiFormListBoxEntry *); + + /** write data out to stream */ + void toStream( TQDataStream& stream ) const; + + /** reads data in from stream */ + void fromStream( TQDataStream& stream ); + +public slots: + + /** + Adds an empty element to the KMultiFormListBox. + + This slot is only required for the @ref MultiVisible face. It should + be connected to a button which lets the user know that he may get more + elements in this KMultiFormListBox by pressing it. The button should + be labeled ``More Entries'' or something similar. + **/ + void addElement(); // Adds an empty element to the KMultiFormListBox + + /** + Changes the face of the KMultiFormListBox. + @param face The new face of the KMultiFormListBox + **/ + void slotChangeFace(KMultiFormListBoxType newFace); + +private: + KMultiFormListBoxShower *theWidget; + KMultiFormListBoxFactory *_factory; + +}; + + +#endif /* tdemultiformlistbox */ + diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistboxentry.cpp b/kregexpeditor/KMultiFormListBox/tdemultiformlistboxentry.cpp new file mode 100644 index 0000000..ee3e5c5 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistboxentry.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ + +#ifndef TQT_ONLY + #include "tdemultiformlistboxentry.moc" +#endif + +#include "tdemultiformlistboxentry.h" +//---------------------------------------------------------------------- +// This function is needed to signal which of the KMultiFormListBox entries +// the Idx button was invoked from. +//---------------------------------------------------------------------- +void KMultiFormListBoxEntry::acceptIndexButton() +{ + emit gotoIndex(this); +} + + +void KMultiFormListBoxEntry::indexWindowPos(TQPoint *start, int *width) +{ + // Calculate the position of the value widgets left-buttom border + TQPoint global_point = valueWidget()->mapToGlobal(TQPoint(0,0)); + start->setX(global_point.x()); + start->setY(global_point.y() + valueWidget()->height()); + + // Calculate the width of the list. + global_point = indexButton()->mapToGlobal(TQPoint(0,0)); + *width = global_point.x() + indexButton()->width() - start->x(); +} diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistboxentry.h b/kregexpeditor/KMultiFormListBox/tdemultiformlistboxentry.h new file mode 100644 index 0000000..957f3ab --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistboxentry.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#ifndef __tdemultiformlistboxentry +#define __tdemultiformlistboxentry + +#include +#include +#include + +/** + This widget must be the base class for an entry widget used in the @ref + KMultiFormListBox class. It is necessary for you to inherit this class to get any + information attached to the elements in the KMultiFormListBox. + + The KMultiFormListBox widget features a fast scrolling mechanism through the Idx + button. If you want to use this in you KMultiFormListBox, then you must do the + following: + @li Create a @ref TQPushButton as a sub-widget to your KMultiFormListBoxEntry. + @li Override the @ref indexButton method to return your TQPushButton + @li Override the @ref idxString to return a @ref TQString + with a textual representation of the content in this KMultiFormListBoxEntry. This + string will be used in the drop-down box which the user gets when he + presses the Idx button. + @li The drop down window must be aligned horizontal to some widget + (which should be next to the Idx button, to ensure a good looking GUI. The + position of the drop down widget may be specified in two ways: (1) + override the @ref valueWidget method to return a widget, to align with + (that is the upper right corner of the drop down window will be the + same as the lower right corner of this widget) or (2) override the @ref + indexWindowPos method to return a start point for the drop down window and + a width. + **/ +class KMultiFormListBoxEntry : public TQWidget +{ + Q_OBJECT + + +public: + KMultiFormListBoxEntry(TQWidget *parent, const char *name) : TQWidget(parent,name) {} + + virtual TQPushButton *indexButton() { return 0; } + virtual TQWidget *valueWidget() { return 0; } + + virtual void indexWindowPos(TQPoint *start, int *width); // both variables are return values. + + // This function must return a string representing the KMultiFormListBox. This is + // used when showing the fast-search menu available from the `Idx' button. + virtual TQString idxString() { return TQString::fromLatin1(""); } + +public slots: + void acceptIndexButton(); + +signals: + void gotoIndex(KMultiFormListBoxEntry *); + +}; + +#endif /* tdemultiformlistboxentry */ + diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistboxfactory.cpp b/kregexpeditor/KMultiFormListBox/tdemultiformlistboxfactory.cpp new file mode 100644 index 0000000..d4414cf --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistboxfactory.cpp @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#include "tdemultiformlistboxfactory.h" +#include + +TQWidget *KMultiFormListBoxFactory::separator(TQWidget *parent) { + TQFrame* sep = new TQFrame( parent ); + sep->setFrameStyle( TQFrame::HLine | TQFrame::Sunken); + sep->setLineWidth(1); + return sep; +} diff --git a/kregexpeditor/KMultiFormListBox/tdemultiformlistboxfactory.h b/kregexpeditor/KMultiFormListBox/tdemultiformlistboxfactory.h new file mode 100644 index 0000000..314c0e0 --- /dev/null +++ b/kregexpeditor/KMultiFormListBox/tdemultiformlistboxfactory.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +// -------------------------------- includes ------------------------------ +#ifndef __tdemultiformlistboxfactory +#define __tdemultiformlistboxfactory +#include +#include "kwidgetstreamer.h" +class KMultiFormListBoxEntry; +//------------------------------------------------------------------------- + + +/** + Factory use to generate elements for the @ref KMultiFormListBox widget. + + To use an @ref KMultiFormListBox, one must inherit from the class KMultiFormListBoxFactory + and override the method @ref create. This method must return an empty + element for the KMultiFormListBox (that is an @ref KMultiFormListBoxEntry or a subclass of + it). + + If you dislike the default separator between each of the elements or + simply do not want a separator in the KMultiFormListBox, then you may override + the method @ref separator. +**/ +class KMultiFormListBoxFactory : public KWidgetStreamer +{ +public: + virtual ~KMultiFormListBoxFactory() {} + + /** + This method must be overridden in subclasses and must return an + ``empty'' instance of the @ref KMultiFormListBoxEntry class, or perhaps rather + a subclass of this class. This instance will be owned by the caller of + this function. + + @param parent A pointer to the parent of this KMultiFormListBoxEntry widget + returned. + @return A fresh @ref KMultiFormListBoxEntry to be used in an instance of the + @ref KMultiFormListBox class. + **/ + virtual KMultiFormListBoxEntry *create(TQWidget *parent) = 0; + + /** + This method is used to get a separator between the elements in an @ref + KMultiFormListBox. The widget returned from this method will be owned by the + caller. + + @param parent A pointer to the parent of the TQWidget returned. + @return A widget which must be used as a separator between the @ref + KMultiFormListBoxEntry elements in an @ref KMultiFormListBox. + **/ + virtual TQWidget *separator(TQWidget *parent); +}; + +#endif /* tdemultiformlistbox */ + diff --git a/kregexpeditor/KMultiFormListBox/widgetwindow.h b/kregexpeditor/KMultiFormListBox/widgetwindow.h index eea6500..2312653 100644 --- a/kregexpeditor/KMultiFormListBox/widgetwindow.h +++ b/kregexpeditor/KMultiFormListBox/widgetwindow.h @@ -26,7 +26,7 @@ #include #endif -#include "kmultiformlistbox-windowed.h" +#include "tdemultiformlistbox-windowed.h" /** @internal diff --git a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp index 04ee2a6..721257c 100644 --- a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp +++ b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ #include "kwidgetstreamer.h" -#include "kmultiformlistbox.h" +#include "tdemultiformlistbox.h" #include #include diff --git a/kregexpeditor/Makefile.am b/kregexpeditor/Makefile.am index 916ef42..22460b6 100644 --- a/kregexpeditor/Makefile.am +++ b/kregexpeditor/Makefile.am @@ -28,7 +28,7 @@ libkregexpeditorcommon_la_SOURCES = \ emacsregexpconverter.cpp regexphighlighter.cpp util.cpp libkregexpeditorcommon_la_LDFLAGS = $(all_libraries) -version-info 1:0:0 -no-undefined -libkregexpeditorcommon_la_LIBADD = KMultiFormListBox/libkmultiformlistbox.la \ +libkregexpeditorcommon_la_LIBADD = KMultiFormListBox/libtdemultiformlistbox.la \ KWidgetStreamer/libkwidgetstreamer.la $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) METASOURCES = AUTO @@ -46,7 +46,7 @@ libkregexpeditorgui_la_LIBADD = libkregexpeditorcommon.la bin_PROGRAMS = kregexpeditor kregexpeditor_SOURCES = main.cpp -kregexpeditor_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kregexpeditor_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kregexpeditor_LDADD = libkregexpeditorcommon.la $(LIB_KIO) kregexpeditor_INCLUDES = $(all_includes) diff --git a/kregexpeditor/characterswidget.h b/kregexpeditor/characterswidget.h index 8100f0a..1450d97 100644 --- a/kregexpeditor/characterswidget.h +++ b/kregexpeditor/characterswidget.h @@ -24,7 +24,7 @@ #include #endif -#include +#include #include "regexpwidget.h" #include diff --git a/kregexpeditor/qt-only/qt-only.pro b/kregexpeditor/qt-only/qt-only.pro index 9af8b97..536c98b 100644 --- a/kregexpeditor/qt-only/qt-only.pro +++ b/kregexpeditor/qt-only/qt-only.pro @@ -31,12 +31,12 @@ HEADERS += altnregexp.h \ gen_qregexpparser.hh \ indexWindow.h \ infopage.h \ - kmultiformlistbox-multivisible.h \ - kmultiformlistbox-shower.h \ - kmultiformlistbox-windowed.h \ - kmultiformlistbox.h \ - kmultiformlistboxentry.h \ - kmultiformlistboxfactory.h \ + tdemultiformlistbox-multivisible.h \ + tdemultiformlistbox-shower.h \ + tdemultiformlistbox-windowed.h \ + tdemultiformlistbox.h \ + tdemultiformlistboxentry.h \ + tdemultiformlistboxfactory.h \ kregexpeditorgui.h \ kregexpeditorprivate.h \ kwidgetstreamer.h \ @@ -96,11 +96,11 @@ SOURCES += altnregexp.cpp \ gen_qregexplexer.cpp \ indexWindow.cpp \ infopage.cpp \ - kmultiformlistbox-multivisible.cpp \ - kmultiformlistbox-windowed.cpp \ - kmultiformlistbox.cpp \ - kmultiformlistboxentry.cpp \ - kmultiformlistboxfactory.cpp \ + tdemultiformlistbox-multivisible.cpp \ + tdemultiformlistbox-windowed.cpp \ + tdemultiformlistbox.cpp \ + tdemultiformlistboxentry.cpp \ + tdemultiformlistboxfactory.cpp \ kregexpeditorgui.cpp \ kregexpeditorprivate.cpp \ kwidgetstreamer.cpp \ diff --git a/ktimer/Makefile.am b/ktimer/Makefile.am index ad3d47d..9778bc7 100644 --- a/ktimer/Makefile.am +++ b/ktimer/Makefile.am @@ -1,5 +1,5 @@ INCLUDES = $(all_includes) -AM_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +AM_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor LDADD = $(LIB_TDEUI) $(LIB_KFILE) bin_PROGRAMS = ktimer diff --git a/kwallet/CMakeLists.txt b/kwallet/CMakeLists.txt deleted file mode 100644 index ce23468..0000000 --- a/kwallet/CMakeLists.txt +++ /dev/null @@ -1,55 +0,0 @@ -################################################# -# -# (C) 2012 Golubev Alexander -# fatzer2 (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( icons ) -add_subdirectory( konfigurator ) - -include_directories( - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### kwalletmanager (executable) ############### - -tde_add_executable( kwalletmanager AUTOMOC - SOURCES walletwidget.ui kwalletmanager.cpp - kwalletmanager.skel main.cpp kwalletpopup.cpp - kwalleteditor.cpp kwmapeditor.cpp - allyourbase.cpp kbetterthankdialogbase.ui - LINK kio-shared - DESTINATION ${BIN_INSTALL_DIR} -) - - -##### icons ##################################### - -tde_install_icons( kwalletmanager) - - -##### other data ################################ - -install( FILES kwalletmanager.rc kwalleteditor.rc - DESTINATION ${DATA_INSTALL_DIR}/kwalletmanager -) - -install( FILES kwalletmanager.desktop - kwalletmanager-kwalletd.desktop - DESTINATION ${XDG_APPS_INSTALL_DIR} -) - diff --git a/kwallet/Makefile.am b/kwallet/Makefile.am deleted file mode 100644 index 2c451ca..0000000 --- a/kwallet/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -INCLUDES= $(all_includes) - -SUBDIRS=. icons konfigurator - -bin_PROGRAMS = kwalletmanager -kwalletmanager_SOURCES = walletwidget.ui kwalletmanager.cpp \ - kwalletmanager.skel main.cpp kwalletpopup.cpp \ - kwalleteditor.cpp kwmapeditor.cpp allyourbase.cpp \ - kbetterthankdialogbase.ui -kwalletmanager_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -kwalletmanager_LDADD = $(LIB_KIO) -lkwalletclient -METASOURCES = AUTO -noinst_HEADERS = kwalletmanager.h kwalletpopup.h walletwidget.h kwalleteditor.h\ - allyourbase.h kwmapeditor.h - -xdg_apps_DATA = kwalletmanager.desktop kwalletmanager-kwalletd.desktop - -KDE_ICON = kwalletmanager - -rc_DATA = kwalletmanager.rc kwalleteditor.rc -rcdir = $(kde_datadir)/kwalletmanager - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kwalletmanager.pot - -kbetterthankdialogbase.lo: kbetterthankdialogbase.ui kbetterthankdialogbase.ui.h diff --git a/kwallet/TODO b/kwallet/TODO deleted file mode 100644 index 145fa7b..0000000 --- a/kwallet/TODO +++ /dev/null @@ -1,13 +0,0 @@ -Things left: - -Backend: -- test 64 bit, zSeries -- refactor the hashes to make it efficient - -Integration: -- Cookie jar -- KMail - -Future ideas: -- Make it a kpart - diff --git a/kwallet/allyourbase.cpp b/kwallet/allyourbase.cpp deleted file mode 100644 index b75a04f..0000000 --- a/kwallet/allyourbase.cpp +++ /dev/null @@ -1,733 +0,0 @@ -/* - Copyright (C) 2003-2005 George Staikos - Copyright (C) 2005 Isaac Clerencia - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "allyourbase.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/**************** - * KWalletFolderItem - ListView items to represent kwallet folders - */ -KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, TQListView* parent, const TQString &name, int entries) -: KListViewItem(parent),_wallet(w),_name(name),_entries(entries) { - setText(0, TQString("%1 (%2)").arg(_name).arg(_entries)); - setRenameEnabled(0, false); - setDragEnabled(true); - setDropEnabled(true); - - TQPixmap pix = getFolderIcon(KIcon::Small); - - setPixmap(0,pix); -} - -TQPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){ - KIconLoader *loader = TDEGlobal::instance()->iconLoader(); - TQPixmap pix = loader->loadIcon( _name, group, 0, - KIcon::DefaultState, 0, true ); - if (pix.isNull()) - pix = loader->loadIcon( _name.lower(), group, 0, - KIcon::DefaultState, 0, true); - if (pix.isNull()) - pix = loader->loadIcon( "folder_red", group, 0, - KIcon::DefaultState, 0, true); - return pix; -} - -void KWalletFolderItem::refresh() { - TQString saveFolder = _wallet->currentFolder(); - _wallet->setFolder(_name); - setText(0, TQString("%1 (%2)").arg(_name).arg(_wallet->entryList().count())); - _wallet->setFolder(saveFolder); -} - -KWalletContainerItem* KWalletFolderItem::getContainer(KWallet::Wallet::EntryType type) { - for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { - KWalletContainerItem *ci = dynamic_cast(i); - if (!ci) { - continue; - } - if (ci->type() == type) { - return ci; - } - } - return 0; -} - -bool KWalletFolderItem::contains(const TQString& key) { - return (getItem(key) != 0); -} - -TQListViewItem* KWalletFolderItem::getItem(const TQString& key) { - for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { - KWalletContainerItem *ci = dynamic_cast(i); - if (!ci) { - continue; - } - TQListViewItem *tmp = ci->getItem(key); - if (tmp) { - return tmp; - } - } - return 0; -} - -bool KWalletFolderItem::acceptDrop(const TQMimeSource *mime) const { - return mime->provides("application/x-kwallet-entry") || - mime->provides("text/uri-list"); -} - -int KWalletFolderItem::rtti() const { - return KWalletFolderItemClass; -} - -TQString KWalletFolderItem::name() const { - return _name; -} - -KWalletFolderItem::~KWalletFolderItem() { -} - -/**************** - * KWalletContainerItem - ListView items to represent kwallet containers, i.e. - * passwords, maps, ... - */ -KWalletContainerItem::KWalletContainerItem(TQListViewItem* parent, const TQString &name, KWallet::Wallet::EntryType type) -: KListViewItem(parent, name), _type(type) { - setRenameEnabled(0, false); - setDragEnabled(true); -} - -KWalletContainerItem::~KWalletContainerItem() { -} - -int KWalletContainerItem::rtti() const { - return KWalletContainerItemClass; -} - -KWallet::Wallet::EntryType KWalletContainerItem::type() { - return _type; -} - -bool KWalletContainerItem::contains(const TQString& key) { - return getItem(key) != 0; -} - -TQListViewItem *KWalletContainerItem::getItem(const TQString& key) { - for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { - if (i->text(0) == key) { - return i; - } - } - return 0; -} - -/**************** - * KWalletEntryItem - ListView items to represent kwallet entries - */ -KWalletEntryItem::KWalletEntryItem(KWallet::Wallet *w, TQListViewItem* parent, const TQString& ename) -: KListViewItem(parent, ename), _wallet(w), _oldName(ename) { - setRenameEnabled(0, true); - setDragEnabled(true); -} - -int KWalletEntryItem::rtti() const { - return KWalletEntryItemClass; -} - -KWalletEntryItem::~KWalletEntryItem() { -} - -/**************** - * KWalletItem - IconView items to represent wallets - */ -KWalletItem::KWalletItem(TQIconView *parent, const TQString& walletName) -: TQIconViewItem(parent, walletName, DesktopIcon("kwalletmanager")) { -} - -KWalletItem::~KWalletItem() { -} - -bool KWalletItem::acceptDrop(const TQMimeSource *mime) const { - return mime->provides("application/x-kwallet-folder") || - mime->provides("text/uri-list"); -} - -static bool decodeEntry(KWallet::Wallet *_wallet, TQDataStream& ds) { - TQ_UINT32 magic; - ds >> magic; - if (magic != KWALLETENTRYMAGIC) { - kdDebug() << "bad magic" << endl; - return false; - } - TQString name; - TQByteArray value; - KWallet::Wallet::EntryType et; - ds >> name; - if (_wallet->hasEntry(name)) { - int rc = KMessageBox::warningContinueCancel(0L, i18n("An entry by the name '%1' already exists. Would you like to continue?").arg(name)); - if (rc == KMessageBox::Cancel) { - return false; - } - } - long l; - ds >> l; - et = KWallet::Wallet::EntryType(l); - ds >> value; - _wallet->writeEntry(name, value, et); - return true; -} - -static bool decodeFolder(KWallet::Wallet *_wallet, TQDataStream& ds) { - TQ_UINT32 magic; - ds >> magic; - if (magic != KWALLETFOLDERMAGIC) { - kdDebug() << "bad magic" << endl; - return false; - } - TQString folder; - ds >> folder; - if (_wallet->hasFolder(folder)) { - int rc = KMessageBox::warningYesNoCancel(0L, i18n("A folder by the name '%1' already exists. What would you like to do?").arg(folder), TQString(), KStdGuiItem::cont(), i18n("Replace")); - if (rc == KMessageBox::Cancel) { - return false; - } - if (rc == KMessageBox::No) { - _wallet->removeFolder(folder); - _wallet->createFolder(folder); - } - } else { - _wallet->createFolder(folder); - } - - _wallet->setFolder(folder); - while (!ds.atEnd()) { - TQString name; - TQByteArray value; - KWallet::Wallet::EntryType et; - ds >> name; - long l; - ds >> l; - et = KWallet::Wallet::EntryType(l); - ds >> value; - _wallet->writeEntry(name, value, et); - } - return true; -} - -void KWalletItem::dropped(TQDropEvent *e, const TQValueList& lst) { - Q_UNUSED(lst); - if (e->provides("application/x-kwallet-folder") || - e->provides("text/uri-list")) { - - // FIXME: don't allow the drop if the wallet name is the same - - KWallet::Wallet *_wallet = KWallet::Wallet::openWallet(text()); - if (!_wallet) { - e->ignore(); - return; - } - - TQString saveFolder = _wallet->currentFolder(); - - TQFile file; - TQDataStream *ds = 0L; - - if (e->provides("application/x-kwallet-folder")) { - TQByteArray edata = e->encodedData("application/x-kwallet-folder"); - if (!edata.isEmpty()) { - ds = new TQDataStream(edata, IO_ReadOnly); - } - } else { // text/uri-list - TQStrList urls; - TQUriDrag::decode(e, urls); - - if (urls.isEmpty()) { - e->ignore(); - return; - } - - KURL u(urls.first()); - if (u.fileName().isEmpty()) { - e->ignore(); - return; - } - TQString tmpFile; - if (TDEIO::NetAccess::download(u, tmpFile, 0L)) { - file.setName(tmpFile); - file.open(IO_ReadOnly); - ds = new TQDataStream(&file); - TDEIO::NetAccess::removeTempFile(tmpFile); - } else { - KMessageBox::error(iconView(), TDEIO::NetAccess::lastErrorString()); - } - } - if (ds) { - decodeFolder(_wallet, *ds); - delete ds; - } - _wallet->setFolder(saveFolder); - delete _wallet; - - //delete the folder from the source if we were moving - TQt::ButtonState state = kapp->keyboardMouseState(); - if (e->source() && e->source()->parent() && - !strcmp(e->source()->parent()->className(), "KWalletEntryList") && - !(state & TQt::ControlButton)) { - - KWalletEntryList *el = - dynamic_cast(e->source()->parent()); - if (el) { - KWalletFolderItem *fi = - dynamic_cast(el->selectedItem()); - if (fi) { - el->_wallet->removeFolder(fi->name()); - } - } - } - e->accept(); - } else { - e->ignore(); - return; - } -} - -/**************** - * KWalletEntryDrag - Stores data for wallet entry drags - */ -class KWalletEntryDrag : public TQStoredDrag { - public: - KWalletEntryDrag(TQWidget *dragSource, const char *name = 0L) - : TQStoredDrag("application/x-kwallet-entry", dragSource, name) { - } - - virtual ~KWalletEntryDrag() {} -}; - -/**************** - * KWalletFolderDrag - Stores data for wallet folder drags - */ -class KWalletFolderDrag : public TQStoredDrag { - public: - KWalletFolderDrag(TQWidget *dragSource, const char *name = 0L) - : TQStoredDrag("application/x-kwallet-folder", dragSource, name) { - } - - virtual ~KWalletFolderDrag() {} -}; - -/**************** - * KWalletEntryList - A listview to store wallet entries - */ -KWalletEntryList::KWalletEntryList(TQWidget *parent, const char *name) -: KListView(parent, name) { - addColumn(i18n("Folders")); - setRootIsDecorated(true); - setDefaultRenameAction(Reject); - setAcceptDrops(true); - setItemsMovable(false); - setDropVisualizer(false); - viewport()->setAcceptDrops(true); -} - -KWalletEntryList::~KWalletEntryList() { -} - -bool KWalletEntryList::acceptDrag(TQDropEvent* e) const { - TQListViewItem *i = itemAt(contentsToViewport(e->pos())); - if (i) { - if (e->provides("application/x-kwallet-entry") || - e->provides("text/uri-list")) { - return true; - } - } - if ((e->provides("application/x-kwallet-folder") && - e->source() != viewport()) || - e->provides("text/uri-list")) { - return true; - } - return false; -} - -//returns true if the item has been dropped successfully -void KWalletEntryList::itemDropped(TQDropEvent *e, TQListViewItem *item) { - bool ok = true; - bool isEntry; - TQFile file; - TQDataStream *ds; - - KWalletEntryList *el = 0L; - TQListViewItem *sel = 0L; - - //detect if we are dragging from kwallet itself - if (e->source() && e->source()->parent() && - !strcmp(e->source()->parent()->className(), "KWalletEntryList")) { - - el = dynamic_cast(e->source()->parent()); - if (!el) { - KMessageBox::error(this, i18n("An unexpected error occurred trying to drop the item")); - } else - sel = el->selectedItem(); - } - - if (e->provides("application/x-kwallet-entry")) { - //do nothing if we are in the same folder - if (sel && sel->parent()->parent() == - KWalletEntryList::getItemFolder(item)) { - e->ignore(); - return; - } - isEntry = true; - TQByteArray data = e->encodedData("application/x-kwallet-entry"); - if (data.isEmpty()) { - e->ignore(); - return; - } - ds = new TQDataStream(data, IO_ReadOnly); - } else if (e->provides("application/x-kwallet-folder")) { - //do nothing if we are in the same wallet - if (this == el) { - e->ignore(); - return; - } - isEntry = false; - TQByteArray data = e->encodedData("application/x-kwallet-folder"); - if (data.isEmpty()) { - e->ignore(); - return; - } - ds = new TQDataStream(data, IO_ReadOnly); - } else if (e->provides("text/uri-list")) { - TQStrList urls; - TQUriDrag::decode(e, urls); - if (urls.isEmpty()) { - e->ignore(); - return; - } - KURL u(urls.first()); - if (u.fileName().isEmpty()) { - e->ignore(); - return; - } - TQString tmpFile; - if (TDEIO::NetAccess::download(u, tmpFile, 0L)) { - file.setName(tmpFile); - file.open(IO_ReadOnly); - ds = new TQDataStream(&file); - //check magic to discover mime type - TQ_UINT32 magic; - (*ds) >> magic; - if (magic == KWALLETENTRYMAGIC) { - isEntry = true; - } else if (magic == KWALLETFOLDERMAGIC) { - isEntry = false; - } else { - kdDebug() << "bad magic" << endl; - e->ignore(); - return; - } - delete ds; - //set the file back to the beginning - file.reset(); - ds = new TQDataStream(&file); - TDEIO::NetAccess::removeTempFile(tmpFile); - } else { - KMessageBox::error(this, TDEIO::NetAccess::lastErrorString()); - return; - } - } else { - e->ignore(); - return; - } - TQt::ButtonState state = kapp->keyboardMouseState(); - if (isEntry) { - if (!item) { - e->ignore(); - return; - } - KWalletFolderItem *fi = KWalletEntryList::getItemFolder(item); - if (!fi) { - KMessageBox::error(this, i18n("An unexpected error occurred trying to drop the entry")); - delete(ds); - e->accept(); - return; - } - TQString saveFolder = _wallet->currentFolder(); - _wallet->setFolder(fi->name()); - ok = decodeEntry(_wallet, *ds); - _wallet->setFolder(saveFolder); - fi->refresh(); - delete(ds); - //delete source if we were moving, i.e., we are dragging - //from kwalletmanager and Control is not pressed - if (ok && el && !(state & TQt::ControlButton) && sel) { - el->_wallet->removeEntry(sel->text(0)); - delete sel; - } - e->accept(); - } else { - ok = decodeFolder(_wallet, *ds); - delete ds; - //delete source if we were moving, i.e., we are dragging - //from kwalletmanager and Control is not pressed - if (ok && el && !(state & TQt::ControlButton) && sel) { - KWalletFolderItem *fi = dynamic_cast(sel); - if (fi) { - el->_wallet->removeFolder(fi->name()); - delete sel; - } else { - KMessageBox::error(this, i18n("An unexpected error occurred trying to delete the original folder, but the folder has been copied successfully")); - } - } - e->accept(); - } -} - -void KWalletEntryList::setWallet(KWallet::Wallet *w) { - _wallet = w; -} - -bool KWalletEntryList::existsFolder(const TQString& name) { - for (TQListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { - KWalletFolderItem *fi = dynamic_cast(vi); - if (!fi) { - continue; - } - if (name == fi->name()) { - return true; - } - } - return false; -} - -void KWalletEntryList::contentsDropEvent(TQDropEvent *e) { - TQListViewItem *i = itemAt(contentsToViewport(e->pos())); - itemDropped(e, i); -} - -void KWalletEntryList::contentsDragEnterEvent(TQDragEnterEvent *e) { - if (e->provides("application/x-kwallet-entry") || - e->provides("application/x-kwallet-folder") || - e->provides("application/uri-list")) { - e->accept(); - } else { - e->ignore(); - } -} - -KWalletFolderItem* KWalletEntryList::getFolder(const TQString& name) { - for (TQListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { - KWalletFolderItem *fi = dynamic_cast(vi); - if (!fi) { - continue; - } - if (name == fi->name()) { - return fi; - } - } - return 0; -} - -KWalletFolderItem *KWalletEntryList::getItemFolder(TQListViewItem *item) { - switch (item->rtti()) { - case KWalletFolderItemClass: - return dynamic_cast(item); - case KWalletContainerItemClass: - return dynamic_cast(item->parent()); - case KWalletEntryItemClass: - return dynamic_cast(item->parent()->parent()); - } - return 0; -} - -/**************** - * KWalletIconDrag - Stores the data for wallet drags - */ -class KWalletIconDrag : public TQIconDrag { - public: - KWalletIconDrag(TQWidget *dragSource, const char *name = 0L) - : TQIconDrag(dragSource, name) { - } - - virtual ~KWalletIconDrag() {} - - virtual const char *format(int i = 0) const { - if (i == 0) { - return "application/x-qiconlist"; - } else if (i == 1) { - return "text/uri-list"; - } - return 0L; - } - - TQByteArray encodedData(const char *mime) const { - TQByteArray a; - TQCString mimetype(mime); - if (mimetype == "application/x-qiconlist") { - return TQIconDrag::encodedData(mime); - } else if (mimetype == "text/uri-list") { - TQCString s = _urls.join("\r\n").latin1(); - if (_urls.count() > 0) { - s.append("\r\n"); - } - a.resize(s.length() + 1); - memcpy(a.data(), s.data(), s.length() + 1); - } - return a; - } - - void append(const TQIconDragItem &item, const TQRect &pr, - const TQRect &tr, const TQString &url) { - TQIconDrag::append(item, pr, tr); - _urls.append(url); - } - - private: - TQStringList _urls; -}; - -/**************** -* * KWalletIconView - An iconview to store wallets -* */ -KWalletIconView::KWalletIconView(TQWidget *parent, const char *name) -: KIconView(parent, name) { - TDEGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); - connect(this, TQT_SIGNAL(dropped(TQDropEvent*, const TQValueList&)), TQT_SLOT(slotDropped(TQDropEvent*, const TQValueList&))); -} - -KWalletIconView::~KWalletIconView() { -} - -void KWalletIconView::slotDropped(TQDropEvent *e, const TQValueList& /*lst*/) { - if (e->source() == viewport()) { - e->ignore(); - return; - } - - if (!e->provides("text/uri-list")) { - e->ignore(); - return; - } - - TQByteArray edata = e->encodedData("text/uri-list"); - TQCString urls = edata.data(); - - TQStringList ul = TQStringList::split("\r\n", urls); - if (ul.isEmpty() || ul.first().isEmpty()) { - e->ignore(); - return; - } - - KURL u(ul.first()); - - if (u.fileName().isEmpty()) { - e->ignore(); - return; - } - - TQString dest = TDEGlobal::dirs()->saveLocation("kwallet") + u.fileName(); - if (TQFile::exists(dest)) { - KMessageBox::sorry(viewport(), i18n("That wallet file already exists. You cannot overwrite wallets.")); - e->ignore(); - return; - } - - // FIXME: verify that it is a real wallet file first - TDEIO::NetAccess::file_copy(u, KURL::fromPathOrURL(dest)); - e->accept(); -} - -void KWalletIconView::contentsMousePressEvent(TQMouseEvent *e) { - _mousePos = e->pos(); - if (!findItem(_mousePos)) { - clearSelection(); - } - KIconView::contentsMousePressEvent( e ); -} - -TQDragObject *KWalletIconView::dragObject() { - KWalletIconDrag* id = new KWalletIconDrag(viewport(), "KWallet Drag"); - TQString path = "file:" + TDEGlobal::dirs()->saveLocation("kwallet"); - TQPoint pos = _mousePos; - for (TQIconViewItem *item = firstItem(); item; item = item->nextItem()) { - if (item->isSelected()) { - TQString url = path + item->text() + ".kwl"; - TQIconDragItem idi; - idi.setData(url.local8Bit()); - id->append(idi, - TQRect(item->pixmapRect(false).topLeft() - pos, - item->pixmapRect(false).size()), - TQRect(item->textRect(false).topLeft() - pos, - item->textRect(false).size()), - url); - } - } - - id->setPixmap(*currentItem()->pixmap(), - pos - currentItem()->pixmapRect(false).topLeft()); - - return id; -} - -TQDragObject *KWalletEntryList::dragObject() { - TQListViewItem *i = currentItem(); - - TQStoredDrag *sd = 0L; - - if (i->rtti() == KWalletEntryItemClass) { - KWalletEntryItem *ei = dynamic_cast(i); - if (!ei) { - return 0L; - } - sd = new KWalletEntryDrag(viewport(), "KWallet Entry Drag"); - TQByteArray a; - TQDataStream ds(a, IO_WriteOnly); - ds << KWALLETENTRYMAGIC; - ds << *ei; - sd->setEncodedData(a); - } else if (i->rtti() == KWalletFolderItemClass) { - KWalletFolderItem *fi = dynamic_cast(i); - if (!fi) { - return 0L; - } - sd = new KWalletFolderDrag(viewport(), "KWallet Folder Drag"); - TQByteArray a; - TQDataStream ds(a, IO_WriteOnly); - - ds << KWALLETFOLDERMAGIC; - ds << *fi; - sd->setEncodedData(a); - } - return sd; -} - -#include "allyourbase.moc" diff --git a/kwallet/allyourbase.h b/kwallet/allyourbase.h deleted file mode 100644 index c89276e..0000000 --- a/kwallet/allyourbase.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - Copyright (C) 2003-2005 George Staikos - Copyright (C) 2005 Isaac Clerencia - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef ALLYOURBASE_H -#define ALLYOURBASE_H - -#include -#include -#include -#include -#include - -#define KWALLETENTRYMAGIC ((TQ_UINT32) 0x6B776C65) -#define KWALLETFOLDERMAGIC ((TQ_UINT32) 0x6B776C66) - -enum KWalletListItemClasses { - KWalletFolderItemClass = 1000, - KWalletContainerItemClass, - KWalletEntryItemClass, - KWalletUnknownClass = 2000 -}; - -class KWalletEntryItem : public KListViewItem { - public: - KWalletEntryItem(KWallet::Wallet *w, TQListViewItem* parent, const TQString& ename); - virtual ~KWalletEntryItem(); - - const TQString& oldName() { return _oldName; } - TQString currentName() { return text(0); } - - void clearOldName() { _oldName = text(0); } - virtual int rtti() const; - - public: - KWallet::Wallet *_wallet; - - private: - TQString _oldName; -}; - -class KWalletContainerItem : public KListViewItem { - public: - KWalletContainerItem(TQListViewItem* parent, const TQString& name, - KWallet::Wallet::EntryType type); - virtual ~KWalletContainerItem(); - - public: - virtual int rtti() const; - KWallet::Wallet::EntryType type(); - bool contains(const TQString& itemKey); - TQListViewItem* getItem(const TQString& itemKey); - - private: - KWallet::Wallet::EntryType _type; -}; - -class KWalletFolderItem : public KListViewItem { - public: - KWalletFolderItem(KWallet::Wallet *w, TQListView* parent, - const TQString& name, int entries); - virtual ~KWalletFolderItem(); - - virtual bool acceptDrop(const TQMimeSource *mime) const; - virtual int rtti() const; - - TQString name() const; - void refresh(); - KWalletContainerItem* getContainer(KWallet::Wallet::EntryType type); - TQPixmap getFolderIcon(KIcon::Group group); - bool contains(const TQString& itemKey); - TQListViewItem* getItem(const TQString& itemKey); - - public: - KWallet::Wallet *_wallet; - - private: - TQString _name; - int _entries; -}; - -class KWalletEntryList : public KListView { - Q_OBJECT - - public: - KWalletEntryList(TQWidget *parent, const char *name = 0L); - virtual ~KWalletEntryList(); - - bool existsFolder(const TQString& name); - KWalletFolderItem* getFolder(const TQString& name); - void contentsDropEvent(TQDropEvent *e); - void contentsDragEnterEvent(TQDragEnterEvent *e); - void setWallet(KWallet::Wallet *w); - - protected: - void itemDropped(TQDropEvent *e, TQListViewItem *item); - virtual TQDragObject *dragObject(); - virtual bool acceptDrag (TQDropEvent* event) const; - - private: - static KWalletFolderItem *getItemFolder(TQListViewItem *item); - - public: - KWallet::Wallet *_wallet; -}; - -class KWalletItem : public TQIconViewItem { - public: - KWalletItem(TQIconView *parent, const TQString& walletName); - virtual ~KWalletItem(); - - virtual bool acceptDrop(const TQMimeSource *mime) const; - - protected: - virtual void dropped(TQDropEvent *e, const TQValueList& lst); -}; - - -class KWalletIconView : public KIconView { - Q_OBJECT - - public: - KWalletIconView(TQWidget *parent, const char *name = 0L); - virtual ~KWalletIconView(); - - protected slots: - virtual void slotDropped(TQDropEvent *e, const TQValueList& lst); - - protected: - virtual TQDragObject *dragObject(); - virtual void contentsMousePressEvent(TQMouseEvent *e); - TQPoint _mousePos; -}; - - -inline TQDataStream& operator<<(TQDataStream& str, const KWalletEntryItem& w) { - TQString name = w.text(0); - str << name; - KWallet::Wallet::EntryType et = w._wallet->entryType(name); - str << long(et); - TQByteArray a; - w._wallet->readEntry(name, a); - str << a; - return str; -} - -inline TQDataStream& operator<<(TQDataStream& str, const KWalletFolderItem& w) { - TQString oldFolder = w._wallet->currentFolder(); - str << w.name(); - w._wallet->setFolder(w.name()); - TQStringList entries = w._wallet->entryList(); - for (TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { - str << *it; - KWallet::Wallet::EntryType et = w._wallet->entryType(*it); - str << long(et); - TQByteArray a; - w._wallet->readEntry(*it, a); - str << a; - } - w._wallet->setFolder(oldFolder); - return str; -} - -#endif diff --git a/kwallet/hi128-app-kwalletmanager.png b/kwallet/hi128-app-kwalletmanager.png deleted file mode 100644 index ccdd7c9..0000000 Binary files a/kwallet/hi128-app-kwalletmanager.png and /dev/null differ diff --git a/kwallet/hi128-app-kwalletmanager2.png b/kwallet/hi128-app-kwalletmanager2.png deleted file mode 100644 index e3937db..0000000 Binary files a/kwallet/hi128-app-kwalletmanager2.png and /dev/null differ diff --git a/kwallet/hi16-app-kwalletmanager.png b/kwallet/hi16-app-kwalletmanager.png deleted file mode 100644 index 4f9f4fd..0000000 Binary files a/kwallet/hi16-app-kwalletmanager.png and /dev/null differ diff --git a/kwallet/hi16-app-kwalletmanager2.png b/kwallet/hi16-app-kwalletmanager2.png deleted file mode 100644 index b2f9004..0000000 Binary files a/kwallet/hi16-app-kwalletmanager2.png and /dev/null differ diff --git a/kwallet/hi22-app-kwalletmanager.png b/kwallet/hi22-app-kwalletmanager.png deleted file mode 100644 index 8bc4cdb..0000000 Binary files a/kwallet/hi22-app-kwalletmanager.png and /dev/null differ diff --git a/kwallet/hi32-app-kwalletmanager.png b/kwallet/hi32-app-kwalletmanager.png deleted file mode 100644 index 69a7c1e..0000000 Binary files a/kwallet/hi32-app-kwalletmanager.png and /dev/null differ diff --git a/kwallet/hi32-app-kwalletmanager2.png b/kwallet/hi32-app-kwalletmanager2.png deleted file mode 100644 index 3cfc4e2..0000000 Binary files a/kwallet/hi32-app-kwalletmanager2.png and /dev/null differ diff --git a/kwallet/hi48-app-kwalletmanager.png b/kwallet/hi48-app-kwalletmanager.png deleted file mode 100644 index 5b46a87..0000000 Binary files a/kwallet/hi48-app-kwalletmanager.png and /dev/null differ diff --git a/kwallet/hi48-app-kwalletmanager2.png b/kwallet/hi48-app-kwalletmanager2.png deleted file mode 100644 index 3ae286d..0000000 Binary files a/kwallet/hi48-app-kwalletmanager2.png and /dev/null differ diff --git a/kwallet/hi64-app-kwalletmanager.png b/kwallet/hi64-app-kwalletmanager.png deleted file mode 100644 index 38a581c..0000000 Binary files a/kwallet/hi64-app-kwalletmanager.png and /dev/null differ diff --git a/kwallet/hi64-app-kwalletmanager2.png b/kwallet/hi64-app-kwalletmanager2.png deleted file mode 100644 index 2e5be4b..0000000 Binary files a/kwallet/hi64-app-kwalletmanager2.png and /dev/null differ diff --git a/kwallet/icons/CMakeLists.txt b/kwallet/icons/CMakeLists.txt deleted file mode 100644 index a943e6a..0000000 --- a/kwallet/icons/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -################################################# -# -# (C) 2012 Golubev Alexander -# fatzer2 (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_install_icons( kwalletmanager) - -tde_install_icons( - DESTINATION ${DATA_INSTALL_DIR}/kwalletmanager/icons -) diff --git a/kwallet/icons/Makefile.am b/kwallet/icons/Makefile.am deleted file mode 100644 index 8bad46c..0000000 --- a/kwallet/icons/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -KDE_ICON = kwalletmanager - -pics_ICON = AUTO -picsdir = $(kde_datadir)/kwalletmanager/icons - diff --git a/kwallet/icons/cr22-action-folder_closed.png b/kwallet/icons/cr22-action-folder_closed.png deleted file mode 100644 index e3ebad3..0000000 Binary files a/kwallet/icons/cr22-action-folder_closed.png and /dev/null differ diff --git a/kwallet/icons/cr22-action-folder_open.png b/kwallet/icons/cr22-action-folder_open.png deleted file mode 100644 index ea175b7..0000000 Binary files a/kwallet/icons/cr22-action-folder_open.png and /dev/null differ diff --git a/kwallet/icons/cr22-action-wallet_closed.png b/kwallet/icons/cr22-action-wallet_closed.png deleted file mode 100644 index 57558ac..0000000 Binary files a/kwallet/icons/cr22-action-wallet_closed.png and /dev/null differ diff --git a/kwallet/icons/cr22-action-wallet_open.png b/kwallet/icons/cr22-action-wallet_open.png deleted file mode 100644 index 55a447f..0000000 Binary files a/kwallet/icons/cr22-action-wallet_open.png and /dev/null differ diff --git a/kwallet/kbetterthankdialogbase.ui b/kwallet/kbetterthankdialogbase.ui deleted file mode 100644 index 65d8b5a..0000000 --- a/kwallet/kbetterthankdialogbase.ui +++ /dev/null @@ -1,154 +0,0 @@ - -KBetterThanKDialogBase - - - KBetterThanKDialogBase - - - - 0 - 0 - 479 - 109 - - - - - - - - unnamed - - - Fixed - - - - _label - - - - - spacer1 - - - Horizontal - - - Expanding - - - - 41 - 21 - - - - - - layout1 - - - - unnamed - - - - _allowOnce - - - &Replace - - - true - - - - - _allowAlways - - - Replace &All - - - - - _deny - - - &Skip - - - - - _denyForever - - - Skip A&ll - - - - - - - spacer2 - - - Horizontal - - - Expanding - - - - 61 - 21 - - - - - - - - - - _allowOnce - clicked() - KBetterThanKDialogBase - clicked() - - - _allowAlways - clicked() - KBetterThanKDialogBase - clicked() - - - _deny - clicked() - KBetterThanKDialogBase - clicked() - - - _denyForever - clicked() - KBetterThanKDialogBase - clicked() - - - - kactivelabel.h - kbetterthankdialogbase.ui.h - - - clicked() - setLabel( const TQString & label ) - init() - accept() - reject() - - - - kactivelabel.h - - diff --git a/kwallet/kbetterthankdialogbase.ui.h b/kwallet/kbetterthankdialogbase.ui.h deleted file mode 100644 index e97ffd1..0000000 --- a/kwallet/kbetterthankdialogbase.ui.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you want to add, delete, or rename functions or slots, use -** TQt Designer to update this file, preserving your code. -** -** You should not define a constructor or destructor in this file. -** Instead, write your code in functions called init() and destroy(). -** These will automatically be called by the form's constructor and -** destructor. -*****************************************************************************/ - - -void KBetterThanKDialogBase::clicked() -{ - if (sender() == _allowOnce) { - done(3); - } else if (sender() == _allowAlways) { - done(1); - } else if (sender() == _deny) { - done(4); - } else if (sender() == _denyForever) { - done(2); - } -} - - -void KBetterThanKDialogBase::setLabel( const TQString & label ) -{ - _label->setText(label); -} - - -void KBetterThanKDialogBase::init() -{ - _allowOnce->setFocus(); -} - - -void KBetterThanKDialogBase::accept() -{ - setResult(3); -} - - -void KBetterThanKDialogBase::reject() -{ - TQDialog::reject(); - setResult(4); -} diff --git a/kwallet/konfigurator/CMakeLists.txt b/kwallet/konfigurator/CMakeLists.txt deleted file mode 100644 index e6af5e7..0000000 --- a/kwallet/konfigurator/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -################################################# -# -# (C) 2012 Golubev Alexander -# fatzer2 (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### kcm_kwallet (kpart) ####################### - -tde_add_kpart( kcm_kwallet AUTOMOC - SOURCES walletconfigwidget.ui konfigurator.cpp - LINK tdeui-shared kwalletclient-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) - - -##### other data ################################ - -install( FILES kwalletconfig.desktop - DESTINATION ${XDG_APPS_INSTALL_DIR} -) - -install( - FILES - kwallet_config.desktop - kwalletmanager_show.desktop - DESTINATION ${SERVICES_INSTALL_DIR} -) diff --git a/kwallet/konfigurator/Makefile.am b/kwallet/konfigurator/Makefile.am deleted file mode 100644 index 74be145..0000000 --- a/kwallet/konfigurator/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -INCLUDES = $(all_includes) -METASOURCES = AUTO - -kde_module_LTLIBRARIES = kcm_kwallet.la -kcm_kwallet_la_SOURCES = walletconfigwidget.ui konfigurator.cpp -kcm_kwallet_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined -kcm_kwallet_la_LIBADD = $(LIB_TDEUI) -lkwalletclient - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kcmkwallet.pot - -xdg_apps_DATA = kwalletconfig.desktop - -kde_services_DATA = kwallet_config.desktop kwalletmanager_show.desktop - diff --git a/kwallet/konfigurator/konfigurator.cpp b/kwallet/konfigurator/konfigurator.cpp deleted file mode 100644 index dd03591..0000000 --- a/kwallet/konfigurator/konfigurator.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/* - Copyright (C) 2003 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - */ - -#include "konfigurator.h" -#include "walletconfigwidget.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -typedef KGenericFactory KWalletFactory; -K_EXPORT_COMPONENT_FACTORY(kcm_kwallet, KWalletFactory("kcmkwallet")) - -KWalletConfig::KWalletConfig(TQWidget *parent, const char *name, const TQStringList&) -: TDECModule(KWalletFactory::instance(), parent, name) { - - TDEAboutData *about = - new TDEAboutData(I18N_NOOP("kcmkwallet"), - I18N_NOOP("TDE Wallet Control Module"), - 0, 0, TDEAboutData::License_GPL, - I18N_NOOP("(c) 2003 George Staikos")); - about->addAuthor("George Staikos", 0, "staikos@kde.org"); - setAboutData( about ); - - _cfg = new TDEConfig("kwalletrc", false, false); - - TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, KDialog::spacingHint()); - vbox->add(_wcw = new WalletConfigWidget(this)); - - connect(_wcw->_enabled, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - connect(_wcw->_launchManager, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - connect(_wcw->_autocloseManager, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - connect(_wcw->_autoclose, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - connect(_wcw->_closeIdle, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - connect(_wcw->_openPrompt, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - connect(_wcw->_screensaverLock, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - connect(_wcw->_localWalletSelected, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - connect(_wcw->_idleTime, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); - connect(_wcw->_launch, TQT_SIGNAL(clicked()), this, TQT_SLOT(launchManager())); - connect(_wcw->_newWallet, TQT_SIGNAL(clicked()), this, TQT_SLOT(newNetworkWallet())); - connect(_wcw->_newLocalWallet, TQT_SIGNAL(clicked()), this, TQT_SLOT(newLocalWallet())); - connect(_wcw->_localWallet, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); - connect(_wcw->_defaultWallet, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); - connect(_wcw->_accessList, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)), this, TQT_SLOT(contextMenuRequested(TQListViewItem*, const TQPoint&, int))); - - _wcw->_accessList->setAllColumnsShowFocus(true); - updateWalletLists(); - load(); - - if (DCOPClient::mainClient()->isApplicationRegistered("kwalletmanager")) { - _wcw->_launch->hide(); - } - -} - - -KWalletConfig::~KWalletConfig() { - delete _cfg; - _cfg = 0L; -} - - -void KWalletConfig::updateWalletLists() { - TQString p1, p2; - p1 = _wcw->_localWallet->currentText(); - p2 = _wcw->_defaultWallet->currentText(); - - _wcw->_localWallet->clear(); - _wcw->_defaultWallet->clear(); - - TQStringList wl = KWallet::Wallet::walletList(); - _wcw->_localWallet->insertStringList(wl); - _wcw->_defaultWallet->insertStringList(wl); - - if (wl.contains(p1)) { - _wcw->_localWallet->setCurrentText(p1); - } - - if (wl.contains(p2)) { - _wcw->_defaultWallet->setCurrentText(p2); - } -} - - -TQString KWalletConfig::newWallet() { - bool ok; - - TQString n = KInputDialog::getText(i18n("New Wallet"), - i18n("Please choose a name for the new wallet:"), - TQString(), - &ok, - this); - - if (!ok) { - return TQString(); - } - - KWallet::Wallet *w = KWallet::Wallet::openWallet(n); - if (!w) { - return TQString(); - } - - delete w; - return n; -} - - -void KWalletConfig::newLocalWallet() { - TQString n = newWallet(); - if (n.isEmpty()) { - return; - } - - updateWalletLists(); - - _wcw->_localWallet->setCurrentText(n); - - emit changed(true); -} - - -void KWalletConfig::newNetworkWallet() { - TQString n = newWallet(); - if (n.isEmpty()) { - return; - } - - updateWalletLists(); - - _wcw->_defaultWallet->setCurrentText(n); - - emit changed(true); -} - - -void KWalletConfig::launchManager() { - if (!DCOPClient::mainClient()->isApplicationRegistered("kwalletmanager")) { - TDEApplication::startServiceByDesktopName("kwalletmanager_show"); - } else { - DCOPRef r("kwalletmanager", "kwalletmanager-mainwindow#1"); - r.send("show"); - r.send("raise"); - } -} - - -void KWalletConfig::configChanged() { - emit changed(true); -} - -void KWalletConfig::load() { - load( false ); -} - -void KWalletConfig::load(bool useDefaults) { - TDEConfigGroup config(_cfg, "Wallet"); - config.setReadDefaults( useDefaults ); - _wcw->_enabled->setChecked(config.readBoolEntry("Enabled", true)); - _wcw->_openPrompt->setChecked(config.readBoolEntry("Prompt on Open", true)); - _wcw->_launchManager->setChecked(config.readBoolEntry("Launch Manager", true)); - _wcw->_autocloseManager->setChecked(! config.readBoolEntry("Leave Manager Open", false)); - _wcw->_screensaverLock->setChecked(config.readBoolEntry("Close on Screensaver", false)); - _wcw->_autoclose->setChecked(!config.readBoolEntry("Leave Open", false)); - _wcw->_closeIdle->setChecked(config.readBoolEntry("Close When Idle", false)); - _wcw->_idleTime->setValue(config.readNumEntry("Idle Timeout", 10)); - if (config.hasKey("Default Wallet")) { - _wcw->_defaultWallet->setCurrentText(config.readEntry("Default Wallet")); - } else { - _wcw->_defaultWallet->setCurrentItem(0); - } - if (config.hasKey("Local Wallet")) { - _wcw->_localWalletSelected->setChecked( !config.readBoolEntry("Use One Wallet") ); - _wcw->_localWallet->setCurrentText(config.readEntry("Local Wallet")); - } else { - _wcw->_localWalletSelected->setChecked(false); - } - _wcw->_accessList->clear(); - _cfg->setGroup("Auto Deny"); - TQStringList denykeys = _cfg->entryMap("Auto Deny").keys(); - _cfg->setGroup("Auto Allow"); - TQStringList keys = _cfg->entryMap("Auto Allow").keys(); - for (TQStringList::Iterator i = keys.begin(); i != keys.end(); ++i) { - _cfg->setGroup("Auto Allow"); - TQStringList apps = _cfg->readListEntry(*i); - _cfg->setGroup("Auto Deny"); - TQStringList denyapps = _cfg->readListEntry(*i); - denykeys.remove(*i); - TQListViewItem *lvi = new TQListViewItem(_wcw->_accessList, *i); - for (TQStringList::Iterator j = apps.begin(); j != apps.end(); ++j) { - new TQListViewItem(lvi, TQString(), *j, i18n("Always Allow")); - } - for (TQStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { - new TQListViewItem(lvi, TQString(), *j, i18n("Always Deny")); - } - } - _cfg->setGroup("Auto Deny"); - for (TQStringList::Iterator i = denykeys.begin(); i != denykeys.end(); ++i) { - TQStringList denyapps = _cfg->readListEntry(*i); - TQListViewItem *lvi = new TQListViewItem(_wcw->_accessList, *i); - for (TQStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { - new TQListViewItem(lvi, TQString(), *j, i18n("Always Deny")); - } - } - emit changed(useDefaults); -} - - -void KWalletConfig::save() { - TDEConfigGroup config(_cfg, "Wallet"); - config.writeEntry("Enabled", _wcw->_enabled->isChecked()); - config.writeEntry("Launch Manager", _wcw->_launchManager->isChecked()); - config.writeEntry("Leave Manager Open", !_wcw->_autocloseManager->isChecked()); - config.writeEntry("Leave Open", !_wcw->_autoclose->isChecked()); - config.writeEntry("Close When Idle", _wcw->_closeIdle->isChecked()); - config.writeEntry("Idle Timeout", _wcw->_idleTime->value()); - config.writeEntry("Prompt on Open", _wcw->_openPrompt->isChecked()); - config.writeEntry("Close on Screensaver", _wcw->_screensaverLock->isChecked()); - - config.writeEntry("Use One Wallet", !_wcw->_localWalletSelected->isChecked()); - if (_wcw->_localWalletSelected->isChecked()) { - config.writeEntry("Local Wallet", _wcw->_localWallet->currentText()); - } else { - config.deleteEntry("Local Wallet"); - } - - if (_wcw->_defaultWallet->currentItem() != -1) { - config.writeEntry("Default Wallet", _wcw->_defaultWallet->currentText()); - } else { - config.deleteEntry("Default Wallet"); - } - - // FIXME: won't survive a language change - _cfg->deleteGroup("Auto Allow"); - _cfg->deleteGroup("Auto Deny"); - _cfg->setGroup("Auto Allow"); - for (TQListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { - TQStringList al; - for (TQListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { - if (j->text(2) == i18n("Always Allow")) { - al << j->text(1); - } - } - _cfg->writeEntry(i->text(0), al); - } - - _cfg->setGroup("Auto Deny"); - for (TQListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { - TQStringList al; - for (TQListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { - if (j->text(2) == i18n("Always Deny")) { - al << j->text(1); - } - } - _cfg->writeEntry(i->text(0), al); - } - - _cfg->sync(); - DCOPRef("kded", "kwalletd").call("reconfigure()"); - - emit changed(false); -} - - -void KWalletConfig::defaults() { - load( true ); -} - - -TQString KWalletConfig::quickHelp() const { - return i18n("This configuration module allows you to configure the KDE wallet system."); -} - - -void KWalletConfig::contextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col) { - Q_UNUSED(col) - if (item && item->parent()) { - KPopupMenu *m = new KPopupMenu(this); - m->insertTitle(item->parent()->text(0)); - m->insertItem(i18n("&Delete"), this, TQT_SLOT(deleteEntry()), Key_Delete); - m->popup(pos); - } -} - - -void KWalletConfig::deleteEntry() { - TQListViewItem *item = _wcw->_accessList->selectedItem(); - if (item) { - delete item; - emit changed(true); - } -} - -#include "konfigurator.moc" - diff --git a/kwallet/konfigurator/konfigurator.h b/kwallet/konfigurator/konfigurator.h deleted file mode 100644 index 418d2e5..0000000 --- a/kwallet/konfigurator/konfigurator.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2003 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - */ - -#ifndef _KWALLETKONFIGURATOR_H -#define _KWALLETKONFIGURATOR_H - -#include - -class TDEConfig; -class WalletConfigWidget; -class TQListViewItem; - -class KWalletConfig : public TDECModule { - Q_OBJECT - - public: - KWalletConfig(TQWidget *parent = 0L, const char *name = 0L, const TQStringList& = TQStringList()); - virtual ~KWalletConfig(); - - void load(); - void load( bool useDefaults ); - void save(); - void defaults(); - - TQString quickHelp() const; - - public slots: - void configChanged(); - void launchManager(); - void newLocalWallet(); - void newNetworkWallet(); - void updateWalletLists(); - TQString newWallet(); - void deleteEntry(); - void contextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col); - - private: - WalletConfigWidget *_wcw; - TDEConfig *_cfg; -}; - -#endif diff --git a/kwallet/konfigurator/kwallet_config.desktop b/kwallet/konfigurator/kwallet_config.desktop deleted file mode 100644 index d1bdf5b..0000000 --- a/kwallet/konfigurator/kwallet_config.desktop +++ /dev/null @@ -1,47 +0,0 @@ -[Desktop Entry] -Type=Service -Exec=kcmshell --caption %c kwalletconfig -Icon=kwalletmanager -DocPath=kwallet/index.html -Name=TDE Wallet -Name[ar]=محفظة كدى -Name[bg]=Портфейл -Name[br]=Doug-paperoù TDE -Name[bs]=TDE novčanik -Name[cs]=Úschovna TDE -Name[cy]=Waled TDE -Name[da]=TDE's tegnebog -Name[de]=Digitale Brieftasche -Name[el]=Πορτοφόλι του TDE -Name[es]=Cartera de TDE -Name[et]=TDE turvalaegas -Name[eu]=TDE Kartera -Name[fi]=Lompakko -Name[fr]=Gestionnaire de comptes de TDE -Name[hi]=केडीई वॉलेट -Name[hu]=Digitális noteszek -Name[is]=TDE veskið -Name[it]=Portafogli di TDE -Name[ja]=TDE ウォレット -Name[kk]=TDE әмияні -Name[km]=កាបូប TDE -Name[lt]=TDE slaptažodinės -Name[mk]=TDE Паричник -Name[nds]=TDE-Knipp -Name[ne]=TDE वालेट -Name[pa]=TDE ਵਾਲਿਟ -Name[pl]=Portfel TDE -Name[pt]=Carteira TDE -Name[pt_BR]=Carteira do TDE -Name[ro]=Portofel TDE -Name[ru]=Бумажник -Name[sl]=Listnica za TDE -Name[sv]=TDE-plånbok -Name[ta]= கேடிஇ வாலட் -Name[tg]=TDE Ҳамён -Name[tr]=TDE Cüzdan -Name[uk]=Торбинки TDE -Name[uz]=TDE qopchiq -Name[uz@cyrillic]=TDE қопчиқ -Name[zh_CN]=TDE 钱包 -Name[zh_TW]=TDE 錢包 diff --git a/kwallet/konfigurator/kwalletconfig.desktop b/kwallet/konfigurator/kwalletconfig.desktop deleted file mode 100644 index 4dedee9..0000000 --- a/kwallet/konfigurator/kwalletconfig.desktop +++ /dev/null @@ -1,152 +0,0 @@ -[Desktop Entry] -Icon=kwalletmanager -Type=Application -Exec=kcmshell kwalletconfig -DocPath=kwallet/index.html -X-TDE-ModuleType=Library -X-TDE-Library=kwallet -X-TDE-ParentApp=kcontrol - -Name=TDE Wallet -Name[ar]=محفظة كدى -Name[bg]=Портфейл -Name[br]=Doug-paperoù TDE -Name[bs]=TDE novčanik -Name[cs]=Úschovna TDE -Name[cy]=Waled TDE -Name[da]=TDE's tegnebog -Name[de]=Digitale Brieftasche -Name[el]=Πορτοφόλι του TDE -Name[es]=Cartera de TDE -Name[et]=TDE turvalaegas -Name[eu]=TDE Kartera -Name[fi]=Lompakko -Name[fr]=Gestionnaire de comptes de TDE -Name[hi]=केडीई वॉलेट -Name[hu]=Digitális noteszek -Name[is]=TDE veskið -Name[it]=Portafogli di TDE -Name[ja]=TDE ウォレット -Name[kk]=TDE әмияні -Name[km]=កាបូប TDE -Name[lt]=TDE slaptažodinės -Name[mk]=TDE Паричник -Name[nds]=TDE-Knipp -Name[ne]=TDE वालेट -Name[pa]=TDE ਵਾਲਿਟ -Name[pl]=Portfel TDE -Name[pt]=Carteira TDE -Name[pt_BR]=Carteira do TDE -Name[ro]=Portofel TDE -Name[ru]=Бумажник -Name[sl]=Listnica za TDE -Name[sv]=TDE-plånbok -Name[ta]= கேடிஇ வாலட் -Name[tg]=TDE Ҳамён -Name[tr]=TDE Cüzdan -Name[uk]=Торбинки TDE -Name[uz]=TDE qopchiq -Name[uz@cyrillic]=TDE қопчиқ -Name[zh_CN]=TDE 钱包 -Name[zh_TW]=TDE 錢包 -Comment=TDE Wallet Configuration -Comment[ar]=إعداد محفظة كدى -Comment[bg]=Настройване на системата Портфейл -Comment[br]=Kefluniadur Doug-paperoù TDE -Comment[bs]=Podešavanje TDE novčanika -Comment[ca]=Configuració de carteres TDE -Comment[cs]=Nastavení úschovny TDE -Comment[cy]=Ffurfweddiad Waled TDE -Comment[da]=TDE's indstilling af tegnebog -Comment[de]=Einrichten der "digitalen Brieftasche" (KWallet) -Comment[el]=Ρύθμιση του πορτοφολιού του TDE -Comment[es]=Configuración de la cartera de TDE -Comment[et]=TDE turvalaeka seadistamine -Comment[eu]=TDE Karteraren Konfigurazioa -Comment[fa]=TDE Wallet پیکربندی -Comment[fi]=TDE-lompakon asetukset -Comment[fr]=Configuration du gestionnaire de comptes de TDE -Comment[ga]=Cumraíocht TDE Wallet -Comment[he]=TDE Wallet הגדרות -Comment[hi]=केडीई वॉलेट कॉन्फ़िगरेशन -Comment[hu]=A TDE digitális noteszeinek beállításai -Comment[is]=Stillingar veskisins -Comment[it]=Configurazione portafogli di TDE -Comment[ja]=TDE ウォレットの設定 -Comment[ka]=TDE Wallet-ის კონფიგურაცია -Comment[kk]=TDE әмияннің баптауы -Comment[km]=ការកំណត់​រចនា​សម្ព័ន្ធ​កាបូប TDE -Comment[lt]=TDE slaptažodinių konfigūravimas -Comment[mk]=Конфигурација на паричник во TDE -Comment[nb]=Oppsett av TDE Wallet -Comment[nds]=TDE-Knipp instellen -Comment[ne]=TDE वालेट कन्फिगरेसन -Comment[nl]=TDE portefeuille-instellingen -Comment[nn]=Oppsett av TDE Wallet -Comment[pa]=TDE ਵਾਲਿਟ ਸੰਰਚਨਾ -Comment[pl]=Konfiguracja Portfela TDE -Comment[pt]=Configuração da Carteira do TDE -Comment[pt_BR]=Configuração da Carteira do TDE -Comment[ro]=Configurează portofelul TDE -Comment[ru]=Параметры бумажника -Comment[sk]=Konfigurácia TDE Wallet -Comment[sl]=Nastavitve Listnice za TDE -Comment[sr]=Подешавање TDE Wallet-а -Comment[sr@Latn]=Podešavanje TDE Wallet-a -Comment[sv]=Inställning av TDE-plånbok -Comment[ta]=கேடிஇ வாலட் வடிவமைப்பு -Comment[tg]=TDE Танзими Ҳамён -Comment[tr]=TDE Cüzdan Ayarı -Comment[uk]=Налаштування KWallet -Comment[uz]=TDE qopchiq xizmatini moslash -Comment[uz@cyrillic]=TDE қопчиқ хизматини мослаш -Comment[zh_CN]=TDE 钱包配置 -Comment[zh_TW]=TDE 錢包設定 -Keywords=Wallet,Form Fill,Passwords,Form Data -Keywords[ar]=محفظة،ملأ نموذج،كلمات السرّ،بيانات نموذج -Keywords[bg]=портфейл, форми, форма, попълване, данни, парола, пароли, Wallet, Form Fill, Passwords, Form Data -Keywords[bs]=Wallet,Form Fill,Passwords,Form Data,novčanik,formulari,popunjavanje formulara,šifre -Keywords[ca]=Cartera,Ompliment de formularis,Contrasentes,Dades de formularis -Keywords[cs]=úschovna,vyplnění formuláře,hesla,data formuláře -Keywords[cy]=Waled,Llenwi Ffurflen,Cyfrineiriau,Data Ffurflenni -Keywords[da]=Tegnebog,Formularudfyldning,Kodeord,Formular-data -Keywords[de]=Geheimfach,Formular,Passwort,Brieftasche,digitale Brieftasche -Keywords[el]=Πορτοφόλι,Συμπλήρωση φόρμας,Κωδικοί πρόσβασης,Δεδομένα φόρμας -Keywords[es]=Cartera,Rellenar formulario,Contraseña,Datos de formulario -Keywords[et]=Turvalaegas,Vormi täitmine,Paroolid,Vormiandmed -Keywords[eu]=Kartera,Formularioa Bete,Pasahitzak,Formulario Datuak -Keywords[fa]=Wallet، پر کردن برگه، اسم رمزها، دادۀ برگه -Keywords[fi]=Lompakko,Lomakkeen täyttö,Salasanat,Lomaketiedot -Keywords[fr]=gestionnaire de comptes,remplissage de formulaire,Mots de passe,Données de formulaire -Keywords[ga]=Wallet,Líonadh Foirmeacha,Focal Faire,Sonraí foirme -Keywords[hi]=बटुआ,फ़ॉर्म फिल,पासवर्ड,फ़ॉर्म डाटा -Keywords[hu]=digitális notesz,űrlapkitöltés,jelszavak,űrlapadatok -Keywords[it]=portafogli,wallet,riempimento moduli,moduli,form,password,dati moduli -Keywords[ja]=ウォレット,フォームフィル,パスワード,フォームデータ -Keywords[ka]=Wallet,ფორმის შევსება,პაროლები,ფორმათა მონაცემები -Keywords[km]=កាបូប,ការបំពេញ​សំណុំ​បែបបទ,ពាក្យ​សម្ងាត់,ទិន្នន័យ​សំណុំ​បែបបទ -Keywords[lt]=Wallet, slaptažodinė,Form Fill,Passwords,Form Data,formų pildymas,slaptažodžiai,formų duomenys -Keywords[mk]=Wallet,Form Fill,Passwords,Form Data, Паричник, формулар, лозинки -Keywords[nb]=Wallet,Skjemautfylling,Passord,Skjema -Keywords[nds]=Knipp,Formulor,Passwöör,Formulordaten -Keywords[ne]=वालेट,फारम भराइ,पासवर्ड,फारम डेटा -Keywords[nl]=Wallet,gegevens,portefeuille,wachtwoorden,veilig bewaren van wachtwoorden,invulgegevens,formulieren -Keywords[nn]=wallet,skjemautfylling,passord,skjema -Keywords[pa]=Wallet,Form Fill,ਗੁਪਤ-ਕੋਡ,ਫਾਰਮ ਡਾਟਾ -Keywords[pl]=portfel,wypełnianie formularzy,uzupełnianie formularzy, hasła, hasło,dane formularzy, formularze -Keywords[pt]=Carteira,Preenchimento de Formulários,Senhas,Dados do Formulário -Keywords[pt_BR]=carteira,preenchimento de formulário,senhas,dados de formulário -Keywords[ro]=portofel,completare formulare,parole,date formular,formular -Keywords[ru]=Wallet,Form Fill,Passwords,Form Data,Бумажник,Пароли,Формы -Keywords[sk]=wallet,formuláre,heslá,dáta z formulárov,schránka,peňaženka -Keywords[sl]=waller,denarnica,gesla,obrazec,podatki,geslo,listnica -Keywords[sr]=Wallet,Form Fill,Passwords,Form Data,лозинке,новчаник -Keywords[sr@Latn]=Wallet,Form Fill,Passwords,Form Data,lozinke,novčanik -Keywords[sv]=Plånbok,fyll i formulär,lösenord,formulärdata -Keywords[ta]=வாலட், படிவ நிரப்பு, கடவுச் சொற்கள், படிவ தகவல் -Keywords[tg]=Ҳамён,Пуркунии Варақа,Гузарвожаҳо,Варақаи Додаҳо -Keywords[tr]=Cüzdan,Form Doldur,Şifreler,Form Verisi -Keywords[uk]=Торбинка,Заповнення форм,Паролі,Дані форм -Keywords[zh_CN]=Wallet,Form Fill,Passwords,Form Data,钱包,填充表单,密码,表单数据 - -Categories=Qt;TDE;X-TDE-settings-security; diff --git a/kwallet/konfigurator/kwalletmanager_show.desktop b/kwallet/konfigurator/kwalletmanager_show.desktop deleted file mode 100644 index 66ba71c..0000000 --- a/kwallet/konfigurator/kwalletmanager_show.desktop +++ /dev/null @@ -1,60 +0,0 @@ -[Desktop Entry] -Name=Wallet Management Tool -Name[ar]=أداة إدارة المحفظة -Name[bg]=Портфейл -Name[br]=Merour an doug-paperoù -Name[bs]=Alat za upravljanje novčanikom -Name[ca]=Eina de gestió de carteres -Name[cs]=Nástroj pro správu úschovny -Name[cy]=Erfyn Rheoli Waled -Name[da]=Håndteringsværktøj for tegnebog -Name[de]=Verwaltung für digitale Brieftasche -Name[el]=Εργαλείο διαχείρισης πορτοφολιού -Name[es]=Herramienta de gestión de cartera -Name[et]=Turvalaeka haldur -Name[eu]=Kartera Kudeatzeko Tresna -Name[fa]=ابزار مدیریت Wallet -Name[fi]=Lompakon hallintatyökalu -Name[fr]=Outil de gestion de comptes -Name[ga]=Uirlis Bhainisteoireachta Wallet -Name[he]=כלי לניהול הארנק של TDE -Name[hi]= बटुआ प्रबंधन औज़ार -Name[hu]=Kezelőprogram a TDE digitális noteszeihez -Name[is]=Tól til að stýra eiginleikum veskisins -Name[it]=Strumento per la gestione dei portafogli -Name[ja]=ウォレット管理ツール -Name[ka]=Wallet-ის მმართველი მოწყობილობა -Name[kk]=Әмиянін басқару құралы -Name[km]=ឧបករណ៍​គ្រប់គ្រង​កាបូប -Name[lt]=Spatažodinių tvarkymo įrankis -Name[mk]=Алатка за менаџирање на паричници -Name[nb]=Wallet administrasjonsverktøy -Name[nds]=Knipp-Pleger -Name[ne]=वालेट व्यवस्थापन उपकरण -Name[nl]=Portefeuillebeheer -Name[nn]=Wallet-administrasjonsverktøy -Name[pa]=ਵਾਲਿਟ ਪਰਬੰਧਨ ਸੰਦ -Name[pl]=Narzędzie do zarządzania Portfelem -Name[pt]=Ferramenta de Gestão da Carteira -Name[pt_BR]=Ferramenta de Gerenciamento da Carteira -Name[ro]=Administrare portofel -Name[ru]=Управление паролями -Name[sk]=Nástroj na správu KWallet -Name[sl]=Orodje za upravljanje z listnicami -Name[sr]=Алат за управљање новчаником -Name[sr@Latn]=Alat za upravljanje novčanikom -Name[sv]=Hanteringsverktyg för plånbok -Name[ta]=வாலட் மேலாண்மை கருவி -Name[tg]=Асбоби Идоракунии Ҳамён -Name[tr]=Cüzdan Yönetim Aracı -Name[uk]=Засіб керування торбинками -Name[uz]=Qopchiq boshqarish vositasi -Name[uz@cyrillic]=Қопчиқ бошқариш воситаси -Name[zh_CN]=钱包管理工具 -Name[zh_TW]=錢包管理工具 -Exec=kwalletmanager --show %u -MimeType=application/x-kde-wallet -InitialPreference=6 -Icon=kwalletmanager -Type=Service -X-TDE-StartupNotify=true diff --git a/kwallet/konfigurator/walletconfigwidget.ui b/kwallet/konfigurator/walletconfigwidget.ui deleted file mode 100644 index 5f51713..0000000 --- a/kwallet/konfigurator/walletconfigwidget.ui +++ /dev/null @@ -1,499 +0,0 @@ - -WalletConfigWidget - - - WalletConfigWidget - - - - 0 - 0 - 585 - 450 - - - - - unnamed - - - 0 - - - - tabWidget2 - - - - tab - - - Wallet Preferences - - - - unnamed - - - - _enabled - - - &Enable the TDE wallet subsystem - - - true - - - <p>The wallet subsytem allows a convenient and secure way to manage all your passwords. You can decide if you want to use this system with this option.</p> - - - - - groupBox2 - - - Close Wallet - - - It is best to close your wallets when you are not using them to prevent others from viewing or using them. - - - - unnamed - - - - layout1 - - - - unnamed - - - - _closeIdle - - - - 1 - 0 - 2 - 0 - - - - Close when unused for: - - - <p><b>Close wallet after a period of inactivity</b><br>When a wallet is closed the password is needed to access it again.</p> - - - - - _idleTime - - - false - - - - 1 - 0 - 0 - 0 - - - - min - - - 999 - - - 1 - - - 5 - - - 10 - - - <p><b>Close wallet after a period of inactivity</b><br>When a wallet is closed the password is needed to access it again.</p> - - - - - spacer12 - - - Horizontal - - - Expanding - - - - 20 - 20 - - - - - - - - _screensaverLock - - - Close when screensaver starts - - - <p><b>Close wallet as soon as the screensaver starts.</b><br>When a wallet is closed the password is needed to access it again.</p> - - - - - _autoclose - - - Close when last application stops using it - - - <p><b>Close wallet as soon as applications that use it have stopped.</b><br>Note that your wallets will only be closed when all applications that use it have stopped.<br>When a wallet is closed the password is needed to access it again.</p> - - - - - - - groupBox4 - - - Automatic Wallet Selection - - - - unnamed - - - - spacer7 - - - Horizontal - - - Expanding - - - - 20 - 20 - - - - - - textLabel1_2 - - - Select wallet to use as default: - - - - - _localWalletSelected - - - Different wallet for local passwords: - - - - - _defaultWallet - - - - 1 - 0 - 1 - 0 - - - - - - _localWallet - - - false - - - - 1 - 0 - 1 - 0 - - - - - - _newLocalWallet - - - false - - - New... - - - - - _newWallet - - - New... - - - - - - - groupBox3 - - - Wallet Manager - - - - unnamed - - - - spacer6 - - - Horizontal - - - Fixed - - - - 20 - 20 - - - - - - _launchManager - - - Show manager in system tray - - - true - - - - - _autocloseManager - - - Hide system tray icon when last wallet closes - - - - - - - spacer4 - - - Vertical - - - Expanding - - - - 31 - 16 - - - - - - - - tab - - - Access Control - - - - unnamed - - - - _openPrompt - - - &Prompt when an application accesses an open wallet - - - true - - - - - - Wallet - - - true - - - true - - - true - - - - - Application - - - true - - - true - - - - - Policy - - - true - - - true - - - - _accessList - - - true - - - - - - - - _launch - - - &Launch Wallet Manager - - - - - spacer2 - - - Horizontal - - - Expanding - - - - 369 - 21 - - - - - - - - _localWalletSelected - toggled(bool) - _newLocalWallet - setEnabled(bool) - - - _localWalletSelected - toggled(bool) - _localWallet - setEnabled(bool) - - - _closeIdle - toggled(bool) - _idleTime - setEnabled(bool) - - - _enabled - toggled(bool) - groupBox2 - setEnabled(bool) - - - _enabled - toggled(bool) - groupBox4 - setEnabled(bool) - - - _enabled - toggled(bool) - groupBox3 - setEnabled(bool) - - - _closeIdle - toggled(bool) - _idleTime - setEnabled(bool) - - - _launchManager - toggled(bool) - _autocloseManager - setEnabled(bool) - - - - _enabled - _closeIdle - _idleTime - _screensaverLock - _autoclose - _defaultWallet - _newWallet - _localWalletSelected - _localWallet - _newLocalWallet - _launchManager - _autocloseManager - tabWidget2 - _openPrompt - _accessList - _launch - - - _storeTogether_toggled(bool) - - - diff --git a/kwallet/kwalleteditor.cpp b/kwallet/kwalleteditor.cpp deleted file mode 100644 index 83c69f8..0000000 --- a/kwallet/kwalleteditor.cpp +++ /dev/null @@ -1,1143 +0,0 @@ -/* - Copyright (C) 2003-2005 George Staikos - Copyright (C) 2005 Isaac Clerencia - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -#include "kbetterthankdialogbase.h" -#include "kwalleteditor.h" -#include "kwmapeditor.h" -#include "allyourbase.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -KWalletEditor::KWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent, const char *name) -: KMainWindow(parent, name), _walletName(wallet), _nonLocal(isPath) { - _newWallet = false; - _ww = new WalletWidget(this, "Wallet Widget"); - _copyPassAction = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copyPassword()), actionCollection()); - - TQVBoxLayout *box = new TQVBoxLayout(_ww->_entryListFrame); - box->setSpacing( KDialog::spacingHint() ); - box->setMargin( KDialog::marginHint() ); - _entryList = new KWalletEntryList(_ww->_entryListFrame, "Wallet Entry List"); - box->addWidget(new KListViewSearchLineWidget(_entryList, _ww->_entryListFrame)); - box->addWidget(_entryList); - - _ww->_entryStack->setEnabled(true); - - box = new TQVBoxLayout(_ww->_entryStack->widget(2)); - _mapEditorShowHide = new TQCheckBox(i18n("&Show values"), _ww->_entryStack->widget(2)); - connect(_mapEditorShowHide, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showHideMapEditorValue(bool))); - _mapEditor = new KWMapEditor(_currentMap, _ww->_entryStack->widget(2)); - box->addWidget(_mapEditorShowHide); - box->addWidget(_mapEditor); - - setCentralWidget(_ww); - - resize(600, 400); - - connect(_entryList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), - this, TQT_SLOT(entrySelectionChanged(TQListViewItem*))); - connect(_entryList, - TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint&,int)), - this, - TQT_SLOT(listContextMenuRequested(TQListViewItem*,const TQPoint&,int))); - connect(_entryList, - TQT_SIGNAL(itemRenamed(TQListViewItem*, int, const TQString&)), - this, - TQT_SLOT(listItemRenamed(TQListViewItem*, int, const TQString&))); - - connect(_ww->_passwordValue, TQT_SIGNAL(textChanged()), - this, TQT_SLOT(entryEditted())); - connect(_mapEditor, TQT_SIGNAL(dirty()), - this, TQT_SLOT(entryEditted())); - - connect(_ww->_undoChanges, TQT_SIGNAL(clicked()), - this, TQT_SLOT(restoreEntry())); - connect(_ww->_saveChanges, TQT_SIGNAL(clicked()), - this, TQT_SLOT(saveEntry())); - - connect(_ww->_showContents, TQT_SIGNAL(clicked()), - this, TQT_SLOT(showPasswordContents())); - connect(_ww->_hideContents, TQT_SIGNAL(clicked()), - this, TQT_SLOT(hidePasswordContents())); - - _walletIsOpen = false; - - _w = KWallet::Wallet::openWallet(wallet, winId(), isPath ? KWallet::Wallet::Path : KWallet::Wallet::Asynchronous); - if (_w) { - connect(_w, TQT_SIGNAL(walletOpened(bool)), this, TQT_SLOT(walletOpened(bool))); - connect(_w, TQT_SIGNAL(walletClosed()), this, TQT_SLOT(walletClosed())); - connect(_w, TQT_SIGNAL(folderUpdated(const TQString&)), this, TQT_SLOT(updateEntries(const TQString&))); - connect(_w, TQT_SIGNAL(folderListUpdated()), this, TQT_SLOT(updateFolderList())); - updateFolderList(); - } else { - kdDebug(2300) << "Wallet open failed!" << endl; - } - - createActions(); - createGUI("kwalleteditor.rc"); - delete toolBar(); - - setCaption(wallet); - - TQTimer::singleShot(0, this, TQT_SLOT(layout())); -} - -KWalletEditor::~KWalletEditor() { - emit editorClosed(this); - delete _newFolderAction; - _newFolderAction = 0L; - delete _deleteFolderAction; - _deleteFolderAction = 0L; - delete _w; - _w = 0L; - if (_nonLocal) { - KWallet::Wallet::closeWallet(_walletName, true); - } -} - -void KWalletEditor::layout() { - TQValueList sz = _ww->_splitter->sizes(); - int sum = sz[0] + sz[1]; - sz[0] = sum/2; - sz[1] = sum/2; - _ww->_splitter->setSizes(sz); -} - -void KWalletEditor::createActions() { - _newFolderAction = new KAction(i18n("&New Folder..."), "folder_new", - 0, TQT_TQOBJECT(this), TQT_SLOT(createFolder()), actionCollection(), - "create_folder"); - connect(this, TQT_SIGNAL(enableFolderActions(bool)), - _newFolderAction, TQT_SLOT(setEnabled(bool))); - - _deleteFolderAction = new KAction(i18n("&Delete Folder"), 0, 0, - TQT_TQOBJECT(this), TQT_SLOT(deleteFolder()), actionCollection(), - "delete_folder"); - connect(this, TQT_SIGNAL(enableContextFolderActions(bool)), - _deleteFolderAction, TQT_SLOT(setEnabled(bool))); - connect(this, TQT_SIGNAL(enableFolderActions(bool)), - _deleteFolderAction, TQT_SLOT(setEnabled(bool))); - - _passwordAction = new KAction(i18n("Change &Password..."), 0, 0, TQT_TQOBJECT(this), - TQT_SLOT(changePassword()), actionCollection(), - "change_password"); - connect(this, TQT_SIGNAL(enableWalletActions(bool)), - _passwordAction, TQT_SLOT(setEnabled(bool))); - - _mergeAction = new KAction(i18n("&Merge Wallet..."), 0, 0, TQT_TQOBJECT(this), - TQT_SLOT(importWallet()), actionCollection(), - "merge"); - connect(this, TQT_SIGNAL(enableWalletActions(bool)), - _mergeAction, TQT_SLOT(setEnabled(bool))); - - _importAction = new KAction(i18n("&Import XML..."), 0, 0, TQT_TQOBJECT(this), - TQT_SLOT(importXML()), actionCollection(), - "import"); - connect(this, TQT_SIGNAL(enableWalletActions(bool)), - _importAction, TQT_SLOT(setEnabled(bool))); - - _exportAction = new KAction(i18n("&Export..."), 0, 0, TQT_TQOBJECT(this), - TQT_SLOT(exportXML()), actionCollection(), - "export"); - connect(this, TQT_SIGNAL(enableWalletActions(bool)), - _exportAction, TQT_SLOT(setEnabled(bool))); - - _saveAsAction = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection()); - connect(this, TQT_SIGNAL(enableWalletActions(bool)), - _saveAsAction, TQT_SLOT(setEnabled(bool))); - - KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); - KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), -actionCollection()); - emit enableWalletActions(false); - emit enableFolderActions(false); - emit enableContextFolderActions(false); -} - - -void KWalletEditor::walletClosed() { - delete _w; - _walletIsOpen = false; - _w = 0L; - _ww->setEnabled(false); - emit enableWalletActions(false); - emit enableFolderActions(false); - KMessageBox::sorry(this, i18n("This wallet was forced closed. You must reopen it to continue working with it.")); - deleteLater(); -} - - -void KWalletEditor::updateFolderList(bool checkEntries) { - TQStringList fl = _w->folderList(); - TQPtrStack trash; - - for (TQListViewItem *i = _entryList->firstChild(); i; i = i->nextSibling()) { - KWalletFolderItem *fi = dynamic_cast(i); - if (!fi) { - continue; - } - if (!fl.contains(fi->name())) { - trash.push(i); - } - } - - trash.setAutoDelete(true); - trash.clear(); - - for (TQStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { - if (_entryList->existsFolder(*i)) { - if (checkEntries) { - updateEntries(*i); - } - continue; - } - - _w->setFolder(*i); - TQStringList entries = _w->entryList(); - KWalletFolderItem *item = new KWalletFolderItem(_w,_entryList, - *i, entries.count()); - - KWalletContainerItem *pi = new KWalletContainerItem(item, i18n("Passwords"),KWallet::Wallet::Password); - KWalletContainerItem *mi = new KWalletContainerItem(item, i18n("Maps"),KWallet::Wallet::Map); - KWalletContainerItem *bi = new KWalletContainerItem(item, i18n("Binary Data"),KWallet::Wallet::Stream); - KWalletContainerItem *ui = new KWalletContainerItem(item, i18n("Unknown"),KWallet::Wallet::Unknown); - - for (TQStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { - switch (_w->entryType(*j)) { - case KWallet::Wallet::Password: - new KWalletEntryItem(_w, pi, *j); - break; - case KWallet::Wallet::Stream: - new KWalletEntryItem(_w, bi, *j); - break; - case KWallet::Wallet::Map: - new KWalletEntryItem(_w, mi, *j); - break; - case KWallet::Wallet::Unknown: - default: - new TQListViewItem(ui, *j); - break; - } - } - _entryList->setEnabled(true); - } - - //check if the current folder has been removed - if (!fl.contains(_currentFolder)) { - _currentFolder = ""; - _ww->_entryTitle->clear(); - _ww->_iconTitle->clear(); - } -} - -void KWalletEditor::deleteFolder() { - if (_w) { - TQListViewItem *i = _entryList->currentItem(); - if (i) { - KWalletFolderItem *fi = dynamic_cast(i); - if (!fi) { - return; - } - - int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the folder '%1' from the wallet?").arg(fi->name()),"",KStdGuiItem::del()); - if (rc == KMessageBox::Continue) { - bool rc = _w->removeFolder(fi->name()); - if (!rc) { - KMessageBox::sorry(this, i18n("Error deleting folder.")); - return; - } - _currentFolder = ""; - _ww->_entryTitle->clear(); - _ww->_iconTitle->clear(); - updateFolderList(); - } - } - } -} - - -void KWalletEditor::createFolder() { - if (_w) { - TQString n; - bool ok; - - do { - n = KInputDialog::getText(i18n("New Folder"), - i18n("Please choose a name for the new folder:"), - TQString(), - &ok, - this); - - if (!ok) { - return; - } - - if (_entryList->existsFolder(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that folder name is in use. Try again?"), TQString(), i18n("Try Again"), i18n("Do Not Try")); - if (rc == KMessageBox::Yes) { - continue; - } - n = TQString(); - } - break; - } while (true); - - _w->createFolder(n); - updateFolderList(); - } -} - - -void KWalletEditor::saveEntry() { - int rc = 1; - TQListViewItem *item = _entryList->currentItem(); - _ww->_saveChanges->setEnabled(false); - _ww->_undoChanges->setEnabled(false); - - if (item && _w && item->parent()) { - KWalletContainerItem *ci = dynamic_cast(item->parent()); - if (ci) { - if (ci->type() == KWallet::Wallet::Password) { - rc = _w->writePassword(item->text(0), _ww->_passwordValue->text()); - } else if (ci->type() == KWallet::Wallet::Map) { - _mapEditor->saveMap(); - rc = _w->writeMap(item->text(0), _currentMap); - } else { - return; - } - - if (rc == 0) { - return; - } - } - } - - KMessageBox::sorry(this, i18n("Error saving entry. Error code: %1").arg(rc)); -} - - -void KWalletEditor::restoreEntry() { - entrySelectionChanged(_entryList->currentItem()); -} - - -void KWalletEditor::entryEditted() { - _ww->_saveChanges->setEnabled(true); - _ww->_undoChanges->setEnabled(true); -} - - -void KWalletEditor::entrySelectionChanged(TQListViewItem *item) { - KWalletContainerItem *ci = 0L; - KWalletFolderItem *fi = 0L; - - switch (item->rtti()) { - case KWalletEntryItemClass: - ci = dynamic_cast(item->parent()); - if (!ci) { - return; - } - fi = dynamic_cast(ci->parent()); - if (!fi) { - return; - } - _w->setFolder(fi->name()); - _deleteFolderAction->setEnabled(false); - if (ci->type() == KWallet::Wallet::Password) { - TQString pass; - if (_w->readPassword(item->text(0), pass) == 0) { - _ww->_entryStack->raiseWidget(int(4)); - _ww->_entryName->setText(i18n("Password: %1") - .arg(item->text(0))); - _ww->_passwordValue->setText(pass); - _ww->_saveChanges->setEnabled(false); - _ww->_undoChanges->setEnabled(false); - } - } else if (ci->type() == KWallet::Wallet::Map) { - _ww->_entryStack->raiseWidget(int(2)); - _mapEditorShowHide->setChecked(false); - showHideMapEditorValue(false); - if (_w->readMap(item->text(0), _currentMap) == 0) { - _mapEditor->reload(); - _ww->_entryName->setText(i18n("Name-Value Map: %1").arg(item->text(0))); - _ww->_saveChanges->setEnabled(false); - _ww->_undoChanges->setEnabled(false); - } - } else if (ci->type() == KWallet::Wallet::Stream) { - _ww->_entryStack->raiseWidget(int(3)); - TQByteArray ba; - if (_w->readEntry(item->text(0), ba) == 0) { - _ww->_entryName->setText(i18n("Binary Data: %1") - .arg(item->text(0))); - _ww->_saveChanges->setEnabled(false); - _ww->_undoChanges->setEnabled(false); - } - } - break; - - case KWalletContainerItemClass: - fi = dynamic_cast(item->parent()); - if (!fi) { - return; - } - _w->setFolder(fi->name()); - _deleteFolderAction->setEnabled(false); - _ww->_entryName->clear(); - _ww->_entryStack->raiseWidget(int(0)); - break; - - case KWalletFolderItemClass: - fi = dynamic_cast(item); - if (!fi) { - return; - } - _w->setFolder(fi->name()); - _deleteFolderAction->setEnabled(true); - _ww->_entryName->clear(); - _ww->_entryStack->raiseWidget(int(0)); - break; - } - - if (fi) { - _currentFolder = fi->name(); - _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); - _ww->_iconTitle->setPixmap(fi->getFolderIcon(KIcon::Toolbar)); - } -} - -void KWalletEditor::updateEntries(const TQString& folder) { - TQPtrStack trash; - - _w->setFolder(folder); - TQStringList entries = _w->entryList(); - - KWalletFolderItem *fi = _entryList->getFolder(folder); - - if (!fi) { - return; - } - - KWalletContainerItem *pi = fi->getContainer(KWallet::Wallet::Password); - KWalletContainerItem *mi = fi->getContainer(KWallet::Wallet::Map); - KWalletContainerItem *bi = fi->getContainer(KWallet::Wallet::Stream); - KWalletContainerItem *ui = fi->getContainer(KWallet::Wallet::Unknown); - - // Remove deleted entries - for (TQListViewItem *i = pi->firstChild(); i; i = i->nextSibling()) { - if (!entries.contains(i->text(0))) { - if (i == _entryList->currentItem()) { - entrySelectionChanged(0L); - } - trash.push(i); - } - } - - for (TQListViewItem *i = mi->firstChild(); i; i = i->nextSibling()) { - if (!entries.contains(i->text(0))) { - if (i == _entryList->currentItem()) { - entrySelectionChanged(0L); - } - trash.push(i); - } - } - - for (TQListViewItem *i = bi->firstChild(); i; i = i->nextSibling()) { - if (!entries.contains(i->text(0))) { - if (i == _entryList->currentItem()) { - entrySelectionChanged(0L); - } - trash.push(i); - } - } - - for (TQListViewItem *i = ui->firstChild(); i; i = i->nextSibling()) { - if (!entries.contains(i->text(0))) { - if (i == _entryList->currentItem()) { - entrySelectionChanged(0L); - } - trash.push(i); - } - } - - trash.setAutoDelete(true); - trash.clear(); - - // Add new entries - for (TQStringList::Iterator i = entries.begin(); i != entries.end(); ++i) { - if (fi->contains(*i)){ - continue; - } - - switch (_w->entryType(*i)) { - case KWallet::Wallet::Password: - new KWalletEntryItem(_w, pi, *i); - break; - case KWallet::Wallet::Stream: - new KWalletEntryItem(_w, bi, *i); - break; - case KWallet::Wallet::Map: - new KWalletEntryItem(_w, mi, *i); - break; - case KWallet::Wallet::Unknown: - default: - new TQListViewItem(ui, *i); - break; - } - } - fi->refresh(); - if (fi->name() == _currentFolder) { - _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); - } - if (!_entryList->selectedItem()) { - _ww->_entryName->clear(); - _ww->_entryStack->raiseWidget(int(0)); - } -} - -void KWalletEditor::listContextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col) { - Q_UNUSED(col) - - if (!_walletIsOpen) { - return; - } - - KWalletListItemClasses menuClass = KWalletUnknownClass; - KWalletContainerItem *ci = 0L; - - if (item) { - if (item->rtti() == KWalletEntryItemClass) { - ci = dynamic_cast(item->parent()); - if (!ci) { - return; - } - } else if (item->rtti() == KWalletContainerItemClass) { - ci = dynamic_cast(item); - if (!ci) { - return; - } - } - - if (ci && ci->type() == KWallet::Wallet::Unknown) { - return; - } - menuClass = static_cast(item->rtti()); - } - - KPopupMenu *m = new KPopupMenu(this); - if (item) { - TQString title = item->text(0); - // I think 200 pixels is wide enough for a title - title = KStringHandler::cPixelSqueeze(title, m->fontMetrics(), 200); - m->insertTitle(title); - switch (menuClass) { - case KWalletEntryItemClass: - m->insertItem(i18n("&New..." ), this, TQT_SLOT(newEntry()), Key_Insert); - m->insertItem(i18n( "&Rename" ), this, TQT_SLOT(renameEntry()), Key_F2); - m->insertItem(i18n( "&Delete" ), this, TQT_SLOT(deleteEntry()), Key_Delete); - if (ci && ci->type() == KWallet::Wallet::Password) { - m->insertSeparator(); - _copyPassAction->plug(m); - } - break; - - case KWalletContainerItemClass: - m->insertItem(i18n( "&New..." ), this, TQT_SLOT(newEntry()), Key_Insert); - break; - - case KWalletFolderItemClass: - _newFolderAction->plug(m); - _deleteFolderAction->plug(m); - break; - default: - abort(); - } - } else { - _newFolderAction->plug(m); - } - m->popup(pos); -} - - -void KWalletEditor::copyPassword() { - TQListViewItem *item = _entryList->selectedItem(); - if (_w && item) { - TQString pass; - if (_w->readPassword(item->text(0), pass) == 0) { - TQApplication::clipboard()->setText(pass); - } - } -} - - -void KWalletEditor::newEntry() { - TQListViewItem *item = _entryList->selectedItem(); - TQString n; - bool ok; - - TQListViewItem *p; - KWalletFolderItem *fi; - - //set the folder where we're trying to create the new entry - if (_w && item) { - p = item; - if (p->rtti() == KWalletEntryItemClass) { - p = item->parent(); - } - fi = dynamic_cast(p->parent()); - if (!fi) { - return; - } - _w->setFolder(fi->name()); - } else { - return; - } - - do { - n = KInputDialog::getText(i18n("New Entry"), - i18n("Please choose a name for the new entry:"), - TQString(), - &ok, - this); - - if (!ok) { - return; - } - - // FIXME: prohibits the use of the subheadings - if (fi->contains(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that entry already exists. Try again?"), TQString(), i18n("Try Again"), i18n("Do Not Try")); - if (rc == KMessageBox::Yes) { - continue; - } - n = TQString(); - } - break; - } while (true); - - if (_w && item && !n.isEmpty()) { - TQListViewItem *p = item; - if (p->rtti() == KWalletEntryItemClass) { - p = item->parent(); - } - - KWalletFolderItem *fi = dynamic_cast(p->parent()); - if (!fi) { - KMessageBox::error(this, i18n("An unexpected error occurred trying to add the new entry")); - return; - } - _w->setFolder(fi->name()); - - KWalletEntryItem *ni = new KWalletEntryItem(_w, p, n); - _entryList->setSelected(ni,true); - _entryList->ensureItemVisible(ni); - - KWalletContainerItem *ci = dynamic_cast(p); - if (!ci) { - KMessageBox::error(this, i18n("An unexpected error occurred trying to add the new entry")); - return; - } - if (ci->type() == KWallet::Wallet::Password) { - _w->writePassword(n, TQString()); - } else if (ci->type() == KWallet::Wallet::Map) { - _w->writeMap(n, TQMap()); - } else if (ci->type() == KWallet::Wallet::Stream) { - _w->writeEntry(n, TQByteArray()); - } else { - abort(); - } - fi->refresh(); - _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); - } -} - - -void KWalletEditor::renameEntry() { - TQListViewItem *item = _entryList->selectedItem(); - if (_w && item) { - item->startRename(0); - } -} - - -// Only supports renaming of KWalletEntryItem derived classes. -void KWalletEditor::listItemRenamed(TQListViewItem* item, int, const TQString& t) { - if (item) { - KWalletEntryItem *i = dynamic_cast(item); - if (!i) { - return; - } - - if (!_w || t.isEmpty()) { - i->setText(0, i->oldName()); - return; - } - - if (_w->renameEntry(i->oldName(), t) == 0) { - i->clearOldName(); - KWalletContainerItem *ci = dynamic_cast(item->parent()); - if (!ci) { - KMessageBox::error(this, i18n("An unexpected error occurred trying to rename the entry")); - return; - } - if (ci->type() == KWallet::Wallet::Password) { - _ww->_entryName->setText(i18n("Password: %1").arg(item->text(0))); - } else if (ci->type() == KWallet::Wallet::Map) { - _ww->_entryName->setText(i18n("Name-Value Map: %1").arg(item->text(0))); - } else if (ci->type() == KWallet::Wallet::Stream) { - _ww->_entryName->setText(i18n("Binary Data: %1").arg(item->text(0))); - } - } else { - i->setText(0, i->oldName()); - } - } -} - - -void KWalletEditor::deleteEntry() { - TQListViewItem *item = _entryList->selectedItem(); - if (_w && item) { - int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the item '%1'?").arg(item->text(0)),"",KStdGuiItem::del()); - if (rc == KMessageBox::Continue) { - KWalletFolderItem *fi = dynamic_cast(item->parent()->parent()); - if (!fi) { - KMessageBox::error(this, i18n("An unexpected error occurred trying to delete the entry")); - return; - } - _w->removeEntry(item->text(0)); - delete item; - entrySelectionChanged(_entryList->currentItem()); - fi->refresh(); - _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); - } - } -} - -void KWalletEditor::changePassword() { - KWallet::Wallet::changePassword(_walletName); -} - - -void KWalletEditor::walletOpened(bool success) { - if (success) { - emit enableFolderActions(true); - emit enableContextFolderActions(false); - emit enableWalletActions(true); - updateFolderList(); - show(); - _entryList->setWallet(_w); - _walletIsOpen = true; - } else { - if (!_newWallet) { - KMessageBox::sorry(this, i18n("Unable to open the requested wallet.")); - } - close(); - } -} - - -void KWalletEditor::hidePasswordContents() { - _ww->_entryStack->raiseWidget(int(4)); -} - - -void KWalletEditor::showPasswordContents() { - _ww->_entryStack->raiseWidget(int(1)); -} - - -void KWalletEditor::showHideMapEditorValue(bool show) { - if (show) { - _mapEditor->showColumn(2); - } else { - _mapEditor->hideColumn(2); - } -} - - -enum MergePlan { Prompt = 0, Always = 1, Never = 2, Yes = 3, No = 4 }; - -void KWalletEditor::importWallet() { - KURL url = KFileDialog::getOpenURL(TQString(), "*.kwl", this); - if (url.isEmpty()) { - return; - } - - TQString tmpFile; - if (!TDEIO::NetAccess::download(url, tmpFile, this)) { - KMessageBox::sorry(this, i18n("Unable to access wallet '%1'.").arg(url.prettyURL())); - return; - } - - KWallet::Wallet *w = KWallet::Wallet::openWallet(tmpFile, winId(), KWallet::Wallet::Path); - if (w && w->isOpen()) { - MergePlan mp = Prompt; - TQStringList fl = w->folderList(); - for (TQStringList::ConstIterator f = fl.constBegin(); f != fl.constEnd(); ++f) { - if (!w->setFolder(*f)) { - continue; - } - - if (!_w->hasFolder(*f)) { - _w->createFolder(*f); - } - - _w->setFolder(*f); - - TQMap > map; - int rc; - rc = w->readMapList("*", map); - if (rc == 0) { - TQMap >::ConstIterator me; - for (me = map.constBegin(); me != map.constEnd(); ++me) { - bool hasEntry = _w->hasEntry(me.key()); - if (hasEntry && mp == Prompt) { - KBetterThanKDialogBase *bd; - bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(me.key()))); - mp = (MergePlan)bd->exec(); - delete bd; - bool ok = false; - if (mp == Always || mp == Yes) { - ok = true; - } - if (mp == Yes || mp == No) { - // reset mp - mp = Prompt; - } - if (!ok) { - continue; - } - } else if (hasEntry && mp == Never) { - continue; - } - _w->writeMap(me.key(), me.data()); - } - } - - TQMap pwd; - rc = w->readPasswordList("*", pwd); - if (rc == 0) { - TQMap::ConstIterator pe; - for (pe = pwd.constBegin(); pe != pwd.constEnd(); ++pe) { - bool hasEntry = _w->hasEntry(pe.key()); - if (hasEntry && mp == Prompt) { - KBetterThanKDialogBase *bd; - bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(pe.key()))); - mp = (MergePlan)bd->exec(); - delete bd; - bool ok = false; - if (mp == Always || mp == Yes) { - ok = true; - } - if (mp == Yes || mp == No) { - // reset mp - mp = Prompt; - } - if (!ok) { - continue; - } - } else if (hasEntry && mp == Never) { - continue; - } - _w->writePassword(pe.key(), pe.data()); - } - } - - TQMap ent; - rc = w->readEntryList("*", ent); - if (rc == 0) { - TQMap::ConstIterator ee; - for (ee = ent.constBegin(); ee != ent.constEnd(); ++ee) { - bool hasEntry = _w->hasEntry(ee.key()); - if (hasEntry && mp == Prompt) { - KBetterThanKDialogBase *bd; - bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(ee.key()))); - mp = (MergePlan)bd->exec(); - delete bd; - bool ok = false; - if (mp == Always || mp == Yes) { - ok = true; - } - if (mp == Yes || mp == No) { - // reset mp - mp = Prompt; - } - if (!ok) { - continue; - } - } else if (hasEntry && mp == Never) { - continue; - } - _w->writeEntry(ee.key(), ee.data()); - } - } - } - } - - delete w; - - TDEIO::NetAccess::removeTempFile(tmpFile); - updateFolderList(true); - restoreEntry(); -} - - -void KWalletEditor::importXML() { - KURL url = KFileDialog::getOpenURL(TQString(), "*.xml", this); - if (url.isEmpty()) { - return; - } - - TQString tmpFile; - if (!TDEIO::NetAccess::download(url, tmpFile, this)) { - KMessageBox::sorry(this, i18n("Unable to access XML file '%1'.").arg(url.prettyURL())); - return; - } - - TQFile qf(tmpFile); - if (!qf.open(IO_ReadOnly)) { - KMessageBox::sorry(this, i18n("Error opening XML file '%1' for input.").arg(url.prettyURL())); - TDEIO::NetAccess::removeTempFile(tmpFile); - return; - } - - TQDomDocument doc(tmpFile); - if (!doc.setContent(&qf)) { - KMessageBox::sorry(this, i18n("Error reading XML file '%1' for input.").arg(url.prettyURL())); - TDEIO::NetAccess::removeTempFile(tmpFile); - return; - } - - TQDomElement top = doc.documentElement(); - if (top.tagName().lower() != "wallet") { - KMessageBox::sorry(this, i18n("Error: XML file does not contain a wallet.")); - TDEIO::NetAccess::removeTempFile(tmpFile); - return; - } - - TQDomNode n = top.firstChild(); - MergePlan mp = Prompt; - while (!n.isNull()) { - TQDomElement e = n.toElement(); - if (e.tagName().lower() != "folder") { - n = n.nextSibling(); - continue; - } - - TQString fname = e.attribute("name"); - if (fname.isEmpty()) { - n = n.nextSibling(); - continue; - } - if (!_w->hasFolder(fname)) { - _w->createFolder(fname); - } - _w->setFolder(fname); - TQDomNode enode = e.firstChild(); - while (!enode.isNull()) { - e = enode.toElement(); - TQString type = e.tagName().lower(); - TQString ename = e.attribute("name"); - bool hasEntry = _w->hasEntry(ename); - if (hasEntry && mp == Prompt) { - KBetterThanKDialogBase *bd; - bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(fname)).arg(TQStyleSheet::escape(ename))); - mp = (MergePlan)bd->exec(); - delete bd; - bool ok = false; - if (mp == Always || mp == Yes) { - ok = true; - } - if (mp == Yes || mp == No) { // reset mp - mp = Prompt; - } - if (!ok) { - enode = enode.nextSibling(); - continue; - } - } else if (hasEntry && mp == Never) { - enode = enode.nextSibling(); - continue; - } - - if (type == "password") { - _w->writePassword(ename, e.text()); - } else if (type == "stream") { - _w->writeEntry(ename, KCodecs::base64Decode(TQCString(e.text().latin1()))); - } else if (type == "map") { - TQMap map; - TQDomNode mapNode = e.firstChild(); - while (!mapNode.isNull()) { - TQDomElement mape = mapNode.toElement(); - if (mape.tagName().lower() == "mapentry") { - map[mape.attribute("name")] = mape.text(); - } - mapNode = mapNode.nextSibling(); - } - _w->writeMap(ename, map); - } - enode = enode.nextSibling(); - } - n = n.nextSibling(); - } - - TDEIO::NetAccess::removeTempFile(tmpFile); - updateFolderList(true); - restoreEntry(); -} - - -void KWalletEditor::exportXML() { - KTempFile tf; - tf.setAutoDelete(true); - TQTextStream& ts(*tf.textStream()); - TQStringList fl = _w->folderList(); - - ts << "" << endl; - for (TQStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { - ts << " " << endl; - _w->setFolder(*i); - TQStringList entries = _w->entryList(); - for (TQStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { - switch (_w->entryType(*j)) { - case KWallet::Wallet::Password: - { - TQString pass; - if (_w->readPassword(*j, pass) == 0) { - ts << " "; - ts << TQStyleSheet::escape(pass); - ts << "" << endl; - } - break; - } - case KWallet::Wallet::Stream: - { - TQByteArray ba; - if (_w->readEntry(*j, ba) == 0) { - ts << " "; - ts << KCodecs::base64Encode(ba); - - ts << "" << endl; - } - break; - } - case KWallet::Wallet::Map: - { - TQMap map; - if (_w->readMap(*j, map) == 0) { - ts << " " << endl; - for (TQMap::ConstIterator k = map.begin(); k != map.end(); ++k) { - ts << " " << TQStyleSheet::escape(k.data()) << "" << endl; - } - ts << " " << endl; - } - break; - } - case KWallet::Wallet::Unknown: - default: - break; - } - } - ts << " " << endl; - } - - ts << "" << endl; - tf.close(); - - KURL url = KFileDialog::getSaveURL(TQString(), "*.xml", this); - - if (!url.isEmpty()) { - bool ok = true; - if (TDEIO::NetAccess::exists(url, false, this)) { - int rc = KMessageBox::warningContinueCancel(this, i18n("The file '%1' already exists. Would you like to overwrite this file?").arg(url.prettyURL()), i18n("Overwrite")); - if (rc == KMessageBox::Cancel) { - ok = false; - } - } - if (ok) { - KURL tfURL; tfURL.setPath(tf.name()); - TDEIO::NetAccess::file_copy(tfURL, url, 0600, true, false, this); - } - } -} - - -void KWalletEditor::setNewWallet(bool x) { - _newWallet = x; -} - - -void KWalletEditor::saveAs() { - KURL url = KFileDialog::getSaveURL(TQString(), "*.kwl", this); - if (!url.isEmpty()) { - // Sync() kwalletd - if (_nonLocal) { - TDEIO::NetAccess::file_copy(KURL(_walletName), url, 0600, false, false, this); - } else { - TQString path = TDEGlobal::dirs()->saveLocation("kwallet") + "/" + _walletName + ".kwl"; - KURL destURL; destURL.setPath(path); - TDEIO::NetAccess::file_copy(destURL, url, 0600, false, false, this); - } - } -} - - -#include "kwalleteditor.moc" - diff --git a/kwallet/kwalleteditor.h b/kwallet/kwalleteditor.h deleted file mode 100644 index 9f63961..0000000 --- a/kwallet/kwalleteditor.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright (C) 2003-2005 George Staikos - Copyright (C) 2005 Isaac Clerencia - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KWALLETEDITOR_H -#define KWALLETEDITOR_H - -#include "walletwidget.h" -#include -#include -#include - -class KAction; -class TQIconViewItem; -class TQListViewItem; -class TQCheckBox; -class KWalletFolderIconView; -class KWalletEntryList; -class KWMapEditor; - -class KWalletEditor : public KMainWindow { - Q_OBJECT - - - public: - KWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent = 0, const char* name = 0); - virtual ~KWalletEditor(); - - bool isOpen() const { return _w != 0L; } - - void setNewWallet(bool newWallet); - - public slots: - void walletClosed(); - void createFolder(); - void deleteFolder(); - - private slots: - void layout(); - void updateFolderList(bool checkEntries = false); - void entrySelectionChanged(TQListViewItem *item); - void listItemRenamed(TQListViewItem *, int, const TQString&); - void listContextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col); - void updateEntries(const TQString& folder); - - void newEntry(); - void renameEntry(); - void deleteEntry(); - void entryEditted(); - void restoreEntry(); - void saveEntry(); - - void changePassword(); - - void walletOpened(bool success); - void hidePasswordContents(); - void showPasswordContents(); - void showHideMapEditorValue(bool show); - - void saveAs(); - void exportXML(); - void importXML(); - void importWallet(); - - void copyPassword(); - - signals: - void enableWalletActions(bool enable); - void enableFolderActions(bool enable); - void enableContextFolderActions(bool enable); - void editorClosed(KMainWindow*); - - public: - TQString _walletName; - - private: - void createActions(); - bool _nonLocal; - KWallet::Wallet *_w; - WalletWidget *_ww; - KWalletEntryList *_entryList; - bool _walletIsOpen; - KAction *_newFolderAction, *_deleteFolderAction; - KAction *_passwordAction, *_exportAction, *_saveAsAction, *_mergeAction, *_importAction; - KAction *_copyPassAction; - TQLabel*_details; - TQString _currentFolder; - TQMap _currentMap; // save memory by storing - // only the most recent map. - KWMapEditor *_mapEditor; - TQCheckBox *_mapEditorShowHide; - bool _newWallet; -}; - -#endif diff --git a/kwallet/kwalleteditor.rc b/kwallet/kwalleteditor.rc deleted file mode 100644 index 9c4faf5..0000000 --- a/kwallet/kwalleteditor.rc +++ /dev/null @@ -1,17 +0,0 @@ - - - - &File - - - - - - - - - - &Help - - - diff --git a/kwallet/kwalletmanager-kwalletd.desktop b/kwallet/kwalletmanager-kwalletd.desktop deleted file mode 100644 index ca037fa..0000000 --- a/kwallet/kwalletmanager-kwalletd.desktop +++ /dev/null @@ -1,60 +0,0 @@ -[Desktop Entry] -Name=Wallet Management Tool -Name[ar]=أداة إدارة المحفظة -Name[bg]=Портфейл -Name[br]=Merour an doug-paperoù -Name[bs]=Alat za upravljanje novčanikom -Name[ca]=Eina de gestió de carteres -Name[cs]=Nástroj pro správu úschovny -Name[cy]=Erfyn Rheoli Waled -Name[da]=Håndteringsværktøj for tegnebog -Name[de]=Verwaltung für digitale Brieftasche -Name[el]=Εργαλείο διαχείρισης πορτοφολιού -Name[es]=Herramienta de gestión de cartera -Name[et]=Turvalaeka haldur -Name[eu]=Kartera Kudeatzeko Tresna -Name[fa]=ابزار مدیریت Wallet -Name[fi]=Lompakon hallintatyökalu -Name[fr]=Outil de gestion de comptes -Name[ga]=Uirlis Bhainisteoireachta Wallet -Name[he]=כלי לניהול הארנק של TDE -Name[hi]= बटुआ प्रबंधन औज़ार -Name[hu]=Kezelőprogram a TDE digitális noteszeihez -Name[is]=Tól til að stýra eiginleikum veskisins -Name[it]=Strumento per la gestione dei portafogli -Name[ja]=ウォレット管理ツール -Name[ka]=Wallet-ის მმართველი მოწყობილობა -Name[kk]=Әмиянін басқару құралы -Name[km]=ឧបករណ៍​គ្រប់គ្រង​កាបូប -Name[lt]=Spatažodinių tvarkymo įrankis -Name[mk]=Алатка за менаџирање на паричници -Name[nb]=Wallet administrasjonsverktøy -Name[nds]=Knipp-Pleger -Name[ne]=वालेट व्यवस्थापन उपकरण -Name[nl]=Portefeuillebeheer -Name[nn]=Wallet-administrasjonsverktøy -Name[pa]=ਵਾਲਿਟ ਪਰਬੰਧਨ ਸੰਦ -Name[pl]=Narzędzie do zarządzania Portfelem -Name[pt]=Ferramenta de Gestão da Carteira -Name[pt_BR]=Ferramenta de Gerenciamento da Carteira -Name[ro]=Administrare portofel -Name[ru]=Управление паролями -Name[sk]=Nástroj na správu KWallet -Name[sl]=Orodje za upravljanje z listnicami -Name[sr]=Алат за управљање новчаником -Name[sr@Latn]=Alat za upravljanje novčanikom -Name[sv]=Hanteringsverktyg för plånbok -Name[ta]=வாலட் மேலாண்மை கருவி -Name[tg]=Асбоби Идоракунии Ҳамён -Name[tr]=Cüzdan Yönetim Aracı -Name[uk]=Засіб керування торбинками -Name[uz]=Qopchiq boshqarish vositasi -Name[uz@cyrillic]=Қопчиқ бошқариш воситаси -Name[zh_CN]=钱包管理工具 -Name[zh_TW]=錢包管理工具 -Exec=kwalletmanager --kwalletd -Icon=kwalletmanager -Type=Application -Terminal=false -X-TDE-StartupNotify=false -NoDisplay=true diff --git a/kwallet/kwalletmanager.cpp b/kwallet/kwalletmanager.cpp deleted file mode 100644 index 7457682..0000000 --- a/kwallet/kwalletmanager.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/* - Copyright (C) 2003,2004 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -#include "kwalletmanager.h" -#include "kwalletpopup.h" -#include "kwalleteditor.h" -#include "allyourbase.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -KWalletManager::KWalletManager(TQWidget *parent, const char *name, WFlags f) -: KMainWindow(parent, name, f), DCOPObject("KWalletManager") { - TDEGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); - _kwalletdLaunch = false; - TQAccel *accel = new TQAccel(this, "kwalletmanager"); - - TDEApplication::dcopClient()->setQtBridgeEnabled(false); - _shuttingDown = false; - TDEConfig cfg("kwalletrc"); // not sure why this setting isn't in kwalletmanagerrc... - TDEConfigGroup walletConfigGroup(&cfg, "Wallet"); - _dcopRef = 0L; - if (walletConfigGroup.readBoolEntry("Launch Manager", true)) { - _tray = new KSystemTray(this, "kwalletmanager tray"); - _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); - TQToolTip::add(_tray, i18n("TDE Wallet: No wallets open.")); - connect(_tray, TQT_SIGNAL(quitSelected()), TQT_SLOT(shuttingDown())); - TQStringList wl = KWallet::Wallet::walletList(); - bool isOpen = false; - for (TQStringList::Iterator it = wl.begin(); it != wl.end(); ++it) { - if (KWallet::Wallet::isOpen(*it)) { - _tray->setPixmap(loadSystemTrayIcon("wallet_open")); - TQToolTip::remove(_tray); - TQToolTip::add(_tray, i18n("TDE Wallet: A wallet is open.")); - isOpen = true; - break; - } - } - if (!isOpen && kapp->isRestored()) { - delete _tray; - _tray = 0L; - TQTimer::singleShot( 0, kapp, TQT_SLOT( quit())); - return; - } - } else { - _tray = 0L; - } - - _iconView = new KWalletIconView(this, "kwalletmanager icon view"); - connect(_iconView, TQT_SIGNAL(executed(TQIconViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(openWallet(TQIconViewItem*))); - connect(_iconView, TQT_SIGNAL(contextMenuRequested(TQIconViewItem*, const TQPoint&)), TQT_TQOBJECT(this), TQT_SLOT(contextMenu(TQIconViewItem*, const TQPoint&))); - - updateWalletDisplay(); - setCentralWidget(_iconView); - _iconView->setMinimumSize(320, 200); - - _dcopRef = new DCOPRef("kded", "kwalletd"); - _dcopRef->dcopClient()->setNotifications(true); - connect(_dcopRef->dcopClient(), - TQT_SIGNAL(applicationRemoved(const TQCString&)), - this, - TQT_SLOT(possiblyRescan(const TQCString&))); - connect(_dcopRef->dcopClient(), - TQT_SIGNAL(applicationRegistered(const TQCString&)), - this, - TQT_SLOT(possiblyRescan(const TQCString&))); - - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "allWalletsClosed()", "allWalletsClosed()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletClosed(TQString)", "updateWalletDisplay()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletOpened(TQString)", "aWalletWasOpened()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletDeleted(TQString)", "updateWalletDisplay()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletListDirty()", "updateWalletDisplay()", false); - - // FIXME: slight race - a wallet can open, then we get launched, but the - // wallet closes before we are done opening. We will then stay - // open. Must check that a wallet is still open here. - - new KAction(i18n("&New Wallet..."), "kwalletmanager", 0, TQT_TQOBJECT(this), - TQT_SLOT(createWallet()), actionCollection(), - "wallet_create"); - KAction *act = new KAction(i18n("Configure &Wallet..."), "configure", - 0, TQT_TQOBJECT(this), TQT_SLOT(setupWallet()), actionCollection(), - "wallet_settings"); - if (_tray) { - act->plug(_tray->contextMenu()); - } - act = new KAction(i18n("Close &All Wallets"), 0, 0, TQT_TQOBJECT(this), - TQT_SLOT(closeAllWallets()), actionCollection(), - "close_all_wallets"); - if (_tray) { - act->plug(_tray->contextMenu()); - } - KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(shuttingDown()), actionCollection()); - KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), -actionCollection()); - - createGUI("kwalletmanager.rc"); - accel->connectItem(accel->insertItem(Key_Return), TQT_TQOBJECT(this), TQT_SLOT(openWallet())); - accel->connectItem(accel->insertItem(Key_Delete), TQT_TQOBJECT(this), TQT_SLOT(deleteWallet())); - - if (_tray) { - _tray->show(); - } else { - show(); - } - - kapp->setName("kwallet"); // hack to fix docs -} - - -KWalletManager::~KWalletManager() { - _tray = 0L; - delete _dcopRef; - _dcopRef = 0L; -} - - -void KWalletManager::kwalletdLaunch() { - _kwalletdLaunch = true; -} - - -bool KWalletManager::queryClose() { - if (!_shuttingDown && !kapp->sessionSaving()) { - if (!_tray) { - kapp->quit(); - } else { - hide(); - } - return false; - } - return true; -} - - -void KWalletManager::aWalletWasOpened() { - if (_tray) { - _tray->setPixmap(loadSystemTrayIcon("wallet_open")); - TQToolTip::remove(_tray); - TQToolTip::add(_tray, i18n("TDE Wallet: A wallet is open.")); - } - updateWalletDisplay(); -} - - -void KWalletManager::updateWalletDisplay() { -TQStringList wl = KWallet::Wallet::walletList(); -TQPtrStack trash; - - for (TQIconViewItem *item = _iconView->firstItem(); item; item = item->nextItem()) { - if (!wl.contains(item->text())) { - trash.push(item); - } - } - - trash.setAutoDelete(true); - trash.clear(); - - for (TQStringList::Iterator i = wl.begin(); i != wl.end(); ++i) { - if (!_iconView->findItem(*i)) { - // FIXME: if KWallet::Wallet::isOpen(*i) then show - // a different icon! - new KWalletItem(_iconView, *i); - } else { - // FIXME: See if icon needs to be updated - } - } -} - - -void KWalletManager::contextMenu(TQIconViewItem *item, const TQPoint& pos) { - if (item) { - TQGuardedPtr popupMenu = new KWalletPopup(item->text(), this); - connect(popupMenu, TQT_SIGNAL(walletOpened(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(openWallet(const TQString&))); - connect(popupMenu, TQT_SIGNAL(walletClosed(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(closeWallet(const TQString&))); - connect(popupMenu, TQT_SIGNAL(walletDeleted(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(deleteWallet(const TQString&))); - connect(popupMenu, TQT_SIGNAL(walletChangePassword(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(changeWalletPassword(const TQString&))); - connect(popupMenu, TQT_SIGNAL(walletCreated()), TQT_TQOBJECT(this), TQT_SLOT(createWallet())); - popupMenu->exec(pos); - delete popupMenu; - } -} - - -void KWalletManager::deleteWallet(const TQString& walletName) { - int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the wallet '%1'?").arg(walletName),"",KStdGuiItem::del()); - if (rc != KMessageBox::Continue) { - return; - } - rc = KWallet::Wallet::deleteWallet(walletName); - if (rc != 0) { - KMessageBox::sorry(this, i18n("Unable to delete the wallet. Error code was %1.").arg(rc)); - } - updateWalletDisplay(); -} - - -void KWalletManager::closeWallet(const TQString& walletName) { - int rc = KWallet::Wallet::closeWallet(walletName, false); - if (rc != 0) { - rc = KMessageBox::warningYesNo(this, i18n("Unable to close wallet cleanly. It is probably in use by other applications. Do you wish to force it closed?"), TQString(), i18n("Force Closure"), i18n("Do Not Force")); - if (rc == KMessageBox::Yes) { - rc = KWallet::Wallet::closeWallet(walletName, true); - if (rc != 0) { - KMessageBox::sorry(this, i18n("Unable to force the wallet closed. Error code was %1.").arg(rc)); - } - } - } - - updateWalletDisplay(); -} - - -void KWalletManager::changeWalletPassword(const TQString& walletName) { - KWallet::Wallet::changePassword(walletName); -} - - -void KWalletManager::openWalletFile(const TQString& path) { - KWalletEditor *we = new KWalletEditor(path, true, this, "Wallet Editor"); - if (we->isOpen()) { - connect(we, TQT_SIGNAL(editorClosed(KMainWindow*)), - this, TQT_SLOT(editorClosed(KMainWindow*))); - we->show(); - } else { - KMessageBox::sorry(this, i18n("Error opening wallet %1.").arg(path)); - delete we; - } -} - - -void KWalletManager::openWallet() { - TQIconViewItem *item = _iconView->currentItem(); - openWallet(item); -} - -void KWalletManager::deleteWallet() { - TQIconViewItem *item = _iconView->currentItem(); - if (item) { - deleteWallet(item->text()); - } -} - - -void KWalletManager::openWallet(const TQString& walletName) { - openWallet(walletName, false); -} - - -void KWalletManager::openWallet(const TQString& walletName, bool newWallet) { - // Don't allow a wallet to open in two windows - for (KMainWindow *w = _windows.first(); w; w = _windows.next()) { - KWalletEditor *e = static_cast(w); - if (e->isOpen() && e->_walletName == walletName) { - w->raise(); - return; - } - } - - KWalletEditor *we = new KWalletEditor(walletName, false, this, "Wallet Editor"); - we->setNewWallet(newWallet); - if (we->isOpen()) { - connect(we, TQT_SIGNAL(editorClosed(KMainWindow*)), - this, TQT_SLOT(editorClosed(KMainWindow*))); - we->show(); - _windows.append(we); - } else if (!newWallet) { - KMessageBox::sorry(this, i18n("Error opening wallet %1.").arg(walletName)); - delete we; - } -} - - -void KWalletManager::openWallet(TQIconViewItem *item) { - if (item) { - openWallet(item->text()); - } -} - - -void KWalletManager::allWalletsClosed() { - if (_tray) { - _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); - TQToolTip::remove(_tray); - TQToolTip::add(_tray, i18n("TDE Wallet: No wallets open.")); - } - possiblyQuit(); -} - - -void KWalletManager::possiblyQuit() { - TDEConfig cfg("kwalletrc"); - cfg.setGroup("Wallet"); - if (_windows.isEmpty() && - !isVisible() && - !cfg.readBoolEntry("Leave Manager Open", false) && - _kwalletdLaunch) { - kapp->quit(); - } -} - - -void KWalletManager::editorClosed(KMainWindow* e) { - _windows.remove(e); -} - - -void KWalletManager::possiblyRescan(const TQCString& app) { - if (app == "kded") { - updateWalletDisplay(); - } -} - - -void KWalletManager::createWallet() { - TQString n; - bool ok; - // FIXME: support international names - TQRegExp regexp("^[A-Za-z0-9]+[A-Za-z0-9_\\s\\-]*$"); - TQString txt = i18n("Please choose a name for the new wallet:"); - - if (!KWallet::Wallet::isEnabled()) { - // FIXME: KMessageBox::warningYesNo(this, i1_8n("KWallet is not enabled. Do you want to enable it?"), TQString(), i18n("Enable"), i18n("Keep Disabled")); - return; - } - - do { - n = KInputDialog::getText(i18n("New Wallet"), - txt, - TQString(), - &ok, - this); - - if (!ok) { - return; - } - - if (_iconView->findItem(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that wallet already exists. Try a new name?"), TQString(), i18n("Try New"), i18n("Do Not Try")); - if (rc == KMessageBox::Yes) { - continue; - } - n = TQString(); - } else if (regexp.exactMatch(n)) { - break; - } else { - txt = i18n("Please choose a name that contains only alphanumeric characters:"); - } - } while (true); - - // Small race here - the wallet could be created on us already. - if (!n.isEmpty()) { - openWallet(n, true); - } -} - - -void KWalletManager::shuttingDown() { - _shuttingDown = true; - kapp->quit(); -} - - -void KWalletManager::setupWallet() { - TDEApplication::startServiceByDesktopName("kwallet_config"); -} - - -void KWalletManager::closeAllWallets() { - _dcopRef->call("closeAllWallets"); -} - - -TQPixmap KWalletManager::loadSystemTrayIcon(const TQString &icon) { -#if KDE_IS_VERSION(3, 1, 90) - return KSystemTray::loadIcon(icon); -#else - TDEConfig *appCfg = kapp->config(); - TDEConfigGroupSaver configSaver(appCfg, "System Tray"); - int iconWidth = appCfg->readNumEntry("systrayIconWidth", 22); - return kapp->iconLoader()->loadIcon( icon, KIcon::Panel, iconWidth ); -#endif -} - - -#include "kwalletmanager.moc" diff --git a/kwallet/kwalletmanager.desktop b/kwallet/kwalletmanager.desktop deleted file mode 100644 index 15a8b05..0000000 --- a/kwallet/kwalletmanager.desktop +++ /dev/null @@ -1,63 +0,0 @@ -[Desktop Entry] -Name=Wallet Management Tool -Name[ar]=أداة إدارة المحفظة -Name[bg]=Портфейл -Name[br]=Merour an doug-paperoù -Name[bs]=Alat za upravljanje novčanikom -Name[ca]=Eina de gestió de carteres -Name[cs]=Nástroj pro správu úschovny -Name[cy]=Erfyn Rheoli Waled -Name[da]=Håndteringsværktøj for tegnebog -Name[de]=Verwaltung für digitale Brieftasche -Name[el]=Εργαλείο διαχείρισης πορτοφολιού -Name[es]=Herramienta de gestión de cartera -Name[et]=Turvalaeka haldur -Name[eu]=Kartera Kudeatzeko Tresna -Name[fa]=ابزار مدیریت Wallet -Name[fi]=Lompakon hallintatyökalu -Name[fr]=Outil de gestion de comptes -Name[ga]=Uirlis Bhainisteoireachta Wallet -Name[he]=כלי לניהול הארנק של TDE -Name[hi]= बटुआ प्रबंधन औज़ार -Name[hu]=Kezelőprogram a TDE digitális noteszeihez -Name[is]=Tól til að stýra eiginleikum veskisins -Name[it]=Strumento per la gestione dei portafogli -Name[ja]=ウォレット管理ツール -Name[ka]=Wallet-ის მმართველი მოწყობილობა -Name[kk]=Әмиянін басқару құралы -Name[km]=ឧបករណ៍​គ្រប់គ្រង​កាបូប -Name[lt]=Spatažodinių tvarkymo įrankis -Name[mk]=Алатка за менаџирање на паричници -Name[nb]=Wallet administrasjonsverktøy -Name[nds]=Knipp-Pleger -Name[ne]=वालेट व्यवस्थापन उपकरण -Name[nl]=Portefeuillebeheer -Name[nn]=Wallet-administrasjonsverktøy -Name[pa]=ਵਾਲਿਟ ਪਰਬੰਧਨ ਸੰਦ -Name[pl]=Narzędzie do zarządzania Portfelem -Name[pt]=Ferramenta de Gestão da Carteira -Name[pt_BR]=Ferramenta de Gerenciamento da Carteira -Name[ro]=Administrare portofel -Name[ru]=Управление паролями -Name[sk]=Nástroj na správu KWallet -Name[sl]=Orodje za upravljanje z listnicami -Name[sr]=Алат за управљање новчаником -Name[sr@Latn]=Alat za upravljanje novčanikom -Name[sv]=Hanteringsverktyg för plånbok -Name[ta]=வாலட் மேலாண்மை கருவி -Name[tg]=Асбоби Идоракунии Ҳамён -Name[tr]=Cüzdan Yönetim Aracı -Name[uk]=Засіб керування торбинками -Name[uz]=Qopchiq boshqarish vositasi -Name[uz@cyrillic]=Қопчиқ бошқариш воситаси -Name[zh_CN]=钱包管理工具 -Name[zh_TW]=錢包管理工具 -Exec=kwalletmanager %u -MimeType=application/x-kde-wallet; -InitialPreference=6 -Icon=kwalletmanager -Type=Application -Terminal=false -X-TDE-StartupNotify=false -Categories=Qt;TDE;Settings; -DocPath=kwallet/index.html diff --git a/kwallet/kwalletmanager.h b/kwallet/kwalletmanager.h deleted file mode 100644 index 1cec995..0000000 --- a/kwallet/kwalletmanager.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2003,2004 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KWALLETMANAGER_H -#define KWALLETMANAGER_H - -#include -#include -#include - -class KSystemTray; -class KWalletIconView; -class TQIconViewItem; -class DCOPRef; - - -class KWalletManager : public KMainWindow, public DCOPObject { - Q_OBJECT -// - K_DCOP - - public: - KWalletManager(TQWidget *parent = 0, const char* name = 0, WFlags f = 0); - virtual ~KWalletManager(); - - TQPixmap loadSystemTrayIcon(const TQString &icon); - - void kwalletdLaunch(); - - public slots: - void createWallet(); - void deleteWallet(const TQString& walletName); - void closeWallet(const TQString& walletName); - void changeWalletPassword(const TQString& walletName); - void openWallet(const TQString& walletName); - void openWallet(const TQString& walletName, bool newWallet); - void openWalletFile(const TQString& path); - void openWallet(TQIconViewItem *item); - void contextMenu(TQIconViewItem *item, const TQPoint& pos); - - protected: - virtual bool queryClose(); - - private: - k_dcop: - ASYNC allWalletsClosed(); - ASYNC updateWalletDisplay(); - ASYNC aWalletWasOpened(); - - private slots: - void shuttingDown(); - void possiblyQuit(); - void editorClosed(KMainWindow* e); - void possiblyRescan(const TQCString& app); - void setupWallet(); - void openWallet(); - void deleteWallet(); - void closeAllWallets(); - - private: - KSystemTray *_tray; - bool _shuttingDown; - KWalletIconView *_iconView; - DCOPRef *_dcopRef; - TQPtrList _windows; - bool _kwalletdLaunch; -}; - -#endif diff --git a/kwallet/kwalletmanager.rc b/kwallet/kwalletmanager.rc deleted file mode 100644 index a1fd2c8..0000000 --- a/kwallet/kwalletmanager.rc +++ /dev/null @@ -1,14 +0,0 @@ - - - - &File - - - - &Settings - - - &Help - - - diff --git a/kwallet/kwalletpopup.cpp b/kwallet/kwalletpopup.cpp deleted file mode 100644 index 032ec8a..0000000 --- a/kwallet/kwalletpopup.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - Copyright (C) 2003 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -#include "kwalletpopup.h" - -#include -#include -#include -#include -#include -#include -#include - -KWalletPopup::KWalletPopup(const TQString& wallet, TQWidget *parent, const char *name) -: KPopupMenu(parent, name), _walletName(wallet) { - insertTitle(wallet); - KActionCollection *ac = new KActionCollection(this, "kwallet context actions"); - KAction *act; - - act = new KAction(i18n("&New Wallet..."), 0, 0, TQT_TQOBJECT(this), - TQT_SLOT(createWallet()), ac, "wallet_create"); - act->plug(this); - - act = new KAction(i18n("&Open..."), 0, Key_Return, TQT_TQOBJECT(this), - TQT_SLOT(openWallet()), ac, "wallet_open"); - act->plug(this); - - act = new KAction(i18n("Change &Password..."), 0, 0, TQT_TQOBJECT(this), - TQT_SLOT(changeWalletPassword()), ac, "wallet_password"); - act->plug(this); - - TQStringList ul = KWallet::Wallet::users(wallet); - if (!ul.isEmpty()) { - KPopupMenu *pm = new KPopupMenu(this, "Disconnect Apps"); - int id = 7000; - for (TQStringList::Iterator it = ul.begin(); it != ul.end(); ++it) { - _appMap[id] = *it; - pm->insertItem(*it, this, TQT_SLOT(disconnectApp(int)), 0, id); - pm->setItemParameter(id, id); - id++; - } - - insertItem(i18n("Disconnec&t"), pm); - } - - act = KStdAction::close( TQT_TQOBJECT(this), - TQT_SLOT(closeWallet()), ac, "wallet_close"); - // FIXME: let's track this inside the manager so we don't need a dcop - // roundtrip here. - act->setEnabled(KWallet::Wallet::isOpen(wallet)); - act->plug(this); - - act = new KAction(i18n("&Delete"), 0, Key_Delete, TQT_TQOBJECT(this), - TQT_SLOT(deleteWallet()), ac, "wallet_delete"); - act->plug(this); -} - - -KWalletPopup::~KWalletPopup() { -} - - -void KWalletPopup::openWallet() { - emit walletOpened(_walletName); -} - - -void KWalletPopup::deleteWallet() { - emit walletDeleted(_walletName); -} - - -void KWalletPopup::closeWallet() { - emit walletClosed(_walletName); -} - - -void KWalletPopup::changeWalletPassword() { - emit walletChangePassword(_walletName); -} - - -void KWalletPopup::createWallet() { - emit walletCreated(); -} - - -void KWalletPopup::disconnectApp(int id) { - KWallet::Wallet::disconnectApplication(_walletName, _appMap[id].latin1()); -} - -#include "kwalletpopup.moc" - diff --git a/kwallet/kwalletpopup.h b/kwallet/kwalletpopup.h deleted file mode 100644 index 8ef78b0..0000000 --- a/kwallet/kwalletpopup.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2003 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KWALLETPOPUP_H -#define KWALLETPOPUP_H - -#include -#include -#include - -class KWalletPopup : public KPopupMenu { - Q_OBJECT - - - public: - KWalletPopup(const TQString& wallet, TQWidget *parent = 0, const char* name = 0); - virtual ~KWalletPopup(); - - public slots: - void openWallet(); - void deleteWallet(); - void closeWallet(); - void createWallet(); - void changeWalletPassword(); - void disconnectApp(int); - - signals: - void walletOpened(const TQString& walletName); - void walletClosed(const TQString& walletName); - void walletDeleted(const TQString& walletName); - void walletCreated(); - void walletChangePassword(const TQString& walletName); - - private: - TQString _walletName; - TQMap _appMap; -}; - -#endif diff --git a/kwallet/kwmapeditor.cpp b/kwallet/kwmapeditor.cpp deleted file mode 100644 index 2a9e332..0000000 --- a/kwallet/kwmapeditor.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/* - Copyright (C) 2003,2004 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "kwmapeditor.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -KWMapEditor::KWMapEditor(TQMap& map, TQWidget *parent, const char *name) -: TQTable(0, 3, parent, name), _map(map) { - _ac = new KActionCollection(this); - _copyAct = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copy()), _ac); - connect(this, TQT_SIGNAL(valueChanged(int,int)), this, TQT_SIGNAL(dirty())); - connect(this, TQT_SIGNAL(contextMenuRequested(int,int,const TQPoint&)), - this, TQT_SLOT(contextMenu(int,int,const TQPoint&))); - setSelectionMode(TQTable::NoSelection); - horizontalHeader()->setLabel(0, TQString()); - horizontalHeader()->setLabel(1, i18n("Key")); - horizontalHeader()->setLabel(2, i18n("Value")); - setColumnWidth(0, 20); // FIXME: this is arbitrary - reload(); -} - -void KWMapEditor::reload() { - unsigned row = 0; - - while ((row = numRows()) > _map.count()) { - removeRow(row - 1); - } - - if ((row = numRows()) < _map.count()) { - insertRows(row, _map.count() - row); - for (int x = row; x < numRows(); ++x) { - TQPushButton *b = new TQPushButton("X", this); - connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(erase())); - setCellWidget(x, 0, b); - } - } - - row = 0; - for (TQMap::Iterator it = _map.begin(); it != _map.end(); ++it) { - setText(row, 1, it.key()); - setText(row, 2, it.data()); - row++; - } -} - - -KWMapEditor::~KWMapEditor() { -} - - -void KWMapEditor::erase() { - const TQObject *o = TQT_TQOBJECT(const_cast(sender())); - for (int i = 0; i < numRows(); i++) { - if (TQT_BASE_OBJECT_CONST(cellWidget(i, 0)) == TQT_BASE_OBJECT_CONST(o)) { - removeRow(i); - break; - } - } - - emit dirty(); -} - - -void KWMapEditor::saveMap() { - _map.clear(); - - for (int i = 0; i < numRows(); i++) { - _map[text(i, 1)] = text(i, 2); - } -} - - -void KWMapEditor::addEntry() { - int x = numRows(); - insertRows(x, 1); - TQPushButton *b = new TQPushButton("X", this); - connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(erase())); - setCellWidget(x, 0, b); - ensureCellVisible(x, 1); - setCurrentCell(x, 1); - emit dirty(); -} - - -void KWMapEditor::emitDirty() { - emit dirty(); -} - - -void KWMapEditor::contextMenu(int row, int col, const TQPoint& pos) { - _contextRow = row; - _contextCol = col; - KPopupMenu *m = new KPopupMenu(this); - m->insertItem(i18n("&New Entry"), this, TQT_SLOT(addEntry())); - _copyAct->plug(m); - m->popup(pos); -} - - -void KWMapEditor::copy() { - TQApplication::clipboard()->setText(text(_contextRow, 2)); -} - - -class InlineEditor : public TQTextEdit { - public: - InlineEditor(KWMapEditor *p, int row, int col) - : TQTextEdit(), _p(p), row(row), col(col) { - setWFlags(WStyle_NoBorder | WDestructiveClose); - KWin::setType(winId(), NET::Override); - connect(p, TQT_SIGNAL(destroyed()), TQT_SLOT(close())); - } - virtual ~InlineEditor() { if (!_p) return; _p->setText(row, col, text()); _p->emitDirty(); } - - protected: - virtual void focusOutEvent(TQFocusEvent* fe) { - if (fe->reason() == TQFocusEvent::Popup) { - TQWidget *focusW = tqApp->focusWidget(); - if (focusW && focusW == popup) { - return; - } - } - close(); - } - virtual void keyPressEvent(TQKeyEvent *e) { - if (e->key() == TQt::Key_Escape) { - e->accept(); - close(); - } else { - e->ignore(); - TQTextEdit::keyPressEvent(e); - } - } - virtual TQPopupMenu *createPopupMenu(const TQPoint &p) { - popup = TQTextEdit::createPopupMenu(p); - return popup; - } - TQGuardedPtr _p; - int row, col; - TQGuardedPtr popup; -}; - - -TQWidget *KWMapEditor::beginEdit(int row, int col, bool replace) { - //kdDebug(2300) << "EDIT COLUMN " << col << endl; - if (col != 2) { - return TQTable::beginEdit(row, col, replace); - } - - TQRect geo = cellGeometry(row, col); - TQTextEdit *e = new InlineEditor(this, row, col); - e->setText(text(row, col)); - e->move(mapToGlobal(geo.topLeft())); - e->resize(geo.width() * 2, geo.height() * 3); - e->show(); - return e; -} - - -#include "kwmapeditor.moc" diff --git a/kwallet/kwmapeditor.h b/kwallet/kwmapeditor.h deleted file mode 100644 index 0fade7b..0000000 --- a/kwallet/kwmapeditor.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2003,2004 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KWMAPEDITOR_H -#define KWMAPEDITOR_H - -#include -#include -#include - -class KAction; -class KActionCollection; - -class KWMapEditor : public TQTable { - Q_OBJECT - - - public: - KWMapEditor(TQMap& map, TQWidget *parent = 0, const char *name = 0); - virtual ~KWMapEditor(); - - public slots: - void reload(); - void saveMap(); - void erase(); - void contextMenu(int row, int col, const TQPoint& pos); - void addEntry(); - void emitDirty(); - - private slots: - void copy(); - - protected: - virtual TQWidget *beginEdit(int row, int col, bool replace); - - signals: - void dirty(); - - private: - TQMap& _map; - int _contextRow, _contextCol; - KActionCollection *_ac; - KAction *_copyAct; -}; - -#endif diff --git a/kwallet/main.cpp b/kwallet/main.cpp deleted file mode 100644 index 5790ef9..0000000 --- a/kwallet/main.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright (C) 2003-2005 George Staikos - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "kwalletmanager.h" - - -class MyApp : public KUniqueApplication { - public: - MyApp() : KUniqueApplication() { ref(); } - virtual ~MyApp() {} - - virtual int newInstance() { return 0; } -}; - -int main(int argc, char **argv) { - static KCmdLineOptions options[] = { - {"show", I18N_NOOP("Show window on startup"), 0}, - {"kwalletd", I18N_NOOP("For use by kwalletd only"), 0}, - {"+name", I18N_NOOP("A wallet name"), 0}, - KCmdLineLastOption - }; - - TDEAboutData about("kwalletmanager", I18N_NOOP("TDE Wallet Manager"), "1.1", - I18N_NOOP("TDE Wallet Management Tool"), - TDEAboutData::License_GPL, - I18N_NOOP("(c) 2003,2004 George Staikos"), 0, - "http://www.kde.org/"); - - about.addAuthor("George Staikos", I18N_NOOP("Primary author and maintainer"), "staikos@kde.org"); - about.addAuthor("Isaac Clerencia", I18N_NOOP("Developer"), "isaac@warp.es"); - - TDECmdLineArgs::init(argc, argv, &about); - TDECmdLineArgs::addCmdLineOptions(options); - - if (!KUniqueApplication::start()) { - return 0; - } - - MyApp a; - - KWalletManager wm; - wm.setCaption(i18n("TDE Wallet Manager")); - - a.setMainWidget(&wm); - - TDEGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - if (args->isSet("show")) { - wm.show(); - } - - if (args->isSet("kwalletd")) { - wm.kwalletdLaunch(); - } - - for (int i = 0; i < args->count(); ++i) { - TQString fn = TQFileInfo(args->arg(i)).absFilePath(); - KMimeType::Ptr ptr; - if (TQFile::exists(fn) && - (ptr = KMimeType::findByFileContent(fn)) && - ptr->is("application/x-kde-wallet")) { - wm.openWalletFile(fn); - } else { - wm.openWallet(args->arg(i)); - } - } - args->clear(); - return a.exec(); -} - diff --git a/kwallet/walletwidget.ui b/kwallet/walletwidget.ui deleted file mode 100644 index 9979097..0000000 --- a/kwallet/walletwidget.ui +++ /dev/null @@ -1,416 +0,0 @@ - -WalletWidget - - - WalletWidget - - - - 0 - 0 - 614 - 507 - - - - - unnamed - - - 0 - - - - _splitter - - - Horizontal - - - - _entryListFrame - - - - 5 - 5 - 0 - 0 - - - - NoFrame - - - Plain - - - - - layout3 - - - - unnamed - - - - _entryName - - - - 5 - 1 - 0 - 0 - - - - - - - PlainText - - - - - spacer1 - - - Horizontal - - - Expanding - - - - 227 - 21 - - - - - - _undoChanges - - - false - - - &Undo - - - "undo" - - - - - layout2 - - - - unnamed - - - - _iconTitle - - - - 1 - 1 - 0 - 0 - - - - - - - - - _entryTitle - - - - 7 - 1 - 0 - 0 - - - - - 1 - - - - - - - RichText - - - AlignVCenter - - - - - - - _saveChanges - - - false - - - &Save - - - "filesave" - - - - - _entryStack - - - - 5 - 5 - 0 - 1 - - - - - page - - - 0 - - - - - page - - - 1 - - - - unnamed - - - 0 - - - - _passwordValue - - - PlainText - - - - - spacer8 - - - Horizontal - - - Expanding - - - - 271 - 20 - - - - - - _hideContents - - - Hide &Contents - - - - - - - page - - - 2 - - - - - page - - - 3 - - - - unnamed - - - 0 - - - - textLabel1_2 - - - This is a binary data entry. It cannot be editted as its format is unknown and application specific. - - - WordBreak|AlignVCenter - - - - - spacer3 - - - Vertical - - - Expanding - - - - 31 - 41 - - - - - - spacer4 - - - Vertical - - - Expanding - - - - 31 - 41 - - - - - - spacer5 - - - Horizontal - - - Expanding - - - - 61 - 41 - - - - - - spacer6 - - - Horizontal - - - Expanding - - - - 41 - 21 - - - - - - - - page - - - 4 - - - - unnamed - - - 0 - - - - spacer7 - - - Horizontal - - - Expanding - - - - 236 - 21 - - - - - - spacer6_2 - - - Vertical - - - Expanding - - - - 31 - 358 - - - - - - _showContents - - - Show &Contents - - - - - - - - - - - - kdialog.h - kiconloader.h - -SmallIconSet - - - diff --git a/superkaramba/src/Makefile.am b/superkaramba/src/Makefile.am index 1bdfd1b..374c552 100644 --- a/superkaramba/src/Makefile.am +++ b/superkaramba/src/Makefile.am @@ -40,7 +40,7 @@ superkaramba_SOURCES = main.cpp karamba.cpp meter.cpp bar.cpp sensor.cpp \ # kde_cfg_DATA = superkaramba.kcfg -superkaramba_LDFLAGS = -Wl,-export-dynamic $(KDE_RPATH) $(all_libraries) $(PYTHONLIB) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +superkaramba_LDFLAGS = -Wl,-export-dynamic $(KDE_RPATH) $(all_libraries) $(PYTHONLIB) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor #superkaramba_LDADD = -lkio $(LIB_TDEUI) $(LIBPYTHON) $(LIBKVM) $(MY_LIBKNEWSTUFF) superkaramba_LDADD = -lkio $(LIB_TDEUI) $(LIBPYTHON) $(LIBKVM) $(MY_LIBKNEWSTUFF) diff --git a/superkaramba/src/karamba.cpp b/superkaramba/src/karamba.cpp index c61f6f8..466c1c3 100644 --- a/superkaramba/src/karamba.cpp +++ b/superkaramba/src/karamba.cpp @@ -39,8 +39,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tdewallet/CMakeLists.txt b/tdewallet/CMakeLists.txt new file mode 100644 index 0000000..e4cedbe --- /dev/null +++ b/tdewallet/CMakeLists.txt @@ -0,0 +1,55 @@ +################################################# +# +# (C) 2012 Golubev Alexander +# fatzer2 (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( icons ) +add_subdirectory( konfigurator ) + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### tdewalletmanager (executable) ############### + +tde_add_executable( tdewalletmanager AUTOMOC + SOURCES walletwidget.ui tdewalletmanager.cpp + tdewalletmanager.skel main.cpp tdewalletpopup.cpp + tdewalleteditor.cpp kwmapeditor.cpp + allyourbase.cpp kbetterthankdialogbase.ui + LINK kio-shared + DESTINATION ${BIN_INSTALL_DIR} +) + + +##### icons ##################################### + +tde_install_icons( tdewalletmanager) + + +##### other data ################################ + +install( FILES tdewalletmanager.rc tdewalleteditor.rc + DESTINATION ${DATA_INSTALL_DIR}/tdewalletmanager +) + +install( FILES tdewalletmanager.desktop + tdewalletmanager-tdewalletd.desktop + DESTINATION ${XDG_APPS_INSTALL_DIR} +) + diff --git a/tdewallet/Makefile.am b/tdewallet/Makefile.am new file mode 100644 index 0000000..d3d62cd --- /dev/null +++ b/tdewallet/Makefile.am @@ -0,0 +1,26 @@ +INCLUDES= $(all_includes) + +SUBDIRS=. icons konfigurator + +bin_PROGRAMS = tdewalletmanager +tdewalletmanager_SOURCES = walletwidget.ui tdewalletmanager.cpp \ + tdewalletmanager.skel main.cpp tdewalletpopup.cpp \ + tdewalleteditor.cpp kwmapeditor.cpp allyourbase.cpp \ + kbetterthankdialogbase.ui +tdewalletmanager_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +tdewalletmanager_LDADD = $(LIB_KIO) -ltdewalletclient +METASOURCES = AUTO +noinst_HEADERS = tdewalletmanager.h tdewalletpopup.h walletwidget.h tdewalleteditor.h\ + allyourbase.h kwmapeditor.h + +xdg_apps_DATA = tdewalletmanager.desktop tdewalletmanager-tdewalletd.desktop + +KDE_ICON = tdewalletmanager + +rc_DATA = tdewalletmanager.rc tdewalleteditor.rc +rcdir = $(kde_datadir)/tdewalletmanager + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/tdewalletmanager.pot + +kbetterthankdialogbase.lo: kbetterthankdialogbase.ui kbetterthankdialogbase.ui.h diff --git a/tdewallet/TODO b/tdewallet/TODO new file mode 100644 index 0000000..145fa7b --- /dev/null +++ b/tdewallet/TODO @@ -0,0 +1,13 @@ +Things left: + +Backend: +- test 64 bit, zSeries +- refactor the hashes to make it efficient + +Integration: +- Cookie jar +- KMail + +Future ideas: +- Make it a kpart + diff --git a/tdewallet/allyourbase.cpp b/tdewallet/allyourbase.cpp new file mode 100644 index 0000000..97b55d8 --- /dev/null +++ b/tdewallet/allyourbase.cpp @@ -0,0 +1,733 @@ +/* + Copyright (C) 2003-2005 George Staikos + Copyright (C) 2005 Isaac Clerencia + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "allyourbase.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/**************** + * KWalletFolderItem - ListView items to represent tdewallet folders + */ +KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, TQListView* parent, const TQString &name, int entries) +: KListViewItem(parent),_wallet(w),_name(name),_entries(entries) { + setText(0, TQString("%1 (%2)").arg(_name).arg(_entries)); + setRenameEnabled(0, false); + setDragEnabled(true); + setDropEnabled(true); + + TQPixmap pix = getFolderIcon(KIcon::Small); + + setPixmap(0,pix); +} + +TQPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){ + KIconLoader *loader = TDEGlobal::instance()->iconLoader(); + TQPixmap pix = loader->loadIcon( _name, group, 0, + KIcon::DefaultState, 0, true ); + if (pix.isNull()) + pix = loader->loadIcon( _name.lower(), group, 0, + KIcon::DefaultState, 0, true); + if (pix.isNull()) + pix = loader->loadIcon( "folder_red", group, 0, + KIcon::DefaultState, 0, true); + return pix; +} + +void KWalletFolderItem::refresh() { + TQString saveFolder = _wallet->currentFolder(); + _wallet->setFolder(_name); + setText(0, TQString("%1 (%2)").arg(_name).arg(_wallet->entryList().count())); + _wallet->setFolder(saveFolder); +} + +KWalletContainerItem* KWalletFolderItem::getContainer(KWallet::Wallet::EntryType type) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { + KWalletContainerItem *ci = dynamic_cast(i); + if (!ci) { + continue; + } + if (ci->type() == type) { + return ci; + } + } + return 0; +} + +bool KWalletFolderItem::contains(const TQString& key) { + return (getItem(key) != 0); +} + +TQListViewItem* KWalletFolderItem::getItem(const TQString& key) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { + KWalletContainerItem *ci = dynamic_cast(i); + if (!ci) { + continue; + } + TQListViewItem *tmp = ci->getItem(key); + if (tmp) { + return tmp; + } + } + return 0; +} + +bool KWalletFolderItem::acceptDrop(const TQMimeSource *mime) const { + return mime->provides("application/x-tdewallet-entry") || + mime->provides("text/uri-list"); +} + +int KWalletFolderItem::rtti() const { + return KWalletFolderItemClass; +} + +TQString KWalletFolderItem::name() const { + return _name; +} + +KWalletFolderItem::~KWalletFolderItem() { +} + +/**************** + * KWalletContainerItem - ListView items to represent tdewallet containers, i.e. + * passwords, maps, ... + */ +KWalletContainerItem::KWalletContainerItem(TQListViewItem* parent, const TQString &name, KWallet::Wallet::EntryType type) +: KListViewItem(parent, name), _type(type) { + setRenameEnabled(0, false); + setDragEnabled(true); +} + +KWalletContainerItem::~KWalletContainerItem() { +} + +int KWalletContainerItem::rtti() const { + return KWalletContainerItemClass; +} + +KWallet::Wallet::EntryType KWalletContainerItem::type() { + return _type; +} + +bool KWalletContainerItem::contains(const TQString& key) { + return getItem(key) != 0; +} + +TQListViewItem *KWalletContainerItem::getItem(const TQString& key) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { + if (i->text(0) == key) { + return i; + } + } + return 0; +} + +/**************** + * KWalletEntryItem - ListView items to represent tdewallet entries + */ +KWalletEntryItem::KWalletEntryItem(KWallet::Wallet *w, TQListViewItem* parent, const TQString& ename) +: KListViewItem(parent, ename), _wallet(w), _oldName(ename) { + setRenameEnabled(0, true); + setDragEnabled(true); +} + +int KWalletEntryItem::rtti() const { + return KWalletEntryItemClass; +} + +KWalletEntryItem::~KWalletEntryItem() { +} + +/**************** + * KWalletItem - IconView items to represent wallets + */ +KWalletItem::KWalletItem(TQIconView *parent, const TQString& walletName) +: TQIconViewItem(parent, walletName, DesktopIcon("tdewalletmanager")) { +} + +KWalletItem::~KWalletItem() { +} + +bool KWalletItem::acceptDrop(const TQMimeSource *mime) const { + return mime->provides("application/x-tdewallet-folder") || + mime->provides("text/uri-list"); +} + +static bool decodeEntry(KWallet::Wallet *_wallet, TQDataStream& ds) { + TQ_UINT32 magic; + ds >> magic; + if (magic != KWALLETENTRYMAGIC) { + kdDebug() << "bad magic" << endl; + return false; + } + TQString name; + TQByteArray value; + KWallet::Wallet::EntryType et; + ds >> name; + if (_wallet->hasEntry(name)) { + int rc = KMessageBox::warningContinueCancel(0L, i18n("An entry by the name '%1' already exists. Would you like to continue?").arg(name)); + if (rc == KMessageBox::Cancel) { + return false; + } + } + long l; + ds >> l; + et = KWallet::Wallet::EntryType(l); + ds >> value; + _wallet->writeEntry(name, value, et); + return true; +} + +static bool decodeFolder(KWallet::Wallet *_wallet, TQDataStream& ds) { + TQ_UINT32 magic; + ds >> magic; + if (magic != KWALLETFOLDERMAGIC) { + kdDebug() << "bad magic" << endl; + return false; + } + TQString folder; + ds >> folder; + if (_wallet->hasFolder(folder)) { + int rc = KMessageBox::warningYesNoCancel(0L, i18n("A folder by the name '%1' already exists. What would you like to do?").arg(folder), TQString(), KStdGuiItem::cont(), i18n("Replace")); + if (rc == KMessageBox::Cancel) { + return false; + } + if (rc == KMessageBox::No) { + _wallet->removeFolder(folder); + _wallet->createFolder(folder); + } + } else { + _wallet->createFolder(folder); + } + + _wallet->setFolder(folder); + while (!ds.atEnd()) { + TQString name; + TQByteArray value; + KWallet::Wallet::EntryType et; + ds >> name; + long l; + ds >> l; + et = KWallet::Wallet::EntryType(l); + ds >> value; + _wallet->writeEntry(name, value, et); + } + return true; +} + +void KWalletItem::dropped(TQDropEvent *e, const TQValueList& lst) { + Q_UNUSED(lst); + if (e->provides("application/x-tdewallet-folder") || + e->provides("text/uri-list")) { + + // FIXME: don't allow the drop if the wallet name is the same + + KWallet::Wallet *_wallet = KWallet::Wallet::openWallet(text()); + if (!_wallet) { + e->ignore(); + return; + } + + TQString saveFolder = _wallet->currentFolder(); + + TQFile file; + TQDataStream *ds = 0L; + + if (e->provides("application/x-tdewallet-folder")) { + TQByteArray edata = e->encodedData("application/x-tdewallet-folder"); + if (!edata.isEmpty()) { + ds = new TQDataStream(edata, IO_ReadOnly); + } + } else { // text/uri-list + TQStrList urls; + TQUriDrag::decode(e, urls); + + if (urls.isEmpty()) { + e->ignore(); + return; + } + + KURL u(urls.first()); + if (u.fileName().isEmpty()) { + e->ignore(); + return; + } + TQString tmpFile; + if (TDEIO::NetAccess::download(u, tmpFile, 0L)) { + file.setName(tmpFile); + file.open(IO_ReadOnly); + ds = new TQDataStream(&file); + TDEIO::NetAccess::removeTempFile(tmpFile); + } else { + KMessageBox::error(iconView(), TDEIO::NetAccess::lastErrorString()); + } + } + if (ds) { + decodeFolder(_wallet, *ds); + delete ds; + } + _wallet->setFolder(saveFolder); + delete _wallet; + + //delete the folder from the source if we were moving + TQt::ButtonState state = kapp->keyboardMouseState(); + if (e->source() && e->source()->parent() && + !strcmp(e->source()->parent()->className(), "KWalletEntryList") && + !(state & TQt::ControlButton)) { + + KWalletEntryList *el = + dynamic_cast(e->source()->parent()); + if (el) { + KWalletFolderItem *fi = + dynamic_cast(el->selectedItem()); + if (fi) { + el->_wallet->removeFolder(fi->name()); + } + } + } + e->accept(); + } else { + e->ignore(); + return; + } +} + +/**************** + * KWalletEntryDrag - Stores data for wallet entry drags + */ +class KWalletEntryDrag : public TQStoredDrag { + public: + KWalletEntryDrag(TQWidget *dragSource, const char *name = 0L) + : TQStoredDrag("application/x-tdewallet-entry", dragSource, name) { + } + + virtual ~KWalletEntryDrag() {} +}; + +/**************** + * KWalletFolderDrag - Stores data for wallet folder drags + */ +class KWalletFolderDrag : public TQStoredDrag { + public: + KWalletFolderDrag(TQWidget *dragSource, const char *name = 0L) + : TQStoredDrag("application/x-tdewallet-folder", dragSource, name) { + } + + virtual ~KWalletFolderDrag() {} +}; + +/**************** + * KWalletEntryList - A listview to store wallet entries + */ +KWalletEntryList::KWalletEntryList(TQWidget *parent, const char *name) +: KListView(parent, name) { + addColumn(i18n("Folders")); + setRootIsDecorated(true); + setDefaultRenameAction(Reject); + setAcceptDrops(true); + setItemsMovable(false); + setDropVisualizer(false); + viewport()->setAcceptDrops(true); +} + +KWalletEntryList::~KWalletEntryList() { +} + +bool KWalletEntryList::acceptDrag(TQDropEvent* e) const { + TQListViewItem *i = itemAt(contentsToViewport(e->pos())); + if (i) { + if (e->provides("application/x-tdewallet-entry") || + e->provides("text/uri-list")) { + return true; + } + } + if ((e->provides("application/x-tdewallet-folder") && + e->source() != viewport()) || + e->provides("text/uri-list")) { + return true; + } + return false; +} + +//returns true if the item has been dropped successfully +void KWalletEntryList::itemDropped(TQDropEvent *e, TQListViewItem *item) { + bool ok = true; + bool isEntry; + TQFile file; + TQDataStream *ds; + + KWalletEntryList *el = 0L; + TQListViewItem *sel = 0L; + + //detect if we are dragging from tdewallet itself + if (e->source() && e->source()->parent() && + !strcmp(e->source()->parent()->className(), "KWalletEntryList")) { + + el = dynamic_cast(e->source()->parent()); + if (!el) { + KMessageBox::error(this, i18n("An unexpected error occurred trying to drop the item")); + } else + sel = el->selectedItem(); + } + + if (e->provides("application/x-tdewallet-entry")) { + //do nothing if we are in the same folder + if (sel && sel->parent()->parent() == + KWalletEntryList::getItemFolder(item)) { + e->ignore(); + return; + } + isEntry = true; + TQByteArray data = e->encodedData("application/x-tdewallet-entry"); + if (data.isEmpty()) { + e->ignore(); + return; + } + ds = new TQDataStream(data, IO_ReadOnly); + } else if (e->provides("application/x-tdewallet-folder")) { + //do nothing if we are in the same wallet + if (this == el) { + e->ignore(); + return; + } + isEntry = false; + TQByteArray data = e->encodedData("application/x-tdewallet-folder"); + if (data.isEmpty()) { + e->ignore(); + return; + } + ds = new TQDataStream(data, IO_ReadOnly); + } else if (e->provides("text/uri-list")) { + TQStrList urls; + TQUriDrag::decode(e, urls); + if (urls.isEmpty()) { + e->ignore(); + return; + } + KURL u(urls.first()); + if (u.fileName().isEmpty()) { + e->ignore(); + return; + } + TQString tmpFile; + if (TDEIO::NetAccess::download(u, tmpFile, 0L)) { + file.setName(tmpFile); + file.open(IO_ReadOnly); + ds = new TQDataStream(&file); + //check magic to discover mime type + TQ_UINT32 magic; + (*ds) >> magic; + if (magic == KWALLETENTRYMAGIC) { + isEntry = true; + } else if (magic == KWALLETFOLDERMAGIC) { + isEntry = false; + } else { + kdDebug() << "bad magic" << endl; + e->ignore(); + return; + } + delete ds; + //set the file back to the beginning + file.reset(); + ds = new TQDataStream(&file); + TDEIO::NetAccess::removeTempFile(tmpFile); + } else { + KMessageBox::error(this, TDEIO::NetAccess::lastErrorString()); + return; + } + } else { + e->ignore(); + return; + } + TQt::ButtonState state = kapp->keyboardMouseState(); + if (isEntry) { + if (!item) { + e->ignore(); + return; + } + KWalletFolderItem *fi = KWalletEntryList::getItemFolder(item); + if (!fi) { + KMessageBox::error(this, i18n("An unexpected error occurred trying to drop the entry")); + delete(ds); + e->accept(); + return; + } + TQString saveFolder = _wallet->currentFolder(); + _wallet->setFolder(fi->name()); + ok = decodeEntry(_wallet, *ds); + _wallet->setFolder(saveFolder); + fi->refresh(); + delete(ds); + //delete source if we were moving, i.e., we are dragging + //from tdewalletmanager and Control is not pressed + if (ok && el && !(state & TQt::ControlButton) && sel) { + el->_wallet->removeEntry(sel->text(0)); + delete sel; + } + e->accept(); + } else { + ok = decodeFolder(_wallet, *ds); + delete ds; + //delete source if we were moving, i.e., we are dragging + //from tdewalletmanager and Control is not pressed + if (ok && el && !(state & TQt::ControlButton) && sel) { + KWalletFolderItem *fi = dynamic_cast(sel); + if (fi) { + el->_wallet->removeFolder(fi->name()); + delete sel; + } else { + KMessageBox::error(this, i18n("An unexpected error occurred trying to delete the original folder, but the folder has been copied successfully")); + } + } + e->accept(); + } +} + +void KWalletEntryList::setWallet(KWallet::Wallet *w) { + _wallet = w; +} + +bool KWalletEntryList::existsFolder(const TQString& name) { + for (TQListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { + KWalletFolderItem *fi = dynamic_cast(vi); + if (!fi) { + continue; + } + if (name == fi->name()) { + return true; + } + } + return false; +} + +void KWalletEntryList::contentsDropEvent(TQDropEvent *e) { + TQListViewItem *i = itemAt(contentsToViewport(e->pos())); + itemDropped(e, i); +} + +void KWalletEntryList::contentsDragEnterEvent(TQDragEnterEvent *e) { + if (e->provides("application/x-tdewallet-entry") || + e->provides("application/x-tdewallet-folder") || + e->provides("application/uri-list")) { + e->accept(); + } else { + e->ignore(); + } +} + +KWalletFolderItem* KWalletEntryList::getFolder(const TQString& name) { + for (TQListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { + KWalletFolderItem *fi = dynamic_cast(vi); + if (!fi) { + continue; + } + if (name == fi->name()) { + return fi; + } + } + return 0; +} + +KWalletFolderItem *KWalletEntryList::getItemFolder(TQListViewItem *item) { + switch (item->rtti()) { + case KWalletFolderItemClass: + return dynamic_cast(item); + case KWalletContainerItemClass: + return dynamic_cast(item->parent()); + case KWalletEntryItemClass: + return dynamic_cast(item->parent()->parent()); + } + return 0; +} + +/**************** + * KWalletIconDrag - Stores the data for wallet drags + */ +class KWalletIconDrag : public TQIconDrag { + public: + KWalletIconDrag(TQWidget *dragSource, const char *name = 0L) + : TQIconDrag(dragSource, name) { + } + + virtual ~KWalletIconDrag() {} + + virtual const char *format(int i = 0) const { + if (i == 0) { + return "application/x-qiconlist"; + } else if (i == 1) { + return "text/uri-list"; + } + return 0L; + } + + TQByteArray encodedData(const char *mime) const { + TQByteArray a; + TQCString mimetype(mime); + if (mimetype == "application/x-qiconlist") { + return TQIconDrag::encodedData(mime); + } else if (mimetype == "text/uri-list") { + TQCString s = _urls.join("\r\n").latin1(); + if (_urls.count() > 0) { + s.append("\r\n"); + } + a.resize(s.length() + 1); + memcpy(a.data(), s.data(), s.length() + 1); + } + return a; + } + + void append(const TQIconDragItem &item, const TQRect &pr, + const TQRect &tr, const TQString &url) { + TQIconDrag::append(item, pr, tr); + _urls.append(url); + } + + private: + TQStringList _urls; +}; + +/**************** +* * KWalletIconView - An iconview to store wallets +* */ +KWalletIconView::KWalletIconView(TQWidget *parent, const char *name) +: KIconView(parent, name) { + TDEGlobal::dirs()->addResourceType("tdewallet", "share/apps/tdewallet"); + connect(this, TQT_SIGNAL(dropped(TQDropEvent*, const TQValueList&)), TQT_SLOT(slotDropped(TQDropEvent*, const TQValueList&))); +} + +KWalletIconView::~KWalletIconView() { +} + +void KWalletIconView::slotDropped(TQDropEvent *e, const TQValueList& /*lst*/) { + if (e->source() == viewport()) { + e->ignore(); + return; + } + + if (!e->provides("text/uri-list")) { + e->ignore(); + return; + } + + TQByteArray edata = e->encodedData("text/uri-list"); + TQCString urls = edata.data(); + + TQStringList ul = TQStringList::split("\r\n", urls); + if (ul.isEmpty() || ul.first().isEmpty()) { + e->ignore(); + return; + } + + KURL u(ul.first()); + + if (u.fileName().isEmpty()) { + e->ignore(); + return; + } + + TQString dest = TDEGlobal::dirs()->saveLocation("tdewallet") + u.fileName(); + if (TQFile::exists(dest)) { + KMessageBox::sorry(viewport(), i18n("That wallet file already exists. You cannot overwrite wallets.")); + e->ignore(); + return; + } + + // FIXME: verify that it is a real wallet file first + TDEIO::NetAccess::file_copy(u, KURL::fromPathOrURL(dest)); + e->accept(); +} + +void KWalletIconView::contentsMousePressEvent(TQMouseEvent *e) { + _mousePos = e->pos(); + if (!findItem(_mousePos)) { + clearSelection(); + } + KIconView::contentsMousePressEvent( e ); +} + +TQDragObject *KWalletIconView::dragObject() { + KWalletIconDrag* id = new KWalletIconDrag(viewport(), "KWallet Drag"); + TQString path = "file:" + TDEGlobal::dirs()->saveLocation("tdewallet"); + TQPoint pos = _mousePos; + for (TQIconViewItem *item = firstItem(); item; item = item->nextItem()) { + if (item->isSelected()) { + TQString url = path + item->text() + ".kwl"; + TQIconDragItem idi; + idi.setData(url.local8Bit()); + id->append(idi, + TQRect(item->pixmapRect(false).topLeft() - pos, + item->pixmapRect(false).size()), + TQRect(item->textRect(false).topLeft() - pos, + item->textRect(false).size()), + url); + } + } + + id->setPixmap(*currentItem()->pixmap(), + pos - currentItem()->pixmapRect(false).topLeft()); + + return id; +} + +TQDragObject *KWalletEntryList::dragObject() { + TQListViewItem *i = currentItem(); + + TQStoredDrag *sd = 0L; + + if (i->rtti() == KWalletEntryItemClass) { + KWalletEntryItem *ei = dynamic_cast(i); + if (!ei) { + return 0L; + } + sd = new KWalletEntryDrag(viewport(), "KWallet Entry Drag"); + TQByteArray a; + TQDataStream ds(a, IO_WriteOnly); + ds << KWALLETENTRYMAGIC; + ds << *ei; + sd->setEncodedData(a); + } else if (i->rtti() == KWalletFolderItemClass) { + KWalletFolderItem *fi = dynamic_cast(i); + if (!fi) { + return 0L; + } + sd = new KWalletFolderDrag(viewport(), "KWallet Folder Drag"); + TQByteArray a; + TQDataStream ds(a, IO_WriteOnly); + + ds << KWALLETFOLDERMAGIC; + ds << *fi; + sd->setEncodedData(a); + } + return sd; +} + +#include "allyourbase.moc" diff --git a/tdewallet/allyourbase.h b/tdewallet/allyourbase.h new file mode 100644 index 0000000..fe9bd05 --- /dev/null +++ b/tdewallet/allyourbase.h @@ -0,0 +1,180 @@ +/* + Copyright (C) 2003-2005 George Staikos + Copyright (C) 2005 Isaac Clerencia + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ALLYOURBASE_H +#define ALLYOURBASE_H + +#include +#include +#include +#include +#include + +#define KWALLETENTRYMAGIC ((TQ_UINT32) 0x6B776C65) +#define KWALLETFOLDERMAGIC ((TQ_UINT32) 0x6B776C66) + +enum KWalletListItemClasses { + KWalletFolderItemClass = 1000, + KWalletContainerItemClass, + KWalletEntryItemClass, + KWalletUnknownClass = 2000 +}; + +class KWalletEntryItem : public KListViewItem { + public: + KWalletEntryItem(KWallet::Wallet *w, TQListViewItem* parent, const TQString& ename); + virtual ~KWalletEntryItem(); + + const TQString& oldName() { return _oldName; } + TQString currentName() { return text(0); } + + void clearOldName() { _oldName = text(0); } + virtual int rtti() const; + + public: + KWallet::Wallet *_wallet; + + private: + TQString _oldName; +}; + +class KWalletContainerItem : public KListViewItem { + public: + KWalletContainerItem(TQListViewItem* parent, const TQString& name, + KWallet::Wallet::EntryType type); + virtual ~KWalletContainerItem(); + + public: + virtual int rtti() const; + KWallet::Wallet::EntryType type(); + bool contains(const TQString& itemKey); + TQListViewItem* getItem(const TQString& itemKey); + + private: + KWallet::Wallet::EntryType _type; +}; + +class KWalletFolderItem : public KListViewItem { + public: + KWalletFolderItem(KWallet::Wallet *w, TQListView* parent, + const TQString& name, int entries); + virtual ~KWalletFolderItem(); + + virtual bool acceptDrop(const TQMimeSource *mime) const; + virtual int rtti() const; + + TQString name() const; + void refresh(); + KWalletContainerItem* getContainer(KWallet::Wallet::EntryType type); + TQPixmap getFolderIcon(KIcon::Group group); + bool contains(const TQString& itemKey); + TQListViewItem* getItem(const TQString& itemKey); + + public: + KWallet::Wallet *_wallet; + + private: + TQString _name; + int _entries; +}; + +class KWalletEntryList : public KListView { + Q_OBJECT + + public: + KWalletEntryList(TQWidget *parent, const char *name = 0L); + virtual ~KWalletEntryList(); + + bool existsFolder(const TQString& name); + KWalletFolderItem* getFolder(const TQString& name); + void contentsDropEvent(TQDropEvent *e); + void contentsDragEnterEvent(TQDragEnterEvent *e); + void setWallet(KWallet::Wallet *w); + + protected: + void itemDropped(TQDropEvent *e, TQListViewItem *item); + virtual TQDragObject *dragObject(); + virtual bool acceptDrag (TQDropEvent* event) const; + + private: + static KWalletFolderItem *getItemFolder(TQListViewItem *item); + + public: + KWallet::Wallet *_wallet; +}; + +class KWalletItem : public TQIconViewItem { + public: + KWalletItem(TQIconView *parent, const TQString& walletName); + virtual ~KWalletItem(); + + virtual bool acceptDrop(const TQMimeSource *mime) const; + + protected: + virtual void dropped(TQDropEvent *e, const TQValueList& lst); +}; + + +class KWalletIconView : public KIconView { + Q_OBJECT + + public: + KWalletIconView(TQWidget *parent, const char *name = 0L); + virtual ~KWalletIconView(); + + protected slots: + virtual void slotDropped(TQDropEvent *e, const TQValueList& lst); + + protected: + virtual TQDragObject *dragObject(); + virtual void contentsMousePressEvent(TQMouseEvent *e); + TQPoint _mousePos; +}; + + +inline TQDataStream& operator<<(TQDataStream& str, const KWalletEntryItem& w) { + TQString name = w.text(0); + str << name; + KWallet::Wallet::EntryType et = w._wallet->entryType(name); + str << long(et); + TQByteArray a; + w._wallet->readEntry(name, a); + str << a; + return str; +} + +inline TQDataStream& operator<<(TQDataStream& str, const KWalletFolderItem& w) { + TQString oldFolder = w._wallet->currentFolder(); + str << w.name(); + w._wallet->setFolder(w.name()); + TQStringList entries = w._wallet->entryList(); + for (TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { + str << *it; + KWallet::Wallet::EntryType et = w._wallet->entryType(*it); + str << long(et); + TQByteArray a; + w._wallet->readEntry(*it, a); + str << a; + } + w._wallet->setFolder(oldFolder); + return str; +} + +#endif diff --git a/tdewallet/hi128-app-tdewalletmanager.png b/tdewallet/hi128-app-tdewalletmanager.png new file mode 100644 index 0000000..ccdd7c9 Binary files /dev/null and b/tdewallet/hi128-app-tdewalletmanager.png differ diff --git a/tdewallet/hi128-app-tdewalletmanager2.png b/tdewallet/hi128-app-tdewalletmanager2.png new file mode 100644 index 0000000..e3937db Binary files /dev/null and b/tdewallet/hi128-app-tdewalletmanager2.png differ diff --git a/tdewallet/hi16-app-tdewalletmanager.png b/tdewallet/hi16-app-tdewalletmanager.png new file mode 100644 index 0000000..4f9f4fd Binary files /dev/null and b/tdewallet/hi16-app-tdewalletmanager.png differ diff --git a/tdewallet/hi16-app-tdewalletmanager2.png b/tdewallet/hi16-app-tdewalletmanager2.png new file mode 100644 index 0000000..b2f9004 Binary files /dev/null and b/tdewallet/hi16-app-tdewalletmanager2.png differ diff --git a/tdewallet/hi22-app-tdewalletmanager.png b/tdewallet/hi22-app-tdewalletmanager.png new file mode 100644 index 0000000..8bc4cdb Binary files /dev/null and b/tdewallet/hi22-app-tdewalletmanager.png differ diff --git a/tdewallet/hi32-app-tdewalletmanager.png b/tdewallet/hi32-app-tdewalletmanager.png new file mode 100644 index 0000000..69a7c1e Binary files /dev/null and b/tdewallet/hi32-app-tdewalletmanager.png differ diff --git a/tdewallet/hi32-app-tdewalletmanager2.png b/tdewallet/hi32-app-tdewalletmanager2.png new file mode 100644 index 0000000..3cfc4e2 Binary files /dev/null and b/tdewallet/hi32-app-tdewalletmanager2.png differ diff --git a/tdewallet/hi48-app-tdewalletmanager.png b/tdewallet/hi48-app-tdewalletmanager.png new file mode 100644 index 0000000..5b46a87 Binary files /dev/null and b/tdewallet/hi48-app-tdewalletmanager.png differ diff --git a/tdewallet/hi48-app-tdewalletmanager2.png b/tdewallet/hi48-app-tdewalletmanager2.png new file mode 100644 index 0000000..3ae286d Binary files /dev/null and b/tdewallet/hi48-app-tdewalletmanager2.png differ diff --git a/tdewallet/hi64-app-tdewalletmanager.png b/tdewallet/hi64-app-tdewalletmanager.png new file mode 100644 index 0000000..38a581c Binary files /dev/null and b/tdewallet/hi64-app-tdewalletmanager.png differ diff --git a/tdewallet/hi64-app-tdewalletmanager2.png b/tdewallet/hi64-app-tdewalletmanager2.png new file mode 100644 index 0000000..2e5be4b Binary files /dev/null and b/tdewallet/hi64-app-tdewalletmanager2.png differ diff --git a/tdewallet/icons/CMakeLists.txt b/tdewallet/icons/CMakeLists.txt new file mode 100644 index 0000000..68f67e2 --- /dev/null +++ b/tdewallet/icons/CMakeLists.txt @@ -0,0 +1,16 @@ +################################################# +# +# (C) 2012 Golubev Alexander +# fatzer2 (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +tde_install_icons( tdewalletmanager) + +tde_install_icons( + DESTINATION ${DATA_INSTALL_DIR}/tdewalletmanager/icons +) diff --git a/tdewallet/icons/Makefile.am b/tdewallet/icons/Makefile.am new file mode 100644 index 0000000..65d4236 --- /dev/null +++ b/tdewallet/icons/Makefile.am @@ -0,0 +1,5 @@ +KDE_ICON = tdewalletmanager + +pics_ICON = AUTO +picsdir = $(kde_datadir)/tdewalletmanager/icons + diff --git a/tdewallet/icons/cr22-action-folder_closed.png b/tdewallet/icons/cr22-action-folder_closed.png new file mode 100644 index 0000000..e3ebad3 Binary files /dev/null and b/tdewallet/icons/cr22-action-folder_closed.png differ diff --git a/tdewallet/icons/cr22-action-folder_open.png b/tdewallet/icons/cr22-action-folder_open.png new file mode 100644 index 0000000..ea175b7 Binary files /dev/null and b/tdewallet/icons/cr22-action-folder_open.png differ diff --git a/tdewallet/icons/cr22-action-wallet_closed.png b/tdewallet/icons/cr22-action-wallet_closed.png new file mode 100644 index 0000000..57558ac Binary files /dev/null and b/tdewallet/icons/cr22-action-wallet_closed.png differ diff --git a/tdewallet/icons/cr22-action-wallet_open.png b/tdewallet/icons/cr22-action-wallet_open.png new file mode 100644 index 0000000..55a447f Binary files /dev/null and b/tdewallet/icons/cr22-action-wallet_open.png differ diff --git a/tdewallet/kbetterthankdialogbase.ui b/tdewallet/kbetterthankdialogbase.ui new file mode 100644 index 0000000..65d8b5a --- /dev/null +++ b/tdewallet/kbetterthankdialogbase.ui @@ -0,0 +1,154 @@ + +KBetterThanKDialogBase + + + KBetterThanKDialogBase + + + + 0 + 0 + 479 + 109 + + + + + + + + unnamed + + + Fixed + + + + _label + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 41 + 21 + + + + + + layout1 + + + + unnamed + + + + _allowOnce + + + &Replace + + + true + + + + + _allowAlways + + + Replace &All + + + + + _deny + + + &Skip + + + + + _denyForever + + + Skip A&ll + + + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 61 + 21 + + + + + + + + + + _allowOnce + clicked() + KBetterThanKDialogBase + clicked() + + + _allowAlways + clicked() + KBetterThanKDialogBase + clicked() + + + _deny + clicked() + KBetterThanKDialogBase + clicked() + + + _denyForever + clicked() + KBetterThanKDialogBase + clicked() + + + + kactivelabel.h + kbetterthankdialogbase.ui.h + + + clicked() + setLabel( const TQString & label ) + init() + accept() + reject() + + + + kactivelabel.h + + diff --git a/tdewallet/kbetterthankdialogbase.ui.h b/tdewallet/kbetterthankdialogbase.ui.h new file mode 100644 index 0000000..e97ffd1 --- /dev/null +++ b/tdewallet/kbetterthankdialogbase.ui.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** TQt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + + +void KBetterThanKDialogBase::clicked() +{ + if (sender() == _allowOnce) { + done(3); + } else if (sender() == _allowAlways) { + done(1); + } else if (sender() == _deny) { + done(4); + } else if (sender() == _denyForever) { + done(2); + } +} + + +void KBetterThanKDialogBase::setLabel( const TQString & label ) +{ + _label->setText(label); +} + + +void KBetterThanKDialogBase::init() +{ + _allowOnce->setFocus(); +} + + +void KBetterThanKDialogBase::accept() +{ + setResult(3); +} + + +void KBetterThanKDialogBase::reject() +{ + TQDialog::reject(); + setResult(4); +} diff --git a/tdewallet/konfigurator/CMakeLists.txt b/tdewallet/konfigurator/CMakeLists.txt new file mode 100644 index 0000000..d9283f8 --- /dev/null +++ b/tdewallet/konfigurator/CMakeLists.txt @@ -0,0 +1,45 @@ +################################################# +# +# (C) 2012 Golubev Alexander +# fatzer2 (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### kcm_tdewallet (kpart) ####################### + +tde_add_kpart( kcm_tdewallet AUTOMOC + SOURCES walletconfigwidget.ui konfigurator.cpp + LINK tdeui-shared tdewalletclient-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other data ################################ + +install( FILES tdewalletconfig.desktop + DESTINATION ${XDG_APPS_INSTALL_DIR} +) + +install( + FILES + tdewallet_config.desktop + tdewalletmanager_show.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/tdewallet/konfigurator/Makefile.am b/tdewallet/konfigurator/Makefile.am new file mode 100644 index 0000000..b7fa556 --- /dev/null +++ b/tdewallet/konfigurator/Makefile.am @@ -0,0 +1,15 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = kcm_tdewallet.la +kcm_tdewallet_la_SOURCES = walletconfigwidget.ui konfigurator.cpp +kcm_tdewallet_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +kcm_tdewallet_la_LIBADD = $(LIB_TDEUI) -ltdewalletclient + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kcmtdewallet.pot + +xdg_apps_DATA = tdewalletconfig.desktop + +kde_services_DATA = tdewallet_config.desktop tdewalletmanager_show.desktop + diff --git a/tdewallet/konfigurator/konfigurator.cpp b/tdewallet/konfigurator/konfigurator.cpp new file mode 100644 index 0000000..230b4c9 --- /dev/null +++ b/tdewallet/konfigurator/konfigurator.cpp @@ -0,0 +1,323 @@ +/* + Copyright (C) 2003 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#include "konfigurator.h" +#include "walletconfigwidget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +typedef KGenericFactory KWalletFactory; +K_EXPORT_COMPONENT_FACTORY(kcm_tdewallet, KWalletFactory("kcmtdewallet")) + +KWalletConfig::KWalletConfig(TQWidget *parent, const char *name, const TQStringList&) +: TDECModule(KWalletFactory::instance(), parent, name) { + + TDEAboutData *about = + new TDEAboutData(I18N_NOOP("kcmtdewallet"), + I18N_NOOP("TDE Wallet Control Module"), + 0, 0, TDEAboutData::License_GPL, + I18N_NOOP("(c) 2003 George Staikos")); + about->addAuthor("George Staikos", 0, "staikos@kde.org"); + setAboutData( about ); + + _cfg = new TDEConfig("tdewalletrc", false, false); + + TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, KDialog::spacingHint()); + vbox->add(_wcw = new WalletConfigWidget(this)); + + connect(_wcw->_enabled, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_launchManager, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_autocloseManager, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_autoclose, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_closeIdle, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_openPrompt, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_screensaverLock, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_localWalletSelected, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_idleTime, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_launch, TQT_SIGNAL(clicked()), this, TQT_SLOT(launchManager())); + connect(_wcw->_newWallet, TQT_SIGNAL(clicked()), this, TQT_SLOT(newNetworkWallet())); + connect(_wcw->_newLocalWallet, TQT_SIGNAL(clicked()), this, TQT_SLOT(newLocalWallet())); + connect(_wcw->_localWallet, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_defaultWallet, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_accessList, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)), this, TQT_SLOT(contextMenuRequested(TQListViewItem*, const TQPoint&, int))); + + _wcw->_accessList->setAllColumnsShowFocus(true); + updateWalletLists(); + load(); + + if (DCOPClient::mainClient()->isApplicationRegistered("tdewalletmanager")) { + _wcw->_launch->hide(); + } + +} + + +KWalletConfig::~KWalletConfig() { + delete _cfg; + _cfg = 0L; +} + + +void KWalletConfig::updateWalletLists() { + TQString p1, p2; + p1 = _wcw->_localWallet->currentText(); + p2 = _wcw->_defaultWallet->currentText(); + + _wcw->_localWallet->clear(); + _wcw->_defaultWallet->clear(); + + TQStringList wl = KWallet::Wallet::walletList(); + _wcw->_localWallet->insertStringList(wl); + _wcw->_defaultWallet->insertStringList(wl); + + if (wl.contains(p1)) { + _wcw->_localWallet->setCurrentText(p1); + } + + if (wl.contains(p2)) { + _wcw->_defaultWallet->setCurrentText(p2); + } +} + + +TQString KWalletConfig::newWallet() { + bool ok; + + TQString n = KInputDialog::getText(i18n("New Wallet"), + i18n("Please choose a name for the new wallet:"), + TQString(), + &ok, + this); + + if (!ok) { + return TQString(); + } + + KWallet::Wallet *w = KWallet::Wallet::openWallet(n); + if (!w) { + return TQString(); + } + + delete w; + return n; +} + + +void KWalletConfig::newLocalWallet() { + TQString n = newWallet(); + if (n.isEmpty()) { + return; + } + + updateWalletLists(); + + _wcw->_localWallet->setCurrentText(n); + + emit changed(true); +} + + +void KWalletConfig::newNetworkWallet() { + TQString n = newWallet(); + if (n.isEmpty()) { + return; + } + + updateWalletLists(); + + _wcw->_defaultWallet->setCurrentText(n); + + emit changed(true); +} + + +void KWalletConfig::launchManager() { + if (!DCOPClient::mainClient()->isApplicationRegistered("tdewalletmanager")) { + TDEApplication::startServiceByDesktopName("tdewalletmanager_show"); + } else { + DCOPRef r("tdewalletmanager", "tdewalletmanager-mainwindow#1"); + r.send("show"); + r.send("raise"); + } +} + + +void KWalletConfig::configChanged() { + emit changed(true); +} + +void KWalletConfig::load() { + load( false ); +} + +void KWalletConfig::load(bool useDefaults) { + TDEConfigGroup config(_cfg, "Wallet"); + config.setReadDefaults( useDefaults ); + _wcw->_enabled->setChecked(config.readBoolEntry("Enabled", true)); + _wcw->_openPrompt->setChecked(config.readBoolEntry("Prompt on Open", true)); + _wcw->_launchManager->setChecked(config.readBoolEntry("Launch Manager", true)); + _wcw->_autocloseManager->setChecked(! config.readBoolEntry("Leave Manager Open", false)); + _wcw->_screensaverLock->setChecked(config.readBoolEntry("Close on Screensaver", false)); + _wcw->_autoclose->setChecked(!config.readBoolEntry("Leave Open", false)); + _wcw->_closeIdle->setChecked(config.readBoolEntry("Close When Idle", false)); + _wcw->_idleTime->setValue(config.readNumEntry("Idle Timeout", 10)); + if (config.hasKey("Default Wallet")) { + _wcw->_defaultWallet->setCurrentText(config.readEntry("Default Wallet")); + } else { + _wcw->_defaultWallet->setCurrentItem(0); + } + if (config.hasKey("Local Wallet")) { + _wcw->_localWalletSelected->setChecked( !config.readBoolEntry("Use One Wallet") ); + _wcw->_localWallet->setCurrentText(config.readEntry("Local Wallet")); + } else { + _wcw->_localWalletSelected->setChecked(false); + } + _wcw->_accessList->clear(); + _cfg->setGroup("Auto Deny"); + TQStringList denykeys = _cfg->entryMap("Auto Deny").keys(); + _cfg->setGroup("Auto Allow"); + TQStringList keys = _cfg->entryMap("Auto Allow").keys(); + for (TQStringList::Iterator i = keys.begin(); i != keys.end(); ++i) { + _cfg->setGroup("Auto Allow"); + TQStringList apps = _cfg->readListEntry(*i); + _cfg->setGroup("Auto Deny"); + TQStringList denyapps = _cfg->readListEntry(*i); + denykeys.remove(*i); + TQListViewItem *lvi = new TQListViewItem(_wcw->_accessList, *i); + for (TQStringList::Iterator j = apps.begin(); j != apps.end(); ++j) { + new TQListViewItem(lvi, TQString(), *j, i18n("Always Allow")); + } + for (TQStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { + new TQListViewItem(lvi, TQString(), *j, i18n("Always Deny")); + } + } + _cfg->setGroup("Auto Deny"); + for (TQStringList::Iterator i = denykeys.begin(); i != denykeys.end(); ++i) { + TQStringList denyapps = _cfg->readListEntry(*i); + TQListViewItem *lvi = new TQListViewItem(_wcw->_accessList, *i); + for (TQStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { + new TQListViewItem(lvi, TQString(), *j, i18n("Always Deny")); + } + } + emit changed(useDefaults); +} + + +void KWalletConfig::save() { + TDEConfigGroup config(_cfg, "Wallet"); + config.writeEntry("Enabled", _wcw->_enabled->isChecked()); + config.writeEntry("Launch Manager", _wcw->_launchManager->isChecked()); + config.writeEntry("Leave Manager Open", !_wcw->_autocloseManager->isChecked()); + config.writeEntry("Leave Open", !_wcw->_autoclose->isChecked()); + config.writeEntry("Close When Idle", _wcw->_closeIdle->isChecked()); + config.writeEntry("Idle Timeout", _wcw->_idleTime->value()); + config.writeEntry("Prompt on Open", _wcw->_openPrompt->isChecked()); + config.writeEntry("Close on Screensaver", _wcw->_screensaverLock->isChecked()); + + config.writeEntry("Use One Wallet", !_wcw->_localWalletSelected->isChecked()); + if (_wcw->_localWalletSelected->isChecked()) { + config.writeEntry("Local Wallet", _wcw->_localWallet->currentText()); + } else { + config.deleteEntry("Local Wallet"); + } + + if (_wcw->_defaultWallet->currentItem() != -1) { + config.writeEntry("Default Wallet", _wcw->_defaultWallet->currentText()); + } else { + config.deleteEntry("Default Wallet"); + } + + // FIXME: won't survive a language change + _cfg->deleteGroup("Auto Allow"); + _cfg->deleteGroup("Auto Deny"); + _cfg->setGroup("Auto Allow"); + for (TQListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { + TQStringList al; + for (TQListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { + if (j->text(2) == i18n("Always Allow")) { + al << j->text(1); + } + } + _cfg->writeEntry(i->text(0), al); + } + + _cfg->setGroup("Auto Deny"); + for (TQListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { + TQStringList al; + for (TQListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { + if (j->text(2) == i18n("Always Deny")) { + al << j->text(1); + } + } + _cfg->writeEntry(i->text(0), al); + } + + _cfg->sync(); + DCOPRef("kded", "tdewalletd").call("reconfigure()"); + + emit changed(false); +} + + +void KWalletConfig::defaults() { + load( true ); +} + + +TQString KWalletConfig::quickHelp() const { + return i18n("This configuration module allows you to configure the KDE wallet system."); +} + + +void KWalletConfig::contextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col) { + Q_UNUSED(col) + if (item && item->parent()) { + KPopupMenu *m = new KPopupMenu(this); + m->insertTitle(item->parent()->text(0)); + m->insertItem(i18n("&Delete"), this, TQT_SLOT(deleteEntry()), Key_Delete); + m->popup(pos); + } +} + + +void KWalletConfig::deleteEntry() { + TQListViewItem *item = _wcw->_accessList->selectedItem(); + if (item) { + delete item; + emit changed(true); + } +} + +#include "konfigurator.moc" + diff --git a/tdewallet/konfigurator/konfigurator.h b/tdewallet/konfigurator/konfigurator.h new file mode 100644 index 0000000..418d2e5 --- /dev/null +++ b/tdewallet/konfigurator/konfigurator.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2003 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#ifndef _KWALLETKONFIGURATOR_H +#define _KWALLETKONFIGURATOR_H + +#include + +class TDEConfig; +class WalletConfigWidget; +class TQListViewItem; + +class KWalletConfig : public TDECModule { + Q_OBJECT + + public: + KWalletConfig(TQWidget *parent = 0L, const char *name = 0L, const TQStringList& = TQStringList()); + virtual ~KWalletConfig(); + + void load(); + void load( bool useDefaults ); + void save(); + void defaults(); + + TQString quickHelp() const; + + public slots: + void configChanged(); + void launchManager(); + void newLocalWallet(); + void newNetworkWallet(); + void updateWalletLists(); + TQString newWallet(); + void deleteEntry(); + void contextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col); + + private: + WalletConfigWidget *_wcw; + TDEConfig *_cfg; +}; + +#endif diff --git a/tdewallet/konfigurator/tdewallet_config.desktop b/tdewallet/konfigurator/tdewallet_config.desktop new file mode 100644 index 0000000..a30297b --- /dev/null +++ b/tdewallet/konfigurator/tdewallet_config.desktop @@ -0,0 +1,47 @@ +[Desktop Entry] +Type=Service +Exec=kcmshell --caption %c tdewalletconfig +Icon=tdewalletmanager +DocPath=tdewallet/index.html +Name=TDE Wallet +Name[ar]=محفظة كدى +Name[bg]=Портфейл +Name[br]=Doug-paperoù TDE +Name[bs]=TDE novčanik +Name[cs]=Úschovna TDE +Name[cy]=Waled TDE +Name[da]=TDE's tegnebog +Name[de]=Digitale Brieftasche +Name[el]=Πορτοφόλι του TDE +Name[es]=Cartera de TDE +Name[et]=TDE turvalaegas +Name[eu]=TDE Kartera +Name[fi]=Lompakko +Name[fr]=Gestionnaire de comptes de TDE +Name[hi]=केडीई वॉलेट +Name[hu]=Digitális noteszek +Name[is]=TDE veskið +Name[it]=Portafogli di TDE +Name[ja]=TDE ウォレット +Name[kk]=TDE әмияні +Name[km]=កាបូប TDE +Name[lt]=TDE slaptažodinės +Name[mk]=TDE Паричник +Name[nds]=TDE-Knipp +Name[ne]=TDE वालेट +Name[pa]=TDE ਵਾਲਿਟ +Name[pl]=Portfel TDE +Name[pt]=Carteira TDE +Name[pt_BR]=Carteira do TDE +Name[ro]=Portofel TDE +Name[ru]=Бумажник +Name[sl]=Listnica za TDE +Name[sv]=TDE-plånbok +Name[ta]= கேடிஇ வாலட் +Name[tg]=TDE Ҳамён +Name[tr]=TDE Cüzdan +Name[uk]=Торбинки TDE +Name[uz]=TDE qopchiq +Name[uz@cyrillic]=TDE қопчиқ +Name[zh_CN]=TDE 钱包 +Name[zh_TW]=TDE 錢包 diff --git a/tdewallet/konfigurator/tdewalletconfig.desktop b/tdewallet/konfigurator/tdewalletconfig.desktop new file mode 100644 index 0000000..ccae543 --- /dev/null +++ b/tdewallet/konfigurator/tdewalletconfig.desktop @@ -0,0 +1,152 @@ +[Desktop Entry] +Icon=tdewalletmanager +Type=Application +Exec=kcmshell tdewalletconfig +DocPath=tdewallet/index.html +X-TDE-ModuleType=Library +X-TDE-Library=tdewallet +X-TDE-ParentApp=kcontrol + +Name=TDE Wallet +Name[ar]=محفظة كدى +Name[bg]=Портфейл +Name[br]=Doug-paperoù TDE +Name[bs]=TDE novčanik +Name[cs]=Úschovna TDE +Name[cy]=Waled TDE +Name[da]=TDE's tegnebog +Name[de]=Digitale Brieftasche +Name[el]=Πορτοφόλι του TDE +Name[es]=Cartera de TDE +Name[et]=TDE turvalaegas +Name[eu]=TDE Kartera +Name[fi]=Lompakko +Name[fr]=Gestionnaire de comptes de TDE +Name[hi]=केडीई वॉलेट +Name[hu]=Digitális noteszek +Name[is]=TDE veskið +Name[it]=Portafogli di TDE +Name[ja]=TDE ウォレット +Name[kk]=TDE әмияні +Name[km]=កាបូប TDE +Name[lt]=TDE slaptažodinės +Name[mk]=TDE Паричник +Name[nds]=TDE-Knipp +Name[ne]=TDE वालेट +Name[pa]=TDE ਵਾਲਿਟ +Name[pl]=Portfel TDE +Name[pt]=Carteira TDE +Name[pt_BR]=Carteira do TDE +Name[ro]=Portofel TDE +Name[ru]=Бумажник +Name[sl]=Listnica za TDE +Name[sv]=TDE-plånbok +Name[ta]= கேடிஇ வாலட் +Name[tg]=TDE Ҳамён +Name[tr]=TDE Cüzdan +Name[uk]=Торбинки TDE +Name[uz]=TDE qopchiq +Name[uz@cyrillic]=TDE қопчиқ +Name[zh_CN]=TDE 钱包 +Name[zh_TW]=TDE 錢包 +Comment=TDE Wallet Configuration +Comment[ar]=إعداد محفظة كدى +Comment[bg]=Настройване на системата Портфейл +Comment[br]=Kefluniadur Doug-paperoù TDE +Comment[bs]=Podešavanje TDE novčanika +Comment[ca]=Configuració de carteres TDE +Comment[cs]=Nastavení úschovny TDE +Comment[cy]=Ffurfweddiad Waled TDE +Comment[da]=TDE's indstilling af tegnebog +Comment[de]=Einrichten der "digitalen Brieftasche" (KWallet) +Comment[el]=Ρύθμιση του πορτοφολιού του TDE +Comment[es]=Configuración de la cartera de TDE +Comment[et]=TDE turvalaeka seadistamine +Comment[eu]=TDE Karteraren Konfigurazioa +Comment[fa]=TDE Wallet پیکربندی +Comment[fi]=TDE-lompakon asetukset +Comment[fr]=Configuration du gestionnaire de comptes de TDE +Comment[ga]=Cumraíocht TDE Wallet +Comment[he]=TDE Wallet הגדרות +Comment[hi]=केडीई वॉलेट कॉन्फ़िगरेशन +Comment[hu]=A TDE digitális noteszeinek beállításai +Comment[is]=Stillingar veskisins +Comment[it]=Configurazione portafogli di TDE +Comment[ja]=TDE ウォレットの設定 +Comment[ka]=TDE Wallet-ის კონფიგურაცია +Comment[kk]=TDE әмияннің баптауы +Comment[km]=ការកំណត់​រចនា​សម្ព័ន្ធ​កាបូប TDE +Comment[lt]=TDE slaptažodinių konfigūravimas +Comment[mk]=Конфигурација на паричник во TDE +Comment[nb]=Oppsett av TDE Wallet +Comment[nds]=TDE-Knipp instellen +Comment[ne]=TDE वालेट कन्फिगरेसन +Comment[nl]=TDE portefeuille-instellingen +Comment[nn]=Oppsett av TDE Wallet +Comment[pa]=TDE ਵਾਲਿਟ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja Portfela TDE +Comment[pt]=Configuração da Carteira do TDE +Comment[pt_BR]=Configuração da Carteira do TDE +Comment[ro]=Configurează portofelul TDE +Comment[ru]=Параметры бумажника +Comment[sk]=Konfigurácia TDE Wallet +Comment[sl]=Nastavitve Listnice za TDE +Comment[sr]=Подешавање TDE Wallet-а +Comment[sr@Latn]=Podešavanje TDE Wallet-a +Comment[sv]=Inställning av TDE-plånbok +Comment[ta]=கேடிஇ வாலட் வடிவமைப்பு +Comment[tg]=TDE Танзими Ҳамён +Comment[tr]=TDE Cüzdan Ayarı +Comment[uk]=Налаштування KWallet +Comment[uz]=TDE qopchiq xizmatini moslash +Comment[uz@cyrillic]=TDE қопчиқ хизматини мослаш +Comment[zh_CN]=TDE 钱包配置 +Comment[zh_TW]=TDE 錢包設定 +Keywords=Wallet,Form Fill,Passwords,Form Data +Keywords[ar]=محفظة،ملأ نموذج،كلمات السرّ،بيانات نموذج +Keywords[bg]=портфейл, форми, форма, попълване, данни, парола, пароли, Wallet, Form Fill, Passwords, Form Data +Keywords[bs]=Wallet,Form Fill,Passwords,Form Data,novčanik,formulari,popunjavanje formulara,šifre +Keywords[ca]=Cartera,Ompliment de formularis,Contrasentes,Dades de formularis +Keywords[cs]=úschovna,vyplnění formuláře,hesla,data formuláře +Keywords[cy]=Waled,Llenwi Ffurflen,Cyfrineiriau,Data Ffurflenni +Keywords[da]=Tegnebog,Formularudfyldning,Kodeord,Formular-data +Keywords[de]=Geheimfach,Formular,Passwort,Brieftasche,digitale Brieftasche +Keywords[el]=Πορτοφόλι,Συμπλήρωση φόρμας,Κωδικοί πρόσβασης,Δεδομένα φόρμας +Keywords[es]=Cartera,Rellenar formulario,Contraseña,Datos de formulario +Keywords[et]=Turvalaegas,Vormi täitmine,Paroolid,Vormiandmed +Keywords[eu]=Kartera,Formularioa Bete,Pasahitzak,Formulario Datuak +Keywords[fa]=Wallet، پر کردن برگه، اسم رمزها، دادۀ برگه +Keywords[fi]=Lompakko,Lomakkeen täyttö,Salasanat,Lomaketiedot +Keywords[fr]=gestionnaire de comptes,remplissage de formulaire,Mots de passe,Données de formulaire +Keywords[ga]=Wallet,Líonadh Foirmeacha,Focal Faire,Sonraí foirme +Keywords[hi]=बटुआ,फ़ॉर्म फिल,पासवर्ड,फ़ॉर्म डाटा +Keywords[hu]=digitális notesz,űrlapkitöltés,jelszavak,űrlapadatok +Keywords[it]=portafogli,wallet,riempimento moduli,moduli,form,password,dati moduli +Keywords[ja]=ウォレット,フォームフィル,パスワード,フォームデータ +Keywords[ka]=Wallet,ფორმის შევსება,პაროლები,ფორმათა მონაცემები +Keywords[km]=កាបូប,ការបំពេញ​សំណុំ​បែបបទ,ពាក្យ​សម្ងាត់,ទិន្នន័យ​សំណុំ​បែបបទ +Keywords[lt]=Wallet, slaptažodinė,Form Fill,Passwords,Form Data,formų pildymas,slaptažodžiai,formų duomenys +Keywords[mk]=Wallet,Form Fill,Passwords,Form Data, Паричник, формулар, лозинки +Keywords[nb]=Wallet,Skjemautfylling,Passord,Skjema +Keywords[nds]=Knipp,Formulor,Passwöör,Formulordaten +Keywords[ne]=वालेट,फारम भराइ,पासवर्ड,फारम डेटा +Keywords[nl]=Wallet,gegevens,portefeuille,wachtwoorden,veilig bewaren van wachtwoorden,invulgegevens,formulieren +Keywords[nn]=wallet,skjemautfylling,passord,skjema +Keywords[pa]=Wallet,Form Fill,ਗੁਪਤ-ਕੋਡ,ਫਾਰਮ ਡਾਟਾ +Keywords[pl]=portfel,wypełnianie formularzy,uzupełnianie formularzy, hasła, hasło,dane formularzy, formularze +Keywords[pt]=Carteira,Preenchimento de Formulários,Senhas,Dados do Formulário +Keywords[pt_BR]=carteira,preenchimento de formulário,senhas,dados de formulário +Keywords[ro]=portofel,completare formulare,parole,date formular,formular +Keywords[ru]=Wallet,Form Fill,Passwords,Form Data,Бумажник,Пароли,Формы +Keywords[sk]=wallet,formuláre,heslá,dáta z formulárov,schránka,peňaženka +Keywords[sl]=waller,denarnica,gesla,obrazec,podatki,geslo,listnica +Keywords[sr]=Wallet,Form Fill,Passwords,Form Data,лозинке,новчаник +Keywords[sr@Latn]=Wallet,Form Fill,Passwords,Form Data,lozinke,novčanik +Keywords[sv]=Plånbok,fyll i formulär,lösenord,formulärdata +Keywords[ta]=வாலட், படிவ நிரப்பு, கடவுச் சொற்கள், படிவ தகவல் +Keywords[tg]=Ҳамён,Пуркунии Варақа,Гузарвожаҳо,Варақаи Додаҳо +Keywords[tr]=Cüzdan,Form Doldur,Şifreler,Form Verisi +Keywords[uk]=Торбинка,Заповнення форм,Паролі,Дані форм +Keywords[zh_CN]=Wallet,Form Fill,Passwords,Form Data,钱包,填充表单,密码,表单数据 + +Categories=Qt;TDE;X-TDE-settings-security; diff --git a/tdewallet/konfigurator/tdewalletmanager_show.desktop b/tdewallet/konfigurator/tdewalletmanager_show.desktop new file mode 100644 index 0000000..3de02d0 --- /dev/null +++ b/tdewallet/konfigurator/tdewalletmanager_show.desktop @@ -0,0 +1,60 @@ +[Desktop Entry] +Name=Wallet Management Tool +Name[ar]=أداة إدارة المحفظة +Name[bg]=Портфейл +Name[br]=Merour an doug-paperoù +Name[bs]=Alat za upravljanje novčanikom +Name[ca]=Eina de gestió de carteres +Name[cs]=Nástroj pro správu úschovny +Name[cy]=Erfyn Rheoli Waled +Name[da]=Håndteringsværktøj for tegnebog +Name[de]=Verwaltung für digitale Brieftasche +Name[el]=Εργαλείο διαχείρισης πορτοφολιού +Name[es]=Herramienta de gestión de cartera +Name[et]=Turvalaeka haldur +Name[eu]=Kartera Kudeatzeko Tresna +Name[fa]=ابزار مدیریت Wallet +Name[fi]=Lompakon hallintatyökalu +Name[fr]=Outil de gestion de comptes +Name[ga]=Uirlis Bhainisteoireachta Wallet +Name[he]=כלי לניהול הארנק של TDE +Name[hi]= बटुआ प्रबंधन औज़ार +Name[hu]=Kezelőprogram a TDE digitális noteszeihez +Name[is]=Tól til að stýra eiginleikum veskisins +Name[it]=Strumento per la gestione dei portafogli +Name[ja]=ウォレット管理ツール +Name[ka]=Wallet-ის მმართველი მოწყობილობა +Name[kk]=Әмиянін басқару құралы +Name[km]=ឧបករណ៍​គ្រប់គ្រង​កាបូប +Name[lt]=Spatažodinių tvarkymo įrankis +Name[mk]=Алатка за менаџирање на паричници +Name[nb]=Wallet administrasjonsverktøy +Name[nds]=Knipp-Pleger +Name[ne]=वालेट व्यवस्थापन उपकरण +Name[nl]=Portefeuillebeheer +Name[nn]=Wallet-administrasjonsverktøy +Name[pa]=ਵਾਲਿਟ ਪਰਬੰਧਨ ਸੰਦ +Name[pl]=Narzędzie do zarządzania Portfelem +Name[pt]=Ferramenta de Gestão da Carteira +Name[pt_BR]=Ferramenta de Gerenciamento da Carteira +Name[ro]=Administrare portofel +Name[ru]=Управление паролями +Name[sk]=Nástroj na správu KWallet +Name[sl]=Orodje za upravljanje z listnicami +Name[sr]=Алат за управљање новчаником +Name[sr@Latn]=Alat za upravljanje novčanikom +Name[sv]=Hanteringsverktyg för plånbok +Name[ta]=வாலட் மேலாண்மை கருவி +Name[tg]=Асбоби Идоракунии Ҳамён +Name[tr]=Cüzdan Yönetim Aracı +Name[uk]=Засіб керування торбинками +Name[uz]=Qopchiq boshqarish vositasi +Name[uz@cyrillic]=Қопчиқ бошқариш воситаси +Name[zh_CN]=钱包管理工具 +Name[zh_TW]=錢包管理工具 +Exec=tdewalletmanager --show %u +MimeType=application/x-kde-wallet +InitialPreference=6 +Icon=tdewalletmanager +Type=Service +X-TDE-StartupNotify=true diff --git a/tdewallet/konfigurator/walletconfigwidget.ui b/tdewallet/konfigurator/walletconfigwidget.ui new file mode 100644 index 0000000..5f51713 --- /dev/null +++ b/tdewallet/konfigurator/walletconfigwidget.ui @@ -0,0 +1,499 @@ + +WalletConfigWidget + + + WalletConfigWidget + + + + 0 + 0 + 585 + 450 + + + + + unnamed + + + 0 + + + + tabWidget2 + + + + tab + + + Wallet Preferences + + + + unnamed + + + + _enabled + + + &Enable the TDE wallet subsystem + + + true + + + <p>The wallet subsytem allows a convenient and secure way to manage all your passwords. You can decide if you want to use this system with this option.</p> + + + + + groupBox2 + + + Close Wallet + + + It is best to close your wallets when you are not using them to prevent others from viewing or using them. + + + + unnamed + + + + layout1 + + + + unnamed + + + + _closeIdle + + + + 1 + 0 + 2 + 0 + + + + Close when unused for: + + + <p><b>Close wallet after a period of inactivity</b><br>When a wallet is closed the password is needed to access it again.</p> + + + + + _idleTime + + + false + + + + 1 + 0 + 0 + 0 + + + + min + + + 999 + + + 1 + + + 5 + + + 10 + + + <p><b>Close wallet after a period of inactivity</b><br>When a wallet is closed the password is needed to access it again.</p> + + + + + spacer12 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + + + _screensaverLock + + + Close when screensaver starts + + + <p><b>Close wallet as soon as the screensaver starts.</b><br>When a wallet is closed the password is needed to access it again.</p> + + + + + _autoclose + + + Close when last application stops using it + + + <p><b>Close wallet as soon as applications that use it have stopped.</b><br>Note that your wallets will only be closed when all applications that use it have stopped.<br>When a wallet is closed the password is needed to access it again.</p> + + + + + + + groupBox4 + + + Automatic Wallet Selection + + + + unnamed + + + + spacer7 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + textLabel1_2 + + + Select wallet to use as default: + + + + + _localWalletSelected + + + Different wallet for local passwords: + + + + + _defaultWallet + + + + 1 + 0 + 1 + 0 + + + + + + _localWallet + + + false + + + + 1 + 0 + 1 + 0 + + + + + + _newLocalWallet + + + false + + + New... + + + + + _newWallet + + + New... + + + + + + + groupBox3 + + + Wallet Manager + + + + unnamed + + + + spacer6 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + _launchManager + + + Show manager in system tray + + + true + + + + + _autocloseManager + + + Hide system tray icon when last wallet closes + + + + + + + spacer4 + + + Vertical + + + Expanding + + + + 31 + 16 + + + + + + + + tab + + + Access Control + + + + unnamed + + + + _openPrompt + + + &Prompt when an application accesses an open wallet + + + true + + + + + + Wallet + + + true + + + true + + + true + + + + + Application + + + true + + + true + + + + + Policy + + + true + + + true + + + + _accessList + + + true + + + + + + + + _launch + + + &Launch Wallet Manager + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 369 + 21 + + + + + + + + _localWalletSelected + toggled(bool) + _newLocalWallet + setEnabled(bool) + + + _localWalletSelected + toggled(bool) + _localWallet + setEnabled(bool) + + + _closeIdle + toggled(bool) + _idleTime + setEnabled(bool) + + + _enabled + toggled(bool) + groupBox2 + setEnabled(bool) + + + _enabled + toggled(bool) + groupBox4 + setEnabled(bool) + + + _enabled + toggled(bool) + groupBox3 + setEnabled(bool) + + + _closeIdle + toggled(bool) + _idleTime + setEnabled(bool) + + + _launchManager + toggled(bool) + _autocloseManager + setEnabled(bool) + + + + _enabled + _closeIdle + _idleTime + _screensaverLock + _autoclose + _defaultWallet + _newWallet + _localWalletSelected + _localWallet + _newLocalWallet + _launchManager + _autocloseManager + tabWidget2 + _openPrompt + _accessList + _launch + + + _storeTogether_toggled(bool) + + + diff --git a/tdewallet/kwalletmanager-tdewalletd.desktop b/tdewallet/kwalletmanager-tdewalletd.desktop new file mode 100644 index 0000000..d4f9706 --- /dev/null +++ b/tdewallet/kwalletmanager-tdewalletd.desktop @@ -0,0 +1,60 @@ +[Desktop Entry] +Name=Wallet Management Tool +Name[ar]=أداة إدارة المحفظة +Name[bg]=Портфейл +Name[br]=Merour an doug-paperoù +Name[bs]=Alat za upravljanje novčanikom +Name[ca]=Eina de gestió de carteres +Name[cs]=Nástroj pro správu úschovny +Name[cy]=Erfyn Rheoli Waled +Name[da]=Håndteringsværktøj for tegnebog +Name[de]=Verwaltung für digitale Brieftasche +Name[el]=Εργαλείο διαχείρισης πορτοφολιού +Name[es]=Herramienta de gestión de cartera +Name[et]=Turvalaeka haldur +Name[eu]=Kartera Kudeatzeko Tresna +Name[fa]=ابزار مدیریت Wallet +Name[fi]=Lompakon hallintatyökalu +Name[fr]=Outil de gestion de comptes +Name[ga]=Uirlis Bhainisteoireachta Wallet +Name[he]=כלי לניהול הארנק של TDE +Name[hi]= बटुआ प्रबंधन औज़ार +Name[hu]=Kezelőprogram a TDE digitális noteszeihez +Name[is]=Tól til að stýra eiginleikum veskisins +Name[it]=Strumento per la gestione dei portafogli +Name[ja]=ウォレット管理ツール +Name[ka]=Wallet-ის მმართველი მოწყობილობა +Name[kk]=Әмиянін басқару құралы +Name[km]=ឧបករណ៍​គ្រប់គ្រង​កាបូប +Name[lt]=Spatažodinių tvarkymo įrankis +Name[mk]=Алатка за менаџирање на паричници +Name[nb]=Wallet administrasjonsverktøy +Name[nds]=Knipp-Pleger +Name[ne]=वालेट व्यवस्थापन उपकरण +Name[nl]=Portefeuillebeheer +Name[nn]=Wallet-administrasjonsverktøy +Name[pa]=ਵਾਲਿਟ ਪਰਬੰਧਨ ਸੰਦ +Name[pl]=Narzędzie do zarządzania Portfelem +Name[pt]=Ferramenta de Gestão da Carteira +Name[pt_BR]=Ferramenta de Gerenciamento da Carteira +Name[ro]=Administrare portofel +Name[ru]=Управление паролями +Name[sk]=Nástroj na správu KWallet +Name[sl]=Orodje za upravljanje z listnicami +Name[sr]=Алат за управљање новчаником +Name[sr@Latn]=Alat za upravljanje novčanikom +Name[sv]=Hanteringsverktyg för plånbok +Name[ta]=வாலட் மேலாண்மை கருவி +Name[tg]=Асбоби Идоракунии Ҳамён +Name[tr]=Cüzdan Yönetim Aracı +Name[uk]=Засіб керування торбинками +Name[uz]=Qopchiq boshqarish vositasi +Name[uz@cyrillic]=Қопчиқ бошқариш воситаси +Name[zh_CN]=钱包管理工具 +Name[zh_TW]=錢包管理工具 +Exec=tdewalletmanager --tdewalletd +Icon=tdewalletmanager +Type=Application +Terminal=false +X-TDE-StartupNotify=false +NoDisplay=true diff --git a/tdewallet/kwmapeditor.cpp b/tdewallet/kwmapeditor.cpp new file mode 100644 index 0000000..2a9e332 --- /dev/null +++ b/tdewallet/kwmapeditor.cpp @@ -0,0 +1,187 @@ +/* + Copyright (C) 2003,2004 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kwmapeditor.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +KWMapEditor::KWMapEditor(TQMap& map, TQWidget *parent, const char *name) +: TQTable(0, 3, parent, name), _map(map) { + _ac = new KActionCollection(this); + _copyAct = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copy()), _ac); + connect(this, TQT_SIGNAL(valueChanged(int,int)), this, TQT_SIGNAL(dirty())); + connect(this, TQT_SIGNAL(contextMenuRequested(int,int,const TQPoint&)), + this, TQT_SLOT(contextMenu(int,int,const TQPoint&))); + setSelectionMode(TQTable::NoSelection); + horizontalHeader()->setLabel(0, TQString()); + horizontalHeader()->setLabel(1, i18n("Key")); + horizontalHeader()->setLabel(2, i18n("Value")); + setColumnWidth(0, 20); // FIXME: this is arbitrary + reload(); +} + +void KWMapEditor::reload() { + unsigned row = 0; + + while ((row = numRows()) > _map.count()) { + removeRow(row - 1); + } + + if ((row = numRows()) < _map.count()) { + insertRows(row, _map.count() - row); + for (int x = row; x < numRows(); ++x) { + TQPushButton *b = new TQPushButton("X", this); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(erase())); + setCellWidget(x, 0, b); + } + } + + row = 0; + for (TQMap::Iterator it = _map.begin(); it != _map.end(); ++it) { + setText(row, 1, it.key()); + setText(row, 2, it.data()); + row++; + } +} + + +KWMapEditor::~KWMapEditor() { +} + + +void KWMapEditor::erase() { + const TQObject *o = TQT_TQOBJECT(const_cast(sender())); + for (int i = 0; i < numRows(); i++) { + if (TQT_BASE_OBJECT_CONST(cellWidget(i, 0)) == TQT_BASE_OBJECT_CONST(o)) { + removeRow(i); + break; + } + } + + emit dirty(); +} + + +void KWMapEditor::saveMap() { + _map.clear(); + + for (int i = 0; i < numRows(); i++) { + _map[text(i, 1)] = text(i, 2); + } +} + + +void KWMapEditor::addEntry() { + int x = numRows(); + insertRows(x, 1); + TQPushButton *b = new TQPushButton("X", this); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(erase())); + setCellWidget(x, 0, b); + ensureCellVisible(x, 1); + setCurrentCell(x, 1); + emit dirty(); +} + + +void KWMapEditor::emitDirty() { + emit dirty(); +} + + +void KWMapEditor::contextMenu(int row, int col, const TQPoint& pos) { + _contextRow = row; + _contextCol = col; + KPopupMenu *m = new KPopupMenu(this); + m->insertItem(i18n("&New Entry"), this, TQT_SLOT(addEntry())); + _copyAct->plug(m); + m->popup(pos); +} + + +void KWMapEditor::copy() { + TQApplication::clipboard()->setText(text(_contextRow, 2)); +} + + +class InlineEditor : public TQTextEdit { + public: + InlineEditor(KWMapEditor *p, int row, int col) + : TQTextEdit(), _p(p), row(row), col(col) { + setWFlags(WStyle_NoBorder | WDestructiveClose); + KWin::setType(winId(), NET::Override); + connect(p, TQT_SIGNAL(destroyed()), TQT_SLOT(close())); + } + virtual ~InlineEditor() { if (!_p) return; _p->setText(row, col, text()); _p->emitDirty(); } + + protected: + virtual void focusOutEvent(TQFocusEvent* fe) { + if (fe->reason() == TQFocusEvent::Popup) { + TQWidget *focusW = tqApp->focusWidget(); + if (focusW && focusW == popup) { + return; + } + } + close(); + } + virtual void keyPressEvent(TQKeyEvent *e) { + if (e->key() == TQt::Key_Escape) { + e->accept(); + close(); + } else { + e->ignore(); + TQTextEdit::keyPressEvent(e); + } + } + virtual TQPopupMenu *createPopupMenu(const TQPoint &p) { + popup = TQTextEdit::createPopupMenu(p); + return popup; + } + TQGuardedPtr _p; + int row, col; + TQGuardedPtr popup; +}; + + +TQWidget *KWMapEditor::beginEdit(int row, int col, bool replace) { + //kdDebug(2300) << "EDIT COLUMN " << col << endl; + if (col != 2) { + return TQTable::beginEdit(row, col, replace); + } + + TQRect geo = cellGeometry(row, col); + TQTextEdit *e = new InlineEditor(this, row, col); + e->setText(text(row, col)); + e->move(mapToGlobal(geo.topLeft())); + e->resize(geo.width() * 2, geo.height() * 3); + e->show(); + return e; +} + + +#include "kwmapeditor.moc" diff --git a/tdewallet/kwmapeditor.h b/tdewallet/kwmapeditor.h new file mode 100644 index 0000000..0fade7b --- /dev/null +++ b/tdewallet/kwmapeditor.h @@ -0,0 +1,62 @@ +/* + Copyright (C) 2003,2004 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KWMAPEDITOR_H +#define KWMAPEDITOR_H + +#include +#include +#include + +class KAction; +class KActionCollection; + +class KWMapEditor : public TQTable { + Q_OBJECT + + + public: + KWMapEditor(TQMap& map, TQWidget *parent = 0, const char *name = 0); + virtual ~KWMapEditor(); + + public slots: + void reload(); + void saveMap(); + void erase(); + void contextMenu(int row, int col, const TQPoint& pos); + void addEntry(); + void emitDirty(); + + private slots: + void copy(); + + protected: + virtual TQWidget *beginEdit(int row, int col, bool replace); + + signals: + void dirty(); + + private: + TQMap& _map; + int _contextRow, _contextCol; + KActionCollection *_ac; + KAction *_copyAct; +}; + +#endif diff --git a/tdewallet/main.cpp b/tdewallet/main.cpp new file mode 100644 index 0000000..2279783 --- /dev/null +++ b/tdewallet/main.cpp @@ -0,0 +1,100 @@ +/* + Copyright (C) 2003-2005 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "tdewalletmanager.h" + + +class MyApp : public KUniqueApplication { + public: + MyApp() : KUniqueApplication() { ref(); } + virtual ~MyApp() {} + + virtual int newInstance() { return 0; } +}; + +int main(int argc, char **argv) { + static KCmdLineOptions options[] = { + {"show", I18N_NOOP("Show window on startup"), 0}, + {"tdewalletd", I18N_NOOP("For use by tdewalletd only"), 0}, + {"+name", I18N_NOOP("A wallet name"), 0}, + KCmdLineLastOption + }; + + TDEAboutData about("tdewalletmanager", I18N_NOOP("TDE Wallet Manager"), "1.1", + I18N_NOOP("TDE Wallet Management Tool"), + TDEAboutData::License_GPL, + I18N_NOOP("(c) 2003,2004 George Staikos"), 0, + "http://www.kde.org/"); + + about.addAuthor("George Staikos", I18N_NOOP("Primary author and maintainer"), "staikos@kde.org"); + about.addAuthor("Isaac Clerencia", I18N_NOOP("Developer"), "isaac@warp.es"); + + TDECmdLineArgs::init(argc, argv, &about); + TDECmdLineArgs::addCmdLineOptions(options); + + if (!KUniqueApplication::start()) { + return 0; + } + + MyApp a; + + KWalletManager wm; + wm.setCaption(i18n("TDE Wallet Manager")); + + a.setMainWidget(&wm); + + TDEGlobal::dirs()->addResourceType("tdewallet", "share/apps/tdewallet"); + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + if (args->isSet("show")) { + wm.show(); + } + + if (args->isSet("tdewalletd")) { + wm.tdewalletdLaunch(); + } + + for (int i = 0; i < args->count(); ++i) { + TQString fn = TQFileInfo(args->arg(i)).absFilePath(); + KMimeType::Ptr ptr; + if (TQFile::exists(fn) && + (ptr = KMimeType::findByFileContent(fn)) && + ptr->is("application/x-kde-wallet")) { + wm.openWalletFile(fn); + } else { + wm.openWallet(args->arg(i)); + } + } + args->clear(); + return a.exec(); +} + diff --git a/tdewallet/tdewalleteditor.cpp b/tdewallet/tdewalleteditor.cpp new file mode 100644 index 0000000..f85294f --- /dev/null +++ b/tdewallet/tdewalleteditor.cpp @@ -0,0 +1,1143 @@ +/* + Copyright (C) 2003-2005 George Staikos + Copyright (C) 2005 Isaac Clerencia + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include "kbetterthankdialogbase.h" +#include "tdewalleteditor.h" +#include "kwmapeditor.h" +#include "allyourbase.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +KWalletEditor::KWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent, const char *name) +: KMainWindow(parent, name), _walletName(wallet), _nonLocal(isPath) { + _newWallet = false; + _ww = new WalletWidget(this, "Wallet Widget"); + _copyPassAction = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copyPassword()), actionCollection()); + + TQVBoxLayout *box = new TQVBoxLayout(_ww->_entryListFrame); + box->setSpacing( KDialog::spacingHint() ); + box->setMargin( KDialog::marginHint() ); + _entryList = new KWalletEntryList(_ww->_entryListFrame, "Wallet Entry List"); + box->addWidget(new KListViewSearchLineWidget(_entryList, _ww->_entryListFrame)); + box->addWidget(_entryList); + + _ww->_entryStack->setEnabled(true); + + box = new TQVBoxLayout(_ww->_entryStack->widget(2)); + _mapEditorShowHide = new TQCheckBox(i18n("&Show values"), _ww->_entryStack->widget(2)); + connect(_mapEditorShowHide, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showHideMapEditorValue(bool))); + _mapEditor = new KWMapEditor(_currentMap, _ww->_entryStack->widget(2)); + box->addWidget(_mapEditorShowHide); + box->addWidget(_mapEditor); + + setCentralWidget(_ww); + + resize(600, 400); + + connect(_entryList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(entrySelectionChanged(TQListViewItem*))); + connect(_entryList, + TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint&,int)), + this, + TQT_SLOT(listContextMenuRequested(TQListViewItem*,const TQPoint&,int))); + connect(_entryList, + TQT_SIGNAL(itemRenamed(TQListViewItem*, int, const TQString&)), + this, + TQT_SLOT(listItemRenamed(TQListViewItem*, int, const TQString&))); + + connect(_ww->_passwordValue, TQT_SIGNAL(textChanged()), + this, TQT_SLOT(entryEditted())); + connect(_mapEditor, TQT_SIGNAL(dirty()), + this, TQT_SLOT(entryEditted())); + + connect(_ww->_undoChanges, TQT_SIGNAL(clicked()), + this, TQT_SLOT(restoreEntry())); + connect(_ww->_saveChanges, TQT_SIGNAL(clicked()), + this, TQT_SLOT(saveEntry())); + + connect(_ww->_showContents, TQT_SIGNAL(clicked()), + this, TQT_SLOT(showPasswordContents())); + connect(_ww->_hideContents, TQT_SIGNAL(clicked()), + this, TQT_SLOT(hidePasswordContents())); + + _walletIsOpen = false; + + _w = KWallet::Wallet::openWallet(wallet, winId(), isPath ? KWallet::Wallet::Path : KWallet::Wallet::Asynchronous); + if (_w) { + connect(_w, TQT_SIGNAL(walletOpened(bool)), this, TQT_SLOT(walletOpened(bool))); + connect(_w, TQT_SIGNAL(walletClosed()), this, TQT_SLOT(walletClosed())); + connect(_w, TQT_SIGNAL(folderUpdated(const TQString&)), this, TQT_SLOT(updateEntries(const TQString&))); + connect(_w, TQT_SIGNAL(folderListUpdated()), this, TQT_SLOT(updateFolderList())); + updateFolderList(); + } else { + kdDebug(2300) << "Wallet open failed!" << endl; + } + + createActions(); + createGUI("tdewalleteditor.rc"); + delete toolBar(); + + setCaption(wallet); + + TQTimer::singleShot(0, this, TQT_SLOT(layout())); +} + +KWalletEditor::~KWalletEditor() { + emit editorClosed(this); + delete _newFolderAction; + _newFolderAction = 0L; + delete _deleteFolderAction; + _deleteFolderAction = 0L; + delete _w; + _w = 0L; + if (_nonLocal) { + KWallet::Wallet::closeWallet(_walletName, true); + } +} + +void KWalletEditor::layout() { + TQValueList sz = _ww->_splitter->sizes(); + int sum = sz[0] + sz[1]; + sz[0] = sum/2; + sz[1] = sum/2; + _ww->_splitter->setSizes(sz); +} + +void KWalletEditor::createActions() { + _newFolderAction = new KAction(i18n("&New Folder..."), "folder_new", + 0, TQT_TQOBJECT(this), TQT_SLOT(createFolder()), actionCollection(), + "create_folder"); + connect(this, TQT_SIGNAL(enableFolderActions(bool)), + _newFolderAction, TQT_SLOT(setEnabled(bool))); + + _deleteFolderAction = new KAction(i18n("&Delete Folder"), 0, 0, + TQT_TQOBJECT(this), TQT_SLOT(deleteFolder()), actionCollection(), + "delete_folder"); + connect(this, TQT_SIGNAL(enableContextFolderActions(bool)), + _deleteFolderAction, TQT_SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableFolderActions(bool)), + _deleteFolderAction, TQT_SLOT(setEnabled(bool))); + + _passwordAction = new KAction(i18n("Change &Password..."), 0, 0, TQT_TQOBJECT(this), + TQT_SLOT(changePassword()), actionCollection(), + "change_password"); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _passwordAction, TQT_SLOT(setEnabled(bool))); + + _mergeAction = new KAction(i18n("&Merge Wallet..."), 0, 0, TQT_TQOBJECT(this), + TQT_SLOT(importWallet()), actionCollection(), + "merge"); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _mergeAction, TQT_SLOT(setEnabled(bool))); + + _importAction = new KAction(i18n("&Import XML..."), 0, 0, TQT_TQOBJECT(this), + TQT_SLOT(importXML()), actionCollection(), + "import"); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _importAction, TQT_SLOT(setEnabled(bool))); + + _exportAction = new KAction(i18n("&Export..."), 0, 0, TQT_TQOBJECT(this), + TQT_SLOT(exportXML()), actionCollection(), + "export"); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _exportAction, TQT_SLOT(setEnabled(bool))); + + _saveAsAction = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection()); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _saveAsAction, TQT_SLOT(setEnabled(bool))); + + KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), +actionCollection()); + emit enableWalletActions(false); + emit enableFolderActions(false); + emit enableContextFolderActions(false); +} + + +void KWalletEditor::walletClosed() { + delete _w; + _walletIsOpen = false; + _w = 0L; + _ww->setEnabled(false); + emit enableWalletActions(false); + emit enableFolderActions(false); + KMessageBox::sorry(this, i18n("This wallet was forced closed. You must reopen it to continue working with it.")); + deleteLater(); +} + + +void KWalletEditor::updateFolderList(bool checkEntries) { + TQStringList fl = _w->folderList(); + TQPtrStack trash; + + for (TQListViewItem *i = _entryList->firstChild(); i; i = i->nextSibling()) { + KWalletFolderItem *fi = dynamic_cast(i); + if (!fi) { + continue; + } + if (!fl.contains(fi->name())) { + trash.push(i); + } + } + + trash.setAutoDelete(true); + trash.clear(); + + for (TQStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { + if (_entryList->existsFolder(*i)) { + if (checkEntries) { + updateEntries(*i); + } + continue; + } + + _w->setFolder(*i); + TQStringList entries = _w->entryList(); + KWalletFolderItem *item = new KWalletFolderItem(_w,_entryList, + *i, entries.count()); + + KWalletContainerItem *pi = new KWalletContainerItem(item, i18n("Passwords"),KWallet::Wallet::Password); + KWalletContainerItem *mi = new KWalletContainerItem(item, i18n("Maps"),KWallet::Wallet::Map); + KWalletContainerItem *bi = new KWalletContainerItem(item, i18n("Binary Data"),KWallet::Wallet::Stream); + KWalletContainerItem *ui = new KWalletContainerItem(item, i18n("Unknown"),KWallet::Wallet::Unknown); + + for (TQStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { + switch (_w->entryType(*j)) { + case KWallet::Wallet::Password: + new KWalletEntryItem(_w, pi, *j); + break; + case KWallet::Wallet::Stream: + new KWalletEntryItem(_w, bi, *j); + break; + case KWallet::Wallet::Map: + new KWalletEntryItem(_w, mi, *j); + break; + case KWallet::Wallet::Unknown: + default: + new TQListViewItem(ui, *j); + break; + } + } + _entryList->setEnabled(true); + } + + //check if the current folder has been removed + if (!fl.contains(_currentFolder)) { + _currentFolder = ""; + _ww->_entryTitle->clear(); + _ww->_iconTitle->clear(); + } +} + +void KWalletEditor::deleteFolder() { + if (_w) { + TQListViewItem *i = _entryList->currentItem(); + if (i) { + KWalletFolderItem *fi = dynamic_cast(i); + if (!fi) { + return; + } + + int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the folder '%1' from the wallet?").arg(fi->name()),"",KStdGuiItem::del()); + if (rc == KMessageBox::Continue) { + bool rc = _w->removeFolder(fi->name()); + if (!rc) { + KMessageBox::sorry(this, i18n("Error deleting folder.")); + return; + } + _currentFolder = ""; + _ww->_entryTitle->clear(); + _ww->_iconTitle->clear(); + updateFolderList(); + } + } + } +} + + +void KWalletEditor::createFolder() { + if (_w) { + TQString n; + bool ok; + + do { + n = KInputDialog::getText(i18n("New Folder"), + i18n("Please choose a name for the new folder:"), + TQString(), + &ok, + this); + + if (!ok) { + return; + } + + if (_entryList->existsFolder(n)) { + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that folder name is in use. Try again?"), TQString(), i18n("Try Again"), i18n("Do Not Try")); + if (rc == KMessageBox::Yes) { + continue; + } + n = TQString(); + } + break; + } while (true); + + _w->createFolder(n); + updateFolderList(); + } +} + + +void KWalletEditor::saveEntry() { + int rc = 1; + TQListViewItem *item = _entryList->currentItem(); + _ww->_saveChanges->setEnabled(false); + _ww->_undoChanges->setEnabled(false); + + if (item && _w && item->parent()) { + KWalletContainerItem *ci = dynamic_cast(item->parent()); + if (ci) { + if (ci->type() == KWallet::Wallet::Password) { + rc = _w->writePassword(item->text(0), _ww->_passwordValue->text()); + } else if (ci->type() == KWallet::Wallet::Map) { + _mapEditor->saveMap(); + rc = _w->writeMap(item->text(0), _currentMap); + } else { + return; + } + + if (rc == 0) { + return; + } + } + } + + KMessageBox::sorry(this, i18n("Error saving entry. Error code: %1").arg(rc)); +} + + +void KWalletEditor::restoreEntry() { + entrySelectionChanged(_entryList->currentItem()); +} + + +void KWalletEditor::entryEditted() { + _ww->_saveChanges->setEnabled(true); + _ww->_undoChanges->setEnabled(true); +} + + +void KWalletEditor::entrySelectionChanged(TQListViewItem *item) { + KWalletContainerItem *ci = 0L; + KWalletFolderItem *fi = 0L; + + switch (item->rtti()) { + case KWalletEntryItemClass: + ci = dynamic_cast(item->parent()); + if (!ci) { + return; + } + fi = dynamic_cast(ci->parent()); + if (!fi) { + return; + } + _w->setFolder(fi->name()); + _deleteFolderAction->setEnabled(false); + if (ci->type() == KWallet::Wallet::Password) { + TQString pass; + if (_w->readPassword(item->text(0), pass) == 0) { + _ww->_entryStack->raiseWidget(int(4)); + _ww->_entryName->setText(i18n("Password: %1") + .arg(item->text(0))); + _ww->_passwordValue->setText(pass); + _ww->_saveChanges->setEnabled(false); + _ww->_undoChanges->setEnabled(false); + } + } else if (ci->type() == KWallet::Wallet::Map) { + _ww->_entryStack->raiseWidget(int(2)); + _mapEditorShowHide->setChecked(false); + showHideMapEditorValue(false); + if (_w->readMap(item->text(0), _currentMap) == 0) { + _mapEditor->reload(); + _ww->_entryName->setText(i18n("Name-Value Map: %1").arg(item->text(0))); + _ww->_saveChanges->setEnabled(false); + _ww->_undoChanges->setEnabled(false); + } + } else if (ci->type() == KWallet::Wallet::Stream) { + _ww->_entryStack->raiseWidget(int(3)); + TQByteArray ba; + if (_w->readEntry(item->text(0), ba) == 0) { + _ww->_entryName->setText(i18n("Binary Data: %1") + .arg(item->text(0))); + _ww->_saveChanges->setEnabled(false); + _ww->_undoChanges->setEnabled(false); + } + } + break; + + case KWalletContainerItemClass: + fi = dynamic_cast(item->parent()); + if (!fi) { + return; + } + _w->setFolder(fi->name()); + _deleteFolderAction->setEnabled(false); + _ww->_entryName->clear(); + _ww->_entryStack->raiseWidget(int(0)); + break; + + case KWalletFolderItemClass: + fi = dynamic_cast(item); + if (!fi) { + return; + } + _w->setFolder(fi->name()); + _deleteFolderAction->setEnabled(true); + _ww->_entryName->clear(); + _ww->_entryStack->raiseWidget(int(0)); + break; + } + + if (fi) { + _currentFolder = fi->name(); + _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); + _ww->_iconTitle->setPixmap(fi->getFolderIcon(KIcon::Toolbar)); + } +} + +void KWalletEditor::updateEntries(const TQString& folder) { + TQPtrStack trash; + + _w->setFolder(folder); + TQStringList entries = _w->entryList(); + + KWalletFolderItem *fi = _entryList->getFolder(folder); + + if (!fi) { + return; + } + + KWalletContainerItem *pi = fi->getContainer(KWallet::Wallet::Password); + KWalletContainerItem *mi = fi->getContainer(KWallet::Wallet::Map); + KWalletContainerItem *bi = fi->getContainer(KWallet::Wallet::Stream); + KWalletContainerItem *ui = fi->getContainer(KWallet::Wallet::Unknown); + + // Remove deleted entries + for (TQListViewItem *i = pi->firstChild(); i; i = i->nextSibling()) { + if (!entries.contains(i->text(0))) { + if (i == _entryList->currentItem()) { + entrySelectionChanged(0L); + } + trash.push(i); + } + } + + for (TQListViewItem *i = mi->firstChild(); i; i = i->nextSibling()) { + if (!entries.contains(i->text(0))) { + if (i == _entryList->currentItem()) { + entrySelectionChanged(0L); + } + trash.push(i); + } + } + + for (TQListViewItem *i = bi->firstChild(); i; i = i->nextSibling()) { + if (!entries.contains(i->text(0))) { + if (i == _entryList->currentItem()) { + entrySelectionChanged(0L); + } + trash.push(i); + } + } + + for (TQListViewItem *i = ui->firstChild(); i; i = i->nextSibling()) { + if (!entries.contains(i->text(0))) { + if (i == _entryList->currentItem()) { + entrySelectionChanged(0L); + } + trash.push(i); + } + } + + trash.setAutoDelete(true); + trash.clear(); + + // Add new entries + for (TQStringList::Iterator i = entries.begin(); i != entries.end(); ++i) { + if (fi->contains(*i)){ + continue; + } + + switch (_w->entryType(*i)) { + case KWallet::Wallet::Password: + new KWalletEntryItem(_w, pi, *i); + break; + case KWallet::Wallet::Stream: + new KWalletEntryItem(_w, bi, *i); + break; + case KWallet::Wallet::Map: + new KWalletEntryItem(_w, mi, *i); + break; + case KWallet::Wallet::Unknown: + default: + new TQListViewItem(ui, *i); + break; + } + } + fi->refresh(); + if (fi->name() == _currentFolder) { + _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); + } + if (!_entryList->selectedItem()) { + _ww->_entryName->clear(); + _ww->_entryStack->raiseWidget(int(0)); + } +} + +void KWalletEditor::listContextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col) { + Q_UNUSED(col) + + if (!_walletIsOpen) { + return; + } + + KWalletListItemClasses menuClass = KWalletUnknownClass; + KWalletContainerItem *ci = 0L; + + if (item) { + if (item->rtti() == KWalletEntryItemClass) { + ci = dynamic_cast(item->parent()); + if (!ci) { + return; + } + } else if (item->rtti() == KWalletContainerItemClass) { + ci = dynamic_cast(item); + if (!ci) { + return; + } + } + + if (ci && ci->type() == KWallet::Wallet::Unknown) { + return; + } + menuClass = static_cast(item->rtti()); + } + + KPopupMenu *m = new KPopupMenu(this); + if (item) { + TQString title = item->text(0); + // I think 200 pixels is wide enough for a title + title = KStringHandler::cPixelSqueeze(title, m->fontMetrics(), 200); + m->insertTitle(title); + switch (menuClass) { + case KWalletEntryItemClass: + m->insertItem(i18n("&New..." ), this, TQT_SLOT(newEntry()), Key_Insert); + m->insertItem(i18n( "&Rename" ), this, TQT_SLOT(renameEntry()), Key_F2); + m->insertItem(i18n( "&Delete" ), this, TQT_SLOT(deleteEntry()), Key_Delete); + if (ci && ci->type() == KWallet::Wallet::Password) { + m->insertSeparator(); + _copyPassAction->plug(m); + } + break; + + case KWalletContainerItemClass: + m->insertItem(i18n( "&New..." ), this, TQT_SLOT(newEntry()), Key_Insert); + break; + + case KWalletFolderItemClass: + _newFolderAction->plug(m); + _deleteFolderAction->plug(m); + break; + default: + abort(); + } + } else { + _newFolderAction->plug(m); + } + m->popup(pos); +} + + +void KWalletEditor::copyPassword() { + TQListViewItem *item = _entryList->selectedItem(); + if (_w && item) { + TQString pass; + if (_w->readPassword(item->text(0), pass) == 0) { + TQApplication::clipboard()->setText(pass); + } + } +} + + +void KWalletEditor::newEntry() { + TQListViewItem *item = _entryList->selectedItem(); + TQString n; + bool ok; + + TQListViewItem *p; + KWalletFolderItem *fi; + + //set the folder where we're trying to create the new entry + if (_w && item) { + p = item; + if (p->rtti() == KWalletEntryItemClass) { + p = item->parent(); + } + fi = dynamic_cast(p->parent()); + if (!fi) { + return; + } + _w->setFolder(fi->name()); + } else { + return; + } + + do { + n = KInputDialog::getText(i18n("New Entry"), + i18n("Please choose a name for the new entry:"), + TQString(), + &ok, + this); + + if (!ok) { + return; + } + + // FIXME: prohibits the use of the subheadings + if (fi->contains(n)) { + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that entry already exists. Try again?"), TQString(), i18n("Try Again"), i18n("Do Not Try")); + if (rc == KMessageBox::Yes) { + continue; + } + n = TQString(); + } + break; + } while (true); + + if (_w && item && !n.isEmpty()) { + TQListViewItem *p = item; + if (p->rtti() == KWalletEntryItemClass) { + p = item->parent(); + } + + KWalletFolderItem *fi = dynamic_cast(p->parent()); + if (!fi) { + KMessageBox::error(this, i18n("An unexpected error occurred trying to add the new entry")); + return; + } + _w->setFolder(fi->name()); + + KWalletEntryItem *ni = new KWalletEntryItem(_w, p, n); + _entryList->setSelected(ni,true); + _entryList->ensureItemVisible(ni); + + KWalletContainerItem *ci = dynamic_cast(p); + if (!ci) { + KMessageBox::error(this, i18n("An unexpected error occurred trying to add the new entry")); + return; + } + if (ci->type() == KWallet::Wallet::Password) { + _w->writePassword(n, TQString()); + } else if (ci->type() == KWallet::Wallet::Map) { + _w->writeMap(n, TQMap()); + } else if (ci->type() == KWallet::Wallet::Stream) { + _w->writeEntry(n, TQByteArray()); + } else { + abort(); + } + fi->refresh(); + _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); + } +} + + +void KWalletEditor::renameEntry() { + TQListViewItem *item = _entryList->selectedItem(); + if (_w && item) { + item->startRename(0); + } +} + + +// Only supports renaming of KWalletEntryItem derived classes. +void KWalletEditor::listItemRenamed(TQListViewItem* item, int, const TQString& t) { + if (item) { + KWalletEntryItem *i = dynamic_cast(item); + if (!i) { + return; + } + + if (!_w || t.isEmpty()) { + i->setText(0, i->oldName()); + return; + } + + if (_w->renameEntry(i->oldName(), t) == 0) { + i->clearOldName(); + KWalletContainerItem *ci = dynamic_cast(item->parent()); + if (!ci) { + KMessageBox::error(this, i18n("An unexpected error occurred trying to rename the entry")); + return; + } + if (ci->type() == KWallet::Wallet::Password) { + _ww->_entryName->setText(i18n("Password: %1").arg(item->text(0))); + } else if (ci->type() == KWallet::Wallet::Map) { + _ww->_entryName->setText(i18n("Name-Value Map: %1").arg(item->text(0))); + } else if (ci->type() == KWallet::Wallet::Stream) { + _ww->_entryName->setText(i18n("Binary Data: %1").arg(item->text(0))); + } + } else { + i->setText(0, i->oldName()); + } + } +} + + +void KWalletEditor::deleteEntry() { + TQListViewItem *item = _entryList->selectedItem(); + if (_w && item) { + int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the item '%1'?").arg(item->text(0)),"",KStdGuiItem::del()); + if (rc == KMessageBox::Continue) { + KWalletFolderItem *fi = dynamic_cast(item->parent()->parent()); + if (!fi) { + KMessageBox::error(this, i18n("An unexpected error occurred trying to delete the entry")); + return; + } + _w->removeEntry(item->text(0)); + delete item; + entrySelectionChanged(_entryList->currentItem()); + fi->refresh(); + _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); + } + } +} + +void KWalletEditor::changePassword() { + KWallet::Wallet::changePassword(_walletName); +} + + +void KWalletEditor::walletOpened(bool success) { + if (success) { + emit enableFolderActions(true); + emit enableContextFolderActions(false); + emit enableWalletActions(true); + updateFolderList(); + show(); + _entryList->setWallet(_w); + _walletIsOpen = true; + } else { + if (!_newWallet) { + KMessageBox::sorry(this, i18n("Unable to open the requested wallet.")); + } + close(); + } +} + + +void KWalletEditor::hidePasswordContents() { + _ww->_entryStack->raiseWidget(int(4)); +} + + +void KWalletEditor::showPasswordContents() { + _ww->_entryStack->raiseWidget(int(1)); +} + + +void KWalletEditor::showHideMapEditorValue(bool show) { + if (show) { + _mapEditor->showColumn(2); + } else { + _mapEditor->hideColumn(2); + } +} + + +enum MergePlan { Prompt = 0, Always = 1, Never = 2, Yes = 3, No = 4 }; + +void KWalletEditor::importWallet() { + KURL url = KFileDialog::getOpenURL(TQString(), "*.kwl", this); + if (url.isEmpty()) { + return; + } + + TQString tmpFile; + if (!TDEIO::NetAccess::download(url, tmpFile, this)) { + KMessageBox::sorry(this, i18n("Unable to access wallet '%1'.").arg(url.prettyURL())); + return; + } + + KWallet::Wallet *w = KWallet::Wallet::openWallet(tmpFile, winId(), KWallet::Wallet::Path); + if (w && w->isOpen()) { + MergePlan mp = Prompt; + TQStringList fl = w->folderList(); + for (TQStringList::ConstIterator f = fl.constBegin(); f != fl.constEnd(); ++f) { + if (!w->setFolder(*f)) { + continue; + } + + if (!_w->hasFolder(*f)) { + _w->createFolder(*f); + } + + _w->setFolder(*f); + + TQMap > map; + int rc; + rc = w->readMapList("*", map); + if (rc == 0) { + TQMap >::ConstIterator me; + for (me = map.constBegin(); me != map.constEnd(); ++me) { + bool hasEntry = _w->hasEntry(me.key()); + if (hasEntry && mp == Prompt) { + KBetterThanKDialogBase *bd; + bd = new KBetterThanKDialogBase(this); + bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(me.key()))); + mp = (MergePlan)bd->exec(); + delete bd; + bool ok = false; + if (mp == Always || mp == Yes) { + ok = true; + } + if (mp == Yes || mp == No) { + // reset mp + mp = Prompt; + } + if (!ok) { + continue; + } + } else if (hasEntry && mp == Never) { + continue; + } + _w->writeMap(me.key(), me.data()); + } + } + + TQMap pwd; + rc = w->readPasswordList("*", pwd); + if (rc == 0) { + TQMap::ConstIterator pe; + for (pe = pwd.constBegin(); pe != pwd.constEnd(); ++pe) { + bool hasEntry = _w->hasEntry(pe.key()); + if (hasEntry && mp == Prompt) { + KBetterThanKDialogBase *bd; + bd = new KBetterThanKDialogBase(this); + bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(pe.key()))); + mp = (MergePlan)bd->exec(); + delete bd; + bool ok = false; + if (mp == Always || mp == Yes) { + ok = true; + } + if (mp == Yes || mp == No) { + // reset mp + mp = Prompt; + } + if (!ok) { + continue; + } + } else if (hasEntry && mp == Never) { + continue; + } + _w->writePassword(pe.key(), pe.data()); + } + } + + TQMap ent; + rc = w->readEntryList("*", ent); + if (rc == 0) { + TQMap::ConstIterator ee; + for (ee = ent.constBegin(); ee != ent.constEnd(); ++ee) { + bool hasEntry = _w->hasEntry(ee.key()); + if (hasEntry && mp == Prompt) { + KBetterThanKDialogBase *bd; + bd = new KBetterThanKDialogBase(this); + bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(ee.key()))); + mp = (MergePlan)bd->exec(); + delete bd; + bool ok = false; + if (mp == Always || mp == Yes) { + ok = true; + } + if (mp == Yes || mp == No) { + // reset mp + mp = Prompt; + } + if (!ok) { + continue; + } + } else if (hasEntry && mp == Never) { + continue; + } + _w->writeEntry(ee.key(), ee.data()); + } + } + } + } + + delete w; + + TDEIO::NetAccess::removeTempFile(tmpFile); + updateFolderList(true); + restoreEntry(); +} + + +void KWalletEditor::importXML() { + KURL url = KFileDialog::getOpenURL(TQString(), "*.xml", this); + if (url.isEmpty()) { + return; + } + + TQString tmpFile; + if (!TDEIO::NetAccess::download(url, tmpFile, this)) { + KMessageBox::sorry(this, i18n("Unable to access XML file '%1'.").arg(url.prettyURL())); + return; + } + + TQFile qf(tmpFile); + if (!qf.open(IO_ReadOnly)) { + KMessageBox::sorry(this, i18n("Error opening XML file '%1' for input.").arg(url.prettyURL())); + TDEIO::NetAccess::removeTempFile(tmpFile); + return; + } + + TQDomDocument doc(tmpFile); + if (!doc.setContent(&qf)) { + KMessageBox::sorry(this, i18n("Error reading XML file '%1' for input.").arg(url.prettyURL())); + TDEIO::NetAccess::removeTempFile(tmpFile); + return; + } + + TQDomElement top = doc.documentElement(); + if (top.tagName().lower() != "wallet") { + KMessageBox::sorry(this, i18n("Error: XML file does not contain a wallet.")); + TDEIO::NetAccess::removeTempFile(tmpFile); + return; + } + + TQDomNode n = top.firstChild(); + MergePlan mp = Prompt; + while (!n.isNull()) { + TQDomElement e = n.toElement(); + if (e.tagName().lower() != "folder") { + n = n.nextSibling(); + continue; + } + + TQString fname = e.attribute("name"); + if (fname.isEmpty()) { + n = n.nextSibling(); + continue; + } + if (!_w->hasFolder(fname)) { + _w->createFolder(fname); + } + _w->setFolder(fname); + TQDomNode enode = e.firstChild(); + while (!enode.isNull()) { + e = enode.toElement(); + TQString type = e.tagName().lower(); + TQString ename = e.attribute("name"); + bool hasEntry = _w->hasEntry(ename); + if (hasEntry && mp == Prompt) { + KBetterThanKDialogBase *bd; + bd = new KBetterThanKDialogBase(this); + bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(fname)).arg(TQStyleSheet::escape(ename))); + mp = (MergePlan)bd->exec(); + delete bd; + bool ok = false; + if (mp == Always || mp == Yes) { + ok = true; + } + if (mp == Yes || mp == No) { // reset mp + mp = Prompt; + } + if (!ok) { + enode = enode.nextSibling(); + continue; + } + } else if (hasEntry && mp == Never) { + enode = enode.nextSibling(); + continue; + } + + if (type == "password") { + _w->writePassword(ename, e.text()); + } else if (type == "stream") { + _w->writeEntry(ename, KCodecs::base64Decode(TQCString(e.text().latin1()))); + } else if (type == "map") { + TQMap map; + TQDomNode mapNode = e.firstChild(); + while (!mapNode.isNull()) { + TQDomElement mape = mapNode.toElement(); + if (mape.tagName().lower() == "mapentry") { + map[mape.attribute("name")] = mape.text(); + } + mapNode = mapNode.nextSibling(); + } + _w->writeMap(ename, map); + } + enode = enode.nextSibling(); + } + n = n.nextSibling(); + } + + TDEIO::NetAccess::removeTempFile(tmpFile); + updateFolderList(true); + restoreEntry(); +} + + +void KWalletEditor::exportXML() { + KTempFile tf; + tf.setAutoDelete(true); + TQTextStream& ts(*tf.textStream()); + TQStringList fl = _w->folderList(); + + ts << "" << endl; + for (TQStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { + ts << " " << endl; + _w->setFolder(*i); + TQStringList entries = _w->entryList(); + for (TQStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { + switch (_w->entryType(*j)) { + case KWallet::Wallet::Password: + { + TQString pass; + if (_w->readPassword(*j, pass) == 0) { + ts << " "; + ts << TQStyleSheet::escape(pass); + ts << "" << endl; + } + break; + } + case KWallet::Wallet::Stream: + { + TQByteArray ba; + if (_w->readEntry(*j, ba) == 0) { + ts << " "; + ts << KCodecs::base64Encode(ba); + + ts << "" << endl; + } + break; + } + case KWallet::Wallet::Map: + { + TQMap map; + if (_w->readMap(*j, map) == 0) { + ts << " " << endl; + for (TQMap::ConstIterator k = map.begin(); k != map.end(); ++k) { + ts << " " << TQStyleSheet::escape(k.data()) << "" << endl; + } + ts << " " << endl; + } + break; + } + case KWallet::Wallet::Unknown: + default: + break; + } + } + ts << " " << endl; + } + + ts << "" << endl; + tf.close(); + + KURL url = KFileDialog::getSaveURL(TQString(), "*.xml", this); + + if (!url.isEmpty()) { + bool ok = true; + if (TDEIO::NetAccess::exists(url, false, this)) { + int rc = KMessageBox::warningContinueCancel(this, i18n("The file '%1' already exists. Would you like to overwrite this file?").arg(url.prettyURL()), i18n("Overwrite")); + if (rc == KMessageBox::Cancel) { + ok = false; + } + } + if (ok) { + KURL tfURL; tfURL.setPath(tf.name()); + TDEIO::NetAccess::file_copy(tfURL, url, 0600, true, false, this); + } + } +} + + +void KWalletEditor::setNewWallet(bool x) { + _newWallet = x; +} + + +void KWalletEditor::saveAs() { + KURL url = KFileDialog::getSaveURL(TQString(), "*.kwl", this); + if (!url.isEmpty()) { + // Sync() tdewalletd + if (_nonLocal) { + TDEIO::NetAccess::file_copy(KURL(_walletName), url, 0600, false, false, this); + } else { + TQString path = TDEGlobal::dirs()->saveLocation("tdewallet") + "/" + _walletName + ".kwl"; + KURL destURL; destURL.setPath(path); + TDEIO::NetAccess::file_copy(destURL, url, 0600, false, false, this); + } + } +} + + +#include "tdewalleteditor.moc" + diff --git a/tdewallet/tdewalleteditor.h b/tdewallet/tdewalleteditor.h new file mode 100644 index 0000000..fa7ea25 --- /dev/null +++ b/tdewallet/tdewalleteditor.h @@ -0,0 +1,111 @@ +/* + Copyright (C) 2003-2005 George Staikos + Copyright (C) 2005 Isaac Clerencia + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KWALLETEDITOR_H +#define KWALLETEDITOR_H + +#include "walletwidget.h" +#include +#include +#include + +class KAction; +class TQIconViewItem; +class TQListViewItem; +class TQCheckBox; +class KWalletFolderIconView; +class KWalletEntryList; +class KWMapEditor; + +class KWalletEditor : public KMainWindow { + Q_OBJECT + + + public: + KWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent = 0, const char* name = 0); + virtual ~KWalletEditor(); + + bool isOpen() const { return _w != 0L; } + + void setNewWallet(bool newWallet); + + public slots: + void walletClosed(); + void createFolder(); + void deleteFolder(); + + private slots: + void layout(); + void updateFolderList(bool checkEntries = false); + void entrySelectionChanged(TQListViewItem *item); + void listItemRenamed(TQListViewItem *, int, const TQString&); + void listContextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col); + void updateEntries(const TQString& folder); + + void newEntry(); + void renameEntry(); + void deleteEntry(); + void entryEditted(); + void restoreEntry(); + void saveEntry(); + + void changePassword(); + + void walletOpened(bool success); + void hidePasswordContents(); + void showPasswordContents(); + void showHideMapEditorValue(bool show); + + void saveAs(); + void exportXML(); + void importXML(); + void importWallet(); + + void copyPassword(); + + signals: + void enableWalletActions(bool enable); + void enableFolderActions(bool enable); + void enableContextFolderActions(bool enable); + void editorClosed(KMainWindow*); + + public: + TQString _walletName; + + private: + void createActions(); + bool _nonLocal; + KWallet::Wallet *_w; + WalletWidget *_ww; + KWalletEntryList *_entryList; + bool _walletIsOpen; + KAction *_newFolderAction, *_deleteFolderAction; + KAction *_passwordAction, *_exportAction, *_saveAsAction, *_mergeAction, *_importAction; + KAction *_copyPassAction; + TQLabel*_details; + TQString _currentFolder; + TQMap _currentMap; // save memory by storing + // only the most recent map. + KWMapEditor *_mapEditor; + TQCheckBox *_mapEditorShowHide; + bool _newWallet; +}; + +#endif diff --git a/tdewallet/tdewalleteditor.rc b/tdewallet/tdewalleteditor.rc new file mode 100644 index 0000000..76bd319 --- /dev/null +++ b/tdewallet/tdewalleteditor.rc @@ -0,0 +1,17 @@ + + + + &File + + + + + + + + + + &Help + + + diff --git a/tdewallet/tdewalletmanager.cpp b/tdewallet/tdewalletmanager.cpp new file mode 100644 index 0000000..9e16b74 --- /dev/null +++ b/tdewallet/tdewalletmanager.cpp @@ -0,0 +1,423 @@ +/* + Copyright (C) 2003,2004 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include "tdewalletmanager.h" +#include "tdewalletpopup.h" +#include "tdewalleteditor.h" +#include "allyourbase.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +KWalletManager::KWalletManager(TQWidget *parent, const char *name, WFlags f) +: KMainWindow(parent, name, f), DCOPObject("KWalletManager") { + TDEGlobal::dirs()->addResourceType("tdewallet", "share/apps/tdewallet"); + _tdewalletdLaunch = false; + TQAccel *accel = new TQAccel(this, "tdewalletmanager"); + + TDEApplication::dcopClient()->setQtBridgeEnabled(false); + _shuttingDown = false; + TDEConfig cfg("tdewalletrc"); // not sure why this setting isn't in tdewalletmanagerrc... + TDEConfigGroup walletConfigGroup(&cfg, "Wallet"); + _dcopRef = 0L; + if (walletConfigGroup.readBoolEntry("Launch Manager", true)) { + _tray = new KSystemTray(this, "tdewalletmanager tray"); + _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); + TQToolTip::add(_tray, i18n("TDE Wallet: No wallets open.")); + connect(_tray, TQT_SIGNAL(quitSelected()), TQT_SLOT(shuttingDown())); + TQStringList wl = KWallet::Wallet::walletList(); + bool isOpen = false; + for (TQStringList::Iterator it = wl.begin(); it != wl.end(); ++it) { + if (KWallet::Wallet::isOpen(*it)) { + _tray->setPixmap(loadSystemTrayIcon("wallet_open")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("TDE Wallet: A wallet is open.")); + isOpen = true; + break; + } + } + if (!isOpen && kapp->isRestored()) { + delete _tray; + _tray = 0L; + TQTimer::singleShot( 0, kapp, TQT_SLOT( quit())); + return; + } + } else { + _tray = 0L; + } + + _iconView = new KWalletIconView(this, "tdewalletmanager icon view"); + connect(_iconView, TQT_SIGNAL(executed(TQIconViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(openWallet(TQIconViewItem*))); + connect(_iconView, TQT_SIGNAL(contextMenuRequested(TQIconViewItem*, const TQPoint&)), TQT_TQOBJECT(this), TQT_SLOT(contextMenu(TQIconViewItem*, const TQPoint&))); + + updateWalletDisplay(); + setCentralWidget(_iconView); + _iconView->setMinimumSize(320, 200); + + _dcopRef = new DCOPRef("kded", "tdewalletd"); + _dcopRef->dcopClient()->setNotifications(true); + connect(_dcopRef->dcopClient(), + TQT_SIGNAL(applicationRemoved(const TQCString&)), + this, + TQT_SLOT(possiblyRescan(const TQCString&))); + connect(_dcopRef->dcopClient(), + TQT_SIGNAL(applicationRegistered(const TQCString&)), + this, + TQT_SLOT(possiblyRescan(const TQCString&))); + + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "allWalletsClosed()", "allWalletsClosed()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletClosed(TQString)", "updateWalletDisplay()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletOpened(TQString)", "aWalletWasOpened()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletDeleted(TQString)", "updateWalletDisplay()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletListDirty()", "updateWalletDisplay()", false); + + // FIXME: slight race - a wallet can open, then we get launched, but the + // wallet closes before we are done opening. We will then stay + // open. Must check that a wallet is still open here. + + new KAction(i18n("&New Wallet..."), "tdewalletmanager", 0, TQT_TQOBJECT(this), + TQT_SLOT(createWallet()), actionCollection(), + "wallet_create"); + KAction *act = new KAction(i18n("Configure &Wallet..."), "configure", + 0, TQT_TQOBJECT(this), TQT_SLOT(setupWallet()), actionCollection(), + "wallet_settings"); + if (_tray) { + act->plug(_tray->contextMenu()); + } + act = new KAction(i18n("Close &All Wallets"), 0, 0, TQT_TQOBJECT(this), + TQT_SLOT(closeAllWallets()), actionCollection(), + "close_all_wallets"); + if (_tray) { + act->plug(_tray->contextMenu()); + } + KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(shuttingDown()), actionCollection()); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), +actionCollection()); + + createGUI("tdewalletmanager.rc"); + accel->connectItem(accel->insertItem(Key_Return), TQT_TQOBJECT(this), TQT_SLOT(openWallet())); + accel->connectItem(accel->insertItem(Key_Delete), TQT_TQOBJECT(this), TQT_SLOT(deleteWallet())); + + if (_tray) { + _tray->show(); + } else { + show(); + } + + kapp->setName("tdewallet"); // hack to fix docs +} + + +KWalletManager::~KWalletManager() { + _tray = 0L; + delete _dcopRef; + _dcopRef = 0L; +} + + +void KWalletManager::tdewalletdLaunch() { + _tdewalletdLaunch = true; +} + + +bool KWalletManager::queryClose() { + if (!_shuttingDown && !kapp->sessionSaving()) { + if (!_tray) { + kapp->quit(); + } else { + hide(); + } + return false; + } + return true; +} + + +void KWalletManager::aWalletWasOpened() { + if (_tray) { + _tray->setPixmap(loadSystemTrayIcon("wallet_open")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("TDE Wallet: A wallet is open.")); + } + updateWalletDisplay(); +} + + +void KWalletManager::updateWalletDisplay() { +TQStringList wl = KWallet::Wallet::walletList(); +TQPtrStack trash; + + for (TQIconViewItem *item = _iconView->firstItem(); item; item = item->nextItem()) { + if (!wl.contains(item->text())) { + trash.push(item); + } + } + + trash.setAutoDelete(true); + trash.clear(); + + for (TQStringList::Iterator i = wl.begin(); i != wl.end(); ++i) { + if (!_iconView->findItem(*i)) { + // FIXME: if KWallet::Wallet::isOpen(*i) then show + // a different icon! + new KWalletItem(_iconView, *i); + } else { + // FIXME: See if icon needs to be updated + } + } +} + + +void KWalletManager::contextMenu(TQIconViewItem *item, const TQPoint& pos) { + if (item) { + TQGuardedPtr popupMenu = new KWalletPopup(item->text(), this); + connect(popupMenu, TQT_SIGNAL(walletOpened(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(openWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletClosed(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(closeWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletDeleted(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(deleteWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletChangePassword(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(changeWalletPassword(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletCreated()), TQT_TQOBJECT(this), TQT_SLOT(createWallet())); + popupMenu->exec(pos); + delete popupMenu; + } +} + + +void KWalletManager::deleteWallet(const TQString& walletName) { + int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the wallet '%1'?").arg(walletName),"",KStdGuiItem::del()); + if (rc != KMessageBox::Continue) { + return; + } + rc = KWallet::Wallet::deleteWallet(walletName); + if (rc != 0) { + KMessageBox::sorry(this, i18n("Unable to delete the wallet. Error code was %1.").arg(rc)); + } + updateWalletDisplay(); +} + + +void KWalletManager::closeWallet(const TQString& walletName) { + int rc = KWallet::Wallet::closeWallet(walletName, false); + if (rc != 0) { + rc = KMessageBox::warningYesNo(this, i18n("Unable to close wallet cleanly. It is probably in use by other applications. Do you wish to force it closed?"), TQString(), i18n("Force Closure"), i18n("Do Not Force")); + if (rc == KMessageBox::Yes) { + rc = KWallet::Wallet::closeWallet(walletName, true); + if (rc != 0) { + KMessageBox::sorry(this, i18n("Unable to force the wallet closed. Error code was %1.").arg(rc)); + } + } + } + + updateWalletDisplay(); +} + + +void KWalletManager::changeWalletPassword(const TQString& walletName) { + KWallet::Wallet::changePassword(walletName); +} + + +void KWalletManager::openWalletFile(const TQString& path) { + KWalletEditor *we = new KWalletEditor(path, true, this, "Wallet Editor"); + if (we->isOpen()) { + connect(we, TQT_SIGNAL(editorClosed(KMainWindow*)), + this, TQT_SLOT(editorClosed(KMainWindow*))); + we->show(); + } else { + KMessageBox::sorry(this, i18n("Error opening wallet %1.").arg(path)); + delete we; + } +} + + +void KWalletManager::openWallet() { + TQIconViewItem *item = _iconView->currentItem(); + openWallet(item); +} + +void KWalletManager::deleteWallet() { + TQIconViewItem *item = _iconView->currentItem(); + if (item) { + deleteWallet(item->text()); + } +} + + +void KWalletManager::openWallet(const TQString& walletName) { + openWallet(walletName, false); +} + + +void KWalletManager::openWallet(const TQString& walletName, bool newWallet) { + // Don't allow a wallet to open in two windows + for (KMainWindow *w = _windows.first(); w; w = _windows.next()) { + KWalletEditor *e = static_cast(w); + if (e->isOpen() && e->_walletName == walletName) { + w->raise(); + return; + } + } + + KWalletEditor *we = new KWalletEditor(walletName, false, this, "Wallet Editor"); + we->setNewWallet(newWallet); + if (we->isOpen()) { + connect(we, TQT_SIGNAL(editorClosed(KMainWindow*)), + this, TQT_SLOT(editorClosed(KMainWindow*))); + we->show(); + _windows.append(we); + } else if (!newWallet) { + KMessageBox::sorry(this, i18n("Error opening wallet %1.").arg(walletName)); + delete we; + } +} + + +void KWalletManager::openWallet(TQIconViewItem *item) { + if (item) { + openWallet(item->text()); + } +} + + +void KWalletManager::allWalletsClosed() { + if (_tray) { + _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("TDE Wallet: No wallets open.")); + } + possiblyQuit(); +} + + +void KWalletManager::possiblyQuit() { + TDEConfig cfg("tdewalletrc"); + cfg.setGroup("Wallet"); + if (_windows.isEmpty() && + !isVisible() && + !cfg.readBoolEntry("Leave Manager Open", false) && + _tdewalletdLaunch) { + kapp->quit(); + } +} + + +void KWalletManager::editorClosed(KMainWindow* e) { + _windows.remove(e); +} + + +void KWalletManager::possiblyRescan(const TQCString& app) { + if (app == "kded") { + updateWalletDisplay(); + } +} + + +void KWalletManager::createWallet() { + TQString n; + bool ok; + // FIXME: support international names + TQRegExp regexp("^[A-Za-z0-9]+[A-Za-z0-9_\\s\\-]*$"); + TQString txt = i18n("Please choose a name for the new wallet:"); + + if (!KWallet::Wallet::isEnabled()) { + // FIXME: KMessageBox::warningYesNo(this, i1_8n("KWallet is not enabled. Do you want to enable it?"), TQString(), i18n("Enable"), i18n("Keep Disabled")); + return; + } + + do { + n = KInputDialog::getText(i18n("New Wallet"), + txt, + TQString(), + &ok, + this); + + if (!ok) { + return; + } + + if (_iconView->findItem(n)) { + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that wallet already exists. Try a new name?"), TQString(), i18n("Try New"), i18n("Do Not Try")); + if (rc == KMessageBox::Yes) { + continue; + } + n = TQString(); + } else if (regexp.exactMatch(n)) { + break; + } else { + txt = i18n("Please choose a name that contains only alphanumeric characters:"); + } + } while (true); + + // Small race here - the wallet could be created on us already. + if (!n.isEmpty()) { + openWallet(n, true); + } +} + + +void KWalletManager::shuttingDown() { + _shuttingDown = true; + kapp->quit(); +} + + +void KWalletManager::setupWallet() { + TDEApplication::startServiceByDesktopName("tdewallet_config"); +} + + +void KWalletManager::closeAllWallets() { + _dcopRef->call("closeAllWallets"); +} + + +TQPixmap KWalletManager::loadSystemTrayIcon(const TQString &icon) { +#if KDE_IS_VERSION(3, 1, 90) + return KSystemTray::loadIcon(icon); +#else + TDEConfig *appCfg = kapp->config(); + TDEConfigGroupSaver configSaver(appCfg, "System Tray"); + int iconWidth = appCfg->readNumEntry("systrayIconWidth", 22); + return kapp->iconLoader()->loadIcon( icon, KIcon::Panel, iconWidth ); +#endif +} + + +#include "tdewalletmanager.moc" diff --git a/tdewallet/tdewalletmanager.desktop b/tdewallet/tdewalletmanager.desktop new file mode 100644 index 0000000..915a341 --- /dev/null +++ b/tdewallet/tdewalletmanager.desktop @@ -0,0 +1,63 @@ +[Desktop Entry] +Name=Wallet Management Tool +Name[ar]=أداة إدارة المحفظة +Name[bg]=Портфейл +Name[br]=Merour an doug-paperoù +Name[bs]=Alat za upravljanje novčanikom +Name[ca]=Eina de gestió de carteres +Name[cs]=Nástroj pro správu úschovny +Name[cy]=Erfyn Rheoli Waled +Name[da]=Håndteringsværktøj for tegnebog +Name[de]=Verwaltung für digitale Brieftasche +Name[el]=Εργαλείο διαχείρισης πορτοφολιού +Name[es]=Herramienta de gestión de cartera +Name[et]=Turvalaeka haldur +Name[eu]=Kartera Kudeatzeko Tresna +Name[fa]=ابزار مدیریت Wallet +Name[fi]=Lompakon hallintatyökalu +Name[fr]=Outil de gestion de comptes +Name[ga]=Uirlis Bhainisteoireachta Wallet +Name[he]=כלי לניהול הארנק של TDE +Name[hi]= बटुआ प्रबंधन औज़ार +Name[hu]=Kezelőprogram a TDE digitális noteszeihez +Name[is]=Tól til að stýra eiginleikum veskisins +Name[it]=Strumento per la gestione dei portafogli +Name[ja]=ウォレット管理ツール +Name[ka]=Wallet-ის მმართველი მოწყობილობა +Name[kk]=Әмиянін басқару құралы +Name[km]=ឧបករណ៍​គ្រប់គ្រង​កាបូប +Name[lt]=Spatažodinių tvarkymo įrankis +Name[mk]=Алатка за менаџирање на паричници +Name[nb]=Wallet administrasjonsverktøy +Name[nds]=Knipp-Pleger +Name[ne]=वालेट व्यवस्थापन उपकरण +Name[nl]=Portefeuillebeheer +Name[nn]=Wallet-administrasjonsverktøy +Name[pa]=ਵਾਲਿਟ ਪਰਬੰਧਨ ਸੰਦ +Name[pl]=Narzędzie do zarządzania Portfelem +Name[pt]=Ferramenta de Gestão da Carteira +Name[pt_BR]=Ferramenta de Gerenciamento da Carteira +Name[ro]=Administrare portofel +Name[ru]=Управление паролями +Name[sk]=Nástroj na správu KWallet +Name[sl]=Orodje za upravljanje z listnicami +Name[sr]=Алат за управљање новчаником +Name[sr@Latn]=Alat za upravljanje novčanikom +Name[sv]=Hanteringsverktyg för plånbok +Name[ta]=வாலட் மேலாண்மை கருவி +Name[tg]=Асбоби Идоракунии Ҳамён +Name[tr]=Cüzdan Yönetim Aracı +Name[uk]=Засіб керування торбинками +Name[uz]=Qopchiq boshqarish vositasi +Name[uz@cyrillic]=Қопчиқ бошқариш воситаси +Name[zh_CN]=钱包管理工具 +Name[zh_TW]=錢包管理工具 +Exec=tdewalletmanager %u +MimeType=application/x-kde-wallet; +InitialPreference=6 +Icon=tdewalletmanager +Type=Application +Terminal=false +X-TDE-StartupNotify=false +Categories=Qt;TDE;Settings; +DocPath=tdewallet/index.html diff --git a/tdewallet/tdewalletmanager.h b/tdewallet/tdewalletmanager.h new file mode 100644 index 0000000..23103d5 --- /dev/null +++ b/tdewallet/tdewalletmanager.h @@ -0,0 +1,85 @@ +/* + Copyright (C) 2003,2004 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KWALLETMANAGER_H +#define KWALLETMANAGER_H + +#include +#include +#include + +class KSystemTray; +class KWalletIconView; +class TQIconViewItem; +class DCOPRef; + + +class KWalletManager : public KMainWindow, public DCOPObject { + Q_OBJECT +// + K_DCOP + + public: + KWalletManager(TQWidget *parent = 0, const char* name = 0, WFlags f = 0); + virtual ~KWalletManager(); + + TQPixmap loadSystemTrayIcon(const TQString &icon); + + void tdewalletdLaunch(); + + public slots: + void createWallet(); + void deleteWallet(const TQString& walletName); + void closeWallet(const TQString& walletName); + void changeWalletPassword(const TQString& walletName); + void openWallet(const TQString& walletName); + void openWallet(const TQString& walletName, bool newWallet); + void openWalletFile(const TQString& path); + void openWallet(TQIconViewItem *item); + void contextMenu(TQIconViewItem *item, const TQPoint& pos); + + protected: + virtual bool queryClose(); + + private: + k_dcop: + ASYNC allWalletsClosed(); + ASYNC updateWalletDisplay(); + ASYNC aWalletWasOpened(); + + private slots: + void shuttingDown(); + void possiblyQuit(); + void editorClosed(KMainWindow* e); + void possiblyRescan(const TQCString& app); + void setupWallet(); + void openWallet(); + void deleteWallet(); + void closeAllWallets(); + + private: + KSystemTray *_tray; + bool _shuttingDown; + KWalletIconView *_iconView; + DCOPRef *_dcopRef; + TQPtrList _windows; + bool _tdewalletdLaunch; +}; + +#endif diff --git a/tdewallet/tdewalletmanager.rc b/tdewallet/tdewalletmanager.rc new file mode 100644 index 0000000..509e4b0 --- /dev/null +++ b/tdewallet/tdewalletmanager.rc @@ -0,0 +1,14 @@ + + + + &File + + + + &Settings + + + &Help + + + diff --git a/tdewallet/tdewalletpopup.cpp b/tdewallet/tdewalletpopup.cpp new file mode 100644 index 0000000..05f142d --- /dev/null +++ b/tdewallet/tdewalletpopup.cpp @@ -0,0 +1,110 @@ +/* + Copyright (C) 2003 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include "tdewalletpopup.h" + +#include +#include +#include +#include +#include +#include +#include + +KWalletPopup::KWalletPopup(const TQString& wallet, TQWidget *parent, const char *name) +: KPopupMenu(parent, name), _walletName(wallet) { + insertTitle(wallet); + KActionCollection *ac = new KActionCollection(this, "tdewallet context actions"); + KAction *act; + + act = new KAction(i18n("&New Wallet..."), 0, 0, TQT_TQOBJECT(this), + TQT_SLOT(createWallet()), ac, "wallet_create"); + act->plug(this); + + act = new KAction(i18n("&Open..."), 0, Key_Return, TQT_TQOBJECT(this), + TQT_SLOT(openWallet()), ac, "wallet_open"); + act->plug(this); + + act = new KAction(i18n("Change &Password..."), 0, 0, TQT_TQOBJECT(this), + TQT_SLOT(changeWalletPassword()), ac, "wallet_password"); + act->plug(this); + + TQStringList ul = KWallet::Wallet::users(wallet); + if (!ul.isEmpty()) { + KPopupMenu *pm = new KPopupMenu(this, "Disconnect Apps"); + int id = 7000; + for (TQStringList::Iterator it = ul.begin(); it != ul.end(); ++it) { + _appMap[id] = *it; + pm->insertItem(*it, this, TQT_SLOT(disconnectApp(int)), 0, id); + pm->setItemParameter(id, id); + id++; + } + + insertItem(i18n("Disconnec&t"), pm); + } + + act = KStdAction::close( TQT_TQOBJECT(this), + TQT_SLOT(closeWallet()), ac, "wallet_close"); + // FIXME: let's track this inside the manager so we don't need a dcop + // roundtrip here. + act->setEnabled(KWallet::Wallet::isOpen(wallet)); + act->plug(this); + + act = new KAction(i18n("&Delete"), 0, Key_Delete, TQT_TQOBJECT(this), + TQT_SLOT(deleteWallet()), ac, "wallet_delete"); + act->plug(this); +} + + +KWalletPopup::~KWalletPopup() { +} + + +void KWalletPopup::openWallet() { + emit walletOpened(_walletName); +} + + +void KWalletPopup::deleteWallet() { + emit walletDeleted(_walletName); +} + + +void KWalletPopup::closeWallet() { + emit walletClosed(_walletName); +} + + +void KWalletPopup::changeWalletPassword() { + emit walletChangePassword(_walletName); +} + + +void KWalletPopup::createWallet() { + emit walletCreated(); +} + + +void KWalletPopup::disconnectApp(int id) { + KWallet::Wallet::disconnectApplication(_walletName, _appMap[id].latin1()); +} + +#include "tdewalletpopup.moc" + diff --git a/tdewallet/tdewalletpopup.h b/tdewallet/tdewalletpopup.h new file mode 100644 index 0000000..8ef78b0 --- /dev/null +++ b/tdewallet/tdewalletpopup.h @@ -0,0 +1,55 @@ +/* + Copyright (C) 2003 George Staikos + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KWALLETPOPUP_H +#define KWALLETPOPUP_H + +#include +#include +#include + +class KWalletPopup : public KPopupMenu { + Q_OBJECT + + + public: + KWalletPopup(const TQString& wallet, TQWidget *parent = 0, const char* name = 0); + virtual ~KWalletPopup(); + + public slots: + void openWallet(); + void deleteWallet(); + void closeWallet(); + void createWallet(); + void changeWalletPassword(); + void disconnectApp(int); + + signals: + void walletOpened(const TQString& walletName); + void walletClosed(const TQString& walletName); + void walletDeleted(const TQString& walletName); + void walletCreated(); + void walletChangePassword(const TQString& walletName); + + private: + TQString _walletName; + TQMap _appMap; +}; + +#endif diff --git a/tdewallet/walletwidget.ui b/tdewallet/walletwidget.ui new file mode 100644 index 0000000..9979097 --- /dev/null +++ b/tdewallet/walletwidget.ui @@ -0,0 +1,416 @@ + +WalletWidget + + + WalletWidget + + + + 0 + 0 + 614 + 507 + + + + + unnamed + + + 0 + + + + _splitter + + + Horizontal + + + + _entryListFrame + + + + 5 + 5 + 0 + 0 + + + + NoFrame + + + Plain + + + + + layout3 + + + + unnamed + + + + _entryName + + + + 5 + 1 + 0 + 0 + + + + + + + PlainText + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 227 + 21 + + + + + + _undoChanges + + + false + + + &Undo + + + "undo" + + + + + layout2 + + + + unnamed + + + + _iconTitle + + + + 1 + 1 + 0 + 0 + + + + + + + + + _entryTitle + + + + 7 + 1 + 0 + 0 + + + + + 1 + + + + + + + RichText + + + AlignVCenter + + + + + + + _saveChanges + + + false + + + &Save + + + "filesave" + + + + + _entryStack + + + + 5 + 5 + 0 + 1 + + + + + page + + + 0 + + + + + page + + + 1 + + + + unnamed + + + 0 + + + + _passwordValue + + + PlainText + + + + + spacer8 + + + Horizontal + + + Expanding + + + + 271 + 20 + + + + + + _hideContents + + + Hide &Contents + + + + + + + page + + + 2 + + + + + page + + + 3 + + + + unnamed + + + 0 + + + + textLabel1_2 + + + This is a binary data entry. It cannot be editted as its format is unknown and application specific. + + + WordBreak|AlignVCenter + + + + + spacer3 + + + Vertical + + + Expanding + + + + 31 + 41 + + + + + + spacer4 + + + Vertical + + + Expanding + + + + 31 + 41 + + + + + + spacer5 + + + Horizontal + + + Expanding + + + + 61 + 41 + + + + + + spacer6 + + + Horizontal + + + Expanding + + + + 41 + 21 + + + + + + + + page + + + 4 + + + + unnamed + + + 0 + + + + spacer7 + + + Horizontal + + + Expanding + + + + 236 + 21 + + + + + + spacer6_2 + + + Vertical + + + Expanding + + + + 31 + 358 + + + + + + _showContents + + + Show &Contents + + + + + + + + + + + + kdialog.h + kiconloader.h + +SmallIconSet + + + -- cgit v1.2.3