diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-03 02:45:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-03 02:45:19 +0000 |
commit | 4e1a5c3eebf50657629e2b4eba13649c2b599598 (patch) | |
tree | 7757743b67ed172d113dad73a3daa5b8aa6f871a /katapult/plugins/catalogs/bookmarkcatalog | |
download | katapult-4e1a5c3eebf50657629e2b4eba13649c2b599598.tar.gz katapult-4e1a5c3eebf50657629e2b4eba13649c2b599598.zip |
Added abandoned KDE3 version of katapult
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/katapult@1084407 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'katapult/plugins/catalogs/bookmarkcatalog')
11 files changed, 755 insertions, 0 deletions
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/Makefile.am b/katapult/plugins/catalogs/bookmarkcatalog/Makefile.am new file mode 100644 index 0000000..ef289e3 --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/Makefile.am @@ -0,0 +1,17 @@ +# set the include path for X, qt and KDE +INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes) + +# header files +noinst_HEADERS = bookmarkcatalog.h bookmark.h actionopenbookmark.h \ + mozillabookmark.h + +# use automoc +METASOURCES = AUTO + +# our plugin +kde_module_LTLIBRARIES = katapult_bookmarkcatalog.la +katapult_bookmarkcatalog_la_SOURCES = settings.ui bookmarkcatalog.cpp \ + bookmark.cpp actionopenbookmark.cpp mozillabookmark.cpp +katapult_bookmarkcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries) +katapult_bookmarkcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la +kde_services_DATA = katapult_bookmarkcatalog.desktop diff --git a/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.cpp b/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.cpp new file mode 100644 index 0000000..bd31782 --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.cpp @@ -0,0 +1,60 @@ +/*************************************************************************** + * 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 <kbookmark.h> +#include <kglobal.h> +#include <kiconloader.h> +#include <krun.h> +#include <kurl.h> +#include <klocale.h> + +#include <qstring.h> +#include <qpixmap.h> + +#include "actionopenbookmark.h" +#include "katapultitem.h" +#include "bookmark.h" +#include "mozillabookmark.h" + +QPixmap ActionOpenBookmark::icon(int size) const +{ + return KGlobal::iconLoader()->loadIcon("fileopen", KIcon::NoGroup, size); +} + +QString ActionOpenBookmark::text() const +{ + return i18n("Open Bookmark"); +} + +void ActionOpenBookmark::execute(const KatapultItem *item) const +{ + if(strcmp(item->className(), "Bookmark") == 0) { + const Bookmark *bookmark = (const Bookmark *) item; + new KRun(bookmark->bookmark().url()); + } else if(strcmp(item->className(), "MozillaBookmark") == 0) { + const MozillaBookmark *bookmark = (const MozillaBookmark *) item; + new KRun(bookmark->url()); + } +} + +bool ActionOpenBookmark::accepts(const KatapultItem *item) const +{ + return strcmp(item->className(), "Bookmark") == 0 || strcmp(item->className(), "MozillaBookmark") == 0; +} diff --git a/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.h b/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.h new file mode 100644 index 0000000..9068753 --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.h @@ -0,0 +1,43 @@ +/*************************************************************************** + * 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 ACTIONOPENBOOKMARK_H +#define ACTIONOPENBOOKMARK_H + +#include <katapultaction.h> + +class KatapultItem; +class QPixmap; +class QString; + +/** +@author Joe Ferris +*/ +class ActionOpenBookmark : public KatapultAction +{ + +public: + virtual QPixmap icon(int) const; + virtual QString text() const; + virtual void execute(const KatapultItem *) const; + virtual bool accepts(const KatapultItem *) const; + +}; + +#endif diff --git a/katapult/plugins/catalogs/bookmarkcatalog/bookmark.cpp b/katapult/plugins/catalogs/bookmarkcatalog/bookmark.cpp new file mode 100644 index 0000000..e5d65db --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/bookmark.cpp @@ -0,0 +1,48 @@ +/*************************************************************************** + * 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 <kbookmark.h> +#include <kglobal.h> +#include <kiconloader.h> + +#include "bookmark.h" + +Bookmark::Bookmark(KBookmark _bookmark) + : KatapultItem() +{ + this->_bookmark = _bookmark; +} + +QPixmap Bookmark::icon(int size) const +{ + return KGlobal::iconLoader()->loadIcon(_bookmark.icon(), KIcon::NoGroup, size); +} + +KBookmark Bookmark::bookmark() const +{ + return _bookmark; +} + +QString Bookmark::text() const +{ + return _bookmark.text(); +} + +#include "bookmark.moc" diff --git a/katapult/plugins/catalogs/bookmarkcatalog/bookmark.h b/katapult/plugins/catalogs/bookmarkcatalog/bookmark.h new file mode 100644 index 0000000..fba7fec --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/bookmark.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * 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 BOOKMARK_H +#define BOOKMARK_H + +#include <kbookmark.h> + +#include <katapultitem.h> + +/** +@author Joe Ferris +*/ +class Bookmark : public KatapultItem +{ + Q_OBJECT +public: + Bookmark(KBookmark); + + virtual QPixmap icon(int) const; + virtual QString text() const; + + KBookmark bookmark() const; + +private: + KBookmark _bookmark; + +}; + +#endif diff --git a/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.cpp b/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.cpp new file mode 100644 index 0000000..e70d65f --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.cpp @@ -0,0 +1,212 @@ +/*************************************************************************** + * 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 <kservicegroup.h> +#include <ksycocaentry.h> +#include <ksycocatype.h> +#include <kapplication.h> +#include <kbookmarkmanager.h> +#include <kbookmark.h> +#include <knuminput.h> +#include <kurlrequester.h> + +#include <qstring.h> +#include <qradiobutton.h> +#include <qbuttongroup.h> +#include <qdir.h> +#include <qregexp.h> +#include <qfile.h> + +#include "bookmarkcatalog.h" +#include "bookmark.h" +#include "mozillabookmark.h" +#include "settings.h" +#include "actionregistry.h" +#include "actionopenbookmark.h" + +K_EXPORT_COMPONENT_FACTORY( katapult_bookmarkcatalog, + KGenericFactory<BookmarkCatalog>( "katapult_bookmarkcatalog" ) ) + +BookmarkCatalog::BookmarkCatalog(QObject *, const char *, const QStringList&) + : CachedCatalog() +{ + manager = KBookmarkManager::userBookmarksManager(); + _minQueryLen = 1; + ActionRegistry::self()->registerAction(new ActionOpenBookmark()); +} + + +BookmarkCatalog::~BookmarkCatalog() +{ +} + +void BookmarkCatalog::initialize() +{ + if(manager != 0) + cacheBookmarkList(manager->root()); + if(_mozEnabled) + cacheMozillaBookmarks(); +} + +void BookmarkCatalog::cacheBookmarkList(KBookmarkGroup group) +{ + KBookmark bookmark = group.first(); + while(!bookmark.isNull()) { + if (bookmark.isGroup()) { + cacheBookmarkList(bookmark.toGroup()); + } else { + addItem(new Bookmark(bookmark)); + } + bookmark = group.next(bookmark); + } +} + +void BookmarkCatalog::cacheMozillaBookmarks() +{ + if(_mozAuto) + _mozFile = detectMozillaFile(); + + if(_mozFile.isEmpty()) + return; + + QFile bmFile(_mozFile); + if(!bmFile.open(IO_ReadOnly)) + return; + + QString contents = bmFile.readAll(); + QRegExp rx("<A HREF=\"([^\"]+)\" [^>]+>([^<]+)</A>"); + int pos = 0; + while(pos > -1) { + pos = rx.search(contents, pos); + if(pos > -1) { + addItem(new MozillaBookmark(rx.cap(1), rx.cap(2), QPixmap())); + pos += rx.matchedLength(); + } + } +} + +QString BookmarkCatalog::detectMozillaFile() +{ + QStringList testDirs; + testDirs << ".firefox" << ".mozilla" << ".phoenix" << ".netscape"; + QDir home = QDir::home(); + for(QStringList::Iterator it = testDirs.begin(); it != testDirs.end(); ++it) { + QString testDir = *it; + if(home.exists(testDir)) { + QDir mozDir = QDir(home.path()+"/"+testDir).canonicalPath(); + if(mozDir.dirName() != testDir && testDirs.contains(mozDir.dirName())) + continue; + QString path = searchMozDir(mozDir.path()); + if(!path.isEmpty()) + return path; + } + } + + return ""; +} + +QString BookmarkCatalog::searchMozDir(QString path) +{ + QDir dir(path); + if(dir.exists("bookmarks.html")) { + return path+"/bookmarks.html"; + } + QStringList entries = dir.entryList(QDir::Dirs | QDir::NoSymLinks); + for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { + if(*it != "." && *it != ".."){ + QString result = searchMozDir(path + "/" + *it); + if(!result.isEmpty()) + return result; + } + } + return QString::null; +} + +unsigned int BookmarkCatalog::minQueryLen() const +{ + return _minQueryLen; +} + +void BookmarkCatalog::readSettings(KConfigBase *config) +{ + _minQueryLen = config->readUnsignedNumEntry("MinQueryLen", 3); + _mozEnabled = config->readBoolEntry("MozEnabled", TRUE); + _mozAuto = config->readBoolEntry("MozAuto", TRUE); + _mozFile = config->readEntry("MozFile", ""); +} + +void BookmarkCatalog::writeSettings(KConfigBase *config) +{ + config->writeEntry("MinQueryLen", _minQueryLen); + config->writeEntry("MozEnabled", _mozEnabled); + config->writeEntry("MozAuto", _mozAuto); + config->writeEntry("MozFile", _mozFile); +} + +QWidget * BookmarkCatalog::configure() +{ + settings = new BookmarkCatalogSettings(); + + settings->minQueryLen->setValue(_minQueryLen); + connect(settings->minQueryLen, SIGNAL(valueChanged(int)), this, SLOT(minQueryLenChanged(int))); + + settings->mozEnabled->setChecked(_mozEnabled); + connect(settings->mozEnabled, SIGNAL(toggled(bool)), this, SLOT(toggleMozEnabled(bool))); + + settings->mozAuto->setChecked(_mozAuto); + connect(settings->mozAuto, SIGNAL(toggled(bool)), this, SLOT(toggleMozAuto(bool))); + + settings->mozManual->setChecked(!_mozAuto); + + settings->mozFile->setURL(_mozFile); + connect(settings->mozFile, SIGNAL(urlSelected(const QString &)), this, SLOT(changeMozFile(const QString &))); + + settings->mozAuto->setEnabled(_mozEnabled); + settings->mozManual->setEnabled(_mozEnabled); + settings->mozFile->setEnabled(_mozEnabled && !_mozAuto); + + return settings; +} + +void BookmarkCatalog::minQueryLenChanged(int _minQueryLen) +{ + this->_minQueryLen = _minQueryLen; +} + +void BookmarkCatalog::toggleMozEnabled(bool _mozEnabled) +{ + this->_mozEnabled = _mozEnabled; + settings->mozAuto->setEnabled(_mozEnabled); + settings->mozManual->setEnabled(_mozEnabled); + settings->mozFile->setEnabled(_mozEnabled && !_mozAuto); +} + +void BookmarkCatalog::toggleMozAuto(bool _mozAuto) +{ + this->_mozAuto = _mozAuto; + settings->mozFile->setEnabled(!_mozAuto); +} + +void BookmarkCatalog::changeMozFile(const QString & _mozFile) +{ + this->_mozFile = _mozFile; +} + +#include "bookmarkcatalog.moc" diff --git a/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.h b/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.h new file mode 100644 index 0000000..b0e5736 --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.h @@ -0,0 +1,71 @@ +/*************************************************************************** + * 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 PROGRAMCATALOG_H +#define PROGRAMCATALOG_H + +#include <kgenericfactory.h> + +#include <qptrlist.h> + +#include "cachedcatalog.h" + +class QWidget; +class QString; +class KBookmarkManager; +class KBookmarkGroup; +class BookmarkCatalogSettings; + +/** +@author Joe Ferris +*/ +class BookmarkCatalog : public CachedCatalog +{ + Q_OBJECT +public: + BookmarkCatalog(QObject *, const char *, const QStringList&); + virtual ~BookmarkCatalog(); + + virtual void initialize(); + virtual void readSettings(KConfigBase *); + virtual void writeSettings(KConfigBase *); + virtual unsigned int minQueryLen() const; + virtual QWidget * configure(); + +public slots: + void minQueryLenChanged(int); + void toggleMozEnabled(bool); + void toggleMozAuto(bool); + void changeMozFile(const QString &); + QString searchMozDir(QString); + +private: + void cacheBookmarkList(KBookmarkGroup); + void cacheMozillaBookmarks(); + QString detectMozillaFile(); + + KBookmarkManager *manager; + int _minQueryLen; + bool _mozEnabled; + bool _mozAuto; + QString _mozFile; + BookmarkCatalogSettings *settings; +}; + +#endif diff --git a/katapult/plugins/catalogs/bookmarkcatalog/katapult_bookmarkcatalog.desktop b/katapult/plugins/catalogs/bookmarkcatalog/katapult_bookmarkcatalog.desktop new file mode 100644 index 0000000..bea99f0 --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/katapult_bookmarkcatalog.desktop @@ -0,0 +1,44 @@ +[Desktop Entry] +Name=Bookmark Catalog +Name[ar]=مستغرض علامات المواقع ( Bookmark Catalog ) +Name[bg]=Каталог с отметки +Name[br]=Katalog sined +Name[da]=Katalogisér bogmærker +Name[de]=Lesezeichen-Katalog +Name[el]=Κατάλογος σελιδοδεικτών +Name[es]=Catálogo de marcadores +Name[et]=Järjehoidjakataloog +Name[fr]=Catalogue de signets +Name[ga]=Catalóg Leabharmharcanna +Name[gl]=Catálogo de Favoritos +Name[it]=Catologo segnalibri +Name[ja]=ブックマークカタログ +Name[nb]=Bokmerke-katalog +Name[nl]=Bladwijzercatalogus +Name[pt]=Catálogo de Favoritos +Name[pt_BR]=Catálogo de Favoritos +Name[sv]=Katalogisera bokmärken +Name[tr]=Yer imi Kataloğu +Name[uk]=Каталог закладок +Comment=Catalogs your KDE bookmarks for easy launching through Katapult +Comment[ar]=يستعرض علامات مواقعك كي دي أي ( KDE ) كي تستطيع اقلاعها عن طريق Katapult +Comment[bg]=Каталогизира с Katapult отметките на KDE за лесно стартиране +Comment[da]=Katalogiserer dine KDE-bogmærker for nem start via Katapult +Comment[de]=Katalogisiert Ihre KDE-Lesezeichen, um sie bequem mit Katapult aufzurufen +Comment[el]=Δημιουργεί κατάλογο με τους σελιδοδείκτες σας του KDE για την εύκολη εκτέλεσή τους μέσω του Katapult +Comment[es]=Cataloga sus marcadores de KDE para iniciarlos con facilidad a través de Katapult +Comment[et]=Kataloogib sinu KDE järjehoidjad hõlpsaks käivitamiseks Katapultiga +Comment[fr]=Cataloguer vos signets KDE pour un lancement facile via Katapult +Comment[gl]=Cataloga os seus favoritos de KDE para seren iniciados mediante Katapult +Comment[it]=Cataloga i tuoi segnalibri di KDE per aprirli facilmente attraverso Katapult +Comment[ja]=Katapult から簡単に開けるように KDE のブックマークをカタログ化 +Comment[nb]=Katalogiserer KDE-bokmerkene for lettvint oppstart med Katapult +Comment[nl]=Catalogiseert uw KDE-bladwijzers voor eenvoudige opstart via Katapult +Comment[pt]=Cataloga os seus favoritos do KDE para lançá-los facilmente através do Katapult +Comment[pt_BR]=Cataloga os seus favoritos do KDE para lançá-los facilmente através do Katapult +Comment[sv]=Katalogiserar dina KDE-bokmärken för enkel start via Katapult +Comment[uk]=Робить каталог закладок KDE для легкого запуску через Катапульту +ServiceTypes=Katapult/Catalog +Type=Service +X-KDE-Library=katapult_bookmarkcatalog +X-Katapult-ID=Bookmark Catalog diff --git a/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.cpp b/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.cpp new file mode 100644 index 0000000..eb55751 --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.cpp @@ -0,0 +1,51 @@ +/*************************************************************************** + * 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 <kiconloader.h> +#include <kglobal.h> + +#include <qpixmap.h> + +#include "mozillabookmark.h" + +MozillaBookmark::MozillaBookmark(QString _url, QString _title, QPixmap _icon) + : KatapultItem() +{ + this->_url = _url; + this->_icon = _icon; + this->_title = _title; +} + +QPixmap MozillaBookmark::icon(int size) const +{ + return KGlobal::iconLoader()->loadIcon("bookmark", KIcon::NoGroup, size); +} + +QString MozillaBookmark::url() const +{ + return _url; +} + +QString MozillaBookmark::text() const +{ + return _title; +} + +#include "mozillabookmark.moc" diff --git a/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.h b/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.h new file mode 100644 index 0000000..f1e25fb --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * 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 MOZILLABOOKMARK_H +#define MOZILLABOOKMARK_H + +#include <qpixmap.h> + +#include "katapultitem.h" + +/** +@author Joe Ferris +*/ +class MozillaBookmark : public KatapultItem +{ + Q_OBJECT +public: + MozillaBookmark(QString, QString, QPixmap); + + virtual QPixmap icon(int) const; + virtual QString text() const; + + QString url() const; + +private: + QString _url, _title; + QPixmap _icon; +}; + +#endif diff --git a/katapult/plugins/catalogs/bookmarkcatalog/settings.ui b/katapult/plugins/catalogs/bookmarkcatalog/settings.ui new file mode 100644 index 0000000..7a8121d --- /dev/null +++ b/katapult/plugins/catalogs/bookmarkcatalog/settings.ui @@ -0,0 +1,117 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<class>BookmarkCatalogSettings</class> +<widget class="QWidget"> + <property name="name"> + <cstring>BookmarkCatalogSettings</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>401</width> + <height>280</height> + </rect> + </property> + <property name="caption"> + <string>Settings</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <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="QButtonGroup"> + <property name="name"> + <cstring>mozEnabled</cstring> + </property> + <property name="title"> + <string>Import Mozilla bookmarks</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QRadioButton"> + <property name="name"> + <cstring>mozAuto</cstring> + </property> + <property name="text"> + <string>Automatically detect bookmark file</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>mozManual</cstring> + </property> + <property name="text"> + <string>Use the following file:</string> + </property> + </widget> + <widget class="KURLRequester"> + <property name="name"> + <cstring>mozFile</cstring> + </property> + </widget> + </vbox> + </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>100</height> + </size> + </property> + </spacer> + </vbox> +</widget> +<layoutdefaults spacing="6" margin="11"/> +<includehints> + <includehint>knuminput.h</includehint> + <includehint>kurlrequester.h</includehint> + <includehint>klineedit.h</includehint> + <includehint>kpushbutton.h</includehint> +</includehints> +</UI> |