not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kcontrol / autostart / addscriptdialog.cpp
blob77efb8a1a47821b8577d0cd154fc32a654f63ac3
1 /***************************************************************************
2 * Copyright (C) 2007 by Stephen Leaf *
3 * smileaf@gmail.com *
4 * Copyright (C) 2008 by Montel Laurent <montel@kde.org> *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
20 ***************************************************************************/
22 #include "addscriptdialog.h"
23 #include <KLineEdit>
24 #include <QCheckBox>
25 #include <QVBoxLayout>
26 #include <klocale.h>
27 #include <KUrlRequester>
28 #include <QLabel>
30 AddScriptDialog::AddScriptDialog (QWidget* parent)
31 : KDialog( parent ) {
32 QWidget *w = new QWidget( this );
33 setButtons( Cancel|Ok );
34 QVBoxLayout *lay= new QVBoxLayout;
35 w->setLayout( lay );
36 QLabel *lab = new QLabel( i18n( "Shell script:" ), w );
37 lay->addWidget( lab );
38 m_url = new KUrlRequester( w );
39 lay->addWidget( m_url );
40 m_symlink = new QCheckBox( i18n( "Create as symlink" ), w ); //TODO fix text
41 m_symlink->setChecked( true );
42 lay->addWidget( m_symlink );
43 connect( m_url->lineEdit(), SIGNAL(textChanged(const QString&)), SLOT(textChanged(const QString&)) );
44 m_url->lineEdit()->setFocus();
45 enableButtonOk(false);
47 setMainWidget( w );
50 AddScriptDialog::~AddScriptDialog()
53 void AddScriptDialog::textChanged(const QString &text) {
54 enableButtonOk(!text.isEmpty());
57 KUrl AddScriptDialog::importUrl() const {
58 return m_url->lineEdit()->text();
61 bool AddScriptDialog::symLink() const {
62 return m_symlink->isChecked();
65 #include "addscriptdialog.moc"