SVN_SILENT
[kdenetwork.git] / krdc / specialkeysdialog.cpp
blobfaf838f26371df21199047079040fbd3f5114628
1 /****************************************************************************
2 **
3 ** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org>
4 **
5 ** This file is part of KDE.
6 **
7 ** This program is free software; you can redistribute it and/or modify
8 ** it under the terms of the GNU General Public License as published by
9 ** the Free Software Foundation; either version 2 of the License, or
10 ** (at your option) any later version.
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ** GNU General Public License for more details.
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; see the file COPYING. If not, write to
19 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 ** Boston, MA 02110-1301, USA.
22 ****************************************************************************/
24 #include "specialkeysdialog.h"
26 #include <KLocale>
28 #include <QKeyEvent>
29 #include <QLabel>
31 SpecialKeysDialog::SpecialKeysDialog(QWidget *parent, RemoteView *remoteView)
32 : KDialog(parent),
33 m_remoteView(remoteView)
35 setCaption(i18n("Special Keys"));
36 setButtons(0);
38 QLabel *descriptionLabel = new QLabel(i18n("Enter a special key or a key combination to sent the the remote desktop."
39 "<br /><br />This function allows you to send a key combination like Ctrl+Q to the remote computer."
40 "<br /><br />When you have finished entering the special keys, close this window."), this);
41 descriptionLabel->setWordWrap(true);
42 descriptionLabel->setTextFormat(Qt::RichText);
44 setMainWidget(descriptionLabel);
45 setFocusPolicy(Qt::StrongFocus);
46 setFocus();
47 grabKeyboard();
50 SpecialKeysDialog::~SpecialKeysDialog()
52 releaseKeyboard();
55 void SpecialKeysDialog::keyPressEvent(QKeyEvent *event)
57 // kDebug(5010) << "key press" << event->key();
59 m_remoteView->keyEvent(event);
61 event->accept();
64 void SpecialKeysDialog::keyReleaseEvent(QKeyEvent *event)
66 // kDebug(5010) << "key release" << event->key();
68 m_remoteView->keyEvent(event);
70 event->accept();
73 #include "specialkeysdialog.moc"