2 * kPPP: A pppd front end for the KDE project
5 * Copyright (C) 1997 Bernd Wuebben
6 * wuebben@math.cornel.edu
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33 #include <QResizeEvent>
35 extern KPPPWidget
*p_kppp
;
37 myMultiEdit::myMultiEdit(QWidget
*parent
, const char *name
)
38 : Q3MultiLineEdit(parent
, name
)
43 void myMultiEdit::newLine() {
44 Q3MultiLineEdit::newLine();
48 DebugWidget::DebugWidget(QWidget
*parent
)
52 setWindowTitle(i18n("Login Script Debug Window"));
54 text_window
= new myMultiEdit(this,"debugwindow");
55 text_window
->setGeometry(2,5,400, 300);
56 // text_window->setReadOnly(FALSE);
58 statuslabel
= new QLabel(QString(), this );
59 statuslabel
->setObjectName("statuslabel");
61 statuslabel
->setFrameStyle( QFrame::Panel
| QFrame::Sunken
);
62 statuslabel
->setAlignment( Qt::AlignLeft
|Qt::AlignVCenter
);
63 statuslabel
->setGeometry(2, 307, 400, 20);
64 //statusPageLabel->setFont( KGlobalSettings::generalFont() );
66 dismiss
= new QPushButton(this);
67 dismiss
->setGeometry(330,340,70,30);
68 dismiss
->setText(i18n("&Close"));
70 connect(dismiss
, SIGNAL(clicked()), SLOT(hide()));
73 /* fline = new QFrame(this,"line");
74 fline->setFrameStyle(QFrame::HLine |QFrame::Sunken);
75 fline->setGeometry(2,332,398,5);*/
77 setMinimumSize(width(),height());
81 void DebugWidget::hideEvent(QHideEvent
*)
84 p_kppp
->con
->debug
->setChecked(false);
87 void DebugWidget::clear() {
92 void DebugWidget::addChar(unsigned char c
) {
95 if(c
== '\r' || c
== '\n') {
97 text_window
->newLine();
99 text_window
->insert(QString(c
));
103 void DebugWidget::statusLabel(const QString
&s
) {
104 statuslabel
->setText(s
);
109 void DebugWidget::keyPressEvent(QKeyEvent *k) {
113 void DebugWidget::resizeEvent(QResizeEvent
*e
){
118 text_window
->setGeometry(2,5,w
- 2 ,h
- 63);
119 statuslabel
->setGeometry(2, h
- 56 , w
-2 , 20);
120 dismiss
->setGeometry(w
- 72 , h
- 32, 70, 30);
121 // fline->setGeometry(2,h -70 ,w - 4,5);
125 void DebugWidget::enter() {
126 text_window
->append("\r\n");
130 void DebugWidget::toggleVisibility() {
136 bool showlog
= isVisible();
137 gpppdata
.set_show_log_window(showlog
);