diff --git a/TODO b/TODO index a679687d..847cffcd 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,6 @@ Known bugs: Todo (soon): - fix shutdown connection in kinetd nide -- remove the standalone & command line modes (="run on demand" in kcontrol) Todo (unscheduled features): - SLP support (or UPnP, or whatever KDE will use) diff --git a/kcm_krfb/configurationwidget.ui b/kcm_krfb/configurationwidget.ui index 7b4968c4..953fada3 100644 --- a/kcm_krfb/configurationwidget.ui +++ b/kcm_krfb/configurationwidget.ui @@ -9,7 +9,7 @@ 0 0 394 - 345 + 260 @@ -28,58 +28,6 @@ 6 - - - runModeGroup - - - - 5 - 1 - 0 - 0 - - - - Run Mode - - - - unnamed - - - 11 - - - 6 - - - - runInBackgroundRB - - - Always run in &background - - - true - - - 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. - - - - - runOnDemandRB - - - Run on &demand - - - Select this option to start and stop Desktop sharing manually. - - - - GroupBox1 diff --git a/kcm_krfb/kcm_krfb.cpp b/kcm_krfb/kcm_krfb.cpp index 503761fc..1796ccfe 100644 --- a/kcm_krfb/kcm_krfb.cpp +++ b/kcm_krfb/kcm_krfb.cpp @@ -61,7 +61,6 @@ KcmKRfb::KcmKRfb(QWidget *p, const char *name, const QStringList &) : load(); connect(m_confWidget.passwordInput, SIGNAL(textChanged(const QString&)), SLOT(configChanged()) ); - connect(m_confWidget.runOnDemandRB, SIGNAL(toggled(bool)), SLOT(configChanged()) ); connect(m_confWidget.allowUninvitedCB, SIGNAL(clicked()), SLOT(configChanged()) ); connect(m_confWidget.confirmConnectionsCB, SIGNAL(clicked()), SLOT(configChanged()) ); connect(m_confWidget.allowDesktopControlCB, SIGNAL(clicked()), SLOT(configChanged()) ); @@ -104,15 +103,6 @@ void KcmKRfb::load() { bool kinetdAvailable, krfbAvailable; checkKInetd(kinetdAvailable, krfbAvailable); - if (!krfbAvailable) { - m_confWidget.runInBackgroundRB->setEnabled(false); - m_confWidget.runOnDemandRB->setChecked(true); - } - else { - bool daemonMode = m_configuration.daemonMode(); - m_confWidget.runInBackgroundRB->setChecked(daemonMode); - m_confWidget.runOnDemandRB->setChecked(!daemonMode); - } m_confWidget.allowUninvitedCB->setChecked(m_configuration.allowUninvitedConnections()); m_confWidget.confirmConnectionsCB->setChecked(m_configuration.askOnConnect()); m_confWidget.allowDesktopControlCB->setChecked(m_configuration.allowDesktopControl()); @@ -121,9 +111,8 @@ void KcmKRfb::load() { void KcmKRfb::save() { + m_configuration.update(); bool allowUninvited = m_confWidget.allowUninvitedCB->isChecked(); - bool daemonMode = !m_confWidget.runOnDemandRB->isChecked(); - m_configuration.setDaemonMode(daemonMode); m_configuration.setAllowUninvited(allowUninvited); m_configuration.setAskOnConnect(m_confWidget.confirmConnectionsCB->isChecked()); m_configuration.setAllowDesktopControl(m_confWidget.allowDesktopControlCB->isChecked()); @@ -135,15 +124,6 @@ void KcmKRfb::defaults() { bool kinetdAvailable, krfbAvailable; checkKInetd(kinetdAvailable, krfbAvailable); - if (!krfbAvailable) { - m_confWidget.runInBackgroundRB->setEnabled(false); - m_confWidget.runOnDemandRB->setChecked(true); - } - else { - m_confWidget.runInBackgroundRB->setEnabled(true); - m_confWidget.runInBackgroundRB->setChecked(true); - m_confWidget.runOnDemandRB->setChecked(false); - } m_confWidget.allowUninvitedCB->setChecked(false); m_confWidget.confirmConnectionsCB->setChecked(false); m_confWidget.allowDesktopControlCB->setChecked(false); @@ -157,7 +137,7 @@ const KAboutData *KcmKRfb::aboutData() const QString KcmKRfb::quickHelp() const { - return i18n("

desktop sharing

This module allows you to configure" + return i18n("

Desktop Sharing Configuration

This module allows you to configure" " the KDE desktop sharing."); } diff --git a/krfb/Makefile.am b/krfb/Makefile.am index 6e0cebff..833cdc23 100644 --- a/krfb/Makefile.am +++ b/krfb/Makefile.am @@ -2,7 +2,7 @@ METASOURCES = AUTO noinst_LIBRARIES = libkrfbconfig.a -libkrfbconfig_a_SOURCES = configuration.cc configurationdialog.ui manageinvitations.ui personalinvitation.ui \ +libkrfbconfig_a_SOURCES = configuration.cc manageinvitations.ui personalinvitation.ui \ invite.ui invitation.cc configuration_hostname.cpp @@ -17,7 +17,7 @@ kde_services_DATA = kinetd_krfb.desktop EXTRA_DIST = $(krfb_SOURCES) $(kde_services_DATA) krfb.desktop \ lo32-app-krfb.png lo16-app-krfb.png rfbcontroller.h \ - eyes-closed24.png eyes-open24.png xupdatescanner.h trayicon.h \ + eyes-open24.png xupdatescanner.h trayicon.h \ configuration.h invitation.h krfbiface.h krfbiface.kidl eventsrc install-data-local: @@ -26,7 +26,6 @@ install-data-local: $(mkinstalldirs) $(kde_datadir)/krfb $(INSTALL_DATA) $(srcdir)/eventsrc $(kde_datadir)/krfb/eventsrc $(mkinstalldirs) $(kde_datadir)/krfb/pics - $(INSTALL_DATA) $(srcdir)/eyes-closed24.png $(kde_datadir)/krfb/pics/eyes-closed24.png $(INSTALL_DATA) $(srcdir)/eyes-open24.png $(kde_datadir)/krfb/pics/eyes-open24.png $(INSTALL_DATA) $(srcdir)/connection-side-image.png $(kde_datadir)/krfb/pics/connection-side-image.png @@ -34,7 +33,6 @@ uninstall-local: -rm -f $(kde_appsdir)/Applications/krfb.desktop -rm -f $(kde_datadir)/krfb/eventsrc -rm -f $(kde_datadir)/krfb/pics/eyes-open24.png - -rm -f $(kde_datadir)/krfb/pics/eyes-closed24.png KDE_ICON = krfb diff --git a/krfb/configuration.cc b/krfb/configuration.cc index d89c5da1..f0595cab 100644 --- a/krfb/configuration.cc +++ b/krfb/configuration.cc @@ -30,8 +30,6 @@ #include #include -void ConfigurationDialog2::closeEvent(QCloseEvent *) -{ emit closed(); } void ManageInvitationsDialog2::closeEvent(QCloseEvent *) { emit closed(); } void InvitationDialog2::closeEvent(QCloseEvent *) @@ -41,23 +39,12 @@ void PersonalInvitationDialog2::closeEvent(QCloseEvent *) Configuration::Configuration(krfb_mode mode) : m_mode(mode), - oneConnectionFlag(false), portNum(-1) { loadFromKConfig(); saveToDialogs(); doKinetdConf(); - connect(confDlg.okButton, SIGNAL(clicked()), SLOT(configOkPressed())); - connect(confDlg.cancelButton, SIGNAL(clicked()), SLOT(configCancelPressed())); - connect(confDlg.applyButton, SIGNAL(clicked()), SLOT(configApplyPressed())); - connect(&confDlg, SIGNAL(closed()), SLOT(configCancelPressed())); - - connect(confDlg.passwordInput, SIGNAL(textChanged(const QString&)), SLOT(configChanged()) ); - connect(confDlg.allowUninvitedCB, SIGNAL(clicked()), SLOT(configChanged()) ); - connect(confDlg.askOnConnectCB, SIGNAL(clicked()), SLOT(configChanged()) ); - connect(confDlg.allowDesktopControlCB, SIGNAL(clicked()), SLOT(configChanged()) ); - connect(invMngDlg.closeButton, SIGNAL(clicked()), SLOT(invMngDlgClosed())); connect(&invMngDlg, SIGNAL(closed()), SLOT(invMngDlgClosed())); connect(invMngDlg.newButton, SIGNAL(clicked()), SLOT(showInvitationDialog())); @@ -72,39 +59,16 @@ Configuration::Configuration(krfb_mode mode) : SLOT(showPersonalInvitationDialog())); connect(invDlg.createInvitationEMailButton, SIGNAL(clicked()), SLOT(inviteEmail())); - if (m_mode != KRFB_STAND_ALONE) - invDlg.dontShowOnStartupButton->hide(); connect(persInvDlg.closeButton, SIGNAL(clicked()), SLOT(persInvDlgClosed())); connect(&persInvDlg, SIGNAL(closed()), SLOT(persInvDlgClosed())); - if ((m_mode == KRFB_STAND_ALONE) || - (m_mode == KRFB_KINETD_MODE) || - (m_mode == KRFB_CONFIGURATION_MODE)) { - connect(&expirationTimer, SIGNAL(timeout()), SLOT(invalidateOldInvitations())); - expirationTimer.start(1000*60); - } - -} - -Configuration::Configuration(bool oneConnection, bool askOnConnect, - bool allowDesktopControl, QString password) : - m_mode(KRFB_STAND_ALONE_CMDARG), - askOnConnectFlag(askOnConnect), - allowDesktopControlFlag(allowDesktopControl), - oneConnectionFlag(oneConnection), - portNum(-1), - passwordString(password) -{ + connect(&expirationTimer, SIGNAL(timeout()), SLOT(invalidateOldInvitations())); + expirationTimer.start(1000*60); } Configuration::~Configuration() { -} - -// special static method to determine daemon mode before constructor was invoked -bool Configuration::earlyDaemonMode() { - KConfig c("krfbrc"); - return c.readBoolEntry("daemonMode", true); + save(); } void Configuration::setKInetd(bool enabled) { @@ -146,14 +110,10 @@ void Configuration::setPortKInetd() { void Configuration::removeInvitation(QValueList::iterator it) { invitationList.remove(it); - doKinetdConf(); + save(); } void Configuration::doKinetdConf() { - if (!daemonFlag) { - setKInetd(false); - return; - } if (allowUninvitedFlag) { setKInetd(true); @@ -181,14 +141,11 @@ void Configuration::doKinetdConf() { } void Configuration::loadFromKConfig() { - if (KRFB_STAND_ALONE_CMDARG == mode()) - return; + KConfig c("krfbrc"); - daemonFlag = c.readBoolEntry("daemonMode", true); allowUninvitedFlag = c.readBoolEntry("allowUninvited", false); askOnConnectFlag = c.readBoolEntry("confirmUninvitedConnection", true); allowDesktopControlFlag = c.readBoolEntry("allowDesktopControl", false); - showInvDlgOnStartupFlag = c.readBoolEntry("shovInvDlgOnStartup", false); passwordString = c.readEntry("uninvitedPassword", ""); invitationList.clear(); @@ -197,39 +154,15 @@ void Configuration::loadFromKConfig() { for (int i = 0; i < num; i++) invitationList.push_back(Invitation(&c, i)); - confDlg.applyButton->setEnabled(false); invalidateOldInvitations(); - -} - -void Configuration::loadFromDialogs() { - bool oldAllowUninvitedFlag = allowUninvitedFlag; - allowUninvitedFlag = confDlg.allowUninvitedCB->isChecked(); - askOnConnectFlag = confDlg.askOnConnectCB->isChecked(); - allowDesktopControlFlag = confDlg.allowDesktopControlCB->isChecked(); - - showInvDlgOnStartupFlag = !invDlg.dontShowOnStartupButton->isChecked(); - - QString newPassword = confDlg.passwordInput->text(); - if (passwordString != newPassword) { - passwordString = newPassword; - emit passwordChanged(); - } - - if (oldAllowUninvitedFlag != allowUninvitedFlag) - doKinetdConf(); } void Configuration::saveToKConfig() { - if (KRFB_STAND_ALONE_CMDARG == mode()) - return; KConfig c("krfbrc"); - c.writeEntry("daemonMode", daemonFlag); c.writeEntry("confirmUninvitedConnection", askOnConnectFlag); c.writeEntry("allowDesktopControl", allowDesktopControlFlag); c.writeEntry("allowUninvited", allowUninvitedFlag); - c.writeEntry("shovInvDlgOnStartup", showInvDlgOnStartupFlag); c.writeEntry("uninvitedPassword", passwordString); c.setGroup("invitations"); @@ -239,17 +172,9 @@ void Configuration::saveToKConfig() { while (i < num) invitationList[i++].save(&c, i); - confDlg.applyButton->setEnabled(false); } void Configuration::saveToDialogs() { - confDlg.allowUninvitedCB->setChecked(allowUninvitedFlag); - confDlg.askOnConnectCB->setChecked(askOnConnectFlag); - confDlg.allowDesktopControlCB->setChecked(allowDesktopControlFlag); - confDlg.passwordInput->setText(passwordString); - - invDlg.dontShowOnStartupButton->setChecked(!showInvDlgOnStartupFlag); - invalidateOldInvitations(); QValueList::iterator it = invitationList.begin(); while (it != invitationList.end()) { @@ -263,38 +188,32 @@ void Configuration::saveToDialogs() { invMngDlg.adjustSize(); } -void Configuration::reload() { - loadFromKConfig(); - saveToDialogs(); -} - void Configuration::save() { saveToKConfig(); saveToDialogs(); doKinetdConf(); } +void Configuration::update() { + loadFromKConfig(); + saveToDialogs(); +} + Invitation Configuration::createInvitation() { Invitation inv; invitationList.push_back(inv); - emit passwordChanged(); doKinetdConf(); return inv; } void Configuration::invalidateOldInvitations() { - bool changed = false; QValueList::iterator it = invitationList.begin(); while (it != invitationList.end()) { - if (!(*it).isValid()) { + if (!(*it).isValid()) it = invitationList.remove(it); - changed = true; - } else it++; } - if (changed) - emit passwordChanged(); } ///////// properties /////////////////////////// @@ -303,10 +222,6 @@ krfb_mode Configuration::mode() const { return m_mode; } -bool Configuration::oneConnection() const { - return oneConnectionFlag; -} - bool Configuration::askOnConnect() const { return askOnConnectFlag; } @@ -319,14 +234,6 @@ bool Configuration::allowUninvitedConnections() const { return allowUninvitedFlag; } -bool Configuration::showInvitationDialogOnStartup() const { - return showInvDlgOnStartupFlag; -} - -bool Configuration::daemonMode() const { - return daemonFlag; -} - QString Configuration::password() const { return passwordString; } @@ -335,19 +242,10 @@ QValueList &Configuration::invitations() { return invitationList; } -void Configuration::setDaemonMode(bool daemonMode) { - daemonFlag = daemonMode; -} - void Configuration::setAllowUninvited(bool allowUninvited) { allowUninvitedFlag = allowUninvited; } -void Configuration::setOnceConnection(bool oneConnection) -{ - oneConnectionFlag = oneConnection; -} - void Configuration::setAskOnConnect(bool askOnConnect) { askOnConnectFlag = askOnConnect; @@ -361,7 +259,6 @@ void Configuration::setAllowDesktopControl(bool allowDesktopControl) void Configuration::setPassword(QString password) { passwordString = password; - emit passwordChanged(); } int Configuration::port() const @@ -372,58 +269,20 @@ int Configuration::port() const return portNum - 5900; } -void Configuration::setPort(int p) { - portNum = p; -} // hostname is implemented in configuration_hostname.cpp // QString Configuration::hostname() -////////////// config dialog ////////////////////////// - -void Configuration::showConfigDialog() { - if (m_mode == KRFB_KINETD_MODE) { - KProcess p; - p << "kcmshell" << "kcmkrfb"; - p.start(KProcess::DontCare); - } - else { - loadFromKConfig(); - saveToDialogs(); - confDlg.show(); - } -} - -void Configuration::configOkPressed() { - loadFromDialogs(); - saveToKConfig(); - confDlg.hide(); -} - -void Configuration::configCancelPressed() { - saveToDialogs(); - confDlg.hide(); -} - -void Configuration::configApplyPressed() { - loadFromDialogs(); - saveToKConfig(); -} - -void Configuration::configChanged() { - confDlg.applyButton->setEnabled(true); -} - ////////////// invitation manage dialog ////////////////////////// void Configuration::showManageInvitationsDialog() { + loadFromKConfig(); saveToDialogs(); invMngDlg.show(); } void Configuration::invMngDlgClosed() { invMngDlg.hide(); - saveToKConfig(); } void Configuration::invMngDlgDeleteOnePressed() { @@ -436,14 +295,13 @@ void Configuration::invMngDlgDeleteOnePressed() { else it++; } - emit passwordChanged(); + saveToKConfig(); doKinetdConf(); } void Configuration::invMngDlgDeleteAllPressed() { invitationList.clear(); saveToKConfig(); - emit passwordChanged(); doKinetdConf(); } @@ -460,7 +318,6 @@ void Configuration::invDlgClosed() { } void Configuration::closeInvDlg() { - loadFromDialogs(); saveToKConfig(); invDlg.hide(); invMngDlg.newButton->setEnabled(true); diff --git a/krfb/configuration.h b/krfb/configuration.h index ba6fda9a..f26d8a10 100644 --- a/krfb/configuration.h +++ b/krfb/configuration.h @@ -20,7 +20,6 @@ #include "invitation.h" -#include "configurationdialog.h" #include "manageinvitations.h" #include "personalinvitation.h" #include "invite.h" @@ -33,20 +32,11 @@ enum krfb_mode { KRFB_UNKNOWN_MODE = 0, - KRFB_STAND_ALONE, - KRFB_STAND_ALONE_CMDARG, KRFB_KINETD_MODE, KRFB_INVITATION_MODE, KRFB_CONFIGURATION_MODE }; -class ConfigurationDialog2 : public ConfigurationDialog { - Q_OBJECT -public: - virtual void closeEvent(QCloseEvent *); -signals: - void closed(); -}; class ManageInvitationsDialog2 : public ManageInvitationsDialog { Q_OBJECT public: @@ -78,47 +68,35 @@ class Configuration : public QObject { Q_OBJECT public: Configuration(krfb_mode mode); - Configuration(bool oneConnection, bool askOnConnect, - bool allowDesktopControl, QString password); ~Configuration(); - static bool earlyDaemonMode(); - krfb_mode mode() const; - bool oneConnection() const; bool askOnConnect() const; bool allowDesktopControl() const; bool allowUninvitedConnections() const; - bool showInvitationDialogOnStartup() const; - bool daemonMode() const; QString password() const; QString hostname() const; int port() const; - void setDaemonMode(bool daemonMode); void setAllowUninvited(bool allowUninvited); - void setOnceConnection(bool oneConnection); void setAskOnConnect(bool askOnConnect); void setAllowDesktopControl(bool allowDesktopControl); void setPassword(QString password); - void reload(); void save(); + void update(); QValueList &invitations(); void removeInvitation(QValueList::iterator it); signals: - void passwordChanged(); void invitationFinished(); public slots: - void showConfigDialog(); void showManageInvitationsDialog(); void showInvitationDialog(); void showPersonalInvitationDialog(); void inviteEmail(); void invalidateOldInvitations(); - void setPort(int); private: void loadFromKConfig(); void loadFromDialogs(); @@ -133,7 +111,6 @@ private: krfb_mode m_mode; - ConfigurationDialog2 confDlg; ManageInvitationsDialog2 invMngDlg; InvitationDialog2 invDlg; PersonalInvitationDialog2 persInvDlg; @@ -142,20 +119,12 @@ private: bool askOnConnectFlag; bool allowDesktopControlFlag; bool allowUninvitedFlag; - bool oneConnectionFlag; - bool daemonFlag; - bool showInvDlgOnStartupFlag; int portNum; QString passwordString; QValueList invitationList; private slots: - void configOkPressed(); - void configCancelPressed(); - void configApplyPressed(); - void configChanged(); - void invMngDlgClosed(); void invMngDlgDeleteOnePressed(); void invMngDlgDeleteAllPressed(); diff --git a/krfb/configurationdialog.ui b/krfb/configurationdialog.ui deleted file mode 100644 index f0c3c95a..00000000 --- a/krfb/configurationdialog.ui +++ /dev/null @@ -1,279 +0,0 @@ - -ConfigurationDialog - - - ConfigurationDialog - - - - 0 - 0 - 335 - 255 - - - - Configuration - Desktop Sharing - - - image0 - - - - unnamed - - - 11 - - - 6 - - - - Frame7 - - - - 5 - 0 - 0 - 0 - - - - NoFrame - - - Plain - - - - - - unnamed - - - 11 - - - 6 - - - - allowUninvitedCB - - - Allow &uninvited connections - - - true - - - - - - Allow connections that do not follow a previous invitation. Be careful to protect your computer when you allow this. - - - - - askOnConnectCB - - - Confirm connection &before accepting - - - If this option is enabled, you will be asked whenever a remote user tries to connect to your display. This allows you to deny the request or to remove things that the remote user should not see before he connects. It is highly recommended to turn this on while you are working on this computer. If you do not enable this option, your only hint that somebody is connected is the small icon in your panel, showing an open eye. - - - - - allowDesktopControlCB - - - Allow &remote client to control the desktop - - - If you turn this option on, the remote user can enter keystrokes and use your mouse pointer. This gives him full control over your computer, so be careful. When the option is disabled the remote user can only watch your screen. - - - - - - - Frame4 - - - - 5 - 0 - 0 - 0 - - - - NoFrame - - - Plain - - - - - - unnamed - - - 6 - - - 6 - - - - TextLabel1 - - - - 1 - 0 - 0 - 0 - - - - Password: - - - - - passwordInput - - - 9 - - - Password - - - If you want to protect your system with a password, enter one here. It is highly recommended that you either do this or enable "ask before remote client connects". - - - - - - - Frame6 - - - - 5 - 0 - 0 - 0 - - - - NoFrame - - - Plain - - - - - - - - unnamed - - - 4 - - - 6 - - - - applyButton - - - &Apply - - - Click this to apply the changes immediately. - - - - - Spacer2 - - - Horizontal - - - Expanding - - - - 20 - 20 - - - - - - okButton - - - &Ok - - - true - - - Apply changes and close window. - - - - - cancelButton - - - &Cancel - - - Discard all changes and close window. - - - - - - - - - 789cdd98c7721cc91186ef7c0a04f3c650d4b637a1d001de5b8200880d1db2da604038c29b0dbdbb32ffeceec582b30448015a85fa2726e69b32592633ab9abf7c98d8db589df8f0cbbbcb2bbe3aac26aa115f4c7ca8af4f4eee7ffde73f7e7bf73e2926e45f144413d1fbbfbd7bbf7935514dac9d9d360a540a50204f91827707f6e09d9ecb045c0c8c726e7be600e579cfde787960eb7f69e01cbc38b08d67a6e7cadaef0d8cc15336b0f5b73270095e1898c1d33dd7d65f3a30ca997b6eac7c75e00a3cdf738bf9f36dc789f5cfdd78c3a8e3bb9ebbfa67c651d0b4e059e3b4ecca0fc06110e636ff29701224b5958fc07990e7982f1f838ba0c863d4bfeb990bf06dcfb65eecc0555065980faff45cdafc6e94c57c5085e0497012266cfd7f06a761da98fd7be3346d6d3e042ec222857d5eee39afc14b3d97369e4d30879cc31e1f82abb04a8dbf2847611426d6df09b8888a18fdd145cf564ee7039bbd4fe0322a131baf0773c4dd78578de3dcfc81bf1a6741577e04aea22a36ffb4f2366a538cdf61be71a002c37f623c688f7889b3986d3c740dce55ca1efb19972a947f04b30a7c05ae5460ac775cabd0ff3eb851c13ee697a8c398ff263d77fe760ad60db5f5c57e26910aed2b70ac42f95ec789ad1f617f123c28dfedd8a7660ff3497215cae14f89ec4e6bf383ff279cb0ad1f617f13af427dc46bd2a850bedf73b71f5bc659d2f9f38331e7564e985faa0e6af35b372eb8b6f961fc69a44239e22b8d55e035e33ca96dbf108f291e30fc2fcd5560c45f5aa49dbfd343cfa5cd7f71602b877fa4a50ae3413e49598572f853ea5528477e936013a11cf34f5b1518fb95052ad4477916aac073e04805463ece6215da07e04485f20d70aa02637db24285f94c0f0cfb0ef3cd4a15fac3fa659c716bf9cfec3377f1e642709575f9c7213eb24605b6f1b42af477a98c70c1781dfc01ee65feb7615c8a03a17c1b8c0d427bc4439ea9c0c87f391eb4afc1850aede17f79a902233fe75e0546fce5950a6ced1b1518f92c6f5560c46fa109d8e263aee7ce5fd1bed08465fb83f82f621518fe05f7b2fd803f633b301f1781310130fcadc083fe91bfc4f94428473e90c34104463e2abc0aeb61e5f5b01e8db10a8cfd281a15ea6f1bcbf6dbfa20df16ad0a8c7c50062a30e2bfd4846cf385bf20fd59fc7d34f67965ed11cf65a2c27c62b0844fe74fc83f703fac8747fc9479ef1fd41aabd03fe683e5b0f9e1bc2ef18011dfa55781719e9655d99d8f0ef9a0ac55b067fd377dff0ee74fd9aac028e780bbfb9047bc72d8f7478db10af5b15fac0794e527c4030febe30f3aeec7931aab501ff1cdc9b0bf38df905ecc7f70bf630d50ac175bfba2efdf4d1b73777f7038afb954c13efc957def8fdec65f0dfe3569ac42ff8877ae5311eab3f130be0b631518e7918f5460ecb78f55609cbf382e2cfe71fff4591cc6b67e386fe0ce367e9c5fd84e1b1fee239e55606b5fa9c0b82ff95a85fe111fbef56d63fb8178ab8234b0f3cee1fe54e985c5ce1b8cb78afaf3c0e17cc3f16dfb83f8a9121518f9bd2afaf561ac078663f1087fa9e5f6d79d7fe71db71d633feb34f4a1ddcf118f75a502aff7dcd59f346eea8e919f6a3cd81fe4c7bad11b0f18f9b389faf5a559631518ebd170d3e577c27e3778c0c8cf4807666fbe63dfd547be40b8d8f981fcd9e251debc7a5bfd3fd970f4b6ea6cb0f3ae7a1379c79d0def6ad7bc896ae73b1b9550fb266a5cf5071b076ef48a3318497fdfda18b9c357dc8943e9ef5b1bc2afe84f439fdfda18efe3eecb78fd594cfc6fd9403f47eed89db85377e6beba737c5ec86f47ee12ba72d7eee65b7b2fb1d18df356dadfc1c6bd7b7093d2df949b76336e56becdb979b720658b6ec92dbb15b7ea7ecec68d5b73eb9d8d0de97bd36db98f6e5b2cad49ff7332ab4f52b2e376dd9eb4fe211bd2fb9e8cebb3accb2c32c0a6db7781f4baef42c8beebe7ba8bc4eeb1cc65512c0d6bf6021bb72e76898c3b95fe16e4db9cacd4becb9e7c6ebb5c4a75fd1624166a996d2163bb79a18d52685dfa08c9c96865e5895c46fce433971a819b222f9f3955549346f7f5f33630df496aa5fd9cf4f3209f0734a2c331fa227bd4d721cc6ec10574841ebe6fe356b4a4eb43c774e20ee994cee82b9dd3c5139dcbaf67526a3aa64bf7402c6b78891ebe6fa3141d637d8ec5c2155d4b5f37744b774f742bbf7e9552d3bd58913594b98cd0c3f76d8c44fbb63e92d7127aa0499aa2699a79a269f975524a5b95ccbb5fbd7df1e6fbefdba04b99f59c3b84029aa5399aa705e973919668b9d392d00cadd02aadd13a6dd026cdcabea38dcc678bb69eb1712ffa28b557685b2c7c1a6c2cd10eed76da119aa13db1f299f6c5caa6d49ba56d8976b1213bbff0cc5a8928704b144acb88624a28a58c722aa864c7e2b4eca814ca75c5e4a5de7325354da15be25a6672fcbc0d6eac8dbc257866f4d5f2018ff810a587f2ed80db3136b44df3fcf9f1a73646fc858f507a24df466f62e3984ffa338e4f84feaa79c8ce4b0efa791b2fd90ff1603e7d990dc955f0abdf6d8cf5ab8c523ee3af7cde8de8c2ad0f169ecfbb44a77cc9577ccd3712012b120963e2836ff98eeff98127bb55bab4de5f98dbe517b132c5d37c2d91bc2a56c6c439cff02ccff124cf77abb4f023365047577ec15df2222ff132af3ccd57bcca6bbcce1bac2f5f8dd45b787cdff8817bc97023e3cda77997b7f823eb4938d4f9c9bbcfef363e3d3d3f788777794f6efcffa18d71d69eeaf5ee893faabfdec6ab69bc0dbc7ff067de7f95b7c3f1ef1f788fa223b9535db9377a8fe280438e38e6c48d38e54cbe871cd87b1d37b84b8ce49e7b80d1ac0ddf1f973eae33f67d90732eb8f4ce935bf3ec3d97c27957774dee43aa44eef1adfc25c3f7c7a58feb8cb5e12bce7ded1b2fe3f40762a516aebaba07729b55ddc93b482b7f77c3f7c7a58feb3cb1e147725b997a0bd1961ffd17ff2fe36d6dfcebefeffe0dd22dc353 - - - - - allowUninvitedCB - toggled(bool) - askOnConnectCB - setEnabled(bool) - - - allowUninvitedCB - toggled(bool) - allowDesktopControlCB - setEnabled(bool) - - - allowUninvitedCB - toggled(bool) - Frame4 - setEnabled(bool) - - - - diff --git a/krfb/eyes-closed.png b/krfb/eyes-closed.png deleted file mode 100644 index 3ed8bd28..00000000 Binary files a/krfb/eyes-closed.png and /dev/null differ diff --git a/krfb/eyes-closed24.png b/krfb/eyes-closed24.png deleted file mode 100644 index 3b9524a2..00000000 Binary files a/krfb/eyes-closed24.png and /dev/null differ diff --git a/krfb/invite.ui b/krfb/invite.ui index 0002ec0d..95f1593e 100644 --- a/krfb/invite.ui +++ b/krfb/invite.ui @@ -170,17 +170,6 @@ This button will start your email application with a pre-configured text that explains to the recipient how to connect to your computer.
- - - dontShowOnStartupButton - - - &Do not show this dialog on startup - - - If you enable this option, this screen will not be shown at each startup in the future. - - TextLabel1 diff --git a/krfb/krfbiface.h b/krfb/krfbiface.h index 11274aea..365c4b7a 100644 --- a/krfb/krfbiface.h +++ b/krfb/krfbiface.h @@ -8,55 +8,11 @@ class krfbIface : virtual public DCOPObject K_DCOP k_dcop: - /** - * If a client is connected it will be disconnected. - */ - virtual void disconnect() = 0; - /** * Quits krfb, connected clients will be disconnected. */ 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 - */ - virtual bool oneConnection() = 0; - - /** - * If set to true krfb will disconnect after a client disconnected. - * @param o true to turn oneConnection feature on. - */ - virtual void setOneConnection(bool o) = 0; - - /** - * If this feature is activated krfb will ask the user before an incomning - * connection will be accepted. - * @return true if askOnConnect is activated - */ - virtual bool askOnConnect() = 0; - - /** - * If this feature is activated krfb will ask the user before an incomning - * connection will be accepted. - * @param a true to turn the askOnConnect feature on. - */ - virtual void setAskOnConnect(bool a) = 0; - - /** - * If this feature is activated krfb allows the connecting client to - * control the desktop (pointer & keyboard). - * @return true if desktop control is activated - */ - virtual bool allowDesktopControl() = 0; - /** * If this feature is activated krfb allows the connecting client to * control the desktop (pointer & keyboard). @@ -64,18 +20,5 @@ k_dcop: */ virtual void setAllowDesktopControl(bool a) = 0; - /** - * 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; - - /** - * Returns the port the server is listening on. - * @return the tcp port of the server - */ - virtual int port() = 0; }; #endif diff --git a/krfb/krfbiface_skel.cc b/krfb/krfbiface_skel.cc index 1c430fac..6d41de3d 100644 --- a/krfb/krfbiface_skel.cc +++ b/krfb/krfbiface_skel.cc @@ -9,96 +9,26 @@ #include "./krfbiface.h" #include -#include -static const int krfbIface_fhash = 13; -static const char* const krfbIface_ftable[12][3] = { - { "void", "disconnect()", "disconnect()" }, +static const char* const krfbIface_ftable[3][3] = { { "void", "exit()", "exit()" }, - { "void", "reloadConfig()", "reloadConfig()" }, - { "bool", "oneConnection()", "oneConnection()" }, - { "void", "setOneConnection(bool)", "setOneConnection(bool o)" }, - { "bool", "askOnConnect()", "askOnConnect()" }, - { "void", "setAskOnConnect(bool)", "setAskOnConnect(bool a)" }, - { "bool", "allowDesktopControl()", "allowDesktopControl()" }, { "void", "setAllowDesktopControl(bool)", "setAllowDesktopControl(bool a)" }, - { "void", "setPassword(QString)", "setPassword(QString p)" }, - { "int", "port()", "port()" }, { 0, 0, 0 } }; bool krfbIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData) { - static QAsciiDict* fdict = 0; - if ( !fdict ) { - fdict = new QAsciiDict( krfbIface_fhash, TRUE, FALSE ); - for ( int i = 0; krfbIface_ftable[i][1]; i++ ) - fdict->insert( krfbIface_ftable[i][1], new int( i ) ); - } - int* fp = fdict->find( fun ); - switch ( fp?*fp:-1) { - case 0: { // void disconnect() + if ( fun == krfbIface_ftable[0][1] ) { // void exit() replyType = krfbIface_ftable[0][0]; - disconnect( ); - } break; - case 1: { // void exit() - replyType = krfbIface_ftable[1][0]; exit( ); - } break; - case 2: { // void reloadConfig() - replyType = krfbIface_ftable[2][0]; - reloadConfig( ); - } break; - case 3: { // bool oneConnection() - replyType = krfbIface_ftable[3][0]; - QDataStream _replyStream( replyData, IO_WriteOnly ); - _replyStream << oneConnection( ); - } break; - case 4: { // void setOneConnection(bool) + } else if ( fun == krfbIface_ftable[1][1] ) { // void setAllowDesktopControl(bool) bool arg0; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; - replyType = krfbIface_ftable[4][0]; - setOneConnection(arg0 ); - } break; - case 5: { // bool askOnConnect() - replyType = krfbIface_ftable[5][0]; - QDataStream _replyStream( replyData, IO_WriteOnly ); - _replyStream << askOnConnect( ); - } break; - case 6: { // void setAskOnConnect(bool) - bool arg0; - QDataStream arg( data, IO_ReadOnly ); - arg >> arg0; - replyType = krfbIface_ftable[6][0]; - setAskOnConnect(arg0 ); - } break; - case 7: { // bool allowDesktopControl() - replyType = krfbIface_ftable[7][0]; - QDataStream _replyStream( replyData, IO_WriteOnly ); - _replyStream << allowDesktopControl( ); - } break; - case 8: { // void setAllowDesktopControl(bool) - bool arg0; - QDataStream arg( data, IO_ReadOnly ); - arg >> arg0; - replyType = krfbIface_ftable[8][0]; + replyType = krfbIface_ftable[1][0]; setAllowDesktopControl(arg0 ); - } break; - case 9: { // void setPassword(QString) - QString arg0; - QDataStream arg( data, IO_ReadOnly ); - arg >> arg0; - replyType = krfbIface_ftable[9][0]; - setPassword(arg0 ); - } break; - case 10: { // int port() - replyType = krfbIface_ftable[10][0]; - QDataStream _replyStream( replyData, IO_WriteOnly ); - _replyStream << port( ); - } break; - default: + } else { return DCOPObject::process( fun, data, replyType, replyData ); } return TRUE; diff --git a/krfb/krfbifaceimpl.cc b/krfb/krfbifaceimpl.cc index e1b46959..751125e9 100644 --- a/krfb/krfbifaceimpl.cc +++ b/krfb/krfbifaceimpl.cc @@ -11,75 +11,18 @@ KRfbIfaceImpl::KRfbIfaceImpl(Configuration *c) : DCOPObject("krfbIface"), - configuration(c), - portNum(0) -{ -} - -void KRfbIfaceImpl::disconnect() -{ - emit connectionClosed(); -} - -/* -void KRfbIfaceImpl::setWindowID(int) + configuration(c) { } -*/ void KRfbIfaceImpl::exit() { emit exitApp(); } -void KRfbIfaceImpl::reloadConfig() -{ - return configuration->reload(); -} -bool KRfbIfaceImpl::oneConnection() -{ - return configuration->oneConnection(); -} -void KRfbIfaceImpl::setOneConnection(bool b) -{ - configuration->setOnceConnection(b); - configuration->save(); -} -bool KRfbIfaceImpl::askOnConnect() -{ - return configuration->askOnConnect(); -} -void KRfbIfaceImpl::setAskOnConnect(bool b) -{ - configuration->setAskOnConnect(b); - configuration->save(); -} -bool KRfbIfaceImpl::allowDesktopControl() -{ - return configuration->allowDesktopControl(); -} void KRfbIfaceImpl::setAllowDesktopControl(bool b) { configuration->setAllowDesktopControl(b); configuration->save(); } -void KRfbIfaceImpl::setPassword(QString password) -{ - configuration->setPassword(password); - configuration->save(); -} -int KRfbIfaceImpl::port() -{ - return portNum; -} - -/* - * Note that setPort() is not a DCOP function, but a slot that's - * connected to RFBController to get the autoprobed port. - */ -void KRfbIfaceImpl::setPort(int p) -{ - portNum = p; -} - #include "krfbifaceimpl.moc" diff --git a/krfb/krfbifaceimpl.h b/krfb/krfbifaceimpl.h index 849ca8a0..b3fd37a6 100644 --- a/krfb/krfbifaceimpl.h +++ b/krfb/krfbifaceimpl.h @@ -10,29 +10,13 @@ class KRfbIfaceImpl : public QObject, public virtual krfbIface Q_OBJECT private: Configuration *configuration; - int portNum; public: KRfbIfaceImpl(Configuration *c); signals: - void connectionClosed(); void exitApp(); -public slots: - void setPort(int p); - public: - void disconnect(); -// void setWindowID(int); void exit(); - void reloadConfig(); - - bool oneConnection(); - void setOneConnection(bool); - bool askOnConnect(); - void setAskOnConnect(bool); - bool allowDesktopControl(); void setAllowDesktopControl(bool); - void setPassword(QString); - int port(); }; #endif diff --git a/krfb/main.cpp b/krfb/main.cpp index 60066999..e0988edc 100644 --- a/krfb/main.cpp +++ b/krfb/main.cpp @@ -43,51 +43,16 @@ static const char *description = I18N_NOOP("VNC-compatible server to share " "KDE desktops"); -#define ARG_ONE_SESSION "one-session" -#define ARG_PASSWORD "password" -#define ARG_DONT_CONFIRM_CONNECT "dont-confirm-connect" -#define ARG_REMOTE_CONTROL "remote-control" -#define ARG_STAND_ALONE "stand-alone" #define ARG_KINETD "kinetd" static KCmdLineOptions options[] = { - { "o", 0, 0}, - { ARG_ONE_SESSION, I18N_NOOP("Terminate when the first session is finished."), 0}, - { "w", 0, 0}, - { ARG_PASSWORD " ", I18N_NOOP("Set the password."), ""}, - { "d", 0, 0}, - { ARG_DONT_CONFIRM_CONNECT, I18N_NOOP("Allow connections without asking the user."), 0}, - { "c", 0, 0}, - { ARG_REMOTE_CONTROL, I18N_NOOP("Allow remote side to control this computer."), 0}, - { "s", 0, 0}, - { ARG_STAND_ALONE, I18N_NOOP("Standalone mode: do not use daemon."), 0}, { ARG_KINETD " ", I18N_NOOP("Used for calling from kinetd."), 0}, { 0, 0, 0 } }; /* - * KRfb can run in 4 different modes: - * - stand-alone - * + To get there call KRfb with kinetd disabled in KConfig (use KControl module) - * + traditional mode like <0.7 versions - * + uses non-kcm configuration dialog - * + invitation on start-up can be disabled - * - stand-alone with command line args - * + to get there call krfb any cmd line args (except --kinetd) - * + behaves like stand-alone, but without configuration & invitations - * - kinetd mode - * + started using the --kinetd argument - * + used for starting from kinetd - * + takes socket fd from cmd args - * + exits after connection is finished - * + config option calls kcontrol module - * - invitation mode - * + started when krfb is called while kinetd is enabled and no cmd line arg is given - * + displays only invitation dialog and finishs then - * + does not accept connections, no tray icon - * * TODO: * - fix bug on 'close connection' in kinetd mode */ @@ -115,8 +80,6 @@ void checkKInetd(bool &kinetdAvailable, bool &krfbAvailable) { int main(int argc, char *argv[]) { - enum krfb_mode mode = KRFB_UNKNOWN_MODE; - KAboutData aboutData( "krfb", I18N_NOOP("Desktop Sharing"), VERSION, description, KAboutData::License_GPL, "(c) 2001-2002, Tim Jansen\n" @@ -151,68 +114,38 @@ int main(int argc, char *argv[]) Configuration *config; KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); QString fdString; - if (args->isSet(ARG_ONE_SESSION) || - args->isSet(ARG_PASSWORD) || - args->isSet(ARG_REMOTE_CONTROL) || - args->isSet(ARG_DONT_CONFIRM_CONNECT)) { - - bool oneConnection = args->isSet(ARG_ONE_SESSION); - bool askOnConnect = !args->isSet(ARG_DONT_CONFIRM_CONNECT); - bool allowDesktopControl = args->isSet(ARG_REMOTE_CONTROL); - QString password = args->getOption(ARG_PASSWORD); - mode = KRFB_STAND_ALONE_CMDARG; - config = new Configuration(oneConnection, askOnConnect, - allowDesktopControl, password); - } - else { - if (args->isSet(ARG_STAND_ALONE)) { - mode = KRFB_STAND_ALONE; - } - else if (args->isSet(ARG_KINETD)) { - fdString = args->getOption(ARG_KINETD); - mode = KRFB_KINETD_MODE; - } - if (mode == KRFB_UNKNOWN_MODE) { - if (Configuration::earlyDaemonMode()) { - bool kinetdA, krfbA; - mode = KRFB_INVITATION_MODE; - checkKInetd(kinetdA, krfbA); - if (!kinetdA) { - KMessageBox::error(0, - i18n("Cannot find KInetD. " - "Have you restarted KDE after installation?"), - i18n("Desktop Sharing Error")); - return 1; - } - if (!krfbA) { - KMessageBox::error(0, - i18n("Cannot find KInetD service for Desktop Sharing (KRfb). " - "Have you restarted KDE after installation?"), - i18n("Desktop Sharing Error")); - return 1; - } - } - else - mode = KRFB_STAND_ALONE; - } - config = new Configuration(mode); - - if ((mode == KRFB_KINETD_MODE) && - (!config->allowUninvitedConnections()) && - (config->invitations().size() == 0)) { - KNotifyClient::event("UnexpectedConnection"); + if (!args->isSet(ARG_KINETD)) { + bool kinetdA, krfbA; + checkKInetd(kinetdA, krfbA); + if (!kinetdA) { + KMessageBox::error(0, + i18n("Cannot find KInetD. " + "Have you restarted KDE after installation?"), + i18n("Desktop Sharing Error")); + return 1; + } + if (!krfbA) { + KMessageBox::error(0, + i18n("Cannot find KInetD service for Desktop Sharing (KRfb). " + "Have you restarted KDE after installation?"), + i18n("Desktop Sharing Error")); return 1; } - } - args->clear(); - - if (mode == KRFB_INVITATION_MODE) { + config = new Configuration(KRFB_INVITATION_MODE); config->showInvitationDialog(); QObject::connect(config, SIGNAL(invitationFinished()), &app, SLOT(quit())); return app.exec(); } + fdString = args->getOption(ARG_KINETD); + config = new Configuration(KRFB_KINETD_MODE); + args->clear(); + + if ((!config->allowUninvitedConnections()) && (config->invitations().size() == 0)) { + KNotifyClient::event("UnexpectedConnection"); + return 1; + } if (!RFBController::checkX11Capabilities()) return 1; @@ -228,59 +161,29 @@ int main(int argc, char *argv[]) QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); - QObject::connect(&trayicon, SIGNAL(connectionClosed()), - &controller, SLOT(closeConnection())); - QObject::connect(&trayicon, SIGNAL(showConfigure()), - config, SLOT(showConfigDialog())); QObject::connect(&trayicon, SIGNAL(showManageInvitations()), config, SLOT(showManageInvitationsDialog())); - QObject::connect(&controller, SIGNAL(portProbed(int)), - config, SLOT(setPort(int))); - - QObject::connect(&dcopiface, SIGNAL(connectionClosed()), - &controller, SLOT(closeConnection())); QObject::connect(&dcopiface, SIGNAL(exitApp()), &app, SLOT(quit())); - QObject::connect(config, SIGNAL(passwordChanged()), - &controller, SLOT(passwordChanged())); - - QObject::connect(&controller, SIGNAL(portProbed(int)), - &dcopiface, SLOT(setPort(int))); - - QObject::connect(&controller, SIGNAL(sessionEstablished()), - &trayicon, SLOT(openConnection())); - - if (config->oneConnection() || (mode == KRFB_KINETD_MODE)) { - QObject::connect(&controller, SIGNAL(sessionRefused()), - &app, SLOT(quit())); - QObject::connect(&controller, SIGNAL(sessionFinished()), - &app, SLOT(quit())); - } else { - QObject::connect(&controller, SIGNAL(sessionFinished()), - &trayicon, SLOT(closeConnection())); - } + QObject::connect(&controller, SIGNAL(sessionRefused()), + &app, SLOT(quit())); + QObject::connect(&controller, SIGNAL(sessionFinished()), + &app, SLOT(quit())); sigset_t sigs; sigemptyset(&sigs); sigaddset(&sigs, SIGPIPE); sigprocmask(SIG_BLOCK, &sigs, 0); - if (mode == KRFB_KINETD_MODE) { - bool ok; - int fdNum = fdString.toInt(&ok); - if (!ok) { - kdError() << "kinetd fd was not numeric." << endl; - return 2; - } - controller.startServer(fdNum); + bool ok; + int fdNum = fdString.toInt(&ok); + if (!ok) { + kdError() << "kinetd fd was not numeric." << endl; + return 2; } - else - controller.startServer(); - - if (config->showInvitationDialogOnStartup()) - config->showInvitationDialog(); + controller.startServer(fdNum); return app.exec(); } diff --git a/krfb/rfbcontroller.cc b/krfb/rfbcontroller.cc index 7d432d5d..e5d42277 100644 --- a/krfb/rfbcontroller.cc +++ b/krfb/rfbcontroller.cc @@ -324,9 +324,7 @@ void RFBController::startServer(int inetdFd, bool xtestGrab) server->frameBuffer = fb; server->autoPort = TRUE; - - if (inetdFd >= 0) - server->inetdSock = inetdFd; + server->inetdSock = inetdFd; server->kbdAddEvent = keyboardHook; server->ptrAddEvent = pointerHook; @@ -344,9 +342,6 @@ void RFBController::startServer(int inetdFd, bool xtestGrab) rfbInitServer(server); state = RFB_WAITING; - if (inetdFd < 0) - emit portProbed(server->rfbPort); - if (xtestGrab) { disabler.disable = false; XTestGrabControl(qt_xdisplay(), true); @@ -369,12 +364,6 @@ void RFBController::stopServer(bool xtestUngrab) } } -void RFBController::rebind() -{ - stopServer(false); - startServer(-1, false); -} - void RFBController::connectionAccepted(bool aRC) { if (state != RFB_CONNECTING) @@ -447,10 +436,7 @@ void RFBController::connectionClosed() void RFBController::closeConnection() { if (state == RFB_CONNECTED) { - if (server->inetdSock >= 0) { - close(server->inetdSock); - emit sessionFinished(); - } + emit sessionFinished(); if (!checkAsyncEvents()) { asyncMutex.lock(); if (!closePending) @@ -642,11 +628,6 @@ void RFBController::passwordChanged() { server->rfbAuthPasswdData = (void*) (authRequired ? 1 : 0); } -int RFBController::getPort() -{ - return server->rfbPort; -} - void RFBController::sendKNotifyEvent(const QString &n, const QString &d) { asyncMutex.lock(); diff --git a/krfb/rfbcontroller.h b/krfb/rfbcontroller.h index 82398818..e065f137 100644 --- a/krfb/rfbcontroller.h +++ b/krfb/rfbcontroller.h @@ -134,7 +134,6 @@ public: static bool checkX11Capabilities(); public slots: - void rebind(); void passwordChanged(); void closeConnection(); @@ -142,7 +141,6 @@ signals: void sessionEstablished(); void sessionFinished(); void sessionRefused(); - void portProbed(int); private: void stopServer(bool xtestUngrab = true); diff --git a/krfb/trayicon.cpp b/krfb/trayicon.cpp index 5b15dd4b..25853b3f 100644 --- a/krfb/trayicon.cpp +++ b/krfb/trayicon.cpp @@ -31,19 +31,10 @@ TrayIcon::TrayIcon(KDialog *d, Configuration *c) : { KIconLoader *loader = KGlobal::iconLoader(); trayIconOpen = loader->loadIcon("eyes-open24", KIcon::User); - trayIconClosed = loader->loadIcon("eyes-closed24", KIcon::User); - setPixmap(trayIconClosed); + setPixmap(trayIconOpen); - configureAction = KStdAction::preferences(this, SIGNAL(showConfigure()), &actionCollection); manageInvitationsAction = new KAction(i18n("Manage &invitations"), QString::null, 0, this, SIGNAL(showManageInvitations()), &actionCollection); - if (c->mode() != KRFB_STAND_ALONE_CMDARG) { - configureAction->plug(contextMenu()); - manageInvitationsAction->plug(contextMenu()); - } - - closeConnectionAction = new KAction(i18n("Cl&ose connection"), QString::null, 0, this, SLOT(connectionClose), &actionCollection); - closeConnectionAction->plug(contextMenu()); - closeConnectionAction->setEnabled(false); + manageInvitationsAction->plug(contextMenu()); contextMenu()->insertSeparator(); aboutAction = KStdAction::aboutApp(this, SLOT(showAbout()), &actionCollection); @@ -55,16 +46,6 @@ TrayIcon::TrayIcon(KDialog *d, Configuration *c) : TrayIcon::~TrayIcon(){ } -void TrayIcon::openConnection(){ - setPixmap(trayIconOpen); - closeConnectionAction->setEnabled(true); -} - -void TrayIcon::closeConnection(){ - setPixmap(trayIconClosed); - closeConnectionAction->setEnabled(false); -} - void TrayIcon::showAbout() { aboutDialog->show(); } diff --git a/krfb/trayicon.h b/krfb/trayicon.h index 3af2661c..934edf27 100644 --- a/krfb/trayicon.h +++ b/krfb/trayicon.h @@ -37,22 +37,13 @@ public: TrayIcon(KDialog*, Configuration*); ~TrayIcon(); -public slots: - void closeConnection(); - void openConnection(); - signals: - void connectionClosed(); - void showConfigure(); void showManageInvitations(); private: KPixmap trayIconOpen; - KPixmap trayIconClosed; KDialog* aboutDialog; KActionCollection actionCollection; - KAction* closeConnectionAction; - KAction* configureAction; KAction* manageInvitationsAction; KAction* aboutAction;