diff options
Diffstat (limited to 'krdc/krdc.cpp')
-rw-r--r-- | krdc/krdc.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/krdc/krdc.cpp b/krdc/krdc.cpp index 1e86891d..0206a37d 100644 --- a/krdc/krdc.cpp +++ b/krdc/krdc.cpp @@ -33,6 +33,7 @@ #include <tdemessagebox.h> #include <twin.h> #include <tdestartupinfo.h> +#include <tqclipboard.h> #include <tqdockarea.h> #include <tqlabel.h> @@ -51,6 +52,7 @@ const int FS_HOSTLABEL_ID = 4; const int FS_ADVANCED_ID = 5; const int FS_ICONIFY_ID = 6; const int FS_CLOSE_ID = 7; +const int FS_PASTE_ID = 8; const int KRDC::TOOLBAR_AUTOHIDE_TIMEOUT = 1000; const int KRDC::TOOLBAR_FPS_1000 = 10000; @@ -373,6 +375,13 @@ void KRDC::enableFullscreen(bool on) m_view->switchFullscreen(on); } +void KRDC::paste() +{ + TQClipboard *cb = TQApplication::clipboard(); + TQString text = cb->text(TQClipboard::Clipboard); + m_view->sendString(text); +} + TQSize KRDC::sizeHint() { if ((m_isFullscreen != WINDOW_MODE_FULLSCREEN) && m_toolbar) { @@ -499,6 +508,14 @@ void KRDC::switchToFullscreen(bool scaling) t->setButton(FS_FULLSCREEN_ID, true); t->addConnection(FS_FULLSCREEN_ID, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(enableFullscreen(bool))); + if(m_view->supportsSendString()) + { + t->insertButton("edit-paste", FS_PASTE_ID); + TDEToolBarButton *pasteButton = t->getButton(FS_PASTE_ID); + TQToolTip::add(pasteButton, i18n("Sends clipboard text to the remote system as key presses")); + t->addConnection(FS_PASTE_ID, TQ_SIGNAL(clicked()), this, TQ_SLOT(paste())); + } + m_popup = createPopupMenu(t); t->insertButton("configure", FS_ADVANCED_ID, m_popup, true, i18n("Advanced options")); TDEToolBarButton *advancedButton = t->getButton(FS_ADVANCED_ID); @@ -621,6 +638,14 @@ void KRDC::switchToNormal(bool scaling) m_popup = 0; } + if(m_view->supportsSendString()) + { + t->insertButton("edit-paste", 4, true, i18n("Paste")); + TDEToolBarButton *pasteButton = t->getButton(4); + TQToolTip::add(pasteButton, i18n("Sends clipboard text to the remote system as key presses")); + t->addConnection(4, TQ_SIGNAL(clicked()), this, TQ_SLOT(paste())); + } + m_popup = createPopupMenu(t); t->insertButton("configure", 3, m_popup, true, i18n("Advanced")); TDEToolBarButton *advancedButton = t->getButton(3); |