Port to CMake, rename to TDEAlternatives (alternatives)

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/1/head
Mavridis Philippe 11 months ago
parent 1920d57b50
commit 59fb1e660d
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -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 )

@ -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( )

@ -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.

@ -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

@ -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:

@ -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@

@ -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)])])

12
debian/changelog vendored

@ -1,12 +0,0 @@
kalternatives (0.12-1) unstable; urgency=low
* Initial release.
-- <Mario Bensi <nef@ipsquad.net>> Tue, 14 Oct 2004 13:07:14 +0100
kalternatives (0.10-1) unstable; urgency=low
* Initial release.
-- <Juanjo Alvarez <juanjux@yahoo.es>> Tue, 30 Dec 2003 22:40:14 +0100

14
debian/control vendored

@ -1,14 +0,0 @@
Source: kalternatives
Section: admin
Priority: optional
Maintainer: Mario Bensi <nef@ipsquad.net>
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.

12
debian/rules vendored

@ -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

@ -1,152 +0,0 @@
<?xml version = '1.0'?>
<kdevelop>
<general>
<author>Juanjo</author>
<email>juanjux@yahoo.es</email>
<version>0.10</version>
<projectmanagement>KDevKDEAutoProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
<keywords>
<keyword>C++</keyword>
<keyword>Code</keyword>
<keyword>Qt</keyword>
<keyword>KDE</keyword>
</keywords>
</general>
<kdevautoproject>
<general>
<activetarget>src/kalternatives</activetarget>
<useconfiguration>debug</useconfiguration>
</general>
<run>
<mainprogram>src/kalternatives</mainprogram>
<directoryradio>executable</directoryradio>
</run>
<configurations>
<optimized>
<builddir>optimized</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
<cxxflags>-O2 -g0</cxxflags>
</optimized>
<debug>
<configargs>--enable-debug=full</configargs>
<builddir>debug</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
<cxxflags>-O0 -g3</cxxflags>
</debug>
</configurations>
<make>
<envvars>
<envvar value="1" name="WANT_AUTOCONF_2_5" />
<envvar value="1" name="WANT_AUTOMAKE_1_6" />
</envvars>
</make>
</kdevautoproject>
<kdevfileview>
<groups>
<group pattern="*.cpp;*.cxx;*.h" name="Sources" />
<group pattern="*.ui" name="User Interface" />
<group pattern="*.png" name="Icons" />
<group pattern="*.po;*.ts" name="Translations" />
<group pattern="*" name="Others" />
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidenonlocation>false</hidenonlocation>
</groups>
<tree>
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
<hidenonprojectfiles>false</hidenonprojectfiles>
</tree>
</kdevfileview>
<kdevdoctreeview>
<ignoretocs>
<toc>ada</toc>
<toc>ada_bugs_gcc</toc>
<toc>bash</toc>
<toc>bash_bugs</toc>
<toc>clanlib</toc>
<toc>w3c-dom-level2-html</toc>
<toc>fortran_bugs_gcc</toc>
<toc>gnome1</toc>
<toc>gnustep</toc>
<toc>gtk</toc>
<toc>gtk_bugs</toc>
<toc>haskell</toc>
<toc>haskell_bugs_ghc</toc>
<toc>java_bugs_gcc</toc>
<toc>java_bugs_sun</toc>
<toc>pascal_bugs_fp</toc>
<toc>php</toc>
<toc>php_bugs</toc>
<toc>perl</toc>
<toc>perl_bugs</toc>
<toc>python</toc>
<toc>python_bugs</toc>
<toc>ruby</toc>
<toc>ruby_bugs</toc>
<toc>sdl</toc>
<toc>w3c-svg</toc>
<toc>sw</toc>
<toc>w3c-uaag10</toc>
<toc>wxwindows_bugs</toc>
</ignoretocs>
<ignoreqt_xml>
<toc>qmake User Guide</toc>
</ignoreqt_xml>
</kdevdoctreeview>
<kdevdebugger>
<general>
<dbgshell>libtool</dbgshell>
</general>
</kdevdebugger>
<kdevfilecreate>
<filetypes/>
<useglobaltypes>
<type ext="ui" />
<type ext="cpp" />
<type ext="h" />
</useglobaltypes>
</kdevfilecreate>
<dist>
<custom>false</custom>
<bzip>false</bzip>
<archname/>
<appname/>
<version>0.10</version>
<release/>
<vendor/>
<licence/>
<summary/>
<group/>
<packager/>
<description/>
<changelog/>
<devpackage>false</devpackage>
<docspackage>false</docspackage>
<appicon>false</appicon>
<arch>0</arch>
<genHTML>false</genHTML>
<useRPM>false</useRPM>
<ftpkde>false</ftpkde>
<appskde>false</appskde>
<url/>
</dist>
<kdevcppsupport>
<references/>
<codecompletion>
<includeGlobalFunctions>true</includeGlobalFunctions>
<includeTypes>true</includeTypes>
<includeEnums>true</includeEnums>
<includeTypedefs>false</includeTypedefs>
<automaticCodeCompletion>true</automaticCodeCompletion>
<automaticArgumentsHint>true</automaticArgumentsHint>
<automaticHeaderCompletion>true</automaticHeaderCompletion>
<codeCompletionDelay>250</codeCompletionDelay>
<argumentsHintDelay>400</argumentsHintDelay>
<headerCompletionDelay>250</headerCompletionDelay>
</codecompletion>
</kdevcppsupport>
</kdevelop>

Binary file not shown.

@ -1,39 +0,0 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
<DocsAndViews NumberOfDocuments="5" >
<Doc0 NumberOfViews="1" URL="file:/home/juanjux/sync/kalternatives/src/kalternatives.cpp" >
<View0 line="297" Type="Source" />
</Doc0>
<Doc1 NumberOfViews="1" URL="file:/home/juanjux/sync/kalternatives/src/kalternatives.h" >
<View0 line="35" Type="Source" />
</Doc1>
<Doc2 NumberOfViews="1" URL="file:/home/juanjux/sync/kalternatives/src/altparser.cpp" >
<View0 line="111" Type="Source" />
</Doc2>
<Doc3 NumberOfViews="1" URL="file:/home/juanjux/sync/kalternatives/src/altparser.h" >
<View0 line="72" Type="Source" />
</Doc3>
<Doc4 NumberOfViews="1" URL="file:/home/juanjux/sync/kalternatives/src/main.cpp" >
<View0 line="74" Type="Source" />
</Doc4>
</DocsAndViews>
<pluginList>
<kdevbookmarks>
<bookmarks>
<bookmark url="/home/juanjux/sync/kalternatives/src/kalternatives.cpp" >
<mark line="276" />
</bookmark>
<bookmark url="/home/juanjux/sync/work/kalternatives/kalternatives" >
<mark line="548" />
</bookmark>
</bookmarks>
</kdevbookmarks>
<kdevsubversion>
<subversion recurseresolve="1" recurserelocate="1" recursemerge="1" recursecommit="1" base="" recursepropget="1" recurseswitch="1" recurseupdate="1" recursepropset="1" recursediff="1" recurserevert="1" forcemove="1" recursecheckout="1" forceremove="1" recurseadd="1" recurseproplist="1" forcemerge="1" />
</kdevsubversion>
<kdevdebugger>
<breakpointList/>
</kdevdebugger>
</pluginList>
</KDevPrjSession>

@ -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

@ -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;

@ -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

@ -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 <kstdguiitem.h>
#include <kurlrequester.h>
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

@ -26,18 +26,18 @@
#include <ktextedit.h>
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);}

@ -27,7 +27,7 @@ class AddAlternatives;
class AddSlaves : public AddSlavesUi
{
Q_OBJECT
TQ_OBJECT
AddAlternatives *m_addAlternatives;

@ -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

@ -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);
}
}

@ -31,7 +31,7 @@ class AltController;
class AltItemElement : public TQObject, public TQCheckListItem
{
Q_OBJECT
TQ_OBJECT
Alternative *m_alt;
TDEListView *m_parent;

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -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;

@ -1,16 +0,0 @@
Begin3
Title: kalternatives -- Some description
Version: 0.12
Entered-date:
Description:
Keywords: KDE Qt
Author: Juanjo <juanjux@yahoo.es>
Maintained-by: Juanjo <juanjux@yahoo.es>
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

@ -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 <kstdguiitem.h>
#include <tdeversion.h>
typedef KGenericFactory<Kalternatives, TQWidget> KalternativesFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_kalternatives, KalternativesFactory("kcmkalternatives"))
#include "config.h"
typedef KGenericFactory<TDEAlternatives, TQWidget> 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<Item> *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<AltItemElement *>(option)))
@ -286,7 +288,7 @@ void Kalternatives::slotOptionClicked(TQListViewItem *option)
}
}
void Kalternatives::slotAddClicked()
void TDEAlternatives::slotAddClicked()
{
TreeItemElement *treeItem;
if((treeItem = dynamic_cast<TreeItemElement *>(m_altList->selectedItem())))
@ -302,7 +304,7 @@ void Kalternatives::slotAddClicked()
}
}
}
void Kalternatives::slotDeleteClicked()
void TDEAlternatives::slotDeleteClicked()
{
TreeItemElement *treeItem;
if((treeItem = dynamic_cast<TreeItemElement *>(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("<h1>Kalternatives</h1>\n"
"A Mandrake/Debian alternatives-system manager.");
return i18n("<h1>TDEAlternatives</h1>\n",
"RPM/DPKG alternatives manager for TDE");
}
#include "kalternatives.moc"
#include "tdealternatives.moc"

@ -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 <config.h>
@ -37,13 +37,11 @@
#include <tdecmodule.h>
#include <tdeaboutdata.h>
#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_
Loading…
Cancel
Save