mirror of
https://github.com/KDE/krfb
synced 2026-07-01 23:41:18 -07:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32b69cb2f3 | ||
|
|
5cd069d45e | ||
|
|
da6f1d35a0 | ||
|
|
a5e58a8a83 | ||
|
|
3428e62959 | ||
|
|
2d778f6b18 | ||
|
|
66b4e8520a | ||
|
|
e237d18812 | ||
|
|
530098eba3 | ||
|
|
39bca53c76 | ||
|
|
c476ef5e3e | ||
|
|
142935f3dc |
@@ -11,13 +11,9 @@ if(NOT INSIDE_KDENETWORK)
|
||||
include(MacroLibrary)
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT)
|
||||
message(WARNING "You enabled experimental Tubes support. Expect breakage!!")
|
||||
|
||||
macro_optional_find_package(TelepathyQt4)
|
||||
macro_log_feature(TELEPATHY_QT4_FOUND "telepathy-qt4" "Telepathy Qt Bindings" "http://telepathy.freedesktop.org" FALSE "0.18" "Needed to build Telepathy Tubes support.")
|
||||
endif (BUILD_EXPERIMENTAL_TUBES_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.")
|
||||
|
||||
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE_PLATFORM_DEFINITIONS})
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# Try to find the Qt4 binding of the Telepathy library
|
||||
# TELEPATHY_QT4_FOUND - system has TelepathyQt4
|
||||
# TELEPATHY_QT4_INCLUDE_DIR - the TelepathyQt4 include directory
|
||||
# TELEPATHY_QT4_LIBRARIES - Link these to use TelepathyQt4
|
||||
|
||||
# Copyright (c) 2008, Allen Winter <winter@kde.org>
|
||||
# Copyright (c) 2009, Andre Moreira Magalhaes <andrunko@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
set(TELEPATHY_QT4_FIND_REQUIRED ${TelepathyQt4_FIND_REQUIRED})
|
||||
if(TELEPATHY_QT4_INCLUDE_DIR AND TELEPATHY_QT4_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
set(TELEPATHY_QT4_FIND_QUIETLY TRUE)
|
||||
endif(TELEPATHY_QT4_INCLUDE_DIR AND TELEPATHY_QT4_LIBRARIES)
|
||||
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_TELEPATHY_QT4 QUIET TelepathyQt4>=0.1.8)
|
||||
endif(PKG_CONFIG_FOUND)
|
||||
|
||||
find_path(TELEPATHY_QT4_INCLUDE_DIR
|
||||
NAMES TelepathyQt4/Types
|
||||
HINTS
|
||||
${PC_TELEPATHY_QT4_INCLUDEDIR}
|
||||
${PC_TELEPATHY_QT4_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(TELEPATHY_QT4_LIBRARIES
|
||||
NAMES telepathy-qt4
|
||||
HINTS
|
||||
${PC_TELEPATHY_QT4_LIBDIR}
|
||||
${PC_TELEPATHY_QT4_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(TELEPATHY_QT4 DEFAULT_MSG
|
||||
TELEPATHY_QT4_LIBRARIES TELEPATHY_QT4_INCLUDE_DIR)
|
||||
@@ -8,6 +8,7 @@ Comment[ca@valencia]=«Framebuffer» basat en Qt per al KRfb.
|
||||
Comment[cs]=Framebuffer založený na Qt pro KRfb.
|
||||
Comment[da]=Qt-baseret framebuffer til KRfb.
|
||||
Comment[de]=Qt-basierter Framebuffer für KRfb
|
||||
Comment[el]=Μνήμη εξόδου βίντεο καρέ με βάση το Qt για το KRfb.
|
||||
Comment[en_GB]=Qt based Framebuffer for KRfb.
|
||||
Comment[es]=Memoria intermedia de vídeo basada en Qt para KRfb.
|
||||
Comment[et]=KRfb Qt põhine kaadripuhver
|
||||
@@ -17,6 +18,7 @@ Comment[fr]=Sortie vidéo fondée sur Qt pour KRfb.
|
||||
Comment[ga]=Maolán fráma le haghaidh KRfb, bunaithe ar Qt.
|
||||
Comment[gl]=Framebuffer baseado en Qt para KRfb.
|
||||
Comment[hr]=Međuspremnik okvira baziran na Qt-u za KRfb.
|
||||
Comment[hu]=Qt-alapú framebuffer a Krfb-hez.
|
||||
Comment[ia]=Framebuffer basate sur Qt per KRfb
|
||||
Comment[it]=Framebuffer basato su Qt per KRfb.
|
||||
Comment[kk]=Qt негіздеген KRfb-нің кадр буфері.
|
||||
@@ -28,6 +30,7 @@ Comment[nb]=Qt-basert rammebuffer for KRfb.
|
||||
Comment[nds]=Op Qt opbuut Bildpuffer för KRfb
|
||||
Comment[nl]=Op Qt gebaseerd framebuffer voor KRfb.
|
||||
Comment[nn]=Qt basert framebuffer for KRfb.
|
||||
Comment[pl]=Bufor ramki na podstawie Qt dla KRfb.
|
||||
Comment[pt]='Framebuffer' baseado no Qt para o KRfb.
|
||||
Comment[pt_BR]=Framebuffer baseado no Qt para o KRfb.
|
||||
Comment[si]=KRfb සඳහා Qt මත පදනම් වූ රාමු බෆරය
|
||||
@@ -51,6 +54,7 @@ Name[ca@valencia]=«Framebuffer» Qt per al KRfb.
|
||||
Name[cs]=Qt Framebuffer pro KRfb
|
||||
Name[da]=Qt-framebuffer til KRfb
|
||||
Name[de]=Qt-Framebuffer für KRfb
|
||||
Name[el]=Qt Framebuffer for KRfb
|
||||
Name[en_GB]=Qt Framebuffer for KRfb
|
||||
Name[es]=Memoria intermedia de vídeo Qt para KRfb
|
||||
Name[et]=KRfb Qt kaadripuhver
|
||||
@@ -60,6 +64,7 @@ Name[fr]=Sortie vidéo Qt pour KRfb
|
||||
Name[ga]=Maolán fráma Qt le haghaidh KRfb
|
||||
Name[gl]=Framebuffer de Qt para KRfb
|
||||
Name[hr]=Qt Framebuffer za KRfb
|
||||
Name[hu]=Qt framebuffer a Krfb-hez
|
||||
Name[ia]=Framebuffer Qt per KRfb
|
||||
Name[it]=Framebuffer Qt per KRfb
|
||||
Name[kk]=Qt KRfb кадр буфері
|
||||
@@ -71,6 +76,7 @@ Name[nb]=Qt rammebuffer for KRfb
|
||||
Name[nds]=Qt-Bildpuffer för KRfb
|
||||
Name[nl]=Qt-framebuffer voor KRfb
|
||||
Name[nn]=Qt-framebuffer for KRfb
|
||||
Name[pl]=Bufor ramki Qt dla KRfb
|
||||
Name[pt]='Framebuffer' do Qt para o KRfb
|
||||
Name[pt_BR]=Framebuffer do Qt para o KRfb
|
||||
Name[si]=KRfb සඳහා වන Qt රාමුබෆරය
|
||||
|
||||
@@ -8,6 +8,7 @@ Comment[ca@valencia]=«Framebuffer» basat en XDamage/XShmQt de l'X11 per al KRf
|
||||
Comment[cs]=Framebuffer založený na X11 XDamage/XShm pro KRfb.
|
||||
Comment[da]=X11 XDamage/XShm-baseret framebuffer til KRfb.
|
||||
Comment[de]=X11 XDamage/XShm-basierter Framebuffer für KRfb.
|
||||
Comment[el]=Μνήμη εξόδου βίντεο καρέ με βάση το X11 XDamage/XShm για το KRfb.
|
||||
Comment[en_GB]=X11 XDamage/XShm based Framebuffer for KRfb.
|
||||
Comment[es]=Memoria intermedia de vídeo basada en X11 Damage/XShm para KRfb.
|
||||
Comment[et]=KRfb X11 XDamage/XShm põhine kaadripuhver
|
||||
@@ -17,6 +18,7 @@ Comment[fr]=Sortie vidéo fondée sur X11 XDamage / XShm pour KRfb.
|
||||
Comment[ga]=Maolán fráma le haghaidh KRfb, bunaithe ar X11 XDamage/XShm
|
||||
Comment[gl]=Framebuffer baseado en Xll XDamage/Xshm para XRfb.
|
||||
Comment[hr]=Međuspreminik okvira baziran na X11 XDamage/XShm za KRfb.
|
||||
Comment[hu]=X11 XDamage/XShm-alapú framebuffer a Krfb-hez.
|
||||
Comment[ia]=Framebuffer basate sur X11 XDamage/XShm per KRfb.
|
||||
Comment[it]=Framebuffer basato su XDamage/XShm di X11 per KRfb.
|
||||
Comment[kk]=X11 XDamage/XShm негіздеген KRfb кадр буфері.
|
||||
@@ -28,6 +30,7 @@ Comment[nb]=Rammebuffer for KRfb basert på X11 XDamage/XShm.
|
||||
Comment[nds]=Op X11-XDamage/-XShm opbuut Bildpuffer för KRfb
|
||||
Comment[nl]=Op X11 XDamage/XShm gebaseerd framebuffer voor KRfb.
|
||||
Comment[nn]=X11 XDamage/XShm basert framebuffer for KRfb.
|
||||
Comment[pl]=Bufor ramki na podstawie X11 XDamage/XShm dla KRfb.
|
||||
Comment[pt]='Framebuffer' baseado no XDamage/XShm do X11 para o KRfb.
|
||||
Comment[pt_BR]=Framebuffer baseado no XDamage/XShm do X11 para o KRfb.
|
||||
Comment[si]=KRfb සඳහා වන රාමු බෆරය මත පදනම් වූ X11 XDamage/XShm.
|
||||
@@ -51,6 +54,7 @@ Name[ca@valencia]=«Framebuffer» de l'X11 per al KRfb.
|
||||
Name[cs]=X11 Framebuffer pro KRfb
|
||||
Name[da]=X11-framebuffer til KRfb
|
||||
Name[de]=X11-Framebuffer für KRfb
|
||||
Name[el]=X11 Framebuffer for KRfb
|
||||
Name[en_GB]=X11 Framebuffer for KRfb
|
||||
Name[es]=Memoria intermedia de vídeo X11 para KRfb
|
||||
Name[et]=KRfb X11 kaadripuhver
|
||||
@@ -60,6 +64,7 @@ Name[fr]=Sortie vidéo X11 pour KRfb
|
||||
Name[ga]=Maolán fráma X11 le haghaidh KRfb
|
||||
Name[gl]=Framebuffer de X11 para KRfb
|
||||
Name[hr]=Međuspremnik okvira X11 za KRfb
|
||||
Name[hu]=X11 framebuffer a Krfb-hez
|
||||
Name[ia]=Framebuffer X11 per KRfb
|
||||
Name[it]=Framebuffer X11 per KRfb
|
||||
Name[kk]=X11 KRfb кадр буфері
|
||||
@@ -71,6 +76,7 @@ Name[nb]=X11 rammebuffer for KRfb
|
||||
Name[nds]=X11-Bildpuffer för KRfb
|
||||
Name[nl]=X11 framebuffer voor KRfb
|
||||
Name[nn]=X11-framebuffer for KRfb
|
||||
Name[pl]=Bufor ramki X11 dla KRfb
|
||||
Name[pt]='Framebuffer' do X11 para o KRfb
|
||||
Name[pt_BR]=Framebuffer do X11 para o KRfb
|
||||
Name[si]=KRfb සඳහා X11 රාමු බෆරය
|
||||
|
||||
@@ -160,17 +160,35 @@ Comment[zh_HK]=設定桌面分享
|
||||
Comment[zh_TW]=設定桌面分享
|
||||
X-KDE-Keywords=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited
|
||||
X-KDE-Keywords[ca]=compartició d'escriptori,krfb,vnc,compartició,krdc,connexió d'escriptori remot,invitació,port,slp,no invitat
|
||||
X-KDE-Keywords[ca@valencia]=compartició d'escriptori,krfb,vnc,compartició,krdc,connexió d'escriptori remot,invitació,port,slp,no invitat
|
||||
X-KDE-Keywords[da]=skrivebordsdeling,krfb,vnc,deling,krdc,remote desktop,fjernskrivebord,invitation,port,slp,uinviteret
|
||||
X-KDE-Keywords[de]=freigabe der arbeitsfläche,krfb,vnc,freigabe,krdc,fernwartung,einladung,port,slp
|
||||
X-KDE-Keywords[el]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited
|
||||
X-KDE-Keywords[es]=compartición de escritorio,krfb,vnc,compartición,krdc,conexión de escritorio en remoto,invitación,puerto,slp,no invitado
|
||||
X-KDE-Keywords[et]=töölaua jagamine,krfb,vnc,jagamine,rdp,krdc,kaugtöölaua ühendus,rdp,kutse,port,slp,kutsumata
|
||||
X-KDE-Keywords[fr]=partage de bureau,krfb,vnc,partage,krdc,connexion à un bureau distant,invitation,port,slp,non-invité
|
||||
X-KDE-Keywords[hu]=asztalmegosztás,krfb,vnc,megosztás,krdc,távoliasztal-kapcsolat,meghívás,port,slp,meghívatlan
|
||||
X-KDE-Keywords[ia]=compartir de scriptorio,krfb.vnc,compartir,krdc,connexion de scriptorio remote,invitation,porto,slp,non invitate
|
||||
X-KDE-Keywords[it]=condivisione desktop,krfb,vnc,condivisione,krdc,connessione desktop remoto,invito,porta,slp,non invitato
|
||||
X-KDE-Keywords[kk]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited
|
||||
X-KDE-Keywords[km]=ការចែករំលែកផ្ទៃតុ,krfb,vnc,ការចែករំលែក,krdc,ការតភ្ជាប់ផ្ទៃតុពីចម្ងាយ,ការអញ្ជើញ,ច្រក,slp,មិនត្រូវបានអញ្ជើញ
|
||||
X-KDE-Keywords[ko]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,데스크톱,공유,원격 데스크톱,포트
|
||||
X-KDE-Keywords[nb]=skrivebordsdeling,krfb,vnc,deling,krdc,tilkoblng til annet skrivebord,invitasjon,port,slp,ikke invitert
|
||||
X-KDE-Keywords[nds]=Schriefdischfreegaav,krfb,vnc,Freegaav,Verbinnen na feern Schriefdisch,Inladen,Port,Koppelsteed,slp,nich inlaadt
|
||||
X-KDE-Keywords[nl]=delen van bureaublad,krfb,vnc,delen,krdc,verbinding naar bureaublad op afstand,invitatie,poort,slp,ongenodigd
|
||||
X-KDE-Keywords[pl]=współdzielenie pulpitu,krfb,vnc,współdzielenie,krdc,podłączenie zdalnego pulpitu,zaproszenie,port,slp,niezaproszony
|
||||
X-KDE-Keywords[pt]=partilha do ecrã,krfb,vnc,partilha,krdc,ligação ecrã remoto,convite,porto,slp,sem convite
|
||||
X-KDE-Keywords[pt_BR]=compartilhamento da área de trabalho,krfb,vnc,compartilhar,krdc,conexão à área de trabalho remota,convite,porta,desconvidar
|
||||
X-KDE-Keywords[sk]=zdieľanie plochy,krfb,vnc,zdieľanie,krdc,vzdialené pripojenie plochy,pozvanie,port,slp,nepozvaný
|
||||
X-KDE-Keywords[sr]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,дељење површи,КРФБ,ВНЦ,дељење,КРДЦ,удаљена површ,позивница,порт,СЛП,непозван
|
||||
X-KDE-Keywords[sr@ijekavian]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,дељење површи,КРФБ,ВНЦ,дељење,КРДЦ,удаљена површ,позивница,порт,СЛП,непозван
|
||||
X-KDE-Keywords[sr@ijekavianlatin]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,deljenje površi,KRFB,VNC,deljenje,KRDC,udaljena površ,pozivnica,port,SLP,nepozvan
|
||||
X-KDE-Keywords[sr@latin]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,deljenje površi,KRFB,VNC,deljenje,KRDC,udaljena površ,pozivnica,port,SLP,nepozvan
|
||||
X-KDE-Keywords[sv]=dela skrivbord,krfb,vnc,dela,krdc,fjärrskrivbordsanslutning,inbjudan,port,slp,oinbjuden
|
||||
X-KDE-Keywords[tr]=masaüstü paylaşımı,krfb,vnc,paylaşım,krdc,uzak masaüstü bağlantısı,davet,port,slp,davet edilmemiş
|
||||
X-KDE-Keywords[uk]=krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,спільне використання,керування,оприлюднення,віддалене з’єднання,запрошення,порт,небажане
|
||||
X-KDE-Keywords[x-test]=xxdesktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvitedxx
|
||||
X-KDE-Keywords[zh_CN]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,桌面共享,共享,远程桌面,远程桌面连接,邀请,端口,取消邀请
|
||||
X-KDE-Keywords[zh_TW]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited
|
||||
|
||||
Categories=Qt;KDE;X-KDE-settings-network;Settings;
|
||||
|
||||
@@ -54,7 +54,7 @@ Name[ne]=केडीई इन्टरनेट डेइमोन
|
||||
Name[nl]=KDE Internet Daemon
|
||||
Name[nn]=KDE-Internett-teneste
|
||||
Name[pa]=KDE ਇੰਟਰਨੈੱਟ ਡੈਮਨ
|
||||
Name[pl]=Internet/sieć
|
||||
Name[pl]=Demon internetowy dla KDE
|
||||
Name[pt]=Servidor de Internet do KDE
|
||||
Name[pt_BR]=Servidor de Internet do KDE
|
||||
Name[ro]=Demon de Internet KDE
|
||||
@@ -128,7 +128,7 @@ Comment[ne]=एउटा इन्टरनेट डेइमोन जसल
|
||||
Comment[nl]=Een internetdaemon die netwerkdiensten op afroep start
|
||||
Comment[nn]=Internett-teneste som startar nettverkstenester når dei trengst
|
||||
Comment[pa]=ਇੱਕ ਇੰਟਰਨੈੱਟ ਡੈਮਨ, ਜੋ ਕਿ ਲੋੜ ਪੈਣ ਉੱਤੇ ਨੈੱਟਵਰਕ ਸਰਵਿਸਾਂ ਸ਼ੁਰੂ ਕਰਦੀ ਹੈ।
|
||||
Comment[pl]=Uruchamianie usług na żądanie
|
||||
Comment[pl]=Demon internetowy, który uruchamia usługi sieciowe na żądanie
|
||||
Comment[pt]=Um servidor da Internet que inicia os serviços de rede a pedido
|
||||
Comment[pt_BR]=Um servidor Internet que inicia os serviços de rede por demanda
|
||||
Comment[ro]=Un demon de Internet ce pornește serviciile de rețea la cerere
|
||||
|
||||
@@ -41,10 +41,10 @@ install (FILES
|
||||
# Second target: krfb - the app
|
||||
# itself.
|
||||
|
||||
if(BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
add_definitions(-DKRFB_WITH_TELEPATHY_TUBES)
|
||||
include_directories(${TELEPATHY_QT4_INCLUDE_DIR})
|
||||
endif(BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
set (krfb_SRCS
|
||||
connectiondialog.cpp
|
||||
@@ -65,14 +65,13 @@ set (krfb_SRCS
|
||||
invitationsrfbclient.cpp
|
||||
)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
set (krfb_SRCS
|
||||
${krfb_SRCS}
|
||||
tubesrfbserver.cpp
|
||||
tubesrfbclient.cpp
|
||||
tubesclienthandler.cpp
|
||||
)
|
||||
endif (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
kde4_add_kcfg_files (krfb_SRCS
|
||||
krfbconfig.kcfgc
|
||||
@@ -87,9 +86,9 @@ kde4_add_ui_files (krfb_SRCS
|
||||
ui/personalinvitewidget.ui
|
||||
)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
kde4_add_ui_files(krfb_SRCS ui/tubesconnectionwidget.ui)
|
||||
endif(BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
kde4_add_executable (krfb
|
||||
${krfb_SRCS}
|
||||
@@ -107,11 +106,11 @@ target_link_libraries (krfb
|
||||
${KDE4_KDEUI_LIBS}
|
||||
)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
target_link_libraries(krfb
|
||||
${TELEPATHY_QT4_LIBRARIES}
|
||||
)
|
||||
endif (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
if (X11_XTest_FOUND)
|
||||
target_link_libraries (krfb
|
||||
@@ -123,14 +122,14 @@ install (TARGETS krfb
|
||||
${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
configure_file(org.freedesktop.Telepathy.Client.krfb_rfb_handler.service.in
|
||||
org.freedesktop.Telepathy.Client.krfb_rfb_handler.service)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krfb_rfb_handler.service
|
||||
DESTINATION ${DBUS_SERVICES_INSTALL_DIR})
|
||||
|
||||
install(FILES krfb_rfb_handler.client DESTINATION ${CMAKE_INSTALL_PREFIX}/share/telepathy/clients/)
|
||||
endif (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ Comment[ca@valencia]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[cs]=Moduly Frame bufferu pro KRfb
|
||||
Comment[da]=Framebuffer-plugins til KRfb
|
||||
Comment[de]=Framebuffer-Module für KRfb
|
||||
Comment[el]=Πρόσθετα μνήμης εξόδου βίντεο καρέ για το KRfb
|
||||
Comment[en_GB]=Frame Buffer plugins for KRfb
|
||||
Comment[es]=Complementos de memoria intermedia de vídeo para KRfb
|
||||
Comment[et]=KRfb kaadripuhvri plugin
|
||||
@@ -19,6 +20,7 @@ Comment[fr]=Modules de sortie vidéo pour KRfb
|
||||
Comment[ga]=Breiseáin Mhaoláin Fráma le haghaidh KRfb
|
||||
Comment[gl]=Engadido de frame buffer para KRfb
|
||||
Comment[hr]=Priključci za međuspremnike okvira za KRfb
|
||||
Comment[hu]=Framebuffer bővítmények a Krfb-hez
|
||||
Comment[ia]=Plug-ins de Frame Buffer per KRfb
|
||||
Comment[it]=Estensioni del framebuffer per KRfb
|
||||
Comment[ja]=KRfb の フレームバッファプラグイン
|
||||
@@ -32,8 +34,9 @@ Comment[nds]=Bildpuffer-Modulen för KRfb
|
||||
Comment[nl]=Framebuffer-plugins voor KRfb
|
||||
Comment[nn]=Framebuffer-tillegg KRfb
|
||||
Comment[pa]=KRfb ਲਈ ਫਰੇਮ ਬਫ਼ਰ ਪਲੱਗਇਨ
|
||||
Comment[pl]=Wtyczki buforów ramek dla KRfb
|
||||
Comment[pt]='Plugins' de 'framebuffers' para o KRfb
|
||||
Comment[pt_BR]=Plug-ins de framebuffers para o KRfb
|
||||
Comment[pt_BR]=Plugins de framebuffers para o KRfb
|
||||
Comment[ru]=Модуль буфера кадров для KRfb
|
||||
Comment[si]=KRfb සඳහා රාමු බෆර ප්ලගින
|
||||
Comment[sk]=Frame Buffer modul pre KRfb
|
||||
|
||||
@@ -63,6 +63,7 @@ Name[sr@ijekavianlatin]=KRFB
|
||||
Name[sr@latin]=KRFB
|
||||
Name[sv]=Krfb
|
||||
Name[tr]=Krfb
|
||||
Name[ug]=Krfb
|
||||
Name[uk]=Krfb
|
||||
Name[uz]=Krfb
|
||||
Name[uz@cyrillic]=Krfb
|
||||
|
||||
@@ -1058,7 +1058,7 @@ Comment[bg]=Заето. Връзката е отказана.
|
||||
Comment[bn]=ব্যস্ত, সংযোগ অস্বীকার করল
|
||||
Comment[br]=Dalc'het, kevreadenn disteuleret
|
||||
Comment[bs]=Zauzeto, veza je odbijena
|
||||
Comment[ca]=Ocupat, connexió refusada
|
||||
Comment[ca]=Ocupat, connexió rebutjada
|
||||
Comment[ca@valencia]=Ocupat, connexió refusada
|
||||
Comment[cs]=Zaneprázdněn, spojení odmítnuto
|
||||
Comment[cy]=Prysur, gwrthodwyd y cysylltiad
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
#include <QtGui/qwindowdefs.h>
|
||||
|
||||
#ifdef KRFB_WITH_TELEPATHY_TUBES
|
||||
# include "tubesclienthandler.h"
|
||||
# include <TelepathyQt4/ClientRegistrar>
|
||||
# include "tubesrfbserver.h"
|
||||
#endif
|
||||
|
||||
#include <signal.h>
|
||||
@@ -105,9 +104,7 @@ int main(int argc, char *argv[])
|
||||
InvitationsRfbServer::init();
|
||||
|
||||
#ifdef KRFB_WITH_TELEPATHY_TUBES
|
||||
Tp::ClientRegistrarPtr clientRegistrar = Tp::ClientRegistrar::create();
|
||||
clientRegistrar->registerClient(Tp::AbstractClientPtr(new TubesClientHandler),
|
||||
"krfb_rfb_handler");
|
||||
TubesRfbServer::init();
|
||||
#endif
|
||||
|
||||
//init the GUI
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
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 "tubesclienthandler.h"
|
||||
#include "tubesrfbserver.h"
|
||||
|
||||
#include <TelepathyQt4/ChannelClassSpecList>
|
||||
#include <TelepathyQt4/Constants>
|
||||
#include <TelepathyQt4/Debug>
|
||||
|
||||
#include <KDebug>
|
||||
|
||||
using namespace Tp;
|
||||
|
||||
static inline Tp::ChannelClassSpecList channelClassSpecList()
|
||||
{
|
||||
Tp::ChannelClassSpec spec = Tp::ChannelClassSpec();
|
||||
spec.setChannelType(TP_QT4_IFACE_CHANNEL_TYPE_STREAM_TUBE);
|
||||
spec.setTargetHandleType(Tp::HandleTypeContact);
|
||||
spec.setRequested(true);
|
||||
spec.setProperty(QString(TP_QT4_IFACE_CHANNEL_TYPE_STREAM_TUBE) + ".Service", QVariant("rfb"));
|
||||
return Tp::ChannelClassSpecList() << spec;
|
||||
}
|
||||
|
||||
TubesClientHandler::TubesClientHandler()
|
||||
: AbstractClientHandler(channelClassSpecList())
|
||||
{
|
||||
kDebug();
|
||||
|
||||
Tp::enableDebug(false);
|
||||
Tp::enableWarnings(true);
|
||||
|
||||
/* Registering telepathy types */
|
||||
registerTypes();
|
||||
}
|
||||
|
||||
TubesClientHandler::~TubesClientHandler()
|
||||
{
|
||||
kDebug();
|
||||
}
|
||||
|
||||
bool TubesClientHandler::bypassApproval() const
|
||||
{
|
||||
// Don't bypass approval of channels.
|
||||
return false;
|
||||
}
|
||||
|
||||
void TubesClientHandler::handleChannels(const Tp::MethodInvocationContextPtr<> &context,
|
||||
const Tp::AccountPtr &account,
|
||||
const Tp::ConnectionPtr &connection,
|
||||
const QList<Tp::ChannelPtr> &channels,
|
||||
const QList<Tp::ChannelRequestPtr> &requestsSatisfied,
|
||||
const QDateTime &userActionTime,
|
||||
const Tp::AbstractClientHandler::HandlerInfo &handlerInfo)
|
||||
{
|
||||
kDebug();
|
||||
|
||||
Q_UNUSED(account);
|
||||
Q_UNUSED(connection);
|
||||
Q_UNUSED(requestsSatisfied);
|
||||
Q_UNUSED(userActionTime);
|
||||
Q_UNUSED(handlerInfo);
|
||||
|
||||
foreach(const Tp::ChannelPtr &channel, channels) {
|
||||
kDebug() << "Incoming channel: " << channel;
|
||||
|
||||
QVariantMap properties = channel->immutableProperties();
|
||||
|
||||
if (properties[TELEPATHY_INTERFACE_CHANNEL ".ChannelType"] ==
|
||||
TELEPATHY_INTERFACE_CHANNEL_TYPE_STREAM_TUBE) {
|
||||
|
||||
kDebug() << "Channel is a stream tube. Handling: " << channel;
|
||||
new TubesRfbServer(channel);
|
||||
}
|
||||
}
|
||||
context->setFinished();
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
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 KRFB_TUBESCLIENTHANDLER_H
|
||||
#define KRFB_TUBESCLIENTHANDLER_H
|
||||
|
||||
#include <TelepathyQt4/AbstractClientHandler>
|
||||
|
||||
class TubesClientHandler : public Tp::AbstractClientHandler
|
||||
{
|
||||
public:
|
||||
TubesClientHandler();
|
||||
virtual ~TubesClientHandler();
|
||||
|
||||
virtual bool bypassApproval() const;
|
||||
virtual void handleChannels(const Tp::MethodInvocationContextPtr<> &context,
|
||||
const Tp::AccountPtr &account,
|
||||
const Tp::ConnectionPtr &connection,
|
||||
const QList<Tp::ChannelPtr> &channels,
|
||||
const QList<Tp::ChannelRequestPtr> &requestsSatisfied,
|
||||
const QDateTime &userActionTime,
|
||||
const Tp::AbstractClientHandler::HandlerInfo &handlerInfo);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define TUBESRFBCLIENT_H
|
||||
|
||||
#include "rfbclient.h"
|
||||
#include <TelepathyQt4/Contact>
|
||||
#include <TelepathyQt/Contact>
|
||||
|
||||
class TubesRfbClient : public RfbClient
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009-2010 Collabora Ltd. <info@collabora.co.uk>
|
||||
Copyright (C) 2009-2011 Collabora Ltd. <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
|
||||
|
||||
@@ -20,71 +20,89 @@
|
||||
#include "tubesrfbclient.h"
|
||||
#include "sockethelpers.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <KDebug>
|
||||
#include <KMessageBox>
|
||||
#include <KLocale>
|
||||
#include <KRandom>
|
||||
|
||||
#include <TelepathyQt4/Connection>
|
||||
#include <TelepathyQt4/Contact>
|
||||
#include <TelepathyQt4/ContactManager>
|
||||
#include <TelepathyQt4/PendingContacts>
|
||||
#include <TelepathyQt4/PendingOperation>
|
||||
#include <TelepathyQt4/PendingReady>
|
||||
#include <TelepathyQt/Debug>
|
||||
#include <TelepathyQt/Contact>
|
||||
#include <TelepathyQt/AccountFactory>
|
||||
#include <TelepathyQt/ConnectionFactory>
|
||||
#include <TelepathyQt/ContactFactory>
|
||||
#include <TelepathyQt/ChannelFactory>
|
||||
#include <TelepathyQt/OutgoingStreamTubeChannel>
|
||||
#include <TelepathyQt/StreamTubeServer>
|
||||
|
||||
/* workaround for QtDBus bug */
|
||||
struct StreamTubeAddress
|
||||
{
|
||||
QString address;
|
||||
uint port;
|
||||
};
|
||||
Q_DECLARE_METATYPE(StreamTubeAddress);
|
||||
|
||||
//Marshall the StreamTubeAddress data into a D-Bus argument
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const StreamTubeAddress &streamTubeAddress)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument << streamTubeAddress.address << streamTubeAddress.port;
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
// Retrieve the StreamTubeAddress data from the D-Bus argument
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
StreamTubeAddress &streamTubeAddress)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument >> streamTubeAddress.address >> streamTubeAddress.port;
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
//**************
|
||||
|
||||
struct TubesRfbServer::Private
|
||||
{
|
||||
Tp::ChannelPtr channel;
|
||||
QHash<int, Tp::ContactPtr> contactsPerPort;
|
||||
QHash<int, PendingTubesRfbClient*> clientsPerPort;
|
||||
Tp::StreamTubeServerPtr stubeServer;
|
||||
QHash<quint16, Tp::ContactPtr> contactsPerPort;
|
||||
QHash<quint16, PendingTubesRfbClient*> clientsPerPort;
|
||||
};
|
||||
|
||||
TubesRfbServer::TubesRfbServer(const Tp::ChannelPtr & channel, QObject *parent)
|
||||
void TubesRfbServer::init()
|
||||
{
|
||||
new TubesRfbServer();
|
||||
//RfbServerManager takes care of deletion
|
||||
}
|
||||
|
||||
TubesRfbServer::TubesRfbServer(QObject *parent)
|
||||
: RfbServer(parent), d(new Private)
|
||||
{
|
||||
kDebug() << "starting ";
|
||||
kDebug() << "starting";
|
||||
|
||||
/* Registering struct containing the tube address */
|
||||
qDBusRegisterMetaType<StreamTubeAddress>();
|
||||
Tp::enableDebug(true);
|
||||
Tp::enableWarnings(true);
|
||||
Tp::registerTypes();
|
||||
|
||||
d->channel = channel;
|
||||
connect(d->channel->becomeReady(),
|
||||
SIGNAL(finished(Tp::PendingOperation*)),
|
||||
SLOT(onChannelReady(Tp::PendingOperation*)));
|
||||
Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(
|
||||
QDBusConnection::sessionBus(), Tp::Account::FeatureCore);
|
||||
|
||||
setListeningPort(6789);
|
||||
setListeningAddress("127.0.0.1"); // Listen only on the loopback network interface
|
||||
Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create(
|
||||
QDBusConnection::sessionBus(), Tp::Connection::FeatureCore);
|
||||
|
||||
Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(
|
||||
QDBusConnection::sessionBus());
|
||||
|
||||
Tp::ContactFactoryPtr contactFactory = Tp::ContactFactory::create(
|
||||
Tp::Contact::FeatureAlias);
|
||||
|
||||
d->stubeServer = Tp::StreamTubeServer::create(
|
||||
QStringList() << QLatin1String("rfb"),
|
||||
QStringList(),
|
||||
QLatin1String("krfb_rfb_handler"),
|
||||
true,
|
||||
accountFactory,
|
||||
connectionFactory,
|
||||
channelFactory,
|
||||
contactFactory);
|
||||
|
||||
connect(d->stubeServer.data(),
|
||||
SIGNAL(tubeRequested(Tp::AccountPtr,Tp::OutgoingStreamTubeChannelPtr,
|
||||
QDateTime,Tp::ChannelRequestHints)),
|
||||
SLOT(onTubeRequested()));
|
||||
connect(d->stubeServer.data(),
|
||||
SIGNAL(tubeClosed(Tp::AccountPtr,Tp::OutgoingStreamTubeChannelPtr,QString,QString)),
|
||||
SLOT(onTubeClosed()));
|
||||
|
||||
connect(d->stubeServer.data(),
|
||||
SIGNAL(newTcpConnection(QHostAddress,quint16,Tp::AccountPtr,
|
||||
Tp::ContactPtr,Tp::OutgoingStreamTubeChannelPtr)),
|
||||
SLOT(onNewTcpConnection(QHostAddress,quint16,Tp::AccountPtr,
|
||||
Tp::ContactPtr,Tp::OutgoingStreamTubeChannelPtr)));
|
||||
connect(d->stubeServer.data(),
|
||||
SIGNAL(tcpConnectionClosed(QHostAddress,quint16,Tp::AccountPtr,Tp::ContactPtr,
|
||||
QString,QString,Tp::OutgoingStreamTubeChannelPtr)),
|
||||
SLOT(onTcpConnectionClosed(QHostAddress,quint16,Tp::AccountPtr,Tp::ContactPtr,
|
||||
QString,QString,Tp::OutgoingStreamTubeChannelPtr)));
|
||||
|
||||
// Pick a random port in the private range (49152–65535)
|
||||
setListeningPort((KRandom::random() % 16383) + 49152);
|
||||
// Listen only on the loopback network interface
|
||||
setListeningAddress("127.0.0.1");
|
||||
setPasswordRequired(false);
|
||||
|
||||
QTimer::singleShot(0, this, SLOT(startAndCheck()));
|
||||
}
|
||||
|
||||
TubesRfbServer::~TubesRfbServer()
|
||||
@@ -93,12 +111,80 @@ TubesRfbServer::~TubesRfbServer()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void TubesRfbServer::startAndCheck()
|
||||
{
|
||||
if (!start()) {
|
||||
//try a few times with different ports
|
||||
bool ok = false;
|
||||
for (int i=0; !ok && i<5; i++) {
|
||||
setListeningPort((KRandom::random() % 16383) + 49152);
|
||||
ok = start();
|
||||
}
|
||||
|
||||
if (!ok) {
|
||||
kError() << "Failed to start tubes rfb server";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO listeningAddress() should be a QHostAddress
|
||||
d->stubeServer->exportTcpSocket(QHostAddress(QString::fromAscii(listeningAddress())),
|
||||
listeningPort());
|
||||
}
|
||||
|
||||
void TubesRfbServer::onTubeRequested()
|
||||
{
|
||||
kDebug() << "Got a tube";
|
||||
}
|
||||
|
||||
void TubesRfbServer::onTubeClosed()
|
||||
{
|
||||
kDebug() << "tube closed";
|
||||
}
|
||||
|
||||
void TubesRfbServer::onNewTcpConnection(const QHostAddress & sourceAddress,
|
||||
quint16 sourcePort,
|
||||
const Tp::AccountPtr & account,
|
||||
const Tp::ContactPtr & contact,
|
||||
const Tp::OutgoingStreamTubeChannelPtr & tube)
|
||||
{
|
||||
Q_UNUSED(account);
|
||||
Q_UNUSED(tube);
|
||||
|
||||
kDebug() << "CM signaled tube connection from" << sourceAddress << ":" << sourcePort;
|
||||
|
||||
d->contactsPerPort[sourcePort] = contact;
|
||||
if (d->clientsPerPort.contains(sourcePort)) {
|
||||
kDebug() << "client already exists";
|
||||
d->clientsPerPort[sourcePort]->setContact(contact);
|
||||
}
|
||||
}
|
||||
|
||||
void TubesRfbServer::onTcpConnectionClosed(const QHostAddress& sourceAddress,
|
||||
quint16 sourcePort,
|
||||
const Tp::AccountPtr& account,
|
||||
const Tp::ContactPtr& contact,
|
||||
const QString& error,
|
||||
const QString& message,
|
||||
const Tp::OutgoingStreamTubeChannelPtr& tube)
|
||||
{
|
||||
Q_UNUSED(account);
|
||||
Q_UNUSED(contact);
|
||||
Q_UNUSED(tube);
|
||||
|
||||
kDebug() << "Connection from" << sourceAddress << ":" << sourcePort << "closed."
|
||||
<< error << message;
|
||||
|
||||
d->clientsPerPort.remove(sourcePort);
|
||||
d->contactsPerPort.remove(sourcePort);
|
||||
}
|
||||
|
||||
PendingRfbClient* TubesRfbServer::newClient(rfbClientPtr client)
|
||||
{
|
||||
kDebug() << "new tubes client";
|
||||
|
||||
PendingTubesRfbClient *c = new PendingTubesRfbClient(client, this);
|
||||
int port = peerPort(client->sock);
|
||||
quint16 port = peerPort(client->sock);
|
||||
|
||||
kDebug() << "new tube client on port" << port;
|
||||
|
||||
d->clientsPerPort[port] = c;
|
||||
if (d->contactsPerPort.contains(port)) {
|
||||
@@ -109,186 +195,4 @@ PendingRfbClient* TubesRfbServer::newClient(rfbClientPtr client)
|
||||
return c;
|
||||
}
|
||||
|
||||
/************************** TP TUBES CODE ************************************/
|
||||
|
||||
void TubesRfbServer::close()
|
||||
{
|
||||
kDebug();
|
||||
d->channel->requestClose();
|
||||
}
|
||||
|
||||
void TubesRfbServer::cleanup()
|
||||
{
|
||||
kDebug();
|
||||
|
||||
d->clientsPerPort.clear();
|
||||
d->contactsPerPort.clear();
|
||||
|
||||
stop();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void TubesRfbServer::onChannelReady(Tp::PendingOperation *op)
|
||||
{
|
||||
kDebug();
|
||||
|
||||
if (op->isError()) {
|
||||
kWarning() << "Getting channel ready faied:" << op->errorName() << op->errorMessage();
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An error occurred sharing your desktop."),
|
||||
i18n("Error"));
|
||||
cleanup();
|
||||
return;
|
||||
}
|
||||
|
||||
Tp::Contacts contacts = d->channel->groupContacts();
|
||||
|
||||
Tp::ContactManagerPtr contactManager = d->channel->connection()->contactManager();
|
||||
|
||||
if (!contactManager) {
|
||||
kWarning() << "Invalid Contact Manager.";
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An unknown error occurred sharing your desktop."),
|
||||
i18n("Error"));
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
Tp::Features features;
|
||||
features << Tp::Contact::FeatureAlias;
|
||||
|
||||
connect(contactManager->upgradeContacts(contacts.toList(), features),
|
||||
SIGNAL(finished(Tp::PendingOperation*)),
|
||||
SLOT(onContactsUpgraded(Tp::PendingOperation*)));
|
||||
}
|
||||
|
||||
void TubesRfbServer::onContactsUpgraded(Tp::PendingOperation *op)
|
||||
{
|
||||
kDebug();
|
||||
|
||||
if (op->isError()) {
|
||||
kWarning() << "Upgrading contacts failed:" << op->errorName() << op->errorMessage();
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An unknown error occurred sharing your desktop."),
|
||||
i18n("Error"));
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
offerTube();
|
||||
}
|
||||
|
||||
void TubesRfbServer::offerTube()
|
||||
{
|
||||
kDebug() << "Channel is ready!";
|
||||
|
||||
//start the rfb server
|
||||
if (!start()) {
|
||||
kWarning() << "Could not start rfb server";
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("Failed to activate the rfb server."),
|
||||
i18n("Error"));
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
connect(d->channel.data(),
|
||||
SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
|
||||
SLOT(onChannelInvalidated(Tp::DBusProxy*, const QString&,
|
||||
const QString&)));
|
||||
|
||||
/* Interface used to control the tube state */
|
||||
Tp::Client::ChannelInterfaceTubeInterface *tubeInterface = d->channel->interface<Tp::Client::ChannelInterfaceTubeInterface>();
|
||||
|
||||
/* Interface used to control stream tube */
|
||||
Tp::Client::ChannelTypeStreamTubeInterface *streamTubeInterface = d->channel->interface<Tp::Client::ChannelTypeStreamTubeInterface>();
|
||||
|
||||
if (streamTubeInterface && tubeInterface) {
|
||||
kDebug() << "Offering tube";
|
||||
|
||||
connect(tubeInterface,
|
||||
SIGNAL(TubeChannelStateChanged(uint)),
|
||||
SLOT(onTubeStateChanged(uint)));
|
||||
|
||||
// Offer the stream tube
|
||||
StreamTubeAddress streamTubeAddress;
|
||||
streamTubeAddress.address = listeningAddress();
|
||||
streamTubeAddress.port = listeningPort();
|
||||
|
||||
kDebug() << "Offering:" << streamTubeAddress.port << streamTubeAddress.address;
|
||||
|
||||
QDBusVariant address;
|
||||
address.setVariant(qVariantFromValue(streamTubeAddress));
|
||||
|
||||
QDBusPendingReply<> ret = streamTubeInterface->Offer(
|
||||
uint(Tp::SocketAddressTypeIPv4),
|
||||
address,
|
||||
uint(Tp::SocketAccessControlPort),
|
||||
QVariantMap());
|
||||
|
||||
connect(new QDBusPendingCallWatcher(ret, this), SIGNAL(finished(QDBusPendingCallWatcher*)),
|
||||
SLOT(onOfferTubeFinished(QDBusPendingCallWatcher*)));
|
||||
connect(streamTubeInterface,
|
||||
SIGNAL(NewRemoteConnection(uint,QDBusVariant,uint)),
|
||||
SLOT(onNewRemoteConnection(uint,QDBusVariant,uint)));
|
||||
}
|
||||
}
|
||||
|
||||
void TubesRfbServer::onOfferTubeFinished(QDBusPendingCallWatcher *watcher)
|
||||
{
|
||||
QDBusPendingReply<void> reply = *watcher;
|
||||
if (reply.isError()) {
|
||||
kWarning() << "Offer tube failed:" << reply.error();
|
||||
|
||||
if (reply.error().name() == TELEPATHY_ERROR_NOT_AVAILABLE) {
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An error occurred sharing your desktop. The person you are "
|
||||
"trying to share your desktop with does not have the required "
|
||||
"software installed to access it."),
|
||||
i18n("Error"));
|
||||
} else {
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An unknown error occurred sharing your desktop."),
|
||||
i18n("Error"));
|
||||
}
|
||||
} else {
|
||||
kDebug() << "Offer Tube succeeded.";
|
||||
}
|
||||
}
|
||||
|
||||
void TubesRfbServer::onTubeStateChanged(uint state)
|
||||
{
|
||||
kDebug() << "Tube state changed:" << state;
|
||||
}
|
||||
|
||||
void TubesRfbServer::onNewRemoteConnection(uint handle, QDBusVariant connectionParam, uint connectionId)
|
||||
{
|
||||
Q_UNUSED(connectionId);
|
||||
|
||||
QVariant v = connectionParam.variant();
|
||||
kDebug() << "variant:" << v;
|
||||
StreamTubeAddress ipv4address = qdbus_cast<StreamTubeAddress>(v);
|
||||
|
||||
kDebug() << "NewRemoteConnection: port:" << ipv4address.port << ipv4address.address;
|
||||
|
||||
Q_FOREACH(const Tp::ContactPtr & c, d->channel->groupContacts()) {
|
||||
if (c->handle().value(0) == handle) {
|
||||
d->contactsPerPort[ipv4address.port] = c;
|
||||
if (d->clientsPerPort.contains(ipv4address.port)) {
|
||||
kDebug() << "client already exists";
|
||||
d->clientsPerPort[ipv4address.port]->setContact(c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TubesRfbServer::onChannelInvalidated(Tp::DBusProxy *proxy,
|
||||
const QString &errorName, const QString &errorMessage)
|
||||
{
|
||||
Q_UNUSED(proxy);
|
||||
kDebug() << "Tube channel invalidated:" << errorName << errorMessage;
|
||||
cleanup();
|
||||
}
|
||||
|
||||
#include "tubesrfbserver.moc"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009-2010 Collabora Ltd. <info@collabora.co.uk>
|
||||
Copyright (C) 2009-2011 Collabora Ltd. <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
|
||||
|
||||
@@ -20,29 +20,43 @@
|
||||
#define TUBESRFBSERVER_H
|
||||
|
||||
#include "rfbserver.h"
|
||||
#include <TelepathyQt4/Channel>
|
||||
#include <QtNetwork/QHostAddress>
|
||||
#include <TelepathyQt/Types>
|
||||
|
||||
class TubesRfbServer : public RfbServer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TubesRfbServer(const Tp::ChannelPtr & channel, QObject* parent = 0);
|
||||
static void init();
|
||||
|
||||
virtual ~TubesRfbServer();
|
||||
|
||||
protected:
|
||||
TubesRfbServer(QObject *parent = 0);
|
||||
|
||||
virtual PendingRfbClient* newClient(rfbClientPtr client);
|
||||
|
||||
private Q_SLOTS:
|
||||
void close();
|
||||
void cleanup();
|
||||
void onChannelReady(Tp::PendingOperation *op);
|
||||
void onContactsUpgraded(Tp::PendingOperation *op);
|
||||
void offerTube();
|
||||
void onOfferTubeFinished(QDBusPendingCallWatcher *watcher);
|
||||
void onTubeStateChanged(uint state);
|
||||
void onNewRemoteConnection(uint handle, QDBusVariant connectionParam, uint connectionId);
|
||||
void onChannelInvalidated(Tp::DBusProxy *proxy,
|
||||
const QString &errorName,
|
||||
const QString &errorMessage);
|
||||
void startAndCheck();
|
||||
|
||||
void onTubeRequested();
|
||||
void onTubeClosed();
|
||||
|
||||
void onNewTcpConnection(
|
||||
const QHostAddress &sourceAddress,
|
||||
quint16 sourcePort,
|
||||
const Tp::AccountPtr &account,
|
||||
const Tp::ContactPtr &contact,
|
||||
const Tp::OutgoingStreamTubeChannelPtr &tube);
|
||||
|
||||
void onTcpConnectionClosed(
|
||||
const QHostAddress &sourceAddress,
|
||||
quint16 sourcePort,
|
||||
const Tp::AccountPtr &account,
|
||||
const Tp::ContactPtr &contact,
|
||||
const QString &error,
|
||||
const QString &message,
|
||||
const Tp::OutgoingStreamTubeChannelPtr &tube);
|
||||
|
||||
private:
|
||||
struct Private;
|
||||
|
||||
Reference in New Issue
Block a user