3 * kPPP: A front end for pppd for the KDE project
7 * Copyright (C) 1997 Bernd Johannes Wuebben
8 * wuebben@math.cornell.edu
11 * Copyright (C) 1997 Jay Painter
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this program; if not, write to the Free
25 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include "scriptedit.h"
30 #include <qcombobox.h>
31 #include <qlineedit.h>
33 #include <QHBoxLayout>
35 ScriptEdit::ScriptEdit( QWidget
*parent
)
38 QHBoxLayout
*tl
= new QHBoxLayout(this);
42 st
= new QComboBox(this);
43 st
->setObjectName("st");
44 st
->addItem("Expect");
46 st
->addItem("Pause (sec)");
47 st
->addItem("Hangup");
48 st
->addItem("Answer");
49 st
->addItem("Timeout (sec)");
50 st
->addItem("Password");
52 st
->addItem("Prompt");
53 st
->addItem("PWPrompt");
54 st
->addItem("LoopStart");
55 st
->addItem("LoopEnd");
58 st
->addItem("SendNoEcho");
59 connect(st
, SIGNAL(activated(int)), SLOT(setType(int)));
61 se
= new QLineEdit(this);
62 se
->setObjectName("se"); // oh yes, signor :-)
63 se
->setGeometry(120, 5, 140, 25);
65 connect(se
, SIGNAL(returnPressed()), SLOT(seReturnPressed()));
76 void ScriptEdit::setEnabled(bool b
) {
81 void ScriptEdit::seReturnPressed() {
86 QString
ScriptEdit::text()const {
90 void ScriptEdit::setText(const QString
&t
) {
95 int ScriptEdit::type()const {
96 return st
->currentIndex();
99 void ScriptEdit::setType(int i
) {
103 se
->setEnabled(true);
108 se
->setEnabled(true);
113 se
->setEnabled(true);
118 se
->setEnabled(false);
123 se
->setEnabled(false);
128 se
->setEnabled(true);
133 se
->setEnabled(true);
138 se
->setEnabled(true);
143 se
->setEnabled(true);
148 se
->setEnabled(true);
153 se
->setEnabled(true);
158 se
->setEnabled(true);
163 se
->setEnabled(true);
167 se
->setText("password");
168 se
->setEnabled(false);
175 #include "scriptedit.moc"