mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 10:52:53 +00:00
kget: remove konqueror support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
1b56d60f45
commit
eed6d375b2
13 changed files with 3 additions and 493 deletions
|
@ -7,17 +7,10 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>558</width>
|
||||
<height>324</height>
|
||||
<height>293</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_KonquerorIntegration">
|
||||
<property name="text">
|
||||
<string>Use as download manager for Konqueror</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="kcfg_AutoPaste">
|
||||
<property name="title">
|
||||
|
|
|
@ -36,9 +36,6 @@
|
|||
</group>
|
||||
|
||||
<group name="Advanced">
|
||||
<entry name="KonquerorIntegration" type="Bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="AutoPaste" type="Bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
|
|
|
@ -73,8 +73,8 @@ PreferencesDialog::PreferencesDialog(QWidget * parent, KConfigSkeleton * skeleto
|
|||
addPage(network, i18n("Network"), "network-workgroup", i18n("Network and Downloads"));
|
||||
addPage(webinterface, i18n("Web Interface"), "network-workgroup", i18n("Control KGet over a Network or the Internet"));
|
||||
addPage(verification, i18n("Verification"), "document-encrypt", i18n("Verification"));
|
||||
addPage(integration, i18nc("integration of KGet with other applications", "Integration"), "konqueror", i18nc("integration of KGet with other applications", "Integration"));
|
||||
addPage(advanced, i18nc("Advanced Options", "Advanced"), "preferences-other", i18n("Advanced Options"));
|
||||
addPage(integration, i18n("Integration"), "applications-other", i18n("Integration of KGet with other applications"));
|
||||
addPage(advanced, i18n("Advanced Options"), "preferences-other", i18n("Advanced Options"));
|
||||
addPage(pluginSelector, i18n("Plugins"), "preferences-plugin", i18n("Transfer Plugins"));
|
||||
|
||||
connect(this, SIGNAL(accepted()), SLOT(disableApplyButton()));
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
add_subdirectory(konqueror)
|
||||
add_subdirectory(webinterface)
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
project (kget_browser_integration)
|
||||
|
||||
set(kget_browser_integration_SRCS
|
||||
kget_plug_in.cpp
|
||||
)
|
||||
|
||||
QT4_ADD_DBUS_INTERFACE(kget_browser_integration_SRCS ../../dbus/org.kde.kget.main.xml kget_interface )
|
||||
|
||||
kde4_add_plugin(kget_browser_integration ${kget_browser_integration_SRCS})
|
||||
|
||||
target_link_libraries(kget_browser_integration ${KDE4_KPARTS_LIBS} ${KDE4_KIO_LIBRARY})
|
||||
|
||||
install(TARGETS kget_browser_integration DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(FILES kget_plug_in.rc kget_plug_in.desktop DESTINATION ${KDE4_DATA_INSTALL_DIR}/dolphinpart/kpartplugins)
|
||||
install(FILES kget_plug_in.rc kget_plug_in.desktop DESTINATION ${KDE4_DATA_INSTALL_DIR}/kwebkitpart/kpartplugins)
|
|
@ -1,4 +0,0 @@
|
|||
#! /bin/sh
|
||||
$EXTRACTRC *.rc >> rc.cpp || exit 11
|
||||
$XGETTEXT *.cpp -o $podir/kgetplugin.pot
|
||||
rm -f rc.cpp
|
|
@ -1,243 +0,0 @@
|
|||
/* This file is part of the KDE project
|
||||
|
||||
Copyright (C) 2002 Patrick Charbonnier <pch@valleeurpe.net>
|
||||
Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
|
||||
Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org>
|
||||
Copyright (C) 2010 Dawit Alemayehu <adawit@kde.org>
|
||||
Copyright (C) 2010 Matthias Fuchs <mat69@gmx.net>
|
||||
|
||||
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 "kget_plug_in.h"
|
||||
|
||||
#include "kget_interface.h"
|
||||
|
||||
#include <KActionCollection>
|
||||
#include <KToggleAction>
|
||||
#include <KActionMenu>
|
||||
#include <KIconLoader>
|
||||
#include <KComponentData>
|
||||
#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <KMenu>
|
||||
#include <KRun>
|
||||
#include <KIcon>
|
||||
#include <KToolInvocation>
|
||||
#include <KPluginFactory>
|
||||
#include <KProtocolInfo>
|
||||
#include <KFileItem>
|
||||
#include <KParts/Part>
|
||||
#include <KParts/PartManager>
|
||||
#include <KParts/HtmlExtension>
|
||||
#include <KParts/FileInfoExtension>
|
||||
|
||||
#include <QtDBus/QDBusConnection>
|
||||
|
||||
|
||||
#define QL1S(x) QLatin1String(x)
|
||||
|
||||
K_PLUGIN_FACTORY(KGetPluginFactory, registerPlugin<KGetPlugin>();)
|
||||
K_EXPORT_PLUGIN(KGetPluginFactory("kgetplugin"))
|
||||
|
||||
static QWidget* partWidget(QObject* obj)
|
||||
{
|
||||
KParts::ReadOnlyPart* part = qobject_cast<KParts::ReadOnlyPart*>(obj);
|
||||
return part ? part->widget() : 0;
|
||||
}
|
||||
|
||||
KGetPlugin::KGetPlugin(QObject *parent, const QVariantList&)
|
||||
:KParts::Plugin(parent)
|
||||
{
|
||||
KActionMenu *menu = new KActionMenu(KIcon("kget"), i18n("Download Manager"), actionCollection());
|
||||
actionCollection()->addAction("kget_menu", menu);
|
||||
|
||||
menu->setDelayed( false );
|
||||
connect( menu->menu(), SIGNAL(aboutToShow()), SLOT(showPopup()));
|
||||
|
||||
m_dropTargetAction = new KToggleAction(i18n("Show Drop Target"), actionCollection());
|
||||
|
||||
connect(m_dropTargetAction, SIGNAL(triggered()), this, SLOT(slotShowDrop()));
|
||||
actionCollection()->addAction(QL1S("show_drop"), m_dropTargetAction);
|
||||
menu->addAction(m_dropTargetAction);
|
||||
|
||||
QAction *showLinksAction = actionCollection()->addAction(QL1S("show_links"));
|
||||
showLinksAction->setText(i18n("List All Links"));
|
||||
connect(showLinksAction, SIGNAL(triggered()), SLOT(slotShowLinks()));
|
||||
menu->addAction(showLinksAction);
|
||||
|
||||
QAction *showSelectedLinksAction = actionCollection()->addAction(QL1S("show_selected_links"));
|
||||
showSelectedLinksAction->setText(i18n("List Selected Links"));
|
||||
connect(showSelectedLinksAction, SIGNAL(triggered()), SLOT(slotShowSelectedLinks()));
|
||||
menu->addAction(showSelectedLinksAction);
|
||||
|
||||
// Hide this plugin if the parent part does not support either
|
||||
// The FileInfo or Html extensions...
|
||||
if (!KParts::HtmlExtension::childObject(parent) && !KParts::FileInfoExtension::childObject(parent))
|
||||
menu->setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
KGetPlugin::~KGetPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
static bool hasDropTarget()
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kget")) {
|
||||
OrgKdeKgetMainInterface kgetInterface("org.kde.kget", "/KGet", QDBusConnection::sessionBus());
|
||||
QDBusReply<bool> reply = kgetInterface.dropTargetVisible();
|
||||
if (reply.isValid()) {
|
||||
found = reply.value();
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
void KGetPlugin::showPopup()
|
||||
{
|
||||
// Check for HtmlExtension support...
|
||||
KParts::HtmlExtension* htmlExtn = KParts::HtmlExtension::childObject(parent());
|
||||
if (htmlExtn) {
|
||||
KParts::SelectorInterface* selector = qobject_cast<KParts::SelectorInterface*>(htmlExtn);
|
||||
if (selector) {
|
||||
m_dropTargetAction->setChecked(hasDropTarget());
|
||||
const KParts::SelectorInterface::QueryMethods methods = selector->supportedQueryMethods();
|
||||
bool enable = (methods & KParts::SelectorInterface::EntireContent);
|
||||
actionCollection()->action(QL1S("show_links"))->setEnabled(enable);
|
||||
enable = (htmlExtn->hasSelection() && (methods & KParts::SelectorInterface::SelectedContent));
|
||||
actionCollection()->action(QL1S("show_selected_links"))->setEnabled(enable);
|
||||
enable = (actionCollection()->action(QL1S("show_links"))->isEnabled() ||
|
||||
actionCollection()->action(QL1S("show_selected_links"))->isEnabled());
|
||||
actionCollection()->action(QL1S("show_drop"))->setEnabled(enable);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for FileInfoExtension support...
|
||||
KParts::FileInfoExtension* fileinfoExtn = KParts::FileInfoExtension::childObject(parent());
|
||||
if (fileinfoExtn) {
|
||||
m_dropTargetAction->setChecked(hasDropTarget());
|
||||
const KParts::FileInfoExtension::QueryModes modes = fileinfoExtn->supportedQueryModes();
|
||||
bool enable = (modes & KParts::FileInfoExtension::AllItems);
|
||||
actionCollection()->action(QL1S("show_links"))->setEnabled(enable);
|
||||
enable = (fileinfoExtn->hasSelection() && (modes & KParts::FileInfoExtension::SelectedItems));
|
||||
actionCollection()->action(QL1S("show_selected_links"))->setEnabled(enable);
|
||||
enable = (actionCollection()->action(QL1S("show_links"))->isEnabled() ||
|
||||
actionCollection()->action(QL1S("show_selected_links"))->isEnabled());
|
||||
actionCollection()->action(QL1S("show_drop"))->setEnabled(enable);
|
||||
return;
|
||||
}
|
||||
|
||||
actionCollection()->action(QL1S("show_selected_links"))->setEnabled(false);
|
||||
actionCollection()->action(QL1S("show_links"))->setEnabled(false);
|
||||
actionCollection()->action(QL1S("show_drop"))->setEnabled(false);
|
||||
if (m_dropTargetAction->isChecked())
|
||||
m_dropTargetAction->setChecked(false);
|
||||
}
|
||||
|
||||
void KGetPlugin::slotShowDrop()
|
||||
{
|
||||
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kget")) {
|
||||
KRun::runCommand("kget --showDropTarget --hideMainWindow", "kget", "kget", partWidget(parent()));
|
||||
} else {
|
||||
OrgKdeKgetMainInterface kgetInterface("org.kde.kget", "/KGet", QDBusConnection::sessionBus());
|
||||
kgetInterface.setDropTargetVisible(m_dropTargetAction->isChecked());
|
||||
}
|
||||
}
|
||||
|
||||
void KGetPlugin::slotShowLinks()
|
||||
{
|
||||
getLinks(false);
|
||||
}
|
||||
|
||||
void KGetPlugin::slotShowSelectedLinks()
|
||||
{
|
||||
getLinks(true);
|
||||
}
|
||||
|
||||
void KGetPlugin::slotImportLinks()
|
||||
{
|
||||
if (m_linkList.isEmpty()) {
|
||||
KMessageBox::sorry(partWidget(parent()),
|
||||
i18n("No downloadable links were found."),
|
||||
i18n("No Links"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove any duplicates links from the list...
|
||||
m_linkList.removeDuplicates();
|
||||
|
||||
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kget") &&
|
||||
KToolInvocation::kdeinitExecWait("kget") != 0) {
|
||||
KMessageBox::sorry(partWidget(parent()),
|
||||
i18n("Unable to communicate with the KGet download manager."),
|
||||
i18n("Communication Error"));
|
||||
return;
|
||||
}
|
||||
|
||||
OrgKdeKgetMainInterface kgetInterface("org.kde.kget", "/KGet", QDBusConnection::sessionBus());
|
||||
kgetInterface.importLinks(m_linkList);
|
||||
}
|
||||
|
||||
void KGetPlugin::getLinks(bool selectedOnly)
|
||||
{
|
||||
KParts::HtmlExtension* htmlExtn = KParts::HtmlExtension::childObject(parent());
|
||||
if (htmlExtn) {
|
||||
KParts::SelectorInterface* selector = qobject_cast<KParts::SelectorInterface*>(htmlExtn);
|
||||
if (selector) {
|
||||
m_linkList.clear();
|
||||
const QUrl baseUrl = htmlExtn->baseUrl();
|
||||
const QString query = QL1S("a[href], img[src], audio[src], video[src], embed[src], object[data]");
|
||||
const KParts::SelectorInterface::QueryMethod method = (selectedOnly ? KParts::SelectorInterface::SelectedContent:
|
||||
KParts::SelectorInterface::EntireContent);
|
||||
const QList<KParts::SelectorInterface::Element> elements = selector->querySelectorAll(query, method);
|
||||
QString attr;
|
||||
Q_FOREACH(const KParts::SelectorInterface::Element& element, elements) {
|
||||
if (element.hasAttribute(QL1S("href")))
|
||||
attr = QL1S("href");
|
||||
else if (element.hasAttribute(QL1S("src")))
|
||||
attr = QL1S("src");
|
||||
else if (element.hasAttribute(QL1S("data")))
|
||||
attr = QL1S("data");
|
||||
const KUrl resolvedUrl (baseUrl.resolved(element.attribute(attr)));
|
||||
// Only select valid and non-local links for download...
|
||||
if (resolvedUrl.isValid() && !resolvedUrl.isLocalFile() && !resolvedUrl.host().isEmpty()) {
|
||||
if (element.hasAttribute(QL1S("type")))
|
||||
m_linkList << QString(QL1S("url ") + resolvedUrl.url() + QL1S(" type ") + element.attribute(QL1S("type")));
|
||||
else
|
||||
m_linkList << resolvedUrl.url();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
slotImportLinks();
|
||||
}
|
||||
|
||||
KParts::FileInfoExtension* fileinfoExtn = KParts::FileInfoExtension::childObject(parent());
|
||||
if (fileinfoExtn) {
|
||||
m_linkList.clear();
|
||||
const KParts::FileInfoExtension::QueryMode mode = (selectedOnly ? KParts::FileInfoExtension::SelectedItems:
|
||||
KParts::FileInfoExtension::AllItems);
|
||||
const KFileItemList items = fileinfoExtn->queryFor(mode);
|
||||
Q_FOREACH(const KFileItem& item, items) {
|
||||
const KUrl url = item.url();
|
||||
// Only select valid and non local links for download...
|
||||
if (item.isReadable() && item.isFile() && !item.isLocalFile() && !url.host().isEmpty()) {
|
||||
if (item.mimetype().isEmpty())
|
||||
m_linkList << url.url();
|
||||
else
|
||||
m_linkList << QString(QL1S("url ") + url.url() + QL1S(" type ") + item.mimetype());
|
||||
}
|
||||
}
|
||||
slotImportLinks();
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_kget_plug_in.cpp"
|
|
@ -1,109 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Icon=kget
|
||||
X-KDE-Library=kget_browser_integration
|
||||
X-KDE-PluginInfo-Author=KGet Maintainers
|
||||
X-KDE-PluginInfo-Email=kget@kde.org
|
||||
X-KDE-PluginInfo-Name=kget_browser_integration
|
||||
X-KDE-PluginInfo-Version=1.0
|
||||
X-KDE-PluginInfo-Website=
|
||||
X-KDE-PluginInfo-Category=Tools
|
||||
X-KDE-PluginInfo-Depends=
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
||||
Name=Download Manager
|
||||
Name[bg]=Изтегляне на файлове
|
||||
Name[bs]=Upravnik preuzimanjima datoteka
|
||||
Name[ca]=Gestor de baixades
|
||||
Name[ca@valencia]=Gestor de baixades
|
||||
Name[cs]=Správce stahování
|
||||
Name[da]=Downloadhåndtering
|
||||
Name[de]=Download-Verwaltung
|
||||
Name[el]=Διαχειριστής λήψεων
|
||||
Name[en_GB]=Download Manager
|
||||
Name[es]=Gestor de descargas
|
||||
Name[et]=Allalaadimiste haldur
|
||||
Name[eu]=Deskarga-kudeatzailea
|
||||
Name[fi]=Tiedostonlataaja
|
||||
Name[fr]=Gestionnaire de téléchargements
|
||||
Name[ga]=Bainisteoir Íosluchtaithe
|
||||
Name[gl]=Xestor de descargas
|
||||
Name[hu]=Letöltéskezelő
|
||||
Name[ia]=Gerente de discargamento
|
||||
Name[it]=Gestore degli scaricamenti
|
||||
Name[ja]=ダウンロードマネージャ
|
||||
Name[kk]=Жүктеп алу менеджері
|
||||
Name[km]=កម្មវិធីគ្រប់គ្រងការទាញយក
|
||||
Name[ko]=다운로드 관리자
|
||||
Name[lt]=Siuntimų valdymas
|
||||
Name[mr]=डाउनलोड व्यवस्थापक
|
||||
Name[nb]=Nedlastingsbehandler
|
||||
Name[nds]=Daalladenpleger
|
||||
Name[nl]=Downloadbeheerder
|
||||
Name[pa]=ਡਾਊਨਲੋਡ ਮੈਨੇਜਰ
|
||||
Name[pl]=Zarządzanie pobieraniem
|
||||
Name[pt]=Gestor de Transferências
|
||||
Name[pt_BR]=Gerenciador de downloads
|
||||
Name[ro]=Administrator descărcări
|
||||
Name[ru]=Диспетчер загрузок
|
||||
Name[si]=බාගත කළමනාකරු
|
||||
Name[sk]=Správca sťahovania
|
||||
Name[sl]=Upravljalnik prejemov
|
||||
Name[sr]=Менаџер преузимања
|
||||
Name[sr@ijekavian]=Менаџер преузимања
|
||||
Name[sr@ijekavianlatin]=Menadžer preuzimanja
|
||||
Name[sr@latin]=Menadžer preuzimanja
|
||||
Name[sv]=Nerladdningshanterare
|
||||
Name[tr]=İndirme Yöneticisi
|
||||
Name[ug]=چۈشۈرۈش باشقۇرغۇسى
|
||||
Name[uk]=Керування звантаженнями
|
||||
Name[x-test]=xxDownload Managerxx
|
||||
Name[zh_CN]=下载管理器
|
||||
Name[zh_TW]=下載管理員
|
||||
Comment=A versatile and easy to use file download manager
|
||||
Comment[bg]=Удобна и лесна за използване програма за изтегляния
|
||||
Comment[bs]=Svestran i jednostavan za korištenje upravljač preuzimanjem datoteka
|
||||
Comment[ca]=Un gestor de baixades de fitxers versàtil i fàcil d'utilitzar
|
||||
Comment[ca@valencia]=Un gestor de baixades de fitxers versàtil i fàcil d'utilitzar
|
||||
Comment[cs]=Všestranný a jednoduše použitelný správce souborů
|
||||
Comment[da]=En alsidig og brugervenlig downloadhåndtering
|
||||
Comment[de]=Ein vielseitiges und einfach zu benutzendes Download-Verwaltungsprogramm
|
||||
Comment[el]=Ένας ευέλικτος και εύκολος στη χρήση διαχειριστής λήψεων αρχείων
|
||||
Comment[en_GB]=A versatile and easy to use file download manager
|
||||
Comment[es]=Una manera sencilla y versátil de usar el gestor de descarga de archivos
|
||||
Comment[et]=Tubli ja lihtne failide allalaadimise haldur
|
||||
Comment[eu]=Erabilera askotako eta errazeko fitxategiak deskargatzeko kudeatzailea
|
||||
Comment[fi]=Monipuolinen ja helppokäyttöinen tiedostonlataaja
|
||||
Comment[fr]=Un gestionnaire de téléchargements facile et polyvalent
|
||||
Comment[gl]=Un xestor de descargas de ficheiros versátil e fácil de usar.
|
||||
Comment[hu]=Egy sokoldalú és egyszerűen használható letöltéskezelő
|
||||
Comment[ia]=Un gestor de discargamento versatile e facile de usar se
|
||||
Comment[is]=Fjölhæfur en einfaldur skráaniðurhalsstjóri
|
||||
Comment[it]=Un gestore di scaricamenti versatile e facile da usare
|
||||
Comment[kk]=Әмбебап және ыңғайлы жүктеп алу менеджері
|
||||
Comment[km]=អាចផ្លាស់ប្ដូរ និងងាយស្រួលប្រើកម្មវិធីគ្រប់គ្រងការទាញយក
|
||||
Comment[ko]=다운로드 관리자
|
||||
Comment[lt]=Lanksti ir paprasta failų atsiuntimo tvarkyklė
|
||||
Comment[mr]=एक बहुमुखी व वापरायला सोपा फाईल डाउनलोड व्यवस्थापक
|
||||
Comment[nb]=En fleksibel nedlastingsbehandler som er lett å bruke
|
||||
Comment[nds]=En ansleegsch un eenfach to bruken Daalladenpleger
|
||||
Comment[nl]=Een veelzijdige en gemakkelijk te gebruiken downloadbeheerder
|
||||
Comment[pl]=Wszechstronny i łatwy w użyciu program zarządzający pobieraniem plików
|
||||
Comment[pt]=Um gestor de transferências de ficheiros simples e versátil de usar
|
||||
Comment[pt_BR]=Um gerenciador de downloads de arquivos simples e fácil de usar
|
||||
Comment[ru]=Гибкий и простой в использовании диспетчер файлов
|
||||
Comment[si]=භාවිතයට පහසු හුරුබුහුටි ගොනු බාගත කළමනාකරු
|
||||
Comment[sk]=Univerzálny a jednoducho použiteľný správca sťahovania
|
||||
Comment[sl]=Vsestranski in preprost upravljalnik prejemov
|
||||
Comment[sr]=Свестран и предусретљив менаџер преузимања фајлова
|
||||
Comment[sr@ijekavian]=Свестран и предусретљив менаџер преузимања фајлова
|
||||
Comment[sr@ijekavianlatin]=Svestran i predusretljiv menadžer preuzimanja fajlova
|
||||
Comment[sr@latin]=Svestran i predusretljiv menadžer preuzimanja fajlova
|
||||
Comment[sv]=En mångsidig och lättanvänd nerladdningshanterare av filer
|
||||
Comment[tr]=Çok yetenekli ve kolay kullanımlı bir indirme yöneticisi
|
||||
Comment[ug]=كۆپ ئىقتىدارلىق، ئىشلىتىش قۇلاي ھۆججەت چۈشۈرۈشنى باشقۇرغۇچ
|
||||
Comment[uk]=Гнучка і проста у користуванні програма для керування звантаженнями
|
||||
Comment[x-test]=xxA versatile and easy to use file download managerxx
|
||||
Comment[zh_CN]=简单易用的多功能文件下载管理器
|
||||
Comment[zh_TW]=一個多功能且容易使用的檔案下載管理員
|
||||
X-KDE-ParentApp=konqueror
|
|
@ -1,42 +0,0 @@
|
|||
/* This file is part of the KDE project
|
||||
|
||||
Copyright (C) 2002 Patrick Charbonnier <pch@valleeurpe.net>
|
||||
Copyright (C) 2010 Matthias Fuchs <mat69@gmx.net>
|
||||
|
||||
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 KGETPLUGIN_H
|
||||
#define KGETPLUGIN_H
|
||||
|
||||
#include <KParts/Plugin>
|
||||
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
class KToggleAction;
|
||||
|
||||
class KGetPlugin : public KParts::Plugin
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KGetPlugin(QObject* parent, const QVariantList&);
|
||||
virtual ~KGetPlugin();
|
||||
|
||||
private Q_SLOTS:
|
||||
void slotShowDrop();
|
||||
void slotShowLinks();
|
||||
void slotShowSelectedLinks();
|
||||
void slotImportLinks();
|
||||
void showPopup();
|
||||
|
||||
private:
|
||||
void getLinks(bool selectedOnly = false);
|
||||
|
||||
QStringList m_linkList;
|
||||
KToggleAction *m_dropTargetAction;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE kpartplugin>
|
||||
<kpartplugin library="kget_browser_integration" name="kget_browser_integration" version="4">
|
||||
<MenuBar>
|
||||
<Menu name="tools"><text>&Tools</text>
|
||||
<Action name="kget_menu"/>
|
||||
</Menu>
|
||||
</MenuBar>
|
||||
<ToolBar name="mainToolBar">
|
||||
<Action name="kget_menu"/>
|
||||
</ToolBar>
|
||||
</kpartplugin>
|
|
@ -103,8 +103,6 @@ MainWindow::~MainWindow()
|
|||
KGet::save();
|
||||
|
||||
slotSaveMyself();
|
||||
// reset konqueror integration (necessary if user enabled / disabled temporarily integration from tray)
|
||||
slotKonquerorIntegration( Settings::konquerorIntegration() );
|
||||
// the following call saves options set in above dtors
|
||||
Settings::self()->writeConfig();
|
||||
|
||||
|
@ -220,12 +218,6 @@ void MainWindow::setupActions()
|
|||
"the clipboard for URLs and paste them automatically."));
|
||||
connect(m_autoPasteAction, SIGNAL(triggered()), SLOT(slotToggleAutoPaste()));
|
||||
|
||||
m_konquerorIntegration = new KToggleAction(KIcon("konqueror"),
|
||||
i18n("Use KGet as Konqueror Download Manager"), actionCollection());
|
||||
actionCollection()->addAction("konqueror_integration", m_konquerorIntegration);
|
||||
connect(m_konquerorIntegration, SIGNAL(triggered(bool)), SLOT(slotTrayKonquerorIntegration(bool)));
|
||||
m_konquerorIntegration->setChecked(Settings::konquerorIntegration());
|
||||
|
||||
// local - Destroys all sub-windows and exits
|
||||
KStandardAction::quit(this, SLOT(slotQuit()), actionCollection());
|
||||
// local - Standard configure actions
|
||||
|
@ -427,16 +419,6 @@ void MainWindow::init()
|
|||
m_drop = new DropTarget(this);
|
||||
|
||||
if (Settings::firstRun()) {
|
||||
if (KMessageBox::questionYesNoCancel(this ,i18n("This is the first time you have run KGet.\n"
|
||||
"Would you like to enable KGet as the download manager for Konqueror?"),
|
||||
i18n("Konqueror Integration"), KGuiItem(i18n("Enable")),
|
||||
KGuiItem(i18n("Do Not Enable")))
|
||||
== KMessageBox::Yes) {
|
||||
Settings::setKonquerorIntegration(true);
|
||||
m_konquerorIntegration->setChecked(Settings::konquerorIntegration());
|
||||
slotKonquerorIntegration(true);
|
||||
}
|
||||
|
||||
m_drop->setDropTargetVisible(false);
|
||||
|
||||
// reset the FirstRun config option
|
||||
|
@ -987,9 +969,6 @@ void MainWindow::slotNewConfig()
|
|||
m_dock = 0;
|
||||
}
|
||||
|
||||
slotKonquerorIntegration(Settings::konquerorIntegration());
|
||||
m_konquerorIntegration->setChecked(Settings::konquerorIntegration());
|
||||
|
||||
if (clipboardTimer) {
|
||||
if (Settings::autoPaste())
|
||||
clipboardTimer->start(1000);
|
||||
|
@ -1068,33 +1047,6 @@ void MainWindow::slotCheckClipboard()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::slotTrayKonquerorIntegration(bool enable)
|
||||
{
|
||||
slotKonquerorIntegration(enable);
|
||||
if (!enable && Settings::konquerorIntegration())
|
||||
{
|
||||
KGet::showNotification(this, "notification",
|
||||
i18n("KGet has been temporarily disabled as download manager for Konqueror. "
|
||||
"If you want to disable it forever, go to Settings->Advanced and disable \"Use "
|
||||
"as download manager for Konqueror\"."),
|
||||
"dialog-info");
|
||||
/*KMessageBox::information(this,
|
||||
i18n("KGet has been temporarily disabled as download manager for Konqueror. "
|
||||
"If you want to disable it forever, go to Settings->Advanced and disable \"Use "
|
||||
"as download manager for Konqueror\"."),
|
||||
i18n("Konqueror Integration disabled"),
|
||||
"KonquerorIntegrationDisabled");*/
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::slotKonquerorIntegration(bool konquerorIntegration)
|
||||
{
|
||||
KConfig cfgKonqueror("konquerorrc", KConfig::NoGlobals);
|
||||
cfgKonqueror.group("HTML Settings").writeEntry("DownloadManager",
|
||||
QString(konquerorIntegration ? "kget" : QString()));
|
||||
cfgKonqueror.sync();
|
||||
}
|
||||
|
||||
void MainWindow::slotShowMenubar()
|
||||
{
|
||||
if (m_menubarAction->isChecked())
|
||||
|
|
|
@ -82,8 +82,6 @@ private slots:
|
|||
void slotStopDownload();
|
||||
void slotConfigureNotifications();
|
||||
void slotToggleAutoPaste();
|
||||
void slotTrayKonquerorIntegration(bool);
|
||||
void slotKonquerorIntegration( bool );
|
||||
void slotShowMenubar();
|
||||
void slotTransferGroupSettings();
|
||||
void slotTransferSettings();
|
||||
|
@ -143,7 +141,6 @@ private:
|
|||
// actions
|
||||
KToggleAction * m_autoPasteAction;
|
||||
KToggleAction * m_menubarAction;
|
||||
KToggleAction * m_konquerorIntegration;
|
||||
|
||||
// for autopaste function
|
||||
QString lastClipboard;
|
||||
|
|
|
@ -32,7 +32,6 @@ Tray::Tray(MainWindow * parent)
|
|||
cm->addAction( parent->actionCollection()->action("start_all_download") );
|
||||
cm->addAction( parent->actionCollection()->action("stop_all_download") );
|
||||
cm->addSeparator();
|
||||
cm->addAction( parent->actionCollection()->action("konqueror_integration") );
|
||||
cm->addAction( parent->actionCollection()->action("options_configure") );
|
||||
|
||||
// Set up basic tray parameters
|
||||
|
|
Loading…
Add table
Reference in a new issue