1
0
mirror of https://invent.kde.org/network/krfb synced 2024-07-01 07:24:29 +00:00

kcm module, multithread inetd, new uis for invitations

svn path=/trunk/kdenetwork/krfb/; revision=142276
This commit is contained in:
Tim Jansen 2002-03-10 23:22:25 +00:00
parent cba2a6bae1
commit 788b31b6c6
21 changed files with 1018 additions and 95 deletions

View File

@ -1,3 +1,15 @@
2002-03-11 Tim Jansen <tjansen@tjansen.de>
* integrated KCModule
* added ui-Files for invitations
* added multithreaded inetd capabilities to libvncserver
2002-03-02 Tim Jansen <tjansen@tjansen.de>
* added kinetd
2002-02-24 Tim Jansen <tjansen@tjansen.de>
* fixed DCOP port() call

View File

@ -1,26 +0,0 @@
Modes & Security
================
KRfb has 3 different security modes
- stand-alone:
+ traditional mode like in versions < 0.7
+ kinetd always disabled
+ KRfb only accepts connections from the time the user
started it until he quits krfb
+ no security restrictions (password can be empty)
- daemon/invitation only:
+ new default since 0.7
+ kinetd is only enabled after the user invited someone
+ krfb only accepts invited users, all other requests will be
denied
- daemon/open
+ kinetd is always enabled
+ a password must be set (enforced by kcontrol module, so this
can be overidden by editing the configuration)
+ kinetd accepts both invited and other users
- an invitation is a password that expires after a default of 60 min
- because of limitations in the Rfb protocol a connecting client must always
enter a password while invitations are valid, even if it is empty

View File

@ -1,4 +1,4 @@
SUBDIRS = kinetd libvncserver krfb po doc
SUBDIRS = kinetd kcm_krfb libvncserver krfb po doc
EXTRA_DIST = admin AUTHORS COPYING ChangeLog INSTALL README TODO NOTES \
ROADMAP DCOP-INTERFACE krfb.lsm

10
NOTES
View File

@ -21,8 +21,12 @@ Comments on various aspects of KRfb:
for --one-connection
- the newconnection-dialog is extra large and has the pixmap on the left
side to capture the attention of the user before allowing a connection.
- the auto-port-selection feature is somewhat inconvenient when you have
more than one VNC server running (you cannot know the port). Problems
willbe solved in a future version when there is an invitation feature.
Do the following files when releasing a new version:
- configure.in.in: change the AM_INIT_AUTOMAKE macro
- krfb/main.cpp: change the VERSION macro
- kcm_krfb/kcm_krfb.cpp: change the VERSION macro
- krfb.lsm: change the version field
tim@tjansen.de

12
ROADMAP
View File

@ -9,12 +9,16 @@ Version 0.6 (2002/02/18): Improved RFB backend
Version 0.7: Better integration with KDE, improved GUI
- kded module 'kinetd' that listens on the Rfb port and starts KRfb
-> remove debug msgs, better error handling
-> fetch new services while running
- invitation support
-> check for xp dialogs
- kcontrol module
- on startup a dialog appears that allows the user to invite somebody
using email (and later other mechanisms). Dialog can be turned off forever,
of course
- remove STDOUT/STDERR logging
-> on startup a dialog appears that allows the user to invite somebody
using email (and later other mechanisms). Dialog can be turned off forever,
of course
-> remove STDOUT/STDERR logging
-> add isConnected() dcop call
Version 0.8:
- i18n

20
kcm_krfb/Makefile.am Normal file
View File

@ -0,0 +1,20 @@
METASOURCES = AUTO
# Code
lib_LTLIBRARIES = libkcm_krfb.la
libkcm_krfb_la_SOURCES = kcm_krfb.cpp kcm_krfb.h configurationwidget.ui
libkcm_krfb_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
libkcm_krfb_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
# Services
kcmdir = $(kde_appsdir)/Settings/System
kcm_DATA = kcmkrfb.desktop
EXTRA_DIST = $(libkcm_krfb_la_SOURCES)\
$(kcm_DATA)
# set the include path for X, qt and KDE
INCLUDES= $(all_includes)

View File

@ -0,0 +1,247 @@
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>ConfigurationWidget</class>
<widget class="QWidget">
<property name="name">
<cstring>ConfigurationWidget</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>353</width>
<height>318</height>
</rect>
</property>
<property name="caption">
<string>ConfWidget</string>
</property>
<property name="icon">
<pixmap>image0</pixmap>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QButtonGroup">
<property name="name">
<cstring>runModeGroup</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Run Mode</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QRadioButton">
<property name="name">
<cstring>runInBackgroundRB</cstring>
</property>
<property name="text">
<string>Always run in &amp;background</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="whatsThis" stdset="0">
<string>Select this option to have Desktop Sharing always available. It will not accept connections unless you either enable uninvited connections or invite somebody. It will use less memory while waiting and you do not have to start or stop it in order to let somebody connect to you desktop.</string>
</property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>runOnDemandRB</cstring>
</property>
<property name="text">
<string>Run on &amp;demand</string>
</property>
<property name="whatsThis" stdset="0">
<string>Select this option to start and stop Desktop sharing manually.</string>
</property>
</widget>
</vbox>
</widget>
<widget class="QButtonGroup">
<property name="name">
<cstring>ButtonGroup7</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Uninvited Connections</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>allowUninvitedCB</cstring>
</property>
<property name="text">
<string>Allow &amp;uninvited connections</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="whatsThis" stdset="0">
<string>Select this option to allow connecting without inviting. This is useful if you want to access your desktop remotely.</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>confirmConnectionsCB</cstring>
</property>
<property name="text">
<string>&amp;Confirm uninvited connections before accepting</string>
</property>
<property name="whatsThis" stdset="0">
<string>If enabled a dialog will appear when somebody attempts to connect, asking you whether you want to accept the connection.</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>allowDesktopControlCB</cstring>
</property>
<property name="text">
<string>Allow u&amp;ninvited connections to control the desktop</string>
</property>
<property name="whatsThis" stdset="0">
<string>Enable this option to allow uninvited user to control your desktop (using mouse and keyboard).</string>
</property>
</widget>
<widget class="QFrame">
<property name="name">
<cstring>Frame4</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
</property>
<property name="frameShadow">
<enum>Plain</enum>
</property>
<property name="layoutMargin" stdset="0">
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>6</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QLabel">
<property name="name">
<cstring>TextLabel1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Password:</string>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>passwordInput</cstring>
</property>
<property name="maxLength">
<number>9</number>
</property>
<property name="echoMode">
<enum>Password</enum>
</property>
<property name="whatsThis" stdset="0">
<string>If you allow uninvited connections it is highly recommended to set a password in order to protect your computer from unauthorized access.</string>
</property>
</widget>
</vbox>
</widget>
</vbox>
</widget>
<widget class="QFrame">
<property name="name">
<cstring>Frame13</cstring>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
</property>
<property name="frameShadow">
<enum>Plain</enum>
</property>
</widget>
</vbox>
</widget>
<images>
<image name="image0">
<data format="XPM.GZ" length="8078">789cdd98c7721cc91186ef7c0a04f3c650d4b637a1d001de5b8200880d1db2da604038c29b0dbdbb32ffeceec582b30448015a85fa2726e69b32592633ab9abf7c98d8db589df8f0cbbbcb2bbe3aac26aa115f4c7ca8af4f4eee7ffde73f7e7bf73e2926e45f144413d1fbbfbd7bbf7935514dac9d9d360a540a50204f91827707f6e09d9ecb045c0c8c726e7be600e579cfde787960eb7f69e01cbc38b08d67a6e7cadaef0d8cc15336b0f5b73270095e1898c1d33dd7d65f3a30ca997b6eac7c75e00a3cdf738bf9f36dc789f5cfdd78c3a8e3bb9ebbfa67c651d0b4e059e3b4ecca0fc06110e636ff29701224b5958fc07990e7982f1f838ba0c863d4bfeb990bf06dcfb65eecc0555065980faff45cdafc6e94c57c5085e0497012266cfd7f06a761da98fd7be3346d6d3e042ec222857d5eee39afc14b3d97369e4d30879cc31e1f82abb04a8dbf2847611426d6df09b8888a18fdd145cf564ee7039bbd4fe0322a131baf0773c4dd78578de3dcfc81bf1a6741577e04aea22a36ffb4f2366a538cdf61be71a002c37f623c688f7889b3986d3c740dce55ca1efb19972a947f04b30a7c05ae5460ac775cabd0ff3eb851c13ee697a8c398ff263d77fe760ad60db5f5c57e26910aed2b70ac42f95ec789ad1f617f123c28dfedd8a7660ff3497215cae14f89ec4e6bf383ff279cb0ad1f617f13af427dc46bd2a850bedf73b71f5bc659d2f9f38331e7564e985faa0e6af35b372eb8b6f961fc69a44239e22b8d55e035e33ca96dbf108f291e30fc2fcd5560c45f5aa49dbfd343cfa5cd7f71602b877fa4a50ae3413e49598572f853ea5528477e936013a11cf34f5b1518fb95052ad4477916aac073e04805463ece6215da07e04485f20d70aa02637db24285f94c0f0cfb0ef3cd4a15fac3fa659c716bf9cfec3377f1e642709575f9c7213eb24605b6f1b42af477a98c70c1781dfc01ee65feb7615c8a03a17c1b8c0d427bc4439ea9c0c87f391eb4afc1850aede17f79a902233fe75e0546fce5950a6ced1b1518f92c6f5560c46fa109d8e263aee7ce5fd1bed08465fb83f82f621518fe05f7b2fd803f633b301f1781310130fcadc083fe91bfc4f94428473e90c34104463e2abc0aeb61e5f5b01e8db10a8cfd281a15ea6f1bcbf6dbfa20df16ad0a8c7c50062a30e2bfd4846cf385bf20fd59fc7d34f67965ed11cf65a2c27c62b0844fe74fc83f703fac8747fc9479ef1fd41aabd03fe683e5b0f9e1bc2ef18011dfa55781719e9655d99d8f0ef9a0ac55b067fd377dff0ee74fd9aac028e780bbfb9047bc72d8f7478db10af5b15fac0794e527c4030febe30f3aeec7931aab501ff1cdc9b0bf38df905ecc7f70bf630d50ac175bfba2efdf4d1b73777f7038afb954c13efc957def8fdec65f0dfe3569ac42ff8877ae5311eab3f130be0b631518e7918f5460ecb78f55609cbf382e2cfe71fff4591cc6b67e386fe0ce367e9c5fd84e1b1fee239e55606b5fa9c0b82ff95a85fe111fbef56d63fb8178ab8234b0f3cee1fe54e985c5ce1b8cb78afaf3c0e17cc3f16dfb83f8a9121518f9bd2afaf561ac078663f1087fa9e5f6d79d7fe71db71d633feb34f4a1ddcf118f75a502aff7dcd59f346eea8e919f6a3cd81fe4c7bad11b0f18f9b389faf5a559631518ebd170d3e577c27e3778c0c8cf4807666fbe63dfd547be40b8d8f981fcd9e251debc7a5bfd3fd970f4b6ea6cb0f3ae7a1379c79d0def6ad7bc896ae73b1b9550fb266a5cf5071b076ef48a3318497fdfda18b9c357dc8943e9ef5b1bc2afe84f439fdfda18efe3eecb78fd594cfc6fd9403f47eed89db85377e6beba737c5ec86f47ee12ba72d7eee65b7b2fb1d18df356dadfc1c6bd7b7093d2df949b76336e56becdb979b720658b6ec92dbb15b7ea7ecec68d5b73eb9d8d0de97bd36db98f6e5b2cad49ff7332ab4f52b2e376dd9eb4fe211bd2fb9e8cebb3accb2c32c0a6db7781f4baef42c8beebe7ba8bc4eeb1cc65512c0d6bf6021bb72e76898c3b95fe16e4db9cacd4becb9e7c6ebb5c4a75fd1624166a996d2163bb79a18d52685dfa08c9c96865e5895c46fce433971a819b222f9f3955549346f7f5f33630df496aa5fd9cf4f3209f0734a2c331fa227bd4d721cc6ec10574841ebe6fe356b4a4eb43c774e20ee994cee82b9dd3c5139dcbaf67526a3aa64bf7402c6b78891ebe6fa3141d637d8ec5c2155d4b5f37744b774f742bbf7e9552d3bd58913594b98cd0c3f76d8c44fbb63e92d7127aa0499aa2699a79a269f975524a5b95ccbb5fbd7df1e6fbefdba04b99f59c3b84029aa5399aa705e973919668b9d392d00cadd02aadd13a6dd026cdcabea38dcc678bb69eb1712ffa28b557685b2c7c1a6c2cd10eed76da119aa13db1f299f6c5caa6d49ba56d8976b1213bbff0cc5a8928704b144acb88624a28a58c722aa864c7e2b4eca814ca75c5e4a5de7325354da15be25a6672fcbc0d6eac8dbc257866f4d5f2018ff810a587f2ed80db3136b44df3fcf9f1a73646fc858f507a24df466f62e3984ffa338e4f84feaa79c8ce4b0efa791b2fd90ff1603e7d990dc955f0abdf6d8cf5ab8c523ee3af7cde8de8c2ad0f169ecfbb44a77cc9577ccd3712012b120963e2836ff98eeff98127bb55bab4de5f98dbe517b132c5d37c2d91bc2a56c6c439cff02ccff124cf77abb4f023365047577ec15df2222ff132af3ccd57bcca6bbcce1bac2f5f8dd45b787cdff8817bc97023e3cda77997b7f823eb4938d4f9c9bbcfef363e3d3d3f788777794f6efcffa18d71d69eeaf5ee893faabfdec6ab69bc0dbc7ff067de7f95b7c3f1ef1f788fa223b9535db9377a8fe280438e38e6c48d38e54cbe871cd87b1d37b84b8ce49e7b80d1ac0ddf1f973eae33f67d90732eb8f4ce935bf3ec3d97c27957774dee43aa44eef1adfc25c3f7c7a58feb8cb5e12bce7ded1b2fe3f40762a516aebaba07729b55ddc93b482b7f77c3f7c7a58feb3cb1e147725b997a0bd1961ffd17ff2fe36d6dfcebefeffe0dd22dc353</data>
</image>
</images>
<connections>
<connection>
<sender>allowUninvitedCB</sender>
<signal>toggled(bool)</signal>
<receiver>confirmConnectionsCB</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>allowUninvitedCB</sender>
<signal>toggled(bool)</signal>
<receiver>allowDesktopControlCB</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>allowUninvitedCB</sender>
<signal>toggled(bool)</signal>
<receiver>passwordInput</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections>
<layoutdefaults spacing="6" margin="11"/>
</UI>

174
kcm_krfb/kcm_krfb.cpp Normal file
View File

@ -0,0 +1,174 @@
/***************************************************************************
kcm_krfb.cpp
--------------
begin : Sat Mar 02 2002
copyright : (C) 2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 "kcm_krfb.h"
#include <qlayout.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qlineedit.h>
#include <qbuttongroup.h>
#include <qcstring.h>
#include <qdatastream.h>
#include <kapplication.h>
#include <kdialog.h>
#include <klocale.h>
#include <kaboutdata.h>
#include <kconfig.h>
#include <kgenericfactory.h>
#include <kdatastream.h>
#include <kdebug.h>
#include <dcopclient.h>
#define VERSION "0.7"
typedef KGenericFactory<KcmKRfb, QWidget> KcmKRfbFactory;
K_EXPORT_COMPONENT_FACTORY( libkcm_krfb, KcmKRfbFactory("kcm_krfb") );
KcmKRfb::KcmKRfb(QWidget *p, const char *name, const QStringList &) :
KCModule(p, name),
confWidget(this) {
QVBoxLayout *l = new QVBoxLayout(this, 0, KDialog::spacingHint());
l->add(&confWidget);
setButtons(Default|Apply|Reset);
about = new KAboutData( "kcm_krfb", I18N_NOOP("Desktop Sharing Control Module"),
VERSION,
I18N_NOOP("Configure desktop sharing"), KAboutData::License_GPL,
"(c) 2002, Tim Jansen\n",
0, "http://www.tjansen.de/krfb", "tim@tjansen.de");
about->addAuthor("Tim Jansen", 0, "tim@tjansen.de");
load();
connect(confWidget.passwordInput, SIGNAL(textChanged(const QString&)), SLOT(configChanged()) );
connect(confWidget.runOnDemandRB, SIGNAL(toggled(bool)), SLOT(configChanged()) );
connect(confWidget.allowUninvitedCB, SIGNAL(clicked()), SLOT(configChanged()) );
connect(confWidget.confirmConnectionsCB, SIGNAL(clicked()), SLOT(configChanged()) );
connect(confWidget.allowDesktopControlCB, SIGNAL(clicked()), SLOT(configChanged()) );
}
KcmKRfb::~KcmKRfb() {
delete about;
}
void KcmKRfb::configChanged() {
emit changed(true);
}
void KcmKRfb::checkKInetd(bool &available, bool &enabled) {
available = false;
enabled = false;
DCOPClient *d = KApplication::dcopClient();
QByteArray sdata, rdata;
QCString replyType;
QDataStream arg(sdata, IO_WriteOnly);
arg << QString("krfb");
if (!d->call ("kded", "kinetd", "isEnabled(QString)", sdata, replyType, rdata))
return;
if (replyType != "bool")
return;
QDataStream answer(rdata, IO_ReadOnly);
answer >> enabled;
available = true;
}
void KcmKRfb::setKInetd(bool enabled) {
DCOPClient *d = KApplication::dcopClient();
QByteArray sdata;
QDataStream arg(sdata, IO_WriteOnly);
arg << QString("krfb");
arg << enabled;
if (!d->send ("kded", "kinetd", "setEnabled(QString,bool)", sdata)) {
confWidget.runInBackgroundRB->setEnabled(false);
confWidget.runOnDemandRB->setChecked(true);
}
}
void KcmKRfb::load() {
bool kinetdAvailable, kinetdEnabled;
checkKInetd(kinetdAvailable, kinetdEnabled);
if (!kinetdAvailable) {
confWidget.runInBackgroundRB->setEnabled(false);
confWidget.runOnDemandRB->setChecked(true);
}
else {
confWidget.runInBackgroundRB->setEnabled(true);
confWidget.runInBackgroundRB->setChecked(kinetdEnabled);
confWidget.runOnDemandRB->setChecked(!kinetdEnabled);
}
KConfig c("krfbrc");
confWidget.allowUninvitedCB->setChecked(c.readBoolEntry("allowUninvited", false));
confWidget.confirmConnectionsCB->setChecked(c.readBoolEntry("confirmUninvitedConnection", false));
confWidget.allowDesktopControlCB->setChecked(c.readBoolEntry("allowDesktopControl", false));
confWidget.passwordInput->setText(c.readEntry("uninvitedPassword", ""));
}
void KcmKRfb::save() {
KConfig c("krfbrc");
setKInetd(!confWidget.runOnDemandRB->isChecked());
c.writeEntry("allowUninvited", confWidget.allowUninvitedCB->isChecked());
c.writeEntry("confirmUninvitedConnection", confWidget.confirmConnectionsCB->isChecked());
c.writeEntry("allowDesktopControl", confWidget.allowDesktopControlCB->isChecked());
c.writeEntry("uninvitedPassword", confWidget.passwordInput->text());
}
void KcmKRfb::defaults() {
bool kinetdAvailable, kinetdEnabled;
checkKInetd(kinetdAvailable, kinetdEnabled);
if (!kinetdAvailable) {
confWidget.runInBackgroundRB->setEnabled(false);
confWidget.runOnDemandRB->setChecked(true);
}
else {
confWidget.runInBackgroundRB->setEnabled(true);
confWidget.runInBackgroundRB->setChecked(true);
confWidget.runOnDemandRB->setChecked(false);
}
confWidget.allowUninvitedCB->setChecked(false);
confWidget.confirmConnectionsCB->setChecked(false);
confWidget.allowDesktopControlCB->setChecked(false);
confWidget.passwordInput->setText("");
}
const KAboutData *KcmKRfb::aboutData() const
{
return about;
}
QString KcmKRfb::quickHelp() const
{
return i18n("<h1>desktop sharing</h1> This module allows you to configure"
" the KDE desktop sharing.");
}

View File

@ -1,8 +1,8 @@
/***************************************************************************
kinetd.h
kcm_krfb.h
------------
begin : Mon Feb 11 2002
begin : Sat Mar 02 2002
copyright : (C) 2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
@ -16,27 +16,32 @@
* *
***************************************************************************/
#ifndef _KINETD_H_
#define _KINETD_H_
#ifndef _KCM_KRFB_H_
#define _KCM_KRFB_H_
#include <kservice.h>
class PortListener {
#include <qobject.h>
#include <kcmodule.h>
#include "configurationwidget.h"
class KcmKRfb : public KCModule {
Q_OBJECT
private:
QString serviceName;
int port;
QCString execPath;
public:
PortListener(KService::Ptr s);
ConfigurationWidget confWidget;
KAboutData *about;
void checkKInetd(bool &available, bool &enabled);
void setKInetd(bool enabled);
public:
KcmKRfb(QWidget *p, const char *name, const QStringList &);
~KcmKRfb();
}
void load();
void save();
void defaults();
QString quickHelp() const;
const KAboutData *aboutData() const;
private slots:
void configChanged();
};
#endif

10
kcm_krfb/kcmkrfb.desktop Normal file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Icon=krfb
Type=Application
Exec=kcmshell kcmkrfb
X-KDE-ModuleType=Library
X-KDE-Library=krfb
Name=Desktop Sharing Configuration

View File

@ -4,6 +4,7 @@ METASOURCES = AUTO
lib_LTLIBRARIES = libkded_kinetd.la
libkded_kinetd_la_SOURCES = kinetd.cpp kinetd.h kinetd.skel
libkded_kinetd_la_LDFLAGS = $(all_libraries) -module -avoid-version
libkded_kinetd_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
# Services

View File

@ -93,20 +93,7 @@ void PortListener::loadConfig(KService::Ptr s) {
if (vmultiInstance.isValid())
multiInstance = vmultiInstance.toBool();
KStandardDirs ksd;
QString configName = ksd.findResource("config", "kinetdrc");
if (configName.isNull()) {
QString d = ksd.saveLocation("config");
if (!d.isNull())
configName = d + "/kinetdrc";
else {
valid = false;
kdDebug() << "Unable to create configuration" << endl;
return;
}
}
config = new KConfig(configName);
config = new KConfig("kinetdrc");
config->setGroup("ListenerConfig");
enabled = config->readBoolEntry("enabled_" + serviceName, enabled);
}
@ -121,9 +108,10 @@ void PortListener::accepted(KSocket *sock) {
}
process.clearArguments();
// TODO: call now:
// process << argument << sock->socket();
// process.start(DontCare);
process << argument << sock->socket();
if (!process.start(KProcess::DontCare) {
kdDebug() << "kinetd: Calling process failed" << endl;
}
delete sock;
}

View File

@ -24,7 +24,7 @@
#include <qlineedit.h>
#include <qcheckbox.h>
void ConfigurationDialog2::closeEvent(QCloseEvent *)
void ConfigurationDialog2::closeEvent(QCloseEvent *)
{
emit closed();
}
@ -36,16 +36,16 @@ Configuration::Configuration() :
loadFromKConfig();
saveToDialog();
connect(confDlg.okButton, SIGNAL(clicked()),
connect(confDlg.okButton, SIGNAL(clicked()),
SLOT(okPressed()));
connect(confDlg.cancelButton, SIGNAL(clicked()),
connect(confDlg.cancelButton, SIGNAL(clicked()),
SLOT(cancelPressed()));
connect(confDlg.applyButton, SIGNAL(clicked()),
connect(confDlg.applyButton, SIGNAL(clicked()),
SLOT(applyPressed()));
connect(&confDlg, SIGNAL(closed()), SLOT(cancelPressed()));
}
Configuration::Configuration(bool oneConnection, bool askOnConnect,
Configuration::Configuration(bool oneConnection, bool askOnConnect,
bool allowDesktopControl, QString password) :
preconfiguredFlag(true),
askOnConnectFlag(askOnConnect),
@ -64,7 +64,7 @@ void Configuration::loadFromKConfig() {
return;
KConfig *config = KGlobal::config();
askOnConnectFlag = config->readBoolEntry("askOnConnect", true);
allowDesktopControlFlag = config->readBoolEntry("allowDesktopControl",
allowDesktopControlFlag = config->readBoolEntry("allowDesktopControl",
false);
passwordString = config->readEntry("password", "");
}
@ -94,6 +94,11 @@ void Configuration::saveToDialog() {
confDlg.passwordInput->setText(passwordString);
}
void Configuration::reload() {
loadFromKConfig();
saveToDialog();
}
bool Configuration::preconfigured() const {
return preconfiguredFlag;
}

View File

@ -2,7 +2,7 @@
configuration.h
-------------------
begin : Tue Dec 11 2001
copyright : (C) 2001 by Tim Jansen
copyright : (C) 2001-2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
@ -33,21 +33,20 @@ signals:
};
/**
* This class stores the app's configuration and also 'drives'
* the configuration dialog.
* This class stores the app's configuration
* @author Tim Jansen
*/
class Configuration : public QObject {
Q_OBJECT
public:
Configuration();
Configuration(bool oneConnection, bool askOnConnect,
Configuration(bool oneConnection, bool askOnConnect,
bool allowDesktopControl, QString password);
~Configuration();
bool preconfigured() const;
bool oneConnection() const;
bool askOnConnect() const;
bool askOnConnect() const;
bool allowDesktopControl() const;
QString password() const;
@ -55,6 +54,7 @@ public:
void setAskOnConnect(bool askOnConnect);
void setAllowDesktopControl(bool allowDesktopControl);
void setPassword(QString password);
void reload();
signals:
void passwordChanged();
@ -63,10 +63,10 @@ public slots:
void showDialog();
private:
void loadFromKConfig();
void loadFromDialog();
void saveToKConfig();
void saveToDialog();
void loadFromKConfig();
void loadFromDialog();
void saveToKConfig();
void saveToDialog();
ConfigurationDialog2 confDlg;
QIntValidator *portValidator;

196
krfb/invite.ui Normal file

File diff suppressed because one or more lines are too long

View File

@ -19,6 +19,12 @@ k_dcop:
*/
virtual void exit() = 0;
/**
* Tells krfb to re-load the configuration. This is usually
* called by the KControl module.
*/
virtual void reloadConfig() = 0;
/**
* If true krfb will disconnect after a client disconnected.
* @return true if oneConnection feature is turned on
@ -60,8 +66,9 @@ k_dcop:
virtual void setAllowDesktopControl(bool a) = 0;
/**
* Sets the default password. An empty password can be used to deactivate
* the password authentication, but only if krfb is in stand-alone mode.
* Sets the password for uninvited sessions. An empty password can be used
* to deactivate the password authentication, but only if krfb is in
* stand-alone mode.
* @param p the password to set
*/
virtual void setPassword(QString p) = 0;

View File

@ -31,6 +31,10 @@ void KRfbIfaceImpl::exit()
{
emit exitApp();
}
void KRfbIfaceImpl::reloadConfig()
{
return configuration->reload();
}
bool KRfbIfaceImpl::oneConnection()
{
return configuration->oneConnection();

View File

@ -24,6 +24,7 @@ public:
void disconnect();
// void setWindowID(int);
void exit();
void reloadConfig();
bool oneConnection();
void setOneConnection(bool);

View File

@ -35,7 +35,7 @@
#include <signal.h>
#define VERSION "0.6"
#define VERSION "0.7"
static const char *description = I18N_NOOP("VNC-compatible server to share "
"KDE desktops");
@ -71,20 +71,20 @@ int main(int argc, char *argv[])
0, "http://www.tjansen.de/krfb", "ml@tjansen.de");
aboutData.addAuthor("Tim Jansen", "", "tim@tjansen.de");
aboutData.addAuthor("Ian Reinhart Geiser", "DCOP interface", "geiseri@kde.org");
aboutData.addCredit("Johannes E. Schindelin",
aboutData.addCredit("Johannes E. Schindelin",
I18N_NOOP("libvncserver"));
aboutData.addCredit("Const Kaplinsky",
I18N_NOOP("TightVNC encoder"));
aboutData.addCredit("Tridia Corporation",
I18N_NOOP("ZLib encoder"));
aboutData.addCredit("AT&T Laboratories Cambridge",
aboutData.addCredit("AT&T Laboratories Cambridge",
I18N_NOOP("original VNC encoders and "
"protocol design"));
aboutData.addCredit("Jens Wagner (heXoNet Support GmbH)",
I18N_NOOP("x11 update scanner, "
"original code base"));
aboutData.addCredit("Jason Spisak",
I18N_NOOP("Connection side image"),
aboutData.addCredit("Jason Spisak",
I18N_NOOP("Connection side image"),
"kovalid@yahoo.com");
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options);

265
krfb/personalinvitation.ui Normal file

File diff suppressed because one or more lines are too long

View File

@ -242,7 +242,7 @@ clientOutput(void *data)
UNLOCK(cl->updateMutex); /* we really needn't lock now. */
}
}
/* OK, now, to save bandwidth, wait a little while for more
updates to come along. */
usleep(cl->screen->rfbDeferUpdateTime * 1000);
@ -301,8 +301,14 @@ listenerRun(void *data)
len = sizeof(peer);
if (rfbScreen->inetdSock != -1) {
cl = rfbNewClient(rfbScreen, rfbScreen->inetdSock);
rfbStartOnHoldClient(cl);
return;
}
/* TODO: this thread wont die by restarting the server */
while ((client_fd = accept(rfbScreen->rfbListenSock,
while ((client_fd = accept(rfbScreen->rfbListenSock,
(struct sockaddr*)&peer, &len)) >= 0) {
cl = rfbNewClient(rfbScreen,client_fd);
len = sizeof(peer);
@ -489,7 +495,7 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
rfbScreen->rfbNeverShared = FALSE;
rfbScreen->rfbDontDisconnect = FALSE;
rfbScreen->rfbAuthPasswdData = 0;
rfbScreen->width = width;
rfbScreen->height = height;
rfbScreen->bitsPerPixel = rfbScreen->depth = 8*bytesPerPixel;