summaryrefslogtreecommitdiffstats
path: root/katapult/plugins/catalogs/documentcatalog
diff options
context:
space:
mode:
Diffstat (limited to 'katapult/plugins/catalogs/documentcatalog')
-rw-r--r--katapult/plugins/catalogs/documentcatalog/Makefile.am16
-rw-r--r--katapult/plugins/catalogs/documentcatalog/actionopendocument.cpp58
-rw-r--r--katapult/plugins/catalogs/documentcatalog/actionopendocument.h41
-rw-r--r--katapult/plugins/catalogs/documentcatalog/directory.cpp36
-rw-r--r--katapult/plugins/catalogs/documentcatalog/directory.h38
-rw-r--r--katapult/plugins/catalogs/documentcatalog/document.cpp86
-rw-r--r--katapult/plugins/catalogs/documentcatalog/document.h52
-rw-r--r--katapult/plugins/catalogs/documentcatalog/documentcatalog.cpp229
-rw-r--r--katapult/plugins/catalogs/documentcatalog/documentcatalog.h71
-rw-r--r--katapult/plugins/catalogs/documentcatalog/katapult_documentcatalog.desktop44
-rw-r--r--katapult/plugins/catalogs/documentcatalog/settings.ui82
11 files changed, 753 insertions, 0 deletions
diff --git a/katapult/plugins/catalogs/documentcatalog/Makefile.am b/katapult/plugins/catalogs/documentcatalog/Makefile.am
new file mode 100644
index 0000000..ddcad1a
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/Makefile.am
@@ -0,0 +1,16 @@
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = documentcatalog.h directory.h document.h actionopendocument.h
+
+# use automoc
+METASOURCES = AUTO
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_documentcatalog.la
+katapult_documentcatalog_la_SOURCES = settings.ui documentcatalog.cpp \
+ directory.cpp document.cpp actionopendocument.cpp
+katapult_documentcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_documentcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_documentcatalog.desktop
diff --git a/katapult/plugins/catalogs/documentcatalog/actionopendocument.cpp b/katapult/plugins/catalogs/documentcatalog/actionopendocument.cpp
new file mode 100644
index 0000000..70f91a7
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/actionopendocument.cpp
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <krun.h>
+#include <klocale.h>
+
+#include "actionopendocument.h"
+#include "document.h"
+#include "directory.h"
+
+ActionOpenDocument::ActionOpenDocument()
+ : KatapultAction()
+{
+}
+
+bool ActionOpenDocument::accepts(const KatapultItem* item) const
+{
+ return strcmp(item->className(), "Document") == 0 || strcmp(item->className(), "Directory") == 0;
+}
+
+QPixmap ActionOpenDocument::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("fileopen", KIcon::NoGroup, size);
+}
+
+QString ActionOpenDocument::text() const
+{
+ return i18n("Open");
+}
+
+void ActionOpenDocument::execute(const KatapultItem* item) const
+{
+ if(strcmp(item->className(), "Document") == 0 || strcmp(item->className(), "Directory") == 0) {
+ const Document *document = (const Document *) item;
+ qDebug("%s", QString("Running: %1").arg(document->path()).latin1());
+ new KRun(document->path());
+ }
+}
+
diff --git a/katapult/plugins/catalogs/documentcatalog/actionopendocument.h b/katapult/plugins/catalogs/documentcatalog/actionopendocument.h
new file mode 100644
index 0000000..c6a8bf7
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/actionopendocument.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#ifndef ACTIONOPENDOCUMENT_H
+#define ACTIONOPENDOCUMENT_H
+
+#include <katapultaction.h>
+
+/**
+@author Joe Ferris
+*/
+class ActionOpenDocument : public KatapultAction
+{
+
+public:
+ ActionOpenDocument();
+
+ virtual bool accepts(const KatapultItem*) const;
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+ virtual void execute(const KatapultItem*) const;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/documentcatalog/directory.cpp b/katapult/plugins/catalogs/documentcatalog/directory.cpp
new file mode 100644
index 0000000..3d3bc54
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/directory.cpp
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include "directory.h"
+
+Directory::Directory(QString _path, QString _absPath)
+ : Document(_path, _absPath, false)
+{
+}
+
+QPixmap Directory::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("folder", KIcon::NoGroup, size);
+}
+
+#include "directory.moc"
diff --git a/katapult/plugins/catalogs/documentcatalog/directory.h b/katapult/plugins/catalogs/documentcatalog/directory.h
new file mode 100644
index 0000000..2f37f20
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/directory.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#ifndef DIRECTORY_H
+#define DIRECTORY_H
+
+#include "document.h"
+
+/**
+@author Joe Ferris
+*/
+class Directory : public Document
+{
+Q_OBJECT
+public:
+ Directory(QString, QString);
+
+ virtual QPixmap icon(int) const;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/documentcatalog/document.cpp b/katapult/plugins/catalogs/documentcatalog/document.cpp
new file mode 100644
index 0000000..96024cc
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/document.cpp
@@ -0,0 +1,86 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include <qfileinfo.h>
+#include <kmimetype.h>
+#include <kiconloader.h>
+#include <kio/previewjob.h>
+
+#include "document.h"
+
+Document::Document(QString _path, QString _absPath, bool _showPreview)
+ : KatapultItem()
+{
+ this->_path = _path;
+ this->_absPath = _absPath;
+ this->_gotpix = false;
+ this->_showPreview=_showPreview;
+
+ QFileInfo file(_absPath);
+ _name = file.fileName();
+}
+
+Document::~Document()
+{
+}
+
+QPixmap Document::icon(int size) const
+{
+ KURL u;
+ KIO::PreviewJob *doc;
+ u.setPath(_absPath);
+ if (this->_showPreview)
+ {
+
+ doc=KIO::filePreview(u,size);
+ connect(doc, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
+ SLOT(gotPreview(const KFileItem*, const QPixmap&)));
+
+ if(this->_gotpix)return this->_pix;
+ return KMimeType::pixmapForURL(u,0, KIcon::NoGroup, size, KIcon::DefaultState, 0L);
+ }
+ else
+ {
+ return KMimeType::pixmapForURL(u,0, KIcon::NoGroup, size, KIcon::DefaultState, 0L);
+ }
+}
+
+void Document::gotPreview(const KFileItem *item, const QPixmap& pixmap )
+{
+ this->_pix = pixmap; this->_gotpix=true;
+ emit itemChanged();
+}
+
+QString Document::text() const
+{
+ return _path;
+}
+
+QString Document::path() const
+{
+ return _absPath;
+}
+
+QString Document::name() const
+{
+ return _name;
+}
+
+#include "document.moc"
diff --git a/katapult/plugins/catalogs/documentcatalog/document.h b/katapult/plugins/catalogs/documentcatalog/document.h
new file mode 100644
index 0000000..6d09d99
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/document.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#ifndef DOCUMENT_H
+#define DOCUMENT_H
+
+#include <katapultitem.h>
+#include <kfileitem.h>
+
+/**
+@author Joe Ferris
+*/
+class Document : public KatapultItem
+{
+ Q_OBJECT
+public:
+ Document(QString, QString, bool);
+ virtual ~Document();
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ QString path() const;
+ QString name() const;
+
+public slots:
+ void gotPreview(const KFileItem*,const QPixmap& );
+
+private:
+ QString _path, _absPath, _name;
+ QPixmap _pix;
+ bool _gotpix;
+ bool _showPreview;
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/documentcatalog/documentcatalog.cpp b/katapult/plugins/catalogs/documentcatalog/documentcatalog.cpp
new file mode 100644
index 0000000..883ac23
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/documentcatalog.cpp
@@ -0,0 +1,229 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This document is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This document 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 document; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include <kservicegroup.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <kapplication.h>
+#include <knuminput.h>
+#include <kcombobox.h>
+
+#include <qcheckbox.h>
+
+#include <actionregistry.h>
+
+#include "settings.h"
+#include "documentcatalog.h"
+#include "document.h"
+#include "directory.h"
+#include "status.h"
+#include "match.h"
+#include "actionopendocument.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_documentcatalog,
+ KGenericFactory<DocumentCatalog>( "katapult_documentcatalog" ) )
+
+DocumentCatalog::DocumentCatalog(QObject *, const char *, const QStringList&)
+ : KatapultCatalog()
+{
+ _minQueryLen = 1;
+ currentPath = "";
+ currentDirDoc = 0;
+ queryMatched = 0;
+ filesListed = FALSE;
+ files.setAutoDelete(TRUE);
+ ActionRegistry::self()->registerAction(new ActionOpenDocument());
+}
+
+DocumentCatalog::~DocumentCatalog()
+{
+}
+
+void DocumentCatalog::initialize()
+{
+ dir = QDir::home();
+ refreshFolders();
+ refreshFiles();
+}
+
+void DocumentCatalog::refreshFolders()
+{
+ folders.clear();
+ files.clear();
+ currentDirDoc = 0;
+ filesListed = FALSE;
+ QStringList folderNames = dir.entryList(QDir::Dirs);
+ for(QStringList::Iterator it = folderNames.begin(); it != folderNames.end(); ++it) {
+ QString dirname = *it;
+ if(!dirname.startsWith("."))
+ folders.append(dirname);
+ }
+}
+
+void DocumentCatalog::refreshFiles()
+{
+ const QFileInfoList *fileList = dir.entryInfoList();
+ Directory *item = new Directory(currentPath, dir.absPath());
+ currentDirDoc = item;
+ files.append(item);
+
+ for(QPtrListStdIterator<QFileInfo> it = fileList->begin(); it != fileList->end(); ++it) {
+ const QFileInfo *file = *it;
+ if(!file->fileName().startsWith(".")) {
+ if(file->isDir())
+ files.append(new Directory(currentPath+file->fileName(), file->absFilePath()));
+ else
+ files.append(new Document(currentPath+file->fileName(), file->absFilePath(), _showPreview));
+ }
+ }
+ filesListed = TRUE;
+}
+
+void DocumentCatalog::queryChanged()
+{
+ int newStatus = 0;
+ if(query() == "")
+ {
+ // reset query
+ dir = QDir::home();
+ currentPath = "";
+ queryMatched = 0;
+ refreshFolders();
+ } else {
+ if(query().length() >= minQueryLen())
+ {
+ QString path = query().lower().remove(0, queryMatched);
+
+ int index;
+ while((index = path.find('/')) != -1) {
+ QString folderQuery = path.left(index);
+ QString guess = QString::null;
+
+ for(QStringList::Iterator it = folders.begin(); it != folders.end(); ++it) {
+ QString folderName = *it;
+ if(folderName.lower().startsWith(folderQuery) && (guess.isNull() || folderName.length() < guess.length()))
+ guess = folderName;
+ }
+
+ if(guess == QString::null) {
+ path = QString::null;
+ break;
+ }
+
+ if(!dir.cd(guess)) {
+ path = QString::null;
+ break;
+ }
+ refreshFolders();
+
+ queryMatched += folderQuery.length() + 1;
+ currentPath += guess + "/";
+ path = path.remove(0, index+1);
+ }
+
+ Match newBestMatch;
+
+ if(path.isNull()) {
+ files.clear();
+ } else {
+ if(!filesListed) {
+ refreshFiles();
+ }
+ if(!path.isEmpty()) {
+ if(currentDirDoc != 0) {
+ files.removeRef(currentDirDoc);
+ currentDirDoc = 0;
+ }
+ QPtrListIterator<Document> it(files);
+ Document *document;
+ while((document = it.current()) != 0) {
+ ++it;
+ if(document->name().lower().startsWith(path)) {
+ int rank = 100*query().length()/document->text().length();
+ if(newBestMatch.isNull() || rank > newBestMatch.rank())
+ newBestMatch = Match(document, rank, currentPath.length() + path.length());
+ } else {
+ files.removeRef(document);
+ }
+ }
+ }
+ }
+
+ if(currentDirDoc != 0 && path.isEmpty())
+ newBestMatch = Match(currentDirDoc, 100, currentPath.length());
+
+ newStatus |= S_Active;
+ if(files.count() > 0)
+ {
+ newStatus |= S_HasResults;
+ if(files.count() > 1 || files.at(0)->className() == "Directory")
+ newStatus |= S_Multiple;
+ } else
+ newStatus |= S_NoResults;
+
+ setBestMatch(newBestMatch);
+ } else {
+ setBestMatch(Match());
+ }
+ }
+ setStatus(newStatus);
+}
+
+unsigned int DocumentCatalog::minQueryLen() const
+{
+ return _minQueryLen;
+}
+
+void DocumentCatalog::readSettings(KConfigBase *config)
+{
+ _minQueryLen = config->readUnsignedNumEntry("MinQueryLen", 1);
+ _showPreview = config->readBoolEntry("showPreview", FALSE);
+}
+
+void DocumentCatalog::writeSettings(KConfigBase *config)
+{
+ config->writeEntry("MinQueryLen", _minQueryLen);
+ config->writeEntry("showPreview", _showPreview);
+}
+
+QWidget * DocumentCatalog::configure()
+{
+ DocumentCatalogSettings *settings = new DocumentCatalogSettings();
+
+ settings->minQueryLen->setValue(_minQueryLen);
+ connect(settings->minQueryLen, SIGNAL(valueChanged(int)), this, SLOT(minQueryLenChanged(int)));
+
+ settings->showPreview->setChecked(_showPreview);
+ connect(settings->showPreview, SIGNAL(toggled(bool)), this, SLOT(toggleshowPreview(bool)));
+
+ return settings;
+}
+
+void DocumentCatalog::minQueryLenChanged(int _minQueryLen)
+{
+ this->_minQueryLen = _minQueryLen;
+}
+
+void DocumentCatalog::toggleshowPreview(bool _showPreview)
+{
+ this->_showPreview = _showPreview;
+
+}
+#include "documentcatalog.moc"
diff --git a/katapult/plugins/catalogs/documentcatalog/documentcatalog.h b/katapult/plugins/catalogs/documentcatalog/documentcatalog.h
new file mode 100644
index 0000000..e153729
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/documentcatalog.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This document is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This document 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 document; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#ifndef DOCUMENTCATALOG_H
+#define DOCUMENTCATALOG_H
+
+#include <kgenericfactory.h>
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+#include <qdir.h>
+
+#include "katapultcatalog.h"
+
+class QWidget;
+class Document;
+
+/**
+@author Joe Ferris
+*/
+class DocumentCatalog : public KatapultCatalog
+{
+ Q_OBJECT
+public:
+ DocumentCatalog(QObject *, const char *, const QStringList&);
+ virtual ~DocumentCatalog();
+
+ virtual void initialize();
+ virtual void queryChanged();
+ virtual void readSettings(KConfigBase *);
+ virtual void writeSettings(KConfigBase *);
+ virtual unsigned int minQueryLen() const;
+ virtual QWidget * configure();
+
+public slots:
+ void minQueryLenChanged(int);
+ void toggleshowPreview(bool);
+
+private:
+ void refreshFolders();
+ void refreshFiles();
+
+ QPtrList<Document> files;
+ Document *currentDirDoc;
+ QStringList folders;
+ QString currentPath;
+ QDir dir;
+ bool filesListed;
+ int _minQueryLen;
+ int queryMatched;
+ bool _showPreview;
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/documentcatalog/katapult_documentcatalog.desktop b/katapult/plugins/catalogs/documentcatalog/katapult_documentcatalog.desktop
new file mode 100644
index 0000000..451e52e
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/katapult_documentcatalog.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Name=Document Catalog
+Name[ar]=مستعرض المستندات ( Document Catalog)
+Name[bg]=Каталог с документи
+Name[br]=Katalog teul
+Name[da]=Katalogisér dokument
+Name[de]=Dokumenten-Katalog
+Name[el]=Κατάλογος εγγράφων
+Name[es]=Catalogador de documentos
+Name[et]=Dokumendikataloog
+Name[fr]=Catalogue des documents
+Name[ga]=Catalóg Cáipéisí
+Name[gl]=Catálogo de Documentos
+Name[it]=Catalogo documenti
+Name[ja]=ドキュメントカタログ
+Name[nb]=Dokumentkatalog
+Name[nl]=Documentcatalogus
+Name[pt]=Catálogo de Documentos
+Name[pt_BR]=Catálogo de Documentos
+Name[sv]=Katalogisera dokument
+Name[tr]=Belge Kataloğu
+Name[uk]=Каталог документів
+Comment=Catalogs your documents for easy launching through Katapult
+Comment[ar]=يستعرض مستنداتك كي تستطيع اقلاعها بسهولة عن طريق Katapult
+Comment[bg]=Каталогизира с Katapult документите с цел лесно стартиране
+Comment[da]=Katalogiserer dine dokumenter for nem start via Katapult
+Comment[de]=Katalogisiert Ihre Dokumente, um sie bequem mit Katapult aufzurufen
+Comment[el]=Δημιουργεί κατάλογο των εγγράφων σας για την εύκολη εκτέλεσή τους μέσω του Katapult
+Comment[es]=Cataloga sus documentos para iniciarlos con facilidad a través de Katapult
+Comment[et]=Kataloogib sinu dokumendid hõlpsaks käivitamiseks Katapultiga
+Comment[fr]=Cataloguer vos documents pour une ouverture facile via Katapult
+Comment[gl]=Cataloga os seus documentos para seren iniciados mediante Katapult
+Comment[it]=Cataloga i tuoi documenti per aprirli facilmente attraverso Katapult
+Comment[ja]=Katapult から簡単に開けるようにドキュメントをカタログ化
+Comment[nb]=Katalogiserer dine dokumenter for lett oppstart via Katapult
+Comment[nl]=Catalogiseert uw documenten voor eenvoudige opstart via Katapult
+Comment[pt]=Cataloga os seus documentos para lançá-los facilmente através do Katapult
+Comment[pt_BR]=Cataloga os seus documentos para lançá-los facilmente através do Katapult
+Comment[sv]=Katalogiserar dina dokument för enkel start via Katapult
+Comment[uk]=Робить каталог документів для простого запуску через Катапульту
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_documentcatalog
+X-Katapult-ID=Document Catalog
diff --git a/katapult/plugins/catalogs/documentcatalog/settings.ui b/katapult/plugins/catalogs/documentcatalog/settings.ui
new file mode 100644
index 0000000..9f11cb9
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/settings.ui
@@ -0,0 +1,82 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>DocumentCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DocumentCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>376</width>
+ <height>519</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <vbox>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Number of characters before searching:</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>minQueryLen</cstring>
+ </property>
+ <property name="maxValue">
+ <number>10</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Katapult will not search for programs until you have typed at least this many characters in the Katapult launcher.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showPreview</cstring>
+ </property>
+ <property name="text">
+ <string>Show Preview for Documents?</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>410</height>
+ </size>
+ </property>
+ </spacer>
+</vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>