Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 324400 Details for
Bug 364739
Enable KRDC to use FreeRDC instead of rdesktop.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
all nessesary files from KDE trunk
krdc-4.9.1-freerdp.patch (text/plain), 666.12 KB, created by
Norbert Marx
on 2012-09-20 15:57:39 UTC
(
hide
)
Description:
all nessesary files from KDE trunk
Filename:
MIME Type:
Creator:
Norbert Marx
Created:
2012-09-20 15:57:39 UTC
Size:
666.12 KB
patch
obsolete
>diff -urN kdenetwork-4.9.1.org/krdc/CMakeLists.txt kdenetwork-4.9.1/krdc/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc/CMakeLists.txt 2012-08-13 02:08:57.000000000 +0200 >+++ kdenetwork-4.9.1/krdc/CMakeLists.txt 2012-09-19 22:30:10.602196002 +0200 >@@ -55,6 +55,7 @@ > add_subdirectory(vnc) > add_subdirectory(nx) > add_subdirectory(rdp) >+add_subdirectory(freerdp) > add_subdirectory(test) > > if(TelepathyQt4_FOUND) >diff -urN kdenetwork-4.9.1.org/krdc/core/krdc.kcfg kdenetwork-4.9.1/krdc/core/krdc.kcfg >--- kdenetwork-4.9.1.org/krdc/core/krdc.kcfg 2012-08-13 02:08:56.000000000 +0200 >+++ kdenetwork-4.9.1/krdc/core/krdc.kcfg 2012-09-19 22:30:10.602196002 +0200 >@@ -118,4 +118,42 @@ > <default>default</default> > </entry> > </group> >+ <group name="FREERDP"> >+ <entry name="FreeRDPWidth" type="Int"> >+ <default>800</default> >+ </entry> >+ <entry name="FreeRDPHeight" type="Int"> >+ <default>600</default> >+ </entry> >+ <entry name="FreeRDPKeyboardLayout" type="Int"> >+ <default>7</default> >+ </entry> >+ <entry name="FreeRDPColorDepth" type="Int"> >+ <default>0</default> >+ </entry> >+ <entry name="FreeRDPSound" type="Int"> >+ <default>0</default> >+ </entry> >+ <entry name="FreeRDPConsole" type="Bool"> >+ <default>false</default> >+ </entry> >+ <entry name="FreeRDPExtraOptions" type="String"> >+ <default></default> >+ </entry> >+ <entry name="DefaultFreerdpUserName" type="String"> >+ <default></default> >+ </entry> >+ <entry name="FreeRDPRecognizeLdapLogins" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="FreeRDPRemoteFX" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="FreeRDPPerformance" type="Int"> >+ <default>2</default> >+ </entry> >+ <entry name="FreeRDPShareMedia" type="String"> >+ <default>/media</default> >+ </entry> >+ </group> > </kcfg> >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/CMakeLists.txt kdenetwork-4.9.1/krdc/freerdp/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc/freerdp/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/CMakeLists.txt 2012-09-19 22:30:10.602196002 +0200 >@@ -0,0 +1,52 @@ >+ >+if(Q_WS_X11) >+ set(HAVE_XFREERDP true) # TODO: implement cmake check? >+endif(Q_WS_X11) >+ >+if(HAVE_XFREERDP) >+ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5012) >+ >+ include_directories( >+ ${CMAKE_CURRENT_BINARY_DIR} >+ ) >+ >+ set(freerdpplugin_SRCS >+ freerdphostpreferences.cpp >+ freerdpviewfactory.cpp >+ freerdpview.cpp >+ ) >+ >+ kde4_add_ui_files(freerdpplugin_SRCS >+ freerdppreferences.ui >+ ) >+ >+ kde4_add_plugin(krdc_freerdpplugin ${freerdpplugin_SRCS}) >+ >+ target_link_libraries(krdc_freerdpplugin >+ ${KDE4_KDECORE_LIBS} >+ ${KDE4_KDEUI_LIBS} >+ krdccore >+ ) >+ >+ set(kcm_krdc_freerdpplugin_SRCS >+ freerdppreferences.cpp >+ ) >+ >+ kde4_add_plugin(kcm_krdc_freerdpplugin ${kcm_krdc_freerdpplugin_SRCS}) >+ >+ target_link_libraries(kcm_krdc_freerdpplugin >+ ${KDE4_KDEUI_LIBS} >+ krdccore >+ ) >+ >+ add_dependencies(kcm_krdc_freerdpplugin krdc_freerdpplugin) >+ >+ install(TARGETS kcm_krdc_freerdpplugin DESTINATION ${PLUGIN_INSTALL_DIR}) >+ install(TARGETS krdc_freerdpplugin DESTINATION ${PLUGIN_INSTALL_DIR}) >+ >+ install(FILES krdc_freerdp.desktop DESTINATION ${SERVICES_INSTALL_DIR}) >+ install(FILES krdc_freerdp_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}) >+ >+ install(FILES freerdp.protocol DESTINATION ${SERVICES_INSTALL_DIR}) >+ install(FILES smb2rdc.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ServiceMenus) >+endif(HAVE_XFREERDP) >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdphostpreferences.cpp kdenetwork-4.9.1/krdc/freerdp/freerdphostpreferences.cpp >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdphostpreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdphostpreferences.cpp 2012-09-19 22:30:10.601196002 +0200 >@@ -0,0 +1,270 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdphostpreferences.h" >+ >+#include "settings.h" >+ >+#include <KDebug> >+ >+#include <QDesktopWidget> >+ >+static const QStringList keymaps = (QStringList() >+ << "ar" >+ << "cs" >+ << "da" >+ << "de" >+ << "de-ch" >+ << "en-dv" >+ << "en-gb" >+ << "en-us" >+ << "es" >+ << "et" >+ << "fi" >+ << "fo" >+ << "fr" >+ << "fr-be" >+ << "fr-ca" >+ << "fr-ch" >+ << "he" >+ << "hr" >+ << "hu" >+ << "is" >+ << "it" >+ << "ja" >+ << "ko" >+ << "lt" >+ << "lv" >+ << "mk" >+ << "nl" >+ << "nl-be" >+ << "no" >+ << "pl" >+ << "pt" >+ << "pt-br" >+ << "ru" >+ << "sl" >+ << "sv" >+ << "th" >+ << "tr" >+); >+ >+static const int defaultKeymap = 7; // en-us >+ >+inline int keymap2int(const QString &keymap) >+{ >+ const int index = keymaps.lastIndexOf(keymap); >+ return (index == -1) ? defaultKeymap : index; >+} >+ >+inline QString int2keymap(int layout) >+{ >+ if (layout >= 0 && layout < keymaps.count()) >+ return keymaps.at(layout); >+ else >+ return keymaps.at(defaultKeymap); >+} >+ >+FreerdpHostPreferences::FreerdpHostPreferences(KConfigGroup configGroup, QObject *parent) >+ : HostPreferences(configGroup, parent) >+{ >+} >+ >+FreerdpHostPreferences::~FreerdpHostPreferences() >+{ >+} >+ >+QWidget* FreerdpHostPreferences::createProtocolSpecificConfigPage() >+{ >+ QWidget *freerdpPage = new QWidget(); >+ freerdpUi.setupUi(freerdpPage); >+ >+ freerdpUi.loginGroupBox->setVisible(false); >+ >+ freerdpUi.kcfg_FreeRDPHeight->setValue(height()); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(width()); >+ freerdpUi.kcfg_FreeRDPColorDepth->setCurrentIndex(colorDepth()); >+ freerdpUi.kcfg_FreeRDPKeyboardLayout->setCurrentIndex(keymap2int(keyboardLayout())); >+ freerdpUi.kcfg_FreeRDPSound->setCurrentIndex(sound()); >+ freerdpUi.kcfg_FreeRDPConsole->setChecked(console()); >+ freerdpUi.kcfg_FreeRDPExtraOptions->setText(extraOptions()); >+ freerdpUi.kcfg_FreeRDPRemoteFX->setChecked(remoteFX()); >+ freerdpUi.kcfg_FreeRDPPerformance->setCurrentIndex(performance()); >+ freerdpUi.kcfg_FreeRDPShareMedia->setText(shareMedia()); >+ >+ connect(freerdpUi.resolutionComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateWidthHeight(int))); >+ >+ const QString resolutionString = QString::number(width()) + 'x' + QString::number(height()); >+ const int resolutionIndex = freerdpUi.resolutionComboBox->findText(resolutionString, Qt::MatchContains); >+ freerdpUi.resolutionComboBox->setCurrentIndex((resolutionIndex == -1) ? freerdpUi.resolutionComboBox->count() - 1 : resolutionIndex); >+ >+ return freerdpPage; >+} >+ >+void FreerdpHostPreferences::updateWidthHeight(int index) >+{ >+ switch (index) { >+ case 0: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(480); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(640); >+ break; >+ case 1: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(600); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(800); >+ break; >+ case 2: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(768); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1024); >+ break; >+ case 3: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(1024); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1280); >+ break; >+ case 4: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(1200); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1600); >+ break; >+ case 5: { >+ QDesktopWidget *desktop = QApplication::desktop(); >+ int currentScreen = desktop->screenNumber(freerdpUi.kcfg_FreeRDPHeight); >+ freerdpUi.kcfg_FreeRDPHeight->setValue(desktop->screenGeometry(currentScreen).height()); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(desktop->screenGeometry(currentScreen).width()); >+ break; >+ } >+ case 6: >+ default: >+ break; >+ } >+ >+ const bool enabled = (index == 6) ? true : false; >+ >+ freerdpUi.kcfg_FreeRDPHeight->setEnabled(enabled); >+ freerdpUi.kcfg_FreeRDPWidth->setEnabled(enabled); >+ freerdpUi.heightLabel->setEnabled(enabled); >+ freerdpUi.widthLabel->setEnabled(enabled); >+} >+ >+void FreerdpHostPreferences::acceptConfig() >+{ >+ HostPreferences::acceptConfig(); >+ >+ setHeight(freerdpUi.kcfg_FreeRDPHeight->value()); >+ setWidth(freerdpUi.kcfg_FreeRDPWidth->value()); >+ setColorDepth(freerdpUi.kcfg_FreeRDPColorDepth->currentIndex()); >+ setKeyboardLayout(int2keymap(freerdpUi.kcfg_FreeRDPKeyboardLayout->currentIndex())); >+ setSound(freerdpUi.kcfg_FreeRDPSound->currentIndex()); >+ setConsole(freerdpUi.kcfg_FreeRDPConsole->isChecked()); >+ setExtraOptions(freerdpUi.kcfg_FreeRDPExtraOptions->text()); >+ setRemoteFX(freerdpUi.kcfg_FreeRDPRemoteFX->isChecked()); >+ setPerformance(freerdpUi.kcfg_FreeRDPPerformance->currentIndex()); >+ setShareMedia(freerdpUi.kcfg_FreeRDPShareMedia->text()); >+} >+ >+void FreerdpHostPreferences::setColorDepth(int colorDepth) >+{ >+ if (colorDepth >= 0) >+ m_configGroup.writeEntry("freeRDPColorDepth", colorDepth); >+} >+ >+int FreerdpHostPreferences::colorDepth() const >+{ >+ return m_configGroup.readEntry("freeRDPColorDepth", Settings::freeRDPColorDepth()); >+} >+ >+void FreerdpHostPreferences::setKeyboardLayout(const QString &keyboardLayout) >+{ >+ if (!keyboardLayout.isNull()) >+ m_configGroup.writeEntry("freeRDPKeyboardLayout", keymap2int(keyboardLayout)); >+} >+ >+QString FreerdpHostPreferences::keyboardLayout() const >+{ >+ return int2keymap(m_configGroup.readEntry("freeRDPKeyboardLayout", Settings::freeRDPKeyboardLayout())); >+} >+ >+void FreerdpHostPreferences::setSound(int sound) >+{ >+ if (sound >= 0) >+ m_configGroup.writeEntry("freeRDPSound", sound); >+} >+ >+int FreerdpHostPreferences::sound() const >+{ >+ return m_configGroup.readEntry("freeRDPSound", Settings::freeRDPSound()); >+} >+ >+void FreerdpHostPreferences::setConsole(bool console) >+{ >+ m_configGroup.writeEntry("freeRDPConsole", console); >+} >+ >+bool FreerdpHostPreferences::console() const >+{ >+ return m_configGroup.readEntry("freeRDPConsole", Settings::freeRDPConsole()); >+} >+ >+void FreerdpHostPreferences::setExtraOptions(const QString &extraOptions) >+{ >+ if (!extraOptions.isNull()) >+ m_configGroup.writeEntry("freeRDPExtraOptions", extraOptions); >+} >+ >+QString FreerdpHostPreferences::extraOptions() const >+{ >+ return m_configGroup.readEntry("freeRDPExtraOptions", Settings::freeRDPExtraOptions()); >+} >+ >+void FreerdpHostPreferences::setRemoteFX(bool remoteFX) >+{ >+ m_configGroup.writeEntry("freeRDPRemoteFX", remoteFX); >+} >+ >+bool FreerdpHostPreferences::remoteFX() const >+{ >+ return m_configGroup.readEntry("freeRDPRemoteFX", Settings::freeRDPRemoteFX()); >+} >+ >+void FreerdpHostPreferences::setPerformance(int performance) >+{ >+ if (performance >= 0) >+ m_configGroup.writeEntry("freeRDPPerformance", performance); >+} >+ >+int FreerdpHostPreferences::performance() const >+{ >+ return m_configGroup.readEntry("freeRDPPerformance", Settings::freeRDPPerformance()); >+} >+ >+void FreerdpHostPreferences::setShareMedia(const QString &shareMedia) >+{ >+ if (!shareMedia.isNull()) >+ m_configGroup.writeEntry("freeRDPShareMedia", shareMedia); >+} >+ >+QString FreerdpHostPreferences::shareMedia() const >+{ >+ return m_configGroup.readEntry("freeRDPShareMedia", Settings::freeRDPShareMedia()); >+} >+ >+#include "freerdphostpreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdphostpreferences.h kdenetwork-4.9.1/krdc/freerdp/freerdphostpreferences.h >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdphostpreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdphostpreferences.h 2012-09-19 22:30:10.602196002 +0200 >@@ -0,0 +1,67 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPHOSTPREFERENCES_H >+#define FREERDPHOSTPREFERENCES_H >+ >+#include "hostpreferences.h" >+#include "ui_freerdppreferences.h" >+ >+class FreerdpHostPreferences : public HostPreferences >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpHostPreferences(KConfigGroup configGroup, QObject *parent = 0); >+ ~FreerdpHostPreferences(); >+ >+ void setColorDepth(int colorDepth); >+ int colorDepth() const; >+ void setKeyboardLayout(const QString &keyboardLayout); >+ QString keyboardLayout() const; >+ void setSound(int sound); >+ int sound() const; >+ void setConsole(bool console); >+ bool console() const; >+ void setExtraOptions(const QString &extraOptions); >+ QString extraOptions() const; >+ void setRemoteFX(bool remoteFX); >+ bool remoteFX() const; >+ void setPerformance(int performance); >+ int performance() const; >+ void setShareMedia(const QString &shareMedia); >+ QString shareMedia() const; >+ >+protected: >+ QWidget* createProtocolSpecificConfigPage(); >+ void acceptConfig(); >+ >+private: >+ Ui::FreerdpPreferences freerdpUi; >+ >+private slots: >+ void updateWidthHeight(int index); >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdppreferences.cpp kdenetwork-4.9.1/krdc/freerdp/freerdppreferences.cpp >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdppreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdppreferences.cpp 2012-09-19 22:30:10.601196002 +0200 >@@ -0,0 +1,67 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdppreferences.h" >+#include "remoteviewfactory.h" >+#include "settings.h" >+ >+#include "ui_freerdppreferences.h" >+ >+#include <KDebug> >+ >+KRDC_PLUGIN_EXPORT(FreerdpPreferences) >+ >+FreerdpPreferences::FreerdpPreferences(QWidget *parent, const QVariantList &args) >+ : KCModule(KrdcFactory::componentData(), parent, args) >+{ >+ Ui::FreerdpPreferences freerdpUi; >+ freerdpUi.setupUi(this); >+ // would need a lot of code duplication. find a solution, bit it's not >+ // that important because you will not change this configuration each day... >+ // see freerdp/freerdphostpreferences.cpp >+ freerdpUi.resolutionComboBox->hide(); >+ freerdpUi.resolutionDummyLabel->hide(); >+ freerdpUi.kcfg_FreeRDPHeight->setEnabled(true); >+ freerdpUi.kcfg_FreeRDPWidth->setEnabled(true); >+ freerdpUi.heightLabel->setEnabled(true); >+ freerdpUi.widthLabel->setEnabled(true); >+ >+ addConfig(Settings::self(), this); >+} >+ >+FreerdpPreferences::~FreerdpPreferences() >+{ >+} >+ >+void FreerdpPreferences::load() >+{ >+ KCModule::load(); >+} >+ >+void FreerdpPreferences::save() >+{ >+ KCModule::save(); >+} >+ >+#include "freerdppreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdppreferences.h kdenetwork-4.9.1/krdc/freerdp/freerdppreferences.h >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdppreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdppreferences.h 2012-09-19 22:30:10.601196002 +0200 >@@ -0,0 +1,45 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPPREFERENCES_H >+#define FREERDPPREFERENCES_H >+ >+#include "freerdphostpreferences.h" >+ >+#include <KCModule> >+ >+class FreerdpPreferences : public KCModule >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpPreferences(QWidget *parent = 0, const QVariantList &args = QVariantList()); >+ ~FreerdpPreferences(); >+ >+ virtual void save(); >+ virtual void load(); >+ >+}; >+ >+#endif // FREERDPPREFERENCES_H >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdppreferences.ui kdenetwork-4.9.1/krdc/freerdp/freerdppreferences.ui >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdppreferences.ui 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdppreferences.ui 2012-09-19 22:30:10.601196002 +0200 >@@ -0,0 +1,645 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<ui version="4.0"> >+ <class>FreerdpPreferences</class> >+ <widget class="QWidget" name="FreerdpPreferences"> >+ <property name="geometry"> >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>484</width> >+ <height>452</height> >+ </rect> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout_2"> >+ <item> >+ <widget class="QGroupBox" name="connectionGroupBox"> >+ <property name="title"> >+ <string>Connection</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout_2"> >+ <item row="0" column="0"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="QLabel" name="resolutionLabel"> >+ <property name="text"> >+ <string>Desktop &resolution:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>resolutionComboBox</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="resolutionDummyLabel"/> >+ </item> >+ </layout> >+ </item> >+ <item row="0" column="1"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="KComboBox" name="resolutionComboBox"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>1</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Minimal (640x480)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Small (800x600)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Normal (1024x768)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Large (1280x1024)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Very Large (1600x1200)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Current Screen Resolution</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Custom Resolution (...)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout"> >+ <item> >+ <widget class="QLabel" name="widthLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>&Width:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPWidth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_FreeRDPWidth"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the width of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>800</number> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="heightLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>H&eight:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPHeight</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_FreeRDPHeight"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the height of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>600</number> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </item> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="colorDepthLabel"> >+ <property name="text"> >+ <string>Color &depth:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPColorDepth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPColorDepth"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Low Color (8 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>High Color (16 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>True Color (24 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>True Color (32 Bit)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="2" column="0"> >+ <widget class="QLabel" name="layoutLabel"> >+ <property name="text"> >+ <string>&Keyboard layout:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPKeyboardLayout</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="2" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPKeyboardLayout"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Use this to specify your keyboard layout. This layout setting is used to send the correct keyboard codes to the server.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>7</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Arabic (ar)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Czech (cs)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Danish (da)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>German (de)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swiss German (de-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>American Dvorak (en-dv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>British English (en-gb)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>US English (en-us)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Spanish (es)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Estonian (et)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Finnish (fi)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Faroese (fo)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>French (fr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Belgian (fr-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>French Canadian (fr-ca)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swiss French (fr-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Hebrew (he)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Croatian (hr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Hungarian (hu)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Icelandic (is)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Italian (it)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Japanese (ja)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Korean (ko)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Lithuanian (lt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Latvian (lv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Macedonian (mk)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Dutch (nl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Belgian Dutch (nl-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Norwegian (no)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Polish (pl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Portuguese (pt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Brazilian (pt-br)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Russian (ru)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Slovenian (sl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swedish (sv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Thai (th)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Turkish (tr)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="3" column="0"> >+ <widget class="QLabel" name="soundLabel"> >+ <property name="text"> >+ <string comment="label for soundsettings in preferences dialog">Sound:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPSound</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="3" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPSound"> >+ <item> >+ <property name="text"> >+ <string>On This Computer</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>On Remote Computer</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Disable Sound</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="4" column="0"> >+ <widget class="QLabel" name="performanceLabel"> >+ <property name="text"> >+ <string comment="label for performance settings in preferences dialog">Performance:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPPerformance</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="4" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPPerformance"> >+ <item> >+ <property name="text"> >+ <string>Moden</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>BroadBand</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Lan</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="5" column="0"> >+ <widget class="QLabel" name="remoteFXLabel"> >+ <property name="text"> >+ <string>RemoteFX:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPRemoteFX</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="5" column="1"> >+ <widget class="QCheckBox" name="kcfg_FreeRDPRemoteFX"> >+ <property name="text"> >+ <string>Enable RemoteFX</string> >+ </property> >+ </widget> >+ </item> >+ <item row="6" column="0"> >+ <widget class="QLabel" name="ShareMediaLabel"> >+ <property name="text"> >+ <string>Share Media:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPShareMedia</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="6" column="1"> >+ <widget class="KLineEdit" name="kcfg_FreeRDPShareMedia"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Share a local media directory to the remote system</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="expertGroupBox"> >+ <property name="title"> >+ <string>Expert Options</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout"> >+ <item row="0" column="0"> >+ <widget class="QLabel" name="consoleLabel"> >+ <property name="text"> >+ <string>Console login:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPConsole</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="0" column="1"> >+ <widget class="QCheckBox" name="kcfg_FreeRDPConsole"> >+ <property name="text"> >+ <string>Attach to Windows Server console</string> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="extraOptionsLabel"> >+ <property name="text"> >+ <string>Extra options:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPExtraOptions</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KLineEdit" name="kcfg_FreeRDPExtraOptions"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can enter additional xfreerdp options.</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="loginGroupBox"> >+ <property name="title"> >+ <string>Login</string> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout"> >+ <item> >+ <layout class="QFormLayout" name="formLayout_3"> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="defaultUserLabel"> >+ <property name="text"> >+ <string>Default user name:</string> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KLineEdit" name="kcfg_DefaultFreerdpUserName"> >+ <property name="clickMessage"> >+ <string>No default user name</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_FreeRDPRecognizeLdapLogins"> >+ <property name="text"> >+ <string>Automatically recognize "LDAP"-Logins and share passwords</string> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <spacer> >+ <property name="orientation"> >+ <enum>Qt::Vertical</enum> >+ </property> >+ <property name="sizeHint" stdset="0"> >+ <size> >+ <width>428</width> >+ <height>16</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ </layout> >+ </widget> >+ <customwidgets> >+ <customwidget> >+ <class>KComboBox</class> >+ <extends>QComboBox</extends> >+ <header>kcombobox.h</header> >+ </customwidget> >+ <customwidget> >+ <class>KLineEdit</class> >+ <extends>QLineEdit</extends> >+ <header>klineedit.h</header> >+ </customwidget> >+ </customwidgets> >+ <tabstops> >+ <tabstop>resolutionComboBox</tabstop> >+ <tabstop>kcfg_FreeRDPWidth</tabstop> >+ <tabstop>kcfg_FreeRDPHeight</tabstop> >+ <tabstop>kcfg_FreeRDPColorDepth</tabstop> >+ <tabstop>kcfg_FreeRDPKeyboardLayout</tabstop> >+ <tabstop>kcfg_FreeRDPSound</tabstop> >+ <tabstop>kcfg_FreeRDPConsole</tabstop> >+ <tabstop>kcfg_FreeRDPExtraOptions</tabstop> >+ <tabstop>kcfg_DefaultFreerdpUserName</tabstop> >+ <tabstop>kcfg_FreeRDPRecognizeLdapLogins</tabstop> >+ </tabstops> >+ <resources/> >+ <connections/> >+</ui> >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdp.protocol kdenetwork-4.9.1/krdc/freerdp/freerdp.protocol >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdp.protocol 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdp.protocol 2012-09-19 22:30:10.602196002 +0200 >@@ -0,0 +1,12 @@ >+[Protocol] >+exec=krdc '%u' >+protocol=freerdp >+input=none >+output=none >+helper=true >+listing= >+reading=false >+writing=false >+makedir=false >+deleting=false >+Icon=krdc >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdpview.cpp kdenetwork-4.9.1/krdc/freerdp/freerdpview.cpp >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdpview.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdpview.cpp 2012-09-19 22:30:10.600196003 +0200 >@@ -0,0 +1,327 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2002 Arend van Beelen jr. <arend@auton.nl> >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdpview.h" >+ >+#include "settings.h" >+ >+#include <KInputDialog> >+#include <KMessageBox> >+#include <KPasswordDialog> >+#include <KShell> >+ >+#include <QX11EmbedContainer> >+#include <QEvent> >+ >+FreerdpView::FreerdpView(QWidget *parent, >+ const KUrl &url, >+ KConfigGroup configGroup, >+ const QString &user, const QString &password, >+ int flags, const QString &domain, >+ const QString &shell, const QString &directory) >+ : RemoteView(parent), >+ m_user(user), >+ m_password(password), >+ m_flags(flags), >+ m_domain(domain), >+ m_shell(shell), >+ m_directory(directory), >+ m_quitFlag(false), >+ m_process(NULL) >+{ >+ m_url = url; >+ m_host = url.host(); >+ m_port = url.port(); >+ >+ if (m_port <= 0) { >+ m_port = TCP_PORT_FREERDP; >+ } >+ >+ m_container = new QX11EmbedContainer(this); >+ m_container->installEventFilter(this); >+ >+ m_hostPreferences = new FreerdpHostPreferences(configGroup, this); >+} >+ >+FreerdpView::~FreerdpView() >+{ >+ startQuitting(); >+} >+ >+// filter out key and mouse events to the container if we are view only >+//FIXME: X11 events are passed to the app before getting caught in the Qt event processing >+bool FreerdpView::eventFilter(QObject *obj, QEvent *event) >+{ >+ if (m_viewOnly) { >+ if (event->type() == QEvent::KeyPress || >+ event->type() == QEvent::KeyRelease || >+ event->type() == QEvent::MouseButtonDblClick || >+ event->type() == QEvent::MouseButtonPress || >+ event->type() == QEvent::MouseButtonRelease || >+ event->type() == QEvent::MouseMove) >+ return true; >+ } >+ return RemoteView::eventFilter(obj, event); >+} >+ >+QSize FreerdpView::framebufferSize() >+{ >+ return m_container->minimumSizeHint(); >+} >+ >+QSize FreerdpView::sizeHint() const >+{ >+ return maximumSize(); >+} >+ >+void FreerdpView::startQuitting() >+{ >+ kDebug(5012) << "About to quit"; >+ m_quitFlag = true; >+ if (m_process) { >+ m_process->terminate(); >+ m_process->waitForFinished(1000); >+ m_container->discardClient(); >+ } >+} >+ >+bool FreerdpView::isQuitting() >+{ >+ return m_quitFlag; >+} >+ >+bool FreerdpView::start() >+{ >+kDebug(5010); >+ m_container->show(); >+ >+ if (m_hostPreferences->walletSupport()) { >+ if (m_url.userName().isEmpty()) { >+ QString userName; >+ bool ok = false; >+ >+ userName = KInputDialog::getText(i18n("Enter Username"), >+ i18n("Please enter the username you would like to use for login."), >+ Settings::defaultFreerdpUserName(), &ok, this); >+ >+ if (ok) >+ m_url.setUserName(userName); >+ } >+ >+kDebug(5010); >+ if (!m_url.userName().isEmpty()) { >+ const bool useLdapLogin = Settings::recognizeLdapLogins() && m_url.userName().contains('\\'); >+ kDebug(5012) << "Is LDAP login:" << useLdapLogin << m_url.userName(); >+ QString walletPassword = readWalletPassword(useLdapLogin); >+ >+ if (!walletPassword.isNull()) >+ m_url.setPassword(walletPassword); >+ else { >+ KPasswordDialog dialog(this); >+ dialog.setPrompt(i18n("Access to the system requires a password.")); >+ if (dialog.exec() == KPasswordDialog::Accepted) { >+ m_url.setPassword(dialog.password()); >+ >+ if (m_hostPreferences->walletSupport()) >+ saveWalletPassword(dialog.password(), useLdapLogin); >+ } >+ } >+ } >+ } >+ >+kDebug(5010); >+ m_process = new QProcess(m_container); >+ >+ QStringList arguments; >+ arguments << "-g" << (QString::number(m_hostPreferences->width()) + 'x' + >+ QString::number(m_hostPreferences->height())); >+ arguments << "-k" << m_hostPreferences->keyboardLayout(); >+ >+kDebug(5010); >+ if (!m_url.userName().isEmpty()) >+ arguments << "-u" << m_url.userName(); >+ else >+ arguments << "-u" << ""; >+ >+ if (!m_url.password().isNull()) >+ arguments << "-p" << m_url.password(); >+ >+ arguments << "-D"; // request the window has no decorations >+ arguments << "-X" << QString::number(m_container->winId()); >+ arguments << "-a" << QString::number((m_hostPreferences->colorDepth() + 1) * 8); >+ >+kDebug(5010); >+ switch (m_hostPreferences->sound()) { >+ case 1: >+ arguments << "-o"; >+ break; >+ case 0: >+ arguments << "--plugin" << "rdpsnd"; >+ break; >+ case 2: >+ default: >+ break; >+ } >+ >+ if (!m_hostPreferences->shareMedia().isEmpty()) { >+ QStringList shareMedia; >+ shareMedia << "--plugin" << "rdpdr" << "--data" << "disk:media:"+ m_hostPreferences->shareMedia() << "--"; >+ arguments += shareMedia; >+ } >+ >+ QString performance; >+ switch (m_hostPreferences->performance()) { >+ case 0: >+ performance = "m"; >+ break; >+ case 1: >+ performance = "b"; >+ break; >+ case 2: >+ performance = "l"; >+ break; >+ default: >+ break; >+ } >+ arguments << "-x" << performance; >+ >+ if (m_hostPreferences->console()) { >+ arguments << "-0"; >+ } >+ >+ if (m_hostPreferences->remoteFX()) { >+ arguments << "--rfx"; >+ } >+ >+ if (!m_hostPreferences->extraOptions().isEmpty()) { >+ const QStringList additionalArguments = KShell::splitArgs(m_hostPreferences->extraOptions()); >+ arguments += additionalArguments; >+ } >+ >+ arguments << "--ignore-certificate"; >+ >+ arguments << (m_host + ':' + QString::number(m_port)); >+ >+ setStatus(Connecting); >+ >+ connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError))); >+ connect(m_process, SIGNAL(readyReadStandardError()), SLOT(receivedStandardError())); >+ connect(m_container, SIGNAL(clientClosed()), SLOT(connectionClosed())); >+ connect(m_container, SIGNAL(clientIsEmbedded()), SLOT(connectionOpened())); >+ >+kDebug(5010) << "xfreerdp " << arguments << endl; >+ m_process->start("xfreerdp", arguments); >+ >+ return true; >+} >+ >+HostPreferences* FreerdpView::hostPreferences() >+{ >+ return m_hostPreferences; >+} >+ >+void FreerdpView::switchFullscreen(bool on) >+{ >+ if (on == true) { >+ m_container->grabKeyboard(); >+ } >+} >+ >+void FreerdpView::connectionOpened() >+{ >+ kDebug(5012) << "Connection opened"; >+ const QSize size = m_container->minimumSizeHint(); >+ kDebug(5012) << "Size hint: " << size.width() << " " << size.height(); >+ setStatus(Connected); >+ setFixedSize(size); >+ resize(size); >+ m_container->setFixedSize(size); >+ emit framebufferSizeChanged(size.width(), size.height()); >+ emit connected(); >+ setFocus(); >+} >+ >+QPixmap FreerdpView::takeScreenshot() >+{ >+ return QPixmap::grabWindow(m_container->clientWinId()); >+} >+ >+void FreerdpView::connectionClosed() >+{ >+ emit disconnected(); >+ setStatus(Disconnected); >+ m_quitFlag = true; >+} >+ >+void FreerdpView::processError(QProcess::ProcessError error) >+{ >+ if (m_quitFlag) // do not try to show error messages while quitting (prevent crashes) >+ return; >+ >+ if (m_status == Connecting) { >+ setStatus(Disconnected); >+ >+ if (error == QProcess::FailedToStart) { >+ KMessageBox::error(0, i18n("Could not start \"xfreerdp\"; make sure xfreerdp is properly installed."), >+ i18n("FREERDP Failure")); >+ return; >+ } >+ >+ if (m_clientVersion.isEmpty()) { >+ KMessageBox::error(0, i18n("Connection attempt to host failed."), >+ i18n("Connection Failure")); >+ } else { >+ KMessageBox::error(0, i18n("The version of \"xfreerdp\" you are using (%1) is too old:\n" >+ "xfreerdp 1.0.1 or greater is required.", m_clientVersion), >+ i18n("FREERDP Failure")); >+ } >+ emit disconnectedError(); >+ } >+} >+ >+void FreerdpView::receivedStandardError() >+{ >+ const QString output(m_process->readAllStandardError()); >+ QString line; >+ int i = 0; >+ while (!(line = output.section('\n', i, i)).isEmpty()) { >+ if (line.startsWith(QLatin1String("Version "))) { >+ m_clientVersion = line.section(' ', 1, 1); >+ m_clientVersion = m_clientVersion.left(m_clientVersion.length() - 1); >+ return; >+ } else { >+ kDebug(5012) << "Process error output: " << line; >+ } >+ i++; >+ } >+} >+ >+void FreerdpView::setGrabAllKeys(bool grabAllKeys) >+{ >+ Q_UNUSED(grabAllKeys); >+ // do nothing.. grabKeyboard seems not to be supported in QX11EmbedContainer >+} >+ >+#include "freerdpview.moc" >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdpviewfactory.cpp kdenetwork-4.9.1/krdc/freerdp/freerdpviewfactory.cpp >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdpviewfactory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdpviewfactory.cpp 2012-09-19 22:30:10.599196003 +0200 >@@ -0,0 +1,94 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdpviewfactory.h" >+ >+#include <KDebug> >+#include <KStandardDirs> >+ >+KRDC_PLUGIN_EXPORT(FreerdpViewFactory) >+ >+FreerdpViewFactory::FreerdpViewFactory(QObject *parent, const QVariantList &args) >+ : RemoteViewFactory(parent) >+{ >+ Q_UNUSED(args); >+ >+ KGlobal::locale()->insertCatalog("krdc"); >+ >+ m_connectToolTipString = i18n("Connect to a Windows Remote Desktop (RDP)"); >+ >+ QMetaObject::invokeMethod(this, "checkRdektopAvailability", Qt::DirectConnection); >+} >+ >+FreerdpViewFactory::~FreerdpViewFactory() >+{ >+} >+ >+bool FreerdpViewFactory::supportsUrl(const KUrl &url) const >+{ >+ return (url.scheme().compare("freerdp", Qt::CaseInsensitive) == 0); >+} >+ >+RemoteView *FreerdpViewFactory::createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+{ >+kDebug(); >+ return new FreerdpView(parent, url, configGroup); >+} >+ >+HostPreferences *FreerdpViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) >+{ >+kDebug(); >+ return new FreerdpHostPreferences(configGroup, parent); >+} >+ >+QString FreerdpViewFactory::scheme() const >+{ >+ return "freerdp"; >+} >+ >+QString FreerdpViewFactory::connectActionText() const >+{ >+ return i18n("New FreeRDP Connection..."); >+} >+ >+QString FreerdpViewFactory::connectButtonText() const >+{ >+ return m_connectToolTipString; >+} >+ >+QString FreerdpViewFactory::connectToolTipText() const >+{ >+ return i18n("<html>Enter the address here. Port is optional.<br />" >+ "<i>Example: freerdpserver:3389 (host:port)</i></html>"); >+} >+ >+void FreerdpViewFactory::checkRdektopAvailability() >+{ >+ if (KStandardDirs::findExe("xfreerdp").isEmpty()) { >+ m_connectToolTipString += '\n' + i18n("The application \"xfreerdp\" cannot be found on your system; make sure it is properly installed " >+ "if you need RDP support."); >+ } >+} >+ >+#include "moc_freerdpviewfactory.cpp" >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdpviewfactory.h kdenetwork-4.9.1/krdc/freerdp/freerdpviewfactory.h >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdpviewfactory.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdpviewfactory.h 2012-09-19 22:30:10.600196003 +0200 >@@ -0,0 +1,63 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPVIEWFACTORY_H >+#define FREERDPVIEWFACTORY_H >+ >+#include "remoteviewfactory.h" >+ >+#include "freerdpview.h" >+#include "freerdppreferences.h" >+ >+class FreerdpViewFactory : public RemoteViewFactory >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpViewFactory(QObject *parent, const QVariantList &args); >+ >+ virtual ~FreerdpViewFactory(); >+ >+ virtual bool supportsUrl(const KUrl &url) const; >+ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup); >+ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent); >+ >+ virtual QString scheme() const; >+ >+ virtual QString connectActionText() const; >+ >+ virtual QString connectButtonText() const; >+ >+ virtual QString connectToolTipText() const; >+ >+private Q_SLOTS: >+ void checkRdektopAvailability(); >+ >+private: >+ QString m_connectToolTipString; >+}; >+ >+#endif // FREERDPVIEWFACTORY_H >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/freerdpview.h kdenetwork-4.9.1/krdc/freerdp/freerdpview.h >--- kdenetwork-4.9.1.org/krdc/freerdp/freerdpview.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/freerdpview.h 2012-09-19 22:30:10.600196003 +0200 >@@ -0,0 +1,101 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2002 Arend van Beelen jr. <arend@auton.nl> >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPVIEW_H >+#define FREERDPVIEW_H >+ >+#include "remoteview.h" >+ >+#include "freerdphostpreferences.h" >+ >+#include <QProcess> >+ >+#define TCP_PORT_FREERDP 3389 >+#define FREERDP_LOGON_NORMAL 0x33 >+ >+class FreerdpView; >+ >+class QX11EmbedContainer; >+ >+class FreerdpView : public RemoteView >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpView(QWidget *parent = 0, >+ const KUrl &url = KUrl(), >+ KConfigGroup configGroup = KConfigGroup(), >+ const QString &user = QString(), const QString &password = QString(), >+ int flags = FREERDP_LOGON_NORMAL, const QString &domain = QString(), >+ const QString &shell = QString(), const QString &directory = QString()); >+ >+ virtual ~FreerdpView(); >+ >+ // functions regarding the window >+ virtual QSize framebufferSize(); // returns the size of the remote view >+ QSize sizeHint() const; // returns the suggested size >+ >+ // functions regarding the connection >+ virtual void startQuitting(); // start closing the connection >+ virtual bool isQuitting(); // are we currently closing the connection? >+ virtual bool start(); // open a connection >+ void setGrabAllKeys(bool grabAllKeys); >+ >+ HostPreferences* hostPreferences(); >+ >+ virtual QPixmap takeScreenshot(); >+ >+public slots: >+ virtual void switchFullscreen(bool on); >+ >+protected: >+ bool eventFilter(QObject *obj, QEvent *event); >+ >+private: >+ // properties used for setting up the connection >+ QString m_name; // name of the connection >+ QString m_user; // the user to use to log in >+ QString m_password; // the password to use >+ int m_flags; // flags which determine how the connection is set up >+ QString m_domain; // the domain where the host is on >+ QString m_shell; // the shell to use >+ QString m_directory; // the working directory on the server >+ >+ // other properties >+ bool m_quitFlag; // if set: die >+ QString m_clientVersion; // version number returned by xfreerdp >+ QX11EmbedContainer *m_container; // container for the xfreerdp window >+ QProcess *m_process; // xfreerdp process >+ >+ FreerdpHostPreferences *m_hostPreferences; >+ >+private slots: >+ void connectionOpened(); // called if xfreerdp started >+ void connectionClosed(); // called if xfreerdp quits >+ void processError(QProcess::ProcessError error); // called if xfreerdp dies >+ void receivedStandardError(); // catches xfreerdp debug output >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/krdc_freerdp_config.desktop kdenetwork-4.9.1/krdc/freerdp/krdc_freerdp_config.desktop >--- kdenetwork-4.9.1.org/krdc/freerdp/krdc_freerdp_config.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/krdc_freerdp_config.desktop 2012-09-19 22:30:10.599196003 +0200 >@@ -0,0 +1,60 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KCModule >+Name=FREERDP >+Name[ast]=FREERDP >+Name[bg]=FREERDP >+Name[bs]=FREERDP >+Name[ca]=FREERDP >+Name[ca@valencia]=FREERDP >+Name[cs]=FREERDP >+Name[da]=FREERDP >+Name[de]=FREERDP >+Name[el]=FREERDP >+Name[en_GB]=FREERDP >+Name[eo]=FREERDP >+Name[es]=FREERDP >+Name[et]=FREERDP >+Name[eu]=FREERDP >+Name[fi]=FREERDP >+Name[fr]=FREERDP >+Name[ga]=FREERDP >+Name[gl]=FREERDP >+Name[hr]=FREERDP >+Name[hu]=FREERDP >+Name[ia]=FREERDP >+Name[it]=FREERDP >+Name[ja]=FREERDP >+Name[kk]=FREERDP >+Name[km]=FREERDP >+Name[ko]=FREERDP >+Name[lt]=FREERDP >+Name[lv]=FREERDP >+Name[nb]=FREERDP >+Name[nds]=FREERDP >+Name[nl]=FREERDP >+Name[nn]=FREERDP >+Name[pa]=FREERDP >+Name[pl]=FREERDP >+Name[pt]=FREERDP >+Name[pt_BR]=FREERDP >+Name[ro]=FREERDP >+Name[ru]=ÐÐ°Ð·Ð¾Ð²Ð°Ñ Ð¿ÑогÑамма FREERDP >+Name[si]=FREERDP >+Name[sk]=FREERDP >+Name[sl]=FREERDP >+Name[sr]=Ð ÐÐ >+Name[sr@ijekavian]=Ð ÐÐ >+Name[sr@ijekavianlatin]=FREERDP >+Name[sr@latin]=FREERDP >+Name[sv]=FREERDP >+Name[tr]=FREERDP >+Name[ug]=FREERDP >+Name[uk]=FREERDP >+Name[wa]=FREERDP >+Name[x-test]=xxFREERDPxx >+Name[zh_CN]=FREERDP >+Name[zh_TW]=FREERDP >+ >+X-KDE-Library=kcm_krdc_freerdpplugin >+X-KDE-ParentComponents=krdc_freerdpplugin >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/krdc_freerdp.desktop kdenetwork-4.9.1/krdc/freerdp/krdc_freerdp.desktop >--- kdenetwork-4.9.1.org/krdc/freerdp/krdc_freerdp.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/krdc_freerdp.desktop 2012-09-19 22:30:10.599196003 +0200 >@@ -0,0 +1,121 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KRDC/Plugin >+Icon=krdc >+Name=FREERDP >+Name[ast]=FREERDP >+Name[bg]=FREERDP >+Name[bs]=FREERDP >+Name[ca]=FREERDP >+Name[ca@valencia]=FREERDP >+Name[cs]=FREERDP >+Name[da]=FREERDP >+Name[de]=FREERDP >+Name[el]=FREERDP >+Name[en_GB]=FREERDP >+Name[eo]=FREERDP >+Name[es]=FREERDP >+Name[et]=FREERDP >+Name[eu]=FREERDP >+Name[fi]=FREERDP >+Name[fr]=FREERDP >+Name[ga]=FREERDP >+Name[gl]=FREERDP >+Name[hr]=FREERDP >+Name[hu]=FREERDP >+Name[ia]=FREERDP >+Name[it]=FREERDP >+Name[ja]=FREERDP >+Name[kk]=FREERDP >+Name[km]=FREERDP >+Name[ko]=FREERDP >+Name[lt]=FREERDP >+Name[lv]=FREERDP >+Name[nb]=FREERDP >+Name[nds]=FREERDP >+Name[nl]=FREERDP >+Name[nn]=FREERDP >+Name[pa]=FREERDP >+Name[pl]=FREERDP >+Name[pt]=FREERDP >+Name[pt_BR]=FREERDP >+Name[ro]=FREERDP >+Name[ru]=ÐÐ°Ð·Ð¾Ð²Ð°Ñ Ð¿ÑогÑамма FREERDP >+Name[si]=FREERDP >+Name[sk]=FREERDP >+Name[sl]=FREERDP >+Name[sr]=Ð ÐÐ >+Name[sr@ijekavian]=Ð ÐÐ >+Name[sr@ijekavianlatin]=FREERDP >+Name[sr@latin]=FREERDP >+Name[sv]=FREERDP >+Name[tr]=FREERDP >+Name[ug]=FREERDP >+Name[uk]=FREERDP >+Name[wa]=FREERDP >+Name[x-test]=xxFREERDPxx >+Name[zh_CN]=FREERDP >+Name[zh_TW]=FREERDP >+Comment=Allows managing FREERDP sessions through KRDC >+Comment[ast]=Permite la xestión de sesiones FREERDP per KRDC >+Comment[bg]=УпÑавление на ÑеÑии на FREERDP Ñ KRDC >+Comment[bs]=DopuÅ¡ta upravljanje RPD sesijama kroz KRDC >+Comment[ca]=Permet gestionar sessions FREERDP mitjançant el KRDC >+Comment[ca@valencia]=Permet gestionar sessions FREERDP mitjançant el KRDC >+Comment[cs]=UmožÅuje spravovánà sezenà FREERDP pomocà KRDC >+Comment[da]=Muliggør hÃ¥ndtering af FREERDP-sessioner via KRDC >+Comment[de]=Erlaubt die Verwaltung von FREERDP-Sitzungen über KRDC >+Comment[el]=ÎÏιÏÏÎÏει Ïη διαÏείÏιÏη ÏÏ Î½ÎµÎ´ÏιÏν FREERDP μÎÏÏ ÏÎ¿Ï KRDC >+Comment[en_GB]=Allows managing FREERDP sessions through KRDC >+Comment[es]=Permite la gestión de sesiones FREERDP mediante KRDC >+Comment[et]=FREERDP-seansside haldamise võimaldamine KRDC kaudu >+Comment[eu]=FREERDP saioak KRDC bidez kudeatzea baimentzen du >+Comment[fi]=Sallii FREERDP-istuntojen hallinnan KRDC:n kautta >+Comment[fr]=Permet de gérer des sessions FREERDP au travers de KRDC >+Comment[ga]=CeadaÃonn sé duit seisiúin FREERDP a bhainistiú trà KRDC >+Comment[gl]=Permite xestionar sesións FREERDP por medio de KRDC >+Comment[hr]=OmoguÄuje upravljanje sjednicama FREERDP-a kroz KRDC >+Comment[hu]=FREERDP-kezelés KRDC-bÅl >+Comment[ia]=Permitte gerer sessiones FREERDP per medio de KRDC >+Comment[it]=Permette di gestire sessioni FREERDP con KRDC >+Comment[ja]=KRDC ãã FREERDP ã»ãã·ã§ã³ã管çã§ããããã«ãã¾ã >+Comment[kk]=KRDC аÑÒÑÐ»Ñ FREERDP ÑеанÑÑаÑÑн баÑÒаÑÑÒа мүмкÑндÑк беÑÑ >+Comment[km]=á¢áá»áááá¶áâá²ááâáááááááááâááááâáááá FREERDP áá¶áááá KRDC >+Comment[ko]=KRDC를 íµí´ì FREERDP ì¸ì ê´ë¦¬í기 >+Comment[lt]=Leidžia valdyti FREERDP sesijas per KRDC >+Comment[lv]=Ä»auj pÄrvaldÄ«t FREERDP sesijas caur KRDC >+Comment[nb]=Tillater Ã¥ styre FREERDP-økter gjennom KRDC >+Comment[nds]=FREERDP-Törns över KRDC plegen >+Comment[nl]=Staat het beheer van FREERDP-sessies toe via KRDC >+Comment[nn]=Lèt deg handtera FREERDP-økter gjennom KRDC >+Comment[pa]=KRDC ਰਾਹà©à¨ FREERDP ਸ਼à©à¨¸à¨¼à¨¨à¨¾à¨ ਦ੠ਪਰਬੰਧ ਦ੠ਮਨà¨à¨¼à©à¨°à© >+Comment[pl]=Pozwala na zarzÄ dzanie sesjami FREERDP przez KRDC >+Comment[pt]=Permite a gestão de sessões FREERDP através do KRDC >+Comment[pt_BR]=Permite o gerenciamento de sessões FREERDP através do KRDC >+Comment[ro]=Permite gestiunea sesiunilor FREERDP prin KRDC >+Comment[ru]=РазÑеÑиÑÑ ÑпÑавление ÑеанÑами FREERDP ÑеÑез KRDC >+Comment[si]=KRDC à·à¶»à·à· FREERDP à·à·à¶» à¶´à·à¶½à¶±à¶ºà¶§ à¶à¶© දà·à¶ºà· >+Comment[sk]=UmožÅuje spravovanie FREERDP sedenà pomocou KRDC >+Comment[sl]=OmogoÄa upravljanje sej FREERDP prek KRDC >+Comment[sr]=УпÑавÑаÑе Ð ÐÐ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavian]=УпÑавÑаÑе Ð ÐÐ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavianlatin]=Upravljanje FREERDP sesijama kroz KRDC >+Comment[sr@latin]=Upravljanje FREERDP sesijama kroz KRDC >+Comment[sv]=TillÃ¥ter hantering av FREERDP-sessioner via KRDC >+Comment[th]=à¸à¸à¸¸à¸à¸²à¸à¹à¸«à¹à¸à¸³à¸à¸²à¸£à¸à¸±à¸à¸à¸²à¸£à¸§à¸²à¸£à¸°à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸ FREERDP à¸à¹à¸²à¸à¸à¸²à¸à¹à¸à¸£à¹à¸à¸£à¸¡ KRDC >+Comment[tr]=FREERDP oturumlarını KRDC üzerinden yönetmeye izin verir >+Comment[uk]=ÐÐ°Ð´Ð°Ñ Ð·Ð¼Ð¾Ð³Ñ ÐºÐµÑÑваÑи ÑеанÑами FREERDP за Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ KRDC >+Comment[x-test]=xxAllows managing FREERDP sessions through KRDCxx >+Comment[zh_CN]=å è®¸ç¨æ·éè¿ KRDC 管ç FREERDPä¼è¯ >+Comment[zh_TW]=å 許éé KRDC 管ç FREERDP å·¥ä½é段 >+ >+X-KDE-PluginInfo-Author=AceLan Kao >+X-KDE-PluginInfo-Email=acelan@acelan.idv.tw >+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_freerdpplugin >+X-KDE-PluginInfo-Name=krdc_freerdpplugin >+ >+X-KDE-KRDC-Sorting=70 >diff -urN kdenetwork-4.9.1.org/krdc/freerdp/smb2rdc.desktop kdenetwork-4.9.1/krdc/freerdp/smb2rdc.desktop >--- kdenetwork-4.9.1.org/krdc/freerdp/smb2rdc.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdp/smb2rdc.desktop 2012-09-19 22:30:10.599196003 +0200 >@@ -0,0 +1,73 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KonqPopupMenu/Plugin >+MimeType=application/x-smb-server; >+Actions=smb2rdc; >+ >+[Desktop Action smb2rdc] >+Name=Open Remote Desktop Connection to This Machine >+Name[ar]=Ø§ÙØªØ ع٠بعد Ø³Ø·Ø Ø§ÙÙ ÙØªØ¨ Ø§ÙØ§ØªØµØ§Ù Ø¥ÙÙ ÙØ°Ù Ø§ÙØ¢ÙØ© >+Name[ast]=Abrir conexón remota d'escritoriu a esti sistema >+Name[bg]=ÐÑÑзка Ñ Ð¾ÑдалеÑен ÑабоÑно мÑÑÑо Ñ Ð¸Ð·Ð±ÑÐ°Ð½Ð¸Ñ ÐºÐ¾Ð¼Ð¿ÑÑÑÑ >+Name[bn]=à¦à¦ মà§à¦¶à¦¿à¦¨à§ পà§à¦°à¦¤à§à¦¯à¦¨à§à¦¤ ডà§à¦¸à§à¦à¦à¦ªà§à¦° সà¦à¦¯à§à¦ à¦à§à¦²à§ >+Name[bs]=Otvara udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[ca]=Obre una connexió remota d'escriptori a aquesta mà quina >+Name[ca@valencia]=Obri una connexió remota d'escriptori a esta mà quina >+Name[cs]=OtevÅÃt vzdálené pÅipojenà plochy k tomuto poÄÃtaÄi >+Name[da]=à bn ekstern desktopforbindelse til denne maskine >+Name[de]=Verbindung zur Arbeitsfläche dieses Rechners herstellen >+Name[el]=ÎÎ·Î¼Î¹Î¿Ï Ïγία ÏÏνδεÏÎ·Ï Ïε αÏομακÏÏ ÏμÎνη εÏιÏάνεια εÏγαÏÎ¯Î±Ï Ïε Î±Ï ÏÏ Ïο μηÏάνημα >+Name[en_GB]=Open Remote Desktop Connection to This Machine >+Name[eo]=Malfermi deforan tabulan konekton al tiu maÅino >+Name[es]=Abrir conexión remota de escritorio a este sistema >+Name[et]=Kaugtöölaua ühenduse avamine sellesse arvutisse >+Name[eu]=Ireki urruneko mahaigainaren konexioa makina honetara >+Name[fa]=باز کرد٠اتصا٠رÙÙ ÛØ²Û Ø±Ø§Ù Ø¯ÙØ± Ø¨Ø±Ø§Û Ø§Û٠٠اشÛÙ >+Name[fi]=Avaa etätyöpöytäyhteys tähän koneeseen >+Name[fr]=Ouvrir une connexion distante au bureau de cette machine >+Name[ga]=Oscail Ceangal Deisce Cianda leis an RÃomhaire Seo >+Name[gl]=Abrir unha conexión remota co escritorio desta máquina >+Name[he]=×¤×ª× ××××ר ש×××× ×¢×××× ×ר×××§ ××××× × ×× >+Name[hi]=à¤à¤¸ मशà¥à¤¨ à¤à¥ लिठरिमà¥à¤ डà¥à¤¸à¥à¤à¤à¥à¤ª à¤à¤¨à¥à¤à¥à¤¶à¤¨ à¤à¥à¤²à¥à¤ >+Name[hne]=यॠमसà¥à¤¨ बर रिमà¥à¤ डà¥à¤¸à¥à¤à¤à¤¾à¤ª à¤à¤¨à¥à¤à¥à¤¸à¤¨ à¤à¥à¤²à¤µ >+Name[hr]=Otvorena veza udaljenog pristupa prema ovom ureÄaju >+Name[hu]=Távoli munkaasztal nyitása itt >+Name[ia]=Aperi connexion de scriptorio remote a iste machina >+Name[is]=Opna fjarlæga skjáborðtengingu til þessarar vélar >+Name[it]=Apri connessione a desktop remoto a questa macchina >+Name[ja]=ãã®ãã¹ãã¸ãªã¢ã¼ããã¹ã¯ãããæ¥ç¶ãéã >+Name[kk]=ÐÑÑ ÐºÐ¾Ð¼Ð¿ÑÑÑеÑÐ´ÐµÐ³Ñ Ò¯ÑÑелге ÒаÑÑÒ ÒоÑÑлÑÐ¼Ð´Ñ Ð°ÑÑ >+Name[km]=áá¾áâáá¶áâáâáááá¶ááâááááâáá»âáá¸âá áááá¶áâáá âááá¶ááá¸áâááá >+Name[ko]=ì´ ìì¤í ì¼ë¡ì ì격 ë°ì¤í¬í± ì°ê²° ì´ê¸° >+Name[lt]=Užmegzti nutolusio darbastalio prijungimÄ prie Å¡io kompiuterio >+Name[lv]=AvÄrt attÄlinÄtÄs darbirsmas savienojumu uz Å¡o datoru >+Name[ml]=വിദàµà´° പണിയിà´à´¤àµà´¤à´¿à´¨àµ ഠയനàµà´¤àµà´°à´µàµà´®à´¾à´¯àµà´³àµà´³ ബനàµà´§à´ à´¤àµà´à´àµà´àµà´ >+Name[nb]=à pne fjerntilkobling til skrivebord til denne maskinen >+Name[nds]=Schriefdisch-Feernverbinnen na dissen Reekner opmaken >+Name[ne]=यॠमà¥à¤¶à¤¿à¤¨à¤®à¤¾ à¤à¤¾à¤¢à¤¾à¤à¥ डà¥à¤¸à¥à¤à¤à¤ª à¤à¤¡à¤¾à¤¨ à¤à¥à¤²à¥à¤¨à¥à¤¹à¥à¤¸à¥ >+Name[nl]=Externe bureaubladverbinding met deze computer openen >+Name[nn]=Opna samband til skrivebordet over nettverket til denne maskina >+Name[pa]=à¨à¨¸ ਮਸ਼à©à¨¨ ਨਾਲ ਰਿਮà©à¨ ਡà©à¨¸à¨à¨à¨¾à¨ª à¨à©à¨¨à©à¨à¨¸à¨¼à¨¨ à¨à©à¨²à©à¨¹à© >+Name[pl]=Otwórz zdalne poÅÄ czenie z pulpitem na tej maszynie >+Name[pt]=Abrir uma Ligação Remota ao Ecrã deste Computador >+Name[pt_BR]=Abre conexões remotas para essa máquina >+Name[ro]=DeschideÈi conexiune de birou distant spre aceastÄ maÈinÄ >+Name[ru]=ÐÑкÑÑÑÑ Ñоединение Remote Desktop Ñ ÑÑой маÑиной >+Name[si]=මà·à¶¸ යනà·à¶à·âරය à·à¶³à·à· දà·à¶»à·à·à¶® à·à·à¶©à¶à¶½ à·à¶¶à¶³à¶à·à· à·à·à·à·à¶ à¶à¶»à¶±à·à¶± >+Name[sk]=OtvoriÅ¥ vzdialené pripojenie pracovnej plochy k tomuto poÄÃtaÄu >+Name[sl]=Odpri povezavo z oddaljenim namizjem na tem raÄunalniku >+Name[sr]=ÐÑвоÑиÑе ÑдаÑÐµÐ½Ñ Ð²ÐµÐ·Ñ Ð¿Ð¾Ð²ÑÑи ка Ð¾Ð²Ð¾Ñ Ð¼Ð°Ñини >+Name[sr@ijekavian]=ÐÑвоÑиÑе ÑдаÑÐµÐ½Ñ Ð²ÐµÐ·Ñ Ð¿Ð¾Ð²ÑÑи ка Ð¾Ð²Ð¾Ñ Ð¼Ð°Ñини >+Name[sr@ijekavianlatin]=Otvorite udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[sr@latin]=Otvorite udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[sv]=Ãppna fjärrskrivbordsanslutning till den här datorn >+Name[th]=à¹à¸à¸´à¸à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸·à¹à¸à¸à¸µà¹à¸à¸³à¸à¸²à¸à¸à¸²à¸à¹à¸à¸¥à¸¡à¸²à¸¢à¸±à¸à¹à¸à¸£à¸·à¹à¸à¸à¸à¸µà¹ >+Name[tr]=Bu Makineye Uzak Masaüstü BaÄlantısı Aç >+Name[uk]=ÐÑдкÑиÑи з'ÑÐ´Ð½Ð°Ð½Ð½Ñ Ð· вÑÐ´Ð´Ð°Ð»ÐµÐ½Ð¾Ñ ÑÑÑлÑниÑÐµÑ Ð´Ð¾ ÑÑого комп'ÑÑеÑа >+Name[vi]=Má» kết ná»i mà n hình ná»n từ xa Äến máy nà y >+Name[x-test]=xxOpen Remote Desktop Connection to This Machinexx >+Name[zh_CN]=æå¼å°æ¤è®¡ç®æºçè¿ç¨æ¡é¢è¿æ¥ >+Name[zh_HK]=éæ¾é 端æ¡é¢é£ç·å°éé»è ¦ >+Name[zh_TW]=卿¤ä¸»æ©ä¸éåé 端æ¡é¢ >+Exec=krdc %u >+Icon=krdc >diff -urN kdenetwork-4.9.1.org/krdc/freerdphostpreferences.cpp kdenetwork-4.9.1/krdc/freerdphostpreferences.cpp >--- kdenetwork-4.9.1.org/krdc/freerdphostpreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdphostpreferences.cpp 2012-09-19 22:29:02.459196002 +0200 >@@ -0,0 +1,540 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdphostpreferences.h" >+ >+#include "settings.h" >+ >+#include <KDebug> >+ >+#include <QDesktopWidget> >+ >+static const QStringList keymaps = (QStringList() >+ << "ar" >+ << "cs" >+ << "da" >+ << "de" >+ << "de-ch" >+ << "en-dv" >+ << "en-gb" >+ << "en-us" >+ << "es" >+ << "et" >+ << "fi" >+ << "fo" >+ << "fr" >+ << "fr-be" >+ << "fr-ca" >+ << "fr-ch" >+ << "he" >+ << "hr" >+ << "hu" >+ << "is" >+ << "it" >+ << "ja" >+ << "ko" >+ << "lt" >+ << "lv" >+ << "mk" >+ << "nl" >+ << "nl-be" >+ << "no" >+ << "pl" >+ << "pt" >+ << "pt-br" >+ << "ru" >+ << "sl" >+ << "sv" >+ << "th" >+ << "tr" >+); >+ >+static const int defaultKeymap = 7; // en-us >+ >+inline int keymap2int(const QString &keymap) >+{ >+ const int index = keymaps.lastIndexOf(keymap); >+ return (index == -1) ? defaultKeymap : index; >+} >+ >+inline QString int2keymap(int layout) >+{ >+ if (layout >= 0 && layout < keymaps.count()) >+ return keymaps.at(layout); >+ else >+ return keymaps.at(defaultKeymap); >+} >+ >+FreerdpHostPreferences::FreerdpHostPreferences(KConfigGroup configGroup, QObject *parent) >+ : HostPreferences(configGroup, parent) >+{ >+} >+ >+FreerdpHostPreferences::~FreerdpHostPreferences() >+{ >+} >+ >+QWidget* FreerdpHostPreferences::createProtocolSpecificConfigPage() >+{ >+ QWidget *freerdpPage = new QWidget(); >+ freerdpUi.setupUi(freerdpPage); >+ >+ freerdpUi.loginGroupBox->setVisible(false); >+ >+ freerdpUi.kcfg_FreeRDPHeight->setValue(height()); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(width()); >+ freerdpUi.kcfg_FreeRDPColorDepth->setCurrentIndex(colorDepth()); >+ freerdpUi.kcfg_FreeRDPKeyboardLayout->setCurrentIndex(keymap2int(keyboardLayout())); >+ freerdpUi.kcfg_FreeRDPSound->setCurrentIndex(sound()); >+ freerdpUi.kcfg_FreeRDPConsole->setChecked(console()); >+ freerdpUi.kcfg_FreeRDPExtraOptions->setText(extraOptions()); >+ freerdpUi.kcfg_FreeRDPRemoteFX->setChecked(remoteFX()); >+ freerdpUi.kcfg_FreeRDPPerformance->setCurrentIndex(performance()); >+ freerdpUi.kcfg_FreeRDPShareMedia->setText(shareMedia()); >+ >+ connect(freerdpUi.resolutionComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateWidthHeight(int))); >+ >+ const QString resolutionString = QString::number(width()) + 'x' + QString::number(height()); >+ const int resolutionIndex = freerdpUi.resolutionComboBox->findText(resolutionString, Qt::MatchContains); >+ freerdpUi.resolutionComboBox->setCurrentIndex((resolutionIndex == -1) ? freerdpUi.resolutionComboBox->count() - 1 : resolutionIndex); >+ >+ return freerdpPage; >+} >+ >+void FreerdpHostPreferences::updateWidthHeight(int index) >+{ >+ switch (index) { >+ case 0: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(480); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(640); >+ break; >+ case 1: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(600); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(800); >+ break; >+ case 2: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(768); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1024); >+ break; >+ case 3: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(1024); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1280); >+ break; >+ case 4: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(1200); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1600); >+ break; >+ case 5: { >+ QDesktopWidget *desktop = QApplication::desktop(); >+ int currentScreen = desktop->screenNumber(freerdpUi.kcfg_FreeRDPHeight); >+ freerdpUi.kcfg_FreeRDPHeight->setValue(desktop->screenGeometry(currentScreen).height()); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(desktop->screenGeometry(currentScreen).width()); >+ break; >+ } >+ case 6: >+ default: >+ break; >+ } >+ >+ const bool enabled = (index == 6) ? true : false; >+ >+ freerdpUi.kcfg_FreeRDPHeight->setEnabled(enabled); >+ freerdpUi.kcfg_FreeRDPWidth->setEnabled(enabled); >+ freerdpUi.heightLabel->setEnabled(enabled); >+ freerdpUi.widthLabel->setEnabled(enabled); >+} >+ >+void FreerdpHostPreferences::acceptConfig() >+{ >+ HostPreferences::acceptConfig(); >+ >+ setHeight(freerdpUi.kcfg_FreeRDPHeight->value()); >+ setWidth(freerdpUi.kcfg_FreeRDPWidth->value()); >+ setColorDepth(freerdpUi.kcfg_FreeRDPColorDepth->currentIndex()); >+ setKeyboardLayout(int2keymap(freerdpUi.kcfg_FreeRDPKeyboardLayout->currentIndex())); >+ setSound(freerdpUi.kcfg_FreeRDPSound->currentIndex()); >+ setConsole(freerdpUi.kcfg_FreeRDPConsole->isChecked()); >+ setExtraOptions(freerdpUi.kcfg_FreeRDPExtraOptions->text()); >+ setRemoteFX(freerdpUi.kcfg_FreeRDPRemoteFX->isChecked()); >+ setPerformance(freerdpUi.kcfg_FreeRDPPerformance->currentIndex()); >+ setShareMedia(freerdpUi.kcfg_FreeRDPShareMedia->text()); >+} >+ >+void FreerdpHostPreferences::setColorDepth(int colorDepth) >+{ >+ if (colorDepth >= 0) >+ m_configGroup.writeEntry("freeRDPColorDepth", colorDepth); >+} >+ >+int FreerdpHostPreferences::colorDepth() const >+{ >+ return m_configGroup.readEntry("freeRDPColorDepth", Settings::freeRDPColorDepth()); >+} >+ >+void FreerdpHostPreferences::setKeyboardLayout(const QString &keyboardLayout) >+{ >+ if (!keyboardLayout.isNull()) >+ m_configGroup.writeEntry("freeRDPKeyboardLayout", keymap2int(keyboardLayout)); >+} >+ >+QString FreerdpHostPreferences::keyboardLayout() const >+{ >+ return int2keymap(m_configGroup.readEntry("freeRDPKeyboardLayout", Settings::freeRDPKeyboardLayout())); >+} >+ >+void FreerdpHostPreferences::setSound(int sound) >+{ >+ if (sound >= 0) >+ m_configGroup.writeEntry("freeRDPSound", sound); >+} >+ >+int FreerdpHostPreferences::sound() const >+{ >+ return m_configGroup.readEntry("freeRDPSound", Settings::freeRDPSound()); >+} >+ >+void FreerdpHostPreferences::setConsole(bool console) >+{ >+ m_configGroup.writeEntry("freeRDPConsole", console); >+} >+ >+bool FreerdpHostPreferences::console() const >+{ >+ return m_configGroup.readEntry("freeRDPConsole", Settings::freeRDPConsole()); >+} >+ >+void FreerdpHostPreferences::setExtraOptions(const QString &extraOptions) >+{ >+ if (!extraOptions.isNull()) >+ m_configGroup.writeEntry("freeRDPExtraOptions", extraOptions); >+} >+ >+QString FreerdpHostPreferences::extraOptions() const >+{ >+ return m_configGroup.readEntry("freeRDPExtraOptions", Settings::freeRDPExtraOptions()); >+} >+ >+void FreerdpHostPreferences::setRemoteFX(bool remoteFX) >+{ >+ m_configGroup.writeEntry("freeRDPRemoteFX", remoteFX); >+} >+ >+bool FreerdpHostPreferences::remoteFX() const >+{ >+ return m_configGroup.readEntry("freeRDPRemoteFX", Settings::freeRDPRemoteFX()); >+} >+ >+void FreerdpHostPreferences::setPerformance(int performance) >+{ >+ if (performance >= 0) >+ m_configGroup.writeEntry("freeRDPPerformance", performance); >+} >+ >+int FreerdpHostPreferences::performance() const >+{ >+ return m_configGroup.readEntry("freeRDPPerformance", Settings::freeRDPPerformance()); >+} >+ >+void FreerdpHostPreferences::setShareMedia(const QString &shareMedia) >+{ >+ if (!shareMedia.isNull()) >+ m_configGroup.writeEntry("freeRDPShareMedia", shareMedia); >+} >+ >+QString FreerdpHostPreferences::shareMedia() const >+{ >+ return m_configGroup.readEntry("freeRDPShareMedia", Settings::freeRDPShareMedia()); >+} >+ >+#include "freerdphostpreferences.moc" >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdphostpreferences.h" >+ >+#include "settings.h" >+ >+#include <KDebug> >+ >+#include <QDesktopWidget> >+ >+static const QStringList keymaps = (QStringList() >+ << "ar" >+ << "cs" >+ << "da" >+ << "de" >+ << "de-ch" >+ << "en-dv" >+ << "en-gb" >+ << "en-us" >+ << "es" >+ << "et" >+ << "fi" >+ << "fo" >+ << "fr" >+ << "fr-be" >+ << "fr-ca" >+ << "fr-ch" >+ << "he" >+ << "hr" >+ << "hu" >+ << "is" >+ << "it" >+ << "ja" >+ << "ko" >+ << "lt" >+ << "lv" >+ << "mk" >+ << "nl" >+ << "nl-be" >+ << "no" >+ << "pl" >+ << "pt" >+ << "pt-br" >+ << "ru" >+ << "sl" >+ << "sv" >+ << "th" >+ << "tr" >+); >+ >+static const int defaultKeymap = 7; // en-us >+ >+inline int keymap2int(const QString &keymap) >+{ >+ const int index = keymaps.lastIndexOf(keymap); >+ return (index == -1) ? defaultKeymap : index; >+} >+ >+inline QString int2keymap(int layout) >+{ >+ if (layout >= 0 && layout < keymaps.count()) >+ return keymaps.at(layout); >+ else >+ return keymaps.at(defaultKeymap); >+} >+ >+FreerdpHostPreferences::FreerdpHostPreferences(KConfigGroup configGroup, QObject *parent) >+ : HostPreferences(configGroup, parent) >+{ >+} >+ >+FreerdpHostPreferences::~FreerdpHostPreferences() >+{ >+} >+ >+QWidget* FreerdpHostPreferences::createProtocolSpecificConfigPage() >+{ >+ QWidget *freerdpPage = new QWidget(); >+ freerdpUi.setupUi(freerdpPage); >+ >+ freerdpUi.loginGroupBox->setVisible(false); >+ >+ freerdpUi.kcfg_FreeRDPHeight->setValue(height()); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(width()); >+ freerdpUi.kcfg_FreeRDPColorDepth->setCurrentIndex(colorDepth()); >+ freerdpUi.kcfg_FreeRDPKeyboardLayout->setCurrentIndex(keymap2int(keyboardLayout())); >+ freerdpUi.kcfg_FreeRDPSound->setCurrentIndex(sound()); >+ freerdpUi.kcfg_FreeRDPConsole->setChecked(console()); >+ freerdpUi.kcfg_FreeRDPExtraOptions->setText(extraOptions()); >+ freerdpUi.kcfg_FreeRDPRemoteFX->setChecked(remoteFX()); >+ freerdpUi.kcfg_FreeRDPPerformance->setCurrentIndex(performance()); >+ freerdpUi.kcfg_FreeRDPShareMedia->setText(shareMedia()); >+ >+ connect(freerdpUi.resolutionComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateWidthHeight(int))); >+ >+ const QString resolutionString = QString::number(width()) + 'x' + QString::number(height()); >+ const int resolutionIndex = freerdpUi.resolutionComboBox->findText(resolutionString, Qt::MatchContains); >+ freerdpUi.resolutionComboBox->setCurrentIndex((resolutionIndex == -1) ? freerdpUi.resolutionComboBox->count() - 1 : resolutionIndex); >+ >+ return freerdpPage; >+} >+ >+void FreerdpHostPreferences::updateWidthHeight(int index) >+{ >+ switch (index) { >+ case 0: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(480); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(640); >+ break; >+ case 1: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(600); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(800); >+ break; >+ case 2: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(768); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1024); >+ break; >+ case 3: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(1024); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1280); >+ break; >+ case 4: >+ freerdpUi.kcfg_FreeRDPHeight->setValue(1200); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(1600); >+ break; >+ case 5: { >+ QDesktopWidget *desktop = QApplication::desktop(); >+ int currentScreen = desktop->screenNumber(freerdpUi.kcfg_FreeRDPHeight); >+ freerdpUi.kcfg_FreeRDPHeight->setValue(desktop->screenGeometry(currentScreen).height()); >+ freerdpUi.kcfg_FreeRDPWidth->setValue(desktop->screenGeometry(currentScreen).width()); >+ break; >+ } >+ case 6: >+ default: >+ break; >+ } >+ >+ const bool enabled = (index == 6) ? true : false; >+ >+ freerdpUi.kcfg_FreeRDPHeight->setEnabled(enabled); >+ freerdpUi.kcfg_FreeRDPWidth->setEnabled(enabled); >+ freerdpUi.heightLabel->setEnabled(enabled); >+ freerdpUi.widthLabel->setEnabled(enabled); >+} >+ >+void FreerdpHostPreferences::acceptConfig() >+{ >+ HostPreferences::acceptConfig(); >+ >+ setHeight(freerdpUi.kcfg_FreeRDPHeight->value()); >+ setWidth(freerdpUi.kcfg_FreeRDPWidth->value()); >+ setColorDepth(freerdpUi.kcfg_FreeRDPColorDepth->currentIndex()); >+ setKeyboardLayout(int2keymap(freerdpUi.kcfg_FreeRDPKeyboardLayout->currentIndex())); >+ setSound(freerdpUi.kcfg_FreeRDPSound->currentIndex()); >+ setConsole(freerdpUi.kcfg_FreeRDPConsole->isChecked()); >+ setExtraOptions(freerdpUi.kcfg_FreeRDPExtraOptions->text()); >+ setRemoteFX(freerdpUi.kcfg_FreeRDPRemoteFX->isChecked()); >+ setPerformance(freerdpUi.kcfg_FreeRDPPerformance->currentIndex()); >+ setShareMedia(freerdpUi.kcfg_FreeRDPShareMedia->text()); >+} >+ >+void FreerdpHostPreferences::setColorDepth(int colorDepth) >+{ >+ if (colorDepth >= 0) >+ m_configGroup.writeEntry("freeRDPColorDepth", colorDepth); >+} >+ >+int FreerdpHostPreferences::colorDepth() const >+{ >+ return m_configGroup.readEntry("freeRDPColorDepth", Settings::freeRDPColorDepth()); >+} >+ >+void FreerdpHostPreferences::setKeyboardLayout(const QString &keyboardLayout) >+{ >+ if (!keyboardLayout.isNull()) >+ m_configGroup.writeEntry("freeRDPKeyboardLayout", keymap2int(keyboardLayout)); >+} >+ >+QString FreerdpHostPreferences::keyboardLayout() const >+{ >+ return int2keymap(m_configGroup.readEntry("freeRDPKeyboardLayout", Settings::freeRDPKeyboardLayout())); >+} >+ >+void FreerdpHostPreferences::setSound(int sound) >+{ >+ if (sound >= 0) >+ m_configGroup.writeEntry("freeRDPSound", sound); >+} >+ >+int FreerdpHostPreferences::sound() const >+{ >+ return m_configGroup.readEntry("freeRDPSound", Settings::freeRDPSound()); >+} >+ >+void FreerdpHostPreferences::setConsole(bool console) >+{ >+ m_configGroup.writeEntry("freeRDPConsole", console); >+} >+ >+bool FreerdpHostPreferences::console() const >+{ >+ return m_configGroup.readEntry("freeRDPConsole", Settings::freeRDPConsole()); >+} >+ >+void FreerdpHostPreferences::setExtraOptions(const QString &extraOptions) >+{ >+ if (!extraOptions.isNull()) >+ m_configGroup.writeEntry("freeRDPExtraOptions", extraOptions); >+} >+ >+QString FreerdpHostPreferences::extraOptions() const >+{ >+ return m_configGroup.readEntry("freeRDPExtraOptions", Settings::freeRDPExtraOptions()); >+} >+ >+void FreerdpHostPreferences::setRemoteFX(bool remoteFX) >+{ >+ m_configGroup.writeEntry("freeRDPRemoteFX", remoteFX); >+} >+ >+bool FreerdpHostPreferences::remoteFX() const >+{ >+ return m_configGroup.readEntry("freeRDPRemoteFX", Settings::freeRDPRemoteFX()); >+} >+ >+void FreerdpHostPreferences::setPerformance(int performance) >+{ >+ if (performance >= 0) >+ m_configGroup.writeEntry("freeRDPPerformance", performance); >+} >+ >+int FreerdpHostPreferences::performance() const >+{ >+ return m_configGroup.readEntry("freeRDPPerformance", Settings::freeRDPPerformance()); >+} >+ >+void FreerdpHostPreferences::setShareMedia(const QString &shareMedia) >+{ >+ if (!shareMedia.isNull()) >+ m_configGroup.writeEntry("freeRDPShareMedia", shareMedia); >+} >+ >+QString FreerdpHostPreferences::shareMedia() const >+{ >+ return m_configGroup.readEntry("freeRDPShareMedia", Settings::freeRDPShareMedia()); >+} >+ >+#include "freerdphostpreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc/freerdppreferences.cpp kdenetwork-4.9.1/krdc/freerdppreferences.cpp >--- kdenetwork-4.9.1.org/krdc/freerdppreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdppreferences.cpp 2012-09-19 22:29:02.459196002 +0200 >@@ -0,0 +1,134 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdppreferences.h" >+#include "remoteviewfactory.h" >+#include "settings.h" >+ >+#include "ui_freerdppreferences.h" >+ >+#include <KDebug> >+ >+KRDC_PLUGIN_EXPORT(FreerdpPreferences) >+ >+FreerdpPreferences::FreerdpPreferences(QWidget *parent, const QVariantList &args) >+ : KCModule(KrdcFactory::componentData(), parent, args) >+{ >+ Ui::FreerdpPreferences freerdpUi; >+ freerdpUi.setupUi(this); >+ // would need a lot of code duplication. find a solution, bit it's not >+ // that important because you will not change this configuration each day... >+ // see freerdp/freerdphostpreferences.cpp >+ freerdpUi.resolutionComboBox->hide(); >+ freerdpUi.resolutionDummyLabel->hide(); >+ freerdpUi.kcfg_FreeRDPHeight->setEnabled(true); >+ freerdpUi.kcfg_FreeRDPWidth->setEnabled(true); >+ freerdpUi.heightLabel->setEnabled(true); >+ freerdpUi.widthLabel->setEnabled(true); >+ >+ addConfig(Settings::self(), this); >+} >+ >+FreerdpPreferences::~FreerdpPreferences() >+{ >+} >+ >+void FreerdpPreferences::load() >+{ >+ KCModule::load(); >+} >+ >+void FreerdpPreferences::save() >+{ >+ KCModule::save(); >+} >+ >+#include "freerdppreferences.moc" >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdppreferences.h" >+#include "remoteviewfactory.h" >+#include "settings.h" >+ >+#include "ui_freerdppreferences.h" >+ >+#include <KDebug> >+ >+KRDC_PLUGIN_EXPORT(FreerdpPreferences) >+ >+FreerdpPreferences::FreerdpPreferences(QWidget *parent, const QVariantList &args) >+ : KCModule(KrdcFactory::componentData(), parent, args) >+{ >+ Ui::FreerdpPreferences freerdpUi; >+ freerdpUi.setupUi(this); >+ // would need a lot of code duplication. find a solution, bit it's not >+ // that important because you will not change this configuration each day... >+ // see freerdp/freerdphostpreferences.cpp >+ freerdpUi.resolutionComboBox->hide(); >+ freerdpUi.resolutionDummyLabel->hide(); >+ freerdpUi.kcfg_FreeRDPHeight->setEnabled(true); >+ freerdpUi.kcfg_FreeRDPWidth->setEnabled(true); >+ freerdpUi.heightLabel->setEnabled(true); >+ freerdpUi.widthLabel->setEnabled(true); >+ >+ addConfig(Settings::self(), this); >+} >+ >+FreerdpPreferences::~FreerdpPreferences() >+{ >+} >+ >+void FreerdpPreferences::load() >+{ >+ KCModule::load(); >+} >+ >+void FreerdpPreferences::save() >+{ >+ KCModule::save(); >+} >+ >+#include "freerdppreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc/freerdppreferences.h kdenetwork-4.9.1/krdc/freerdppreferences.h >--- kdenetwork-4.9.1.org/krdc/freerdppreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdppreferences.h 2012-09-19 22:29:02.459196002 +0200 >@@ -0,0 +1,90 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPPREFERENCES_H >+#define FREERDPPREFERENCES_H >+ >+#include "freerdphostpreferences.h" >+ >+#include <KCModule> >+ >+class FreerdpPreferences : public KCModule >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpPreferences(QWidget *parent = 0, const QVariantList &args = QVariantList()); >+ ~FreerdpPreferences(); >+ >+ virtual void save(); >+ virtual void load(); >+ >+}; >+ >+#endif // FREERDPPREFERENCES_H >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPPREFERENCES_H >+#define FREERDPPREFERENCES_H >+ >+#include "freerdphostpreferences.h" >+ >+#include <KCModule> >+ >+class FreerdpPreferences : public KCModule >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpPreferences(QWidget *parent = 0, const QVariantList &args = QVariantList()); >+ ~FreerdpPreferences(); >+ >+ virtual void save(); >+ virtual void load(); >+ >+}; >+ >+#endif // FREERDPPREFERENCES_H >diff -urN kdenetwork-4.9.1.org/krdc/freerdppreferences.ui kdenetwork-4.9.1/krdc/freerdppreferences.ui >--- kdenetwork-4.9.1.org/krdc/freerdppreferences.ui 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdppreferences.ui 2012-09-19 22:29:02.458196002 +0200 >@@ -0,0 +1,1290 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<ui version="4.0"> >+ <class>FreerdpPreferences</class> >+ <widget class="QWidget" name="FreerdpPreferences"> >+ <property name="geometry"> >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>484</width> >+ <height>452</height> >+ </rect> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout_2"> >+ <item> >+ <widget class="QGroupBox" name="connectionGroupBox"> >+ <property name="title"> >+ <string>Connection</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout_2"> >+ <item row="0" column="0"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="QLabel" name="resolutionLabel"> >+ <property name="text"> >+ <string>Desktop &resolution:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>resolutionComboBox</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="resolutionDummyLabel"/> >+ </item> >+ </layout> >+ </item> >+ <item row="0" column="1"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="KComboBox" name="resolutionComboBox"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>1</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Minimal (640x480)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Small (800x600)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Normal (1024x768)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Large (1280x1024)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Very Large (1600x1200)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Current Screen Resolution</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Custom Resolution (...)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout"> >+ <item> >+ <widget class="QLabel" name="widthLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>&Width:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPWidth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_FreeRDPWidth"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the width of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>800</number> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="heightLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>H&eight:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPHeight</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_FreeRDPHeight"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the height of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>600</number> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </item> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="colorDepthLabel"> >+ <property name="text"> >+ <string>Color &depth:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPColorDepth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPColorDepth"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Low Color (8 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>High Color (16 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>True Color (24 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>True Color (32 Bit)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="2" column="0"> >+ <widget class="QLabel" name="layoutLabel"> >+ <property name="text"> >+ <string>&Keyboard layout:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPKeyboardLayout</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="2" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPKeyboardLayout"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Use this to specify your keyboard layout. This layout setting is used to send the correct keyboard codes to the server.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>7</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Arabic (ar)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Czech (cs)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Danish (da)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>German (de)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swiss German (de-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>American Dvorak (en-dv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>British English (en-gb)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>US English (en-us)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Spanish (es)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Estonian (et)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Finnish (fi)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Faroese (fo)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>French (fr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Belgian (fr-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>French Canadian (fr-ca)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swiss French (fr-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Hebrew (he)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Croatian (hr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Hungarian (hu)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Icelandic (is)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Italian (it)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Japanese (ja)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Korean (ko)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Lithuanian (lt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Latvian (lv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Macedonian (mk)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Dutch (nl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Belgian Dutch (nl-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Norwegian (no)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Polish (pl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Portuguese (pt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Brazilian (pt-br)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Russian (ru)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Slovenian (sl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swedish (sv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Thai (th)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Turkish (tr)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="3" column="0"> >+ <widget class="QLabel" name="soundLabel"> >+ <property name="text"> >+ <string comment="label for soundsettings in preferences dialog">Sound:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPSound</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="3" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPSound"> >+ <item> >+ <property name="text"> >+ <string>On This Computer</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>On Remote Computer</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Disable Sound</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="4" column="0"> >+ <widget class="QLabel" name="performanceLabel"> >+ <property name="text"> >+ <string comment="label for performance settings in preferences dialog">Performance:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPPerformance</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="4" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPPerformance"> >+ <item> >+ <property name="text"> >+ <string>Moden</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>BroadBand</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Lan</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="5" column="0"> >+ <widget class="QLabel" name="remoteFXLabel"> >+ <property name="text"> >+ <string>RemoteFX:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPRemoteFX</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="5" column="1"> >+ <widget class="QCheckBox" name="kcfg_FreeRDPRemoteFX"> >+ <property name="text"> >+ <string>Enable RemoteFX</string> >+ </property> >+ </widget> >+ </item> >+ <item row="6" column="0"> >+ <widget class="QLabel" name="ShareMediaLabel"> >+ <property name="text"> >+ <string>Share Media:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPShareMedia</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="6" column="1"> >+ <widget class="KLineEdit" name="kcfg_FreeRDPShareMedia"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Share a local media directory to the remote system</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="expertGroupBox"> >+ <property name="title"> >+ <string>Expert Options</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout"> >+ <item row="0" column="0"> >+ <widget class="QLabel" name="consoleLabel"> >+ <property name="text"> >+ <string>Console login:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPConsole</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="0" column="1"> >+ <widget class="QCheckBox" name="kcfg_FreeRDPConsole"> >+ <property name="text"> >+ <string>Attach to Windows Server console</string> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="extraOptionsLabel"> >+ <property name="text"> >+ <string>Extra options:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPExtraOptions</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KLineEdit" name="kcfg_FreeRDPExtraOptions"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can enter additional xfreerdp options.</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="loginGroupBox"> >+ <property name="title"> >+ <string>Login</string> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout"> >+ <item> >+ <layout class="QFormLayout" name="formLayout_3"> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="defaultUserLabel"> >+ <property name="text"> >+ <string>Default user name:</string> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KLineEdit" name="kcfg_DefaultFreerdpUserName"> >+ <property name="clickMessage"> >+ <string>No default user name</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_FreeRDPRecognizeLdapLogins"> >+ <property name="text"> >+ <string>Automatically recognize "LDAP"-Logins and share passwords</string> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <spacer> >+ <property name="orientation"> >+ <enum>Qt::Vertical</enum> >+ </property> >+ <property name="sizeHint" stdset="0"> >+ <size> >+ <width>428</width> >+ <height>16</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ </layout> >+ </widget> >+ <customwidgets> >+ <customwidget> >+ <class>KComboBox</class> >+ <extends>QComboBox</extends> >+ <header>kcombobox.h</header> >+ </customwidget> >+ <customwidget> >+ <class>KLineEdit</class> >+ <extends>QLineEdit</extends> >+ <header>klineedit.h</header> >+ </customwidget> >+ </customwidgets> >+ <tabstops> >+ <tabstop>resolutionComboBox</tabstop> >+ <tabstop>kcfg_FreeRDPWidth</tabstop> >+ <tabstop>kcfg_FreeRDPHeight</tabstop> >+ <tabstop>kcfg_FreeRDPColorDepth</tabstop> >+ <tabstop>kcfg_FreeRDPKeyboardLayout</tabstop> >+ <tabstop>kcfg_FreeRDPSound</tabstop> >+ <tabstop>kcfg_FreeRDPConsole</tabstop> >+ <tabstop>kcfg_FreeRDPExtraOptions</tabstop> >+ <tabstop>kcfg_DefaultFreerdpUserName</tabstop> >+ <tabstop>kcfg_FreeRDPRecognizeLdapLogins</tabstop> >+ </tabstops> >+ <resources/> >+ <connections/> >+</ui> >+<?xml version="1.0" encoding="UTF-8"?> >+<ui version="4.0"> >+ <class>FreerdpPreferences</class> >+ <widget class="QWidget" name="FreerdpPreferences"> >+ <property name="geometry"> >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>484</width> >+ <height>452</height> >+ </rect> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout_2"> >+ <item> >+ <widget class="QGroupBox" name="connectionGroupBox"> >+ <property name="title"> >+ <string>Connection</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout_2"> >+ <item row="0" column="0"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="QLabel" name="resolutionLabel"> >+ <property name="text"> >+ <string>Desktop &resolution:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>resolutionComboBox</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="resolutionDummyLabel"/> >+ </item> >+ </layout> >+ </item> >+ <item row="0" column="1"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="KComboBox" name="resolutionComboBox"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>1</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Minimal (640x480)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Small (800x600)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Normal (1024x768)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Large (1280x1024)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Very Large (1600x1200)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Current Screen Resolution</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Custom Resolution (...)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout"> >+ <item> >+ <widget class="QLabel" name="widthLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>&Width:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPWidth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_FreeRDPWidth"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the width of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>800</number> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="heightLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>H&eight:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPHeight</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_FreeRDPHeight"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the height of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>600</number> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </item> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="colorDepthLabel"> >+ <property name="text"> >+ <string>Color &depth:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPColorDepth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPColorDepth"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Low Color (8 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>High Color (16 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>True Color (24 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>True Color (32 Bit)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="2" column="0"> >+ <widget class="QLabel" name="layoutLabel"> >+ <property name="text"> >+ <string>&Keyboard layout:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPKeyboardLayout</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="2" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPKeyboardLayout"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Use this to specify your keyboard layout. This layout setting is used to send the correct keyboard codes to the server.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>7</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Arabic (ar)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Czech (cs)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Danish (da)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>German (de)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swiss German (de-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>American Dvorak (en-dv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>British English (en-gb)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>US English (en-us)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Spanish (es)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Estonian (et)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Finnish (fi)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Faroese (fo)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>French (fr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Belgian (fr-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>French Canadian (fr-ca)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swiss French (fr-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Hebrew (he)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Croatian (hr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Hungarian (hu)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Icelandic (is)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Italian (it)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Japanese (ja)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Korean (ko)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Lithuanian (lt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Latvian (lv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Macedonian (mk)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Dutch (nl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Belgian Dutch (nl-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Norwegian (no)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Polish (pl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Portuguese (pt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Brazilian (pt-br)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Russian (ru)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Slovenian (sl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swedish (sv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Thai (th)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Turkish (tr)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="3" column="0"> >+ <widget class="QLabel" name="soundLabel"> >+ <property name="text"> >+ <string comment="label for soundsettings in preferences dialog">Sound:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPSound</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="3" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPSound"> >+ <item> >+ <property name="text"> >+ <string>On This Computer</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>On Remote Computer</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Disable Sound</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="4" column="0"> >+ <widget class="QLabel" name="performanceLabel"> >+ <property name="text"> >+ <string comment="label for performance settings in preferences dialog">Performance:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPPerformance</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="4" column="1"> >+ <widget class="KComboBox" name="kcfg_FreeRDPPerformance"> >+ <item> >+ <property name="text"> >+ <string>Moden</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>BroadBand</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Lan</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="5" column="0"> >+ <widget class="QLabel" name="remoteFXLabel"> >+ <property name="text"> >+ <string>RemoteFX:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPRemoteFX</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="5" column="1"> >+ <widget class="QCheckBox" name="kcfg_FreeRDPRemoteFX"> >+ <property name="text"> >+ <string>Enable RemoteFX</string> >+ </property> >+ </widget> >+ </item> >+ <item row="6" column="0"> >+ <widget class="QLabel" name="ShareMediaLabel"> >+ <property name="text"> >+ <string>Share Media:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPShareMedia</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="6" column="1"> >+ <widget class="KLineEdit" name="kcfg_FreeRDPShareMedia"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Share a local media directory to the remote system</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="expertGroupBox"> >+ <property name="title"> >+ <string>Expert Options</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout"> >+ <item row="0" column="0"> >+ <widget class="QLabel" name="consoleLabel"> >+ <property name="text"> >+ <string>Console login:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPConsole</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="0" column="1"> >+ <widget class="QCheckBox" name="kcfg_FreeRDPConsole"> >+ <property name="text"> >+ <string>Attach to Windows Server console</string> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="extraOptionsLabel"> >+ <property name="text"> >+ <string>Extra options:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_FreeRDPExtraOptions</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KLineEdit" name="kcfg_FreeRDPExtraOptions"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can enter additional xfreerdp options.</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="loginGroupBox"> >+ <property name="title"> >+ <string>Login</string> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout"> >+ <item> >+ <layout class="QFormLayout" name="formLayout_3"> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="defaultUserLabel"> >+ <property name="text"> >+ <string>Default user name:</string> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KLineEdit" name="kcfg_DefaultFreerdpUserName"> >+ <property name="clickMessage"> >+ <string>No default user name</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_FreeRDPRecognizeLdapLogins"> >+ <property name="text"> >+ <string>Automatically recognize "LDAP"-Logins and share passwords</string> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <spacer> >+ <property name="orientation"> >+ <enum>Qt::Vertical</enum> >+ </property> >+ <property name="sizeHint" stdset="0"> >+ <size> >+ <width>428</width> >+ <height>16</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ </layout> >+ </widget> >+ <customwidgets> >+ <customwidget> >+ <class>KComboBox</class> >+ <extends>QComboBox</extends> >+ <header>kcombobox.h</header> >+ </customwidget> >+ <customwidget> >+ <class>KLineEdit</class> >+ <extends>QLineEdit</extends> >+ <header>klineedit.h</header> >+ </customwidget> >+ </customwidgets> >+ <tabstops> >+ <tabstop>resolutionComboBox</tabstop> >+ <tabstop>kcfg_FreeRDPWidth</tabstop> >+ <tabstop>kcfg_FreeRDPHeight</tabstop> >+ <tabstop>kcfg_FreeRDPColorDepth</tabstop> >+ <tabstop>kcfg_FreeRDPKeyboardLayout</tabstop> >+ <tabstop>kcfg_FreeRDPSound</tabstop> >+ <tabstop>kcfg_FreeRDPConsole</tabstop> >+ <tabstop>kcfg_FreeRDPExtraOptions</tabstop> >+ <tabstop>kcfg_DefaultFreerdpUserName</tabstop> >+ <tabstop>kcfg_FreeRDPRecognizeLdapLogins</tabstop> >+ </tabstops> >+ <resources/> >+ <connections/> >+</ui> >diff -urN kdenetwork-4.9.1.org/krdc/freerdpview.cpp kdenetwork-4.9.1/krdc/freerdpview.cpp >--- kdenetwork-4.9.1.org/krdc/freerdpview.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdpview.cpp 2012-09-19 22:29:02.458196002 +0200 >@@ -0,0 +1,654 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2002 Arend van Beelen jr. <arend@auton.nl> >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdpview.h" >+ >+#include "settings.h" >+ >+#include <KInputDialog> >+#include <KMessageBox> >+#include <KPasswordDialog> >+#include <KShell> >+ >+#include <QX11EmbedContainer> >+#include <QEvent> >+ >+FreerdpView::FreerdpView(QWidget *parent, >+ const KUrl &url, >+ KConfigGroup configGroup, >+ const QString &user, const QString &password, >+ int flags, const QString &domain, >+ const QString &shell, const QString &directory) >+ : RemoteView(parent), >+ m_user(user), >+ m_password(password), >+ m_flags(flags), >+ m_domain(domain), >+ m_shell(shell), >+ m_directory(directory), >+ m_quitFlag(false), >+ m_process(NULL) >+{ >+ m_url = url; >+ m_host = url.host(); >+ m_port = url.port(); >+ >+ if (m_port <= 0) { >+ m_port = TCP_PORT_FREERDP; >+ } >+ >+ m_container = new QX11EmbedContainer(this); >+ m_container->installEventFilter(this); >+ >+ m_hostPreferences = new FreerdpHostPreferences(configGroup, this); >+} >+ >+FreerdpView::~FreerdpView() >+{ >+ startQuitting(); >+} >+ >+// filter out key and mouse events to the container if we are view only >+//FIXME: X11 events are passed to the app before getting caught in the Qt event processing >+bool FreerdpView::eventFilter(QObject *obj, QEvent *event) >+{ >+ if (m_viewOnly) { >+ if (event->type() == QEvent::KeyPress || >+ event->type() == QEvent::KeyRelease || >+ event->type() == QEvent::MouseButtonDblClick || >+ event->type() == QEvent::MouseButtonPress || >+ event->type() == QEvent::MouseButtonRelease || >+ event->type() == QEvent::MouseMove) >+ return true; >+ } >+ return RemoteView::eventFilter(obj, event); >+} >+ >+QSize FreerdpView::framebufferSize() >+{ >+ return m_container->minimumSizeHint(); >+} >+ >+QSize FreerdpView::sizeHint() const >+{ >+ return maximumSize(); >+} >+ >+void FreerdpView::startQuitting() >+{ >+ kDebug(5012) << "About to quit"; >+ m_quitFlag = true; >+ if (m_process) { >+ m_process->terminate(); >+ m_process->waitForFinished(1000); >+ m_container->discardClient(); >+ } >+} >+ >+bool FreerdpView::isQuitting() >+{ >+ return m_quitFlag; >+} >+ >+bool FreerdpView::start() >+{ >+kDebug(5010); >+ m_container->show(); >+ >+ if (m_hostPreferences->walletSupport()) { >+ if (m_url.userName().isEmpty()) { >+ QString userName; >+ bool ok = false; >+ >+ userName = KInputDialog::getText(i18n("Enter Username"), >+ i18n("Please enter the username you would like to use for login."), >+ Settings::defaultFreerdpUserName(), &ok, this); >+ >+ if (ok) >+ m_url.setUserName(userName); >+ } >+ >+kDebug(5010); >+ if (!m_url.userName().isEmpty()) { >+ const bool useLdapLogin = Settings::recognizeLdapLogins() && m_url.userName().contains('\\'); >+ kDebug(5012) << "Is LDAP login:" << useLdapLogin << m_url.userName(); >+ QString walletPassword = readWalletPassword(useLdapLogin); >+ >+ if (!walletPassword.isNull()) >+ m_url.setPassword(walletPassword); >+ else { >+ KPasswordDialog dialog(this); >+ dialog.setPrompt(i18n("Access to the system requires a password.")); >+ if (dialog.exec() == KPasswordDialog::Accepted) { >+ m_url.setPassword(dialog.password()); >+ >+ if (m_hostPreferences->walletSupport()) >+ saveWalletPassword(dialog.password(), useLdapLogin); >+ } >+ } >+ } >+ } >+ >+kDebug(5010); >+ m_process = new QProcess(m_container); >+ >+ QStringList arguments; >+ arguments << "-g" << (QString::number(m_hostPreferences->width()) + 'x' + >+ QString::number(m_hostPreferences->height())); >+ arguments << "-k" << m_hostPreferences->keyboardLayout(); >+ >+kDebug(5010); >+ if (!m_url.userName().isEmpty()) >+ arguments << "-u" << m_url.userName(); >+ else >+ arguments << "-u" << ""; >+ >+ if (!m_url.password().isNull()) >+ arguments << "-p" << m_url.password(); >+ >+ arguments << "-D"; // request the window has no decorations >+ arguments << "-X" << QString::number(m_container->winId()); >+ arguments << "-a" << QString::number((m_hostPreferences->colorDepth() + 1) * 8); >+ >+kDebug(5010); >+ switch (m_hostPreferences->sound()) { >+ case 1: >+ arguments << "-o"; >+ break; >+ case 0: >+ arguments << "--plugin" << "rdpsnd"; >+ break; >+ case 2: >+ default: >+ break; >+ } >+ >+ if (!m_hostPreferences->shareMedia().isEmpty()) { >+ QStringList shareMedia; >+ shareMedia << "--plugin" << "rdpdr" << "--data" << "disk:media:"+ m_hostPreferences->shareMedia() << "--"; >+ arguments += shareMedia; >+ } >+ >+ QString performance; >+ switch (m_hostPreferences->performance()) { >+ case 0: >+ performance = "m"; >+ break; >+ case 1: >+ performance = "b"; >+ break; >+ case 2: >+ performance = "l"; >+ break; >+ default: >+ break; >+ } >+ arguments << "-x" << performance; >+ >+ if (m_hostPreferences->console()) { >+ arguments << "-0"; >+ } >+ >+ if (m_hostPreferences->remoteFX()) { >+ arguments << "--rfx"; >+ } >+ >+ if (!m_hostPreferences->extraOptions().isEmpty()) { >+ const QStringList additionalArguments = KShell::splitArgs(m_hostPreferences->extraOptions()); >+ arguments += additionalArguments; >+ } >+ >+ arguments << "--ignore-certificate"; >+ >+ arguments << (m_host + ':' + QString::number(m_port)); >+ >+ setStatus(Connecting); >+ >+ connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError))); >+ connect(m_process, SIGNAL(readyReadStandardError()), SLOT(receivedStandardError())); >+ connect(m_container, SIGNAL(clientClosed()), SLOT(connectionClosed())); >+ connect(m_container, SIGNAL(clientIsEmbedded()), SLOT(connectionOpened())); >+ >+kDebug(5010) << "xfreerdp " << arguments << endl; >+ m_process->start("xfreerdp", arguments); >+ >+ return true; >+} >+ >+HostPreferences* FreerdpView::hostPreferences() >+{ >+ return m_hostPreferences; >+} >+ >+void FreerdpView::switchFullscreen(bool on) >+{ >+ if (on == true) { >+ m_container->grabKeyboard(); >+ } >+} >+ >+void FreerdpView::connectionOpened() >+{ >+ kDebug(5012) << "Connection opened"; >+ const QSize size = m_container->minimumSizeHint(); >+ kDebug(5012) << "Size hint: " << size.width() << " " << size.height(); >+ setStatus(Connected); >+ setFixedSize(size); >+ resize(size); >+ m_container->setFixedSize(size); >+ emit framebufferSizeChanged(size.width(), size.height()); >+ emit connected(); >+ setFocus(); >+} >+ >+QPixmap FreerdpView::takeScreenshot() >+{ >+ return QPixmap::grabWindow(m_container->clientWinId()); >+} >+ >+void FreerdpView::connectionClosed() >+{ >+ emit disconnected(); >+ setStatus(Disconnected); >+ m_quitFlag = true; >+} >+ >+void FreerdpView::processError(QProcess::ProcessError error) >+{ >+ if (m_quitFlag) // do not try to show error messages while quitting (prevent crashes) >+ return; >+ >+ if (m_status == Connecting) { >+ setStatus(Disconnected); >+ >+ if (error == QProcess::FailedToStart) { >+ KMessageBox::error(0, i18n("Could not start \"xfreerdp\"; make sure xfreerdp is properly installed."), >+ i18n("FREERDP Failure")); >+ return; >+ } >+ >+ if (m_clientVersion.isEmpty()) { >+ KMessageBox::error(0, i18n("Connection attempt to host failed."), >+ i18n("Connection Failure")); >+ } else { >+ KMessageBox::error(0, i18n("The version of \"xfreerdp\" you are using (%1) is too old:\n" >+ "xfreerdp 1.0.1 or greater is required.", m_clientVersion), >+ i18n("FREERDP Failure")); >+ } >+ emit disconnectedError(); >+ } >+} >+ >+void FreerdpView::receivedStandardError() >+{ >+ const QString output(m_process->readAllStandardError()); >+ QString line; >+ int i = 0; >+ while (!(line = output.section('\n', i, i)).isEmpty()) { >+ if (line.startsWith(QLatin1String("Version "))) { >+ m_clientVersion = line.section(' ', 1, 1); >+ m_clientVersion = m_clientVersion.left(m_clientVersion.length() - 1); >+ return; >+ } else { >+ kDebug(5012) << "Process error output: " << line; >+ } >+ i++; >+ } >+} >+ >+void FreerdpView::setGrabAllKeys(bool grabAllKeys) >+{ >+ Q_UNUSED(grabAllKeys); >+ // do nothing.. grabKeyboard seems not to be supported in QX11EmbedContainer >+} >+ >+#include "freerdpview.moc" >+/**************************************************************************** >+** >+** Copyright (C) 2002 Arend van Beelen jr. <arend@auton.nl> >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdpview.h" >+ >+#include "settings.h" >+ >+#include <KInputDialog> >+#include <KMessageBox> >+#include <KPasswordDialog> >+#include <KShell> >+ >+#include <QX11EmbedContainer> >+#include <QEvent> >+ >+FreerdpView::FreerdpView(QWidget *parent, >+ const KUrl &url, >+ KConfigGroup configGroup, >+ const QString &user, const QString &password, >+ int flags, const QString &domain, >+ const QString &shell, const QString &directory) >+ : RemoteView(parent), >+ m_user(user), >+ m_password(password), >+ m_flags(flags), >+ m_domain(domain), >+ m_shell(shell), >+ m_directory(directory), >+ m_quitFlag(false), >+ m_process(NULL) >+{ >+ m_url = url; >+ m_host = url.host(); >+ m_port = url.port(); >+ >+ if (m_port <= 0) { >+ m_port = TCP_PORT_FREERDP; >+ } >+ >+ m_container = new QX11EmbedContainer(this); >+ m_container->installEventFilter(this); >+ >+ m_hostPreferences = new FreerdpHostPreferences(configGroup, this); >+} >+ >+FreerdpView::~FreerdpView() >+{ >+ startQuitting(); >+} >+ >+// filter out key and mouse events to the container if we are view only >+//FIXME: X11 events are passed to the app before getting caught in the Qt event processing >+bool FreerdpView::eventFilter(QObject *obj, QEvent *event) >+{ >+ if (m_viewOnly) { >+ if (event->type() == QEvent::KeyPress || >+ event->type() == QEvent::KeyRelease || >+ event->type() == QEvent::MouseButtonDblClick || >+ event->type() == QEvent::MouseButtonPress || >+ event->type() == QEvent::MouseButtonRelease || >+ event->type() == QEvent::MouseMove) >+ return true; >+ } >+ return RemoteView::eventFilter(obj, event); >+} >+ >+QSize FreerdpView::framebufferSize() >+{ >+ return m_container->minimumSizeHint(); >+} >+ >+QSize FreerdpView::sizeHint() const >+{ >+ return maximumSize(); >+} >+ >+void FreerdpView::startQuitting() >+{ >+ kDebug(5012) << "About to quit"; >+ m_quitFlag = true; >+ if (m_process) { >+ m_process->terminate(); >+ m_process->waitForFinished(1000); >+ m_container->discardClient(); >+ } >+} >+ >+bool FreerdpView::isQuitting() >+{ >+ return m_quitFlag; >+} >+ >+bool FreerdpView::start() >+{ >+kDebug(5010); >+ m_container->show(); >+ >+ if (m_hostPreferences->walletSupport()) { >+ if (m_url.userName().isEmpty()) { >+ QString userName; >+ bool ok = false; >+ >+ userName = KInputDialog::getText(i18n("Enter Username"), >+ i18n("Please enter the username you would like to use for login."), >+ Settings::defaultFreerdpUserName(), &ok, this); >+ >+ if (ok) >+ m_url.setUserName(userName); >+ } >+ >+kDebug(5010); >+ if (!m_url.userName().isEmpty()) { >+ const bool useLdapLogin = Settings::recognizeLdapLogins() && m_url.userName().contains('\\'); >+ kDebug(5012) << "Is LDAP login:" << useLdapLogin << m_url.userName(); >+ QString walletPassword = readWalletPassword(useLdapLogin); >+ >+ if (!walletPassword.isNull()) >+ m_url.setPassword(walletPassword); >+ else { >+ KPasswordDialog dialog(this); >+ dialog.setPrompt(i18n("Access to the system requires a password.")); >+ if (dialog.exec() == KPasswordDialog::Accepted) { >+ m_url.setPassword(dialog.password()); >+ >+ if (m_hostPreferences->walletSupport()) >+ saveWalletPassword(dialog.password(), useLdapLogin); >+ } >+ } >+ } >+ } >+ >+kDebug(5010); >+ m_process = new QProcess(m_container); >+ >+ QStringList arguments; >+ arguments << "-g" << (QString::number(m_hostPreferences->width()) + 'x' + >+ QString::number(m_hostPreferences->height())); >+ arguments << "-k" << m_hostPreferences->keyboardLayout(); >+ >+kDebug(5010); >+ if (!m_url.userName().isEmpty()) >+ arguments << "-u" << m_url.userName(); >+ else >+ arguments << "-u" << ""; >+ >+ if (!m_url.password().isNull()) >+ arguments << "-p" << m_url.password(); >+ >+ arguments << "-D"; // request the window has no decorations >+ arguments << "-X" << QString::number(m_container->winId()); >+ arguments << "-a" << QString::number((m_hostPreferences->colorDepth() + 1) * 8); >+ >+kDebug(5010); >+ switch (m_hostPreferences->sound()) { >+ case 1: >+ arguments << "-o"; >+ break; >+ case 0: >+ arguments << "--plugin" << "rdpsnd"; >+ break; >+ case 2: >+ default: >+ break; >+ } >+ >+ if (!m_hostPreferences->shareMedia().isEmpty()) { >+ QStringList shareMedia; >+ shareMedia << "--plugin" << "rdpdr" << "--data" << "disk:media:"+ m_hostPreferences->shareMedia() << "--"; >+ arguments += shareMedia; >+ } >+ >+ QString performance; >+ switch (m_hostPreferences->performance()) { >+ case 0: >+ performance = "m"; >+ break; >+ case 1: >+ performance = "b"; >+ break; >+ case 2: >+ performance = "l"; >+ break; >+ default: >+ break; >+ } >+ arguments << "-x" << performance; >+ >+ if (m_hostPreferences->console()) { >+ arguments << "-0"; >+ } >+ >+ if (m_hostPreferences->remoteFX()) { >+ arguments << "--rfx"; >+ } >+ >+ if (!m_hostPreferences->extraOptions().isEmpty()) { >+ const QStringList additionalArguments = KShell::splitArgs(m_hostPreferences->extraOptions()); >+ arguments += additionalArguments; >+ } >+ >+ arguments << "--ignore-certificate"; >+ >+ arguments << (m_host + ':' + QString::number(m_port)); >+ >+ setStatus(Connecting); >+ >+ connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError))); >+ connect(m_process, SIGNAL(readyReadStandardError()), SLOT(receivedStandardError())); >+ connect(m_container, SIGNAL(clientClosed()), SLOT(connectionClosed())); >+ connect(m_container, SIGNAL(clientIsEmbedded()), SLOT(connectionOpened())); >+ >+kDebug(5010) << "xfreerdp " << arguments << endl; >+ m_process->start("xfreerdp", arguments); >+ >+ return true; >+} >+ >+HostPreferences* FreerdpView::hostPreferences() >+{ >+ return m_hostPreferences; >+} >+ >+void FreerdpView::switchFullscreen(bool on) >+{ >+ if (on == true) { >+ m_container->grabKeyboard(); >+ } >+} >+ >+void FreerdpView::connectionOpened() >+{ >+ kDebug(5012) << "Connection opened"; >+ const QSize size = m_container->minimumSizeHint(); >+ kDebug(5012) << "Size hint: " << size.width() << " " << size.height(); >+ setStatus(Connected); >+ setFixedSize(size); >+ resize(size); >+ m_container->setFixedSize(size); >+ emit framebufferSizeChanged(size.width(), size.height()); >+ emit connected(); >+ setFocus(); >+} >+ >+QPixmap FreerdpView::takeScreenshot() >+{ >+ return QPixmap::grabWindow(m_container->clientWinId()); >+} >+ >+void FreerdpView::connectionClosed() >+{ >+ emit disconnected(); >+ setStatus(Disconnected); >+ m_quitFlag = true; >+} >+ >+void FreerdpView::processError(QProcess::ProcessError error) >+{ >+ if (m_quitFlag) // do not try to show error messages while quitting (prevent crashes) >+ return; >+ >+ if (m_status == Connecting) { >+ setStatus(Disconnected); >+ >+ if (error == QProcess::FailedToStart) { >+ KMessageBox::error(0, i18n("Could not start \"xfreerdp\"; make sure xfreerdp is properly installed."), >+ i18n("FREERDP Failure")); >+ return; >+ } >+ >+ if (m_clientVersion.isEmpty()) { >+ KMessageBox::error(0, i18n("Connection attempt to host failed."), >+ i18n("Connection Failure")); >+ } else { >+ KMessageBox::error(0, i18n("The version of \"xfreerdp\" you are using (%1) is too old:\n" >+ "xfreerdp 1.0.1 or greater is required.", m_clientVersion), >+ i18n("FREERDP Failure")); >+ } >+ emit disconnectedError(); >+ } >+} >+ >+void FreerdpView::receivedStandardError() >+{ >+ const QString output(m_process->readAllStandardError()); >+ QString line; >+ int i = 0; >+ while (!(line = output.section('\n', i, i)).isEmpty()) { >+ if (line.startsWith(QLatin1String("Version "))) { >+ m_clientVersion = line.section(' ', 1, 1); >+ m_clientVersion = m_clientVersion.left(m_clientVersion.length() - 1); >+ return; >+ } else { >+ kDebug(5012) << "Process error output: " << line; >+ } >+ i++; >+ } >+} >+ >+void FreerdpView::setGrabAllKeys(bool grabAllKeys) >+{ >+ Q_UNUSED(grabAllKeys); >+ // do nothing.. grabKeyboard seems not to be supported in QX11EmbedContainer >+} >+ >+#include "freerdpview.moc" >diff -urN kdenetwork-4.9.1.org/krdc/freerdpviewfactory.cpp kdenetwork-4.9.1/krdc/freerdpviewfactory.cpp >--- kdenetwork-4.9.1.org/krdc/freerdpviewfactory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdpviewfactory.cpp 2012-09-19 22:29:02.457196002 +0200 >@@ -0,0 +1,188 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdpviewfactory.h" >+ >+#include <KDebug> >+#include <KStandardDirs> >+ >+KRDC_PLUGIN_EXPORT(FreerdpViewFactory) >+ >+FreerdpViewFactory::FreerdpViewFactory(QObject *parent, const QVariantList &args) >+ : RemoteViewFactory(parent) >+{ >+ Q_UNUSED(args); >+ >+ KGlobal::locale()->insertCatalog("krdc"); >+ >+ m_connectToolTipString = i18n("Connect to a Windows Remote Desktop (RDP)"); >+ >+ QMetaObject::invokeMethod(this, "checkRdektopAvailability", Qt::DirectConnection); >+} >+ >+FreerdpViewFactory::~FreerdpViewFactory() >+{ >+} >+ >+bool FreerdpViewFactory::supportsUrl(const KUrl &url) const >+{ >+ return (url.scheme().compare("freerdp", Qt::CaseInsensitive) == 0); >+} >+ >+RemoteView *FreerdpViewFactory::createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+{ >+kDebug(); >+ return new FreerdpView(parent, url, configGroup); >+} >+ >+HostPreferences *FreerdpViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) >+{ >+kDebug(); >+ return new FreerdpHostPreferences(configGroup, parent); >+} >+ >+QString FreerdpViewFactory::scheme() const >+{ >+ return "freerdp"; >+} >+ >+QString FreerdpViewFactory::connectActionText() const >+{ >+ return i18n("New FreeRDP Connection..."); >+} >+ >+QString FreerdpViewFactory::connectButtonText() const >+{ >+ return m_connectToolTipString; >+} >+ >+QString FreerdpViewFactory::connectToolTipText() const >+{ >+ return i18n("<html>Enter the address here. Port is optional.<br />" >+ "<i>Example: freerdpserver:3389 (host:port)</i></html>"); >+} >+ >+void FreerdpViewFactory::checkRdektopAvailability() >+{ >+ if (KStandardDirs::findExe("xfreerdp").isEmpty()) { >+ m_connectToolTipString += '\n' + i18n("The application \"xfreerdp\" cannot be found on your system; make sure it is properly installed " >+ "if you need RDP support."); >+ } >+} >+ >+#include "moc_freerdpviewfactory.cpp" >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 "freerdpviewfactory.h" >+ >+#include <KDebug> >+#include <KStandardDirs> >+ >+KRDC_PLUGIN_EXPORT(FreerdpViewFactory) >+ >+FreerdpViewFactory::FreerdpViewFactory(QObject *parent, const QVariantList &args) >+ : RemoteViewFactory(parent) >+{ >+ Q_UNUSED(args); >+ >+ KGlobal::locale()->insertCatalog("krdc"); >+ >+ m_connectToolTipString = i18n("Connect to a Windows Remote Desktop (RDP)"); >+ >+ QMetaObject::invokeMethod(this, "checkRdektopAvailability", Qt::DirectConnection); >+} >+ >+FreerdpViewFactory::~FreerdpViewFactory() >+{ >+} >+ >+bool FreerdpViewFactory::supportsUrl(const KUrl &url) const >+{ >+ return (url.scheme().compare("freerdp", Qt::CaseInsensitive) == 0); >+} >+ >+RemoteView *FreerdpViewFactory::createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+{ >+kDebug(); >+ return new FreerdpView(parent, url, configGroup); >+} >+ >+HostPreferences *FreerdpViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) >+{ >+kDebug(); >+ return new FreerdpHostPreferences(configGroup, parent); >+} >+ >+QString FreerdpViewFactory::scheme() const >+{ >+ return "freerdp"; >+} >+ >+QString FreerdpViewFactory::connectActionText() const >+{ >+ return i18n("New FreeRDP Connection..."); >+} >+ >+QString FreerdpViewFactory::connectButtonText() const >+{ >+ return m_connectToolTipString; >+} >+ >+QString FreerdpViewFactory::connectToolTipText() const >+{ >+ return i18n("<html>Enter the address here. Port is optional.<br />" >+ "<i>Example: freerdpserver:3389 (host:port)</i></html>"); >+} >+ >+void FreerdpViewFactory::checkRdektopAvailability() >+{ >+ if (KStandardDirs::findExe("xfreerdp").isEmpty()) { >+ m_connectToolTipString += '\n' + i18n("The application \"xfreerdp\" cannot be found on your system; make sure it is properly installed " >+ "if you need RDP support."); >+ } >+} >+ >+#include "moc_freerdpviewfactory.cpp" >diff -urN kdenetwork-4.9.1.org/krdc/freerdpviewfactory.h kdenetwork-4.9.1/krdc/freerdpviewfactory.h >--- kdenetwork-4.9.1.org/krdc/freerdpviewfactory.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdpviewfactory.h 2012-09-19 22:29:02.457196002 +0200 >@@ -0,0 +1,126 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPVIEWFACTORY_H >+#define FREERDPVIEWFACTORY_H >+ >+#include "remoteviewfactory.h" >+ >+#include "freerdpview.h" >+#include "freerdppreferences.h" >+ >+class FreerdpViewFactory : public RemoteViewFactory >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpViewFactory(QObject *parent, const QVariantList &args); >+ >+ virtual ~FreerdpViewFactory(); >+ >+ virtual bool supportsUrl(const KUrl &url) const; >+ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup); >+ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent); >+ >+ virtual QString scheme() const; >+ >+ virtual QString connectActionText() const; >+ >+ virtual QString connectButtonText() const; >+ >+ virtual QString connectToolTipText() const; >+ >+private Q_SLOTS: >+ void checkRdektopAvailability(); >+ >+private: >+ QString m_connectToolTipString; >+}; >+ >+#endif // FREERDPVIEWFACTORY_H >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPVIEWFACTORY_H >+#define FREERDPVIEWFACTORY_H >+ >+#include "remoteviewfactory.h" >+ >+#include "freerdpview.h" >+#include "freerdppreferences.h" >+ >+class FreerdpViewFactory : public RemoteViewFactory >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpViewFactory(QObject *parent, const QVariantList &args); >+ >+ virtual ~FreerdpViewFactory(); >+ >+ virtual bool supportsUrl(const KUrl &url) const; >+ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup); >+ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent); >+ >+ virtual QString scheme() const; >+ >+ virtual QString connectActionText() const; >+ >+ virtual QString connectButtonText() const; >+ >+ virtual QString connectToolTipText() const; >+ >+private Q_SLOTS: >+ void checkRdektopAvailability(); >+ >+private: >+ QString m_connectToolTipString; >+}; >+ >+#endif // FREERDPVIEWFACTORY_H >diff -urN kdenetwork-4.9.1.org/krdc/freerdpview.h kdenetwork-4.9.1/krdc/freerdpview.h >--- kdenetwork-4.9.1.org/krdc/freerdpview.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/freerdpview.h 2012-09-19 22:29:02.457196002 +0200 >@@ -0,0 +1,202 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2002 Arend van Beelen jr. <arend@auton.nl> >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPVIEW_H >+#define FREERDPVIEW_H >+ >+#include "remoteview.h" >+ >+#include "freerdphostpreferences.h" >+ >+#include <QProcess> >+ >+#define TCP_PORT_FREERDP 3389 >+#define FREERDP_LOGON_NORMAL 0x33 >+ >+class FreerdpView; >+ >+class QX11EmbedContainer; >+ >+class FreerdpView : public RemoteView >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpView(QWidget *parent = 0, >+ const KUrl &url = KUrl(), >+ KConfigGroup configGroup = KConfigGroup(), >+ const QString &user = QString(), const QString &password = QString(), >+ int flags = FREERDP_LOGON_NORMAL, const QString &domain = QString(), >+ const QString &shell = QString(), const QString &directory = QString()); >+ >+ virtual ~FreerdpView(); >+ >+ // functions regarding the window >+ virtual QSize framebufferSize(); // returns the size of the remote view >+ QSize sizeHint() const; // returns the suggested size >+ >+ // functions regarding the connection >+ virtual void startQuitting(); // start closing the connection >+ virtual bool isQuitting(); // are we currently closing the connection? >+ virtual bool start(); // open a connection >+ void setGrabAllKeys(bool grabAllKeys); >+ >+ HostPreferences* hostPreferences(); >+ >+ virtual QPixmap takeScreenshot(); >+ >+public slots: >+ virtual void switchFullscreen(bool on); >+ >+protected: >+ bool eventFilter(QObject *obj, QEvent *event); >+ >+private: >+ // properties used for setting up the connection >+ QString m_name; // name of the connection >+ QString m_user; // the user to use to log in >+ QString m_password; // the password to use >+ int m_flags; // flags which determine how the connection is set up >+ QString m_domain; // the domain where the host is on >+ QString m_shell; // the shell to use >+ QString m_directory; // the working directory on the server >+ >+ // other properties >+ bool m_quitFlag; // if set: die >+ QString m_clientVersion; // version number returned by xfreerdp >+ QX11EmbedContainer *m_container; // container for the xfreerdp window >+ QProcess *m_process; // xfreerdp process >+ >+ FreerdpHostPreferences *m_hostPreferences; >+ >+private slots: >+ void connectionOpened(); // called if xfreerdp started >+ void connectionClosed(); // called if xfreerdp quits >+ void processError(QProcess::ProcessError error); // called if xfreerdp dies >+ void receivedStandardError(); // catches xfreerdp debug output >+}; >+ >+#endif >+/**************************************************************************** >+** >+** Copyright (C) 2002 Arend van Beelen jr. <arend@auton.nl> >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2012 AceLan Kao <acelan @ acelan.idv.tw> >+** >+** 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 FREERDPVIEW_H >+#define FREERDPVIEW_H >+ >+#include "remoteview.h" >+ >+#include "freerdphostpreferences.h" >+ >+#include <QProcess> >+ >+#define TCP_PORT_FREERDP 3389 >+#define FREERDP_LOGON_NORMAL 0x33 >+ >+class FreerdpView; >+ >+class QX11EmbedContainer; >+ >+class FreerdpView : public RemoteView >+{ >+ Q_OBJECT >+ >+public: >+ explicit FreerdpView(QWidget *parent = 0, >+ const KUrl &url = KUrl(), >+ KConfigGroup configGroup = KConfigGroup(), >+ const QString &user = QString(), const QString &password = QString(), >+ int flags = FREERDP_LOGON_NORMAL, const QString &domain = QString(), >+ const QString &shell = QString(), const QString &directory = QString()); >+ >+ virtual ~FreerdpView(); >+ >+ // functions regarding the window >+ virtual QSize framebufferSize(); // returns the size of the remote view >+ QSize sizeHint() const; // returns the suggested size >+ >+ // functions regarding the connection >+ virtual void startQuitting(); // start closing the connection >+ virtual bool isQuitting(); // are we currently closing the connection? >+ virtual bool start(); // open a connection >+ void setGrabAllKeys(bool grabAllKeys); >+ >+ HostPreferences* hostPreferences(); >+ >+ virtual QPixmap takeScreenshot(); >+ >+public slots: >+ virtual void switchFullscreen(bool on); >+ >+protected: >+ bool eventFilter(QObject *obj, QEvent *event); >+ >+private: >+ // properties used for setting up the connection >+ QString m_name; // name of the connection >+ QString m_user; // the user to use to log in >+ QString m_password; // the password to use >+ int m_flags; // flags which determine how the connection is set up >+ QString m_domain; // the domain where the host is on >+ QString m_shell; // the shell to use >+ QString m_directory; // the working directory on the server >+ >+ // other properties >+ bool m_quitFlag; // if set: die >+ QString m_clientVersion; // version number returned by xfreerdp >+ QX11EmbedContainer *m_container; // container for the xfreerdp window >+ QProcess *m_process; // xfreerdp process >+ >+ FreerdpHostPreferences *m_hostPreferences; >+ >+private slots: >+ void connectionOpened(); // called if xfreerdp started >+ void connectionClosed(); // called if xfreerdp quits >+ void processError(QProcess::ProcessError error); // called if xfreerdp dies >+ void receivedStandardError(); // catches xfreerdp debug output >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc/krdc_freerdp_config.desktop kdenetwork-4.9.1/krdc/krdc_freerdp_config.desktop >--- kdenetwork-4.9.1.org/krdc/krdc_freerdp_config.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/krdc_freerdp_config.desktop 2012-09-19 22:29:02.457196002 +0200 >@@ -0,0 +1,120 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KCModule >+Name=FREERDP >+Name[ast]=FREERDP >+Name[bg]=FREERDP >+Name[bs]=FREERDP >+Name[ca]=FREERDP >+Name[ca@valencia]=FREERDP >+Name[cs]=FREERDP >+Name[da]=FREERDP >+Name[de]=FREERDP >+Name[el]=FREERDP >+Name[en_GB]=FREERDP >+Name[eo]=FREERDP >+Name[es]=FREERDP >+Name[et]=FREERDP >+Name[eu]=FREERDP >+Name[fi]=FREERDP >+Name[fr]=FREERDP >+Name[ga]=FREERDP >+Name[gl]=FREERDP >+Name[hr]=FREERDP >+Name[hu]=FREERDP >+Name[ia]=FREERDP >+Name[it]=FREERDP >+Name[ja]=FREERDP >+Name[kk]=FREERDP >+Name[km]=FREERDP >+Name[ko]=FREERDP >+Name[lt]=FREERDP >+Name[lv]=FREERDP >+Name[nb]=FREERDP >+Name[nds]=FREERDP >+Name[nl]=FREERDP >+Name[nn]=FREERDP >+Name[pa]=FREERDP >+Name[pl]=FREERDP >+Name[pt]=FREERDP >+Name[pt_BR]=FREERDP >+Name[ro]=FREERDP >+Name[ru]=ÐÐ°Ð·Ð¾Ð²Ð°Ñ Ð¿ÑогÑамма FREERDP >+Name[si]=FREERDP >+Name[sk]=FREERDP >+Name[sl]=FREERDP >+Name[sr]=Ð ÐÐ >+Name[sr@ijekavian]=Ð ÐÐ >+Name[sr@ijekavianlatin]=FREERDP >+Name[sr@latin]=FREERDP >+Name[sv]=FREERDP >+Name[tr]=FREERDP >+Name[ug]=FREERDP >+Name[uk]=FREERDP >+Name[wa]=FREERDP >+Name[x-test]=xxFREERDPxx >+Name[zh_CN]=FREERDP >+Name[zh_TW]=FREERDP >+ >+X-KDE-Library=kcm_krdc_freerdpplugin >+X-KDE-ParentComponents=krdc_freerdpplugin >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KCModule >+Name=FREERDP >+Name[ast]=FREERDP >+Name[bg]=FREERDP >+Name[bs]=FREERDP >+Name[ca]=FREERDP >+Name[ca@valencia]=FREERDP >+Name[cs]=FREERDP >+Name[da]=FREERDP >+Name[de]=FREERDP >+Name[el]=FREERDP >+Name[en_GB]=FREERDP >+Name[eo]=FREERDP >+Name[es]=FREERDP >+Name[et]=FREERDP >+Name[eu]=FREERDP >+Name[fi]=FREERDP >+Name[fr]=FREERDP >+Name[ga]=FREERDP >+Name[gl]=FREERDP >+Name[hr]=FREERDP >+Name[hu]=FREERDP >+Name[ia]=FREERDP >+Name[it]=FREERDP >+Name[ja]=FREERDP >+Name[kk]=FREERDP >+Name[km]=FREERDP >+Name[ko]=FREERDP >+Name[lt]=FREERDP >+Name[lv]=FREERDP >+Name[nb]=FREERDP >+Name[nds]=FREERDP >+Name[nl]=FREERDP >+Name[nn]=FREERDP >+Name[pa]=FREERDP >+Name[pl]=FREERDP >+Name[pt]=FREERDP >+Name[pt_BR]=FREERDP >+Name[ro]=FREERDP >+Name[ru]=ÐÐ°Ð·Ð¾Ð²Ð°Ñ Ð¿ÑогÑамма FREERDP >+Name[si]=FREERDP >+Name[sk]=FREERDP >+Name[sl]=FREERDP >+Name[sr]=Ð ÐÐ >+Name[sr@ijekavian]=Ð ÐÐ >+Name[sr@ijekavianlatin]=FREERDP >+Name[sr@latin]=FREERDP >+Name[sv]=FREERDP >+Name[tr]=FREERDP >+Name[ug]=FREERDP >+Name[uk]=FREERDP >+Name[wa]=FREERDP >+Name[x-test]=xxFREERDPxx >+Name[zh_CN]=FREERDP >+Name[zh_TW]=FREERDP >+ >+X-KDE-Library=kcm_krdc_freerdpplugin >+X-KDE-ParentComponents=krdc_freerdpplugin >diff -urN kdenetwork-4.9.1.org/krdc/krdc_freerdp.desktop kdenetwork-4.9.1/krdc/krdc_freerdp.desktop >--- kdenetwork-4.9.1.org/krdc/krdc_freerdp.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/krdc_freerdp.desktop 2012-09-19 22:29:02.457196002 +0200 >@@ -0,0 +1,242 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KRDC/Plugin >+Icon=krdc >+Name=FREERDP >+Name[ast]=FREERDP >+Name[bg]=FREERDP >+Name[bs]=FREERDP >+Name[ca]=FREERDP >+Name[ca@valencia]=FREERDP >+Name[cs]=FREERDP >+Name[da]=FREERDP >+Name[de]=FREERDP >+Name[el]=FREERDP >+Name[en_GB]=FREERDP >+Name[eo]=FREERDP >+Name[es]=FREERDP >+Name[et]=FREERDP >+Name[eu]=FREERDP >+Name[fi]=FREERDP >+Name[fr]=FREERDP >+Name[ga]=FREERDP >+Name[gl]=FREERDP >+Name[hr]=FREERDP >+Name[hu]=FREERDP >+Name[ia]=FREERDP >+Name[it]=FREERDP >+Name[ja]=FREERDP >+Name[kk]=FREERDP >+Name[km]=FREERDP >+Name[ko]=FREERDP >+Name[lt]=FREERDP >+Name[lv]=FREERDP >+Name[nb]=FREERDP >+Name[nds]=FREERDP >+Name[nl]=FREERDP >+Name[nn]=FREERDP >+Name[pa]=FREERDP >+Name[pl]=FREERDP >+Name[pt]=FREERDP >+Name[pt_BR]=FREERDP >+Name[ro]=FREERDP >+Name[ru]=ÐÐ°Ð·Ð¾Ð²Ð°Ñ Ð¿ÑогÑамма FREERDP >+Name[si]=FREERDP >+Name[sk]=FREERDP >+Name[sl]=FREERDP >+Name[sr]=Ð ÐÐ >+Name[sr@ijekavian]=Ð ÐÐ >+Name[sr@ijekavianlatin]=FREERDP >+Name[sr@latin]=FREERDP >+Name[sv]=FREERDP >+Name[tr]=FREERDP >+Name[ug]=FREERDP >+Name[uk]=FREERDP >+Name[wa]=FREERDP >+Name[x-test]=xxFREERDPxx >+Name[zh_CN]=FREERDP >+Name[zh_TW]=FREERDP >+Comment=Allows managing FREERDP sessions through KRDC >+Comment[ast]=Permite la xestión de sesiones FREERDP per KRDC >+Comment[bg]=УпÑавление на ÑеÑии на FREERDP Ñ KRDC >+Comment[bs]=DopuÅ¡ta upravljanje RPD sesijama kroz KRDC >+Comment[ca]=Permet gestionar sessions FREERDP mitjançant el KRDC >+Comment[ca@valencia]=Permet gestionar sessions FREERDP mitjançant el KRDC >+Comment[cs]=UmožÅuje spravovánà sezenà FREERDP pomocà KRDC >+Comment[da]=Muliggør hÃ¥ndtering af FREERDP-sessioner via KRDC >+Comment[de]=Erlaubt die Verwaltung von FREERDP-Sitzungen über KRDC >+Comment[el]=ÎÏιÏÏÎÏει Ïη διαÏείÏιÏη ÏÏ Î½ÎµÎ´ÏιÏν FREERDP μÎÏÏ ÏÎ¿Ï KRDC >+Comment[en_GB]=Allows managing FREERDP sessions through KRDC >+Comment[es]=Permite la gestión de sesiones FREERDP mediante KRDC >+Comment[et]=FREERDP-seansside haldamise võimaldamine KRDC kaudu >+Comment[eu]=FREERDP saioak KRDC bidez kudeatzea baimentzen du >+Comment[fi]=Sallii FREERDP-istuntojen hallinnan KRDC:n kautta >+Comment[fr]=Permet de gérer des sessions FREERDP au travers de KRDC >+Comment[ga]=CeadaÃonn sé duit seisiúin FREERDP a bhainistiú trà KRDC >+Comment[gl]=Permite xestionar sesións FREERDP por medio de KRDC >+Comment[hr]=OmoguÄuje upravljanje sjednicama FREERDP-a kroz KRDC >+Comment[hu]=FREERDP-kezelés KRDC-bÅl >+Comment[ia]=Permitte gerer sessiones FREERDP per medio de KRDC >+Comment[it]=Permette di gestire sessioni FREERDP con KRDC >+Comment[ja]=KRDC ãã FREERDP ã»ãã·ã§ã³ã管çã§ããããã«ãã¾ã >+Comment[kk]=KRDC аÑÒÑÐ»Ñ FREERDP ÑеанÑÑаÑÑн баÑÒаÑÑÒа мүмкÑндÑк беÑÑ >+Comment[km]=á¢áá»áááá¶áâá²ááâáááááááááâááááâáááá FREERDP áá¶áááá KRDC >+Comment[ko]=KRDC를 íµí´ì FREERDP ì¸ì ê´ë¦¬í기 >+Comment[lt]=Leidžia valdyti FREERDP sesijas per KRDC >+Comment[lv]=Ä»auj pÄrvaldÄ«t FREERDP sesijas caur KRDC >+Comment[nb]=Tillater Ã¥ styre FREERDP-økter gjennom KRDC >+Comment[nds]=FREERDP-Törns över KRDC plegen >+Comment[nl]=Staat het beheer van FREERDP-sessies toe via KRDC >+Comment[nn]=Lèt deg handtera FREERDP-økter gjennom KRDC >+Comment[pa]=KRDC ਰਾਹà©à¨ FREERDP ਸ਼à©à¨¸à¨¼à¨¨à¨¾à¨ ਦ੠ਪਰਬੰਧ ਦ੠ਮਨà¨à¨¼à©à¨°à© >+Comment[pl]=Pozwala na zarzÄ dzanie sesjami FREERDP przez KRDC >+Comment[pt]=Permite a gestão de sessões FREERDP através do KRDC >+Comment[pt_BR]=Permite o gerenciamento de sessões FREERDP através do KRDC >+Comment[ro]=Permite gestiunea sesiunilor FREERDP prin KRDC >+Comment[ru]=РазÑеÑиÑÑ ÑпÑавление ÑеанÑами FREERDP ÑеÑез KRDC >+Comment[si]=KRDC à·à¶»à·à· FREERDP à·à·à¶» à¶´à·à¶½à¶±à¶ºà¶§ à¶à¶© දà·à¶ºà· >+Comment[sk]=UmožÅuje spravovanie FREERDP sedenà pomocou KRDC >+Comment[sl]=OmogoÄa upravljanje sej FREERDP prek KRDC >+Comment[sr]=УпÑавÑаÑе Ð ÐÐ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavian]=УпÑавÑаÑе Ð ÐÐ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavianlatin]=Upravljanje FREERDP sesijama kroz KRDC >+Comment[sr@latin]=Upravljanje FREERDP sesijama kroz KRDC >+Comment[sv]=TillÃ¥ter hantering av FREERDP-sessioner via KRDC >+Comment[th]=à¸à¸à¸¸à¸à¸²à¸à¹à¸«à¹à¸à¸³à¸à¸²à¸£à¸à¸±à¸à¸à¸²à¸£à¸§à¸²à¸£à¸°à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸ FREERDP à¸à¹à¸²à¸à¸à¸²à¸à¹à¸à¸£à¹à¸à¸£à¸¡ KRDC >+Comment[tr]=FREERDP oturumlarını KRDC üzerinden yönetmeye izin verir >+Comment[uk]=ÐÐ°Ð´Ð°Ñ Ð·Ð¼Ð¾Ð³Ñ ÐºÐµÑÑваÑи ÑеанÑами FREERDP за Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ KRDC >+Comment[x-test]=xxAllows managing FREERDP sessions through KRDCxx >+Comment[zh_CN]=å è®¸ç¨æ·éè¿ KRDC 管ç FREERDPä¼è¯ >+Comment[zh_TW]=å 許éé KRDC 管ç FREERDP å·¥ä½é段 >+ >+X-KDE-PluginInfo-Author=AceLan Kao >+X-KDE-PluginInfo-Email=acelan@acelan.idv.tw >+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_freerdpplugin >+X-KDE-PluginInfo-Name=krdc_freerdpplugin >+ >+X-KDE-KRDC-Sorting=70 >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KRDC/Plugin >+Icon=krdc >+Name=FREERDP >+Name[ast]=FREERDP >+Name[bg]=FREERDP >+Name[bs]=FREERDP >+Name[ca]=FREERDP >+Name[ca@valencia]=FREERDP >+Name[cs]=FREERDP >+Name[da]=FREERDP >+Name[de]=FREERDP >+Name[el]=FREERDP >+Name[en_GB]=FREERDP >+Name[eo]=FREERDP >+Name[es]=FREERDP >+Name[et]=FREERDP >+Name[eu]=FREERDP >+Name[fi]=FREERDP >+Name[fr]=FREERDP >+Name[ga]=FREERDP >+Name[gl]=FREERDP >+Name[hr]=FREERDP >+Name[hu]=FREERDP >+Name[ia]=FREERDP >+Name[it]=FREERDP >+Name[ja]=FREERDP >+Name[kk]=FREERDP >+Name[km]=FREERDP >+Name[ko]=FREERDP >+Name[lt]=FREERDP >+Name[lv]=FREERDP >+Name[nb]=FREERDP >+Name[nds]=FREERDP >+Name[nl]=FREERDP >+Name[nn]=FREERDP >+Name[pa]=FREERDP >+Name[pl]=FREERDP >+Name[pt]=FREERDP >+Name[pt_BR]=FREERDP >+Name[ro]=FREERDP >+Name[ru]=ÐÐ°Ð·Ð¾Ð²Ð°Ñ Ð¿ÑогÑамма FREERDP >+Name[si]=FREERDP >+Name[sk]=FREERDP >+Name[sl]=FREERDP >+Name[sr]=Ð ÐÐ >+Name[sr@ijekavian]=Ð ÐÐ >+Name[sr@ijekavianlatin]=FREERDP >+Name[sr@latin]=FREERDP >+Name[sv]=FREERDP >+Name[tr]=FREERDP >+Name[ug]=FREERDP >+Name[uk]=FREERDP >+Name[wa]=FREERDP >+Name[x-test]=xxFREERDPxx >+Name[zh_CN]=FREERDP >+Name[zh_TW]=FREERDP >+Comment=Allows managing FREERDP sessions through KRDC >+Comment[ast]=Permite la xestión de sesiones FREERDP per KRDC >+Comment[bg]=УпÑавление на ÑеÑии на FREERDP Ñ KRDC >+Comment[bs]=DopuÅ¡ta upravljanje RPD sesijama kroz KRDC >+Comment[ca]=Permet gestionar sessions FREERDP mitjançant el KRDC >+Comment[ca@valencia]=Permet gestionar sessions FREERDP mitjançant el KRDC >+Comment[cs]=UmožÅuje spravovánà sezenà FREERDP pomocà KRDC >+Comment[da]=Muliggør hÃ¥ndtering af FREERDP-sessioner via KRDC >+Comment[de]=Erlaubt die Verwaltung von FREERDP-Sitzungen über KRDC >+Comment[el]=ÎÏιÏÏÎÏει Ïη διαÏείÏιÏη ÏÏ Î½ÎµÎ´ÏιÏν FREERDP μÎÏÏ ÏÎ¿Ï KRDC >+Comment[en_GB]=Allows managing FREERDP sessions through KRDC >+Comment[es]=Permite la gestión de sesiones FREERDP mediante KRDC >+Comment[et]=FREERDP-seansside haldamise võimaldamine KRDC kaudu >+Comment[eu]=FREERDP saioak KRDC bidez kudeatzea baimentzen du >+Comment[fi]=Sallii FREERDP-istuntojen hallinnan KRDC:n kautta >+Comment[fr]=Permet de gérer des sessions FREERDP au travers de KRDC >+Comment[ga]=CeadaÃonn sé duit seisiúin FREERDP a bhainistiú trà KRDC >+Comment[gl]=Permite xestionar sesións FREERDP por medio de KRDC >+Comment[hr]=OmoguÄuje upravljanje sjednicama FREERDP-a kroz KRDC >+Comment[hu]=FREERDP-kezelés KRDC-bÅl >+Comment[ia]=Permitte gerer sessiones FREERDP per medio de KRDC >+Comment[it]=Permette di gestire sessioni FREERDP con KRDC >+Comment[ja]=KRDC ãã FREERDP ã»ãã·ã§ã³ã管çã§ããããã«ãã¾ã >+Comment[kk]=KRDC аÑÒÑÐ»Ñ FREERDP ÑеанÑÑаÑÑн баÑÒаÑÑÒа мүмкÑндÑк беÑÑ >+Comment[km]=á¢áá»áááá¶áâá²ááâáááááááááâááááâáááá FREERDP áá¶áááá KRDC >+Comment[ko]=KRDC를 íµí´ì FREERDP ì¸ì ê´ë¦¬í기 >+Comment[lt]=Leidžia valdyti FREERDP sesijas per KRDC >+Comment[lv]=Ä»auj pÄrvaldÄ«t FREERDP sesijas caur KRDC >+Comment[nb]=Tillater Ã¥ styre FREERDP-økter gjennom KRDC >+Comment[nds]=FREERDP-Törns över KRDC plegen >+Comment[nl]=Staat het beheer van FREERDP-sessies toe via KRDC >+Comment[nn]=Lèt deg handtera FREERDP-økter gjennom KRDC >+Comment[pa]=KRDC ਰਾਹà©à¨ FREERDP ਸ਼à©à¨¸à¨¼à¨¨à¨¾à¨ ਦ੠ਪਰਬੰਧ ਦ੠ਮਨà¨à¨¼à©à¨°à© >+Comment[pl]=Pozwala na zarzÄ dzanie sesjami FREERDP przez KRDC >+Comment[pt]=Permite a gestão de sessões FREERDP através do KRDC >+Comment[pt_BR]=Permite o gerenciamento de sessões FREERDP através do KRDC >+Comment[ro]=Permite gestiunea sesiunilor FREERDP prin KRDC >+Comment[ru]=РазÑеÑиÑÑ ÑпÑавление ÑеанÑами FREERDP ÑеÑез KRDC >+Comment[si]=KRDC à·à¶»à·à· FREERDP à·à·à¶» à¶´à·à¶½à¶±à¶ºà¶§ à¶à¶© දà·à¶ºà· >+Comment[sk]=UmožÅuje spravovanie FREERDP sedenà pomocou KRDC >+Comment[sl]=OmogoÄa upravljanje sej FREERDP prek KRDC >+Comment[sr]=УпÑавÑаÑе Ð ÐÐ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavian]=УпÑавÑаÑе Ð ÐÐ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavianlatin]=Upravljanje FREERDP sesijama kroz KRDC >+Comment[sr@latin]=Upravljanje FREERDP sesijama kroz KRDC >+Comment[sv]=TillÃ¥ter hantering av FREERDP-sessioner via KRDC >+Comment[th]=à¸à¸à¸¸à¸à¸²à¸à¹à¸«à¹à¸à¸³à¸à¸²à¸£à¸à¸±à¸à¸à¸²à¸£à¸§à¸²à¸£à¸°à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸ FREERDP à¸à¹à¸²à¸à¸à¸²à¸à¹à¸à¸£à¹à¸à¸£à¸¡ KRDC >+Comment[tr]=FREERDP oturumlarını KRDC üzerinden yönetmeye izin verir >+Comment[uk]=ÐÐ°Ð´Ð°Ñ Ð·Ð¼Ð¾Ð³Ñ ÐºÐµÑÑваÑи ÑеанÑами FREERDP за Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ KRDC >+Comment[x-test]=xxAllows managing FREERDP sessions through KRDCxx >+Comment[zh_CN]=å è®¸ç¨æ·éè¿ KRDC 管ç FREERDPä¼è¯ >+Comment[zh_TW]=å 許éé KRDC 管ç FREERDP å·¥ä½é段 >+ >+X-KDE-PluginInfo-Author=AceLan Kao >+X-KDE-PluginInfo-Email=acelan@acelan.idv.tw >+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_freerdpplugin >+X-KDE-PluginInfo-Name=krdc_freerdpplugin >+ >+X-KDE-KRDC-Sorting=70 >diff -urN kdenetwork-4.9.1.org/krdc/smb2rdc.desktop kdenetwork-4.9.1/krdc/smb2rdc.desktop >--- kdenetwork-4.9.1.org/krdc/smb2rdc.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc/smb2rdc.desktop 2012-09-19 22:29:02.456196002 +0200 >@@ -0,0 +1,146 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KonqPopupMenu/Plugin >+MimeType=application/x-smb-server; >+Actions=smb2rdc; >+ >+[Desktop Action smb2rdc] >+Name=Open Remote Desktop Connection to This Machine >+Name[ar]=Ø§ÙØªØ ع٠بعد Ø³Ø·Ø Ø§ÙÙ ÙØªØ¨ Ø§ÙØ§ØªØµØ§Ù Ø¥ÙÙ ÙØ°Ù Ø§ÙØ¢ÙØ© >+Name[ast]=Abrir conexón remota d'escritoriu a esti sistema >+Name[bg]=ÐÑÑзка Ñ Ð¾ÑдалеÑен ÑабоÑно мÑÑÑо Ñ Ð¸Ð·Ð±ÑÐ°Ð½Ð¸Ñ ÐºÐ¾Ð¼Ð¿ÑÑÑÑ >+Name[bn]=à¦à¦ মà§à¦¶à¦¿à¦¨à§ পà§à¦°à¦¤à§à¦¯à¦¨à§à¦¤ ডà§à¦¸à§à¦à¦à¦ªà§à¦° সà¦à¦¯à§à¦ à¦à§à¦²à§ >+Name[bs]=Otvara udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[ca]=Obre una connexió remota d'escriptori a aquesta mà quina >+Name[ca@valencia]=Obri una connexió remota d'escriptori a esta mà quina >+Name[cs]=OtevÅÃt vzdálené pÅipojenà plochy k tomuto poÄÃtaÄi >+Name[da]=à bn ekstern desktopforbindelse til denne maskine >+Name[de]=Verbindung zur Arbeitsfläche dieses Rechners herstellen >+Name[el]=ÎÎ·Î¼Î¹Î¿Ï Ïγία ÏÏνδεÏÎ·Ï Ïε αÏομακÏÏ ÏμÎνη εÏιÏάνεια εÏγαÏÎ¯Î±Ï Ïε Î±Ï ÏÏ Ïο μηÏάνημα >+Name[en_GB]=Open Remote Desktop Connection to This Machine >+Name[eo]=Malfermi deforan tabulan konekton al tiu maÅino >+Name[es]=Abrir conexión remota de escritorio a este sistema >+Name[et]=Kaugtöölaua ühenduse avamine sellesse arvutisse >+Name[eu]=Ireki urruneko mahaigainaren konexioa makina honetara >+Name[fa]=باز کرد٠اتصا٠رÙÙ ÛØ²Û Ø±Ø§Ù Ø¯ÙØ± Ø¨Ø±Ø§Û Ø§Û٠٠اشÛÙ >+Name[fi]=Avaa etätyöpöytäyhteys tähän koneeseen >+Name[fr]=Ouvrir une connexion distante au bureau de cette machine >+Name[ga]=Oscail Ceangal Deisce Cianda leis an RÃomhaire Seo >+Name[gl]=Abrir unha conexión remota co escritorio desta máquina >+Name[he]=×¤×ª× ××××ר ש×××× ×¢×××× ×ר×××§ ××××× × ×× >+Name[hi]=à¤à¤¸ मशà¥à¤¨ à¤à¥ लिठरिमà¥à¤ डà¥à¤¸à¥à¤à¤à¥à¤ª à¤à¤¨à¥à¤à¥à¤¶à¤¨ à¤à¥à¤²à¥à¤ >+Name[hne]=यॠमसà¥à¤¨ बर रिमà¥à¤ डà¥à¤¸à¥à¤à¤à¤¾à¤ª à¤à¤¨à¥à¤à¥à¤¸à¤¨ à¤à¥à¤²à¤µ >+Name[hr]=Otvorena veza udaljenog pristupa prema ovom ureÄaju >+Name[hu]=Távoli munkaasztal nyitása itt >+Name[ia]=Aperi connexion de scriptorio remote a iste machina >+Name[is]=Opna fjarlæga skjáborðtengingu til þessarar vélar >+Name[it]=Apri connessione a desktop remoto a questa macchina >+Name[ja]=ãã®ãã¹ãã¸ãªã¢ã¼ããã¹ã¯ãããæ¥ç¶ãéã >+Name[kk]=ÐÑÑ ÐºÐ¾Ð¼Ð¿ÑÑÑеÑÐ´ÐµÐ³Ñ Ò¯ÑÑелге ÒаÑÑÒ ÒоÑÑлÑÐ¼Ð´Ñ Ð°ÑÑ >+Name[km]=áá¾áâáá¶áâáâáááá¶ááâááááâáá»âáá¸âá áááá¶áâáá âááá¶ááá¸áâááá >+Name[ko]=ì´ ìì¤í ì¼ë¡ì ì격 ë°ì¤í¬í± ì°ê²° ì´ê¸° >+Name[lt]=Užmegzti nutolusio darbastalio prijungimÄ prie Å¡io kompiuterio >+Name[lv]=AvÄrt attÄlinÄtÄs darbirsmas savienojumu uz Å¡o datoru >+Name[ml]=വിദàµà´° പണിയിà´à´¤àµà´¤à´¿à´¨àµ ഠയനàµà´¤àµà´°à´µàµà´®à´¾à´¯àµà´³àµà´³ ബനàµà´§à´ à´¤àµà´à´àµà´àµà´ >+Name[nb]=à pne fjerntilkobling til skrivebord til denne maskinen >+Name[nds]=Schriefdisch-Feernverbinnen na dissen Reekner opmaken >+Name[ne]=यॠमà¥à¤¶à¤¿à¤¨à¤®à¤¾ à¤à¤¾à¤¢à¤¾à¤à¥ डà¥à¤¸à¥à¤à¤à¤ª à¤à¤¡à¤¾à¤¨ à¤à¥à¤²à¥à¤¨à¥à¤¹à¥à¤¸à¥ >+Name[nl]=Externe bureaubladverbinding met deze computer openen >+Name[nn]=Opna samband til skrivebordet over nettverket til denne maskina >+Name[pa]=à¨à¨¸ ਮਸ਼à©à¨¨ ਨਾਲ ਰਿਮà©à¨ ਡà©à¨¸à¨à¨à¨¾à¨ª à¨à©à¨¨à©à¨à¨¸à¨¼à¨¨ à¨à©à¨²à©à¨¹à© >+Name[pl]=Otwórz zdalne poÅÄ czenie z pulpitem na tej maszynie >+Name[pt]=Abrir uma Ligação Remota ao Ecrã deste Computador >+Name[pt_BR]=Abre conexões remotas para essa máquina >+Name[ro]=DeschideÈi conexiune de birou distant spre aceastÄ maÈinÄ >+Name[ru]=ÐÑкÑÑÑÑ Ñоединение Remote Desktop Ñ ÑÑой маÑиной >+Name[si]=මà·à¶¸ යනà·à¶à·âරය à·à¶³à·à· දà·à¶»à·à·à¶® à·à·à¶©à¶à¶½ à·à¶¶à¶³à¶à·à· à·à·à·à·à¶ à¶à¶»à¶±à·à¶± >+Name[sk]=OtvoriÅ¥ vzdialené pripojenie pracovnej plochy k tomuto poÄÃtaÄu >+Name[sl]=Odpri povezavo z oddaljenim namizjem na tem raÄunalniku >+Name[sr]=ÐÑвоÑиÑе ÑдаÑÐµÐ½Ñ Ð²ÐµÐ·Ñ Ð¿Ð¾Ð²ÑÑи ка Ð¾Ð²Ð¾Ñ Ð¼Ð°Ñини >+Name[sr@ijekavian]=ÐÑвоÑиÑе ÑдаÑÐµÐ½Ñ Ð²ÐµÐ·Ñ Ð¿Ð¾Ð²ÑÑи ка Ð¾Ð²Ð¾Ñ Ð¼Ð°Ñини >+Name[sr@ijekavianlatin]=Otvorite udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[sr@latin]=Otvorite udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[sv]=Ãppna fjärrskrivbordsanslutning till den här datorn >+Name[th]=à¹à¸à¸´à¸à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸·à¹à¸à¸à¸µà¹à¸à¸³à¸à¸²à¸à¸à¸²à¸à¹à¸à¸¥à¸¡à¸²à¸¢à¸±à¸à¹à¸à¸£à¸·à¹à¸à¸à¸à¸µà¹ >+Name[tr]=Bu Makineye Uzak Masaüstü BaÄlantısı Aç >+Name[uk]=ÐÑдкÑиÑи з'ÑÐ´Ð½Ð°Ð½Ð½Ñ Ð· вÑÐ´Ð´Ð°Ð»ÐµÐ½Ð¾Ñ ÑÑÑлÑниÑÐµÑ Ð´Ð¾ ÑÑого комп'ÑÑеÑа >+Name[vi]=Má» kết ná»i mà n hình ná»n từ xa Äến máy nà y >+Name[x-test]=xxOpen Remote Desktop Connection to This Machinexx >+Name[zh_CN]=æå¼å°æ¤è®¡ç®æºçè¿ç¨æ¡é¢è¿æ¥ >+Name[zh_HK]=éæ¾é 端æ¡é¢é£ç·å°éé»è ¦ >+Name[zh_TW]=卿¤ä¸»æ©ä¸éåé 端æ¡é¢ >+Exec=krdc %u >+Icon=krdc >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KonqPopupMenu/Plugin >+MimeType=application/x-smb-server; >+Actions=smb2rdc; >+ >+[Desktop Action smb2rdc] >+Name=Open Remote Desktop Connection to This Machine >+Name[ar]=Ø§ÙØªØ ع٠بعد Ø³Ø·Ø Ø§ÙÙ ÙØªØ¨ Ø§ÙØ§ØªØµØ§Ù Ø¥ÙÙ ÙØ°Ù Ø§ÙØ¢ÙØ© >+Name[ast]=Abrir conexón remota d'escritoriu a esti sistema >+Name[bg]=ÐÑÑзка Ñ Ð¾ÑдалеÑен ÑабоÑно мÑÑÑо Ñ Ð¸Ð·Ð±ÑÐ°Ð½Ð¸Ñ ÐºÐ¾Ð¼Ð¿ÑÑÑÑ >+Name[bn]=à¦à¦ মà§à¦¶à¦¿à¦¨à§ পà§à¦°à¦¤à§à¦¯à¦¨à§à¦¤ ডà§à¦¸à§à¦à¦à¦ªà§à¦° সà¦à¦¯à§à¦ à¦à§à¦²à§ >+Name[bs]=Otvara udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[ca]=Obre una connexió remota d'escriptori a aquesta mà quina >+Name[ca@valencia]=Obri una connexió remota d'escriptori a esta mà quina >+Name[cs]=OtevÅÃt vzdálené pÅipojenà plochy k tomuto poÄÃtaÄi >+Name[da]=à bn ekstern desktopforbindelse til denne maskine >+Name[de]=Verbindung zur Arbeitsfläche dieses Rechners herstellen >+Name[el]=ÎÎ·Î¼Î¹Î¿Ï Ïγία ÏÏνδεÏÎ·Ï Ïε αÏομακÏÏ ÏμÎνη εÏιÏάνεια εÏγαÏÎ¯Î±Ï Ïε Î±Ï ÏÏ Ïο μηÏάνημα >+Name[en_GB]=Open Remote Desktop Connection to This Machine >+Name[eo]=Malfermi deforan tabulan konekton al tiu maÅino >+Name[es]=Abrir conexión remota de escritorio a este sistema >+Name[et]=Kaugtöölaua ühenduse avamine sellesse arvutisse >+Name[eu]=Ireki urruneko mahaigainaren konexioa makina honetara >+Name[fa]=باز کرد٠اتصا٠رÙÙ ÛØ²Û Ø±Ø§Ù Ø¯ÙØ± Ø¨Ø±Ø§Û Ø§Û٠٠اشÛÙ >+Name[fi]=Avaa etätyöpöytäyhteys tähän koneeseen >+Name[fr]=Ouvrir une connexion distante au bureau de cette machine >+Name[ga]=Oscail Ceangal Deisce Cianda leis an RÃomhaire Seo >+Name[gl]=Abrir unha conexión remota co escritorio desta máquina >+Name[he]=×¤×ª× ××××ר ש×××× ×¢×××× ×ר×××§ ××××× × ×× >+Name[hi]=à¤à¤¸ मशà¥à¤¨ à¤à¥ लिठरिमà¥à¤ डà¥à¤¸à¥à¤à¤à¥à¤ª à¤à¤¨à¥à¤à¥à¤¶à¤¨ à¤à¥à¤²à¥à¤ >+Name[hne]=यॠमसà¥à¤¨ बर रिमà¥à¤ डà¥à¤¸à¥à¤à¤à¤¾à¤ª à¤à¤¨à¥à¤à¥à¤¸à¤¨ à¤à¥à¤²à¤µ >+Name[hr]=Otvorena veza udaljenog pristupa prema ovom ureÄaju >+Name[hu]=Távoli munkaasztal nyitása itt >+Name[ia]=Aperi connexion de scriptorio remote a iste machina >+Name[is]=Opna fjarlæga skjáborðtengingu til þessarar vélar >+Name[it]=Apri connessione a desktop remoto a questa macchina >+Name[ja]=ãã®ãã¹ãã¸ãªã¢ã¼ããã¹ã¯ãããæ¥ç¶ãéã >+Name[kk]=ÐÑÑ ÐºÐ¾Ð¼Ð¿ÑÑÑеÑÐ´ÐµÐ³Ñ Ò¯ÑÑелге ÒаÑÑÒ ÒоÑÑлÑÐ¼Ð´Ñ Ð°ÑÑ >+Name[km]=áá¾áâáá¶áâáâáááá¶ááâááááâáá»âáá¸âá áááá¶áâáá âááá¶ááá¸áâááá >+Name[ko]=ì´ ìì¤í ì¼ë¡ì ì격 ë°ì¤í¬í± ì°ê²° ì´ê¸° >+Name[lt]=Užmegzti nutolusio darbastalio prijungimÄ prie Å¡io kompiuterio >+Name[lv]=AvÄrt attÄlinÄtÄs darbirsmas savienojumu uz Å¡o datoru >+Name[ml]=വിദàµà´° പണിയിà´à´¤àµà´¤à´¿à´¨àµ ഠയനàµà´¤àµà´°à´µàµà´®à´¾à´¯àµà´³àµà´³ ബനàµà´§à´ à´¤àµà´à´àµà´àµà´ >+Name[nb]=à pne fjerntilkobling til skrivebord til denne maskinen >+Name[nds]=Schriefdisch-Feernverbinnen na dissen Reekner opmaken >+Name[ne]=यॠमà¥à¤¶à¤¿à¤¨à¤®à¤¾ à¤à¤¾à¤¢à¤¾à¤à¥ डà¥à¤¸à¥à¤à¤à¤ª à¤à¤¡à¤¾à¤¨ à¤à¥à¤²à¥à¤¨à¥à¤¹à¥à¤¸à¥ >+Name[nl]=Externe bureaubladverbinding met deze computer openen >+Name[nn]=Opna samband til skrivebordet over nettverket til denne maskina >+Name[pa]=à¨à¨¸ ਮਸ਼à©à¨¨ ਨਾਲ ਰਿਮà©à¨ ਡà©à¨¸à¨à¨à¨¾à¨ª à¨à©à¨¨à©à¨à¨¸à¨¼à¨¨ à¨à©à¨²à©à¨¹à© >+Name[pl]=Otwórz zdalne poÅÄ czenie z pulpitem na tej maszynie >+Name[pt]=Abrir uma Ligação Remota ao Ecrã deste Computador >+Name[pt_BR]=Abre conexões remotas para essa máquina >+Name[ro]=DeschideÈi conexiune de birou distant spre aceastÄ maÈinÄ >+Name[ru]=ÐÑкÑÑÑÑ Ñоединение Remote Desktop Ñ ÑÑой маÑиной >+Name[si]=මà·à¶¸ යනà·à¶à·âරය à·à¶³à·à· දà·à¶»à·à·à¶® à·à·à¶©à¶à¶½ à·à¶¶à¶³à¶à·à· à·à·à·à·à¶ à¶à¶»à¶±à·à¶± >+Name[sk]=OtvoriÅ¥ vzdialené pripojenie pracovnej plochy k tomuto poÄÃtaÄu >+Name[sl]=Odpri povezavo z oddaljenim namizjem na tem raÄunalniku >+Name[sr]=ÐÑвоÑиÑе ÑдаÑÐµÐ½Ñ Ð²ÐµÐ·Ñ Ð¿Ð¾Ð²ÑÑи ка Ð¾Ð²Ð¾Ñ Ð¼Ð°Ñини >+Name[sr@ijekavian]=ÐÑвоÑиÑе ÑдаÑÐµÐ½Ñ Ð²ÐµÐ·Ñ Ð¿Ð¾Ð²ÑÑи ка Ð¾Ð²Ð¾Ñ Ð¼Ð°Ñини >+Name[sr@ijekavianlatin]=Otvorite udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[sr@latin]=Otvorite udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[sv]=Ãppna fjärrskrivbordsanslutning till den här datorn >+Name[th]=à¹à¸à¸´à¸à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸·à¹à¸à¸à¸µà¹à¸à¸³à¸à¸²à¸à¸à¸²à¸à¹à¸à¸¥à¸¡à¸²à¸¢à¸±à¸à¹à¸à¸£à¸·à¹à¸à¸à¸à¸µà¹ >+Name[tr]=Bu Makineye Uzak Masaüstü BaÄlantısı Aç >+Name[uk]=ÐÑдкÑиÑи з'ÑÐ´Ð½Ð°Ð½Ð½Ñ Ð· вÑÐ´Ð´Ð°Ð»ÐµÐ½Ð¾Ñ ÑÑÑлÑниÑÐµÑ Ð´Ð¾ ÑÑого комп'ÑÑеÑа >+Name[vi]=Má» kết ná»i mà n hình ná»n từ xa Äến máy nà y >+Name[x-test]=xxOpen Remote Desktop Connection to This Machinexx >+Name[zh_CN]=æå¼å°æ¤è®¡ç®æºçè¿ç¨æ¡é¢è¿æ¥ >+Name[zh_HK]=éæ¾é 端æ¡é¢é£ç·å°éé»è ¦ >+Name[zh_TW]=卿¤ä¸»æ©ä¸éåé 端æ¡é¢ >+Exec=krdc %u >+Icon=krdc >diff -urN kdenetwork-4.9.1.org/krdc.org/bookmarkmanager.cpp kdenetwork-4.9.1/krdc.org/bookmarkmanager.cpp >--- kdenetwork-4.9.1.org/krdc.org/bookmarkmanager.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/bookmarkmanager.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,205 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "bookmarkmanager.h" >+ >+#include "mainwindow.h" >+ >+#include <KBookmarkMenu> >+#include <KStandardDirs> >+#include <KDebug> >+ >+BookmarkManager::BookmarkManager(KActionCollection *collection, KMenu *menu, MainWindow *parent) >+ : QObject(parent), >+ KBookmarkOwner(), >+ m_mainWindow(parent) >+{ >+ const QString file = KStandardDirs::locateLocal("data", "krdc/bookmarks.xml"); >+ >+ m_manager = KBookmarkManager::managerForFile(file, "krdc"); >+ m_manager->setUpdate(true); >+ m_bookmarkMenu = new KBookmarkMenu(m_manager, this, menu, collection); >+ >+ KBookmarkGroup root = m_manager->root(); >+ KBookmark bm = root.first(); >+ while (!bm.isNull()) { >+ if (bm.metaDataItem("krdc-history") == "historyfolder") // get it also when user renamed it >+ break; >+ bm = root.next(bm); >+ } >+ >+ if (bm.isNull()) { >+ kDebug(5010) << "History folder not found. Create it."; >+ bm = m_manager->root().createNewFolder(i18n("History")); >+ bm.setMetaDataItem("krdc-history", "historyfolder"); >+ m_manager->emitChanged(); >+ } >+ >+ m_historyGroup = bm.toGroup(); >+} >+ >+BookmarkManager::~BookmarkManager() >+{ >+ delete m_bookmarkMenu; >+} >+ >+void BookmarkManager::addHistoryBookmark() >+{ >+ KBookmark bm = m_historyGroup.first(); >+ while (!bm.isNull()) { >+ if (bm.url() == KUrl(currentUrl())) { >+ kDebug(5010) << "Found URL. Move it at the history start."; >+ m_historyGroup.moveBookmark(bm, KBookmark()); >+ bm.updateAccessMetadata(); >+ m_manager->emitChanged(m_historyGroup); >+ return; >+ } >+ bm = m_historyGroup.next(bm); >+ } >+ >+ if (bm.isNull()) { >+ kDebug(5010) << "Add new history bookmark."; >+ bm = m_historyGroup.addBookmark(currentTitle(), currentUrl()); >+ bm.updateAccessMetadata(); >+ m_historyGroup.moveBookmark(bm, KBookmark()); >+ m_manager->emitChanged(m_historyGroup); >+ } >+} >+ >+void BookmarkManager::openBookmark(const KBookmark &bm, Qt::MouseButtons, Qt::KeyboardModifiers) >+{ >+ emit openUrl(bm.url()); >+} >+ >+void BookmarkManager::openFolderinTabs(const KBookmarkGroup &bookmarkGroup) >+{ >+ KBookmark bm = bookmarkGroup.first(); >+ while (!bm.isNull()) { >+ emit openUrl(bm.url()); >+ bm = bookmarkGroup.next(bm); >+ } >+} >+ >+bool BookmarkManager::addBookmarkEntry() const >+{ >+ return true; >+} >+ >+bool BookmarkManager::editBookmarkEntry() const >+{ >+ return true; >+} >+ >+QString BookmarkManager::currentUrl() const >+{ >+ if (m_mainWindow->currentRemoteView() >= 0) >+ return m_mainWindow->remoteViewList().at(m_mainWindow->currentRemoteView()) >+ ->url().prettyUrl(KUrl::RemoveTrailingSlash); >+ else >+ return QString(); >+} >+ >+QString BookmarkManager::currentTitle() const >+{ >+ return QUrl::fromPercentEncoding(currentUrl().toUtf8()); >+} >+ >+bool BookmarkManager::supportsTabs() const >+{ >+ return true; >+} >+ >+QList<QPair<QString, QString> > BookmarkManager::currentBookmarkList() const >+{ >+ QList<QPair<QString, QString> > list; >+ >+ QListIterator<RemoteView *> iter(m_mainWindow->remoteViewList()); >+ >+ while (iter.hasNext()) { >+ RemoteView *next = iter.next(); >+ const QString url = next->url().prettyUrl(KUrl::RemoveTrailingSlash); >+ list << QPair<QString, QString>(url, url); >+ } >+ >+ return list; >+} >+ >+void BookmarkManager::addManualBookmark(const QString &url, const QString &text) >+{ >+ m_manager->root().addBookmark(url, text); >+ emit m_manager->emitChanged(); >+} >+ >+KBookmarkManager* BookmarkManager::getManager() >+{ >+ return m_manager; >+} >+ >+const QStringList BookmarkManager::findBookmarkAddresses(const KBookmarkGroup &group, const QString &url) >+{ >+ QStringList bookmarkAddresses = QStringList(); >+ KBookmark bm = group.first(); >+ while (!bm.isNull()) { >+ if (bm.isGroup()) { >+ bookmarkAddresses.append(findBookmarkAddresses(bm.toGroup(), url)); >+ } >+ >+ if (bm.url() == url) { >+ bookmarkAddresses.append(bm.address()); >+ } >+ bm = group.next(bm); >+ } >+ return bookmarkAddresses; >+} >+ >+void BookmarkManager::removeByUrl(KBookmarkManager *manager, const QString &url, bool ignoreHistory, const QString updateTitle) >+{ >+ foreach(const QString &address, findBookmarkAddresses(manager->root(), url)) { >+ KBookmark bm = manager->findByAddress(address); >+ if (ignoreHistory && bm.parentGroup().metaDataItem("krdc-history") == "historyfolder") { >+ if (!updateTitle.isEmpty()) { >+ kDebug(5010) << "Update" << bm.fullText(); >+ bm.setFullText(updateTitle); >+ } >+ } else { >+ if (!bm.isGroup()) { // please don't delete groups... happened in testing >+ kDebug(5010) << "Delete" << bm.fullText(); >+ bm.parentGroup().deleteBookmark(bm); >+ } >+ } >+ } >+ >+ manager->emitChanged(); >+} >+ >+void BookmarkManager::updateTitle(KBookmarkManager *manager, const QString &url, const QString &title) >+{ >+ foreach(const QString &address, findBookmarkAddresses(manager->root(), url)) { >+ KBookmark bm = manager->findByAddress(address); >+ bm.setFullText(title); >+ kDebug(5010) << "Update" << bm.fullText(); >+ } >+ manager->emitChanged(); >+} >+ >+#include "bookmarkmanager.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/bookmarkmanager.h kdenetwork-4.9.1/krdc.org/bookmarkmanager.h >--- kdenetwork-4.9.1.org/krdc.org/bookmarkmanager.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/bookmarkmanager.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,72 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 BOOKMARKMANAGER_H >+#define BOOKMARKMANAGER_H >+ >+#include <KBookmarkManager> >+ >+class KActionCollection; >+class KBookmarkMenu; >+ >+class MainWindow; >+ >+class BookmarkManager : public QObject, public KBookmarkOwner >+{ >+ Q_OBJECT >+ >+public: >+ BookmarkManager(KActionCollection *collection, KMenu *menu, MainWindow *parent); >+ ~BookmarkManager(); >+ >+ virtual QString currentUrl() const; >+ virtual QString currentTitle() const; >+ virtual bool addBookmarkEntry() const; >+ virtual bool editBookmarkEntry() const; >+ virtual bool supportsTabs() const; >+ virtual QList<QPair<QString, QString> > currentBookmarkList() const; >+ void addHistoryBookmark(); >+ void addManualBookmark(const QString &url, const QString &text); >+ KBookmarkManager* getManager(); >+ // removes all bookmarks with url, possibly ignore the history folder and update it's title there if it's set >+ static void removeByUrl(KBookmarkManager *manager, const QString &url, bool ignoreHistory = false, const QString updateTitle = QString()); >+ static void updateTitle(KBookmarkManager *manager, const QString &url, const QString &title); >+ // returns a QStringList for all bookmarks that point to this url using KBookmark::address() >+ static const QStringList findBookmarkAddresses(const KBookmarkGroup &group, const QString &url); >+ >+signals: >+ void openUrl(const KUrl &url); >+ >+private slots: >+ void openBookmark(const KBookmark &bm, Qt::MouseButtons, Qt::KeyboardModifiers); >+ void openFolderinTabs(const KBookmarkGroup &bookmarkGroup); >+ >+private: >+ KBookmarkMenu *m_bookmarkMenu; >+ KBookmarkManager *m_manager; >+ KBookmarkGroup m_historyGroup; >+ >+ MainWindow *m_mainWindow; >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/cmake/modules/FindLibVNCServer.cmake kdenetwork-4.9.1/krdc.org/cmake/modules/FindLibVNCServer.cmake >--- kdenetwork-4.9.1.org/krdc.org/cmake/modules/FindLibVNCServer.cmake 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/cmake/modules/FindLibVNCServer.cmake 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,41 @@ >+# cmake macro to test LIBVNCSERVER LIB >+ >+# Copyright (c) 2006, Alessandro Praduroux <pradu@pradu.it> >+# Copyright (c) 2007, Urs Wolfer <uwolfer @ kde.org> >+# >+# Redistribution and use is allowed according to the terms of the BSD license. >+# For details see the accompanying COPYING-CMAKE-SCRIPTS file. >+ >+INCLUDE(CheckPointerMember) >+ >+IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES) >+ # Already in cache, be silent >+ SET(LIBVNCSERVER_FIND_QUIETLY TRUE) >+ENDIF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES) >+ >+FIND_PATH(LIBVNCSERVER_INCLUDE_DIR rfb/rfb.h) >+ >+FIND_LIBRARY(LIBVNCSERVER_LIBRARIES NAMES vncserver libvncserver) >+ >+# libvncserver and libvncclient are in the same package, so it does >+# not make sense to add a new cmake script for finding libvncclient. >+# instead just find the libvncclient also in this file. >+FIND_PATH(LIBVNCCLIENT_INCLUDE_DIR rfb/rfbclient.h) >+FIND_LIBRARY(LIBVNCCLIENT_LIBRARIES NAMES vncclient libvncclient) >+ >+IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES) >+ SET(CMAKE_REQUIRED_INCLUDES "${LIBVNCSERVER_INCLUDE_DIR}" "${CMAKE_REQUIRED_INCLUDES}") >+ CHECK_POINTER_MEMBER(rfbClient* GotXCutText rfb/rfbclient.h LIBVNCSERVER_FOUND) >+ENDIF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES) >+ >+IF (LIBVNCSERVER_FOUND) >+ IF (NOT LIBVNCSERVER_FIND_QUIETLY) >+ MESSAGE(STATUS "Found LibVNCServer: ${LIBVNCSERVER_LIBRARIES}") >+ ENDIF (NOT LIBVNCSERVER_FIND_QUIETLY) >+ELSE (LIBVNCSERVER_FOUND) >+ IF (LIBVNCSERVER_FIND_REQUIRED) >+ MESSAGE(FATAL_ERROR "Could NOT find acceptable version of LibVNCServer (version 0.9 or later required).") >+ ENDIF (LIBVNCSERVER_FIND_REQUIRED) >+ENDIF (LIBVNCSERVER_FOUND) >+ >+MARK_AS_ADVANCED(LIBVNCSERVER_INCLUDE_DIR LIBVNCSERVER_LIBRARIES) >diff -urN kdenetwork-4.9.1.org/krdc.org/CMakeLists.txt kdenetwork-4.9.1/krdc.org/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/CMakeLists.txt 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,124 @@ >+ >+project(krdc) >+ >+if(NOT INSIDE_KDENETWORK) >+ message("Not building inside KDENetwork, loading KDE CMake Macros.") >+ >+ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) >+ >+ find_package(KDE4 REQUIRED) >+ >+ include(KDE4Defaults) >+ include(MacroLibrary) >+ >+ include(CheckIncludeFile) >+ include(CheckIncludeFiles) >+ include(CheckSymbolExists) >+ include(CheckFunctionExists) >+ include(CheckLibraryExists) >+ include(CheckPrototypeExists) >+ include(CheckTypeSize) >+ >+ set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS}) >+ if(WIN32) >+ set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES}) >+ set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES}) >+ endif(WIN32) >+ add_definitions(${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS}) >+ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}) >+ >+ # 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") >+ >+ macro_optional_find_package(TelepathyQt4) >+ macro_log_feature(TelepathyQt4_FOUND "telepathy-qt" "Telepathy Qt Bindings" "http://telepathy.freedesktop.org" FALSE "0.9" "Needed to build Telepathy Tubes support.") >+ >+endif(NOT INSIDE_KDENETWORK) >+ >+macro_optional_find_package(LibVNCServer) >+macro_log_feature(LIBVNCSERVER_FOUND "libvncserver" "VNC Server library" "http://libvncserver.sourceforge.net/" FALSE "0.9" "Needed to build Krfb and VNC support in Krdc") >+ >+if(TelepathyQt4_FOUND) >+ add_definitions(-DTELEPATHY_SUPPORT) >+ include_directories(${TELEPATHY_QT4_INCLUDE_DIR}) >+endif() >+ >+include_directories( >+ ${CMAKE_CURRENT_SOURCE_DIR} >+ ${CMAKE_CURRENT_SOURCE_DIR}/core/ >+ ${CMAKE_CURRENT_BINARY_DIR}/core/ >+ ${CMAKE_CURRENT_BINARY_DIR} >+) >+ >+add_subdirectory(core) >+add_subdirectory(vnc) >+add_subdirectory(nx) >+add_subdirectory(rdp) >+add_subdirectory(test) >+ >+if(TelepathyQt4_FOUND) >+ add_subdirectory(krdc_approver) >+endif() >+ >+add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5010) >+add_definitions(-DBUILD_ZEROCONF) >+ >+set(krdc_SRCS >+ config/hostpreferenceslist.cpp >+ config/preferencesdialog.cpp >+ floatingtoolbar.cpp >+ bookmarkmanager.cpp >+ connectiondelegate.cpp >+ remotedesktopsmodel.cpp >+ systemtrayicon.cpp >+ tabbedviewwidget.cpp >+ mainwindow.cpp >+ main.cpp >+) >+ >+if(TelepathyQt4_FOUND) >+ set(krdc_SRCS ${krdc_SRCS} >+ tubesmanager.cpp >+ ) >+endif() >+ >+kde4_add_ui_files(krdc_SRCS >+ config/general.ui >+) >+ >+kde4_add_executable(krdc ${krdc_SRCS}) >+ >+target_link_libraries(krdc >+ ${KDE4_KFILE_LIBS} >+ ${KDE4_KIO_LIBS} >+ ${KDE4_KNOTIFYCONFIG_LIBS} >+ ${KDE4_KCMUTILS_LIBS} >+ krdccore >+) >+ >+if(TelepathyQt4_FOUND) >+ target_link_libraries(krdc >+ ${TELEPATHY_QT4_LIBRARIES} >+ ) >+endif() >+ >+target_link_libraries(krdc ${KDE4_KDNSSD_LIBS}) >+ >+install(TARGETS krdc ${INSTALL_TARGETS_DEFAULT_ARGS}) >+install(FILES krdcui.rc DESTINATION ${DATA_INSTALL_DIR}/krdc) >+install(PROGRAMS krdc.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) >+install(FILES pointcursor.png pointcursormask.png DESTINATION ${DATA_INSTALL_DIR}/krdc/pics) >+ >+if(TelepathyQt4_FOUND) >+ configure_file(org.freedesktop.Telepathy.Client.krdc_rfb_handler.service.in >+ ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service) >+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service >+ DESTINATION ${DBUS_SERVICES_INSTALL_DIR}) >+ >+ install(FILES krdc_rfb_handler.client DESTINATION ${SHARE_INSTALL_PREFIX}/telepathy/clients/) >+endif() >+ >+if(NOT INSIDE_KDENETWORK) >+ macro_display_feature_log() >+endif(NOT INSIDE_KDENETWORK) >diff -urN kdenetwork-4.9.1.org/krdc.org/config/CMakeLists.txt kdenetwork-4.9.1/krdc.org/config/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/config/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/config/CMakeLists.txt 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1 @@ >+install(FILES krdc.kcfg DESTINATION ${KCFG_INSTALL_DIR}) >diff -urN kdenetwork-4.9.1.org/krdc.org/config/general.ui kdenetwork-4.9.1/krdc.org/config/general.ui >--- kdenetwork-4.9.1.org/krdc.org/config/general.ui 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/config/general.ui 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,220 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<ui version="4.0"> >+ <class>General</class> >+ <widget class="QWidget" name="General"> >+ <property name="geometry"> >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>363</width> >+ <height>464</height> >+ </rect> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout_2"> >+ <item> >+ <widget class="QCheckBox" name="kcfg_RememberSessions"> >+ <property name="text"> >+ <string>Remember open sessions for next startup</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_RememberHistory"> >+ <property name="text"> >+ <string>Remember connection history</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_WalletSupport"> >+ <property name="text"> >+ <string>Remember passwords (KWallet)</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_SystemTrayIcon"> >+ <property name="text"> >+ <string>Enable system tray icon</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_ShowStatusBar"> >+ <property name="text"> >+ <string>Show status bar</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_KeepAspectRatio"> >+ <property name="text"> >+ <string>Keep aspect ratio when scaling</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout"> >+ <item> >+ <widget class="QLabel" name="backgroundLabel"> >+ <property name="text"> >+ <string>Background color of empty place:</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <spacer> >+ <property name="orientation"> >+ <enum>Qt::Horizontal</enum> >+ </property> >+ <property name="sizeHint" stdset="0"> >+ <size> >+ <width>40</width> >+ <height>20</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ <item> >+ <widget class="KColorButton" name="kcfg_BackgroundColor"> >+ <property name="sizePolicy"> >+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> >+ <horstretch>0</horstretch> >+ <verstretch>0</verstretch> >+ </sizepolicy> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="connectionGroupBox"> >+ <property name="title"> >+ <string>When Connecting</string> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout_3"> >+ <item> >+ <widget class="QCheckBox" name="kcfg_ShowPreferencesForNewConnections"> >+ <property name="text"> >+ <string>Show the preferences dialog for new connections</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_ResizeOnConnect"> >+ <property name="toolTip"> >+ <string>This option will resize the window to fit the connection size. If it is too big, it will maximize the window.</string> >+ </property> >+ <property name="text"> >+ <string>Resize to fit</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_FullscreenOnConnect"> >+ <property name="toolTip"> >+ <string>This option switches to fullscreen only if the connection resolution is the same as the current screen resolution</string> >+ </property> >+ <property name="text"> >+ <string>Switch to Fullscreen if appropriate</string> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="tabGroupBox"> >+ <property name="title"> >+ <string>Tab Settings</string> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout"> >+ <item> >+ <widget class="QCheckBox" name="kcfg_ShowTabBar"> >+ <property name="text"> >+ <string>Always show tab bar</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_TabCloseButton"> >+ <property name="text"> >+ <string>Show close button on tabs</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_TabMiddleClick"> >+ <property name="text"> >+ <string>Middle-click on a tab closes it</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout" name="horizontalLayout"> >+ <item> >+ <widget class="QLabel" name="tabOrientationLabel"> >+ <property name="text"> >+ <string>Tab position:</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="KComboBox" name="kcfg_TabPosition"> >+ <item> >+ <property name="text"> >+ <string>Top</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Bottom</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Left</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Right</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <spacer> >+ <property name="orientation"> >+ <enum>Qt::Vertical</enum> >+ </property> >+ <property name="sizeHint" stdset="0"> >+ <size> >+ <width>20</width> >+ <height>40</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ </layout> >+ </widget> >+ <customwidgets> >+ <customwidget> >+ <class>KComboBox</class> >+ <extends>QComboBox</extends> >+ <header>kcombobox.h</header> >+ </customwidget> >+ <customwidget> >+ <class>KColorButton</class> >+ <extends>QPushButton</extends> >+ <header>kcolorbutton.h</header> >+ </customwidget> >+ </customwidgets> >+ <resources/> >+ <connections/> >+</ui> >diff -urN kdenetwork-4.9.1.org/krdc.org/config/hostpreferenceslist.cpp kdenetwork-4.9.1/krdc.org/config/hostpreferenceslist.cpp >--- kdenetwork-4.9.1.org/krdc.org/config/hostpreferenceslist.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/config/hostpreferenceslist.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,147 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "hostpreferenceslist.h" >+#include "hostpreferences.h" >+ >+#include <KDebug> >+#include <KIcon> >+#include <KLocale> >+#include <KMessageBox> >+#include <KPushButton> >+#include <KStandardDirs> >+ >+#include <QFile> >+#include <QLayout> >+#include <QListWidget> >+ >+HostPreferencesList::HostPreferencesList(QWidget *parent, MainWindow *mainWindow, KConfigGroup hostPrefsConfig) >+ : QWidget(parent) >+ , m_hostPrefsConfig(hostPrefsConfig) >+ , m_mainWindow(mainWindow) >+{ >+ hostList = new QListWidget(this); >+ connect(hostList, SIGNAL(itemSelectionChanged()), SLOT(selectionChanged())); >+ connect(hostList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), SLOT(configureHost())); >+ >+ configureButton = new KPushButton(this); >+ configureButton->setEnabled(false); >+ configureButton->setText(i18n("Configure...")); >+ configureButton->setIcon(KIcon("configure")); >+ connect(configureButton, SIGNAL(clicked()), SLOT(configureHost())); >+ >+ removeButton = new KPushButton(this); >+ removeButton->setEnabled(false); >+ removeButton->setText(i18n("Remove")); >+ removeButton->setIcon(KIcon("list-remove")); >+ connect(removeButton, SIGNAL(clicked()), SLOT(removeHost())); >+ >+ QVBoxLayout *buttonLayout = new QVBoxLayout; >+ buttonLayout->addWidget(configureButton); >+ buttonLayout->addWidget(removeButton); >+ buttonLayout->addStretch(); >+ >+ QHBoxLayout *mainLayout = new QHBoxLayout(this); >+ mainLayout->addWidget(hostList); >+ mainLayout->addLayout(buttonLayout); >+ >+ setLayout(mainLayout); >+ >+ readConfig(); >+} >+ >+HostPreferencesList::~HostPreferencesList() >+{ >+} >+ >+void HostPreferencesList::readConfig() >+{ >+ QStringList urls = m_hostPrefsConfig.groupList(); >+ >+ for (int i = 0; i < urls.size(); ++i) >+ hostList->addItem(new QListWidgetItem(urls.at(i))); >+} >+ >+void HostPreferencesList::saveSettings() >+{ >+ m_hostPrefsConfig.sync(); >+} >+ >+void HostPreferencesList::configureHost() >+{ >+ QList<QListWidgetItem *> selectedItems = hostList->selectedItems(); >+ >+ foreach(QListWidgetItem *selectedItem, selectedItems) { >+ const QString url = selectedItem->text(); >+ >+ kDebug(5010) << "Configure host: " << url; >+ >+ HostPreferences* prefs = 0; >+ >+ const QList<RemoteViewFactory *> remoteViewFactories(m_mainWindow->remoteViewFactoriesList()); >+ foreach(RemoteViewFactory *factory, remoteViewFactories) { >+ if (factory->supportsUrl(url)) { >+ prefs = factory->createHostPreferences(m_hostPrefsConfig.group(url), this); >+ if (prefs) { >+ kDebug(5010) << "Found plugin to handle url (" + url + "): " + prefs->metaObject()->className(); >+ } else { >+ kDebug(5010) << "Found plugin to handle url (" + url + "), but plugin does not provide preferences"; >+ } >+ } >+ } >+ >+ if (prefs) { >+ prefs->showDialog(this); >+ delete prefs; >+ } else { >+ KMessageBox::error(this, >+ i18n("The selected host cannot be handled."), >+ i18n("Unusable URL")); >+ } >+ } >+} >+ >+void HostPreferencesList::removeHost() >+{ >+ const QList<QListWidgetItem *> selectedItems = hostList->selectedItems(); >+ >+ foreach(QListWidgetItem *selectedItem, selectedItems) { >+ kDebug(5010) << "Remove host: " << selectedItem->text(); >+ >+ m_hostPrefsConfig.deleteGroup(selectedItem->text()); >+ delete(selectedItem); >+ } >+ >+ saveSettings(); >+ hostList->clearSelection(); >+} >+ >+void HostPreferencesList::selectionChanged() >+{ >+ const bool enabled = hostList->selectedItems().isEmpty() ? false : true; >+ >+ configureButton->setEnabled(enabled); >+ removeButton->setEnabled(enabled); >+} >+ >+#include "hostpreferenceslist.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/config/hostpreferenceslist.h kdenetwork-4.9.1/krdc.org/config/hostpreferenceslist.h >--- kdenetwork-4.9.1.org/krdc.org/config/hostpreferenceslist.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/config/hostpreferenceslist.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,62 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 HOSTPREFERENCESLIST_H >+#define HOSTPREFERENCESLIST_H >+ >+#include "mainwindow.h" >+ >+#include <KConfigGroup> >+ >+#include <QDomDocument> >+#include <QWidget> >+ >+class KPushButton; >+ >+class QListWidget; >+ >+class HostPreferencesList : public QWidget >+{ >+ Q_OBJECT >+ >+public: >+ HostPreferencesList(QWidget *parent, MainWindow *mainWindow, KConfigGroup hostPrefsConfig); >+ ~HostPreferencesList(); >+ >+private slots: >+ void readConfig(); >+ void saveSettings(); >+ void configureHost(); >+ void removeHost(); >+ void selectionChanged(); >+ >+private: >+ KConfigGroup m_hostPrefsConfig; >+ >+ KPushButton *configureButton; >+ KPushButton *removeButton; >+ QListWidget *hostList; >+ MainWindow *m_mainWindow; >+}; >+ >+#endif // HOSTPREFERENCESLIST_H >diff -urN kdenetwork-4.9.1.org/krdc.org/config/preferencesdialog.cpp kdenetwork-4.9.1/krdc.org/config/preferencesdialog.cpp >--- kdenetwork-4.9.1.org/krdc.org/config/preferencesdialog.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/config/preferencesdialog.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,83 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 - 2010 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "preferencesdialog.h" >+ >+#include "hostpreferenceslist.h" >+#include "ui_general.h" >+ >+#include <KConfigSkeleton> >+#include <KDebug> >+#include <KPluginSelector> >+#include <KService> >+#include <KServiceTypeTrader> >+#include <KPluginInfo> >+ >+PreferencesDialog::PreferencesDialog(QWidget *parent, KConfigSkeleton *skeleton) >+ : KConfigDialog(parent, "preferences", skeleton) >+ , m_settingsChanged(false) >+{ >+ QWidget *generalPage = new QWidget(this); >+ Ui::General generalUi; >+ generalUi.setupUi(generalPage); >+ addPage(generalPage, i18nc("General Config", "General"), "krdc", i18n("General Configuration")); >+ >+ HostPreferencesList *hostPreferencesList = new HostPreferencesList(this, >+ qobject_cast<MainWindow *>(parent), >+ skeleton->config()->group("hostpreferences")); >+ addPage(hostPreferencesList, i18n("Hosts"), "computer", i18n("Host Configuration")); >+ >+ m_pluginSelector = new KPluginSelector(); >+ KService::List offers = KServiceTypeTrader::self()->query("KRDC/Plugin"); >+ m_pluginSelector->addPlugins(KPluginInfo::fromServices(offers), KPluginSelector::ReadConfigFile, >+ i18n("Plugins"), "Service", KGlobal::config()); >+ m_pluginSelector->load(); >+ addPage(m_pluginSelector, i18n("Plugins"), "preferences-plugin", i18n("Plugin Configuration")); >+ >+ connect(this, SIGNAL(accepted()), SLOT(saveState())); >+ connect(this, SIGNAL(defaultClicked()), SLOT(loadDefaults())); >+ connect(m_pluginSelector, SIGNAL(changed(bool)), SLOT(settingsChanged())); >+} >+ >+void PreferencesDialog::saveState() >+{ >+ //TODO: relaod plugins at runtime? >+ m_pluginSelector->save(); >+} >+ >+void PreferencesDialog::loadDefaults() >+{ >+ m_pluginSelector->defaults(); >+ enableButton(Default, false); >+} >+ >+void PreferencesDialog::settingsChanged() >+{ >+ enableButton(Apply, true); >+ enableButton(Default, true); >+} >+ >+bool PreferencesDialog::isDefault() >+{ >+ return KConfigDialog::isDefault() && m_pluginSelector->isDefault(); >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/config/preferencesdialog.h kdenetwork-4.9.1/krdc.org/config/preferencesdialog.h >--- kdenetwork-4.9.1.org/krdc.org/config/preferencesdialog.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/config/preferencesdialog.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,52 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 PREFERENCESDIALOG_H >+#define PREFERENCESDIALOG_H >+ >+#include <KConfigDialog> >+ >+class KConfigSkeleton; >+class KPluginSelector; >+ >+class PreferencesDialog : public KConfigDialog >+{ >+ Q_OBJECT >+ >+public: >+ PreferencesDialog(QWidget *parent, KConfigSkeleton *config); >+ >+protected: >+ virtual bool isDefault(); >+ >+private slots: >+ void saveState(); >+ void loadDefaults(); >+ void settingsChanged(); >+ >+private: >+ KPluginSelector *m_pluginSelector; >+ bool m_settingsChanged; >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/connectiondelegate.cpp kdenetwork-4.9.1/krdc.org/connectiondelegate.cpp >--- kdenetwork-4.9.1.org/krdc.org/connectiondelegate.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/connectiondelegate.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,89 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Tony Murray <murraytony@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 "connectiondelegate.h" >+#include "remotedesktopsmodel.h" >+ >+#include <KDateTime> >+#include <KDebug> >+#include <KIcon> >+#include <KIconLoader> >+#include <KLocale> >+ >+ConnectionDelegate::ConnectionDelegate(QObject *parent) : >+ QStyledItemDelegate(parent) >+{ >+} >+ >+QString ConnectionDelegate::displayText(const QVariant &value, const QLocale& locale) const >+{ >+ if (value.type() == QVariant::DateTime) { >+ KDateTime lastConnected = KDateTime(value.toDateTime()); >+ KDateTime currentTime = KDateTime::currentUtcDateTime(); >+ >+ int daysAgo = lastConnected.daysTo(currentTime); >+ if (daysAgo <= 1 && lastConnected.secsTo(currentTime) < 86400) { >+ int minutesAgo = lastConnected.secsTo(currentTime) / 60; >+ int hoursAgo = minutesAgo / 60; >+ if (hoursAgo < 1) { >+ if (minutesAgo < 1) >+ return i18n("Less than a minute ago"); >+ return i18np("A minute ago", "%1 minutes ago", minutesAgo); >+ } else { >+ return i18np("An hour ago", "%1 hours ago", hoursAgo); >+ } >+ } else { // 1 day or more >+ if (daysAgo < 30) >+ return i18np("Yesterday", "%1 days ago", daysAgo); >+ if (daysAgo < 365) >+ return i18np("Over a month ago", "%1 months ago", daysAgo / 30); >+ return i18np("A year ago", "%1 years ago", daysAgo / 365); >+ } >+ >+ } >+ // These aren't the strings you're looking for, move along. >+ return QStyledItemDelegate::displayText(value, locale); >+} >+ >+void ConnectionDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const >+{ >+ if (index.column() == RemoteDesktopsModel::Favorite) { >+ QVariant value = index.data(Qt::CheckStateRole); >+ if (value.isValid()) { >+ Qt::CheckState checkState = static_cast<Qt::CheckState>(value.toInt()); >+ KIcon favIcon = KIcon("bookmarks"); >+ KIcon::Mode mode = (checkState == Qt::Checked) ? KIcon::Active : KIcon::Disabled; >+ favIcon.paint(painter, option.rect, option.decorationAlignment, mode); >+ >+ } >+ } else { >+ QStyledItemDelegate::paint(painter, option, index); >+ } >+} >+ >+QSize ConnectionDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const >+{ >+ if (index.column() == RemoteDesktopsModel::Favorite) >+ return QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall); >+ return QStyledItemDelegate::sizeHint(option, index); >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/connectiondelegate.h kdenetwork-4.9.1/krdc.org/connectiondelegate.h >--- kdenetwork-4.9.1.org/krdc.org/connectiondelegate.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/connectiondelegate.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,43 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Tony Murray <murraytony@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 CONNECTIONDELEGATE_H >+#define CONNECTIONDELEGATE_H >+ >+#include <QStyledItemDelegate> >+ >+class ConnectionDelegate : public QStyledItemDelegate >+{ >+ Q_OBJECT >+public: >+ explicit ConnectionDelegate(QObject *parent = 0); >+ QString displayText(const QVariant &value, const QLocale& locale) const; >+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; >+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; >+signals: >+ >+public slots: >+ >+}; >+ >+#endif // CONNECTIONDELEGATE_H >diff -urN kdenetwork-4.9.1.org/krdc.org/core/CMakeLists.txt kdenetwork-4.9.1/krdc.org/core/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/core/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/CMakeLists.txt 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,29 @@ >+ >+add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5010) >+ >+set(krdccore_SRCS >+ remoteviewfactory.cpp >+ remoteview.cpp >+ hostpreferences.cpp >+) >+ >+kde4_add_kcfg_files(krdccore_SRCS settings.kcfgc) >+ >+kde4_add_library(krdccore SHARED ${krdccore_SRCS}) >+ >+target_link_libraries(krdccore ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS}) >+ >+set_target_properties(krdccore PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}) >+ >+install(TARGETS krdccore ${INSTALL_TARGETS_DEFAULT_ARGS}) >+ >+# Install headers >+set(krdccore_HDRS >+ remoteviewfactory.h >+ remoteview.h >+ hostpreferences.h >+) >+ >+install(FILES ${krdccore_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/krdc COMPONENT Devel) >+install(FILES krdc_plugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) >+install(FILES krdc.kcfg DESTINATION ${KCFG_INSTALL_DIR}) >diff -urN kdenetwork-4.9.1.org/krdc.org/core/hostpreferences.cpp kdenetwork-4.9.1/krdc.org/core/hostpreferences.cpp >--- kdenetwork-4.9.1.org/krdc.org/core/hostpreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/hostpreferences.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,239 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 - 2010 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "hostpreferences.h" >+ >+#include "settings.h" >+ >+#include <KDebug> >+#include <KLocale> >+#include <KStandardDirs> >+#include <KTitleWidget> >+ >+#include <QCheckBox> >+#include <QFile> >+#include <QVBoxLayout> >+ >+HostPreferences::HostPreferences(KConfigGroup configGroup, QObject *parent) >+ : QObject(parent), >+ m_configGroup(configGroup), >+ m_connected(false), >+ showAgainCheckBox(0), >+ walletSupportCheckBox(0) >+{ >+ m_hostConfigured = m_configGroup.hasKey("showConfigAgain"); >+} >+ >+HostPreferences::~HostPreferences() >+{ >+} >+ >+KConfigGroup HostPreferences::configGroup() >+{ >+ return m_configGroup; >+} >+ >+void HostPreferences::acceptConfig() >+{ >+ setShowConfigAgain(showAgainCheckBox->isChecked()); >+ setWalletSupport(walletSupportCheckBox->isChecked()); >+} >+ >+bool HostPreferences::hostConfigured() >+{ >+ return m_hostConfigured; >+} >+ >+void HostPreferences::setShowConfigAgain(bool show) >+{ >+ m_configGroup.writeEntry("showConfigAgain", show); >+} >+ >+bool HostPreferences::showConfigAgain() >+{ >+ return m_configGroup.readEntry("showConfigAgain", true); >+} >+ >+void HostPreferences::setWalletSupport(bool walletSupport) >+{ >+ m_configGroup.writeEntry("walletSupport", walletSupport); >+} >+ >+bool HostPreferences::walletSupport() >+{ >+ return m_configGroup.readEntry("walletSupport", true); >+} >+ >+void HostPreferences::setHeight(int height) >+{ >+ if (height >= 0) >+ m_configGroup.writeEntry("height", height); >+} >+ >+int HostPreferences::height() >+{ >+ return m_configGroup.readEntry("height", Settings::height()); >+} >+ >+void HostPreferences::setWidth(int width) >+{ >+ if (width >= 0) >+ m_configGroup.writeEntry("width", width); >+} >+ >+int HostPreferences::width() >+{ >+ return m_configGroup.readEntry("width", Settings::width()); >+} >+ >+bool HostPreferences::fullscreenScale() >+{ >+ return m_configGroup.readEntry("fullscreenScale", false); >+} >+ >+void HostPreferences::setFullscreenScale(bool scale) >+{ >+ m_configGroup.writeEntry("fullscreenScale", scale); >+} >+ >+bool HostPreferences::windowedScale() >+{ >+ return m_configGroup.readEntry("windowedScale", false); >+} >+ >+void HostPreferences::setWindowedScale(bool scale) >+{ >+ m_configGroup.writeEntry("windowedScale", scale); >+} >+ >+bool HostPreferences::grabAllKeys() >+{ >+ return m_configGroup.readEntry("grabAllKeys", false); >+} >+ >+void HostPreferences::setGrabAllKeys(bool grab) >+{ >+ m_configGroup.writeEntry("grabAllKeys", grab); >+} >+ >+bool HostPreferences::showLocalCursor() >+{ >+ return m_configGroup.readEntry("showLocalCursor", false); >+} >+ >+void HostPreferences::setShowLocalCursor(bool show) >+{ >+ m_configGroup.writeEntry("showLocalCursor", show); >+} >+ >+bool HostPreferences::viewOnly() >+{ >+ return m_configGroup.readEntry("viewOnly", false); >+} >+ >+void HostPreferences::setViewOnly(bool view) >+{ >+ m_configGroup.writeEntry("viewOnly", view); >+} >+ >+bool HostPreferences::showDialogIfNeeded(QWidget *parent) >+{ >+ if (hostConfigured()) { >+ if (showConfigAgain()) { >+ kDebug(5010) << "Show config dialog again"; >+ return showDialog(parent); >+ } else >+ return true; // no changes, no need to save >+ } else { >+ kDebug(5010) << "No config found, create new"; >+ if (Settings::showPreferencesForNewConnections()) >+ return showDialog(parent); >+ else >+ return true; >+ } >+} >+ >+ >+bool HostPreferences::showDialog(QWidget *parent) >+{ >+ // Prepare dialog >+ KDialog *dialog = new KDialog(parent); >+ dialog->setCaption(i18n("Host Configuration")); >+ >+ QWidget *mainWidget = dialog->mainWidget(); >+ QVBoxLayout *layout = new QVBoxLayout(mainWidget); >+ >+ KTitleWidget *titleWidget = new KTitleWidget(dialog); >+ titleWidget->setText(i18n("Host Configuration")); >+ if (m_connected) { >+ titleWidget->setComment(QString("<i>%1</i>").arg( >+ i18n("Note that settings might only apply when you connect next time to this host."))); >+ } >+ titleWidget->setPixmap(KIcon("krdc")); >+ layout->addWidget(titleWidget); >+ >+ QWidget* widget = createProtocolSpecificConfigPage(); >+ >+ if (widget) { >+ if (widget->layout()) >+ widget->layout()->setMargin(0); >+ >+ layout->addWidget(widget); >+ } >+ >+ showAgainCheckBox = new QCheckBox(mainWidget); >+ showAgainCheckBox->setText(i18n("Show this dialog again for this host")); >+ showAgainCheckBox->setChecked(showConfigAgain()); >+ >+ walletSupportCheckBox = new QCheckBox(mainWidget); >+ walletSupportCheckBox->setText(i18n("Remember password (KWallet)")); >+ walletSupportCheckBox->setChecked(walletSupport()); >+ >+ layout->addWidget(showAgainCheckBox); >+ layout->addWidget(walletSupportCheckBox); >+ layout->addStretch(1); >+ >+ // WORKAROUND: it seems that KDialog does not set the minimum size properly in some cases. >+ // see for example issue #244539. also it looks like KTitleWidget returns a too small size hint when a comment is shown. >+ QSize minimumSize = dialog->sizeHint(); >+ if (m_connected) { >+ minimumSize += QSize(0, 50); >+ } >+ dialog->setMinimumSize(minimumSize); >+ >+ // Show dialog >+ if (dialog->exec() == KDialog::Accepted) { >+ kDebug(5010) << "HostPreferences config dialog accepted"; >+ acceptConfig(); >+ return true; >+ } else { >+ return false; >+ } >+} >+ >+void HostPreferences::setShownWhileConnected(bool connected) >+{ >+ m_connected = connected; >+} >+ >+#include "hostpreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/core/hostpreferences.h kdenetwork-4.9.1/krdc.org/core/hostpreferences.h >--- kdenetwork-4.9.1.org/krdc.org/core/hostpreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/hostpreferences.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,114 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 HOSTPREFERENCES_H >+#define HOSTPREFERENCES_H >+ >+#include "remoteview.h" >+ >+#include <kdemacros.h> >+ >+#include <KDialog> >+ >+#include <QDomDocument> >+ >+#include <QSize> >+ >+class QCheckBox; >+class QWidget; >+class KConfig; >+class KConfigGroup; >+ >+class KRDCCORE_EXPORT HostPreferences : public QObject >+{ >+ Q_OBJECT >+ >+public: >+ ~HostPreferences(); >+ >+ KConfigGroup configGroup(); >+ >+ bool walletSupport(); >+ >+ /** Whether scaling is enabled when session is full screen. Note: only windowedScale seems to be used. */ >+ bool fullscreenScale(); >+ void setFullscreenScale(bool scale); >+ >+ /** Whether scaling is enabled when session is not full screen */ >+ bool windowedScale(); >+ void setWindowedScale(bool scale); >+ >+ bool grabAllKeys(); >+ void setGrabAllKeys(bool grab); >+ >+ bool showLocalCursor(); >+ void setShowLocalCursor(bool show); >+ >+ bool viewOnly(); >+ void setViewOnly(bool view); >+ >+ /** Saved height. Generally used for the viewsize. */ >+ int height(); >+ void setHeight(int height); >+ /** Saved width. Generally used for the viewsize. */ >+ int width(); >+ void setWidth(int width); >+ >+ /** >+ * Show the configuration dialog if needed, ie. if the user did >+ * check "show this dialog again for this host". >+ * Returns true if user pressed ok. >+ */ >+ bool showDialogIfNeeded(QWidget *parent); >+ >+ /** Show the configuration dialog */ >+ bool showDialog(QWidget *parent); >+ >+ /** If @p connected is true, a message is shown that settings might only apply after a reconnect. */ >+ void setShownWhileConnected(bool connected); >+ >+protected: >+ HostPreferences(KConfigGroup configGroup, QObject *parent); >+ >+ virtual QWidget* createProtocolSpecificConfigPage() = 0; >+ >+ /** Called when the user validates the config dialog. */ >+ virtual void acceptConfig(); >+ >+ bool hostConfigured(); >+ bool showConfigAgain(); >+ >+ KConfigGroup m_configGroup; >+ >+private: >+ void setShowConfigAgain(bool show); >+ void setWalletSupport(bool walletSupport); >+ >+ bool m_hostConfigured; >+ bool m_connected; >+ >+ QCheckBox *showAgainCheckBox; >+ QCheckBox *walletSupportCheckBox; >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/core/krdc_export.h kdenetwork-4.9.1/krdc.org/core/krdc_export.h >--- kdenetwork-4.9.1.org/krdc.org/core/krdc_export.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/krdc_export.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,39 @@ >+/* This file is part of the KDE project >+ Copyright (C) 2006 David Faure <faure@kde.org> >+ >+ This library is free software; you can redistribute it and/or >+ modify it under the terms of the GNU Library General Public >+ License as published by the Free Software Foundation; either >+ version 2 of the License, or (at your option) any later version. >+ >+ This library 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 >+ Library General Public License for more details. >+ >+ You should have received a copy of the GNU Library General Public License >+ along with this library; see the file COPYING.LIB. If not, write to >+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ Boston, MA 02110-1301, USA. >+*/ >+ >+#ifndef KRDCCORE_EXPORT_H >+#define KRDCCORE_EXPORT_H >+ >+/* needed for KDE_EXPORT and KDE_IMPORT macros */ >+#include <kdemacros.h> >+ >+#ifndef KRDCCORE_EXPORT >+# if defined(MAKE_KRDCCORE_LIB) >+ /* We are building this library */ >+# define KRDCCORE_EXPORT KDE_EXPORT >+# define KRDCCORE_TEST_EXPORT KDE_EXPORT >+# else >+ /* We are using this library */ >+# define KRDCCORE_EXPORT KDE_IMPORT >+# define KRDCCORE_TEST_EXPORT KDE_IMPORT >+# endif >+#endif >+ >+#endif >+ >diff -urN kdenetwork-4.9.1.org/krdc.org/core/krdc.kcfg kdenetwork-4.9.1/krdc.org/core/krdc.kcfg >--- kdenetwork-4.9.1.org/krdc.org/core/krdc.kcfg 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/krdc.kcfg 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,121 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd"> >+<kcfg> >+ <kcfgfile name="krdcrc"/> >+ <group name="General"> >+ <entry name="RememberSessions" type="Bool"> >+ <default>false</default> >+ </entry> >+ <entry name="RememberHistory" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="OpenSessions" type="StringList" key="Items"> >+ <label>Sessions</label> >+ </entry> >+ <entry name="NormalUrlInputLine" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="ShowPreferencesForNewConnections" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="ResizeOnConnect" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="FullscreenOnConnect" type="Bool"> >+ <default>false</default> >+ </entry> >+ <entry name="BackgroundColor" type="Color"> >+ <default>#00417F</default> >+ </entry> >+ <entry name="WalletSupport" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="SystemTrayIcon" type="Bool"> >+ <default>false</default> >+ </entry> >+ <entry name="KeepAspectRatio" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="TabCloseButton" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="TabMiddleClick" type="Bool"> >+ <default>true</default> >+ </entry> >+ <entry name="TabPosition" type="Int"> >+ <default>0</default> >+ </entry> >+ <entry name="ShowTabBar" type="Bool"> >+ <default>false</default> >+ </entry> >+ <entry name="ShowStatusBar" type="Bool"> >+ <default>false</default> >+ </entry> >+ <entry name="ConnectionListSortColumn" type="Int"> >+ <default>2</default> >+ </entry> >+ <entry name="ConnectionListSortOrder" type="Int"> >+ <default>1</default> >+ </entry> >+ </group> >+ <group name="VNC"> >+ <entry name="Quality" type="Int"> >+ <default>1</default> >+ </entry> >+ <entry name="Scaling" type="Bool"> >+ <default>false</default> >+ </entry> >+ <entry name="ScalingWidth" type="Int"> >+ <default>800</default> >+ </entry> >+ <entry name="ScalingHeight" type="Int"> >+ <default>600</default> >+ </entry> >+ </group> >+ <group name="RDP"> >+ <entry name="Width" type="Int"> >+ <default>800</default> >+ </entry> >+ <entry name="Height" type="Int"> >+ <default>600</default> >+ </entry> >+ <entry name="KeyboardLayout" type="Int"> >+ <default>7</default> >+ </entry> >+ <entry name="ColorDepth" type="Int"> >+ <default>0</default> >+ </entry> >+ <entry name="Sound" type="Int"> >+ <default>0</default> >+ </entry> >+ <entry name="Console" type="Bool"> >+ <default>false</default> >+ </entry> >+ <entry name="ExtraOptions" type="String"> >+ <default></default> >+ </entry> >+ <entry name="DefaultRdpUserName" type="String"> >+ <default></default> >+ </entry> >+ <entry name="RecognizeLdapLogins" type="Bool"> >+ <default>true</default> >+ </entry> >+ </group> >+ <group name="NX"> >+ <entry name="NxWidth" type="Int"> >+ <default>800</default> >+ </entry> >+ <entry name="NxHeight" type="Int"> >+ <default>600</default> >+ </entry> >+ <entry name="NxDesktopType" type="Int"> >+ <default>0</default> >+ </entry> >+ <entry name="NxKeyboardLayout" type="Int"> >+ <default>7</default> >+ </entry> >+ <entry name="NxPrivateKey" type="String"> >+ <default>default</default> >+ </entry> >+ </group> >+</kcfg> >diff -urN kdenetwork-4.9.1.org/krdc.org/core/krdc_plugin.desktop kdenetwork-4.9.1/krdc.org/core/krdc_plugin.desktop >--- kdenetwork-4.9.1.org/krdc.org/core/krdc_plugin.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/krdc_plugin.desktop 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,60 @@ >+[Desktop Entry] >+Type=ServiceType >+X-KDE-ServiceType=KRDC/Plugin >+Name=KRDC Plugin >+Name[ast]=Complemente KRDC >+Name[bg]=ÐÑиÑÑавка KRDC >+Name[bs]=KRDC Dodatak >+Name[ca]=Connector del KRDC >+Name[ca@valencia]=Connector del KRDC >+Name[cs]=Modul KRDC >+Name[da]=KRDC-plugin >+Name[de]=KRDC-Modul >+Name[el]=Î ÏÏÏθεÏο KRDC >+Name[en_GB]=KRDC Plugin >+Name[es]=Complemento de KRDC >+Name[et]=KRDC plugin >+Name[eu]=KRDC plugina >+Name[fi]=Kopete-liitännäinen >+Name[fr]=Module KRDC >+Name[ga]=Breiseán KRDC >+Name[gl]=Engadido KRDC >+Name[hr]=PrikljuÄak KRDC >+Name[hu]=KRDC-bÅvÃtmény >+Name[ia]=Plug-in de KRDC >+Name[it]=Estensione di KRDC >+Name[ja]=KRDC ãã©ã°ã¤ã³ >+Name[kk]=KRDC Ð¿Ð»Ð°Ð³Ð¸Ð½Ñ >+Name[km]=áááááá·áá¸âáááá½á KRDC >+Name[ko]=KRDC íë¬ê·¸ì¸ >+Name[lt]=KRDC priedas >+Name[lv]=KRDC spraudnis >+Name[nb]=KRDC programtillegg >+Name[nds]=KRDC-Moduul >+Name[nl]=KRDC-plugin >+Name[nn]=KRDC-programtillegg >+Name[pa]=KRDC ਪਲੱà¨à¨à¨¨ >+Name[pl]=Wtyczka KRDC >+Name[pt]='Plugin' do KRDC >+Name[pt_BR]=Plugin KRDC >+Name[ro]=Modul KRDC >+Name[ru]=ÐодÑÐ»Ñ KRDC >+Name[si]=KRDC à¶´à·à¶½à¶à·à¶±à¶º >+Name[sk]=Modul KRDC >+Name[sl]=Vstavek za KRDC >+Name[sr]=ÐÑикÑÑÑак ÐÐ ÐЦâа >+Name[sr@ijekavian]=ÐÑикÑÑÑак ÐÐ ÐЦâа >+Name[sr@ijekavianlatin]=PrikljuÄak KRDCâa >+Name[sr@latin]=PrikljuÄak KRDCâa >+Name[sv]=Insticksprogram för KRDC >+Name[th]=สà¹à¸§à¸à¹à¸ªà¸£à¸´à¸¡à¸à¸à¸ KRDC >+Name[tr]=KRDC Eklentisi >+Name[uk]=ÐодаÑок KRDC >+Name[x-test]=xxKRDC Pluginxx >+Name[zh_CN]=KRDC æä»¶ >+Name[zh_TW]=KRDC 夿ç¨å¼ >+ >+# Sorting of the plugin. >+# 0 is the highest value. >+[PropertyDef::X-KDE-KRDC-Sorting] >+Type=int >diff -urN kdenetwork-4.9.1.org/krdc.org/core/remoteview.cpp kdenetwork-4.9.1/krdc.org/core/remoteview.cpp >--- kdenetwork-4.9.1.org/krdc.org/core/remoteview.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/remoteview.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,283 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2002-2003 Tim Jansen <tim@tjansen.de> >+** Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "remoteview.h" >+ >+#ifndef QTONLY >+ #include <KDebug> >+ #include <KStandardDirs> >+#endif >+ >+#include <QBitmap> >+ >+RemoteView::RemoteView(QWidget *parent) >+ : QWidget(parent), >+ m_status(Disconnected), >+ m_host(QString()), >+ m_port(0), >+ m_viewOnly(false), >+ m_grabAllKeys(false), >+ m_scale(false), >+ m_keyboardIsGrabbed(false), >+#ifndef QTONLY >+ m_wallet(0), >+#endif >+ m_dotCursorState(CursorOff) >+{ >+} >+ >+RemoteView::~RemoteView() >+{ >+#ifndef QTONLY >+ delete m_wallet; >+#endif >+} >+ >+RemoteView::RemoteStatus RemoteView::status() >+{ >+ return m_status; >+} >+ >+void RemoteView::setStatus(RemoteView::RemoteStatus s) >+{ >+ if (m_status == s) >+ return; >+ >+ if (((1+ m_status) != s) && (s != Disconnected)) { >+ // follow state transition rules >+ >+ if (s == Disconnecting) { >+ if (m_status == Disconnected) >+ return; >+ } else { >+ Q_ASSERT(((int) s) >= 0); >+ if (m_status > s) { >+ m_status = Disconnected; >+ emit statusChanged(Disconnected); >+ } >+ // smooth state transition >+ RemoteStatus origState = m_status; >+ for (int i = origState; i < s; ++i) { >+ m_status = (RemoteStatus) i; >+ emit statusChanged((RemoteStatus) i); >+ } >+ } >+ } >+ m_status = s; >+ emit statusChanged(m_status); >+} >+ >+bool RemoteView::supportsScaling() const >+{ >+ return false; >+} >+ >+bool RemoteView::supportsLocalCursor() const >+{ >+ return false; >+} >+ >+QString RemoteView::host() >+{ >+ return m_host; >+} >+ >+QSize RemoteView::framebufferSize() >+{ >+ return QSize(0, 0); >+} >+ >+void RemoteView::startQuitting() >+{ >+} >+ >+bool RemoteView::isQuitting() >+{ >+ return false; >+} >+ >+int RemoteView::port() >+{ >+ return m_port; >+} >+ >+void RemoteView::updateConfiguration() >+{ >+} >+ >+void RemoteView::keyEvent(QKeyEvent *) >+{ >+} >+ >+bool RemoteView::viewOnly() >+{ >+ return m_viewOnly; >+} >+ >+void RemoteView::setViewOnly(bool viewOnly) >+{ >+ m_viewOnly = viewOnly; >+} >+ >+bool RemoteView::grabAllKeys() >+{ >+ return m_grabAllKeys; >+} >+ >+void RemoteView::setGrabAllKeys(bool grabAllKeys) >+{ >+ m_grabAllKeys = grabAllKeys; >+ >+ if (grabAllKeys) { >+ m_keyboardIsGrabbed = true; >+ grabKeyboard(); >+ } else if (m_keyboardIsGrabbed) { >+ releaseKeyboard(); >+ } >+} >+ >+QPixmap RemoteView::takeScreenshot() >+{ >+ return QPixmap::grabWidget(this); >+} >+ >+void RemoteView::showDotCursor(DotCursorState state) >+{ >+ m_dotCursorState = state; >+} >+ >+RemoteView::DotCursorState RemoteView::dotCursorState() const >+{ >+ return m_dotCursorState; >+} >+ >+bool RemoteView::scaling() const >+{ >+ return m_scale; >+} >+ >+void RemoteView::enableScaling(bool scale) >+{ >+ m_scale = scale; >+} >+ >+void RemoteView::switchFullscreen(bool) >+{ >+} >+ >+void RemoteView::scaleResize(int, int) >+{ >+} >+ >+KUrl RemoteView::url() >+{ >+ return m_url; >+} >+ >+#ifndef QTONLY >+QString RemoteView::readWalletPassword(bool fromUserNameOnly) >+{ >+ const QString KRDCFOLDER = "KRDC"; >+ >+ window()->setDisabled(true); // WORKAROUND: disable inputs so users cannot close the current tab (see #181230) >+ m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), window()->winId()); >+ window()->setDisabled(false); >+ >+ if (m_wallet) { >+ bool walletOK = m_wallet->hasFolder(KRDCFOLDER); >+ if (!walletOK) { >+ walletOK = m_wallet->createFolder(KRDCFOLDER); >+ kDebug(5010) << "Wallet folder created"; >+ } >+ if (walletOK) { >+ kDebug(5010) << "Wallet OK"; >+ m_wallet->setFolder(KRDCFOLDER); >+ QString password; >+ >+ QString key; >+ if (fromUserNameOnly) >+ key = m_url.userName(); >+ else >+ key = m_url.prettyUrl(KUrl::RemoveTrailingSlash); >+ >+ if (m_wallet->hasEntry(key) && >+ !m_wallet->readPassword(key, password)) { >+ kDebug(5010) << "Password read OK"; >+ >+ return password; >+ } >+ } >+ } >+ return QString(); >+} >+ >+void RemoteView::saveWalletPassword(const QString &password, bool fromUserNameOnly) >+{ >+ QString key; >+ if (fromUserNameOnly) >+ key = m_url.userName(); >+ else >+ key = m_url.prettyUrl(KUrl::RemoveTrailingSlash); >+ >+ if (m_wallet && m_wallet->isOpen()) { >+ kDebug(5010) << "Write wallet password"; >+ m_wallet->writePassword(key, password); >+ } >+} >+#endif >+ >+QCursor RemoteView::localDotCursor() const >+{ >+#ifdef QTONLY >+ return QCursor(); //TODO >+#else >+ QBitmap cursorBitmap(KGlobal::dirs()->findResource("appdata", >+ "pics/pointcursor.png")); >+ QBitmap cursorMask(KGlobal::dirs()->findResource("appdata", >+ "pics/pointcursormask.png")); >+ return QCursor(cursorBitmap, cursorMask); >+#endif >+} >+ >+void RemoteView::focusInEvent(QFocusEvent *event) >+{ >+ if (m_grabAllKeys) { >+ m_keyboardIsGrabbed = true; >+ grabKeyboard(); >+ } >+ >+ QWidget::focusInEvent(event); >+} >+ >+void RemoteView::focusOutEvent(QFocusEvent *event) >+{ >+ if (m_grabAllKeys || m_keyboardIsGrabbed) { >+ m_keyboardIsGrabbed = false; >+ releaseKeyboard(); >+ } >+ >+ QWidget::focusOutEvent(event); >+} >+ >+#include "moc_remoteview.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/core/remoteviewfactory.cpp kdenetwork-4.9.1/krdc.org/core/remoteviewfactory.cpp >--- kdenetwork-4.9.1.org/krdc.org/core/remoteviewfactory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/remoteviewfactory.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,37 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "remoteviewfactory.h" >+ >+#include <KDebug> >+ >+RemoteViewFactory::RemoteViewFactory(QObject *parent) >+ : QObject(parent) >+{ >+} >+ >+RemoteViewFactory::~RemoteViewFactory() >+{ >+} >+ >+#include "moc_remoteviewfactory.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/core/remoteviewfactory.h kdenetwork-4.9.1/krdc.org/core/remoteviewfactory.h >--- kdenetwork-4.9.1.org/krdc.org/core/remoteviewfactory.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/remoteviewfactory.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,107 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 REMOTEVIEWFACTORY_H >+#define REMOTEVIEWFACTORY_H >+ >+#include "remoteview.h" >+ >+#include <kdemacros.h> >+#include <KPluginFactory> >+#include <KPluginLoader> >+ >+class KUrl; >+ >+/** >+ * Convenience macros to export a KRDC plugin. Suppose you created the plugin >+ * FooRemoteViewFactory. In FooRemoteViewFactory you will have to put the following line: >+ * >+ * @code >+ * KRDC_PLUGIN_EXPORT(FooRemoteViewFactory) >+ * @endcode >+ * >+ * The rest will be done for you. >+ */ >+#define KRDC_PLUGIN_EXPORT( c ) \ >+ K_PLUGIN_FACTORY( KrdcFactory, registerPlugin< c >(); ) \ >+ K_EXPORT_PLUGIN( KrdcFactory("c") ) >+ >+/** >+ * Factory to be implemented by any plugin. >+ */ >+class KRDCCORE_EXPORT RemoteViewFactory : public QObject >+{ >+ Q_OBJECT >+ >+public: >+ /** >+ * Deconstructor. >+ */ >+ virtual ~RemoteViewFactory(); >+ >+ /** >+ * Returns true if the provided @p url is supported by the current plugin. >+ */ >+ virtual bool supportsUrl(const KUrl &url) const = 0; >+ >+ /** >+ * Returns a new RemoteView implementing object. >+ */ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) = 0; >+ >+ /** >+ * Returns a new HostPreferences implementing object or 0 if no settings are available. >+ */ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent) = 0; >+ >+ /** >+ * Returns the supported scheme. >+ * @see KUrl::scheme() >+ */ >+ virtual QString scheme() const = 0; >+ >+ /** >+ * Returns the text of the action in the file menu (by default). >+ */ >+ virtual QString connectActionText() const = 0; >+ >+ /** >+ * Returns the text of the connect button on the startscreen. >+ */ >+ virtual QString connectButtonText() const = 0; >+ >+ /** >+ * Returns the tooltip next to the url navigator when the user presses >+ * the connect action. >+ */ >+ virtual QString connectToolTipText() const = 0; >+ >+protected: >+ /** >+ * Protected constructor so it cannot be instantiated. >+ */ >+ RemoteViewFactory(QObject *parent = 0); >+ >+}; >+ >+#endif // REMOTEVIEWFACTORY_H >diff -urN kdenetwork-4.9.1.org/krdc.org/core/remoteview.h kdenetwork-4.9.1/krdc.org/core/remoteview.h >--- kdenetwork-4.9.1.org/krdc.org/core/remoteview.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/remoteview.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,415 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2002-2003 Tim Jansen <tim@tjansen.de> >+** Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 REMOTEVIEW_H >+#define REMOTEVIEW_H >+ >+#ifdef QTONLY >+ #include <QUrl> >+ #define KUrl QUrl >+ #define KRDCCORE_EXPORT >+#else >+ #include <KUrl> >+ #include <KWallet/Wallet> >+ #include <krdc_export.h> >+#endif >+ >+#include <QWidget> >+ >+class HostPreferences; >+ >+/** >+ * Generic widget that displays a remote framebuffer. >+ * Implement this if you want to add another backend. >+ * >+ * Things to take care of: >+ * @li The RemoteView is responsible for its size. In >+ * non-scaling mode, set the fixed size of the widget >+ * to the remote resolution. In scaling mode, set the >+ * maximum size to the remote size and minimum size to the >+ * smallest resolution that your scaler can handle. >+ * @li if you override mouseMoveEvent() >+ * you must ignore the QEvent, because the KRDC widget will >+ * need it for stuff like toolbar auto-hide and bump >+ * scrolling. If you use x11Event(), make sure that >+ * MotionNotify events will be forwarded. >+ * >+ */ >+class KRDCCORE_EXPORT RemoteView : public QWidget >+{ >+ Q_OBJECT >+ >+public: >+ >+ Q_ENUMS(Quality) >+ >+ enum Quality { >+ Unknown, >+ High, >+ Medium, >+ Low >+ }; >+ >+ /** >+ * Describes the state of a local cursor, if there is such a concept in the backend. >+ * With local cursors, there are two cursors: the cursor on the local machine (client), >+ * and the cursor on the remote machine (server). Because there is usually some lag, >+ * some backends show both cursors simultanously. In the VNC backend the local cursor >+ * is a dot and the remote cursor is the 'real' cursor, usually an arrow. >+ */ >+ >+ Q_ENUMS(DotCursorState) >+ >+ enum DotCursorState { >+ CursorOn, ///< Always show local cursor (and the remote one). >+ CursorOff, ///< Never show local cursor, only the remote one. >+ /// Try to measure the lag and enable the local cursor if the latency is too high. >+ CursorAuto >+ }; >+ >+ /** >+ * State of the connection. The state of the connection is returned >+ * by @ref RemoteView::status(). >+ * >+ * Not every state transition is allowed. You are only allowed to transition >+ * a state to the following state, with three exceptions: >+ * @li You can move from every state directly to Disconnected >+ * @li You can move from every state except Disconnected to >+ * Disconnecting >+ * @li You can move from Disconnected to Connecting >+ * >+ * @ref RemoteView::setStatus() will follow this rules for you. >+ * (If you add/remove a state here, you must adapt it) >+ */ >+ >+ Q_ENUMS(RemoteStatus) >+ >+ enum RemoteStatus { >+ Connecting = 0, >+ Authenticating = 1, >+ Preparing = 2, >+ Connected = 3, >+ Disconnecting = -1, >+ Disconnected = -2 >+ }; >+ >+ Q_ENUMS(ErrorCode) >+ >+ enum ErrorCode { >+ None = 0, >+ Internal, >+ Connection, >+ Protocol, >+ IO, >+ Name, >+ NoServer, >+ ServerBlocked, >+ Authentication >+ }; >+ >+ virtual ~RemoteView(); >+ >+ /** >+ * Checks whether the backend supports scaling. The >+ * default implementation returns false. >+ * @return true if scaling is supported >+ * @see scaling() >+ */ >+ virtual bool supportsScaling() const; >+ >+ /** >+ * Checks whether the widget is in scale mode. The >+ * default implementation always returns false. >+ * @return true if scaling is activated. Must always be >+ * false if @ref supportsScaling() returns false >+ * @see supportsScaling() >+ */ >+ virtual bool scaling() const; >+ >+ /** >+ * Checks whether the backend supports the concept of local cursors. The >+ * default implementation returns false. >+ * @return true if local cursors are supported/known >+ * @see DotCursorState >+ * @see showDotCursor() >+ * @see dotCursorState() >+ */ >+ virtual bool supportsLocalCursor() const; >+ >+ /** >+ * Sets the state of the dot cursor, if supported by the backend. >+ * The default implementation does nothing. >+ * @param state the new state (CursorOn, CursorOff or >+ * CursorAuto) >+ * @see dotCursorState() >+ * @see supportsLocalCursor() >+ */ >+ virtual void showDotCursor(DotCursorState state); >+ >+ /** >+ * Returns the state of the local cursor. The default implementation returns >+ * always CursorOff. >+ * @return true if local cursors are supported/known >+ * @see showDotCursor() >+ * @see supportsLocalCursor() >+ */ >+ virtual DotCursorState dotCursorState() const; >+ >+ /** >+ * Checks whether the view is in view-only mode. This means >+ * that all input is ignored. >+ */ >+ virtual bool viewOnly(); >+ >+ /** >+ * Checks whether grabbing all possible keys is enabled. >+ */ >+ virtual bool grabAllKeys(); >+ >+ /** >+ * Returns the resolution of the remote framebuffer. >+ * It should return a null @ref QSize when the size >+ * is not known. >+ * The backend must also emit a @ref framebufferSizeChanged() >+ * when the size of the framebuffer becomes available >+ * for the first time or the size changed. >+ * @return the remote framebuffer size, a null QSize >+ * if unknown >+ */ >+ virtual QSize framebufferSize(); >+ >+ /** >+ * Initiate the disconnection. This doesn't need to happen >+ * immediately. The call must not block. >+ * @see isQuitting() >+ */ >+ virtual void startQuitting(); >+ >+ /** >+ * Checks whether the view is currently quitting. >+ * @return true if it is quitting >+ * @see startQuitting() >+ * @see setStatus() >+ */ >+ virtual bool isQuitting(); >+ >+ /** >+ * @return the host the view is connected to >+ */ >+ virtual QString host(); >+ >+ /** >+ * @return the port the view is connected to >+ */ >+ virtual int port(); >+ >+ /** >+ * Initialize the view (for example by showing configuration >+ * dialogs to the user) and start connecting. Should not block >+ * without running the event loop (so displaying a dialog is ok). >+ * When the view starts connecting the application must call >+ * @ref setStatus() with the status Connecting. >+ * @return true if successful (so far), false >+ * otherwise >+ * @see connected() >+ * @see disconnected() >+ * @see disconnectedError() >+ * @see statusChanged() >+ */ >+ virtual bool start() = 0; >+ >+ /** >+ * Called when the configuration is changed. >+ * The default implementation does nothing. >+ */ >+ virtual void updateConfiguration(); >+ >+ /** >+ * @return screenshot of the view >+ */ >+ virtual QPixmap takeScreenshot(); >+ >+#ifndef QTONLY >+ /** >+ * Returns the current host preferences of this view. >+ */ >+ virtual HostPreferences* hostPreferences() = 0; >+#endif >+ >+ /** >+ * Returns the current status of the connection. >+ * @return the status of the connection >+ * @see setStatus() >+ */ >+ RemoteStatus status(); >+ >+ /** >+ * @return the current url >+ */ >+ KUrl url(); >+ >+public slots: >+ /** >+ * Called to enable or disable scaling. >+ * Ignored if @ref supportsScaling() is false. >+ * The default implementation does nothing. >+ * @param s true to enable, false to disable. >+ * @see supportsScaling() >+ * @see scaling() >+ */ >+ virtual void enableScaling(bool scale); >+ >+ /** >+ * Enables/disables the view-only mode. >+ * Ignored if @ref supportsScaling() is false. >+ * The default implementation does nothing. >+ * @param viewOnly true to enable, false to disable. >+ * @see supportsScaling() >+ * @see viewOnly() >+ */ >+ virtual void setViewOnly(bool viewOnly); >+ >+ /** >+ * Enables/disables grabbing all possible keys. >+ * @param grabAllKeys true to enable, false to disable. >+ * Default is false. >+ * @see grabAllKeys() >+ */ >+ virtual void setGrabAllKeys(bool grabAllKeys); >+ >+ /** >+ * Called to let the backend know it when >+ * we switch from/to fullscreen. >+ * @param on true when switching to fullscreen, >+ * false when switching from fullscreen. >+ */ >+ virtual void switchFullscreen(bool on); >+ >+ /** >+ * Sends a QKeyEvent to the remote server. >+ * @param event the key to send >+ */ >+ virtual void keyEvent(QKeyEvent *event); >+ >+ /** >+ * Called when the visible place changed so remote >+ * view can resize itself. >+ */ >+ virtual void scaleResize(int w, int h); >+ >+signals: >+ /** >+ * Emitted when the size of the remote screen changes. Also >+ * called when the size is known for the first time. >+ * @param x the width of the screen >+ * @param y the height of the screen >+ */ >+ void framebufferSizeChanged(int w, int h); >+ >+ /** >+ * Emitted when the view connected successfully. >+ */ >+ void connected(); >+ >+ /** >+ * Emitted when the view disconnected without error. >+ */ >+ void disconnected(); >+ >+ /** >+ * Emitted when the view disconnected with error. >+ */ >+ void disconnectedError(); >+ >+ /** >+ * Emitted when the view has a specific error. >+ */ >+ void errorMessage(const QString &title, const QString &message); >+ >+ /** >+ * Emitted when the status of the view changed. >+ * @param s the new status >+ */ >+ void statusChanged(RemoteView::RemoteStatus s); >+ >+ /** >+ * Emitted when the password dialog is shown or hidden. >+ * @param b true when the dialog is shown, false when it has been hidden >+ */ >+ void showingPasswordDialog(bool b); >+ >+ /** >+ * Emitted when the mouse on the remote side has been moved. >+ * @param x the new x coordinate >+ * @param y the new y coordinate >+ * @param buttonMask the mask of mouse buttons (bit 0 for first mouse >+ * button, 1 for second button etc)a >+ */ >+ void mouseStateChanged(int x, int y, int buttonMask); >+ >+protected: >+ RemoteView(QWidget *parent = 0); >+ >+ void focusInEvent(QFocusEvent *event); >+ void focusOutEvent(QFocusEvent *event); >+ >+ /** >+ * The status of the remote view. >+ */ >+ RemoteStatus m_status; >+ >+ /** >+ * Set the status of the connection. >+ * Emits a statusChanged() signal. >+ * Note that the states need to be set in a certain order, >+ * see @ref Status. setStatus() will try to do this >+ * transition automatically, so if you are in Connecting >+ * and call setStatus(Preparing), setStatus() will >+ * emit a Authenticating and then Preparing. >+ * If you transition backwards, it will emit a >+ * Disconnected before doing the transition. >+ * @param s the new status >+ */ >+ virtual void setStatus(RemoteStatus s); >+ >+ QCursor localDotCursor() const; >+ >+ QString m_host; >+ int m_port; >+ bool m_viewOnly; >+ bool m_grabAllKeys; >+ bool m_scale; >+ bool m_keyboardIsGrabbed; >+ KUrl m_url; >+ >+#ifndef QTONLY >+ QString readWalletPassword(bool fromUserNameOnly = false); >+ void saveWalletPassword(const QString &password, bool fromUserNameOnly = false); >+ KWallet::Wallet *m_wallet; >+#endif >+ >+ DotCursorState m_dotCursorState; >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/core/settings.kcfgc kdenetwork-4.9.1/krdc.org/core/settings.kcfgc >--- kdenetwork-4.9.1.org/krdc.org/core/settings.kcfgc 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/core/settings.kcfgc 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,5 @@ >+ClassName=Settings >+File=krdc.kcfg >+Mutators=true >+Singleton=true >+Visibility=KDE_EXPORT >diff -urN kdenetwork-4.9.1.org/krdc.org/floatingtoolbar.cpp kdenetwork-4.9.1/krdc.org/floatingtoolbar.cpp >--- kdenetwork-4.9.1.org/krdc.org/floatingtoolbar.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/floatingtoolbar.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,486 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org> >+** Parts of this file have been take from okular: >+** Copyright (C) 2004-2005 Enrico Ros <eros.kde@email.it> >+** >+** 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 "floatingtoolbar.h" >+ >+#include <KDebug> >+#include <KGlobalSettings> >+ >+#include <QApplication> >+#include <QBitmap> >+#include <QDesktopWidget> >+#include <QMouseEvent> >+#include <QPainter> >+#include <QTimer> >+ >+static const int actionIconSize = 22; >+static const int toolBarRBMargin = 2; >+static const double toolBarOpacity = 0.8; >+static const int visiblePixelWhenAutoHidden = 6; >+static const int autoHideTimeout = 500; >+static const int initialAutoHideTimeout = 2000; >+ >+/** >+ * Denotes the verious states of the animation. >+ */ >+enum AnimState { >+ Hiding, >+ Showing, >+ Still >+}; >+ >+class FloatingToolBarPrivate >+{ >+public: >+ FloatingToolBarPrivate(FloatingToolBar *qq) >+ : q(qq) >+ , anchorSide(FloatingToolBar::Left) >+ , offsetPlaceHolder(new QWidget(qq)) >+ , animState(Still) >+ , toDelete(false) >+ , visible(false) >+ , sticky(false) >+ , opacity(toolBarOpacity) >+ // set queuedShow to true so we show the toolbar if we get a resize event on the anchorWidget >+ , queuedShow(true) { >+ } >+ >+ // rebuild contents and reposition then widget >+ void buildToolBar(); >+ void reposition(); >+ // compute the visible and hidden positions along current side >+ QPoint getInnerPoint() const; >+ QPoint getOuterPoint() const; >+ >+ FloatingToolBar *q; >+ >+ QWidget *anchorWidget; >+ FloatingToolBar::Side anchorSide; >+ QWidget *offsetPlaceHolder; >+ >+ QTimer *animTimer; >+ QTimer *autoHideTimer; >+ QPoint currentPosition; >+ QPoint endPosition; >+ AnimState animState; >+ bool toDelete; >+ bool visible; >+ bool sticky; >+ qreal opacity; >+ bool queuedShow; >+ >+ QPixmap backgroundPixmap; >+}; >+ >+FloatingToolBar::FloatingToolBar(QWidget *parent, QWidget *anchorWidget) >+ : QToolBar(parent), d(new FloatingToolBarPrivate(this)) >+{ >+ ; >+ addWidget(d->offsetPlaceHolder); >+ >+ setMouseTracking(true); >+ setIconSize(QSize(actionIconSize, actionIconSize)); >+ d->anchorWidget = anchorWidget; >+ >+ d->animTimer = new QTimer(this); >+ connect(d->animTimer, SIGNAL(timeout()), this, SLOT(animate())); >+ >+ d->autoHideTimer = new QTimer(this); >+ connect(d->autoHideTimer, SIGNAL(timeout()), this, SLOT(hide())); >+ >+ // apply a filter to get notified when anchor changes geometry >+ d->anchorWidget->installEventFilter(this); >+} >+ >+FloatingToolBar::~FloatingToolBar() >+{ >+ delete d; >+} >+ >+void FloatingToolBar::addAction(QAction *action) >+{ >+ QToolBar::addAction(action); >+ >+ // rebuild toolbar shape and contents only if the toolbar is already visible, >+ // otherwise it will be done in showAndAnimate() >+ if (isVisible()) >+ d->reposition(); >+} >+ >+void FloatingToolBar::setSide(Side side) >+{ >+ d->anchorSide = side; >+ >+ if (isVisible()) >+ d->reposition(); >+} >+ >+void FloatingToolBar::setSticky(bool sticky) >+{ >+ d->sticky = sticky; >+ >+ if (sticky) >+ d->autoHideTimer->stop(); >+} >+ >+void FloatingToolBar::showAndAnimate() >+{ >+ if (d->animState == Showing) >+ return; >+ >+ d->animState = Showing; >+ >+ show(); >+ >+ // force update for case when toolbar has not been built yet >+ d->reposition(); >+ >+ // start scrolling in >+ d->animTimer->start(20); >+ >+ // This permits to show the toolbar for a while when going full screen. >+ if (!d->sticky) >+ d->autoHideTimer->start(initialAutoHideTimeout); >+} >+ >+void FloatingToolBar::hideAndDestroy() >+{ >+ if (d->animState == Hiding) >+ return; >+ >+ // set parameters for sliding out >+ d->animState = Hiding; >+ d->toDelete = true; >+ d->endPosition = d->getOuterPoint(); >+ >+ // start scrolling out >+ d->animTimer->start(20); >+} >+ >+void FloatingToolBar::hide() >+{ >+ if (underMouse()) >+ return; >+ >+ if (d->visible) { >+ QPoint diff; >+ switch (d->anchorSide) { >+ case Left: >+ diff = QPoint(visiblePixelWhenAutoHidden, 0); >+ break; >+ case Right: >+ diff = QPoint(-visiblePixelWhenAutoHidden, 0); >+ break; >+ case Top: >+ diff = QPoint(0, visiblePixelWhenAutoHidden); >+ break; >+ case Bottom: >+ diff = QPoint(0, -visiblePixelWhenAutoHidden); >+ break; >+ } >+ d->animState = Hiding; >+ d->endPosition = d->getOuterPoint() + diff; >+ >+ // start scrolling out >+ d->animTimer->start(20); >+ } >+} >+ >+bool FloatingToolBar::eventFilter(QObject *obj, QEvent *e) >+{ >+ if (obj == d->anchorWidget && e->type() == QEvent::Resize) { >+ if (d->queuedShow) { // if the toolbar is not visible yet, try to show it if the anchor widget is in fullscreen already >+ d->queuedShow = false; >+ showAndAnimate(); >+ return true; >+ } >+ >+ // if anchorWidget changed geometry reposition toolbar >+ d->animTimer->stop(); >+ if ((d->animState == Hiding || !d->visible) && d->toDelete) >+ deleteLater(); >+ else >+ d->reposition(); >+ } >+ >+ return QToolBar::eventFilter(obj, e); >+} >+ >+void FloatingToolBar::paintEvent(QPaintEvent *e) >+{ >+ QToolBar::paintEvent(e); >+ >+ // paint the internal pixmap over the widget >+ QPainter p(this); >+ p.setOpacity(d->opacity); >+ p.drawImage(e->rect().topLeft(), d->backgroundPixmap.toImage(), e->rect()); >+} >+ >+void FloatingToolBar::mousePressEvent(QMouseEvent *e) >+{ >+ if (e->button() == Qt::LeftButton) >+ setCursor(Qt::SizeAllCursor); >+ >+ QToolBar::mousePressEvent(e); >+} >+ >+void FloatingToolBar::mouseMoveEvent(QMouseEvent *e) >+{ >+ // show the toolbar again when it is auto-hidden >+ if (!d->visible) { >+ showAndAnimate(); >+ return; >+ } >+ >+ if ((QApplication::mouseButtons() & Qt::LeftButton) != Qt::LeftButton) >+ return; >+ >+ // compute the nearest side to attach the widget to >+ const QPoint parentPos = mapToParent(e->pos()); >+ const float nX = (float)parentPos.x() / (float)d->anchorWidget->width(); >+ const float nY = (float)parentPos.y() / (float)d->anchorWidget->height(); >+ if (nX > 0.3 && nX < 0.7 && nY > 0.3 && nY < 0.7) >+ return; >+ bool LT = nX < (1.0 - nY); >+ bool LB = nX < (nY); >+ Side side = LT ? (LB ? Left : Top) : (LB ? Bottom : Right); >+ >+ // check if side changed >+ if (side == d->anchorSide) >+ return; >+ >+ d->anchorSide = side; >+ d->reposition(); >+ emit orientationChanged((int)side); >+ >+ QToolBar::mouseMoveEvent(e); >+} >+ >+void FloatingToolBar::enterEvent(QEvent *e) >+{ >+ // Stop the autohide timer while the mouse is inside >+ d->autoHideTimer->stop(); >+ >+ if (!d->visible) >+ showAndAnimate(); >+ QToolBar::enterEvent(e); >+} >+ >+void FloatingToolBar::leaveEvent(QEvent *e) >+{ >+ if (!d->sticky) >+ d->autoHideTimer->start(autoHideTimeout); >+ QToolBar::leaveEvent(e); >+} >+ >+void FloatingToolBar::mouseReleaseEvent(QMouseEvent *e) >+{ >+ if (e->button() == Qt::LeftButton) >+ setCursor(Qt::ArrowCursor); >+ >+ QToolBar::mouseReleaseEvent(e); >+} >+ >+void FloatingToolBar::wheelEvent(QWheelEvent *e) >+{ >+ e->accept(); >+ >+ const qreal diff = e->delta() / 100.0 / 15.0; >+// kDebug(5010) << diff; >+ if (((d->opacity <= 1) && (diff > 0)) || ((d->opacity >= 0) && (diff < 0))) >+ d->opacity += diff; >+ >+ update(); >+ >+ QToolBar::wheelEvent(e); >+} >+ >+void FloatingToolBarPrivate::buildToolBar() >+{ >+ const bool prevUpdates = q->updatesEnabled(); >+ q->setUpdatesEnabled(false); >+ >+ // 1. init numbers we are going to use >+ const bool topLeft = anchorSide == FloatingToolBar::Left || anchorSide == FloatingToolBar::Top; >+ const bool vertical = anchorSide == FloatingToolBar::Left || anchorSide == FloatingToolBar::Right; >+ >+ if (vertical) { >+ offsetPlaceHolder->setFixedSize(1, 7); >+ q->setOrientation(Qt::Vertical); >+ } else { >+ offsetPlaceHolder->setFixedSize(7, 1); >+ q->setOrientation(Qt::Horizontal); >+ } >+ >+ // 2. compute widget size >+ const int myWidth = q->sizeHint().width() - 1; >+ const int myHeight = q->sizeHint().height() - 1; >+ >+ // 3. resize pixmap, mask and widget >+ QBitmap mask(myWidth + 1, myHeight + 1); >+ backgroundPixmap = QPixmap(myWidth + 1, myHeight + 1); >+ backgroundPixmap.fill(Qt::transparent); >+ >+ q->resize(myWidth + 1, myHeight + 1); >+ >+ // 4. create and set transparency mask >+ QPainter maskPainter(&mask); >+ mask.fill(Qt::white); >+ maskPainter.setBrush(Qt::black); >+ if (vertical) >+ maskPainter.drawRoundRect(topLeft ? -10 : 0, 0, myWidth + 10, myHeight, 2000 / (myWidth + 10), 2000 / myHeight); >+ else >+ maskPainter.drawRoundRect(0, topLeft ? -10 : 0, myWidth, myHeight + 10, 2000 / myWidth, 2000 / (myHeight + 10)); >+ maskPainter.end(); >+ q->setMask(mask); >+ >+ // 5. draw background >+ QPainter bufferPainter(&backgroundPixmap); >+ bufferPainter.translate(0.5, 0.5); >+ QPalette pal = q->palette(); >+ // 5.1. draw horizontal/vertical gradient >+ QLinearGradient grad; >+ switch (anchorSide) { >+ case FloatingToolBar::Left: >+ grad = QLinearGradient(0, 1, myWidth + 1, 1); >+ break; >+ case FloatingToolBar::Right: >+ grad = QLinearGradient(myWidth + 1, 1, 0, 1); >+ break; >+ case FloatingToolBar::Top: >+ grad = QLinearGradient(1, 0, 1, myHeight + 1); >+ break; >+ case FloatingToolBar::Bottom: >+ grad = QLinearGradient(1, myHeight + 1, 0, 1); >+ break; >+ } >+ grad.setColorAt(0, pal.color(QPalette::Active, QPalette::Button)); >+ grad.setColorAt(1, pal.color(QPalette::Active, QPalette::Light)); >+ bufferPainter.setBrush(QBrush(grad)); >+ // 5.2. draw rounded border >+ bufferPainter.setPen( pal.color(QPalette::Active, QPalette::Dark).lighter(40)); >+ bufferPainter.setRenderHints(QPainter::Antialiasing); >+ if (vertical) >+ bufferPainter.drawRoundRect(topLeft ? -10 : 0, 0, myWidth + 10, myHeight, 2000 / (myWidth + 10), 2000 / myHeight); >+ else >+ bufferPainter.drawRoundRect(0, topLeft ? -10 : 0, myWidth, myHeight + 10, 2000 / myWidth, 2000 / (myHeight + 10)); >+ // 5.3. draw handle >+ bufferPainter.translate(-0.5, -0.5); >+ bufferPainter.setPen(pal.color(QPalette::Active, QPalette::Mid)); >+ if (vertical) { >+ int dx = anchorSide == FloatingToolBar::Left ? 2 : 4; >+ bufferPainter.drawLine(dx, 6, dx + myWidth - 8, 6); >+ bufferPainter.drawLine(dx, 9, dx + myWidth - 8, 9); >+ bufferPainter.setPen(pal.color(QPalette::Active, QPalette::Light)); >+ bufferPainter.drawLine(dx + 1, 7, dx + myWidth - 7, 7); >+ bufferPainter.drawLine(dx + 1, 10, dx + myWidth - 7, 10); >+ } else { >+ int dy = anchorSide == FloatingToolBar::Top ? 2 : 4; >+ bufferPainter.drawLine(6, dy, 6, dy + myHeight - 8); >+ bufferPainter.drawLine(9, dy, 9, dy + myHeight - 8); >+ bufferPainter.setPen(pal.color(QPalette::Active, QPalette::Light)); >+ bufferPainter.drawLine(7, dy + 1, 7, dy + myHeight - 7); >+ bufferPainter.drawLine(10, dy + 1, 10, dy + myHeight - 7); >+ } >+ >+ q->setUpdatesEnabled(prevUpdates); >+} >+ >+void FloatingToolBarPrivate::reposition() >+{ >+ // note: hiding widget here will gives better gfx, but ends drag operation >+ // rebuild widget and move it to its final place >+ buildToolBar(); >+ if (!visible) { >+ currentPosition = getOuterPoint(); >+ endPosition = getInnerPoint(); >+ } else { >+ currentPosition = getInnerPoint(); >+ endPosition = getOuterPoint(); >+ } >+ q->move(currentPosition); >+} >+ >+QPoint FloatingToolBarPrivate::getInnerPoint() const >+{ >+ // returns the final position of the widget >+ if (anchorSide == FloatingToolBar::Left) >+ return QPoint(0, (anchorWidget->height() - q->height()) / 2); >+ if (anchorSide == FloatingToolBar::Top) >+ return QPoint((anchorWidget->width() - q->width()) / 2, 0); >+ if (anchorSide == FloatingToolBar::Right) >+ return QPoint(anchorWidget->width() - q->width() + toolBarRBMargin, (anchorWidget->height() - q->height()) / 2); >+ return QPoint((anchorWidget->width() - q->width()) / 2, anchorWidget->height() - q->height() + toolBarRBMargin); >+} >+ >+QPoint FloatingToolBarPrivate::getOuterPoint() const >+{ >+ // returns the point from which the transition starts >+ if (anchorSide == FloatingToolBar::Left) >+ return QPoint(-q->width(), (anchorWidget->height() - q->height()) / 2); >+ if (anchorSide == FloatingToolBar::Top) >+ return QPoint((anchorWidget->width() - q->width()) / 2, -q->height()); >+ if (anchorSide == FloatingToolBar::Right) >+ return QPoint(anchorWidget->width() + toolBarRBMargin, (anchorWidget->height() - q->height()) / 2); >+ return QPoint((anchorWidget->width() - q->width()) / 2, anchorWidget->height() + toolBarRBMargin); >+} >+ >+void FloatingToolBar::animate() >+{ >+ if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects) { >+ // move currentPosition towards endPosition >+ int dX = d->endPosition.x() - d->currentPosition.x(); >+ int dY = d->endPosition.y() - d->currentPosition.y(); >+ dX = dX / 6 + qMax(-1, qMin(1, dX)); >+ dY = dY / 6 + qMax(-1, qMin(1, dY)); >+ d->currentPosition.setX(d->currentPosition.x() + dX); >+ d->currentPosition.setY(d->currentPosition.y() + dY); >+ } else { >+ d->currentPosition = d->endPosition; >+ } >+ >+ move(d->currentPosition); >+ >+ // handle arrival to the end >+ if (d->currentPosition == d->endPosition) { >+ d->animTimer->stop(); >+ switch (d->animState) { >+ case Hiding: >+ d->visible = false; >+ d->animState = Still; >+ if (d->toDelete) >+ deleteLater(); >+ break; >+ case Showing: >+ d->visible = true; >+ d->animState = Still; >+ break; >+ default: >+ kDebug(5010) << "Illegal state"; >+ } >+ } >+} >+ >+#include "floatingtoolbar.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/floatingtoolbar.h kdenetwork-4.9.1/krdc.org/floatingtoolbar.h >--- kdenetwork-4.9.1.org/krdc.org/floatingtoolbar.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/floatingtoolbar.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,77 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org> >+** Parts of this file have been take from okular: >+** Copyright (C) 2004-2005 Enrico Ros <eros.kde@email.it> >+** >+** 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 FLOATINGTOOLBAR_H >+#define FLOATINGTOOLBAR_H >+ >+#include <QToolBar> >+ >+/** >+ * @short A toolbar widget that slides in from a side. >+ * >+ * This is a shaped widget that slides in from a side of the 'anchor widget' >+ * it's attached to. It can be dragged and docked on {left,top,right,bottom} >+ * sides and contains actions. >+ */ >+class FloatingToolBar : public QToolBar >+{ >+ Q_OBJECT >+public: >+ FloatingToolBar(QWidget *parent, QWidget *anchorWidget); >+ ~FloatingToolBar(); >+ >+ Q_ENUMS(Side) >+ enum Side { Left = 0, Top = 1, Right = 2, Bottom = 3 }; >+ >+ void addAction(QAction *action); >+ void setSide(Side side); >+ >+Q_SIGNALS: >+ void orientationChanged(int side); >+ >+public Q_SLOTS: >+ void setSticky(bool sticky); >+ void showAndAnimate(); >+ void hideAndDestroy(); >+ >+protected: >+ bool eventFilter(QObject *o, QEvent *e); >+ void paintEvent(QPaintEvent *); >+ void mousePressEvent(QMouseEvent *e); >+ void mouseMoveEvent(QMouseEvent *e); >+ void enterEvent(QEvent *e); >+ void leaveEvent(QEvent *e); >+ void mouseReleaseEvent(QMouseEvent *e); >+ void wheelEvent(QWheelEvent *e); >+ >+private: >+ class FloatingToolBarPrivate *d; >+ >+private Q_SLOTS: >+ void animate(); >+ void hide(); >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/konsole/CMakeLists.txt kdenetwork-4.9.1/krdc.org/konsole/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/konsole/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/konsole/CMakeLists.txt 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,20 @@ >+ >+set(BUILD_KONSOLE true) >+if(BUILD_KONSOLE) >+ set(konsoleplugin_SRCS >+ konsoleviewfactory.cpp >+ konsoleview.cpp >+ ) >+ >+ kde4_add_plugin(krdc_konsoleplugin ${konsoleplugin_SRCS}) >+ >+ target_link_libraries(krdc_konsoleplugin >+ ${KDE4_KDECORE_LIBS} >+ ${KDE4_KDEUI_LIBS} >+ ${KDE4_KPARTS_LIBS} >+ krdccore >+ ) >+ install(TARGETS krdc_konsoleplugin DESTINATION ${PLUGIN_INSTALL_DIR}) >+ >+ install(FILES krdc_konsole.desktop DESTINATION ${SERVICES_INSTALL_DIR}) >+endif(BUILD_KONSOLE) >diff -urN kdenetwork-4.9.1.org/krdc.org/konsole/konsoleview.cpp kdenetwork-4.9.1/krdc.org/konsole/konsoleview.cpp >--- kdenetwork-4.9.1.org/krdc.org/konsole/konsoleview.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/konsole/konsoleview.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,128 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "konsoleview.h" >+ >+#include <KParts/Part> >+#include <KPluginFactory> >+#include <KPluginLoader> >+#include <KService> >+#include <kde_terminal_interface.h> >+ >+#include <QDir> >+#include <QEvent> >+#include <QScrollArea> >+#include <QVBoxLayout> >+ >+KonsoleView::KonsoleView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+ : RemoteView(parent) >+{ >+ m_url = url; >+ m_host = url.host(); >+ m_port = url.port(); >+ >+ m_hostPreferences = new KonsoleHostPreferences(configGroup, this); >+ >+// QSize size = QSize(640, 480); >+ const QSize size = (qobject_cast<QWidget *>(parent))->size(); >+ setStatus(Connected); >+ setFixedSize(size); >+ setFixedSize(size); >+ emit framebufferSizeChanged(size.width(), size.height()); >+ >+ KPluginFactory* factory = 0; >+ KService::Ptr service = KService::serviceByDesktopName("konsolepart"); >+ if (service) { >+ factory = KPluginLoader(service->library()).factory(); >+ } >+ KParts::ReadOnlyPart* part = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0; >+ if (part != 0) { >+// connect(part, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited())); >+ QVBoxLayout *mainLayout = new QVBoxLayout(this); >+ mainLayout->setMargin(0); >+ mainLayout->setSpacing(0); >+ m_terminalWidget = part->widget(); >+ mainLayout->addWidget(m_terminalWidget); >+ m_terminal = qobject_cast<TerminalInterface *>(part); >+ m_terminal->showShellInDir(QDir::homePath()); >+ m_terminal->sendInput("echo " + url.user() + '@' + url.host()/* + ':' + url.port()*/ + '\n'); >+// m_terminal->sendInput("clear\n"); >+ m_terminalWidget->resize(size); >+ } >+} >+ >+KonsoleView::~KonsoleView() >+{ >+ emit disconnected(); >+ setStatus(Disconnected); >+} >+ >+bool KonsoleView::eventFilter(QObject *obj, QEvent *event) >+{ >+ if (m_viewOnly) { >+ if (event->type() == QEvent::KeyPress || >+ event->type() == QEvent::KeyRelease || >+ event->type() == QEvent::MouseButtonDblClick || >+ event->type() == QEvent::MouseButtonPress || >+ event->type() == QEvent::MouseButtonRelease || >+ event->type() == QEvent::MouseMove) >+ return true; >+ } >+ return RemoteView::eventFilter(obj, event); >+} >+ >+QSize KonsoleView::framebufferSize() >+{ >+ return minimumSizeHint(); >+} >+ >+QSize KonsoleView::sizeHint() const >+{ >+ return RemoteView::sizeHint(); >+ return maximumSize(); >+} >+ >+bool KonsoleView::isQuitting() >+{ >+ return false; >+} >+ >+bool KonsoleView::start() >+{ >+ setStatus(Connected); >+ emit connected(); >+ m_terminalWidget->setFocus(); >+ return true; >+} >+ >+HostPreferences* KonsoleView::hostPreferences() >+{ >+ return m_hostPreferences; >+} >+ >+void KonsoleView::switchFullscreen(bool on) >+{ >+ Q_UNUSED(on); >+} >+ >+#include "konsoleview.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/konsole/konsoleviewfactory.cpp kdenetwork-4.9.1/krdc.org/konsole/konsoleviewfactory.cpp >--- kdenetwork-4.9.1.org/krdc.org/konsole/konsoleviewfactory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/konsole/konsoleviewfactory.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,82 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "konsoleviewfactory.h" >+ >+#include <KDebug> >+#include <KLocale> >+ >+KRDC_PLUGIN_EXPORT(KonsoleViewFactory) >+ >+KonsoleViewFactory::KonsoleViewFactory(QObject *parent, const QVariantList &args) >+ : RemoteViewFactory(parent) >+{ >+ Q_UNUSED(args); >+ >+ KGlobal::locale()->insertCatalog("krdc"); >+} >+ >+KonsoleViewFactory::~KonsoleViewFactory() >+{ >+} >+ >+bool KonsoleViewFactory::supportsUrl(const KUrl &url) const >+{ >+ return (url.scheme().compare("konsole", Qt::CaseInsensitive) == 0); >+} >+ >+RemoteView *KonsoleViewFactory::createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+{ >+ return new KonsoleView(parent, url, configGroup); >+} >+ >+HostPreferences *KonsoleViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) >+{ >+ Q_UNUSED(configGroup); >+ Q_UNUSED(parent); >+ >+ return 0; >+} >+ >+QString KonsoleViewFactory::scheme() const >+{ >+ return "konsole"; >+} >+ >+QString KonsoleViewFactory::connectActionText() const >+{ >+ return i18n("New Konsole Connection..."); //FIXME >+} >+ >+QString KonsoleViewFactory::connectButtonText() const >+{ >+ return i18n("KRDC Konsole Connection"); >+} >+ >+QString KonsoleViewFactory::connectToolTipText() const >+{ >+ return i18n("<html>Enter the address here. Port is optional.<br />" >+ "<i>Example: konsoleserver (host)</i></html>"); >+} >+ >+#include "moc_konsoleviewfactory.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/konsole/konsoleviewfactory.h kdenetwork-4.9.1/krdc.org/konsole/konsoleviewfactory.h >--- kdenetwork-4.9.1.org/krdc.org/konsole/konsoleviewfactory.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/konsole/konsoleviewfactory.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,55 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 KONSOLEVIEWFACTORY_H >+#define KONSOLEVIEWFACTORY_H >+ >+#include "remoteviewfactory.h" >+ >+#include "konsoleview.h" >+ >+class KonsoleViewFactory : public RemoteViewFactory >+{ >+ Q_OBJECT >+ >+public: >+ explicit KonsoleViewFactory(QObject *parent, const QVariantList &args); >+ >+ virtual ~KonsoleViewFactory(); >+ >+ virtual bool supportsUrl(const KUrl &url) const; >+ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup); >+ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent); >+ >+ virtual QString scheme() const; >+ >+ virtual QString connectActionText() const; >+ >+ virtual QString connectButtonText() const; >+ >+ virtual QString connectToolTipText() const; >+}; >+ >+#endif // KONSOLEVIEWFACTORY_H >diff -urN kdenetwork-4.9.1.org/krdc.org/konsole/konsoleview.h kdenetwork-4.9.1/krdc.org/konsole/konsoleview.h >--- kdenetwork-4.9.1.org/krdc.org/konsole/konsoleview.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/konsole/konsoleview.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,77 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 KONSOLEVIEW_H >+#define KONSOLEVIEW_H >+ >+#include "konsoleview.h" >+ >+#include "remoteview.h" >+#include "hostpreferences.h" >+ >+#include <KConfigGroup> >+ >+class KonsoleHostPreferences; >+class TerminalInterface; >+ >+class KonsoleView : public RemoteView >+{ >+ Q_OBJECT >+ >+public: >+ explicit KonsoleView(QWidget *parent = 0, const KUrl &url = KUrl(), KConfigGroup configGroup = KConfigGroup()); >+ >+ virtual ~KonsoleView(); >+ >+ virtual QSize framebufferSize(); >+ QSize sizeHint() const; >+ >+ virtual bool isQuitting(); >+ virtual bool start(); >+ HostPreferences* hostPreferences(); >+ >+public slots: >+ virtual void switchFullscreen(bool on); >+ >+protected: >+ bool eventFilter(QObject *obj, QEvent *event); >+ >+private: >+ KonsoleHostPreferences *m_hostPreferences; >+ TerminalInterface* m_terminal; >+ QWidget *m_terminalWidget; >+}; >+ >+ >+class KonsoleHostPreferences : public HostPreferences >+{ >+ Q_OBJECT >+public: >+ explicit KonsoleHostPreferences(KConfigGroup configGroup, QObject *parent = 0) >+ : HostPreferences(configGroup, parent) {} >+ >+protected: >+ virtual QWidget* createProtocolSpecificConfigPage() { return 0; }; >+}; >+ >+#endif // KONSOLEVIEW_H >diff -urN kdenetwork-4.9.1.org/krdc.org/konsole/krdc_konsole.desktop kdenetwork-4.9.1/krdc.org/konsole/krdc_konsole.desktop >--- kdenetwork-4.9.1.org/krdc.org/konsole/krdc_konsole.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/konsole/krdc_konsole.desktop 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,123 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KRDC/Plugin >+Icon=krdc >+Name=Konsole >+Name[ast]=Konsole >+Name[bg]=Konsole >+Name[bs]=Konzola >+Name[ca]=Konsole >+Name[ca@valencia]=Konsole >+Name[cs]=Konsole >+Name[da]=Konsole >+Name[de]=Konsole >+Name[el]=Konsole >+Name[en_GB]=Konsole >+Name[eo]=Konsole >+Name[es]=Konsole >+Name[et]=Konsool >+Name[eu]=Konsole >+Name[fi]=Konsoli >+Name[fr]=Konsole >+Name[ga]=Konsole >+Name[gl]=Konsole >+Name[hr]=Konsole >+Name[hsb]=Konsola >+Name[hu]=Konsole >+Name[ia]=Konsole >+Name[it]=Konsole >+Name[ja]=Konsole >+Name[kk]=Konsole >+Name[km]=áá»ááá¼á >+Name[ko]=Konsole >+Name[lt]=Konsole >+Name[lv]=Konsole >+Name[mai]=à¤à¤à¤¸à¥à¤² >+Name[nb]=Konsole >+Name[nds]=Konsole >+Name[nl]=Konsole >+Name[nn]=Konsoll >+Name[pa]=à¨à¨¨à¨¸à©à¨² >+Name[pl]=Konsola >+Name[pt]=Konsole >+Name[pt_BR]=Konsole >+Name[ro]=KonsolÄ >+Name[ru]=Konsole >+Name[si]=Konsole >+Name[sk]=Konsole >+Name[sl]=Konzola >+Name[sr]=Ðонзола >+Name[sr@ijekavian]=Ðонзола >+Name[sr@ijekavianlatin]=Konsole >+Name[sr@latin]=Konsole >+Name[sv]=Terminal >+Name[th]=à¸à¸à¸à¹à¸à¸¥-K >+Name[tr]=Konsole >+Name[ug]=Konsole >+Name[uk]=Konsole >+Name[x-test]=xxKonsolexx >+Name[zh_CN]=Konsole >+Name[zh_TW]=çµç«¯æ©_Konsole >+Comment=Allows managing SSH or Telnet sessions through KRDC >+Comment[ast]=Permite la xestión de sesiones SSH o Telnet per KRDC >+Comment[bg]=УпÑавление на ÑеÑии на SSH и Telnet пÑез KRDC >+Comment[bs]=DopuÅ¡ta ureÄivanje SSH ili Telnet sesija kroz KRDC >+Comment[ca]=Permet gestionar sessions SSH o Telnet mitjançant el KRDC >+Comment[ca@valencia]=Permet gestionar sessions SSH o Telnet mitjançant el KRDC >+Comment[cs]=UmožÅuje spravovat sezenà SSH nebo Telnet pomocà KRDC >+Comment[da]=Muliggør hÃ¥ndtering af SSH- eller Telnet-sessioner via KRDC >+Comment[de]=Erlaubt die Verwaltung von SSH- und Telnet-Sitzungen über KRDC >+Comment[el]=ÎÏιÏÏÎÏει Ïη διαÏείÏιÏη ÏÏ Î½ÎµÎ´ÏιÏν SSH ή Telnet μÎÏÏ ÏÎ¿Ï KRDC >+Comment[en_GB]=Allows managing SSH or Telnet sessions through KRDC >+Comment[es]=Permite la gestión de sesiones SSH o Telnet mediante KRDC >+Comment[et]=SSH- või Telneti seansside haldamise võimaldamine KRDC kaudu >+Comment[eu]=SSH edo Telnet saioak KRDC bidez kudeatzea baimentzen du >+Comment[fi]=Mahdollistaa SSH- ja Telnet-istuntojen hallinnan KRDC:llä >+Comment[fr]=Permet de gérer des sessions SSH ou Telnet au travers de KRDC >+Comment[ga]=CeadaÃonn sé duit seisiúin SSH nó Telnet a bhainistiú trà KRDC >+Comment[gl]=Permite a xestión de sesións SSH ou Telnet por medio de KRCC >+Comment[hr]=OmoguÄuje upravljanje sjednicama SSH-a i Telneta kroz KRDC >+Comment[hu]=SSH vagy telnet használata a KRDC-n keresztül >+Comment[ia]=Permitte gerer sessiones SSH o Telnet per medio de KRDC >+Comment[it]=Permette la gestione di sessioni SSH o Telnet con KRDC >+Comment[ja]=KRDC ãã SSH ã Telnet ã»ãã·ã§ã³ã管çã§ããããã«ãã¾ã >+Comment[kk]=KRDC аÑÒÑÐ»Ñ SSH не Telnet ÑеанÑÑаÑÑн баÑÒаÑÑÒа мүмкÑндÑк беÑÑ >+Comment[km]=á¢áá»áááá¶áâá²ááâáááááááááââáááá SSH ᬠTelnet áá¶áááá KRDC >+Comment[ko]=KRDC를 íµí´ì ì격 SSHë í ë· ì¸ì ê´ë¦¬í기 >+Comment[lt]=Leisti valdyti SSH ar Telnet sesijas per KRDC >+Comment[lv]=Ä»auj pÄrvaldÄ«t SSH un Telnet sesijas caur KRDC >+Comment[nb]=Tillater Ã¥ styre SSH eller Telnet-økter gjennom KRDC >+Comment[nds]=SSH- oder Telnet-Törns över KRDC plegen >+Comment[nl]=Staat het beheer van ssh- of telnet-sessies toe via KRDC >+Comment[nn]=Lèt deg handtera SSH- eller Telnet-økter gjennom KRDC >+Comment[pa]=KRDC ਰਾਹà©à¨ SSH à¨à¨¾à¨ à¨à©à¨²à¨¨à©à¨ (Telnet) ਸ਼à©à¨¸à¨¼à¨¨ ਮਨà¨à¨¼à©à¨°à© >+Comment[pl]=Pozwala zarzÄ dzaÄ sesjami SSH lub Telnet za pomocÄ KRDC >+Comment[pt]=Permite a gestão de sessões SSH ou Telnet através do KRDC >+Comment[pt_BR]=Permite o gerenciamento de sessões SSH ou Telnet através do KRDC >+Comment[ro]=Permite gestiunea sesiunilor SSH sau Telnet prin KRDC >+Comment[ru]=РазÑеÑиÑÑ ÑпÑавление ÑеанÑами SSH или Telnet ÑеÑез KRDC >+Comment[si]=KRDC à·à¶»à·à· Telnet à·à· SSH à·à·à¶» à¶´à·à¶½à¶±à¶ºà¶§ à¶à¶© දà·à¶ºà· >+Comment[sk]=UmožÅuje spravovanie SSH alebo Telnet sedenà pomocou KRDC >+Comment[sl]=OmogoÄa upravljanje sej SSH ali Telnet prek KRDC >+Comment[sr]=УпÑавÑаÑе ССХ и ТÐÐÐÐТ везама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavian]=УпÑавÑаÑе ССХ и ТÐÐÐÐТ везама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavianlatin]=Upravljanje SSH i TELNET vezama kroz KRDC >+Comment[sr@latin]=Upravljanje SSH i TELNET vezama kroz KRDC >+Comment[sv]=TillÃ¥ter hantering av SSH- eller Telnet-sessioner via KRDC >+Comment[th]=à¸à¸à¸¸à¸à¸²à¸à¹à¸«à¹à¸à¸³à¸à¸²à¸£à¸à¸±à¸à¸à¸²à¸£à¸§à¸²à¸£à¸°à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸ SSH หรืภTelnet à¸à¹à¸²à¸à¸à¸²à¸à¹à¸à¸£à¹à¸à¸£à¸¡ KRDC >+Comment[tr]=KRDC üzerinden SSH ve Telnet oturumlarını yönetmenizi saÄlar >+Comment[uk]=ÐÐ°Ð´Ð°Ñ Ð·Ð¼Ð¾Ð³Ñ ÐºÐµÑÑваÑи ÑеанÑами SSH або Telnet за Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ KRDC >+Comment[x-test]=xxAllows managing SSH or Telnet sessions through KRDCxx >+Comment[zh_CN]=å è®¸ç¨æ·éè¿ KRDC 管ç SSH æ Telnet ä¼è¯ >+Comment[zh_TW]=å 許éé KRDC 管ç SSH æ Telnet å·¥ä½é段 >+ >+X-KDE-PluginInfo-Author=Urs Wolfer >+X-KDE-PluginInfo-Email=uwolfer@kde.org >+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_konsoleplugin >+X-KDE-PluginInfo-Name=krdc_konsoleplugin >+ >+X-KDE-KRDC-Sorting=70 >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/approver.cpp kdenetwork-4.9.1/krdc.org/krdc_approver/approver.cpp >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/approver.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/approver.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,150 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk> >+** Copyright (C) 2009 Abner Silva <abner.silva@kdemail.net> >+** >+** This file is part of KDE. >+** >+** 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 "approver.h" >+ >+#include <KDebug> >+#include <KNotification> >+#include <KLocalizedString> >+ >+#include <TelepathyQt/Contact> >+#include <TelepathyQt/Connection> >+#include <TelepathyQt/ReferencedHandles> >+#include <TelepathyQt/PendingReady> >+#include <TelepathyQt/ChannelDispatchOperation> >+ >+Approver::Approver(const Tp::MethodInvocationContextPtr<> &context, >+ const QList<Tp::ChannelPtr> &channels, >+ const Tp::ChannelDispatchOperationPtr &dispatchOperation, >+ QObject *parent) >+ : QObject(parent), >+ m_context(context), >+ m_channels(channels), >+ m_dispatchOp(dispatchOperation), >+ m_notification(0) >+{ >+ kDebug() << "Initializing approver"; >+ >+ connect(m_dispatchOp->becomeReady(), >+ SIGNAL(finished(Tp::PendingOperation*)), >+ SLOT(onDispatchOperationReady(Tp::PendingOperation*))); >+} >+ >+void Approver::onDispatchOperationReady(Tp::PendingOperation *op) >+{ >+ if (op->isError()) { >+ kError() << "Dispatch operation failed to become ready" >+ << op->errorName() << op->errorMessage(); >+ m_context->setFinishedWithError(op->errorName(), op->errorMessage()); >+ emit finished(); >+ return; >+ } >+ >+ kDebug() << "DispatchOp ready!"; >+ >+ Tp::ChannelPtr channel = m_dispatchOp->channels()[0]; >+ connect(channel->becomeReady(), >+ SIGNAL(finished(Tp::PendingOperation*)), >+ SLOT(onChannelReady(Tp::PendingOperation*))); >+} >+ >+void Approver::onChannelReady(Tp::PendingOperation *op) >+{ >+ if (op->isError()) { >+ kError() << "Channel failed to become ready" >+ << op->errorName() << op->errorMessage(); >+ m_context->setFinishedWithError(op->errorName(), op->errorMessage()); >+ emit finished(); >+ return; >+ } >+ >+ kDebug() << "Channel ready!"; >+ >+ Tp::ContactPtr contact = m_dispatchOp->channels()[0]->initiatorContact(); >+ >+ KNotification *notification = new KNotification("newrfb", NULL, KNotification::Persistent); >+ notification->setTitle(i18n("Invitation to view remote desktop")); >+ notification->setText(i18n("%1 wants to share his/her desktop with you", contact->alias())); >+ notification->setActions(QStringList() << i18n("Accept") << i18n("Reject")); >+ >+ Tp::Client::ConnectionInterfaceAvatarsInterface *avatarIface = >+ m_dispatchOp->channels()[0]->connection()->optionalInterface<Tp::Client::ConnectionInterfaceAvatarsInterface>(); >+ >+ if (avatarIface) { >+ QDBusPendingReply<QByteArray, QString> reply = avatarIface->RequestAvatar( >+ contact->handle().takeFirst()); >+ >+ reply.waitForFinished(); >+ >+ if (!reply.isError()) { >+ QPixmap avatar; >+ avatar.loadFromData(reply.value()); >+ notification->setPixmap(avatar); >+ } >+ } >+ >+ connect(notification, SIGNAL(action1Activated()), SLOT(onAccepted())); >+ connect(notification, SIGNAL(action2Activated()), SLOT(onRejected())); >+ connect(notification, SIGNAL(ignored()), SLOT(onRejected())); >+ >+ notification->sendEvent(); >+ >+ m_notification = notification; >+ >+ m_context->setFinished(); >+} >+ >+Approver::~Approver() >+{ >+ kDebug() << "Destroying approver"; >+} >+ >+void Approver::onAccepted() >+{ >+ kDebug() << "Channel approved"; >+ m_dispatchOp->handleWith(TP_QT_IFACE_CLIENT + ".krdc_rfb_handler"); >+ >+ emit finished(); >+} >+ >+void Approver::onRejected() >+{ >+ kDebug() << "Channel rejected"; >+ connect(m_dispatchOp->claim(), SIGNAL(finished(Tp::PendingOperation*)), >+ SLOT(onClaimFinished(Tp::PendingOperation*))); >+} >+ >+void Approver::onClaimFinished(Tp::PendingOperation *op) >+{ >+ if (op->isError()) { >+ kError() << "Claim operation failed" >+ << op->errorName() << op->errorMessage(); >+ m_context->setFinishedWithError(op->errorName(), op->errorMessage()); >+ } >+ else { >+ foreach(const Tp::ChannelPtr &channel, m_channels) >+ channel->requestClose(); >+ } >+ >+ emit finished(); >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/approver.h kdenetwork-4.9.1/krdc.org/krdc_approver/approver.h >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/approver.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/approver.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,66 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk> >+** Copyright (C) 2009 Abner Silva <abner.silva@kdemail.net> >+** >+** 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 APPROVER_H >+#define APPROVER_H >+ >+#include <QObject> >+ >+#include <TelepathyQt/Channel> >+ >+class KNotification; >+ >+class Approver : public QObject >+{ >+ Q_OBJECT >+ Q_DISABLE_COPY(Approver) >+ >+public: >+ ~Approver(); >+ >+private Q_SLOTS: >+ void onAccepted(); >+ void onRejected(); >+ void onDispatchOperationReady(Tp::PendingOperation*); >+ void onChannelReady(Tp::PendingOperation*); >+ void onClaimFinished(Tp::PendingOperation*); >+ >+Q_SIGNALS: >+ void finished(); >+ >+private: >+ Approver(const Tp::MethodInvocationContextPtr<> &context, >+ const QList<Tp::ChannelPtr> &channels, >+ const Tp::ChannelDispatchOperationPtr &dispatchOperation, >+ QObject *parent); >+ >+private: >+ Tp::MethodInvocationContextPtr<> m_context; >+ QList<Tp::ChannelPtr> m_channels; >+ Tp::ChannelDispatchOperationPtr m_dispatchOp; >+ QPointer<KNotification> m_notification; >+ >+ friend class ApproverManager; >+}; >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/approvermanager.cpp kdenetwork-4.9.1/krdc.org/krdc_approver/approvermanager.cpp >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/approvermanager.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/approvermanager.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,88 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk> >+** Copyright (C) 2009 Abner Silva <abner.silva@kdemail.net> >+** >+** 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 "approvermanager.h" >+#include "approver.h" >+ >+#include <QDBusObjectPath> >+#include <QDBusConnection> >+ >+#include <KApplication> >+#include <KDebug> >+ >+#include <TelepathyQt/Account> >+#include <TelepathyQt/ChannelClassSpecList> >+#include <TelepathyQt/ChannelDispatchOperation> >+#include <TelepathyQt/Connection> >+#include <TelepathyQt/PendingOperation> >+#include <TelepathyQt/PendingReady> >+#include <TelepathyQt/Debug> >+ >+static inline Tp::ChannelClassSpecList channelClassSpecList() >+{ >+ Tp::ChannelClassSpec spec = Tp::ChannelClassSpec(); >+ spec.setChannelType(TP_QT_IFACE_CHANNEL_TYPE_STREAM_TUBE); >+ spec.setTargetHandleType(Tp::HandleTypeContact); >+ spec.setRequested(false); >+ spec.setProperty(TP_QT_IFACE_CHANNEL_TYPE_STREAM_TUBE + ".Service", >+ QVariant("rfb")); >+ return Tp::ChannelClassSpecList() << spec; >+} >+ >+ApproverManager::ApproverManager(QObject *parent) >+ : QObject(parent), >+ AbstractClientApprover(channelClassSpecList()) >+{ >+ kDebug() << "Initializing approver manager"; >+} >+ >+ApproverManager::~ApproverManager() >+{ >+ kDebug() << "Destroying approver manager"; >+} >+ >+void ApproverManager::addDispatchOperation(const Tp::MethodInvocationContextPtr<> &context, >+ const Tp::ChannelDispatchOperationPtr &dispatchOperation) >+{ >+ kDebug() << "New channel for approving arrived"; >+ >+ Approver *approver = new Approver(context, dispatchOperation->channels(), dispatchOperation, this); >+ connect(approver, SIGNAL(finished()), SLOT(onFinished())); >+ >+ m_approvers << approver; >+} >+ >+void ApproverManager::onFinished() >+{ >+ kDebug() << "Approver finished"; >+ >+ Approver *approver = qobject_cast<Approver*>(sender()); >+ m_approvers.removeOne(approver); >+ approver->deleteLater(); >+ >+ if (m_approvers.empty()) { >+ kDebug() << "Quitting approver manager"; >+ KApplication::kApplication()->quit(); >+ } >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/approvermanager.h kdenetwork-4.9.1/krdc.org/krdc_approver/approvermanager.h >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/approvermanager.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/approvermanager.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,49 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk> >+** Copyright (C) 2009 Abner Silva <abner.silva@kdemail.net> >+** >+** 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 APPROVERMANAGER_H >+#define APPROVERMANAGER_H >+ >+#include <TelepathyQt/AbstractClientApprover> >+ >+class Approver; >+ >+class ApproverManager : public QObject, public Tp::AbstractClientApprover >+{ >+ Q_OBJECT >+ >+public: >+ ApproverManager(QObject *parent); >+ virtual ~ApproverManager(); >+ >+ virtual void addDispatchOperation(const Tp::MethodInvocationContextPtr<> &context, >+ const Tp::ChannelDispatchOperationPtr &dispatchOperation); >+ >+private Q_SLOTS: >+ void onFinished(); >+ >+private: >+ QList<Approver *> m_approvers; >+}; >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/CMakeLists.txt kdenetwork-4.9.1/krdc.org/krdc_approver/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/CMakeLists.txt 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,23 @@ >+include_directories(${CMAKE_CURRENT_BINARY_DIR}) >+ >+set (krdc_rfb_approver_SRCS >+ main.cpp >+ approvermanager.cpp >+ approver.cpp >+) >+ >+kde4_add_executable(krdc_rfb_approver ${krdc_rfb_approver_SRCS}) >+target_link_libraries(krdc_rfb_approver ${KDE4_KDEUI_LIBS} >+ ${TELEPATHY_QT4_LIBRARIES} >+) >+ >+install(TARGETS krdc_rfb_approver ${INSTALL_TARGETS_DEFAULT_ARGS}) >+install(FILES krdc_rfb_approver.notifyrc DESTINATION ${DATA_INSTALL_DIR}/krdc_rfb_approver) >+ >+configure_file(org.freedesktop.Telepathy.Client.krdc_rfb_approver.service.in >+ ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krdc_rfb_approver.service) >+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krdc_rfb_approver.service >+ DESTINATION ${DBUS_SERVICES_INSTALL_DIR}) >+ >+# FIXME any better macro for ${XDG_DATA_DIRS} ? >+install(FILES krdc_rfb_approver.client DESTINATION ${SHARE_INSTALL_PREFIX}/telepathy/clients/) >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/krdc_rfb_approver.client kdenetwork-4.9.1/krdc.org/krdc_approver/krdc_rfb_approver.client >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/krdc_rfb_approver.client 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/krdc_rfb_approver.client 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,8 @@ >+[org.freedesktop.Telepathy.Client] >+Interfaces=org.freedesktop.Telepathy.Client.Approver; >+ >+[org.freedesktop.Telepathy.Client.Approver.ApproverChannelFilter 0] >+org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamTube >+org.freedesktop.Telepathy.Channel.Type.StreamTube.Service s=rfb >+org.freedesktop.Telepathy.Channel.Requested b=false >+ >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/krdc_rfb_approver.notifyrc kdenetwork-4.9.1/krdc.org/krdc_approver/krdc_rfb_approver.notifyrc >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/krdc_rfb_approver.notifyrc 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/krdc_rfb_approver.notifyrc 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,165 @@ >+[Global] >+IconName=krdc >+Comment=KRDC >+Comment[ast]=KRDC >+Comment[bg]=KRDC >+Comment[bs]=KRDC >+Comment[ca]=KRDC >+Comment[ca@valencia]=KRDC >+Comment[cs]=KRDC >+Comment[da]=KRDC >+Comment[de]=KRDC >+Comment[el]=KRDC >+Comment[en_GB]=KRDC >+Comment[eo]=KRDC >+Comment[es]=KRDC >+Comment[et]=KRDC >+Comment[eu]=KRDC >+Comment[fi]=KRDC >+Comment[fr]=KRDC >+Comment[ga]=KRDC >+Comment[gl]=KRDC >+Comment[hr]=KRDC >+Comment[hu]=KRDC >+Comment[ia]=KRDC >+Comment[it]=KRDC >+Comment[ja]=KRDC >+Comment[kk]=KRDC >+Comment[km]=KRDC >+Comment[ko]=KRDC >+Comment[lt]=KRDC >+Comment[lv]=KRDC >+Comment[nb]=KRDC >+Comment[nds]=KRDC >+Comment[nl]=KRDC >+Comment[nn]=KRDC >+Comment[pa]=KRDC >+Comment[pl]=KRDC >+Comment[pt]=KRDC >+Comment[pt_BR]=KRDC >+Comment[ro]=KRDC >+Comment[ru]=KRDC >+Comment[si]=KRDC >+Comment[sk]=KRDC >+Comment[sl]=KRDC >+Comment[sr]=ÐÐ ÐЦ >+Comment[sr@ijekavian]=ÐÐ ÐЦ >+Comment[sr@ijekavianlatin]=KRDC >+Comment[sr@latin]=KRDC >+Comment[sv]=KRDC >+Comment[tr]=KRDC >+Comment[ug]=KRDC >+Comment[uk]=KRDC >+Comment[wa]=KRDC >+Comment[x-test]=xxKRDCxx >+Comment[zh_CN]=KRDC >+Comment[zh_TW]=KRDC é 端æ¡é¢é£ç·éæ§ >+Name=KRDC >+Name[ar]=KRDC >+Name[ast]=KRDC >+Name[bg]=KRDC >+Name[bs]=KRDC >+Name[ca]=KRDC >+Name[ca@valencia]=KRDC >+Name[cs]=KRDC >+Name[da]=KRDC >+Name[de]=KRDC >+Name[el]=KRDC >+Name[en_GB]=KRDC >+Name[eo]=KRDC >+Name[es]=KRDC >+Name[et]=KRDC >+Name[eu]=KRDC >+Name[fi]=KRDC >+Name[fr]=KRDC >+Name[ga]=KRDC >+Name[gl]=KRDC >+Name[hne]=à¤à¥à¤à¤°à¤¡à¥à¤¸à¥ >+Name[hr]=KRDC >+Name[hu]=KRDC >+Name[ia]=KRDC >+Name[it]=KRDC >+Name[ja]=KRDC >+Name[kk]=KRDC >+Name[km]=KRDC >+Name[ko]=KRDC >+Name[lt]=KDE nutolusio darbastalio klientas >+Name[lv]=KRDC >+Name[ml]=à´àµà´à´°àµâഡിസി >+Name[nb]=KRDC >+Name[nds]=KRDC >+Name[nl]=KRDC >+Name[nn]=KRDC >+Name[pa]=KRDC >+Name[pl]=KRDC >+Name[pt]=KRDC >+Name[pt_BR]=KRDC >+Name[ro]=KRDC >+Name[ru]=KRDC >+Name[si]=KRDC >+Name[sk]=KRDC >+Name[sl]=KRDC >+Name[sq]=KRDC >+Name[sr]=ÐÐ ÐЦ >+Name[sr@ijekavian]=ÐÐ ÐЦ >+Name[sr@ijekavianlatin]=KRDC >+Name[sr@latin]=KRDC >+Name[sv]=KRDC >+Name[tr]=KRDC >+Name[ug]=KRDC >+Name[uk]=KRDC >+Name[wa]=KRDC >+Name[x-test]=xxKRDCxx >+Name[zh_CN]=KRDC >+Name[zh_TW]=é 端æ¡é¢_KRDC >+ >+[Event/newrfb] >+Name=Incoming RFB Tube >+Name[ast]=RFB Tube entrante >+Name[bs]=Dolazna RFB cijev >+Name[ca]=Tub RFB entrant >+Name[ca@valencia]=Tub RFB entrant >+Name[cs]=PÅÃchozà kanál RFB >+Name[da]=Indkommende RFB-tube >+Name[de]=Eingehender RFB-Tunnel >+Name[el]=ÎÎ¯Î±Ï Î»Î¿Ï ÎµÎ¹ÏεÏÏÏÎ¼ÎµÎ½Î¿Ï RFB >+Name[en_GB]=Incoming RFB Tube >+Name[es]=RFB Tube entrante >+Name[et]=Sisenev RFB-tube >+Name[eu]=Sarrerako RFB hodia >+Name[fi]=Saapuva RFB-putki >+Name[fr]=Canal RFB entrant >+Name[ga]=Tiúb RFB Isteach >+Name[gl]=Tubo RFB entrante >+Name[hr]=DolazeÄi RFB Tube >+Name[hu]=BejövÅ RFB-csatorna >+Name[ia]=RFB Tube in arrivata >+Name[it]=Canale RFB in arrivo >+Name[kk]=ÐÑÑÑÑ RFB аÑнаÑÑ >+Name[km]=RFB Tube á á¼á >+Name[ko]=ë¤ì´ì¤ë RFB Tube >+Name[lt]=Ä®einantis RFB kanalas >+Name[lv]=IenÄkoÅ¡a RFB truba >+Name[nb]=Innkommende RFB-rør >+Name[nds]=Ankamen RFB-Kanaal >+Name[nl]=Inkomende RFB-buis >+Name[nn]=Innkommande RFB-tube >+Name[pa]=ਠਰਹ੠RFB à¨à¨¿à¨à¨¬ >+Name[pl]=PrzychodzÄ ca RFB Tube >+Name[pt]=Ligação de RFB Recebida >+Name[pt_BR]=Ligação de RFB recebida >+Name[si]=à¶´à·à¶¸à·à¶«à·à¶± RFB නලය >+Name[sk]=Prichádzajúci RFB kanál >+Name[sl]=Prejet oddaljen slikovni medpomnilnik >+Name[sr]=Ðолазна РФРÑев >+Name[sr@ijekavian]=Ðолазна РФРÑев >+Name[sr@ijekavianlatin]=Dolazna RFB cev >+Name[sr@latin]=Dolazna RFB cev >+Name[sv]=Inkommande RFB-rör >+Name[tr]=Gelen RFB Tube >+Name[uk]=ÐÑ Ñдний канал RFB >+Name[x-test]=xxIncoming RFB Tubexx >+Name[zh_CN]=æ¶å°ç RFB ç¹å¯¹ç¹è¯·æ± >+Name[zh_TW]=é²ä¾ç RFB Tube >+Action=Popup >+Flags=Persistent >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/main.cpp kdenetwork-4.9.1/krdc.org/krdc_approver/main.cpp >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/main.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/main.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,63 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk> >+** Copyright (C) 2009 Abner Silva <abner.silva@kdemail.net> >+** >+** 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 "approvermanager.h" >+ >+#include <KAboutData> >+#include <KCmdLineArgs> >+#include <KLocalizedString> >+#include <KUniqueApplication> >+ >+#include <TelepathyQt/Types> >+#include <TelepathyQt/Debug> >+#include <TelepathyQt/ClientRegistrar> >+ >+int main(int argc, char **argv) >+{ >+ KAboutData aboutData("krdc_rfb_approver", "KRDC", ki18n("KRDC"), "0.1", >+ ki18n("Approver for KRDC"), KAboutData::License_GPL, >+ ki18n("(C) 2009, Abner Silva")); >+ aboutData.setProgramIconName("krdc"); >+ aboutData.addAuthor(ki18nc("@info:credit", "Abner Silva"), KLocalizedString(), >+ "abner.silva@kdemail.net"); >+ >+ KCmdLineArgs::init(argc, argv, &aboutData); >+ >+ if (!KUniqueApplication::start()) >+ return 0; >+ >+ KUniqueApplication app; >+ app.disableSessionManagement(); >+ >+ Tp::registerTypes(); >+ Tp::enableDebug(true); >+ Tp::enableWarnings(true); >+ >+ Tp::ClientRegistrarPtr registrar = Tp::ClientRegistrar::create(); >+ Tp::SharedPtr<ApproverManager> approverManager; >+ approverManager = Tp::SharedPtr<ApproverManager>(new ApproverManager(0)); >+ registrar->registerClient(Tp::AbstractClientPtr::dynamicCast(approverManager), "krdc_rfb_approver"); >+ >+ return app.exec(); >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_approver/org.freedesktop.Telepathy.Client.krdc_rfb_approver.service.in kdenetwork-4.9.1/krdc.org/krdc_approver/org.freedesktop.Telepathy.Client.krdc_rfb_approver.service.in >--- kdenetwork-4.9.1.org/krdc.org/krdc_approver/org.freedesktop.Telepathy.Client.krdc_rfb_approver.service.in 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_approver/org.freedesktop.Telepathy.Client.krdc_rfb_approver.service.in 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,3 @@ >+[D-BUS Service] >+Name=org.freedesktop.Telepathy.Client.krdc_rfb_approver >+Exec=@CMAKE_INSTALL_PREFIX@/bin/krdc_rfb_approver >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc.desktop kdenetwork-4.9.1/krdc.org/krdc.desktop >--- kdenetwork-4.9.1.org/krdc.org/krdc.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc.desktop 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,122 @@ >+# KDE Config File >+[Desktop Entry] >+Type=Application >+Exec=krdc -caption "%c" %u >+Icon=krdc >+Terminal=false >+Name=KRDC >+Name[ar]=KRDC >+Name[ast]=KRDC >+Name[bg]=KRDC >+Name[bs]=KRDC >+Name[ca]=KRDC >+Name[ca@valencia]=KRDC >+Name[cs]=KRDC >+Name[da]=KRDC >+Name[de]=KRDC >+Name[el]=KRDC >+Name[en_GB]=KRDC >+Name[eo]=KRDC >+Name[es]=KRDC >+Name[et]=KRDC >+Name[eu]=KRDC >+Name[fi]=KRDC >+Name[fr]=KRDC >+Name[ga]=KRDC >+Name[gl]=KRDC >+Name[hne]=à¤à¥à¤à¤°à¤¡à¥à¤¸à¥ >+Name[hr]=KRDC >+Name[hu]=KRDC >+Name[ia]=KRDC >+Name[it]=KRDC >+Name[ja]=KRDC >+Name[kk]=KRDC >+Name[km]=KRDC >+Name[ko]=KRDC >+Name[lt]=KDE nutolusio darbastalio klientas >+Name[lv]=KRDC >+Name[ml]=à´àµà´à´°àµâഡിസി >+Name[nb]=KRDC >+Name[nds]=KRDC >+Name[nl]=KRDC >+Name[nn]=KRDC >+Name[pa]=KRDC >+Name[pl]=KRDC >+Name[pt]=KRDC >+Name[pt_BR]=KRDC >+Name[ro]=KRDC >+Name[ru]=KRDC >+Name[si]=KRDC >+Name[sk]=KRDC >+Name[sl]=KRDC >+Name[sq]=KRDC >+Name[sr]=ÐÐ ÐЦ >+Name[sr@ijekavian]=ÐÐ ÐЦ >+Name[sr@ijekavianlatin]=KRDC >+Name[sr@latin]=KRDC >+Name[sv]=KRDC >+Name[tr]=KRDC >+Name[ug]=KRDC >+Name[uk]=KRDC >+Name[wa]=KRDC >+Name[x-test]=xxKRDCxx >+Name[zh_CN]=KRDC >+Name[zh_TW]=é 端æ¡é¢_KRDC >+GenericName=Remote Desktop Client >+GenericName[ar]=ع٠ÙÙ Ø³Ø·Ø Ø§ÙÙ ÙØªØ¨ Ø§ÙØ¨Ø¹Ùد >+GenericName[ast]=Veceru d'escritoriu remotu >+GenericName[bg]=ÐÑдалеÑен ÑабоÑен Ð¿Ð»Ð¾Ñ >+GenericName[bs]=Klijent udaljene radne povrÅ¡ine >+GenericName[ca]=Client d'escriptori remot >+GenericName[ca@valencia]=Client d'escriptori remot >+GenericName[cs]=Klient vzdálené pracovnà plochy >+GenericName[da]=Ekstern desktopklient >+GenericName[de]=Verbindung zu Fremdrechner >+GenericName[el]=ΠελάÏÎ·Ï Î±ÏομακÏÏ ÏμÎÎ½Î·Ï ÎµÏιÏÎ¬Î½ÎµÎ¹Î±Ï ÎµÏγαÏÎ¯Î±Ï >+GenericName[en_GB]=Remote Desktop Client >+GenericName[es]=Cliente de escritorio remoto >+GenericName[et]=Kaugtöölaua klient >+GenericName[eu]=Urruneko mahaigainaren bezeroa >+GenericName[fi]=Etätyöpöytäasiakas >+GenericName[fr]=Connexion à un bureau distant >+GenericName[ga]=Cliant Deisce Cianda >+GenericName[gl]=Cliente de conexión remota ao escritorio >+GenericName[hne]=रिमà¥à¤ डà¥à¤¸à¥à¤à¤à¤¾à¤ª à¤à¥à¤²à¤¾à¤à¤à¤ >+GenericName[hr]=Klijent za udaljeno povezivanje >+GenericName[hu]=Távoli asztal >+GenericName[ia]=Cliente de scriptorio remote >+GenericName[it]=Client per connessione a desktop remoto >+GenericName[ja]=ãªã¢ã¼ããã¹ã¯ãããã¯ã©ã¤ã¢ã³ã >+GenericName[kk]=ÒаÑÑÒÑан Ò¯ÑÑелге ÒоÑÑÐ»Ñ ÐºÐ»Ð¸ÐµÐ½ÑÑ >+GenericName[km]=áááááá·áá¸âáá¾áâáááááá»âáá¸âá áááá¶á >+GenericName[ko]=ì격 ë°ì¤í¬í± í´ë¼ì´ì¸í¸ >+GenericName[lt]=Nutolusio darbastalio klientas >+GenericName[lv]=AttÄlinÄtÄs darbvirsmas klients >+GenericName[ml]=വിദàµà´° പണിയിഠà´àµà´²à´¯à´¨àµà´±àµ >+GenericName[nb]=Tilkobling til annet skrivebord >+GenericName[nds]=Schriefdisch-Feernverbinnen >+GenericName[nl]=Client voor verbinding met extern bureaublad >+GenericName[nn]=Skrivebordssamband over nettverket >+GenericName[pa]=ਰਿਮà©à¨ ਡà©à¨¸à¨à¨à¨¾à¨ª à¨à¨²à¨¾à¨à¨ >+GenericName[pl]=Klient zdalnego dostÄpu do pulpitu >+GenericName[pt]=Cliente de Ecrãs Remotos >+GenericName[pt_BR]=Cliente de área de trabalho remota >+GenericName[ro]=Client pentru birou la distanÈÄ >+GenericName[ru]=УдалÑннÑй доÑÑÑп к ÑабоÑÐµÐ¼Ñ ÑÑÐ¾Ð»Ñ >+GenericName[si]=දà·à¶»à·à·à¶® à·à·à¶©à¶à¶½ යà·à¶¯à·à¶¸ >+GenericName[sk]=Klient vzdialenej pracovnej plochy >+GenericName[sl]=Odjemalec za oddaljeno namizje >+GenericName[sr]=ÐлиÑÐµÐ½Ñ ÑдаÑене повÑÑи >+GenericName[sr@ijekavian]=ÐлиÑÐµÐ½Ñ ÑдаÑене повÑÑи >+GenericName[sr@ijekavianlatin]=Klijent udaljene povrÅ¡i >+GenericName[sr@latin]=Klijent udaljene povrÅ¡i >+GenericName[sv]=Fjärranslutning till skrivbord >+GenericName[th]=à¹à¸à¸¥à¹à¸à¸à¸à¹à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸·à¹à¸à¸à¸µà¹à¸à¸³à¸à¸²à¸à¸à¸²à¸à¹à¸à¸¥ >+GenericName[tr]=Uzak Masaüstü İstemcisi >+GenericName[ug]=ÙÙØ±Ø§ÙتÙÙÙ Ø¦ÛØ³ØªÛÙØ¦ÛØ³ØªÙ Ø®ÛØ±Ùدار٠>+GenericName[uk]=ÐлÑÑÐ½Ñ Ð·'ÑÐ´Ð½Ð°Ð½Ð½Ñ Ð· вÑÐ´Ð´Ð°Ð»ÐµÐ½Ð¾Ñ ÑÑÑлÑниÑÐµÑ >+GenericName[x-test]=xxRemote Desktop Clientxx >+GenericName[zh_CN]=è¿ç¨æ¡é¢å®¢æ·ç«¯ >+GenericName[zh_TW]=é 端æ¡é¢å®¢æ¶ç«¯ >+X-DocPath=krdc/index.html >+Categories=Qt;KDE;Network;RemoteAccess; >diff -urN kdenetwork-4.9.1.org/krdc.org/krdc_rfb_handler.client kdenetwork-4.9.1/krdc.org/krdc_rfb_handler.client >--- kdenetwork-4.9.1.org/krdc.org/krdc_rfb_handler.client 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdc_rfb_handler.client 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,7 @@ >+[org.freedesktop.Telepathy.Client] >+Interfaces=org.freedesktop.Telepathy.Client.Handler; >+ >+[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0] >+org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamTube >+org.freedesktop.Telepathy.Channel.Type.StreamTube.Service s=rfb >+org.freedesktop.Telepathy.Channel.Requested b=false >diff -urN kdenetwork-4.9.1.org/krdc.org/krdcui.rc kdenetwork-4.9.1/krdc.org/krdcui.rc >--- kdenetwork-4.9.1.org/krdc.org/krdcui.rc 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/krdcui.rc 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,33 @@ >+<?xml version="1.0" encoding="utf-8"?> >+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> >+<gui name="krdc" version="10"> >+<MenuBar> >+ <Menu name="file"> >+ <Action name="new_connection" /> >+ </Menu> >+ <Menu noMerge="1" name="session"><text>&Session</text> >+ <Action name="switch_fullscreen" /> >+ <Action name="take_screenshot" /> >+ <Action name="view_only" /> >+ <Action name="show_local_cursor" /> >+ <Action name="grab_all_keys" /> >+ <Action name="scale" /> >+ <Action name="disconnect" /> >+ </Menu> >+ <Action name="bookmark" /> >+ <Menu name="settings"> >+ <Action name="remote_desktop_dockwidget" /> >+ </Menu> >+</MenuBar> >+<ToolBar fullWidth="false" name="krdc_remote_view_toolbar" newline="false"><text>Remote View Toolbar</text> >+ <Action name="new_connection" /> >+ <Separator /> >+ <Action name="switch_fullscreen" /> >+ <Action name="take_screenshot" /> >+ <Action name="view_only" /> >+ <Action name="show_local_cursor" /> >+ <Action name="grab_all_keys" /> >+ <Action name="scale" /> >+ <Action name="disconnect" /> >+</ToolBar> >+</gui> >diff -urN kdenetwork-4.9.1.org/krdc.org/main.cpp kdenetwork-4.9.1/krdc.org/main.cpp >--- kdenetwork-4.9.1.org/krdc.org/main.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/main.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,105 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2001-2003 Tim Jansen <tim@tjansen.de> >+** Copyright (C) 2007 - 2012 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "mainwindow.h" >+ >+#include <KApplication> >+#include <KLocale> >+#include <KCmdLineArgs> >+#include <KAboutData> >+#include <KDebug> >+ >+#include <QTime> >+ >+int main(int argc, char **argv) >+{ >+ QTime startupTimer; >+ startupTimer.start(); >+ KAboutData aboutData("krdc", 0, ki18n("KRDC"), KDE_VERSION_STRING, >+ ki18n("KDE Remote Desktop Client"), KAboutData::License_GPL, >+ ki18n("(c) 2007-2012, Urs Wolfer\n" >+ "(c) 2001-2003, Tim Jansen\n" >+ "(c) 2002-2003, Arend van Beelen jr.\n" >+ "(c) 2000-2002, Const Kaplinsky\n" >+ "(c) 2000, Tridia Corporation\n" >+ "(c) 1999, AT&T Laboratories Boston\n" >+ "(c) 1999-2003, Matthew Chapman\n" >+ "(c) 2009, Collabora Ltd")); >+ >+ aboutData.addAuthor(ki18n("Urs Wolfer"), ki18n("Developer, Maintainer"), "uwolfer@kde.org"); >+ aboutData.addAuthor(ki18n("Tony Murray"), ki18n("Developer"), "murraytony@gmail.com"); >+ aboutData.addAuthor(ki18n("Tim Jansen"), ki18n("Former Developer"), "tim@tjansen.de"); >+ aboutData.addAuthor(ki18n("Arend van Beelen jr."), ki18n("Initial RDP backend"), "arend@auton.nl"); >+ aboutData.addCredit(ki18n("Brad Hards"), ki18n("Google Summer of Code 2007 KRDC project mentor"), >+ "bradh@frogmouth.net"); >+ aboutData.addCredit(ki18n("LibVNCServer / LibVNCClient developers"), ki18n("VNC client library"), >+ "libvncserver-common@lists.sf.net", "http://libvncserver.sourceforge.net/"); >+ aboutData.addAuthor(ki18n("Abner Silva"), ki18n("Telepathy Tubes Integration"), "abner.silva@kdemail.net"); >+ >+ KCmdLineArgs::init(argc, argv, &aboutData); >+ >+ KCmdLineOptions options; >+ options.add("fullscreen", ki18n("Start KRDC with the provided URL in fullscreen mode (works only with one URL)")); >+ options.add("!+[URL]", ki18n("URLs to connect after startup")); >+ >+ KCmdLineArgs::addCmdLineOptions(options); >+ >+ KApplication app; >+ >+ MainWindow *mainwindow = new MainWindow; >+ mainwindow->show(); >+ >+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); >+ >+ if (args->count() > 0) { >+ for (int i = 0; i < args->count(); ++i) { >+ KUrl u(args->url(i)); >+ >+ if (u.scheme().isEmpty() || u.host().isEmpty()) { // unusable url; try to recover it... >+ QString arg(args->url(i).url()); >+ >+ kDebug(5010) << "unusable url; try to recover it:" << arg; >+ >+ if (arg.lastIndexOf('/') != 0) >+ arg = arg.right(arg.length() - arg.lastIndexOf('/') - 1); >+ >+ if (!arg.contains("://")) >+ arg.prepend("vnc://"); // vnc was default in kde3 times... >+ >+ kDebug(5010) << "recovered url:" << arg; >+ >+ u = arg; >+ } >+ >+ if (!u.isValid()) >+ continue; >+ >+ mainwindow->newConnection(u, ((args->isSet("fullscreen")) && (args->count() == 1))); >+ } >+ } >+ >+ kDebug(5010) << "########## KRDC ready:" << startupTimer.elapsed() << "ms ##########"; >+ >+ return app.exec(); >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/Mainpage.dox kdenetwork-4.9.1/krdc.org/Mainpage.dox >--- kdenetwork-4.9.1.org/krdc.org/Mainpage.dox 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/Mainpage.dox 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,5 @@ >+/** @mainpage KRDC API Reference >+ * >+ * KRDC is a remote desktop client for KDE. >+ * >+ */ >diff -urN kdenetwork-4.9.1.org/krdc.org/mainwindow.cpp kdenetwork-4.9.1/krdc.org/mainwindow.cpp >--- kdenetwork-4.9.1.org/krdc.org/mainwindow.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/mainwindow.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,1244 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 - 2012 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2009 - 2010 Tony Murray <murraytony @ 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 "mainwindow.h" >+ >+#include "remoteview.h" >+#include "settings.h" >+#include "config/preferencesdialog.h" >+#include "floatingtoolbar.h" >+#include "bookmarkmanager.h" >+#include "connectiondelegate.h" >+#include "remotedesktopsmodel.h" >+#include "systemtrayicon.h" >+#include "tabbedviewwidget.h" >+#include "hostpreferences.h" >+ >+#ifdef TELEPATHY_SUPPORT >+#include "tubesmanager.h" >+#endif >+ >+#include <KAction> >+#include <KActionCollection> >+#include <KActionMenu> >+#include <KComboBox> >+#include <KEditToolBar> >+#include <KIcon> >+#include <KInputDialog> >+#include <KLineEdit> >+#include <KLocale> >+#include <KMenu> >+#include <KMenuBar> >+#include <KMessageBox> >+#include <KNotifyConfigWidget> >+#include <KPluginInfo> >+#include <KPushButton> >+#include <KShortcutsDialog> >+#include <KStatusBar> >+#include <KToggleAction> >+#include <KToggleFullScreenAction> >+#include <KServiceTypeTrader> >+ >+#include <QClipboard> >+#include <QDockWidget> >+#include <QFontMetrics> >+#include <QGroupBox> >+#include <QHBoxLayout> >+#include <QHeaderView> >+#include <QLabel> >+#include <QLayout> >+#include <QScrollArea> >+#include <QSortFilterProxyModel> >+#include <QTableView> >+#include <QTimer> >+#include <QToolBar> >+#include <QVBoxLayout> >+ >+MainWindow::MainWindow(QWidget *parent) >+ : KXmlGuiWindow(parent), >+ m_fullscreenWindow(0), >+ m_protocolInput(0), >+ m_addressInput(0), >+ m_toolBar(0), >+ m_currentRemoteView(-1), >+ m_systemTrayIcon(0), >+ m_dockWidgetTableView(0), >+ m_newConnectionTableView(0), >+#ifdef TELEPATHY_SUPPORT >+ m_tubesManager(0), >+#endif >+ m_newConnectionWidget(0) >+{ >+ loadAllPlugins(); >+ >+ setupActions(); >+ >+ setStandardToolBarMenuEnabled(true); >+ >+ m_tabWidget = new TabbedViewWidget(this); >+ m_tabWidget->setMovable(true); >+ m_tabWidget->setTabPosition((KTabWidget::TabPosition) Settings::tabPosition()); >+ >+#if QT_VERSION >= 0x040500 >+ m_tabWidget->setTabsClosable(Settings::tabCloseButton()); >+#else >+ m_tabWidget->setCloseButtonEnabled(Settings::tabCloseButton()); >+#endif >+ >+ connect(m_tabWidget, SIGNAL(closeRequest(QWidget*)), SLOT(closeTab(QWidget*))); >+ >+ if (Settings::tabMiddleClick()) >+ connect(m_tabWidget, SIGNAL(mouseMiddleClick(QWidget*)), SLOT(closeTab(QWidget*))); >+ >+ connect(m_tabWidget, SIGNAL(mouseDoubleClick(QWidget*)), SLOT(openTabSettings(QWidget*))); >+ connect(m_tabWidget, SIGNAL(contextMenu(QWidget*,QPoint)), SLOT(tabContextMenu(QWidget*,QPoint))); >+ >+ m_tabWidget->setMinimumSize(600, 400); >+ setCentralWidget(m_tabWidget); >+ >+ createDockWidget(); >+ >+ createGUI("krdcui.rc"); >+ >+ if (Settings::systemTrayIcon()) { >+ m_systemTrayIcon = new SystemTrayIcon(this); >+ if(m_fullscreenWindow) m_systemTrayIcon->setAssociatedWidget(m_fullscreenWindow); >+ } >+ >+ connect(m_tabWidget, SIGNAL(currentChanged(int)), SLOT(tabChanged(int))); >+ >+ if (Settings::showStatusBar()) >+ statusBar()->showMessage(i18n("KDE Remote Desktop Client started")); >+ >+ updateActionStatus(); // disable remote view actions >+ >+ if (Settings::openSessions().count() == 0) // just create a new connection tab if there are no open sessions >+ m_tabWidget->addTab(newConnectionWidget(), i18n("New Connection")); >+ >+ setAutoSaveSettings(); // e.g toolbar position, mainwindow size, ... >+ >+ if (Settings::rememberSessions()) // give some time to create and show the window first >+ QTimer::singleShot(100, this, SLOT(restoreOpenSessions())); >+} >+ >+MainWindow::~MainWindow() >+{ >+} >+ >+void MainWindow::setupActions() >+{ >+ QAction *connectionAction = actionCollection()->addAction("new_connection"); >+ connectionAction->setText(i18n("New Connection")); >+ connectionAction->setIcon(KIcon("network-connect")); >+ connect(connectionAction, SIGNAL(triggered()), SLOT(newConnectionPage())); >+ >+ QAction *screenshotAction = actionCollection()->addAction("take_screenshot"); >+ screenshotAction->setText(i18n("Copy Screenshot to Clipboard")); >+ screenshotAction->setIconText(i18n("Screenshot")); >+ screenshotAction->setIcon(KIcon("ksnapshot")); >+ connect(screenshotAction, SIGNAL(triggered()), SLOT(takeScreenshot())); >+ >+ KAction *fullscreenAction = actionCollection()->addAction("switch_fullscreen"); // note: please do not switch to KStandardShortcut unless you know what you are doing (see history of this file) >+ fullscreenAction->setText(i18n("Switch to Full Screen Mode")); >+ fullscreenAction->setIconText(i18n("Full Screen")); >+ fullscreenAction->setIcon(KIcon("view-fullscreen")); >+ fullscreenAction->setShortcut(KStandardShortcut::fullScreen()); >+ connect(fullscreenAction, SIGNAL(triggered()), SLOT(switchFullscreen())); >+ >+ QAction *viewOnlyAction = actionCollection()->addAction("view_only"); >+ viewOnlyAction->setCheckable(true); >+ viewOnlyAction->setText(i18n("View Only")); >+ viewOnlyAction->setIcon(KIcon("document-preview")); >+ connect(viewOnlyAction, SIGNAL(triggered(bool)), SLOT(viewOnly(bool))); >+ >+ KAction *disconnectAction = actionCollection()->addAction("disconnect"); >+ disconnectAction->setText(i18n("Disconnect")); >+ disconnectAction->setIcon(KIcon("network-disconnect")); >+ disconnectAction->setShortcut(QKeySequence::Close); >+ connect(disconnectAction, SIGNAL(triggered()), SLOT(disconnectHost())); >+ >+ QAction *showLocalCursorAction = actionCollection()->addAction("show_local_cursor"); >+ showLocalCursorAction->setCheckable(true); >+ showLocalCursorAction->setIcon(KIcon("input-mouse")); >+ showLocalCursorAction->setText(i18n("Show Local Cursor")); >+ showLocalCursorAction->setIconText(i18n("Local Cursor")); >+ connect(showLocalCursorAction, SIGNAL(triggered(bool)), SLOT(showLocalCursor(bool))); >+ >+ QAction *grabAllKeysAction = actionCollection()->addAction("grab_all_keys"); >+ grabAllKeysAction->setCheckable(true); >+ grabAllKeysAction->setIcon(KIcon("configure-shortcuts")); >+ grabAllKeysAction->setText(i18n("Grab All Possible Keys")); >+ grabAllKeysAction->setIconText(i18n("Grab Keys")); >+ connect(grabAllKeysAction, SIGNAL(triggered(bool)), SLOT(grabAllKeys(bool))); >+ >+ QAction *scaleAction = actionCollection()->addAction("scale"); >+ scaleAction->setCheckable(true); >+ scaleAction->setIcon(KIcon("zoom-fit-best")); >+ scaleAction->setText(i18n("Scale Remote Screen to Fit Window Size")); >+ scaleAction->setIconText(i18n("Scale")); >+ connect(scaleAction, SIGNAL(triggered(bool)), SLOT(scale(bool))); >+ >+ KStandardAction::quit(this, SLOT(quit()), actionCollection()); >+ KStandardAction::preferences(this, SLOT(preferences()), actionCollection()); >+ KStandardAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection()); >+ KStandardAction::keyBindings(this, SLOT(configureKeys()), actionCollection()); >+ QAction *configNotifyAction = KStandardAction::configureNotifications(this, SLOT(configureNotifications()), actionCollection()); >+ configNotifyAction->setVisible(false); >+ m_menubarAction = KStandardAction::showMenubar(this, SLOT(showMenubar()), actionCollection()); >+ m_menubarAction->setChecked(!menuBar()->isHidden()); >+ >+ KActionMenu *bookmarkMenu = new KActionMenu(i18n("Bookmarks"), actionCollection()); >+ m_bookmarkManager = new BookmarkManager(actionCollection(), bookmarkMenu->menu(), this); >+ actionCollection()->addAction("bookmark" , bookmarkMenu); >+ connect(m_bookmarkManager, SIGNAL(openUrl(KUrl)), SLOT(newConnection(KUrl))); >+} >+ >+void MainWindow::loadAllPlugins() >+{ >+ const KService::List offers = KServiceTypeTrader::self()->query("KRDC/Plugin"); >+ >+ KConfigGroup conf(KGlobal::config(), "Plugins"); >+ >+ for (int i = 0; i < offers.size(); i++) { >+ KService::Ptr offer = offers[i]; >+ >+ RemoteViewFactory *remoteView; >+ >+ KPluginInfo description(offer); >+ description.load(conf); >+ >+ const bool selected = description.isPluginEnabled(); >+ >+ if (selected) { >+ if ((remoteView = createPluginFromService(offer)) != 0) { >+ kDebug(5010) << "### Plugin " + description.name() + " found ###"; >+ kDebug(5010) << "# Version:" << description.version(); >+ kDebug(5010) << "# Description:" << description.comment(); >+ kDebug(5010) << "# Author:" << description.author(); >+ const int sorting = offer->property("X-KDE-KRDC-Sorting").toInt(); >+ kDebug(5010) << "# Sorting:" << sorting; >+ >+ m_remoteViewFactories.insert(sorting, remoteView); >+ } else { >+ kDebug(5010) << "Error loading KRDC plugin (" << (offers[i])->library() << ')'; >+ } >+ } else { >+ kDebug(5010) << "# Plugin " + description.name() + " found, however it's not activated, skipping..."; >+ continue; >+ } >+ } >+ >+#ifdef TELEPATHY_SUPPORT >+ /* Start tube handler */ >+ m_tubesManager = new TubesManager(this); >+ connect(m_tubesManager, SIGNAL(newConnection(KUrl)), SLOT(newConnection(KUrl))); >+#endif >+} >+ >+RemoteViewFactory *MainWindow::createPluginFromService(const KService::Ptr &service) >+{ >+ //try to load the specified library >+ KPluginFactory *factory = KPluginLoader(service->library()).factory(); >+ >+ if (!factory) { >+ kError(5010) << "KPluginFactory could not load the plugin:" << service->library(); >+ return 0; >+ } >+ >+ RemoteViewFactory *plugin = factory->create<RemoteViewFactory>(); >+ >+ return plugin; >+} >+ >+void MainWindow::restoreOpenSessions() >+{ >+ const QStringList list = Settings::openSessions(); >+ QStringList::ConstIterator it = list.begin(); >+ QStringList::ConstIterator end = list.end(); >+ while (it != end) { >+ newConnection(*it); >+ ++it; >+ } >+} >+ >+KUrl MainWindow::getInputUrl() >+{ >+ KUrl inputUrl; >+ inputUrl.setProtocol(m_protocolInput->currentText()); >+ >+ // Work around incorrect KUrl parsing of @ >+ QString enteredAddress = m_addressInput->text(); >+ int atLocation = enteredAddress.lastIndexOf(QLatin1Char('@')); >+ >+ // set the non-username part of the url >+ inputUrl.setAuthority(enteredAddress.mid(atLocation + 1)); >+ >+ // if the url contains @, set the username part. it needs to be utf8 encoded >+ if(atLocation > 0) { >+ inputUrl.setUserName(enteredAddress.left(atLocation)); >+ } >+ >+ return inputUrl; >+} >+ >+void MainWindow::newConnection(const KUrl &newUrl, bool switchFullscreenWhenConnected, const QString &tabName) >+{ >+ m_switchFullscreenWhenConnected = switchFullscreenWhenConnected; >+ >+ const KUrl url = newUrl.isEmpty() ? getInputUrl() : newUrl; >+ >+ if (!url.isValid() || (url.host().isEmpty() && url.port() < 0) >+ || (!url.path().isEmpty() && url.path() != QLatin1String("/"))) { >+ KMessageBox::error(this, >+ i18n("The entered address does not have the required form.\n Syntax: [username@]host[:port]"), >+ i18n("Malformed URL")); >+ return; >+ } >+ >+ if (m_protocolInput && m_addressInput) { >+ int index = m_protocolInput->findText(url.protocol()); >+ if (index>=0) m_protocolInput->setCurrentIndex(index); >+ m_addressInput->setText(url.authority()); >+ } >+ >+ RemoteView *view = 0; >+ KConfigGroup configGroup = Settings::self()->config()->group("hostpreferences").group(url.prettyUrl(KUrl::RemoveTrailingSlash)); >+ >+ foreach(RemoteViewFactory *factory, m_remoteViewFactories) { >+ if (factory->supportsUrl(url)) { >+ view = factory->createView(this, url, configGroup); >+ kDebug(5010) << "Found plugin to handle url (" + url.url() + "): " + view->metaObject()->className(); >+ break; >+ } >+ } >+ >+ if (!view) { >+ KMessageBox::error(this, >+ i18n("The entered address cannot be handled."), >+ i18n("Unusable URL")); >+ return; >+ } >+ >+ // Configure the view >+ HostPreferences* prefs = view->hostPreferences(); >+ if (! prefs->showDialogIfNeeded(this)) { >+ delete view; >+ return; >+ } >+ >+ saveHostPrefs(); >+ >+ view->showDotCursor(prefs->showLocalCursor() ? RemoteView::CursorOn : RemoteView::CursorOff); >+ view->setViewOnly(prefs->viewOnly()); >+ if (! switchFullscreenWhenConnected) view->enableScaling(prefs->windowedScale()); >+ >+ connect(view, SIGNAL(framebufferSizeChanged(int,int)), this, SLOT(resizeTabWidget(int,int))); >+ connect(view, SIGNAL(statusChanged(RemoteView::RemoteStatus)), this, SLOT(statusChanged(RemoteView::RemoteStatus))); >+ connect(view, SIGNAL(disconnected()), this, SLOT(disconnectHost())); >+ >+ m_remoteViewList.append(view); >+ >+ QScrollArea *scrollArea = createScrollArea(m_tabWidget, view); >+ >+ const int indexOfNewConnectionWidget = m_tabWidget->indexOf(m_newConnectionWidget); >+ if (indexOfNewConnectionWidget >= 0) >+ m_tabWidget->removeTab(indexOfNewConnectionWidget); >+ >+ const int newIndex = m_tabWidget->addTab(scrollArea, KIcon("krdc"), tabName.isEmpty() ? url.prettyUrl(KUrl::RemoveTrailingSlash) : tabName); >+ m_tabWidget->setCurrentIndex(newIndex); >+ tabChanged(newIndex); // force to update m_currentRemoteView (tabChanged is not emitted when start page has been disabled) >+ >+ view->start(); >+} >+ >+void MainWindow::openFromRemoteDesktopsModel(const QModelIndex &index) >+{ >+ const QString urlString = index.data(10001).toString(); >+ const QString nameString = index.data(10003).toString(); >+ if (!urlString.isEmpty()) { >+ const KUrl url(urlString); >+ // first check if url has already been opened; in case show the tab >+ for (int i = 0; i < m_remoteViewList.count(); ++i) { >+ if (m_remoteViewList.at(i)->url() == url) { >+ m_tabWidget->setCurrentIndex(i); >+ return; >+ } >+ } >+ newConnection(url, false, nameString); >+ } >+} >+ >+void MainWindow::resizeTabWidget(int w, int h) >+{ >+ kDebug(5010) << "tabwidget resize, view size: w: " << w << ", h: " << h; >+ if (m_fullscreenWindow) { >+ kDebug(5010) << "in fullscreen mode, refusing to resize"; >+ return; >+ } >+ >+ const QSize viewSize = QSize(w,h); >+ QDesktopWidget *desktop = QApplication::desktop(); >+ >+ if (Settings::fullscreenOnConnect()) { >+ int currentScreen = desktop->screenNumber(this); >+ const QSize screenSize = desktop->screenGeometry(currentScreen).size(); >+ >+ if (screenSize == viewSize) { >+ kDebug(5010) << "screen size equal to target view size -> switch to fullscreen mode"; >+ switchFullscreen(); >+ return; >+ } >+ } >+ >+ if (Settings::resizeOnConnect()) { >+ QWidget* currentWidget = m_tabWidget->currentWidget(); >+ const QSize newWindowSize = size() - currentWidget->frameSize() + viewSize; >+ >+ const QSize desktopSize = desktop->availableGeometry().size(); >+ kDebug(5010) << "new window size: " << newWindowSize << " available space:" << desktopSize; >+ >+ if ((newWindowSize.width() >= desktopSize.width()) || (newWindowSize.height() >= desktopSize.height())) { >+ kDebug(5010) << "remote desktop needs more space than available -> show window maximized"; >+ setWindowState(windowState() | Qt::WindowMaximized); >+ return; >+ } >+ >+ resize(newWindowSize); >+ } >+} >+ >+void MainWindow::statusChanged(RemoteView::RemoteStatus status) >+{ >+ kDebug(5010) << status; >+ >+ // the remoteview is already deleted, so don't show it; otherwise it would crash >+ if (status == RemoteView::Disconnecting || status == RemoteView::Disconnected) >+ return; >+ >+ RemoteView *view = m_remoteViewList.at(m_currentRemoteView); >+ const QString host = view->host(); >+ >+ QString iconName = "krdc"; >+ QString message; >+ >+ switch (status) { >+ case RemoteView::Connecting: >+ iconName = "network-connect"; >+ message = i18n("Connecting to %1", host); >+ break; >+ case RemoteView::Authenticating: >+ iconName = "dialog-password"; >+ message = i18n("Authenticating at %1", host); >+ break; >+ case RemoteView::Preparing: >+ iconName = "view-history"; >+ message = i18n("Preparing connection to %1", host); >+ break; >+ case RemoteView::Connected: >+ iconName = "krdc"; >+ message = i18n("Connected to %1", host); >+ >+ if (view->grabAllKeys() != view->hostPreferences()->grabAllKeys()) { >+ view->setGrabAllKeys(view->hostPreferences()->grabAllKeys()); >+ updateActionStatus(); >+ } >+ >+ // when started with command line fullscreen argument >+ if (m_switchFullscreenWhenConnected) { >+ m_switchFullscreenWhenConnected = false; >+ switchFullscreen(); >+ } >+ >+ if (Settings::rememberHistory()) { >+ m_bookmarkManager->addHistoryBookmark(); >+ } >+ >+ break; >+ default: >+ break; >+ } >+ >+ m_tabWidget->setTabIcon(m_tabWidget->currentIndex(), KIcon(iconName)); >+ if (Settings::showStatusBar()) >+ statusBar()->showMessage(message); >+} >+ >+void MainWindow::takeScreenshot() >+{ >+ const QPixmap snapshot = m_remoteViewList.at(m_currentRemoteView)->takeScreenshot(); >+ >+ QApplication::clipboard()->setPixmap(snapshot); >+} >+ >+void MainWindow::switchFullscreen() >+{ >+ kDebug(5010); >+ >+ if (m_fullscreenWindow) { >+ // Leaving full screen mode >+ m_fullscreenWindow->setWindowState(0); >+ m_fullscreenWindow->hide(); >+ >+ m_tabWidget->setTabBarHidden(m_tabWidget->count() <= 1 && !Settings::showTabBar()); >+ m_tabWidget->setDocumentMode(false); >+ setCentralWidget(m_tabWidget); >+ >+ show(); >+ restoreGeometry(m_mainWindowGeometry); >+ if (m_systemTrayIcon) m_systemTrayIcon->setAssociatedWidget(this); >+ >+ foreach(RemoteView *currentView, m_remoteViewList) { >+ currentView->enableScaling(currentView->hostPreferences()->windowedScale()); >+ } >+ >+ if (m_toolBar) { >+ m_toolBar->hideAndDestroy(); >+ m_toolBar->deleteLater(); >+ m_toolBar = 0; >+ } >+ >+ actionCollection()->action("switch_fullscreen")->setIcon(KIcon("view-fullscreen")); >+ actionCollection()->action("switch_fullscreen")->setText(i18n("Switch to Full Screen Mode")); >+ actionCollection()->action("switch_fullscreen")->setIconText(i18n("Full Screen")); >+ >+ m_fullscreenWindow->deleteLater(); >+ m_fullscreenWindow = 0; >+ } else { >+ // Entering full screen mode >+ m_fullscreenWindow = new QWidget(this, Qt::Window); >+ m_fullscreenWindow->setWindowTitle(i18nc("window title when in full screen mode (for example displayed in tasklist)", >+ "KDE Remote Desktop Client (Full Screen)")); >+ >+ m_mainWindowGeometry = saveGeometry(); >+ >+ m_tabWidget->setTabBarHidden(true); >+ m_tabWidget->setDocumentMode(true); >+ >+ foreach(RemoteView *currentView, m_remoteViewList) { >+ currentView->enableScaling(currentView->hostPreferences()->fullscreenScale()); >+ } >+ >+ QVBoxLayout *fullscreenLayout = new QVBoxLayout(m_fullscreenWindow); >+ fullscreenLayout->setContentsMargins(QMargins(0, 0, 0, 0)); >+ fullscreenLayout->addWidget(m_tabWidget); >+ >+ KToggleFullScreenAction::setFullScreen(m_fullscreenWindow, true); >+ >+ MinimizePixel *minimizePixel = new MinimizePixel(m_fullscreenWindow); >+ minimizePixel->winId(); // force it to be a native widget (prevents problem with QX11EmbedContainer) >+ connect(minimizePixel, SIGNAL(rightClicked()), m_fullscreenWindow, SLOT(showMinimized())); >+ m_fullscreenWindow->installEventFilter(this); >+ >+ m_fullscreenWindow->show(); >+ hide(); // hide after showing the new window so it stays on the same screen >+ >+ if (m_systemTrayIcon) m_systemTrayIcon->setAssociatedWidget(m_fullscreenWindow); >+ showRemoteViewToolbar(); >+ } >+ if (m_tabWidget->currentWidget() == m_newConnectionWidget) { >+ m_addressInput->setFocus(); >+ } >+} >+ >+QScrollArea *MainWindow::createScrollArea(QWidget *parent, RemoteView *remoteView) >+{ >+ RemoteViewScrollArea *scrollArea = new RemoteViewScrollArea(parent); >+ scrollArea->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); >+ >+ connect(scrollArea, SIGNAL(resized(int,int)), remoteView, SLOT(scaleResize(int,int))); >+ >+ QPalette palette = scrollArea->palette(); >+ palette.setColor(QPalette::Dark, Settings::backgroundColor()); >+ scrollArea->setPalette(palette); >+ >+ scrollArea->setBackgroundRole(QPalette::Dark); >+ scrollArea->setFrameStyle(QFrame::NoFrame); >+ >+ scrollArea->setWidget(remoteView); >+ >+ return scrollArea; >+} >+ >+void MainWindow::disconnectHost() >+{ >+ kDebug(5010); >+ >+ RemoteView *view = qobject_cast<RemoteView*>(QObject::sender()); >+ >+ QWidget *widgetToDelete; >+ if (view) { >+ widgetToDelete = (QWidget*) view->parent()->parent(); >+ m_remoteViewList.removeOne(view); >+ } else { >+ widgetToDelete = m_tabWidget->currentWidget(); >+ view = m_remoteViewList.takeAt(m_currentRemoteView); >+ } >+ >+ saveHostPrefs(view); >+ view->startQuitting(); // some deconstructors can't properly quit, so quit early >+ m_tabWidget->removePage(widgetToDelete); >+ widgetToDelete->deleteLater(); >+#ifdef TELEPATHY_SUPPORT >+ m_tubesManager->closeTube(view->url()); >+#endif >+ >+ // if closing the last connection, create new connection tab >+ if (m_tabWidget->count() == 0) { >+ newConnectionPage(false); >+ } >+ >+ // if the newConnectionWidget is the only tab and we are fullscreen, switch to window mode >+ if (m_fullscreenWindow && m_tabWidget->count() == 1 && m_tabWidget->currentWidget() == m_newConnectionWidget) { >+ switchFullscreen(); >+ } >+} >+ >+void MainWindow::closeTab(QWidget *widget) >+{ >+ bool isNewConnectionPage = widget == m_newConnectionWidget; >+ const int index = m_tabWidget->indexOf(widget); >+ >+ kDebug(5010) << index; >+ >+ if (!isNewConnectionPage) { >+ RemoteView *view = m_remoteViewList.takeAt(index); >+ view->startQuitting(); >+#ifdef TELEPATHY_SUPPORT >+ m_tubesManager->closeTube(view->url()); >+#endif >+ widget->deleteLater(); >+ } >+ >+ m_tabWidget->removePage(widget); >+ >+ // if closing the last connection, create new connection tab >+ if (m_tabWidget->count() == 0) { >+ newConnectionPage(false); >+ } >+ >+ // if the newConnectionWidget is the only tab and we are fullscreen, switch to window mode >+ if (m_fullscreenWindow && m_tabWidget->count() == 1 && m_tabWidget->currentWidget() == m_newConnectionWidget) { >+ switchFullscreen(); >+ } >+} >+ >+void MainWindow::openTabSettings(QWidget *widget) >+{ >+ RemoteViewScrollArea *scrollArea = qobject_cast<RemoteViewScrollArea*>(widget); >+ if (!scrollArea) return; >+ RemoteView *view = qobject_cast<RemoteView*>(scrollArea->widget()); >+ if (!view) return; >+ >+ const QString url = view->url().url(); >+ kDebug(5010) << url; >+ >+ showSettingsDialog(url); >+} >+ >+void MainWindow::showSettingsDialog(const QString &url) >+{ >+ HostPreferences *prefs = 0; >+ >+ foreach(RemoteViewFactory *factory, remoteViewFactoriesList()) { >+ if (factory->supportsUrl(url)) { >+ prefs = factory->createHostPreferences(Settings::self()->config()->group("hostpreferences").group(url), this); >+ if (prefs) { >+ kDebug(5010) << "Found plugin to handle url (" + url + "): " + prefs->metaObject()->className(); >+ } else { >+ kDebug(5010) << "Found plugin to handle url (" + url + "), but plugin does not provide preferences"; >+ } >+ } >+ } >+ >+ if (prefs) { >+ prefs->setShownWhileConnected(true); >+ prefs->showDialog(this); >+ } else { >+ KMessageBox::error(this, >+ i18n("The selected host cannot be handled."), >+ i18n("Unusable URL")); >+ } >+} >+ >+void MainWindow::showConnectionContextMenu(const QPoint &pos) >+{ >+ // QTableView does not take headers into account when it does mapToGlobal(), so calculate the offset >+ QPoint offset = QPoint(m_newConnectionTableView->verticalHeader()->size().width(), >+ m_newConnectionTableView->horizontalHeader()->size().height()); >+ QModelIndex index = m_newConnectionTableView->indexAt(pos); >+ >+ if (!index.isValid()) >+ return; >+ >+ const QString url = index.data(10001).toString(); >+ const QString title = m_remoteDesktopsModelProxy->index(index.row(), RemoteDesktopsModel::Title).data(Qt::DisplayRole).toString(); >+ const QString source = m_remoteDesktopsModelProxy->index(index.row(), RemoteDesktopsModel::Source).data(Qt::DisplayRole).toString(); >+ >+ KMenu *menu = new KMenu(m_newConnectionTableView); >+ menu->addTitle(url); >+ >+ QAction *connectAction = menu->addAction(KIcon("network-connect"), i18n("Connect")); >+ QAction *renameAction = menu->addAction(KIcon("edit-rename"), i18n("Rename")); >+ QAction *settingsAction = menu->addAction(KIcon("configure"), i18n("Settings")); >+ QAction *deleteAction = menu->addAction(KIcon("edit-delete"), i18n("Delete")); >+ >+ // not very clean, but it works, >+ if (!(source == i18nc("Where each displayed link comes from", "Bookmarks") || >+ source == i18nc("Where each displayed link comes from", "History"))) { >+ renameAction->setEnabled(false); >+ deleteAction->setEnabled(false); >+ } >+ >+ QAction *selectedAction = menu->exec(m_newConnectionTableView->mapToGlobal(pos + offset)); >+ >+ if (selectedAction == connectAction) { >+ openFromRemoteDesktopsModel(index); >+ } else if (selectedAction == renameAction) { >+ //TODO: use inline editor if possible >+ bool ok = false; >+ const QString newTitle = KInputDialog::getText(i18n("Rename %1", title), i18n("Rename %1 to", title), "", &ok, this); >+ if (ok && !newTitle.isEmpty()) { >+ BookmarkManager::updateTitle(m_bookmarkManager->getManager(), url, newTitle); >+ } >+ } else if (selectedAction == settingsAction) { >+ showSettingsDialog(url); >+ } else if (selectedAction == deleteAction) { >+ >+ if (KMessageBox::warningContinueCancel(this, i18n("Are you sure you want to delete %1?", url), i18n("Delete %1", title), >+ KStandardGuiItem::del()) == KMessageBox::Continue) { >+ BookmarkManager::removeByUrl(m_bookmarkManager->getManager(), url); >+ } >+ } >+ >+ menu->deleteLater(); >+} >+ >+void MainWindow::tabContextMenu(QWidget *widget, const QPoint &point) >+{ >+ RemoteViewScrollArea *scrollArea = qobject_cast<RemoteViewScrollArea*>(widget); >+ if (!scrollArea) return; >+ RemoteView *view = qobject_cast<RemoteView*>(scrollArea->widget()); >+ if (!view) return; >+ >+ const QString url = view->url().prettyUrl(KUrl::RemoveTrailingSlash); >+ kDebug(5010) << url; >+ >+ KMenu *menu = new KMenu(this); >+ menu->addTitle(url); >+ QAction *bookmarkAction = menu->addAction(KIcon("bookmark-new"), i18n("Add Bookmark")); >+ QAction *closeAction = menu->addAction(KIcon("tab-close"), i18n("Close Tab")); >+ QAction *selectedAction = menu->exec(point); >+ if (selectedAction) { >+ if (selectedAction == closeAction) { >+ closeTab(widget); >+ } else if (selectedAction == bookmarkAction) { >+ m_bookmarkManager->addManualBookmark(url, url); >+ } >+ } >+ menu->deleteLater(); >+} >+ >+void MainWindow::showLocalCursor(bool showLocalCursor) >+{ >+ kDebug(5010) << showLocalCursor; >+ >+ RemoteView* view = m_remoteViewList.at(m_currentRemoteView); >+ view->showDotCursor(showLocalCursor ? RemoteView::CursorOn : RemoteView::CursorOff); >+ view->hostPreferences()->setShowLocalCursor(showLocalCursor); >+ saveHostPrefs(); >+} >+ >+void MainWindow::viewOnly(bool viewOnly) >+{ >+ kDebug(5010) << viewOnly; >+ >+ RemoteView* view = m_remoteViewList.at(m_currentRemoteView); >+ view->setViewOnly(viewOnly); >+ view->hostPreferences()->setViewOnly(viewOnly); >+ saveHostPrefs(); >+} >+ >+void MainWindow::grabAllKeys(bool grabAllKeys) >+{ >+ kDebug(5010); >+ >+ RemoteView* view = m_remoteViewList.at(m_currentRemoteView); >+ view->setGrabAllKeys(grabAllKeys); >+ view->hostPreferences()->setGrabAllKeys(grabAllKeys); >+ saveHostPrefs(); >+} >+ >+void MainWindow::scale(bool scale) >+{ >+ kDebug(5010); >+ >+ RemoteView* view = m_remoteViewList.at(m_currentRemoteView); >+ view->enableScaling(scale); >+ if (m_fullscreenWindow) >+ view->hostPreferences()->setFullscreenScale(scale); >+ else >+ view->hostPreferences()->setWindowedScale(scale); >+ >+ saveHostPrefs(); >+} >+ >+void MainWindow::showRemoteViewToolbar() >+{ >+ kDebug(5010); >+ >+ if (!m_toolBar) { >+ actionCollection()->action("switch_fullscreen")->setIcon(KIcon("view-restore")); >+ actionCollection()->action("switch_fullscreen")->setText(i18n("Switch to Window Mode")); >+ actionCollection()->action("switch_fullscreen")->setIconText(i18n("Window Mode")); >+ >+ m_toolBar = new FloatingToolBar(m_fullscreenWindow, m_fullscreenWindow); >+ m_toolBar->winId(); // force it to be a native widget (prevents problem with QX11EmbedContainer) >+ m_toolBar->setSide(FloatingToolBar::Top); >+ >+ KComboBox *sessionComboBox = new KComboBox(m_toolBar); >+ sessionComboBox->setStyleSheet("QComboBox:!editable{background:transparent;}"); >+ sessionComboBox->setModel(m_tabWidget->getModel()); >+ sessionComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); >+ sessionComboBox->setCurrentIndex(m_tabWidget->currentIndex()); >+ connect(sessionComboBox, SIGNAL(activated(int)), m_tabWidget, SLOT(setCurrentIndex(int))); >+ connect(m_tabWidget, SIGNAL(currentChanged(int)), sessionComboBox, SLOT(setCurrentIndex(int))); >+ m_toolBar->addWidget(sessionComboBox); >+ >+ QToolBar *buttonBox = new QToolBar(m_toolBar); >+ >+ buttonBox->addAction(actionCollection()->action("new_connection")); >+ buttonBox->addAction(actionCollection()->action("switch_fullscreen")); >+ >+ QAction *minimizeAction = new QAction(m_toolBar); >+ minimizeAction->setIcon(KIcon("go-down")); >+ minimizeAction->setText(i18n("Minimize Full Screen Window")); >+ connect(minimizeAction, SIGNAL(triggered()), m_fullscreenWindow, SLOT(showMinimized())); >+ buttonBox->addAction(minimizeAction); >+ >+ buttonBox->addAction(actionCollection()->action("take_screenshot")); >+ buttonBox->addAction(actionCollection()->action("view_only")); >+ buttonBox->addAction(actionCollection()->action("show_local_cursor")); >+ buttonBox->addAction(actionCollection()->action("grab_all_keys")); >+ buttonBox->addAction(actionCollection()->action("scale")); >+ buttonBox->addAction(actionCollection()->action("disconnect")); >+ buttonBox->addAction(actionCollection()->action("file_quit")); >+ >+ QAction *stickToolBarAction = new QAction(m_toolBar); >+ stickToolBarAction->setCheckable(true); >+ stickToolBarAction->setIcon(KIcon("object-locked")); >+ stickToolBarAction->setText(i18n("Stick Toolbar")); >+ connect(stickToolBarAction, SIGNAL(triggered(bool)), m_toolBar, SLOT(setSticky(bool))); >+ buttonBox->addAction(stickToolBarAction); >+ >+ m_toolBar->addWidget(buttonBox); >+ } >+} >+ >+void setActionStatus(QAction* action, bool enabled, bool visible, bool checked) >+{ >+ action->setEnabled(enabled); >+ action->setVisible(visible); >+ action->setChecked(checked); >+} >+ >+void MainWindow::updateActionStatus() >+{ >+ kDebug(5010) << m_tabWidget->currentIndex(); >+ >+ bool enabled = true; >+ >+ if (m_tabWidget->currentWidget() == m_newConnectionWidget) >+ enabled = false; >+ >+ RemoteView* view = (m_currentRemoteView >= 0 && enabled) ? m_remoteViewList.at(m_currentRemoteView) : 0; >+ >+ actionCollection()->action("take_screenshot")->setEnabled(enabled); >+ actionCollection()->action("disconnect")->setEnabled(enabled); >+ >+ setActionStatus(actionCollection()->action("view_only"), >+ enabled, >+ true, >+ view ? view->viewOnly() : false); >+ >+ setActionStatus(actionCollection()->action("show_local_cursor"), >+ enabled, >+ view ? view->supportsLocalCursor() : false, >+ view ? view->dotCursorState() == RemoteView::CursorOn : false); >+ >+ setActionStatus(actionCollection()->action("scale"), >+ enabled, >+ view ? view->supportsScaling() : false, >+ view ? view->scaling() : false); >+ >+ setActionStatus(actionCollection()->action("grab_all_keys"), >+ enabled, >+ enabled, >+ view ? view->grabAllKeys() : false); >+} >+ >+void MainWindow::preferences() >+{ >+ // An instance of your dialog could be already created and could be >+ // cached, in which case you want to display the cached dialog >+ // instead of creating another one >+ if (PreferencesDialog::showDialog("preferences")) >+ return; >+ >+ // KConfigDialog didn't find an instance of this dialog, so lets >+ // create it: >+ PreferencesDialog *dialog = new PreferencesDialog(this, Settings::self()); >+ >+ // User edited the configuration - update your local copies of the >+ // configuration data >+ connect(dialog, SIGNAL(settingsChanged(QString)), >+ this, SLOT(updateConfiguration())); >+ >+ dialog->show(); >+} >+ >+void MainWindow::updateConfiguration() >+{ >+ if (!Settings::showStatusBar()) >+ statusBar()->deleteLater(); >+ else >+ statusBar()->showMessage(""); // force creation of statusbar >+ >+ m_tabWidget->setTabBarHidden((m_tabWidget->count() <= 1 && !Settings::showTabBar()) || m_fullscreenWindow); >+ m_tabWidget->setTabPosition((KTabWidget::TabPosition) Settings::tabPosition()); >+#if QT_VERSION >= 0x040500 >+ m_tabWidget->setTabsClosable(Settings::tabCloseButton()); >+#else >+ m_tabWidget->setCloseButtonEnabled(Settings::tabCloseButton()); >+#endif >+ disconnect(m_tabWidget, SIGNAL(mouseMiddleClick(QWidget*)), this, SLOT(closeTab(QWidget*))); // just be sure it is not connected twice >+ if (Settings::tabMiddleClick()) >+ connect(m_tabWidget, SIGNAL(mouseMiddleClick(QWidget*)), SLOT(closeTab(QWidget*))); >+ >+ if (Settings::systemTrayIcon() && !m_systemTrayIcon) { >+ m_systemTrayIcon = new SystemTrayIcon(this); >+ if(m_fullscreenWindow) m_systemTrayIcon->setAssociatedWidget(m_fullscreenWindow); >+ } else if (m_systemTrayIcon) { >+ delete m_systemTrayIcon; >+ m_systemTrayIcon = 0; >+ } >+ >+ // update the scroll areas background color >+ for (int i = 0; i < m_tabWidget->count(); ++i) { >+ QPalette palette = m_tabWidget->widget(i)->palette(); >+ palette.setColor(QPalette::Dark, Settings::backgroundColor()); >+ m_tabWidget->widget(i)->setPalette(palette); >+ } >+ >+ // Send update configuration message to all views >+ for (int i = 0; i < m_remoteViewList.count(); ++i) { >+ m_remoteViewList.at(i)->updateConfiguration(); >+ } >+ >+} >+ >+void MainWindow::quit(bool systemEvent) >+{ >+ const bool haveRemoteConnections = !m_remoteViewList.isEmpty(); >+ if (systemEvent || !haveRemoteConnections || KMessageBox::warningContinueCancel(this, >+ i18n("Are you sure you want to quit the KDE Remote Desktop Client?"), >+ i18n("Confirm Quit"), >+ KStandardGuiItem::quit(), KStandardGuiItem::cancel(), >+ "DoNotAskBeforeExit") == KMessageBox::Continue) { >+ >+ if (Settings::rememberSessions()) { // remember open remote views for next startup >+ QStringList list; >+ for (int i = 0; i < m_remoteViewList.count(); ++i) { >+ kDebug(5010) << m_remoteViewList.at(i)->url(); >+ list.append(m_remoteViewList.at(i)->url().prettyUrl(KUrl::RemoveTrailingSlash)); >+ } >+ Settings::setOpenSessions(list); >+ } >+ >+ saveHostPrefs(); >+ >+ Settings::self()->writeConfig(); >+ >+ qApp->quit(); >+ } >+} >+ >+void MainWindow::configureNotifications() >+{ >+ KNotifyConfigWidget::configure(this); >+} >+ >+void MainWindow::configureKeys() >+{ >+ KShortcutsDialog::configure(actionCollection()); >+} >+ >+void MainWindow::configureToolbars() >+{ >+ KEditToolBar edit(actionCollection()); >+ connect(&edit, SIGNAL(newToolBarConfig()), this, SLOT(newToolbarConfig())); >+ edit.exec(); >+} >+ >+void MainWindow::showMenubar() >+{ >+ if (m_menubarAction->isChecked()) >+ menuBar()->show(); >+ else >+ menuBar()->hide(); >+} >+ >+bool MainWindow::eventFilter(QObject *obj, QEvent *event) >+{ >+ // check for close events from the fullscreen window. >+ if (obj == m_fullscreenWindow && event->type() == QEvent::Close) { >+ quit(true); >+ } >+ // allow other events to pass through. >+ return QObject::eventFilter(obj, event); >+} >+ >+void MainWindow::closeEvent(QCloseEvent *event) >+{ >+ if (event->spontaneous()) { // Returns true if the event originated outside the application (a system event); otherwise returns false. >+ event->ignore(); >+ if (Settings::systemTrayIcon()) { >+ hide(); // just hide the mainwindow, keep it in systemtray >+ } else { >+ quit(); >+ } >+ } else { >+ quit(true); >+ } >+} >+ >+void MainWindow::saveProperties(KConfigGroup &group) >+{ >+ kDebug(5010); >+ KMainWindow::saveProperties(group); >+ saveHostPrefs(); >+} >+ >+void MainWindow::saveHostPrefs(RemoteView* view) >+{ >+ // Save default window size for currently active view >+ if (!view) >+ view = m_currentRemoteView >= 0 ? m_remoteViewList.at(m_currentRemoteView) : 0; >+ >+ // should saving this be a user option? >+ if (view && view->scaling()) { >+ QSize viewSize = m_tabWidget->currentWidget()->size(); >+ kDebug(5010) << "saving window size:" << viewSize; >+ view->hostPreferences()->setWidth(viewSize.width()); >+ view->hostPreferences()->setHeight(viewSize.height()); >+ } >+ >+ Settings::self()->config()->sync(); >+} >+ >+void MainWindow::tabChanged(int index) >+{ >+ kDebug(5010) << index; >+ >+ m_tabWidget->setTabBarHidden((m_tabWidget->count() <= 1 && !Settings::showTabBar()) || m_fullscreenWindow); >+ >+ m_currentRemoteView = index; >+ >+ if (m_tabWidget->currentWidget() == m_newConnectionWidget) { >+ m_currentRemoteView = -1; >+ if(m_addressInput) m_addressInput->setFocus(); >+ } >+ >+ const QString tabTitle = m_tabWidget->tabText(index).remove('&'); >+ setCaption(tabTitle == i18n("New Connection") ? QString() : tabTitle); >+ >+ updateActionStatus(); >+} >+ >+QWidget* MainWindow::newConnectionWidget() >+{ >+ if (m_newConnectionWidget) >+ return m_newConnectionWidget; >+ >+ m_newConnectionWidget = new QWidget(this); >+ >+ QVBoxLayout *startLayout = new QVBoxLayout(m_newConnectionWidget); >+ startLayout->setContentsMargins(QMargins(8, 12, 8, 4)); >+ >+ QLabel *headerLabel = new QLabel(m_newConnectionWidget); >+ headerLabel->setText(i18n("<h1>KDE Remote Desktop Client</h1><br />Enter or select the address of the desktop you would like to connect to.")); >+ >+ QLabel *headerIconLabel = new QLabel(m_newConnectionWidget); >+ headerIconLabel->setPixmap(KIcon("krdc").pixmap(80)); >+ >+ QHBoxLayout *headerLayout = new QHBoxLayout; >+ headerLayout->addWidget(headerLabel, 1, Qt::AlignTop); >+ headerLayout->addWidget(headerIconLabel); >+ startLayout->addLayout(headerLayout); >+ >+ { >+ QHBoxLayout *connectLayout = new QHBoxLayout; >+ >+ QLabel *addressLabel = new QLabel(i18n("Connect to:"), m_newConnectionWidget); >+ m_protocolInput = new KComboBox(m_newConnectionWidget); >+ m_addressInput = new KLineEdit(m_newConnectionWidget); >+ m_addressInput->setClearButtonShown(true); >+ m_addressInput->setClickMessage(i18n("Type here to connect to an address and filter the list.")); >+ connect(m_addressInput, SIGNAL(textChanged(QString)), m_remoteDesktopsModelProxy, SLOT(setFilterFixedString(QString))); >+ >+ foreach(RemoteViewFactory *factory, m_remoteViewFactories) { >+ m_protocolInput->addItem(factory->scheme()); >+ } >+ >+ connect(m_addressInput, SIGNAL(returnPressed()), SLOT(newConnection())); >+ m_addressInput->setToolTip(i18n("Type an IP or DNS Name here. Clear the line to get a list of connection methods.")); >+ >+ KPushButton *connectButton = new KPushButton(m_newConnectionWidget); >+ connectButton->setToolTip(i18n("Goto Address")); >+ connectButton->setIcon(KIcon("go-jump-locationbar")); >+ connect(connectButton, SIGNAL(clicked()), SLOT(newConnection())); >+ >+ connectLayout->addWidget(addressLabel); >+ connectLayout->addWidget(m_protocolInput); >+ connectLayout->addWidget(m_addressInput, 1); >+ connectLayout->addWidget(connectButton); >+ connectLayout->setContentsMargins(QMargins(0, 6, 0, 10)); >+ startLayout->addLayout(connectLayout); >+ } >+ >+ { >+ m_newConnectionTableView = new QTableView(m_newConnectionWidget); >+ m_newConnectionTableView->setModel(m_remoteDesktopsModelProxy); >+ >+ // set up the view so it looks nice >+ m_newConnectionTableView->setItemDelegate(new ConnectionDelegate(m_newConnectionTableView)); >+ m_newConnectionTableView->setShowGrid(false); >+ m_newConnectionTableView->setSelectionMode(QAbstractItemView::NoSelection); >+ m_newConnectionTableView->verticalHeader()->hide(); >+ m_newConnectionTableView->verticalHeader()->setDefaultSectionSize( >+ m_newConnectionTableView->fontMetrics().height() + 3); >+ m_newConnectionTableView->horizontalHeader()->setStretchLastSection(true); >+ m_newConnectionTableView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); >+ m_newConnectionTableView->setAlternatingRowColors(true); >+ // set up sorting and actions (double click open, right click custom menu) >+ m_newConnectionTableView->setSortingEnabled(true); >+ m_newConnectionTableView->sortByColumn(Settings::connectionListSortColumn(), Qt::SortOrder(Settings::connectionListSortOrder())); >+ connect(m_newConnectionTableView->horizontalHeader(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), >+ SLOT(saveConnectionListSort(int,Qt::SortOrder))); >+ connect(m_newConnectionTableView, SIGNAL(doubleClicked(QModelIndex)), >+ SLOT(openFromRemoteDesktopsModel(QModelIndex))); >+ m_newConnectionTableView->setContextMenuPolicy(Qt::CustomContextMenu); >+ connect(m_newConnectionTableView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showConnectionContextMenu(QPoint))); >+ >+ startLayout->addWidget(m_newConnectionTableView); >+ } >+ >+ return m_newConnectionWidget; >+} >+ >+void MainWindow::saveConnectionListSort(const int logicalindex, const Qt::SortOrder order) >+{ >+ Settings::setConnectionListSortColumn(logicalindex); >+ Settings::setConnectionListSortOrder(order); >+ Settings::self()->writeConfig(); >+} >+ >+void MainWindow::newConnectionPage(bool clearInput) >+{ >+ const int indexOfNewConnectionWidget = m_tabWidget->indexOf(m_newConnectionWidget); >+ if (indexOfNewConnectionWidget >= 0) >+ m_tabWidget->setCurrentIndex(indexOfNewConnectionWidget); >+ else { >+ const int index = m_tabWidget->addTab(newConnectionWidget(), i18n("New Connection")); >+ m_tabWidget->setCurrentIndex(index); >+ } >+ if(clearInput) { >+ m_addressInput->clear(); >+ } else { >+ m_addressInput->selectAll(); >+ } >+ m_addressInput->setFocus(); >+} >+ >+QList<RemoteView *> MainWindow::remoteViewList() const >+{ >+ return m_remoteViewList; >+} >+ >+QList<RemoteViewFactory *> MainWindow::remoteViewFactoriesList() const >+{ >+ return m_remoteViewFactories.values(); >+} >+ >+int MainWindow::currentRemoteView() const >+{ >+ return m_currentRemoteView; >+} >+ >+void MainWindow::createDockWidget() >+{ >+ QDockWidget *remoteDesktopsDockWidget = new QDockWidget(this); >+ QWidget *remoteDesktopsDockLayoutWidget = new QWidget(remoteDesktopsDockWidget); >+ QVBoxLayout *remoteDesktopsDockLayout = new QVBoxLayout(remoteDesktopsDockLayoutWidget); >+ remoteDesktopsDockWidget->setObjectName("remoteDesktopsDockWidget"); // required for saving position / state >+ remoteDesktopsDockWidget->setWindowTitle(i18n("Remote Desktops")); >+ QFontMetrics fontMetrics(remoteDesktopsDockWidget->font()); >+ remoteDesktopsDockWidget->setMinimumWidth(fontMetrics.width("vnc://192.168.100.100:6000")); >+ actionCollection()->addAction("remote_desktop_dockwidget", >+ remoteDesktopsDockWidget->toggleViewAction()); >+ >+ m_dockWidgetTableView = new QTableView(remoteDesktopsDockLayoutWidget); >+ RemoteDesktopsModel *remoteDesktopsModel = new RemoteDesktopsModel(this); >+ m_remoteDesktopsModelProxy = new QSortFilterProxyModel(this); >+ m_remoteDesktopsModelProxy->setSourceModel(remoteDesktopsModel); >+ m_remoteDesktopsModelProxy->setFilterCaseSensitivity(Qt::CaseInsensitive); >+ m_remoteDesktopsModelProxy->setFilterRole(10002); >+ m_dockWidgetTableView->setModel(m_remoteDesktopsModelProxy); >+ >+ m_dockWidgetTableView->setShowGrid(false); >+ m_dockWidgetTableView->verticalHeader()->hide(); >+ m_dockWidgetTableView->verticalHeader()->setDefaultSectionSize( >+ m_dockWidgetTableView->fontMetrics().height() + 2); >+ m_dockWidgetTableView->horizontalHeader()->hide(); >+ m_dockWidgetTableView->horizontalHeader()->setStretchLastSection(true); >+ // hide all columns, then show the one we want >+ for (int i=0; i<m_remoteDesktopsModelProxy->columnCount(); i++) { >+ m_dockWidgetTableView->hideColumn(i); >+ } >+ m_dockWidgetTableView->showColumn(RemoteDesktopsModel::Title); >+ m_dockWidgetTableView->sortByColumn(RemoteDesktopsModel::Title, Qt::AscendingOrder); >+ >+ connect(m_dockWidgetTableView, SIGNAL(doubleClicked(QModelIndex)), >+ SLOT(openFromRemoteDesktopsModel(QModelIndex))); >+ >+ KLineEdit *filterLineEdit = new KLineEdit(remoteDesktopsDockLayoutWidget); >+ filterLineEdit->setClickMessage(i18n("Filter")); >+ filterLineEdit->setClearButtonShown(true); >+ connect(filterLineEdit, SIGNAL(textChanged(QString)), m_remoteDesktopsModelProxy, SLOT(setFilterFixedString(QString))); >+ remoteDesktopsDockLayout->addWidget(filterLineEdit); >+ remoteDesktopsDockLayout->addWidget(m_dockWidgetTableView); >+ remoteDesktopsDockWidget->setWidget(remoteDesktopsDockLayoutWidget); >+ addDockWidget(Qt::LeftDockWidgetArea, remoteDesktopsDockWidget); >+} >+ >+#include "mainwindow.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/mainwindow.h kdenetwork-4.9.1/krdc.org/mainwindow.h >--- kdenetwork-4.9.1.org/krdc.org/mainwindow.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/mainwindow.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,187 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 - 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2009 - 2010 Tony Murray <murraytony @ 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 MAINWINDOW_H >+#define MAINWINDOW_H >+ >+#include "remoteview.h" >+#include "remoteviewfactory.h" >+#include "tabbedviewwidget.h" >+ >+#include <KService> >+#include <KXmlGuiWindow> >+ >+class KComboBox; >+class KLineEdit; >+class KPushButton; >+class KToggleAction; >+class KTabWidget; >+ >+class BookmarkManager; >+class FloatingToolBar; >+class RemoteView; >+class SystemTrayIcon; >+class TabbedViewWidget; >+ >+class QScrollArea; >+class QModelIndex; >+class QSortFilterProxyModel; >+class QTableView; >+ >+#ifdef TELEPATHY_SUPPORT >+class TubesManager; >+#endif >+ >+class MainWindow : public KXmlGuiWindow >+{ >+ Q_OBJECT >+public: >+ MainWindow(QWidget *parent = 0); >+ ~MainWindow(); >+ >+ QList<RemoteView *> remoteViewList() const; >+ QList<RemoteViewFactory *> remoteViewFactoriesList() const; >+ int currentRemoteView() const; >+ >+public slots: >+ void newConnection(const KUrl &newUrl = KUrl(), bool switchFullscreenWhenConnected = false, const QString &tabName = QString()); >+ >+protected: >+ virtual void closeEvent(QCloseEvent *event); >+ bool eventFilter(QObject *obj, QEvent *event); // checks for close events on fs window >+ virtual void saveProperties(KConfigGroup &group); >+ void saveHostPrefs(RemoteView *view = 0); >+ >+private slots: >+ void restoreOpenSessions(); >+ void quit(bool systemEvent = false); >+ void preferences(); >+ void configureNotifications(); >+ void configureKeys(); >+ void configureToolbars(); >+ void showMenubar(); >+ void resizeTabWidget(int w, int h); >+ void statusChanged(RemoteView::RemoteStatus status); >+ void showRemoteViewToolbar(); >+ void takeScreenshot(); >+ void switchFullscreen(); >+ void disconnectHost(); >+ void closeTab(QWidget *widget); >+ void openTabSettings(QWidget *widget); >+ void tabContextMenu(QWidget *widget, const QPoint &point); >+ void viewOnly(bool viewOnly); >+ void showLocalCursor(bool showLocalCursor); >+ void grabAllKeys(bool grabAllKeys); >+ void scale(bool scale); >+ void updateActionStatus(); >+ void updateConfiguration(); >+ void tabChanged(int index); >+ QWidget* newConnectionWidget(); >+ void newConnectionPage(bool clearInput = true); >+ void openFromRemoteDesktopsModel(const QModelIndex &index); >+ void createDockWidget(); >+ void showConnectionContextMenu(const QPoint &pos); >+ void saveConnectionListSort(const int logicalindex, const Qt::SortOrder order); >+ >+private: >+ void setupActions(); >+ void loadAllPlugins(); >+ RemoteViewFactory *createPluginFromService(const KService::Ptr &service); >+ void showSettingsDialog(const QString &url); >+ QScrollArea *createScrollArea(QWidget *parent, RemoteView *remoteView); >+ KUrl getInputUrl(); >+ >+ QWidget *m_fullscreenWindow; >+ QByteArray m_mainWindowGeometry; >+ >+ KToggleAction *m_menubarAction; >+ TabbedViewWidget *m_tabWidget; >+ KComboBox *m_protocolInput; >+ KLineEdit *m_addressInput; >+ >+ FloatingToolBar *m_toolBar; >+ >+ BookmarkManager *m_bookmarkManager; >+ >+ QList<RemoteView *> m_remoteViewList; >+ QMap<int, RemoteViewFactory *> m_remoteViewFactories; >+ >+ int m_currentRemoteView; >+ bool m_switchFullscreenWhenConnected; >+ >+ SystemTrayIcon *m_systemTrayIcon; >+ QTableView *m_dockWidgetTableView; >+ QTableView *m_newConnectionTableView; >+ QSortFilterProxyModel *m_remoteDesktopsModelProxy; >+#ifdef TELEPATHY_SUPPORT >+ TubesManager *m_tubesManager; >+#endif >+ QWidget *m_newConnectionWidget; >+}; >+ >+#include <QApplication> >+#include <QDesktopWidget> >+#include <QMouseEvent> >+ >+class MinimizePixel : public QWidget >+{ >+ Q_OBJECT >+public: >+ MinimizePixel(QWidget *parent) >+ : QWidget(parent) { >+ setFixedSize(1, 1); >+ move(QApplication::desktop()->screenGeometry().width() - 1, 0); >+ } >+ >+signals: >+ void rightClicked(); >+ >+protected: >+ void mousePressEvent(QMouseEvent *event) { >+ if (event->button() == Qt::RightButton) >+ emit rightClicked(); >+ } >+}; >+ >+#include <QScrollArea> >+ >+class RemoteViewScrollArea : public QScrollArea >+{ >+ Q_OBJECT >+public: >+ RemoteViewScrollArea(QWidget *parent) >+ : QScrollArea(parent) { >+ } >+ >+signals: >+ void resized(int w, int h); >+ >+protected: >+ void resizeEvent(QResizeEvent *event) { >+ QScrollArea::resizeEvent(event); >+ emit resized(width() - 2*frameWidth(), height() - 2*frameWidth()); >+ } >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/Messages.sh kdenetwork-4.9.1/krdc.org/Messages.sh >--- kdenetwork-4.9.1.org/krdc.org/Messages.sh 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/Messages.sh 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,6 @@ >+#! /bin/sh >+$EXTRACTRC *.ui */*.ui >> rc.cpp || exit 11 >+$EXTRACTRC *.rc */*.rc >> rc.cpp || exit 12 >+$EXTRACTRC */*.kcfg >> rc.cpp >+$XGETTEXT *.cpp */*.cpp -o $podir/krdc.pot >+rm -f rc.cpp >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/CMakeLists.txt kdenetwork-4.9.1/krdc.org/nx/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/nx/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/CMakeLists.txt 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,55 @@ >+ >+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) >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/default.dsa.key kdenetwork-4.9.1/krdc.org/nx/default.dsa.key >--- kdenetwork-4.9.1.org/krdc.org/nx/default.dsa.key 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/default.dsa.key 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,12 @@ >+-----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----- >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/krdc_nx_config.desktop kdenetwork-4.9.1/krdc.org/nx/krdc_nx_config.desktop >--- kdenetwork-4.9.1.org/krdc.org/nx/krdc_nx_config.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/krdc_nx_config.desktop 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,60 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KCModule >+Name=NX >+Name[ast]=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[it]=NX >+Name[ja]=NX >+Name[kk]=NX >+Name[km]=NX >+Name[ko]=NX >+Name[lt]=NX >+Name[lv]=NX >+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 >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/krdc_nx.desktop kdenetwork-4.9.1/krdc.org/nx/krdc_nx.desktop >--- kdenetwork-4.9.1.org/krdc.org/nx/krdc_nx.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/krdc_nx.desktop 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,120 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KRDC/Plugin >+Icon=krdc >+Name=NX >+Name[ast]=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[it]=NX >+Name[ja]=NX >+Name[kk]=NX >+Name[km]=NX >+Name[ko]=NX >+Name[lt]=NX >+Name[lv]=NX >+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[ast]=Permite la xestión de sesiones NX per 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[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 NX sedenà pomocou 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 >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxcallbacks.cpp kdenetwork-4.9.1/krdc.org/nx/nxcallbacks.cpp >--- kdenetwork-4.9.1.org/krdc.org/nx/nxcallbacks.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxcallbacks.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,91 @@ >+/**************************************************************************** >+ * ** >+ * ** 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() >+{ >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxcallbacks.h kdenetwork-4.9.1/krdc.org/nx/nxcallbacks.h >--- kdenetwork-4.9.1.org/krdc.org/nx/nxcallbacks.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxcallbacks.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,64 @@ >+/**************************************************************************** >+** >+** 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 >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxclientthread.cpp kdenetwork-4.9.1/krdc.org/nx/nxclientthread.cpp >--- kdenetwork-4.9.1.org/krdc.org/nx/nxclientthread.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxclientthread.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,200 @@ >+/**************************************************************************** >+** >+** 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); >+ } >+} >+ >+void NxClientThread::startSession() >+{ >+ m_client.runSession(); >+} >+ >+#include "moc_nxclientthread.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxclientthread.h kdenetwork-4.9.1/krdc.org/nx/nxclientthread.h >--- kdenetwork-4.9.1.org/krdc.org/nx/nxclientthread.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxclientthread.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,90 @@ >+/**************************************************************************** >+** >+** 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 NXCLIENTTHREAD_H >+#define NXCLIENTTHREAD_H >+ >+#include <KDebug> >+#include <KLocale> >+#include <KUrl> >+ >+#include "remoteview.h" >+ >+#include <QThread> >+#include <QMutex> >+#include <QString> >+ >+#include <string> >+ >+#include <nxcl/nxclientlib.h> >+#include <nxcl/nxdata.h> >+ >+class NxCallbacks; >+ >+class NxClientThread: public QThread >+{ >+ Q_OBJECT >+ >+public: >+ explicit NxClientThread(QObject *parent = 0); >+ ~NxClientThread(); >+ >+ void setCallbacks(NxCallbacks *callbacks); >+ void setHost(const QString &host); >+ void setPort(int port); >+ void setUserName(const QString &userName); >+ void setPassword(const QString &password); >+ void setResolution(int width, int height); >+ void setDesktopType(const QString &desktopType); >+ void setKeyboardLayout(const QString &keyboardLayout); >+ void setPrivateKey(const QString &privateKey); >+ void setSuspended(bool suspended); >+ void setId(const QString &id); >+ void stop(); >+ void startSession(); >+ >+protected: >+ void run(); >+ >+signals: >+ /** >+ * Emitted when the X Window ID of the main NX >+ * window is received. >+ * @param xid the X Window ID of the main NX window >+ */ >+ void hasXid(int xid); >+ >+private: >+ nxcl::NXClientLib m_client; >+ nxcl::NXSessionData m_data; >+ >+ std::string m_host; >+ int m_port; >+ std::string m_privateKey; >+ int m_xid; >+ >+ bool m_stopped; >+ QMutex m_mutex; >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxhostpreferences.cpp kdenetwork-4.9.1/krdc.org/nx/nxhostpreferences.cpp >--- kdenetwork-4.9.1.org/krdc.org/nx/nxhostpreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxhostpreferences.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,298 @@ >+/**************************************************************************** >+** >+** 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 "nxhostpreferences.h" >+ >+#include "settings.h" >+ >+#include <KDebug> >+#include <kfiledialog.h> >+ >+#include <QDesktopWidget> >+#include <QFile> >+#include <QByteArray> >+#include <QTextEdit> >+ >+static const QStringList keymaps = (QStringList() >+ << "ar" >+ << "cs" >+ << "da" >+ << "de" >+ << "de-ch" >+ << "en-dv" >+ << "en-gb" >+ << "en-us" >+ << "es" >+ << "et" >+ << "fi" >+ << "fo" >+ << "fr" >+ << "fr-be" >+ << "fr-ca" >+ << "fr-ch" >+ << "he" >+ << "hr" >+ << "hu" >+ << "is" >+ << "it" >+ << "ja" >+ << "ko" >+ << "lt" >+ << "lv" >+ << "mk" >+ << "nl" >+ << "nl-be" >+ << "no" >+ << "pl" >+ << "pt" >+ << "pt-br" >+ << "ru" >+ << "sl" >+ << "sv" >+ << "th" >+ << "tr" >+); >+ >+static const int defaultKeymap = 7; // en-us >+ >+inline int keymap2int(const QString &keymap) >+{ >+ const int index = keymaps.lastIndexOf(keymap); >+ return (index == -1) ? defaultKeymap : index; >+} >+ >+inline QString int2keymap(int layout) >+{ >+ if (layout >= 0 && layout < keymaps.count()) >+ return keymaps.at(layout); >+ else >+ return keymaps.at(defaultKeymap); >+} >+ >+static const QStringList desktopTypes = (QStringList() >+ << "unix-kde" >+ << "unix-gnome" >+ << "unix-cde" >+ << "unix-xdm" >+); >+ >+static const int defaultDesktopType = 0; >+ >+inline int desktopType2int(const QString &desktopType) >+{ >+ const int index = desktopTypes.lastIndexOf(desktopType); >+ return (index == -1) ? defaultDesktopType : index; >+} >+ >+inline QString int2desktopType(int index) >+{ >+ if (index >= 0 && index < desktopTypes.count()) >+ return desktopTypes.at(index); >+ else >+ return desktopTypes.at(defaultDesktopType); >+} >+ >+NxHostPreferences::NxHostPreferences(KConfigGroup configGroup, QObject *parent) >+ : HostPreferences(configGroup, parent) >+{ >+} >+ >+NxHostPreferences::~NxHostPreferences() >+{ >+} >+ >+QWidget* NxHostPreferences::createProtocolSpecificConfigPage() >+{ >+ nxPage = new QWidget(); >+ nxUi.setupUi(nxPage); >+ >+ nxUi.kcfg_NxHeight->setValue(height()); >+ nxUi.kcfg_NxWidth->setValue(width()); >+ nxUi.kcfg_NxDesktopType->setCurrentIndex(desktopType2int(desktopType())); >+ nxUi.kcfg_NxKeyboardLayout->setCurrentIndex(keymap2int(keyboardLayout())); >+ >+ if (privateKey() == "default") { >+ nxUi.checkboxDefaultPrivateKey->setChecked(true); >+ nxUi.groupboxPrivateKey->setEnabled(false); >+ setDefaultPrivateKey(Qt::Checked); >+ } else { >+ nxUi.checkboxDefaultPrivateKey->setChecked(false); >+ nxUi.groupboxPrivateKey->setEnabled(true); >+ setDefaultPrivateKey(Qt::Unchecked); >+ } >+ >+ connect(nxUi.resolutionComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateWidthHeight(int))); >+ connect(nxUi.checkboxDefaultPrivateKey, SIGNAL(stateChanged(int)), SLOT(setDefaultPrivateKey(int))); >+ connect(nxUi.buttonImportPrivateKey, SIGNAL(pressed()), SLOT(chooseKeyFile())); >+ connect(nxUi.kcfg_NxPrivateKey, SIGNAL(textChanged()), SLOT(updatePrivateKey())); >+ >+ const QString resolutionString = QString::number(width()) + 'x' + QString::number(height()); >+ const int resolutionIndex = nxUi.resolutionComboBox->findText(resolutionString, Qt::MatchContains); >+ nxUi.resolutionComboBox->setCurrentIndex((resolutionIndex == -1) ? 5 : resolutionIndex); >+ >+ return nxPage; >+} >+ >+void NxHostPreferences::updateWidthHeight(int index) >+{ >+ switch (index) { >+ case 0: >+ nxUi.kcfg_NxHeight->setValue(480); >+ nxUi.kcfg_NxWidth->setValue(640); >+ break; >+ case 1: >+ nxUi.kcfg_NxHeight->setValue(600); >+ nxUi.kcfg_NxWidth->setValue(800); >+ break; >+ case 2: >+ nxUi.kcfg_NxHeight->setValue(768); >+ nxUi.kcfg_NxWidth->setValue(1024); >+ break; >+ case 3: >+ nxUi.kcfg_NxHeight->setValue(1024); >+ nxUi.kcfg_NxWidth->setValue(1280); >+ break; >+ case 4: >+ nxUi.kcfg_NxHeight->setValue(1200); >+ nxUi.kcfg_NxWidth->setValue(1600); >+ break; >+ case 5: { >+ QDesktopWidget *desktop = QApplication::desktop(); >+ int currentScreen = desktop->screenNumber(nxUi.kcfg_NxHeight); >+ nxUi.kcfg_NxHeight->setValue(desktop->screenGeometry(currentScreen).height()); >+ nxUi.kcfg_NxWidth->setValue(desktop->screenGeometry(currentScreen).width()); >+ break; >+ } >+ case 6: >+ default: >+ break; >+ } >+ >+ bool enabled = (index == 6) ? true : false; >+ >+ nxUi.kcfg_NxHeight->setEnabled(enabled); >+ nxUi.kcfg_NxWidth->setEnabled(enabled); >+ nxUi.heightLabel->setEnabled(enabled); >+ nxUi.widthLabel->setEnabled(enabled); >+} >+ >+void NxHostPreferences::setDefaultPrivateKey(int state) >+{ >+ if (state == Qt::Checked) { >+ setPrivateKey("default"); >+ nxUi.groupboxPrivateKey->setEnabled(false); >+ } else if (state == Qt::Unchecked) { >+ setPrivateKey(""); >+ nxUi.groupboxPrivateKey->setEnabled(true); >+ } >+} >+ >+void NxHostPreferences::updatePrivateKey() >+{ >+ m_privateKey = nxUi.kcfg_NxPrivateKey->toPlainText(); >+} >+ >+void NxHostPreferences::chooseKeyFile() >+{ >+ const QString fileName = KFileDialog::getOpenFileName(KUrl(QDir::homePath()), >+ "*.key|" + i18n("Key Files (*.key)"), >+ nxPage, i18n("Open DSA Key File")); >+ >+ QFile file(fileName); >+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) >+ return; >+ >+ QByteArray key; >+ while (!file.atEnd()) >+ key += file.readLine(); >+ >+ nxUi.kcfg_NxPrivateKey->setPlainText(QString(key)); >+ setPrivateKey(QString(key)); >+} >+ >+void NxHostPreferences::acceptConfig() >+{ >+ HostPreferences::acceptConfig(); >+ >+ setHeight(nxUi.kcfg_NxHeight->value()); >+ setWidth(nxUi.kcfg_NxWidth->value()); >+ setDesktopType(int2desktopType(nxUi.kcfg_NxDesktopType->currentIndex())); >+ setKeyboardLayout(int2keymap(nxUi.kcfg_NxKeyboardLayout->currentIndex())); >+} >+ >+void NxHostPreferences::setHeight(int height) >+{ >+ if (height >= 0) >+ m_configGroup.writeEntry("height", height); >+} >+ >+int NxHostPreferences::height() >+{ >+ return m_configGroup.readEntry("height", Settings::nxHeight()); >+} >+ >+void NxHostPreferences::setWidth(int width) >+{ >+ if (width >= 0) >+ m_configGroup.writeEntry("width", width); >+} >+ >+int NxHostPreferences::width() >+{ >+ return m_configGroup.readEntry("width", Settings::nxWidth()); >+} >+ >+void NxHostPreferences::setDesktopType(const QString &desktopType) >+{ >+ if (!desktopType.isNull()) >+ m_configGroup.writeEntry("desktopType", desktopType2int(desktopType)); >+} >+ >+QString NxHostPreferences::desktopType() const >+{ >+ return int2desktopType(m_configGroup.readEntry("desktopType", Settings::nxDesktopType())); >+} >+ >+void NxHostPreferences::setKeyboardLayout(const QString &keyboardLayout) >+{ >+ if (!keyboardLayout.isNull()) >+ m_configGroup.writeEntry("keyboardLayout", keymap2int(keyboardLayout)); >+} >+ >+QString NxHostPreferences::keyboardLayout() const >+{ >+ return int2keymap(m_configGroup.readEntry("keyboardLayout", Settings::nxKeyboardLayout())); >+} >+ >+void NxHostPreferences::setPrivateKey(const QString &privateKey) >+{ >+ if (!privateKey.isNull()) >+ m_configGroup.writeEntry("privateKey", privateKey); >+} >+ >+QString NxHostPreferences::privateKey() const >+{ >+ return m_configGroup.readEntry("privateKey", Settings::nxPrivateKey()); >+} >+ >+#include "nxhostpreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxhostpreferences.h kdenetwork-4.9.1/krdc.org/nx/nxhostpreferences.h >--- kdenetwork-4.9.1.org/krdc.org/nx/nxhostpreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxhostpreferences.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,65 @@ >+/**************************************************************************** >+** >+** 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 NXHOSTPREFERENCES_H >+#define NXHOSTPREFERENCES_H >+ >+#include "hostpreferences.h" >+#include "ui_nxpreferences.h" >+ >+class NxHostPreferences : public HostPreferences >+{ >+ Q_OBJECT >+ >+public: >+ explicit NxHostPreferences(KConfigGroup configGroup, QObject *parent = 0); >+ ~NxHostPreferences(); >+ >+ void setHeight(int height); >+ int height(); >+ void setWidth(int width); >+ int width(); >+ void setDesktopType(const QString &desktopType); >+ QString desktopType() const; >+ void setKeyboardLayout(const QString &keyboardLayout); >+ QString keyboardLayout() const; >+ void setPrivateKey(const QString &privateKey); >+ QString privateKey() const; >+ >+protected: >+ QWidget* createProtocolSpecificConfigPage(); >+ void acceptConfig(); >+ >+private: >+ QString m_privateKey; >+ Ui::NxPreferences nxUi; >+ QWidget *nxPage; >+ >+private slots: >+ void updateWidthHeight(int index); >+ void setDefaultPrivateKey(int state); >+ void updatePrivateKey(); >+ void chooseKeyFile(); >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxpreferences.cpp kdenetwork-4.9.1/krdc.org/nx/nxpreferences.cpp >--- kdenetwork-4.9.1.org/krdc.org/nx/nxpreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxpreferences.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,66 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "nxpreferences.h" >+#include "remoteviewfactory.h" >+#include "settings.h" >+ >+#include "ui_nxpreferences.h" >+ >+#include <KDebug> >+ >+KRDC_PLUGIN_EXPORT(NxPreferences) >+ >+NxPreferences::NxPreferences(QWidget *parent, const QVariantList &args) >+ : KCModule(KrdcFactory::componentData(), parent, args) >+{ >+ Ui::NxPreferences nxUi; >+ nxUi.setupUi(this); >+ nxUi.resolutionComboBox->hide(); >+ nxUi.checkboxDefaultPrivateKey->hide(); >+ nxUi.buttonImportPrivateKey->hide(); >+ nxUi.labelPrivateKey->hide(); >+ nxUi.groupboxPrivateKey->hide(); >+ nxUi.kcfg_NxHeight->setEnabled(true); >+ nxUi.kcfg_NxWidth->setEnabled(true); >+ nxUi.heightLabel->setEnabled(true); >+ nxUi.widthLabel->setEnabled(true); >+ >+ addConfig(Settings::self(), this); >+} >+ >+NxPreferences::~NxPreferences() >+{ >+} >+ >+void NxPreferences::load() >+{ >+ KCModule::load(); >+} >+ >+void NxPreferences::save() >+{ >+ KCModule::save(); >+} >+ >+#include "nxpreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxpreferences.h kdenetwork-4.9.1/krdc.org/nx/nxpreferences.h >--- kdenetwork-4.9.1.org/krdc.org/nx/nxpreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxpreferences.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,44 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 NXPREFERENCES_H >+#define NXPREFERENCES_H >+ >+#include "nxhostpreferences.h" >+ >+#include <KCModule> >+ >+class NxPreferences : public KCModule >+{ >+ Q_OBJECT >+ >+public: >+ explicit NxPreferences(QWidget *parent = 0, const QVariantList &args = QVariantList()); >+ ~NxPreferences(); >+ >+ virtual void save(); >+ virtual void load(); >+ >+}; >+ >+#endif // NXPREFERENCES_H >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxpreferences.ui kdenetwork-4.9.1/krdc.org/nx/nxpreferences.ui >--- kdenetwork-4.9.1.org/krdc.org/nx/nxpreferences.ui 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxpreferences.ui 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,533 @@ >+<ui version="4.0" > >+ <class>NxPreferences</class> >+ <widget class="QWidget" name="NxPreferences" > >+ <property name="geometry" > >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>561</width> >+ <height>471</height> >+ </rect> >+ </property> >+ <property name="sizePolicy" > >+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > >+ <horstretch>0</horstretch> >+ <verstretch>0</verstretch> >+ </sizepolicy> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout" > >+ <item> >+ <widget class="QGroupBox" name="connectionGroupBox" > >+ <property name="title" > >+ <string>Connection</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout" > >+ <item row="0" column="0" > >+ <layout class="QVBoxLayout" > >+ <item> >+ <widget class="QLabel" name="resolutionLabel" > >+ <property name="text" > >+ <string>Desktop &resolution:</string> >+ </property> >+ <property name="buddy" > >+ <cstring>resolutionComboBox</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="resolutionDummyLabel" /> >+ </item> >+ </layout> >+ </item> >+ <item row="0" column="1" > >+ <layout class="QVBoxLayout" > >+ <item> >+ <widget class="KComboBox" name="resolutionComboBox" > >+ <property name="minimumSize" > >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis" > >+ <string>Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you.</string> >+ </property> >+ <property name="currentIndex" > >+ <number>1</number> >+ </property> >+ <item> >+ <property name="text" > >+ <string>Minimal (640x480)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Small (800x600)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Normal (1024x768)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Large (1280x1024)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Very Large (1600x1200)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Current Screen Resolution</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Custom Resolution (...)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout" > >+ <item> >+ <widget class="QLabel" name="widthLabel" > >+ <property name="enabled" > >+ <bool>false</bool> >+ </property> >+ <property name="text" > >+ <string>&Width:</string> >+ </property> >+ <property name="alignment" > >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy" > >+ <cstring>kcfg_NxWidth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_NxWidth" > >+ <property name="enabled" > >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis" > >+ <string>This is the width of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum" > >+ <number>9999</number> >+ </property> >+ <property name="value" > >+ <number>800</number> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="heightLabel" > >+ <property name="enabled" > >+ <bool>false</bool> >+ </property> >+ <property name="text" > >+ <string>H&eight:</string> >+ </property> >+ <property name="alignment" > >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy" > >+ <cstring>kcfg_NxHeight</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_NxHeight" > >+ <property name="enabled" > >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis" > >+ <string>This is the height of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum" > >+ <number>9999</number> >+ </property> >+ <property name="value" > >+ <number>600</number> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </item> >+ <item row="1" column="0" > >+ <widget class="QLabel" name="desktopTypeLabel" > >+ <property name="text" > >+ <string>Desktop &type:</string> >+ </property> >+ <property name="buddy" > >+ <cstring>kcfg_NxDesktopType</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1" > >+ <widget class="KComboBox" name="kcfg_NxDesktopType" > >+ <property name="minimumSize" > >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis" > >+ <string>Here you can specify the desktop environment of the remote desktop.</string> >+ </property> >+ <item> >+ <property name="text" > >+ <string>KDE</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Gnome</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>CDE</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>XDM</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="2" column="0" > >+ <widget class="QLabel" name="layoutLabel" > >+ <property name="text" > >+ <string>&Keyboard layout:</string> >+ </property> >+ <property name="buddy" > >+ <cstring>kcfg_NxKeyboardLayout</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="2" column="1" > >+ <widget class="KComboBox" name="kcfg_NxKeyboardLayout" > >+ <property name="minimumSize" > >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis" > >+ <string>Use this to specify your keyboard layout. This layout setting is used to send the correct keyboard codes to the server.</string> >+ </property> >+ <property name="currentIndex" > >+ <number>7</number> >+ </property> >+ <item> >+ <property name="text" > >+ <string>Arabic (ar)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Czech (cs)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Danish (da)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>German (de)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Swiss German (de-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>American Dvorak (en-dv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>British English (en-gb)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>US English (en-us)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Spanish (es)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Estonian (et)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Finnish (fi)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Faroese (fo)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>French (fr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Belgian (fr-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>French Canadian (fr-ca)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Swiss French (fr-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Hebrew (he)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Croatian (hr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Hungarian (hu)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Icelandic (is)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Italian (it)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Japanese (ja)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Korean (ko)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Lithuanian (lt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Latvian (lv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Macedonian (mk)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Dutch (nl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Belgian Dutch (nl-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Norwegian (no)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Polish (pl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Portuguese (pt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Brazilian (pt-br)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Russian (ru)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Slovenian (sl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Swedish (sv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Thai (th)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Turkish (tr)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="3" column="0" > >+ <widget class="QLabel" name="labelPrivateKey" > >+ <property name="text" > >+ <string comment="label for soundsettings in preferences dialog" >Private key:</string> >+ </property> >+ </widget> >+ </item> >+ <item row="3" column="1" > >+ <layout class="QHBoxLayout" name="horizontalLayout" > >+ <item> >+ <widget class="QCheckBox" name="checkboxDefaultPrivateKey" > >+ <property name="whatsThis" > >+ <string>The authentication on the NX server requires a private key. By default, it is the NoMachine DSA key. Use this box to choose the default key, or configure it by importing from a file or editing directly the textbox. </string> >+ </property> >+ <property name="text" > >+ <string>NoMachine Key</string> >+ </property> >+ <property name="checked" > >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="groupboxPrivateKey" > >+ <property name="title" > >+ <string>Private Key Management</string> >+ </property> >+ <layout class="QGridLayout" > >+ <item row="0" column="1" > >+ <widget class="KTextEdit" name="kcfg_NxPrivateKey" > >+ <property name="sizePolicy" > >+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > >+ <horstretch>0</horstretch> >+ <verstretch>0</verstretch> >+ </sizepolicy> >+ </property> >+ <property name="whatsThis" > >+ <string>Use this textbox to edit the private key for the authentication on the NX server.</string> >+ </property> >+ </widget> >+ </item> >+ <item row="0" column="0" > >+ <layout class="QVBoxLayout" name="verticalLayout_2" > >+ <item> >+ <widget class="QLabel" name="label" > >+ <property name="sizePolicy" > >+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > >+ <horstretch>0</horstretch> >+ <verstretch>0</verstretch> >+ </sizepolicy> >+ </property> >+ <property name="text" > >+ <string>Private DSA Key :</string> >+ </property> >+ <property name="alignment" > >+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QPushButton" name="buttonImportPrivateKey" > >+ <property name="whatsThis" > >+ <string>Use this button to import the private key from a file.</string> >+ </property> >+ <property name="text" > >+ <string>Import ...</string> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <spacer> >+ <property name="orientation" > >+ <enum>Qt::Vertical</enum> >+ </property> >+ <property name="sizeHint" stdset="0" > >+ <size> >+ <width>428</width> >+ <height>16</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ </layout> >+ </widget> >+ <customwidgets> >+ <customwidget> >+ <class>KComboBox</class> >+ <extends>QComboBox</extends> >+ <header>kcombobox.h</header> >+ </customwidget> >+ <customwidget> >+ <class>KTextEdit</class> >+ <extends>QTextEdit</extends> >+ <header>ktextedit.h</header> >+ </customwidget> >+ </customwidgets> >+ <tabstops> >+ <tabstop>resolutionComboBox</tabstop> >+ <tabstop>kcfg_NxWidth</tabstop> >+ <tabstop>kcfg_NxHeight</tabstop> >+ <tabstop>kcfg_NxKeyboardLayout</tabstop> >+ </tabstops> >+ <resources/> >+ <connections/> >+</ui> >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nx.protocol kdenetwork-4.9.1/krdc.org/nx/nx.protocol >--- kdenetwork-4.9.1.org/krdc.org/nx/nx.protocol 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nx.protocol 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,12 @@ >+[Protocol] >+exec=krdc '%u' >+protocol=nx >+input=none >+output=none >+helper=true >+listing= >+reading=false >+writing=false >+makedir=false >+deleting=false >+Icon=krdc >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxresumesessions.cpp kdenetwork-4.9.1/krdc.org/nx/nxresumesessions.cpp >--- kdenetwork-4.9.1.org/krdc.org/nx/nxresumesessions.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxresumesessions.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,105 @@ >+/**************************************************************************** >+** >+** 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 "nxresumesessions.h" >+ >+#include <QTreeWidget> >+#include <QTreeWidgetItem> >+#include <QVBoxLayout> >+ >+#include <KTitleWidget> >+ >+NxResumeSessions::NxResumeSessions() >+{ >+ QWidget *nxPage = new QWidget(); >+ nxUi.setupUi(nxPage); >+ >+ setCaption(i18n("Available NX Sessions")); >+ setButtons(KDialog::None); >+ >+ QVBoxLayout *layout = new QVBoxLayout(); >+ >+ KTitleWidget *titleWidget = new KTitleWidget(); >+ titleWidget->setText(i18n("Available NX Sessions")); >+ titleWidget->setPixmap(KIcon("krdc")); >+ layout->addWidget(titleWidget); >+ layout->addWidget(nxPage); >+ >+ QWidget *mainWidget = new QWidget(); >+ mainWidget->setLayout(layout); >+ setMainWidget(mainWidget); >+ >+ connect(nxUi.buttonNew, SIGNAL(pressed()), this, SLOT(pressedNew())); >+ connect(nxUi.buttonResume, SIGNAL(pressed()), this, SLOT(pressedResume())); >+} >+ >+NxResumeSessions::~NxResumeSessions() >+{ >+ if (!empty()) >+ clear(); >+} >+ >+bool NxResumeSessions::empty() const >+{ >+ return nxUi.sessionsList->topLevelItemCount() == 0; >+} >+ >+void NxResumeSessions::clear() >+{ >+ nxUi.sessionsList->clear(); >+} >+ >+void NxResumeSessions::addSessions(QList<nxcl::NXResumeData> sessions) >+{ >+ for (int i = 0; i < sessions.size(); ++i) { >+ const nxcl::NXResumeData session = sessions.at(i); >+ QTreeWidgetItem *tmp = new QTreeWidgetItem(); >+ tmp->setText(0, QString::number(session.display)); >+ tmp->setText(1, QString(session.sessionType.c_str())); >+ tmp->setText(2, QString(session.sessionID.c_str())); >+ tmp->setText(3, QString::number(session.depth)); >+ tmp->setText(4, QString(session.screen.c_str())); >+ tmp->setText(5, QString(session.sessionName.c_str())); >+ >+ nxUi.sessionsList->addTopLevelItem(tmp); >+ } >+} >+ >+void NxResumeSessions::show() >+{ >+ adjustSize(); >+ >+ if (exec() == KDialog::Rejected) >+ pressedNew(); >+} >+ >+void NxResumeSessions::pressedNew() >+{ >+ emit newSession(); >+} >+ >+void NxResumeSessions::pressedResume() >+{ >+ emit resumeSession(QString("")); >+} >+ >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxresumesessions.h kdenetwork-4.9.1/krdc.org/nx/nxresumesessions.h >--- kdenetwork-4.9.1.org/krdc.org/nx/nxresumesessions.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxresumesessions.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,58 @@ >+/**************************************************************************** >+** >+** 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 NXRESUMESESSIONS_H >+#define NXRESUMESESSIONS_H >+ >+#include "ui_nxresumesessions.h" >+ >+#include <QList> >+#include <QWidget> >+#include <KDialog> >+#include <nxcl/nxdata.h> >+ >+class NxResumeSessions : public KDialog >+{ >+ Q_OBJECT >+ >+public: >+ explicit NxResumeSessions(); >+ ~NxResumeSessions(); >+ bool empty() const; >+ void clear(); >+ void addSessions(QList<nxcl::NXResumeData> sessions); >+ void show(); >+ >+private: >+ Ui::NxSessions nxUi; >+ >+private slots: >+ void pressedNew(); >+ void pressedResume(); >+ >+signals: >+ void newSession(); >+ void resumeSession(QString); >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxresumesessions.ui kdenetwork-4.9.1/krdc.org/nx/nxresumesessions.ui >--- kdenetwork-4.9.1.org/krdc.org/nx/nxresumesessions.ui 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxresumesessions.ui 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,94 @@ >+<ui version="4.0" > >+ <class>NxSessions</class> >+ <widget class="QWidget" name="NxSessions" > >+ <property name="geometry" > >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>725</width> >+ <height>260</height> >+ </rect> >+ </property> >+ <layout class="QVBoxLayout" > >+ <property name="margin" > >+ <number>9</number> >+ </property> >+ <property name="spacing" > >+ <number>6</number> >+ </property> >+ <item> >+ <widget class="QTreeWidget" name="sessionsList" > >+ <column> >+ <property name="text" > >+ <string>Display</string> >+ </property> >+ </column> >+ <column> >+ <property name="text" > >+ <string>Type</string> >+ </property> >+ </column> >+ <column> >+ <property name="text" > >+ <string>Session ID</string> >+ </property> >+ </column> >+ <column> >+ <property name="text" > >+ <string>Colour Depth</string> >+ </property> >+ </column> >+ <column> >+ <property name="text" > >+ <string>Resolution</string> >+ </property> >+ </column> >+ <column> >+ <property name="text" > >+ <string>Session Name</string> >+ </property> >+ </column> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout" > >+ <property name="margin" > >+ <number>0</number> >+ </property> >+ <property name="spacing" > >+ <number>6</number> >+ </property> >+ <item> >+ <spacer> >+ <property name="orientation" > >+ <enum>Qt::Horizontal</enum> >+ </property> >+ <property name="sizeHint" > >+ <size> >+ <width>40</width> >+ <height>20</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ <item> >+ <widget class="QPushButton" name="buttonNew" > >+ <property name="text" > >+ <string>&New</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QPushButton" name="buttonResume" > >+ <property name="text" > >+ <string>&Resume</string> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </widget> >+ <resources/> >+ <connections/> >+</ui> >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxview.cpp kdenetwork-4.9.1/krdc.org/nx/nxview.cpp >--- kdenetwork-4.9.1.org/krdc.org/nx/nxview.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxview.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,278 @@ >+/**************************************************************************** >+** >+** 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 "nxview.h" >+#include "settings.h" >+ >+#include <nxcl/nxdata.h> >+ >+#include <KInputDialog> >+#include <KMessageBox> >+#include <KPasswordDialog> >+ >+#include <QEvent> >+#include <QMetaType> >+ >+NxView::NxView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+ : RemoteView(parent), >+ m_quitFlag(false), >+ m_container(NULL), >+ m_hostPreferences(NULL) >+{ >+ m_url = url; >+ m_host = url.host(); >+ m_port = url.port(); >+ >+ if (m_port <= 0 || m_port >= 65536) >+ m_port = TCP_PORT_NX; >+ >+ m_container = new QX11EmbedContainer(this); >+ m_container->installEventFilter(this); >+ >+ qRegisterMetaType<QList<nxcl::NXResumeData> >("QList<nxcl::NXResumeData>"); >+ >+ m_clientThread.setCallbacks(&m_callbacks); >+ >+ connect(&m_clientThread, SIGNAL(hasXid(int)), this, SLOT(hasXid(int))); >+ connect(&m_callbacks, SIGNAL(progress(int,QString)), this, SLOT(handleProgress(int,QString))); >+ connect(&m_callbacks, SIGNAL(suspendedSessions(QList<nxcl::NXResumeData>)), this, SLOT(handleSuspendedSessions(QList<nxcl::NXResumeData>))); >+ connect(&m_callbacks, SIGNAL(noSessions()), this, SLOT(handleNoSessions())); >+ connect(&m_callbacks, SIGNAL(atCapacity()), this, SLOT(handleAtCapacity())); >+ connect(&m_resumeSessions, SIGNAL(newSession()), this, SLOT(handleNewSession())); >+ connect(&m_resumeSessions, SIGNAL(resumeSession(QString)), this, SLOT(handleResumeSession(QString))); >+ >+ m_hostPreferences = new NxHostPreferences(configGroup, this); >+} >+ >+NxView::~NxView() >+{ >+} >+ >+// filter out key and mouse events to the container if we are view only >+//FIXME: X11 events are passed to the app before getting caught in the Qt event processing >+bool NxView::eventFilter(QObject *obj, QEvent *event) >+{ >+ if (m_viewOnly) { >+ if (event->type() == QEvent::KeyPress || >+ event->type() == QEvent::KeyRelease || >+ event->type() == QEvent::MouseButtonDblClick || >+ event->type() == QEvent::MouseButtonPress || >+ event->type() == QEvent::MouseButtonRelease || >+ event->type() == QEvent::MouseMove) >+ return true; >+ } >+ >+ return RemoteView::eventFilter(obj, event); >+} >+ >+void NxView::startQuitting() >+{ >+ kDebug(5013) << "about to quit"; >+ >+ const bool connected = status() == RemoteView::Connected; >+ setStatus(Disconnecting); >+ m_quitFlag = true; >+ >+ if (connected) >+ m_clientThread.stop(); >+ else >+ m_clientThread.quit(); >+ >+ m_clientThread.wait(500); >+ setStatus(Disconnected); >+ m_container->discardClient(); >+} >+ >+bool NxView::isQuitting() >+{ >+ return m_quitFlag; >+} >+ >+bool NxView::start() >+{ >+ m_clientThread.setResolution(m_hostPreferences->width(), m_hostPreferences->height()); >+ m_clientThread.setDesktopType(m_hostPreferences->desktopType()); >+ m_clientThread.setKeyboardLayout(m_hostPreferences->keyboardLayout()); >+ m_clientThread.setPrivateKey(m_hostPreferences->privateKey()); >+ >+ m_container->show(); >+ >+ if (m_hostPreferences->walletSupport()) { >+ if (m_url.userName().isEmpty()) { >+ QString userName; >+ bool ok = false; >+ >+ userName = KInputDialog::getText(i18n("Enter Username"), >+ i18n("Please enter the username you would like to use for login."), >+ QString(), &ok, this); >+ >+ if (ok) >+ m_url.setUserName(userName); >+ } >+ >+ if (!m_url.userName().isEmpty()) { >+ QString walletPassword = readWalletPassword(); >+ >+ if (!walletPassword.isNull()) >+ m_url.setPassword(walletPassword); >+ else { >+ KPasswordDialog dialog(this); >+ dialog.setPrompt(i18n("Access to the system requires a password.")); >+ if (dialog.exec() == KPasswordDialog::Accepted) { >+ m_url.setPassword(dialog.password()); >+ >+ if (m_hostPreferences->walletSupport()) >+ saveWalletPassword(dialog.password()); >+ } >+ } >+ } >+ } >+ >+ m_clientThread.setHost(m_host); >+ m_clientThread.setPort(m_port); >+ m_clientThread.setUserName(m_url.userName()); >+ m_clientThread.setPassword(m_url.password()); >+ m_clientThread.setResolution(m_hostPreferences->width(), m_hostPreferences->height()); >+ >+ setStatus(Connecting); >+ m_clientThread.start(); >+ >+ connect(m_container, SIGNAL(clientIsEmbedded()), SLOT(connectionOpened())); >+ connect(m_container, SIGNAL(clientClosed()), SLOT(connectionClosed())); >+ >+ return true; >+} >+ >+HostPreferences* NxView::hostPreferences() >+{ >+ return m_hostPreferences; >+} >+ >+QSize NxView::framebufferSize() >+{ >+ return m_container->minimumSizeHint(); >+} >+ >+QSize NxView::sizeHint() const >+{ >+ return maximumSize(); >+} >+ >+ >+void NxView::switchFullscreen(bool on) >+{ >+ setGrabAllKeys(on); >+} >+ >+void NxView::setGrabAllKeys(bool grabAllKeys) >+{ >+ m_grabAllKeys = grabAllKeys; >+ >+ if (grabAllKeys) { >+ m_keyboardIsGrabbed = true; >+ m_container->grabKeyboard(); >+ } else if (m_keyboardIsGrabbed) >+ m_container->releaseKeyboard(); >+} >+ >+void NxView::hasXid(int xid) >+{ >+ m_container->embedClient(xid); >+} >+ >+void NxView::handleProgress(int id, QString msg) >+{ >+ Q_UNUSED(msg); >+ switch (id) { >+ case NXCL_AUTH_FAILED: >+ KMessageBox::error(this, i18n("The authentication key is invalid."), i18n("Invalid authentication key")); >+ break; >+ case NXCL_LOGIN_FAILED: >+ KMessageBox::error(this, i18n("The username or password that you have entered is invalid."), i18n("Invalid username or password")); >+ break; >+ case NXCL_HOST_KEY_VERIFAILED: >+ KMessageBox::error(this, i18n("The host key verification has failed."), i18n("Host key verification failed")); >+ break; >+ case NXCL_PROCESS_ERROR: >+ KMessageBox::error(this, i18n("An error has occurred during the connection to the NX server."), i18n("Process error")); >+ break; >+ default: >+ break; >+ } >+} >+ >+void NxView::handleSuspendedSessions(QList<nxcl::NXResumeData> sessions) >+{ >+ if (!m_resumeSessions.empty()) >+ m_resumeSessions.clear(); >+ >+ m_resumeSessions.addSessions(sessions); >+ m_resumeSessions.show(); >+} >+ >+void NxView::handleNoSessions() >+{ >+ m_clientThread.setSuspended(false); >+ m_clientThread.startSession(); >+} >+ >+void NxView::handleAtCapacity() >+{ >+ KMessageBox::error(this, i18n("This NX server is running at capacity."), i18n("Server at capacity")); >+} >+ >+void NxView::handleNewSession() >+{ >+ m_clientThread.setSuspended(false); >+ m_clientThread.startSession(); >+} >+ >+void NxView::handleResumeSession(QString id) >+{ >+ m_clientThread.setId(id); >+ m_clientThread.setSuspended(true); >+ m_clientThread.startSession(); >+} >+ >+void NxView::connectionOpened() >+{ >+ kDebug(5013) << "Connection opened"; >+ QSize size(m_hostPreferences->width(), m_hostPreferences->height()); >+ kDebug(5013) << "Size hint: " << size.width() << size.height(); >+ setStatus(Connected); >+ setFixedSize(size); >+ resize(size); >+ m_container->setFixedSize(size); >+ emit framebufferSizeChanged(size.width(), size.height()); >+ emit connected(); >+ setFocus(); >+} >+ >+void NxView::connectionClosed() >+{ >+ emit disconnected(); >+ setStatus(Disconnected); >+ m_quitFlag = true; >+} >+ >+#include "nxview.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxviewfactory.cpp kdenetwork-4.9.1/krdc.org/nx/nxviewfactory.cpp >--- kdenetwork-4.9.1.org/krdc.org/nx/nxviewfactory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxviewfactory.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,78 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "nxviewfactory.h" >+ >+#include <KDebug> >+ >+KRDC_PLUGIN_EXPORT(NxViewFactory) >+ >+NxViewFactory::NxViewFactory(QObject *parent, const QVariantList &args) >+ : RemoteViewFactory(parent) >+{ >+ Q_UNUSED(args); >+ >+ KGlobal::locale()->insertCatalog("krdc"); >+} >+ >+NxViewFactory::~NxViewFactory() >+{ >+} >+ >+bool NxViewFactory::supportsUrl(const KUrl &url) const >+{ >+ return (url.scheme().compare("nx", Qt::CaseInsensitive) == 0); >+} >+ >+RemoteView *NxViewFactory::createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+{ >+ return new NxView(parent, url, configGroup); >+} >+ >+HostPreferences *NxViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) >+{ >+ return new NxHostPreferences(configGroup, parent); >+} >+ >+QString NxViewFactory::scheme() const >+{ >+ return "nx"; >+} >+ >+QString NxViewFactory::connectActionText() const >+{ >+ return i18n("New NX Connection..."); >+} >+ >+QString NxViewFactory::connectButtonText() const >+{ >+ return i18n("Connect to a NX Remote Desktop"); >+} >+ >+QString NxViewFactory::connectToolTipText() const >+{ >+ return i18n("<html>Enter the address here.<br />" >+ "<i>Example: nxserver (host)</i></html>"); >+} >+ >+#include "moc_nxviewfactory.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxviewfactory.h kdenetwork-4.9.1/krdc.org/nx/nxviewfactory.h >--- kdenetwork-4.9.1.org/krdc.org/nx/nxviewfactory.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxviewfactory.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,56 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 NXVIEWFACTORY_H >+#define NXVIEWFACTORY_H >+ >+#include "remoteviewfactory.h" >+ >+#include "nxview.h" >+#include "nxpreferences.h" >+ >+class NxViewFactory : public RemoteViewFactory >+{ >+ Q_OBJECT >+ >+public: >+ explicit NxViewFactory(QObject *parent, const QVariantList &args); >+ >+ virtual ~NxViewFactory(); >+ >+ virtual bool supportsUrl(const KUrl &url) const; >+ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup); >+ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent); >+ >+ virtual QString scheme() const; >+ >+ virtual QString connectActionText() const; >+ >+ virtual QString connectButtonText() const; >+ >+ virtual QString connectToolTipText() const; >+}; >+ >+#endif // NXVIEWFACTORY_H >diff -urN kdenetwork-4.9.1.org/krdc.org/nx/nxview.h kdenetwork-4.9.1/krdc.org/nx/nxview.h >--- kdenetwork-4.9.1.org/krdc.org/nx/nxview.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/nx/nxview.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,90 @@ >+/**************************************************************************** >+** >+** 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 NXVIEW_H >+#define NXVIEW_H >+ >+#include "remoteview.h" >+#include "nxcallbacks.h" >+#include "nxclientthread.h" >+#include "nxhostpreferences.h" >+#include "nxresumesessions.h" >+ >+#include <QX11EmbedContainer> >+ >+#define TCP_PORT_NX 22 >+ >+class NxView : public RemoteView >+{ >+ Q_OBJECT >+ >+public: >+ explicit NxView(QWidget *parent = 0, const KUrl &url = KUrl(), KConfigGroup configGroup = KConfigGroup()); >+ virtual ~NxView(); >+ >+ // Start closing the connection >+ virtual void startQuitting(); >+ // If we are currently closing the connection >+ virtual bool isQuitting(); >+ // Open a connection >+ virtual bool start(); >+ >+ // Returns the size of the remote view >+ virtual QSize framebufferSize(); >+ // Returns the suggested size of the remote view >+ QSize sizeHint() const; >+ virtual void setGrabAllKeys(bool grabAllKeys); >+ >+ HostPreferences* hostPreferences(); >+ >+public slots: >+ void switchFullscreen(bool on); >+ void hasXid(int xid); >+ void handleProgress(int id, QString msg); >+ void handleSuspendedSessions(QList<nxcl::NXResumeData> sessions); >+ void handleNoSessions(); >+ void handleAtCapacity(); >+ void handleNewSession(); >+ void handleResumeSession(QString id); >+ void connectionOpened(); >+ void connectionClosed(); >+ >+protected: >+ bool eventFilter(QObject *obj, QEvent *event); >+ >+private: >+ // Thread that manage NX connection >+ NxClientThread m_clientThread; >+ // NX Callbacks >+ NxCallbacks m_callbacks; >+ // If we are currently closing the connection >+ bool m_quitFlag; >+ // Widget which contains the NX Window >+ QX11EmbedContainer *m_container; >+ // Dialog which allows user to choose NX preferences. >+ NxHostPreferences *m_hostPreferences; >+ // Dialog which allows user to resume NX sessions. >+ NxResumeSessions m_resumeSessions; >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service.in kdenetwork-4.9.1/krdc.org/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service.in >--- kdenetwork-4.9.1.org/krdc.org/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service.in 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service.in 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,3 @@ >+[D-BUS Service] >+Name=org.freedesktop.Telepathy.Client.krdc_rfb_handler >+Exec=@CMAKE_INSTALL_PREFIX@/bin/krdc >Binary files kdenetwork-4.9.1.org/krdc.org/pointcursormask.png and kdenetwork-4.9.1/krdc.org/pointcursormask.png differ >Binary files kdenetwork-4.9.1.org/krdc.org/pointcursor.png and kdenetwork-4.9.1/krdc.org/pointcursor.png differ >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/CMakeLists.txt kdenetwork-4.9.1/krdc.org/rdp/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/rdp/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/CMakeLists.txt 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,52 @@ >+ >+if(Q_WS_X11) >+ set(HAVE_RDESKTOP true) # TODO: implement cmake check? >+endif(Q_WS_X11) >+ >+if(HAVE_RDESKTOP) >+ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5012) >+ >+ include_directories( >+ ${CMAKE_CURRENT_BINARY_DIR} >+ ) >+ >+ set(rdpplugin_SRCS >+ rdphostpreferences.cpp >+ rdpviewfactory.cpp >+ rdpview.cpp >+ ) >+ >+ kde4_add_ui_files(rdpplugin_SRCS >+ rdppreferences.ui >+ ) >+ >+ kde4_add_plugin(krdc_rdpplugin ${rdpplugin_SRCS}) >+ >+ target_link_libraries(krdc_rdpplugin >+ ${KDE4_KDECORE_LIBS} >+ ${KDE4_KDEUI_LIBS} >+ krdccore >+ ) >+ >+ set(kcm_krdc_rdpplugin_SRCS >+ rdppreferences.cpp >+ ) >+ >+ kde4_add_plugin(kcm_krdc_rdpplugin ${kcm_krdc_rdpplugin_SRCS}) >+ >+ target_link_libraries(kcm_krdc_rdpplugin >+ ${KDE4_KDEUI_LIBS} >+ krdccore >+ ) >+ >+ add_dependencies(kcm_krdc_rdpplugin krdc_rdpplugin) >+ >+ install(TARGETS kcm_krdc_rdpplugin DESTINATION ${PLUGIN_INSTALL_DIR}) >+ install(TARGETS krdc_rdpplugin DESTINATION ${PLUGIN_INSTALL_DIR}) >+ >+ install(FILES krdc_rdp.desktop DESTINATION ${SERVICES_INSTALL_DIR}) >+ install(FILES krdc_rdp_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}) >+ >+ install(FILES rdp.protocol DESTINATION ${SERVICES_INSTALL_DIR}) >+ install(FILES smb2rdc.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ServiceMenus) >+endif(HAVE_RDESKTOP) >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/krdc_rdp_config.desktop kdenetwork-4.9.1/krdc.org/rdp/krdc_rdp_config.desktop >--- kdenetwork-4.9.1.org/krdc.org/rdp/krdc_rdp_config.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/krdc_rdp_config.desktop 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,60 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KCModule >+Name=RDP >+Name[ast]=RDP >+Name[bg]=RDP >+Name[bs]=RDP >+Name[ca]=RDP >+Name[ca@valencia]=RDP >+Name[cs]=RDP >+Name[da]=RDP >+Name[de]=RDP >+Name[el]=RDP >+Name[en_GB]=RDP >+Name[eo]=RDP >+Name[es]=RDP >+Name[et]=RDP >+Name[eu]=RDP >+Name[fi]=RDP >+Name[fr]=RDP >+Name[ga]=RDP >+Name[gl]=RDP >+Name[hr]=RDP >+Name[hu]=RDP >+Name[ia]=RDP >+Name[it]=RDP >+Name[ja]=RDP >+Name[kk]=RDP >+Name[km]=RDP >+Name[ko]=RDP >+Name[lt]=RDP >+Name[lv]=RDP >+Name[nb]=RDP >+Name[nds]=RDP >+Name[nl]=RDP >+Name[nn]=RDP >+Name[pa]=RDP >+Name[pl]=RDP >+Name[pt]=RDP >+Name[pt_BR]=RDP >+Name[ro]=RDP >+Name[ru]=ÐÐ°Ð·Ð¾Ð²Ð°Ñ Ð¿ÑогÑамма RDP >+Name[si]=RDP >+Name[sk]=RDP >+Name[sl]=RDP >+Name[sr]=Ð ÐÐ >+Name[sr@ijekavian]=Ð ÐÐ >+Name[sr@ijekavianlatin]=RDP >+Name[sr@latin]=RDP >+Name[sv]=RDP >+Name[tr]=RDP >+Name[ug]=RDP >+Name[uk]=RDP >+Name[wa]=RDP >+Name[x-test]=xxRDPxx >+Name[zh_CN]=RDP >+Name[zh_TW]=RDP >+ >+X-KDE-Library=kcm_krdc_rdpplugin >+X-KDE-ParentComponents=krdc_rdpplugin >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/krdc_rdp.desktop kdenetwork-4.9.1/krdc.org/rdp/krdc_rdp.desktop >--- kdenetwork-4.9.1.org/krdc.org/rdp/krdc_rdp.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/krdc_rdp.desktop 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,121 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KRDC/Plugin >+Icon=krdc >+Name=RDP >+Name[ast]=RDP >+Name[bg]=RDP >+Name[bs]=RDP >+Name[ca]=RDP >+Name[ca@valencia]=RDP >+Name[cs]=RDP >+Name[da]=RDP >+Name[de]=RDP >+Name[el]=RDP >+Name[en_GB]=RDP >+Name[eo]=RDP >+Name[es]=RDP >+Name[et]=RDP >+Name[eu]=RDP >+Name[fi]=RDP >+Name[fr]=RDP >+Name[ga]=RDP >+Name[gl]=RDP >+Name[hr]=RDP >+Name[hu]=RDP >+Name[ia]=RDP >+Name[it]=RDP >+Name[ja]=RDP >+Name[kk]=RDP >+Name[km]=RDP >+Name[ko]=RDP >+Name[lt]=RDP >+Name[lv]=RDP >+Name[nb]=RDP >+Name[nds]=RDP >+Name[nl]=RDP >+Name[nn]=RDP >+Name[pa]=RDP >+Name[pl]=RDP >+Name[pt]=RDP >+Name[pt_BR]=RDP >+Name[ro]=RDP >+Name[ru]=ÐÐ°Ð·Ð¾Ð²Ð°Ñ Ð¿ÑогÑамма RDP >+Name[si]=RDP >+Name[sk]=RDP >+Name[sl]=RDP >+Name[sr]=Ð ÐÐ >+Name[sr@ijekavian]=Ð ÐÐ >+Name[sr@ijekavianlatin]=RDP >+Name[sr@latin]=RDP >+Name[sv]=RDP >+Name[tr]=RDP >+Name[ug]=RDP >+Name[uk]=RDP >+Name[wa]=RDP >+Name[x-test]=xxRDPxx >+Name[zh_CN]=RDP >+Name[zh_TW]=RDP >+Comment=Allows managing RDP sessions through KRDC >+Comment[ast]=Permite la xestión de sesiones RDP per KRDC >+Comment[bg]=УпÑавление на ÑеÑии на RDP Ñ KRDC >+Comment[bs]=DopuÅ¡ta upravljanje RPD sesijama kroz KRDC >+Comment[ca]=Permet gestionar sessions RDP mitjançant el KRDC >+Comment[ca@valencia]=Permet gestionar sessions RDP mitjançant el KRDC >+Comment[cs]=UmožÅuje spravovánà sezenà RDP pomocà KRDC >+Comment[da]=Muliggør hÃ¥ndtering af RDP-sessioner via KRDC >+Comment[de]=Erlaubt die Verwaltung von RDP-Sitzungen über KRDC >+Comment[el]=ÎÏιÏÏÎÏει Ïη διαÏείÏιÏη ÏÏ Î½ÎµÎ´ÏιÏν RDP μÎÏÏ ÏÎ¿Ï KRDC >+Comment[en_GB]=Allows managing RDP sessions through KRDC >+Comment[es]=Permite la gestión de sesiones RDP mediante KRDC >+Comment[et]=RDP-seansside haldamise võimaldamine KRDC kaudu >+Comment[eu]=RDP saioak KRDC bidez kudeatzea baimentzen du >+Comment[fi]=Sallii RDP-istuntojen hallinnan KRDC:n kautta >+Comment[fr]=Permet de gérer des sessions RDP au travers de KRDC >+Comment[ga]=CeadaÃonn sé duit seisiúin RDP a bhainistiú trà KRDC >+Comment[gl]=Permite xestionar sesións RDP por medio de KRDC >+Comment[hr]=OmoguÄuje upravljanje sjednicama RDP-a kroz KRDC >+Comment[hu]=RDP-kezelés KRDC-bÅl >+Comment[ia]=Permitte gerer sessiones RDP per medio de KRDC >+Comment[it]=Permette di gestire sessioni RDP con KRDC >+Comment[ja]=KRDC ãã RDP ã»ãã·ã§ã³ã管çã§ããããã«ãã¾ã >+Comment[kk]=KRDC аÑÒÑÐ»Ñ RDP ÑеанÑÑаÑÑн баÑÒаÑÑÒа мүмкÑндÑк беÑÑ >+Comment[km]=á¢áá»áááá¶áâá²ááâáááááááááâááááâáááá RDP áá¶áááá KRDC >+Comment[ko]=KRDC를 íµí´ì RDP ì¸ì ê´ë¦¬í기 >+Comment[lt]=Leidžia valdyti RDP sesijas per KRDC >+Comment[lv]=Ä»auj pÄrvaldÄ«t RDP sesijas caur KRDC >+Comment[nb]=Tillater Ã¥ styre RDP-økter gjennom KRDC >+Comment[nds]=RDP-Törns över KRDC plegen >+Comment[nl]=Staat het beheer van RDP-sessies toe via KRDC >+Comment[nn]=Lèt deg handtera RDP-økter gjennom KRDC >+Comment[pa]=KRDC ਰਾਹà©à¨ RDP ਸ਼à©à¨¸à¨¼à¨¨à¨¾à¨ ਦ੠ਪਰਬੰਧ ਦ੠ਮਨà¨à¨¼à©à¨°à© >+Comment[pl]=Pozwala na zarzÄ dzanie sesjami RDP przez KRDC >+Comment[pt]=Permite a gestão de sessões RDP através do KRDC >+Comment[pt_BR]=Permite o gerenciamento de sessões RDP através do KRDC >+Comment[ro]=Permite gestiunea sesiunilor RDP prin KRDC >+Comment[ru]=РазÑеÑиÑÑ ÑпÑавление ÑеанÑами RDP ÑеÑез KRDC >+Comment[si]=KRDC à·à¶»à·à· RDP à·à·à¶» à¶´à·à¶½à¶±à¶ºà¶§ à¶à¶© දà·à¶ºà· >+Comment[sk]=UmožÅuje spravovanie RDP sedenà pomocou KRDC >+Comment[sl]=OmogoÄa upravljanje sej RDP prek KRDC >+Comment[sr]=УпÑавÑаÑе Ð ÐÐ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavian]=УпÑавÑаÑе Ð ÐÐ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavianlatin]=Upravljanje RDP sesijama kroz KRDC >+Comment[sr@latin]=Upravljanje RDP sesijama kroz KRDC >+Comment[sv]=TillÃ¥ter hantering av RDP-sessioner via KRDC >+Comment[th]=à¸à¸à¸¸à¸à¸²à¸à¹à¸«à¹à¸à¸³à¸à¸²à¸£à¸à¸±à¸à¸à¸²à¸£à¸§à¸²à¸£à¸°à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸ RDP à¸à¹à¸²à¸à¸à¸²à¸à¹à¸à¸£à¹à¸à¸£à¸¡ KRDC >+Comment[tr]=RDP oturumlarını KRDC üzerinden yönetmeye izin verir >+Comment[uk]=ÐÐ°Ð´Ð°Ñ Ð·Ð¼Ð¾Ð³Ñ ÐºÐµÑÑваÑи ÑеанÑами RDP за Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ KRDC >+Comment[x-test]=xxAllows managing RDP sessions through KRDCxx >+Comment[zh_CN]=å è®¸ç¨æ·éè¿ KRDC 管ç RDPä¼è¯ >+Comment[zh_TW]=å 許éé KRDC 管ç RDP å·¥ä½é段 >+ >+X-KDE-PluginInfo-Author=Urs Wolfer >+X-KDE-PluginInfo-Email=uwolfer@kde.org >+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_rdpplugin >+X-KDE-PluginInfo-Name=krdc_rdpplugin >+ >+X-KDE-KRDC-Sorting=60 >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdphostpreferences.cpp kdenetwork-4.9.1/krdc.org/rdp/rdphostpreferences.cpp >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdphostpreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdphostpreferences.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,231 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "rdphostpreferences.h" >+ >+#include "settings.h" >+ >+#include <KDebug> >+ >+#include <QDesktopWidget> >+ >+static const QStringList keymaps = (QStringList() >+ << "ar" >+ << "cs" >+ << "da" >+ << "de" >+ << "de-ch" >+ << "en-dv" >+ << "en-gb" >+ << "en-us" >+ << "es" >+ << "et" >+ << "fi" >+ << "fo" >+ << "fr" >+ << "fr-be" >+ << "fr-ca" >+ << "fr-ch" >+ << "he" >+ << "hr" >+ << "hu" >+ << "is" >+ << "it" >+ << "ja" >+ << "ko" >+ << "lt" >+ << "lv" >+ << "mk" >+ << "nl" >+ << "nl-be" >+ << "no" >+ << "pl" >+ << "pt" >+ << "pt-br" >+ << "ru" >+ << "sl" >+ << "sv" >+ << "th" >+ << "tr" >+); >+ >+static const int defaultKeymap = 7; // en-us >+ >+inline int keymap2int(const QString &keymap) >+{ >+ const int index = keymaps.lastIndexOf(keymap); >+ return (index == -1) ? defaultKeymap : index; >+} >+ >+inline QString int2keymap(int layout) >+{ >+ if (layout >= 0 && layout < keymaps.count()) >+ return keymaps.at(layout); >+ else >+ return keymaps.at(defaultKeymap); >+} >+ >+RdpHostPreferences::RdpHostPreferences(KConfigGroup configGroup, QObject *parent) >+ : HostPreferences(configGroup, parent) >+{ >+} >+ >+RdpHostPreferences::~RdpHostPreferences() >+{ >+} >+ >+QWidget* RdpHostPreferences::createProtocolSpecificConfigPage() >+{ >+ QWidget *rdpPage = new QWidget(); >+ rdpUi.setupUi(rdpPage); >+ >+ rdpUi.loginGroupBox->setVisible(false); >+ >+ rdpUi.kcfg_Height->setValue(height()); >+ rdpUi.kcfg_Width->setValue(width()); >+ rdpUi.kcfg_ColorDepth->setCurrentIndex(colorDepth()); >+ rdpUi.kcfg_KeyboardLayout->setCurrentIndex(keymap2int(keyboardLayout())); >+ rdpUi.kcfg_Sound->setCurrentIndex(sound()); >+ rdpUi.kcfg_Console->setChecked(console()); >+ rdpUi.kcfg_ExtraOptions->setText(extraOptions()); >+ >+ connect(rdpUi.resolutionComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateWidthHeight(int))); >+ >+ const QString resolutionString = QString::number(width()) + 'x' + QString::number(height()); >+ const int resolutionIndex = rdpUi.resolutionComboBox->findText(resolutionString, Qt::MatchContains); >+ rdpUi.resolutionComboBox->setCurrentIndex((resolutionIndex == -1) ? rdpUi.resolutionComboBox->count() - 1 : resolutionIndex); >+ >+ return rdpPage; >+} >+ >+void RdpHostPreferences::updateWidthHeight(int index) >+{ >+ switch (index) { >+ case 0: >+ rdpUi.kcfg_Height->setValue(480); >+ rdpUi.kcfg_Width->setValue(640); >+ break; >+ case 1: >+ rdpUi.kcfg_Height->setValue(600); >+ rdpUi.kcfg_Width->setValue(800); >+ break; >+ case 2: >+ rdpUi.kcfg_Height->setValue(768); >+ rdpUi.kcfg_Width->setValue(1024); >+ break; >+ case 3: >+ rdpUi.kcfg_Height->setValue(1024); >+ rdpUi.kcfg_Width->setValue(1280); >+ break; >+ case 4: >+ rdpUi.kcfg_Height->setValue(1200); >+ rdpUi.kcfg_Width->setValue(1600); >+ break; >+ case 5: { >+ QDesktopWidget *desktop = QApplication::desktop(); >+ int currentScreen = desktop->screenNumber(rdpUi.kcfg_Height); >+ rdpUi.kcfg_Height->setValue(desktop->screenGeometry(currentScreen).height()); >+ rdpUi.kcfg_Width->setValue(desktop->screenGeometry(currentScreen).width()); >+ break; >+ } >+ case 6: >+ default: >+ break; >+ } >+ >+ const bool enabled = (index == 6) ? true : false; >+ >+ rdpUi.kcfg_Height->setEnabled(enabled); >+ rdpUi.kcfg_Width->setEnabled(enabled); >+ rdpUi.heightLabel->setEnabled(enabled); >+ rdpUi.widthLabel->setEnabled(enabled); >+} >+ >+void RdpHostPreferences::acceptConfig() >+{ >+ HostPreferences::acceptConfig(); >+ >+ setHeight(rdpUi.kcfg_Height->value()); >+ setWidth(rdpUi.kcfg_Width->value()); >+ setColorDepth(rdpUi.kcfg_ColorDepth->currentIndex()); >+ setKeyboardLayout(int2keymap(rdpUi.kcfg_KeyboardLayout->currentIndex())); >+ setSound(rdpUi.kcfg_Sound->currentIndex()); >+ setConsole(rdpUi.kcfg_Console->isChecked()); >+ setExtraOptions(rdpUi.kcfg_ExtraOptions->text()); >+} >+ >+void RdpHostPreferences::setColorDepth(int colorDepth) >+{ >+ if (colorDepth >= 0) >+ m_configGroup.writeEntry("colorDepth", colorDepth); >+} >+ >+int RdpHostPreferences::colorDepth() const >+{ >+ return m_configGroup.readEntry("colorDepth", Settings::colorDepth()); >+} >+ >+void RdpHostPreferences::setKeyboardLayout(const QString &keyboardLayout) >+{ >+ if (!keyboardLayout.isNull()) >+ m_configGroup.writeEntry("keyboardLayout", keymap2int(keyboardLayout)); >+} >+ >+QString RdpHostPreferences::keyboardLayout() const >+{ >+ return int2keymap(m_configGroup.readEntry("keyboardLayout", Settings::keyboardLayout())); >+} >+ >+void RdpHostPreferences::setSound(int sound) >+{ >+ if (sound >= 0) >+ m_configGroup.writeEntry("sound", sound); >+} >+ >+int RdpHostPreferences::sound() const >+{ >+ return m_configGroup.readEntry("sound", Settings::sound()); >+} >+ >+void RdpHostPreferences::setConsole(bool console) >+{ >+ m_configGroup.writeEntry("console", console); >+} >+ >+bool RdpHostPreferences::console() const >+{ >+ return m_configGroup.readEntry("console", Settings::console()); >+} >+ >+void RdpHostPreferences::setExtraOptions(const QString &extraOptions) >+{ >+ if (!extraOptions.isNull()) >+ m_configGroup.writeEntry("extraOptions", extraOptions); >+} >+ >+QString RdpHostPreferences::extraOptions() const >+{ >+ return m_configGroup.readEntry("extraOptions", Settings::extraOptions()); >+} >+ >+#include "rdphostpreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdphostpreferences.h kdenetwork-4.9.1/krdc.org/rdp/rdphostpreferences.h >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdphostpreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdphostpreferences.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,60 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 RDPHOSTPREFERENCES_H >+#define RDPHOSTPREFERENCES_H >+ >+#include "hostpreferences.h" >+#include "ui_rdppreferences.h" >+ >+class RdpHostPreferences : public HostPreferences >+{ >+ Q_OBJECT >+ >+public: >+ explicit RdpHostPreferences(KConfigGroup configGroup, QObject *parent = 0); >+ ~RdpHostPreferences(); >+ >+ void setColorDepth(int colorDepth); >+ int colorDepth() const; >+ void setKeyboardLayout(const QString &keyboardLayout); >+ QString keyboardLayout() const; >+ void setSound(int sound); >+ int sound() const; >+ void setConsole(bool console); >+ bool console() const; >+ void setExtraOptions(const QString &extraOptions); >+ QString extraOptions() const; >+ >+protected: >+ QWidget* createProtocolSpecificConfigPage(); >+ void acceptConfig(); >+ >+private: >+ Ui::RdpPreferences rdpUi; >+ >+private slots: >+ void updateWidthHeight(int index); >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdppreferences.cpp kdenetwork-4.9.1/krdc.org/rdp/rdppreferences.cpp >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdppreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdppreferences.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,66 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "rdppreferences.h" >+#include "remoteviewfactory.h" >+#include "settings.h" >+ >+#include "ui_rdppreferences.h" >+ >+#include <KDebug> >+ >+KRDC_PLUGIN_EXPORT(RdpPreferences) >+ >+RdpPreferences::RdpPreferences(QWidget *parent, const QVariantList &args) >+ : KCModule(KrdcFactory::componentData(), parent, args) >+{ >+ Ui::RdpPreferences rdpUi; >+ rdpUi.setupUi(this); >+ // would need a lot of code duplication. find a solution, bit it's not >+ // that important because you will not change this configuration each day... >+ // see rdp/rdphostpreferences.cpp >+ rdpUi.resolutionComboBox->hide(); >+ rdpUi.resolutionDummyLabel->hide(); >+ rdpUi.kcfg_Height->setEnabled(true); >+ rdpUi.kcfg_Width->setEnabled(true); >+ rdpUi.heightLabel->setEnabled(true); >+ rdpUi.widthLabel->setEnabled(true); >+ >+ addConfig(Settings::self(), this); >+} >+ >+RdpPreferences::~RdpPreferences() >+{ >+} >+ >+void RdpPreferences::load() >+{ >+ KCModule::load(); >+} >+ >+void RdpPreferences::save() >+{ >+ KCModule::save(); >+} >+ >+#include "rdppreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdppreferences.h kdenetwork-4.9.1/krdc.org/rdp/rdppreferences.h >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdppreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdppreferences.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,44 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 RDPPREFERENCES_H >+#define RDPPREFERENCES_H >+ >+#include "rdphostpreferences.h" >+ >+#include <KCModule> >+ >+class RdpPreferences : public KCModule >+{ >+ Q_OBJECT >+ >+public: >+ explicit RdpPreferences(QWidget *parent = 0, const QVariantList &args = QVariantList()); >+ ~RdpPreferences(); >+ >+ virtual void save(); >+ virtual void load(); >+ >+}; >+ >+#endif // RDPPREFERENCES_H >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdppreferences.ui kdenetwork-4.9.1/krdc.org/rdp/rdppreferences.ui >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdppreferences.ui 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdppreferences.ui 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,568 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<ui version="4.0"> >+ <class>RdpPreferences</class> >+ <widget class="QWidget" name="RdpPreferences"> >+ <property name="geometry"> >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>484</width> >+ <height>406</height> >+ </rect> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout_2"> >+ <item> >+ <widget class="QGroupBox" name="connectionGroupBox"> >+ <property name="title"> >+ <string>Connection</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout_2"> >+ <item row="0" column="0"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="QLabel" name="resolutionLabel"> >+ <property name="text"> >+ <string>Desktop &resolution:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>resolutionComboBox</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="resolutionDummyLabel"/> >+ </item> >+ </layout> >+ </item> >+ <item row="0" column="1"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="KComboBox" name="resolutionComboBox"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>1</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Minimal (640x480)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Small (800x600)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Normal (1024x768)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Large (1280x1024)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Very Large (1600x1200)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Current Screen Resolution</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Custom Resolution (...)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout"> >+ <item> >+ <widget class="QLabel" name="widthLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>&Width:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_Width</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_Width"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the width of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>800</number> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="heightLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>H&eight:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_Height</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_Height"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the height of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>600</number> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </item> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="colorDepthLabel"> >+ <property name="text"> >+ <string>Color &depth:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_ColorDepth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KComboBox" name="kcfg_ColorDepth"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Low Color (8 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>High Color (16 Bit)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>True Color (24 Bit)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="2" column="0"> >+ <widget class="QLabel" name="layoutLabel"> >+ <property name="text"> >+ <string>&Keyboard layout:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_KeyboardLayout</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="2" column="1"> >+ <widget class="KComboBox" name="kcfg_KeyboardLayout"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Use this to specify your keyboard layout. This layout setting is used to send the correct keyboard codes to the server.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>7</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Arabic (ar)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Czech (cs)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Danish (da)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>German (de)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swiss German (de-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>American Dvorak (en-dv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>British English (en-gb)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>US English (en-us)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Spanish (es)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Estonian (et)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Finnish (fi)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Faroese (fo)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>French (fr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Belgian (fr-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>French Canadian (fr-ca)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swiss French (fr-ch)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Hebrew (he)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Croatian (hr)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Hungarian (hu)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Icelandic (is)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Italian (it)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Japanese (ja)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Korean (ko)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Lithuanian (lt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Latvian (lv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Macedonian (mk)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Dutch (nl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Belgian Dutch (nl-be)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Norwegian (no)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Polish (pl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Portuguese (pt)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Brazilian (pt-br)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Russian (ru)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Slovenian (sl)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Swedish (sv)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Thai (th)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Turkish (tr)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="3" column="0"> >+ <widget class="QLabel" name="soundLabel"> >+ <property name="text"> >+ <string comment="label for soundsettings in preferences dialog">Sound:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_Sound</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="3" column="1"> >+ <widget class="KComboBox" name="kcfg_Sound"> >+ <item> >+ <property name="text"> >+ <string>On This Computer</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>On Remote Computer</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Disable Sound</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="expertGroupBox"> >+ <property name="title"> >+ <string>Expert Options</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout"> >+ <item row="0" column="0"> >+ <widget class="QLabel" name="consoleLabel"> >+ <property name="text"> >+ <string>Console login:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_Console</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="0" column="1"> >+ <widget class="QCheckBox" name="kcfg_Console"> >+ <property name="text"> >+ <string>Attach to Windows Server console</string> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="extraOptionsLabel"> >+ <property name="text"> >+ <string>Extra options:</string> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_ExtraOptions</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KLineEdit" name="kcfg_ExtraOptions"> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can enter additional rdesktop options.</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <widget class="QGroupBox" name="loginGroupBox"> >+ <property name="title"> >+ <string>Login</string> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout"> >+ <item> >+ <layout class="QFormLayout" name="formLayout_3"> >+ <item row="1" column="0"> >+ <widget class="QLabel" name="defaultUserLabel"> >+ <property name="text"> >+ <string>Default user name:</string> >+ </property> >+ </widget> >+ </item> >+ <item row="1" column="1"> >+ <widget class="KLineEdit" name="kcfg_DefaultRdpUserName"> >+ <property name="clickMessage"> >+ <string>No default user name</string> >+ </property> >+ <property name="showClearButton" stdset="0"> >+ <bool>true</bool> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ <item> >+ <widget class="QCheckBox" name="kcfg_RecognizeLdapLogins"> >+ <property name="text"> >+ <string>Automatically recognize "LDAP"-Logins and share passwords</string> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <spacer> >+ <property name="orientation"> >+ <enum>Qt::Vertical</enum> >+ </property> >+ <property name="sizeHint" stdset="0"> >+ <size> >+ <width>428</width> >+ <height>16</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ </layout> >+ </widget> >+ <customwidgets> >+ <customwidget> >+ <class>KLineEdit</class> >+ <extends>QLineEdit</extends> >+ <header>klineedit.h</header> >+ </customwidget> >+ <customwidget> >+ <class>KComboBox</class> >+ <extends>QComboBox</extends> >+ <header>kcombobox.h</header> >+ </customwidget> >+ </customwidgets> >+ <tabstops> >+ <tabstop>resolutionComboBox</tabstop> >+ <tabstop>kcfg_Width</tabstop> >+ <tabstop>kcfg_Height</tabstop> >+ <tabstop>kcfg_ColorDepth</tabstop> >+ <tabstop>kcfg_KeyboardLayout</tabstop> >+ <tabstop>kcfg_Sound</tabstop> >+ <tabstop>kcfg_Console</tabstop> >+ <tabstop>kcfg_ExtraOptions</tabstop> >+ <tabstop>kcfg_DefaultRdpUserName</tabstop> >+ <tabstop>kcfg_RecognizeLdapLogins</tabstop> >+ </tabstops> >+ <resources/> >+ <connections/> >+</ui> >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdp.protocol kdenetwork-4.9.1/krdc.org/rdp/rdp.protocol >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdp.protocol 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdp.protocol 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,12 @@ >+[Protocol] >+exec=krdc '%u' >+protocol=rdp >+input=none >+output=none >+helper=true >+listing= >+reading=false >+writing=false >+makedir=false >+deleting=false >+Icon=krdc >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdpview.cpp kdenetwork-4.9.1/krdc.org/rdp/rdpview.cpp >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdpview.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdpview.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,294 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2002 Arend van Beelen jr. <arend@auton.nl> >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "rdpview.h" >+ >+#include "settings.h" >+ >+#include <KInputDialog> >+#include <KMessageBox> >+#include <KPasswordDialog> >+#include <KShell> >+ >+#include <QX11EmbedContainer> >+#include <QEvent> >+ >+RdpView::RdpView(QWidget *parent, >+ const KUrl &url, >+ KConfigGroup configGroup, >+ const QString &user, const QString &password, >+ int flags, const QString &domain, >+ const QString &shell, const QString &directory) >+ : RemoteView(parent), >+ m_user(user), >+ m_password(password), >+ m_flags(flags), >+ m_domain(domain), >+ m_shell(shell), >+ m_directory(directory), >+ m_quitFlag(false), >+ m_process(NULL) >+{ >+ m_url = url; >+ m_host = url.host(); >+ m_port = url.port(); >+ >+ if (m_port <= 0) { >+ m_port = TCP_PORT_RDP; >+ } >+ >+ m_container = new QX11EmbedContainer(this); >+ m_container->installEventFilter(this); >+ >+ m_hostPreferences = new RdpHostPreferences(configGroup, this); >+} >+ >+RdpView::~RdpView() >+{ >+ startQuitting(); >+} >+ >+// filter out key and mouse events to the container if we are view only >+//FIXME: X11 events are passed to the app before getting caught in the Qt event processing >+bool RdpView::eventFilter(QObject *obj, QEvent *event) >+{ >+ if (m_viewOnly) { >+ if (event->type() == QEvent::KeyPress || >+ event->type() == QEvent::KeyRelease || >+ event->type() == QEvent::MouseButtonDblClick || >+ event->type() == QEvent::MouseButtonPress || >+ event->type() == QEvent::MouseButtonRelease || >+ event->type() == QEvent::MouseMove) >+ return true; >+ } >+ return RemoteView::eventFilter(obj, event); >+} >+ >+QSize RdpView::framebufferSize() >+{ >+ return m_container->minimumSizeHint(); >+} >+ >+QSize RdpView::sizeHint() const >+{ >+ return maximumSize(); >+} >+ >+void RdpView::startQuitting() >+{ >+ kDebug(5012) << "About to quit"; >+ m_quitFlag = true; >+ if (m_process) { >+ m_process->terminate(); >+ m_process->waitForFinished(1000); >+ m_container->discardClient(); >+ } >+} >+ >+bool RdpView::isQuitting() >+{ >+ return m_quitFlag; >+} >+ >+bool RdpView::start() >+{ >+ m_container->show(); >+ >+ if (m_hostPreferences->walletSupport()) { >+ if (m_url.userName().isEmpty()) { >+ QString userName; >+ bool ok = false; >+ >+ userName = KInputDialog::getText(i18n("Enter Username"), >+ i18n("Please enter the username you would like to use for login."), >+ Settings::defaultRdpUserName(), &ok, this); >+ >+ if (ok) >+ m_url.setUserName(userName); >+ } >+ >+ if (!m_url.userName().isEmpty()) { >+ const bool useLdapLogin = Settings::recognizeLdapLogins() && m_url.userName().contains('\\'); >+ kDebug(5012) << "Is LDAP login:" << useLdapLogin << m_url.userName(); >+ QString walletPassword = readWalletPassword(useLdapLogin); >+ >+ if (!walletPassword.isNull()) >+ m_url.setPassword(walletPassword); >+ else { >+ KPasswordDialog dialog(this); >+ dialog.setPrompt(i18n("Access to the system requires a password.")); >+ if (dialog.exec() == KPasswordDialog::Accepted) { >+ m_url.setPassword(dialog.password()); >+ >+ if (m_hostPreferences->walletSupport()) >+ saveWalletPassword(dialog.password(), useLdapLogin); >+ } >+ } >+ } >+ } >+ >+ m_process = new QProcess(m_container); >+ >+ QStringList arguments; >+ arguments << "-g" << (QString::number(m_hostPreferences->width()) + 'x' + >+ QString::number(m_hostPreferences->height())); >+ arguments << "-k" << m_hostPreferences->keyboardLayout(); >+ >+ if (!m_url.userName().isEmpty()) >+ arguments << "-u" << m_url.userName(); >+ else >+ arguments << "-u" << ""; >+ >+ if (!m_url.password().isNull()) >+ arguments << "-p" << m_url.password(); >+ >+ arguments << "-D"; // request the window has no decorations >+ arguments << "-X" << QString::number(m_container->winId()); >+ arguments << "-a" << QString::number((m_hostPreferences->colorDepth() + 1) * 8); >+ >+ QString sound; >+ switch (m_hostPreferences->sound()) { >+ case 0: >+ sound = "local"; >+ break; >+ case 1: >+ sound = "remote"; >+ break; >+ case 2: >+ default: >+ sound = "off"; >+ } >+ arguments << "-r" << "sound:" + sound; >+ >+ if (m_hostPreferences->console()) { >+ arguments << "-0"; >+ } >+ >+ if (!m_hostPreferences->extraOptions().isEmpty()) { >+ const QStringList additionalArguments = KShell::splitArgs(m_hostPreferences->extraOptions()); >+ arguments += additionalArguments; >+ } >+ >+ arguments << (m_host + ':' + QString::number(m_port)); >+ >+ setStatus(Connecting); >+ >+ connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError))); >+ connect(m_process, SIGNAL(readyReadStandardError()), SLOT(receivedStandardError())); >+ connect(m_container, SIGNAL(clientClosed()), SLOT(connectionClosed())); >+ connect(m_container, SIGNAL(clientIsEmbedded()), SLOT(connectionOpened())); >+ >+ m_process->start("rdesktop", arguments); >+ >+ return true; >+} >+ >+HostPreferences* RdpView::hostPreferences() >+{ >+ return m_hostPreferences; >+} >+ >+void RdpView::switchFullscreen(bool on) >+{ >+ if (on == true) { >+ m_container->grabKeyboard(); >+ } >+} >+ >+void RdpView::connectionOpened() >+{ >+ kDebug(5012) << "Connection opened"; >+ const QSize size = m_container->minimumSizeHint(); >+ kDebug(5012) << "Size hint: " << size.width() << " " << size.height(); >+ setStatus(Connected); >+ setFixedSize(size); >+ resize(size); >+ m_container->setFixedSize(size); >+ emit framebufferSizeChanged(size.width(), size.height()); >+ emit connected(); >+ setFocus(); >+} >+ >+QPixmap RdpView::takeScreenshot() >+{ >+ return QPixmap::grabWindow(m_container->clientWinId()); >+} >+ >+void RdpView::connectionClosed() >+{ >+ emit disconnected(); >+ setStatus(Disconnected); >+ m_quitFlag = true; >+} >+ >+void RdpView::processError(QProcess::ProcessError error) >+{ >+ if (m_quitFlag) // do not try to show error messages while quitting (prevent crashes) >+ return; >+ >+ if (m_status == Connecting) { >+ setStatus(Disconnected); >+ >+ if (error == QProcess::FailedToStart) { >+ KMessageBox::error(0, i18n("Could not start \"rdesktop\"; make sure rdesktop is properly installed."), >+ i18n("RDP Failure")); >+ return; >+ } >+ >+ if (m_clientVersion.isEmpty()) { >+ KMessageBox::error(0, i18n("Connection attempt to host failed."), >+ i18n("Connection Failure")); >+ } else { >+ KMessageBox::error(0, i18n("The version of \"rdesktop\" you are using (%1) is too old:\n" >+ "rdesktop 1.3.2 or greater is required.", m_clientVersion), >+ i18n("RDP Failure")); >+ } >+ emit disconnectedError(); >+ } >+} >+ >+void RdpView::receivedStandardError() >+{ >+ const QString output(m_process->readAllStandardError()); >+ QString line; >+ int i = 0; >+ while (!(line = output.section('\n', i, i)).isEmpty()) { >+ if (line.startsWith(QLatin1String("Version "))) { >+ m_clientVersion = line.section(' ', 1, 1); >+ m_clientVersion = m_clientVersion.left(m_clientVersion.length() - 1); >+ return; >+ } else { >+ kDebug(5012) << "Process error output: " << line; >+ } >+ i++; >+ } >+} >+ >+void RdpView::setGrabAllKeys(bool grabAllKeys) >+{ >+ Q_UNUSED(grabAllKeys); >+ // do nothing.. grabKeyboard seems not to be supported in QX11EmbedContainer >+} >+ >+#include "rdpview.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdpviewfactory.cpp kdenetwork-4.9.1/krdc.org/rdp/rdpviewfactory.cpp >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdpviewfactory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdpviewfactory.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,91 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "rdpviewfactory.h" >+ >+#include <KDebug> >+#include <KStandardDirs> >+ >+KRDC_PLUGIN_EXPORT(RdpViewFactory) >+ >+RdpViewFactory::RdpViewFactory(QObject *parent, const QVariantList &args) >+ : RemoteViewFactory(parent) >+{ >+ Q_UNUSED(args); >+ >+ KGlobal::locale()->insertCatalog("krdc"); >+ >+ m_connectToolTipString = i18n("Connect to a Windows Remote Desktop (RDP)"); >+ >+ QMetaObject::invokeMethod(this, "checkRdektopAvailability", Qt::DirectConnection); >+} >+ >+RdpViewFactory::~RdpViewFactory() >+{ >+} >+ >+bool RdpViewFactory::supportsUrl(const KUrl &url) const >+{ >+ return (url.scheme().compare("rdp", Qt::CaseInsensitive) == 0); >+} >+ >+RemoteView *RdpViewFactory::createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+{ >+ return new RdpView(parent, url, configGroup); >+} >+ >+HostPreferences *RdpViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) >+{ >+ return new RdpHostPreferences(configGroup, parent); >+} >+ >+QString RdpViewFactory::scheme() const >+{ >+ return "rdp"; >+} >+ >+QString RdpViewFactory::connectActionText() const >+{ >+ return i18n("New RDP Connection..."); >+} >+ >+QString RdpViewFactory::connectButtonText() const >+{ >+ return m_connectToolTipString; >+} >+ >+QString RdpViewFactory::connectToolTipText() const >+{ >+ return i18n("<html>Enter the address here. Port is optional.<br />" >+ "<i>Example: rdpserver:3389 (host:port)</i></html>"); >+} >+ >+void RdpViewFactory::checkRdektopAvailability() >+{ >+ if (KStandardDirs::findExe("rdesktop").isEmpty()) { >+ m_connectToolTipString += '\n' + i18n("The application \"rdesktop\" cannot be found on your system; make sure it is properly installed " >+ "if you need RDP support."); >+ } >+} >+ >+#include "moc_rdpviewfactory.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdpviewfactory.h kdenetwork-4.9.1/krdc.org/rdp/rdpviewfactory.h >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdpviewfactory.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdpviewfactory.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,62 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 RDPVIEWFACTORY_H >+#define RDPVIEWFACTORY_H >+ >+#include "remoteviewfactory.h" >+ >+#include "rdpview.h" >+#include "rdppreferences.h" >+ >+class RdpViewFactory : public RemoteViewFactory >+{ >+ Q_OBJECT >+ >+public: >+ explicit RdpViewFactory(QObject *parent, const QVariantList &args); >+ >+ virtual ~RdpViewFactory(); >+ >+ virtual bool supportsUrl(const KUrl &url) const; >+ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup); >+ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent); >+ >+ virtual QString scheme() const; >+ >+ virtual QString connectActionText() const; >+ >+ virtual QString connectButtonText() const; >+ >+ virtual QString connectToolTipText() const; >+ >+private Q_SLOTS: >+ void checkRdektopAvailability(); >+ >+private: >+ QString m_connectToolTipString; >+}; >+ >+#endif // RDPVIEWFACTORY_H >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/rdpview.h kdenetwork-4.9.1/krdc.org/rdp/rdpview.h >--- kdenetwork-4.9.1.org/krdc.org/rdp/rdpview.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/rdpview.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,100 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2002 Arend van Beelen jr. <arend@auton.nl> >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 RDPVIEW_H >+#define RDPVIEW_H >+ >+#include "remoteview.h" >+ >+#include "rdphostpreferences.h" >+ >+#include <QProcess> >+ >+#define TCP_PORT_RDP 3389 >+#define RDP_LOGON_NORMAL 0x33 >+ >+class RdpView; >+ >+class QX11EmbedContainer; >+ >+class RdpView : public RemoteView >+{ >+ Q_OBJECT >+ >+public: >+ explicit RdpView(QWidget *parent = 0, >+ const KUrl &url = KUrl(), >+ KConfigGroup configGroup = KConfigGroup(), >+ const QString &user = QString(), const QString &password = QString(), >+ int flags = RDP_LOGON_NORMAL, const QString &domain = QString(), >+ const QString &shell = QString(), const QString &directory = QString()); >+ >+ virtual ~RdpView(); >+ >+ // functions regarding the window >+ virtual QSize framebufferSize(); // returns the size of the remote view >+ QSize sizeHint() const; // returns the suggested size >+ >+ // functions regarding the connection >+ virtual void startQuitting(); // start closing the connection >+ virtual bool isQuitting(); // are we currently closing the connection? >+ virtual bool start(); // open a connection >+ void setGrabAllKeys(bool grabAllKeys); >+ >+ HostPreferences* hostPreferences(); >+ >+ virtual QPixmap takeScreenshot(); >+ >+public slots: >+ virtual void switchFullscreen(bool on); >+ >+protected: >+ bool eventFilter(QObject *obj, QEvent *event); >+ >+private: >+ // properties used for setting up the connection >+ QString m_name; // name of the connection >+ QString m_user; // the user to use to log in >+ QString m_password; // the password to use >+ int m_flags; // flags which determine how the connection is set up >+ QString m_domain; // the domain where the host is on >+ QString m_shell; // the shell to use >+ QString m_directory; // the working directory on the server >+ >+ // other properties >+ bool m_quitFlag; // if set: die >+ QString m_clientVersion; // version number returned by rdesktop >+ QX11EmbedContainer *m_container; // container for the rdesktop window >+ QProcess *m_process; // rdesktop process >+ >+ RdpHostPreferences *m_hostPreferences; >+ >+private slots: >+ void connectionOpened(); // called if rdesktop started >+ void connectionClosed(); // called if rdesktop quits >+ void processError(QProcess::ProcessError error); // called if rdesktop dies >+ void receivedStandardError(); // catches rdesktop debug output >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/rdp/smb2rdc.desktop kdenetwork-4.9.1/krdc.org/rdp/smb2rdc.desktop >--- kdenetwork-4.9.1.org/krdc.org/rdp/smb2rdc.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/rdp/smb2rdc.desktop 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,73 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KonqPopupMenu/Plugin >+MimeType=application/x-smb-server; >+Actions=smb2rdc; >+ >+[Desktop Action smb2rdc] >+Name=Open Remote Desktop Connection to This Machine >+Name[ar]=Ø§ÙØªØ ع٠بعد Ø³Ø·Ø Ø§ÙÙ ÙØªØ¨ Ø§ÙØ§ØªØµØ§Ù Ø¥ÙÙ ÙØ°Ù Ø§ÙØ¢ÙØ© >+Name[ast]=Abrir conexón remota d'escritoriu a esti sistema >+Name[bg]=ÐÑÑзка Ñ Ð¾ÑдалеÑен ÑабоÑно мÑÑÑо Ñ Ð¸Ð·Ð±ÑÐ°Ð½Ð¸Ñ ÐºÐ¾Ð¼Ð¿ÑÑÑÑ >+Name[bn]=à¦à¦ মà§à¦¶à¦¿à¦¨à§ পà§à¦°à¦¤à§à¦¯à¦¨à§à¦¤ ডà§à¦¸à§à¦à¦à¦ªà§à¦° সà¦à¦¯à§à¦ à¦à§à¦²à§ >+Name[bs]=Otvara udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[ca]=Obre una connexió remota d'escriptori a aquesta mà quina >+Name[ca@valencia]=Obri una connexió remota d'escriptori a esta mà quina >+Name[cs]=OtevÅÃt vzdálené pÅipojenà plochy k tomuto poÄÃtaÄi >+Name[da]=à bn ekstern desktopforbindelse til denne maskine >+Name[de]=Verbindung zur Arbeitsfläche dieses Rechners herstellen >+Name[el]=ÎÎ·Î¼Î¹Î¿Ï Ïγία ÏÏνδεÏÎ·Ï Ïε αÏομακÏÏ ÏμÎνη εÏιÏάνεια εÏγαÏÎ¯Î±Ï Ïε Î±Ï ÏÏ Ïο μηÏάνημα >+Name[en_GB]=Open Remote Desktop Connection to This Machine >+Name[eo]=Malfermi deforan tabulan konekton al tiu maÅino >+Name[es]=Abrir conexión remota de escritorio a este sistema >+Name[et]=Kaugtöölaua ühenduse avamine sellesse arvutisse >+Name[eu]=Ireki urruneko mahaigainaren konexioa makina honetara >+Name[fa]=باز کرد٠اتصا٠رÙÙ ÛØ²Û Ø±Ø§Ù Ø¯ÙØ± Ø¨Ø±Ø§Û Ø§Û٠٠اشÛÙ >+Name[fi]=Avaa etätyöpöytäyhteys tähän koneeseen >+Name[fr]=Ouvrir une connexion distante au bureau de cette machine >+Name[ga]=Oscail Ceangal Deisce Cianda leis an RÃomhaire Seo >+Name[gl]=Abrir unha conexión remota co escritorio desta máquina >+Name[he]=×¤×ª× ××××ר ש×××× ×¢×××× ×ר×××§ ××××× × ×× >+Name[hi]=à¤à¤¸ मशà¥à¤¨ à¤à¥ लिठरिमà¥à¤ डà¥à¤¸à¥à¤à¤à¥à¤ª à¤à¤¨à¥à¤à¥à¤¶à¤¨ à¤à¥à¤²à¥à¤ >+Name[hne]=यॠमसà¥à¤¨ बर रिमà¥à¤ डà¥à¤¸à¥à¤à¤à¤¾à¤ª à¤à¤¨à¥à¤à¥à¤¸à¤¨ à¤à¥à¤²à¤µ >+Name[hr]=Otvorena veza udaljenog pristupa prema ovom ureÄaju >+Name[hu]=Távoli munkaasztal nyitása itt >+Name[ia]=Aperi connexion de scriptorio remote a iste machina >+Name[is]=Opna fjarlæga skjáborðtengingu til þessarar vélar >+Name[it]=Apri connessione a desktop remoto a questa macchina >+Name[ja]=ãã®ãã¹ãã¸ãªã¢ã¼ããã¹ã¯ãããæ¥ç¶ãéã >+Name[kk]=ÐÑÑ ÐºÐ¾Ð¼Ð¿ÑÑÑеÑÐ´ÐµÐ³Ñ Ò¯ÑÑелге ÒаÑÑÒ ÒоÑÑлÑÐ¼Ð´Ñ Ð°ÑÑ >+Name[km]=áá¾áâáá¶áâáâáááá¶ááâááááâáá»âáá¸âá áááá¶áâáá âááá¶ááá¸áâááá >+Name[ko]=ì´ ìì¤í ì¼ë¡ì ì격 ë°ì¤í¬í± ì°ê²° ì´ê¸° >+Name[lt]=Užmegzti nutolusio darbastalio prijungimÄ prie Å¡io kompiuterio >+Name[lv]=AvÄrt attÄlinÄtÄs darbirsmas savienojumu uz Å¡o datoru >+Name[ml]=വിദàµà´° പണിയിà´à´¤àµà´¤à´¿à´¨àµ ഠയനàµà´¤àµà´°à´µàµà´®à´¾à´¯àµà´³àµà´³ ബനàµà´§à´ à´¤àµà´à´àµà´àµà´ >+Name[nb]=à pne fjerntilkobling til skrivebord til denne maskinen >+Name[nds]=Schriefdisch-Feernverbinnen na dissen Reekner opmaken >+Name[ne]=यॠमà¥à¤¶à¤¿à¤¨à¤®à¤¾ à¤à¤¾à¤¢à¤¾à¤à¥ डà¥à¤¸à¥à¤à¤à¤ª à¤à¤¡à¤¾à¤¨ à¤à¥à¤²à¥à¤¨à¥à¤¹à¥à¤¸à¥ >+Name[nl]=Externe bureaubladverbinding met deze computer openen >+Name[nn]=Opna samband til skrivebordet over nettverket til denne maskina >+Name[pa]=à¨à¨¸ ਮਸ਼à©à¨¨ ਨਾਲ ਰਿਮà©à¨ ਡà©à¨¸à¨à¨à¨¾à¨ª à¨à©à¨¨à©à¨à¨¸à¨¼à¨¨ à¨à©à¨²à©à¨¹à© >+Name[pl]=Otwórz zdalne poÅÄ czenie z pulpitem na tej maszynie >+Name[pt]=Abrir uma Ligação Remota ao Ecrã deste Computador >+Name[pt_BR]=Abrir conexões remotas para essa máquina >+Name[ro]=DeschideÈi conexiune de birou distant spre aceastÄ maÈinÄ >+Name[ru]=ÐÑкÑÑÑÑ Ñоединение Remote Desktop Ñ ÑÑой маÑиной >+Name[si]=මà·à¶¸ යනà·à¶à·âරය à·à¶³à·à· දà·à¶»à·à·à¶® à·à·à¶©à¶à¶½ à·à¶¶à¶³à¶à·à· à·à·à·à·à¶ à¶à¶»à¶±à·à¶± >+Name[sk]=OtvoriÅ¥ vzdialené pripojenie pracovnej plochy k tomuto poÄÃtaÄu >+Name[sl]=Odpri povezavo z oddaljenim namizjem na tem raÄunalniku >+Name[sr]=ÐÑвоÑиÑе ÑдаÑÐµÐ½Ñ Ð²ÐµÐ·Ñ Ð¿Ð¾Ð²ÑÑи ка Ð¾Ð²Ð¾Ñ Ð¼Ð°Ñини >+Name[sr@ijekavian]=ÐÑвоÑиÑе ÑдаÑÐµÐ½Ñ Ð²ÐµÐ·Ñ Ð¿Ð¾Ð²ÑÑи ка Ð¾Ð²Ð¾Ñ Ð¼Ð°Ñини >+Name[sr@ijekavianlatin]=Otvorite udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[sr@latin]=Otvorite udaljenu vezu povrÅ¡i ka ovoj maÅ¡ini >+Name[sv]=Ãppna fjärrskrivbordsanslutning till den här datorn >+Name[th]=à¹à¸à¸´à¸à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸·à¹à¸à¸à¸µà¹à¸à¸³à¸à¸²à¸à¸à¸²à¸à¹à¸à¸¥à¸¡à¸²à¸¢à¸±à¸à¹à¸à¸£à¸·à¹à¸à¸à¸à¸µà¹ >+Name[tr]=Bu Makineye Uzak Masaüstü BaÄlantısı Aç >+Name[uk]=ÐÑдкÑиÑи з'ÑÐ´Ð½Ð°Ð½Ð½Ñ Ð· вÑÐ´Ð´Ð°Ð»ÐµÐ½Ð¾Ñ ÑÑÑлÑниÑÐµÑ Ð´Ð¾ ÑÑого комп'ÑÑеÑа >+Name[vi]=Má» kết ná»i mà n hình ná»n từ xa Äến máy nà y >+Name[x-test]=xxOpen Remote Desktop Connection to This Machinexx >+Name[zh_CN]=æå¼å°æ¤è®¡ç®æºçè¿ç¨æ¡é¢è¿æ¥ >+Name[zh_HK]=éæ¾é 端æ¡é¢é£ç·å°éé»è ¦ >+Name[zh_TW]=卿¤ä¸»æ©ä¸éåé 端æ¡é¢ >+Exec=krdc %u >+Icon=krdc >diff -urN kdenetwork-4.9.1.org/krdc.org/remotedesktopsmodel.cpp kdenetwork-4.9.1/krdc.org/remotedesktopsmodel.cpp >--- kdenetwork-4.9.1.org/krdc.org/remotedesktopsmodel.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/remotedesktopsmodel.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,303 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2009 Tony Murray <murraytony@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 "remotedesktopsmodel.h" >+#include "bookmarkmanager.h" >+ >+#include <KStandardDirs> >+#include <KDebug> >+#include <KLocale> >+ >+RemoteDesktopsModel::RemoteDesktopsModel(QObject *parent) >+ : QAbstractTableModel(parent) >+{ >+ const QString file = KStandardDirs::locateLocal("data", "krdc/bookmarks.xml"); >+ m_manager = KBookmarkManager::managerForFile(file, "krdc"); >+ m_manager->setUpdate(true); >+ connect(m_manager, SIGNAL(changed(QString,QString)), SLOT(bookmarksChanged())); >+ buildModelFromBookmarkGroup(m_manager->root()); >+ >+#ifdef BUILD_ZEROCONF >+ // Add RDP and NX if they start announcing via Zeroconf: >+ m_protocols["_rfb._tcp"] = "vnc"; >+ >+ zeroconfBrowser = new DNSSD::ServiceBrowser("_rfb._tcp", true); >+ connect(zeroconfBrowser, SIGNAL(finished()), this, SLOT(servicesChanged())); >+ zeroconfBrowser->startBrowse(); >+ kDebug(5010) << "Browsing for zeroconf hosts."; >+#endif >+} >+ >+RemoteDesktopsModel::~RemoteDesktopsModel() >+{ >+} >+ >+int RemoteDesktopsModel::columnCount(const QModelIndex &) const >+{ >+ return 6; // same as count of RemoteDesktopsModel::DisplayItems enum >+} >+ >+int RemoteDesktopsModel::rowCount(const QModelIndex &) const >+{ >+ return remoteDesktops.size(); >+} >+ >+Qt::ItemFlags RemoteDesktopsModel::flags(const QModelIndex &index) const >+{ >+ if (!index.isValid()) >+ return 0; >+ if (index.column() == RemoteDesktopsModel::Favorite) { >+ return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable; >+ } >+ return Qt::ItemIsEnabled; >+} >+ >+bool RemoteDesktopsModel::setData(const QModelIndex &index, const QVariant &value, int role) >+{ >+ if (index.isValid() && role == Qt::CheckStateRole && index.column() == RemoteDesktopsModel::Favorite) { >+ bool checked = (Qt::CheckState)value.toUInt() == Qt::Checked; >+ remoteDesktops[index.row()].favorite = checked; >+ >+ RemoteDesktop rd = remoteDesktops.at(index.row()); >+ if (checked) { >+ KBookmarkGroup root = m_manager->root(); >+ root.addBookmark(rd.title, rd.url); >+ m_manager->emitChanged(root); >+ } else { >+ BookmarkManager::removeByUrl(m_manager, rd.url, true, rd.title); >+ } >+ return true; >+ } >+ return false; >+} >+ >+QVariant RemoteDesktopsModel::data(const QModelIndex &index, int role) const >+{ >+ if (!index.isValid()) >+ return QVariant(); >+ >+ RemoteDesktop item = remoteDesktops.at(index.row()); >+ >+ switch (role) { >+ case Qt::DisplayRole: >+ switch (index.column()) { >+ case RemoteDesktopsModel::Favorite: >+ return item.favorite; >+ case RemoteDesktopsModel::Title: >+ return item.title; >+ case RemoteDesktopsModel::LastConnected: >+ return QVariant(item.lastConnected.dateTime()); >+ case RemoteDesktopsModel::VisitCount: >+ return item.visits; >+ case RemoteDesktopsModel::Created: >+ if (item.created.isNull()) return QVariant(); >+ return KGlobal::locale()->formatDateTime(item.created.toLocalZone(), KLocale::ShortDate); >+ case RemoteDesktopsModel::Source: >+ switch (item.source) { >+ case RemoteDesktop::Bookmarks: >+ return i18nc("Where each displayed link comes from", "Bookmarks"); >+ case RemoteDesktop::History: >+ return i18nc("Where each displayed link comes from", "History"); >+ case RemoteDesktop::Zeroconf: >+ return i18nc("Where each displayed link comes from", "Zeroconf"); >+ case RemoteDesktop::None: >+ return i18nc("Where each displayed link comes from", "None"); >+ } >+ default: >+ return QVariant(); >+ } >+ >+ case Qt::CheckStateRole: >+ if (index.column() == RemoteDesktopsModel::Favorite) >+ return item.favorite ? Qt::Checked : Qt::Unchecked; >+ return QVariant(); >+ >+ case Qt::ToolTipRole: >+ switch(index.column()) { >+ case RemoteDesktopsModel::Favorite: >+ if (item.favorite) { >+ return i18nc("Remove the selected url from the bookarks menu", "Remove the bookmark for %1.", item.title); >+ } else { >+ return i18nc("Add the selected url to the bookmarks menu", "Bookmark %1.", item.title); >+ } >+ case RemoteDesktopsModel::LastConnected: >+ if (!item.lastConnected.isNull()) { >+ return KGlobal::locale()->formatDateTime(item.lastConnected.toLocalZone(), KLocale::FancyLongDate); >+ } >+ break; // else show default tooltip >+ case RemoteDesktopsModel::Created: >+ if (!item.created.isNull()) { >+ return KGlobal::locale()->formatDateTime(item.created.toLocalZone(), KLocale::FancyLongDate); >+ } >+ break; // else show default tooltip >+ default: >+ break; >+ } >+ return item.url; //use the url for the tooltip >+ >+ case 10001: //url for dockwidget >+ return item.url; >+ >+ case 10002: //filter >+ return QUrl::fromPercentEncoding(QString(item.url + item.title).toUtf8()); // return both user visible title and url data, percent encoded >+ >+ case 10003: //title for dockwidget >+ return item.title; >+ >+ default: >+ return QVariant(); >+ } >+} >+ >+QVariant RemoteDesktopsModel::headerData(int section, Qt::Orientation orientation, >+ int role) const >+{ >+ if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { >+ switch (section) { >+ case RemoteDesktopsModel::Favorite: >+ return QVariant(); // the favorite column is to small for a header >+ case RemoteDesktopsModel::Title: >+ return i18nc("Header of the connections list, title/url for remote connection", "Remote Desktop"); >+ case RemoteDesktopsModel::LastConnected: >+ return i18nc("Header of the connections list, the last time this connection was initiated", "Last Connected"); >+ case RemoteDesktopsModel::VisitCount: >+ return i18nc("Header of the connections list, the number of times this connection has been visited", "Visits"); >+ case RemoteDesktopsModel::Created: >+ return i18nc("Header of the connections list, the time when this entry was created", "Created"); >+ case RemoteDesktopsModel::Source: >+ return i18nc("Header of the connections list, where this entry comes from", "Source"); >+ } >+ } >+ return QVariant(); >+} >+ >+// does not trigger view update, you must do this by hand after using this function >+void RemoteDesktopsModel::removeAllItemsFromSources(RemoteDesktop::Sources sources) >+{ >+ QMutableListIterator<RemoteDesktop> iter(remoteDesktops); >+ while (iter.hasNext()) { >+ iter.next(); >+ // if it matches any of the specified sources, remove it >+ if ((iter.value().source & sources) > 0) >+ iter.remove(); >+ } >+} >+ >+void RemoteDesktopsModel::bookmarksChanged() >+{ >+ kDebug(5010); >+ removeAllItemsFromSources(RemoteDesktop::Bookmarks | RemoteDesktop::History); >+ buildModelFromBookmarkGroup(m_manager->root()); >+ reset(); >+} >+ >+// Danger Will Roobinson, confusing code ahead! >+void RemoteDesktopsModel::buildModelFromBookmarkGroup(const KBookmarkGroup &group) >+{ >+ KBookmark bm = group.first(); >+ while (!bm.isNull()) { >+ if (bm.isGroup()) { >+ // recurse subfolders and treat it special if it is the history folder >+ buildModelFromBookmarkGroup(bm.toGroup()); >+ } else { // not a group >+ >+ RemoteDesktop item; >+ item.title = bm.fullText(); >+ item.url = bm.url().url(); >+ int index = remoteDesktops.indexOf(item); //search for this url to see if we need to update it >+ bool newItem = index < 0; // do we need to create a new item? >+ >+ // we want to merge all copies of a url into one link, so if the item exists, update it >+ if (group.metaDataItem("krdc-history") == "historyfolder") { >+ // set source and favorite (will override later if needed) >+ item.source = RemoteDesktop::History; >+ item.favorite = false; >+ >+ // since we are in the history folder collect statitics and add them >+ KDateTime connected = KDateTime(); >+ KDateTime created = KDateTime(); >+ bool ok = false; >+ // first the created datetime >+ created.setTime_t(bm.metaDataItem("time_added").toLongLong(&ok)); >+ if (ok) (newItem ? item : remoteDesktops[index]).created = created; >+ // then the last visited datetime >+ ok = false; >+ connected.setTime_t(bm.metaDataItem("time_visited").toLongLong(&ok)); >+ if (ok) (newItem ? item : remoteDesktops[index]).lastConnected = connected; >+ // finally the visited count >+ ok = false; >+ int visits = bm.metaDataItem("visit_count").toInt(&ok); >+ if (ok) (newItem ? item : remoteDesktops[index]).visits = visits; >+ } else { >+ if (newItem) { >+ // if this is a new item, just add the rest of the required data >+ item.lastConnected = KDateTime(); >+ item.created = KDateTime(); >+ item.visits = 0; >+ item.favorite = true; >+ item.source = RemoteDesktop::Bookmarks; >+ } else { >+ // otherwise override these fields with the info from the bookmark >+ remoteDesktops[index].title = bm.fullText(); >+ remoteDesktops[index].favorite = true; >+ remoteDesktops[index].source = RemoteDesktop::Bookmarks; >+ } >+ } >+ // if we have a new item, add it >+ if (newItem) >+ remoteDesktops.append(item); >+ } >+ bm = group.next(bm); // next item in the group >+ } >+} >+ >+#ifdef BUILD_ZEROCONF >+void RemoteDesktopsModel::servicesChanged() >+{ >+ //redo list because it is easier than finding and removing one that disappeared >+ QList<DNSSD::RemoteService::Ptr> services = zeroconfBrowser->services(); >+ KUrl url; >+ removeAllItemsFromSources(RemoteDesktop::Zeroconf); >+ foreach(DNSSD::RemoteService::Ptr service, services) { >+ url.setProtocol(m_protocols[service->type()].toLower()); >+ url.setHost(service->hostName()); >+ url.setPort(service->port()); >+ >+ RemoteDesktop item; >+ item.url = url.url(); >+ >+ if (!remoteDesktops.contains(item)) { >+ item.title = service->serviceName(); >+ item.source = RemoteDesktop::Zeroconf; >+ item.created = KDateTime::currentLocalDateTime(); >+ item.favorite = false; >+ item.visits = 0; >+ remoteDesktops.append(item); >+ } >+ } >+ reset(); >+} >+#endif >+ >+#include "remotedesktopsmodel.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/remotedesktopsmodel.h kdenetwork-4.9.1/krdc.org/remotedesktopsmodel.h >--- kdenetwork-4.9.1.org/krdc.org/remotedesktopsmodel.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/remotedesktopsmodel.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,97 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** Copyright (C) 2009 Tony Murray <murraytony@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 REMOTEDESKTOPSMODEL_H >+#define REMOTEDESKTOPSMODEL_H >+ >+#include <QAbstractTableModel> >+#include <KDateTime> >+ >+#ifdef BUILD_ZEROCONF >+#include <dnssd/servicebrowser.h> >+#endif >+ >+class KBookmarkGroup; >+class KBookmarkManager; >+ >+struct RemoteDesktop { >+public: >+ enum Source { None = 0x0, Bookmarks = 0x1, History = 0x2, Zeroconf = 0x4 }; >+ Q_DECLARE_FLAGS(Sources, Source) >+ QString title; >+ QString url; >+ KDateTime lastConnected; >+ KDateTime created; >+ int visits; >+ RemoteDesktop::Source source; >+ bool favorite; >+ bool operator<(const RemoteDesktop &rd) const { >+ if (lastConnected == rd.lastConnected) >+ return url < rd.url; >+ return rd.lastConnected < lastConnected; // seems backward but gets the desired result >+ } >+ bool operator==(const RemoteDesktop &rd) const { >+ return url == rd.url; >+ } >+}; >+ >+class RemoteDesktopsModel : public QAbstractTableModel >+{ >+ Q_OBJECT >+ >+public: >+ RemoteDesktopsModel(QObject *parent); >+ ~RemoteDesktopsModel(); >+ >+ enum DisplayItems { Favorite, Title, LastConnected, VisitCount, Created, Source }; >+ int rowCount(const QModelIndex &parent = QModelIndex()) const; >+ int columnCount(const QModelIndex &parent = QModelIndex()) const; >+ Qt::ItemFlags flags(const QModelIndex &index) const; >+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); >+ QVariant data(const QModelIndex &index, int role) const; >+ QVariant headerData(int section, Qt::Orientation orientation, >+ int role = Qt::DisplayRole) const; >+ >+private: >+ QList<RemoteDesktop> remoteDesktops; >+ QString getLastConnectedString(KDateTime lastConnected, bool fuzzy = false) const; >+ void removeAllItemsFromSources(RemoteDesktop::Sources sources); >+ void buildModelFromBookmarkGroup(const KBookmarkGroup &group); >+ KBookmarkManager *m_manager; >+ >+#ifdef BUILD_ZEROCONF >+ DNSSD::ServiceBrowser *zeroconfBrowser; >+ QHash<QString, QString> m_protocols; >+#endif >+ >+private slots: >+ void bookmarksChanged(); >+#ifdef BUILD_ZEROCONF >+ void servicesChanged(); >+#endif >+}; >+ >+Q_DECLARE_OPERATORS_FOR_FLAGS(RemoteDesktop::Sources) >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/systemtrayicon.cpp kdenetwork-4.9.1/krdc.org/systemtrayicon.cpp >--- kdenetwork-4.9.1.org/krdc.org/systemtrayicon.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/systemtrayicon.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,62 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "systemtrayicon.h" >+ >+#include "mainwindow.h" >+ >+#include <KActionCollection> >+#include <KLocale> >+#include <KMenu> >+ >+SystemTrayIcon::SystemTrayIcon(MainWindow *parent) >+ : KStatusNotifierItem(parent), >+ m_mainWindow(parent) >+{ >+ setIconByName("krdc"); >+ setStatus(KStatusNotifierItem::Active); >+ setCategory(KStatusNotifierItem::ApplicationStatus); >+ >+ setToolTipIconByName("krdc"); >+ setToolTipTitle(i18n("KDE Remote Desktop Client")); >+ >+ contextMenu()->addSeparator(); >+ contextMenu()->addAction(parent->actionCollection()->action("bookmark")); >+ contextMenu()->addSeparator(); >+ >+ connect(this, SIGNAL(activateRequested(bool,QPoint)), this, SLOT(checkActivatedWindow(bool))); >+} >+ >+void SystemTrayIcon::checkActivatedWindow(bool active) >+{ >+ // make sure the fullscreen window stays fullscreen by restoring the FullScreen state upon restore. >+ if(active && associatedWidget() != m_mainWindow) { >+ associatedWidget()->setWindowState(Qt::WindowFullScreen); >+ } >+} >+ >+SystemTrayIcon::~SystemTrayIcon() >+{ >+} >+ >+#include "systemtrayicon.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/systemtrayicon.h kdenetwork-4.9.1/krdc.org/systemtrayicon.h >--- kdenetwork-4.9.1.org/krdc.org/systemtrayicon.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/systemtrayicon.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,46 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 SYSTEMTRAYICON_H >+#define SYSTEMTRAYICON_H >+ >+#include <kstatusnotifieritem.h> >+ >+class MainWindow; >+ >+class SystemTrayIcon : public KStatusNotifierItem >+{ >+ Q_OBJECT >+ >+public: >+ SystemTrayIcon(MainWindow *parent); >+ ~SystemTrayIcon(); >+ >+public slots: >+ void checkActivatedWindow(bool active); >+ >+private: >+ MainWindow *m_mainWindow; >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/tabbedviewwidget.cpp kdenetwork-4.9.1/krdc.org/tabbedviewwidget.cpp >--- kdenetwork-4.9.1.org/krdc.org/tabbedviewwidget.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/tabbedviewwidget.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,184 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Tony Murray <murraytony @ 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 "tabbedviewwidget.h" >+ >+TabbedViewWidgetModel::TabbedViewWidgetModel(KTabWidget *modelTarget) >+ : QAbstractItemModel(modelTarget), m_tabWidget(modelTarget) >+{ >+} >+ >+QModelIndex TabbedViewWidgetModel::index(int row, int column, const QModelIndex &parent) const >+{ >+ if (!hasIndex(row, column, parent)) { >+ return QModelIndex(); >+ } >+ return createIndex(row, column, m_tabWidget->widget(row)); >+} >+ >+QModelIndex TabbedViewWidgetModel::parent(const QModelIndex &) const >+{ >+ return QModelIndex(); >+} >+ >+int TabbedViewWidgetModel::columnCount(const QModelIndex &) const >+{ >+ return 1; >+} >+ >+ >+int TabbedViewWidgetModel::rowCount(const QModelIndex &) const >+{ >+ return m_tabWidget->count(); >+} >+ >+Qt::ItemFlags TabbedViewWidgetModel::flags(const QModelIndex &index) const >+{ >+ if (!index.isValid()) { >+ return Qt::ItemIsEnabled; >+ } >+ return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; >+} >+ >+bool TabbedViewWidgetModel::setData(const QModelIndex &index, const QVariant &value, int role) >+{ >+ if (index.isValid() && role == Qt::EditRole) { >+ m_tabWidget->setTabText(index.row(), value.toString()); >+ emit dataChanged(index, index); >+ return true; >+ } >+ return false; >+} >+ >+QVariant TabbedViewWidgetModel::data(const QModelIndex &index, int role) const >+{ >+ if (!index.isValid()) { >+ return QVariant(); >+ } >+ >+ switch (role) { >+ case Qt::EditRole: >+ case Qt::DisplayRole: >+ return m_tabWidget->tabText(index.row()).remove(QRegExp("&(?!&)")); //remove accelerator string >+ case Qt::ToolTipRole: >+ return m_tabWidget->tabToolTip(index.row()); >+ case Qt::DecorationRole: >+ return m_tabWidget->tabIcon(index.row()); >+ default: >+ return QVariant(); >+ } >+} >+ >+void TabbedViewWidgetModel::emitLayoutAboutToBeChanged() >+{ >+ emit layoutAboutToBeChanged(); >+} >+ >+void TabbedViewWidgetModel::emitLayoutChanged() >+{ >+ emit layoutChanged(); >+} >+ >+void TabbedViewWidgetModel::emitDataChanged(int index) >+{ >+ QModelIndex modelIndex = createIndex(index, 1); >+ emit dataChanged(modelIndex, modelIndex); >+} >+ >+TabbedViewWidget::TabbedViewWidget(QWidget *parent, Qt::WFlags flags) >+ : KTabWidget(parent, flags), m_model(new TabbedViewWidgetModel(this)) >+{ >+} >+ >+TabbedViewWidget::~TabbedViewWidget() >+{ >+} >+ >+TabbedViewWidgetModel* TabbedViewWidget::getModel() >+{ >+ return m_model; >+} >+ >+int TabbedViewWidget::addTab(QWidget *page, const QString &label) >+{ >+ int count = KTabWidget::count(); >+ m_model->beginInsertRows(QModelIndex(), count, count); >+ int ret = KTabWidget::addTab(page, label); >+ m_model->endInsertRows(); >+ return ret; >+} >+ >+int TabbedViewWidget::addTab(QWidget *page, const QIcon &icon, const QString &label) >+{ >+ int count = KTabWidget::count(); >+ m_model->beginInsertRows(QModelIndex(), count, count); >+ int ret = KTabWidget::addTab(page, icon, label); >+ m_model->endInsertRows(); >+ return ret; >+} >+ >+int TabbedViewWidget::insertTab(int index, QWidget *page, const QString &label) >+{ >+ m_model->beginInsertRows(QModelIndex(), index, index); >+ int ret = KTabWidget::insertTab(index, page, label); >+ m_model->endInsertRows(); >+ return ret; >+} >+ >+int TabbedViewWidget::insertTab(int index, QWidget *page, const QIcon &icon, const QString &label) >+{ >+ m_model->beginInsertRows(QModelIndex(), index, index); >+ int ret = KTabWidget::insertTab(index, page, icon, label); >+ m_model->endInsertRows(); >+ return ret; >+} >+ >+void TabbedViewWidget::removePage(QWidget *page) >+{ >+ int index = KTabWidget::indexOf(page); >+ m_model->beginRemoveRows(QModelIndex(), index, index); >+ KTabWidget::removePage(page); >+ m_model->endRemoveRows(); >+} >+ >+void TabbedViewWidget::removeTab(int index) >+{ >+ m_model->beginRemoveRows(QModelIndex(), index, index); >+ KTabWidget::removeTab(index); >+ m_model->endRemoveRows(); >+} >+ >+void TabbedViewWidget::moveTab(int from, int to) >+{ >+ m_model->emitLayoutAboutToBeChanged(); >+ KTabWidget::moveTab(from, to); >+ m_model->emitLayoutChanged(); >+} >+ >+void TabbedViewWidget::setTabText(int index, const QString &label) >+{ >+ KTabWidget::setTabText(index, label); >+ m_model->emitDataChanged(index); >+} >+ >+#include "tabbedviewwidget.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/tabbedviewwidget.h kdenetwork-4.9.1/krdc.org/tabbedviewwidget.h >--- kdenetwork-4.9.1.org/krdc.org/tabbedviewwidget.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/tabbedviewwidget.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,71 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009 Tony Murray <murraytony @ 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 TABBEDVIEWWIDGET_H >+#define TABBEDVIEWWIDGET_H >+ >+#include <QAbstractItemModel> >+#include <KTabWidget> >+ >+class TabbedViewWidgetModel : public QAbstractItemModel >+{ >+ friend class TabbedViewWidget; >+ Q_OBJECT >+public: >+ TabbedViewWidgetModel(KTabWidget *modelTarget); >+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; >+ QModelIndex parent(const QModelIndex &index) const; >+ int rowCount(const QModelIndex &parent = QModelIndex()) const; >+ int columnCount(const QModelIndex &parent = QModelIndex()) const; >+ Qt::ItemFlags flags(const QModelIndex &index) const; >+ bool setData(const QModelIndex &index, const QVariant &value, int role); >+ QVariant data(const QModelIndex &index, int role) const; >+protected: >+ void emitLayoutAboutToBeChanged(); >+ void emitLayoutChanged(); >+ void emitDataChanged(int index); >+private: >+ KTabWidget *m_tabWidget; >+}; >+ >+class TabbedViewWidget : public KTabWidget >+{ >+ Q_OBJECT >+public: >+ explicit TabbedViewWidget(QWidget *parent = 0, Qt::WFlags flags = 0); >+ virtual ~TabbedViewWidget(); >+ TabbedViewWidgetModel* getModel(); >+ int addTab(QWidget *page, const QString &label); >+ int addTab(QWidget *page, const QIcon &icon, const QString &label); >+ int insertTab(int index, QWidget *page, const QString &label); >+ int insertTab(int index, QWidget *page, const QIcon &icon, const QString &label); >+ void removeTab(int index); >+ void removePage(QWidget *page); >+ void moveTab(int from, int to); >+ void setTabText(int index, const QString &label); >+private: >+ TabbedViewWidgetModel *m_model; >+}; >+ >+#endif // FULLSCREENWINDOW_H >+ >diff -urN kdenetwork-4.9.1.org/krdc.org/test/CMakeLists.txt kdenetwork-4.9.1/krdc.org/test/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/test/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/test/CMakeLists.txt 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,26 @@ >+ >+if(NOT NDEBUG) >+ set(BUILD_TEST true) >+endif(NOT NDEBUG) >+if(BUILD_TEST) >+ >+ include_directories( >+ ${CMAKE_CURRENT_BINARY_DIR} >+ ) >+ >+ set(testplugin_SRCS >+ testviewfactory.cpp >+ testview.cpp >+ ) >+ >+ kde4_add_plugin(krdc_testplugin ${testplugin_SRCS}) >+ >+ target_link_libraries(krdc_testplugin >+ ${KDE4_KDECORE_LIBS} >+ ${KDE4_KDEUI_LIBS} >+ krdccore >+ ) >+ install(TARGETS krdc_testplugin DESTINATION ${PLUGIN_INSTALL_DIR}) >+ >+ install(FILES krdc_test.desktop DESTINATION ${SERVICES_INSTALL_DIR}) >+endif(BUILD_TEST) >diff -urN kdenetwork-4.9.1.org/krdc.org/test/krdc_test.desktop kdenetwork-4.9.1/krdc.org/test/krdc_test.desktop >--- kdenetwork-4.9.1.org/krdc.org/test/krdc_test.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/test/krdc_test.desktop 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,121 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KRDC/Plugin >+Icon=krdc >+Name=Test >+Name[ast]=Preba >+Name[bg]=ÐÑоба >+Name[bs]=Test >+Name[ca]=Prova >+Name[ca@valencia]=Prova >+Name[cs]=Test >+Name[da]=Test >+Name[de]=Test >+Name[el]=Îοκιμή >+Name[en_GB]=Test >+Name[es]=Prueba >+Name[et]=Test >+Name[eu]=Proba >+Name[fi]=Testi >+Name[fr]=Test >+Name[ga]=Tástáil >+Name[gl]=Proba >+Name[hr]=Test >+Name[hsb]=Test >+Name[hu]=Teszt >+Name[ia]=Essaya >+Name[it]=Prova >+Name[ja]=ãã¹ã >+Name[kk]=ТеÑÑ >+Name[km]=áá¶ááááá >+Name[ko]=í ì¤í¸ >+Name[lt]=Testavimas >+Name[lv]=Tests >+Name[mai]=à¤à¤¾à¤à¤ >+Name[nb]=Test >+Name[nds]=Test >+Name[nl]=Test >+Name[nn]=Test >+Name[pa]=à¨à©à¨¸à¨ >+Name[pl]=Test >+Name[pt]=Teste >+Name[pt_BR]=Testar >+Name[ro]=Test >+Name[ru]=ÐÑовеÑка >+Name[si]=à¶´à·à¶»à·à¶à·à·à·à¶¸ >+Name[sk]=Test >+Name[sl]=Poskus >+Name[sr]=ÐÑоба >+Name[sr@ijekavian]=ÐÑоба >+Name[sr@ijekavianlatin]=Proba >+Name[sr@latin]=Proba >+Name[sv]=Test >+Name[th]=à¸à¸à¸ªà¸à¸ >+Name[tr]=Test >+Name[ug]=سÙÙØ§ >+Name[uk]=ТеÑÑ >+Name[wa]=Asprouvaedje >+Name[x-test]=xxTestxx >+Name[zh_CN]=æµè¯ >+Name[zh_TW]=測試 >+Comment=Testplugin for KRDC development >+Comment[ast]=Complementu de preba pal desendolcu de KRDC >+Comment[bg]=ÐÑобна пÑиÑÑавка за KRDC >+Comment[bs]=Probni prikljuÄak za razvoj KRDC >+Comment[ca]=Connector de prova del desenvolupament del KRDC >+Comment[ca@valencia]=Connector de prova del desenvolupament del KRDC >+Comment[cs]=DemonstraÄnà modul pro vývoj KRDC >+Comment[da]=Test-plugin til KRDC-udvikling >+Comment[de]=Testmodul für die KRDC-Entwicklung >+Comment[el]=Î ÏÏÏθεÏο Î´Î¿ÎºÎ¹Î¼Î®Ï Î³Î¹Î± Ïην ανάÏÏÏ Î¾Î· ÏÎ¿Ï KRDC >+Comment[en_GB]=Testplugin for KRDC development >+Comment[es]=Complemento de prueba para el desarrollo de KRDC >+Comment[et]=Plugin KRDC arendustegevuse testimiseks >+Comment[eu]=Probako plugina KRDC garatzeko >+Comment[fi]=KRDC-kehityksen testiliitännäinen >+Comment[fr]=Module de test pour le développement de KRDC >+Comment[ga]=Breiseán tástála le haghaidh fhorbairt KRDC >+Comment[gl]=Engadido de proba para o desenvolvemento de KRDC >+Comment[hr]=Testni prikljuÄak za razvoj KRDC-a >+Comment[hu]=Tesztmodul KRDC-fejlesztÅknek >+Comment[ia]=Plug-in de essayo pro developpamento de KRDC >+Comment[it]=Estensione di prova per lo sviluppo di KRDC >+Comment[ja]=KRDC éçºã®ããã®ãã¹ãç¨ãã©ã°ã¤ã³ >+Comment[kk]=KRDC-ÒÒ±ÑаÑÑÑÑÑÑн үйÑеÑÑ Ò¯ÑÑн ÑÑÐ½Ð°Ò Ð¿Ð»Ð°Ð³Ð¸Ð½Ñ >+Comment[km]=áá¶áâá¢áá·áááááá Testplugin ááááá¶áá KRDC >+Comment[ko]=KRDC ê°ë°ì ìí í ì¤í¸ íë¬ê·¸ì¸ >+Comment[lt]=Ä®skiepis, skirtas KRDC programavimui >+Comment[lv]=DemonstrÄcijas spraudnis KRDC izstrÄdei >+Comment[nb]=Test-programtillegg for KRDC-utvikling >+Comment[nds]=Testmoduul för't Utwickeln vun KRDC >+Comment[nl]=Testplugin voor KRDC-ontwikkeling >+Comment[nn]=Programtillegg for demonstrasjon og opplæring i KRDC-utvikling >+Comment[pl]=Wtyczka demonstracyjna do nauki programowania KRDC >+Comment[pt]='Plugin' de demonstração para o desenvolvimento com o KRDC >+Comment[pt_BR]=Plugin de teste para o desenvolvimento no KRDC >+Comment[ro]=Modul de testare pentru dezvoltarea KRDC >+Comment[ru]=ÐемонÑÑÑаÑионнÑй модÑÐ»Ñ Ð´Ð»Ñ Ð¸Ð·ÑÑÐµÐ½Ð¸Ñ Ð¿ÑогÑаммиÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¼Ð¾Ð´Ñлей KRDC >+Comment[si]=KRDC à·à¶à·à¶»à·à¶°à¶±à¶ºà¶à· à·à¶³à·à· à¶´à·à¶»à·à¶à·à·à·à¶¸à· à¶´à·à¶½à¶à·à¶±à¶º >+Comment[sk]=Testovacà modul pre vývoj KRDC >+Comment[sl]=Poskusni vstavek za razvoj KRDC >+Comment[sr]=ÐÑобни пÑикÑÑÑак за ÑÐ°Ð·Ð²Ð¾Ñ ÐÐ ÐЦâа >+Comment[sr@ijekavian]=ÐÑобни пÑикÑÑÑак за ÑÐ°Ð·Ð²Ð¾Ñ ÐÐ ÐЦâа >+Comment[sr@ijekavianlatin]=Probni prikljuÄak za razvoj KRDCâa >+Comment[sr@latin]=Probni prikljuÄak za razvoj KRDCâa >+Comment[sv]=Testinsticksprogram för utveckling av KRDC >+Comment[tr]=KRDC geliÅtirmesi için örnek eklenti >+Comment[uk]=ТеÑÑовий додаÑок Ð´Ð»Ñ ÑозÑобки KRDC >+Comment[x-test]=xxTestplugin for KRDC developmentxx >+Comment[zh_CN]=KRDC å¼åç¨çæµè¯æä»¶ >+Comment[zh_TW]=KRDC éç¼çæ¸¬è©¦å¤æç¨å¼ >+ >+X-KDE-PluginInfo-Author=Urs Wolfer >+X-KDE-PluginInfo-Email=uwolfer@kde.org >+X-KDE-PluginInfo-Version=1.0 >+X-KDE-PluginInfo-Category=Service >+X-KDE-PluginInfo-License=GPL >+X-KDE-PluginInfo-EnabledByDefault=false >+X-KDE-Library=krdc_testplugin >+X-KDE-PluginInfo-Name=krdc_testplugin >+ >+X-KDE-KRDC-Sorting=80 >diff -urN kdenetwork-4.9.1.org/krdc.org/test/testview.cpp kdenetwork-4.9.1/krdc.org/test/testview.cpp >--- kdenetwork-4.9.1.org/krdc.org/test/testview.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/test/testview.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,99 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "testview.h" >+ >+#include <QEvent> >+ >+TestView::TestView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+ : RemoteView(parent) >+{ >+ m_hostPreferences = new TestHostPreferences(configGroup, this); >+ >+ Q_UNUSED(url); >+ >+ setAutoFillBackground(true); >+ >+ QPalette pal = palette(); >+ pal.setColor(QPalette::Dark, Qt::yellow); >+ setPalette(pal); >+ >+ const QSize size = QSize(640, 480); >+ setStatus(Connected); >+ setFixedSize(size); >+ setFixedSize(size); >+ emit framebufferSizeChanged(size.width(), size.height()); >+ emit connected(); >+} >+ >+TestView::~TestView() >+{ >+ emit disconnected(); >+ setStatus(Disconnected); >+} >+ >+bool TestView::eventFilter(QObject *obj, QEvent *event) >+{ >+ if (m_viewOnly) { >+ if (event->type() == QEvent::KeyPress || >+ event->type() == QEvent::KeyRelease || >+ event->type() == QEvent::MouseButtonDblClick || >+ event->type() == QEvent::MouseButtonPress || >+ event->type() == QEvent::MouseButtonRelease || >+ event->type() == QEvent::MouseMove) >+ return true; >+ } >+ return RemoteView::eventFilter(obj, event); >+} >+ >+QSize TestView::framebufferSize() >+{ >+ return minimumSizeHint(); >+} >+ >+QSize TestView::sizeHint() const >+{ >+ return maximumSize(); >+} >+ >+bool TestView::isQuitting() >+{ >+ return false; >+} >+ >+bool TestView::start() >+{ >+ return true; >+} >+ >+HostPreferences* TestView::hostPreferences() >+{ >+ return m_hostPreferences; >+} >+ >+void TestView::switchFullscreen(bool on) >+{ >+ Q_UNUSED(on); >+} >+ >+#include "testview.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/test/testviewfactory.cpp kdenetwork-4.9.1/krdc.org/test/testviewfactory.cpp >--- kdenetwork-4.9.1.org/krdc.org/test/testviewfactory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/test/testviewfactory.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,82 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "testviewfactory.h" >+ >+#include <KDebug> >+#include <KLocale> >+ >+KRDC_PLUGIN_EXPORT(TestViewFactory) >+ >+TestViewFactory::TestViewFactory(QObject *parent, const QVariantList &args) >+ : RemoteViewFactory(parent) >+{ >+ Q_UNUSED(args); >+ >+ KGlobal::locale()->insertCatalog("krdc"); >+} >+ >+TestViewFactory::~TestViewFactory() >+{ >+} >+ >+bool TestViewFactory::supportsUrl(const KUrl &url) const >+{ >+ return (url.scheme().compare("test", Qt::CaseInsensitive) == 0); >+} >+ >+RemoteView *TestViewFactory::createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+{ >+ return new TestView(parent, url, configGroup); >+} >+ >+HostPreferences *TestViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) >+{ >+ Q_UNUSED(configGroup); >+ Q_UNUSED(parent); >+ >+ return 0; >+} >+ >+QString TestViewFactory::scheme() const >+{ >+ return "test"; >+} >+ >+QString TestViewFactory::connectActionText() const >+{ >+ return ("New Test Connection..."); // no i18n required, just internal test plugin! >+} >+ >+QString TestViewFactory::connectButtonText() const >+{ >+ return ("KRDC Test Connection"); // no i18n required, just internal test plugin! >+} >+ >+QString TestViewFactory::connectToolTipText() const >+{ >+ return ("<html>Enter the address here. Port is optional.<br />" >+ "<i>Example: testserver (host)</i></html>"); // no i18n required, just internal test plugin! >+} >+ >+#include "moc_testviewfactory.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/test/testviewfactory.h kdenetwork-4.9.1/krdc.org/test/testviewfactory.h >--- kdenetwork-4.9.1.org/krdc.org/test/testviewfactory.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/test/testviewfactory.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,55 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 TESTVIEWFACTORY_H >+#define TESTVIEWFACTORY_H >+ >+#include "remoteviewfactory.h" >+ >+#include "testview.h" >+ >+class TestViewFactory : public RemoteViewFactory >+{ >+ Q_OBJECT >+ >+public: >+ explicit TestViewFactory(QObject *parent, const QVariantList &args); >+ >+ virtual ~TestViewFactory(); >+ >+ virtual bool supportsUrl(const KUrl &url) const; >+ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup); >+ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent); >+ >+ virtual QString scheme() const; >+ >+ virtual QString connectActionText() const; >+ >+ virtual QString connectButtonText() const; >+ >+ virtual QString connectToolTipText() const; >+}; >+ >+#endif // TESTVIEWFACTORY_H >diff -urN kdenetwork-4.9.1.org/krdc.org/test/testview.h kdenetwork-4.9.1/krdc.org/test/testview.h >--- kdenetwork-4.9.1.org/krdc.org/test/testview.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/test/testview.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,74 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 TESTVIEW_H >+#define TESTVIEW_H >+ >+#include "testview.h" >+ >+#include "remoteview.h" >+#include "hostpreferences.h" >+ >+#include <KConfigGroup> >+ >+class TestHostPreferences; >+ >+class TestView : public RemoteView >+{ >+ Q_OBJECT >+ >+public: >+ explicit TestView(QWidget *parent = 0, const KUrl &url = KUrl(), KConfigGroup configGroup = KConfigGroup()); >+ >+ virtual ~TestView(); >+ >+ virtual QSize framebufferSize(); >+ QSize sizeHint() const; >+ >+ virtual bool isQuitting(); >+ virtual bool start(); >+ HostPreferences* hostPreferences(); >+ >+public slots: >+ virtual void switchFullscreen(bool on); >+ >+protected: >+ bool eventFilter(QObject *obj, QEvent *event); >+ >+private: >+ TestHostPreferences *m_hostPreferences; >+}; >+ >+ >+class TestHostPreferences : public HostPreferences >+{ >+ Q_OBJECT >+public: >+ explicit TestHostPreferences(KConfigGroup configGroup, QObject *parent = 0) >+ : HostPreferences(configGroup, parent) {} >+ >+protected: >+ virtual QWidget* createProtocolSpecificConfigPage() { return 0; }; >+}; >+ >+#endif // TESTVIEW_H >diff -urN kdenetwork-4.9.1.org/krdc.org/tubesmanager.cpp kdenetwork-4.9.1/krdc.org/tubesmanager.cpp >--- kdenetwork-4.9.1.org/krdc.org/tubesmanager.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/tubesmanager.cpp 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,88 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009-2011 Collabora Ltd <info@collabora.co.uk> >+** Copyright (C) 2009 Abner Silva <abner.silva@kdemail.net> >+** >+** 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 "tubesmanager.h" >+ >+#include <TelepathyQt/IncomingStreamTubeChannel> >+#include <TelepathyQt/Debug> >+ >+#include <KDebug> >+ >+ >+TubesManager::TubesManager(QObject *parent) >+ : QObject(parent) >+{ >+ kDebug() << "Initializing tubes manager"; >+ >+ Tp::enableDebug(true); >+ Tp::enableWarnings(true); >+ >+ /* Registering telepathy types */ >+ Tp::registerTypes(); >+ >+ m_stubeClient = Tp::StreamTubeClient::create( >+ QStringList() << QLatin1String("rfb"), >+ QStringList(), >+ QLatin1String("krdc_rfb_handler")); >+ >+ m_stubeClient->setToAcceptAsTcp(); >+ >+ connect(m_stubeClient.data(), >+ SIGNAL(tubeAcceptedAsTcp(QHostAddress,quint16,QHostAddress,quint16, >+ Tp::AccountPtr,Tp::IncomingStreamTubeChannelPtr)), >+ SLOT(onTubeAccepted(QHostAddress,quint16,QHostAddress,quint16, >+ Tp::AccountPtr,Tp::IncomingStreamTubeChannelPtr))); >+} >+ >+TubesManager::~TubesManager() >+{ >+ kDebug() << "Destroying tubes manager"; >+} >+ >+void TubesManager::closeTube(const KUrl& url) >+{ >+ if (m_tubes.contains(url)) { >+ m_tubes.take(url)->requestClose(); >+ } >+} >+ >+void TubesManager::onTubeAccepted( >+ const QHostAddress & listenAddress, quint16 listenPort, >+ const QHostAddress & sourceAddress, quint16 sourcePort, >+ const Tp::AccountPtr & account, >+ const Tp::IncomingStreamTubeChannelPtr & tube) >+{ >+ Q_UNUSED(sourceAddress); >+ Q_UNUSED(sourcePort); >+ Q_UNUSED(account); >+ >+ KUrl url; >+ url.setScheme("vnc"); >+ url.setHost(listenAddress.toString()); >+ url.setPort(listenPort); >+ >+ kDebug() << "newConnection:" << url; >+ m_tubes.insert(url, tube); >+ emit newConnection(url); >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/tubesmanager.h kdenetwork-4.9.1/krdc.org/tubesmanager.h >--- kdenetwork-4.9.1.org/krdc.org/tubesmanager.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/tubesmanager.h 2012-08-13 02:08:57.000000000 +0200 >@@ -0,0 +1,59 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2009-2011 Collabora Ltd <info@collabora.co.uk> >+** Copyright (C) 2009 Abner Silva <abner.silva@kdemail.net> >+** >+** 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 TUBESMANAGER_H >+#define TUBESMANAGER_H >+ >+#include <TelepathyQt/StreamTubeClient> >+#include <QtNetwork/QHostAddress> >+#include <KUrl> >+ >+class TubesManager : public QObject >+{ >+ Q_OBJECT >+ >+public: >+ TubesManager(QObject *parent); >+ virtual ~TubesManager(); >+ >+ void closeTube(const KUrl & url); >+ >+Q_SIGNALS: >+ void newConnection(KUrl); >+ >+private Q_SLOTS: >+ void onTubeAccepted( >+ const QHostAddress & listenAddress, >+ quint16 listenPort, >+ const QHostAddress & sourceAddress, >+ quint16 sourcePort, >+ const Tp::AccountPtr & account, >+ const Tp::IncomingStreamTubeChannelPtr & tube); >+ >+private: >+ Tp::StreamTubeClientPtr m_stubeClient; >+ QHash<KUrl, Tp::IncomingStreamTubeChannelPtr> m_tubes; >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/CMakeLists.txt kdenetwork-4.9.1/krdc.org/vnc/CMakeLists.txt >--- kdenetwork-4.9.1.org/krdc.org/vnc/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/CMakeLists.txt 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,54 @@ >+ >+if(LIBVNCSERVER_FOUND) >+ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5011) >+ >+ include_directories( >+ ${CMAKE_CURRENT_BINARY_DIR} >+ ${LIBVNCCLIENT_INCLUDE_DIR} >+ ) >+ >+ set(vncplugin_SRCS >+ vnchostpreferences.cpp >+ vncclientthread.cpp >+ vncviewfactory.cpp >+ vncview.cpp >+ ) >+ >+ kde4_add_ui_files(vncplugin_SRCS >+ vncpreferences.ui >+ ) >+ >+ kde4_add_plugin(krdc_vncplugin ${vncplugin_SRCS}) >+ >+ target_link_libraries(krdc_vncplugin >+ ${KDE4_KDECORE_LIBS} >+ ${KDE4_KDEUI_LIBS} >+ ${LIBVNCCLIENT_LIBRARIES} >+ krdccore >+ ) >+ >+ if(JPEG_FOUND) >+ target_link_libraries(krdc_vncplugin ${JPEG_LIBRARIES}) >+ endif(JPEG_FOUND) >+ >+ set(kcm_krdc_vncplugin_SRCS >+ vncpreferences.cpp >+ ) >+ >+ kde4_add_plugin(kcm_krdc_vncplugin ${kcm_krdc_vncplugin_SRCS}) >+ >+ target_link_libraries(kcm_krdc_vncplugin >+ ${KDE4_KDEUI_LIBS} >+ krdccore >+ ) >+ >+ add_dependencies(kcm_krdc_vncplugin krdc_vncplugin) >+ >+ install(TARGETS kcm_krdc_vncplugin DESTINATION ${PLUGIN_INSTALL_DIR}) >+ install(TARGETS krdc_vncplugin DESTINATION ${PLUGIN_INSTALL_DIR}) >+ >+ install(FILES krdc_vnc.desktop DESTINATION ${SERVICES_INSTALL_DIR}) >+ install(FILES krdc_vnc_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}) >+ >+ install(FILES vnc.protocol DESTINATION ${SERVICES_INSTALL_DIR}) >+endif(LIBVNCSERVER_FOUND) >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/krdc_vnc_config.desktop kdenetwork-4.9.1/krdc.org/vnc/krdc_vnc_config.desktop >--- kdenetwork-4.9.1.org/krdc.org/vnc/krdc_vnc_config.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/krdc_vnc_config.desktop 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,60 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KCModule >+Name=VNC >+Name[ast]=VNC >+Name[bg]=VNC >+Name[bs]=VNC >+Name[ca]=VNC >+Name[ca@valencia]=VNC >+Name[cs]=VNC >+Name[da]=VNC >+Name[de]=VNC >+Name[el]=VNC >+Name[en_GB]=VNC >+Name[eo]=VNC >+Name[es]=VNC >+Name[et]=VNC >+Name[eu]=VNC >+Name[fi]=VNC >+Name[fr]=VNC >+Name[ga]=VNC >+Name[gl]=VNC >+Name[hr]=VNC >+Name[hu]=VNC >+Name[ia]=VNC >+Name[it]=VNC >+Name[ja]=VNC >+Name[kk]=VNC >+Name[km]=VNC >+Name[ko]=VNC >+Name[lt]=VNC >+Name[lv]=VNC >+Name[nb]=VNC >+Name[nds]=VNC >+Name[nl]=VNC >+Name[nn]=VNC >+Name[pa]=VNC >+Name[pl]=VNC >+Name[pt]=VNC >+Name[pt_BR]=VNC >+Name[ro]=VNC >+Name[ru]=VNC >+Name[si]=VNC >+Name[sk]=VNC >+Name[sl]=VNC >+Name[sr]=ÐÐЦ >+Name[sr@ijekavian]=ÐÐЦ >+Name[sr@ijekavianlatin]=VNC >+Name[sr@latin]=VNC >+Name[sv]=VNC >+Name[tr]=VNC >+Name[ug]=VNC >+Name[uk]=VNC >+Name[wa]=VNC >+Name[x-test]=xxVNCxx >+Name[zh_CN]=VNC >+Name[zh_TW]=VNC >+ >+X-KDE-Library=kcm_krdc_vncplugin >+X-KDE-ParentComponents=krdc_vncplugin >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/krdc_vnc.desktop kdenetwork-4.9.1/krdc.org/vnc/krdc_vnc.desktop >--- kdenetwork-4.9.1.org/krdc.org/vnc/krdc_vnc.desktop 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/krdc_vnc.desktop 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,120 @@ >+[Desktop Entry] >+Type=Service >+X-KDE-ServiceTypes=KRDC/Plugin >+Icon=krdc >+Name=VNC >+Name[ast]=VNC >+Name[bg]=VNC >+Name[bs]=VNC >+Name[ca]=VNC >+Name[ca@valencia]=VNC >+Name[cs]=VNC >+Name[da]=VNC >+Name[de]=VNC >+Name[el]=VNC >+Name[en_GB]=VNC >+Name[eo]=VNC >+Name[es]=VNC >+Name[et]=VNC >+Name[eu]=VNC >+Name[fi]=VNC >+Name[fr]=VNC >+Name[ga]=VNC >+Name[gl]=VNC >+Name[hr]=VNC >+Name[hu]=VNC >+Name[ia]=VNC >+Name[it]=VNC >+Name[ja]=VNC >+Name[kk]=VNC >+Name[km]=VNC >+Name[ko]=VNC >+Name[lt]=VNC >+Name[lv]=VNC >+Name[nb]=VNC >+Name[nds]=VNC >+Name[nl]=VNC >+Name[nn]=VNC >+Name[pa]=VNC >+Name[pl]=VNC >+Name[pt]=VNC >+Name[pt_BR]=VNC >+Name[ro]=VNC >+Name[ru]=VNC >+Name[si]=VNC >+Name[sk]=VNC >+Name[sl]=VNC >+Name[sr]=ÐÐЦ >+Name[sr@ijekavian]=ÐÐЦ >+Name[sr@ijekavianlatin]=VNC >+Name[sr@latin]=VNC >+Name[sv]=VNC >+Name[tr]=VNC >+Name[ug]=VNC >+Name[uk]=VNC >+Name[wa]=VNC >+Name[x-test]=xxVNCxx >+Name[zh_CN]=VNC >+Name[zh_TW]=VNC >+Comment=Allows managing VNC sessions through KRDC >+Comment[ast]=Permite la xestión de sesiones VNC per KRDC >+Comment[bg]=УпÑавление на ÑеÑии на VNC Ñ KRDC >+Comment[bs]=DopuÅ¡ta upravljanje VNC sesijama kroz KRDC >+Comment[ca]=Permet gestionar sessions VNC mitjançant el KRDC >+Comment[ca@valencia]=Permet gestionar sessions VNC mitjançant el KRDC >+Comment[cs]=UmožÅuje spravovánà sezenà VNC pomocà KRDC >+Comment[da]=Muliggør hÃ¥ndtering af VNC-sessioner via KRDC >+Comment[de]=Erlaubt die Verwaltung von VNC-Sitzungen über KRDC >+Comment[el]=ÎÏιÏÏÎÏει Ïη διαÏείÏιÏη ÏÏ Î½ÎµÎ´ÏιÏν VNC μÎÏÏ ÏÎ¿Ï KRDC >+Comment[en_GB]=Allows managing VNC sessions through KRDC >+Comment[es]=Permite la gestión de sesiones VNC mediante KRDC >+Comment[et]=VNC-seansside haldamise võimaldamine KRDC kaudu >+Comment[eu]=VNC saioak KRDC bidez kudeatzea baimentzen du >+Comment[fi]=Mahdollistaa VNC-istuntojen hallinnan KRDC:llä >+Comment[fr]=Permet de gérer des sessions VNC au travers de KRDC >+Comment[ga]=CeadaÃonn sé duit seisiúin VNC a bhainistiú trà KRDC >+Comment[gl]=Permite xestionar sesións VNC por medio de KRDC >+Comment[hr]=OmoguÄuje upravljanje sjednicama VNC-a kroz KRDC >+Comment[hu]=VNC-elérés KRDC-bÅl >+Comment[ia]=Permitte gerer sessiones VNC per medio de KRDC >+Comment[it]=Permette di gestire sessioni VNC con KRDC >+Comment[ja]=KRDC ãã VNC ã»ãã·ã§ã³ã管çã§ããããã«ãã¾ã >+Comment[kk]=KRDC аÑÒÑÐ»Ñ VNC ÑеанÑÑаÑÑн баÑÒаÑÑÒа мүмкÑндÑк беÑÑ >+Comment[km]=á¢áá»áááá¶áâá²ááâáááááááááâááááâáááá VNC áá¶áááá KRDC >+Comment[ko]=KRDC를 íµí´ì VNC ì¸ì ê´ë¦¬í기 >+Comment[lt]=Leidžia valdyti VNC sesijas per KRDC >+Comment[lv]=Ä»auj pÄrvaldÄ«t VNC sesijas caur KRDC >+Comment[nb]=Tillater Ã¥ styre VNC-økter gjennom KRDC >+Comment[nds]=VNC-Törns över KRDC plegen >+Comment[nl]=Staat het beheer van VNC-sessies toe via KRDC >+Comment[nn]=Lèt deg handtera VNC-økter gjennom KRDC >+Comment[pa]=KRDC ਰਾਹà©à¨ VNC ਸ਼à©à¨¸à¨¼à¨¨à¨¾à¨ ਦ੠ਪਰਬੰਧ ਦ੠ਮਨà¨à¨¼à©à¨°à© >+Comment[pl]=Pozwala na zarzÄ dzanie sesjami VNC przez KRDC >+Comment[pt]=Permite a gestão de sessões VNC através do KRDC >+Comment[pt_BR]=Permite o gerenciamento de sessões VNC através do KRDC >+Comment[ro]=Permite gestiunea sesiunilor VNC prin KRDC >+Comment[ru]=РазÑеÑиÑÑ ÑпÑавление ÑеанÑами VNC ÑеÑез KRDC >+Comment[si]=KRDC à·à¶»à·à· VNC à·à·à¶» à¶´à·à¶½à¶±à¶ºà¶§ à¶à¶© දà·à¶ºà· >+Comment[sk]=UmožÅuje spravovanie VNC sedenà pomocou KRDC >+Comment[sl]=OmogoÄa upravljanje sej VNC prek KRDC >+Comment[sr]=УпÑавÑаÑе ÐÐЦ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavian]=УпÑавÑаÑе ÐÐЦ ÑеÑиÑама кÑоз ÐÐ ÐЦ >+Comment[sr@ijekavianlatin]=Upravljanje VNC sesijama kroz KRDC >+Comment[sr@latin]=Upravljanje VNC sesijama kroz KRDC >+Comment[sv]=TillÃ¥ter hantering av VNC-sessioner via KRDC >+Comment[tr]=VNC oturumlarını KRDC üzerinden yönetmeye izin verir >+Comment[uk]=ÐÐ°Ð´Ð°Ñ Ð·Ð¼Ð¾Ð³Ñ ÐºÐµÑÑваÑи ÑеанÑами VNC за Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ KRDC >+Comment[x-test]=xxAllows managing VNC sessions through KRDCxx >+Comment[zh_CN]=å è®¸ç¨æ·éè¿ KRDC 管ç VNC ä¼è¯ >+Comment[zh_TW]=å 許éé KRDC 管ç VNC å·¥ä½é段 >+ >+X-KDE-PluginInfo-Author=Urs Wolfer >+X-KDE-PluginInfo-Email=uwolfer@kde.org >+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_vncplugin >+X-KDE-PluginInfo-Name=krdc_vncplugin >+ >+X-KDE-KRDC-Sorting=20 >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/qtonly/krdc-vnc-qtonly.pro kdenetwork-4.9.1/krdc.org/vnc/qtonly/krdc-vnc-qtonly.pro >--- kdenetwork-4.9.1.org/krdc.org/vnc/qtonly/krdc-vnc-qtonly.pro 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/qtonly/krdc-vnc-qtonly.pro 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,9 @@ >+TEMPLATE = app >+TARGET = >+DEPENDPATH += . >+INCLUDEPATH += . >+LIBS += -lvncclient -lgnutls >+DEFINES += QTONLY >+ >+HEADERS += remoteview.h vncclientthread.h vncview.h >+SOURCES += main.cpp remoteview.cpp vncclientthread.cpp vncview.cpp >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/qtonly/main.cpp kdenetwork-4.9.1/krdc.org/vnc/qtonly/main.cpp >--- kdenetwork-4.9.1.org/krdc.org/vnc/qtonly/main.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/qtonly/main.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,40 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 <QApplication> >+ >+#include "vncview.h" >+ >+int main(int argc, char *argv[]) >+{ >+ QApplication app(argc, argv); >+ if (QCoreApplication::arguments().count() < 2) { >+ qFatal("Please define an URL as argument. Example: vnc://:password@server:1\n" >+ "Optionally, you can define the quality as second argument (1-3, where 1 is the best). Default is 2."); >+ return 1; >+ } >+ VncView vncView(0, QCoreApplication::arguments().at(1)); >+ vncView.show(); >+ vncView.start(); >+ return app.exec(); >+} >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/qtonly/README kdenetwork-4.9.1/krdc.org/vnc/qtonly/README >--- kdenetwork-4.9.1.org/krdc.org/vnc/qtonly/README 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/qtonly/README 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,30 @@ >+Qt-only version of the KRDC VNC backend >+======================================= >+ >+In order to build it, you need the LibVNCClient (LibVNCServer) >+library (version 0.9.1 or newer required): >+ http://sourceforge.net/project/showfiles.php?group_id=32584&package_id=24717 >+ >+The following files from KRDC are required: >+ krdc/core/remoteview.{cpp,h} >+ krdc/vnc/vncview.{cpp,h} >+ krdc/vnc/vncclientthread.{cpp,h} >+ krdc/vnc/qtonly/main.cpp >+ krdc/vnc/qtonly/krdc-vnc-qtonly.pro >+ >+Copy these files into a folder and run: >+ qmake >+ make >+ >+In order to try it out, type: >+ ./krdc-vnc-qtonly vnc://:password@server:1 1 >+ (the last argument defines the quality as second argument (1-3, where 1 is >+ the best). Default is 2.) >+ >+If you use these code in your project, make sure that QTONLY is defined (see >+krdc-vnc-qtonly.pro). >+ >+IMPORTANT NOTICE >+================ >+If you do any fixes or improvements in these files, please backport them to the original sources. >+Please send a patch with the changes to <uwolfer @ kde.org>. Thanks a lot! >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncclientthread.cpp kdenetwork-4.9.1/krdc.org/vnc/vncclientthread.cpp >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncclientthread.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncclientthread.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,454 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "vncclientthread.h" >+ >+#include <QMutexLocker> >+#include <QTimer> >+ >+//for detecting intel AMT KVM vnc server >+static const QString INTEL_AMT_KVM_STRING= "Intel(r) AMT KVM"; >+static QString outputErrorMessageString; >+ >+QVector<QRgb> VncClientThread::m_colorTable; >+ >+void VncClientThread::setClientColorDepth(rfbClient* cl, VncClientThread::ColorDepth cd) >+{ >+ switch(cd) { >+ case bpp8: >+ if (m_colorTable.isEmpty()) { >+ m_colorTable.resize(256); >+ int r,g,b; >+ for (int i = 0; i < 256; ++i) { >+ //pick out the red (3 bits), green (3 bits) and blue (2 bits) bits and make them maximum significant in 8bits >+ //this gives a colortable for 8bit true colors >+ r= (i & 0x07) << 5; >+ g= (i & 0x38) << 2; >+ b= i & 0xc0; >+ m_colorTable[i] = qRgb(r, g, b); >+ } >+ } >+ cl->format.depth = 8; >+ cl->format.bitsPerPixel = 8; >+ cl->format.redShift = 0; >+ cl->format.greenShift = 3; >+ cl->format.blueShift = 6; >+ cl->format.redMax = 7; >+ cl->format.greenMax = 7; >+ cl->format.blueMax = 3; >+ break; >+ case bpp16: >+ cl->format.depth = 16; >+ cl->format.bitsPerPixel = 16; >+ cl->format.redShift = 11; >+ cl->format.greenShift = 5; >+ cl->format.blueShift = 0; >+ cl->format.redMax = 0x1f; >+ cl->format.greenMax = 0x3f; >+ cl->format.blueMax = 0x1f; >+ break; >+ case bpp32: >+ default: >+ cl->format.depth = 24; >+ cl->format.bitsPerPixel = 32; >+ cl->format.redShift = 16; >+ cl->format.greenShift = 8; >+ cl->format.blueShift = 0; >+ cl->format.redMax = 0xff; >+ cl->format.greenMax = 0xff; >+ cl->format.blueMax = 0xff; >+ } >+} >+ >+rfbBool VncClientThread::newclient(rfbClient *cl) >+{ >+ VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); >+ Q_ASSERT(t); >+ >+ //8bit color hack for Intel(r) AMT KVM "classic vnc" = vnc server built in in Intel Vpro chipsets. >+ if (INTEL_AMT_KVM_STRING == cl->desktopName) { >+ kDebug(5011) << "Intel(R) AMT KVM: switching to 8 bit color depth (workaround, recent libvncserver needed)"; >+ t->setColorDepth(bpp8); >+ } >+ setClientColorDepth(cl, t->colorDepth()); >+ >+ const int width = cl->width, height = cl->height, depth = cl->format.bitsPerPixel; >+ const int size = width * height * (depth / 8); >+ if (t->frameBuffer) >+ delete [] t->frameBuffer; // do not leak if we get a new framebuffer size >+ t->frameBuffer = new uint8_t[size]; >+ cl->frameBuffer = t->frameBuffer; >+ memset(cl->frameBuffer, '\0', size); >+ >+ switch (t->quality()) { >+ case RemoteView::High: >+ cl->appData.encodingsString = "copyrect zlib hextile raw"; >+ cl->appData.compressLevel = 0; >+ cl->appData.qualityLevel = 9; >+ break; >+ case RemoteView::Medium: >+ cl->appData.encodingsString = "copyrect tight zrle ultra zlib hextile corre rre raw"; >+ cl->appData.compressLevel = 5; >+ cl->appData.qualityLevel = 7; >+ break; >+ case RemoteView::Low: >+ case RemoteView::Unknown: >+ default: >+ cl->appData.encodingsString = "copyrect tight zrle ultra zlib hextile corre rre raw"; >+ cl->appData.compressLevel = 9; >+ cl->appData.qualityLevel = 1; >+ } >+ >+ SetFormatAndEncodings(cl); >+ kDebug(5011) << "Client created"; >+ return true; >+} >+ >+void VncClientThread::updatefb(rfbClient* cl, int x, int y, int w, int h) >+{ >+// kDebug(5011) << "updated client: x: " << x << ", y: " << y << ", w: " << w << ", h: " << h; >+ VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); >+ Q_ASSERT(t); >+ >+ const int width = cl->width, height = cl->height; >+ QImage img; >+ switch(t->colorDepth()) { >+ case bpp8: >+ img = QImage(cl->frameBuffer, width, height, QImage::Format_Indexed8); >+ img.setColorTable(m_colorTable); >+ break; >+ case bpp16: >+ img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB16); >+ break; >+ case bpp32: >+ img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB32); >+ break; >+ } >+ >+ if (img.isNull()) { >+ kDebug(5011) << "image not loaded"; >+ } >+ >+ t->setImage(img); >+ >+ t->emitUpdated(x, y, w, h); >+} >+ >+void VncClientThread::cuttext(rfbClient* cl, const char *text, int textlen) >+{ >+ const QString cutText = QString::fromUtf8(text, textlen); >+ kDebug(5011) << cutText; >+ >+ if (!cutText.isEmpty()) { >+ VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); >+ Q_ASSERT(t); >+ >+ t->emitGotCut(cutText); >+ } >+} >+ >+char *VncClientThread::passwdHandler(rfbClient *cl) >+{ >+ kDebug(5011) << "password request" << kBacktrace(); >+ >+ VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); >+ Q_ASSERT(t); >+ >+ t->passwordRequest(); >+ t->m_passwordError = true; >+ >+ return strdup(t->password().toLocal8Bit()); >+} >+ >+void VncClientThread::outputHandler(const char *format, ...) >+{ >+ va_list args; >+ va_start(args, format); >+ >+ QString message; >+ message.vsprintf(format, args); >+ >+ va_end(args); >+ >+ message = message.trimmed(); >+ >+ kDebug(5011) << message; >+ >+ if ((message.contains("Couldn't convert ")) || >+ (message.contains("Unable to connect to VNC server"))) >+ outputErrorMessageString = i18n("Server not found."); >+ >+ if ((message.contains("VNC connection failed: Authentication failed, too many tries")) || >+ (message.contains("VNC connection failed: Too many authentication failures"))) >+ outputErrorMessageString = i18n("VNC authentication failed because of too many authentication tries."); >+ >+ if (message.contains("VNC connection failed: Authentication failed")) >+ outputErrorMessageString = i18n("VNC authentication failed."); >+ >+ if (message.contains("VNC server closed connection")) >+ outputErrorMessageString = i18n("VNC server closed connection."); >+ >+ // internal messages, not displayed to user >+ if (message.contains("VNC server supports protocol version 3.889")) // see http://bugs.kde.org/162640 >+ outputErrorMessageString = "INTERNAL:APPLE_VNC_COMPATIBILTY"; >+} >+ >+VncClientThread::VncClientThread(QObject *parent) >+ : QThread(parent) >+ , frameBuffer(0) >+ , cl(0) >+ , m_stopped(false) >+{ >+ QMutexLocker locker(&mutex); >+ >+ QTimer *outputErrorMessagesCheckTimer = new QTimer(this); >+ outputErrorMessagesCheckTimer->setInterval(500); >+ connect(outputErrorMessagesCheckTimer, SIGNAL(timeout()), this, SLOT(checkOutputErrorMessage())); >+ outputErrorMessagesCheckTimer->start(); >+} >+ >+VncClientThread::~VncClientThread() >+{ >+ if(isRunning()) { >+ stop(); >+ terminate(); >+ const bool quitSuccess = wait(1000); >+ kDebug(5011) << "Attempting to stop in deconstructor, will crash if this fails:" << quitSuccess; >+ } >+ >+ if (cl) { >+ // Disconnect from vnc server & cleanup allocated resources >+ rfbClientCleanup(cl); >+ } >+ >+ delete [] frameBuffer; >+} >+ >+void VncClientThread::checkOutputErrorMessage() >+{ >+ if (!outputErrorMessageString.isEmpty()) { >+ kDebug(5011) << outputErrorMessageString; >+ QString errorMessage = outputErrorMessageString; >+ outputErrorMessageString.clear(); >+ // show authentication failure error only after the 3rd unsuccessful try >+ if ((errorMessage != i18n("VNC authentication failed.")) || m_passwordError) >+ outputErrorMessage(errorMessage); >+ } >+} >+ >+void VncClientThread::setHost(const QString &host) >+{ >+ QMutexLocker locker(&mutex); >+ m_host = host; >+} >+ >+void VncClientThread::setPort(int port) >+{ >+ QMutexLocker locker(&mutex); >+ m_port = port; >+} >+ >+void VncClientThread::setQuality(RemoteView::Quality quality) >+{ >+ m_quality = quality; >+ //set color depth dependent on quality >+ switch(quality) { >+ case RemoteView::Low: >+ setColorDepth(bpp8); >+ break; >+ case RemoteView::High: >+ setColorDepth(bpp32); >+ break; >+ case RemoteView::Medium: >+ default: >+ setColorDepth(bpp16); >+ } >+} >+ >+void VncClientThread::setColorDepth(ColorDepth colorDepth) >+{ >+ m_colorDepth= colorDepth; >+} >+ >+RemoteView::Quality VncClientThread::quality() const >+{ >+ return m_quality; >+} >+ >+VncClientThread::ColorDepth VncClientThread::colorDepth() const >+{ >+ return m_colorDepth; >+} >+ >+void VncClientThread::setImage(const QImage &img) >+{ >+ QMutexLocker locker(&mutex); >+ m_image = img; >+} >+ >+const QImage VncClientThread::image(int x, int y, int w, int h) >+{ >+ QMutexLocker locker(&mutex); >+ >+ if (w == 0) // full image requested >+ return m_image; >+ else >+ return m_image.copy(x, y, w, h); >+} >+ >+void VncClientThread::emitUpdated(int x, int y, int w, int h) >+{ >+ emit imageUpdated(x, y, w, h); >+} >+ >+void VncClientThread::emitGotCut(const QString &text) >+{ >+ emit gotCut(text); >+} >+ >+void VncClientThread::stop() >+{ >+ QMutexLocker locker(&mutex); >+ m_stopped = true; >+} >+ >+void VncClientThread::run() >+{ >+ QMutexLocker locker(&mutex); >+ >+ while (!m_stopped) { // try to connect as long as the server allows >+ locker.relock(); >+ m_passwordError = false; >+ locker.unlock(); >+ >+ rfbClientLog = outputHandler; >+ rfbClientErr = outputHandler; >+ //24bit color dept in 32 bits per pixel = default. Will change colordepth and bpp later if needed >+ cl = rfbGetClient(8, 3, 4); >+ setClientColorDepth(cl, this->colorDepth()); >+ cl->MallocFrameBuffer = newclient; >+ cl->canHandleNewFBSize = true; >+ cl->GetPassword = passwdHandler; >+ cl->GotFrameBufferUpdate = updatefb; >+ cl->GotXCutText = cuttext; >+ rfbClientSetClientData(cl, 0, this); >+ >+ locker.relock(); >+ cl->serverHost = strdup(m_host.toUtf8().constData()); >+ >+ if (m_port < 0 || !m_port) // port is invalid or empty... >+ m_port = 5900; // fallback: try an often used VNC port >+ >+ if (m_port >= 0 && m_port < 100) // the user most likely used the short form (e.g. :1) >+ m_port += 5900; >+ cl->serverPort = m_port; >+ locker.unlock(); >+ >+ kDebug(5011) << "--------------------- trying init ---------------------"; >+ >+ if (rfbInitClient(cl, 0, 0)) >+ break; >+ else >+ cl = 0; >+ >+ locker.relock(); >+ if (m_passwordError) >+ continue; >+ >+ return; >+ } >+ >+ locker.relock(); >+ kDebug(5011) << "--------------------- Starting main VNC event loop ---------------------"; >+ while (!m_stopped) { >+ locker.unlock(); >+ const int i = WaitForMessage(cl, 500); >+ if (i < 0) { >+ break; >+ } >+ if (i) { >+ if (!HandleRFBServerMessage(cl)) { >+ break; >+ } >+ } >+ >+ locker.relock(); >+ while (!m_eventQueue.isEmpty()) { >+ ClientEvent* clientEvent = m_eventQueue.dequeue(); >+ locker.unlock(); >+ clientEvent->fire(cl); >+ delete clientEvent; >+ locker.relock(); >+ } >+ } >+ >+ m_stopped = true; >+} >+ >+ClientEvent::~ClientEvent() >+{ >+} >+ >+void PointerClientEvent::fire(rfbClient* cl) >+{ >+ SendPointerEvent(cl, m_x, m_y, m_buttonMask); >+} >+ >+void KeyClientEvent::fire(rfbClient* cl) >+{ >+ SendKeyEvent(cl, m_key, m_pressed); >+} >+ >+void ClientCutEvent::fire(rfbClient* cl) >+{ >+ SendClientCutText(cl, text.toUtf8().data(), text.size()); >+} >+ >+void VncClientThread::mouseEvent(int x, int y, int buttonMask) >+{ >+ QMutexLocker lock(&mutex); >+ if (m_stopped) >+ return; >+ >+ m_eventQueue.enqueue(new PointerClientEvent(x, y, buttonMask)); >+} >+ >+void VncClientThread::keyEvent(int key, bool pressed) >+{ >+ QMutexLocker lock(&mutex); >+ if (m_stopped) >+ return; >+ >+ m_eventQueue.enqueue(new KeyClientEvent(key, pressed)); >+} >+ >+void VncClientThread::clientCut(const QString &text) >+{ >+ QMutexLocker lock(&mutex); >+ if (m_stopped) >+ return; >+ >+ m_eventQueue.enqueue(new ClientCutEvent(text)); >+} >+ >+#include "moc_vncclientthread.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncclientthread.h kdenetwork-4.9.1/krdc.org/vnc/vncclientthread.h >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncclientthread.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncclientthread.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,172 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 VNCCLIENTTHREAD_H >+#define VNCCLIENTTHREAD_H >+ >+#ifdef QTONLY >+ #include <QDebug> >+ #define kDebug(n) qDebug() >+ #define kBacktrace() "" >+ #define i18n tr >+#else >+ #include <KDebug> >+ #include <KLocale> >+#endif >+ >+#include "remoteview.h" >+ >+#include <QQueue> >+#include <QThread> >+#include <QImage> >+#include <QMutex> >+ >+extern "C" { >+#include <rfb/rfbclient.h> >+} >+ >+class ClientEvent >+{ >+public: >+ virtual ~ClientEvent(); >+ >+ virtual void fire(rfbClient*) = 0; >+}; >+ >+class KeyClientEvent : public ClientEvent >+{ >+public: >+ KeyClientEvent(int key, int pressed) >+ : m_key(key), m_pressed(pressed) {} >+ >+ void fire(rfbClient*); >+ >+private: >+ int m_key; >+ int m_pressed; >+}; >+ >+class PointerClientEvent : public ClientEvent >+{ >+public: >+ PointerClientEvent(int x, int y, int buttonMask) >+ : m_x(x), m_y(y), m_buttonMask(buttonMask) {} >+ >+ void fire(rfbClient*); >+ >+private: >+ int m_x; >+ int m_y; >+ int m_buttonMask; >+}; >+ >+class ClientCutEvent : public ClientEvent >+{ >+public: >+ ClientCutEvent(const QString &text) >+ : text(text) {} >+ >+ void fire(rfbClient*); >+ >+private: >+ QString text; >+}; >+ >+class VncClientThread: public QThread >+{ >+ Q_OBJECT >+ >+public: >+ Q_ENUMS(ColorDepth) >+ >+ enum ColorDepth { >+ bpp32, >+ bpp16, >+ bpp8 >+ }; >+ >+ explicit VncClientThread(QObject *parent = 0); >+ ~VncClientThread(); >+ const QImage image(int x = 0, int y = 0, int w = 0, int h = 0); >+ void setImage(const QImage &img); >+ void emitUpdated(int x, int y, int w, int h); >+ void emitGotCut(const QString &text); >+ void stop(); >+ void setHost(const QString &host); >+ void setPort(int port); >+ void setQuality(RemoteView::Quality quality); >+ void setPassword(const QString &password) { >+ m_password = password; >+ } >+ const QString password() const { >+ return m_password; >+ } >+ >+ RemoteView::Quality quality() const; >+ ColorDepth colorDepth() const; >+ uint8_t *frameBuffer; >+ >+signals: >+ void imageUpdated(int x, int y, int w, int h); >+ void gotCut(const QString &text); >+ void passwordRequest(); >+ void outputErrorMessage(const QString &message); >+ >+public slots: >+ void mouseEvent(int x, int y, int buttonMask); >+ void keyEvent(int key, bool pressed); >+ void clientCut(const QString &text); >+ >+protected: >+ void run(); >+ >+private: >+ static void setClientColorDepth(rfbClient *cl, ColorDepth cd); >+ void setColorDepth(ColorDepth colorDepth); >+ //these static methods are callback functions for libvncclient >+ static rfbBool newclient(rfbClient *cl); >+ static void updatefb(rfbClient *cl, int x, int y, int w, int h); >+ static void cuttext(rfbClient *cl, const char *text, int textlen); >+ static char* passwdHandler(rfbClient *cl); >+ static void outputHandler(const char *format, ...); >+ >+ QImage m_image; >+ rfbClient *cl; >+ QString m_host; >+ QString m_password; >+ int m_port; >+ QMutex mutex; >+ RemoteView::Quality m_quality; >+ ColorDepth m_colorDepth; >+ QQueue<ClientEvent* > m_eventQueue; >+ //color table for 8bit indexed colors >+ static QVector<QRgb> m_colorTable; >+ >+ volatile bool m_stopped; >+ volatile bool m_passwordError; >+ >+private slots: >+ void checkOutputErrorMessage(); >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vnchostpreferences.cpp kdenetwork-4.9.1/krdc.org/vnc/vnchostpreferences.cpp >--- kdenetwork-4.9.1.org/krdc.org/vnc/vnchostpreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vnchostpreferences.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,143 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "vnchostpreferences.h" >+ >+#include "settings.h" >+ >+#include <KDebug> >+ >+#include <QDesktopWidget> >+ >+VncHostPreferences::VncHostPreferences(KConfigGroup configGroup, QObject *parent) >+ : HostPreferences(configGroup, parent) >+{ >+} >+ >+VncHostPreferences::~VncHostPreferences() >+{ >+} >+ >+QWidget* VncHostPreferences::createProtocolSpecificConfigPage() >+{ >+ QWidget *vncPage = new QWidget(); >+ vncUi.setupUi(vncPage); >+ >+ vncUi.kcfg_Quality->setCurrentIndex(quality() - 1); >+ vncUi.kcfg_Scaling->setChecked(windowedScale()); >+ vncUi.kcfg_ScalingWidth->setValue(width()); >+ vncUi.kcfg_ScalingHeight->setValue(height()); >+ >+ connect(vncUi.resolutionComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateScalingWidthHeight(int))); >+ connect(vncUi.kcfg_Scaling, SIGNAL(toggled(bool)), SLOT(updateScaling(bool))); >+ >+ const QString resolutionString = QString::number(width()) + 'x' + QString::number(height()); >+ const int resolutionIndex = vncUi.resolutionComboBox->findText(resolutionString, Qt::MatchContains); >+ vncUi.resolutionComboBox->setCurrentIndex((resolutionIndex == -1) ? vncUi.resolutionComboBox->count() - 1 : resolutionIndex); >+ >+ updateScaling(windowedScale()); >+ >+ return vncPage; >+} >+ >+void VncHostPreferences::updateScalingWidthHeight(int index) >+{ >+ switch (index) { >+ case 0: >+ vncUi.kcfg_ScalingHeight->setValue(480); >+ vncUi.kcfg_ScalingWidth->setValue(640); >+ break; >+ case 1: >+ vncUi.kcfg_ScalingHeight->setValue(600); >+ vncUi.kcfg_ScalingWidth->setValue(800); >+ break; >+ case 2: >+ vncUi.kcfg_ScalingHeight->setValue(768); >+ vncUi.kcfg_ScalingWidth->setValue(1024); >+ break; >+ case 3: >+ vncUi.kcfg_ScalingHeight->setValue(1024); >+ vncUi.kcfg_ScalingWidth->setValue(1280); >+ break; >+ case 4: >+ vncUi.kcfg_ScalingHeight->setValue(1200); >+ vncUi.kcfg_ScalingWidth->setValue(1600); >+ break; >+ case 5: { >+ QDesktopWidget *desktop = QApplication::desktop(); >+ int currentScreen = desktop->screenNumber(vncUi.kcfg_ScalingHeight); >+ vncUi.kcfg_ScalingHeight->setValue(desktop->screenGeometry(currentScreen).height()); >+ vncUi.kcfg_ScalingWidth->setValue(desktop->screenGeometry(currentScreen).width()); >+ break; >+ } >+ case 6: >+ default: >+ break; >+ } >+ >+ checkEnableCustomSize(index); >+} >+ >+void VncHostPreferences::updateScaling(bool enabled) >+{ >+ vncUi.resolutionComboBox->setEnabled(enabled); >+ if(enabled) { >+ checkEnableCustomSize(vncUi.resolutionComboBox->currentIndex()); >+ } else { >+ checkEnableCustomSize(-1); >+ } >+} >+ >+void VncHostPreferences::checkEnableCustomSize(int index) >+{ >+ const bool enabled = (index == 6); >+ >+ vncUi.kcfg_ScalingHeight->setEnabled(enabled); >+ vncUi.kcfg_ScalingWidth->setEnabled(enabled); >+ vncUi.heightLabel->setEnabled(enabled); >+ vncUi.widthLabel->setEnabled(enabled); >+} >+ >+void VncHostPreferences::acceptConfig() >+{ >+ HostPreferences::acceptConfig(); >+ setQuality((RemoteView::Quality)(vncUi.kcfg_Quality->currentIndex() + 1)); >+ setWindowedScale(vncUi.kcfg_Scaling->isChecked()); >+ if(vncUi.kcfg_Scaling->isChecked()) { >+ setHeight(vncUi.kcfg_ScalingHeight->value()); >+ setWidth(vncUi.kcfg_ScalingWidth->value()); >+ } >+} >+ >+void VncHostPreferences::setQuality(RemoteView::Quality quality) >+{ >+ if (quality >= 0 && quality <= 3) >+ m_configGroup.writeEntry("quality", (int) quality); >+} >+ >+RemoteView::Quality VncHostPreferences::quality() >+{ >+ return (RemoteView::Quality) m_configGroup.readEntry("quality", (int) Settings::quality() + 1); >+} >+ >+#include "vnchostpreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vnchostpreferences.h kdenetwork-4.9.1/krdc.org/vnc/vnchostpreferences.h >--- kdenetwork-4.9.1.org/krdc.org/vnc/vnchostpreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vnchostpreferences.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,55 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 VNCHOSTPREFERENCES_H >+#define VNCHOSTPREFERENCES_H >+ >+#include "hostpreferences.h" >+#include "ui_vncpreferences.h" >+ >+class VncHostPreferences : public HostPreferences >+{ >+ Q_OBJECT >+ >+public: >+ explicit VncHostPreferences(KConfigGroup configGroup, QObject *parent = 0); >+ ~VncHostPreferences(); >+ >+ void setQuality(RemoteView::Quality quality); >+ RemoteView::Quality quality(); >+ >+protected: >+ void acceptConfig(); >+ >+ virtual QWidget* createProtocolSpecificConfigPage(); >+ >+private: >+ Ui::VncPreferences vncUi; >+ void checkEnableCustomSize(int index); >+ >+private slots: >+ void updateScalingWidthHeight(int index); >+ void updateScaling(bool enabled); >+}; >+ >+#endif >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncpreferences.cpp kdenetwork-4.9.1/krdc.org/vnc/vncpreferences.cpp >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncpreferences.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncpreferences.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,65 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "vncpreferences.h" >+#include "remoteviewfactory.h" >+#include "settings.h" >+ >+#include "ui_vncpreferences.h" >+ >+#include <KDebug> >+ >+KRDC_PLUGIN_EXPORT(VncPreferences) >+ >+VncPreferences::VncPreferences(QWidget *parent, const QVariantList &args) >+ : KCModule(KrdcFactory::componentData(), parent, args) >+{ >+ Ui::VncPreferences vncUi; >+ vncUi.setupUi(this); >+ >+ // copying the RDP preferences... need to create generic code for the plugins. >+ vncUi.resolutionDummyLabel->hide(); >+ vncUi.resolutionComboBox->hide(); >+ vncUi.kcfg_ScalingHeight->setEnabled(true); >+ vncUi.kcfg_ScalingWidth->setEnabled(true); >+ vncUi.heightLabel->setEnabled(true); >+ vncUi.widthLabel->setEnabled(true); >+ >+ addConfig(Settings::self(), this); >+} >+ >+VncPreferences::~VncPreferences() >+{ >+} >+ >+void VncPreferences::load() >+{ >+ KCModule::load(); >+} >+ >+void VncPreferences::save() >+{ >+ KCModule::save(); >+} >+ >+#include "vncpreferences.moc" >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncpreferences.h kdenetwork-4.9.1/krdc.org/vnc/vncpreferences.h >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncpreferences.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncpreferences.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,44 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 VNCPREFERENCES_H >+#define VNCPREFERENCES_H >+ >+#include "vnchostpreferences.h" >+ >+#include <KCModule> >+ >+class VncPreferences : public KCModule >+{ >+ Q_OBJECT >+ >+public: >+ explicit VncPreferences(QWidget *parent = 0, const QVariantList &args = QVariantList()); >+ ~VncPreferences(); >+ >+ virtual void save(); >+ virtual void load(); >+ >+}; >+ >+#endif // VNCPREFERENCES_H >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncpreferences.ui kdenetwork-4.9.1/krdc.org/vnc/vncpreferences.ui >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncpreferences.ui 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncpreferences.ui 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,225 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<ui version="4.0" > >+ <class>VncPreferences</class> >+ <widget class="QWidget" name="VncPreferences" > >+ <property name="geometry" > >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>436</width> >+ <height>151</height> >+ </rect> >+ </property> >+ <layout class="QVBoxLayout" name="verticalLayout" > >+ <item> >+ <widget class="QGroupBox" name="vncGroupBox" > >+ <property name="title" > >+ <string>Connection</string> >+ </property> >+ <layout class="QFormLayout" name="formLayout" > >+ <item row="0" column="0" > >+ <widget class="QLabel" name="connectionLabel" > >+ <property name="text" > >+ <string>Connection type:</string> >+ </property> >+ <property name="buddy" > >+ <cstring>kcfg_Quality</cstring> >+ </property> >+ </widget> >+ </item> >+ <item row="0" column="1" > >+ <widget class="KComboBox" name="kcfg_Quality" > >+ <property name="minimumSize" > >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis" > >+ <string>Use this to specify the performance of your connection. Note that you should select the speed of the weakest link - even if you have a high speed connection, it will not help you if the remote computer uses a slow modem. Choosing a level of quality that is too high on a slow link will cause slower response times. Choosing a lower quality will increase latencies in high speed connections and results in lower image quality, especially in 'Low Quality' mode.</string> >+ </property> >+ <item> >+ <property name="text" > >+ <string>High Quality (LAN, direct connection)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Medium Quality (DSL, Cable, fast Internet)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text" > >+ <string>Low Quality (Modem, ISDN, slow Internet)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item row="2" column="0"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="QCheckBox" name="kcfg_Scaling"> >+ <property name="text"> >+ <string>Scale to Size:</string> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="resolutionDummyLabel"/> >+ </item> >+ </layout> >+ </item> >+ <item row="2" column="1"> >+ <layout class="QVBoxLayout"> >+ <item> >+ <widget class="KComboBox" name="resolutionComboBox"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="minimumSize"> >+ <size> >+ <width>280</width> >+ <height>0</height> >+ </size> >+ </property> >+ <property name="whatsThis"> >+ <string>Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you.</string> >+ </property> >+ <property name="currentIndex"> >+ <number>1</number> >+ </property> >+ <item> >+ <property name="text"> >+ <string>Minimal (640x480)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Small (800x600)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Normal (1024x768)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Large (1280x1024)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Very Large (1600x1200)</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Current Screen Resolution</string> >+ </property> >+ </item> >+ <item> >+ <property name="text"> >+ <string>Custom Resolution (...)</string> >+ </property> >+ </item> >+ </widget> >+ </item> >+ <item> >+ <layout class="QHBoxLayout"> >+ <item> >+ <widget class="QLabel" name="widthLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>&Width:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_ScalingWidth</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_ScalingWidth"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the width of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>800</number> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QLabel" name="heightLabel"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="text"> >+ <string>H&eight:</string> >+ </property> >+ <property name="alignment"> >+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> >+ </property> >+ <property name="buddy"> >+ <cstring>kcfg_ScalingHeight</cstring> >+ </property> >+ </widget> >+ </item> >+ <item> >+ <widget class="QSpinBox" name="kcfg_ScalingHeight"> >+ <property name="enabled"> >+ <bool>false</bool> >+ </property> >+ <property name="whatsThis"> >+ <string>This is the height of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above.</string> >+ </property> >+ <property name="maximum"> >+ <number>9999</number> >+ </property> >+ <property name="value"> >+ <number>600</number> >+ </property> >+ </widget> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </item> >+ </layout> >+ </widget> >+ </item> >+ <item> >+ <spacer name="verticalSpacer" > >+ <property name="orientation" > >+ <enum>Qt::Vertical</enum> >+ </property> >+ <property name="sizeHint" stdset="0" > >+ <size> >+ <width>428</width> >+ <height>16</height> >+ </size> >+ </property> >+ </spacer> >+ </item> >+ </layout> >+ </widget> >+ <customwidgets> >+ <customwidget> >+ <class>KComboBox</class> >+ <extends>QComboBox</extends> >+ <header>kcombobox.h</header> >+ </customwidget> >+ </customwidgets> >+ <resources/> >+ <connections/> >+</ui> >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vnc.protocol kdenetwork-4.9.1/krdc.org/vnc/vnc.protocol >--- kdenetwork-4.9.1.org/krdc.org/vnc/vnc.protocol 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vnc.protocol 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,12 @@ >+[Protocol] >+exec=krdc '%u' >+protocol=vnc >+input=none >+output=none >+helper=true >+listing= >+reading=false >+writing=false >+makedir=false >+deleting=false >+Icon=krdc >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncview.cpp kdenetwork-4.9.1/krdc.org/vnc/vncview.cpp >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncview.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncview.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,592 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007-2012 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "vncview.h" >+ >+#ifdef QTONLY >+ #include <QMessageBox> >+ #include <QInputDialog> >+ #define KMessageBox QMessageBox >+ #define error(parent, message, caption) \ >+ critical(parent, caption, message) >+#else >+ #include "settings.h" >+ #include <KActionCollection> >+ #include <KMainWindow> >+ #include <KMessageBox> >+ #include <KPasswordDialog> >+ #include <KXMLGUIClient> >+#endif >+ >+#include <QApplication> >+#include <QImage> >+#include <QPainter> >+#include <QMouseEvent> >+ >+// Definition of key modifier mask constants >+#define KMOD_Alt_R 0x01 >+#define KMOD_Alt_L 0x02 >+#define KMOD_Meta_L 0x04 >+#define KMOD_Control_L 0x08 >+#define KMOD_Shift_L 0x10 >+ >+VncView::VncView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+ : RemoteView(parent), >+ m_initDone(false), >+ m_buttonMask(0), >+ m_repaint(false), >+ m_quitFlag(false), >+ m_firstPasswordTry(true), >+ m_dontSendClipboard(false), >+ m_horizontalFactor(1.0), >+ m_verticalFactor(1.0), >+ m_forceLocalCursor(false) >+{ >+ m_url = url; >+ m_host = url.host(); >+ m_port = url.port(); >+ >+ connect(&vncThread, SIGNAL(imageUpdated(int,int,int,int)), this, SLOT(updateImage(int,int,int,int)), Qt::BlockingQueuedConnection); >+ connect(&vncThread, SIGNAL(gotCut(QString)), this, SLOT(setCut(QString)), Qt::BlockingQueuedConnection); >+ connect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword()), Qt::BlockingQueuedConnection); >+ connect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString))); >+ >+ m_clipboard = QApplication::clipboard(); >+ connect(m_clipboard, SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged())); >+ >+#ifndef QTONLY >+ m_hostPreferences = new VncHostPreferences(configGroup, this); >+#else >+ Q_UNUSED(configGroup); >+#endif >+} >+ >+VncView::~VncView() >+{ >+ startQuitting(); >+} >+ >+bool VncView::eventFilter(QObject *obj, QEvent *event) >+{ >+ if (m_viewOnly) { >+ if (event->type() == QEvent::KeyPress || >+ event->type() == QEvent::KeyRelease || >+ event->type() == QEvent::MouseButtonDblClick || >+ event->type() == QEvent::MouseButtonPress || >+ event->type() == QEvent::MouseButtonRelease || >+ event->type() == QEvent::Wheel || >+ event->type() == QEvent::MouseMove) >+ return true; >+ } >+ >+ return RemoteView::eventFilter(obj, event); >+} >+ >+QSize VncView::framebufferSize() >+{ >+ return m_frame.size(); >+} >+ >+QSize VncView::sizeHint() const >+{ >+ return size(); >+} >+ >+QSize VncView::minimumSizeHint() const >+{ >+ return size(); >+} >+ >+void VncView::scaleResize(int w, int h) >+{ >+ RemoteView::scaleResize(w, h); >+ >+ kDebug(5011) << w << h; >+ if (m_scale) { >+ m_verticalFactor = (qreal) h / m_frame.height(); >+ m_horizontalFactor = (qreal) w / m_frame.width(); >+ >+#ifndef QTONLY >+ if (Settings::keepAspectRatio()) { >+ m_verticalFactor = m_horizontalFactor = qMin(m_verticalFactor, m_horizontalFactor); >+ } >+#else >+ m_verticalFactor = m_horizontalFactor = qMin(m_verticalFactor, m_horizontalFactor); >+#endif >+ >+ const qreal newW = m_frame.width() * m_horizontalFactor; >+ const qreal newH = m_frame.height() * m_verticalFactor; >+ setMaximumSize(newW, newH); //This is a hack to force Qt to center the view in the scroll area >+ resize(newW, newH); >+ } >+} >+ >+void VncView::updateConfiguration() >+{ >+ RemoteView::updateConfiguration(); >+ >+ // Update the scaling mode in case KeepAspectRatio changed >+ scaleResize(parentWidget()->width(), parentWidget()->height()); >+} >+ >+void VncView::startQuitting() >+{ >+ kDebug(5011) << "about to quit"; >+ >+ setStatus(Disconnecting); >+ >+ m_quitFlag = true; >+ >+ vncThread.stop(); >+ >+ unpressModifiers(); >+ >+ // Disconnect all signals so that we don't get any more callbacks from the client thread >+ bool imageUpdatedDisconnect = disconnect(&vncThread, SIGNAL(imageUpdated(int,int,int,int)), this, SLOT(updateImage(int,int,int,int))); >+ bool gotCutDisconnect = disconnect(&vncThread, SIGNAL(gotCut(QString)), this, SLOT(setCut(QString))); >+ bool passwordRequestDisconnect = disconnect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword())); >+ bool outputErrorMessageDisconnect = disconnect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString))); >+ >+ kDebug(5011) << "Signals disconnected: imageUpdated: " << imageUpdatedDisconnect << "gotCut: " << gotCutDisconnect << "passwordRequest: " << passwordRequestDisconnect << "outputErrorMessage: " << outputErrorMessageDisconnect; >+ >+ vncThread.quit(); >+ >+ const bool quitSuccess = vncThread.wait(1000); >+ >+ kDebug(5011) << "Quit VNC thread success:" << quitSuccess; >+ >+ setStatus(Disconnected); >+} >+ >+bool VncView::isQuitting() >+{ >+ return m_quitFlag; >+} >+ >+bool VncView::start() >+{ >+ vncThread.setHost(m_host); >+ vncThread.setPort(m_port); >+ RemoteView::Quality quality; >+#ifdef QTONLY >+ quality = (RemoteView::Quality)((QCoreApplication::arguments().count() > 2) ? >+ QCoreApplication::arguments().at(2).toInt() : 2); >+#else >+ quality = m_hostPreferences->quality(); >+#endif >+ >+ vncThread.setQuality(quality); >+ >+ // set local cursor on by default because low quality mostly means slow internet connection >+ if (quality == RemoteView::Low) { >+ showDotCursor(RemoteView::CursorOn); >+#ifndef QTONLY >+ // KRDC does always just have one main window, so at(0) is safe >+ KXMLGUIClient *mainWindow = dynamic_cast<KXMLGUIClient*>(KMainWindow::memberList().at(0)); >+ if (mainWindow) >+ mainWindow->actionCollection()->action("show_local_cursor")->setChecked(true); >+#endif >+ } >+ >+ setStatus(Connecting); >+ >+ vncThread.start(); >+ return true; >+} >+ >+bool VncView::supportsScaling() const >+{ >+ return true; >+} >+ >+bool VncView::supportsLocalCursor() const >+{ >+ return true; >+} >+ >+void VncView::requestPassword() >+{ >+ kDebug(5011) << "request password"; >+ >+ setStatus(Authenticating); >+ >+#ifndef QTONLY >+ // just try to get the passwort from the wallet the first time, otherwise it will loop (see issue #226283) >+ if (m_firstPasswordTry && m_hostPreferences->walletSupport()) { >+ QString walletPassword = readWalletPassword(); >+ >+ if (!walletPassword.isNull()) { >+ vncThread.setPassword(walletPassword); >+ m_firstPasswordTry = false; >+ return; >+ } >+ } >+#endif >+ >+ if (m_firstPasswordTry && !m_url.password().isNull()) { >+ vncThread.setPassword(m_url.password()); >+ m_firstPasswordTry = false; >+ return; >+ } >+ >+#ifdef QTONLY >+ bool ok; >+ QString password = QInputDialog::getText(this, //krazy:exclude=qclasses >+ tr("Password required"), >+ tr("Please enter the password for the remote desktop:"), >+ QLineEdit::Password, QString(), &ok); >+ m_firstPasswordTry = false; >+ if (ok) >+ vncThread.setPassword(password); >+ else >+ startQuitting(); >+#else >+ KPasswordDialog dialog(this); >+ dialog.setPrompt(m_firstPasswordTry ? i18n("Access to the system requires a password.") >+ : i18n("Authentication failed. Please try again.")); >+ if (dialog.exec() == KPasswordDialog::Accepted) { >+ m_firstPasswordTry = false; >+ vncThread.setPassword(dialog.password()); >+ } else { >+ kDebug(5011) << "password dialog not accepted"; >+ startQuitting(); >+ } >+#endif >+} >+ >+void VncView::outputErrorMessage(const QString &message) >+{ >+ kDebug(5011) << message; >+ >+ if (message == "INTERNAL:APPLE_VNC_COMPATIBILTY") { >+ setCursor(localDotCursor()); >+ m_forceLocalCursor = true; >+ return; >+ } >+ >+ startQuitting(); >+ >+#ifndef QTONLY >+ KMessageBox::error(this, message, i18n("VNC failure")); >+#endif >+ emit errorMessage(i18n("VNC failure"), message); >+} >+ >+#ifndef QTONLY >+HostPreferences* VncView::hostPreferences() >+{ >+ return m_hostPreferences; >+} >+#endif >+ >+void VncView::updateImage(int x, int y, int w, int h) >+{ >+// kDebug(5011) << "got update" << width() << height(); >+ >+ m_x = x; >+ m_y = y; >+ m_w = w; >+ m_h = h; >+ >+ if (m_horizontalFactor != 1.0 || m_verticalFactor != 1.0) { >+ // If the view is scaled, grow the update rectangle to avoid artifacts >+ m_x-=1; >+ m_y-=1; >+ m_w+=2; >+ m_h+=2; >+ } >+ >+ m_frame = vncThread.image(); >+ >+ if (!m_initDone) { >+ setAttribute(Qt::WA_StaticContents); >+ setAttribute(Qt::WA_OpaquePaintEvent); >+ installEventFilter(this); >+ >+ setCursor(((m_dotCursorState == CursorOn) || m_forceLocalCursor) ? localDotCursor() : Qt::BlankCursor); >+ >+ setMouseTracking(true); // get mouse events even when there is no mousebutton pressed >+ setFocusPolicy(Qt::WheelFocus); >+ setStatus(Connected); >+ emit connected(); >+ >+ if (m_scale) { >+#ifndef QTONLY >+ kDebug(5011) << "Setting initial size w:" <<m_hostPreferences->width() << " h:" << m_hostPreferences->height(); >+ emit framebufferSizeChanged(m_hostPreferences->width(), m_hostPreferences->height()); >+ scaleResize(m_hostPreferences->width(), m_hostPreferences->height()); >+ kDebug() << "m_frame.size():" << m_frame.size() << "size()" << size(); >+#else >+//TODO: qtonly alternative >+#endif >+ } >+ >+ m_initDone = true; >+ >+#ifndef QTONLY >+ if (m_hostPreferences->walletSupport()) { >+ saveWalletPassword(vncThread.password()); >+ } >+#endif >+ } >+ >+ if ((y == 0 && x == 0) && (m_frame.size() != size())) { >+ kDebug(5011) << "Updating framebuffer size"; >+ if (m_scale) { >+ setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); >+ if (parentWidget()) >+ scaleResize(parentWidget()->width(), parentWidget()->height()); >+ } else { >+ kDebug(5011) << "Resizing: " << m_frame.width() << m_frame.height(); >+ resize(m_frame.width(), m_frame.height()); >+ setMaximumSize(m_frame.width(), m_frame.height()); //This is a hack to force Qt to center the view in the scroll area >+ setMinimumSize(m_frame.width(), m_frame.height()); >+ emit framebufferSizeChanged(m_frame.width(), m_frame.height()); >+ } >+ } >+ >+ m_repaint = true; >+ repaint(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor)); >+ m_repaint = false; >+} >+ >+void VncView::setViewOnly(bool viewOnly) >+{ >+ RemoteView::setViewOnly(viewOnly); >+ >+ m_dontSendClipboard = viewOnly; >+ >+ if (viewOnly) >+ setCursor(Qt::ArrowCursor); >+ else >+ setCursor(m_dotCursorState == CursorOn ? localDotCursor() : Qt::BlankCursor); >+} >+ >+void VncView::showDotCursor(DotCursorState state) >+{ >+ RemoteView::showDotCursor(state); >+ >+ setCursor(state == CursorOn ? localDotCursor() : Qt::BlankCursor); >+} >+ >+void VncView::enableScaling(bool scale) >+{ >+ RemoteView::enableScaling(scale); >+ >+ if (scale) { >+ setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); >+ setMinimumSize(1, 1); >+ if (parentWidget()) >+ scaleResize(parentWidget()->width(), parentWidget()->height()); >+ } else { >+ m_verticalFactor = 1.0; >+ m_horizontalFactor = 1.0; >+ >+ setMaximumSize(m_frame.width(), m_frame.height()); //This is a hack to force Qt to center the view in the scroll area >+ setMinimumSize(m_frame.width(), m_frame.height()); >+ resize(m_frame.width(), m_frame.height()); >+ } >+} >+ >+void VncView::setCut(const QString &text) >+{ >+ m_dontSendClipboard = true; >+ m_clipboard->setText(text, QClipboard::Clipboard); >+ m_dontSendClipboard = false; >+} >+ >+void VncView::paintEvent(QPaintEvent *event) >+{ >+// kDebug(5011) << "paint event: x: " << m_x << ", y: " << m_y << ", w: " << m_w << ", h: " << m_h; >+ if (m_frame.isNull() || m_frame.format() == QImage::Format_Invalid) { >+ kDebug(5011) << "no valid image to paint"; >+ RemoteView::paintEvent(event); >+ return; >+ } >+ >+ event->accept(); >+ >+ QPainter painter(this); >+ >+ if (m_repaint) { >+// kDebug(5011) << "normal repaint"; >+ painter.drawImage(QRect(qRound(m_x*m_horizontalFactor), qRound(m_y*m_verticalFactor), >+ qRound(m_w*m_horizontalFactor), qRound(m_h*m_verticalFactor)), >+ m_frame.copy(m_x, m_y, m_w, m_h).scaled(qRound(m_w*m_horizontalFactor), >+ qRound(m_h*m_verticalFactor), >+ Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); >+ } else { >+// kDebug(5011) << "resize repaint"; >+ QRect rect = event->rect(); >+ if (rect.width() != width() || rect.height() != height()) { >+// kDebug(5011) << "Partial repaint"; >+ const int sx = rect.x()/m_horizontalFactor; >+ const int sy = rect.y()/m_verticalFactor; >+ const int sw = rect.width()/m_horizontalFactor; >+ const int sh = rect.height()/m_verticalFactor; >+ painter.drawImage(rect, >+ m_frame.copy(sx, sy, sw, sh).scaled(rect.width(), rect.height(), >+ Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); >+ } else { >+// kDebug(5011) << "Full repaint" << width() << height() << m_frame.width() << m_frame.height(); >+ painter.drawImage(QRect(0, 0, width(), height()), >+ m_frame.scaled(m_frame.width() * m_horizontalFactor, m_frame.height() * m_verticalFactor, >+ Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); >+ } >+ } >+ >+ RemoteView::paintEvent(event); >+} >+ >+void VncView::resizeEvent(QResizeEvent *event) >+{ >+ RemoteView::resizeEvent(event); >+ update(); >+} >+ >+bool VncView::event(QEvent *event) >+{ >+ switch (event->type()) { >+ case QEvent::KeyPress: >+ case QEvent::KeyRelease: >+// kDebug(5011) << "keyEvent"; >+ keyEventHandler(static_cast<QKeyEvent*>(event)); >+ return true; >+ break; >+ case QEvent::MouseButtonDblClick: >+ case QEvent::MouseButtonPress: >+ case QEvent::MouseButtonRelease: >+ case QEvent::MouseMove: >+// kDebug(5011) << "mouseEvent"; >+ mouseEventHandler(static_cast<QMouseEvent*>(event)); >+ return true; >+ break; >+ case QEvent::Wheel: >+// kDebug(5011) << "wheelEvent"; >+ wheelEventHandler(static_cast<QWheelEvent*>(event)); >+ return true; >+ break; >+ default: >+ return RemoteView::event(event); >+ } >+} >+ >+void VncView::mouseEventHandler(QMouseEvent *e) >+{ >+ if (e->type() != QEvent::MouseMove) { >+ if ((e->type() == QEvent::MouseButtonPress) || >+ (e->type() == QEvent::MouseButtonDblClick)) { >+ if (e->button() & Qt::LeftButton) >+ m_buttonMask |= 0x01; >+ if (e->button() & Qt::MidButton) >+ m_buttonMask |= 0x02; >+ if (e->button() & Qt::RightButton) >+ m_buttonMask |= 0x04; >+ } else if (e->type() == QEvent::MouseButtonRelease) { >+ if (e->button() & Qt::LeftButton) >+ m_buttonMask &= 0xfe; >+ if (e->button() & Qt::MidButton) >+ m_buttonMask &= 0xfd; >+ if (e->button() & Qt::RightButton) >+ m_buttonMask &= 0xfb; >+ } >+ } >+ >+ vncThread.mouseEvent(qRound(e->x() / m_horizontalFactor), qRound(e->y() / m_verticalFactor), m_buttonMask); >+} >+ >+void VncView::wheelEventHandler(QWheelEvent *event) >+{ >+ int eb = 0; >+ if (event->delta() < 0) >+ eb |= 0x10; >+ else >+ eb |= 0x8; >+ >+ const int x = qRound(event->x() / m_horizontalFactor); >+ const int y = qRound(event->y() / m_verticalFactor); >+ >+ vncThread.mouseEvent(x, y, eb | m_buttonMask); >+ vncThread.mouseEvent(x, y, m_buttonMask); >+} >+ >+void VncView::keyEventHandler(QKeyEvent *e) >+{ >+ // strip away autorepeating KeyRelease; see bug #206598 >+ if (e->isAutoRepeat() && (e->type() == QEvent::KeyRelease)) >+ return; >+ >+// parts of this code are based on http://italc.sourcearchive.com/documentation/1.0.9.1/vncview_8cpp-source.html >+ rfbKeySym k = e->nativeVirtualKey(); >+ >+ // we do not handle Key_Backtab separately as the Shift-modifier >+ // is already enabled >+ if (e->key() == Qt::Key_Backtab) { >+ k = XK_Tab; >+ } >+ >+ const bool pressed = (e->type() == QEvent::KeyPress); >+ >+ // handle modifiers >+ if (k == XK_Shift_L || k == XK_Control_L || k == XK_Meta_L || k == XK_Alt_L) { >+ if (pressed) { >+ m_mods[k] = true; >+ } else if (m_mods.contains(k)) { >+ m_mods.remove(k); >+ } else { >+ unpressModifiers(); >+ } >+ } >+ >+ if (k) { >+ vncThread.keyEvent(k, pressed); >+ } >+} >+ >+void VncView::unpressModifiers() >+{ >+ const QList<unsigned int> keys = m_mods.keys(); >+ QList<unsigned int>::const_iterator it = keys.constBegin(); >+ while (it != keys.end()) { >+ vncThread.keyEvent(*it, false); >+ it++; >+ } >+ m_mods.clear(); >+} >+ >+void VncView::clipboardDataChanged() >+{ >+ kDebug(5011); >+ >+ if (m_status != Connected) >+ return; >+ >+ if (m_clipboard->ownsClipboard() || m_dontSendClipboard) >+ return; >+ >+ const QString text = m_clipboard->text(QClipboard::Clipboard); >+ >+ vncThread.clientCut(text); >+} >+ >+#include "moc_vncview.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncviewfactory.cpp kdenetwork-4.9.1/krdc.org/vnc/vncviewfactory.cpp >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncviewfactory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncviewfactory.cpp 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,78 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 "vncviewfactory.h" >+ >+#include <KDebug> >+ >+KRDC_PLUGIN_EXPORT(VncViewFactory) >+ >+VncViewFactory::VncViewFactory(QObject *parent, const QVariantList &args) >+ : RemoteViewFactory(parent) >+{ >+ Q_UNUSED(args); >+ >+ KGlobal::locale()->insertCatalog("krdc"); >+} >+ >+VncViewFactory::~VncViewFactory() >+{ >+} >+ >+bool VncViewFactory::supportsUrl(const KUrl &url) const >+{ >+ return (url.scheme().compare("vnc", Qt::CaseInsensitive) == 0); >+} >+ >+RemoteView *VncViewFactory::createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup) >+{ >+ return new VncView(parent, url, configGroup); >+} >+ >+HostPreferences *VncViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) >+{ >+ return new VncHostPreferences(configGroup, parent); >+} >+ >+QString VncViewFactory::scheme() const >+{ >+ return "vnc"; >+} >+ >+QString VncViewFactory::connectActionText() const >+{ >+ return i18n("New VNC Connection..."); >+} >+ >+QString VncViewFactory::connectButtonText() const >+{ >+ return i18n("Connect to a VNC Remote Desktop"); >+} >+ >+QString VncViewFactory::connectToolTipText() const >+{ >+ return i18n("<html>Enter the address here.<br />" >+ "<i>Example: vncserver:1 (host:port / screen)</i></html>"); >+} >+ >+#include "moc_vncviewfactory.cpp" >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncviewfactory.h kdenetwork-4.9.1/krdc.org/vnc/vncviewfactory.h >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncviewfactory.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncviewfactory.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,56 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 VNCVIEWFACTORY_H >+#define VNCVIEWFACTORY_H >+ >+#include "remoteviewfactory.h" >+ >+#include "vncview.h" >+#include "vncpreferences.h" >+ >+class VncViewFactory : public RemoteViewFactory >+{ >+ Q_OBJECT >+ >+public: >+ explicit VncViewFactory(QObject *parent, const QVariantList &args); >+ >+ virtual ~VncViewFactory(); >+ >+ virtual bool supportsUrl(const KUrl &url) const; >+ >+ virtual RemoteView *createView(QWidget *parent, const KUrl &url, KConfigGroup configGroup); >+ >+ virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent); >+ >+ virtual QString scheme() const; >+ >+ virtual QString connectActionText() const; >+ >+ virtual QString connectButtonText() const; >+ >+ virtual QString connectToolTipText() const; >+}; >+ >+#endif // VNCVIEWFACTORY_H >diff -urN kdenetwork-4.9.1.org/krdc.org/vnc/vncview.h kdenetwork-4.9.1/krdc.org/vnc/vncview.h >--- kdenetwork-4.9.1.org/krdc.org/vnc/vncview.h 1970-01-01 01:00:00.000000000 +0100 >+++ kdenetwork-4.9.1/krdc.org/vnc/vncview.h 2012-08-13 02:08:56.000000000 +0200 >@@ -0,0 +1,110 @@ >+/**************************************************************************** >+** >+** Copyright (C) 2007-2012 Urs Wolfer <uwolfer @ kde.org> >+** >+** 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 VNCVIEW_H >+#define VNCVIEW_H >+ >+#include "remoteview.h" >+#include "vncclientthread.h" >+ >+#ifdef QTONLY >+ class KConfigGroup{}; >+#else >+ #include "vnchostpreferences.h" >+#endif >+ >+#include <QClipboard> >+ >+extern "C" { >+#include <rfb/rfbclient.h> >+} >+ >+class VncView: public RemoteView >+{ >+ Q_OBJECT >+ >+public: >+ explicit VncView(QWidget *parent = 0, const KUrl &url = KUrl(), KConfigGroup configGroup = KConfigGroup()); >+ ~VncView(); >+ >+ QSize framebufferSize(); >+ QSize sizeHint() const; >+ QSize minimumSizeHint() const; >+ void startQuitting(); >+ bool isQuitting(); >+ bool start(); >+ bool supportsScaling() const; >+ bool supportsLocalCursor() const; >+ >+#ifndef QTONLY >+ HostPreferences* hostPreferences(); >+#endif >+ >+ void setViewOnly(bool viewOnly); >+ void showDotCursor(DotCursorState state); >+ void enableScaling(bool scale); >+ >+ virtual void updateConfiguration(); >+ >+public slots: >+ void scaleResize(int w, int h); >+ >+protected: >+ void paintEvent(QPaintEvent *event); >+ bool event(QEvent *event); >+ void resizeEvent(QResizeEvent *event); >+ bool eventFilter(QObject *obj, QEvent *event); >+ >+private: >+ VncClientThread vncThread; >+ QClipboard *m_clipboard; >+ bool m_initDone; >+ int m_buttonMask; >+ QMap<unsigned int, bool> m_mods; >+ int m_x, m_y, m_w, m_h; >+ bool m_repaint; >+ bool m_quitFlag; >+ bool m_firstPasswordTry; >+ bool m_dontSendClipboard; >+ qreal m_horizontalFactor; >+ qreal m_verticalFactor; >+#ifndef QTONLY >+ VncHostPreferences *m_hostPreferences; >+#endif >+ QImage m_frame; >+ bool m_forceLocalCursor; >+ >+ void keyEventHandler(QKeyEvent *e); >+ void unpressModifiers(); >+ void wheelEventHandler(QWheelEvent *event); >+ void mouseEventHandler(QMouseEvent *event); >+ >+private slots: >+ void updateImage(int x, int y, int w, int h); >+ void setCut(const QString &text); >+ void requestPassword(); >+ void outputErrorMessage(const QString &message); >+ void clipboardDataChanged(); >+}; >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 364739
: 324400 |
324402