diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9476e27 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,53 @@ +################################################################################ +# TDEAlternatives - alternatives configuration module for TDE # +# # +# Improvements and feedback are welcome! # +# This software is licensed under the terms of the GNU GPL v3 license. # +################################################################################ + +cmake_minimum_required( VERSION 3.1 ) + +project( kcm_alternatives ) + +### Required modules ########################################################### +include( FindPkgConfig ) +include( CheckFunctionExists ) +include( CheckSymbolExists ) +include( CheckIncludeFile ) +include( CheckLibraryExists ) +include( CheckCSourceCompiles ) +include( CheckCXXSourceCompiles ) + +### TDE macros ################################################################# +include( TDEMacros ) +tde_set_project_version( ) + +include( TDESetupPaths ) +tde_setup_paths( ) + +### Optional support ########################################################### +option( WITH_DISTRIBUTION_DPKG "Enable support for DPKG package manager" OFF ) +option( WITH_DISTRIBUTION_RPM "Enable support for RPM package manager" OFF ) + +### Modules to build ########################################################### +option( BUILD_ALL "Build all" ON ) +option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) + +### Configure checks ########################################################### +include( ConfigureChecks.cmake ) + +### Compiler settings ########################################################## +add_definitions( -DHAVE_CONFIG_H ) + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) +set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" ) + +### Add subdirectories ######################################################### +add_subdirectory( src ) +tde_conditional_add_project_docs( BUILD_DOC ) +tde_conditional_add_project_translations( BUILD_TRANSLATIONS ) + +### Write configuration ######################################################## +configure_file( config.h.cmake config.h @ONLY ) \ No newline at end of file diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..7555a11 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,32 @@ +################################################################################ +# TDEAlternatives - alternatives configuration module for TDE # +# # +# Improvements and feedback are welcome! # +# This software is licensed under the terms of the GNU GPL v3 license. # +################################################################################ + +find_package( TQt ) +find_package( TDE ) + +tde_setup_architecture_flags( ) + +include( TestBigEndian ) +test_big_endian( WORDS_BIGENDIAN ) + +tde_setup_largefiles( ) + + +if( WITH_GCC_VISIBILITY ) + tde_setup_gcc_visibility( ) +endif( WITH_GCC_VISIBILITY ) + + +# Distribution + +if( NOT WITH_DISTRIBUTION_DPKG AND NOT WITH_DISTRIBUTION_RPM ) + tde_message_fatal("No distribution selected, please select one of: dpkg, rpm") +endif( ) + +if( WITH_DISTRIBUTION_DPKG AND WITH_DISTRIBUTION_RPM ) + tde_message_fatal("Multiple distributions selected. You should select only one distribution.") +endif( ) \ No newline at end of file diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 3909ce9..0000000 --- a/INSTALL +++ /dev/null @@ -1,16 +0,0 @@ -What you need: - -- KDE >= 3.2 -- Qt -- All development packages for KDE (kdelibs & qt) - -To install configure the program with the correct prefix for -your KDE installation (like /usr or /opt/kde3 or similar) - -./configure --prefix=... - -And finally: - -make install - -Now you should be able to run the "kalternatives" command. diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 3e2cd4f..0000000 --- a/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -SUBDIRS = src doc - -$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs - cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ; - -$(top_srcdir)/subdirs: - cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs - -$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in - @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4 - -MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files - -package-messages: - cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages - $(MAKE) -C po merge - -EXTRA_DIST = admin COPYING configure.in.in - -dist-hook: - cd $(top_distdir) && perl admin/am_edit -padmin - cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs diff --git a/Makefile.cvs b/Makefile.cvs deleted file mode 100644 index 4c0afd1..0000000 --- a/Makefile.cvs +++ /dev/null @@ -1,10 +0,0 @@ -all: - @echo "This Makefile is only for the CVS repository" - @echo "This will be deleted before making the distribution" - @echo "" - $(MAKE) -f admin/Makefile.common cvs - -dist: - $(MAKE) -f admin/Makefile.common dist - -.SILENT: diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 0000000..3ac4cb3 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,12 @@ +#define VERSION "@VERSION@" + +// Defined if you have fvisibility and fvisibility-inlines-hidden support. +#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ + +/* Distributions */ +#cmakedefine WITH_DISTRIBUTION_DPKG @WITH_DISTRIBUTION_DPKG@ +#cmakedefine WITH_DISTRIBUTION_RPM @WITH_DISTRIBUTION_RPM@ \ No newline at end of file diff --git a/configure.in.in b/configure.in.in deleted file mode 100644 index 4f9eb42..0000000 --- a/configure.in.in +++ /dev/null @@ -1,11 +0,0 @@ -#MIN_CONFIG(3.0.0) - -AM_INIT_AUTOMAKE(kalternatives, 0.10) -AC_C_BIGENDIAN -AC_CHECK_KDEMAXPATHLEN - -AC_CHECK_FILE(/etc/debian_version, [AC_DEFINE([DEBIAN], [], [debian]) AC_MSG_NOTICE(it is a debian)], -[AC_CHECK_FILE(/etc/mandrakelinux-release, -[AC_DEFINE([MANDRAKE], [], [mandrake]) AC_MSG_NOTICE(it is a mandrake)], -[AC_MSG_NOTICE(it is an other distribution)])]) - diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 8fba3fa..0000000 --- a/debian/changelog +++ /dev/null @@ -1,12 +0,0 @@ -kalternatives (0.12-1) unstable; urgency=low - - * Initial release. - - -- > Tue, 14 Oct 2004 13:07:14 +0100 - -kalternatives (0.10-1) unstable; urgency=low - - * Initial release. - - -- > Tue, 30 Dec 2003 22:40:14 +0100 - diff --git a/debian/control b/debian/control deleted file mode 100644 index 89395d7..0000000 --- a/debian/control +++ /dev/null @@ -1,14 +0,0 @@ -Source: kalternatives -Section: admin -Priority: optional -Maintainer: Mario Bensi -Build-Depends: automake1.7, debhelper (>> 4.0.18), gettext, kdelibs4-dev -Standards-Version: 3.2.1 - -Package: kalternatives -Architecture: any -Depends: ${shlibs:Depends} -Description: KDE GUI for configuring the Debian alternatives system - This program lets you configure the Debian/Mandrake alternatives system (a - system that allows you to select one alternative file for many in the - filesystem) using an easy KDE GUI. diff --git a/debian/rules b/debian/rules deleted file mode 100755 index d8cd816..0000000 --- a/debian/rules +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/make -f - -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/kde.mk - -# These variables are used by debhelper.mk; we are telling it to -# 1. dh_compress not to compress any files with the below extensions. -# 2. dh_makeshlibs to create automatic conservative version dependencies -# 3. dh_shlibdeps which directories to look in to resolve internal dependencies -DEB_COMPRESS_EXCLUDE := .bz2 .css .dcl .docbook -license -DEB_DH_MAKESHLIBS_ARGS := -V -DEB_SHLIBDEPS_INCLUDE := debian/libartsc0/usr/lib debian/libarts1/usr/lib diff --git a/kalternatives.kdevelop b/kalternatives.kdevelop deleted file mode 100644 index 4d56712..0000000 --- a/kalternatives.kdevelop +++ /dev/null @@ -1,152 +0,0 @@ - - - - Juanjo - juanjux@yahoo.es - 0.10 - KDevKDEAutoProject - C++ - - C++ - Code - Qt - KDE - - - - - src/kalternatives - debug - - - src/kalternatives - executable - - - - optimized - kdevgccoptions - kdevgppoptions - kdevg77options - -O2 -g0 - - - --enable-debug=full - debug - kdevgccoptions - kdevgppoptions - kdevg77options - -O0 -g3 - - - - - - - - - - - - - - - - - false - false - - - *.o,*.lo,CVS - false - - - - - ada - ada_bugs_gcc - bash - bash_bugs - clanlib - w3c-dom-level2-html - fortran_bugs_gcc - gnome1 - gnustep - gtk - gtk_bugs - haskell - haskell_bugs_ghc - java_bugs_gcc - java_bugs_sun - pascal_bugs_fp - php - php_bugs - perl - perl_bugs - python - python_bugs - ruby - ruby_bugs - sdl - w3c-svg - sw - w3c-uaag10 - wxwindows_bugs - - - qmake User Guide - - - - - libtool - - - - - - - - - - - - false - false - - - 0.10 - - - - - - - - - false - false - false - 0 - false - false - false - false - - - - - - true - true - true - false - true - true - true - 250 - 400 - 250 - - - diff --git a/kalternatives.kdevelop.pcs b/kalternatives.kdevelop.pcs deleted file mode 100644 index 8ebb09f..0000000 Binary files a/kalternatives.kdevelop.pcs and /dev/null differ diff --git a/kalternatives.kdevses b/kalternatives.kdevses deleted file mode 100644 index 3a5f8de..0000000 --- a/kalternatives.kdevses +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kalternatives.pro b/kalternatives.pro deleted file mode 100644 index bd8d754..0000000 --- a/kalternatives.pro +++ /dev/null @@ -1,11 +0,0 @@ -###################################################################### -# Automatically generated by qmake (1.06c) Sat Feb 28 20:13:05 2004 -###################################################################### - -TEMPLATE = app -DEPENDPATH += src -INCLUDEPATH += . src - -# Input -HEADERS += src/altparser.h src/kalternatives.h -SOURCES += src/altparser.cpp src/kalternatives.cpp src/main.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..8866b04 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,62 @@ +################################################################################ +# TDEAlternatives - alternatives configuration module for TDE # +# # +# Improvements and feedback are welcome! # +# This software is licensed under the terms of the GNU GPL v3 license. # +################################################################################ + +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_alternatives (module) ################################################## + +tde_add_kpart( + kcm_alternatives AUTOMOC + + SOURCES + addslavesui.ui + propertieswindow.ui + addalternativesui.ui + mainwindow.ui + altcontroller.cpp + tdealternatives.cpp + altparser.cpp + altitemelement.cpp + treeitemelement.cpp + addslaves.cpp + addalternatives.cpp + + LINK + tdeui-shared + tdeio-shared + + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +### translated desktop files ################################################### + +tde_create_translated_desktop(alternatives.desktop) + + +### data ####################################################################### + +tde_install_icons( ) + +install( + FILES tdealternativesui.rc + DESTINATION ${DATA_INSTALL_DIR}/tdealternatives/ +) + + +# kate: replace-tabs true; tab-width 2; \ No newline at end of file diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index bb80034..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -INCLUDES = $(all_includes) - -noinst_HEADERS = kalternatives.h altparser.h altcontroller.h altitemelement.h treeitemelement.h addslaves.h addalternatives.h - -KDE_ICON = kalternatives - -# Install this plugin in the KDE modules directory -kde_module_LTLIBRARIES = kcm_kalternatives.la - -kcm_kalternatives_la_SOURCES = addslavesui.ui propertieswindow.ui addalternativesui.ui mainwindow.ui altcontroller.cpp kalternatives.cpp altparser.cpp altitemelement.cpp treeitemelement.cpp addslaves.cpp addalternatives.cpp - -kcm_kalternatives_la_LIBADD = $(LIB_TDEUI) $(LIB_TDEIO) -kcm_kalternatives_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined - - -kcm_kalternatives_la_METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kalternatives.pot - -xdg_apps_DATA = kalternatives.desktop diff --git a/src/addalternatives.cpp b/src/addalternatives.cpp index 4ecda4a..1a88725 100644 --- a/src/addalternatives.cpp +++ b/src/addalternatives.cpp @@ -21,7 +21,7 @@ #include "addalternatives.h" #include "addslaves.h" #include "treeitemelement.h" -#include "kalternatives.h" +#include "tdealternatives.h" #include "altcontroller.h" #include "altitemelement.h" #include "altparser.h" @@ -35,8 +35,8 @@ #include #include -AddAlternatives::AddAlternatives(TreeItemElement *treeItem, Kalternatives *kalt, int countSlaves): -AddAlternativesUi(kalt),m_treeItem(treeItem), m_kalt(kalt), m_countSlave(countSlaves) +AddAlternatives::AddAlternatives(TreeItemElement *treeItem, TDEAlternatives *kalt, int countSlaves): +AddAlternativesUi(kalt),m_treeItem(treeItem), m_alt(kalt), m_countSlave(countSlaves) { m_bOk->setGuiItem(KStdGuiItem::ok()); m_bCancel->setGuiItem(KStdGuiItem::cancel()); @@ -87,7 +87,7 @@ void AddAlternatives::slotOkClicked() item->addAlternative(a); - AltItemElement *altItem = new AltItemElement(m_kalt->optionsList(), a); + AltItemElement *altItem = new AltItemElement(m_alt->optionsList(), a); m_treeItem->getAltController()->addAltItem(altItem); @@ -108,7 +108,7 @@ void AddAlternatives::slotOkClicked() altItem->searchDescription(); } m_treeItem->setNbrAltChanged(TRUE); - emit m_kalt->configChanged(); + emit m_alt->configChanged(); close(); } else diff --git a/src/addalternatives.h b/src/addalternatives.h index bbb7454..c7c6c28 100644 --- a/src/addalternatives.h +++ b/src/addalternatives.h @@ -26,18 +26,18 @@ #include class TreeItemElement; -class Kalternatives; +class TDEAlternatives; class AddAlternatives : public AddAlternativesUi { - Q_OBJECT + TQ_OBJECT TreeItemElement *m_treeItem; - Kalternatives *m_kalt; + TDEAlternatives *m_alt; int m_countSlave; public: - AddAlternatives(TreeItemElement *treeItem, Kalternatives *kalt, int countSlaves); + AddAlternatives(TreeItemElement *treeItem, TDEAlternatives *kalt, int countSlaves); virtual ~AddAlternatives(); void addSlave(const TQString& text){m_textSlave->append(text);} diff --git a/src/addslaves.h b/src/addslaves.h index efcb274..27265b7 100644 --- a/src/addslaves.h +++ b/src/addslaves.h @@ -27,7 +27,7 @@ class AddAlternatives; class AddSlaves : public AddSlavesUi { - Q_OBJECT + TQ_OBJECT AddAlternatives *m_addAlternatives; diff --git a/src/alternatives.desktop b/src/alternatives.desktop new file mode 100644 index 0000000..818e58e --- /dev/null +++ b/src/alternatives.desktop @@ -0,0 +1,16 @@ +[Desktop Entry] +Encoding=UTF-8 +Exec=tdecmshell alternatives +Icon=tdealternatives +Type=Application + +X-TDE-ModuleType=Library +X-TDE-Library=alternatives +X-TDE-RootOnly=true +X-TDE-HasReadOnlyMode=true +X-TDE-ParentApp=kcontrol + +Name=Alternatives +Comment=TDEAlternatives - DPKG/RPM alternatives manager for TDE +Categories=Qt;TDE;X-TDE-settings-system; +Keywords=applications,alternative,alternatives,dpkg,rpm,debian,devuan,ubuntu,redhat,fedora,mageia \ No newline at end of file diff --git a/src/altitemelement.cpp b/src/altitemelement.cpp index 0e695f9..d0125cf 100644 --- a/src/altitemelement.cpp +++ b/src/altitemelement.cpp @@ -62,12 +62,12 @@ void AltItemElement::searchDescription() *procdesc << "whatis"; *procdesc << exec; - connect(procdesc, SIGNAL(receivedStdout(TDEProcess *, char *, int)), this, - SLOT(slotGetDescription(TDEProcess *, char *, int))); - //connect(procdesc, SIGNAL( receivedStderr(TDEProcess *, char *, int) ), this, - // SLOT(slotGetDescription(TDEProcess *, char *, int))); - connect(procdesc, SIGNAL( processExited(TDEProcess *)), this, - SLOT(slotDescriptionTermined(TDEProcess *))); + connect(procdesc, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), this, + TQ_SLOT(slotGetDescription(TDEProcess *, char *, int))); + //connect(procdesc, TQ_SIGNAL( receivedStderr(TDEProcess *, char *, int) ), this, + // TQ_SLOT(slotGetDescription(TDEProcess *, char *, int))); + connect(procdesc, TQ_SIGNAL( processExited(TDEProcess *)), this, + TQ_SLOT(slotDescriptionTermined(TDEProcess *))); procdesc->start(TDEProcess::NotifyOnExit,/*TDEProcess::Block,*/ TDEProcess::AllOutput); } } diff --git a/src/altitemelement.h b/src/altitemelement.h index dad1693..df04e6b 100644 --- a/src/altitemelement.h +++ b/src/altitemelement.h @@ -31,7 +31,7 @@ class AltController; class AltItemElement : public TQObject, public TQCheckListItem { - Q_OBJECT + TQ_OBJECT Alternative *m_alt; TDEListView *m_parent; diff --git a/src/hi16-app-kalternatives.png b/src/hi16-app-tdealternatives.png similarity index 100% rename from src/hi16-app-kalternatives.png rename to src/hi16-app-tdealternatives.png diff --git a/src/hi32-app-kalternatives.png b/src/hi32-app-tdealternatives.png similarity index 100% rename from src/hi32-app-kalternatives.png rename to src/hi32-app-tdealternatives.png diff --git a/src/kalternatives.desktop b/src/kalternatives.desktop deleted file mode 100644 index 1a83fbb..0000000 --- a/src/kalternatives.desktop +++ /dev/null @@ -1,37 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Exec=tdecmshell kalternatives -Icon=application-vnd.tde.misc -Type=Application - -X-TDE-ModuleType=Library -X-TDE-Library=kalternatives -X-TDE-RootOnly=true -X-TDE-HasReadOnlyMode=true -X-TDE-ParentApp=kcontrol - -Comment=Kalternatives - KDE Mandrake/Debian alternatives-system manager -Comment[da]=Alternative systemhåndteringer, Kalternatives for KDE Mandrake/Debian -Comment[es]=Kalternatives - administrador alternativo del sistema KDE en Mandrake/Debian -Comment[et]=Kalternatives - KDE Mandrake/Debiani alternatiivide süsteemi haldur -Comment[fr]=KAlternatives - Un gestionnaire du système d'alternatives Mandrake / Debian pour KDE -Comment[gl]=Kalternatives - Xestión do sistema de alternativas da Mandrake/Debian -Comment[it]=Kalternatives - Gestione dei sistemi di alternative di Mandrake e Debian per KDE -Comment[pt]=Kalternatives - Gestão de sistema de alternativas para Mandrake/Debian -Comment[pt_BR]=Kalternatives - Gestão de sistema de alternativas para Mandrake/Debian -Comment[sv]=Kalternativ - KDE:s Mandrake och Debian alternativ systemhantering -Comment[ta]=Kalternatives - கேடியி மாண்ட்ரேக்/டெபியன் மாற்றுகள் அமைப்பு மேலாளர் -Comment[tr]=Kseçenekleri - KDE Mandarake/Debian seçenekleri sistem yöneticisi -Comment[xx]=xxKalternatives - KDE Mandrake/Debian alternatives-system managerxx -Keywords=Kalternatives;kalternatives -Keywords[fr]=Kalternatives;kalternatives;alternatives -Keywords[sv]=Kalternativ;kalternativ -Keywords[tr]=Kseçenekleri;kseçenekleri -Keywords[xx]=xxKalternatives;kalternativesxx -Name=Kalternatives -Name[ta]=Kமாற்றுகள் -Name[tr]=Kseçenekleri -Name[xx]=xxKalternativesxx - - -Categories=Qt;TDE;X-TDE-settings-system; diff --git a/src/kalternatives.lsm b/src/kalternatives.lsm deleted file mode 100644 index 8558492..0000000 --- a/src/kalternatives.lsm +++ /dev/null @@ -1,16 +0,0 @@ -Begin3 -Title: kalternatives -- Some description -Version: 0.12 -Entered-date: -Description: -Keywords: KDE Qt -Author: Juanjo -Maintained-by: Juanjo -Home-page: -Alternate-site: -Primary-site: ftp://ftp.kde.org/pub/kde/unstable/apps/utils - xxxxxx kalternatives-0.12.tar.gz - xxx kalternatives-0.12.lsm -Platform: Linux. Needs KDE -Copying-policy: GPL -End diff --git a/src/kalternatives.cpp b/src/tdealternatives.cpp similarity index 81% rename from src/kalternatives.cpp rename to src/tdealternatives.cpp index 940fc57..744433a 100644 --- a/src/kalternatives.cpp +++ b/src/tdealternatives.cpp @@ -21,7 +21,7 @@ * 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "kalternatives.h" +#include "tdealternatives.h" #include "altparser.h" #include "propertieswindow.h" #include "altcontroller.h" @@ -44,19 +44,21 @@ #include #include -typedef KGenericFactory KalternativesFactory; -K_EXPORT_COMPONENT_FACTORY( kcm_kalternatives, KalternativesFactory("kcmkalternatives")) +#include "config.h" + +typedef KGenericFactory TDEAlternativesFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_alternatives, TDEAlternativesFactory("kcm_alternatives")) extern "C" { - TDECModule *create_kalternatives(TQWidget *parent, const char *name) + TDECModule *create_alternatives(TQWidget *parent, const char *name) { - return new Kalternatives(parent, name); + return new TDEAlternatives(parent, name); }; } -Kalternatives::Kalternatives(TQWidget *parent, const char *name, const TQStringList&) -:TDECModule(/*KalternativesFactory::instance(), */parent, name), myAboutData(0) +TDEAlternatives::TDEAlternatives(TQWidget *parent, const char *name, const TQStringList&) +:TDECModule(/*TDEAlternativesFactory::instance(), */parent, name), myAboutData(0) { setUseRootOnlyMsg(false); @@ -73,14 +75,16 @@ Kalternatives::Kalternatives(TQWidget *parent, const char *name, const TQStringL setButtons(Help); } -#ifdef MANDRAKE +#ifdef WITH_DISTRIBUTION_RPM m_mgr = new AltFilesManager("/var/lib/rpm/alternatives"); #else - #ifdef DEBIAN + #ifdef WITH_DISTRIBUTION_DPKG m_mgr = new AltFilesManager("/var/lib/dpkg/alternatives"); #else - KMessageBox::sorry(this, i18n("Kalternatives only work on Debian- or Mandrake-based systems"), i18n("Wrong System Type")); - TQTimer::singleShot(0, this, SLOT(die())); + KMessageBox::sorry(this, + i18n("TDEAlternatives only works on systems which use the DPKG or RPM package manager."), + i18n("Wrong System Type")); + TQTimer::singleShot(0, this, TQ_SLOT(die())); #endif #endif @@ -91,20 +95,20 @@ m_mgr = new AltFilesManager("/var/lib/rpm/alternatives"); mainwindow->m_altList->setShowToolTips(1); - connect(mainwindow->m_hideAlt, SIGNAL(clicked()), this, - SLOT(slotHideAlternativesClicked())); + connect(mainwindow->m_hideAlt, TQ_SIGNAL(clicked()), this, + TQ_SLOT(slotHideAlternativesClicked())); - connect(mainwindow->m_altList, SIGNAL(selectionChanged( TQListViewItem* )), this, - SLOT(slotSelectAlternativesClicked(TQListViewItem *))); + connect(mainwindow->m_altList, TQ_SIGNAL(selectionChanged( TQListViewItem* )), this, + TQ_SLOT(slotSelectAlternativesClicked(TQListViewItem *))); - connect(mainwindow->m_optionsList, SIGNAL(clicked(TQListViewItem *)), - this, SLOT(slotOptionClicked(TQListViewItem *))); - connect(mainwindow->m_bAdd, SIGNAL(clicked()), this, - SLOT(slotAddClicked())); - connect(mainwindow->m_bDelete, SIGNAL(clicked()), this, - SLOT(slotDeleteClicked())); - connect(mainwindow->m_bProperties, SIGNAL(clicked()), this, - SLOT(slotPropertiesClicked())); + connect(mainwindow->m_optionsList, TQ_SIGNAL(clicked(TQListViewItem *)), + this, TQ_SLOT(slotOptionClicked(TQListViewItem *))); + connect(mainwindow->m_bAdd, TQ_SIGNAL(clicked()), this, + TQ_SLOT(slotAddClicked())); + connect(mainwindow->m_bDelete, TQ_SIGNAL(clicked()), this, + TQ_SLOT(slotDeleteClicked())); + connect(mainwindow->m_bProperties, TQ_SIGNAL(clicked()), this, + TQ_SLOT(slotPropertiesClicked())); m_altList = mainwindow->m_altList; m_optionsList = mainwindow->m_optionsList; @@ -124,26 +128,24 @@ m_mgr = new AltFilesManager("/var/lib/rpm/alternatives"); m_statusCombo->setEnabled(false); } - myAboutData = new TDEAboutData("kcmkalternatives", I18N_NOOP("Kalternatives"), - KALT_VERSION, I18N_NOOP("KDE Mandrake/Debian alternatives-system manager"), + myAboutData = new TDEAboutData("kcm_alternatives", I18N_NOOP("TDEAlternatives"), + VERSION, I18N_NOOP("DPKG/RPM alternatives manager for TDE"), TDEAboutData::License_GPL, I18N_NOOP("(c) 2004 Juanjo Alvarez Martinez\n" - "(c) 2004 Mario Bensi")); + "(c) 2004 Mario Bensi")); myAboutData->addAuthor("Juanjo Alvarez Martinez", 0, "juanjo@juanjoalvarez.net", "http://juanjoalvarez.net"); myAboutData->addAuthor("Mario Bensi", 0, "nef@ipsquad.net", "http://ipsquad.net"); myAboutData->addAuthor("Pino Toscano", 0, "toscano.pino@tiscali.it"); -#if KDE_IS_VERSION(3,2,90) setAboutData( myAboutData ); -#endif load(); m_hideAlt->setChecked(true); slotHideAlternativesClicked(); } -Kalternatives::~Kalternatives() +TDEAlternatives::~TDEAlternatives() { if(m_mgr) delete m_mgr; if(m_altList) delete m_altList; @@ -153,12 +155,12 @@ Kalternatives::~Kalternatives() if(m_hideAlt) delete m_hideAlt; } -void Kalternatives::die() +void TDEAlternatives::die() { delete this; } -void Kalternatives::load() +void TDEAlternatives::load() { clearList(m_altList); TQPtrList *itemslist = m_mgr->getGlobalAlternativeList(); @@ -186,7 +188,7 @@ void Kalternatives::load() -void Kalternatives::clearList(TDEListView* list) +void TDEAlternatives::clearList(TDEListView* list) { TQListViewItemIterator it( list ); TQListViewItem *tmp; @@ -198,7 +200,7 @@ void Kalternatives::clearList(TDEListView* list) } -void Kalternatives::slotSelectAlternativesClicked(TQListViewItem *alternative) +void TDEAlternatives::slotSelectAlternativesClicked(TQListViewItem *alternative) { clearList(m_optionsList); TreeItemElement *treeItem; @@ -239,7 +241,7 @@ void Kalternatives::slotSelectAlternativesClicked(TQListViewItem *alternative) -void Kalternatives::slotHideAlternativesClicked() +void TDEAlternatives::slotHideAlternativesClicked() { if (m_hideAlt->isChecked ()) { @@ -269,7 +271,7 @@ void Kalternatives::slotHideAlternativesClicked() } -void Kalternatives::slotOptionClicked(TQListViewItem *option) +void TDEAlternatives::slotOptionClicked(TQListViewItem *option) { AltItemElement *altItem; if((altItem = dynamic_cast(option))) @@ -286,7 +288,7 @@ void Kalternatives::slotOptionClicked(TQListViewItem *option) } } -void Kalternatives::slotAddClicked() +void TDEAlternatives::slotAddClicked() { TreeItemElement *treeItem; if((treeItem = dynamic_cast(m_altList->selectedItem()))) @@ -302,7 +304,7 @@ void Kalternatives::slotAddClicked() } } } -void Kalternatives::slotDeleteClicked() +void TDEAlternatives::slotDeleteClicked() { TreeItemElement *treeItem; if((treeItem = dynamic_cast(m_altList->selectedItem()))) @@ -324,7 +326,7 @@ void Kalternatives::slotDeleteClicked() } } -void Kalternatives::slotPropertiesClicked() +void TDEAlternatives::slotPropertiesClicked() { AltItemElement *altItem; @@ -355,7 +357,7 @@ void Kalternatives::slotPropertiesClicked() } -void Kalternatives::save() +void TDEAlternatives::save() { TQListViewItemIterator it( m_altList ); TreeItemElement *treeItem; @@ -440,18 +442,18 @@ void Kalternatives::save() } -void Kalternatives::configChanged() +void TDEAlternatives::configChanged() { emit changed(true); } -TQString Kalternatives::quickHelp() const +TQString TDEAlternatives::quickHelp() const { - return i18n("

Kalternatives

\n" - "A Mandrake/Debian alternatives-system manager."); + return i18n("

TDEAlternatives

\n", + "RPM/DPKG alternatives manager for TDE"); } -#include "kalternatives.moc" +#include "tdealternatives.moc" \ No newline at end of file diff --git a/src/kalternatives.h b/src/tdealternatives.h similarity index 90% rename from src/kalternatives.h rename to src/tdealternatives.h index e035f10..b130d11 100644 --- a/src/kalternatives.h +++ b/src/tdealternatives.h @@ -21,8 +21,8 @@ * 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _KALTERNATIVES_H_ -#define _KALTERNATIVES_H_ +#ifndef _tdealternatives_H_ +#define _tdealternatives_H_ //#ifdef HAVE_CONFIG_H //#include @@ -37,13 +37,11 @@ #include #include -#define KALT_VERSION "0.12" - class AltFilesManager; -class Kalternatives : public TDECModule +class TDEAlternatives : public TDECModule { - Q_OBJECT + TQ_OBJECT bool m_bisRoot; AltFilesManager *m_mgr; @@ -57,8 +55,8 @@ class Kalternatives : public TDECModule void clearList(TDEListView* list); public: - Kalternatives(TQWidget *parent=0, const char *name=0, const TQStringList& = TQStringList() ); - virtual ~Kalternatives(); + TDEAlternatives(TQWidget *parent=0, const char *name=0, const TQStringList& = TQStringList() ); + virtual ~TDEAlternatives(); TDEListView *optionsList() const {return m_optionsList;} bool isBisRoot() const {return m_bisRoot;} @@ -80,4 +78,4 @@ private slots: void slotPropertiesClicked(); }; -#endif // _KALTERNATIVES_H_ +#endif // _tdealternatives_H_ diff --git a/src/kalternativesui.rc b/src/tdealternativesui.rc similarity index 100% rename from src/kalternativesui.rc rename to src/tdealternativesui.rc