diff --git a/TODO b/TODO index 424dfc60..9d2f614c 100644 --- a/TODO +++ b/TODO @@ -2,18 +2,18 @@ For 3.2: - write SLP service template for remote desktop protocols (documentation) -- when krfb is started with URL arguments and without connection - quality, add some kind of smart algorithm to determine whether the - other host is local (maybe using SLP to announce the connectivity - of a LAN) +- extend VNC to enable/disable desktop wallpaper - enhance RFB with SASL authentication (Kerberos) - encrypted connections (using SASL and/or SSL/TLS) - with kerberos/ssl: display name of remote user in connection dialog, kpassivepopup and systray (if name is available) -- try to solve the non-atomic KConfig changes problem - mention that invitations are one-time on personal invitation dialog Todo (unscheduled features): +- when krfb is started with URL arguments and without connection + quality, add some kind of smart algorithm to determine whether the + other host is local (maybe using SLP to announce the connectivity + of a LAN) - NAT traversal support if I can find an acceptable implementation (probably using TURN, as soon as there is a server and newer spec for that) - when OpenSLP supports this, allow scope configuration diff --git a/kcm_krfb/configurationwidget.ui b/kcm_krfb/configurationwidget.ui index fa256ef9..62c95415 100644 --- a/kcm_krfb/configurationwidget.ui +++ b/kcm_krfb/configurationwidget.ui @@ -1,4 +1,4 @@ - + ConfigurationWidget @@ -23,7 +23,7 @@ unnamed - 11 + 0 6 @@ -148,7 +148,7 @@ enableSLPCB - Announce &service on the network + Announce service &on the network true @@ -162,7 +162,7 @@ confirmConnectionsCB - &Confirm uninvited connections before accepting + Confirm uninvited connections &before accepting If enabled, a dialog will appear when somebody attempts to connect, asking you whether you want to accept the connection. @@ -222,7 +222,7 @@ - &Password: + Pass&word: passwordInput @@ -265,6 +265,75 @@ + + + tab + + + &Session + + + + unnamed + + + 11 + + + 6 + + + + GroupBox4 + + + Session preferences + + + + unnamed + + + 11 + + + 6 + + + + disableBackgroundCB + + + Disable &background image + + + false + + + Check this option to disable the background image during a remote session. + + + + + + + Spacer4 + + + Vertical + + + Expanding + + + + 0 + 20 + + + + + tab @@ -304,7 +373,7 @@ autoPortCB - A&ssign port automatically + Assi&gn port automatically true @@ -341,7 +410,7 @@ TextLabel1_2 - &Port: + P&ort: portInput @@ -436,4 +505,8 @@ Most VNC clients use a display number instead of the actual port. This display n portInput + + knuminput.h + knuminput.h + diff --git a/kcm_krfb/kcm_krfb.cpp b/kcm_krfb/kcm_krfb.cpp index 4533b173..5a927047 100644 --- a/kcm_krfb/kcm_krfb.cpp +++ b/kcm_krfb/kcm_krfb.cpp @@ -84,6 +84,7 @@ KcmKRfb::KcmKRfb(QWidget *p, const char *name, const QStringList &) : connect(&m_configuration, SIGNAL(invitationNumChanged(int)), this, SLOT(setInvitationNum(int))); setInvitationNum(m_configuration.invitations().size()); + connect(m_confWidget->disableBackgroundCB, SIGNAL(clicked()), SLOT(configChanged()) ); } KcmKRfb::~KcmKRfb() { delete m_about; @@ -133,6 +134,7 @@ void KcmKRfb::load() { m_confWidget->autoPortCB->setChecked(m_configuration.preferredPort()<0); m_confWidget->portInput->setValue(m_configuration.preferredPort()> 0 ? m_configuration.preferredPort() : 5900); + m_confWidget->disableBackgroundCB->setChecked(m_configuration.disableBackground()); } void KcmKRfb::save() { @@ -148,6 +150,7 @@ void KcmKRfb::save() { m_configuration.setPreferredPort(-1); else m_configuration.setPreferredPort(m_confWidget->portInput->value()); + m_configuration.setDisableBackground(m_confWidget->disableBackgroundCB->isChecked()); m_configuration.save(); } @@ -162,6 +165,7 @@ void KcmKRfb::defaults() { m_confWidget->passwordInput->setText(""); m_confWidget->autoPortCB->setChecked(true); m_confWidget->portInput->setValue(5900); + m_confWidget->disableBackgroundCB->setChecked(false); } const KAboutData *KcmKRfb::aboutData() const diff --git a/krfb/configuration.cc b/krfb/configuration.cc index 321bedde..461f71b0 100644 --- a/krfb/configuration.cc +++ b/krfb/configuration.cc @@ -144,6 +144,7 @@ void Configuration::loadFromKConfig() { askOnConnectFlag = c.readBoolEntry("confirmUninvitedConnection", true); allowDesktopControlFlag = c.readBoolEntry("allowDesktopControl", false); preferredPortNum = c.readNumEntry("preferredPort", -1); + disableBackgroundFlag = c.readBoolEntry("disableBackground", false); if (c.hasKey("uninvitedPasswordCrypted")) passwordString = cryptStr(c.readEntry("uninvitedPasswordCrypted", "")); else @@ -159,6 +160,7 @@ void Configuration::loadFromKConfig() { invalidateOldInvitations(); if (invNum != invitationList.size()) emit invitationNumChanged(invitationList.size()); + } void Configuration::saveToKConfig() { @@ -169,6 +171,7 @@ void Configuration::saveToKConfig() { c.writeEntry("allowUninvited", allowUninvitedFlag); c.writeEntry("enableSLP", enableSLPFlag); c.writeEntry("preferredPort", preferredPortNum); + c.writeEntry("disableBackground", disableBackgroundFlag); c.writeEntry("uninvitedPasswordCrypted", cryptStr(passwordString)); c.deleteEntry("uninvitedPassword"); @@ -274,6 +277,10 @@ QValueList &Configuration::invitations() { return invitationList; } +bool Configuration::disableBackground() const { + return disableBackgroundFlag; +} + void Configuration::setAllowUninvited(bool allowUninvited) { allowUninvitedFlag = allowUninvited; } @@ -316,6 +323,9 @@ int Configuration::preferredPort() const return preferredPortNum; } +void Configuration::setDisableBackground(bool disable) { + disableBackgroundFlag = disable; +} ////////////// invitation manage dialog ////////////////////////// diff --git a/krfb/configuration.h b/krfb/configuration.h index 5ed21142..204ac5d4 100644 --- a/krfb/configuration.h +++ b/krfb/configuration.h @@ -59,12 +59,14 @@ public: QString hostname() const; int port() const; int preferredPort() const; + bool disableBackground() const; void setAllowUninvited(bool allowUninvited); void setEnableSLP(bool e); void setAskOnConnect(bool askOnConnect); void setPassword(QString password); void setPreferredPort(int p); + void setDisableBackground(bool disable); void save(); void update(); @@ -114,6 +116,8 @@ private: QString passwordString; QValueList invitationList; + + bool disableBackgroundFlag; private slots: void refreshTimeout(); diff --git a/krfb/main.cpp b/krfb/main.cpp index 8a62beb8..37457518 100644 --- a/krfb/main.cpp +++ b/krfb/main.cpp @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) "(c) 2000-2001, Const Kaplinsky\n" "(c) 2000, Tridia Corporation\n" "(c) 1999, AT&T Laboratories Cambridge\n", - 0, "", "ml@tjansen.de"); + 0, "", "tim@tjansen.de"); aboutData.addAuthor("Tim Jansen", "", "tim@tjansen.de"); aboutData.addAuthor("Ian Reinhart Geiser", "DCOP interface", "geiseri@kde.org"); aboutData.addCredit("Johannes E. Schindelin", @@ -95,6 +95,8 @@ int main(int argc, char *argv[]) aboutData.addCredit("Jason Spisak", I18N_NOOP("Connection side image"), "kovalid@yahoo.com"); + aboutData.addCredit("Karl Vogel", + I18N_NOOP("KDesktop background deactivation")); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineArgs::addCmdLineOptions(options); diff --git a/krfb/rfbcontroller.cc b/krfb/rfbcontroller.cc index ef750d9d..ee941787 100644 --- a/krfb/rfbcontroller.cc +++ b/krfb/rfbcontroller.cc @@ -499,6 +499,15 @@ bool RFBController::checkAsyncEvents() return closed; } +void RFBController::restoreBackground() { + if (configuration->disableBackground()) { + DCOPRef ref("kdesktop", "KBackgroundIface"); + ref.setDCOPClient(KApplication::dcopClient()); + + ref.send("setBackgroundEnabled(bool)", bool(true)); + } +} + void RFBController::connectionClosed() { KNotifyClient::event("ConnectionClosed", @@ -506,6 +515,7 @@ void RFBController::connectionClosed() .arg(remoteIp)); idleTimer.stop(); + restoreBackground(); state = RFB_WAITING; if (forcedClose) emit quitApp(); @@ -517,6 +527,8 @@ void RFBController::closeConnection() { forcedClose = true; if (state == RFB_CONNECTED) { + restoreBackground(); + if (!checkAsyncEvents()) { asyncMutex.lock(); if (!closePending) @@ -735,6 +747,12 @@ void RFBController::sendKNotifyEvent(const QString &n, const QString &d) void RFBController::sendSessionEstablished() { + if (configuration->disableBackground()) { + DCOPRef ref("kdesktop", "KBackgroundIface"); + ref.setDCOPClient(KApplication::dcopClient()); + + ref.send("setBackgroundEnabled(bool)", bool(false)); + } emit sessionEstablished(remoteIp); } diff --git a/krfb/rfbcontroller.h b/krfb/rfbcontroller.h index a13454d8..50fcc891 100644 --- a/krfb/rfbcontroller.h +++ b/krfb/rfbcontroller.h @@ -160,6 +160,7 @@ private: void sendKNotifyEvent(const QString &name, const QString &desc); bool checkAsyncEvents(); void sendSessionEstablished(); + void restoreBackground(); QString remoteIp; bool allowDesktopControl;