1 /***************************************************************************
2 * Copyright (C) 2007 by Stephen Leaf *
4 * Copyright (C) 2008 by Montel Laurent <montel@kde.org> *
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. *
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. *
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"
25 #include <QVBoxLayout>
27 #include <KUrlRequester>
30 AddScriptDialog::AddScriptDialog (QWidget
* parent
)
32 QWidget
*w
= new QWidget( this );
33 setButtons( Cancel
|Ok
);
34 QVBoxLayout
*lay
= new QVBoxLayout
;
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);
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"