Commit 5a339bb4 authored by Nicolas Fella's avatar Nicolas Fella Committed by Albert Astals Cid
Browse files

Remove half-finished Konsole backend

It was never finished and hasn't seen active progress in 10 years
parent c92aa7b7
Pipeline #170965 passed with stage
in 51 seconds
set(BUILD_KONSOLE true)
if (NOT BUILD_KONSOLE)
return()
endif()
add_library(krdc_konsoleplugin)
target_sources(krdc_konsoleplugin PRIVATE
konsoleviewfactory.cpp
konsoleview.cpp
)
find_package(KF5 REQUIRED COMPONENTS Parts)
target_link_libraries(krdc_konsoleplugin
Qt::Core
KF5::Wallet
KF5::ConfigCore
KF5::Parts
Qt::Gui
krdccore
)
install(TARGETS krdc_konsoleplugin DESTINATION ${KDE_INSTALL_PLUGINDIR}/krdc)
/*
SPDX-FileCopyrightText: 2009 Urs Wolfer <uwolfer@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "konsoleview.h"
#include <KParts/Part>
#include <KParts/ReadOnlyPart>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KService>
#include <kde_terminal_interface.h>
#include <QDir>
#include <QEvent>
#include <QScrollArea>
#include <QVBoxLayout>
KonsoleView::KonsoleView(QWidget *parent, const QUrl &url, KConfigGroup configGroup)
: RemoteView(parent)
{
m_url = url;
m_host = url.host();
m_port = url.port();
m_hostPreferences = new KonsoleHostPreferences(configGroup, this);
// QSize size = QSize(640, 480);
const QSize size = (qobject_cast<QWidget *>(parent))->size();
setStatus(Connected);
setFixedSize(size);
setFixedSize(size);
Q_EMIT framebufferSizeChanged(size.width(), size.height());
KPluginFactory* factory = 0;
KService::Ptr service = KService::serviceByDesktopName("konsolepart");
if (service) {
factory = KPluginLoader(service->library()).factory();
}
KParts::ReadOnlyPart* part = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0;
if (part != 0) {
// connect(part, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited()));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setSpacing(0);
m_terminalWidget = part->widget();
mainLayout->addWidget(m_terminalWidget);
m_terminal = qobject_cast<TerminalInterface *>(part);
m_terminal->showShellInDir(QDir::homePath());
m_terminal->sendInput("echo " + url.userName() + '@' + url.host()/* + ':' + url.port()*/ + '\n');
// m_terminal->sendInput("clear\n");
m_terminalWidget->resize(size);
}
}
KonsoleView::~KonsoleView()
{
Q_EMIT disconnected();
setStatus(Disconnected);
}
bool KonsoleView::eventFilter(QObject *obj, QEvent *event)
{
if (m_viewOnly) {
if (event->type() == QEvent::KeyPress ||
event->type() == QEvent::KeyRelease ||
event->type() == QEvent::MouseButtonDblClick ||
event->type() == QEvent::MouseButtonPress ||
event->type() == QEvent::MouseButtonRelease ||
event->type() == QEvent::MouseMove)
return true;
}
return RemoteView::eventFilter(obj, event);
}
QSize KonsoleView::framebufferSize()
{
return minimumSizeHint();
}
QSize KonsoleView::sizeHint() const
{
return RemoteView::sizeHint();
return maximumSize();
}
bool KonsoleView::isQuitting()
{
return false;
}
bool KonsoleView::start()
{
setStatus(Connected);
Q_EMIT connected();
m_terminalWidget->setFocus();
return true;
}
HostPreferences* KonsoleView::hostPreferences()
{
return m_hostPreferences;
}
void KonsoleView::switchFullscreen(bool on)
{
Q_UNUSED(on);
}
/*
SPDX-FileCopyrightText: 2009 Urs Wolfer <uwolfer@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KONSOLEVIEW_H
#define KONSOLEVIEW_H
#include "konsoleview.h"
#include "remoteview.h"
#include "hostpreferences.h"
#include <KConfigGroup>
class KonsoleHostPreferences;
class TerminalInterface;
class KonsoleView : public RemoteView
{
Q_OBJECT
public:
explicit KonsoleView(QWidget *parent = 0, const QUrl &url = QUrl(), KConfigGroup configGroup = KConfigGroup());
virtual ~KonsoleView();
virtual QSize framebufferSize();
QSize sizeHint() const;
virtual bool isQuitting();
virtual bool start();
HostPreferences* hostPreferences();
public Q_SLOTS:
virtual void switchFullscreen(bool on);
protected:
bool eventFilter(QObject *obj, QEvent *event);
private:
KonsoleHostPreferences *m_hostPreferences;
TerminalInterface* m_terminal;
QWidget *m_terminalWidget;
};
class KonsoleHostPreferences : public HostPreferences
{
Q_OBJECT
public:
explicit KonsoleHostPreferences(KConfigGroup configGroup, QObject *parent = 0)
: HostPreferences(configGroup, parent) {}
protected:
virtual QWidget* createProtocolSpecificConfigPage() { return 0; };
};
#endif // KONSOLEVIEW_H
/*
SPDX-FileCopyrightText: 2009 Urs Wolfer <uwolfer@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "konsoleviewfactory.h"
#include <KLocalizedString>
K_PLUGIN_CLASS_WITH_JSON(KonsoleViewFactory, "krdc_konsole.json")
KonsoleViewFactory::KonsoleViewFactory(QObject *parent, const QVariantList &args)
: RemoteViewFactory(parent)
{
Q_UNUSED(args);
KLocalizedString::setApplicationDomain("krdc");
}
KonsoleViewFactory::~KonsoleViewFactory()
{
}
bool KonsoleViewFactory::supportsUrl(const QUrl &url) const
{
return (url.scheme().compare("konsole", Qt::CaseInsensitive) == 0);
}
RemoteView *KonsoleViewFactory::createView(QWidget *parent, const QUrl &url, KConfigGroup configGroup)
{
return new KonsoleView(parent, url, configGroup);
}
HostPreferences *KonsoleViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent)
{
Q_UNUSED(configGroup);
Q_UNUSED(parent);
return 0;
}
QString KonsoleViewFactory::scheme() const
{
return "konsole";
}
QString KonsoleViewFactory::connectActionText() const
{
return i18n("New Konsole Connection..."); //FIXME
}
QString KonsoleViewFactory::connectButtonText() const
{
return i18n("KRDC Konsole Connection");
}
QString KonsoleViewFactory::connectToolTipText() const
{
return i18n("<html>Enter the address here. Port is optional.<br />"
"<i>Example: konsoleserver (host)</i></html>");
}
#include "konsoleviewfactory.moc"
/*
SPDX-FileCopyrightText: 2009 Urs Wolfer <uwolfer@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KONSOLEVIEWFACTORY_H
#define KONSOLEVIEWFACTORY_H
#include "remoteviewfactory.h"
#include "konsoleview.h"
class KonsoleViewFactory : public RemoteViewFactory
{
Q_OBJECT
public:
explicit KonsoleViewFactory(QObject *parent, const QVariantList &args);
virtual ~KonsoleViewFactory();
virtual bool supportsUrl(const QUrl &url) const;
virtual RemoteView *createView(QWidget *parent, const QUrl &url, KConfigGroup configGroup);
virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent);
virtual QString scheme() const;
virtual QString connectActionText() const;
virtual QString connectButtonText() const;
virtual QString connectToolTipText() const;
};
#endif // KONSOLEVIEWFACTORY_H
{
"KPlugin": {
"Authors": [
{
"Email": "uwolfer@kde.org",
"Name": "Urs Wolfer",
"Name[ca@valencia]": "Urs Wolfer",
"Name[ca]": "Urs Wolfer",
"Name[en_GB]": "Urs Wolfer",
"Name[es]": "Urs Wolfer",
"Name[fr]": "Urs Wolfer",
"Name[it]": "Urs Wolfer",
"Name[nl]": "Urs Wolfer",
"Name[pt]": "Urs Wolfer",
"Name[ro]": "Urs Wolfer",
"Name[sk]": "Urs Wolfer",
"Name[sl]": "Urs Wolfer",
"Name[sv]": "Urs Wolfer",
"Name[uk]": "Urs Wolfer",
"Name[x-test]": "xxUrs Wolferxx"
}
],
"Category": "Service",
"Description": "Allows managing SSH or Telnet sessions through KRDC",
"Description[ca@valencia]": "Permet gestionar sessions SSH o Telnet mitjançant KRDC",
"Description[ca]": "Permet gestionar sessions SSH o Telnet mitjançant el KRDC",
"Description[en_GB]": "Allows managing SSH or Telnet sessions through KRDC",
"Description[es]": "Permite la gestión de sesiones SSH y Telnet mediante KRDC",
"Description[fr]": "Permet la gestion de sessions « SSH » ou « Telnet » grâce à KRDC",
"Description[it]": "Consente la gestione di sessioni SSH o Telnet con KRDC",
"Description[nl]": "Staat het beheer van ssh- of telnet-sessies toe via KRDC",
"Description[pt]": "Permite gerir as sessões de SSH ou Telnet através do KRDC",
"Description[ro]": "Permite gestiunea sesiunilor SSH sau Telnet prin KRDC",
"Description[sk]": "Umožňuje spravovanie sedení SSH alebo Telnet pomocou aplikácie KRDC",
"Description[sl]": "Dovoljuje upravljanje sej SSH ali Telnet prek KRDC",
"Description[sv]": "Tillåter hantering av SSH- eller Telnet-sessioner via KRDC",
"Description[uk]": "Надає змогу керувати сеансами SSH або Telnet за допомогою KRDC",
"Description[x-test]": "xxAllows managing SSH or Telnet sessions through KRDCxx",
"EnabledByDefault": true,
"Icon": "krdc",
"Id": "krdc_konsoleplugin",
"License": "GPL",
"Name": "Konsole",
"Name[ca@valencia]": "Konsole",
"Name[ca]": "Konsole",
"Name[en_GB]": "Konsole",
"Name[es]": "Konsole",
"Name[fr]": "Konsole",
"Name[it]": "Konsole",
"Name[nl]": "Konsole",
"Name[pt]": "Konsole",
"Name[ro]": "Konsolă",
"Name[sk]": "Konsole",
"Name[sl]": "Konsole",
"Name[sv]": "Terminal",
"Name[uk]": "Konsole",
"Name[x-test]": "xxKonsolexx"
},
"X-KDE-KRDC-Sorting": 70
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment