Add ICQ feature 122468: Notification if someone reads your away message
[kdenetwork.git] / krdc / maindialog.cpp
blobd18a8100f5feab9ac346daed84b79e0435e716e0
1 /* This file is part of the KDE project
2 Copyright (C) 2003-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 "maindialog.h"
21 #include "maindialogwidget.h"
22 #include "preferencesdialog.h"
24 #include <kapplication.h>
25 #include <kguiitem.h>
26 #include <klocale.h>
27 #include <ktoolinvocation.h>
29 MainDialog::MainDialog( QWidget *parent, const char *name )
30 : KDialog( parent )
32 setObjectName( name );
33 setModal( true );
34 setCaption( i18n( "Remote Desktop Connection" ) );
35 setButtons( Ok | Close | Help | User1 );
36 setButtonGuiItem( User1, KGuiItem( i18n( "&Preferences" ), "configure" ) );
37 m_dialogWidget = new MainDialogWidget( this );
38 m_dialogWidget->setObjectName( "m_dialogWidget" );
39 setMainWidget( m_dialogWidget );
41 setButtonText( Ok, i18n( "Connect" ) );
42 enableButtonOk( false );
44 connect( m_dialogWidget, SIGNAL( hostValid( bool ) ),
45 SLOT( enableButtonOk( bool ) ) );
47 // preferences button....
48 connect( this, SIGNAL( user1Clicked() ),
49 this, SLOT( slotUser1() ) );
51 connect( this, SIGNAL( helpClicked() ),
52 this, SLOT( slotHelp() ) );
55 void MainDialog::setRemoteHost( const QString &host )
57 m_dialogWidget->setRemoteHost( host );
60 QString MainDialog::remoteHost()
62 return m_dialogWidget->remoteHost();
65 void MainDialog::adjustWidgetSize()
67 adjustSize();
70 void MainDialog::slotHelp()
72 KToolInvocation::invokeHelp();
75 void MainDialog::slotUser1()
77 PreferencesDialog p( this );
78 p.exec();
81 void MainDialog::slotOk()
83 m_dialogWidget->save();
85 KDialog::accept();
88 void MainDialog::slotClose()
90 m_dialogWidget->save();
92 KDialog::reject();
95 #include "maindialog.moc"