diff options
Diffstat (limited to 'konqueror/sidebar')
86 files changed, 11257 insertions, 0 deletions
diff --git a/konqueror/sidebar/.version b/konqueror/sidebar/.version new file mode 100644 index 000000000..9cb17c334 --- /dev/null +++ b/konqueror/sidebar/.version @@ -0,0 +1 @@ +Version=3 diff --git a/konqueror/sidebar/Makefile.am b/konqueror/sidebar/Makefile.am new file mode 100644 index 000000000..702320841 --- /dev/null +++ b/konqueror/sidebar/Makefile.am @@ -0,0 +1,44 @@ +# this has all of the subdirectories that make will recurse into. if +# there are none, comment this out +#SUBDIRS = . sidebar_classic trees + +#SUBDIRS = . +SUBDIRS = . trees web_module + +# set the include path for X, qt and KDE +INCLUDES = -I$(top_srcdir)/libkonq -I$(top_srcdir)/kate/lib $(all_includes) + +# these are the headers for your project +noinst_HEADERS = konqsidebar.h sidebar_widget.h konqsidebariface_p.h + +include_HEADERS = konqsidebarplugin.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +lib_LTLIBRARIES = libkonqsidebarplugin.la +kde_module_LTLIBRARIES = konq_sidebar.la + +# the Part's source, library search path, and link libraries +konq_sidebar_la_SOURCES = konqsidebar.cpp sidebar_widget.cpp +konq_sidebar_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) +konq_sidebar_la_LIBADD = $(LIB_KPARTS) $(LIB_KIO) ../../libkonq/libkonq.la ./libkonqsidebarplugin.la $(LIB_KUTILS) + +libkonqsidebarplugin_la_SOURCES=konqsidebarplugin.cpp +libkonqsidebarplugin_la_LDFLAGS = -version-info 3:0:2 $(all_libraries) -no-undefined +libkonqsidebarplugin_la_LIBADD = $(LIB_KPARTS) + +# this is where the desktop file will go +partdesktopdir = $(kde_servicesdir) +partdesktop_DATA = konq_sidebartng.desktop + +# this is where the part's XML-GUI resource file goes +partrcdir = $(kde_confdir) +partrc_DATA = konqsidebartng.rc + +versiondir = $(kde_datadir)/konqsidebartng/entries/ +version_DATA=.version + +updatedir = $(kde_datadir)/kconf_update +update_DATA = konqsidebartng.upd +update_SCRIPTS = move_konqsidebartng_entries.sh diff --git a/konqueror/sidebar/konq_sidebartng.desktop b/konqueror/sidebar/konq_sidebartng.desktop new file mode 100644 index 000000000..b5842da7f --- /dev/null +++ b/konqueror/sidebar/konq_sidebartng.desktop @@ -0,0 +1,93 @@ +[Desktop Entry] +Type=Service +Icon=view_sidetree +Name=Navigation Panel +Name[af]=Navigasie Paneel +Name[ar]=لوحة الملاحة +Name[az]=Naviqasiya Paneli +Name[be]=Панэль навігацыі +Name[bg]=Навигационен панел +Name[bn]=ভ্রমণ প্যানেল +Name[br]=Panell furchal +Name[bs]=Panel za navigaciju +Name[ca]=Plafó de navegació +Name[cs]=Navigační panel +Name[csb]=Nawigacëjny panel +Name[cy]=Panel Llywio +Name[da]=Navigationspanel +Name[de]=Navigationsbereich +Name[el]=Πλαίσιο πλοήγησης +Name[eo]=Navigila panelo +Name[es]=Panel de navegación +Name[et]=Liikumise paneel +Name[eu]=Arakaketa panela +Name[fa]=تابلوی ناوش +Name[fi]=Navigointipaneeli +Name[fr]=Panneau de navigation +Name[fy]=Navigaasjepaniel +Name[ga]=Painéal Loingseoireachta +Name[gl]=Painel de Navegación +Name[he]=לוח ניווט +Name[hi]=नेविगेशन फलक +Name[hr]=Navigacijska ploča +Name[hu]=Navigációs panel +Name[is]=Leiðarstýrispjald +Name[it]=Pannello di navigazione +Name[ja]=ナビゲーションパネル +Name[ka]=სანავიგაციო პანელი +Name[kk]=Шарлау панелі +Name[km]=បន្ទះការរុករក +Name[ko]=탐색 패널 +Name[lo]=ຖາດນຳທາງ +Name[lt]=Navigacijos pultas +Name[lv]=Navigācijas Panelis +Name[mk]=Навигациски панел +Name[mn]=Жолоодлогын самбар +Name[ms]=Panel Navigasi +Name[mt]=Pannell ta' navigazzjoni +Name[nb]=Navigasjonspanel +Name[nds]=Navigatschoonspaneel +Name[ne]=नेभिगेसन प्यानल +Name[nl]=Navigatiepaneel +Name[nn]=Navigasjonspanel +Name[nso]=Panel ya Navigation +Name[pa]=ਏਧਰ-ਓਧਰ ਪੈਨਲ +Name[pl]=Panel nawigacyjny +Name[pt]=Painel de Navegação +Name[pt_BR]=Painel de Navegação +Name[ro]=Panou de navigare +Name[ru]=Панель навигации +Name[rw]=Umwanya w'Ibuganya +Name[se]=Navigašuvdnapanela +Name[sk]=Navigačný panel +Name[sl]=Navigacijski pult +Name[sr]=Навигациони панел +Name[sr@Latn]=Navigacioni panel +Name[sv]=Navigeringspanel +Name[ta]=நாவிகேஷன் பலகம் +Name[tg]=Сафҳаи контроли ҷустуҷӯ +Name[th]=ถาดนำทาง +Name[tr]=Dolaşma Paneli +Name[tt]=Küçü Qoraltiräse +Name[uk]=Панель навігації +Name[uz]=Yoʻlchi paneli +Name[uz@cyrillic]=Йўлчи панели +Name[ven]=Phanele ya Navigation +Name[vi]=Bảng điều khiển Duyệt +Name[wa]=Panea d' naiviaedje +Name[xh]=Iqela lenjongo Yolawulo +Name[zh_CN]=导航面板 +Name[zh_TW]=導覽面板 +Name[zu]=Iwindi lemininingwane Lokuzula +MimeType=inode/directory +ServiceTypes=KParts/ReadOnlyPart,Browser/View +X-KDE-Library=konq_sidebar +X-KDE-BrowserView-AllowAsDefault=false +X-KDE-BrowserView-HideFromMenus=true +X-KDE-BrowserView-PassiveMode=true +X-KDE-BrowserView-Toggable=true +X-KDE-BrowserView-ToggableView-Orientation=vertical +X-KDE-BrowserView-HierarchicalView=true +X-KDE-BrowserView-FollowActive=true +X-KDE-BrowserView-LinkedView=false +X-KDE-BrowserView-Built-Into=konqueror diff --git a/konqueror/sidebar/konqsidebar.cpp b/konqueror/sidebar/konqsidebar.cpp new file mode 100644 index 000000000..ae2880b13 --- /dev/null +++ b/konqueror/sidebar/konqsidebar.cpp @@ -0,0 +1,127 @@ +/*************************************************************************** + konqsidebar.cpp + ------------------- + begin : Sat June 2 16:25:27 CEST 2001 + copyright : (C) 2001 Joseph Wenninger + email : jowenn@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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "konqsidebar.h" +#include "konqsidebariface_p.h" + +#include <konq_events.h> +#include <kdebug.h> +#include <qapplication.h> +#include <kaccelmanager.h> + +KonqSidebar::KonqSidebar( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, bool universalMode ) +: KParts::ReadOnlyPart(parent, name),KonqSidebarIface() +{ + // we need an instance + setInstance( KonqSidebarFactory::instance() ); + m_extension = 0; + // this should be your custom internal widget + m_widget = new Sidebar_Widget( parentWidget, this, widgetName ,universalMode, parentWidget->topLevelWidget()->property("currentProfile").toString() ); + m_extension = new KonqSidebarBrowserExtension( this, m_widget,"KonqSidebar::BrowserExtension" ); + connect(m_widget,SIGNAL(started(KIO::Job *)), + this, SIGNAL(started(KIO::Job*))); + connect(m_widget,SIGNAL(completed()),this,SIGNAL(completed())); + connect(m_extension, SIGNAL(addWebSideBar(const KURL&, const QString&)), + m_widget, SLOT(addWebSideBar(const KURL&, const QString&))); + KAcceleratorManager::setNoAccel(m_widget); + setWidget(m_widget); +} + +KInstance *KonqSidebar::getInstance() +{ + kdDebug() << "KonqSidebar::getInstance()" << endl; + return KonqSidebarFactory::instance(); +} + +KonqSidebar::~KonqSidebar() +{ +} + +bool KonqSidebar::openFile() +{ + return true; +} + +bool KonqSidebar::openURL(const KURL &url) { + if (m_widget) + return m_widget->openURL(url); + else return false; +} + +void KonqSidebar::customEvent(QCustomEvent* ev) +{ + if (KonqFileSelectionEvent::test(ev) || + KonqFileMouseOverEvent::test(ev) || + KonqConfigEvent::test(ev)) + { + // Forward the event to the widget + QApplication::sendEvent( m_widget, ev ); + } +} + + + +// It's usually safe to leave the factory code alone.. with the +// notable exception of the KAboutData data +#include <kaboutdata.h> +#include <klocale.h> +#include <kinstance.h> + +KInstance* KonqSidebarFactory::s_instance = 0L; +KAboutData* KonqSidebarFactory::s_about = 0L; + +KonqSidebarFactory::KonqSidebarFactory() + : KParts::Factory() +{ +} + +KonqSidebarFactory::~KonqSidebarFactory() +{ + delete s_instance; + s_instance = 0L; + delete s_about; + s_about = 0L; +} + +KParts::Part* KonqSidebarFactory::createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char * /*classname*/, const QStringList &args ) +{ + // Create an instance of our Part + KonqSidebar* obj = new KonqSidebar( parentWidget, widgetName, parent, name, args.contains("universal") ); + + // See if we are to be read-write or not +// if (QCString(classname) == "KParts::ReadOnlyPart") + // obj->setReadWrite(false); + + return obj; +} + +KInstance* KonqSidebarFactory::instance() +{ + if( !s_instance ) + { + s_about = new KAboutData("konqsidebartng", I18N_NOOP("Extended Sidebar"), "0.1"); + s_about->addAuthor("Joseph WENNINGER", 0, "jowenn@bigfoot.com"); + s_instance = new KInstance(s_about); + } + return s_instance; +} + +K_EXPORT_COMPONENT_FACTORY( konq_sidebar, KonqSidebarFactory ) + +#include "konqsidebar.moc" diff --git a/konqueror/sidebar/konqsidebar.h b/konqueror/sidebar/konqsidebar.h new file mode 100644 index 000000000..32a5f5679 --- /dev/null +++ b/konqueror/sidebar/konqsidebar.h @@ -0,0 +1,126 @@ +/*************************************************************************** + konqsidebar.h + ------------------- + begin : Sat June 2 16:25:27 CEST 2001 + copyright : (C) 2001 Joseph Wenninger + email : jowenn@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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef KONQSIDEBARPART_H +#define KONQSIDEBARPART_H + +#include <kparts/part.h> +#include <kparts/factory.h> +#include <kparts/event.h> +#include <kparts/browserextension.h> +#include <qguardedptr.h> +#include "sidebar_widget.h" +#include "konqsidebariface_p.h" + +class QWidget; +class QPainter; +class QCustomEvent; +class KURL; + + +class KonqSidebar; +class KonqSidebarFactory; + +class KonqSidebarBrowserExtension : public KParts::BrowserExtension +{ + Q_OBJECT + public: + KonqSidebarBrowserExtension(KonqSidebar *part_,Sidebar_Widget *widget_,const char *name): + KParts::BrowserExtension((KParts::ReadOnlyPart*)part_,name),widget(widget_){;} + ~KonqSidebarBrowserExtension(){;} + + protected: + QGuardedPtr<Sidebar_Widget> widget; + + +// The following slots are needed for konqueror's standard actions + protected slots: + void copy(){if (widget) widget->stdAction("copy()");} + void cut(){if (widget) widget->stdAction("cut()");} + void paste(){if (widget) widget->stdAction("paste()");} + void pasteTo(const KURL&){if (widget) widget->stdAction("paste()");} + void trash(){if (widget) widget->stdAction("trash()");} + void del(){if (widget) widget->stdAction("del()");} + void rename(){if (widget) widget->stdAction("rename()");} + void properties() {if (widget) widget->stdAction("properties()");} + void editMimeType() {if (widget) widget->stdAction("editMimeType()");} + // @li @p print : Print :-) not supported + void reparseConfiguration() {if (widget) widget->stdAction("reparseConfiguration()");} + void refreshMimeTypes () { if (widget) widget->stdAction("refreshMimeTypes()");} +}; + +/** + * This is a "Part". It that does all the real work in a KPart + * application. + * + * @short Main Part + * @author Joseph WENNINGER <jowenn@bigfoot.com> + * @version 0.1 + */ +class KonqSidebar : public KParts::ReadOnlyPart, public KonqSidebarIface +{ + Q_OBJECT +public: + /** + * Default constructor + */ + KonqSidebar(QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name,bool universalMode); + + /** + * Destructor + */ + virtual ~KonqSidebar(); + + virtual bool openURL(const KURL &url); + KonqSidebarBrowserExtension* extension() const + { return m_extension; } + KInstance *getInstance(); + virtual bool universalMode() {return m_universalMode;} +protected: + /** + * This must be implemented by each part + */ + KonqSidebarBrowserExtension * m_extension; + virtual bool openFile(); + + virtual void customEvent(QCustomEvent* ev); + +private: + class Sidebar_Widget *m_widget; + bool m_universalMode; +}; + +class KInstance; +class KAboutData; + +class KonqSidebarFactory : public KParts::Factory +{ + Q_OBJECT +public: + KonqSidebarFactory(); + virtual ~KonqSidebarFactory(); + virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args ); + static KInstance* instance(); + +private: + static KInstance* s_instance; + static KAboutData* s_about; +}; + +#endif // KPARTAPPPART_H diff --git a/konqueror/sidebar/konqsidebariface_p.h b/konqueror/sidebar/konqsidebariface_p.h new file mode 100644 index 000000000..2a693d004 --- /dev/null +++ b/konqueror/sidebar/konqsidebariface_p.h @@ -0,0 +1,9 @@ +#ifndef _KONQSIDEBARIFACE_H_ +#define _KONQSIDEBARIFACE_H_ +class KonqSidebarIface { +public: + KonqSidebarIface(){} + virtual ~KonqSidebarIface(){} + virtual bool universalMode()=0; +}; +#endif diff --git a/konqueror/sidebar/konqsidebarplugin.cpp b/konqueror/sidebar/konqsidebarplugin.cpp new file mode 100644 index 000000000..b2b7d9f17 --- /dev/null +++ b/konqueror/sidebar/konqsidebarplugin.cpp @@ -0,0 +1,59 @@ +/* This file is part of the KDE project + Copyright (C) 2001,2002 Joseph Wenninger <jowenn@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "konqsidebarplugin.moc" +#include "konqsidebariface_p.h" +#include <kdebug.h> + + +KonqSidebarPlugin::KonqSidebarPlugin(KInstance *instance,QObject *parent, + QWidget * /*widgetParent*/, QString &desktopName_, const char* name) + : QObject(parent,name), desktopName(desktopName_) +{ + m_parentInstance=instance; +} + +KonqSidebarPlugin::~KonqSidebarPlugin() { } + +KInstance *KonqSidebarPlugin::parentInstance(){return m_parentInstance;} + +void KonqSidebarPlugin::openURL(const KURL& url){handleURL(url);} + +void KonqSidebarPlugin::openPreview(const KFileItemList& items) +{ + handlePreview(items); +} + +void KonqSidebarPlugin::openPreviewOnMouseOver(const KFileItem& item) +{ + handlePreviewOnMouseOver(item); +} + +void KonqSidebarPlugin::handlePreview(const KFileItemList & /*items*/) {} + +void KonqSidebarPlugin::handlePreviewOnMouseOver(const KFileItem& /*items*/) {} + + +bool KonqSidebarPlugin::universalMode() { + if (!parent()) return false; + KonqSidebarIface *ksi=static_cast<KonqSidebarIface*>(parent()->qt_cast("KonqSidebarIface")); + if (!ksi) return false; + kdDebug()<<"calling KonqSidebarIface->universalMode()"<<endl; + return ksi->universalMode(); +} diff --git a/konqueror/sidebar/konqsidebarplugin.h b/konqueror/sidebar/konqsidebarplugin.h new file mode 100644 index 000000000..ad931070f --- /dev/null +++ b/konqueror/sidebar/konqsidebarplugin.h @@ -0,0 +1,97 @@ +/* This file is part of the KDE project + Copyright (C) 2001,2002 Joseph Wenninger <jowenn@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef _konqsidebarplugin_h_ +#define _konqsidebarplugin_h_ +#include <qwidget.h> +#include <qobject.h> +#include <kurl.h> +#include <qstring.h> +#include <kparts/part.h> +#include <kparts/browserextension.h> +#include <kio/job.h> +#include <qguardedptr.h> +#include <kfileitem.h> + +class KonqSidebarPluginPrivate; + +class KDE_EXPORT KonqSidebarPlugin : public QObject +{ + Q_OBJECT + public: + KonqSidebarPlugin(KInstance *instance,QObject *parent,QWidget *widgetParent,QString &desktopName_, const char* name=0); + ~KonqSidebarPlugin(); + virtual QWidget *getWidget()=0; + virtual void *provides(const QString &)=0; + KInstance *parentInstance(); + protected: + virtual void handleURL(const KURL &url)=0; + virtual void handlePreview(const KFileItemList & items); + virtual void handlePreviewOnMouseOver(const KFileItem &items); //not used yet, perhaps in KDE 3.1 + QString desktopName; + KInstance* m_parentInstance; + + private: + KonqSidebarPluginPrivate *d; + + signals: + void requestURL(KURL&); + void started(KIO::Job *); + void completed(); + void setIcon(const QString& icon); + void setCaption(const QString& caption); + + + protected: + bool universalMode(); + public slots: + void openURL(const KURL& url); + + void openPreview(const KFileItemList& items); + + void openPreviewOnMouseOver(const KFileItem& item); // not used yet, perhaps KDE 3.1 + /* + if your plugin supports a setup dialog, instead (replaces the url menu entry in the popup) (not supported yet) + void setup(QWidget *parent); + + */ + + + /* signals, which could be, but need not to be added + + void openURLRequest( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); + void createNewWindow( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); + + void enableAction( const char * name, bool enabled ); + + void popupMenu( const QPoint &global, const KFileItemList &items ); + void popupMenu( KXMLGUIClient *client, const QPoint &global, const KFileItemList &items ); + void popupMenu( const QPoint &global, const KURL &url, + const QString &mimeType, mode_t mode = (mode_t)-1 ); + void popupMenu( KXMLGUIClient *client, + const QPoint &global, const KURL &url, + const QString &mimeType, mode_t mode = (mode_t)-1 ); + + void showError(QString &); //for later extension + void showMessage(QString &); //for later extension + + */ + +}; + +#endif diff --git a/konqueror/sidebar/konqsidebartng.rc b/konqueror/sidebar/konqsidebartng.rc new file mode 100644 index 000000000..2d1ebb484 --- /dev/null +++ b/konqueror/sidebar/konqsidebartng.rc @@ -0,0 +1,7 @@ +[filemanagement] +OpenViews=home.desktop +SingleWidgetMode=true + +[webbrowsing] +OpenViews=bookmarks.desktop +SingleWidgetMode=true diff --git a/konqueror/sidebar/konqsidebartng.upd b/konqueror/sidebar/konqsidebartng.upd new file mode 100644 index 000000000..f71b688d8 --- /dev/null +++ b/konqueror/sidebar/konqsidebartng.upd @@ -0,0 +1,12 @@ +Id=konqsidebartng_rc +File=konqsidebartng.rc +Group=<default>,webbrowsing +Options=Copy +AllKeys +Group=<default>,filemanagement +Options=Copy +AllKeys +RemoveGroup=<default> + +Id=konqsidebartng_entries +Script=move_konqsidebartng_entries.sh,sh diff --git a/konqueror/sidebar/move_konqsidebartng_entries.sh b/konqueror/sidebar/move_konqsidebartng_entries.sh new file mode 100644 index 000000000..83de07bf3 --- /dev/null +++ b/konqueror/sidebar/move_konqsidebartng_entries.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +prefix=$(kde-config --localprefix) +source="$prefix/share/apps/konqsidebartng" + +[ -d "$source/entries" ] || exit 0 + +profiles="filemanagement webbrowsing" +for profile in $profiles; do + dest="$source/$profile/entries" + if [ ! -d "$dest" ]; then + mkdir -p "$dest" || exit 1 + cp $source/entries/.version $dest/ + cp $source/entries/* $dest/ + fi +done + +rm -rf $source/entries diff --git a/konqueror/sidebar/sidebar_widget.cpp b/konqueror/sidebar/sidebar_widget.cpp new file mode 100644 index 000000000..3b402b25e --- /dev/null +++ b/konqueror/sidebar/sidebar_widget.cpp @@ -0,0 +1,1310 @@ +/*************************************************************************** + sidebar_widget.cpp + ------------------- + begin : Sat June 2 16:25:27 CEST 2001 + copyright : (C) 2001 Joseph Wenninger + email : jowenn@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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include <config.h> + +#include <limits.h> + +#include <qdir.h> +#include <qpopupmenu.h> +#include <qhbox.h> +#include <qpushbutton.h> +#include <qwhatsthis.h> +#include <qlayout.h> +#include <qstringlist.h> + +#include <klocale.h> +#include <ksimpleconfig.h> +#include <kstandarddirs.h> +#include <kdebug.h> +#include <kiconloader.h> +#include <kicondialog.h> +#include <kmessagebox.h> +#include <kinputdialog.h> +#include <konq_events.h> +#include <kfileitem.h> +#include <kio/netaccess.h> +#include <kpopupmenu.h> +#include <kprocess.h> +#include <kurlrequesterdlg.h> +#include <kinputdialog.h> +#include <kfiledialog.h> +#include <kdesktopfile.h> +#include "konqsidebar.h" + +#include "sidebar_widget.h" +#include "sidebar_widget.moc" + + +addBackEnd::addBackEnd(QWidget *parent, class QPopupMenu *addmenu, + bool universal, const QString ¤tProfile, + const char *name) + : QObject(parent,name), + m_parent(parent) +{ + m_universal=universal; + m_currentProfile = currentProfile; + menu = addmenu; + connect(menu,SIGNAL(aboutToShow()),this,SLOT(aboutToShowAddMenu())); + connect(menu,SIGNAL(activated(int)),this,SLOT(activatedAddMenu(int))); +} + +void addBackEnd::aboutToShowAddMenu() +{ + if (!menu) + return; + KStandardDirs *dirs = KGlobal::dirs(); + QStringList list = dirs->findAllResources("data","konqsidebartng/add/*.desktop",true,true); + libNames.setAutoDelete(true); + libNames.resize(0); + libParam.setAutoDelete(true); + libParam.resize(0); + menu->clear(); + int i = 0; + + for (QStringList::Iterator it = list.begin(); it != list.end(); ++it, i++ ) + { + KDesktopFile *confFile; + + confFile = new KDesktopFile(*it, true); + if (! confFile->tryExec()) { + delete confFile; + i--; + continue; + } + if (m_universal) { + if (confFile->readEntry("X-KDE-KonqSidebarUniversal").upper()!="TRUE") { + delete confFile; + i--; + continue; + } + } else { + if (confFile->readEntry("X-KDE-KonqSidebarBrowser").upper()=="FALSE") { + delete confFile; + i--; + continue; + } + } + QString icon = confFile->readIcon(); + if (!icon.isEmpty()) + { + menu->insertItem(SmallIcon(icon), + confFile->readEntry("Name"), i); + } else { + menu->insertItem(confFile->readEntry("Name"), i); + } + libNames.resize(libNames.size()+1); + libNames.insert(libNames.count(), new QString(confFile->readEntry("X-KDE-KonqSidebarAddModule"))); + libParam.resize(libParam.size()+1); + libParam.insert(libParam.count(), new QString(confFile->readEntry("X-KDE-KonqSidebarAddParam"))); + delete confFile; + } + menu->insertSeparator(); + menu->insertItem(i18n("Rollback to System Default"), i); +} + + +void addBackEnd::doRollBack() +{ + if (KMessageBox::warningContinueCancel(m_parent, i18n("<qt>This removes all your entries from the sidebar and adds the system default ones.<BR><B>This procedure is irreversible</B><BR>Do you want to proceed?</qt>"))==KMessageBox::Continue) + { + KStandardDirs *dirs = KGlobal::dirs(); + QString loc=dirs->saveLocation("data","konqsidebartng/" + m_currentProfile + "/",true); + QDir dir(loc); + QStringList dirEntries = dir.entryList( QDir::Dirs | QDir::NoSymLinks ); + dirEntries.remove("."); + dirEntries.remove(".."); + for ( QStringList::Iterator it = dirEntries.begin(); it != dirEntries.end(); ++it ) { + if ((*it)!="add") + KIO::NetAccess::del(KURL( loc+(*it) ), m_parent); + } + emit initialCopyNeeded(); + } +} + + +static QString findFileName(const QString* tmpl,bool universal, const QString &profile) { + QString myFile, filename; + KStandardDirs *dirs = KGlobal::dirs(); + QString tmp = *tmpl; + + if (universal) { + dirs->saveLocation("data", "konqsidebartng/kicker_entries/", true); + tmp.prepend("/konqsidebartng/kicker_entries/"); + } else { + dirs->saveLocation("data", "konqsidebartng/" + profile + "/entries/", true); + tmp.prepend("/konqsidebartng/" + profile + "/entries/"); + } + filename = tmp.arg(""); + myFile = locateLocal("data", filename); + + if (QFile::exists(myFile)) { + for (ulong l = 0; l < ULONG_MAX; l++) { + filename = tmp.arg(l); + myFile = locateLocal("data", filename); + if (!QFile::exists(myFile)) { + break; + } else { + myFile = QString::null; + } + } + } + + return myFile; +} + +void addBackEnd::activatedAddMenu(int id) +{ + kdDebug() << "activatedAddMenu: " << QString("%1").arg(id) << endl; + if (((uint)id) == libNames.size()) + doRollBack(); + if(((uint)id) >= libNames.size()) + return; + + KLibLoader *loader = KLibLoader::self(); + + // try to load the library + QString libname = *libNames.at(id); + KLibrary *lib = loader->library(QFile::encodeName(libname)); + if (lib) + { + // get the create_ function + QString factory("add_"); + factory = factory+(*libNames.at(id)); + void *add = lib->symbol(QFile::encodeName(factory)); + + if (add) + { + //call the add function + bool (*func)(QString*, QString*, QMap<QString,QString> *); + QMap<QString,QString> map; + func = (bool (*)(QString*, QString*, QMap<QString,QString> *)) add; + QString *tmp = new QString(""); + if (func(tmp,libParam.at(id),&map)) + { + QString myFile = findFileName(tmp,m_universal,m_currentProfile); + + if (!myFile.isEmpty()) + { + kdDebug() <<"trying to save to file: "<<myFile << endl; + KSimpleConfig scf(myFile,false); + scf.setGroup("Desktop Entry"); + for (QMap<QString,QString>::ConstIterator it = map.begin(); it != map.end(); ++it) { + kdDebug() <<"writing:"<<it.key()<<" / "<<it.data()<<endl; + scf.writePathEntry(it.key(), it.data()); + } + scf.sync(); + emit updateNeeded(); + + } else { + kdWarning() << "No unique filename found" << endl; + } + } else { + kdWarning() << "No new entry (error?)" << endl; + } + delete tmp; + } + } else { + kdWarning() << "libname:" << libNames.at(id) + << " doesn't specify a library!" << endl; + } +} + + +/**************************************************************/ +/* Sidebar_Widget */ +/**************************************************************/ + +Sidebar_Widget::Sidebar_Widget(QWidget *parent, KParts::ReadOnlyPart *par, const char *name,bool universalMode, const QString ¤tProfile) + :QWidget(parent,name),m_universalMode(universalMode),m_partParent(par),m_currentProfile(currentProfile) +{ + m_somethingVisible = false; + m_initial = true; + m_noUpdate = false; + m_layout = 0; + m_currentButton = 0; + m_activeModule = 0; + m_userMovedSplitter = false; + //kdDebug() << "**** Sidebar_Widget:SidebarWidget()"<<endl; + if (universalMode) + { + m_relPath = "konqsidebartng/kicker_entries/"; + } + else + { + m_relPath = "konqsidebartng/" + currentProfile + "/entries/"; + } + m_path = KGlobal::dirs()->saveLocation("data", m_relPath, true); + m_buttons.setAutoDelete(true); + m_hasStoredUrl = false; + m_latestViewed = -1; + setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + + QSplitter *splitterWidget = splitter(); + if (splitterWidget) { + splitterWidget->setResizeMode(parent, QSplitter::FollowSizeHint); + splitterWidget->setOpaqueResize( false ); + connect(splitterWidget,SIGNAL(setRubberbandCalled()),SLOT(userMovedSplitter())); + } + + m_area = new KDockArea(this); + m_area->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + m_mainDockWidget = m_area->createDockWidget("free", 0); + m_mainDockWidget->setWidget(new QWidget(m_mainDockWidget)); + m_area->setMainDockWidget(m_mainDockWidget); + m_area->setMinimumWidth(0); + m_mainDockWidget->setDockSite(KDockWidget::DockTop); + m_mainDockWidget->setEnableDocking(KDockWidget::DockNone); + + m_buttonBar = new KMultiTabBar(KMultiTabBar::Vertical,this); + m_buttonBar->showActiveTabTexts(true); + + m_menu = new QPopupMenu(this, "Sidebar_Widget::Menu"); + QPopupMenu *addMenu = new QPopupMenu(this, "Sidebar_Widget::addPopup"); + m_menu->insertItem(i18n("Add New"), addMenu, 0); + m_menu->insertItem(i18n("Multiple Views"), 1); + m_menu->insertItem(i18n("Show Tabs Left"), 2); + m_menu->insertItem(i18n("Show Configuration Button"), 3); + if (!m_universalMode) { + m_menu->insertItem(SmallIconSet("remove"), + i18n("Close Navigation Panel"), + par, SLOT(deleteLater())); + } + connect(m_menu, SIGNAL(aboutToShow()), + this, SLOT(aboutToShowConfigMenu())); + connect(m_menu, SIGNAL(activated(int)), + this, SLOT(activatedMenu(int))); + + m_buttonPopup = 0; + addBackEnd *ab = new addBackEnd(this, addMenu, universalMode, + currentProfile, + "Sidebar_Widget-addBackEnd"); + + connect(ab, SIGNAL(updateNeeded()), + this, SLOT(updateButtons())); + connect(ab, SIGNAL(initialCopyNeeded()), + this, SLOT(finishRollBack())); + + initialCopy(); + + if (universalMode) + { + m_config = new KConfig("konqsidebartng_kicker.rc"); + } + else + { + m_config = new KConfig("konqsidebartng.rc"); + m_config->setGroup(currentProfile); + } + readConfig(); + + // Disable stuff (useful for Kiosk mode)! + m_menu->setItemVisible(1, !m_immutableSingleWidgetMode); + m_menu->setItemVisible(2, !m_immutableShowTabsLeft); + m_menu->setItemVisible(3, !m_immutableShowExtraButtons); + + connect(&m_configTimer, SIGNAL(timeout()), + this, SLOT(saveConfig())); + m_somethingVisible = !m_openViews.isEmpty(); + doLayout(); + QTimer::singleShot(0,this,SLOT(createButtons())); + connect(m_area, SIGNAL(dockWidgetHasUndocked(KDockWidget*)), + this, SLOT(dockWidgetHasUndocked(KDockWidget*))); +} + +void Sidebar_Widget::addWebSideBar(const KURL& url, const QString& /*name*/) { + //kdDebug() << "Web sidebar entry to be added: " << url.url() + // << " [" << name << "]" << endl; + + // Look for existing ones with this URL + KStandardDirs *dirs = KGlobal::dirs(); + QString list; + dirs->saveLocation("data", m_relPath, true); + list = locateLocal("data", m_relPath); + + // Go through list to see which ones exist. Check them for the URL + QStringList files = QDir(list).entryList("websidebarplugin*.desktop"); + for (QStringList::Iterator it = files.begin(); it != files.end(); ++it){ + KSimpleConfig scf(list + *it, false); + scf.setGroup("Desktop Entry"); + if (scf.readPathEntry("URL", QString::null) == url.url()) { + // We already have this one! + KMessageBox::information(this, + i18n("This entry already exists.")); + return; + } + } + + QString tmpl = "websidebarplugin%1.desktop"; + QString myFile = findFileName(&tmpl,m_universalMode,m_currentProfile); + + if (!myFile.isEmpty()) { + KSimpleConfig scf(myFile, false); + scf.setGroup("Desktop Entry"); + scf.writeEntry("Type", "Link"); + scf.writePathEntry("URL", url.url()); + scf.writeEntry("Icon", "netscape"); + scf.writeEntry("Name", i18n("Web SideBar Plugin")); + scf.writeEntry("Open", "true"); + scf.writeEntry("X-KDE-KonqSidebarModule", "konqsidebar_web"); + scf.sync(); + + QTimer::singleShot(0,this,SLOT(updateButtons())); + } +} + + +void Sidebar_Widget::finishRollBack() +{ + m_path = KGlobal::dirs()->saveLocation("data",m_relPath,true); + initialCopy(); + QTimer::singleShot(0,this,SLOT(updateButtons())); +} + + +void Sidebar_Widget::saveConfig() +{ + m_config->writeEntry("SingleWidgetMode",m_singleWidgetMode); + m_config->writeEntry("ShowExtraButtons",m_showExtraButtons); + m_config->writeEntry("ShowTabsLeft", m_showTabsLeft); + m_config->writeEntry("HideTabs", m_hideTabs); + m_config->writeEntry("SavedWidth",m_savedWidth); + m_config->sync(); +} + +void Sidebar_Widget::doLayout() +{ + if (m_layout) + delete m_layout; + + m_layout = new QHBoxLayout(this); + if (m_showTabsLeft) + { + m_layout->add(m_buttonBar); + m_layout->add(m_area); + m_buttonBar->setPosition(KMultiTabBar::Left); + } else { + m_layout->add(m_area); + m_layout->add(m_buttonBar); + m_buttonBar->setPosition(KMultiTabBar::Right); + } + m_layout->activate(); + if (m_hideTabs) m_buttonBar->hide(); + else m_buttonBar->show(); +} + + +void Sidebar_Widget::aboutToShowConfigMenu() +{ + m_menu->setItemChecked(1, !m_singleWidgetMode); + m_menu->setItemChecked(2, m_showTabsLeft); + m_menu->setItemChecked(3, m_showExtraButtons); +} + + +void Sidebar_Widget::initialCopy() +{ + kdDebug()<<"Initial copy"<<endl; + QStringList dirtree_dirs; + if (m_universalMode) + dirtree_dirs = KGlobal::dirs()->findDirs("data","konqsidebartng/kicker_entries/"); + else + dirtree_dirs = KGlobal::dirs()->findDirs("data","konqsidebartng/entries/"); + if (dirtree_dirs.last()==m_path) + return; //oups; + + int nVersion=-1; + KSimpleConfig lcfg(m_path+".version"); + int lVersion=lcfg.readNumEntry("Version",0); + + + for (QStringList::const_iterator ddit=dirtree_dirs.begin();ddit!=dirtree_dirs.end();++ddit) { + QString dirtree_dir=*ddit; + if (dirtree_dir == m_path) continue; + + + kdDebug()<<"************************************ retrieving directory info:"<<dirtree_dir<<endl; + + if ( !dirtree_dir.isEmpty() && dirtree_dir != m_path ) + { + KSimpleConfig gcfg(dirtree_dir+".version"); + int gversion = gcfg.readNumEntry("Version", 1); + nVersion=(nVersion>gversion)?nVersion:gversion; + if (lVersion >= gversion) + continue; + + QDir dir(m_path); + QStringList entries = dir.entryList( QDir::Files ); + QStringList dirEntries = dir.entryList( QDir::Dirs | QDir::NoSymLinks ); + dirEntries.remove( "." ); + dirEntries.remove( ".." ); + + QDir globalDir( dirtree_dir ); + Q_ASSERT( globalDir.isReadable() ); + // Only copy the entries that don't exist yet in the local dir + QStringList globalDirEntries = globalDir.entryList(); + QStringList::ConstIterator eIt = globalDirEntries.begin(); + QStringList::ConstIterator eEnd = globalDirEntries.end(); + for (; eIt != eEnd; ++eIt ) + { + //kdDebug(1201) << "KonqSidebarTree::scanDir dirtree_dir contains " << *eIt << endl; + if ( *eIt != "." && *eIt != ".." && + !entries.contains( *eIt ) && + !dirEntries.contains( *eIt ) ) + { // we don't have that one yet -> copy it. + QString cp("cp -R -- "); + cp += KProcess::quote(dirtree_dir + *eIt); + cp += " "; + cp += KProcess::quote(m_path); + kdDebug() << "SidebarWidget::intialCopy executing " << cp << endl; + ::system( QFile::encodeName(cp) ); + } + } + } + + lcfg.writeEntry("Version",(nVersion>lVersion)?nVersion:lVersion); + lcfg.sync(); + + } +} + +void Sidebar_Widget::buttonPopupActivate(int id) +{ + switch (id) + { + case 1: + { + KIconDialog kicd(this); +// kicd.setStrictIconSize(true); + QString iconname=kicd.selectIcon(KIcon::Small); + kdDebug()<<"New Icon Name:"<<iconname<<endl; + if (!iconname.isEmpty()) + { + KSimpleConfig ksc(m_path+m_currentButton->file); + ksc.setGroup("Desktop Entry"); + ksc.writeEntry("Icon",iconname); + ksc.sync(); + QTimer::singleShot(0,this,SLOT(updateButtons())); + } + break; + } + case 2: + { + KURLRequesterDlg * dlg = new KURLRequesterDlg( m_currentButton->URL, i18n("Enter a URL:"), this, "url_dlg" ); + dlg->fileDialog()->setMode( KFile::Directory ); + if (dlg->exec()) + { + KSimpleConfig ksc(m_path+m_currentButton->file); + ksc.setGroup("Desktop Entry"); + if ( !dlg->selectedURL().isValid()) + { + KMessageBox::error(this, i18n("<qt><b>%1</b> does not exist</qt>").arg(dlg->selectedURL().url())); + } + else + { + QString newurl= dlg->selectedURL().prettyURL(); + //If we are going to set the name by 'set name', we don't set it here. + //ksc.writeEntry("Name",newurl); + ksc.writePathEntry("URL",newurl); + ksc.sync(); + QTimer::singleShot(0,this,SLOT(updateButtons())); + } + } + delete dlg; + break; + } + case 3: + { + if (KMessageBox::warningContinueCancel(this,i18n("<qt>Do you really want to remove the <b>%1</b> tab?</qt>").arg(m_currentButton->displayName), + QString::null,KStdGuiItem::del())==KMessageBox::Continue) + { + QFile f(m_path+m_currentButton->file); + if (!f.remove()) + qDebug("Error, file not deleted"); + QTimer::singleShot(0,this,SLOT(updateButtons())); + } + break; + } + case 4: // Set a name for this sidebar tab + { + bool ok; + + // Pop up the dialog asking the user for name. + const QString name = KInputDialog::getText(i18n("Set Name"), i18n("Enter the name:"), + m_currentButton->displayName, &ok, this); + + if(ok) + { + // Write the name in the .desktop file of this side button. + KSimpleConfig ksc(m_path+m_currentButton->file); + ksc.setGroup("Desktop Entry"); + ksc.writeEntry("Name", name, true, false, true /*localized*/ ); + ksc.sync(); + + // Update the buttons with a QTimer (why?) + QTimer::singleShot(0,this,SLOT(updateButtons())); + } + break; + } + } +} + +void Sidebar_Widget::activatedMenu(int id) +{ + switch (id) + { + case 1: + { + m_singleWidgetMode = !m_singleWidgetMode; + if ((m_singleWidgetMode) && (m_visibleViews.count()>1)) + { + int tmpViewID=m_latestViewed; + for (uint i=0; i<m_buttons.count(); i++) { + ButtonInfo *button = m_buttons.at(i); + if ((int) i != tmpViewID) + { + if (button->dock && button->dock->isVisibleTo(this)) + showHidePage(i); + } else { + if (button->dock) + { + m_area->setMainDockWidget(button->dock); + m_mainDockWidget->undock(); + } + } + } + m_latestViewed=tmpViewID; + } else { + if (!m_singleWidgetMode) + { + int tmpLatestViewed=m_latestViewed; + m_area->setMainDockWidget(m_mainDockWidget); + m_mainDockWidget->setDockSite(KDockWidget::DockTop); + m_mainDockWidget->setEnableDocking(KDockWidget::DockNone); + m_mainDockWidget->show(); + if ((tmpLatestViewed>=0) && (tmpLatestViewed < (int) m_buttons.count())) + { + ButtonInfo *button = m_buttons.at(tmpLatestViewed); + if (button && button->dock) + { + m_noUpdate=true; + button->dock->undock(); + button->dock->setEnableDocking(KDockWidget::DockTop| + KDockWidget::DockBottom/*|KDockWidget::DockDesktop*/); + kdDebug()<<"Reconfiguring multi view mode"<<endl; + m_buttonBar->setTab(tmpLatestViewed,true); + showHidePage(tmpLatestViewed); + } + } + } + } + break; + } + case 2: + { + m_showTabsLeft = ! m_showTabsLeft; + doLayout(); + break; + } + case 3: + { + m_showExtraButtons = ! m_showExtraButtons; + if(m_showExtraButtons) + { + m_buttonBar->button(-1)->show(); + } + else + { + m_buttonBar->button(-1)->hide(); + + KMessageBox::information(this, + i18n("You have hidden the navigation panel configuration button. To make it visible again, click the right mouse button on any of the navigation panel buttons and select \"Show Configuration Button\".")); + + } + break; + } + default: + return; + } + m_configTimer.start(400, true); +} + +void Sidebar_Widget::readConfig() +{ + m_disableConfig = m_config->readBoolEntry("DisableConfig",false); + m_singleWidgetMode = m_config->readBoolEntry("SingleWidgetMode",true); + m_immutableSingleWidgetMode = + m_config->entryIsImmutable("SingleWidgetMode"); + m_showExtraButtons = m_config->readBoolEntry("ShowExtraButtons",false); + m_immutableShowExtraButtons = + m_config->entryIsImmutable("ShowExtraButtons"); + m_showTabsLeft = m_config->readBoolEntry("ShowTabsLeft", true); + m_immutableShowTabsLeft = m_config->entryIsImmutable("ShowTabsLeft"); + m_hideTabs = m_config->readBoolEntry("HideTabs", false); + m_immutableHideTabs = m_config->entryIsImmutable("HideTabs"); + + if (m_initial) { + m_openViews = m_config->readListEntry("OpenViews"); + m_savedWidth = m_config->readNumEntry("SavedWidth",200); + m_initial=false; + } +} + +void Sidebar_Widget::stdAction(const char *handlestd) +{ + ButtonInfo* mod = m_activeModule; + + if (!mod) + return; + if (!(mod->module)) + return; + + kdDebug() << "Try calling >active< module's (" << mod->module->className() << ") slot " << handlestd << endl; + + int id = mod->module->metaObject()->findSlot( handlestd ); + if ( id == -1 ) + return; + kdDebug() << "Action slot was found, it will be called now" << endl; + QUObject o[ 1 ]; + mod->module->qt_invoke( id, o ); + return; +} + + +void Sidebar_Widget::updateButtons() +{ + //PARSE ALL DESKTOP FILES + m_openViews = m_visibleViews; + + if (m_buttons.count() > 0) + { + for (uint i = 0; i < m_buttons.count(); i++) + { + ButtonInfo *button = m_buttons.at(i); + if (button->dock) + { + m_noUpdate = true; + if (button->dock->isVisibleTo(this)) { + showHidePage(i); + } + + delete button->module; + delete button->dock; + } + m_buttonBar->removeTab(i); + + } + } + m_buttons.clear(); + + readConfig(); + doLayout(); + createButtons(); +} + +void Sidebar_Widget::createButtons() +{ + if (!m_path.isEmpty()) + { + kdDebug()<<"m_path: "<<m_path<<endl; + QDir dir(m_path); + QStringList list=dir.entryList("*.desktop"); + for (QStringList::Iterator it=list.begin(); it!=list.end(); ++it) + { + addButton(*it); + } + } + + if (!m_buttonBar->button(-1)) { + m_buttonBar->appendButton(SmallIcon("configure"), -1, m_menu, + i18n("Configure Sidebar")); + } + + if (m_showExtraButtons && !m_disableConfig) { + m_buttonBar->button(-1)->show(); + } else { + m_buttonBar->button(-1)->hide(); + } + + for (uint i = 0; i < m_buttons.count(); i++) + { + ButtonInfo *button = m_buttons.at(i); + if (m_openViews.contains(button->file)) + { + m_buttonBar->setTab(i,true); + m_noUpdate = true; + showHidePage(i); + if (m_singleWidgetMode) { + break; + } + } + } + + collapseExpandSidebar(); + m_noUpdate=false; +} + +bool Sidebar_Widget::openURL(const class KURL &url) +{ + if (url.protocol()=="sidebar") + { + for (unsigned int i=0;i<m_buttons.count();i++) + if (m_buttons.at(i)->file==url.path()) + { + KMultiTabBarTab *tab = m_buttonBar->tab(i); + if (!tab->isOn()) + tab->animateClick(); + return true; + } + return false; + } + + m_storedUrl=url; + m_hasStoredUrl=true; + bool ret = false; + for (unsigned int i=0;i<m_buttons.count();i++) + { + ButtonInfo *button = m_buttons.at(i); + if (button->dock) + { + if ((button->dock->isVisibleTo(this)) && (button->module)) + { + ret = true; + button->module->openURL(url); + } + } + } + return ret; +} + +bool Sidebar_Widget::addButton(const QString &desktoppath,int pos) +{ + int lastbtn = m_buttons.count(); + m_buttons.resize(m_buttons.size()+1); + + KSimpleConfig *confFile; + + kdDebug() << "addButton:" << (m_path+desktoppath) << endl; + + confFile = new KSimpleConfig(m_path+desktoppath,true); + confFile->setGroup("Desktop Entry"); + + QString icon = confFile->readEntry("Icon"); + QString name = confFile->readEntry("Name"); + QString comment = confFile->readEntry("Comment"); + QString url = confFile->readPathEntry("URL",QString::null); + QString lib = confFile->readEntry("X-KDE-KonqSidebarModule"); + + delete confFile; + + if (pos == -1) + { + m_buttonBar->appendTab(SmallIcon(icon), lastbtn, name); + ButtonInfo *bi = new ButtonInfo(desktoppath, ((KonqSidebar*)m_partParent),0, url, lib, name, + icon, this); + /*int id=*/m_buttons.insert(lastbtn, bi); + KMultiTabBarTab *tab = m_buttonBar->tab(lastbtn); + tab->installEventFilter(this); + connect(tab,SIGNAL(clicked(int)),this,SLOT(showHidePage(int))); + + // Set Whats This help + // This uses the comments in the .desktop files + QWhatsThis::add(tab, comment); + } + + return true; +} + + + +bool Sidebar_Widget::eventFilter(QObject *obj, QEvent *ev) +{ + + if (ev->type()==QEvent::MouseButtonPress && ((QMouseEvent *)ev)->button()==QMouseEvent::RightButton) + { + KMultiTabBarTab *bt=dynamic_cast<KMultiTabBarTab*>(obj); + if (bt) + { + kdDebug()<<"Request for popup"<<endl; + m_currentButton = 0; + for (uint i=0;i<m_buttons.count();i++) + { + if (bt==m_buttonBar->tab(i)) + { + m_currentButton = m_buttons.at(i); + break; + } + } + + if (m_currentButton) + { + if (!m_buttonPopup) + { + m_buttonPopup=new KPopupMenu(this, "Sidebar_Widget::ButtonPopup"); + m_buttonPopup->insertTitle(SmallIcon("unknown"), "", 50); + m_buttonPopup->insertItem(SmallIconSet("text"), i18n("Set Name..."),4); // Item to open a dialog to change the name of the sidebar item (by Pupeno) + m_buttonPopup->insertItem(SmallIconSet("www"), i18n("Set URL..."),2); + m_buttonPopup->insertItem(SmallIconSet("icons"), i18n("Set Icon..."),1); + m_buttonPopup->insertSeparator(); + m_buttonPopup->insertItem(SmallIconSet("editdelete"), i18n("Remove"),3); + m_buttonPopup->insertSeparator(); + m_buttonPopup->insertItem(SmallIconSet("configure"), i18n("Configure Navigation Panel"), m_menu, 4); + connect(m_buttonPopup, SIGNAL(activated(int)), + this, SLOT(buttonPopupActivate(int))); + } + m_buttonPopup->setItemEnabled(2,!m_currentButton->URL.isEmpty()); + m_buttonPopup->changeTitle(50,SmallIcon(m_currentButton->iconName), + m_currentButton->displayName); + if (!m_disableConfig) + { m_buttonPopup->exec(QCursor::pos()); } + } + return true; + + } + } + return false; +} + +void Sidebar_Widget::mousePressEvent(QMouseEvent *ev) +{ + if (ev->type()==QEvent::MouseButtonPress && + ((QMouseEvent *)ev)->button()==QMouseEvent::RightButton && + !m_disableConfig) + { m_menu->exec(QCursor::pos()); } +} + +KonqSidebarPlugin *Sidebar_Widget::loadModule(QWidget *par,QString &desktopName,QString lib_name,ButtonInfo* bi) +{ + KLibLoader *loader = KLibLoader::self(); + + // try to load the library + KLibrary *lib = loader->library(QFile::encodeName(lib_name)); + if (lib) + { + // get the create_ function + QString factory("create_%1"); + void *create = lib->symbol(QFile::encodeName(factory.arg(lib_name))); + + if (create) + { + // create the module + + KonqSidebarPlugin* (*func)(KInstance*,QObject *, QWidget*, QString&, const char *); + func = (KonqSidebarPlugin* (*)(KInstance*,QObject *, QWidget *, QString&, const char *)) create; + QString fullPath(m_path+desktopName); + return (KonqSidebarPlugin*)func(getInstance(),bi,par,fullPath,0); + } + } else { + kdWarning() << "Module " << lib_name << " doesn't specify a library!" << endl; + } + return 0; +} + +KParts::BrowserExtension *Sidebar_Widget::getExtension() +{ + return KParts::BrowserExtension::childObject(m_partParent); +} + +bool Sidebar_Widget::createView( ButtonInfo *data) +{ + bool ret = true; + KSimpleConfig *confFile; + confFile = new KSimpleConfig(data->file,true); + confFile->setGroup("Desktop Entry"); + + data->dock = m_area->createDockWidget(confFile->readEntry("Name",i18n("Unknown")),0); + data->module = loadModule(data->dock,data->file,data->libName,data); + + if (data->module == 0) + { + delete data->dock; + data->dock = 0; + ret = false; + } else { + data->dock->setWidget(data->module->getWidget()); + data->dock->setEnableDocking(KDockWidget::DockTop| + KDockWidget::DockBottom/*|KDockWidget::DockDesktop*/); + data->dock->setDockSite(KDockWidget::DockTop|KDockWidget::DockBottom); + connectModule(data->module); + connect(this, SIGNAL(fileSelection(const KFileItemList&)), + data->module, SLOT(openPreview(const KFileItemList&))); + + connect(this, SIGNAL(fileMouseOver(const KFileItem&)), + data->module, SLOT(openPreviewOnMouseOver(const KFileItem&))); + } + + delete confFile; + return ret; +} + +void Sidebar_Widget::showHidePage(int page) +{ + ButtonInfo *info = m_buttons.at(page); + if (!info->dock) + { + if (m_buttonBar->isTabRaised(page)) + { + //SingleWidgetMode + if (m_singleWidgetMode) + { + if (m_latestViewed != -1) + { + m_noUpdate = true; + showHidePage(m_latestViewed); + } + } + + if (!createView(info)) + { + m_buttonBar->setTab(page,false); + return; + } + + m_buttonBar->setTab(page,true); + + connect(info->module, + SIGNAL(setIcon(const QString&)), + m_buttonBar->tab(page), + SLOT(setIcon(const QString&))); + + connect(info->module, + SIGNAL(setCaption(const QString&)), + m_buttonBar->tab(page), + SLOT(setText(const QString&))); + + if (m_singleWidgetMode) + { + m_area->setMainDockWidget(info->dock); + m_mainDockWidget->undock(); + } else { + info->dock->manualDock(m_mainDockWidget,KDockWidget::DockTop,100); + } + + info->dock->show(); + + if (m_hasStoredUrl) + info->module->openURL(m_storedUrl); + m_visibleViews<<info->file; + m_latestViewed=page; + } + } else { + if ((!info->dock->isVisibleTo(this)) && (m_buttonBar->isTabRaised(page))) { + //SingleWidgetMode + if (m_singleWidgetMode) { + if (m_latestViewed != -1) { + m_noUpdate = true; + showHidePage(m_latestViewed); + } + } + + if (m_singleWidgetMode) { + m_area->setMainDockWidget(info->dock); + m_mainDockWidget->undock(); + } else { + info->dock->manualDock(m_mainDockWidget,KDockWidget::DockTop,100); + } + + info->dock->show(); + m_latestViewed = page; + if (m_hasStoredUrl) + info->module->openURL(m_storedUrl); + m_visibleViews << info->file; + m_buttonBar->setTab(page,true); + } else { + m_buttonBar->setTab(page,false); + if (m_singleWidgetMode) { + m_area->setMainDockWidget(m_mainDockWidget); + m_mainDockWidget->show(); + } + info->dock->undock(); + m_latestViewed = -1; + m_visibleViews.remove(info->file); + } + } + + if (!m_noUpdate) + collapseExpandSidebar(); + m_noUpdate = false; +} + +void Sidebar_Widget::collapseExpandSidebar() +{ + if (!parentWidget()) + return; // Can happen during destruction + + if (m_visibleViews.count()==0) + { + m_somethingVisible = false; + parentWidget()->setMaximumWidth(minimumSizeHint().width()); + updateGeometry(); + emit panelHasBeenExpanded(false); + } else { + m_somethingVisible = true; + parentWidget()->setMaximumWidth(32767); + updateGeometry(); + emit panelHasBeenExpanded(true); + } +} + +QSize Sidebar_Widget::sizeHint() const +{ + if (m_somethingVisible) + return QSize(m_savedWidth,200); + return minimumSizeHint(); +} + +void Sidebar_Widget::dockWidgetHasUndocked(KDockWidget* wid) +{ + kdDebug()<<" Sidebar_Widget::dockWidgetHasUndocked(KDockWidget*)"<<endl; + for (unsigned int i=0;i<m_buttons.count();i++) + { + ButtonInfo *button = m_buttons.at(i); + if (button->dock==wid) + { + if (m_buttonBar->isTabRaised(i)) + { + m_buttonBar->setTab(i,false); + showHidePage(i); + } + } + } +} + +KInstance *Sidebar_Widget::getInstance() +{ + return ((KonqSidebar*)m_partParent)->getInstance(); +} + +void Sidebar_Widget::submitFormRequest(const char *action, + const QString& url, + const QByteArray& formData, + const QString& /*target*/, + const QString& contentType, + const QString& /*boundary*/ ) +{ +KParts::URLArgs args; + + args.setContentType("Content-Type: " + contentType); + args.postData = formData; + args.setDoPost(QCString(action).lower() == "post"); + // boundary? + emit getExtension()->openURLRequest(KURL( url ), args); +} + +void Sidebar_Widget::openURLRequest( const KURL &url, const KParts::URLArgs &args) +{ + getExtension()->openURLRequest(url,args); +} + +void Sidebar_Widget::createNewWindow( const KURL &url, const KParts::URLArgs &args) +{ + getExtension()->createNewWindow(url,args); +} + +void Sidebar_Widget::createNewWindow( const KURL &url, const KParts::URLArgs &args, + const KParts::WindowArgs &windowArgs, KParts::ReadOnlyPart *&part ) +{ + getExtension()->createNewWindow(url,args,windowArgs,part); +} + +void Sidebar_Widget::enableAction( const char * name, bool enabled ) +{ + if (sender()->parent()->isA("ButtonInfo")) + { + ButtonInfo *btninfo = static_cast<ButtonInfo*>(sender()->parent()); + if (btninfo) + { + QString n(name); + if (n == "copy") + btninfo->copy = enabled; + else if (n == "cut") + btninfo->cut = enabled; + else if (n == "paste") + btninfo->paste = enabled; + else if (n == "trash") + btninfo->trash = enabled; + else if (n == "del") + btninfo->del = enabled; + else if (n == "rename") + btninfo->rename = enabled; + } + } +} + + +bool Sidebar_Widget::doEnableActions() +{ + if (!(sender()->parent()->isA("ButtonInfo"))) + { + kdDebug()<<"Couldn't set active module, aborting"<<endl; + return false; + } else { + m_activeModule=static_cast<ButtonInfo*>(sender()->parent()); + getExtension()->enableAction( "copy", m_activeModule->copy ); + getExtension()->enableAction( "cut", m_activeModule->cut ); + getExtension()->enableAction( "paste", m_activeModule->paste ); + getExtension()->enableAction( "trash", m_activeModule->trash ); + getExtension()->enableAction( "del", m_activeModule->del ); + getExtension()->enableAction( "rename", m_activeModule->rename ); + return true; + } + +} + +void Sidebar_Widget::popupMenu( const QPoint &global, const KFileItemList &items ) +{ + if (doEnableActions()) + getExtension()->popupMenu(global,items); +} + + +void Sidebar_Widget::popupMenu( KXMLGUIClient *client, const QPoint &global, const KFileItemList &items ) +{ + if (doEnableActions()) + getExtension()->popupMenu(client,global,items); +} + +void Sidebar_Widget::popupMenu( const QPoint &global, const KURL &url, + const QString &mimeType, mode_t mode) +{ + if (doEnableActions()) + getExtension()->popupMenu(global,url,mimeType,mode); +} + +void Sidebar_Widget::popupMenu( KXMLGUIClient *client, + const QPoint &global, const KURL &url, + const QString &mimeType, mode_t mode ) +{ + if (doEnableActions()) + getExtension()->popupMenu(client,global,url,mimeType,mode); +} + +void Sidebar_Widget::connectModule(QObject *mod) +{ + if (mod->metaObject()->findSignal("started(KIO::Job*)") != -1) { + connect(mod,SIGNAL(started(KIO::Job *)),this, SIGNAL(started(KIO::Job*))); + } + + if (mod->metaObject()->findSignal("completed()") != -1) { + connect(mod,SIGNAL(completed()),this,SIGNAL(completed())); + } + + if (mod->metaObject()->findSignal("popupMenu(const QPoint&,const KURL&,const QString&,mode_t)") != -1) { + connect(mod,SIGNAL(popupMenu( const QPoint &, const KURL &, + const QString &, mode_t)),this,SLOT(popupMenu( const + QPoint &, const KURL&, const QString &, mode_t))); + } + + if (mod->metaObject()->findSignal("popupMenu(KXMLGUIClient*,const QPoint&,const KURL&,const QString&,mode_t)") != -1) { + connect(mod,SIGNAL(popupMenu( KXMLGUIClient *, const QPoint &, + const KURL &,const QString &, mode_t)),this, + SLOT(popupMenu( KXMLGUIClient *, const QPoint &, + const KURL &,const QString &, mode_t))); + } + + if (mod->metaObject()->findSignal("popupMenu(const QPoint&,const KFileItemList&)") != -1) { + connect(mod,SIGNAL(popupMenu( const QPoint &, const KFileItemList & )), + this,SLOT(popupMenu( const QPoint &, const KFileItemList & ))); + } + + if (mod->metaObject()->findSignal("openURLRequest(const KURL&,const KParts::URLArgs&)") != -1) { + connect(mod,SIGNAL(openURLRequest( const KURL &, const KParts::URLArgs &)), + this,SLOT(openURLRequest( const KURL &, const KParts::URLArgs &))); + } + + if (mod->metaObject()->findSignal("submitFormRequest(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&)") != -1) { + connect(mod, + SIGNAL(submitFormRequest(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&)), + this, + SLOT(submitFormRequest(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&))); + } + + if (mod->metaObject()->findSignal("enableAction(const char*,bool)") != -1) { + connect(mod,SIGNAL(enableAction( const char *, bool)), + this,SLOT(enableAction(const char *, bool))); + } + + if (mod->metaObject()->findSignal("createNewWindow(const KURL&,const KParts::URLArgs&)") != -1) { + connect(mod,SIGNAL(createNewWindow( const KURL &, const KParts::URLArgs &)), + this,SLOT(createNewWindow( const KURL &, const KParts::URLArgs &))); + } +} + + + +Sidebar_Widget::~Sidebar_Widget() +{ + m_config->writeEntry("OpenViews", m_visibleViews); + if (m_configTimer.isActive()) + saveConfig(); + delete m_config; + m_noUpdate = true; + for (uint i=0;i<m_buttons.count();i++) + { + ButtonInfo *button = m_buttons.at(i); + if (button->dock) + button->dock->undock(); + } +} + +void Sidebar_Widget::customEvent(QCustomEvent* ev) +{ + if (KonqFileSelectionEvent::test(ev)) + { + emit fileSelection(static_cast<KonqFileSelectionEvent*>(ev)->selection()); + } else if (KonqFileMouseOverEvent::test(ev)) { + if (!(static_cast<KonqFileMouseOverEvent*>(ev)->item())) { + emit fileMouseOver(KFileItem(KURL(),QString::null,KFileItem::Unknown)); + } else { + emit fileMouseOver(*static_cast<KonqFileMouseOverEvent*>(ev)->item()); + } + } +} + +void Sidebar_Widget::resizeEvent(QResizeEvent* ev) +{ + if (m_somethingVisible && m_userMovedSplitter) + { + int newWidth = width(); + QSplitter *split = splitter(); + if (split && (m_savedWidth != newWidth)) + { + QValueList<int> sizes = split->sizes(); + if ((sizes.count() >= 2) && (sizes[1])) + { + m_savedWidth = newWidth; + updateGeometry(); + m_configTimer.start(400, true); + } + } + } + m_userMovedSplitter = false; + QWidget::resizeEvent(ev); +} + +QSplitter *Sidebar_Widget::splitter() const +{ + if (m_universalMode) return 0; + QObject *p = parent(); + if (!p) return 0; + p = p->parent(); + return static_cast<QSplitter*>(p); +} + +void Sidebar_Widget::userMovedSplitter() +{ + m_userMovedSplitter = true; +} diff --git a/konqueror/sidebar/sidebar_widget.h b/konqueror/sidebar/sidebar_widget.h new file mode 100644 index 000000000..ccaba5224 --- /dev/null +++ b/konqueror/sidebar/sidebar_widget.h @@ -0,0 +1,225 @@ +/*************************************************************************** + sidebar_widget.h + ------------------- + begin : Sat June 2 16:25:27 CEST 2001 + copyright : (C) 2001 Joseph Wenninger + email : jowenn@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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef _SIDEBAR_WIDGET_ +#define _SIDEBAR_WIDGET_ + +#include <qptrvector.h> +#include <qtimer.h> +#include <qstring.h> +#include <qguardedptr.h> + +#include <kdockwidget.h> +#include <kurl.h> +#include <ktoolbar.h> +#include <kparts/part.h> +#include <kmultitabbar.h> + +#include "konqsidebarplugin.h" +#include "konqsidebariface_p.h" + +class KDockWidget; +class QHBoxLayout; +class QSplitter; +class QStringList; + +class ButtonInfo: public QObject, public KonqSidebarIface +{ + Q_OBJECT +public: + ButtonInfo(const QString& file_, class KonqSidebarIface *part, class KDockWidget *dock_, + const QString &url_,const QString &lib, + const QString &dispName_, const QString &iconName_, + QObject *parent) + : QObject(parent), file(file_), dock(dock_), URL(url_), + libName(lib), displayName(dispName_), iconName(iconName_), m_part(part) + { + copy = cut = paste = trash = del = rename =false; + } + + ~ButtonInfo() {} + + QString file; + KDockWidget *dock; + KonqSidebarPlugin *module; + QString URL; + QString libName; + QString displayName; + QString iconName; + bool copy; + bool cut; + bool paste; + bool trash; + bool del; + bool rename; + KonqSidebarIface *m_part; + virtual bool universalMode() {return m_part->universalMode();} +}; + + +class addBackEnd: public QObject +{ + Q_OBJECT +public: + addBackEnd(QWidget *parent,class QPopupMenu *addmenu, bool universal, + const QString ¤tProfile, const char *name=0); + ~addBackEnd(){;} +protected slots: + void aboutToShowAddMenu(); + void activatedAddMenu(int); +signals: + void updateNeeded(); + void initialCopyNeeded(); +private: + QGuardedPtr<class QPopupMenu> menu; + QPtrVector<QString> libNames; + QPtrVector<QString> libParam; + bool m_universal; + QString m_currentProfile; + void doRollBack(); + QWidget *m_parent; +}; + +class KDE_EXPORT Sidebar_Widget: public QWidget +{ + Q_OBJECT +public: + friend class ButtonInfo; +public: + Sidebar_Widget(QWidget *parent, KParts::ReadOnlyPart *par, + const char * name,bool universalMode, + const QString ¤tProfile); + ~Sidebar_Widget(); + bool openURL(const class KURL &url); + void stdAction(const char *handlestd); + //virtual KParts::ReadOnlyPart *getPart(); + KParts::BrowserExtension *getExtension(); + virtual QSize sizeHint() const; + +public slots: + void addWebSideBar(const KURL& url, const QString& name); + +protected: + void customEvent(QCustomEvent* ev); + void resizeEvent(QResizeEvent* ev); + virtual bool eventFilter(QObject*,QEvent*); + virtual void mousePressEvent(QMouseEvent*); + +protected slots: + void showHidePage(int value); + void createButtons(); + void updateButtons(); + void finishRollBack(); + void activatedMenu(int id); + void buttonPopupActivate(int); + void dockWidgetHasUndocked(KDockWidget*); + void aboutToShowConfigMenu(); + void saveConfig(); + +signals: + void started(KIO::Job *); + void completed(); + void fileSelection(const KFileItemList& iems); + void fileMouseOver(const KFileItem& item); + +public: + /* interface KonqSidebar_PluginInterface*/ + KInstance *getInstance(); +// virtual void showError(QString &); for later extension +// virtual void showMessage(QString &); for later extension + /* end of interface implementation */ + + + /* The following public slots are wrappers for browserextension fields */ +public slots: + void openURLRequest( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); + /* @internal + * @since 3.2 + * ### KDE4 remove me + */ + void submitFormRequest(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&); + void createNewWindow( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); + void createNewWindow( const KURL &url, const KParts::URLArgs &args, + const KParts::WindowArgs &windowArgs, KParts::ReadOnlyPart *&part ); + + void popupMenu( const QPoint &global, const KFileItemList &items ); + void popupMenu( KXMLGUIClient *client, const QPoint &global, const KFileItemList &items ); + void popupMenu( const QPoint &global, const KURL &url, + const QString &mimeType, mode_t mode = (mode_t)-1 ); + void popupMenu( KXMLGUIClient *client, + const QPoint &global, const KURL &url, + const QString &mimeType, mode_t mode = (mode_t)-1 ); + void enableAction( const char * name, bool enabled ); + void userMovedSplitter(); + +private: + QSplitter *splitter() const; + bool addButton(const QString &desktoppath,int pos=-1); + bool createView(ButtonInfo *data); + KonqSidebarPlugin *loadModule(QWidget *par,QString &desktopName,QString lib_name,ButtonInfo *bi); + void readConfig(); + void initialCopy(); + void doLayout(); + void connectModule(QObject *mod); + void collapseExpandSidebar(); + bool doEnableActions(); + bool m_universalMode; + bool m_userMovedSplitter; +private: + KParts::ReadOnlyPart *m_partParent; + KDockArea *m_area; + KDockWidget *m_mainDockWidget; + + KMultiTabBar *m_buttonBar; + QPtrVector<ButtonInfo> m_buttons; + QHBoxLayout *m_layout; + KPopupMenu *m_buttonPopup; + QPopupMenu *m_menu; + QGuardedPtr<ButtonInfo> m_activeModule; + QGuardedPtr<ButtonInfo> m_currentButton; + + KConfig *m_config; + QTimer m_configTimer; + + KURL m_storedUrl; + int m_savedWidth; + int m_latestViewed; + + bool m_hasStoredUrl; + bool m_singleWidgetMode; + bool m_immutableSingleWidgetMode; + bool m_showTabsLeft; + bool m_immutableShowTabsLeft; + bool m_hideTabs; + bool m_immutableHideTabs; + bool m_disableConfig; + bool m_showExtraButtons; + bool m_immutableShowExtraButtons; + bool m_somethingVisible; + bool m_noUpdate; + bool m_initial; + + QString m_path; + QString m_relPath; + QString m_currentProfile; + QStringList m_visibleViews; // The views that are actually open + QStringList m_openViews; // The views that should be opened + +signals: + void panelHasBeenExpanded(bool); +}; + +#endif diff --git a/konqueror/sidebar/test/Makefile.am b/konqueror/sidebar/test/Makefile.am new file mode 100644 index 000000000..ebaeff299 --- /dev/null +++ b/konqueror/sidebar/test/Makefile.am @@ -0,0 +1,23 @@ +# this has all of the subdirectories that make will recurse into. if +# there are none, comment this out +SUBDIRS = . + +# set the include path for X, qt and KDE +INCLUDES = -I$(srcdir)/.. $(all_includes) + +# these are the headers for your project +noinst_HEADERS = konqsidebartest.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = konq_sidebartest.la + +# the Part's source, library search path, and link libraries +konq_sidebartest_la_SOURCES = konqsidebartest.cpp +konq_sidebartest_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) +konq_sidebartest_la_LIBADD = $(LIB_KPARTS) $(LIB_KIO) ../libkonqsidebarplugin.la + +# this is where the part's XML-GUI resource file goes +partrcdir = $(kde_datadir)/konqsidebartng/entries +partrc_DATA = test.desktop diff --git a/konqueror/sidebar/test/konqsidebartest.cpp b/konqueror/sidebar/test/konqsidebartest.cpp new file mode 100644 index 000000000..56dfff2fe --- /dev/null +++ b/konqueror/sidebar/test/konqsidebartest.cpp @@ -0,0 +1,26 @@ +/*************************************************************************** + konqsidebartest.cpp + ------------------- + begin : Sat June 2 16:25:27 CEST 2001 + copyright : (C) 2001 Joseph Wenninger + email : jowenn@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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "konqsidebartest.moc" +#include <kinstance.h> + +extern "C" +{ + KDE_EXPORT void* create_konq_sidebartest(KInstance *instance,QObject *par,QWidget *widp,QString &desktopname,const char *name) + { + return new SidebarTest(instance,par,widp,desktopname,name); + } +}; diff --git a/konqueror/sidebar/test/konqsidebartest.h b/konqueror/sidebar/test/konqsidebartest.h new file mode 100644 index 000000000..0c304e949 --- /dev/null +++ b/konqueror/sidebar/test/konqsidebartest.h @@ -0,0 +1,43 @@ +/*************************************************************************** + konqsidebartest.h + ------------------- + begin : Sat June 2 16:25:27 CEST 2001 + copyright : (C) 2001 Joseph Wenninger + email : jowenn@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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef _konq_sidebar_test_h_ +#define _konq_sidebar_test_h_ +#include <konqsidebarplugin.h> +#include <qlabel.h> +#include <qlayout.h> + +class SidebarTest : public KonqSidebarPlugin + { + Q_OBJECT + public: + SidebarTest(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName_, const char* name=0): + KonqSidebarPlugin(inst,parent,widgetParent,desktopName_,name) + { + widget=new QLabel("Init Value",widgetParent); + } + ~SidebarTest(){;} + virtual QWidget *getWidget(){return widget;} + virtual void *provides(const QString &) {return 0;} + protected: + QLabel *widget; + virtual void handleURL(const KURL &url) + { + widget->setText(url.url()); + } + }; + +#endif diff --git a/konqueror/sidebar/test/test.desktop b/konqueror/sidebar/test/test.desktop new file mode 100644 index 000000000..9ede79467 --- /dev/null +++ b/konqueror/sidebar/test/test.desktop @@ -0,0 +1,68 @@ +[Desktop Entry] +Type=Link +URL= +Icon=wizard +Name=Test +Name[af]=Toets +Name[ar]=إختبار +Name[az]=Sınaq +Name[be]=Праверка +Name[bg]=Проба +Name[bn]=পরীক্ষা +Name[br]=Arnodiñ +Name[bs]=Proba +Name[ca]=Prova +Name[cy]=Arbrofi +Name[el]=Δοκιμή +Name[eo]=Testo +Name[es]=Prueba +Name[eu]=Froga +Name[fa]=آزمون +Name[fi]=Testi +Name[ga]=Tástáil +Name[gl]=Probar +Name[he]=ניסיון +Name[hi]=जांच +Name[hu]=Próba +Name[id]=Tes +Name[is]=Prufa +Name[it]=Prova +Name[ja]=テスト +Name[ka]=ტესტი +Name[kk]=Сынау +Name[km]=សាកល្បង +Name[ko]=시험 +Name[lo]=ທົດສອບ +Name[lt]=Testas +Name[lv]=Tests +Name[mk]=Тест +Name[mn]=Тест +Name[ms]=Uji +Name[ne]=परीक्षण +Name[nso]=Teko +Name[pa]=ਜਾਂਚ +Name[pt]=Teste +Name[pt_BR]=Testar +Name[ru]=Тест +Name[rw]=Isuzuma +Name[se]=Geahččaleapmi +Name[sl]=Preizkus +Name[sr]=Тест +Name[ta]=சோதனை +Name[te]=పరీక్ష +Name[tg]=Озмоиш +Name[th]=ทดสอบ +Name[tt]=Sınaw +Name[uk]=Тест +Name[uz]=Sinov +Name[uz@cyrillic]=Синов +Name[ven]=Mulingo +Name[vi]=Thử +Name[wa]=Sayî +Name[xh]=Uvavanyo +Name[zh_CN]=测试 +Name[zh_TW]=測試 +Name[zu]=Isivivinyo + +Open=false +X-KDE-KonqSidebarModule=konq_sidebartest diff --git a/konqueror/sidebar/trees/Makefile.am b/konqueror/sidebar/trees/Makefile.am new file mode 100644 index 000000000..68257b8a9 --- /dev/null +++ b/konqueror/sidebar/trees/Makefile.am @@ -0,0 +1,17 @@ +#SUBDIRS = init dirtree_module history_module bookmark_module . +SUBDIRS = init . dirtree_module history_module bookmark_module + +INCLUDES = -I$(top_srcdir)/libkonq -I$(top_srcdir)/konqueror -I$(srcdir)/.. $(all_includes) + +noinst_LTLIBRARIES = libkonq_sidebar_tree.la +kde_module_LTLIBRARIES = konqsidebar_tree.la +METASOURCES = AUTO + +libkonq_sidebar_tree_la_SOURCES = konq_sidebartree.cpp konq_sidebartreeitem.cpp konq_sidebartreetoplevelitem.cpp +#libkonq_sidebar_tree_la_LDFLAGS = $(all_libraries) -avoid-version -no-undefined +libkonq_sidebar_tree_la_LIBADD = $(top_builddir)/libkonq/libkonq.la ../libkonqsidebarplugin.la + +konqsidebar_tree_la_SOURCES = konqsidebar_tree.cpp +konqsidebar_tree_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +konqsidebar_tree_la_LIBADD = $(top_builddir)/libkonq/libkonq.la ../libkonqsidebarplugin.la libkonq_sidebar_tree.la + diff --git a/konqueror/sidebar/trees/bookmark_module/Makefile.am b/konqueror/sidebar/trees/bookmark_module/Makefile.am new file mode 100644 index 000000000..740c03798 --- /dev/null +++ b/konqueror/sidebar/trees/bookmark_module/Makefile.am @@ -0,0 +1,10 @@ +INCLUDES = -I$(top_srcdir)/libkonq -I$(srcdir)/.. -I$(srcdir)/../.. $(all_includes) + +kde_module_LTLIBRARIES = konq_sidebartree_bookmarks.la + +METASOURCES = AUTO + +konq_sidebartree_bookmarks_la_SOURCES = bookmark_module.cpp bookmark_item.cpp +konq_sidebartree_bookmarks_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +konq_sidebartree_bookmarks_la_LIBADD = ../../libkonqsidebarplugin.la ../libkonq_sidebar_tree.la + diff --git a/konqueror/sidebar/trees/bookmark_module/bookmark_item.cpp b/konqueror/sidebar/trees/bookmark_module/bookmark_item.cpp new file mode 100644 index 000000000..c0fae56cc --- /dev/null +++ b/konqueror/sidebar/trees/bookmark_module/bookmark_item.cpp @@ -0,0 +1,81 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "bookmark_item.h" +#include <kbookmarkdrag.h> +#include <konq_sidebartree.h> +#include <kdebug.h> +#include <kiconloader.h> + +#include "bookmark_module.h" + +#define MYMODULE static_cast<KonqSidebarBookmarkModule*>(module()) + +KonqSidebarBookmarkItem::KonqSidebarBookmarkItem( KonqSidebarTreeItem *parentItem, KonqSidebarTreeTopLevelItem *topLevelItem, const KBookmark & bk, int key ) + : KonqSidebarTreeItem( parentItem, topLevelItem ), m_bk(bk), m_key(key) +{ + setText( 0, bk.text() ); + setPixmap( 0, SmallIcon(bk.icon()) ); +} + +QDragObject * KonqSidebarBookmarkItem::dragObject( QWidget * parent, bool ) +{ + KBookmarkDrag * drag = KBookmarkDrag::newDrag( m_bk, parent ); + // TODO honour bool move ? + return drag; +} + +void KonqSidebarBookmarkItem::middleButtonClicked() +{ + emit tree()->createNewWindow( externalURL() ); +} + +void KonqSidebarBookmarkItem::rightButtonPressed() +{ + MYMODULE->showPopupMenu(); +} + +void KonqSidebarBookmarkItem::del() +{ + //maybe todo +} + +KURL KonqSidebarBookmarkItem::externalURL() const +{ + return m_bk.isGroup() ? KURL() : m_bk.url(); +} + +QString KonqSidebarBookmarkItem::toolTipText() const +{ + return m_bk.url().prettyURL(); +} + +void KonqSidebarBookmarkItem::itemSelected() +{ + tree()->enableActions( false, false, false, false, false, false ); +} + +QString KonqSidebarBookmarkItem::key( int /*column*/, bool /*ascending*/ ) const +{ + return QString::number(m_key).rightJustify( 5, '0' ); +} + +KBookmark &KonqSidebarBookmarkItem::bookmark() +{ + return m_bk; +} diff --git a/konqueror/sidebar/trees/bookmark_module/bookmark_item.h b/konqueror/sidebar/trees/bookmark_module/bookmark_item.h new file mode 100644 index 000000000..5ffe953e8 --- /dev/null +++ b/konqueror/sidebar/trees/bookmark_module/bookmark_item.h @@ -0,0 +1,62 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef bookmark_item_h +#define bookmark_item_h + +#include <konq_sidebartreeitem.h> +#include <kbookmark.h> + +/** + * A bookmark item + */ +class KonqSidebarBookmarkItem : public KonqSidebarTreeItem +{ +public: + KonqSidebarBookmarkItem( KonqSidebarTreeItem *parentItem, KonqSidebarTreeTopLevelItem *topLevelItem, + const KBookmark & bk, int key ); + + virtual ~KonqSidebarBookmarkItem() {} + + // Create a drag object from this item. + virtual QDragObject * dragObject( QWidget * parent, bool move = false ); + + virtual void middleButtonClicked(); + virtual void rightButtonPressed(); + + virtual void del(); + + // The URL to open when this link is clicked + virtual KURL externalURL() const; + + // overwrite this if you want a tooltip shown on your item + virtual QString toolTipText() const; + + // Called when this item is selected + virtual void itemSelected(); + + virtual QString key( int column, bool /*ascending*/ ) const; + + virtual KBookmark &bookmark(); + +private: + KBookmark m_bk; + int m_key; +}; + +#endif diff --git a/konqueror/sidebar/trees/bookmark_module/bookmark_module.cpp b/konqueror/sidebar/trees/bookmark_module/bookmark_module.cpp new file mode 100644 index 000000000..a931ac526 --- /dev/null +++ b/konqueror/sidebar/trees/bookmark_module/bookmark_module.cpp @@ -0,0 +1,583 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <qclipboard.h> +#include <qcursor.h> +#include <qpopupmenu.h> + +#include <kaction.h> +#include <kactioncollection.h> +#include <kapplication.h> +#include <kbookmarkdrag.h> +#include <kiconloader.h> +#include <klineedit.h> +#include <kmessagebox.h> + +#include <dcopclient.h> +#include <dcopref.h> + +#include "bookmark_module.h" +#include "bookmark_item.h" +#include <konqbookmarkmanager.h> +#include <kdebug.h> + +KonqSidebarBookmarkModule::KonqSidebarBookmarkModule( KonqSidebarTree * parentTree ) + : QObject( 0L ), KonqSidebarTreeModule( parentTree ), + m_topLevelItem( 0L ), m_ignoreOpenChange(true) +{ + // formats handled by KBookmarkDrag: + QStringList formats; + formats << "text/uri-list" << "application/x-xbel" << "text/plain"; + tree()->setDropFormats(formats); + + connect(tree(), SIGNAL(moved(QListViewItem*,QListViewItem*,QListViewItem*)), + this, SLOT(slotMoved(QListViewItem*,QListViewItem*,QListViewItem*))); + connect(tree(), SIGNAL(dropped(KListView*,QDropEvent*,QListViewItem*,QListViewItem*)), + this, SLOT(slotDropped(KListView*,QDropEvent*,QListViewItem*,QListViewItem*))); + + connect(tree(), SIGNAL(expanded(QListViewItem*)), + this, SLOT(slotOpenChange(QListViewItem*))); + connect(tree(), SIGNAL(collapsed(QListViewItem*)), + this, SLOT(slotOpenChange(QListViewItem*))); + + m_collection = new KActionCollection( this, "bookmark actions" ); + (void) new KAction( i18n("&Create New Folder"), "folder_new", 0, this, + SLOT( slotCreateFolder() ), m_collection, "create_folder"); + (void) new KAction( i18n("Delete Folder"), "editdelete", 0, this, + SLOT( slotDelete() ), m_collection, "delete_folder"); + (void) new KAction( i18n("Delete Bookmark"), "editdelete", 0, this, + SLOT( slotDelete() ), m_collection, "delete_bookmark"); + (void) new KAction( i18n("Properties"), "edit", 0, this, + SLOT( slotProperties() ), m_collection, "item_properties"); + (void) new KAction( i18n("Open in New Window"), "window_new", 0, this, + SLOT( slotOpenNewWindow() ), m_collection, "open_window"); + (void) new KAction( i18n("Open in New Tab"), "tab_new", 0, this, + SLOT( slotOpenTab() ), m_collection, "open_tab"); + (void) new KAction( i18n("Open Folder in Tabs"), "tab_new", 0, this, + SLOT( slotOpenTab() ), m_collection, "folder_open_tabs"); + (void) new KAction( i18n("Copy Link Address"), "editcopy", 0, this, + SLOT( slotCopyLocation() ), m_collection, "copy_location"); + + KStdAction::editBookmarks( KonqBookmarkManager::self(), SLOT( slotEditBookmarks() ), + m_collection, "edit_bookmarks" ); + + connect( KonqBookmarkManager::self(), SIGNAL(changed(const QString &, const QString &) ), + SLOT( slotBookmarksChanged(const QString &) ) ); +} + +KonqSidebarBookmarkModule::~KonqSidebarBookmarkModule() +{ +} + +void KonqSidebarBookmarkModule::addTopLevelItem( KonqSidebarTreeTopLevelItem * item ) +{ + m_ignoreOpenChange = true; + + m_topLevelItem = item; + fillListView(); + + m_ignoreOpenChange = false; +} + +bool KonqSidebarBookmarkModule::handleTopLevelContextMenu( KonqSidebarTreeTopLevelItem *, const QPoint& ) +{ + QPopupMenu *menu = new QPopupMenu; + + if (tree()->tabSupport()) { + m_collection->action("folder_open_tabs")->plug(menu); + menu->insertSeparator(); + } + m_collection->action("create_folder")->plug(menu); + + menu->insertSeparator(); + m_collection->action("edit_bookmarks")->plug(menu); + + menu->exec( QCursor::pos() ); + delete menu; + + return true; +} + +void KonqSidebarBookmarkModule::showPopupMenu() +{ + KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() ); + if (!bi) + return; + + bool tabSupported = tree()->tabSupport(); + QPopupMenu *menu = new QPopupMenu; + + if (bi->bookmark().isGroup()) { + if (tabSupported) { + m_collection->action("folder_open_tabs")->plug(menu); + menu->insertSeparator(); + } + m_collection->action("create_folder")->plug(menu); + m_collection->action("delete_folder")->plug(menu); + } else { + m_collection->action("open_window")->plug(menu); + if (tabSupported) + m_collection->action("open_tab")->plug(menu); + m_collection->action("copy_location")->plug(menu); + menu->insertSeparator(); + m_collection->action("create_folder")->plug(menu); + m_collection->action("delete_bookmark")->plug(menu); + } + menu->insertSeparator(); + m_collection->action("item_properties")->plug(menu); + + menu->exec( QCursor::pos() ); + delete menu; +} + +void KonqSidebarBookmarkModule::slotMoved(QListViewItem *i, QListViewItem*, QListViewItem *after) +{ + KonqSidebarBookmarkItem *item = dynamic_cast<KonqSidebarBookmarkItem*>( i ); + if (!item) + return; + KBookmark bookmark = item->bookmark(); + + KBookmark afterBookmark; + KonqSidebarBookmarkItem *afterItem = dynamic_cast<KonqSidebarBookmarkItem*>(after); + if (afterItem) + afterBookmark = afterItem->bookmark(); + + KBookmarkGroup oldParentGroup = bookmark.parentGroup(); + KBookmarkGroup parentGroup; + // try to get the parent group (assume that the QListViewItem has been reparented by KListView)... + // if anything goes wrong, use the root. + if (item->parent()) { + bool error = false; + + KonqSidebarBookmarkItem *parent = dynamic_cast<KonqSidebarBookmarkItem*>( (item->parent()) ); + if (!parent) { + error = true; + } else { + if (parent->bookmark().isGroup()) + parentGroup = parent->bookmark().toGroup(); + else + error = true; + } + + if (error) + parentGroup = KonqBookmarkManager::self()->root(); + } else { + // No parent! This means the user dropped it before the top level item + // And KListView has moved the item there, we need to correct it + tree()->moveItem(item, m_topLevelItem, 0L); + parentGroup = KonqBookmarkManager::self()->root(); + } + + // remove the old reference. + oldParentGroup.deleteBookmark( bookmark ); + + // insert the new item. + parentGroup.moveItem(bookmark, afterBookmark); + + // inform others about the changed groups. quite expensive, so do + // our best to update them in only one emitChanged call. + QString oldAddress = oldParentGroup.address(); + QString newAddress = parentGroup.address(); + if (oldAddress == newAddress) { + KonqBookmarkManager::self()->emitChanged( parentGroup ); + } else { + int i = 0; + while (true) { + QChar c1 = oldAddress[i]; + QChar c2 = newAddress[i]; + if (c1 == QChar::null) { + // oldParentGroup is probably parent of parentGroup. + KonqBookmarkManager::self()->emitChanged( oldParentGroup ); + break; + } else if (c2 == QChar::null) { + // parentGroup is probably parent of oldParentGroup. + KonqBookmarkManager::self()->emitChanged( parentGroup ); + break; + } else { + if (c1 == c2) { + // step to the next character. + ++i; + } else { + // ugh... need to update both groups separately. + KonqBookmarkManager::self()->emitChanged( oldParentGroup ); + KonqBookmarkManager::self()->emitChanged( parentGroup ); + break; + } + } + } + } +} + +void KonqSidebarBookmarkModule::slotDropped(KListView *, QDropEvent *e, QListViewItem *parent, QListViewItem *after) +{ + if (!KBookmarkDrag::canDecode(e)) + return; + + KBookmark afterBookmark; + KonqSidebarBookmarkItem *afterItem = dynamic_cast<KonqSidebarBookmarkItem*>(after); + if (afterItem) + afterBookmark = afterItem->bookmark(); + + KBookmarkGroup parentGroup; + // try to get the parent group... + if (after) { + parentGroup = afterBookmark.parentGroup(); + } else if (parent) { + if(KonqSidebarBookmarkItem *p = dynamic_cast<KonqSidebarBookmarkItem*>(parent)) + { + if (!p) + return; + KBookmark bm = p->bookmark(); + if (bm.isGroup()) + parentGroup = bm.toGroup(); + else + return; + } + else if(parent == m_topLevelItem) + { + parentGroup = KonqBookmarkManager::self()->root(); + } + } else { + // it's most probably the root... + parentGroup = KonqBookmarkManager::self()->root(); + } + + QValueList<KBookmark> bookmarks = KBookmarkDrag::decode(e); + + // copy + QValueList<KBookmark>::iterator it = bookmarks.begin(); + for (;it != bookmarks.end(); ++it) { + // insert new item. + parentGroup.moveItem(*it, afterBookmark); + } + + KonqBookmarkManager::self()->emitChanged( parentGroup ); +} + +void KonqSidebarBookmarkModule::slotCreateFolder() +{ + KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() ); + KBookmarkGroup parentGroup; + if (bi) + { + if (bi->bookmark().isGroup()) + parentGroup = bi->bookmark().toGroup(); + else + parentGroup = bi->bookmark().parentGroup(); + } + else if(tree()->selectedItem() == m_topLevelItem) + { + parentGroup = KonqBookmarkManager::self()->root(); + } + else + return; + + KBookmark bookmark = parentGroup.createNewFolder(KonqBookmarkManager::self()); + if(bi && !(bi->bookmark().isGroup())) + parentGroup.moveItem(bookmark, bi->bookmark()); + + KonqBookmarkManager::self()->emitChanged( parentGroup ); +} + +void KonqSidebarBookmarkModule::slotDelete() +{ + KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() ); + if (!bi) + return; + + KBookmark bookmark = bi->bookmark(); + bool folder = bookmark.isGroup(); + + if (KMessageBox::warningYesNo( + tree(), + folder ? i18n("Are you sure you wish to remove the bookmark folder\n\"%1\"?").arg(bookmark.text()) + : i18n("Are you sure you wish to remove the bookmark\n\"%1\"?").arg(bookmark.text()), + folder ? i18n("Bookmark Folder Deletion") + : i18n("Bookmark Deletion"), + KGuiItem( i18n("&Delete"), "editdelete"), KStdGuiItem::cancel()) + != KMessageBox::Yes + ) + return; + + KBookmarkGroup parentBookmark = bookmark.parentGroup(); + parentBookmark.deleteBookmark( bookmark ); + + KonqBookmarkManager::self()->emitChanged( parentBookmark ); +} + +void makeTextNodeMod(KBookmark bk, const QString &m_nodename, const QString &m_newText) { + QDomNode subnode = bk.internalElement().namedItem(m_nodename); + if (subnode.isNull()) { + subnode = bk.internalElement().ownerDocument().createElement(m_nodename); + bk.internalElement().appendChild(subnode); + } + + if (subnode.firstChild().isNull()) { + QDomText domtext = subnode.ownerDocument().createTextNode(""); + subnode.appendChild(domtext); + } + + QDomText domtext = subnode.firstChild().toText(); + + QString m_oldText = domtext.data(); + domtext.setData(m_newText); +} + +void KonqSidebarBookmarkModule::slotProperties(KonqSidebarBookmarkItem *bi) +{ + if (!bi) { + bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() ); + if (!bi) + return; + } + + KBookmark bookmark = bi->bookmark(); + + QString folder = bookmark.isGroup() ? QString::null : bookmark.url().pathOrURL(); + BookmarkEditDialog dlg( bookmark.fullText(), folder, 0, 0, + i18n("Bookmark Properties") ); + if ( dlg.exec() != KDialogBase::Accepted ) + return; + + makeTextNodeMod(bookmark, "title", dlg.finalTitle()); + if ( !dlg.finalUrl().isNull() ) + { + KURL u = KURL::fromPathOrURL(dlg.finalUrl()); + bookmark.internalElement().setAttribute("href", u.url(0, 106)); + } + + KBookmarkGroup parentBookmark = bookmark.parentGroup(); + KonqBookmarkManager::self()->emitChanged( parentBookmark ); +} + +void KonqSidebarBookmarkModule::slotOpenNewWindow() +{ + KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() ); + if (!bi) + return; + + emit tree()->createNewWindow( bi->bookmark().url() ); +} + +void KonqSidebarBookmarkModule::slotOpenTab() +{ + KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() ); + KBookmark bookmark; + if (bi) + { + bookmark = bi->bookmark(); + } + else if(tree()->selectedItem() == m_topLevelItem) + bookmark = KonqBookmarkManager::self()->root(); + else + return; + + DCOPRef ref(kapp->dcopClient()->appId(), tree()->topLevelWidget()->name()); + + if (bookmark.isGroup()) { + KBookmarkGroup group = bookmark.toGroup(); + bookmark = group.first(); + while (!bookmark.isNull()) { + if (!bookmark.isGroup() && !bookmark.isSeparator()) + ref.call( "newTab(QString)", bookmark.url().url() ); + bookmark = group.next(bookmark); + } + } else { + ref.call( "newTab(QString)", bookmark.url().url() ); + } +} + +void KonqSidebarBookmarkModule::slotCopyLocation() +{ + KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() ); + if (!bi) + return; + + KBookmark bookmark = bi->bookmark(); + + if ( !bookmark.isGroup() ) + { + kapp->clipboard()->setData( KBookmarkDrag::newDrag(bookmark, 0), + QClipboard::Selection ); + kapp->clipboard()->setData( KBookmarkDrag::newDrag(bookmark, 0), + QClipboard::Clipboard ); + } +} + +void KonqSidebarBookmarkModule::slotOpenChange(QListViewItem* i) +{ + if (m_ignoreOpenChange) + return; + + KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( i ); + if (!bi) + return; + + KBookmark bookmark = bi->bookmark(); + + bool open = bi->isOpen(); + + if (!open) + m_folderOpenState.remove(bookmark.address()); // no need to store closed folders... + else + m_folderOpenState[bookmark.address()] = open; +} + +void KonqSidebarBookmarkModule::slotBookmarksChanged( const QString & groupAddress ) +{ + m_ignoreOpenChange = true; + + // update the right part of the tree + KBookmarkGroup group = KonqBookmarkManager::self()->findByAddress( groupAddress ).toGroup(); + KonqSidebarBookmarkItem * item = findByAddress( groupAddress ); + Q_ASSERT(!group.isNull()); + Q_ASSERT(item); + if (!group.isNull() && item) + { + // Delete all children of item + QListViewItem * child = item->firstChild(); + while( child ) { + QListViewItem * next = child->nextSibling(); + delete child; + child = next; + } + fillGroup( item, group ); + } + + m_ignoreOpenChange = false; +} + +void KonqSidebarBookmarkModule::fillListView() +{ + m_ignoreOpenChange = true; + + KBookmarkGroup root = KonqBookmarkManager::self()->root(); + fillGroup( m_topLevelItem, root ); + + m_ignoreOpenChange = false; +} + +void KonqSidebarBookmarkModule::fillGroup( KonqSidebarTreeItem * parentItem, KBookmarkGroup group ) +{ + int n = 0; + for ( KBookmark bk = group.first() ; !bk.isNull() ; bk = group.next(bk), ++n ) + { + KonqSidebarBookmarkItem * item = new KonqSidebarBookmarkItem( parentItem, m_topLevelItem, bk, n ); + if ( bk.isGroup() ) + { + KBookmarkGroup grp = bk.toGroup(); + fillGroup( item, grp ); + + QString address(grp.address()); + if (m_folderOpenState.contains(address)) + item->setOpen(m_folderOpenState[address]); + else + item->setOpen(false); + } + else if ( bk.isSeparator() ) + item->setVisible( false ); + else + item->setExpandable( false ); + } +} + +// Borrowed from KEditBookmarks +KonqSidebarBookmarkItem * KonqSidebarBookmarkModule::findByAddress( const QString & address ) const +{ + QListViewItem * item = m_topLevelItem; + // The address is something like /5/10/2 + QStringList addresses = QStringList::split('/',address); + for ( QStringList::Iterator it = addresses.begin() ; it != addresses.end() ; ++it ) + { + uint number = (*it).toUInt(); + item = item->firstChild(); + for ( uint i = 0 ; i < number ; ++i ) + item = item->nextSibling(); + } + Q_ASSERT(item); + return static_cast<KonqSidebarBookmarkItem *>(item); +} + +// Borrowed&modified from KBookmarkMenu... +BookmarkEditDialog::BookmarkEditDialog(const QString& title, const QString& url, + QWidget * parent, const char * name, const QString& caption ) + : KDialogBase(parent, name, true, caption, + (Ok|Cancel), + Ok, false, KGuiItem()), + m_title(0), m_location(0) +{ + setButtonOK( i18n( "&Update" ) ); + + QWidget *main = new QWidget( this ); + setMainWidget( main ); + + bool folder = url.isNull(); + QGridLayout *grid = new QGridLayout( main, 2, folder?1:2, spacingHint() ); + + QLabel *nameLabel = new QLabel(i18n("Name:"), main, "title label"); + grid->addWidget(nameLabel, 0, 0); + m_title = new KLineEdit(main, "title edit"); + m_title->setText(title); + nameLabel->setBuddy(m_title); + grid->addWidget(m_title, 0, 1); + if(!folder) { + QLabel *locationLabel = new QLabel(i18n("Location:"), main, "location label"); + grid->addWidget(locationLabel, 1, 0); + m_location = new KLineEdit(main, "location edit"); + m_location->setText(url); + locationLabel->setBuddy(m_location); + grid->addWidget(m_location, 1, 1); + } + main->setMinimumSize( 300, 0 ); +} + +void BookmarkEditDialog::slotOk() +{ + accept(); +} + +void BookmarkEditDialog::slotCancel() +{ + reject(); +} + +QString BookmarkEditDialog::finalUrl() const +{ + if (m_location!=0) + return m_location->text(); + else + return QString::null; +} + +QString BookmarkEditDialog::finalTitle() const +{ + if (m_title!=0) + return m_title->text(); + else + return QString::null; +} + +extern "C" +{ + KDE_EXPORT KonqSidebarTreeModule* create_konq_sidebartree_bookmarks(KonqSidebarTree* par,const bool) + { + return new KonqSidebarBookmarkModule(par); + } +} + +#include "bookmark_module.moc" diff --git a/konqueror/sidebar/trees/bookmark_module/bookmark_module.h b/konqueror/sidebar/trees/bookmark_module/bookmark_module.h new file mode 100644 index 000000000..b38cdb540 --- /dev/null +++ b/konqueror/sidebar/trees/bookmark_module/bookmark_module.h @@ -0,0 +1,98 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef bookmark_module_h +#define bookmark_module_h + +#include <qmap.h> +#include <qobject.h> +#include <konq_sidebartreemodule.h> +#include <kbookmark.h> +#include <kdialogbase.h> +class KonqSidebarBookmarkItem; + +class KActionCollection; +class KLineEdit; + +/** + * This module displays bookmarks in the tree + */ +class KonqSidebarBookmarkModule : public QObject, public KonqSidebarTreeModule +{ + Q_OBJECT +public: + KonqSidebarBookmarkModule( KonqSidebarTree * parentTree ); + virtual ~KonqSidebarBookmarkModule(); + + // Handle this new toplevel item [can only be called once currently] + virtual void addTopLevelItem( KonqSidebarTreeTopLevelItem * item ); + virtual bool handleTopLevelContextMenu( KonqSidebarTreeTopLevelItem *, const QPoint& ); + + void showPopupMenu(); + + +protected slots: + void slotBookmarksChanged( const QString & ); + void slotMoved(QListViewItem*,QListViewItem*,QListViewItem*); + void slotDropped(KListView*,QDropEvent*,QListViewItem*,QListViewItem*); + void slotCreateFolder(); + void slotDelete(); + void slotProperties(KonqSidebarBookmarkItem *bi = 0); + void slotOpenNewWindow(); + void slotOpenTab(); + void slotCopyLocation(); + +protected: + void fillListView(); + void fillGroup( KonqSidebarTreeItem * parentItem, KBookmarkGroup group ); + KonqSidebarBookmarkItem * findByAddress( const QString & address ) const; + +private slots: + void slotOpenChange(QListViewItem*); + +private: + KonqSidebarTreeTopLevelItem * m_topLevelItem; + KonqSidebarBookmarkItem * m_rootItem; + + KActionCollection *m_collection; + + bool m_ignoreOpenChange; + QMap<QString, bool> m_folderOpenState; +}; + +class BookmarkEditDialog : public KDialogBase +{ + Q_OBJECT + +public: + BookmarkEditDialog( const QString& title, const QString& url, + QWidget * = 0, const char * = 0, + const QString& caption = i18n( "Add Bookmark" ) ); + + QString finalUrl() const; + QString finalTitle() const; + +protected slots: + void slotOk(); + void slotCancel(); + +private: + KLineEdit *m_title, *m_location; +}; + +#endif diff --git a/konqueror/sidebar/trees/dirtree_module/Makefile.am b/konqueror/sidebar/trees/dirtree_module/Makefile.am new file mode 100644 index 000000000..eb6cf061c --- /dev/null +++ b/konqueror/sidebar/trees/dirtree_module/Makefile.am @@ -0,0 +1,10 @@ +INCLUDES = -I$(top_srcdir)/libkonq -I$(srcdir)/.. -I$(srcdir)/../.. $(all_includes) + +kde_module_LTLIBRARIES = konq_sidebartree_dirtree.la + +METASOURCES = AUTO +konq_sidebartree_dirtree_la_SOURCES = dirtree_module.cpp dirtree_item.cpp +konq_sidebartree_dirtree_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +konq_sidebartree_dirtree_la_LIBADD = ../../libkonqsidebarplugin.la ../libkonq_sidebar_tree.la + + diff --git a/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp b/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp new file mode 100644 index 000000000..78132010a --- /dev/null +++ b/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp @@ -0,0 +1,245 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + Copyright (C) 2003 Waldo Bastian <bastian@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +//#include "konq_treepart.h" +#include "dirtree_item.h" +#include "dirtree_module.h" +#include <konq_operations.h> +#include <konq_drag.h> +#include <kdebug.h> +#include <kglobalsettings.h> +#include <kuserprofile.h> +#include <qapplication.h> +#include <qclipboard.h> +#include <kio/paste.h> +#include <qfile.h> +#include <qpainter.h> +#include <kiconloader.h> +#include <qcursor.h> + +#define MYMODULE static_cast<KonqSidebarDirTreeModule*>(module()) + +KonqSidebarDirTreeItem::KonqSidebarDirTreeItem( KonqSidebarTreeItem *parentItem, KonqSidebarTreeTopLevelItem *topLevelItem, KFileItem *fileItem ) + : KonqSidebarTreeItem( parentItem, topLevelItem ), m_fileItem( fileItem ) +{ + if ( m_topLevelItem ) + MYMODULE->addSubDir( this ); + reset(); +} + +KonqSidebarDirTreeItem::KonqSidebarDirTreeItem( KonqSidebarTree *parent, KonqSidebarTreeTopLevelItem *topLevelItem, KFileItem *fileItem ) + : KonqSidebarTreeItem( parent, topLevelItem ), m_fileItem( fileItem ) +{ + if ( m_topLevelItem ) + MYMODULE->addSubDir( this ); + reset(); +} + +KonqSidebarDirTreeItem::~KonqSidebarDirTreeItem() +{ +} + +void KonqSidebarDirTreeItem::reset() +{ + bool expandable = true; + // For local dirs, find out if they have no children, to remove the "+" + if ( m_fileItem->isDir() ) + { + KURL url = m_fileItem->url(); + if ( url.isLocalFile() ) + { + QCString path( QFile::encodeName(url.path())); + struct stat buff; + if ( ::stat( path.data(), &buff ) != -1 ) + { + //kdDebug() << "KonqSidebarDirTreeItem::init " << path << " : " << buff.st_nlink << endl; + // The link count for a directory is generally subdir_count + 2. + // One exception is if there are hard links to the directory, in this case + // the link count can be > 2 even if no subdirs exist. + // The other exception are smb (and maybe netware) mounted directories + // of which the link count is always 1. Therefore, we only set the item + // as non-expandable if it's exactly 2 (one link from the parent dir, + // plus one from the '.' entry). + if ( buff.st_nlink == 2 ) + expandable = false; + } + } + } + setExpandable( expandable ); + id = m_fileItem->url().url(-1); +} + +void KonqSidebarDirTreeItem::setOpen( bool open ) +{ + kdDebug(1201) << "KonqSidebarDirTreeItem::setOpen " << open << endl; + if ( open && !childCount() && m_bListable ) + MYMODULE->openSubFolder( this ); + else if ( hasStandardIcon() ) + { + int size = KGlobal::iconLoader()->currentSize( KIcon::Small ); + if ( open ) + setPixmap( 0, DesktopIcon( "folder_open", size ) ); + else + setPixmap( 0, m_fileItem->pixmap( size ) ); + } + KonqSidebarTreeItem::setOpen( open ); +} + +bool KonqSidebarDirTreeItem::hasStandardIcon() +{ + // The reason why we can't use KFileItem::iconName() is that it doesn't + // take custom icons in .directory files into account + return m_fileItem->determineMimeType()->icon( m_fileItem->url(), m_fileItem->isLocalFile() ) == "folder"; +} + +void KonqSidebarDirTreeItem::paintCell( QPainter *_painter, const QColorGroup & _cg, int _column, int _width, int _alignment ) +{ + if (m_fileItem->isLink()) + { + QFont f( _painter->font() ); + f.setItalic( TRUE ); + _painter->setFont( f ); + } + QListViewItem::paintCell( _painter, _cg, _column, _width, _alignment ); +} + +KURL KonqSidebarDirTreeItem::externalURL() const +{ + return m_fileItem->url(); +} + +QString KonqSidebarDirTreeItem::externalMimeType() const +{ + if (m_fileItem->isMimeTypeKnown()) + return m_fileItem->mimetype(); + else + return QString::null; +} + +bool KonqSidebarDirTreeItem::acceptsDrops( const QStrList & formats ) +{ + if ( formats.contains("text/uri-list") ) + return m_fileItem->acceptsDrops(); + return false; +} + +void KonqSidebarDirTreeItem::drop( QDropEvent * ev ) +{ + KonqOperations::doDrop( m_fileItem, externalURL(), ev, tree() ); +} + +QDragObject * KonqSidebarDirTreeItem::dragObject( QWidget * parent, bool move ) +{ + KURL::List lst; + lst.append( m_fileItem->url() ); + + KonqDrag * drag = KonqDrag::newDrag( lst, false, parent ); + drag->setMoveSelection( move ); + + return drag; +} + +void KonqSidebarDirTreeItem::itemSelected() +{ + bool bInTrash = false; + + if ( m_fileItem->url().directory(false) == KGlobalSettings::trashPath() ) + bInTrash = true; + + QMimeSource *data = QApplication::clipboard()->data(); + bool paste = ( data->encodedData( data->format() ).size() != 0 ); + + tree()->enableActions( true, true, paste, true && !bInTrash, true, true ); +} + +void KonqSidebarDirTreeItem::middleButtonClicked() +{ + // Duplicated from KonqDirPart :( + // Optimisation to avoid KRun to call kfmclient that then tells us + // to open a window :-) + KService::Ptr offer = KServiceTypeProfile::preferredService(m_fileItem->mimetype(), "Application"); + if (offer) kdDebug(1201) << "KonqDirPart::mmbClicked: got service " << offer->desktopEntryName() << endl; + if ( offer && offer->desktopEntryName().startsWith("kfmclient") ) + { + kdDebug(1201)<<"Emitting createNewWindow"<<endl; + KParts::URLArgs args; + args.serviceType = m_fileItem->mimetype(); + emit tree()->createNewWindow( m_fileItem->url(), args ); + } + else + m_fileItem->run(); +} + +void KonqSidebarDirTreeItem::rightButtonPressed() +{ + KFileItemList lstItems; + lstItems.append( m_fileItem ); + emit tree()->popupMenu( QCursor::pos(), lstItems ); +} + +void KonqSidebarDirTreeItem::paste() +{ + // move or not move ? + bool move = false; + QMimeSource *data = QApplication::clipboard()->data(); + if ( data->provides( "application/x-kde-cutselection" ) ) { + move = KonqDrag::decodeIsCutSelection( data ); + kdDebug(1201) << "move (from clipboard data) = " << move << endl; + } + + KIO::pasteClipboard( m_fileItem->url(), move ); +} + +void KonqSidebarDirTreeItem::trash() +{ + delOperation( KonqOperations::TRASH ); +} + +void KonqSidebarDirTreeItem::del() +{ + delOperation( KonqOperations::DEL ); +} + +void KonqSidebarDirTreeItem::shred() +{ + delOperation( KonqOperations::SHRED ); +} + +void KonqSidebarDirTreeItem::delOperation( int method ) +{ + KURL::List lst; + lst.append(m_fileItem->url()); + + KonqOperations::del(tree(), method, lst); +} + +QString KonqSidebarDirTreeItem::toolTipText() const +{ + return m_fileItem->url().pathOrURL(); +} + +void KonqSidebarDirTreeItem::rename() +{ + tree()->rename( this, 0 ); +} + +void KonqSidebarDirTreeItem::rename( const QString & name ) +{ + KonqOperations::rename( tree(), m_fileItem->url(), name ); +} diff --git a/konqueror/sidebar/trees/dirtree_module/dirtree_item.h b/konqueror/sidebar/trees/dirtree_module/dirtree_item.h new file mode 100644 index 000000000..fe98595e6 --- /dev/null +++ b/konqueror/sidebar/trees/dirtree_module/dirtree_item.h @@ -0,0 +1,73 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef dirtree_item_h +#define dirtree_item_h + +#include "konq_sidebartreeitem.h" +#include <kurl.h> +#include <qstringlist.h> +class QDropEvent; +class KFileItem; + +class KonqSidebarDirTreeItem : public KonqSidebarTreeItem +{ +public: + KonqSidebarDirTreeItem( KonqSidebarTreeItem *parentItem, KonqSidebarTreeTopLevelItem *topLevelItem, KFileItem *fileItem ); + KonqSidebarDirTreeItem( KonqSidebarTree *parent, KonqSidebarTreeTopLevelItem *topLevelItem, KFileItem *fileItem ); + ~KonqSidebarDirTreeItem(); + + KFileItem *fileItem() const { return m_fileItem; } + + virtual void setOpen( bool open ); + + virtual void paintCell( QPainter *_painter, const QColorGroup & _cg, int _column, int _width, int _alignment ); + + virtual bool acceptsDrops( const QStrList & formats ); + virtual void drop( QDropEvent * ev ); + virtual QDragObject * dragObject( QWidget * parent, bool move = false ); + + virtual void middleButtonClicked(); + virtual void rightButtonPressed(); + + virtual void paste(); + virtual void trash(); + virtual void del(); + virtual void shred(); + virtual void rename(); // start a rename operation + void rename( const QString & name ); // do the actual renaming + + // The URL to open when this link is clicked + virtual KURL externalURL() const; + virtual QString externalMimeType() const; + virtual QString toolTipText() const; + + virtual void itemSelected(); + + void reset(); + + bool hasStandardIcon(); + + QString id; + +private: + void delOperation( int method ); + KFileItem *m_fileItem; +}; + +#endif diff --git a/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp b/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp new file mode 100644 index 000000000..725927362 --- /dev/null +++ b/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp @@ -0,0 +1,649 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + 2002 Michael Brade <brade@kde.org> + Copyright (C) 2003 Waldo Bastian <bastian@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "dirtree_module.h" +#include "dirtree_item.h" +#include <kdebug.h> +#include <kprotocolinfo.h> +#include <kdesktopfile.h> +#include <kmessagebox.h> +#include <kiconloader.h> +#include <kdirlister.h> +#include "konqsidebariface_p.h" + + +KonqSidebarDirTreeModule::KonqSidebarDirTreeModule( KonqSidebarTree * parentTree , bool showHidden) + : KonqSidebarTreeModule( parentTree, showHidden ), m_dirLister(0L), m_topLevelItem(0L) +{ + bool universalMode=false; + /* Doesn't work reliable :-( + + KonqSidebarPlugin * plugin = parentTree->part(); + // KonqSidebarPlugin::universalMode() is protected :-| + if ( plugin->parent() ) { + KonqSidebarIface * ksi = static_cast<KonqSidebarIface*>( plugin->parent()->qt_cast( "KonqSidebarIface" ) ); + universalMode = ksi ? ksi->universalMode() : false; + } */ + + KConfig * config = new KConfig( universalMode ? "konqsidebartng_kicker.rc" : "konqsidebartng.rc" ); + config->setGroup(""); + m_showArchivesAsFolders = config->readBoolEntry("ShowArchivesAsFolders",true); + delete config; +} + +KonqSidebarDirTreeModule::~KonqSidebarDirTreeModule() +{ + // KDirLister may still emit canceled while being deleted. + if (m_dirLister) + { + disconnect( m_dirLister, SIGNAL( canceled( const KURL & ) ), + this, SLOT( slotListingStopped( const KURL & ) ) ); + delete m_dirLister; + } +} + +KURL::List KonqSidebarDirTreeModule::selectedUrls() +{ + KURL::List lst; + KonqSidebarDirTreeItem *selection = static_cast<KonqSidebarDirTreeItem *>( m_pTree->selectedItem() ); + if( !selection ) + { + kdError() << "KonqSidebarDirTreeModule::selectedUrls: no selection!" << endl; + return lst; + } + lst.append(selection->fileItem()->url()); + return lst; +} + +void KonqSidebarDirTreeModule::addTopLevelItem( KonqSidebarTreeTopLevelItem * item ) +{ + if(m_topLevelItem) // We can handle only one at a time ! + kdError() << "KonqSidebarDirTreeModule::addTopLevelItem: Impossible, we can have only one toplevel item !" << endl; + + KDesktopFile cfg( item->path(), true ); + cfg.setDollarExpansion(true); + + KURL targetURL; + targetURL.setPath(item->path()); + + if ( cfg.hasLinkType() ) + { + targetURL = cfg.readURL(); + // some services might want to make their URL configurable in kcontrol + QString configured = cfg.readEntry("X-KDE-ConfiguredURL"); + if (!configured.isEmpty()) { + QStringList list = QStringList::split(':', configured); + KConfig config(list[0]); + if (list[1] != "noGroup") config.setGroup(list[1]); + QString conf_url = config.readEntry(list[2]); + if (!conf_url.isEmpty()) { + targetURL = conf_url; + } + } + } + else if ( cfg.hasDeviceType() ) + { + // Determine the mountpoint + QString mp = cfg.readEntry("MountPoint"); + if ( mp.isEmpty() ) + return; + + targetURL.setPath(mp); + } + else + return; + + bool bListable = KProtocolInfo::supportsListing( targetURL ); + //kdDebug(1201) << targetURL.prettyURL() << " listable : " << bListable << endl; + + if ( !bListable ) + { + item->setExpandable( false ); + item->setListable( false ); + } + + item->setExternalURL( targetURL ); + addSubDir( item ); + + m_topLevelItem = item; +} + +void KonqSidebarDirTreeModule::openTopLevelItem( KonqSidebarTreeTopLevelItem * item ) +{ + if ( !item->childCount() && item->isListable() ) + openSubFolder( item ); +} + +void KonqSidebarDirTreeModule::addSubDir( KonqSidebarTreeItem *item ) +{ + QString id = item->externalURL().url(-1); + kdDebug(1201) << this << " KonqSidebarDirTreeModule::addSubDir " << id << endl; + m_dictSubDirs.insert(id, item ); + + KonqSidebarDirTreeItem *ditem = dynamic_cast<KonqSidebarDirTreeItem*>(item); + if (ditem) + m_ptrdictSubDirs.insert(ditem->fileItem(), item); +} + +// Remove <key, item> from dict, taking into account that there maybe +// other items with the same key. +static void remove(QDict<KonqSidebarTreeItem> &dict, const QString &key, KonqSidebarTreeItem *item) +{ + QPtrList<KonqSidebarTreeItem> *otherItems = 0; + while(true) { + KonqSidebarTreeItem *takeItem = dict.take(key); + if (!takeItem || (takeItem == item)) + { + if (!otherItems) + return; + + // Insert the otherItems back in + for(KonqSidebarTreeItem *otherItem; (otherItem = otherItems->take(0));) + { + dict.insert(key, otherItem); + } + delete otherItems; + return; + } + // Not the item we are looking for + if (!otherItems) + otherItems = new QPtrList<KonqSidebarTreeItem>(); + + otherItems->prepend(takeItem); + } +} + +// Looks up key in dict and returns it in item, if there are multiple items +// with the same key, additional items are returned in itemList which should +// be deleted by the caller. +static void lookupItems(QDict<KonqSidebarTreeItem> &dict, const QString &key, KonqSidebarTreeItem *&item, QPtrList<KonqSidebarTreeItem> *&itemList) +{ + itemList = 0; + item = dict.take(key); + if (!item) + return; + + while(true) + { + KonqSidebarTreeItem *takeItem = dict.take(key); + if (!takeItem) + { + // + // Insert itemList back in + if (itemList) + { + for(KonqSidebarTreeItem *otherItem = itemList->first(); otherItem; otherItem = itemList->next()) + dict.insert(key, otherItem); + } + dict.insert(key, item); + return; + } + if (!itemList) + itemList = new QPtrList<KonqSidebarTreeItem>(); + + itemList->prepend(takeItem); + } +} + +// Remove <key, item> from dict, taking into account that there maybe +// other items with the same key. +static void remove(QPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSidebarTreeItem *item) +{ + QPtrList<KonqSidebarTreeItem> *otherItems = 0; + while(true) { + KonqSidebarTreeItem *takeItem = dict.take(key); + if (!takeItem || (takeItem == item)) + { + if (!otherItems) + return; + + // Insert the otherItems back in + for(KonqSidebarTreeItem *otherItem; (otherItem = otherItems->take(0));) + { + dict.insert(key, otherItem); + } + delete otherItems; + return; + } + // Not the item we are looking for + if (!otherItems) + otherItems = new QPtrList<KonqSidebarTreeItem>(); + + otherItems->prepend(takeItem); + } +} + +// Looks up key in dict and returns it in item, if there are multiple items +// with the same key, additional items are returned in itemList which should +// be deleted by the caller. +static void lookupItems(QPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSidebarTreeItem *&item, QPtrList<KonqSidebarTreeItem> *&itemList) +{ + itemList = 0; + item = dict.take(key); + if (!item) + return; + + while(true) + { + KonqSidebarTreeItem *takeItem = dict.take(key); + if (!takeItem) + { + // + // Insert itemList back in + if (itemList) + { + for(KonqSidebarTreeItem *otherItem = itemList->first(); otherItem; otherItem = itemList->next()) + dict.insert(key, otherItem); + } + dict.insert(key, item); + return; + } + if (!itemList) + itemList = new QPtrList<KonqSidebarTreeItem>(); + + itemList->prepend(takeItem); + } +} + + +void KonqSidebarDirTreeModule::removeSubDir( KonqSidebarTreeItem *item, bool childrenOnly ) +{ + kdDebug(1201) << this << " KonqSidebarDirTreeModule::removeSubDir item=" << item << endl; + if ( item->firstChild() ) + { + KonqSidebarTreeItem * it = static_cast<KonqSidebarTreeItem *>(item->firstChild()); + KonqSidebarTreeItem * next = 0L; + while ( it ) { + next = static_cast<KonqSidebarTreeItem *>(it->nextSibling()); + removeSubDir( it ); + delete it; + it = next; + } + } + + if ( !childrenOnly ) + { + QString id = item->externalURL().url(-1); + remove(m_dictSubDirs, id, item); + while (!(item->alias.isEmpty())) + { + remove(m_dictSubDirs, item->alias.front(), item); + item->alias.pop_front(); + } + + KonqSidebarDirTreeItem *ditem = dynamic_cast<KonqSidebarDirTreeItem*>(item); + if (ditem) + remove(m_ptrdictSubDirs, ditem->fileItem(), item); + } +} + + +void KonqSidebarDirTreeModule::openSubFolder( KonqSidebarTreeItem *item ) +{ + kdDebug(1201) << this << " openSubFolder( " << item->externalURL().prettyURL() << " )" << endl; + + if ( !m_dirLister ) // created on demand + { + m_dirLister = new KDirLister( true ); + //m_dirLister->setDirOnlyMode( true ); +// QStringList mimetypes; +// mimetypes<<QString("inode/directory"); +// m_dirLister->setMimeFilter(mimetypes); + + connect( m_dirLister, SIGNAL( newItems( const KFileItemList & ) ), + this, SLOT( slotNewItems( const KFileItemList & ) ) ); + connect( m_dirLister, SIGNAL( refreshItems( const KFileItemList & ) ), + this, SLOT( slotRefreshItems( const KFileItemList & ) ) ); + connect( m_dirLister, SIGNAL( deleteItem( KFileItem * ) ), + this, SLOT( slotDeleteItem( KFileItem * ) ) ); + connect( m_dirLister, SIGNAL( completed( const KURL & ) ), + this, SLOT( slotListingStopped( const KURL & ) ) ); + connect( m_dirLister, SIGNAL( canceled( const KURL & ) ), + this, SLOT( slotListingStopped( const KURL & ) ) ); + connect( m_dirLister, SIGNAL( redirection( const KURL &, const KURL & ) ), + this, SLOT( slotRedirection( const KURL &, const KURL & ) ) ); + } + + + if ( !item->isTopLevelItem() && + static_cast<KonqSidebarDirTreeItem *>(item)->hasStandardIcon() ) + { + int size = KGlobal::iconLoader()->currentSize( KIcon::Small ); + QPixmap pix = DesktopIcon( "folder_open", size ); + m_pTree->startAnimation( item, "kde", 6, &pix ); + } + else + m_pTree->startAnimation( item ); + + listDirectory( item ); +} + +void KonqSidebarDirTreeModule::listDirectory( KonqSidebarTreeItem *item ) +{ + // This causes a reparsing, but gets rid of the trailing slash + QString strUrl = item->externalURL().url(-1); + KURL url( strUrl ); + + QPtrList<KonqSidebarTreeItem> *itemList; + KonqSidebarTreeItem * openItem; + lookupItems(m_dictSubDirs, strUrl, openItem, itemList); + + while(openItem) + { + if (openItem->childCount()) + break; + + openItem = itemList ? itemList->take(0) : 0; + } + delete itemList; + + if (openItem) + { + // We have this directory listed already, just copy the entries as we + // can't use the dirlister, it would invalidate the old entries + int size = KGlobal::iconLoader()->currentSize( KIcon::Small ); + KonqSidebarTreeItem * parentItem = item; + KonqSidebarDirTreeItem *oldItem = static_cast<KonqSidebarDirTreeItem *> (openItem->firstChild()); + while(oldItem) + { + KFileItem * fileItem = oldItem->fileItem(); + if (! fileItem->isDir() ) + { + KMimeType::Ptr ptr; + + if ( fileItem->url().isLocalFile() && (((ptr=fileItem->determineMimeType())!=0) && (ptr->is("inode/directory") || m_showArchivesAsFolders) && ((!ptr->property("X-KDE-LocalProtocol").toString().isEmpty()) ))) { + kdDebug()<<"Something not really a directory"<<endl; + } else { +// kdError() << "Item " << fileItem->url().prettyURL() << " is not a directory!" << endl; + continue; + } + } + + KonqSidebarDirTreeItem *dirTreeItem = new KonqSidebarDirTreeItem( parentItem, m_topLevelItem, fileItem ); + dirTreeItem->setPixmap( 0, fileItem->pixmap( size ) ); + dirTreeItem->setText( 0, KIO::decodeFileName( fileItem->name() ) ); + + oldItem = static_cast<KonqSidebarDirTreeItem *> (oldItem->nextSibling()); + } + m_pTree->stopAnimation( item ); + + return; + } + + m_dirLister->setShowingDotFiles( showHidden()); + + if (tree()->isOpeningFirstChild()) m_dirLister->setAutoErrorHandlingEnabled(false,0); + else m_dirLister->setAutoErrorHandlingEnabled(true,tree()); + + m_dirLister->openURL( url, true /*keep*/ ); +} + +void KonqSidebarDirTreeModule::slotNewItems( const KFileItemList& entries ) +{ + kdDebug(1201) << this << " KonqSidebarDirTreeModule::slotNewItems " << entries.count() << endl; + + Q_ASSERT(entries.count()); + KFileItem * firstItem = const_cast<KFileItemList&>(entries).first(); // qlist sucks for constness + + // Find parent item - it's the same for all the items + KURL dir( firstItem->url().url(-1) ); + dir.setFileName( "" ); + kdDebug(1201) << this << " KonqSidebarDirTreeModule::slotNewItems dir=" << dir.url(-1) << endl; + + QPtrList<KonqSidebarTreeItem> *parentItemList; + KonqSidebarTreeItem * parentItem; + lookupItems(m_dictSubDirs, dir.url(-1), parentItem, parentItemList); + + if ( !parentItem ) // hack for dnssd://domain/type/service listed in dnssd:/type/ dir + { + dir.setHost( QString::null ); + lookupItems( m_dictSubDirs, dir.url(-1), parentItem, parentItemList ); + } + + if( !parentItem ) + { + KMessageBox::error( tree(), i18n("Cannot find parent item %1 in the tree. Internal error.").arg( dir.url(-1) ) ); + return; + } + + kdDebug()<<"number of additional parent items:"<< (parentItemList?parentItemList->count():0)<<endl; + int size = KGlobal::iconLoader()->currentSize( KIcon::Small ); + do + { + kdDebug()<<"Parent Item URL:"<<parentItem->externalURL()<<endl; + QPtrListIterator<KFileItem> kit ( entries ); + for( ; kit.current(); ++kit ) + { + KFileItem * fileItem = *kit; + + if (! fileItem->isDir() ) + { + KMimeType::Ptr ptr; + + if ( fileItem->url().isLocalFile() && (( (ptr=fileItem->determineMimeType())!=0) && (ptr->is("inode/directory") || m_showArchivesAsFolders) && ((!ptr->property("X-KDE-LocalProtocol").toString().isEmpty()) ))) { + kdDebug()<<"Something really a directory"<<endl; + } else { + //kdError() << "Item " << fileItem->url().prettyURL() << " is not a directory!" << endl; + continue; + } + } + + KonqSidebarDirTreeItem *dirTreeItem = new KonqSidebarDirTreeItem( parentItem, m_topLevelItem, fileItem ); + dirTreeItem->setPixmap( 0, fileItem->pixmap( size ) ); + dirTreeItem->setText( 0, KIO::decodeFileName( fileItem->name() ) ); + } + + } while ((parentItem = parentItemList ? parentItemList->take(0) : 0)); + delete parentItemList; +} + +void KonqSidebarDirTreeModule::slotRefreshItems( const KFileItemList &entries ) +{ + int size = KGlobal::iconLoader()->currentSize( KIcon::Small ); + + QPtrListIterator<KFileItem> kit ( entries ); + kdDebug(1201) << "KonqSidebarDirTreeModule::slotRefreshItems " << entries.count() << " entries. First: " << kit.current()->url().url() << endl; + for( ; kit.current(); ++kit ) + { + KFileItem *fileItem = kit.current(); + + QPtrList<KonqSidebarTreeItem> *itemList; + KonqSidebarTreeItem * item; + lookupItems(m_ptrdictSubDirs, fileItem, item, itemList); + + if (!item) + { + if ( fileItem->isDir() ) // don't warn for files + kdWarning(1201) << "KonqSidebarDirTreeModule::slotRefreshItems can't find old entry for " << kit.current()->url().url(-1) << endl; + continue; + } + + do + { + if ( item->isTopLevelItem() ) // we only have dirs and one toplevel item in the dict + { + kdWarning(1201) << "KonqSidebarDirTreeModule::slotRefreshItems entry for " << kit.current()->url().url(-1) << " matches against toplevel." << endl; + break; + } + + KonqSidebarDirTreeItem * dirTreeItem = static_cast<KonqSidebarDirTreeItem *>(item); + // Item renamed ? + if ( dirTreeItem->id != fileItem->url().url( -1 ) ) + { + // We need to update the URL in m_dictSubDirs, and to get rid of the child items, so remove and add. + // Then remove + delete + removeSubDir( dirTreeItem, true /*children only*/ ); + remove(m_dictSubDirs, dirTreeItem->id, dirTreeItem); + + dirTreeItem->reset(); // Reset id + dirTreeItem->setPixmap( 0, fileItem->pixmap( size ) ); + dirTreeItem->setText( 0, KIO::decodeFileName( fileItem->name() ) ); + + // Make sure the item doesn't get inserted twice! + // dirTreeItem->id points to the new name + remove(m_dictSubDirs, dirTreeItem->id, dirTreeItem); + m_dictSubDirs.insert(dirTreeItem->id, dirTreeItem); + } + else + { + dirTreeItem->setPixmap( 0, fileItem->pixmap( size ) ); + dirTreeItem->setText( 0, KIO::decodeFileName( fileItem->name() ) ); + } + + } while ((item = itemList ? itemList->take(0) : 0)); + delete itemList; + } +} + +void KonqSidebarDirTreeModule::slotDeleteItem( KFileItem *fileItem ) +{ + kdDebug(1201) << "KonqSidebarDirTreeModule::slotDeleteItem( " << fileItem->url().url(-1) << " )" << endl; + + // All items are in m_ptrdictSubDirs, so look it up fast + QPtrList<KonqSidebarTreeItem> *itemList; + KonqSidebarTreeItem * item; + lookupItems(m_ptrdictSubDirs, fileItem, item, itemList); + while(item) + { + removeSubDir( item ); + delete item; + + item = itemList ? itemList->take(0) : 0; + } + delete itemList; +} + +void KonqSidebarDirTreeModule::slotRedirection( const KURL & oldUrl, const KURL & newUrl ) +{ + kdDebug(1201) << "******************************KonqSidebarDirTreeModule::slotRedirection(" << newUrl.prettyURL() << ")" << endl; + + QString oldUrlStr = oldUrl.url(-1); + QString newUrlStr = newUrl.url(-1); + + QPtrList<KonqSidebarTreeItem> *itemList; + KonqSidebarTreeItem * item; + lookupItems(m_dictSubDirs, oldUrlStr, item, itemList); + + if (!item) + { + kdWarning(1201) << "NOT FOUND oldUrl=" << oldUrlStr << endl; + return; + } + + do + { + if (item->alias.contains(newUrlStr)) continue; + kdDebug()<<"Redirectiong element"<<endl; + // We need to update the URL in m_dictSubDirs + m_dictSubDirs.insert( newUrlStr, item ); + item->alias << newUrlStr; + + kdDebug(1201) << "Updating url of " << item << " to " << newUrlStr << endl; + + } while ((item = itemList ? itemList->take(0) : 0)); + delete itemList; +} + +void KonqSidebarDirTreeModule::slotListingStopped( const KURL & url ) +{ + kdDebug(1201) << "KonqSidebarDirTree::slotListingStopped " << url.url(-1) << endl; + + QPtrList<KonqSidebarTreeItem> *itemList; + KonqSidebarTreeItem * item; + lookupItems(m_dictSubDirs, url.url(-1), item, itemList); + + while(item) + { + if ( item->childCount() == 0 ) + { + item->setExpandable( false ); + item->repaint(); + } + m_pTree->stopAnimation( item ); + + item = itemList ? itemList->take(0) : 0; + } + delete itemList; + + kdDebug(1201) << "m_selectAfterOpening " << m_selectAfterOpening.prettyURL() << endl; + if ( !m_selectAfterOpening.isEmpty() && url.isParentOf( m_selectAfterOpening ) ) + { + KURL theURL( m_selectAfterOpening ); + m_selectAfterOpening = KURL(); + followURL( theURL ); + } +} + +void KonqSidebarDirTreeModule::followURL( const KURL & url ) +{ + // Check if we already know this URL + KonqSidebarTreeItem * item = m_dictSubDirs[ url.url(-1) ]; + if (item) // found it -> ensure visible, select, return. + { + m_pTree->ensureItemVisible( item ); + m_pTree->setSelected( item, true ); + return; + } + + KURL uParent( url ); + KonqSidebarTreeItem * parentItem = 0L; + // Go up to the first known parent + do + { + uParent = uParent.upURL(); + parentItem = m_dictSubDirs[ uParent.url(-1) ]; + } while ( !parentItem && !uParent.path().isEmpty() && uParent.path() != "/" ); + + // Not found !?! + if (!parentItem) + { + kdDebug() << "No parent found for url " << url.prettyURL() << endl; + return; + } + kdDebug(1202) << "Found parent " << uParent.prettyURL() << endl; + + // That's the parent directory we found. Open if not open... + if ( !parentItem->isOpen() ) + { + parentItem->setOpen( true ); + if ( parentItem->childCount() && m_dictSubDirs[ url.url(-1) ] ) + { + // Immediate opening, if the dir was already listed + followURL( url ); // equivalent to a goto-beginning-of-method + } else + { + m_selectAfterOpening = url; + kdDebug(1202) << "KonqSidebarDirTreeModule::followURL: m_selectAfterOpening=" << m_selectAfterOpening.url() << endl; + } + } +} + + +extern "C" +{ + KDE_EXPORT KonqSidebarTreeModule *create_konq_sidebartree_dirtree(KonqSidebarTree* par,const bool showHidden) + { + return new KonqSidebarDirTreeModule(par,showHidden); + } +} + + + +#include "dirtree_module.moc" diff --git a/konqueror/sidebar/trees/dirtree_module/dirtree_module.h b/konqueror/sidebar/trees/dirtree_module/dirtree_module.h new file mode 100644 index 000000000..dc46d3b9e --- /dev/null +++ b/konqueror/sidebar/trees/dirtree_module/dirtree_module.h @@ -0,0 +1,82 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef dirtree_module_h +#define dirtree_module_h + +#include <konq_sidebartreemodule.h> +#include <kfileitem.h> +#include <qpixmap.h> +#include <qdict.h> +#include <qptrdict.h> + +class KDirLister; +class KonqSidebarTree; +class KonqSidebarTreeItem; +class KonqSidebarDirTreeItem; +class KonqPropsView; + +class KonqSidebarDirTreeModule : public QObject, public KonqSidebarTreeModule +{ + Q_OBJECT +public: + KonqSidebarDirTreeModule( KonqSidebarTree * parentTree, bool ); + virtual ~KonqSidebarDirTreeModule(); + + virtual void addTopLevelItem( KonqSidebarTreeTopLevelItem * item ); + + virtual void openTopLevelItem( KonqSidebarTreeTopLevelItem * item ); + + virtual void followURL( const KURL & url ); + + // Called by KonqSidebarDirTreeItem + void openSubFolder( KonqSidebarTreeItem *item ); + void addSubDir( KonqSidebarTreeItem *item ); + void removeSubDir( KonqSidebarTreeItem *item, bool childrenonly = false ); + +private slots: + void slotNewItems( const KFileItemList & ); + void slotRefreshItems( const KFileItemList & ); + void slotDeleteItem( KFileItem *item ); + void slotRedirection( const KURL & oldUrl, const KURL & newUrl ); + void slotListingStopped( const KURL & url ); + +private: + //KonqSidebarTreeItem * findDir( const KURL &_url ); + void listDirectory( KonqSidebarTreeItem *item ); + KURL::List selectedUrls(); + + // URL -> item + // Each KonqSidebarDirTreeItem is indexed on item->id() and + // all item->alias'es + QDict<KonqSidebarTreeItem> m_dictSubDirs; + + // KFileItem -> item + QPtrDict<KonqSidebarTreeItem> m_ptrdictSubDirs; + + KDirLister * m_dirLister; + + KURL m_selectAfterOpening; + + KonqSidebarTreeTopLevelItem * m_topLevelItem; + + bool m_showArchivesAsFolders; +}; + + +#endif diff --git a/konqueror/sidebar/trees/history_module/Makefile.am b/konqueror/sidebar/trees/history_module/Makefile.am new file mode 100644 index 000000000..5f033d662 --- /dev/null +++ b/konqueror/sidebar/trees/history_module/Makefile.am @@ -0,0 +1,16 @@ +INCLUDES = -I$(top_srcdir)/libkonq -I$(srcdir)/.. -I$(srcdir)/../.. $(all_includes) + +kde_module_LTLIBRARIES = konq_sidebartree_history.la kcm_history.la + +METASOURCES = AUTO + +konq_sidebartree_history_la_SOURCES = history_module.cpp history_item.cpp \ + history_settings.cpp history_settings.skel +konq_sidebartree_history_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +konq_sidebartree_history_la_LIBADD = ../../libkonqsidebarplugin.la ../libkonq_sidebar_tree.la + +kcm_history_la_SOURCES = kcmhistory.cpp history_dlg.ui history_settings.cpp history_settings.skel +kcm_history_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +kcm_history_la_LIBADD = -lkdeui $(top_builddir)/libkonq/libkonq.la + +xdg_apps_DATA = kcmhistory.desktop diff --git a/konqueror/sidebar/trees/history_module/history_dlg.ui b/konqueror/sidebar/trees/history_module/history_dlg.ui new file mode 100644 index 000000000..32fd31296 --- /dev/null +++ b/konqueror/sidebar/trees/history_module/history_dlg.ui @@ -0,0 +1,239 @@ +<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> +<class>KonqSidebarHistoryDlg</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KonqHistoryDlg</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>450</width> + <height>290</height> + </rect> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <widget class="QGroupBox"> + <property name="name"> + <cstring>gbLimits</cstring> + </property> + <property name="title"> + <string>Limits</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <spacer row="1" column="2"> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>240</width> + <height>16</height> + </size> + </property> + </spacer> + <widget class="QCheckBox" row="1" column="0"> + <property name="name"> + <cstring>cbExpire</cstring> + </property> + <property name="text"> + <string>URLs e&xpire after</string> + </property> + </widget> + <widget class="KIntNumInput" row="1" column="1"> + <property name="name"> + <cstring>spinExpire</cstring> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>lEntries</cstring> + </property> + <property name="text"> + <string>Maximum &number of URLs:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>spinEntries</cstring> + </property> + </widget> + <widget class="KIntNumInput" row="0" column="1"> + <property name="name"> + <cstring>spinEntries</cstring> + </property> + </widget> + </grid> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>gbFonts</cstring> + </property> + <property name="title"> + <string>Custom Fonts For</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KIntNumInput" row="0" column="1"> + <property name="name"> + <cstring>spinNewer</cstring> + </property> + </widget> + <widget class="KIntNumInput" row="1" column="1"> + <property name="name"> + <cstring>spinOlder</cstring> + </property> + </widget> + <widget class="QComboBox" row="1" column="2"> + <property name="name"> + <cstring>comboOlder</cstring> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>lbNewer</cstring> + </property> + <property name="text"> + <string>URLs newer than</string> + </property> + </widget> + <widget class="QComboBox" row="0" column="2"> + <property name="name"> + <cstring>comboNewer</cstring> + </property> + </widget> + <widget class="QPushButton" row="1" column="3"> + <property name="name"> + <cstring>btnFontOlder</cstring> + </property> + <property name="text"> + <string>Choose Font...</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>lbOlder</cstring> + </property> + <property name="text"> + <string>URLs older than</string> + </property> + </widget> + <widget class="QPushButton" row="0" column="3"> + <property name="name"> + <cstring>btnFontNewer</cstring> + </property> + <property name="text"> + <string>Choose Font...</string> + </property> + </widget> + </grid> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>gbDetails</cstring> + </property> + <property name="title"> + <string>Details</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>cbDetailedTips</cstring> + </property> + <property name="text"> + <string>Detailed tooltips</string> + </property> + <property name="toolTip" stdset="0"> + <string>Shows the number of times visited and the dates of the first and last visits, in addition to the URL</string> + </property> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout4</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QPushButton"> + <property name="name"> + <cstring>btnClearHistory</cstring> + </property> + <property name="text"> + <string>Clear History</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>418</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>16</width> + <height>30</height> + </size> + </property> + </spacer> + </vbox> +</widget> +<includes> + <include location="global" impldecl="in implementation">kdialog.h</include> +</includes> +<layoutdefaults spacing="6" margin="0"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +<includehints> + <includehint>knuminput.h</includehint> + <includehint>knuminput.h</includehint> + <includehint>knuminput.h</includehint> + <includehint>knuminput.h</includehint> + <includehint>knuminput.h</includehint> + <includehint>knuminput.h</includehint> + <includehint>knuminput.h</includehint> + <includehint>knuminput.h</includehint> +</includehints> +</UI> diff --git a/konqueror/sidebar/trees/history_module/history_item.cpp b/konqueror/sidebar/trees/history_module/history_item.cpp new file mode 100644 index 000000000..bfda3152c --- /dev/null +++ b/konqueror/sidebar/trees/history_module/history_item.cpp @@ -0,0 +1,246 @@ +/* This file is part of the KDE project + Copyright (C) 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <kbookmarkdrag.h> +#include <kprotocolinfo.h> +#include <konq_faviconmgr.h> +#include <qpainter.h> + +#include <assert.h> + +#include "history_item.h" +#include "history_module.h" +#include "history_settings.h" +#include <kiconloader.h> + +#define MYMODULE static_cast<KonqSidebarHistoryModule*>(module()) +#define MYGROUP static_cast<KonqSidebarHistoryGroupItem*>(parent()) + +KonqSidebarHistorySettings * KonqSidebarHistoryItem::s_settings = 0L; + +KonqSidebarHistoryItem::KonqSidebarHistoryItem( const KonqHistoryEntry *entry, + KonqSidebarTreeItem * parentItem, + KonqSidebarTreeTopLevelItem *topLevelItem ) + : KonqSidebarTreeItem( parentItem, topLevelItem ) +{ + setExpandable( false ); + update( entry ); +} + +KonqSidebarHistoryItem::~KonqSidebarHistoryItem() +{ +} + +void KonqSidebarHistoryItem::update( const KonqHistoryEntry *entry ) +{ + m_entry = entry; + + if (!entry) + return; + + QString title( entry->title ); + if ( !title.stripWhiteSpace().isEmpty() && + title != entry->url.url() ) + setText( 0, title ); + else { + QString path( entry->url.path() ); + if ( path.isEmpty() ) + path += '/'; + setText( 0, path ); + } + + KonqSidebarHistoryGroupItem *group = MYGROUP; + assert(group); + QString path = entry->url.path(); + if ( group->hasFavIcon() && (path.isNull() || path == "/") ) + { + const QPixmap *pm = group->pixmap(0); + if (pm) + setPixmap( 0, *pm ); + } + else + { + setPixmap( 0, SmallIcon(KProtocolInfo::icon( entry->url.protocol() ))); + } + + group->itemUpdated( this ); // update for sorting +} + +void KonqSidebarHistoryItem::itemSelected() +{ + tree()->enableActions( true, true, false, false, false, false ); +} + +void KonqSidebarHistoryItem::rightButtonPressed() +{ + MYMODULE->showPopupMenu(); +} + +QDragObject * KonqSidebarHistoryItem::dragObject( QWidget * parent, bool /*move*/ ) +{ + QString icon = KonqFavIconMgr::iconForURL( m_entry->url.url() ); + KBookmark bookmark = KBookmark::standaloneBookmark( m_entry->title, + m_entry->url, icon ); + KBookmarkDrag *drag = KBookmarkDrag::newDrag( bookmark, parent ); + return drag; +} + +// new items go on top +QString KonqSidebarHistoryItem::key( int column, bool ascending ) const +{ + if ( MYMODULE->sortsByName() ) + return KonqSidebarTreeItem::key( column, ascending ); + + QString tmp; + tmp.sprintf( "%08x", m_entry->lastVisited.secsTo(MYMODULE->currentTime())); + return tmp; +} + +QString KonqSidebarHistoryItem::toolTipText() const +{ + if ( s_settings->m_detailedTips ) { + // this weird ordering of %4, %1, %2, %3 is due to the reason, that some + // urls seem to contain %N, which would get substituted in the next + // .arg() calls. So to fix this, we first substitute the last items + // and then put in the url. + QString tip = i18n("<qt><center><b>%4</b></center><hr>Last visited: %1<br>First visited: %2<br>Number of times visited: %3</qt>"); + return tip.arg( KGlobal::locale()->formatDateTime( m_entry->lastVisited ) ).arg( KGlobal::locale()->formatDateTime( m_entry->firstVisited ) ).arg( m_entry->numberOfTimesVisited ).arg( m_entry->url.url() ); + } + + return m_entry->url.url(); +} + +void KonqSidebarHistoryItem::paintCell( QPainter *p, const QColorGroup & cg, + int column, int width, int alignment ) +{ + QDateTime dt; + QDateTime current = QDateTime::currentDateTime(); + + if ( s_settings->m_metricYoungerThan == KonqSidebarHistorySettings::DAYS ) + dt = current.addDays( - s_settings->m_valueYoungerThan ); + else + dt = current.addSecs( - (s_settings->m_valueYoungerThan * 60) ); + + if ( m_entry->lastVisited > dt ) + p->setFont( s_settings->m_fontYoungerThan ); + + else { + if ( s_settings->m_metricOlderThan == KonqSidebarHistorySettings::DAYS ) + dt = current.addDays( - s_settings->m_valueOlderThan ); + else + dt = current.addSecs( - (s_settings->m_valueOlderThan * 60) ); + + if ( m_entry->lastVisited < dt ) + p->setFont( s_settings->m_fontOlderThan ); + } + + KonqSidebarTreeItem::paintCell( p, cg, column, width, alignment ); +} + +/////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// + + +KonqSidebarHistoryGroupItem::KonqSidebarHistoryGroupItem( const KURL& url, + KonqSidebarTreeTopLevelItem *topLevelItem) + : KonqSidebarTreeItem( topLevelItem, topLevelItem ), + m_hasFavIcon( false ), + m_url( url ) +{ +} + +void KonqSidebarHistoryGroupItem::setFavIcon( const QPixmap& pix ) +{ + setPixmap( 0, pix ); + m_hasFavIcon = true; +} + +// the group item itself will be removed automatically, +// when the last child is removed +void KonqSidebarHistoryGroupItem::remove() +{ + KURL::List list; + KonqSidebarHistoryItem *child = static_cast<KonqSidebarHistoryItem*>( firstChild() ); + while( child ) { + list.append( child->externalURL() ); + child = static_cast<KonqSidebarHistoryItem*>( child->nextSibling() ); + } + + if ( !list.isEmpty() ) + KonqHistoryManager::kself()->emitRemoveFromHistory( list ); +} + +KonqSidebarHistoryItem * KonqSidebarHistoryGroupItem::findChild(const KonqHistoryEntry *entry) const +{ + QListViewItem *child = firstChild(); + KonqSidebarHistoryItem *item = 0L; + + while ( child ) { + item = static_cast<KonqSidebarHistoryItem *>( child ); + if ( item->entry() == entry ) + return item; + + child = child->nextSibling(); + } + + return 0L; +} + +void KonqSidebarHistoryGroupItem::itemSelected() +{ + tree()->enableActions( false, false, false, + false, false, false ); +} + +void KonqSidebarHistoryGroupItem::rightButtonPressed() +{ + MYMODULE->showPopupMenu(); +} + +// let the module change our pixmap (opened/closed) +void KonqSidebarHistoryGroupItem::setOpen( bool open ) +{ + MYMODULE->groupOpened( this, open ); + KonqSidebarTreeItem::setOpen( open ); +} + +// new items go on top +QString KonqSidebarHistoryGroupItem::key( int column, bool ascending ) const +{ + if ( !m_lastVisited.isValid() || MYMODULE->sortsByName() ) + return KonqSidebarTreeItem::key( column, ascending ); + + QString tmp; + tmp.sprintf( "%08x", m_lastVisited.secsTo( MYMODULE->currentTime() )); + return tmp; +} + +void KonqSidebarHistoryGroupItem::itemUpdated( KonqSidebarHistoryItem *item ) +{ + if ( !m_lastVisited.isValid() || m_lastVisited < item->lastVisited() ) + m_lastVisited = item->lastVisited(); +} + +QDragObject * KonqSidebarHistoryGroupItem::dragObject( QWidget *parent, bool /*move*/) +{ + QString icon = KonqFavIconMgr::iconForURL( m_url.url() ); + KBookmark bookmark = KBookmark::standaloneBookmark( QString::null, m_url, + icon ); + KBookmarkDrag *drag = KBookmarkDrag::newDrag( bookmark, parent ); + return drag; +} diff --git a/konqueror/sidebar/trees/history_module/history_item.h b/konqueror/sidebar/trees/history_module/history_item.h new file mode 100644 index 000000000..a7c77a677 --- /dev/null +++ b/konqueror/sidebar/trees/history_module/history_item.h @@ -0,0 +1,111 @@ +/* This file is part of the KDE project + Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef HISTORY_ITEM_H +#define HISTORY_ITEM_H + +#include <kurl.h> +#include <konq_historymgr.h> + +#include "konq_sidebartreeitem.h" + +class QDropEvent; +class QPainter; +class KonqSidebarHistorySettings; + +class KonqSidebarHistoryItem : public KonqSidebarTreeItem +{ +public: + KonqSidebarHistoryItem( const KonqHistoryEntry *entry, + KonqSidebarTreeItem *parentItem, + KonqSidebarTreeTopLevelItem *topLevelItem ); + ~KonqSidebarHistoryItem(); + + virtual void rightButtonPressed(); + + virtual void itemSelected(); + + // The URL to open when this link is clicked + virtual KURL externalURL() const { return m_entry->url; } + const KURL& url() const { return m_entry->url; } // a faster one + virtual QString toolTipText() const; + + QString host() const { return m_entry->url.host(); } + QString path() const { return m_entry->url.path(); } + + const QDateTime& lastVisited() const { return m_entry->lastVisited; } + + void update( const KonqHistoryEntry *entry ); + const KonqHistoryEntry *entry() const { return m_entry; } + + virtual QDragObject * dragObject( QWidget * parent, bool move = false ); + + virtual QString key( int column, bool ascending ) const; + + static void setSettings( KonqSidebarHistorySettings *s ) { s_settings = s; } + + virtual void paintCell( QPainter *, const QColorGroup & cg, int column, + int width, int alignment ); + +private: + const KonqHistoryEntry *m_entry; + static KonqSidebarHistorySettings *s_settings; + +}; + +class KonqSidebarHistoryGroupItem : public KonqSidebarTreeItem +{ +public: + + KonqSidebarHistoryGroupItem( const KURL& url, KonqSidebarTreeTopLevelItem * ); + + /** + * removes itself and all its children from the history (not just the view) + */ + void remove(); + + KonqSidebarHistoryItem * findChild( const KonqHistoryEntry *entry ) const; + + virtual void rightButtonPressed(); + + virtual void setOpen( bool open ); + + virtual QString key( int column, bool ascending ) const; + + void itemUpdated( KonqSidebarHistoryItem *item ); + + bool hasFavIcon() const { return m_hasFavIcon; } + void setFavIcon( const QPixmap& pix ); + + virtual QDragObject * dragObject( QWidget *, bool ); + virtual void itemSelected(); + + // we don't support the following of KonqSidebarTreeItem + bool acceptsDrops( const QStrList& ) { return false; } + virtual void drop( QDropEvent * ) {} + virtual KURL externalURL() const { return KURL(); } + +private: + bool m_hasFavIcon; + const KURL m_url; + QDateTime m_lastVisited; + +}; + + +#endif // HISTORY_ITEM_H diff --git a/konqueror/sidebar/trees/history_module/history_module.cpp b/konqueror/sidebar/trees/history_module/history_module.cpp new file mode 100644 index 000000000..832abd74e --- /dev/null +++ b/konqueror/sidebar/trees/history_module/history_module.cpp @@ -0,0 +1,369 @@ +/* This file is part of the KDE project + Copyright (C) 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org> + 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <qapplication.h> +#include <qpopupmenu.h> + +#include <kapplication.h> +#include <kaction.h> +#include <kcursor.h> +#include <kconfig.h> +#include <kdebug.h> +#include <kiconloader.h> +#include <kmessagebox.h> +#include <krun.h> +#include <kstaticdeleter.h> + +#include <konq_faviconmgr.h> + +#include "history_module.h" +#include "history_settings.h" + +static KStaticDeleter<KonqSidebarHistorySettings> sd; +KonqSidebarHistorySettings * KonqSidebarHistoryModule::s_settings = 0L; + +KonqSidebarHistoryModule::KonqSidebarHistoryModule( KonqSidebarTree * parentTree, const char *name ) + : QObject( 0L, name ), KonqSidebarTreeModule( parentTree ), + m_dict( 349 ), + m_topLevelItem( 0L ), + m_dlg( 0L ), + m_initialized( false ) +{ + if ( !s_settings ) { + sd.setObject( s_settings, + new KonqSidebarHistorySettings( 0, "history settings" )); + s_settings->readSettings( true ); + } + + connect( s_settings, SIGNAL( settingsChanged() ), SLOT( slotSettingsChanged() )); + + m_dict.setAutoDelete( true ); + m_currentTime = QDateTime::currentDateTime(); + + KConfig *kc = KGlobal::config(); + KConfigGroupSaver cs( kc, "HistorySettings" ); + m_sortsByName = kc->readEntry( "SortHistory", "byDate" ) == "byName"; + + + KonqHistoryManager *manager = KonqHistoryManager::kself(); + + connect( manager, SIGNAL( loadingFinished() ), SLOT( slotCreateItems() )); + connect( manager, SIGNAL( cleared() ), SLOT( clear() )); + + connect( manager, SIGNAL( entryAdded( const KonqHistoryEntry * ) ), + SLOT( slotEntryAdded( const KonqHistoryEntry * ) )); + connect( manager, SIGNAL( entryRemoved( const KonqHistoryEntry *) ), + SLOT( slotEntryRemoved( const KonqHistoryEntry *) )); + + connect( parentTree, SIGNAL( expanded( QListViewItem * )), + SLOT( slotItemExpanded( QListViewItem * ))); + + m_collection = new KActionCollection( this, "history actions" ); + (void) new KAction( i18n("New &Window"), "window_new", 0, this, + SLOT( slotNewWindow() ), m_collection, "open_new"); + (void) new KAction( i18n("&Remove Entry"), "editdelete", 0, this, + SLOT( slotRemoveEntry() ), m_collection, "remove"); + (void) new KAction( i18n("C&lear History"), "history_clear", 0, this, + SLOT( slotClearHistory() ), m_collection, "clear"); + (void) new KAction( i18n("&Preferences..."), "configure", 0, this, + SLOT( slotPreferences()), m_collection, "preferences"); + + KRadioAction *sort; + sort = new KRadioAction( i18n("By &Name"), 0, this, + SLOT( slotSortByName() ), m_collection, "byName"); + sort->setExclusiveGroup("SortGroup"); + sort->setChecked( m_sortsByName ); + + sort = new KRadioAction( i18n("By &Date"), 0, this, + SLOT( slotSortByDate() ), m_collection, "byDate"); + sort->setExclusiveGroup("SortGroup"); + sort->setChecked( !m_sortsByName ); + + m_folderClosed = SmallIcon( "folder" ); + m_folderOpen = SmallIcon( "folder_open" ); + + slotSettingsChanged(); // read the settings +} + +KonqSidebarHistoryModule::~KonqSidebarHistoryModule() +{ + HistoryItemIterator it( m_dict ); + QStringList openGroups; + while ( it.current() ) { + if ( it.current()->isOpen() ) + openGroups.append( it.currentKey() ); + ++it; + } + + KConfig *kc = KGlobal::config(); + KConfigGroupSaver cs( kc, "HistorySettings" ); + kc->writeEntry("OpenGroups", openGroups); + kc->sync(); +} + +void KonqSidebarHistoryModule::slotSettingsChanged() +{ + KonqSidebarHistoryItem::setSettings( s_settings ); + tree()->triggerUpdate(); +} + +void KonqSidebarHistoryModule::slotCreateItems() +{ + QApplication::setOverrideCursor( KCursor::waitCursor() ); + clear(); + + KonqSidebarHistoryItem *item; + KonqHistoryEntry *entry; + KonqHistoryList entries( KonqHistoryManager::kself()->entries() ); + KonqHistoryIterator it( entries ); + m_currentTime = QDateTime::currentDateTime(); + + // the group item and the item of the serverroot '/' get a fav-icon + // if available. All others get the protocol icon. + while ( (entry = it.current()) ) { + KonqSidebarHistoryGroupItem *group = getGroupItem( entry->url ); + item = new KonqSidebarHistoryItem( entry, group, m_topLevelItem ); + + ++it; + } + + KConfig *kc = KGlobal::config(); + KConfigGroupSaver cs( kc, "HistorySettings" ); + QStringList openGroups = kc->readListEntry("OpenGroups"); + QStringList::Iterator it2 = openGroups.begin(); + KonqSidebarHistoryGroupItem *group; + while ( it2 != openGroups.end() ) { + group = m_dict.find( *it2 ); + if ( group ) + group->setOpen( true ); + + ++it2; + } + + QApplication::restoreOverrideCursor(); + m_initialized = true; +} + +// deletes the listview items but does not affect the history backend +void KonqSidebarHistoryModule::clear() +{ + m_dict.clear(); +} + +void KonqSidebarHistoryModule::slotEntryAdded( const KonqHistoryEntry *entry ) +{ + if ( !m_initialized ) + return; + + m_currentTime = QDateTime::currentDateTime(); + KonqSidebarHistoryGroupItem *group = getGroupItem( entry->url ); + KonqSidebarHistoryItem *item = group->findChild( entry ); + if ( !item ) + item = new KonqSidebarHistoryItem( entry, group, m_topLevelItem ); + else + item->update( entry ); + + // QListView scrolls when calling sort(), so we have to hack around that + // (we don't want no scrolling every time an entry is added) + KonqSidebarTree *t = tree(); + t->lockScrolling( true ); + group->sort(); + m_topLevelItem->sort(); + qApp->processOneEvent(); + t->lockScrolling( false ); +} + +void KonqSidebarHistoryModule::slotEntryRemoved( const KonqHistoryEntry *entry ) +{ + if ( !m_initialized ) + return; + + QString groupKey = groupForURL( entry->url ); + KonqSidebarHistoryGroupItem *group = m_dict.find( groupKey ); + if ( !group ) + return; + + delete group->findChild( entry ); + + if ( group->childCount() == 0 ) + m_dict.remove( groupKey ); +} + +void KonqSidebarHistoryModule::addTopLevelItem( KonqSidebarTreeTopLevelItem * item ) +{ + m_topLevelItem = item; +} + +bool KonqSidebarHistoryModule::handleTopLevelContextMenu( KonqSidebarTreeTopLevelItem *, + const QPoint& pos ) +{ + showPopupMenu( ModuleContextMenu, pos ); + return true; +} + +void KonqSidebarHistoryModule::showPopupMenu() +{ + showPopupMenu( EntryContextMenu | ModuleContextMenu, QCursor::pos() ); +} + +void KonqSidebarHistoryModule::showPopupMenu( int which, const QPoint& pos ) +{ + QPopupMenu *sortMenu = new QPopupMenu; + m_collection->action("byName")->plug( sortMenu ); + m_collection->action("byDate")->plug( sortMenu ); + + QPopupMenu *menu = new QPopupMenu; + + if ( which & EntryContextMenu ) + { + m_collection->action("open_new")->plug( menu ); + menu->insertSeparator(); + m_collection->action("remove")->plug( menu ); + } + + m_collection->action("clear")->plug( menu ); + menu->insertSeparator(); + menu->insertItem( i18n("Sort"), sortMenu ); + menu->insertSeparator(); + m_collection->action("preferences")->plug( menu ); + + menu->exec( pos ); + delete menu; + delete sortMenu; +} + +void KonqSidebarHistoryModule::slotNewWindow() +{ + kdDebug(1201)<<"void KonqSidebarHistoryModule::slotNewWindow()"<<endl; + + QListViewItem *item = tree()->selectedItem(); + KonqSidebarHistoryItem *hi = dynamic_cast<KonqSidebarHistoryItem*>( item ); + if ( hi ) + { + kdDebug(1201)<<"void KonqSidebarHistoryModule::slotNewWindow(): emitting createNewWindow"<<endl; + emit tree()->createNewWindow( hi->url() ); + } +} + +void KonqSidebarHistoryModule::slotRemoveEntry() +{ + QListViewItem *item = tree()->selectedItem(); + KonqSidebarHistoryItem *hi = dynamic_cast<KonqSidebarHistoryItem*>( item ); + if ( hi ) // remove a single entry + KonqHistoryManager::kself()->emitRemoveFromHistory( hi->externalURL()); + + else { // remove a group of entries + KonqSidebarHistoryGroupItem *gi = dynamic_cast<KonqSidebarHistoryGroupItem*>( item ); + if ( gi ) + gi->remove(); + } +} + +void KonqSidebarHistoryModule::slotPreferences() +{ + // Run the history sidebar settings. + KRun::run( "kcmshell kcmhistory", KURL::List() ); +} + +void KonqSidebarHistoryModule::slotSortByName() +{ + m_sortsByName = true; + sortingChanged(); +} + +void KonqSidebarHistoryModule::slotSortByDate() +{ + m_sortsByName = false; + sortingChanged(); +} + +void KonqSidebarHistoryModule::sortingChanged() +{ + m_topLevelItem->sort(); + + KConfig *kc = KGlobal::config(); + KConfigGroupSaver cs( kc, "HistorySettings" ); + kc->writeEntry( "SortHistory", m_sortsByName ? "byName" : "byDate" ); + kc->sync(); +} + +void KonqSidebarHistoryModule::slotItemExpanded( QListViewItem *item ) +{ + if ( item == m_topLevelItem && !m_initialized ) + slotCreateItems(); +} + +void KonqSidebarHistoryModule::groupOpened( KonqSidebarHistoryGroupItem *item, bool open ) +{ + if ( item->hasFavIcon() ) + return; + + if ( open ) + item->setPixmap( 0, m_folderOpen ); + else + item->setPixmap( 0, m_folderClosed ); +} + + +KonqSidebarHistoryGroupItem * KonqSidebarHistoryModule::getGroupItem( const KURL& url ) +{ + const QString& groupKey = groupForURL( url ); + KonqSidebarHistoryGroupItem *group = m_dict.find( groupKey ); + if ( !group ) { + group = new KonqSidebarHistoryGroupItem( url, m_topLevelItem ); + + QString icon = KonqFavIconMgr::iconForURL( url.url() ); + if ( icon.isEmpty() ) + group->setPixmap( 0, m_folderClosed ); + else + group->setFavIcon( SmallIcon( icon ) ); + + group->setText( 0, groupKey ); + + m_dict.insert( groupKey, group ); + } + + return group; +} + +void KonqSidebarHistoryModule::slotClearHistory() +{ + KGuiItem guiitem = KStdGuiItem::clear(); + guiitem.setIconSet( SmallIconSet("history_clear")); + + if ( KMessageBox::warningContinueCancel( tree(), + i18n("Do you really want to clear " + "the entire history?"), + i18n("Clear History?"), guiitem ) + == KMessageBox::Continue ) + KonqHistoryManager::kself()->emitClear(); +} + + +extern "C" +{ + KDE_EXPORT KonqSidebarTreeModule* create_konq_sidebartree_history(KonqSidebarTree* par, const bool) + { + return new KonqSidebarHistoryModule(par); + } +} + + + +#include "history_module.moc" diff --git a/konqueror/sidebar/trees/history_module/history_module.h b/konqueror/sidebar/trees/history_module/history_module.h new file mode 100644 index 000000000..30295fc3f --- /dev/null +++ b/konqueror/sidebar/trees/history_module/history_module.h @@ -0,0 +1,108 @@ +/* This file is part of the KDE project + Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef HISTORY_MODULE_H +#define HISTORY_MODULE_H + +#include <qdatetime.h> +#include <qobject.h> +#include <qdict.h> +#include <qpixmap.h> + +#include <kglobal.h> +#include <klocale.h> +#include <konq_sidebartreemodule.h> + +#include "history_item.h" + +class KActionCollection; +class KDialogBase; +class KonqSidebarHistorySettings; +class KonqSidebarTree; +class KonqSidebarTreeItem; + +class KonqSidebarHistoryModule : public QObject, public KonqSidebarTreeModule +{ + Q_OBJECT + +public: + enum { + ModuleContextMenu = 1, + EntryContextMenu = 2 + }; + + KonqSidebarHistoryModule( KonqSidebarTree * parentTree, const char * name = 0 ); + virtual ~KonqSidebarHistoryModule(); + + virtual void addTopLevelItem( KonqSidebarTreeTopLevelItem * item ); + virtual bool handleTopLevelContextMenu( KonqSidebarTreeTopLevelItem *item, const QPoint& pos ); + + void showPopupMenu( int which, const QPoint& pos ); + + // called by the items + void showPopupMenu(); + void groupOpened( KonqSidebarHistoryGroupItem *item, bool open ); + const QDateTime& currentTime() const { return m_currentTime; } + bool sortsByName() const { return m_sortsByName; } + + static QString groupForURL( const KURL& url ) { + static const QString& misc = KGlobal::staticQString(i18n("Miscellaneous")); + return url.host().isEmpty() ? misc : url.host(); + } + +public slots: + void clear(); + +private slots: + void slotCreateItems(); + void slotEntryAdded( const KonqHistoryEntry * ); + void slotEntryRemoved( const KonqHistoryEntry * ); + + void slotNewWindow(); + void slotRemoveEntry(); + void slotPreferences(); + void slotSettingsChanged(); + + void slotItemExpanded( QListViewItem * ); + + void slotSortByName(); + void slotSortByDate(); + + void slotClearHistory(); + +private: + KonqSidebarHistoryGroupItem *getGroupItem( const KURL& url ); + + void sortingChanged(); + typedef QDictIterator<KonqSidebarHistoryGroupItem> HistoryItemIterator; + QDict<KonqSidebarHistoryGroupItem> m_dict; + + KonqSidebarTreeTopLevelItem * m_topLevelItem; + + KActionCollection *m_collection; + + KDialogBase *m_dlg; + QPixmap m_folderClosed; + QPixmap m_folderOpen; + bool m_initialized; + bool m_sortsByName; + QDateTime m_currentTime; // used for sorting the items by date + static KonqSidebarHistorySettings *s_settings; +}; + +#endif // HISTORY_MODULE_H diff --git a/konqueror/sidebar/trees/history_module/history_settings.cpp b/konqueror/sidebar/trees/history_module/history_settings.cpp new file mode 100644 index 000000000..ed8bc7756 --- /dev/null +++ b/konqueror/sidebar/trees/history_module/history_settings.cpp @@ -0,0 +1,111 @@ + +#include <kapplication.h> +#include <kconfig.h> +#include <kglobal.h> +#include <dcopclient.h> + +#include "history_settings.h" + +KonqSidebarHistorySettings::KonqSidebarHistorySettings( QObject *parent, const char *name ) + : QObject( parent, name ), + DCOPObject( "KonqSidebarHistorySettings" ) +{ + m_fontOlderThan.setItalic( true ); // default +} + +KonqSidebarHistorySettings::KonqSidebarHistorySettings() + : QObject(), + DCOPObject( "KonqSidebarHistorySettings" ) +{ + m_fontOlderThan.setItalic( true ); // default +} + +KonqSidebarHistorySettings::KonqSidebarHistorySettings( const KonqSidebarHistorySettings& s ) + : QObject(), + DCOPObject( "KonqSidebarHistorySettings" ) +{ + m_valueYoungerThan = s.m_valueYoungerThan; + m_valueOlderThan = s.m_valueOlderThan; + + m_metricYoungerThan = s.m_metricYoungerThan; + m_metricOlderThan = s.m_metricOlderThan; + + m_detailedTips = s.m_detailedTips; + + m_fontYoungerThan = s.m_fontYoungerThan; + m_fontOlderThan = s.m_fontOlderThan; +} + +KonqSidebarHistorySettings::~KonqSidebarHistorySettings() +{ +} + +void KonqSidebarHistorySettings::readSettings(bool global) +{ + KConfig *config; + QString oldgroup; + + if (global) { + config = KGlobal::config(); + oldgroup= config->group(); + } + else + config = new KConfig("konquerorrc"); + + config->setGroup("HistorySettings"); + m_valueYoungerThan = config->readNumEntry("Value youngerThan", 1 ); + m_valueOlderThan = config->readNumEntry("Value olderThan", 2 ); + + QString minutes = QString::fromLatin1("minutes"); + QString days = QString::fromLatin1("days"); + QString metric = config->readEntry("Metric youngerThan", days ); + m_metricYoungerThan = (metric == days) ? DAYS : MINUTES; + metric = config->readEntry("Metric olderThan", days ); + m_metricOlderThan = (metric == days) ? DAYS : MINUTES; + + m_detailedTips = config->readBoolEntry("Detailed Tooltips", true); + + m_fontYoungerThan = config->readFontEntry( "Font youngerThan", + &m_fontYoungerThan ); + m_fontOlderThan = config->readFontEntry( "Font olderThan", + &m_fontOlderThan ); + if (global) + config->setGroup( oldgroup ); + else + delete config; +} + +void KonqSidebarHistorySettings::applySettings() +{ + KConfig *config = new KConfig("konquerorrc"); + config->setGroup("HistorySettings"); + + config->writeEntry("Value youngerThan", m_valueYoungerThan ); + config->writeEntry("Value olderThan", m_valueOlderThan ); + + QString minutes = QString::fromLatin1("minutes"); + QString days = QString::fromLatin1("days"); + config->writeEntry("Metric youngerThan", m_metricYoungerThan == DAYS ? + days : minutes ); + config->writeEntry("Metric olderThan", m_metricOlderThan == DAYS ? + days : minutes ); + + config->writeEntry("Detailed Tooltips", m_detailedTips); + + config->writeEntry("Font youngerThan", m_fontYoungerThan ); + config->writeEntry("Font olderThan", m_fontOlderThan ); + + delete config; + + // notify konqueror instances about the new configuration + kapp->dcopClient()->send( "konqueror*", "KonqSidebarHistorySettings", + "notifySettingsChanged()", QByteArray() ); +} + +void KonqSidebarHistorySettings::notifySettingsChanged() +{ + readSettings(false); + emit settingsChanged(); +} + +#include "history_settings.moc" diff --git a/konqueror/sidebar/trees/history_module/history_settings.h b/konqueror/sidebar/trees/history_module/history_settings.h new file mode 100644 index 000000000..21bcd01db --- /dev/null +++ b/konqueror/sidebar/trees/history_module/history_settings.h @@ -0,0 +1,66 @@ +/* This file is part of the KDE project + Copyright (C) 2000 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; 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef HISTORY_SETTINGS_H +#define HISTORY_SETTINGS_H + +#include <qfont.h> +#include <qobject.h> + +#include <dcopobject.h> + +class KonqSidebarHistorySettings : public QObject, public DCOPObject +{ + K_DCOP + Q_OBJECT + +public: + enum { MINUTES, DAYS }; + + KonqSidebarHistorySettings( QObject *parent, const char *name ); + virtual ~KonqSidebarHistorySettings(); + + void readSettings(bool global); + void applySettings(); + + uint m_valueYoungerThan; + uint m_valueOlderThan; + + int m_metricYoungerThan; + int m_metricOlderThan; + + bool m_detailedTips; + + QFont m_fontYoungerThan; + QFont m_fontOlderThan; + +signals: + void settingsChanged(); + +protected: + KonqSidebarHistorySettings(); + KonqSidebarHistorySettings( const KonqSidebarHistorySettings& ); + +k_dcop: + void notifySettingsChanged(); + +private: // to make dcopidl happy :-/ +}; + +#endif // HISTORY_SETTINGS_H diff --git a/konqueror/sidebar/trees/history_module/kcmhistory.cpp b/konqueror/sidebar/trees/history_module/kcmhistory.cpp new file mode 100644 index 000000000..e4b31b232 --- /dev/null +++ b/konqueror/sidebar/trees/history_module/kcmhistory.cpp @@ -0,0 +1,272 @@ +/* + * kcmhistory.cpp + * Copyright (c) 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org> + * Copyright (c) 2002 Stephan Binner <binner@kde.org> + * + * based on kcmtaskbar.cpp + * Copyright (c) 2000 Kurt Granroth <granroth@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; 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 + */ + +#include <qcheckbox.h> +#include <qcombobox.h> +#include <qlayout.h> +#include <qpushbutton.h> +#include <qradiobutton.h> + +#include <dcopclient.h> +#include <dcopref.h> +#include <kapplication.h> +#include <kconfig.h> +#include <kdialog.h> +#include <kfontdialog.h> +#include <kgenericfactory.h> +#include <kglobal.h> +#include <kiconloader.h> +#include <klocale.h> +#include <kmessagebox.h> +#include <knuminput.h> +#include "history_dlg.h" + +#include "konq_historymgr.h" + +#include "kcmhistory.h" +#include "history_settings.h" + +typedef KGenericFactory<HistorySidebarConfig, QWidget > KCMHistoryFactory; +K_EXPORT_COMPONENT_FACTORY (kcm_history, KCMHistoryFactory("kcmhistory") ) + +HistorySidebarConfig::HistorySidebarConfig( QWidget *parent, const char* name, const QStringList & ) + : KCModule (KCMHistoryFactory::instance(), parent, name) +{ + KGlobal::locale()->insertCatalogue("konqueror"); + + m_settings = new KonqSidebarHistorySettings( 0, "history settings" ); + m_settings->readSettings( false ); + + QVBoxLayout *topLayout = new QVBoxLayout(this, 0, KDialog::spacingHint()); + dialog = new KonqSidebarHistoryDlg(this); + + dialog->spinEntries->setRange( 0, INT_MAX, 1, false ); + dialog->spinExpire->setRange( 0, INT_MAX, 1, false ); + + dialog->spinNewer->setRange( 0, INT_MAX, 1, false ); + dialog->spinOlder->setRange( 0, INT_MAX, 1, false ); + + dialog->comboNewer->insertItem( i18n("Minutes"), + KonqSidebarHistorySettings::MINUTES ); + dialog->comboNewer->insertItem( i18n("Days"), + KonqSidebarHistorySettings::DAYS ); + + dialog->comboOlder->insertItem( i18n("Minutes"), + KonqSidebarHistorySettings::MINUTES ); + dialog->comboOlder->insertItem( i18n("Days"), + KonqSidebarHistorySettings::DAYS ); + + connect( dialog->cbExpire, SIGNAL( toggled( bool )), + dialog->spinExpire, SLOT( setEnabled( bool ))); + connect( dialog->spinExpire, SIGNAL( valueChanged( int )), + this, SLOT( slotExpireChanged( int ))); + + connect( dialog->spinNewer, SIGNAL( valueChanged( int )), + SLOT( slotNewerChanged( int ))); + connect( dialog->spinOlder, SIGNAL( valueChanged( int )), + SLOT( slotOlderChanged( int ))); + + connect( dialog->btnFontNewer, SIGNAL( clicked() ), + SLOT( slotGetFontNewer() )); + connect( dialog->btnFontOlder, SIGNAL( clicked() ), + SLOT( slotGetFontOlder() )); + connect( dialog->btnClearHistory, SIGNAL( clicked() ), + SLOT( slotClearHistory() )); + + connect( dialog->cbDetailedTips, SIGNAL( toggled( bool )), + SLOT( configChanged() )); + connect( dialog->cbExpire, SIGNAL( toggled( bool )), + SLOT( configChanged() )); + connect( dialog->spinEntries, SIGNAL( valueChanged( int )), + SLOT( configChanged() )); + connect( dialog->comboNewer, SIGNAL( activated( int )), + SLOT( configChanged() )); + connect( dialog->comboOlder, SIGNAL( activated( int )), + SLOT( configChanged() )); + + dialog->show(); + topLayout->add(dialog); + load(); +} + +void HistorySidebarConfig::configChanged() +{ + emit changed(true); +} + +void HistorySidebarConfig::load() +{ + KConfig config("konquerorrc"); + config.setGroup("HistorySettings"); + dialog->spinExpire->setValue( config.readNumEntry( "Maximum age of History entries", 90) ); + dialog->spinEntries->setValue( config.readNumEntry( "Maximum of History entries", 500 ) ); + dialog->cbExpire->setChecked( dialog->spinExpire->value() > 0 ); + + dialog->spinNewer->setValue( m_settings->m_valueYoungerThan ); + dialog->spinOlder->setValue( m_settings->m_valueOlderThan ); + + dialog->comboNewer->setCurrentItem( m_settings->m_metricYoungerThan ); + dialog->comboOlder->setCurrentItem( m_settings->m_metricOlderThan ); + + dialog->cbDetailedTips->setChecked( m_settings->m_detailedTips ); + + m_fontNewer = m_settings->m_fontYoungerThan; + m_fontOlder = m_settings->m_fontOlderThan; + + // enable/disable widgets + dialog->spinExpire->setEnabled( dialog->cbExpire->isChecked() ); + + slotExpireChanged( dialog->spinExpire->value() ); + slotNewerChanged( dialog->spinNewer->value() ); + slotOlderChanged( dialog->spinOlder->value() ); + + emit changed(false); +} + +void HistorySidebarConfig::save() +{ + Q_UINT32 age = dialog->cbExpire->isChecked() ? dialog->spinExpire->value() : 0; + Q_UINT32 count = dialog->spinEntries->value(); + + KConfig config("konquerorrc"); + config.setGroup("HistorySettings"); + config.writeEntry( "Maximum of History entries", count ); + config.writeEntry( "Maximum age of History entries", age ); + + QByteArray dataAge; + QDataStream streamAge( dataAge, IO_WriteOnly ); + streamAge << age << "foo"; + kapp->dcopClient()->send( "konqueror*", "KonqHistoryManager", + "notifyMaxAge(Q_UINT32, QCString)", dataAge ); + + QByteArray dataCount; + QDataStream streamCount( dataCount, IO_WriteOnly ); + streamCount << count << "foo"; + kapp->dcopClient()->send( "konqueror*", "KonqHistoryManager", + "notifyMaxCount(Q_UINT32, QCString)", dataCount ); + + m_settings->m_valueYoungerThan = dialog->spinNewer->value(); + m_settings->m_valueOlderThan = dialog->spinOlder->value(); + + m_settings->m_metricYoungerThan = dialog->comboNewer->currentItem(); + m_settings->m_metricOlderThan = dialog->comboOlder->currentItem(); + + m_settings->m_detailedTips = dialog->cbDetailedTips->isChecked(); + + m_settings->m_fontYoungerThan = m_fontNewer; + m_settings->m_fontOlderThan = m_fontOlder; + + m_settings->applySettings(); + + emit changed(false); +} + +void HistorySidebarConfig::defaults() +{ + dialog->spinEntries->setValue( 500 ); + dialog->cbExpire->setChecked( true ); + dialog->spinExpire->setValue( 90 ); + + dialog->spinNewer->setValue( 1 ); + dialog->spinOlder->setValue( 2 ); + + dialog->comboNewer->setCurrentItem( KonqSidebarHistorySettings::DAYS ); + dialog->comboOlder->setCurrentItem( KonqSidebarHistorySettings::DAYS ); + + dialog->cbDetailedTips->setChecked( true ); + + m_fontNewer = QFont(); + m_fontNewer.setItalic( true ); + m_fontOlder = QFont(); + + emit changed(true); +} + +QString HistorySidebarConfig::quickHelp() const +{ + return i18n("<h1>History Sidebar</h1>" + " You can configure the history sidebar here."); +} + +void HistorySidebarConfig::slotExpireChanged( int value ) +{ + dialog->spinExpire->setSuffix( i18n(" day", " days", value) ); + configChanged(); +} + +// change hour to days, minute to minutes and the other way round, +// depending on the value of the spinbox, and synchronize the two spinBoxes +// to enfore newer <= older. +void HistorySidebarConfig::slotNewerChanged( int value ) +{ + dialog->comboNewer->changeItem( i18n ( "Day", "Days", value), + KonqSidebarHistorySettings::DAYS); + dialog->comboNewer->changeItem( i18n ( "Minute", "Minutes", value), + KonqSidebarHistorySettings::MINUTES); + + if ( dialog->spinNewer->value() > dialog->spinOlder->value() ) + dialog->spinOlder->setValue( dialog->spinNewer->value() ); + configChanged(); +} + +void HistorySidebarConfig::slotOlderChanged( int value ) +{ + dialog->comboOlder->changeItem( i18n ( "Day", "Days", value), + KonqSidebarHistorySettings::DAYS); + dialog->comboOlder->changeItem( i18n ( "Minute", "Minutes", value), + KonqSidebarHistorySettings::MINUTES); + + if ( dialog->spinNewer->value() > dialog->spinOlder->value() ) + dialog->spinNewer->setValue( dialog->spinOlder->value() ); + + configChanged(); +} + +void HistorySidebarConfig::slotGetFontNewer() +{ + int result = KFontDialog::getFont( m_fontNewer, false, this ); + if ( result == KFontDialog::Accepted ) + configChanged(); +} + +void HistorySidebarConfig::slotGetFontOlder() +{ + int result = KFontDialog::getFont( m_fontOlder, false, this ); + if ( result == KFontDialog::Accepted ) + configChanged(); +} + +void HistorySidebarConfig::slotClearHistory() +{ + KGuiItem guiitem = KStdGuiItem::clear(); + guiitem.setIconSet( SmallIconSet("history_clear")); + if ( KMessageBox::warningContinueCancel( this, + i18n("Do you really want to clear " + "the entire history?"), + i18n("Clear History?"), guiitem ) + == KMessageBox::Continue ) { + DCOPRef dcopHistManager( "konqueror*", "KonqHistoryManager" ); + dcopHistManager.send( "notifyClear", "KonqHistoryManager" ); + } +} + +#include "kcmhistory.moc" diff --git a/konqueror/sidebar/trees/history_module/kcmhistory.desktop b/konqueror/sidebar/trees/history_module/kcmhistory.desktop new file mode 100644 index 000000000..396b27b84 --- /dev/null +++ b/konqueror/sidebar/trees/history_module/kcmhistory.desktop @@ -0,0 +1,233 @@ +[Desktop Entry] +Icon=history +Type=Application +Exec=kcmshell kcmhistory + +X-KDE-ModuleType=Library +X-KDE-Library=history +X-KDE-FactoryName=history + +Name=History Sidebar +Name[af]=Geskiedenis Kantbalk +Name[ar]=الشريط الجانبي للخط الزمني +Name[az]=Keçmiş Yan Çubuğu +Name[be]=Бакавая панэль гісторыі +Name[bg]=История +Name[bn]=ইতিহাস সাইডবার +Name[bs]=Historija sidebar +Name[ca]=Barra de l'historial +Name[cs]=Panel historie +Name[csb]=Bòcznô lëstew historëji +Name[cy]=Cwpwrdd Cornel Hanes +Name[da]=Historik-sidebjælke +Name[de]=Verlaufsbereich +Name[el]=Πλευρική μπάρα ιστορικού +Name[eo]=Historia flankzono +Name[es]=Barra de historial +Name[et]=Ajaloo külgriba +Name[eu]=Historiaren alboko barra +Name[fa]=میله جانبی تاریخچه +Name[fi]=Historiasivupalkki +Name[fr]=Barre latérale d'historique +Name[fy]=Histoarje +Name[ga]=Barra Taoibh Staire +Name[gl]=Barra Lateral co Historial +Name[he]=סרגל היסטוריה +Name[hi]=इतिहास बाज़ूपट्टी +Name[hr]=Traka povijesti +Name[hu]=Napló-oldalsáv +Name[is]=Sögu hliðarslá +Name[it]=Barra laterale cronologia +Name[ja]=履歴サイドバー +Name[ka]=ისტორიის გვერდითი პანელი +Name[kk]=Бүйірдегі журнал панелі +Name[km]=របារប្រវត្តិ +Name[ko]=과거 기록 사이드바 +Name[lo]=ປະວັດການໃໍຊ້ງານ +Name[lt]=Istorijos šoninė juosta +Name[lv]=Vēstures sānjosla +Name[mk]=Лента за историја +Name[mn]=Түүхийн хуудас +Name[ms]=Bar Sisi Sejarah +Name[mt]=Kronoloġija +Name[nb]=Historie-sidestolpe +Name[nds]=Vörgeschicht-Sietpaneel +Name[ne]=इतिहास छेउपट्टी +Name[nl]=Geschiedenis +Name[nn]=Historie-sidestolpe +Name[nso]=Bar ya lehlakori ya Histori +Name[pa]=ਅਤੀਤ ਪਾਸੇ ਪੱਟੀ +Name[pl]=Pasek boczny z historią +Name[pt]=Barra Lateral do Histórico +Name[pt_BR]=Barra Lateral de Histórico +Name[ro]=Bară laterală de istoric +Name[ru]=Журнал +Name[rw]=Umurongokuruhande w'Amateka +Name[se]=Historihkkaholga +Name[sk]=Bočný panel histórie +Name[sl]=Stranska vrstica zgodovine +Name[sr]=Бочни панел историјата +Name[sr@Latn]=Bočni panel istorijata +Name[sv]=Historiksidopanel +Name[ta]=வரலாற்றுப் பக்கப்பட்டி +Name[tg]=Паҳлӯи сафҳаи торихча +Name[th]=แถบประวัติการใช้ด้านข้าง +Name[tr]=Geçmiş Yan Çubuğu +Name[tt]=Taríx Yantiräse +Name[uk]=Бічна панель історії +Name[uz]=Tarix paneli +Name[uz@cyrillic]=Тарих панели +Name[ven]=Bara ya lurumbu ya Divhazwakale +Name[vi]=Bảng Lịch sử +Name[wa]=Bår di costé di l' istwere +Name[xh]=Ibar esecaleni Yembali +Name[zh_CN]=历史侧边栏 +Name[zh_TW]=歷史紀錄邊列 +Name[zu]=Umlando webha yaseceleni +Comment=Configure the history sidebar +Comment[af]=Stel die geskiedenis kantbalk op +Comment[ar]=إعداد الشريط الجانبي للخط الزمني +Comment[az]=Keçmiş yan çubuğunu quraşdır +Comment[be]=Настаўленне бакавой панэлі гісторыі +Comment[bg]=Настройване на историята +Comment[bn]=ইতিহাস সাইডবার কনফিগার করুন +Comment[bs]=Ovdje možete podesiti history sidebar +Comment[ca]=Configura la barra de l'historial +Comment[cs]=Nastavení panelu historie +Comment[csb]=Kònfigùracëjô bòczny lëstwë historëji +Comment[cy]=Ffurfweddu'r cwpwrdd cornel hanes +Comment[da]=Indstil historik-sidebjælken +Comment[de]=Verlaufsanzeige im Navigationsbereich einrichten +Comment[el]=Ρυθμίστε την πλευρική μπάρα ιστορικού +Comment[eo]=Agordo de la historia flankzono +Comment[es]=Configuración de la barra del historial +Comment[et]=Ajaloo külgriba seadistamine +Comment[eu]=Konfiguratu historiaren alboko barra +Comment[fa]=پیکربندی میله جانبی تاریخچه +Comment[fi]=Historiasivupalkin asetukset +Comment[fr]=Configuration de l'historique de la barre latérale +Comment[fy]=Hjir kinne jo de histoarje ynstelle +Comment[ga]=Cumraigh an barra taoibh staire +Comment[gl]=Configurar o historial da barra lateral +Comment[he]=שינוי הגדרות הסרגל הצדדי של ההיסטוריה +Comment[hi]=इतिहास बाज़ूपट्टी कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje trake povijesti +Comment[hu]=A napló-oldalsáv beállításai +Comment[is]=Stilla hliðardálk með flakksögu +Comment[it]=Configura la barra laterale della cronologia +Comment[ja]=履歴サイドバーの設定 +Comment[ka]=ისტორიის გვერდითი პანელის კონფიგურირება +Comment[kk]=Бүйірдегі журнал панелін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធរបារប្រវត្តិ +Comment[ko]=과거 기록 사이드바를 설정합니다 +Comment[lo]=ທ່ານສາມາດປັບແຕ່ງຖາດພາເນລແຖບຫນ້າຕ່າງງານ ໄດ້ທີ່ນີ້ +Comment[lt]=Konfigūruoti istorijos šoninę juostą +Comment[lv]=Šeit jūs varat konfigurēt vēstures sānjoslu +Comment[mk]=Конфигурација на лентата за историја +Comment[mn]=Түүхийн хуудас тохируулах +Comment[ms]=Konfigur bar sisi sejarah +Comment[mt]=Ikkonfigura l-wirja tal-kronoloġija +Comment[nb]=Tilpass historiesidestolpen +Comment[nds]=Dat Vörgeschicht-Sietpaneel instellen +Comment[ne]=इतिहास छेउपट्टी कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u de geschiedenis instellen +Comment[nn]=Set opp historie-sidestolpen +Comment[nso]=Beakanya bar ya lehlakori ya histori +Comment[pa]=ਅਤੀਤ ਬਾਹੀ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja paska bocznego z historią +Comment[pt]=Configuração da barra lateral do histórico +Comment[pt_BR]=Configura a barra lateral de Histórico +Comment[ro]=Configurează bara laterală de URL-uri vizitate +Comment[ru]=Настройка боковой панели журнала +Comment[rw]=Kuboneza umurongokuruhande w'amateka +Comment[se]=Heivet historihkkaholgga +Comment[sk]=Nastavenie bočného panelu histórie +Comment[sl]=Nastavitve stranske vrstice zgodovine +Comment[sr]=Подешавање бочног панела историјата +Comment[sr@Latn]=Podešavanje bočnog panela istorijata +Comment[sv]=Anpassa historiksidopanelen +Comment[ta]=வரலாறு பக்கப்பட்டியலை வடிவமை +Comment[tg]=Танзимоти паҳлӯи сафҳаи торихча +Comment[th]=ปรับแต่งแถบประวัติการใช้ด้านข้าง +Comment[tr]=Geçmiş yan çubuğunu yapılandır +Comment[tt]="Uzğanı" yantiräseneñ caylawı +Comment[uk]=Налаштування бічної панелі історії +Comment[uz]=Tarix panelini moslash +Comment[uz@cyrillic]=Тарих панелини мослаш +Comment[ven]=Dzudzanyani bara ya lurumbu lwa divhazwakale +Comment[vi]=Cấu hình bảng nằm bên cạnh chứa lịch sử duyệt mạng +Comment[wa]=Apontyî l' dujhance del bår di costé d' istwere +Comment[xh]=Qwalasela imbali ye bar yasecaleni +Comment[zh_CN]=配置任务侧边栏 +Comment[zh_TW]=設定歷史紀錄邊列 +Comment[zu]=Hlanganisela ibha yaseceleni yomlando +Keywords=history,expire +Keywords[ar]=الخط الزمني, إنتهاء الأجل +Keywords[az]=history,expire,keçmiş +Keywords[be]=Гісторыя,Састарэлая,history,expire +Keywords[bg]=история, сърфиране, срок, изтичане, history, expire +Keywords[ca]=historial,expira +Keywords[cs]=historie,vypršení +Keywords[csb]=historëjô,wëgasëwanié +Keywords[cy]=hanes,daw i ben +Keywords[da]=historik,udløbe +Keywords[de]=History,Verlauf +Keywords[el]=ιστορικό,λήξη +Keywords[eo]=historio,malvalidiĝi +Keywords[es]=historial,expirar +Keywords[et]=ajalugu,aegumine +Keywords[eu]=historia,iraungi +Keywords[fa]=تاریخچه، انقضا +Keywords[fi]=historia,umpeenmeno +Keywords[fr]=historique,expiration +Keywords[fy]=histoarje,ferrinne +Keywords[ga]=stair,caite,as feidhm +Keywords[gl]=historial,caducar +Keywords[he]=היסטוריה,תפוגה,history,expire +Keywords[hi]=इतिहास,बीत गया +Keywords[hr]=history,expire,povijest,istek +Keywords[hu]=napló,lejárás +Keywords[is]=Saga,útrunnið,history +Keywords[it]=cronologia,scadenza +Keywords[ja]=履歴,失効 +Keywords[km]=ប្រវត្តិ ផុតកំណត់ +Keywords[lo]=ໃຊ້ຮ່ວມກັນ +Keywords[lt]=history,expire, istorija,pasibaigti +Keywords[lv]=vēsture,beigties +Keywords[mk]=history,expire,историја,истекува +Keywords[mn]=Түүх,Дуусах +Keywords[ms]=sejarah, luput +Keywords[mt]=history,expire,kronoloġija,skadi +Keywords[nb]=historie,utløper +Keywords[nds]=Vörgeschicht,aflopen +Keywords[ne]=इतिहास, म्याद समाप्त +Keywords[nl]=geschiedenis,verloop +Keywords[nn]=historie,utgår +Keywords[nso]=histori,felelwa ke nako +Keywords[pa]=expire,ਅਤੀਤ +Keywords[pl]=historia,wygasanie +Keywords[pt]=histórico,expirar +Keywords[pt_BR]=histórico,expirar +Keywords[ro]=istoric,expirare +Keywords[ru]=history,expire,журнал +Keywords[rw]=amateka,kurangiza igihe +Keywords[se]=historihkka,boarásnuvvat +Keywords[sk]=história,vypršanie +Keywords[sl]=zgodovina,potek,poteče +Keywords[sr]=history,expire,историјат,истицање +Keywords[sr@Latn]=history,expire,istorijat,isticanje +Keywords[sv]=historik,utgå +Keywords[ta]=வரலாறு,முடிந்தது +Keywords[th]=ประวัติการใช้,หมดอายุ +Keywords[tr]=geçmiş +Keywords[uk]=історія,закінчення терміну,втрата чинності +Keywords[uz]=tarix,muddati oʻtish +Keywords[uz@cyrillic]=тарих,муддати ўтиш +Keywords[ven]=divhazwakale,fhelelwa nga tshifhinga +Keywords[vi]=lịch sử,hết hạn +Keywords[wa]=istwere,espirer,espiraedje +Keywords[xh]=imbali,ephelelwa lixesha +Keywords[zh_CN]=history,expire,历史,过期 +Keywords[zh_TW]=history,expire,歷史紀錄,過期 +Keywords[zu]=umlando,ukuphelelwa isikhathi +Categories=Qt;KDE;X-KDE-settings-webbrowsing; diff --git a/konqueror/sidebar/trees/history_module/kcmhistory.h b/konqueror/sidebar/trees/history_module/kcmhistory.h new file mode 100644 index 000000000..5eaaf3a64 --- /dev/null +++ b/konqueror/sidebar/trees/history_module/kcmhistory.h @@ -0,0 +1,64 @@ +/* + * kcmhistory.h + * Copyright (c) 2002 Stephan Binner <binner@kde.org> + * + * based on kcmtaskbar.h + * Copyright (c) 2000 Kurt Granroth <granroth@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; 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 + */ +#ifndef __kcmhistory_h__ +#define __kcmhistory_h__ + +#include <kcmodule.h> + +class KonqHistoryManager; +class KonqSidebarHistorySettings; +class KonqSidebarHistoryDlg; + +class HistorySidebarConfig : public KCModule +{ + Q_OBJECT + +public: + HistorySidebarConfig( QWidget *parent=0, const char* name=0, const QStringList &list=QStringList() ); + + void load(); + void save(); + void defaults(); + + QString quickHelp() const; + +private slots: + void configChanged(); + + void slotGetFontNewer(); + void slotGetFontOlder(); + + void slotExpireChanged( int ); + void slotNewerChanged( int ); + void slotOlderChanged( int ); + + void slotClearHistory(); + +private: + QFont m_fontNewer; + QFont m_fontOlder; + + KonqSidebarHistoryDlg* dialog; + KonqSidebarHistorySettings *m_settings; + KonqHistoryManager *mgr; +}; + +#endif diff --git a/konqueror/sidebar/trees/init/Makefile.am b/konqueror/sidebar/trees/init/Makefile.am new file mode 100644 index 000000000..58c6186b0 --- /dev/null +++ b/konqueror/sidebar/trees/init/Makefile.am @@ -0,0 +1,16 @@ +SUBDIRS = remote services + +dataEntry_DATA = home.desktop root.desktop history.desktop bookmarks.desktop \ + services.desktop remote.desktop system.desktop +dataEntrydir = $(kde_datadir)/konqsidebartng/entries + +dataKickerEntries_DATA = home.desktop root.desktop history.desktop bookmarks.desktop \ + services.desktop remote.desktop +dataKickerEntriesdir = $(kde_datadir)/konqsidebartng/kicker_entries + + +dataAdd_DATA = virtualfolderadd.desktop +dataAdddir = $(kde_datadir)/konqsidebartng/add + +dataPlugins_DATA = history_module.desktop dirtree_module.desktop bookmarks_module.desktop +dataPluginsdir = $(kde_datadir)/konqsidebartng/dirtree diff --git a/konqueror/sidebar/trees/init/README b/konqueror/sidebar/trees/init/README new file mode 100644 index 000000000..c0907a3ae --- /dev/null +++ b/konqueror/sidebar/trees/init/README @@ -0,0 +1,6 @@ +Note: increase the version in konq_tree.cpp when you add + new .desktop files, otherwise they won't get used + when the user already has old versions. + +i.e. +const int currentVersion = 5; <-- change this in konq_tree.cpp diff --git a/konqueror/sidebar/trees/init/bookmarks.desktop b/konqueror/sidebar/trees/init/bookmarks.desktop new file mode 100644 index 000000000..1707aba6b --- /dev/null +++ b/konqueror/sidebar/trees/init/bookmarks.desktop @@ -0,0 +1,165 @@ +[Desktop Entry] +Type=Link +URL= +Icon=bookmark +Name=Bookmarks +Name[af]=Boekmerke +Name[ar]=علامات المواقع +Name[az]=Nişanlar +Name[be]=Закладкі +Name[bg]=Отметки +Name[bn]=বুকমার্ক +Name[br]=Sinedoù +Name[bs]=Zabilješke +Name[ca]=Punts +Name[cs]=Záložky +Name[csb]=Załóżczi +Name[cy]=Nodau Tudalen +Name[da]=Bogmærker +Name[de]=Lesezeichen +Name[el]=Σελιδοδείκτες +Name[eo]=Legosignoj +Name[es]=Marcadores +Name[et]=Järjehoidjad +Name[eu]=Laster-markak +Name[fa]=چوب الفها +Name[fi]=Kirjanmerkit +Name[fr]=Signets +Name[fy]=Blêdwizers +Name[ga]=Leabharmharcanna +Name[gl]=Marcadores +Name[he]=סימניות +Name[hi]= पसंदीदा +Name[hr]=Oznake +Name[hu]=Könyvjelzők +Name[id]=Bookmark +Name[is]=Bókamerki +Name[it]=Segnalibri +Name[ja]=ブックマーク +Name[ka]=სანიშნეები +Name[kk]=Бетбелгі +Name[km]=ចំណាំ +Name[ko]=책갈피 +Name[lo]=ທີ່ຄັ້ນປື້ມ +Name[lt]=Žymelės +Name[lv]=Grāmatzīmes +Name[mk]=Обележувачи +Name[mn]=Хавчуурга +Name[ms]=Tanda Buku +Name[mt]=Favoriti +Name[nb]=Bokmerker +Name[nds]=Leesteken +Name[ne]=पुस्तकचिनो +Name[nl]=Bladwijzers +Name[nn]=Bokmerke +Name[nso]=Ditshwao tsa Buka +Name[pa]=ਬੁੱਕਮਾਰਕ +Name[pl]=Zakładki +Name[pt]=Favoritos +Name[pt_BR]=Favoritos +Name[ro]=Semne de carte +Name[ru]=Закладки +Name[rw]=Utumenyetso +Name[se]=Girjemearkkat +Name[sk]=Záložky +Name[sl]=Zaznamki +Name[sr]=Маркери +Name[sr@Latn]=Markeri +Name[sv]=Bokmärken +Name[ta]=புத்தகக்குறிகள் +Name[te]=పేజి గుర్తులు +Name[tg]=Гузориш +Name[th]=ที่คั่นหน้า +Name[tr]=Yer imleri +Name[tt]=Bitbilge +Name[uk]=Закладки +Name[uz]=Xatchoʻplar +Name[uz@cyrillic]=Хатчўплар +Name[ven]=Dzitswayo dza bugu +Name[vi]=Sổ lưu địa chỉ +Name[wa]=Rimåkes +Name[xh]=Amanqaku eencwadi +Name[zh_CN]=书签 +Name[zh_TW]=書籤 +Name[zu]=Omaka bencwadi +Comment=This is the list of your bookmarks, for a faster access +Comment[af]=Hierdie is die lys van jou boekmerke, vir 'n vinniger toegang verkry +Comment[ar]=هذه قائمة بمواقعك المفضلة من أجل وصول أسرع +Comment[az]=Bunlar daha asan yetişmək üçün toplanan nişanlarınızdır +Comment[be]=Гэта спіс вашых закладак для хуткага доступу +Comment[bg]=Списък на отметки за бърз достъп +Comment[bn]=আপনার বুকমার্কের তালিকা, পছন্দের গন্তব্যে চটপট পৌঁছে যাবার জন্য +Comment[bs]=Ovo je lista vaših zabiljeških, za brži pristup +Comment[ca]=Aquesta és la llista dels vostres punts, per un accés més ràpid +Comment[cs]=Toto je seznam vašich záložek k jejich rychlejšímu nalezení +Comment[csb]=To je lësta załóżków, dlô chùtczégò przistãpù +Comment[cy]=Dyma restr eich nodau tudalen, am gyrchiad cyflymach +Comment[da]=Dette er en liste af dine bogmærker for hurtigere adgang +Comment[de]=Dies ist eine Liste Ihrer Lesezeichen, sie dient dem schnelleren Zugriff +Comment[el]=Αυτή είναι η λίστα των σελιδοδεικτών σας, για γρηγορότερη πρόσβαση +Comment[eo]=Jen la listo de viaj legosignoj por pli rapida aliro +Comment[es]=Esta es la lista de sus marcadores, para un acceso más rápido. +Comment[et]=Sinu järjehoidjate nimekiri +Comment[eu]=Hemen duzu zure laster-marken zerrenda, atzitze bizkorragorako +Comment[fa]=این فهرست چوب الفهای شما، برای دستیابی سریعتر است +Comment[fi]=Tämä on lista kirjanmerkeistäsi +Comment[fr]=Voici la liste de vos signets, afin que vous y accédiez plus rapidement +Comment[fy]=Dit is de list mei jo blêdwizers, foar fluggere tagong +Comment[ga]=Seo liosta do chuid leabharmharcanna, le haghaidh rochtain níos tapúla +Comment[gl]=Ésta é a lista dos seus marcadores, para un aceso máis rápido +Comment[he]=זוהי רשימת הסימניות שלך, לגישה מהירה +Comment[hi]=यह आपकी पसंद की सूची है, तेजी से पहुँच के लिए +Comment[hr]=Popis oznaka koje ubrzavaju pristup +Comment[hu]=A könyvjelzők listája (gyors elérhetőség) +Comment[is]=Hér eru bókamerkin þín +Comment[it]=Questa è la lista dei tuoi segnalibri, per un accesso più rapido +Comment[ja]=高速アクセスのためのブックマークのリストです +Comment[ka]=ეს არის თვენი სანიშნეების სია, რომელიც გჭირდებათ სწრაფად წვდომისთვის +Comment[kk]=Тез ақтару үшін бетбелгі тізіміңіз +Comment[km]=នេះជាបញ្ជីចំណាំរបស់អ្នក ដែលអាចចូលដំណើរការបានលឿន +Comment[ko]=빠른 접근을 위한 책갈피 목록입니다 +Comment[lo]=ນີ້ເປັນລາຍການທີ່ຄັ້ນປື້ມຂອງທ່ານ ເພື່ການຮງກໃຊ້ຢ່າງໄວร็ว +Comment[lt]=Šiame aplanke yra visos Jūsų žymelės, skirtos greitesniam priėjimui +Comment[lv]=Šis ir jūsu grāmatzīmju saraksts ātrākai pieejai +Comment[mk]=Ова е листа на вашите обележувачи што служат за побрз пристап +Comment[mn]=Энэ бол таны хавчуургын жагсаалт ба таньд хурдан хандах боломж олгоно. +Comment[ms]=Ini ialah senarai tanda buku anda, untuk akses terpantas +Comment[mt]=Din hija lista tal-favoriti tiegħek, għal aċċess ta' malajr +Comment[nb]=Dette er en liste over bokmerkene dine, for raskere tilgang +Comment[nds]=Dat is de List vun Dien Leesteken för gauen Togriep +Comment[ne]=छिटो पहुँचका लागि यो तपाईँको पुस्तकचिनो सूची हो +Comment[nl]=Dit is de lijst met uw bladwijzers, voor snellere toegang +Comment[nn]=Dette er ei liste over bokmerka dine, for snøggare tilgang +Comment[nso]=Ye ke palo ya ditshwao tsa gago tsa buka,go tsenelo ya kapela +Comment[pa]=ਤੇਜ਼ ਖੋਲਣ ਲਈ ਇਹ ਤੁਹਾਡੇ ਬੁੱਕਮਾਰਕ ਦੀ ਸੂਚੀ ਹੈ +Comment[pl]=To jest lista zakładek, dla szybszego dostępu +Comment[pt]=Os seus favoritos, para um acesso mais rápido +Comment[pt_BR]=Esta pasta contém a sua lista dos favoritos, para o acesso mais rápido +Comment[ro]=Aceasta este lista semnelor dumneavoastră de carte +Comment[ru]=Список закладок для быстрого доступа +Comment[rw]=Uru ni urutonde rw'utumenyetso twawe, k'ukugera kwihuse +Comment[se]=Dát leat du girjemearkkat, álkibut gávdnat +Comment[sk]=Toto je zoznam vašich záložiek, pre rýchlejší prístup k nim +Comment[sl]=To je seznam vaših zaznamkov, za hitrejši dostop. +Comment[sr]=Ово је листа ваших маркера, ради лакшег приступа +Comment[sr@Latn]=Ovo je lista vaših markera, radi lakšeg pristupa +Comment[sv]=Det här är listan på dina bokmärken, för snabbare åtkomst +Comment[ta]=இந்த பட்டியல் உங்கள் புத்தக குறியீடுகளை விரைவாற் அணுகுவதற்கு. +Comment[tg]=Рӯйхати гузориш барои дастраси тез +Comment[th]=นี่เป็นรายการที่คั่นหน้าของคุณ เพื่อการเรียกใช้อย่างรวดเร็ว +Comment[tr]=Bu sizin daha hızlı erişiminiz için kısa yollarınızın bir listesidir +Comment[tt]=Tiz ireşü öçen bitbilgelär tezmäse +Comment[uk]=Це - список ваших закладок для швидкого доступу +Comment[uz]=Xatchoʻplar roʻyxati +Comment[uz@cyrillic]=Хатчўплар рўйхати +Comment[ven]=Hoyu ndi mutevhe wa tswayo dza bugu, uitele u dzhene ngau tavhanya +Comment[vi]=Đây là danh sách tất cả các địa chỉ đã lưu của bạn, giúp cho truy cập nhanh hơn +Comment[wa]=Cichal est l' djivêye di vos rmåkes, po les trover pus rade +Comment[xh]=Olu luluhlu lwamanqaku encwadi yakho, yonikezelo olukhawulezayo +Comment[zh_CN]=这是您的书签列表,以便使得访问更加方便 +Comment[zh_TW]=快速存取網站的書籤列表 +Comment[zu]=Lolu uhlu lomaka bakho bencwadi,ukuze ungene ngokushesha +Open=false +X-KDE-TreeModule=Bookmarks +X-KDE-SearchableTreeModule=true +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/bookmarks_module.desktop b/konqueror/sidebar/trees/init/bookmarks_module.desktop new file mode 100644 index 000000000..4f6c96324 --- /dev/null +++ b/konqueror/sidebar/trees/init/bookmarks_module.desktop @@ -0,0 +1,166 @@ +[Desktop Entry] +Type=Link +URL= +Icon=bookmark +Name=Bookmarks +Name[af]=Boekmerke +Name[ar]=علامات المواقع +Name[az]=Nişanlar +Name[be]=Закладкі +Name[bg]=Отметки +Name[bn]=বুকমার্ক +Name[br]=Sinedoù +Name[bs]=Zabilješke +Name[ca]=Punts +Name[cs]=Záložky +Name[csb]=Załóżczi +Name[cy]=Nodau Tudalen +Name[da]=Bogmærker +Name[de]=Lesezeichen +Name[el]=Σελιδοδείκτες +Name[eo]=Legosignoj +Name[es]=Marcadores +Name[et]=Järjehoidjad +Name[eu]=Laster-markak +Name[fa]=چوب الفها +Name[fi]=Kirjanmerkit +Name[fr]=Signets +Name[fy]=Blêdwizers +Name[ga]=Leabharmharcanna +Name[gl]=Marcadores +Name[he]=סימניות +Name[hi]= पसंदीदा +Name[hr]=Oznake +Name[hu]=Könyvjelzők +Name[id]=Bookmark +Name[is]=Bókamerki +Name[it]=Segnalibri +Name[ja]=ブックマーク +Name[ka]=სანიშნეები +Name[kk]=Бетбелгі +Name[km]=ចំណាំ +Name[ko]=책갈피 +Name[lo]=ທີ່ຄັ້ນປື້ມ +Name[lt]=Žymelės +Name[lv]=Grāmatzīmes +Name[mk]=Обележувачи +Name[mn]=Хавчуурга +Name[ms]=Tanda Buku +Name[mt]=Favoriti +Name[nb]=Bokmerker +Name[nds]=Leesteken +Name[ne]=पुस्तकचिनो +Name[nl]=Bladwijzers +Name[nn]=Bokmerke +Name[nso]=Ditshwao tsa Buka +Name[pa]=ਬੁੱਕਮਾਰਕ +Name[pl]=Zakładki +Name[pt]=Favoritos +Name[pt_BR]=Favoritos +Name[ro]=Semne de carte +Name[ru]=Закладки +Name[rw]=Utumenyetso +Name[se]=Girjemearkkat +Name[sk]=Záložky +Name[sl]=Zaznamki +Name[sr]=Маркери +Name[sr@Latn]=Markeri +Name[sv]=Bokmärken +Name[ta]=புத்தகக்குறிகள் +Name[te]=పేజి గుర్తులు +Name[tg]=Гузориш +Name[th]=ที่คั่นหน้า +Name[tr]=Yer imleri +Name[tt]=Bitbilge +Name[uk]=Закладки +Name[uz]=Xatchoʻplar +Name[uz@cyrillic]=Хатчўплар +Name[ven]=Dzitswayo dza bugu +Name[vi]=Sổ lưu địa chỉ +Name[wa]=Rimåkes +Name[xh]=Amanqaku eencwadi +Name[zh_CN]=书签 +Name[zh_TW]=書籤 +Name[zu]=Omaka bencwadi +Comment=This is the list of your bookmarks, for a faster access +Comment[af]=Hierdie is die lys van jou boekmerke, vir 'n vinniger toegang verkry +Comment[ar]=هذه قائمة بمواقعك المفضلة من أجل وصول أسرع +Comment[az]=Bunlar daha asan yetişmək üçün toplanan nişanlarınızdır +Comment[be]=Гэта спіс вашых закладак для хуткага доступу +Comment[bg]=Списък на отметки за бърз достъп +Comment[bn]=আপনার বুকমার্কের তালিকা, পছন্দের গন্তব্যে চটপট পৌঁছে যাবার জন্য +Comment[bs]=Ovo je lista vaših zabiljeških, za brži pristup +Comment[ca]=Aquesta és la llista dels vostres punts, per un accés més ràpid +Comment[cs]=Toto je seznam vašich záložek k jejich rychlejšímu nalezení +Comment[csb]=To je lësta załóżków, dlô chùtczégò przistãpù +Comment[cy]=Dyma restr eich nodau tudalen, am gyrchiad cyflymach +Comment[da]=Dette er en liste af dine bogmærker for hurtigere adgang +Comment[de]=Dies ist eine Liste Ihrer Lesezeichen, sie dient dem schnelleren Zugriff +Comment[el]=Αυτή είναι η λίστα των σελιδοδεικτών σας, για γρηγορότερη πρόσβαση +Comment[eo]=Jen la listo de viaj legosignoj por pli rapida aliro +Comment[es]=Esta es la lista de sus marcadores, para un acceso más rápido. +Comment[et]=Sinu järjehoidjate nimekiri +Comment[eu]=Hemen duzu zure laster-marken zerrenda, atzitze bizkorragorako +Comment[fa]=این فهرست چوب الفهای شما، برای دستیابی سریعتر است +Comment[fi]=Tämä on lista kirjanmerkeistäsi +Comment[fr]=Voici la liste de vos signets, afin que vous y accédiez plus rapidement +Comment[fy]=Dit is de list mei jo blêdwizers, foar fluggere tagong +Comment[ga]=Seo liosta do chuid leabharmharcanna, le haghaidh rochtain níos tapúla +Comment[gl]=Ésta é a lista dos seus marcadores, para un aceso máis rápido +Comment[he]=זוהי רשימת הסימניות שלך, לגישה מהירה +Comment[hi]=यह आपकी पसंद की सूची है, तेजी से पहुँच के लिए +Comment[hr]=Popis oznaka koje ubrzavaju pristup +Comment[hu]=A könyvjelzők listája (gyors elérhetőség) +Comment[is]=Hér eru bókamerkin þín +Comment[it]=Questa è la lista dei tuoi segnalibri, per un accesso più rapido +Comment[ja]=高速アクセスのためのブックマークのリストです +Comment[ka]=ეს არის თვენი სანიშნეების სია, რომელიც გჭირდებათ სწრაფად წვდომისთვის +Comment[kk]=Тез ақтару үшін бетбелгі тізіміңіз +Comment[km]=នេះជាបញ្ជីចំណាំរបស់អ្នក ដែលអាចចូលដំណើរការបានលឿន +Comment[ko]=빠른 접근을 위한 책갈피 목록입니다 +Comment[lo]=ນີ້ເປັນລາຍການທີ່ຄັ້ນປື້ມຂອງທ່ານ ເພື່ການຮງກໃຊ້ຢ່າງໄວร็ว +Comment[lt]=Šiame aplanke yra visos Jūsų žymelės, skirtos greitesniam priėjimui +Comment[lv]=Šis ir jūsu grāmatzīmju saraksts ātrākai pieejai +Comment[mk]=Ова е листа на вашите обележувачи што служат за побрз пристап +Comment[mn]=Энэ бол таны хавчуургын жагсаалт ба таньд хурдан хандах боломж олгоно. +Comment[ms]=Ini ialah senarai tanda buku anda, untuk akses terpantas +Comment[mt]=Din hija lista tal-favoriti tiegħek, għal aċċess ta' malajr +Comment[nb]=Dette er en liste over bokmerkene dine, for raskere tilgang +Comment[nds]=Dat is de List vun Dien Leesteken för gauen Togriep +Comment[ne]=छिटो पहुँचका लागि यो तपाईँको पुस्तकचिनो सूची हो +Comment[nl]=Dit is de lijst met uw bladwijzers, voor snellere toegang +Comment[nn]=Dette er ei liste over bokmerka dine, for snøggare tilgang +Comment[nso]=Ye ke palo ya ditshwao tsa gago tsa buka,go tsenelo ya kapela +Comment[pa]=ਤੇਜ਼ ਖੋਲਣ ਲਈ ਇਹ ਤੁਹਾਡੇ ਬੁੱਕਮਾਰਕ ਦੀ ਸੂਚੀ ਹੈ +Comment[pl]=To jest lista zakładek, dla szybszego dostępu +Comment[pt]=Os seus favoritos, para um acesso mais rápido +Comment[pt_BR]=Esta pasta contém a sua lista dos favoritos, para o acesso mais rápido +Comment[ro]=Aceasta este lista semnelor dumneavoastră de carte +Comment[ru]=Список закладок для быстрого доступа +Comment[rw]=Uru ni urutonde rw'utumenyetso twawe, k'ukugera kwihuse +Comment[se]=Dát leat du girjemearkkat, álkibut gávdnat +Comment[sk]=Toto je zoznam vašich záložiek, pre rýchlejší prístup k nim +Comment[sl]=To je seznam vaših zaznamkov, za hitrejši dostop. +Comment[sr]=Ово је листа ваших маркера, ради лакшег приступа +Comment[sr@Latn]=Ovo je lista vaših markera, radi lakšeg pristupa +Comment[sv]=Det här är listan på dina bokmärken, för snabbare åtkomst +Comment[ta]=இந்த பட்டியல் உங்கள் புத்தக குறியீடுகளை விரைவாற் அணுகுவதற்கு. +Comment[tg]=Рӯйхати гузориш барои дастраси тез +Comment[th]=นี่เป็นรายการที่คั่นหน้าของคุณ เพื่อการเรียกใช้อย่างรวดเร็ว +Comment[tr]=Bu sizin daha hızlı erişiminiz için kısa yollarınızın bir listesidir +Comment[tt]=Tiz ireşü öçen bitbilgelär tezmäse +Comment[uk]=Це - список ваших закладок для швидкого доступу +Comment[uz]=Xatchoʻplar roʻyxati +Comment[uz@cyrillic]=Хатчўплар рўйхати +Comment[ven]=Hoyu ndi mutevhe wa tswayo dza bugu, uitele u dzhene ngau tavhanya +Comment[vi]=Đây là danh sách tất cả các địa chỉ đã lưu của bạn, giúp cho truy cập nhanh hơn +Comment[wa]=Cichal est l' djivêye di vos rmåkes, po les trover pus rade +Comment[xh]=Olu luluhlu lwamanqaku encwadi yakho, yonikezelo olukhawulezayo +Comment[zh_CN]=这是您的书签列表,以便使得访问更加方便 +Comment[zh_TW]=快速存取網站的書籤列表 +Comment[zu]=Lolu uhlu lomaka bakho bencwadi,ukuze ungene ngokushesha +Open=false +X-KDE-TreeModule=Bookmarks +X-KDE-SearchableTreeModule=true +X-KDE-TreeModule-Lib=konq_sidebartree_bookmarks +X-KDE-Default-URL= diff --git a/konqueror/sidebar/trees/init/dirtree_module.desktop b/konqueror/sidebar/trees/init/dirtree_module.desktop new file mode 100644 index 000000000..7db283eb2 --- /dev/null +++ b/konqueror/sidebar/trees/init/dirtree_module.desktop @@ -0,0 +1,82 @@ +[Desktop Entry] +Type=Link +URL= +Icon=folder +Name=Folder +Name[af]=Gids +Name[ar]=المجلد +Name[az]=Qovluq +Name[be]=Тэчка +Name[bg]=Директория +Name[bn]=ফোল্ডার +Name[br]=Renkell +Name[bs]=Direktorij +Name[ca]=Carpeta +Name[cs]=Složka +Name[csb]=Katalog +Name[cy]=Plygell +Name[da]=Mappe +Name[de]=Ordner +Name[el]=Φάκελος +Name[eo]=Dosierujo +Name[es]=Carpeta +Name[et]=Kataloog +Name[eu]=Karpeta +Name[fa]=پوشه +Name[fi]=Kansio +Name[fr]=Dossier +Name[fy]=Map +Name[ga]=Fillteán +Name[gl]=Cartafol +Name[he]=תיקייה +Name[hi]=फ़ोल्डर +Name[hr]=Mapa +Name[hu]=Könyvtár +Name[is]=Mappa +Name[it]=Cartella +Name[ja]=フォルダ +Name[ka]=საქაღალდე +Name[kk]=Қапшық +Name[km]=ថត +Name[ko]=홈 폴더 +Name[lt]=Aplankas +Name[lv]=Mape +Name[mk]=Папка +Name[mn]=хавтас +Name[mt]=Direttorju +Name[nb]=Mappe +Name[nds]=Orner +Name[ne]=फोल्डर +Name[nl]=Map +Name[nn]=Mappe +Name[pa]=ਫੋਲਡਰ +Name[pl]=Katalog +Name[pt]=Pasta +Name[pt_BR]=Pasta +Name[ru]=Папка +Name[rw]=Ububiko +Name[se]=Máhppa +Name[sk]=Priečinok +Name[sl]=Mapa +Name[sr]=Фасцикла +Name[sr@Latn]=Fascikla +Name[sv]=Katalog +Name[ta]=அடைவு +Name[te]=ఫొల్డర్ +Name[tg]=Феҳрист +Name[th]=โฟลเดอร์ +Name[tr]=Dizin +Name[tt]=Törgäk +Name[uk]=Тека +Name[uz]=Jild +Name[uz@cyrillic]=Жилд +Name[vi]=Thư mục +Name[wa]=Ridant +Name[zh_CN]=文件夹 +Name[zh_TW]=資料夾 +Open=false + +X-KDE-TreeModule=Directory +X-KDE-TreeModule-Lib=konq_sidebartree_dirtree +X-KDE-Default-URL=file:/ +X-KDE-TreeModule-ShowHidden=false diff --git a/konqueror/sidebar/trees/init/history.desktop b/konqueror/sidebar/trees/init/history.desktop new file mode 100644 index 000000000..f81c3a56f --- /dev/null +++ b/konqueror/sidebar/trees/init/history.desktop @@ -0,0 +1,164 @@ +[Desktop Entry] +Type=Link +URL= +Icon=history +Name=History +Name[af]=Geskiedenis +Name[ar]=الخطّ الزمني +Name[az]=Keçmiş +Name[be]=Гісторыя +Name[bg]=История +Name[bn]=ইতিহাস +Name[br]=Istor +Name[bs]=Historija +Name[ca]=Historial +Name[cs]=Historie +Name[csb]=Historëjô +Name[cy]=Hanes +Name[da]=Historik +Name[de]=Verlaufsspeicher +Name[el]=Ιστορικό +Name[eo]=Historio +Name[es]=Historial +Name[et]=Ajalugu +Name[eu]=Historia +Name[fa]=تاریخچه +Name[fi]=Historia +Name[fr]=Historique +Name[fy]=Histoarje +Name[ga]=Stair +Name[gl]=Historial +Name[he]=היסטוריה +Name[hi]=इतिहास +Name[hr]=Povijest +Name[hu]=Napló +Name[id]=Sejarah +Name[is]=Saga +Name[it]=Cronologia +Name[ja]=履歴 +Name[ka]=ისტორია +Name[kk]=Журнал +Name[km]=ប្រវត្តិ +Name[ko]=과거 기록 +Name[lo]=ປະວັດການໃຊ້ງານ +Name[lt]=Istorija +Name[lv]=Vēsture +Name[mk]=Историја +Name[mn]=Түүх +Name[ms]=Sejarah +Name[mt]=Kronoloġija +Name[nb]=Historie +Name[nds]=Vörgeschicht +Name[ne]=इतिहास +Name[nl]=Geschiedenis +Name[nn]=Historie +Name[nso]=Histori +Name[pa]=ਅਤੀਤ +Name[pl]=Historia +Name[pt]=Histórico +Name[pt_BR]=Histórico +Name[ro]=Istoric +Name[ru]=Журнал +Name[rw]=Amateka +Name[se]=Historihkka +Name[sk]=História +Name[sl]=Zgodovina +Name[sr]=Историјат +Name[sr@Latn]=Istorijat +Name[sv]=Historik +Name[ta]=வரலாறு +Name[te]=చరిత్ర +Name[tg]=Таърих +Name[th]=ประวัติการใช้ +Name[tr]=Geçmiş +Name[tt]=Taríx +Name[uk]=Історія +Name[uz]=Tarix +Name[uz@cyrillic]=Тарих +Name[ven]=Divhazwakale +Name[vi]=Lịch sử +Name[wa]=Istwere +Name[xh]=Imbali +Name[zh_CN]=历史 +Name[zh_TW]=歷史紀錄 +Name[zu]=Umlando +Comment=This is the history of the URLs you have recently visited. You can sort them in many ways. +Comment[af]=Hierdie is die geskiedenis van die Urls jy het onlangse besoekte. jy kan sorteer hulle in veel maniere. +Comment[ar]=هذا الخط الزمني للمواقع التي زرتها حديثاً. يمكنك ترتيبها بالعديد من الطرق. +Comment[az]=Bu da əvvəllər ziyarət etdiyiniz URLlərin siyahısıdır. Onları istədiyiniz kimi düzə bilərsiiz. +Comment[be]=Гэта гісторыя спасылак URL, якія вы раней наведалі. Вы можаце ўпарадкаваць іх рознымі спосабамі. +Comment[bg]=История на скоро посетените адреси +Comment[bn]=আপনি সম্প্রতি কোন কোন ইউ-আর-এল-এ গিয়েছেন তার ইতিহাস। আপনি এই তালিকাটি নানাভাবে সাজাতে পারেন। +Comment[bs]=Ovo je historija URLova koje ste nedavno posjetili. Možete ih složiti na više načina. +Comment[ca]=Aquest és l'historial amb els URL que heu visitat recentment. Podeu ordenar-les de moltes maneres. +Comment[cs]=Toto je historie URL, které jste naposledy navštívili. Můžete si je různými způsoby setřídit. +Comment[csb]=Historëjô slédno òbzérónëch adresów URL. Je mòżno jã na wszelejaczé ôrte zortowac. +Comment[cy]=Dyma hanes y safleoedd rydych wedi ymweld a nhw. Gallwch eu didoli mewn sawl ffordd. +Comment[da]=Dette er historikken for de URL'er du har besøgt for nyligt. Du kan sortere dem på mange måder. +Comment[de]=Dies ist ein Ordner für alle Adressen, die Sie in letzter Zeit besucht haben. Sie können sie auf vielerlei Weise sortieren. +Comment[el]=Αυτό είναι το ιστορικό των URL που επισκεφθήκατε πρόσφατα. Μπορείτε να τα ταξινομήσετε με πολλούς τρόπους. +Comment[eo]=Jen la historio de la vizititaj URLoj. Vi povas ordigi ilin diversmaniere. +Comment[es]=Este es el historial con las URLs que ha visitado recientemente. Puede ordenarlas de diversos modos. +Comment[et]=Sinu viimati külastatud saitide ajalugu. Ajalugu on võimalik mitmel moel sorteerida. +Comment[eu]=Hau bisitatu berri dituzun URLen historia da. Era askotan antola ditzakezu +Comment[fa]=این تاریخچۀ نشانیهای وبی است که اخیراً بازدید کردهاید. میتوانید آنها را به روشهای زیادی مرتب کنید. +Comment[fi]=Tämä on historia selatuista verkko-osoitteista. Ne voidaan järjestää monella tavalla. +Comment[fr]=Voici la liste des URL que vous avez récemment visitées. Vous pouvez les trier de multiples façons. +Comment[fy]=Dit is de histoarje fan de URL-adressen wêr jo koartlyn west ha. Jo kinne se op ferskate manieren sortearje. +Comment[gl]=Éste é o historial de URLs que visitou recentemente. Pode ordená-las de varios xeitos. +Comment[he]=זוהי היסטוריית הכתובות בהן ביקרת לאחרונה. באפשרותך לסדר אותה במגוון דרכים. +Comment[hi]=आप जो हालिया भ्रमण किए हैं, उन यूआरएल का यह इतिहास है. आप इन्हें कई तरीकों से क्रमबद्ध कर सकते हैं. +Comment[hr]=Povijest nedavno posjećenih URL adresa koji je moguće preslagivati na različite načine +Comment[hu]=Itt láthatók a legutóbb meglátogatott URL-ek. Többféle szempont szerint is sorba rendezhetők. +Comment[is]=Þetta er saga þeirra heimasíðna sem þú hefur heimsótt. Þú getur raðað þessum lista á ýmsan hátt. +Comment[it]=Questa è la cronologia degli indirizzi URL che hai visitato recentemente. Puoi ordinarli in vari modi. +Comment[ja]=最近訪問した URL のリストを表示します。リストはさまざまな方法でソートできます。 +Comment[ka]=ეს არის იმ URL-თა სია რომელიც ბოლო დროს მოინახულეთ. თქვენ შეგიძლიათ მათი დალაგება თქვენი ნებისამებრ +Comment[kk]=Жуырда жолыққан URL адрестер. Өз ыңғайыңызға қарай реттеп алуға болады. +Comment[km]=នេះជាប្រវត្តិរបស់ URL ដែលអ្នកបានទស្សនាថ្មីៗនេះ ។ អ្នកអាចតម្រៀបពួកវាតាមវិធីជាច្រើន ។ +Comment[ko]=이것은 최근에 방문한 URL 기록입니다. 다양한 방법으로 정렬할 수 있습니다. +Comment[lo]=ນີ້ເປັນປະວັດເກັບ URL ທີ່ທ່ານເຄີຍມມກ່ອນໂດຍທ່ານສາມາດລງງລຳດັບມັນໄດ້ໃນຫລາຍຮູບແບບ +Comment[lt]=Tai Jūsų neseniai aplankytų URL istorija, Jūs galite surūšiuoti juos įvairiais būdais. +Comment[lv]=Šī ir nesen apmeklēto URL vēsture. Jūs varat to šķirot daudzos veidos. +Comment[mk]=Ова е историја на URL кои скоро сте ги посетиле. Може да ги подредувате на разни начини. +Comment[mn]= Энэ бол таны хамгийн сүүлд айлчилсан URL хаягуудын түүх юм. Та тэдгээрийг янз бүрээр эрэмбэлж болно. +Comment[ms]=Ini ialah sejarah URL yang baru anda lawati. Anda tidak boleh isihkan ia dalam banyak cara. +Comment[mt]=Din hija kronoloġija tal-URLs kollha li żort reċentement. Tista' tissortjahom b'diversi modi. +Comment[nb]=Dette er en liste over de nettadressene du har vært innom nylig. Du kan sortere dem på ulike måter. +Comment[nds]=Dit is de Vörgeschicht vun Sieden, de Du tolest besöcht hest. Du kannst se op mennige Oorden sorteren. +Comment[ne]=यो तपाईँले भर्खरै अवलोकन गर्नु भएको यूआरएलहरूको सूची हो । तीनिहरूलाई तपाईँले धेरै तरिकाले क्रमबद्ध गर्न सक्नुहुन्छ । +Comment[nl]=Dit is de geschiedenis van de URL-adressen waar u recentelijk bent geweest. U kunt ze op meerdere manieren sorteren. +Comment[nn]=Dette er historia over adressene du nyleg har vitja. Du kan sortera lista på mange måtar. +Comment[nso]=Ye ke histori ya di-URL tseo odi etetsego gabjale. Okadi rarolla ka mekgwa ye mentshi. +Comment[pa]=ਇਹ URL ਦੀ ਸੂਚੀ ਹੈ, ਜੋ ਕਿ ਤੁਸੀਂ ਖੋਲੋ ਸਨ, ਤੁਸੀਂ ਇਹਨਾਂ ਨੂੰ ਕਈ ਤਰਾਂ ਕ੍ਰਮਬੱਧ ਕਰ ਸਕਦੇ ਹੋ। +Comment[pl]=Historia ostatnio odwiedzonych adresów URL. Można ją na różne sposoby posortować. +Comment[pt]=O histórico dos URLs visitados recentemente. É possível ordená-los de várias maneiras. +Comment[pt_BR]=Este é o histórico das URLs que você visitou recentemente. Você pode ordenar esta lista de várias maneiras. +Comment[ro]=Acesta este istoricul URL-urilor pe care le-ați vizitat recent. Le puteți sorta în diferite moduri. +Comment[ru]=Журнал недавно посещённых адресов (URL). Его можно настраивать по своему усмотрению. +Comment[rw]=Aya ni amateka ya URL wasuye vuba. Ushobora kuzishungura mu buryo bwinshi. +Comment[se]=Dán listtus oainnát čujuhusaid maid áiddo leat guossohan. Don sáhtát erohallat listtu máŋgga láhkai. +Comment[sk]=Toto je história URL, ktoré ste naposledy navštívili. Môžete ich utriediť rôznymi spôsobmi. +Comment[sl]=To je zgodovina URL-jev, ki ste jih pred kratkim obiskali. Lahko jih uredite na različne načine. +Comment[sr]=Ово је листа URL-ова које сте недавно посетили. Можете је поређати на разне начине. +Comment[sr@Latn]=Ovo je lista URL-ova koje ste nedavno posetili. Možete je poređati na razne načine. +Comment[sv]=Det här är historiken på de webbadresser du nyligen besökt. Du kan sortera dem på många sätt. +Comment[ta]=நீங்கள் தற்போது பார்த்த வலைப்பின்னல்களின் வரலாறு. அதை பல வழிகளில் வரிசைப்படுத்தலாம். +Comment[tg]=Ин саҳифаҳои аз торихчаи URL-ҳое ки охирон дидаед. Метавонед онҳоро ба ҳар сурати дархост мураттаб кунед. +Comment[th]=นี่เป็นประวัติเก็บ URL ที่คุณเคยไปมาก่อน โดยคุณสามารถเรียงลำดับมันได้ในหลายรูปแบบ +Comment[tr]=Bu sizim yakın geçmişte ziyaret ettiğiniz URL'lerin bir listesidir. Bunları bir çok şekilde sıralayabilirsiniz. +Comment[tt]=Soñğı arada qaralğan bulğan URL tezmäse. Anı törleçä tärtipläp bula. +Comment[uk]=Це - історія URL, які ви недавно відвідали. Ви можете також впорядкувати її будь-яким чином. +Comment[uz]=Yaqinda koʻrgan URL'larning tarixi. Ularni turlicha saralashingiz mumkin +Comment[uz@cyrillic]=Яқинда кўрган URL'ларнинг тарихи. Уларни турлича саралашингиз мумкин +Comment[ven]=Heyi ndi divhazwakale ya URL no i dalelaho zwazwino. Ni nga i lugisa nga ndila dzo fhambananho. +Comment[vi]=Đây là danh sách các URL bạn đã xem gần đây. Bạn có thể sắp xếp lại chúng theo vài cách khác nhau. +Comment[wa]=Cichal est l' istwere des URL ki vs avoz vizité enawaire. Vos les ploz arindjî di sacwantès manires. +Comment[xh]=Le yimbali yee URL obusandukuzindwendwela. Ungazibeka ngendlela ezininzi. +Comment[zh_CN]=这是您曾经浏览过的 URL 历史。您可以以多种方式对其排序。 +Comment[zh_TW]=這是您最近訪問的 URL 的歷史紀錄。您可以將它們以多種方式排序。 +Comment[zu]=Lo umlando wama-URL osanda kuwavakashela. Ungawahlela ngezindlela eziningi. +Open=false +X-KDE-TreeModule=History +X-KDE-SearchableTreeModule=true +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/history_module.desktop b/konqueror/sidebar/trees/init/history_module.desktop new file mode 100644 index 000000000..47d26b3b6 --- /dev/null +++ b/konqueror/sidebar/trees/init/history_module.desktop @@ -0,0 +1,165 @@ +[Desktop Entry] +Type=Link +URL= +Icon=history +Name=History +Name[af]=Geskiedenis +Name[ar]=الخطّ الزمني +Name[az]=Keçmiş +Name[be]=Гісторыя +Name[bg]=История +Name[bn]=ইতিহাস +Name[br]=Istor +Name[bs]=Historija +Name[ca]=Historial +Name[cs]=Historie +Name[csb]=Historëjô +Name[cy]=Hanes +Name[da]=Historik +Name[de]=Verlaufsspeicher +Name[el]=Ιστορικό +Name[eo]=Historio +Name[es]=Historial +Name[et]=Ajalugu +Name[eu]=Historia +Name[fa]=تاریخچه +Name[fi]=Historia +Name[fr]=Historique +Name[fy]=Histoarje +Name[ga]=Stair +Name[gl]=Historial +Name[he]=היסטוריה +Name[hi]=इतिहास +Name[hr]=Povijest +Name[hu]=Napló +Name[id]=Sejarah +Name[is]=Saga +Name[it]=Cronologia +Name[ja]=履歴 +Name[ka]=ისტორია +Name[kk]=Журнал +Name[km]=ប្រវត្តិ +Name[ko]=과거 기록 +Name[lo]=ປະວັດການໃຊ້ງານ +Name[lt]=Istorija +Name[lv]=Vēsture +Name[mk]=Историја +Name[mn]=Түүх +Name[ms]=Sejarah +Name[mt]=Kronoloġija +Name[nb]=Historie +Name[nds]=Vörgeschicht +Name[ne]=इतिहास +Name[nl]=Geschiedenis +Name[nn]=Historie +Name[nso]=Histori +Name[pa]=ਅਤੀਤ +Name[pl]=Historia +Name[pt]=Histórico +Name[pt_BR]=Histórico +Name[ro]=Istoric +Name[ru]=Журнал +Name[rw]=Amateka +Name[se]=Historihkka +Name[sk]=História +Name[sl]=Zgodovina +Name[sr]=Историјат +Name[sr@Latn]=Istorijat +Name[sv]=Historik +Name[ta]=வரலாறு +Name[te]=చరిత్ర +Name[tg]=Таърих +Name[th]=ประวัติการใช้ +Name[tr]=Geçmiş +Name[tt]=Taríx +Name[uk]=Історія +Name[uz]=Tarix +Name[uz@cyrillic]=Тарих +Name[ven]=Divhazwakale +Name[vi]=Lịch sử +Name[wa]=Istwere +Name[xh]=Imbali +Name[zh_CN]=历史 +Name[zh_TW]=歷史紀錄 +Name[zu]=Umlando +Comment=This is the history of the URLs you have recently visited. You can sort them in many ways. +Comment[af]=Hierdie is die geskiedenis van die Urls jy het onlangse besoekte. jy kan sorteer hulle in veel maniere. +Comment[ar]=هذا الخط الزمني للمواقع التي زرتها حديثاً. يمكنك ترتيبها بالعديد من الطرق. +Comment[az]=Bu da əvvəllər ziyarət etdiyiniz URLlərin siyahısıdır. Onları istədiyiniz kimi düzə bilərsiiz. +Comment[be]=Гэта гісторыя спасылак URL, якія вы раней наведалі. Вы можаце ўпарадкаваць іх рознымі спосабамі. +Comment[bg]=История на скоро посетените адреси +Comment[bn]=আপনি সম্প্রতি কোন কোন ইউ-আর-এল-এ গিয়েছেন তার ইতিহাস। আপনি এই তালিকাটি নানাভাবে সাজাতে পারেন। +Comment[bs]=Ovo je historija URLova koje ste nedavno posjetili. Možete ih složiti na više načina. +Comment[ca]=Aquest és l'historial amb els URL que heu visitat recentment. Podeu ordenar-les de moltes maneres. +Comment[cs]=Toto je historie URL, které jste naposledy navštívili. Můžete si je různými způsoby setřídit. +Comment[csb]=Historëjô slédno òbzérónëch adresów URL. Je mòżno jã na wszelejaczé ôrte zortowac. +Comment[cy]=Dyma hanes y safleoedd rydych wedi ymweld a nhw. Gallwch eu didoli mewn sawl ffordd. +Comment[da]=Dette er historikken for de URL'er du har besøgt for nyligt. Du kan sortere dem på mange måder. +Comment[de]=Dies ist ein Ordner für alle Adressen, die Sie in letzter Zeit besucht haben. Sie können sie auf vielerlei Weise sortieren. +Comment[el]=Αυτό είναι το ιστορικό των URL που επισκεφθήκατε πρόσφατα. Μπορείτε να τα ταξινομήσετε με πολλούς τρόπους. +Comment[eo]=Jen la historio de la vizititaj URLoj. Vi povas ordigi ilin diversmaniere. +Comment[es]=Este es el historial con las URLs que ha visitado recientemente. Puede ordenarlas de diversos modos. +Comment[et]=Sinu viimati külastatud saitide ajalugu. Ajalugu on võimalik mitmel moel sorteerida. +Comment[eu]=Hau bisitatu berri dituzun URLen historia da. Era askotan antola ditzakezu +Comment[fa]=این تاریخچۀ نشانیهای وبی است که اخیراً بازدید کردهاید. میتوانید آنها را به روشهای زیادی مرتب کنید. +Comment[fi]=Tämä on historia selatuista verkko-osoitteista. Ne voidaan järjestää monella tavalla. +Comment[fr]=Voici la liste des URL que vous avez récemment visitées. Vous pouvez les trier de multiples façons. +Comment[fy]=Dit is de histoarje fan de URL-adressen wêr jo koartlyn west ha. Jo kinne se op ferskate manieren sortearje. +Comment[gl]=Éste é o historial de URLs que visitou recentemente. Pode ordená-las de varios xeitos. +Comment[he]=זוהי היסטוריית הכתובות בהן ביקרת לאחרונה. באפשרותך לסדר אותה במגוון דרכים. +Comment[hi]=आप जो हालिया भ्रमण किए हैं, उन यूआरएल का यह इतिहास है. आप इन्हें कई तरीकों से क्रमबद्ध कर सकते हैं. +Comment[hr]=Povijest nedavno posjećenih URL adresa koji je moguće preslagivati na različite načine +Comment[hu]=Itt láthatók a legutóbb meglátogatott URL-ek. Többféle szempont szerint is sorba rendezhetők. +Comment[is]=Þetta er saga þeirra heimasíðna sem þú hefur heimsótt. Þú getur raðað þessum lista á ýmsan hátt. +Comment[it]=Questa è la cronologia degli indirizzi URL che hai visitato recentemente. Puoi ordinarli in vari modi. +Comment[ja]=最近訪問した URL のリストを表示します。リストはさまざまな方法でソートできます。 +Comment[ka]=ეს არის იმ URL-თა სია რომელიც ბოლო დროს მოინახულეთ. თქვენ შეგიძლიათ მათი დალაგება თქვენი ნებისამებრ +Comment[kk]=Жуырда жолыққан URL адрестер. Өз ыңғайыңызға қарай реттеп алуға болады. +Comment[km]=នេះជាប្រវត្តិរបស់ URL ដែលអ្នកបានទស្សនាថ្មីៗនេះ ។ អ្នកអាចតម្រៀបពួកវាតាមវិធីជាច្រើន ។ +Comment[ko]=이것은 최근에 방문한 URL 기록입니다. 다양한 방법으로 정렬할 수 있습니다. +Comment[lo]=ນີ້ເປັນປະວັດເກັບ URL ທີ່ທ່ານເຄີຍມມກ່ອນໂດຍທ່ານສາມາດລງງລຳດັບມັນໄດ້ໃນຫລາຍຮູບແບບ +Comment[lt]=Tai Jūsų neseniai aplankytų URL istorija, Jūs galite surūšiuoti juos įvairiais būdais. +Comment[lv]=Šī ir nesen apmeklēto URL vēsture. Jūs varat to šķirot daudzos veidos. +Comment[mk]=Ова е историја на URL кои скоро сте ги посетиле. Може да ги подредувате на разни начини. +Comment[mn]= Энэ бол таны хамгийн сүүлд айлчилсан URL хаягуудын түүх юм. Та тэдгээрийг янз бүрээр эрэмбэлж болно. +Comment[ms]=Ini ialah sejarah URL yang baru anda lawati. Anda tidak boleh isihkan ia dalam banyak cara. +Comment[mt]=Din hija kronoloġija tal-URLs kollha li żort reċentement. Tista' tissortjahom b'diversi modi. +Comment[nb]=Dette er en liste over de nettadressene du har vært innom nylig. Du kan sortere dem på ulike måter. +Comment[nds]=Dit is de Vörgeschicht vun Sieden, de Du tolest besöcht hest. Du kannst se op mennige Oorden sorteren. +Comment[ne]=यो तपाईँले भर्खरै अवलोकन गर्नु भएको यूआरएलहरूको सूची हो । तीनिहरूलाई तपाईँले धेरै तरिकाले क्रमबद्ध गर्न सक्नुहुन्छ । +Comment[nl]=Dit is de geschiedenis van de URL-adressen waar u recentelijk bent geweest. U kunt ze op meerdere manieren sorteren. +Comment[nn]=Dette er historia over adressene du nyleg har vitja. Du kan sortera lista på mange måtar. +Comment[nso]=Ye ke histori ya di-URL tseo odi etetsego gabjale. Okadi rarolla ka mekgwa ye mentshi. +Comment[pa]=ਇਹ URL ਦੀ ਸੂਚੀ ਹੈ, ਜੋ ਕਿ ਤੁਸੀਂ ਖੋਲੋ ਸਨ, ਤੁਸੀਂ ਇਹਨਾਂ ਨੂੰ ਕਈ ਤਰਾਂ ਕ੍ਰਮਬੱਧ ਕਰ ਸਕਦੇ ਹੋ। +Comment[pl]=Historia ostatnio odwiedzonych adresów URL. Można ją na różne sposoby posortować. +Comment[pt]=O histórico dos URLs visitados recentemente. É possível ordená-los de várias maneiras. +Comment[pt_BR]=Este é o histórico das URLs que você visitou recentemente. Você pode ordenar esta lista de várias maneiras. +Comment[ro]=Acesta este istoricul URL-urilor pe care le-ați vizitat recent. Le puteți sorta în diferite moduri. +Comment[ru]=Журнал недавно посещённых адресов (URL). Его можно настраивать по своему усмотрению. +Comment[rw]=Aya ni amateka ya URL wasuye vuba. Ushobora kuzishungura mu buryo bwinshi. +Comment[se]=Dán listtus oainnát čujuhusaid maid áiddo leat guossohan. Don sáhtát erohallat listtu máŋgga láhkai. +Comment[sk]=Toto je história URL, ktoré ste naposledy navštívili. Môžete ich utriediť rôznymi spôsobmi. +Comment[sl]=To je zgodovina URL-jev, ki ste jih pred kratkim obiskali. Lahko jih uredite na različne načine. +Comment[sr]=Ово је листа URL-ова које сте недавно посетили. Можете је поређати на разне начине. +Comment[sr@Latn]=Ovo je lista URL-ova koje ste nedavno posetili. Možete je poređati na razne načine. +Comment[sv]=Det här är historiken på de webbadresser du nyligen besökt. Du kan sortera dem på många sätt. +Comment[ta]=நீங்கள் தற்போது பார்த்த வலைப்பின்னல்களின் வரலாறு. அதை பல வழிகளில் வரிசைப்படுத்தலாம். +Comment[tg]=Ин саҳифаҳои аз торихчаи URL-ҳое ки охирон дидаед. Метавонед онҳоро ба ҳар сурати дархост мураттаб кунед. +Comment[th]=นี่เป็นประวัติเก็บ URL ที่คุณเคยไปมาก่อน โดยคุณสามารถเรียงลำดับมันได้ในหลายรูปแบบ +Comment[tr]=Bu sizim yakın geçmişte ziyaret ettiğiniz URL'lerin bir listesidir. Bunları bir çok şekilde sıralayabilirsiniz. +Comment[tt]=Soñğı arada qaralğan bulğan URL tezmäse. Anı törleçä tärtipläp bula. +Comment[uk]=Це - історія URL, які ви недавно відвідали. Ви можете також впорядкувати її будь-яким чином. +Comment[uz]=Yaqinda koʻrgan URL'larning tarixi. Ularni turlicha saralashingiz mumkin +Comment[uz@cyrillic]=Яқинда кўрган URL'ларнинг тарихи. Уларни турлича саралашингиз мумкин +Comment[ven]=Heyi ndi divhazwakale ya URL no i dalelaho zwazwino. Ni nga i lugisa nga ndila dzo fhambananho. +Comment[vi]=Đây là danh sách các URL bạn đã xem gần đây. Bạn có thể sắp xếp lại chúng theo vài cách khác nhau. +Comment[wa]=Cichal est l' istwere des URL ki vs avoz vizité enawaire. Vos les ploz arindjî di sacwantès manires. +Comment[xh]=Le yimbali yee URL obusandukuzindwendwela. Ungazibeka ngendlela ezininzi. +Comment[zh_CN]=这是您曾经浏览过的 URL 历史。您可以以多种方式对其排序。 +Comment[zh_TW]=這是您最近訪問的 URL 的歷史紀錄。您可以將它們以多種方式排序。 +Comment[zu]=Lo umlando wama-URL osanda kuwavakashela. Ungawahlela ngezindlela eziningi. +Open=false +X-KDE-TreeModule=History +X-KDE-SearchableTreeModule=true +X-KDE-TreeModule-Lib=konq_sidebartree_history +X-KDE-Default-URL= diff --git a/konqueror/sidebar/trees/init/home.desktop b/konqueror/sidebar/trees/init/home.desktop new file mode 100644 index 000000000..d18f98466 --- /dev/null +++ b/konqueror/sidebar/trees/init/home.desktop @@ -0,0 +1,158 @@ +[Desktop Entry] +Type=Link +URL=file:$HOME +Icon=folder_home +Name=Home Folder +Name[af]=Tuis Gids +Name[ar]=منزلي +Name[az]=Ev Qovluğu +Name[be]=Хатняя тэчка +Name[bg]=Домашна директория +Name[bn]=ব্যক্তিগত ফোল্ডার +Name[br]=Renkell ar gêr +Name[bs]=Home direktorij +Name[ca]=Carpeta inici +Name[cs]=Domovská složka +Name[csb]=Domôcy katalog +Name[cy]=Plygell Cartref +Name[da]=Hjemmemappe +Name[de]=Persönlicher Ordner +Name[el]=Προσωπικός φάκελος +Name[eo]=Hejma dosierujo +Name[es]=Carpeta personal +Name[et]=Kodukataloog +Name[eu]=Etxeko karpeta +Name[fa]=پوشۀ آغازه +Name[fi]=Kotikansio +Name[fr]=Dossier personnel +Name[fy]=Persoanlike map +Name[ga]=Fillteán Baile +Name[gl]=Cartafol Persoal +Name[he]=תיקיית בית +Name[hi]=मुख फ़ोल्डर +Name[hr]=Početna mapa korisnika +Name[hu]=Saját könyvtár +Name[is]=Heimasvæði +Name[it]=Cartella Home +Name[ja]=ホームフォルダ +Name[ka]=საწყისი საქაღალდე +Name[kk]=Мекен қапшығы +Name[km]=ថតផ្ទះ +Name[ko]=홈 폴더 +Name[lt]=Namų aplankas +Name[lv]=Mājas mape +Name[mk]=Домашна папка +Name[mn]=Хувийн лавлах +Name[ms]=Folder Laman Utama +Name[mt]=Direttorju Personali +Name[nb]=Hjemmemappe +Name[nds]=Tohuus-Orner +Name[ne]=गृह फोल्डर +Name[nl]=Persoonlijke map +Name[nn]=Heimemappe +Name[pa]=ਘਰ ਫੋਲਡਰ +Name[pl]=Katalog domowy +Name[pt]=Pasta Pessoal +Name[pt_BR]=Pasta do Usuário +Name[ro]=Folder personal +Name[ru]=Домашняя папка +Name[rw]=Ububiko Urugo +Name[se]=Ruoktomáhppa +Name[sk]=Domovský priečinok +Name[sl]=Domača mapa +Name[sr]=Домаћа фасцикла +Name[sr@Latn]=Domaća fascikla +Name[sv]=Hemkatalog +Name[ta]=வீட்டு அடைவு +Name[te]=ఇంటి ఫొల్డర్ +Name[tg]=Феҳристи хонагӣ +Name[th]=โฟลเดอร์ส่วนตัว +Name[tr]=Başlangıç Dizini +Name[tt]=Ana Törgäk +Name[uk]=Домашня тека +Name[uz]=Uy jildi +Name[uz@cyrillic]=Уй жилди +Name[vi]=Thư mục Nhà +Name[wa]=Ridant måjhon +Name[zh_CN]=主文件夹 +Name[zh_TW]=家目錄 +Comment=This folder contains your personal files +Comment[af]=Hierdie kabinet bevat jou persoonlike lêers +Comment[ar]=هذا المجلّد يحتوي على ملفاتك الخاصة +Comment[az]=Bütün şəxsi fayllarınız bu qovluqda yer alır +Comment[be]=Гэтая тэчка ўтрымлівае вашы ўласныя файлы +Comment[bg]=Тази директория съдържа вашите лични файлове +Comment[bn]=এই ফোল্ডারে আপনার নিজের জাবতীয় ফাইল থাকে +Comment[bs]=Ovaj direktorij sadrži sve vaše osobne datoteke +Comment[ca]=Aquest directori conté els vostres fitxers personals +Comment[cs]=Tento adresář obsahuje vaše osobní soubory +Comment[csb]=Nen katalog zamëkô w se wszëtczé twòje priwatné lopczi +Comment[cy]=Mae'r plygell yma'n cadw eich ffeiliau personol +Comment[da]=Denne mappe indeholder dine personlige filer +Comment[de]=Dieser Ordner enthält Ihre persönlichen Dateien. +Comment[el]=Αυτός ο φάκελος περιέχει τα προσωπικά σας αρχεία +Comment[eo]=Tiu ĉi dosierujo enhavas viajn personajn dosierojn +Comment[es]=Esta carpeta contiene sus archivos personales +Comment[et]=See kataloog sisaldab sinu isiklike faile +Comment[eu]=Zeure fitxategiak karpeta honetan daude +Comment[fa]=این پوشه شامل پروندههای شخصی شماست +Comment[fi]=Tämä kansio sisältää henkilökohtaiset tiedostot +Comment[fr]=Ce dossier contient tous vos fichiers personnels +Comment[fy]=Dizze map befettet al jo persoanlike triemmen +Comment[ga]=Tá do chomhaid phearsanta san fhillteán seo +Comment[gl]=Este cartafol contén os seus ficheiros persoais +Comment[he]=תיקייה זו מכילה את הקבצים האישיים שלך +Comment[hi]=यह फ़ोल्डर आपकी निजी फ़ाइलें रखता है +Comment[hr]=Ova mapa sadrži vaše osobne datoteke +Comment[hu]=Ez a mappa tartalmazza az Ön személyes fájljait +Comment[is]=Þessi mappa inniheldur skjölin þín +Comment[it]=Questa cartella contiene i tuoi file personali +Comment[ja]=これはあなたの個人的なファイルを含むフォルダです +Comment[ka]=თქვენი პერსონალური ფაილების შესანახი საქაღალდე +Comment[kk]=Бұл қапшықта Сіздің дербес файлдарыңыз сақталады +Comment[km]=ថតនេះមានឯកសារផ្ទាល់ខ្លួនរបស់អ្នក +Comment[ko]=이 폴더는 개인 파일을 포함합니다 +Comment[lo]=ໂຟເດີນີ້ບັນຈຸແຟ້ມຕ່າງຯທີ່ເປັນສ່ວນຕົວຂອງທ່ານ +Comment[lt]=Šiame aplanke yra Jūsų asmeninės bylos +Comment[lv]=Šī mape satur jūsu personālos failus +Comment[mk]=Оваа папка ги содржи вашите лични датотеки +Comment[mn]=Энэ лавлах таны хувийн файлуудыг агуулна. +Comment[ms]=Folder ini mengandungi fail peribadi anda +Comment[mt]=Dan id-direttorju iżomm il-fajls personali kollha tiegħek. +Comment[nb]=Denne mappa inneholder dine personlige filer +Comment[nds]=In dissen Orner sünd dien egen Dateien +Comment[ne]=यो फोल्डरले तपाईँको व्यक्तिगत फाइलहरू समावेश गर्छ +Comment[nl]=Deze map bevat al uw persoonlijke bestanden +Comment[nn]=Denne mappa inneheld dine personlege filer. +Comment[nso]=Sephuthi se sena le difaele tsa gago tsa botho +Comment[pa]=ਇਹ ਫੋਲਡਰ ਤੁਹਾਡੀਆਂ ਨਿੱਜੀ ਫਾਇਲਾਂ ਰੱਖਦਾ ਹੈ +Comment[pl]=Ten katalog zawiera wszystkie twoje osobiste pliki. +Comment[pt]=Esta pasta contém os seus ficheiros pessoais +Comment[pt_BR]=Esta pasta contém os seus arquivos pessoais +Comment[ro]=Acest director conține fișierele dumneavoastră personale +Comment[ru]=Папка ваших личных файлов +Comment[rw]=Ubu bubiko bufite amadosiye yihariye yawe +Comment[se]=Dán máhpas du iežat fiillat leat +Comment[sk]=Tento priečinok obsahuje vaše osobné súbory +Comment[sl]=Ta mapa vsebuje vaše osebne datoteke. +Comment[sr]=Ова фасцикла садржи ваше личне фајлове +Comment[sr@Latn]=Ova fascikla sadrži vaše lične fajlove +Comment[sv]=Den här katalogen innehåller dina personliga filer +Comment[ta]=இந்த அடைவில் உங்கள் அந்தரங்க கோப்புகள் உள்ளன +Comment[tg]=Ин феҳрист шомили файлҳои шахсии шумост +Comment[th]=โฟลเดอร์นี้บรรจุแฟ้มต่าง ๆ ที่เป็นส่วนตัวของคุณ +Comment[tr]=Bu dizin kişisel dosyalarınızı içerir +Comment[tt]=Bu törgäktä şäxsi biremnäreñ yata +Comment[uk]=Ця тека містить ваші персональні файли +Comment[uz]=Bu jild sizning shaxsiy fayllaringizdan iborat +Comment[uz@cyrillic]=Бу жилд сизнинг шахсий файлларингиздан иборат +Comment[ven]=Foludara ino ina dzifaela dzanu +Comment[vi]=Thư mục này chứa các tập tin của riêng bạn +Comment[wa]=Ci ridant chal a les fitchîs et dnêyes da vosse +Comment[xh]=Le ncwadi eneenkcukacha iqulathe iifayile zobuntu bakho +Comment[zh_CN]=此文件夹包含了您的个人文件 +Comment[zh_TW]=這個資料夾包含有您的個人文件 +Comment[zu]=Lesi sigcini samafayela siqukethe amafayela akho siqu +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/remote.desktop b/konqueror/sidebar/trees/init/remote.desktop new file mode 100644 index 000000000..adc02b1cc --- /dev/null +++ b/konqueror/sidebar/trees/init/remote.desktop @@ -0,0 +1,87 @@ +[Desktop Entry] +Name=Network +Name[af]=Netwerk +Name[ar]=الشبكة +Name[az]=Şəbəkə +Name[be]=Сетка +Name[bg]=Мрежа +Name[bn]=নেটওয়ার্ক +Name[br]=Rouedad +Name[bs]=Mreža +Name[ca]=Xarxa +Name[cs]=Síť +Name[csb]=Séc +Name[cy]=Rhwydwaith +Name[da]=Netværk +Name[de]=Netzwerk +Name[el]=Δίκτυο +Name[eo]=Reto +Name[es]=Red +Name[et]=Võrk +Name[eu]=Sarea +Name[fa]=شبکه +Name[fi]=Verkko +Name[fo]=Net +Name[fr]=Réseau +Name[fy]=Netwurk +Name[ga]=Líonra +Name[gl]=Rede +Name[he]=רשת +Name[hi]=नेटवर्क +Name[hr]=Mreža +Name[hu]=Hálózat +Name[id]=Jaringan +Name[is]=Net +Name[it]=Rete +Name[ja]=ネットワーク +Name[ka]=ქსელი +Name[kk]=Желі +Name[km]=បណ្ដាញ +Name[ko]=네트워크 +Name[lo]=ລະບົບເຄື່ອຄາຍ +Name[lt]=Tinklas +Name[lv]=Tīkls +Name[mk]=Мрежа +Name[mn]=Сүлжээ +Name[ms]=Rangkaian +Name[nb]=Nettverk +Name[nds]=Nettwark +Name[ne]=सञ्जाल +Name[nl]=Netwerk +Name[nn]=Nettverk +Name[nso]=Kgokagano +Name[oc]=Resèu +Name[pa]=ਨੈੱਟਵਰਕ +Name[pl]=Sieć +Name[pt]=Rede +Name[pt_BR]=Rede +Name[ro]=Rețea +Name[ru]=Сеть +Name[rw]=Urusobe +Name[se]=Fierbmi +Name[sk]=Sieť +Name[sl]=Omrežje +Name[sr]=Мрежа +Name[sr@Latn]=Mreža +Name[sv]=Nätverk +Name[ta]=வலைதளம் +Name[te]=నెట్ వర్క్ +Name[tg]=Шабака +Name[th]=ระบบเครือข่าย +Name[tr]=Ağ +Name[tt]=Çeltär +Name[uk]=Мережа +Name[uz]=Tarmoq +Name[uz@cyrillic]=Тармоқ +Name[ven]=Vhukwamani +Name[vi]=Mạng +Name[wa]=Rantoele +Name[xh]=Umsebenzi womnatha +Name[zh_CN]=网络 +Name[zh_TW]=網路 +Name[zu]=Uxhumano olusakazekile +Icon=network +Open=false +X-KDE-TreeModule=Virtual +X-KDE-RelURL=remote +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/remote/.directory b/konqueror/sidebar/trees/init/remote/.directory new file mode 100644 index 000000000..0f347fafb --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/.directory @@ -0,0 +1,84 @@ +[Desktop Entry] +Name=Network +Name[af]=Netwerk +Name[ar]=الشبكة +Name[az]=Şəbəkə +Name[be]=Сетка +Name[bg]=Мрежа +Name[bn]=নেটওয়ার্ক +Name[br]=Rouedad +Name[bs]=Mreža +Name[ca]=Xarxa +Name[cs]=Síť +Name[csb]=Séc +Name[cy]=Rhwydwaith +Name[da]=Netværk +Name[de]=Netzwerk +Name[el]=Δίκτυο +Name[eo]=Reto +Name[es]=Red +Name[et]=Võrk +Name[eu]=Sarea +Name[fa]=شبکه +Name[fi]=Verkko +Name[fo]=Net +Name[fr]=Réseau +Name[fy]=Netwurk +Name[ga]=Líonra +Name[gl]=Rede +Name[he]=רשת +Name[hi]=नेटवर्क +Name[hr]=Mreža +Name[hu]=Hálózat +Name[id]=Jaringan +Name[is]=Net +Name[it]=Rete +Name[ja]=ネットワーク +Name[ka]=ქსელი +Name[kk]=Желі +Name[km]=បណ្ដាញ +Name[ko]=네트워크 +Name[lo]=ລະບົບເຄື່ອຄາຍ +Name[lt]=Tinklas +Name[lv]=Tīkls +Name[mk]=Мрежа +Name[mn]=Сүлжээ +Name[ms]=Rangkaian +Name[nb]=Nettverk +Name[nds]=Nettwark +Name[ne]=सञ्जाल +Name[nl]=Netwerk +Name[nn]=Nettverk +Name[nso]=Kgokagano +Name[oc]=Resèu +Name[pa]=ਨੈੱਟਵਰਕ +Name[pl]=Sieć +Name[pt]=Rede +Name[pt_BR]=Rede +Name[ro]=Rețea +Name[ru]=Сеть +Name[rw]=Urusobe +Name[se]=Fierbmi +Name[sk]=Sieť +Name[sl]=Omrežje +Name[sr]=Мрежа +Name[sr@Latn]=Mreža +Name[sv]=Nätverk +Name[ta]=வலைதளம் +Name[te]=నెట్ వర్క్ +Name[tg]=Шабака +Name[th]=ระบบเครือข่าย +Name[tr]=Ağ +Name[tt]=Çeltär +Name[uk]=Мережа +Name[uz]=Tarmoq +Name[uz@cyrillic]=Тармоқ +Name[ven]=Vhukwamani +Name[vi]=Mạng +Name[wa]=Rantoele +Name[xh]=Umsebenzi womnatha +Name[zh_CN]=网络 +Name[zh_TW]=網路 +Name[zu]=Uxhumano olusakazekile +Icon=network +Open=false diff --git a/konqueror/sidebar/trees/init/remote/Makefile.am b/konqueror/sidebar/trees/init/remote/Makefile.am new file mode 100644 index 000000000..06c68f0cf --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/Makefile.am @@ -0,0 +1,4 @@ +SUBDIRS = ftp web + +konq_sidebartree_virtuals_remote_data_DATA = .directory +konq_sidebartree_virtuals_remote_datadir = $(kde_datadir)/konqsidebartng/virtual_folders/remote diff --git a/konqueror/sidebar/trees/init/remote/ftp/.directory b/konqueror/sidebar/trees/init/remote/ftp/.directory new file mode 100644 index 000000000..75e432e50 --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/ftp/.directory @@ -0,0 +1,56 @@ +[Desktop Entry] +Name=FTP Archives +Name[az]=FTP Arxivləri +Name[bg]=FTP архиви +Name[br]=Dielloù FTP +Name[ca]=Arxius FTP +Name[cs]=FTP archívy +Name[csb]=Archiwa FTP +Name[cy]=Archif FTP +Name[da]=FTP-Arkiver +Name[de]=FTP-Archive +Name[el]=Αρχειοθήκες FTP +Name[eo]=FTP-Arkivoj +Name[es]=Archivos FTP +Name[et]=FTP-arhiivid +Name[fo]=FTP-søvn +Name[fr]=Archives FTP +Name[hi]=एफ़टीपी आर्काइव +Name[hr]=FTP arhive +Name[hu]=FTP +Name[id]=Arsip FTP +Name[is]=FTP gagnageymslur +Name[it]=Archivi FTP +Name[ja]=FTP アーカイブ +Name[km]=ប័ណ្ណសារ FTP +Name[ko]=FTP 저장소 +Name[lo]=ແຟ້ມບີບອັດ FTP +Name[lt]=FTP archyvai +Name[lv]=FTP Arhīvi +Name[mn]=FTP-Архив +Name[mt]=Arkivji FTP +Name[nb]=FTP-arkiv +Name[nds]=FTP-Archiven +Name[nl]=FTP-archieven +Name[nso]=Dipolokelo tsa FTP +Name[oc]=Archius FTP +Name[pl]=Archiwa FTP +Name[pt]=Arquivos de FTP +Name[pt_BR]=Arquivos de FTP +Name[ro]=Arhive FTP +Name[ru]=Серверы FTP +Name[sk]=FTP archívy +Name[sl]=Arhivi FTP +Name[sr]=FTP архиве +Name[sr@Latn]=FTP arhive +Name[sv]=FTP-arkiv +Name[tr]=FTP Arşivleri +Name[uk]=Архіви FTP +Name[uz]=FTP arxivlar +Name[uz@cyrillic]=FTP архивлар +Name[ven]=Fhethu huno vhulungwa zwa kale ha FTP +Name[wa]=Årtchives FTP +Name[xh]=Ushicilelo lukawonke-wonke kunye namanye amaxwebhu embali e FTP +Name[zh_TW]=FTP 歸檔 +Name[zu]=Imiqulu ye-FTP +Icon=konqueror diff --git a/konqueror/sidebar/trees/init/remote/ftp/Makefile.am b/konqueror/sidebar/trees/init/remote/ftp/Makefile.am new file mode 100644 index 000000000..c9a7c26aa --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/ftp/Makefile.am @@ -0,0 +1,3 @@ +konq_sidebartree_virtuals_remote_ftp_data_DATA = .directory kde_ftp.desktop +konq_sidebartree_virtuals_remote_ftp_datadir = $(kde_datadir)/konqsidebartng/virtual_folders/remote/ftp + diff --git a/konqueror/sidebar/trees/init/remote/ftp/kde_ftp.desktop b/konqueror/sidebar/trees/init/remote/ftp/kde_ftp.desktop new file mode 100644 index 000000000..3021fe215 --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/ftp/kde_ftp.desktop @@ -0,0 +1,88 @@ +[Desktop Entry] +Type=Link +URL=ftp://ftp.kde.org/pub/kde +Icon=ftp +Name=KDE Official FTP +Name[af]=Kde Amptelike Ftp +Name[ar]=ميفاق نقل الملفات الرسمي لِــ KDE +Name[az]=KDE FTP vericisi +Name[be]=Афіцыйны FTP KDE +Name[bg]=Официален FTP сървър на KDE +Name[bn]=মূল কে.ডি.ই. এফ.টি.পি. +Name[br]=FTP ofisiel KDE +Name[bs]=KDE službeni FTP +Name[ca]=FTP oficial del KDE +Name[cs]=Oficiální FTP projektu KDE +Name[csb]=Òficjalnô serwera FTP dlô KDE +Name[cy]=FTP Swyddogol KDE +Name[da]=KDE's officielle FTP +Name[de]=FTP-Bereich von KDE +Name[el]=Επίσημο FTP του KDE +Name[eo]=Oficiala FTP-arĥivo de KDE +Name[es]=FTP oficial de KDE +Name[et]=KDE ametlik FTP sait +Name[eu]=KDEren FTP ofiziala +Name[fa]=قاپ رسمی KDE +Name[fi]=KDE:n virallinen FTP +Name[fr]=Site FTP officiel de KDE +Name[fy]=KDE's Offisjele FTP +Name[ga]=FTP Oifigiúil KDE +Name[gl]=FTP Oficial de KDE +Name[he]=ה־FTP הרשמי של KDE +Name[hi]=केडीई आधिकारिक एफटीपी +Name[hr]=KDE službeni FTP +Name[hu]=Hivatalos KDE FTP +Name[id]=FTP KDE Resmi +Name[is]=FTP gagnabanki KDE +Name[it]=FTP ufficiale di KDE +Name[ja]=KDE 公式 FTP +Name[ka]=KDE-ს ძირითადი FTP სერვერი +Name[kk]=Негізгі KDE FTP сервері +Name[km]=FTP ផ្លូវការរបស់ KDE +Name[ko]=KDE 공식 FTP +Name[lo]=ໄຊ້์ FTP ຢ່າງເປັນທາງການຂອງ KDE +Name[lt]=KDE oficialus FTP +Name[lv]=KDE Oficiālais FTP +Name[mk]=Официјален FTP на KDE +Name[mn]=КДЭ-н FTP- хаяг +Name[ms]=FTP Rasmi KDE +Name[mt]=FTP Uffiċjali tal-KDE +Name[nb]=KDEs offisielle FTP +Name[nds]=Dat offizielle KDE-FTP +Name[ne]=KDE आधिकारिक FTP +Name[nl]=KDE's Officiële FTP +Name[nn]=Offisiell KDE-FTP +Name[nso]=FTP ya Semolao ya KDE +Name[oc]=FTP oficial dèu KDE +Name[pa]=KDE ਮੂਲ FTP +Name[pl]=Oficjalny serwer FTP dla KDE +Name[pt]=FTP Oficial do KDE +Name[pt_BR]=FTP oficial do KDE +Name[ro]=Site FTP KDE oficial +Name[ru]=Основной FTP-сервер KDE +Name[rw]=KDE FTP yemewe +Name[se]=Almmolaš KDE-FTP +Name[sk]=Oficiálne FTP KDE +Name[sl]=Uradni FTP za KDE +Name[sr]=Званични KDE-ов FTP +Name[sr@Latn]=Zvanični KDE-ov FTP +Name[sv]=KDE:s officiella FTP-server +Name[ta]=KDE அலுவலக FTP +Name[te]=కెడిఈ అధికారిక ఎఫ్ టి పి +Name[tg]=KDE расмии FTP +Name[th]=ไซต์ FTP ทางการของ KDE +Name[tr]=KDE FTP sunucusu +Name[tt]=KDE'nıñ Räsmi FTP +Name[uk]=Офіціальний FTP KDE +Name[uz]=Rasmiy KDE FTP +Name[uz@cyrillic]=Расмий KDE FTP +Name[ven]=FTP ya ofishiala ya KDE +Name[vi]=FTP chính thức của KDE +Name[wa]=Site FTP oficir di KDE +Name[xh]=KDE Osemthethweni FTP +Name[zh_CN]=KDE 官方 FTP +Name[zh_TW]=KDE 官方 FTP 站 +Name[zu]=I-FTP esemthethweni ye-KDE +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/remote/web/.directory b/konqueror/sidebar/trees/init/remote/web/.directory new file mode 100644 index 000000000..cb8fcc9a3 --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/web/.directory @@ -0,0 +1,56 @@ +[Desktop Entry] +Name=Web Sites +Name[az]=İnternet Saytları +Name[bg]=Уеб страници +Name[br]=Lec'hiennoù gwiad +Name[ca]=Llocs Web +Name[cs]=Webové stránky +Name[csb]=Starnë WWW +Name[cy]=Gwefannau +Name[da]=Netsteder +Name[de]=Webseiten +Name[el]=Τόποι στο διαδίκτυο +Name[eo]=Retejoj +Name[es]=Sitios web +Name[et]=Veebileheküljed +Name[fo]=Vevstøð +Name[fr]=Sites Web +Name[hi]=वेब साइट्स +Name[hr]=Web-lokacije +Name[hu]=Weboldalak +Name[id]=Situs Web +Name[is]=Vefsvæði +Name[it]=Siti web +Name[ja]=ウェブサイト +Name[km]=តំបន់បណ្ដាញ +Name[ko]=웹 사이트 +Name[lo]=ເວ໊ບໄຊ์ +Name[lt]=Žiniatinklio svetainės +Name[lv]=Tīmekļa vietas +Name[mn]=Вэб хуудсууд +Name[nb]=Nettsteder +Name[nds]=Nettsieden +Name[nl]=Websites +Name[nso]=Mafelo a Web +Name[oc]=Sitis web +Name[pl]=Strony WWW +Name[pt]=Páginas Web +Name[pt_BR]=Páginas Web +Name[ro]=Sit-uri de Web +Name[ru]=Веб-сайты +Name[sk]=Webové stránky +Name[sl]=Spletne strani +Name[sr]=Веб сајтови +Name[sr@Latn]=Veb sajtovi +Name[sv]=Webbplatser +Name[tg]=Саҳифаҳои Веб +Name[tr]=Web Siteleri +Name[uk]=Веб-сайти +Name[uz]=Veb-saytlar +Name[uz@cyrillic]=Веб-сайтлар +Name[ven]=Webu saiti +Name[wa]=Sites waibes +Name[xh]=Amanxuwa e Web +Name[zh_TW]=網站 +Name[zu]=Iziza ze-Web +Icon=konqueror diff --git a/konqueror/sidebar/trees/init/remote/web/Makefile.am b/konqueror/sidebar/trees/init/remote/web/Makefile.am new file mode 100644 index 000000000..30bc162b6 --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/web/Makefile.am @@ -0,0 +1,2 @@ +konq_sidebartree_virtuals_remote_web_data_DATA = .directory apps_web.desktop dot_web.desktop kde_web.desktop look_web.desktop +konq_sidebartree_virtuals_remote_web_datadir = $(kde_datadir)/konqsidebartng/virtual_folders/remote/web diff --git a/konqueror/sidebar/trees/init/remote/web/apps_web.desktop b/konqueror/sidebar/trees/init/remote/web/apps_web.desktop new file mode 100644 index 000000000..694c4a04f --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/web/apps_web.desktop @@ -0,0 +1,87 @@ +[Desktop Entry] +Type=Link +URL=http://www.kde-apps.org/ +Name=KDE Applications +Name[af]=Kde Programme +Name[ar]=تطبيقات KDE +Name[az]=KDE Proqramları +Name[be]=Праграмы KDE +Name[bg]=Програми за KDE +Name[bn]=কে.ডি.ই অ্যাপলিকেশন +Name[br]=Arloadoù KDE +Name[bs]=KDE Programi +Name[ca]=Aplicacions KDE +Name[cs]=KDE aplikace +Name[csb]=Programë KDE +Name[cy]=Cymhwysiadau KDE +Name[da]=KDE-programmer +Name[de]=KDE-Programme +Name[el]=Εφαρμογές KDE +Name[eo]=KDE-Aplikaĵoj +Name[es]=Aplicaciones de KDE +Name[et]=KDE rakendused +Name[eu]=KDEren aplikazioak +Name[fa]=کاربردهای KDE +Name[fi]=KDE:n sovellukset +Name[fr]=Applications KDE +Name[fy]=KDE Programma's +Name[ga]=Feidhmchláir KDE +Name[gl]=Aplicacións de KDE +Name[he]=יישומי KDE +Name[hi]=केडीई अनुप्रयोग +Name[hr]=KDE aplikacije +Name[hu]=KDE-alkalmazások +Name[is]=KDE Forrit +Name[it]=Applicazioni KDE +Name[ja]=KDE アプリケーション +Name[ka]=KDE-ს პროგრამები +Name[kk]=KDE қолданбалары +Name[km]=កម្មវិធីរបស់ KDE +Name[ko]=KDE 응용 프로그램 +Name[lo]=ແອບພີເຄຊັ້ນ KDE +Name[lt]=KDE programos +Name[lv]=KDE Aplikācijas +Name[mk]=KDE-апликации +Name[mn]=КДЭ-Програм +Name[ms]=Aplikasi KDE +Name[mt]=Programmi KDE +Name[nb]=KDE-programmer +Name[nds]=KDE-Programmen +Name[ne]=KDE अनुप्रयोग +Name[nl]=KDE Programma's +Name[nn]=KDE-program +Name[nso]=Ditshomiso tsa KDE +Name[pa]=KDE ਕਾਰਜ +Name[pl]=Programy KDE +Name[pt]=Aplicações do KDE +Name[pt_BR]=Aplicativos KDE +Name[ro]=Aplicații KDE +Name[ru]=Приложения KDE +Name[rw]=Porogaramu KDE +Name[se]=KDE-prográmmat +Name[sk]=Aplikácie KDE +Name[sl]=Uporabniški programi +Name[sr]=KDE програми +Name[sr@Latn]=KDE programi +Name[ss]=Ticelo te KDE +Name[sv]=KDE-program +Name[ta]=KDE நிரல்கள் +Name[te]=కెడిఈ కార్యక్రమాలు +Name[tg]=Барномаҳои KDE +Name[th]=แอพพลิเคชัน KDE +Name[tr]=KDE Uygulamaları +Name[tt]=KDE Yazılımnarı +Name[uk]=Програми KDE +Name[uz]=KDE dasturlar +Name[uz@cyrillic]=KDE дастурлар +Name[ven]=Apulifikhesheni ya KDE +Name[vi]=Ứng dụng cho KDE +Name[wa]=Programes KDE +Name[xh]=Izicelo ze KDE +Name[zh_CN]=KDE 应用程序 +Name[zh_TW]=KDE 應用程式 +Name[zu]=Abayaleli be-KDE +Icon=www +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/remote/web/dot_web.desktop b/konqueror/sidebar/trees/init/remote/web/dot_web.desktop new file mode 100644 index 000000000..9743376df --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/web/dot_web.desktop @@ -0,0 +1,86 @@ +[Desktop Entry] +Type=Link +URL=http://dot.kde.org/ +Name=KDE News +Name[af]=Kde Nuus +Name[ar]=أخبار KDE +Name[az]=KDE Xəbərləri +Name[be]=Навіны KDE +Name[bg]=Новини за KDE +Name[bn]=কে.ডি.ই. সংবাদ +Name[br]=Keleier KDE +Name[bs]=KDE Novosti +Name[ca]=Notícies KDE +Name[cs]=Novinky KDE +Name[csb]=Nowinë KDE +Name[cy]=Newyddion KDE +Name[da]=KDE-nyheder +Name[de]=KDE-Nachrichten +Name[el]=Νέα KDE +Name[eo]=KDE-Novaĵoj +Name[es]=Noticias de KDE +Name[et]=KDE uudised +Name[eu]=KDEren albisteak +Name[fa]=اخبار KDE +Name[fi]=KDE:n uutiset +Name[fr]=Les nouvelles sur KDE +Name[fy]=KDE Nijs +Name[ga]=Nuacht KDE +Name[gl]=Novas de KDE +Name[he]=חדשות KDE +Name[hi]=केडीई समाचार +Name[hr]=KDE novosti +Name[hu]=KDE hírek +Name[is]=KDE fréttir +Name[it]=Notizie di KDE +Name[ja]=KDE ニュース +Name[ka]=KDE-ს სიახლეები +Name[kk]=KDE жаңалықтары +Name[km]=ព័ត៌មាន KDE +Name[ko]=KDE 뉴스 +Name[lo]=ຂ່າວຂອງ KDE +Name[lt]=KDE naujienos +Name[lv]=KDE Ziņas +Name[mk]=KDE-вести +Name[mn]=КДЭ-Мэдээ +Name[ms]=Berita KDE +Name[mt]=Aħbarijiet KDE +Name[nb]=KDE-nyheter +Name[nds]=KDE-Narichten +Name[ne]=KDE समाचार +Name[nl]=KDE Nieuws +Name[nn]=KDE-nyhende +Name[nso]=Ditaba tsa KDE +Name[pa]=KDE ਖ਼ਬਰਾਂ +Name[pl]=Wiadomości KDE +Name[pt]=Notícias do KDE +Name[ro]=Știri KDE +Name[ru]=Новости KDE +Name[rw]=KDE Amakuru +Name[se]=KDE-ođđasat +Name[sk]=Novinky KDE +Name[sl]=Novice o KDE +Name[sr]=KDE вести +Name[sr@Latn]=KDE vesti +Name[ss]=Tindzaba te KDE +Name[sv]=KDE-nyheter +Name[ta]=KDE செய்திகள் +Name[te]=కెడిఈ వార్తలు +Name[tg]=Иттилоотҳои KDE +Name[th]=ข่าวของ KDE +Name[tr]=KDE Haberleri +Name[tt]=KDE Yañalıqları +Name[uk]=Новини KDE +Name[uz]=KDE yangiliklar +Name[uz@cyrillic]=KDE янгиликлар +Name[ven]=Mafhungo a KDE +Name[vi]=Tin tức KDE +Name[wa]=Noveles di KDE +Name[xh]=Iindaba ze KDE +Name[zh_CN]=KDE 新闻 +Name[zh_TW]=KDE 新聞 +Name[zu]=Izindaba ze-KDE +Icon=www +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/remote/web/kde_web.desktop b/konqueror/sidebar/trees/init/remote/web/kde_web.desktop new file mode 100644 index 000000000..4228c0b48 --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/web/kde_web.desktop @@ -0,0 +1,88 @@ +[Desktop Entry] +Type=Link +URL=http://www.kde.org +Name=KDE Home Page +Name[af]=KDE Tuisblad +Name[ar]=موقع KDE على الشبكة +Name[az]=KDE Ana Səhifəsi +Name[be]=Хатняя старонка KDE +Name[bg]=Домашна страница на KDE +Name[bn]=কে.ডি.ই. হোম পেজ +Name[br]=Pajenn Er-Gêr KDE +Name[bs]=KDE web stranica +Name[ca]=Pàgina inici de KDE +Name[cs]=Domovská stránka KDE +Name[csb]=Domôcô starna KDE +Name[cy]=Hafan KDE +Name[da]=KDE-hjemmeside +Name[de]=KDE-Startseite +Name[el]=Ιστοσελίδα του KDE +Name[eo]=TTTejo de KDE +Name[es]=Página Web de KDE +Name[et]=KDE kodulehekülg +Name[eu]=KDEren hasierako orria +Name[fa]=صفحه آغازۀ KDE +Name[fi]=KDE:n kotisivu +Name[fr]=Page d'accueil de KDE +Name[fy]=KDE's Thússide +Name[ga]=Leathanach Baile KDE +Name[gl]=Páxina Web de KDE +Name[he]=אתר הבית של KDE +Name[hi]=केडीई मुख पृष्ठ +Name[hr]=KDE glavna stranica +Name[hu]=KDE honlap +Name[id]=Home Page KDE +Name[is]=Heimasíða KDE +Name[it]=Homepage di KDE +Name[ja]=KDE ホームページ +Name[ka]=KDE-ს ვებ გვერდი +Name[kk]=KDE веб-сайты +Name[km]=គេហទំព័រ KDE +Name[ko]=KDE 홈페이지 +Name[lo]=ໂຫມເພຈ KDE +Name[lt]=KDE namų puslapis +Name[lv]=KDE Mājas Lapa +Name[mk]=Домашната страница на KDE +Name[mn]=КДЭ-Эхлэл хуудас +Name[ms]=Laman Utama KDE +Name[mt]=Homepage tal-KDE +Name[nb]=KDEs hjemmeside +Name[nds]=KDE-Nettsiet +Name[ne]=KDE गृह पृष्ठ +Name[nl]=KDE's startpagina +Name[nn]=KDE-nettstaden +Name[nso]=Letlakala la Gae la KDE +Name[oc]=Pagina iniciau de KDE +Name[pa]=KDE ਮੁੱਖ ਸਫਾ +Name[pl]=Strona domowa KDE +Name[pt]=Página do KDE +Name[pt_BR]=Página principal do KDE +Name[ro]=Site-ul KDE +Name[ru]=Основной сайт KDE +Name[rw]=KDE Ipajikwinjira +Name[se]=KDE-ruoktosiidu +Name[sk]=Domovská stránka KDE +Name[sl]=Domača stran KDE +Name[sr]=Матична страна KDE-а +Name[sr@Latn]=Matična strana KDE-a +Name[sv]=KDE:s webbplats +Name[ta]=KDE வீட்டுப் பக்கம் +Name[te]=కెడిఈ ఇంటి పుట +Name[tg]=Сафҳаи хонагии KDE +Name[th]=โฮมเพจ KDE +Name[tr]=KDE Ana Sayfası +Name[tt]=KDE Anabite +Name[uk]=Домашня сторінка KDE +Name[uz]=KDE veb-sayti +Name[uz@cyrillic]=KDE веб-сайти +Name[ven]=Siatari la KDE +Name[vi]=Trang nhà của KDE +Name[wa]=Pådje måjhon di KDE +Name[xh]=Iphepha Lasekhaya le KDE +Name[zh_CN]=KDE 主页 +Name[zh_TW]=KDE 首頁 +Name[zu]=Ikhasi lasekhaya le-KDE +Icon=www +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/remote/web/look_web.desktop b/konqueror/sidebar/trees/init/remote/web/look_web.desktop new file mode 100644 index 000000000..eadd73827 --- /dev/null +++ b/konqueror/sidebar/trees/init/remote/web/look_web.desktop @@ -0,0 +1,54 @@ +[Desktop Entry] +Type=Link +URL=http://themes.kde.org/ +Name=KDE Eye Candy +Name[af]=KDE Oog genot +Name[bn]=কে.ডি.ই. আই ক্যান্ডি +Name[bs]=KDE ukrasi +Name[ca]=Decoració KDE +Name[cs]=Pastva pro oči +Name[csb]=Ùsnôżnienia dlô KDE +Name[da]=KDE øjenfryd +Name[de]=KDE Optik +Name[el]=KDE Εμφάνιση +Name[eo]=KDE Ornamaĵoj +Name[es]=Embellecimiento KDE +Name[et]=KDE silmailu +Name[fi]=KDE:n silmän iloa +Name[fr]=Agrément visuel KDE +Name[fy]=Eachstrieljende KDE +Name[gl]=Embelecemento de KDE +Name[he]=צעצועים חזותיים של KDE +Name[hr]=KDE mamac za oko +Name[hu]=KDE grafikai kiegészítők +Name[is]=KDE augnayndi +Name[it]=Bellezza di KDE +Name[ja]=KDE アイキャンディ +Name[km]=ទិដ្ឋភាពស្រស់ស្អាតរបស់ KDE +Name[ko]=KDE 눈깔사탕 +Name[mk]=Убавина за очи во KDE +Name[nb]=KDE-pynt +Name[nds]=Wat för de Ogen vun KDE +Name[ne]=KDE आइ क्यान्डी +Name[nl]=Oogstrelend KDE +Name[nn]=KDE-pynt +Name[pa]=KDE ਆਈ ਕੈਂਡੀ +Name[pl]=Upiększenia dla KDE +Name[pt]=Gráficos Bonitos do KDE +Name[pt_BR]=Candy Eye do KDE +Name[ro]=Tematici KDE +Name[ru]=Темы и стили для KDE +Name[se]=KDE-čalbmenjálgát +Name[sl]=Bombončki KDE +Name[sr]=KDE слаткиши +Name[sr@Latn]=KDE slatkiši +Name[sv]=KDE-ögongodis +Name[ta]=கேடியி ஐ காண்டி +Name[th]=ตกแต่งน่ารักกับ KDE +Name[vi]=Kẹo ngọt Thị giác KDE +Name[wa]=KDE bea po ls ouys +Name[zh_CN]=KDE 眼福 +Icon=www +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/root.desktop b/konqueror/sidebar/trees/init/root.desktop new file mode 100644 index 000000000..b206da8e7 --- /dev/null +++ b/konqueror/sidebar/trees/init/root.desktop @@ -0,0 +1,158 @@ +[Desktop Entry] +Type=Link +URL=file:/ +Icon=folder_red +Name=Root Folder +Name[af]=Basis Gids +Name[ar]=مجلد الجذر +Name[az]=Ali İstifadəçi Qovluğu +Name[be]=Каранёвая тэчка +Name[bg]=Главна директория +Name[bn]=রুট ফোল্ডার +Name[br]=Renkell gwrizienn +Name[bs]=Root direktorij +Name[ca]=Carpeta arrel +Name[cs]=Kořenová složka +Name[csb]=Przédny katalog (root) +Name[cy]=Plygell Gwraidd +Name[da]=Rodmappe +Name[de]=Basisordner +Name[el]=Ριζικός φάκελος +Name[eo]=Baza dosierujo +Name[es]=Directorio raiz +Name[et]=Juurkataloog +Name[eu]=Erro karpeta +Name[fa]=پوشۀ ریشه +Name[fi]=Juurikansio +Name[fr]=Dossier racine +Name[fy]=Haadmap +Name[ga]=Fréamhfhillteán +Name[gl]=Cartafol Raíz +Name[he]=תיקיית שורש +Name[hi]=रूट फ़ोल्डर +Name[hr]=Korijenska mapa +Name[hu]=Gyökérkönyvtár +Name[is]=Rótarmappa +Name[it]=Cartella radice +Name[ja]=ルートフォルダ +Name[ka]=ძირეული საქაღალდე +Name[kk]=Түбір қапшығы +Name[km]=ថត Root +Name[ko]=루트 폴더 +Name[lt]=Root aplankas +Name[lv]=Saknes katalogs +Name[mk]=Коренова папка +Name[mn]=Язгуур лавлах +Name[ms]=Folder Root +Name[mt]=Direttorju root +Name[nb]=Rotkatalog +Name[nds]=Wörtelorner +Name[ne]=रुट फोल्डर +Name[nl]=Hoofdmap +Name[nn]=Rotmappe +Name[pa]=ਰੂਟ(root) ਫੋਲਡਰ +Name[pl]=Katalog główny +Name[pt]=Pasta Raiz +Name[pt_BR]=Pasta Raiz +Name[ro]=Folder rădăcină +Name[ru]=Корневая папка +Name[rw]=Ububiko Umuzi +Name[se]=Ruohtasmáhppa +Name[sk]=Koreňový priečinok +Name[sl]=Korenska mapa +Name[sr]=Корена фасцикла +Name[sr@Latn]=Korena fascikla +Name[sv]=Rotkatalog +Name[ta]=ஆரம்ப அடைவு +Name[te]=రూట్ ఫొల్డర్ +Name[tg]=Феҳристи реша +Name[th]=โฟลเดอร์ราก +Name[tr]=Kök Dizini +Name[tt]=Töp Törgäk +Name[uk]=Коренева тека +Name[uz]=Tub jildi +Name[uz@cyrillic]=Туб жилди +Name[vi]=Thư mục Gốc +Name[wa]=Ridant raecene +Name[zh_CN]=根文件夹 +Name[zh_TW]=Root 資料夾 +Comment=This is the root of the filesystem +Comment[af]=Hierdie is die basis van die lêer stelsel +Comment[ar]=هذا هو الجذر لنظام الملفات +Comment[az]=Bu, fayl sisteminizin köküdür +Comment[be]=Гэта пачатак файлавай сістэмы +Comment[bg]=Тази директория е главната директория на системата +Comment[bn]=এটি ফাইলসিস্টেমের মূল (root) +Comment[bs]=Ovo je korijen datotečnog sistema +Comment[ca]=Aquest és l'arrel del sistema de fitxers +Comment[cs]=Toto je kořenový adresář souborového systému +Comment[csb]=Je to kòrzéń systemë lopków (przédny katalog - root) +Comment[cy]=Dyma wraidd y cysawd ffeiliau +Comment[da]=Dette er roden af filsystemet +Comment[de]=Dies ist der Basisordner Ihres Dateisystems +Comment[el]=Αυτή είναι η ρίζα του συστήματος αρχείων +Comment[eo]=Jen la radiko de la dosieraro +Comment[es]=Esta es la raíz del sistema de archivos +Comment[et]=See on failisüsteemi ülemkataloog +Comment[eu]=Hau fitxategi sistemaren erroa da +Comment[fa]=این ریشه سیستم پرونده است +Comment[fi]=Tämä on tiedostojärjestelmän juuri +Comment[fr]=Ce dossier est à la racine de votre arborescence +Comment[fy]=Dit is de haad fan it triemsysteem +Comment[ga]=Seo fréamh an comhadchórais +Comment[gl]=Ésta é a raiz do sistema de arquivos +Comment[he]=זהו השורש של מערכת הקבצים שלך +Comment[hi]=यह फ़ाइल सिस्टम का रूट है +Comment[hr]=Korijenska mapa datotečnog sustava +Comment[hu]=Ez a fájlrendszer gyökere +Comment[is]=Þetta er rót skráarkerfisins +Comment[it]=Questa è la radice del filesystem +Comment[ja]=ファイルシステムのルートです +Comment[ka]=ფაილური სისტემუს ძირეული საქაღალდე +Comment[kk]=Файл жүйесінің түбірі +Comment[km]=នេះជាឫសរបស់ប្រព័ន្ធឯកសារ +Comment[ko]=파일 시스템의 루트입니다 +Comment[lo]=ນີ້ເປັນຮາກຂອງລະບົບແຟ້ມ +Comment[lt]=Tai yra bylų sistemos pradžia +Comment[lv]=Šī ir failusistēmas sakne +Comment[mk]=Ова е коренот на датотечниот системот +Comment[mn]=Энэ бол таны файлын системийн язгуур +Comment[ms]=Ini ialah root bagi sistem fail +Comment[mt]=Dan huwa d-direttorju ewlieni tas-sistema +Comment[nb]=Dette er rota til filsystemet +Comment[nds]=Dit is dat Dateisysteem sien Wörtel +Comment[ne]=यो फाइल प्रणालीको रुट हो +Comment[nl]=Dit is de root van het bestandssysteem +Comment[nn]=Dette er rota i filsystemet. +Comment[nso]=Se ke modu wa system ya faele +Comment[pa]=ਇਹ ਫਾਇਲ ਸਿਸਟਮ ਦਾ ਰੂਟ (root) ਹੈ +Comment[pl]=To jest korzeń systemu plików (czyli katalog główny) +Comment[pt]=Este é o topo do sistema de ficheiros +Comment[pt_BR]=Esta é a raiz do seu sistema de arquivos +Comment[ro]=Aceasta este rădăcina sistemului de fișiere +Comment[ru]=Корневая папка файловой системы +Comment[rw]=Uyu ni umuzi w'idosiyesisitemu +Comment[se]=Dát lea du fiilavuogádaga ruohtas +Comment[sk]=Toto je koreňový priečinok systému súborov +Comment[sl]=To je koren datotečnega sistema. +Comment[sr]=Ово је корен система фајлова +Comment[sr@Latn]=Ovo je koren sistema fajlova +Comment[sv]=Det här är roten på filsystemet +Comment[ta]=இதுவே கோப்பு அமைப்பின் வேராகும் +Comment[tg]=Инҷо решаи системаи файл аст +Comment[th]=นี่เป็นรากของระบบแฟ้ม +Comment[tr]=Bu dosya sisteminizi kök dizinidir +Comment[tt]=Birem sistemeneñ töp törgäge bu +Comment[uk]=Це - корінь файлової системи +Comment[uz]=Fayl tizimining tubi +Comment[uz@cyrillic]=Файл тизимининг туби +Comment[ven]=Hoyu ndi mudzi wa maitele a faela +Comment[vi]=Đây là gốc của hệ thống tập tin +Comment[wa]=Cichal est li ridant raecene do sistinme di fitchîs +Comment[xh]=Le yingcambu yendlela yefayile +Comment[zh_CN]=这是文件系统的根 +Comment[zh_TW]=這是檔案系統的根目錄 +Comment[zu]=Le yimpande yesistimu yamafayela +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/services.desktop b/konqueror/sidebar/trees/init/services.desktop new file mode 100644 index 000000000..72c51db89 --- /dev/null +++ b/konqueror/sidebar/trees/init/services.desktop @@ -0,0 +1,85 @@ +[Desktop Entry] +URL= +Icon=services +Name=Services +Name[af]=Dienste +Name[ar]=الخدمات +Name[az]=Xidmətlər +Name[be]=Сервісы +Name[bg]=Услуги +Name[bn]=সার্ভিসসমূহ +Name[br]=Servijoù +Name[bs]=Servisi +Name[ca]=Serveis +Name[cs]=Služby +Name[csb]=Ùsłëżnotë +Name[cy]=Gwasanaethau +Name[da]=Tjenester +Name[de]=KDE-Dienste +Name[el]=Υπηρεσίες +Name[eo]=Servoj +Name[es]=Servicios +Name[et]=Teenused +Name[eu]=Zerbitzuak +Name[fa]=خدمات +Name[fi]=Palvelut +Name[fo]=Tænastur +Name[fy]=Tsjinsten +Name[ga]=Seirbhísí +Name[gl]=Servizos +Name[he]=שירותים +Name[hi]=सेवाएं +Name[hr]=Usluge +Name[hu]=Szolgáltatások +Name[is]=Þjónustur +Name[it]=Servizi +Name[ja]=サービス +Name[ka]=სერვისები +Name[kk]=Қызметтер +Name[km]=សេវា +Name[ko]=서비스 +Name[lo]=ບໍລິການ +Name[lt]=Tarnybos +Name[lv]=Servisi +Name[mk]=Сервиси +Name[mn]=КДЭ-Үйлчилгээ +Name[ms]=Servis +Name[mt]=Servizzi +Name[nb]=Tjenester +Name[nds]=KDE-Deensten +Name[ne]=सेवा +Name[nn]=Tenester +Name[nso]=Ditirelo +Name[pa]=ਸੇਵਾਵਾਂ +Name[pl]=Usługi +Name[pt]=Serviços +Name[pt_BR]=Serviços +Name[ro]=Servicii +Name[ru]=Сервисы +Name[rw]=Serivise +Name[se]=Bálvalusat +Name[sk]=Služby +Name[sl]=Storitve +Name[sr]=Сервиси +Name[sr@Latn]=Servisi +Name[sv]=Tjänster +Name[ta]=சேவைகள் +Name[te]=సేవలు +Name[tg]=Хидматҳо +Name[th]=บริการ +Name[tr]=Servisler +Name[tt]=Xezmätlär +Name[uk]=Служби +Name[uz]=Xizmatlar +Name[uz@cyrillic]=Хизматлар +Name[ven]=Dzitshumelo +Name[vi]=Các dịch vụ +Name[wa]=Siervices +Name[xh]=Iinkonzo +Name[zh_CN]=服务 +Name[zh_TW]=服務 +Name[zu]=Imisebenzi +Open=false +X-KDE-TreeModule=Virtual +X-KDE-RelURL=services +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/services/.directory b/konqueror/sidebar/trees/init/services/.directory new file mode 100644 index 000000000..7d2b5e78c --- /dev/null +++ b/konqueror/sidebar/trees/init/services/.directory @@ -0,0 +1,81 @@ +[Desktop Entry] +Icon=pipe +Name=Services +Name[af]=Dienste +Name[ar]=الخدمات +Name[az]=Xidmətlər +Name[be]=Сервісы +Name[bg]=Услуги +Name[bn]=সার্ভিসসমূহ +Name[br]=Servijoù +Name[bs]=Servisi +Name[ca]=Serveis +Name[cs]=Služby +Name[csb]=Ùsłëżnotë +Name[cy]=Gwasanaethau +Name[da]=Tjenester +Name[de]=KDE-Dienste +Name[el]=Υπηρεσίες +Name[eo]=Servoj +Name[es]=Servicios +Name[et]=Teenused +Name[eu]=Zerbitzuak +Name[fa]=خدمات +Name[fi]=Palvelut +Name[fo]=Tænastur +Name[fy]=Tsjinsten +Name[ga]=Seirbhísí +Name[gl]=Servizos +Name[he]=שירותים +Name[hi]=सेवाएं +Name[hr]=Usluge +Name[hu]=Szolgáltatások +Name[is]=Þjónustur +Name[it]=Servizi +Name[ja]=サービス +Name[ka]=სერვისები +Name[kk]=Қызметтер +Name[km]=សេវា +Name[ko]=서비스 +Name[lo]=ບໍລິການ +Name[lt]=Tarnybos +Name[lv]=Servisi +Name[mk]=Сервиси +Name[mn]=КДЭ-Үйлчилгээ +Name[ms]=Servis +Name[mt]=Servizzi +Name[nb]=Tjenester +Name[nds]=KDE-Deensten +Name[ne]=सेवा +Name[nn]=Tenester +Name[nso]=Ditirelo +Name[pa]=ਸੇਵਾਵਾਂ +Name[pl]=Usługi +Name[pt]=Serviços +Name[pt_BR]=Serviços +Name[ro]=Servicii +Name[ru]=Сервисы +Name[rw]=Serivise +Name[se]=Bálvalusat +Name[sk]=Služby +Name[sl]=Storitve +Name[sr]=Сервиси +Name[sr@Latn]=Servisi +Name[sv]=Tjänster +Name[ta]=சேவைகள் +Name[te]=సేవలు +Name[tg]=Хидматҳо +Name[th]=บริการ +Name[tr]=Servisler +Name[tt]=Xezmätlär +Name[uk]=Служби +Name[uz]=Xizmatlar +Name[uz@cyrillic]=Хизматлар +Name[ven]=Dzitshumelo +Name[vi]=Các dịch vụ +Name[wa]=Siervices +Name[xh]=Iinkonzo +Name[zh_CN]=服务 +Name[zh_TW]=服務 +Name[zu]=Imisebenzi +Open=false diff --git a/konqueror/sidebar/trees/init/services/Makefile.am b/konqueror/sidebar/trees/init/services/Makefile.am new file mode 100644 index 000000000..8e8c2e2f8 --- /dev/null +++ b/konqueror/sidebar/trees/init/services/Makefile.am @@ -0,0 +1,2 @@ +konq_sidebartree_init_services_data_DATA = .directory audiocd.desktop printsystem.desktop media.desktop settings.desktop applications.desktop +konq_sidebartree_init_services_datadir = $(kde_datadir)/konqsidebartng/virtual_folders/services diff --git a/konqueror/sidebar/trees/init/services/applications.desktop b/konqueror/sidebar/trees/init/services/applications.desktop new file mode 100644 index 000000000..0996b0e9e --- /dev/null +++ b/konqueror/sidebar/trees/init/services/applications.desktop @@ -0,0 +1,79 @@ +[Desktop Entry] +Type=Link +URL=applications:/ +Icon=kmenu +Name=Applications +Name[af]=Programme +Name[ar]=التطبيقات +Name[az]=Proqram Tə'minatları +Name[be]=Праграмы +Name[bg]=Програми +Name[bn]=অ্যাপলিকেশন +Name[br]=Arloadoù +Name[bs]=Programi +Name[ca]=Aplicacions +Name[cs]=Aplikace +Name[csb]=Programë +Name[cy]=Cymhwysiadau +Name[da]=Programmer +Name[de]=Programme +Name[el]=Εφαρμογές +Name[eo]=Aplikaĵoj +Name[es]=Aplicaciones +Name[et]=Rakendused +Name[eu]=Aplikazioak +Name[fa]=کاربردها +Name[fi]=Sovellukset +Name[fy]=Programma's +Name[ga]=Feidhmchláir +Name[gl]=Aplicacións +Name[he]=יישומים +Name[hi]=अनुप्रयोग +Name[hr]=Aplikacije +Name[hu]=Alkalmazások +Name[is]=Forrit +Name[it]=Applicazioni +Name[ja]=アプリケーション +Name[ka]=პროგრამები +Name[kk]=Қолданбалар +Name[km]=កម្មវិធី +Name[ko]=응용 프로그램 +Name[lt]=Programos +Name[lv]=Aplikācijas +Name[mk]=Апликации +Name[ms]=Aplikasi +Name[mt]=Programmi KDE +Name[nb]=Programmer +Name[nds]=Programmen +Name[ne]=अनुप्रयोग +Name[nl]=Programma's +Name[nn]=Program +Name[pa]=ਕਾਰਜ +Name[pl]=Programy +Name[pt]=Aplicações +Name[pt_BR]=Aplicativos +Name[ro]=Aplicații +Name[ru]=Приложения +Name[rw]=Amaporogaramu +Name[se]=Prográmmat +Name[sk]=Aplikácie +Name[sl]=Programi +Name[sr]=Програми +Name[sr@Latn]=Programi +Name[sv]=Program +Name[ta]=பயன்பாடுகள் +Name[te]=కార్యక్రమాలు +Name[tg]=Барномаҳо +Name[th]=แอพพลิเคชัน KDE +Name[tr]=Uygulamalar +Name[tt]=Yazılımnar +Name[uk]=Програми +Name[uz]=Dasturlar +Name[uz@cyrillic]=Дастурлар +Name[vi]=Ứng dụng +Name[wa]=Programes +Name[zh_CN]=应用程序 +Name[zh_TW]=應用程式 +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/services/audiocd.desktop b/konqueror/sidebar/trees/init/services/audiocd.desktop new file mode 100644 index 000000000..a7a8e3f27 --- /dev/null +++ b/konqueror/sidebar/trees/init/services/audiocd.desktop @@ -0,0 +1,85 @@ +[Desktop Entry] +Type=Link +URL=audiocd:/ +Icon=cdaudio_unmount +Name=Audio CD Browser +Name[af]=Musiek CD Blaaier +Name[ar]=متصفح الأقراص المدمجة الصوتية +Name[az]=Audio CD Səyyahı +Name[be]=Праглядальнік гукавых CD +Name[bg]=Аудио диск +Name[bn]=অডিও সিডি ব্রাউজার +Name[br]=Furcher ar CDoù klevet +Name[bs]=Audio CD preglednik +Name[ca]=Navegador d'àudio CD +Name[cs]=Prohlížeč zvukových CD +Name[csb]=Przezérnik audio CD +Name[cy]=Porydd CD Sain +Name[da]=Audio-cd-søger +Name[de]=Audio-CD-Browser +Name[el]=Περιηγητής CD ήχου +Name[eo]=Rigardilo por muzikaj lumdiskoj +Name[es]=Navegador de CD-Audio +Name[et]=Audio CD sirvija +Name[eu]=Audio CD arakatzailea +Name[fa]=مرورگر دیسک فشردۀ صوتی +Name[fi]=Audio CD:n selain +Name[fr]=Navigateur de CD audio +Name[fy]=Audio kompaktskiif blêder +Name[ga]=Brabhsálaí Dhlúthdhiosca Fuaime +Name[gl]=Navegador de CD de Audio +Name[he]=דפדפן תקליטורי שמע +Name[hi]=ऑडियो सीडी ब्राउज़र +Name[hr]=Glazbeni CD preglednik +Name[hu]=Hang-CD-böngésző +Name[is]=Tónlistardiskaflakkari +Name[it]=Navigazione dei CD audio +Name[ja]=オーディオ CD ブラウザ +Name[ka]=Audio CD-ს დათვალიერება +Name[kk]=Аудио CD шолғышы +Name[km]=កម្មវិធីរុករកស៊ីឌីសំឡេង +Name[lo]=ບາວເຊີ ຊີດີ ອໍດີໂອ້ +Name[lt]=Audio CD naršyklė +Name[lv]=Audio CD Pārlūks +Name[mk]=Прелистувач на аудио CD-а +Name[mn]=Аудио-КД-Хөтөч +Name[ms]=Pelayar CD Audio +Name[mt]=Browser CDs tal-Mużika +Name[nb]=Lyd-CD-leser +Name[nds]=Audio-CDs bekieken +Name[ne]=अडियो सीडी ब्राउजर +Name[nl]=Audio-cd Browser +Name[nn]=Lyd-CD-lesar +Name[nso]=Seinyakisi sa CD yeo e Kwagalago +Name[pa]=ਆਡੀਓ CD ਝਲਕਾਰਾ +Name[pl]=Przeglądarka audio CD +Name[pt]=Navegador de CDs Áudio +Name[pt_BR]=Navegador de CDs de Áudio +Name[ro]=Navigator CD audio +Name[ru]=Просмотр аудио CD +Name[rw]=Mucukumbuzi wa CD Inyumvo +Name[se]=Jietna-CD-logan +Name[sk]=Prehliadač zvukových CD +Name[sl]=Brskalnik po glasbenem CDju +Name[sr]=Прегледач аудио CD-ова +Name[sr@Latn]=Pregledač audio CD-ova +Name[sv]=Bläddrare för ljud-cd +Name[ta]=கேட்பொலி குறுந்தகடு உலாவி +Name[te]=ఆడియొ సిడి బ్రౌజర్ +Name[tg]=Тафсири Аудио CD +Name[th]=บราวเซอร์ซีดีเพลง +Name[tr]=Müzik CD +Name[tt]=Tawışlı CD Küzätüçe +Name[uk]=Навігатор аудіо КД +Name[uz]=Audio kompakt-disk brauzeri +Name[uz@cyrillic]=Аудио компакт-диск браузери +Name[ven]=Buronza ya CD ino thetsheleswa +Name[vi]=Duyệt CD nhạc +Name[wa]=Foyteuse des plakes lazer odio +Name[xh]=Umkhangeli zincwadi we CD Audio +Name[zh_CN]=音频 CD 浏览器 +Name[zh_TW]=音樂 CD 瀏覽器 +Name[zu]=Umcingi wama-CD ozwakalayo +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/services/media.desktop b/konqueror/sidebar/trees/init/services/media.desktop new file mode 100644 index 000000000..edff531f9 --- /dev/null +++ b/konqueror/sidebar/trees/init/services/media.desktop @@ -0,0 +1,74 @@ +[Desktop Entry] +Type=Link +URL=media:/ +Icon=system +Name=Storage Media +Name[af]=Stoor Media +Name[ar]=وسائط التخزين +Name[be]=Носьбіты +Name[bg]=Съхраняващи устройства +Name[bn]=স্টোরেজ মিডিয়া +Name[bs]=Uređaji za smještaj podataka +Name[ca]=Suports d'emmagatzematge +Name[cs]=Úložná zařízení +Name[csb]=Zôpisowné media +Name[da]=Opbevaringsmedie +Name[de]=Speichermedien +Name[el]=Συσκευές αποθήκευσης +Name[eo]=Enmemoriga Medio +Name[es]=Dispositivos de almacenamiento +Name[et]=Andmekandjad +Name[eu]=Biltegiratze-euskarria +Name[fa]=رسانۀ ذخیرهگاه +Name[fi]=Tallennusmedia +Name[fr]=Support de stockage +Name[fy]=Opslachapparaten +Name[ga]=Meán Stórais +Name[gl]=Medios de armacenaxe +Name[he]=התקנים +Name[hi]=भंडार मीडिया +Name[hr]=Mediji za pohranjivanje +Name[hu]=Tárolóeszközök +Name[is]=Geymslumiðlar +Name[it]=Dispositivi di archiviazione +Name[ja]=記憶メディア +Name[ka]=მონაცემთა შენახვის მოწყობილობები +Name[kk]=Жинақтаушы құрылғылар +Name[km]=ឧបករណ៍ផ្ទុក +Name[lt]=Saugojimo įrenginiai +Name[lv]=Datu nesējs +Name[mk]=Медиуми за податоци +Name[ms]=Media Storan +Name[nb]=Lagringsenheter +Name[nds]=Spiekermedien +Name[ne]=भण्डारण मिडिया +Name[nl]=Opslagapparaten +Name[nn]=Lagringsmedium +Name[pa]=ਸਟੋਰੇਜ਼ ਮੀਡਿਆ +Name[pl]=Urządzenia przechowywania danych +Name[pt]=Dispositivos de Armazenamento +Name[pt_BR]=Mídia de Armazenamento +Name[ro]=Mediu de stocare +Name[ru]=Устройства хранения данных +Name[rw]=Uburyo bwo Kubika +Name[se]=Vurkenmedia +Name[sk]=Zálohovacie médiá +Name[sl]=Nosilci za shranjevanje +Name[sr]=Складишни медијуми +Name[sr@Latn]=Skladišni medijumi +Name[sv]=Lagringsmedia +Name[ta]=சேகரிப்பு ஊடகம் +Name[tg]=Захирагоҳи маълумот +Name[th]=สื่อเก็บข้อมูล +Name[tr]=Depolama Ortamı +Name[tt]=Saqlawlı Media +Name[uk]=Пристрої зберігання інформації +Name[uz]=Saqlash uskunalari +Name[uz@cyrillic]=Сақлаш ускуналари +Name[vi]=Ổ chứa Dữ liệu +Name[wa]=Sopoirts di wårdaedje +Name[zh_CN]=存储介质 +Name[zh_TW]=儲存媒體 +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/services/printsystem.desktop b/konqueror/sidebar/trees/init/services/printsystem.desktop new file mode 100644 index 000000000..b51737e50 --- /dev/null +++ b/konqueror/sidebar/trees/init/services/printsystem.desktop @@ -0,0 +1,85 @@ +[Desktop Entry] +Type=Link +URL=print:/ +Icon=fileprint +Name=Print System Browser +Name[af]=Drukker Stelsel Blaaier +Name[ar]=متصفح نظام الطباعة +Name[az]=Çap Sistemi Səyyahı +Name[be]=Праглядальнік сістэм друку +Name[bg]=Система за печат +Name[bn]=মুদ্রণ ব্যবস্থা ব্রাউজার +Name[bs]=Preglednik sistema štampe +Name[ca]=Navegador del sistema d'impressió +Name[cs]=Prohlížeč tiskového systému +Name[csb]=Przezérnik systemë drëkù +Name[cy]=Porydd y Cysawd Argraffu +Name[da]=Udskriftssystemsøger +Name[de]=Drucksystem-Browser +Name[el]=Προβολέας συστήματος εκτύπωσης +Name[eo]=Rigardilo por printosistemo +Name[es]=Navegador del sistema de impresión +Name[et]=Trükkimissüsteemi sirvija +Name[eu]=Inprimaketa sistemaren arakatzailea +Name[fa]=مرورگر سیستم چاپ +Name[fi]=Tulostusjärjestelmä +Name[fr]=Navigateur dans le système d'impression +Name[fy]=Printsysteemblêder +Name[ga]=Brabhsálaí an Chóras Priontála +Name[gl]=Navegador do Sistema de Impresión +Name[he]=דפדפן מערכות הדפסה +Name[hi]=मुद्ण तंत्र ब्राउज़र +Name[hr]=Preglednik sustava ispisivanja +Name[hu]=A nyomtatók böngészése +Name[is]=Prentaraflakk +Name[it]=Navigazione del sistema di stampa +Name[ja]=印刷システムブラウザ +Name[ka]=ბეჭდვის სისტემის დათვალიერება +Name[kk]=Басып шығару жүйесін шолғышы +Name[km]=កម្មវិធីរុករកប្រព័ន្ធបោះពុម្ព +Name[ko]=인쇄 시스템 탐색기 +Name[lo]=ການຮງກເບິ່ງລະບົບການພິມ +Name[lt]=Spausdinimo sistemos naršyklė +Name[lv]=Drukas Sistēmas Pārlūks +Name[mk]=Прелистувач на печатарскиот систем +Name[mn]=Хэдлэх системийн хөтөч +Name[ms]=Pelayar Sistem Cetak +Name[mt]=Browser tas-sistema ta' pprintjar +Name[nb]=Visning av utskriftssystem +Name[nds]=Drucksysteem bekieken +Name[ne]=मुद्रण प्रणाली ब्राउजर +Name[nl]=Afdruksysteembrowser +Name[nn]=Vising av utskriftssystem +Name[nso]=Seinyakisi sa System ya Kgatiso +Name[pa]=ਪਰਿੰਟ ਸਿਸਟਮ ਝਲਕਾਰਾ +Name[pl]=Przeglądarka systemu drukowania +Name[pt]=Navegador do Sistema de Impressão +Name[pt_BR]=Sistema de Impressão +Name[ro]=Navigator sistem tipărire +Name[ru]=Просмотр системы печати +Name[rw]=Mucukumbuzi Sisitemu Gucapa +Name[se]=Čájet čálihanvuogádaga +Name[sk]=Prehliadač tlačového systému +Name[sl]=Brskalnik po tiskalniškem sistemu +Name[sr]=Прегледач система за штампу +Name[sr@Latn]=Pregledač sistema za štampu +Name[sv]=Bläddrare för utskriftssystem +Name[ta]=அச்சு அமைப்பு உலாவி +Name[te]=ప్రచురణ వ్యవస్థ బ్రౌజర్ +Name[tg]=Чопи тафсири система +Name[th]=เรียกดูระบบการพิมพ์ +Name[tr]=Yazdırma Sistemi Tarayıcı +Name[tt]=Bastıru Sistemen Küzätüçe +Name[uk]=Навігація системи друку +Name[uz]=Bosib chiqarish tizim brauzeri +Name[uz@cyrillic]=Босиб чиқариш тизим браузери +Name[ven]=Buronza ya maitele au phirintha +Name[vi]=Duyệt Hệ thống In ấn +Name[wa]=Foyteuse do sistinme d' imprimaedje +Name[xh]=Shicilela Umkhangeli zincwadi Wendlela +Name[zh_CN]=打印系统浏览器 +Name[zh_TW]=列印系統瀏覽器 +Name[zu]=Umcingi wesistimu yokushicilela +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/services/settings.desktop b/konqueror/sidebar/trees/init/services/settings.desktop new file mode 100644 index 000000000..416d5a69b --- /dev/null +++ b/konqueror/sidebar/trees/init/services/settings.desktop @@ -0,0 +1,81 @@ +[Desktop Entry] +Type=Link +URL=settings:/ +Icon=kcontrol +Name=Settings +Name[af]=Instellings +Name[ar]=التعيينات +Name[az]=Qurğular +Name[be]=Настаўленні +Name[bg]=Настройки +Name[bn]=সেটিংস +Name[br]=Dibarzhoù +Name[bs]=Postavke +Name[ca]=Preferències +Name[cs]=Nastavení +Name[csb]=Ùstôw +Name[cy]=Gosodiadau +Name[da]=Opsætning +Name[de]=Einstellungen +Name[el]=Ρυθμίσεις +Name[eo]=Agordo +Name[es]=Preferencias +Name[et]=Seadistused +Name[eu]=Ezarpenak +Name[fa]=تنظیمات +Name[fi]=Asetukset +Name[fr]=Configuration +Name[fy]=Ynstellings +Name[ga]=Socruithe +Name[gl]=Opcións +Name[he]=הגדרות +Name[hi]=विन्यास +Name[hr]=Postavke +Name[hsb]=Nastajenja +Name[hu]=Beállítások +Name[is]=Stillingar +Name[it]=Impostazioni +Name[ja]=設定 +Name[ka]=პარამეტრები +Name[kk]=Параметрлері +Name[km]=ការកំណត់ +Name[ko]=설정 +Name[lt]=Parinktys +Name[lv]=Parametri +Name[mk]=Поставувања +Name[mn]=Тохируулга +Name[ms]=Tempatan +Name[nb]=Innstillinger +Name[nds]=Instellen +Name[ne]=सेटिङ +Name[nl]=Instellingen +Name[nn]=Innstillingar +Name[pa]=ਸੈਟਿੰਗ +Name[pl]=Ustawienia +Name[pt]=Configuração +Name[pt_BR]=Configurações +Name[ro]=Setări +Name[ru]=Настройка +Name[rw]=Amagenamiterere +Name[se]=Heivehusat +Name[sk]=Nastavenia +Name[sl]=Nastavitve +Name[sr]=Поставке +Name[sr@Latn]=Postavke +Name[sv]=Inställningar +Name[ta]=அமைப்புகள் +Name[te]=అమరికలు +Name[tg]=Танзимот +Name[th]=ตั้งค่าต่างๆ +Name[tr]=Ayarlar +Name[tt]=Caylaw +Name[uk]=Параметри +Name[uz]=Moslamalar +Name[uz@cyrillic]=Мосламалар +Name[vi]=Thiết lập +Name[wa]=Apontiaedjes +Name[zh_CN]=设置 +Name[zh_TW]=設定 +Open=false +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/system.desktop b/konqueror/sidebar/trees/init/system.desktop new file mode 100644 index 000000000..490b4ef7f --- /dev/null +++ b/konqueror/sidebar/trees/init/system.desktop @@ -0,0 +1,139 @@ +[Desktop Entry] +Type=Link +URL=system:/ +Icon=system +Name=System +Name[af]=Stelsel +Name[ar]=النظام +Name[az]=Sistem +Name[be]=Сістэма +Name[bg]=Система +Name[bn]=সিস্টেম +Name[br]=Reizhiad +Name[bs]=Sistem +Name[ca]=Sistema +Name[cs]=Systém +Name[csb]=Systema +Name[cy]=Cysawd +Name[el]=Σύστημα +Name[eo]=Sistemo +Name[es]=Sistema +Name[et]=Süsteem +Name[eu]=Sistema +Name[fa]=سیستم +Name[fi]=Järjestelmä +Name[fo]=Kervi +Name[fr]=Système +Name[fy]=Systeem +Name[ga]=Córas +Name[gl]=Sistema +Name[he]=מערכת +Name[hi]=तंत्र +Name[hr]=Sustav +Name[hu]=Rendszer +Name[id]=Sistem +Name[is]=Kerfi +Name[it]=Sistema +Name[ja]=システム +Name[ka]=სისტემა +Name[kk]=Жүйелік +Name[km]=ប្រព័ន្ធ +Name[ko]=시스템 +Name[lo]=ຈັດການລະບົບ +Name[lt]=Sistema +Name[lv]=Sistēma +Name[mk]=Систем +Name[mn]=Систем +Name[ms]=Sistem +Name[mt]=Sistema +Name[nds]=Systeem +Name[ne]=प्रणाली +Name[nl]=Systeem +Name[oc]=Sistemo +Name[pa]=ਸਿਸਟਮ +Name[pt]=Sistema +Name[pt_BR]=Sistema +Name[ro]=Sistem +Name[ru]=Система +Name[rw]=Sisitemu +Name[se]=Vuogádat +Name[sk]=Systém +Name[sl]=Sistem +Name[sr]=Систем +Name[sr@Latn]=Sistem +Name[ss]=Umshini +Name[ta]=அமைப்பு +Name[te]=వ్యవస్థ +Name[tg]=Система +Name[th]=ระบบ +Name[tr]=Sistem +Name[tt]=Sistem +Name[uk]=Система +Name[uz]=Tizim +Name[uz@cyrillic]=Тизим +Name[ven]=Maitele +Name[vi]=Hệ thống +Name[wa]=Sistinme +Name[xh]=Indlela esestyenziswayo +Name[zh_CN]=系统 +Name[zh_TW]=系統 +Name[zu]=Isistimu +Comment=This folder allows you to access common places on your computer +Comment[af]=Hierdie gids laat jou toe om algemene plekke op jou rekenaar te besoek +Comment[ar]=هذا المجلّد يسمح لك بالوصول إلى مواقع مشتركة على حاسوبك +Comment[be]=Гэтая тэчка дазваляе атрымаць хуткі доступ да розных важных месцаў на вашым кампутары +Comment[bg]=Директория за достъп до често използваните места в компютъра +Comment[bn]=এই ফোল্ডারটি আপনার কম্পিউটারে সাধারণত ব্যবহৃত অবস্থানগুলিতে চটপট চলে যেতে সাহায্য করে +Comment[bs]=Ovaj direktorij vam omogućuje pristup uobičajenim mjestima na vašem računaru +Comment[ca]=Aquesta carpeta us permet accedir a llocs usuals de l'ordinador +Comment[cs]=Tato složka zpřístupňuje často používaná umístění na vašem počítači +Comment[csb]=Nen katalog dôwô mòżnotã przistãpù do nôczãsczi brëkòwónëch placów w twòjim kòmpùtrze +Comment[da]=Denne mappe giver adgang til almindelige steder på din computer +Comment[de]=Dieser Ordner ermöglicht den Zugriff auf gebräuchliche Systembereiche des Computers +Comment[el]=Αυτός ο φάκελος σας επιτρέπει την πρόσβαση σε τυπικές τοποθεσίες του συστήματός σας +Comment[eo]=Tiu ĉi dosierujo atingebligas al viaj ofte vizititaj lokoj en via komputilo +Comment[es]=Esta carpeta permite acceder a lugares usuales en su equipo +Comment[et]=See kataloog võimaldab juurdepääsu tavalistele kohtadele su arvutis +Comment[eu]=Karpeta honek zure ordenagailuaren leku arruntetarako sarbidea ematen dizu +Comment[fa]=این پوشه اجازۀ دستیابی به جاهای مشترک در رایانۀ شما را میدهد +Comment[fi]=Tämä kansio sallii pääsyn tietokoneesi yleisiin kohteisiin +Comment[fr]=Ce dossier vous permet d'accéder aux endroits de votre ordinateur régulièrement utilisés +Comment[fy]=Dizze map jout tagong ta algemiene plakken yn jo kompjûter +Comment[ga]=Ceadaíonn an fillteán seo duit áiteanna coitianta a rochtain ar do ríomhaire +Comment[gl]=Este cartafol permite-lle aceder a lugares habituais do seu ordenador +Comment[he]=תיקייה זו מאפשרת לך לגשת את המקומות המועדפים עליך במערכת שלך +Comment[hr]=Ova mapa omogućuje pristup uobičajenim lokacijama na računalu +Comment[hu]=Néhány fontosabb rendszerkönyvtár elérését teszi lehetővé +Comment[is]=Þessi mappa veitir aðgang að algengum stöðum á tölvunni þinni +Comment[it]=Questa cartella permette di accedere agli oggetti comuni del tuo computer +Comment[ja]=このフォルダからコンピュータ上のよく使われる場所にアクセスできます +Comment[kk]=Бұл қапшық компьютердегі ортақ орындарға қатынауға мүмкіндік береді +Comment[km]=ថតនេះអនុញ្ញាតឲ្យអ្នកចូលដំណើរការកន្លែងទូទៅលើកុំព្យូទ័ររបស់អ្នក +Comment[lt]=Šio aplanko padedami pasieksite dažniausiai lankomas kompiuterio vietas +Comment[mk]=Оваа папка ви овозможува пристап до вообичаените места на вашиот компјутер +Comment[nb]=Denne mappa gir deg tilgang til vanlige steder på din datamaskin +Comment[nds]=Mit dissen Orner kannst Du op en Reeg faken bruukte Öörd togriepen +Comment[ne]=यो फोल्डरले तपाईँलाई कम्प्युटरको साझा स्थानहरूमा पहुँच अनुमति दिन्छ +Comment[nl]=Deze map geeft toegang tot algemene plekken van uw desktop +Comment[nn]=Denne mappa gir deg tilgang til nokre vanlege stader på datamaskina +Comment[pa]=ਇਹ ਫੋਲਡਰ ਤੁਹਾਨੂੰ ਤੁਹਾਡੇ ਕੰਪਿਊਟਰ 'ਚ ਆਮ ਥਾਵਾਂ ਦੀ ਵਰਤੋਂ ਕਰਨ ਲਈ ਸਹਾਇਕ ਹੈ +Comment[pl]=Ten folder umożliwia dostęp do najczęściej używanych miejsc w Twoim komputerze +Comment[pt]=Esta pasta permite aceder a alguns locais comuns no seu computador +Comment[pt_BR]=Esta pasta permite que você acesse lugares comuns em seu computador +Comment[ro]=Acest folder vă permite să accesați locurile uzuale pe computerul dvs. +Comment[ru]=Часто используемые папки +Comment[sk]=Tento priečinok umožňuje pristupovať na spoločné miesta na tomto počítači +Comment[sl]=Ta mapa omogoča dostop do pomembnih lokacij na vašem računalniku +Comment[sr]=Ова фасцикла омогућава приступ уобичајеним местима на вашем рачунару +Comment[sr@Latn]=Ova fascikla omogućava pristup uobičajenim mestima na vašem računaru +Comment[sv]=Den här katalogen gör det möjligt att komma åt vanliga platser på din dator +Comment[th]=โฟลเดอร์นี้อนุญาตให้คุณเข้าถึงสถานที่ทั่วๆ ไปในเครื่องคอมพิวเตอร์ของคุณ +Comment[tr]=Bu klasör bilgisayarınızdaki belirli yerlere erişmenizi sağlar +Comment[uk]=Ця тека надає доступ до спільних місць у вашому комп'ютері +Comment[vi]=Thư mục này cho phép bạn truy cập vào các nơi thông dụng của máy tính +Comment[wa]=Ci ridant chal vos permete d' aler ås comonès plaeces so vosse copiutrece +Comment[zh_CN]=此文件夹允许您访问计算机中的公共位置 +Comment[zh_TW]=這個資料夾允許存取您電腦上的共同空間 +Open=true +X-KDE-TreeModule=Directory +X-KDE-KonqSidebarModule=konqsidebar_tree diff --git a/konqueror/sidebar/trees/init/virtualfolderadd.desktop b/konqueror/sidebar/trees/init/virtualfolderadd.desktop new file mode 100644 index 000000000..0af894ac6 --- /dev/null +++ b/konqueror/sidebar/trees/init/virtualfolderadd.desktop @@ -0,0 +1,81 @@ +[Desktop Entry] +Type=Link +URL= +Icon=folder +Name=Folder +Name[af]=Gids +Name[ar]=المجلد +Name[az]=Qovluq +Name[be]=Тэчка +Name[bg]=Директория +Name[bn]=ফোল্ডার +Name[br]=Renkell +Name[bs]=Direktorij +Name[ca]=Carpeta +Name[cs]=Složka +Name[csb]=Katalog +Name[cy]=Plygell +Name[da]=Mappe +Name[de]=Ordner +Name[el]=Φάκελος +Name[eo]=Dosierujo +Name[es]=Carpeta +Name[et]=Kataloog +Name[eu]=Karpeta +Name[fa]=پوشه +Name[fi]=Kansio +Name[fr]=Dossier +Name[fy]=Map +Name[ga]=Fillteán +Name[gl]=Cartafol +Name[he]=תיקייה +Name[hi]=फ़ोल्डर +Name[hr]=Mapa +Name[hu]=Könyvtár +Name[is]=Mappa +Name[it]=Cartella +Name[ja]=フォルダ +Name[ka]=საქაღალდე +Name[kk]=Қапшық +Name[km]=ថត +Name[ko]=홈 폴더 +Name[lt]=Aplankas +Name[lv]=Mape +Name[mk]=Папка +Name[mn]=хавтас +Name[mt]=Direttorju +Name[nb]=Mappe +Name[nds]=Orner +Name[ne]=फोल्डर +Name[nl]=Map +Name[nn]=Mappe +Name[pa]=ਫੋਲਡਰ +Name[pl]=Katalog +Name[pt]=Pasta +Name[pt_BR]=Pasta +Name[ru]=Папка +Name[rw]=Ububiko +Name[se]=Máhppa +Name[sk]=Priečinok +Name[sl]=Mapa +Name[sr]=Фасцикла +Name[sr@Latn]=Fascikla +Name[sv]=Katalog +Name[ta]=அடைவு +Name[te]=ఫొల్డర్ +Name[tg]=Феҳрист +Name[th]=โฟลเดอร์ +Name[tr]=Dizin +Name[tt]=Törgäk +Name[uk]=Тека +Name[uz]=Jild +Name[uz@cyrillic]=Жилд +Name[vi]=Thư mục +Name[wa]=Ridant +Name[zh_CN]=文件夹 +Name[zh_TW]=資料夾 + +Open=false +X-KDE-KonqSidebarAddParam= +X-KDE-KonqSidebarAddModule=konqsidebar_tree +X-KDE-KonqSidebarUniversal=true diff --git a/konqueror/sidebar/trees/konq_sidebartree.cpp b/konqueror/sidebar/trees/konq_sidebartree.cpp new file mode 100644 index 000000000..e30e21ac9 --- /dev/null +++ b/konqueror/sidebar/trees/konq_sidebartree.cpp @@ -0,0 +1,1048 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + 2000 Carsten Pfeiffer <pfeiffer@kde.org> + 2003 Waldo Bastian <bastian@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "konq_sidebartreemodule.h" + +#include <qclipboard.h> +#include <qcursor.h> +#include <qdir.h> +#include <qheader.h> +#include <qpopupmenu.h> +#include <qtimer.h> + +#include <dcopclient.h> +#include <dcopref.h> + +#include <kaction.h> +#include <kapplication.h> +#include <kdebug.h> +#include <kdesktopfile.h> +#include <kdirnotify_stub.h> +#include <kglobalsettings.h> +#include <kiconloader.h> +#include <kinputdialog.h> +#include <kio/netaccess.h> +#include <kmimetype.h> +#include <kprocess.h> +#include <kpropertiesdialog.h> +#include <kprotocolinfo.h> +#include <kstandarddirs.h> +#include <kurldrag.h> + +#include <stdlib.h> +#include <assert.h> + + +static const int autoOpenTimeout = 750; + + +getModule KonqSidebarTree::getPluginFactory(QString name) +{ + if (!pluginFactories.contains(name)) + { + KLibLoader *loader = KLibLoader::self(); + QString libName = pluginInfo[name]; + KLibrary *lib = loader->library(QFile::encodeName(libName)); + if (lib) + { + // get the create_ function + QString factory = "create_" + libName; + void *create = lib->symbol(QFile::encodeName(factory)); + if (create) + { + getModule func = (getModule)create; + pluginFactories.insert(name, func); + kdDebug()<<"Added a module"<<endl; + } + else + { + kdWarning()<<"No create function found in"<<libName<<endl; + } + } + else + kdWarning() << "Module " << libName << " can't be loaded!" << endl; + } + + return pluginFactories[name]; +} + +void KonqSidebarTree::loadModuleFactories() +{ + pluginFactories.clear(); + pluginInfo.clear(); + KStandardDirs *dirs=KGlobal::dirs(); + QStringList list=dirs->findAllResources("data","konqsidebartng/dirtree/*.desktop",false,true); + + + for (QStringList::ConstIterator it=list.begin();it!=list.end();++it) + { + KSimpleConfig ksc(*it); + ksc.setGroup("Desktop Entry"); + QString name = ksc.readEntry("X-KDE-TreeModule"); + QString libName = ksc.readEntry("X-KDE-TreeModule-Lib"); + if ((name.isEmpty()) || (libName.isEmpty())) + {kdWarning()<<"Bad Configuration file for a dirtree module "<<*it<<endl; continue;} + + //Register the library info. + pluginInfo[name] = libName; + } +} + + +class KonqSidebarTree_Internal +{ +public: + DropAcceptType m_dropMode; + QStringList m_dropFormats; +}; + + +KonqSidebarTree::KonqSidebarTree( KonqSidebar_Tree *parent, QWidget *parentWidget, int virt, const QString& path ) + : KListView( parentWidget ), + m_currentTopLevelItem( 0 ), + m_toolTip( this ), + m_scrollingLocked( false ), + m_collection( 0 ) +{ + d = new KonqSidebarTree_Internal; + d->m_dropMode = SidebarTreeMode; + + loadModuleFactories(); + + setAcceptDrops( true ); + viewport()->setAcceptDrops( true ); + m_lstModules.setAutoDelete( true ); + + setSelectionMode( QListView::Single ); + setDragEnabled(true); + + m_part = parent; + + m_animationTimer = new QTimer( this ); + connect( m_animationTimer, SIGNAL( timeout() ), + this, SLOT( slotAnimation() ) ); + + m_currentBeforeDropItem = 0; + m_dropItem = 0; + m_bOpeningFirstChild=false; + + addColumn( QString::null ); + header()->hide(); + setTreeStepSize(15); + + m_autoOpenTimer = new QTimer( this ); + connect( m_autoOpenTimer, SIGNAL( timeout() ), + this, SLOT( slotAutoOpenFolder() ) ); + + connect( this, SIGNAL( doubleClicked( QListViewItem * ) ), + this, SLOT( slotDoubleClicked( QListViewItem * ) ) ); + connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem*, const QPoint&, int)), + this, SLOT( slotMouseButtonPressed(int, QListViewItem*, const QPoint&, int)) ); + connect( this, SIGNAL( mouseButtonClicked( int, QListViewItem*, const QPoint&, int ) ), + this, SLOT( slotMouseButtonClicked( int, QListViewItem*, const QPoint&, int ) ) ); + connect( this, SIGNAL( returnPressed( QListViewItem * ) ), + this, SLOT( slotDoubleClicked( QListViewItem * ) ) ); + connect( this, SIGNAL( selectionChanged() ), + this, SLOT( slotSelectionChanged() ) ); + + connect( this, SIGNAL(itemRenamed(QListViewItem*, const QString &, int)), + this, SLOT(slotItemRenamed(QListViewItem*, const QString &, int))); + +/* assert( m_part->getInterfaces()->getInstance()->dirs ); + QString dirtreeDir = m_part->getInterfaces()->getInstance()->dirs()->saveLocation( "data", "konqueror/dirtree/" ); */ + +// assert( KGlobal::dirs() ); +// QString dirtreeDir = part->getInterfaces()->getInstance()->dirs()->saveLocation( "data", "konqueror/dirtree/" ); + + if (virt==VIRT_Folder) + { + m_dirtreeDir.dir.setPath(KGlobal::dirs()->saveLocation("data","konqsidebartng/virtual_folders/"+path+"/")); + m_dirtreeDir.relDir=path; + } + else + m_dirtreeDir.dir.setPath( path ); + kdDebug(1201)<<m_dirtreeDir.dir.path()<<endl; + m_dirtreeDir.type=virt; + // Initial parsing + rescanConfiguration(); + + if (firstChild()) + { + m_bOpeningFirstChild = true; + firstChild()->setOpen(true); + m_bOpeningFirstChild = false; + } + + setFrameStyle( QFrame::ToolBarPanel | QFrame::Raised ); +} + +KonqSidebarTree::~KonqSidebarTree() +{ + clearTree(); + + delete d; +} + +void KonqSidebarTree::itemDestructed( KonqSidebarTreeItem *item ) +{ + stopAnimation(item); + + if (item == m_currentBeforeDropItem) + { + m_currentBeforeDropItem = 0; + } +} + +void KonqSidebarTree::setDropFormats(const QStringList &formats) +{ + d->m_dropFormats = formats; +} + +void KonqSidebarTree::clearTree() +{ + m_lstModules.clear(); + m_topLevelItems.clear(); + m_mapCurrentOpeningFolders.clear(); + m_currentBeforeDropItem = 0; + clear(); + + if (m_dirtreeDir.type==VIRT_Folder) + { + setRootIsDecorated( true ); + } + else + { + setRootIsDecorated( false ); + } +} + +void KonqSidebarTree::followURL( const KURL &url ) +{ + // Maybe we're there already ? + KonqSidebarTreeItem *selection = static_cast<KonqSidebarTreeItem *>( selectedItem() ); + if (selection && selection->externalURL().equals( url, true )) + { + ensureItemVisible( selection ); + return; + } + + kdDebug(1201) << "KonqDirTree::followURL: " << url.url() << endl; + QPtrListIterator<KonqSidebarTreeTopLevelItem> topItem ( m_topLevelItems ); + for (; topItem.current(); ++topItem ) + { + if ( topItem.current()->externalURL().isParentOf( url ) ) + { + topItem.current()->module()->followURL( url ); + return; // done + } + } + kdDebug(1201) << "KonqDirTree::followURL: Not found" << endl; +} + +void KonqSidebarTree::contentsDragEnterEvent( QDragEnterEvent *ev ) +{ + m_dropItem = 0; + m_currentBeforeDropItem = selectedItem(); + // Save the available formats + m_lstDropFormats.clear(); + for( int i = 0; ev->format( i ); i++ ) + if ( *( ev->format( i ) ) ) + m_lstDropFormats.append( ev->format( i ) ); +} + +void KonqSidebarTree::contentsDragMoveEvent( QDragMoveEvent *e ) +{ + QListViewItem *item = itemAt( contentsToViewport( e->pos() ) ); + + // Accept drops on the background, if URLs + if ( !item && m_lstDropFormats.contains("text/uri-list") ) + { + m_dropItem = 0; + e->acceptAction(); + if (selectedItem()) + setSelected( selectedItem(), false ); // no item selected + return; + } + + if (item && static_cast<KonqSidebarTreeItem*>(item)->acceptsDrops( m_lstDropFormats )) { + d->m_dropMode = SidebarTreeMode; + + if ( !item->isSelectable() ) + { + m_dropItem = 0; + m_autoOpenTimer->stop(); + e->ignore(); + return; + } + + e->acceptAction(); + + setSelected( item, true ); + + if ( item != m_dropItem ) + { + m_autoOpenTimer->stop(); + m_dropItem = item; + m_autoOpenTimer->start( autoOpenTimeout ); + } + } else { + d->m_dropMode = KListViewMode; + KListView::contentsDragMoveEvent(e); + } +} + +void KonqSidebarTree::contentsDragLeaveEvent( QDragLeaveEvent *ev ) +{ + // Restore the current item to what it was before the dragging (#17070) + if ( m_currentBeforeDropItem ) + setSelected( m_currentBeforeDropItem, true ); + else + setSelected( m_dropItem, false ); // no item selected + m_currentBeforeDropItem = 0; + m_dropItem = 0; + m_lstDropFormats.clear(); + + if (d->m_dropMode == KListViewMode) { + KListView::contentsDragLeaveEvent(ev); + } +} + +void KonqSidebarTree::contentsDropEvent( QDropEvent *ev ) +{ + if (d->m_dropMode == SidebarTreeMode) { + m_autoOpenTimer->stop(); + + if ( !selectedItem() ) + { + // KonqOperations::doDrop( 0L, m_dirtreeDir.dir, ev, this ); + KURL::List urls; + if ( KURLDrag::decode( ev, urls ) ) + { + for(KURL::List::ConstIterator it = urls.begin(); + it != urls.end(); ++it) + { + addURL(0, *it); + } + } + } + else + { + KonqSidebarTreeItem *selection = static_cast<KonqSidebarTreeItem *>( selectedItem() ); + selection->drop( ev ); + } + } else { + KListView::contentsDropEvent(ev); + } +} + +static QString findUniqueFilename(const QString &path, QString filename) +{ + if (filename.endsWith(".desktop")) + filename.truncate(filename.length()-8); + + QString name = filename; + int n = 2; + while(QFile::exists(path + filename + ".desktop")) + { + filename = QString("%2_%1").arg(n++).arg(name); + } + return path+filename+".desktop"; +} + +void KonqSidebarTree::addURL(KonqSidebarTreeTopLevelItem* item, const KURL & url) +{ + QString path; + if (item) + path = item->path(); + else + path = m_dirtreeDir.dir.path(); + + KURL destUrl; + + if (url.isLocalFile() && url.fileName().endsWith(".desktop")) + { + QString filename = findUniqueFilename(path, url.fileName()); + destUrl.setPath(filename); + KIO::NetAccess::copy(url, destUrl, this); + } + else + { + QString name = url.host(); + if (name.isEmpty()) + name = url.fileName(); + QString filename = findUniqueFilename(path, name); + destUrl.setPath(filename); + + KDesktopFile cfg(filename); + cfg.writeEntry("Encoding", "UTF-8"); + cfg.writeEntry("Type","Link"); + cfg.writeEntry("URL", url.url()); + QString icon = "folder"; + if (!url.isLocalFile()) + icon = KMimeType::favIconForURL(url); + if (icon.isEmpty()) + icon = KProtocolInfo::icon( url.protocol() ); + cfg.writeEntry("Icon", icon); + cfg.writeEntry("Name", name); + cfg.writeEntry("Open", false); + cfg.sync(); + } + + KDirNotify_stub allDirNotify( "*", "KDirNotify*" ); + destUrl.setPath( destUrl.directory() ); + allDirNotify.FilesAdded( destUrl ); + + if (item) + item->setOpen(true); +} + +bool KonqSidebarTree::acceptDrag(QDropEvent* e) const +{ + // for KListViewMode... + for( int i = 0; e->format( i ); i++ ) + if ( d->m_dropFormats.contains(e->format( i ) ) ) + return true; + return false; +} + +QDragObject* KonqSidebarTree::dragObject() +{ + KonqSidebarTreeItem* item = static_cast<KonqSidebarTreeItem *>( selectedItem() ); + if ( !item ) + return 0; + + QDragObject* drag = item->dragObject( viewport(), false ); + if ( !drag ) + return 0; + + const QPixmap *pix = item->pixmap(0); + if ( pix && drag->pixmap().isNull() ) + drag->setPixmap( *pix ); + + return drag; +} + +void KonqSidebarTree::leaveEvent( QEvent *e ) +{ + KListView::leaveEvent( e ); +// emitStatusBarText( QString::null ); +} + + +void KonqSidebarTree::slotDoubleClicked( QListViewItem *item ) +{ + //kdDebug(1201) << "KonqSidebarTree::slotDoubleClicked " << item << endl; + if ( !item ) + return; + + if ( !static_cast<KonqSidebarTreeItem*>(item)->isClickable() ) + return; + + slotExecuted( item ); + item->setOpen( !item->isOpen() ); +} + +void KonqSidebarTree::slotExecuted( QListViewItem *item ) +{ + kdDebug(1201) << "KonqSidebarTree::slotExecuted " << item << endl; + if ( !item ) + return; + + if ( !static_cast<KonqSidebarTreeItem*>(item)->isClickable() ) + return; + + KonqSidebarTreeItem *dItem = static_cast<KonqSidebarTreeItem *>( item ); + + KParts::URLArgs args; + + args.serviceType = dItem->externalMimeType(); + args.trustedSource = true; + KURL externalURL = dItem->externalURL(); + if ( !externalURL.isEmpty() ) + openURLRequest( externalURL, args ); +} + +void KonqSidebarTree::slotMouseButtonPressed( int _button, QListViewItem* _item, const QPoint&, int col ) +{ + KonqSidebarTreeItem * item = static_cast<KonqSidebarTreeItem*>( _item ); + if (_button == RightButton) + { + if ( item && col < 2) + { + item->setSelected( true ); + item->rightButtonPressed(); + } + } +} + +void KonqSidebarTree::slotMouseButtonClicked(int _button, QListViewItem* _item, const QPoint&, int col) +{ + KonqSidebarTreeItem * item = static_cast<KonqSidebarTreeItem*>(_item); + if(_item && col < 2) + { + switch( _button ) { + case LeftButton: + slotExecuted( item ); + break; + case MidButton: + item->middleButtonClicked(); + break; + } + } +} + +void KonqSidebarTree::slotAutoOpenFolder() +{ + m_autoOpenTimer->stop(); + + if ( !m_dropItem || m_dropItem->isOpen() ) + return; + + m_dropItem->setOpen( true ); + m_dropItem->repaint(); +} + +void KonqSidebarTree::rescanConfiguration() +{ + kdDebug(1201) << "KonqSidebarTree::rescanConfiguration()" << endl; + m_autoOpenTimer->stop(); + clearTree(); + if (m_dirtreeDir.type==VIRT_Folder) + { + kdDebug(1201)<<"KonqSidebarTree::rescanConfiguration()-->scanDir"<<endl; + scanDir( 0, m_dirtreeDir.dir.path(), true); + + } + else + { + kdDebug(1201)<<"KonqSidebarTree::rescanConfiguration()-->loadTopLevel"<<endl; + loadTopLevelItem( 0, m_dirtreeDir.dir.path() ); + } +} + +void KonqSidebarTree::slotSelectionChanged() +{ + if ( !m_dropItem ) // don't do this while the dragmove thing + { + KonqSidebarTreeItem * item = static_cast<KonqSidebarTreeItem *>( selectedItem() ); + if ( item ) + item->itemSelected(); + /* else -- doesn't seem to happen + {} */ + } +} + +void KonqSidebarTree::FilesAdded( const KURL & dir ) +{ + kdDebug(1201) << "KonqSidebarTree::FilesAdded " << dir.url() << endl; + if ( m_dirtreeDir.dir.isParentOf( dir ) ) + // We use a timer in case of DCOP re-entrance.. + QTimer::singleShot( 0, this, SLOT( rescanConfiguration() ) ); +} + +void KonqSidebarTree::FilesRemoved( const KURL::List & urls ) +{ + //kdDebug(1201) << "KonqSidebarTree::FilesRemoved " << urls.count() << endl; + for ( KURL::List::ConstIterator it = urls.begin() ; it != urls.end() ; ++it ) + { + //kdDebug(1201) << "KonqSidebarTree::FilesRemoved " << (*it).prettyURL() << endl; + if ( m_dirtreeDir.dir.isParentOf( *it ) ) + { + QTimer::singleShot( 0, this, SLOT( rescanConfiguration() ) ); + kdDebug(1201) << "KonqSidebarTree::FilesRemoved done" << endl; + return; + } + } +} + +void KonqSidebarTree::FilesChanged( const KURL::List & urls ) +{ + //kdDebug(1201) << "KonqSidebarTree::FilesChanged" << endl; + // not same signal, but same implementation + FilesRemoved( urls ); +} + +void KonqSidebarTree::scanDir( KonqSidebarTreeItem *parent, const QString &path, bool isRoot ) +{ + QDir dir( path ); + + if ( !dir.isReadable() ) + return; + + kdDebug(1201) << "scanDir " << path << endl; + + QStringList entries = dir.entryList( QDir::Files ); + QStringList dirEntries = dir.entryList( QDir::Dirs | QDir::NoSymLinks ); + dirEntries.remove( "." ); + dirEntries.remove( ".." ); + + if ( isRoot ) + { + bool copyConfig = ( entries.count() == 0 && dirEntries.count() == 0 ); + if (!copyConfig) + { + // Check version number + // Version 1 was the dirtree of KDE 2.0.x (no versioning at that time, so default) + // Version 2 includes the history + // Version 3 includes the bookmarks + // Version 4 includes lan.desktop and floppy.desktop, Alex + // Version 5 includes the audiocd browser + // Version 6 includes the printmanager and lan browser + const int currentVersion = 6; + QString key = QString::fromLatin1("X-KDE-DirTreeVersionNumber"); + KSimpleConfig versionCfg( path + "/.directory" ); + int versionNumber = versionCfg.readNumEntry( key, 1 ); + kdDebug(1201) << "KonqSidebarTree::scanDir found version " << versionNumber << endl; + if ( versionNumber < currentVersion ) + { + versionCfg.writeEntry( key, currentVersion ); + versionCfg.sync(); + copyConfig = true; + } + } + if (copyConfig) + { + // We will copy over the configuration for the dirtree, from the global directory + QStringList dirtree_dirs = KGlobal::dirs()->findDirs("data","konqsidebartng/virtual_folders/"+m_dirtreeDir.relDir+"/"); + + +// QString dirtree_dir = KGlobal::dirs()->findDirs("data","konqsidebartng/virtual_folders/"+m_dirtreeDir.relDir+"/").last(); // most global +// kdDebug(1201) << "KonqSidebarTree::scanDir dirtree_dir=" << dirtree_dir << endl; + + /* + // debug code + + QStringList blah = m_part->getInterfaces->getInstance()->dirs()->dirs()->findDirs( "data", "konqueror/dirtree" ); + QStringList::ConstIterator eIt = blah.begin(); + QStringList::ConstIterator eEnd = blah.end(); + for (; eIt != eEnd; ++eIt ) + kdDebug(1201) << "KonqSidebarTree::scanDir findDirs got me " << *eIt << endl; + // end debug code + */ + + for (QStringList::const_iterator ddit=dirtree_dirs.begin();ddit!=dirtree_dirs.end();++ddit) { + QString dirtree_dir=*ddit; + if (dirtree_dir==path) continue; + // if ( !dirtree_dir.isEmpty() && dirtree_dir != path ) + { + QDir globalDir( dirtree_dir ); + Q_ASSERT( globalDir.isReadable() ); + // Only copy the entries that don't exist yet in the local dir + QStringList globalDirEntries = globalDir.entryList(); + QStringList::ConstIterator eIt = globalDirEntries.begin(); + QStringList::ConstIterator eEnd = globalDirEntries.end(); + for (; eIt != eEnd; ++eIt ) + { + //kdDebug(1201) << "KonqSidebarTree::scanDir dirtree_dir contains " << *eIt << endl; + if ( *eIt != "." && *eIt != ".." + && !entries.contains( *eIt ) && !dirEntries.contains( *eIt ) ) + { // we don't have that one yet -> copy it. + QString cp("cp -R -- "); + cp += KProcess::quote(dirtree_dir + *eIt); + cp += " "; + cp += KProcess::quote(path); + kdDebug(1201) << "KonqSidebarTree::scanDir executing " << cp << endl; + ::system( QFile::encodeName(cp) ); + } + } + } + } + // hack to make QDir refresh the lists + dir.setPath(path); + entries = dir.entryList( QDir::Files ); + dirEntries = dir.entryList( QDir::Dirs ); + dirEntries.remove( "." ); + dirEntries.remove( ".." ); + } + } + QStringList::ConstIterator eIt = entries.begin(); + QStringList::ConstIterator eEnd = entries.end(); + + for (; eIt != eEnd; ++eIt ) + { + QString filePath = QString( *eIt ).prepend( path ); + KURL u; + u.setPath( filePath ); + if ( KMimeType::findByURL( u, 0, true )->name() == "application/x-desktop" ) + loadTopLevelItem( parent, filePath ); + } + + eIt = dirEntries.begin(); + eEnd = dirEntries.end(); + + for (; eIt != eEnd; eIt++ ) + { + QString newPath = QString( path ).append( *eIt ).append( '/' ); + + if ( newPath == KGlobalSettings::autostartPath() ) + continue; + + loadTopLevelGroup( parent, newPath ); + } +} + +void KonqSidebarTree::loadTopLevelGroup( KonqSidebarTreeItem *parent, const QString &path ) +{ + QDir dir( path ); + QString name = dir.dirName(); + QString icon = "folder"; + bool open = false; + + kdDebug(1201) << "Scanning " << path << endl; + + QString dotDirectoryFile = QString( path ).append( "/.directory" ); + + if ( QFile::exists( dotDirectoryFile ) ) + { + kdDebug(1201) << "Reading the .directory" << endl; + KSimpleConfig cfg( dotDirectoryFile, true ); + cfg.setDesktopGroup(); + name = cfg.readEntry( "Name", name ); + icon = cfg.readEntry( "Icon", icon ); + //stripIcon( icon ); + open = cfg.readBoolEntry( "Open", open ); + } + + KonqSidebarTreeTopLevelItem *item; + if ( parent ) + { + kdDebug(1201) << "KonqSidebarTree::loadTopLevelGroup Inserting new group under parent " << endl; + item = new KonqSidebarTreeTopLevelItem( parent, 0 /* no module */, path ); + } + else + item = new KonqSidebarTreeTopLevelItem( this, 0 /* no module */, path ); + item->setText( 0, name ); + item->setPixmap( 0, SmallIcon( icon ) ); + item->setListable( false ); + item->setClickable( false ); + item->setTopLevelGroup( true ); + item->setOpen( open ); + + m_topLevelItems.append( item ); + + kdDebug(1201) << "Inserting group " << name << " " << path << endl; + + scanDir( item, path ); + + if ( item->childCount() == 0 ) + item->setExpandable( false ); +} + +void KonqSidebarTree::loadTopLevelItem( KonqSidebarTreeItem *parent, const QString &filename ) +{ + KDesktopFile cfg( filename, true ); + cfg.setDollarExpansion(true); + + QFileInfo inf( filename ); + + QString path = filename; + QString name = KIO::decodeFileName( inf.fileName() ); + if ( name.length() > 8 && name.right( 8 ) == ".desktop" ) + name.truncate( name.length() - 8 ); + if ( name.length() > 7 && name.right( 7 ) == ".kdelnk" ) + name.truncate( name.length() - 7 ); + + name = cfg.readEntry( "Name", name ); + KonqSidebarTreeModule * module = 0L; + + // Here's where we need to create the right module... + // ### TODO: make this KTrader/KLibrary based. + QString moduleName = cfg.readEntry( "X-KDE-TreeModule" ); + QString showHidden=cfg.readEntry("X-KDE-TreeModule-ShowHidden"); + + if (moduleName.isEmpty()) moduleName="Directory"; + kdDebug(1201) << "##### Loading module: " << moduleName << " file: " << filename << endl; + + getModule func; + func = getPluginFactory(moduleName); + if (func!=0) + { + kdDebug(1201)<<"showHidden: "<<showHidden<<endl; + module=func(this,showHidden.upper()=="TRUE"); + } + + if (module==0) {kdDebug()<<"No Module loaded"<<endl; return;} + + KonqSidebarTreeTopLevelItem *item; + if ( parent ) + item = new KonqSidebarTreeTopLevelItem( parent, module, path ); + else + item = new KonqSidebarTreeTopLevelItem( this, module, path ); + + item->setText( 0, name ); + item->setPixmap( 0, SmallIcon( cfg.readIcon() )); + + module->addTopLevelItem( item ); + + m_topLevelItems.append( item ); + m_lstModules.append( module ); + + bool open = cfg.readBoolEntry( "Open", false ); + if ( open && item->isExpandable() ) + item->setOpen( true ); +} + +void KonqSidebarTree::slotAnimation() +{ + MapCurrentOpeningFolders::Iterator it = m_mapCurrentOpeningFolders.begin(); + MapCurrentOpeningFolders::Iterator end = m_mapCurrentOpeningFolders.end(); + for (; it != end; ++it ) + { + uint & iconNumber = it.data().iconNumber; + QString icon = QString::fromLatin1( it.data().iconBaseName ).append( QString::number( iconNumber ) ); + it.key()->setPixmap( 0, SmallIcon( icon)); + + iconNumber++; + if ( iconNumber > it.data().iconCount ) + iconNumber = 1; + } +} + + +void KonqSidebarTree::startAnimation( KonqSidebarTreeItem * item, const char * iconBaseName, uint iconCount, const QPixmap * originalPixmap ) +{ + const QPixmap *pix = originalPixmap ? originalPixmap : item->pixmap(0); + if (pix) + { + m_mapCurrentOpeningFolders.insert( item, AnimationInfo( iconBaseName, iconCount, *pix ) ); + if ( !m_animationTimer->isActive() ) + m_animationTimer->start( 50 ); + } +} + +void KonqSidebarTree::stopAnimation( KonqSidebarTreeItem * item ) +{ + MapCurrentOpeningFolders::Iterator it = m_mapCurrentOpeningFolders.find(item); + if ( it != m_mapCurrentOpeningFolders.end() ) + { + item->setPixmap( 0, it.data().originalPixmap ); + m_mapCurrentOpeningFolders.remove( item ); + + if (m_mapCurrentOpeningFolders.isEmpty()) + m_animationTimer->stop(); + } +} + +KonqSidebarTreeItem * KonqSidebarTree::currentItem() const +{ + return static_cast<KonqSidebarTreeItem *>( selectedItem() ); +} + +void KonqSidebarTree::setContentsPos( int x, int y ) +{ + if ( !m_scrollingLocked ) + KListView::setContentsPos( x, y ); +} + +void KonqSidebarTree::slotItemRenamed(QListViewItem* item, const QString &name, int col) +{ + Q_ASSERT(col==0); + if (col != 0) return; + assert(item); + KonqSidebarTreeItem * treeItem = static_cast<KonqSidebarTreeItem *>(item); + treeItem->rename( name ); +} + + +void KonqSidebarTree::enableActions( bool copy, bool cut, bool paste, + bool trash, bool del, bool rename) +{ + enableAction( "copy", copy ); + enableAction( "cut", cut ); + enableAction( "paste", paste ); + enableAction( "trash", trash ); + enableAction( "del", del ); + enableAction( "rename", rename ); +} + +bool KonqSidebarTree::tabSupport() +{ + // see if the newTab() dcop function is available (i.e. the sidebar is embedded into konqueror) + DCOPRef ref(kapp->dcopClient()->appId(), topLevelWidget()->name()); + DCOPReply reply = ref.call("functions()"); + if (reply.isValid()) { + QCStringList funcs; + reply.get(funcs, "QCStringList"); + for (QCStringList::ConstIterator it = funcs.begin(); it != funcs.end(); ++it) { + if ((*it) == "void newTab(QString url)") { + return true; + break; + } + } + } + return false; +} + +void KonqSidebarTree::showToplevelContextMenu() +{ + KonqSidebarTreeTopLevelItem *item = 0; + KonqSidebarTreeItem *treeItem = currentItem(); + if (treeItem && treeItem->isTopLevelItem()) + item = static_cast<KonqSidebarTreeTopLevelItem *>(treeItem); + + if (!m_collection) + { + m_collection = new KActionCollection( this, "bookmark actions" ); + (void) new KAction( i18n("&Create New Folder..."), "folder_new", 0, this, + SLOT( slotCreateFolder() ), m_collection, "create_folder"); + (void) new KAction( i18n("Delete Folder"), "editdelete", 0, this, + SLOT( slotDelete() ), m_collection, "delete_folder"); + (void) new KAction( i18n("Rename"), 0, this, + SLOT( slotRename() ), m_collection, "rename"); + (void) new KAction( i18n("Delete Link"), "editdelete", 0, this, + SLOT( slotDelete() ), m_collection, "delete_link"); + (void) new KAction( i18n("Properties"), "edit", 0, this, + SLOT( slotProperties() ), m_collection, "item_properties"); + (void) new KAction( i18n("Open in New Window"), "window_new", 0, this, + SLOT( slotOpenNewWindow() ), m_collection, "open_window"); + (void) new KAction( i18n("Open in New Tab"), "tab_new", 0, this, + SLOT( slotOpenTab() ), m_collection, "open_tab"); + (void) new KAction( i18n("Copy Link Address"), "editcopy", 0, this, + SLOT( slotCopyLocation() ), m_collection, "copy_location"); + } + + QPopupMenu *menu = new QPopupMenu; + + if (item) { + if (item->isTopLevelGroup()) { + m_collection->action("rename")->plug(menu); + m_collection->action("delete_folder")->plug(menu); + menu->insertSeparator(); + m_collection->action("create_folder")->plug(menu); + } else { + if (tabSupport()) + m_collection->action("open_tab")->plug(menu); + m_collection->action("open_window")->plug(menu); + m_collection->action("copy_location")->plug(menu); + menu->insertSeparator(); + m_collection->action("rename")->plug(menu); + m_collection->action("delete_link")->plug(menu); + } + menu->insertSeparator(); + m_collection->action("item_properties")->plug(menu); + } else { + m_collection->action("create_folder")->plug(menu); + } + + m_currentTopLevelItem = item; + + menu->exec( QCursor::pos() ); + delete menu; + + m_currentTopLevelItem = 0; +} + +void KonqSidebarTree::slotCreateFolder() +{ + QString path; + QString name = i18n("New Folder"); + + while(true) + { + name = KInputDialog::getText(i18n("Create New Folder"), + i18n("Enter folder name:"), name); + if (name.isEmpty()) + return; + + if (m_currentTopLevelItem) + path = m_currentTopLevelItem->path(); + else + path = m_dirtreeDir.dir.path(); + + if (!path.endsWith("/")) + path += "/"; + + path = path + name; + + if (!QFile::exists(path)) + break; + + name = name + "-2"; + } + + KGlobal::dirs()->makeDir(path); + + loadTopLevelGroup(m_currentTopLevelItem, path); +} + +void KonqSidebarTree::slotDelete() +{ + if (!m_currentTopLevelItem) return; + m_currentTopLevelItem->del(); +} + +void KonqSidebarTree::slotRename() +{ + if (!m_currentTopLevelItem) return; + m_currentTopLevelItem->rename(); +} + +void KonqSidebarTree::slotProperties() +{ + if (!m_currentTopLevelItem) return; + + KURL url; + url.setPath(m_currentTopLevelItem->path()); + + KPropertiesDialog *dlg = new KPropertiesDialog( url ); + dlg->setFileNameReadOnly(true); + dlg->exec(); + delete dlg; +} + +void KonqSidebarTree::slotOpenNewWindow() +{ + if (!m_currentTopLevelItem) return; + emit createNewWindow( m_currentTopLevelItem->externalURL() ); +} + +void KonqSidebarTree::slotOpenTab() +{ + if (!m_currentTopLevelItem) return; + DCOPRef ref(kapp->dcopClient()->appId(), topLevelWidget()->name()); + ref.call( "newTab(QString)", m_currentTopLevelItem->externalURL().url() ); +} + +void KonqSidebarTree::slotCopyLocation() +{ + if (!m_currentTopLevelItem) return; + KURL url = m_currentTopLevelItem->externalURL(); + kapp->clipboard()->setData( new KURLDrag(url, 0), QClipboard::Selection ); + kapp->clipboard()->setData( new KURLDrag(url, 0), QClipboard::Clipboard ); +} + +/////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// + + +void KonqSidebarTreeToolTip::maybeTip( const QPoint &point ) +{ + QListViewItem *item = m_view->itemAt( point ); + if ( item ) { + QString text = static_cast<KonqSidebarTreeItem*>( item )->toolTipText(); + if ( !text.isEmpty() ) + tip ( m_view->itemRect( item ), text ); + } +} + + + + +#include "konq_sidebartree.moc" diff --git a/konqueror/sidebar/trees/konq_sidebartree.h b/konqueror/sidebar/trees/konq_sidebartree.h new file mode 100644 index 000000000..cc2035466 --- /dev/null +++ b/konqueror/sidebar/trees/konq_sidebartree.h @@ -0,0 +1,225 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + 2000 Carsten Pfeiffer <pfeiffer@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef konq_tree_h +#define konq_tree_h + +#include <klistview.h> +#include "konq_sidebartreetoplevelitem.h" +#include "konqsidebar_tree.h" +#include <kdirnotify.h> +#include <qmap.h> +#include <qpoint.h> +#include <qstrlist.h> +#include <qtooltip.h> + +class KonqSidebarTreeModule; +class KonqSidebarTreeItem; +class KActionCollection; + +class QTimer; + +class KonqSidebarTree_Internal; + +#define VIRT_Link 0 +#define VIRT_Folder 1 // A directory which is parsed for .desktop files + +typedef KonqSidebarTreeModule*(*getModule)(KonqSidebarTree*, const bool); + +typedef struct DirTreeConfigData_ +{ + KURL dir; + int type; + QString relDir; +} DirTreeConfigData; + + +class KonqSidebarTreeToolTip : public QToolTip +{ +public: + KonqSidebarTreeToolTip( QListView *view ) : QToolTip( view->viewport() ), m_view( view ) {} + +protected: + virtual void maybeTip( const QPoint & ); + +private: + QListView *m_view; +}; + +typedef enum { + SidebarTreeMode, // used if the drop is accepted by a KonqSidebarTreeItem. otherwise + KListViewMode // use KListView's dnd implementation. accepts mime types set with setDropFormats() +} DropAcceptType; + +/** + * The multi-purpose tree (listview) + * It parses its configuration (desktop files), each one corresponding to + * a toplevel item, and creates the modules that will handle the contents + * of those items. + */ +class KonqSidebarTree : public KListView, public KDirNotify +{ + Q_OBJECT +public: + KonqSidebarTree( KonqSidebar_Tree *parent, QWidget *parentWidget, int virt, const QString& path ); + virtual ~KonqSidebarTree(); + + void followURL( const KURL &url ); + + /** + * @return the current (i.e. selected) item + */ + KonqSidebarTreeItem * currentItem() const; + + void startAnimation( KonqSidebarTreeItem * item, const char * iconBaseName = "kde", uint iconCount = 6, const QPixmap * originalPixmap = 0L ); + void stopAnimation( KonqSidebarTreeItem * item ); + + // Reimplemented from KDirNotify + void FilesAdded( const KURL & dir ); + void FilesRemoved( const KURL::List & urls ); + void FilesChanged( const KURL::List & urls ); + + KonqSidebarPlugin * part() { return m_part; } + + void lockScrolling( bool lock ) { m_scrollingLocked = lock; } + + bool isOpeningFirstChild() const { return m_bOpeningFirstChild; } + + void enableActions( bool copy, bool cut, bool paste, + bool trash, bool del, bool rename = false ); + + void itemDestructed( KonqSidebarTreeItem *item ); + + void setDropFormats( const QStringList &formats ); // used in KListView mode + + // Show context menu for toplevel items + void showToplevelContextMenu(); + + // Add an URL + void addURL(KonqSidebarTreeTopLevelItem* item, const KURL&url); + + // If we can use dcop to open tabs + bool tabSupport(); + +public slots: + virtual void setContentsPos( int x, int y ); + +protected: + virtual void contentsDragEnterEvent( QDragEnterEvent *e ); + virtual void contentsDragMoveEvent( QDragMoveEvent *e ); + virtual void contentsDragLeaveEvent( QDragLeaveEvent *e ); + virtual void contentsDropEvent( QDropEvent *ev ); + virtual bool acceptDrag(QDropEvent* e) const; // used in KListView mode + + virtual void leaveEvent( QEvent * ); + + virtual QDragObject* dragObject(); + +private slots: + void slotDoubleClicked( QListViewItem *item ); + void slotExecuted( QListViewItem *item ); + void slotMouseButtonPressed(int _button, QListViewItem* _item, const QPoint&, int col); + void slotMouseButtonClicked(int _button, QListViewItem* _item, const QPoint&, int col); + void slotSelectionChanged(); + + void slotAnimation(); + + void slotAutoOpenFolder(); + + void rescanConfiguration(); + + void slotItemRenamed(QListViewItem*, const QString &, int); + + void slotCreateFolder(); + void slotDelete(); + void slotRename(); + void slotProperties(); + void slotOpenNewWindow(); + void slotOpenTab(); + void slotCopyLocation(); + +private: + void clearTree(); + void scanDir( KonqSidebarTreeItem *parent, const QString &path, bool isRoot = false ); + void loadTopLevelGroup( KonqSidebarTreeItem *parent, const QString &path ); + void loadTopLevelItem( KonqSidebarTreeItem *parent, const QString &filename ); + + void loadModuleFactories(); + + +private: + QPtrList<KonqSidebarTreeTopLevelItem> m_topLevelItems; + KonqSidebarTreeTopLevelItem *m_currentTopLevelItem; + + QPtrList<KonqSidebarTreeModule> m_lstModules; + + KonqSidebarPlugin *m_part; + + struct AnimationInfo + { + AnimationInfo( const char * _iconBaseName, uint _iconCount, const QPixmap & _originalPixmap ) + : iconBaseName(_iconBaseName), iconCount(_iconCount), iconNumber(1), originalPixmap(_originalPixmap) {} + AnimationInfo() : iconCount(0) {} + QCString iconBaseName; + uint iconCount; + uint iconNumber; + QPixmap originalPixmap; + }; + typedef QMap<KonqSidebarTreeItem *, AnimationInfo> MapCurrentOpeningFolders; + MapCurrentOpeningFolders m_mapCurrentOpeningFolders; + + QTimer *m_animationTimer; + + QListViewItem *m_currentBeforeDropItem; // The item that was current before the drag-enter event happened + QListViewItem *m_dropItem; // The item we are moving the mouse over (during a drag) + QStrList m_lstDropFormats; + + QTimer *m_autoOpenTimer; + + // The base URL for our configuration directory + //KURL m_dirtreeDir; + DirTreeConfigData m_dirtreeDir; + + KonqSidebarTreeToolTip m_toolTip; + bool m_scrollingLocked; + + getModule getPluginFactory(QString name); + + QMap<QString, QString> pluginInfo; + QMap<QString, getModule> pluginFactories; + + bool m_bOpeningFirstChild; + KActionCollection *m_collection; + + KonqSidebarTree_Internal *d; + +#undef signals +#define signals public +signals: +#undef signals +#define signals protected + void openURLRequest( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); + void createNewWindow( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); + void popupMenu( const QPoint &global, const KURL &url, + const QString &mimeType, mode_t mode = (mode_t)-1 ); + void popupMenu( const QPoint &global, const KFileItemList &items ); + void enableAction( const char * name, bool enabled ); +}; + +#endif diff --git a/konqueror/sidebar/trees/konq_sidebartreeitem.cpp b/konqueror/sidebar/trees/konq_sidebartreeitem.cpp new file mode 100644 index 000000000..daa0ae777 --- /dev/null +++ b/konqueror/sidebar/trees/konq_sidebartreeitem.cpp @@ -0,0 +1,65 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + Copyright (C) 2003 Waldo Bastian <bastian@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include "konq_sidebartree.h" +//#include "konq_sidebartreepart.h" + +KonqSidebarTreeItem::KonqSidebarTreeItem( KonqSidebarTreeItem *parentItem, KonqSidebarTreeTopLevelItem *topLevelItem ) + : QListViewItem( parentItem ) +{ + initItem( topLevelItem ); +} + +KonqSidebarTreeItem::KonqSidebarTreeItem( KonqSidebarTree *parent, KonqSidebarTreeTopLevelItem *topLevelItem ) + : QListViewItem( parent ) +{ + initItem( topLevelItem ); +} + +KonqSidebarTreeItem::~KonqSidebarTreeItem() +{ + KonqSidebarTree *t = tree(); + if (t) + t->itemDestructed(this); +} + +void KonqSidebarTreeItem::initItem( KonqSidebarTreeTopLevelItem *topLevelItem ) +{ + m_topLevelItem = topLevelItem; + m_bListable = true; + m_bClickable = true; + + setExpandable( true ); +} + +void KonqSidebarTreeItem::middleButtonClicked() +{ + emit tree()->createNewWindow( externalURL() ); +} + +KonqSidebarTreeModule * KonqSidebarTreeItem::module() const +{ + return m_topLevelItem->module(); +} + +KonqSidebarTree * KonqSidebarTreeItem::tree() const +{ + return static_cast<KonqSidebarTree *>(listView()); +} diff --git a/konqueror/sidebar/trees/konq_sidebartreeitem.h b/konqueror/sidebar/trees/konq_sidebartreeitem.h new file mode 100644 index 000000000..ef6f73931 --- /dev/null +++ b/konqueror/sidebar/trees/konq_sidebartreeitem.h @@ -0,0 +1,116 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + Copyright (C) 2003 Waldo Bastian <bastian@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef konq_treeitem_h +#define konq_treeitem_h + +#include <qlistview.h> +#include <qstringlist.h> +#include <kurl.h> + +class QPainter; +class QDragObject; +class QStrList; +class KonqSidebarTree; +class KonqSidebarTreeItem; +class KonqSidebarTreeModule; +class KonqSidebarTreeTopLevelItem; + +/** + * The base class for any item in the tree. + * Items belonging to a given module are created and managed by the module, + * but they should all be KonqSidebarTreeItems, for the event handling in KonqSidebarTree. + */ +class KonqSidebarTreeItem : public QListViewItem +{ +public: + // Create an item under another one + KonqSidebarTreeItem( KonqSidebarTreeItem *parentItem, KonqSidebarTreeTopLevelItem *topLevelItem ); + + void initItem( KonqSidebarTreeTopLevelItem *topLevelItem ); + + virtual ~KonqSidebarTreeItem(); + + // Whether the item accepts a drop consisting in those @p formats + virtual bool acceptsDrops( const QStrList & ) { return false; } + + // Handle a drop on this item. If you didn't want it, you shouln't + // have return true in acceptsDrops :) + virtual void drop( QDropEvent * ) {} + + // Create a drag object from this item. + virtual QDragObject * dragObject( QWidget * parent, bool move = false ) = 0; + + virtual void middleButtonClicked(); + virtual void rightButtonPressed() = 0; + + virtual void paste() {} + virtual void trash() {} + virtual void del() {} + virtual void shred() {} + virtual void rename() {} + virtual void rename( const QString& ) {} + + // The URL to open when this link is clicked + virtual KURL externalURL() const = 0; + + // The mimetype to use when this link is clicked + // If unknown, return QString::null, konq will determine the mimetype itself + virtual QString externalMimeType() const { return QString::null; } + + // overwrite this if you want a tooltip shown on your item + virtual QString toolTipText() const { return QString::null; } + + // Called when this item is selected + // Reimplement, and call tree()->part()->extension()->enableActions(...) + virtual void itemSelected() = 0; + + // Basically, true for directories and toplevel items + void setListable( bool b ) { m_bListable = b; } + bool isListable() const { return m_bListable; } + + // Whether clicking on the item should open the "external URL" of the item + void setClickable( bool b ) { m_bClickable = b; } + bool isClickable() const { return m_bClickable; } + + // Whether the item is a toplevel item + virtual bool isTopLevelItem() const { return false; } + + KonqSidebarTreeTopLevelItem * topLevelItem() const { return m_topLevelItem; } + + // returns the module associated to our toplevel item + KonqSidebarTreeModule * module() const; + + // returns the tree inside which this item is + KonqSidebarTree *tree() const; + + virtual QString key( int column, bool ) const { return text( column ).lower(); } + + // List of alternative names (URLs) this entry is known under + QStringList alias; +protected: + // Create an item at the toplevel - only for toplevel items -> protected + KonqSidebarTreeItem( KonqSidebarTree *parent, KonqSidebarTreeTopLevelItem *topLevelItem ); + + KonqSidebarTreeTopLevelItem *m_topLevelItem; + bool m_bListable:1; + bool m_bClickable:1; +}; + +#endif diff --git a/konqueror/sidebar/trees/konq_sidebartreemodule.h b/konqueror/sidebar/trees/konq_sidebartreemodule.h new file mode 100644 index 000000000..9f9863311 --- /dev/null +++ b/konqueror/sidebar/trees/konq_sidebartreemodule.h @@ -0,0 +1,65 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef konq_treemodule_h +#define konq_treemodule_h + +#include <qobject.h> +#include "konq_sidebartree.h" +class QDragObject; +class KonqSidebarTreeItem; +class KonqSidebarTreeTopLevelItem; +class KonqSidebarTree; + +/** + * The base class for KonqSidebarTree Modules. It defines the interface + * between the generic KonqSidebarTree and the particular modules + * (directory tree, history, bookmarks, ...) + */ +class KonqSidebarTreeModule +{ +public: + KonqSidebarTreeModule( KonqSidebarTree * parentTree , bool showHidden=false) + : m_pTree( parentTree ), m_showHidden(showHidden) {} + virtual ~KonqSidebarTreeModule() {} + + // Handle this new toplevel item [can only be called once currently] + virtual void addTopLevelItem( KonqSidebarTreeTopLevelItem * item ) = 0; + + // Open this toplevel item - you don't need to reimplement if + // you create the item's children right away + virtual void openTopLevelItem( KonqSidebarTreeTopLevelItem * ) {} + + // Follow a URL opened in another view - only implement if the module + // has anything to do with URLs + virtual void followURL( const KURL & ) {} + + KonqSidebarTree *tree() const { return m_pTree; } + bool showHidden() { return m_showHidden;} + virtual void setShowHidden(bool showhidden) {m_showHidden=showhidden;} + + virtual bool handleTopLevelContextMenu( KonqSidebarTreeTopLevelItem *, const QPoint& ) { return false; } + +protected: + KonqSidebarTree * m_pTree; + bool m_showHidden; +}; + + + +#endif diff --git a/konqueror/sidebar/trees/konq_sidebartreetoplevelitem.cpp b/konqueror/sidebar/trees/konq_sidebartreetoplevelitem.cpp new file mode 100644 index 000000000..d71959c1e --- /dev/null +++ b/konqueror/sidebar/trees/konq_sidebartreetoplevelitem.cpp @@ -0,0 +1,208 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +//#include "konq_treepart.h" +#include "konq_sidebartreemodule.h" +#include <kdebug.h> +#include <kdirnotify_stub.h> +#include <kio/paste.h> +#include <konq_operations.h> +#include <kprotocolinfo.h> +#include <kurldrag.h> +#include <kmimetype.h> +#include <qapplication.h> +#include <qclipboard.h> +#include <qcursor.h> +#include <konq_drag.h> + +void KonqSidebarTreeTopLevelItem::init() +{ + QString desktopFile = m_path; + if ( isTopLevelGroup() ) + desktopFile += "/.directory"; + KSimpleConfig cfg( desktopFile, true ); + cfg.setDesktopGroup(); + m_comment = cfg.readEntry( "Comment" ); +} + +void KonqSidebarTreeTopLevelItem::setOpen( bool open ) +{ + if (open && module()) + module()->openTopLevelItem( this ); + KonqSidebarTreeItem::setOpen( open ); +} + +void KonqSidebarTreeTopLevelItem::itemSelected() +{ + kdDebug() << "KonqSidebarTreeTopLevelItem::itemSelected" << endl; + QMimeSource *data = QApplication::clipboard()->data(); + bool paste = m_bTopLevelGroup && data->provides("text/uri-list"); + tree()->enableActions( true, true, paste, true, true, true /*rename*/ ); +} + +bool KonqSidebarTreeTopLevelItem::acceptsDrops( const QStrList & formats ) +{ + return formats.contains("text/uri-list") && + ( m_bTopLevelGroup || !externalURL().isEmpty() ); +} + +void KonqSidebarTreeTopLevelItem::drop( QDropEvent * ev ) +{ + if ( m_bTopLevelGroup ) + { + // When dropping something to "Network" or its subdirs, we want to create + // a desktop link, not to move/copy/link - except for .desktop files :-} + KURL::List lst; + if ( KURLDrag::decode( ev, lst ) && !lst.isEmpty() ) // Are they urls ? + { + KURL::List::Iterator it = lst.begin(); + for ( ; it != lst.end() ; it++ ) + { + tree()->addURL(this, *it); + } + } else + kdError(1202) << "No URL !? " << endl; + } + else // Top level item, not group + { + if ( !externalURL().isEmpty() ) + KonqOperations::doDrop( 0L, externalURL(), ev, tree() ); + } +} + +QDragObject * KonqSidebarTreeTopLevelItem::dragObject( QWidget * parent, bool move ) +{ + // 100% duplicated from KonqDirTreeItem::dragObject :( + KURL::List lst; + KURL url; + url.setPath( path() ); + lst.append( url ); + + KonqDrag * drag = KonqDrag::newDrag( lst, false, parent ); + + const QPixmap * pix = pixmap(0); + if (pix) + { + QPoint hotspot( pix->width() / 2, pix->height() / 2 ); + drag->setPixmap( *pix, hotspot ); + } + drag->setMoveSelection( move ); + + return drag; +} + +void KonqSidebarTreeTopLevelItem::middleButtonClicked() +{ + if ( !m_bTopLevelGroup ) + emit tree()->createNewWindow( m_externalURL ); + // Do nothing for toplevel groups +} + +void KonqSidebarTreeTopLevelItem::rightButtonPressed() +{ + KURL url; + url.setPath( m_path ); + // We don't show "edit file type" (useless here) and "properties" (shows the wrong name, + // i.e. the filename instead of the Name field). There's the Rename item for that. + // Only missing thing is changing the URL of a link. Hmm... + + if ( !module() || !module()->handleTopLevelContextMenu( this, QCursor::pos() ) ) + { + tree()->showToplevelContextMenu(); + } +} + + +void KonqSidebarTreeTopLevelItem::trash() +{ + delOperation( KonqOperations::TRASH ); +} + +void KonqSidebarTreeTopLevelItem::del() +{ + delOperation( KonqOperations::DEL ); +} + +void KonqSidebarTreeTopLevelItem::shred() +{ + delOperation( KonqOperations::SHRED ); +} + +void KonqSidebarTreeTopLevelItem::delOperation( int method ) +{ + KURL url; + url.setPath( m_path ); + KURL::List lst; + lst.append(url); + + KonqOperations::del(tree(), method, lst); +} + +void KonqSidebarTreeTopLevelItem::paste() +{ + // move or not move ? + bool move = false; + QMimeSource *data = QApplication::clipboard()->data(); + if ( data->provides( "application/x-kde-cutselection" ) ) { + move = KonqDrag::decodeIsCutSelection( data ); + kdDebug(1201) << "move (from clipboard data) = " << move << endl; + } + + KURL destURL; + if ( m_bTopLevelGroup ) + destURL.setPath( m_path ); + else + destURL = m_externalURL; + + KIO::pasteClipboard( destURL, move ); +} + +void KonqSidebarTreeTopLevelItem::rename() +{ + tree()->rename( this, 0 ); +} + +void KonqSidebarTreeTopLevelItem::rename( const QString & name ) +{ + KURL url; + url.setPath( m_path ); + + // Well, it's not really the file we want to rename, it's the Name field + // of the .directory or desktop file + //KonqOperations::rename( tree(), url, name ); + + QString desktopFile = m_path; + if ( isTopLevelGroup() ) + desktopFile += "/.directory"; + KSimpleConfig cfg( desktopFile ); + cfg.setDesktopGroup(); + cfg.writeEntry( "Name", name ); + cfg.sync(); + + // Notify about the change + KURL::List lst; + lst.append(url); + KDirNotify_stub allDirNotify("*", "KDirNotify*"); + allDirNotify.FilesChanged( lst ); +} + +QString KonqSidebarTreeTopLevelItem::toolTipText() const +{ + return m_comment; +} + diff --git a/konqueror/sidebar/trees/konq_sidebartreetoplevelitem.h b/konqueror/sidebar/trees/konq_sidebartreetoplevelitem.h new file mode 100644 index 000000000..fc67e274e --- /dev/null +++ b/konqueror/sidebar/trees/konq_sidebartreetoplevelitem.h @@ -0,0 +1,101 @@ +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef konq_treetoplevelitem_h +#define konq_treetoplevelitem_h + +#include "konq_sidebartreeitem.h" + +class QStrList; +class KonqSidebarTreeModule; + +/** + * Each toplevel item (created from a desktop file) + * points to the module that handles it + --> this doesn't prevent the same module from handling multiple toplevel items, + but we don't do that currently. + */ +class KonqSidebarTreeTopLevelItem : public KonqSidebarTreeItem +{ +public: + /** + * Create a toplevel toplevel-item :) + * @param module the module handling this toplevel item + * @param path the path to the desktop file that was the reason for creating this item + */ + KonqSidebarTreeTopLevelItem( KonqSidebarTree *parent, KonqSidebarTreeModule * module, const QString & path ) + : KonqSidebarTreeItem(parent, 0L), m_module(module), m_path(path), m_bTopLevelGroup(false) { init(); } + + /** + * Create a toplevel-item under a toplevel group + * @param module the module handling this toplevel item + * @param path the path to the desktop file that was the reason for creating this item + */ + KonqSidebarTreeTopLevelItem( KonqSidebarTreeItem *parentItem, KonqSidebarTreeModule * module, const QString & path ) + : KonqSidebarTreeItem( parentItem, 0L), m_module(module), m_path(path), m_bTopLevelGroup(false) { init(); } + + void init(); + + virtual bool acceptsDrops( const QStrList & formats ); + virtual void drop( QDropEvent * ev ); + virtual QDragObject * dragObject( QWidget * parent, bool move = false ); + virtual void middleButtonClicked(); + virtual void rightButtonPressed(); + + virtual void paste(); + virtual void trash(); + virtual void del(); + virtual void shred(); + virtual void rename(); // start a rename operation + virtual void rename( const QString & name ); // do the actual renaming + + virtual void setOpen( bool open ); + + // Whether the item is a toplevel item - true + virtual bool isTopLevelItem() const { return true; } + + virtual KURL externalURL() const { return m_externalURL; } + + virtual QString toolTipText() const; + + virtual void itemSelected(); + + // The module should call this for each toplevel item that is passed to it + // unless it calls setClickable(false) + void setExternalURL( const KURL & url ) { m_externalURL = url; } + + // Whether the item is a toplevel group. [Only matters for dnd] + void setTopLevelGroup( bool b ) { m_bTopLevelGroup = b; } + bool isTopLevelGroup() const { return m_bTopLevelGroup; } + + // The module that handles the subtree below this toplevel item + KonqSidebarTreeModule *module() const { return m_module; } + + // The path to the desktop file responsible for this toplevel item + QString path() const { return m_path; } + +protected: + void delOperation( int method ); + KonqSidebarTreeModule *m_module; + QString m_path; + QString m_comment; + KURL m_externalURL; + bool m_bTopLevelGroup; +}; + +#endif diff --git a/konqueror/sidebar/trees/konqsidebar_tree.cpp b/konqueror/sidebar/trees/konqsidebar_tree.cpp new file mode 100644 index 000000000..9b53f195d --- /dev/null +++ b/konqueror/sidebar/trees/konqsidebar_tree.cpp @@ -0,0 +1,167 @@ +#include "konqsidebar_tree.h" +#include "konqsidebar_tree.moc" +#include "konq_sidebartree.h" +#include <kdebug.h> +#include <kstandarddirs.h> +#include <ksimpleconfig.h> +#include <kinputdialog.h> +#include <kiconloader.h> +#include <klistviewsearchline.h> + +#include <qclipboard.h> +#include <qdragobject.h> +#include <qtoolbutton.h> +#include <qvbox.h> + +KonqSidebar_Tree::KonqSidebar_Tree(KInstance *instance,QObject *parent,QWidget *widgetParent, QString &desktopName_, const char* name): + KonqSidebarPlugin(instance,parent,widgetParent,desktopName_,name) + { + KSimpleConfig ksc(desktopName_); + ksc.setGroup("Desktop Entry"); + int virt= ( (ksc.readEntry("X-KDE-TreeModule","")=="Virtual") ?VIRT_Folder:VIRT_Link); + if (virt==1) desktopName_=ksc.readEntry("X-KDE-RelURL",""); + + widget = new QVBox(widgetParent); + + if (ksc.readBoolEntry("X-KDE-SearchableTreeModule",false)) { + QHBox* searchline = new QHBox(widget); + searchline->setSpacing(KDialog::spacingHint()); + tree=new KonqSidebarTree(this,widget,virt,desktopName_); + QToolButton *clearSearch = new QToolButton(searchline); + clearSearch->setTextLabel(i18n("Clear Search"), true); + clearSearch->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left" : "locationbar_erase")); + QLabel* slbl = new QLabel(i18n("Se&arch:"), searchline); + KListViewSearchLine* listViewSearch = new KListViewSearchLine(searchline,tree); + slbl->setBuddy(listViewSearch); + connect(clearSearch, SIGNAL(pressed()), listViewSearch, SLOT(clear())); + } + else + tree=new KonqSidebarTree(this,widget,virt,desktopName_); + + connect(tree, SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs &)), + this,SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs &))); + + connect(tree,SIGNAL(createNewWindow( const KURL &, const KParts::URLArgs &)), + this,SIGNAL(createNewWindow( const KURL &, const KParts::URLArgs &))); + + connect(tree,SIGNAL(popupMenu( const QPoint &, const KURL &, const QString &, mode_t )), + this,SIGNAL(popupMenu( const QPoint &, const KURL &, const QString &, mode_t ))); + + connect(tree,SIGNAL(popupMenu( const QPoint &, const KFileItemList & )), + this,SIGNAL(popupMenu( const QPoint &, const KFileItemList & ))); + + connect(tree,SIGNAL(enableAction( const char *, bool )), + this,SIGNAL(enableAction( const char *, bool))); + + } + + +KonqSidebar_Tree::~KonqSidebar_Tree(){;} + +void* KonqSidebar_Tree::provides(const QString &) {return 0;} + +//void KonqSidebar_Tree::emitStatusBarText (const QString &) {;} + +QWidget *KonqSidebar_Tree::getWidget(){return widget;} + +void KonqSidebar_Tree::handleURL(const KURL &url) + { + emit started( 0 ); + tree->followURL( url ); + emit completed(); + } + +void KonqSidebar_Tree::cut() +{ + QDragObject * drag = static_cast<KonqSidebarTreeItem*>(tree->selectedItem())->dragObject( 0L, true ); + if (drag) + QApplication::clipboard()->setData( drag ); +} + +void KonqSidebar_Tree::copy() +{ + QDragObject * drag = static_cast<KonqSidebarTreeItem*>(tree->selectedItem())->dragObject( 0L ); + if (drag) + QApplication::clipboard()->setData( drag ); +} + +void KonqSidebar_Tree::paste() +{ + if (tree->currentItem()) + tree->currentItem()->paste(); +} + +void KonqSidebar_Tree::trash() +{ + if (tree->currentItem()) + tree->currentItem()->trash(); +} + +void KonqSidebar_Tree::del() +{ + if (tree->currentItem()) + tree->currentItem()->del(); +} + +void KonqSidebar_Tree::shred() +{ + if (tree->currentItem()) + tree->currentItem()->shred(); +} + +void KonqSidebar_Tree::rename() +{ + Q_ASSERT( tree->currentItem() ); + if (tree->currentItem()) + tree->currentItem()->rename(); +} + + + + + + +extern "C" +{ + KDE_EXPORT void* create_konqsidebar_tree(KInstance *inst,QObject *par,QWidget *widp,QString &desktopname,const char *name) + { + return new KonqSidebar_Tree(inst,par,widp,desktopname,name); + } +} + +extern "C" +{ + KDE_EXPORT bool add_konqsidebar_tree(QString* fn, QString*, QMap<QString,QString> *map) + { + KStandardDirs *dirs=KGlobal::dirs(); + QStringList list=dirs->findAllResources("data","konqsidebartng/dirtree/*.desktop",false,true); + QStringList names; + for (QStringList::ConstIterator it=list.begin();it!=list.end();++it) + { + KSimpleConfig sc(*it); + sc.setGroup("Desktop Entry"); + names<<sc.readEntry("Name"); + } + + QString item = KInputDialog::getItem( i18n( "Select Type" ), + i18n( "Select type:" ), names ); + if (!item.isEmpty()) + { + int id=names.findIndex( item ); + if (id==-1) return false; + KSimpleConfig ksc2(*list.at(id)); + ksc2.setGroup("Desktop Entry"); + map->insert("Type","Link"); + map->insert("Icon",ksc2.readEntry("Icon")); + map->insert("Name",ksc2.readEntry("Name")); + map->insert("Open","false"); + map->insert("URL",ksc2.readEntry("X-KDE-Default-URL")); + map->insert("X-KDE-KonqSidebarModule","konqsidebar_tree"); + map->insert("X-KDE-TreeModule",ksc2.readEntry("X-KDE-TreeModule")); + map->insert("X-KDE-TreeModule-ShowHidden",ksc2.readEntry("X-KDE-TreeModule-ShowHidden")); + fn->setLatin1("dirtree%1.desktop"); + return true; + } + return false; + } +} diff --git a/konqueror/sidebar/trees/konqsidebar_tree.h b/konqueror/sidebar/trees/konqsidebar_tree.h new file mode 100644 index 000000000..968a59585 --- /dev/null +++ b/konqueror/sidebar/trees/konqsidebar_tree.h @@ -0,0 +1,47 @@ +#ifndef _konq_sidebar_test_h_ +#define _konq_sidebar_test_h_ +#include <konqsidebarplugin.h> +#include <qlabel.h> +#include <qlayout.h> +#include <kparts/part.h> +#include <kparts/factory.h> +#include <kparts/browserextension.h> +#include <kdialogbase.h> +#include <qcombobox.h> +#include <qstringlist.h> +#include <klocale.h> +#include <qlineedit.h> +class KonqSidebarTree; +class QVBox; + +class KonqSidebar_Tree: public KonqSidebarPlugin + { + Q_OBJECT + public: + KonqSidebar_Tree(KInstance *instance,QObject *parent,QWidget *widgetParent, QString &desktopName_, const char* name=0); + ~KonqSidebar_Tree(); + virtual void *provides(const QString &); +// void emitStatusBarText (const QString &); + virtual QWidget *getWidget(); + protected: + class QVBox *widget; + class KonqSidebarTree *tree; + virtual void handleURL(const KURL &url); + protected slots: + void copy(); + void cut(); + void paste(); + void trash(); + void del(); + void shred(); + void rename(); +signals: + void openURLRequest( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); + void createNewWindow( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); + void popupMenu( const QPoint &global, const KURL &url, + const QString &mimeType, mode_t mode = (mode_t)-1 ); + void popupMenu( const QPoint &global, const KFileItemList &items ); + void enableAction( const char * name, bool enabled ); + }; + +#endif diff --git a/konqueror/sidebar/web_module/Makefile.am b/konqueror/sidebar/web_module/Makefile.am new file mode 100644 index 000000000..64675d351 --- /dev/null +++ b/konqueror/sidebar/web_module/Makefile.am @@ -0,0 +1,19 @@ +INCLUDES = -I$(srcdir)/../ -I$(srcdir)/../../../libkonq $(all_includes) + +kde_module_LTLIBRARIES = konqsidebar_web.la + +METASOURCES = AUTO + +konqsidebar_web_la_SOURCES = web_module.cpp +konqsidebar_web_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +konqsidebar_web_la_LIBADD = $(LIB_KPARTS) $(LIB_KHTML) ../libkonqsidebarplugin.la ../../../libkonq/libkonq.la + +#plugindir=$(kde_datadir)/konqsidebartng/entries +#plugin_DATA=websidebar.desktop + +pluginadddir=$(kde_datadir)/konqsidebartng/add +pluginadd_DATA=webmodule_add.desktop + +htmldir=$(kde_datadir)/konqsidebartng/websidebar +html_DATA=websidebar.html + diff --git a/konqueror/sidebar/web_module/TODO b/konqueror/sidebar/web_module/TODO new file mode 100644 index 000000000..abf3260f9 --- /dev/null +++ b/konqueror/sidebar/web_module/TODO @@ -0,0 +1,6 @@ +- Apparently _content works everywhere in Mozilla. Maybe this should go into +KHTMLPart afterall. That would solve the form post problem too. +- Forms don't work. I don't know if they will for a long time since we can't + really filter them with KHTML. +- Allow setting the useragent (only do this in a clean fashion!!) +- Double check the KHTML extensions for security implications. diff --git a/konqueror/sidebar/web_module/web_module.cpp b/konqueror/sidebar/web_module/web_module.cpp new file mode 100644 index 000000000..ab77c40a0 --- /dev/null +++ b/konqueror/sidebar/web_module/web_module.cpp @@ -0,0 +1,220 @@ +/* This file is part of the KDE project + Copyright (C) 2003, George Staikos <staikos@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "web_module.h" +#include <qfileinfo.h> +#include <qhbox.h> +#include <qspinbox.h> +#include <qtimer.h> + +#include <dom/html_inline.h> +#include <kdebug.h> +#include <kdialog.h> +#include <kglobal.h> +#include <klocale.h> +#include <konq_pixmapprovider.h> +#include <kparts/browserextension.h> +#include <kstandarddirs.h> + + +KonqSideBarWebModule::KonqSideBarWebModule(KInstance *instance, QObject *parent, QWidget *widgetParent, QString &desktopName, const char* name) + : KonqSidebarPlugin(instance, parent, widgetParent, desktopName, name) +{ + _htmlPart = new KHTMLSideBar(universalMode()); + connect(_htmlPart, SIGNAL(reload()), this, SLOT(reload())); + connect(_htmlPart, SIGNAL(completed()), this, SLOT(pageLoaded())); + connect(_htmlPart, + SIGNAL(setWindowCaption(const QString&)), + this, + SLOT(setTitle(const QString&))); + connect(_htmlPart, + SIGNAL(openURLRequest(const QString&, KParts::URLArgs)), + this, + SLOT(urlClicked(const QString&, KParts::URLArgs))); + connect(_htmlPart->browserExtension(), + SIGNAL(openURLRequest(const KURL&, const KParts::URLArgs&)), + this, + SLOT(formClicked(const KURL&, const KParts::URLArgs&))); + connect(_htmlPart, + SIGNAL(setAutoReload()), this, SLOT( setAutoReload() )); + connect(_htmlPart, + SIGNAL(openURLNewWindow(const QString&, KParts::URLArgs)), + this, + SLOT(urlNewWindow(const QString&, KParts::URLArgs))); + connect(_htmlPart, + SIGNAL(submitFormRequest(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&)), + this, + SIGNAL(submitFormRequest(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&))); + + _desktopName = desktopName; + + KSimpleConfig ksc(_desktopName); + ksc.setGroup("Desktop Entry"); + reloadTimeout = ksc.readNumEntry("Reload", 0); + _url = ksc.readPathEntry("URL"); + _htmlPart->openURL(_url ); + // Must load this delayed + QTimer::singleShot(0, this, SLOT(loadFavicon())); +} + + +KonqSideBarWebModule::~KonqSideBarWebModule() { + delete _htmlPart; + _htmlPart = 0L; +} + + +QWidget *KonqSideBarWebModule::getWidget() { + return _htmlPart->widget(); +} + +void KonqSideBarWebModule::setAutoReload(){ + KDialogBase dlg(0, "", true, i18n("Set Refresh Timeout (0 disables)"), + KDialogBase::Ok|KDialogBase::Cancel); + QHBox *hbox = dlg.makeHBoxMainWidget(); + + QSpinBox *mins = new QSpinBox( 0, 120, 1, hbox ); + mins->setSuffix( i18n(" min") ); + QSpinBox *secs = new QSpinBox( 0, 59, 1, hbox ); + secs->setSuffix( i18n(" sec") ); + + if( reloadTimeout > 0 ) { + int seconds = reloadTimeout / 1000; + secs->setValue( seconds % 60 ); + mins->setValue( ( seconds - secs->value() ) / 60 ); + } + + if( dlg.exec() == QDialog::Accepted ) { + int msec = ( mins->value() * 60 + secs->value() ) * 1000; + reloadTimeout = msec; + KSimpleConfig ksc(_desktopName); + ksc.setGroup("Desktop Entry"); + ksc.writeEntry("Reload", reloadTimeout); + reload(); + } +} + +void *KonqSideBarWebModule::provides(const QString &) { + return 0L; +} + + +void KonqSideBarWebModule::handleURL(const KURL &) { +} + + +void KonqSideBarWebModule::urlNewWindow(const QString& url, KParts::URLArgs args) +{ + emit createNewWindow(KURL(url), args); +} + + +void KonqSideBarWebModule::urlClicked(const QString& url, KParts::URLArgs args) +{ + emit openURLRequest(KURL(url), args); +} + + +void KonqSideBarWebModule::formClicked(const KURL& url, const KParts::URLArgs& args) +{ + _htmlPart->browserExtension()->setURLArgs(args); + _htmlPart->openURL(url); +} + + +void KonqSideBarWebModule::loadFavicon() { + QString icon = KonqPixmapProvider::iconForURL(_url.url()); + if (icon.isEmpty()) { + KonqFavIconMgr::downloadHostIcon(_url); + icon = KonqPixmapProvider::iconForURL(_url.url()); + } + + if (!icon.isEmpty()) { + emit setIcon(icon); + + KSimpleConfig ksc(_desktopName); + ksc.setGroup("Desktop Entry"); + if (icon != ksc.readPathEntry("Icon")) { + ksc.writePathEntry("Icon", icon); + } + } +} + + +void KonqSideBarWebModule::reload() { + _htmlPart->openURL(_url); +} + + +void KonqSideBarWebModule::setTitle(const QString& title) { + if (!title.isEmpty()) { + emit setCaption(title); + + KSimpleConfig ksc(_desktopName); + ksc.setGroup("Desktop Entry"); + if (title != ksc.readPathEntry("Name")) { + ksc.writePathEntry("Name", title); + } + } +} + + +void KonqSideBarWebModule::pageLoaded() { + if( reloadTimeout > 0 ) { + QTimer::singleShot( reloadTimeout, this, SLOT( reload() ) ); + } +} + + +extern "C" { + KDE_EXPORT KonqSidebarPlugin* create_konqsidebar_web(KInstance *instance, QObject *parent, QWidget *widget, QString &desktopName, const char *name) { + return new KonqSideBarWebModule(instance, parent, widget, desktopName, name); + } +} + + +extern "C" { + KDE_EXPORT bool add_konqsidebar_web(QString* fn, QString* param, QMap<QString,QString> *map) { + Q_UNUSED(param); + KGlobal::dirs()->addResourceType("websidebardata", KStandardDirs::kde_default("data") + "konqsidebartng/websidebar"); + KURL url; + url.setProtocol("file"); + QStringList paths = KGlobal::dirs()->resourceDirs("websidebardata"); + for (QStringList::Iterator i = paths.begin(); i != paths.end(); ++i) { + if (QFileInfo(*i + "websidebar.html").exists()) { + url.setPath(*i + "websidebar.html"); + break; + } + } + + if (url.path().isEmpty()) + return false; + map->insert("Type", "Link"); + map->insert("URL", url.url()); + map->insert("Icon", "netscape"); + map->insert("Name", i18n("Web SideBar Plugin")); + map->insert("Open", "true"); + map->insert("X-KDE-KonqSidebarModule","konqsidebar_web"); + fn->setLatin1("websidebarplugin%1.desktop"); + return true; + } +} + + +#include "web_module.moc" + diff --git a/konqueror/sidebar/web_module/web_module.h b/konqueror/sidebar/web_module/web_module.h new file mode 100644 index 000000000..58650b309 --- /dev/null +++ b/konqueror/sidebar/web_module/web_module.h @@ -0,0 +1,202 @@ +/* This file is part of the KDE project + Copyright (C) 2003 George Staikos <staikos@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef web_module_h +#define web_module_h + +#include <assert.h> +#include <khtml_part.h> +#include <kiconloader.h> +#include <klocale.h> +#include <konqsidebarplugin.h> +#include <kpopupmenu.h> +#include <qobject.h> + + +// A wrapper for KHTMLPart to make it behave the way we want it to. +class KHTMLSideBar : public KHTMLPart +{ + Q_OBJECT + public: + KHTMLSideBar(bool universal) : KHTMLPart() { + setStatusMessagesEnabled(false); + setMetaRefreshEnabled(true); + setJavaEnabled(false); + setPluginsEnabled(false); + + setFormNotification(KHTMLPart::Only); + connect(this, + SIGNAL(formSubmitNotification(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&)), + this, + SLOT(formProxy(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&)) + ); + + + _linkMenu = new KPopupMenu(widget(), + "link context menu"); + if (!universal) { + _linkMenu->insertItem(i18n("&Open Link"), + this, SLOT(loadPage())); + _linkMenu->insertItem(i18n("Open in New &Window"), + this, SLOT(loadNewWindow())); + } else { + _linkMenu->insertItem(i18n("Open in New &Window"), + this, SLOT(loadPage())); + } + _menu = new KPopupMenu(widget(), "context menu"); + _menu->insertItem(SmallIcon("reload"), i18n("&Reload"), + this, SIGNAL(reload())); + _menu->insertItem(SmallIcon("reload"), i18n("Set &Automatic Reload"), this, SIGNAL(setAutoReload())); + + connect(this, + SIGNAL(popupMenu(const QString&,const QPoint&)), + this, + SLOT(showMenu(const QString&, const QPoint&))); + + } + virtual ~KHTMLSideBar() {} + + signals: + void submitFormRequest(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&); + void openURLRequest(const QString& url, KParts::URLArgs args); + void openURLNewWindow(const QString& url, KParts::URLArgs args); + void reload(); + void setAutoReload(); + + protected: + virtual void urlSelected( const QString &url, int button, + int state, const QString &_target, + KParts::URLArgs args = KParts::URLArgs()) { + if (button == LeftButton ){ + if (_target.lower() == "_self") { + openURL(url); + } else if (_target.lower() == "_blank") { + emit openURLNewWindow(completeURL(url).url(), args); + } else { // isEmpty goes here too + emit openURLRequest(completeURL(url).url(), args); + } + return; + } + if (button == MidButton) { + emit openURLNewWindow(completeURL(url).url(), + args); + return; + } + // A refresh + if (button == 0 && _target.lower() == "_self") { + openURL(completeURL(url)); + return; + } + KHTMLPart::urlSelected(url,button,state,_target,args); + } + + protected slots: + void loadPage() { + emit openURLRequest(completeURL(_lastUrl).url(), + KParts::URLArgs()); + } + + void loadNewWindow() { + emit openURLNewWindow(completeURL(_lastUrl).url(), + KParts::URLArgs()); + } + + void showMenu(const QString& url, const QPoint& pos) { + if (url.isEmpty()) { + _menu->popup(pos); + } else { + _lastUrl = url; + _linkMenu->popup(pos); + } + } + + void formProxy(const char *action, + const QString& url, + const QByteArray& formData, + const QString& target, + const QString& contentType, + const QString& boundary) { + QString t = target.lower(); + QString u; + + if (QCString(action).lower() != "post") { + // GET + KURL kurl = completeURL(url); + kurl.setQuery(formData.data()); + u = kurl.url(); + } else { + u = completeURL(url).url(); + } + + // Some sites seem to use empty targets to send to the + // main frame. + if (t == "_content") { + emit submitFormRequest(action, u, formData, + target, contentType, boundary); + } else if (t.isEmpty() || t == "_self") { + setFormNotification(KHTMLPart::NoNotification); + submitFormProxy(action, u, formData, target, + contentType, boundary); + setFormNotification(KHTMLPart::Only); + } + } + private: + KPopupMenu *_menu, *_linkMenu; + QString _lastUrl; +}; + + + +class KonqSideBarWebModule : public KonqSidebarPlugin +{ + Q_OBJECT + public: + KonqSideBarWebModule(KInstance *instance, QObject *parent, + QWidget *widgetParent, QString &desktopName, + const char *name); + virtual ~KonqSideBarWebModule(); + + virtual QWidget *getWidget(); + virtual void *provides(const QString &); + + signals: + void submitFormRequest(const char*,const QString&,const QByteArray&,const QString&,const QString&,const QString&); + void openURLRequest(const KURL &url, const KParts::URLArgs &args); + void createNewWindow(const KURL &url, const KParts::URLArgs &args); + protected: + virtual void handleURL(const KURL &url); + + private slots: + void urlClicked(const QString& url, KParts::URLArgs args); + void formClicked(const KURL& url, const KParts::URLArgs& args); + void urlNewWindow(const QString& url, KParts::URLArgs args); + void pageLoaded(); + void loadFavicon(); + void setTitle(const QString&); + void setAutoReload(); + void reload(); + + private: + KHTMLSideBar *_htmlPart; + KURL _url; + int reloadTimeout; + QString _desktopName; +}; + +#endif + diff --git a/konqueror/sidebar/web_module/webmodule_add.desktop b/konqueror/sidebar/web_module/webmodule_add.desktop new file mode 100644 index 000000000..78a9972e2 --- /dev/null +++ b/konqueror/sidebar/web_module/webmodule_add.desktop @@ -0,0 +1,79 @@ +[Desktop Entry] +Type=Link +URL= +Icon=www +Name=Web SideBar Module +Name[af]=Web kantbalk module +Name[ar]=وحدة شريط الشبكة الجانبي +Name[az]=Veb Yan Çubuq Modulu +Name[be]=Модуль cеціўнай бакавой панэлі +Name[bg]=Модул за страничния панел на браузъра +Name[bn]=ওয়েব সাইডবার মডিউল +Name[bs]=Web sidebar modul +Name[ca]=Mòdul web SideBar +Name[cs]=Webový postranní panel +Name[csb]=Moduł bòczny lëstwë WWW +Name[cy]=Modiwl Bar Ochr Gwe +Name[da]=Web-sidebjælke modul +Name[de]=Web-Navigationsbereich +Name[el]=Άρθρωμα πλευρικής μπάρας Ιστού +Name[eo]=TTT-flankzona modulo +Name[es]=Módulo de la barra lateral de web +Name[et]=Veebi külgriba moodul +Name[eu]=Web-eko alboko barraren modulua +Name[fa]=پیمانۀ میله جانبی وب +Name[fi]=Verkkosivupalkkimoduuli +Name[fr]=Module de barre de navigation sur le web +Name[fy]=Web sydbalke module +Name[ga]=Modúl Barra Taoibh Gréasáin +Name[gl]=Módulo da Barra Lateral Web +Name[he]=מודול שורת־צד מקוון +Name[hi]=वेब बाज़ूपट्टी मॉड्यूल +Name[hr]=Modul za web trake +Name[hu]=Webes oldalsáv-modul +Name[is]=Vefhliðarslá +Name[it]=Modulo barra laterale web +Name[ja]=ウェブサイドバーモジュール +Name[ka]=გვერდით Web დაფის მოდული +Name[kk]=Веб бүйір панель модулі +Name[km]=ម៉ូឌុលរបារបណ្ដាញ +Name[ko]=웹 사이드바 모듈 +Name[lt]=Šoninės žiniatinklio juostos modulis +Name[lv]=Tīmekļa sānjoslas modulis +Name[mk]=Модул - Веб-странична лента +Name[mn]=Вэб самбарын модул +Name[ms]=Modul Bar Sisi Web +Name[mt]=Barra tal-ġenb għal-web +Name[nb]=Modul for nett-sidestolpe +Name[nds]=Sietpaneel för de Nettnavigatschoon +Name[ne]=वेब छेउपट्टी मोड्युल +Name[nl]=Webzijbalkmodule +Name[nn]=Modul for nett-sidestolpe +Name[pa]=ਵੈੱਬ ਬਾਹੀ ਮੈਡੀਊਲ +Name[pl]=Moduł paska bocznego WWW +Name[pt]=Módulo da Barra Lateral Web +Name[pt_BR]=Módulo da Barra Lateral Web +Name[ro]=Modul bară laterală web +Name[ru]=Модуль боковой панели Web +Name[rw]=Igice UmurongokuRuahande cy'Urubugamakuru +Name[se]=Neahtta-bálddalasholga moduvla +Name[sk]=Modul bočného Web panelu +Name[sl]=Modul spletne stranske vrstice +Name[sr]=Модул веб бочне траке +Name[sr@Latn]=Modul veb bočne trake +Name[sv]=Webbsidoradsmodul +Name[ta]=வலை பக்கப்பட்டி பகுதி +Name[tg]=Бахши навори канораи вэб +Name[th]=โมดูลแถบด้านข้างสำหรับเว็บ +Name[tr]=Web Yan Çubuk Modülü +Name[tt]=Web YanTirä Modulı +Name[uk]=Модуль бічної панелі Тенет +Name[uz]=Veb yon paneli moduli +Name[uz@cyrillic]=Веб ён панели модули +Name[vi]=Mô đun Thanh bên Trình duyệt +Name[wa]=Module di bår di costé waibe +Name[zh_CN]=Web 侧边栏模块 +Name[zh_TW]=網頁邊列模組 +Open=false +X-KDE-KonqSidebarAddModule=konqsidebar_web +X-KDE-KonqSidebarUniversal=true diff --git a/konqueror/sidebar/web_module/websidebar.desktop b/konqueror/sidebar/web_module/websidebar.desktop new file mode 100644 index 000000000..30413e06a --- /dev/null +++ b/konqueror/sidebar/web_module/websidebar.desktop @@ -0,0 +1,78 @@ +[Desktop Entry] +Type=Link +URL= +Icon=www +Name=Web SideBar Module +Name[af]=Web kantbalk module +Name[ar]=وحدة شريط الشبكة الجانبي +Name[az]=Veb Yan Çubuq Modulu +Name[be]=Модуль cеціўнай бакавой панэлі +Name[bg]=Модул за страничния панел на браузъра +Name[bn]=ওয়েব সাইডবার মডিউল +Name[bs]=Web sidebar modul +Name[ca]=Mòdul web SideBar +Name[cs]=Webový postranní panel +Name[csb]=Moduł bòczny lëstwë WWW +Name[cy]=Modiwl Bar Ochr Gwe +Name[da]=Web-sidebjælke modul +Name[de]=Web-Navigationsbereich +Name[el]=Άρθρωμα πλευρικής μπάρας Ιστού +Name[eo]=TTT-flankzona modulo +Name[es]=Módulo de la barra lateral de web +Name[et]=Veebi külgriba moodul +Name[eu]=Web-eko alboko barraren modulua +Name[fa]=پیمانۀ میله جانبی وب +Name[fi]=Verkkosivupalkkimoduuli +Name[fr]=Module de barre de navigation sur le web +Name[fy]=Web sydbalke module +Name[ga]=Modúl Barra Taoibh Gréasáin +Name[gl]=Módulo da Barra Lateral Web +Name[he]=מודול שורת־צד מקוון +Name[hi]=वेब बाज़ूपट्टी मॉड्यूल +Name[hr]=Modul za web trake +Name[hu]=Webes oldalsáv-modul +Name[is]=Vefhliðarslá +Name[it]=Modulo barra laterale web +Name[ja]=ウェブサイドバーモジュール +Name[ka]=გვერდით Web დაფის მოდული +Name[kk]=Веб бүйір панель модулі +Name[km]=ម៉ូឌុលរបារបណ្ដាញ +Name[ko]=웹 사이드바 모듈 +Name[lt]=Šoninės žiniatinklio juostos modulis +Name[lv]=Tīmekļa sānjoslas modulis +Name[mk]=Модул - Веб-странична лента +Name[mn]=Вэб самбарын модул +Name[ms]=Modul Bar Sisi Web +Name[mt]=Barra tal-ġenb għal-web +Name[nb]=Modul for nett-sidestolpe +Name[nds]=Sietpaneel för de Nettnavigatschoon +Name[ne]=वेब छेउपट्टी मोड्युल +Name[nl]=Webzijbalkmodule +Name[nn]=Modul for nett-sidestolpe +Name[pa]=ਵੈੱਬ ਬਾਹੀ ਮੈਡੀਊਲ +Name[pl]=Moduł paska bocznego WWW +Name[pt]=Módulo da Barra Lateral Web +Name[pt_BR]=Módulo da Barra Lateral Web +Name[ro]=Modul bară laterală web +Name[ru]=Модуль боковой панели Web +Name[rw]=Igice UmurongokuRuahande cy'Urubugamakuru +Name[se]=Neahtta-bálddalasholga moduvla +Name[sk]=Modul bočného Web panelu +Name[sl]=Modul spletne stranske vrstice +Name[sr]=Модул веб бочне траке +Name[sr@Latn]=Modul veb bočne trake +Name[sv]=Webbsidoradsmodul +Name[ta]=வலை பக்கப்பட்டி பகுதி +Name[tg]=Бахши навори канораи вэб +Name[th]=โมดูลแถบด้านข้างสำหรับเว็บ +Name[tr]=Web Yan Çubuk Modülü +Name[tt]=Web YanTirä Modulı +Name[uk]=Модуль бічної панелі Тенет +Name[uz]=Veb yon paneli moduli +Name[uz@cyrillic]=Веб ён панели модули +Name[vi]=Mô đun Thanh bên Trình duyệt +Name[wa]=Module di bår di costé waibe +Name[zh_CN]=Web 侧边栏模块 +Name[zh_TW]=網頁邊列模組 +Open=false +X-KDE-KonqSidebarModule=konqsidebar_web diff --git a/konqueror/sidebar/web_module/websidebar.html b/konqueror/sidebar/web_module/websidebar.html new file mode 100644 index 000000000..111356054 --- /dev/null +++ b/konqueror/sidebar/web_module/websidebar.html @@ -0,0 +1,11 @@ +<html> +<body> +<div align="center" width="80%"> +<font size="+2"> +Web SideBar Extension +</font> +<hr /> +<br /> +Select a URL with the context menu for the icon of this extension. +</body> +</html> |