Commit 99f5ff34 authored by Adriaan de Groot's avatar Adriaan de Groot 💬
Browse files

Remove NX support

Summary:
Although NX still exists, and nomachine.com offers downloads for
Linux, the NX plugin for krdc was never updated since KDE 4.2.
Let's call 8 years with no development a "unused, remove" kind of feature.

Test Plan:
The top-level CMakeLists.txt had the check for NX commented out,
and the sub-CMakeLists.txt checked for a _FOUND that couldn't
possibly be set.

Reviewers: uwolfer

Subscribers: aacid

Differential Revision: https://phabricator.kde.org/D23453
parent 122b0474
......@@ -99,9 +99,6 @@ set_package_properties(freerdp PROPERTIES
PURPOSE "The xfreerdp binary is needed for RDP support in KRDC (at runtime)"
TYPE RUNTIME
)
# NX support is not ready for KDE 4.2; disabled (uwolfer)
# macro_optional_find_package(LibNXCL)
# macro_log_feature(LIBNXCL_FOUND "libnxcl" "NX X compression client library" "http://svn.berlios.de/svnroot/repos/freenx/trunk/freenx-client/nxcl/" FALSE "1.0" "Needed to build Krdc with NX support")
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
......@@ -112,7 +109,6 @@ include_directories(
add_subdirectory(core)
add_subdirectory(vnc)
add_subdirectory(nx)
add_subdirectory(rdp)
add_subdirectory(test)
......
if(LIBNXCL_FOUND)
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5013)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${LIBNXCL_INCLUDE_DIR}
)
set(nxplugin_SRCS
nxhostpreferences.cpp
nxclientthread.cpp
nxviewfactory.cpp
nxview.cpp
nxcallbacks.cpp
nxresumesessions.cpp
)
kde4_add_ui_files(nxplugin_SRCS
nxpreferences.ui
nxresumesessions.ui
)
kde4_add_plugin(krdc_nxplugin ${nxplugin_SRCS})
target_link_libraries(krdc_nxplugin
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${LIBNXCL_LIBRARIES}
krdccore
)
set(kcm_krdc_nxplugin_SRCS
nxpreferences.cpp
)
kde4_add_plugin(kcm_krdc_nxplugin ${kcm_krdc_nxplugin_SRCS})
target_link_libraries(kcm_krdc_nxplugin
${KDE4_KDEUI_LIBS}
krdccore
)
add_dependencies(kcm_krdc_nxplugin krdc_nxplugin)
install(TARGETS kcm_krdc_nxplugin DESTINATION ${PLUGIN_INSTALL_DIR})
install(TARGETS krdc_nxplugin DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES krdc_nx.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES krdc_nx_config.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES nx.protocol DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES default.dsa.key DESTINATION ${DATA_INSTALL_DIR}/krdc)
endif(LIBNXCL_FOUND)
-----BEGIN DSA PRIVATE KEY-----
MIIBuwIBAAKBgQCXv9AzQXjxvXWC1qu3CdEqskX9YomTfyG865gb4D02ZwWuRU/9
C3I9/bEWLdaWgJYXIcFJsMCIkmWjjeSZyTmeoypI1iLifTHUxn3b7WNWi8AzKcVF
aBsBGiljsop9NiD1mEpA0G+nHHrhvTXz7pUvYrsrXcdMyM6rxqn77nbbnwIVALCi
xFdHZADw5KAVZI7r6QatEkqLAoGBAI4L1TQGFkq5xQ/nIIciW8setAAIyrcWdK/z
5/ZPeELdq70KDJxoLf81NL/8uIc4PoNyTRJjtT3R4f8Az1TsZWeh2+ReCEJxDWgG
fbk2YhRqoQTtXPFsI4qvzBWct42WonWqyyb1bPBHk+JmXFscJu5yFQ+JUVNsENpY
+Gkz3HqTAoGANlgcCuA4wrC+3Cic9CFkqiwO/Rn1vk8dvGuEQqFJ6f6LVfPfRTfa
QU7TGVLk2CzY4dasrwxJ1f6FsT8DHTNGnxELPKRuLstGrFY/PR7KeafeFZDf+fJ3
mbX5nxrld3wi5titTnX+8s4IKv29HJguPvOK/SI7cjzA+SqNfD7qEo8CFDIm1xRf
8xAPsSKs6yZ6j1FNklfu
-----END DSA PRIVATE KEY-----
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KRDC/Plugin
Icon=krdc
Name=NX
Name[bg]=NX
Name[bs]=NX
Name[ca]=NX
Name[ca@valencia]=NX
Name[cs]=NX
Name[da]=NX
Name[de]=NX
Name[el]=NX
Name[en_GB]=NX
Name[eo]=NX
Name[es]=NX
Name[et]=NX
Name[eu]=NX
Name[fi]=NX
Name[fr]=NX
Name[ga]=NX
Name[gl]=NX
Name[hr]=NX
Name[hu]=NX
Name[ia]=NX
Name[is]=NX
Name[it]=NX
Name[ja]=NX
Name[kk]=NX
Name[km]=NX
Name[ko]=NX
Name[lt]=NX
Name[lv]=NX
Name[mr]=एन-एक्स
Name[nb]=NX
Name[nds]=NX
Name[nl]=NX
Name[nn]=NX
Name[pa]=NX
Name[pl]=NX
Name[pt]=NX
Name[pt_BR]=NX
Name[ro]=NX
Name[ru]=NX
Name[si]=NX
Name[sk]=NX
Name[sl]=NX
Name[sr]=НИкс
Name[sr@ijekavian]=НИкс
Name[sr@ijekavianlatin]=NX
Name[sr@latin]=NX
Name[sv]=NX
Name[tr]=NX
Name[ug]=NX
Name[uk]=NX
Name[wa]=NX
Name[x-test]=xxNXxx
Name[zh_CN]=NX
Name[zh_TW]=NX
Comment=Allows managing NX sessions through KRDC
Comment[bg]=Управление на сесии на NX с KRDC
Comment[bs]=Dopušta upravljanje NX sesijama kroz KRDC
Comment[ca]=Permet gestionar sessions NX mitjançant el KRDC
Comment[ca@valencia]=Permet gestionar sessions NX mitjançant el KRDC
Comment[cs]=Umožňuje spravování sezení NX pomocí KRDC
Comment[da]=Muliggør håndtering af NX-sessioner via KRDC
Comment[de]=Erlaubt die Verwaltung von NX-Sitzungen über KRDC
Comment[el]=Επιτρέπει τη διαχείριση συνεδριών NX μέσω του KRDC
Comment[en_GB]=Allows managing NX sessions through KRDC
Comment[es]=Permite la gestión de sesiones NX mediante KRDC
Comment[et]=NX-seansside haldamise võimaldamine KRDC kaudu
Comment[eu]=NX saioak KRDC bidez kudeatzea baimentzen du
Comment[fi]=Mahdollistaa NX-istuntojen hallinnan KRDC:llä
Comment[fr]=Permet de gérer des sessions « NX » au travers de KRDC
Comment[ga]=Ceadaíonn sé duit seisiúin NX a bhainistiú trí KRDC
Comment[gl]=Permite xestionar sesións NX por medio de KRDC
Comment[hr]=Omogućuje upravljanje sjednicama NX-a kroz KRDC
Comment[hu]=NX-elérés KRDC-ből
Comment[ia]=Permitte gerer sessiones NX per medio de KRDC
Comment[is]=Gefur kost á að stjórna NX setum með KRDC
Comment[it]=Permette di gestire sessioni NX con KRDC
Comment[ja]=KRDC から NX セッションを管理できるようにします
Comment[kk]=KRDC арқылы NX сеанстарын басқаруға мүмкіндік беру
Comment[km]=អនុញ្ញាត​ឲ្យ​គ្រប់គ្រង​សម័យ NX តាមរយៈ KRDC
Comment[ko]=KRDC를 통해서 NX 세션 관리하기
Comment[lt]=Leidžia valdyti NX sesijas per KRDC
Comment[lv]=Ļauj pārvaldīt NX sesijas caur KRDC
Comment[nb]=Tillater å styre NX-økter gjennom KRDC
Comment[nds]=NX-Törns över KRDC plegen
Comment[nl]=Staat het beheren van NX-sessies toe via KRDC
Comment[nn]=Lèt deg handtera NX-økter gjennom KRDC
Comment[pl]=Pozwala na zarządzanie sesjami NX przez KRDC
Comment[pt]=Permite a gestão de sessões NX através do KRDC
Comment[pt_BR]=Permite o gerenciamento de sessões NX através do KRDC
Comment[ro]=Permite gestiunea sesiunilor NX prin KRDC
Comment[ru]=Разрешить управление сеансами NX через KRDC
Comment[si]=KRDC හරහා NX වාර පාලනයට ඉඩ දෙයි
Comment[sk]=Umožňuje spravovanie sedení NX pomocou aplikácie KRDC
Comment[sl]=Omogoča upravljanje sej NX prek KRDC
Comment[sr]=Управљање НИкс сесијама кроз КРДЦ
Comment[sr@ijekavian]=Управљање НИкс сесијама кроз КРДЦ
Comment[sr@ijekavianlatin]=Upravljanje NX sesijama kroz KRDC
Comment[sr@latin]=Upravljanje NX sesijama kroz KRDC
Comment[sv]=Tillåter hantering av NX-sessioner via KRDC
Comment[th]=อนุญาตให้ทำการจัดการวาระการเชื่อมต่อ NX ผ่านทางโปรแกรม KRDC
Comment[tr]=NX oturumlarını KRDC üzerinden yönetmeye izin verir
Comment[uk]=Надає змогу керувати сеансами NX за допомогою KRDC
Comment[x-test]=xxAllows managing NX sessions through KRDCxx
Comment[zh_CN]=允许用户通过 KRDC 管理 NX 会话
Comment[zh_TW]=允許透過 KRDC 管理 NX 工作階段
X-KDE-PluginInfo-Author=David Gross
X-KDE-PluginInfo-Email=gdavid.devel@gmail.com
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-Category=Service
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-KDE-Library=krdc_nxplugin
X-KDE-PluginInfo-Name=krdc_nxplugin
X-KDE-KRDC-Sorting=40
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KCModule
Name=NX
Name[bg]=NX
Name[bs]=NX
Name[ca]=NX
Name[ca@valencia]=NX
Name[cs]=NX
Name[da]=NX
Name[de]=NX
Name[el]=NX
Name[en_GB]=NX
Name[eo]=NX
Name[es]=NX
Name[et]=NX
Name[eu]=NX
Name[fi]=NX
Name[fr]=NX
Name[ga]=NX
Name[gl]=NX
Name[hr]=NX
Name[hu]=NX
Name[ia]=NX
Name[is]=NX
Name[it]=NX
Name[ja]=NX
Name[kk]=NX
Name[km]=NX
Name[ko]=NX
Name[lt]=NX
Name[lv]=NX
Name[mr]=एन-एक्स
Name[nb]=NX
Name[nds]=NX
Name[nl]=NX
Name[nn]=NX
Name[pa]=NX
Name[pl]=NX
Name[pt]=NX
Name[pt_BR]=NX
Name[ro]=NX
Name[ru]=NX
Name[si]=NX
Name[sk]=NX
Name[sl]=NX
Name[sr]=НИкс
Name[sr@ijekavian]=НИкс
Name[sr@ijekavianlatin]=NX
Name[sr@latin]=NX
Name[sv]=NX
Name[tr]=NX
Name[ug]=NX
Name[uk]=NX
Name[wa]=NX
Name[x-test]=xxNXxx
Name[zh_CN]=NX
Name[zh_TW]=NX
X-KDE-Library=kcm_krdc_nxplugin
X-KDE-ParentComponents=krdc_nxplugin
[Protocol]
exec=krdc '%u'
protocol=nx
input=none
output=none
helper=true
listing=
reading=false
writing=false
makedir=false
deleting=false
Icon=krdc
/****************************************************************************
* **
* ** Copyright (C) 2008 David Gross <gdavid.devel@gmail.com>
* **
* ** This file is part of KDE.
* **
* ** 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.
* **
* ****************************************************************************/
#include "nxcallbacks.h"
NxCallbacks::NxCallbacks()
{
}
NxCallbacks::~NxCallbacks()
{
}
void NxCallbacks::write(std::string msg)
{
Q_UNUSED(msg);
}
void NxCallbacks::write(int num, std::string msg)
{
emit progress(num, QString(msg.c_str()));
}
void NxCallbacks::error(std::string msg)
{
Q_UNUSED(msg);
}
void NxCallbacks::debug(std::string msg)
{
Q_UNUSED(msg);
}
void NxCallbacks::stdoutSignal(std::string msg)
{
Q_UNUSED(msg);
}
void NxCallbacks::stderrSignal(std::string msg)
{
Q_UNUSED(msg);
}
void NxCallbacks::stdinSignal(std::string msg)
{
Q_UNUSED(msg);
}
void NxCallbacks::resumeSessionsSignal(std::list<nxcl::NXResumeData> sessions)
{
QList<nxcl::NXResumeData> qsessions;
for (std::list<nxcl::NXResumeData>::const_iterator it = sessions.begin(); it != sessions.end(); ++it)
qsessions << (*it);
emit suspendedSessions(qsessions);
}
void NxCallbacks::noSessionsSignal()
{
emit noSessions();
}
void NxCallbacks::serverCapacitySignal()
{
emit atCapacity();
}
void NxCallbacks::connectedSuccessfullySignal()
{
}
/****************************************************************************
**
** Copyright (C) 2008 David Gross <gdavid.devel@gmail.com>
**
** This file is part of KDE.
**
** 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 NXCALLBACKS_H
#define NXCALLBACKS_H
#include <nxcl/nxclientlib.h>
#include <nxcl/nxdata.h>
#include <list>
#include <string>
#include <QList>
#include <QObject>
class NxCallbacks : public QObject, public nxcl::NXClientLibExternalCallbacks
{
Q_OBJECT
public:
NxCallbacks();
virtual ~NxCallbacks();
virtual void write(std::string msg);
virtual void write(int num, std::string msg);
virtual void error(std::string msg);
virtual void debug(std::string msg);
virtual void stdoutSignal(std::string msg);
virtual void stderrSignal(std::string msg);
virtual void stdinSignal(std::string msg);
virtual void resumeSessionsSignal(std::list<nxcl::NXResumeData> sessions);
virtual void noSessionsSignal();
virtual void serverCapacitySignal();
virtual void connectedSuccessfullySignal();
signals:
void progress(int, QString);
void suspendedSessions(QList<nxcl::NXResumeData>);
void noSessions();
void atCapacity();
};
#endif
/****************************************************************************
**
** Copyright (C) 2008 David Gross <gdavid.devel@gmail.com>
**
** This file is part of KDE.
**
** 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.
**
****************************************************************************/
#include "nxclientthread.h"
#include "nxcallbacks.h"
#include <kglobal.h>
#include <kstandarddirs.h>
#include <QDesktopWidget>
#include <QApplication>
#include <QFile>
NxClientThread::NxClientThread(QObject *parent)
: QThread(parent),
m_host(std::string()),
m_port(0),
m_privateKey(std::string()),
m_xid(0),
m_stopped(false)
{
m_client.setSessionData(&m_data);
QDesktopWidget *desktop = QApplication::desktop();
int currentScreen = desktop->screenNumber();
QRect rect = desktop->screenGeometry(currentScreen);
m_client.setResolution(rect.width(), rect.height());
m_client.setDepth(24);
m_client.setRender(true);
m_data.sessionName = "krdcSession";
m_data.cache = 8;
m_data.images = 32;
m_data.linkType = "adsl";
m_data.render = true;
m_data.backingstore = "when_requested";
m_data.imageCompressionMethod = 2;
m_data.keyboard = "defkeymap";
m_data.media = false;
m_data.agentServer = "";
m_data.agentUser = "";
m_data.agentPass = "";
m_data.cups = 0;
m_data.suspended = false;
m_data.fullscreen = false;
m_data.encryption = true;
m_data.terminate = false;
}
NxClientThread::~NxClientThread()
{
stop();
wait(500);
}
void NxClientThread::setCallbacks(NxCallbacks *callbacks)
{
m_client.setExternalCallbacks(callbacks);
}
void NxClientThread::setHost(const QString &host)
{
QMutexLocker locker(&m_mutex);
QByteArray tmp = host.toAscii();
m_host = tmp.data();
}
void NxClientThread::setPort(int port)
{
QMutexLocker locker(&m_mutex);
m_port = port;
}
void NxClientThread::setUserName(const QString &userName)
{
QMutexLocker locker(&m_mutex);
std::string userNameStr = std::string(userName.toAscii().data());
m_client.setUsername(userNameStr);
}
void NxClientThread::setPassword(const QString &password)
{
QMutexLocker locker(&m_mutex);
std::string passwordStr = std::string(password.toAscii());
m_client.setPassword(passwordStr);
}
void NxClientThread::setResolution(int width, int height)
{
QMutexLocker locker(&m_mutex);
m_data.geometry = width + 'x' + height + "+0+0";
}
void NxClientThread::setDesktopType(const QString &desktopType)
{
QMutexLocker locker(&m_mutex);
QByteArray tmp = desktopType.toAscii();
m_data.sessionType = tmp.data();
}
void NxClientThread::setKeyboardLayout(const QString &keyboardLayout)
{
QMutexLocker locker(&m_mutex);
QByteArray tmp = keyboardLayout.toAscii();
m_data.kbtype = tmp.data();
}
void NxClientThread::setPrivateKey(const QString &privateKey)
{
QMutexLocker locker(&m_mutex);
QByteArray tmp = privateKey.toAscii();
m_privateKey = tmp.data();
}
void NxClientThread::setSuspended(bool suspended)
{
QMutexLocker locker(&m_mutex);
m_data.suspended = suspended;
}
void NxClientThread::setId(const QString &id)
{
QMutexLocker locker(&m_mutex);
QByteArray tmp = id.toAscii();
m_data.id = tmp.data();
}
void NxClientThread::stop()
{
QMutexLocker locker(&m_mutex);
m_stopped = true;
}
void NxClientThread::run()
{
if (m_privateKey.compare("default") == 0) {
const QString keyfilename = QString("default.dsa.key");
const QString keyfilepath = KGlobal::dirs()->findResource("appdata", keyfilename);
QFile file(keyfilepath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
QByteArray key;
while (!file.atEnd())
key += file.readLine();
m_client.invokeNXSSH("supplied", m_host, true, key.data(), m_port);
} else
m_client.invokeNXSSH("supplied", m_host, true, m_privateKey, m_port);
nxcl::notQProcess* p;
while (!m_client.getIsFinished() && !m_stopped) {
if (!m_client.getReadyForProxy()) {
p = m_client.getNXSSHProcess();
p->probeProcess();
} else {
p = m_client.getNXSSHProcess();
p->probeProcess();
p = m_client.getNXProxyProcess();
p->probeProcess();
}
if (!this->m_xid) {
this->m_xid = m_client.getXID();
if (this->m_xid)
emit hasXid(this->m_xid);
}
usleep(1000);