summaryrefslogtreecommitdiffstats
path: root/kmrml/kmrml/kcontrol
diff options
context:
space:
mode:
Diffstat (limited to 'kmrml/kmrml/kcontrol')
-rw-r--r--kmrml/kmrml/kcontrol/CMakeLists.txt38
-rw-r--r--kmrml/kmrml/kcontrol/Makefile.am25
-rw-r--r--kmrml/kmrml/kcontrol/indexcleaner.cpp96
-rw-r--r--kmrml/kmrml/kcontrol/indexcleaner.h54
-rw-r--r--kmrml/kmrml/kcontrol/indexer.cpp190
-rw-r--r--kmrml/kmrml/kcontrol/indexer.h69
-rw-r--r--kmrml/kmrml/kcontrol/indextest.cpp43
-rw-r--r--kmrml/kmrml/kcontrol/indextest.h27
-rw-r--r--kmrml/kmrml/kcontrol/kcmkmrml.cpp146
-rw-r--r--kmrml/kmrml/kcontrol/kcmkmrml.desktop176
-rw-r--r--kmrml/kmrml/kcontrol/kcmkmrml.h53
-rw-r--r--kmrml/kmrml/kcontrol/mainpage.cpp501
-rw-r--r--kmrml/kmrml/kcontrol/mainpage.h110
-rw-r--r--kmrml/kmrml/kcontrol/serverconfigwidget.ui272
14 files changed, 0 insertions, 1800 deletions
diff --git a/kmrml/kmrml/kcontrol/CMakeLists.txt b/kmrml/kmrml/kcontrol/CMakeLists.txt
deleted file mode 100644
index 6ff6fbb6..00000000
--- a/kmrml/kmrml/kcontrol/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-#################################################
-#
-# (C) 2010-2011 Calvin Morrison
-# mutantturkey@gmail.com
-#
-# Improvements and feedback are welcome
-#
-# This file is released under GPL >= 2
-#
-#################################################
-
-include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/../lib
- ${CMAKE_BINARY_DIR}
- ${TDE_INCLUDE_DIR}
- ${TQT_INCLUDE_DIRS}
-)
-
-link_directories(
- ${TQT_LIBRARY_DIRS}
-)
-
-#### other data #################################
-
-INSTALL( FILES kcmkmrml.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
-
-
-#### kcm_kmrml (module) ###########################
-
-tde_add_kpart( kcm_kmrml AUTOMOC
- SOURCES
- kcmkmrml.cpp mainpage.cpp indexer.cpp
- serverconfigwidget.ui indexcleaner.cpp
- LINK
- kmrmlstuff-static tdeparts-shared tdeio-shared
- DESTINATION ${PLUGIN_INSTALL_DIR}
-)
diff --git a/kmrml/kmrml/kcontrol/Makefile.am b/kmrml/kmrml/kcontrol/Makefile.am
deleted file mode 100644
index 60637449..00000000
--- a/kmrml/kmrml/kcontrol/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-LIB_KMRMLSTUFF = $(top_builddir)/kmrml/kmrml/lib/libkmrmlstuff.la
-
-kde_module_LTLIBRARIES = kcm_kmrml.la
-
-kcm_kmrml_la_SOURCES = kcmkmrml.cpp mainpage.cpp indexer.cpp serverconfigwidget.ui indexcleaner.cpp
-kcm_kmrml_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kcm_kmrml_la_LIBADD = $(LIB_KMRMLSTUFF) $(LIB_TDEIO)
-INCLUDES= -I$(top_srcdir)/kmrml/kmrml/lib $(all_includes)
-
-kcm_kmrml_la_METASOURCES = AUTO
-
-noinst_HEADERS = kcmkmrml.h mainpage.h serverconfigwidget.h indexer.h indexcleaner.h
-
-xdg_apps_DATA = kcmkmrml.desktop
-
-#check_PROGRAMS = indextest
-#indextest_SOURCES = indextest.cpp indexer.cpp
-#indextest_LDADD = $(LIB_KMRMLSTUFF) $(LIB_TDECORE)
-#indextest_LDFLAGS = $(all_libraries)
-
-
-
-#pics_DATA = play.png
-#picsdir = $(kde_datadir)/kcontrol/pics
-
diff --git a/kmrml/kmrml/kcontrol/indexcleaner.cpp b/kmrml/kmrml/kcontrol/indexcleaner.cpp
deleted file mode 100644
index be2fbc29..00000000
--- a/kmrml/kmrml/kcontrol/indexcleaner.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-#include <kdebug.h>
-#include <kprocess.h>
-
-#include <kmrml_config.h>
-#include "indexcleaner.h"
-
-#include <tdeversion.h>
-#if TDE_VERSION < 306
- #define QUOTE( x ) x
-#else
- #define QUOTE( x ) TDEProcess::quote( x )
-#endif
-
-using namespace KMrmlConfig;
-
-IndexCleaner::IndexCleaner( const TQStringList& dirs,
- const KMrml::Config *config,
- TQObject *parent, const char *name )
- : TQObject( parent, name ),
- m_dirs( dirs ),
- m_config( config ),
- m_process( 0L )
-{
- m_stepSize = 100 / dirs.count();
-}
-
-IndexCleaner::~IndexCleaner()
-{
- if ( m_process )
- {
- m_process->kill();
- delete m_process;
- m_process = 0L;
- }
-}
-
-void IndexCleaner::start()
-{
- startNext();
-}
-
-void IndexCleaner::slotExited( TDEProcess *proc )
-{
- emit advance( m_stepSize );
-
- if ( !proc->normalExit() )
- kdWarning() << "Error removing old indexed directory" << endl;
-
- m_process = 0L;
-
- startNext();
-}
-
-void IndexCleaner::startNext()
-{
- if ( m_dirs.isEmpty() )
- {
- emit advance( 100 );
- emit finished();
- return;
- }
-
-#if TDE_VERSION < 306
- m_process = new KShellProcess();
-#else
- m_process = new TDEProcess();
- m_process->setUseShell( true );
-#endif
- connect( m_process, TQT_SIGNAL( processExited( TDEProcess * )),
- TQT_SLOT( slotExited( TDEProcess * ) ));
-
- TQString cmd = m_config->removeCollectionCommandLine();
-
- TQString dir = m_dirs.first();
- m_dirs.pop_front();
-
- int index = cmd.find( "%d" );
- if ( index != -1 )
- cmd.replace( index, 2, QUOTE( dir ) );
- else // no %d? What else can we do?
- cmd.append( TQString::fromLatin1(" ") + QUOTE( dir ) );
-
- *m_process << cmd;
-
- if ( !m_process->start() )
- {
- kdWarning() << "Error starting: " << cmd << endl;
-
- delete m_process;
- m_process = 0L;
-
- startNext();
- }
-}
-
-#include "indexcleaner.moc"
diff --git a/kmrml/kmrml/kcontrol/indexcleaner.h b/kmrml/kmrml/kcontrol/indexcleaner.h
deleted file mode 100644
index 05396870..00000000
--- a/kmrml/kmrml/kcontrol/indexcleaner.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-** $Id$
-**
-** Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
-**
-****************************************************************************/
-
-#ifndef INDEXCLEANER_H
-#define INDEXCLEANER_H
-
-#include <tqobject.h>
-#include <tqstringlist.h>
-
-class TDEProcess;
-
-namespace KMrml
-{
- class Config;
-}
-
-namespace KMrmlConfig
-{
- class IndexCleaner : public TQObject
- {
- Q_OBJECT
-
-
- public:
- IndexCleaner( const TQStringList& dirs, const KMrml::Config *config,
- TQObject *parent = 0, const char *name = 0 );
- ~IndexCleaner();
-
- void start();
-
- signals:
- void advance( int value );
- void finished();
-
- private slots:
- void slotExited( TDEProcess * );
-
- private:
- int m_stepSize;
- void startNext();
-
- TQStringList m_dirs;
- const KMrml::Config *m_config;
- TDEProcess *m_process;
- };
-
-}
-
-
-#endif // INDEXCLEANER_H
diff --git a/kmrml/kmrml/kcontrol/indexer.cpp b/kmrml/kmrml/kcontrol/indexer.cpp
deleted file mode 100644
index 2392cfd5..00000000
--- a/kmrml/kmrml/kcontrol/indexer.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation, version 2.
-
- 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 <tqfile.h>
-#include <tqregexp.h>
-
-#include <kdebug.h>
-#include <tdelocale.h>
-#include <tdeglobal.h>
-#include <kprocio.h>
-
-#include "indexer.h"
-
-#include <tdeversion.h>
-#if TDE_VERSION < 306
- #define QUOTE( x ) x
-#else
- #define QUOTE( x ) TDEProcess::quote( x )
-#endif
-
-using namespace KMrmlConfig;
-
-Indexer::Indexer( const KMrml::Config* config,
- TQObject *parent, const char *name )
- : TQObject( parent, name ),
- m_config( config ),
- m_dirCount( 0 )
-{
- m_process = new KProcIO();
-#if TDE_VERSION >= 306
- m_process->setUseShell( true );
-#endif
- m_process->setEnvironment( "LC_ALL", "C" );
- connect( m_process, TQT_SIGNAL( processExited( TDEProcess * )),
- TQT_SLOT( processFinished( TDEProcess * )));
- connect( m_process, TQT_SIGNAL( readReady( KProcIO * )),
- TQT_SLOT( slotCanRead( KProcIO * )) );
-}
-
-Indexer::~Indexer()
-{
- delete m_process;
-}
-
-void Indexer::startIndexing( const TQStringList& dirs )
-{
- if ( m_process->isRunning() )
- return;
-
- m_dirs = dirs;
- m_dirCount = dirs.count();
- processNext();
-}
-
-void Indexer::processFinished( TDEProcess *proc )
-{
- // still more directories to index?
- if ( !m_dirs.isEmpty() )
- processNext();
- else
- {
- if ( proc->normalExit() )
- emit finished( proc->exitStatus() );
- else
- emit finished( -1000 );
- }
-}
-
-
-void Indexer::processNext()
-{
- m_currentDir = m_dirs.first();
- m_dirs.pop_front();
- while ( m_currentDir.endsWith( "/" ) )
- m_currentDir.remove( m_currentDir.length() -1, 1 );
-
- m_process->resetAll();
-
- TQString cmd = m_config->addCollectionCommandLine().simplifyWhiteSpace().stripWhiteSpace();
-
- // in the commandline, replace %d with the directory to process and
- // %t with the thumbnail dir
- int index = cmd.find( "%d" ); // ### TQFile::encodeName()?
- if ( index != -1 )
- cmd.replace( index, 2, QUOTE( m_currentDir ) );
- index = cmd.find( "%t" );
- if ( index != -1 )
- cmd.replace( index, 2, QUOTE(m_currentDir + "_thumbnails") );
-
-// tqDebug("****** command: %s", cmd.latin1());
-#if TDE_VERSION >= 306
- *m_process << cmd;
-#else
- TQStringList params = TQStringList::split( ' ', cmd );
- TQStringList::Iterator it = params.begin();
- for ( ; it != params.end(); ++it )
- *m_process << *it;
-#endif
-
- emit progress( 0, i18n("<qt>Next Folder: <br><b>%1</b>").arg( m_currentDir ));
- m_process->start();
-}
-
-void Indexer::slotCanRead( KProcIO *proc )
-{
- static const TQString& sprogress = TDEGlobal::staticQString("PROGRESS: ");
- static const TQString& r1 = /* PROGRESS: 1 of 6 done (15%) */
- TDEGlobal::staticQString( "(\\d+) of (\\d+) done \\((\\d+)%\\)" );
-
- TQString line;
- int bytes = -1;
- while ( (bytes = proc->readln( line )) != -1 )
- {
- // examine the output.
- // We're looking for lines like:
- // PROGRESS: 1 of 6 done (15%)
- // PROGRESS: 99%
- // PROGRESS: 100%
-
- if ( !line.startsWith( sprogress ) ) // uninteresting debug output
- continue;
- else // parse output
- {
- // cut off "PROGRESS: "
- line = line.mid( sprogress.length() );
- line = line.simplifyWhiteSpace().stripWhiteSpace();
-// tqDebug("*** START LINE ***");
-// tqDebug("%s", line.latin1());
-// tqDebug("*** END LINE ***");
-
- // case 1: image processing, below 99%
- if ( line.at( line.length() -1 ) == ')' )
- {
- TQRegExp regxp( r1 );
- int pos = regxp.search( line );
- if ( pos > -1 )
- {
- TQString currentFile = regxp.cap( 1 );
- TQString numFiles = regxp.cap( 2 );
- TQString percent = regxp.cap( 3 );
-
-// tqDebug( "current: %s, number: %s, percent: %s", currentFile.latin1(), numFiles.latin1(), percent.latin1());
- bool ok = false;
- int perc = percent.toInt( &ok );
- if ( ok )
- {
- uint dirsLeft = m_dirs.count();
- TQString message = i18n( "<qt>Processing folder %1 of %2: <br><b>%3</b><br>File %4 of %5.</qt>").arg( m_dirCount - dirsLeft ).arg( m_dirCount).arg( m_currentDir ).arg( currentFile ).arg( numFiles );
- emit progress( perc, message );
- }
- }
- }
-
-
- // case 2: file writing, 99% or done, 100%
- else
- {
- TQString percent = line.left( line.length() - 1 );
-
- bool ok = false;
- int number = percent.toInt( &ok );
- if ( ok )
- {
- TQString message = (number == 100) ?
- i18n("Finished.") : i18n("Writing data...");
- emit progress( number, message );
- }
- else
- kdDebug() << "Error while parsing gift-add-collection.pl output" << endl;
- }
- }
- }
-}
-
-#include "indexer.moc"
diff --git a/kmrml/kmrml/kcontrol/indexer.h b/kmrml/kmrml/kcontrol/indexer.h
deleted file mode 100644
index 72755081..00000000
--- a/kmrml/kmrml/kcontrol/indexer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation, version 2.
-
- 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 INDEXER_H
-#define INDEXER_H
-
-#include <tqobject.h>
-
-#include <kmrml_config.h>
-
-class TDEProcess;
-class KProcIO;
-
-namespace KMrmlConfig
-{
- class Indexer : public TQObject
- {
- Q_OBJECT
-
-
- public:
- Indexer( const KMrml::Config *config,
- TQObject *parent = 0L, const char *name = 0 );
- ~Indexer();
-
- void startIndexing( const TQStringList& dirs );
- void stop();
-
- signals:
- void progress( int percent, const TQString& text );
- void finished( int returnCode );
-
-
- private slots:
- void slotCanRead( KProcIO * );
- void processFinished( TDEProcess * );
-
- private:
- void processNext();
-
- KProcIO *m_process;
- const KMrml::Config *m_config;
-
- uint m_dirCount;
- TQStringList m_dirs;
- TQString m_currentDir;
-
- };
-
-
-}
-
-
-#endif // INDEXER_H
diff --git a/kmrml/kmrml/kcontrol/indextest.cpp b/kmrml/kmrml/kcontrol/indextest.cpp
deleted file mode 100644
index cc816c0b..00000000
--- a/kmrml/kmrml/kcontrol/indextest.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "indexer.h"
-#include <kmrml_config.h>
-#include "indextest.moc"
-
-#include <tdeapplication.h>
-#include <tdeconfig.h>
-#include <tdeglobal.h>
-
-using namespace KMrmlConfig;
-
-IndexTest::IndexTest()
-{
- KMrml::Config *config = new KMrml::Config( TDEGlobal::config() );
- Indexer *indexer = new Indexer( *config, this );
- connect( indexer, TQT_SIGNAL( finished( bool )), TQT_SLOT( slotFinished( bool )));
- connect( indexer, TQT_SIGNAL( progress( int, const TQString& )),
- TQT_SLOT( slotProgress( int, const TQString& )));
-
- indexer->startIndexing( "/home/gis/testcoll" );
-}
-
-IndexTest::~IndexTest()
-{
-
-}
-
-void IndexTest::slotFinished( bool success )
-{
- tqDebug("##### FINISHED: %i", success );
-}
-
-void IndexTest::slotProgress( int percent, const TQString& message )
-{
- tqDebug("--- progress: %i: %s", percent, message.latin1());
-}
-
-int main( int argc, char **argv )
-{
- TDEApplication app( argc, argv, "indextest" );
- IndexTest *test = new IndexTest();
-
- return app.exec();
-}
diff --git a/kmrml/kmrml/kcontrol/indextest.h b/kmrml/kmrml/kcontrol/indextest.h
deleted file mode 100644
index 1071cdbd..00000000
--- a/kmrml/kmrml/kcontrol/indextest.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/****************************************************************************
-** $Id$
-**
-** Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
-**
-****************************************************************************/
-
-#ifndef INDEXTEST_H
-#define INDEXTEST_H
-
-class IndexTest : public TQObject
-{
- Q_OBJECT
-
-
-public:
- IndexTest();
- ~IndexTest();
-
-private slots:
- void slotFinished( bool success );
- void slotProgress( int percent, const TQString& message );
-
-};
-
-
-#endif // INDEXTEST_H
diff --git a/kmrml/kmrml/kcontrol/kcmkmrml.cpp b/kmrml/kmrml/kcontrol/kcmkmrml.cpp
deleted file mode 100644
index e055a8bf..00000000
--- a/kmrml/kmrml/kcontrol/kcmkmrml.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation, version 2.
-
- 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 <tqlabel.h>
-#include <tqlayout.h>
-
-#include <tdeaboutdata.h>
-#include <tdeapplication.h>
-#include <kdebug.h>
-#include <kdialog.h>
-#include <tdeglobal.h>
-#include <tdelocale.h>
-#include <tdemessagebox.h>
-#include <kgenericfactory.h>
-#include <kstandarddirs.h>
-#include <kurllabel.h>
-
-#include "kcmkmrml.h"
-#include <dcopclient.h>
-
-#include "mainpage.h"
-#include <version.h>
-
-using namespace KMrmlConfig;
-
-static const int COL_FILENAME = 1;
-
-typedef KGenericFactory<KCMKMrml, TQWidget> MrmlFactory;
-K_EXPORT_COMPONENT_FACTORY( kcm_kmrml, MrmlFactory("kmrml") )
-
-KCMKMrml::KCMKMrml(TQWidget *parent, const char *name, const TQStringList & ):
- TDECModule(MrmlFactory::instance(), parent, name)
-{
- TDEAboutData* ab = new TDEAboutData(
- "kcmkmrml",
- I18N_NOOP("KCMKMrml"),
- KMRML_VERSION,
- I18N_NOOP("Advanced Search Control Module"),
- TDEAboutData::License_GPL,
- I18N_NOOP( "Copyright 2002, Carsten Pfeiffer" ),
- 0,
- "http://devel-home.kde.org/~pfeiffer/kmrml/" );
- ab->addAuthor( "Carsten Pfeiffer", 0, "pfeiffer@kde.org" );
- setAboutData( ab );
-
- TQVBoxLayout *layout = new TQVBoxLayout( this );
- layout->setSpacing( KDialog::spacingHint() );
- m_mainPage = new MainPage( this, "main page" );
-
- layout->addWidget( m_mainPage );
-
- connect( m_mainPage, TQT_SIGNAL( changed( bool ) ), TQT_SIGNAL( changed( bool )));
-
- checkGiftInstallation();
-}
-
-KCMKMrml::~KCMKMrml()
-{
-}
-
-void KCMKMrml::checkGiftInstallation()
-{
- TQString giftExe = TDEGlobal::dirs()->findExe( "gift" );
- TQString giftAddCollectionExe = TDEGlobal::dirs()->findExe( "gift-add-collection.pl" );
-
- if ( giftExe.isEmpty() || giftAddCollectionExe.isEmpty() )
- {
- TQString errorMessage =
- i18n("Cannot find executables \"gift\" and/or \"gift-add-collection.pl\" in the PATH.\n"
- "Please install the \"GNU Image Finding Tool\".");
- KMessageBox::error( this, errorMessage );
- m_mainPage->hide();
- TQLabel *errorLabel = new TQLabel( errorMessage, this );
- errorLabel->setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Fixed ) );
- KURLLabel *urlLabel = new KURLLabel( "http://www.gnu.org/software/gift", TQString(), this );
- urlLabel->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) );
- connect( urlLabel, TQT_SIGNAL( leftClickedURL( const TQString& )), kapp, TQT_SLOT( invokeBrowser( const TQString& )) );
- TQLayout *l = layout();
- l->addItem( new TQSpacerItem( 0, 10, TQSizePolicy::Minimum, TQSizePolicy::Expanding ) );
- l->add( errorLabel );
- l->add( urlLabel );
- l->addItem( new TQSpacerItem( 0, 10, TQSizePolicy::Minimum, TQSizePolicy::Expanding ) );
- errorLabel->show();
- }
- else
- load();
-}
-
-void KCMKMrml::defaults()
-{
- if (KMessageBox::warningContinueCancel(this,
- i18n("Do you really want the configuration to be reset "
- "to the defaults?"), i18n("Reset Configuration"), KStdGuiItem::cont())
- != KMessageBox::Continue)
- return;
-
- m_mainPage->resetDefaults();
-
- emit changed( true );
-}
-
-void KCMKMrml::load()
-{
- m_mainPage->load();
-
- emit changed( true );
-}
-
-void KCMKMrml::save()
-{
- m_mainPage->save();
-
- emit changed( false );
-}
-
-TQString KCMKMrml::quickHelp() const
-{
- return i18n("<h1>Image Index</h1>"
- "TDE can make use of the GNU Image Finding Tool (GIFT) to "
- "perform queries based not just on filenames, but on "
- "file content."
- "<p>For example, you can search for an image by giving an example "
- "image that looks similar to the one you are looking for.</p>"
- "<p>For this to work, your image directories need to be "
- "indexed by, for example, the GIFT server.</p>"
- "<p>Here you can configure the servers (you can also query "
- "remote servers) and the directories to index.</p>"
- );
-}
-
-#include "kcmkmrml.moc"
diff --git a/kmrml/kmrml/kcontrol/kcmkmrml.desktop b/kmrml/kmrml/kcontrol/kcmkmrml.desktop
deleted file mode 100644
index f4fe6536..00000000
--- a/kmrml/kmrml/kcontrol/kcmkmrml.desktop
+++ /dev/null
@@ -1,176 +0,0 @@
-[Desktop Entry]
-Exec=tdecmshell kcmkmrml
-Icon=folder_image
-Type=Application
-
-X-TDE-ModuleType=Library
-X-TDE-Library=kmrml
-
-Name=Image Index
-Name[ar]=فهرس الصور
-Name[bg]=Графичен индекс
-Name[br]=Meneger ar skeudenn
-Name[bs]=Indeks slika
-Name[ca]=Índex d'imatge
-Name[cs]=Rejstřík obrázků
-Name[cy]=Mynegai Delweddau
-Name[da]=Billedindeks
-Name[de]=Bildindex
-Name[el]=Ευρετήριο εικόνων
-Name[eo]=Bildindekso
-Name[es]=Índice de imágenes
-Name[et]=Pildiindeks
-Name[eu]=Irudiaren indizea
-Name[fa]=نمایۀ تصویر
-Name[fi]=Kuvahakemisto
-Name[fr]=Indexation des images
-Name[gl]=Índice imaxe
-Name[he]=אינדקס תמונות
-Name[hi]=छवि सूची
-Name[hu]=Képkereső
-Name[is]=Myndayfirlit
-Name[it]=Indice di immagini
-Name[ja]=画像インデックス
-Name[kk]=Кескіндер индексі
-Name[km]=លិបិក្រម​រូបភាព
-Name[lt]=Paveikslėlių rodyklė
-Name[ms]=Indeks Imej
-Name[nb]=Bildeindeks
-Name[nds]=Bildindex
-Name[ne]=छवि अनुक्रमणिका
-Name[nl]=Afbeeldingenindex
-Name[nn]=Biletindeks
-Name[nso]=Palo ya Ponagalo
-Name[pl]=Spis obrazków
-Name[pt]=Índice de Imagens
-Name[pt_BR]=Índice de Imagens
-Name[ro]=Index imagini
-Name[ru]=Индексирование изображений
-Name[se]=Govvaindeaksa
-Name[sk]=Katalóg obrázkov
-Name[sl]=Seznam slik
-Name[sr]=Индекс слика
-Name[sr@Latn]=Indeks slika
-Name[sv]=Bildindex
-Name[ta]=பிம்ப அட்டவணை
-Name[tg]=Индексатсия кардани тасвирот
-Name[th]=ดัชนีรูปภาพ
-Name[tr]=Resim İndeksi
-Name[uk]=Індекс зображень
-Name[uz]=Rasm indeksi
-Name[uz@cyrillic]=Расм индекси
-Name[ven]=Index ya tshifanyiso
-Name[wa]=Indecse des imådjes
-Name[xh]=Isalathisi Somfanekiso
-Name[zh_CN]=图像索引
-Name[zh_HK]=圖像索引
-Name[zh_TW]=影像索引
-Name[zu]=Isiqalo Sesithombe
-
-Comment=Configuration for using the GNU Image Finding Tool
-Comment[ar]=اعدادات لاستخدام أداة GNU للبحث عن الصور
-Comment[bg]=Настройване на програмата за индексиране и търсене на изображения
-Comment[bs]=Podešavanje za upotrebu GNU Alata za pronalaženje slika
-Comment[ca]=Configuració per a l'ús de l'eina de cerca d'imatges GNU
-Comment[cs]=Konfigurace používání nástroje GNU Image Finding Tool
-Comment[cy]=Ffurfweddiad am ddefnyddio'r Erfyn Canfod Delweddau GNU
-Comment[da]=Indstilling for brug af GNU Image Finding Tool
-Comment[de]=Einrichtung für die Benutzung des GNU Bildersuchwerkzeugs (GNU Image Finding Tool)
-Comment[el]=Ρύθμιση για τη χρήση του εργαλείου αναζήτησης εικόνων GIFT
-Comment[es]=Configuración para utilizar la herramienta de búsqueda de imágenes de GNU
-Comment[et]=Seadistused GNU pildileidmisrakenduse kasutamiseks
-Comment[eu]=GNU irudi aurkitzailea erabiltzeko konfigurazioa
-Comment[fa]=پیکربندی برای استفاده از ابزار یافتن تصویر GNU
-Comment[fi]=Asetukset GNU Image Finding Tool -ohjelman käyttöä varten
-Comment[fr]=Configuration pour l'utilisation du GNU Image Finding Tool
-Comment[gl]=Configuración para empregar a «GNU Image Finding Tool»
-Comment[he]=שינוי הגדרות כלי חיפוש התמונות של GNU
-Comment[hi]=ग्नू छवि खोज औज़ार को उपयोग करने के लिए कॉन्फ़िगरेशन
-Comment[hu]=A GIFT képkereső szolgáltatás beállításai
-Comment[is]=Stillingar til þess að nota GNU myndleitartólið
-Comment[it]=Configurazione della ricerca delle immagini
-Comment[ja]=GIFT (GNU Image Finding Tool) を使用するための設定
-Comment[kk]=GNU Image Finding Tool кескінді табу құралын пайдалану баптаулары
-Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​ដើម្បី​ប្រើ​ឧបករណ៍​ស្វែងរក​រូបភាព​របស់ GNU
-Comment[lt]=GNU paveikslėlių paieškos įrankio konfigūracija
-Comment[ms]=Konfigurasi untuk mengguna Alat Carian Imej GNU
-Comment[nb]=Tilpass GNU bildesøkingsverktøy
-Comment[nds]=Inrichten för dat GNU-Bildsöökwarktüüch
-Comment[ne]=GNU छवि फेला पार्ने उपकरण प्रयोगका लागि कन्फिगरेसन
-Comment[nl]=Configuratie voor het gebruik van de GNU Image Finding Tool
-Comment[nn]=Oppsett av GNU Image Finding Tool
-Comment[pl]=Konfiguracja Gifta (narzędzia do szukania obrazków GNU)
-Comment[pt]=Configuração da Ferramenta de Procura de Imagens da GNU
-Comment[pt_BR]=Configuração para o uso da Ferramenta de Procura de Imagens GNU
-Comment[ro]=Configurare pentru GNU Image Finding Tool
-Comment[ru]=Настройка использования программы поиска изображений GNU Image Finding Tool
-Comment[se]=Heivet GNU Image Finding Tool
-Comment[sk]=Konfigurácia pre GNU Image Finding Tool
-Comment[sl]=Nastavitve za uporabo orodja GNU za iskanje slik
-Comment[sr]=Подешавање коришћења GNU-овог алата за тражење слика
-Comment[sr@Latn]=Podešavanje korišćenja GNU-ovog alata za traženje slika
-Comment[sv]=Inställning för att använda GNU:s bildsökverktyg
-Comment[ta]=GNU பிம்ப தேடுதல் கருவியை பயன்படுத்துவதற்கான அமைப்பு
-Comment[tg]=Танзимоти истифодабарии барномаиҷустуҷӯи тасвироти GNU Image Finding Tool
-Comment[tr]=GNU Resim Bulma Aracı yapılandırması
-Comment[uk]=Налаштування засобу пошуку зображень GNU
-Comment[ven]=Nzudzanyo yau shumisa tshishumiswa tshau toda tshifanyiso tsha GNU
-Comment[wa]=Apontiaedje po-z eployî l' usteye di cweraedje d' imådjes di GNU
-Comment[xh]=Uqwalaselo lokusebenzisa Isixhobo Sokufumana Umfanekiso we GNU
-Comment[zh_CN]=使用 GNU 图像查找工具的配置
-Comment[zh_HK]=GNU 圖像搜尋工具的設定
-Comment[zh_TW]= GNU 影像搜尋工具組態
-Comment[zu]=Inhlanganiselo yokusebenzisa Ithuluzi Lokuthola Isithombe se-GNU
-
-Keywords=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;
-Keywords[ar]=صور;بحث;استعلام;Find;Gift;kmrml;mrml;CBIR;
-Keywords[bg]=изображения; търсене; заявка; картинка; картинки; снимки; Images; Search; Query; Find; Gift; kmrml; mrml; CBIR;
-Keywords[bs]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;slike;pretraga;upit;nađi;
-Keywords[ca]=Imatges;Cerca;Consulta;Busca;Gift;kmrml;mrml;CBIR;
-Keywords[cs]=Obrázky;Hledat;Dotaz;Najít;Gift;kmrml;mrml;CBIR;
-Keywords[cy]=Delweddau;Chwilio;Canfod;Gift;kmrml;mrml;CBIR;
-Keywords[da]=Billeder;Søgning;Forespørgsel;Find;Gave;kmrml;mrml;CBIR;
-Keywords[de]=Bilder;Suche;Anfrage;finden;Geschenk;kmrml;mrml;CBIR;
-Keywords[el]=Εικόνες;Αναζήτηση;Ερώτηση;Αναζήτηση;Gift;kmrml;mrml;CBIR;
-Keywords[es]=Imágenes;Búsqueda;Consulta;Buscar;Gift;kmrml;mrml;CBIR;
-Keywords[et]=pildid;otsing;päring;leia;Gift;kmrml;mrml;CBIR;
-Keywords[eu]=Irudiak;Bilaketa;Bilatu;Galdetu;Gift;kmrml;mrml;CBIR;
-Keywords[fa]=تصاویر، جستجو، پرس‌و‌جو، یافتن، Gift،kmrml،mrml،CBIR;
-Keywords[fi]=Kuvat;Haku;Etsi;Lahja;kmrml;mrml;CBIR;
-Keywords[fr]=Images;Recherche;Requête;Chercher;Gift;kmrml;mrml;CBIR;
-Keywords[gl]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR; imaxes; procura;
-Keywords[he]=תמונות;חיפוש;שאילתה;Gift;kmrml;mrml;CBIR; Images;Search;Query;Find;
-Keywords[hi]=छवि; खोज;ढूंढ;तलाश;उपहार;केएमआरएमएल;एमआरएमएल;सीबीआईआर;
-Keywords[hu]=képek;keresés;lekérdezés;találat;Gift;kmrml;mrml;CBIR;
-Keywords[it]=immagini;ricerca;trovare;Gift;kmrml;mrml;CBIR;
-Keywords[ja]=画像;検索;クエリ;検索;Gift;kmrml;mrml;CBIR;
-Keywords[km]=រូបភាព;ស្វែងរក;សួរ;រក;Gift;kmrml;mrml;CBIR;
-Keywords[lt]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR; paveikslėliai;paieška;paklausimas;
-Keywords[nb]=Bilder;Søk;Spørringer;Finn;Gift;kmrml;mrml;CBIR;
-Keywords[nds]=Biller;Söök;Anfraag;söken;Gaav;kmrml;mrml;CBIR;
-Keywords[nl]=illustraties;figuren;figuur;afbeeldingen;plaatjes;zoeken;find;gift;kmrml;mrml;CBIR;images;
-Keywords[nn]=bilete;søk;spørjing;finn;gåve;kmrml;mrml;CBIR;
-Keywords[nso]=Diponagalo;Nyaka;Kgokgonego;Hwetsa;Mpho;kmrml;mrml;CBIR;
-Keywords[pl]=Obrazki;Szukanie;Zapytanie;Szukaj;Gift;kmrml;mrml;CBIR;
-Keywords[pt]=Imagens;Procurar;Pesquisar;Encontrar;Prenda;kmrml;mrml;CBIR;
-Keywords[pt_BR]=Imagens;Busca;Consulta;Procurar;Presente;kmrml;mrml;CBIR;
-Keywords[ro]=imagini;căutare;caută;interogare;găseşte;dar;kmrml;mrml;CBIR;
-Keywords[ru]=изображения;поиск;запрос;kmrml;mrml;CBIR;
-Keywords[sk]=Obrázky;Hľadanie;Dotazy;Nájsť;kmrml;mrml;CBIR;
-Keywords[sl]=slike;iskanje;povpraševanje;išči;najdi;gift;kmrml;mrml;CBIR;
-Keywords[sr]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;слике;тражи;упит;нађи;поклон;
-Keywords[sr@Latn]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;slike;traži;upit;nađi;poklon;
-Keywords[sv]=Bilder;Sök;Förfrågan;Hitta;Gift;kmrml;mrml;CBIR;
-Keywords[ta]=பிம்பங்கள்; தேடு; கேள்வி; கண்டுபிடி;பரிசு;kmrml;mrml;CBIR;
-Keywords[tg]=тасвирот;ҷустуҷӯӣ;дархост;kmrml;mrml;CBIR;
-Keywords[tr]=Resimler;Ara;Arama;kmrml;mrml;CBIR;
-Keywords[uk]=зображення;пошук;запит;знайти;подарунок;kmrml;mrml;CBIR;
-Keywords[ven]=Zwifanyiso;Toda;Mbudziso;Wana;Mpho;kmrml;mrml;CBIR;
-Keywords[wa]=Imådjes;Cweri;Cweraedje;Trover;Gift;kmrml;mrml;CBIR;
-Keywords[xh]=Imifanekiso;Uphendlo;Ubuzo;fumana;Isiphiwo;kmrml;mrml;CBIR;
-Keywords[zh_CN]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;图像;搜索;查询;查找;礼物;
-Keywords[zh_HK]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;圖像;搜尋;查詢;尋找;
-Keywords[zh_TW]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;影像;搜尋;查詢;尋找;
-Keywords[zu]=Izithombe;Funa;Buza;Thola;Isipho;kmrml;mrml;CBIR;
-
-Categories=Qt;TDE;Settings;X-TDE-settings-system;
diff --git a/kmrml/kmrml/kcontrol/kcmkmrml.h b/kmrml/kmrml/kcontrol/kcmkmrml.h
deleted file mode 100644
index 02778d0a..00000000
--- a/kmrml/kmrml/kcontrol/kcmkmrml.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation, version 2.
-
- 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 KCMKMRML_H
-#define KCMKMRML_H
-
-#include <tdecmodule.h>
-
-class TDEAboutData;
-class KURLRequester;
-
-namespace KMrmlConfig
-{
- class MainPage;
-
- class KCMKMrml : public TDECModule
- {
- Q_OBJECT
-
-
- public:
- KCMKMrml(TQWidget *parent, const char *name, const TQStringList &);
- virtual ~KCMKMrml();
-
- virtual void defaults();
- virtual void load();
- virtual void save();
- virtual TQString quickHelp() const;
-
- private:
- void checkGiftInstallation();
-
- MainPage *m_mainPage;
- };
-
-}
-
-#endif
diff --git a/kmrml/kmrml/kcontrol/mainpage.cpp b/kmrml/kmrml/kcontrol/mainpage.cpp
deleted file mode 100644
index 9ddd6bf9..00000000
--- a/kmrml/kmrml/kcontrol/mainpage.cpp
+++ /dev/null
@@ -1,501 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation, version 2.
-
- 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 <tqcheckbox.h>
-#include <tqlabel.h>
-#include <tqsizepolicy.h>
-#include <tqtooltip.h>
-#include <tqwidget.h>
-#include <tqvgroupbox.h>
-
-#include <kcombobox.h>
-#include <kdialog.h>
-#include <keditlistbox.h>
-#include <tdeglobalsettings.h>
-#include <klineedit.h>
-#include <tdelocale.h>
-#include <tdemessagebox.h>
-#include <knuminput.h>
-#include <kprogress.h>
-#include <kurlrequester.h>
-
-#include <tdeversion.h>
-#include <kdebug.h>
-#include <tdeio/slaveconfig.h>
-#include <tdeio/ioslave_defaults.h> // MAX_PORT_VALUE
-
-#include "serverconfigwidget.h"
-#include "mainpage.h"
-#include "indexer.h"
-#include "indexcleaner.h"
-
-#include <limits.h>
-#include <string.h>
-
-using namespace KMrmlConfig;
-
-
-MainPage::MainPage( TQWidget *parent, const char *name )
- : TQVBox( parent, name ),
- m_indexer( 0L ),
- m_indexCleaner( 0L ),
- m_progressDialog( 0L ),
- m_performIndexing( false ),
- m_locked( false )
-{
- m_config = new KMrml::Config();
- setSpacing( KDialog::spacingHint() );
-
- TQVGroupBox *gBox = new TQVGroupBox( i18n("Indexing Server Configuration"),
- this );
- m_serverWidget = new ServerConfigWidget( gBox, "server config widget" );
- TQString tip = i18n("Hostname of the Indexing Server");
- TQToolTip::add( m_serverWidget->m_hostLabel, tip );
- TQToolTip::add( m_serverWidget->m_hostCombo, tip );
-
- m_serverWidget->m_portInput->setRange( 0, MAX_PORT_VALUE );
-
-#if TDE_VERSION >= 306
- KURLRequester *requester = new KURLRequester( this, "dir requester" );
- requester->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
- requester->setURL( TDEGlobalSettings::documentPath() );
- connect( requester, TQT_SIGNAL( openFileDialog( KURLRequester * )),
- TQT_SLOT( slotRequesterClicked( KURLRequester * )));
-
- m_listBox = new KEditListBox( i18n("Folders to Be Indexed" ),
- requester->customEditor(), this, "listbox",
- false,
- KEditListBox::Add | KEditListBox::Remove );
-#else
- m_listBox = new KEditListBox( i18n("Folders to Be Indexed" ),
- this, "listbox", false,
- KEditListBox::Add | KEditListBox::Remove );
-#endif
-
- connect( m_listBox, TQT_SIGNAL( changed() ), TQT_SLOT( slotDirectoriesChanged() ));
- connect( m_serverWidget->m_hostCombo, TQT_SIGNAL( textChanged(const TQString&)),
- TQT_SLOT( slotHostChanged() ));
- connect( m_serverWidget->m_portInput, TQT_SIGNAL( valueChanged( int )),
- TQT_SLOT( slotPortChanged( int ) ));
- connect ( m_serverWidget->m_useAuth, TQT_SIGNAL( toggled(bool) ),
- TQT_SLOT( slotUseAuthChanged( bool ) ));
- connect( m_serverWidget->m_userEdit, TQT_SIGNAL( textChanged( const TQString&)),
- TQT_SLOT( slotUserChanged( const TQString& ) ));
- connect( m_serverWidget->m_passEdit, TQT_SIGNAL( textChanged( const TQString&)),
- TQT_SLOT( slotPassChanged( const TQString& ) ));
-
- connect( m_serverWidget->m_addButton, TQT_SIGNAL( clicked() ),
- TQT_SLOT( slotAddClicked() ));
- connect( m_serverWidget->m_removeButton, TQT_SIGNAL( clicked() ),
- TQT_SLOT( slotRemoveClicked() ));
-
- connect( m_serverWidget->m_hostCombo, TQT_SIGNAL( activated( const TQString& )),
- TQT_SLOT( slotHostActivated( const TQString& )));
- connect( m_serverWidget->m_hostCombo, TQT_SIGNAL( returnPressed() ),
- TQT_SLOT( slotAddClicked() ));
-
- connect( m_serverWidget->m_autoPort, TQT_SIGNAL( toggled( bool ) ),
- TQT_SLOT( slotAutoPortChanged( bool ) ));
-
- m_serverWidget->m_hostCombo->setTrapReturnKey( true );
- m_serverWidget->m_hostCombo->setFocus();
-}
-
-MainPage::~MainPage()
-{
- delete m_config;
-}
-
-void MainPage::resetDefaults()
-{
- blockSignals( true );
-
- initFromSettings( KMrml::ServerSettings::defaults() );
-
- m_serverWidget->m_hostCombo->clear();
- m_serverWidget->m_hostCombo->insertItem( m_settings.host );
-
- m_listBox->clear();
-
- // slotHostChanged(); not necessary, will be called by TQt signals
- slotUseAuthChanged( m_serverWidget->m_useAuth->isChecked() );
-
- blockSignals( false );
-}
-
-void MainPage::load()
-{
- blockSignals( true );
-
- initFromSettings( m_config->defaultSettings() );
-
- m_serverWidget->m_hostCombo->clear();
- m_serverWidget->m_hostCombo->insertStringList( m_config->hosts() );
- m_serverWidget->m_hostCombo->setCurrentItem( m_settings.host );
-
- m_listBox->clear();
- m_listBox->insertStringList( m_config->indexableDirectories() );
-
- // slotHostChanged(); not necessary, will be called by TQt signals
- slotUseAuthChanged( m_serverWidget->m_useAuth->isChecked() );
-
- blockSignals( false );
-}
-
-void MainPage::save()
-{
- m_config->addSettings( m_settings );
- m_config->setDefaultHost( m_settings.host );
-
- TQStringList indexDirs = m_listBox->items();
- TQStringList oldIndexDirs = m_config->indexableDirectories();
- TQStringList removedDirs = difference( oldIndexDirs, indexDirs );
-
- m_config->setIndexableDirectories( indexDirs );
- if ( indexDirs.isEmpty() )
- KMessageBox::information( this,
- i18n("You did not specify any folders to "
- "be indexed. This means you will be "
- "unable to perform queries on your "
- "computer."),
- "kcmkmrml_no_directories_specified" );
-
- if ( m_config->sync() )
- TDEIO::SlaveConfig::self()->reset();
-
- processIndexDirs( removedDirs );
-}
-
-TQStringList MainPage::difference( const TQStringList& oldIndexDirs,
- const TQStringList& newIndexDirs ) const
-{
- TQStringList result;
-
- TQString slash = TQString::fromLatin1("/");
- TQStringList::ConstIterator oldIt = oldIndexDirs.begin();
- TQString oldDir, newDir;
-
- for ( ; oldIt != oldIndexDirs.end(); oldIt++ )
- {
- bool removed = true;
- oldDir = *oldIt;
-
- while ( oldDir.endsWith( slash ) ) // remove slashes
- oldDir.remove( oldDir.length() - 1, 1 );
-
- TQStringList::ConstIterator newIt = newIndexDirs.begin();
- for ( ; newIt != newIndexDirs.end(); newIt++ )
- {
- newDir = *newIt;
- while ( newDir.endsWith( slash ) ) // remove slashes
- newDir.remove( newDir.length() - 1, 1 );
-
- if ( oldDir == newDir )
- {
- removed = false;
- break;
- }
- }
-
- if ( removed )
- result.append( *oldIt ); // not oldDir -- maybe gift needs slashes
- }
-
- return result;
-}
-
-void MainPage::initFromSettings( const KMrml::ServerSettings& settings )
-{
- m_settings = settings;
-
- m_locked = true;
-
- m_serverWidget->m_portInput->setValue( settings.configuredPort );
- m_serverWidget->m_autoPort->setChecked( settings.autoPort );
- m_serverWidget->m_useAuth->setChecked( settings.useAuth );
- m_serverWidget->m_userEdit->setText( settings.user );
- m_serverWidget->m_passEdit->setText( settings.pass );
-
- m_locked = false;
-}
-
-void MainPage::slotHostActivated( const TQString& host )
-{
- // implicitly save the current settings when another host was chosen
- m_config->addSettings( m_settings );
-
- initFromSettings( m_config->settingsForHost( host ) );
-}
-
-void MainPage::slotHostChanged()
-{
- TQString host = m_serverWidget->m_hostCombo->currentText();
- m_listBox->setEnabled( (host == "localhost") );
-
- KMrml::ServerSettings settings = m_config->settingsForHost( host );
- enableWidgetsFor( settings );
-}
-
-void MainPage::slotUseAuthChanged( bool enable )
-{
- m_settings.useAuth = enable;
- m_serverWidget->m_userEdit->setEnabled( enable );
- m_serverWidget->m_passEdit->setEnabled( enable );
-
- if ( enable )
- m_serverWidget->m_userEdit->setFocus();
-
- if ( !m_locked )
- changed();
-}
-
-void MainPage::slotUserChanged( const TQString& user )
-{
- if ( m_locked )
- return;
-
- m_settings.user = user;
- changed();
-}
-
-void MainPage::slotPassChanged( const TQString& pass )
-{
- if ( m_locked )
- return;
-
- m_settings.pass = pass;
- changed();
-}
-
-void MainPage::slotPortChanged( int port )
-{
- if ( m_locked )
- return;
-
- m_settings.configuredPort = (unsigned short int) port;
- changed();
-}
-
-void MainPage::slotAutoPortChanged( bool on )
-{
- if ( m_locked )
- return;
-
- m_settings.autoPort = on;
- m_serverWidget->m_portInput->setEnabled( !on );
- changed();
-}
-
-void MainPage::slotRequesterClicked( KURLRequester *requester )
-{
- static bool init = true;
- if ( !init )
- return;
-
- init = false;
-
- requester->setCaption(i18n("Select Folder You Want to Index"));
-}
-
-void MainPage::slotAddClicked()
-{
- TQString host = m_serverWidget->m_hostCombo->currentText();
- m_settings.host = host;
-
- m_config->addSettings( m_settings );
- m_serverWidget->m_hostCombo->insertItem( host );
- m_serverWidget->m_hostCombo->setCurrentItem( host );
-
- enableWidgetsFor( m_settings );
-}
-
-void MainPage::slotRemoveClicked()
-{
- TQString host = m_serverWidget->m_hostCombo->currentText();
- if ( host.isEmpty() ) // should never happen
- return;
-
- m_config->removeSettings( host );
- m_serverWidget->m_hostCombo->removeItem( m_serverWidget->m_hostCombo->currentItem() );
- m_serverWidget->m_hostCombo->setCurrentItem( 0 );
-
- host = m_serverWidget->m_hostCombo->currentText();
- initFromSettings( m_config->settingsForHost( host ) );
-}
-
-void MainPage::enableWidgetsFor( const KMrml::ServerSettings& settings )
-{
- TQString host = settings.host;
- bool enableWidgets = (m_config->hosts().findIndex( host ) > -1);
- m_serverWidget->m_addButton->setEnabled(!enableWidgets && !host.isEmpty());
- m_serverWidget->m_removeButton->setEnabled( enableWidgets &&
- !host.isEmpty() &&
- host != "localhost" );
-
- m_serverWidget->m_autoPort->setEnabled( host == "localhost" );
- bool portEnable = enableWidgets && (settings.autoPort ||
- !m_serverWidget->m_autoPort->isEnabled());
- m_serverWidget->m_portLabel->setEnabled( portEnable && !m_serverWidget->m_autoPort->isChecked());
- m_serverWidget->m_portInput->setEnabled( portEnable && !m_serverWidget->m_autoPort->isChecked());
-
- m_serverWidget->m_useAuth->setEnabled( enableWidgets );
- m_serverWidget->m_userLabel->setEnabled( enableWidgets );
- m_serverWidget->m_passLabel->setEnabled( enableWidgets );
- m_serverWidget->m_userEdit->setEnabled( enableWidgets );
- m_serverWidget->m_passEdit->setEnabled( enableWidgets );
-
- bool useAuth = m_serverWidget->m_useAuth->isChecked();
- m_serverWidget->m_userEdit->setEnabled( useAuth );
- m_serverWidget->m_passEdit->setEnabled( useAuth );
-}
-
-void MainPage::slotDirectoriesChanged()
-{
- m_performIndexing = true;
- changed();
-}
-
-void MainPage::processIndexDirs( const TQStringList& removeDirs )
-{
- // ### how to remove indexed directories?
- if ( !m_performIndexing ||
- (removeDirs.isEmpty() && m_config->indexableDirectories().isEmpty()) )
- return;
-
- delete m_progressDialog;
- delete m_indexCleaner;
- m_indexCleaner = 0L;
- delete m_indexer;
- m_indexer = 0L;
-
- m_progressDialog = new KProgressDialog( this, "indexing dialog",
- i18n("Removing old Index Files"),
- i18n("Processing..."),
- true );
- m_progressDialog->setAutoClose( false );
- m_progressDialog->setMinimumWidth( 300 );
- connect( m_progressDialog, TQT_SIGNAL( cancelClicked() ),
- TQT_SLOT( slotCancelIndexing() ));
-
- // argh -- don't automatically show the dialog
- m_progressDialog->setMinimumDuration( INT_MAX );
-
- if ( !removeDirs.isEmpty() )
- {
- m_indexCleaner = new IndexCleaner( removeDirs, m_config, TQT_TQOBJECT(this) );
- connect( m_indexCleaner, TQT_SIGNAL( advance( int ) ),
- m_progressDialog->progressBar(), TQT_SLOT( advance( int ) ));
- connect( m_indexCleaner, TQT_SIGNAL( finished() ),
- TQT_SLOT( slotMaybeIndex() ) );
- m_indexCleaner->start();
- }
- else
- {
- slotMaybeIndex();
- }
- if ( m_progressDialog )
- m_progressDialog->exec();
-}
-
-void MainPage::slotMaybeIndex()
-{
- delete m_indexCleaner; // Stop in the name of the law!
- m_indexCleaner = 0L;
-
- m_progressDialog->setLabel( i18n("Finished.") );
-
- if ( m_config->indexableDirectories().isEmpty() )
- return;
-
- if ( KMessageBox::questionYesNo( this,
- i18n("The settings have been saved. Now, "
- "the configured directories need to "
- "be indexed. This may take a while. "
- "Do you want to do this now?"),
- i18n("Start Indexing Now?"),
- i18n("Index"), i18n("Do Not Index"),
- "ask_startIndexing"
- ) != KMessageBox::Yes )
- return;
- m_progressDialog->setCaption( i18n("Indexing Folders") );
- m_progressDialog->setLabel( i18n("Processing...") );
- m_progressDialog->progressBar()->setProgress( 0 );
-
- // do the indexing
- m_indexer = new Indexer( m_config, TQT_TQOBJECT(this), "Indexer" );
- connect( m_indexer, TQT_SIGNAL( progress( int, const TQString& )),
- TQT_SLOT( slotIndexingProgress( int, const TQString& ) ));
- connect( m_indexer, TQT_SIGNAL( finished( int )),
- TQT_SLOT( slotIndexingFinished( int ) ));
- m_indexer->startIndexing( m_config->indexableDirectories() );
-}
-
-
-void MainPage::slotIndexingProgress( int percent, const TQString& message )
-{
- m_progressDialog->progressBar()->setValue( percent );
- m_progressDialog->setLabel( message );
-}
-
-void MainPage::slotIndexingFinished( int returnCode )
-{
- if ( returnCode != 0 )
- {
- TQString syserr;
- if ( returnCode == 127 )
- syserr = i18n("Is the \"GNU Image Finding Tool\" properly installed?");
- else
- {
- char *err = strerror( returnCode );
- if ( err )
- syserr = TQString::fromLocal8Bit( err );
- else
- syserr = i18n("Unknown error: %1").arg( returnCode );
- }
-
- KMessageBox::detailedError( this, i18n("An error occurred during indexing. The index might be invalid."),
- syserr, i18n("Indexing Aborted") );
- }
- else
- m_performIndexing = false;
-
- delete m_indexer;
- m_indexer = 0L;
- if ( m_progressDialog )
- {
- m_progressDialog->deleteLater();
- m_progressDialog = 0L;
- }
-}
-
-void MainPage::slotCancelIndexing()
-{
- delete m_indexCleaner;
- m_indexCleaner = 0L;
-
- delete m_indexer;
- m_indexer = 0L;
- if ( m_progressDialog )
- {
- m_progressDialog->deleteLater();
- m_progressDialog = 0L;
- }
-}
-
-
-#include "mainpage.moc"
diff --git a/kmrml/kmrml/kcontrol/mainpage.h b/kmrml/kmrml/kcontrol/mainpage.h
deleted file mode 100644
index 3b79da6d..00000000
--- a/kmrml/kmrml/kcontrol/mainpage.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation, version 2.
-
- 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 MAINPAGE_H
-#define MAINPAGE_H
-
-#include <tqvbox.h>
-
-#include <kmrml_config.h>
-
-class TQCheckBox;
-class KComboBox;
-class KEditListBox;
-class KIntNumInput;
-class KLineEdit;
-class KProgressDialog;
-class KURLRequester;
-
-namespace KMrml
-{
- class Config;
-}
-
-class ServerConfigWidget;
-
-namespace KMrmlConfig
-{
- class Indexer;
- class IndexCleaner;
-
- class MainPage : public TQVBox
- {
- Q_OBJECT
-
-
- public:
- MainPage( TQWidget *parent, const char *name );
- ~MainPage();
-
- void resetDefaults();
- void load();
- void save();
-
- signals:
- void changed( bool );
-
- private slots:
- void changed() { emit changed( true ); }
- void slotRequesterClicked( KURLRequester * );
- void slotHostChanged();
- void slotUseAuthChanged( bool );
- void slotUserChanged( const TQString& );
- void slotPassChanged( const TQString& );
- void slotPortChanged( int );
- void slotAutoPortChanged( bool );
-
- void slotAddClicked();
- void slotRemoveClicked();
-
- void slotHostActivated( const TQString& );
-
- void slotDirectoriesChanged();
-
- void slotMaybeIndex();
- void slotIndexingProgress( int percent, const TQString& message );
- void slotIndexingFinished( int returnCode );
- void slotCancelIndexing();
-
-
- private:
- void enableWidgetsFor( const KMrml::ServerSettings& settings );
- void initFromSettings( const KMrml::ServerSettings& settings );
-
- void processIndexDirs( const TQStringList& removedDirs );
-
- TQStringList difference( const TQStringList& oldIndexDirs,
- const TQStringList& newIndexDirs ) const;
-
- ServerConfigWidget *m_serverWidget;
- KEditListBox *m_listBox;
- KMrml::Config *m_config;
- KMrmlConfig::Indexer *m_indexer;
- KMrmlConfig::IndexCleaner *m_indexCleaner;
- KProgressDialog *m_progressDialog;
-
- KMrml::ServerSettings m_settings;
- bool m_performIndexing;
- bool m_locked;
- };
-
-}
-
-
-
-#endif // MAINPAGE_H
diff --git a/kmrml/kmrml/kcontrol/serverconfigwidget.ui b/kmrml/kmrml/kcontrol/serverconfigwidget.ui
deleted file mode 100644
index 5f3a34cd..00000000
--- a/kmrml/kmrml/kcontrol/serverconfigwidget.ui
+++ /dev/null
@@ -1,272 +0,0 @@
-<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
-<class>ServerConfigWidget</class>
-<widget class="TQWidget">
- <property name="name">
- <cstring>ServerConfigWidget</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>455</width>
- <height>321</height>
- </rect>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>11</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>Layout7</cstring>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="TQLayoutWidget" row="0" column="1">
- <property name="name">
- <cstring>Layout4</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="KComboBox">
- <property name="name">
- <cstring>m_hostCombo</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>3</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="editable">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="TQPushButton">
- <property name="name">
- <cstring>m_addButton</cstring>
- </property>
- <property name="text">
- <string>&amp;Add</string>
- </property>
- </widget>
- <widget class="TQPushButton">
- <property name="name">
- <cstring>m_removeButton</cstring>
- </property>
- <property name="text">
- <string>&amp;Remove</string>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget class="TQLayoutWidget" row="1" column="1">
- <property name="name">
- <cstring>Layout6</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="KIntSpinBox">
- <property name="name">
- <cstring>m_portInput</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip" stdset="0">
- <string>TCP/IP Port Number of the Indexing Server</string>
- </property>
- </widget>
- <widget class="TQCheckBox">
- <property name="name">
- <cstring>m_autoPort</cstring>
- </property>
- <property name="text">
- <string>Au&amp;to</string>
- </property>
- <property name="toolTip" stdset="0">
- <string>Tries to automatically determine the port. This works only for local servers.</string>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>Spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </hbox>
- </widget>
- <widget class="TQLabel" row="0" column="0">
- <property name="name">
- <cstring>m_hostLabel</cstring>
- </property>
- <property name="text">
- <string>Ho&amp;stname:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>m_hostCombo</cstring>
- </property>
- </widget>
- <widget class="TQLabel" row="1" column="0">
- <property name="name">
- <cstring>m_portLabel</cstring>
- </property>
- <property name="text">
- <string>P&amp;ort:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>m_portInput</cstring>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="TQCheckBox">
- <property name="name">
- <cstring>m_useAuth</cstring>
- </property>
- <property name="text">
- <string>Per&amp;form authentication</string>
- </property>
- </widget>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>Layout12</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <spacer>
- <property name="name">
- <cstring>Spacer1</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Fixed</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- <widget class="TQLayoutWidget">
- <property name="name">
- <cstring>Layout6</cstring>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="TQLabel" row="0" column="0">
- <property name="name">
- <cstring>m_userLabel</cstring>
- </property>
- <property name="text">
- <string>&amp;Username:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>m_userEdit</cstring>
- </property>
- </widget>
- <widget class="KLineEdit" row="1" column="1">
- <property name="name">
- <cstring>m_passEdit</cstring>
- </property>
- </widget>
- <widget class="TQLabel" row="1" column="0">
- <property name="name">
- <cstring>m_passLabel</cstring>
- </property>
- <property name="text">
- <string>&amp;Password:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>m_passEdit</cstring>
- </property>
- </widget>
- <widget class="KLineEdit" row="0" column="1">
- <property name="name">
- <cstring>m_userEdit</cstring>
- </property>
- </widget>
- </grid>
- </widget>
- </hbox>
- </widget>
- </vbox>
-</widget>
-<tabstops>
- <tabstop>m_hostCombo</tabstop>
- <tabstop>m_addButton</tabstop>
- <tabstop>m_removeButton</tabstop>
- <tabstop>m_portInput</tabstop>
- <tabstop>m_useAuth</tabstop>
- <tabstop>m_userEdit</tabstop>
- <tabstop>m_passEdit</tabstop>
-</tabstops>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>