1 /* This file is part of the KDE project
2 Copyright (C) 2004 Nadeem Hasan <nhasan@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #include "invitedialog.h"
22 #include <kiconloader.h>
24 #include <KStandardGuiItem>
26 #include <QtGui/QLabel>
27 #include <QtGui/QPushButton>
28 #include <QtGui/QToolTip>
29 #include <QtGui/QCursor>
31 InviteDialog::InviteDialog( QWidget
*parent
)
34 setCaption(i18n("Invitation"));
35 setButtons(User1
|Close
|Help
);
36 setDefaultButton(NoDefault
);
39 setMinimumSize(500, 300);
41 m_inviteWidget
= new QWidget( this );
42 setupUi(m_inviteWidget
);
44 pixmapLabel
->setPixmap(KIcon("krfb").pixmap(128));
45 setMainWidget( m_inviteWidget
);
47 setButtonGuiItem( User1
, KStandardGuiItem::configure() );
49 connect( btnCreateInvite
, SIGNAL( clicked() ),
50 SIGNAL( createInviteClicked() ) );
51 connect( btnEmailInvite
, SIGNAL( clicked() ),
52 SIGNAL( emailInviteClicked() ) );
53 connect( btnManageInvite
, SIGNAL( clicked() ),
54 SIGNAL( manageInviteClicked() ) );
55 connect( helpLabel
, SIGNAL( linkActivated ( QString
) ),
56 SLOT( showWhatsthis() ));
59 void InviteDialog::slotUser1()
61 emit
configureClicked();
64 void InviteDialog::enableInviteButton( bool enable
)
66 btnCreateInvite
->setEnabled( enable
);
69 void InviteDialog::setInviteCount( int count
)
71 btnManageInvite
->setText(
72 i18n( "&Manage Invitations (%1)...", count
) );
75 void InviteDialog::showWhatsthis()
77 QToolTip::showText(QCursor::pos(),
78 i18n("An invitation creates a one-time password that allows the receiver to connect to your desktop.\n"
79 "It is valid for only one successful connection and will expire after an hour if it has not been used. \n"
80 "When somebody connects to your computer a dialog will appear and ask you for permission.\n "
81 "The connection will not be established before you accept it. In this dialog you can also\n restrict "
82 "the other person to view your desktop only, without the ability to move your\n mouse pointer or press "
83 "keys.\nIf you want to create a permanent password for Desktop Sharing, allow 'Uninvited Connections' \n"
84 "in the configuration."));
87 #include "invitedialog.moc"