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>
27 #include <ktoolinvocation.h>
29 MainDialog::MainDialog( QWidget
*parent
, const char *name
)
32 setObjectName( name
);
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, "m_dialogWidget" );
38 setMainWidget( m_dialogWidget
);
40 setButtonText( Ok
, i18n( "Connect" ) );
41 enableButtonOk( false );
43 connect( m_dialogWidget
, SIGNAL( hostValid( bool ) ),
44 SLOT( enableButtonOk( bool ) ) );
47 void MainDialog::setRemoteHost( const QString
&host
)
49 m_dialogWidget
->setRemoteHost( host
);
52 QString
MainDialog::remoteHost()
54 return m_dialogWidget
->remoteHost();
57 void MainDialog::slotHelp()
59 KToolInvocation::invokeHelp();
62 void MainDialog::slotUser1()
64 PreferencesDialog
p( this );
68 void MainDialog::slotOk()
70 m_dialogWidget
->save();
75 void MainDialog::slotClose()
77 m_dialogWidget
->save();
82 #include "maindialog.moc"