author | tille <tille> | 2003-05-25 00:47:30 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-25 00:47:30 (UTC) |
commit | 672a9a2ecd1132aadcf1043946e27339693145a4 (patch) (unidiff) | |
tree | 9393acea880576582306679081dc0d7fb16aac6c | |
parent | d1c32c127b4dabb716064a790da6be7c24975a92 (diff) | |
download | opie-672a9a2ecd1132aadcf1043946e27339693145a4.zip opie-672a9a2ecd1132aadcf1043946e27339693145a4.tar.gz opie-672a9a2ecd1132aadcf1043946e27339693145a4.tar.bz2 |
debug window gone
-rw-r--r-- | noncore/settings/networksettings/ppp/debug.cpp | 141 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/debug.h | 70 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/kpppwidget.cpp | 26 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/kpppwidget.h | 43 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/ppp.pro | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/pppmodule.cpp | 1 |
6 files changed, 3 insertions, 282 deletions
diff --git a/noncore/settings/networksettings/ppp/debug.cpp b/noncore/settings/networksettings/ppp/debug.cpp deleted file mode 100644 index 447ccf2..0000000 --- a/noncore/settings/networksettings/ppp/debug.cpp +++ b/dev/null | |||
@@ -1,141 +0,0 @@ | |||
1 | /* | ||
2 | * kPPP: A pppd front end for the KDE project | ||
3 | * | ||
4 | * $Id$ | ||
5 | * Copyright (C) 1997 Bernd Wuebben | ||
6 | * wuebben@math.cornel.edu | ||
7 | * | ||
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. | ||
12 | * | ||
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. | ||
17 | * | ||
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., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | */ | ||
22 | |||
23 | #include "debug.h" | ||
24 | //#include "main.h" | ||
25 | #include "pppdata.h" | ||
26 | //#include <klocale.h> | ||
27 | #define i18n QObject::tr | ||
28 | #include "kpppwidget.h" | ||
29 | #include <assert.h> | ||
30 | |||
31 | extern KPPPWidget *p_kppp; | ||
32 | |||
33 | myMultiEdit::myMultiEdit(QWidget *parent, const char *name) | ||
34 | : QMultiLineEdit(parent, name) | ||
35 | { | ||
36 | setReadOnly(true); | ||
37 | } | ||
38 | |||
39 | void myMultiEdit::insertChar(unsigned char c) { | ||
40 | QMultiLineEdit::insert(QChar(c)); | ||
41 | } | ||
42 | |||
43 | |||
44 | void myMultiEdit::newLine() { | ||
45 | QMultiLineEdit::newLine(); | ||
46 | } | ||
47 | |||
48 | |||
49 | DebugWidget::DebugWidget(QWidget *parent, const char *name) | ||
50 | : QDialog(parent, name, FALSE) | ||
51 | { | ||
52 | setCaption(i18n("Login Script Debug Window")); | ||
53 | |||
54 | text_window = new myMultiEdit(this,"debugwindow"); | ||
55 | text_window->setGeometry(2,5,400, 300); | ||
56 | // text_window->setReadOnly(FALSE); | ||
57 | |||
58 | statuslabel = new QLabel("", this, "statuslabel"); | ||
59 | |||
60 | statuslabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | ||
61 | statuslabel->setAlignment( AlignLeft|AlignVCenter ); | ||
62 | statuslabel->setGeometry(2, 307, 400, 20); | ||
63 | //statusPageLabel->setFont( QFont("helvetica",12,QFont::Normal) ); | ||
64 | |||
65 | dismiss = new QPushButton(this); | ||
66 | dismiss->setGeometry(330,340,70,30); | ||
67 | dismiss->setText(i18n("Close")); | ||
68 | dismiss->setFocus(); | ||
69 | connect(dismiss, SIGNAL(clicked()), SLOT(hide())); | ||
70 | |||
71 | |||
72 | /* fline = new QFrame(this,"line"); | ||
73 | fline->setFrameStyle(QFrame::HLine |QFrame::Sunken); | ||
74 | fline->setGeometry(2,332,398,5);*/ | ||
75 | adjustSize(); | ||
76 | setMinimumSize(width(),height()); | ||
77 | |||
78 | } | ||
79 | |||
80 | void DebugWidget::hideEvent(QHideEvent *) | ||
81 | { | ||
82 | assert(p_kppp); | ||
83 | // p_kppp->con->debug->setOn(false); | ||
84 | } | ||
85 | |||
86 | void DebugWidget::clear() { | ||
87 | text_window->clear(); | ||
88 | } | ||
89 | |||
90 | |||
91 | void DebugWidget::addChar(unsigned char c) { | ||
92 | QString stuff; | ||
93 | |||
94 | if(c == '\r' || c == '\n') { | ||
95 | if(c == '\n') | ||
96 | text_window->newLine(); | ||
97 | } else | ||
98 | text_window->insertChar(c); | ||
99 | } | ||
100 | |||
101 | |||
102 | void DebugWidget::statusLabel(const QString &s) { | ||
103 | statuslabel->setText(s); | ||
104 | } | ||
105 | |||
106 | |||
107 | /* | ||
108 | void DebugWidget::keyPressEvent(QKeyEvent *k) { | ||
109 | } | ||
110 | |||
111 | */ | ||
112 | void DebugWidget::resizeEvent(QResizeEvent *e){ | ||
113 | int w = width() ; | ||
114 | int h = height(); | ||
115 | e = e; | ||
116 | |||
117 | text_window->setGeometry(2,5,w - 2 ,h - 63); | ||
118 | statuslabel->setGeometry(2, h - 56 , w -2 , 20); | ||
119 | dismiss->setGeometry(w - 72 , h - 32, 70, 30); | ||
120 | // fline->setGeometry(2,h -70 ,w - 4,5); | ||
121 | } | ||
122 | |||
123 | |||
124 | void DebugWidget::enter() { | ||
125 | text_window->append("\r\n"); | ||
126 | } | ||
127 | |||
128 | |||
129 | void DebugWidget::toggleVisibility() { | ||
130 | if(isVisible()) | ||
131 | hide(); | ||
132 | else | ||
133 | show(); | ||
134 | |||
135 | bool showlog = isVisible(); | ||
136 | PPPData::data()->set_show_log_window(showlog); | ||
137 | } | ||
138 | |||
139 | |||
140 | |||
141 | |||
diff --git a/noncore/settings/networksettings/ppp/debug.h b/noncore/settings/networksettings/ppp/debug.h deleted file mode 100644 index 3565cec..0000000 --- a/noncore/settings/networksettings/ppp/debug.h +++ b/dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * kPPP: A pppd front end for the KDE project | ||
3 | * | ||
4 | * $Id$ | ||
5 | * Copyright (C) 1997 Bernd Wuebben | ||
6 | * wuebben@math.cornel.edu | ||
7 | * | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU Library General Public | ||
11 | * License as published by the Free Software Foundation; either | ||
12 | * version 2 of the License, or (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * Library General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU Library General Public | ||
20 | * License along with this program; if not, write to the Free | ||
21 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | */ | ||
23 | |||
24 | #ifndef _DEBUGWIDGET_ | ||
25 | #define _DEBUGWIDGET_ | ||
26 | |||
27 | #include <qdialog.h> | ||
28 | #include <qstring.h> | ||
29 | #include <qlabel.h> | ||
30 | #include <qmultilineedit.h> | ||
31 | #include <qpushbutton.h> | ||
32 | |||
33 | |||
34 | class myMultiEdit : public QMultiLineEdit { | ||
35 | public: | ||
36 | |||
37 | myMultiEdit(QWidget *parent=0, const char *name=0); | ||
38 | |||
39 | void newLine(); | ||
40 | void insertChar(unsigned char c); | ||
41 | }; | ||
42 | |||
43 | |||
44 | class DebugWidget : public QDialog { | ||
45 | Q_OBJECT | ||
46 | public: | ||
47 | DebugWidget(QWidget *parent=0, const char *name=0); | ||
48 | |||
49 | void clear(); | ||
50 | |||
51 | public slots: | ||
52 | void statusLabel(const QString &); | ||
53 | void toggleVisibility(); | ||
54 | void addChar(unsigned char); | ||
55 | |||
56 | protected: | ||
57 | virtual void hideEvent(QHideEvent *); | ||
58 | virtual void resizeEvent(QResizeEvent *e); | ||
59 | |||
60 | private: | ||
61 | void enter(); | ||
62 | QFrame *fline; | ||
63 | QPushButton *dismiss; | ||
64 | myMultiEdit *text_window; | ||
65 | |||
66 | QLabel *statuslabel; | ||
67 | }; | ||
68 | |||
69 | #endif | ||
70 | |||
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp index 8d70cd4..f8a8dc3 100644 --- a/noncore/settings/networksettings/ppp/kpppwidget.cpp +++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp | |||
@@ -220,86 +220,69 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
220 | // l2->addWidget(setup_b); | 220 | // l2->addWidget(setup_b); |
221 | // // l2->addWidget(help_b); | 221 | // // l2->addWidget(help_b); |
222 | // l2->addSpacing(20); | 222 | // l2->addSpacing(20); |
223 | // l2->addWidget(connect_b); | 223 | // l2->addWidget(connect_b); |
224 | 224 | ||
225 | setFixedSize(sizeHint()); | 225 | setFixedSize(sizeHint()); |
226 | 226 | ||
227 | (void)new Modem; | 227 | (void)new Modem; |
228 | 228 | ||
229 | // we also connect cmld_start to the beginConnect so that I can run | 229 | // we also connect cmld_start to the beginConnect so that I can run |
230 | // the dialer through a command line argument | 230 | // the dialer through a command line argument |
231 | connect(this,SIGNAL(cmdl_start()),this,SLOT(beginConnect())); | 231 | connect(this,SIGNAL(cmdl_start()),this,SLOT(beginConnect())); |
232 | 232 | ||
233 | // stats = new PPPStats; | 233 | // stats = new PPPStats; |
234 | 234 | ||
235 | // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); | 235 | // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); |
236 | 236 | ||
237 | // constructor of con_win reads position from config file | 237 | // constructor of con_win reads position from config file |
238 | // con_win = new ConWindow(0, "conw", this); | 238 | // con_win = new ConWindow(0, "conw", this); |
239 | // KWin::setIcons(con_win->winId(), kapp->icon(), kapp->miniIcon()); | 239 | // KWin::setIcons(con_win->winId(), kapp->icon(), kapp->miniIcon()); |
240 | 240 | ||
241 | // statdlg = new PPPStatsDlg(0, "stats", this, stats); | 241 | // statdlg = new PPPStatsDlg(0, "stats", this, stats); |
242 | // statdlg->hide(); | 242 | // statdlg->hide(); |
243 | 243 | ||
244 | debugwindow = new DebugWidget(0,"debugwindow"); | ||
245 | // KWin::setIcons(debugwindow->winId(), kapp->icon(), kapp->miniIcon()); | ||
246 | debugwindow->hide(); | ||
247 | |||
248 | // load up the accounts combo box | 244 | // load up the accounts combo box |
249 | 245 | ||
250 | // resetaccounts(); | 246 | // resetaccounts(); |
251 | // con = new ConnectWidget(0, "con"); | 247 | // con = new ConnectWidget(0, "con"); |
252 | //KWin::setIcons(con->winId(), kapp->icon(), kapp->miniIcon() ); | 248 | //KWin::setIcons(con->winId(), kapp->icon(), kapp->miniIcon() ); |
253 | // connect(this, SIGNAL(begin_connect()),con, SLOT(preinit())); | 249 | // connect(this, SIGNAL(begin_connect()),con, SLOT(preinit())); |
254 | // Is this the best we can do here? it's not right. | 250 | // Is this the best we can do here? it's not right. |
255 | // QRect desk = QApplication::desktop()->screenGeometry( | 251 | // QRect desk = QApplication::desktop()->screenGeometry( |
256 | // QApplication::desktop()->screenNumber(topLevelWidget())); | 252 | // QApplication::desktop()->screenNumber(topLevelWidget())); |
257 | // con->setGeometry(desk.center().x()-175, desk.center().y()-55, 350,110); | 253 | // con->setGeometry(desk.center().x()-175, desk.center().y()-55, 350,110); |
258 | 254 | ||
259 | // connect the ConnectWidgets various signals | 255 | // connect the ConnectWidgets various signals |
260 | // connect(con, SIGNAL(closeDebugWindow()), | ||
261 | // debugwindow, SLOT(hide())); | ||
262 | // connect(con, SIGNAL(debugMessage(const QString &)), | ||
263 | // debugwindow, SLOT(statusLabel(const QString &))); | ||
264 | // connect(con, SIGNAL(toggleDebugWindow()), | ||
265 | // debugwindow, SLOT(toggleVisibility())); | ||
266 | // connect(con, SIGNAL(debugPutChar(unsigned char)), | ||
267 | // debugwindow, SLOT(addChar(unsigned char))); | ||
268 | // // connect(con, SIGNAL(startAccounting()), | 256 | // // connect(con, SIGNAL(startAccounting()), |
269 | // // this, SLOT(startAccounting())); | 257 | // // this, SLOT(startAccounting())); |
270 | // // connect(con, SIGNAL(stopAccounting()), | 258 | // // connect(con, SIGNAL(stopAccounting()), |
271 | // // this, SLOT(stopAccounting())); | 259 | // // this, SLOT(stopAccounting())); |
272 | // connect(qApp, SIGNAL(saveYourself()), | 260 | // connect(qApp, SIGNAL(saveYourself()), |
273 | // this, SLOT(saveMyself())); | 261 | // this, SLOT(saveMyself())); |
274 | // connect(qApp, SIGNAL(shutDown()), | 262 | // connect(qApp, SIGNAL(shutDown()), |
275 | // this, SLOT(shutDown())); | 263 | // this, SLOT(shutDown())); |
276 | 264 | ||
277 | // debugwindow->setGeometry(desk.center().x()+190, desk.center().y()-55, | ||
278 | // debugwindow->width(),debugwindow->height()); | ||
279 | |||
280 | // move(desk.center().x()-width()/2, desk.center().y()-height()/2); | ||
281 | |||
282 | 265 | ||
283 | // KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); | 266 | // KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); |
284 | 267 | ||
285 | // m_strCmdlAccount = args->getOption("c"); | 268 | // m_strCmdlAccount = args->getOption("c"); |
286 | // m_bQuitOnDisconnect = args->isSet("q"); | 269 | // m_bQuitOnDisconnect = args->isSet("q"); |
287 | 270 | ||
288 | // if(!m_strCmdlAccount.isEmpty()) { | 271 | // if(!m_strCmdlAccount.isEmpty()) { |
289 | // m_bCmdlAccount = true; | 272 | // m_bCmdlAccount = true; |
290 | // kdDebug(5002) << "cmdl_account: " << m_bCmdlAccount << endl; | 273 | // kdDebug(5002) << "cmdl_account: " << m_bCmdlAccount << endl; |
291 | // } | 274 | // } |
292 | 275 | ||
293 | // if(m_bCmdlAccount){ | 276 | // if(m_bCmdlAccount){ |
294 | // bool result = PPPData::data()->setAccount(m_strCmdlAccount); | 277 | // bool result = PPPData::data()->setAccount(m_strCmdlAccount); |
295 | // if (!result){ | 278 | // if (!result){ |
296 | // QString string; | 279 | // QString string; |
297 | // string = i18n("No such Account:\n%1").arg(m_strCmdlAccount); | 280 | // string = i18n("No such Account:\n%1").arg(m_strCmdlAccount); |
298 | // KMessageBox::error(this, string); | 281 | // KMessageBox::error(this, string); |
299 | // m_bCmdlAccount = false; | 282 | // m_bCmdlAccount = false; |
300 | // this->show(); | 283 | // this->show(); |
301 | // } else { | 284 | // } else { |
302 | // beginConnect(); | 285 | // beginConnect(); |
303 | // } | 286 | // } |
304 | // } else | 287 | // } else |
305 | // expandbutton(); | 288 | // expandbutton(); |
@@ -614,57 +597,48 @@ void KPPPWidget::beginConnect() { | |||
614 | encodeWord(PPPData::data()->storedUsername()), | 597 | encodeWord(PPPData::data()->storedUsername()), |
615 | encodeWord(PPPData::data()->password()))) { | 598 | encodeWord(PPPData::data()->password()))) { |
616 | QString s; | 599 | QString s; |
617 | s = i18n("Cannot create PAP/CHAP authentication\n" | 600 | s = i18n("Cannot create PAP/CHAP authentication\n" |
618 | "file \"%1\"").arg(PAP_AUTH_FILE); | 601 | "file \"%1\"").arg(PAP_AUTH_FILE); |
619 | QMessageBox::warning(this, "error", s); | 602 | QMessageBox::warning(this, "error", s); |
620 | return; | 603 | return; |
621 | } | 604 | } |
622 | } | 605 | } |
623 | } | 606 | } |
624 | 607 | ||
625 | if (PPPData::data()->phonenumber().isEmpty()) { | 608 | if (PPPData::data()->phonenumber().isEmpty()) { |
626 | QString s = i18n("You must specify a telephone number!"); | 609 | QString s = i18n("You must specify a telephone number!"); |
627 | QMessageBox::warning(this, "error", s); | 610 | QMessageBox::warning(this, "error", s); |
628 | return; | 611 | return; |
629 | } | 612 | } |
630 | 613 | ||
631 | this->hide(); | 614 | this->hide(); |
632 | 615 | ||
633 | QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname()); | 616 | QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname()); |
634 | // con->setCaption(tit); | 617 | // con->setCaption(tit); |
635 | 618 | ||
636 | // con->show(); | 619 | // con->show(); |
637 | 620 | ||
638 | bool show_debug = PPPData::data()->get_show_log_window(); | ||
639 | // con->debug->setOn(show_debug);// toggle button | ||
640 | debugwindow->clear(); | ||
641 | if (!show_debug) | ||
642 | debugwindow->hide(); | ||
643 | else { | ||
644 | debugwindow->show(); | ||
645 | // con->raise(); | ||
646 | } | ||
647 | 621 | ||
648 | emit begin_connect(); | 622 | emit begin_connect(); |
649 | } | 623 | } |
650 | 624 | ||
651 | 625 | ||
652 | void KPPPWidget::disconnect() { | 626 | void KPPPWidget::disconnect() { |
653 | if (!PPPData::data()->command_before_disconnect().isEmpty()) { | 627 | if (!PPPData::data()->command_before_disconnect().isEmpty()) { |
654 | // con_win->hide(); | 628 | // con_win->hide(); |
655 | // con->show(); | 629 | // con->show(); |
656 | // con->setCaption(i18n("Disconnecting...")); | 630 | // con->setCaption(i18n("Disconnecting...")); |
657 | // con->setMsg(i18n("Executing command before disconnection.")); | 631 | // con->setMsg(i18n("Executing command before disconnection.")); |
658 | 632 | ||
659 | qApp->processEvents(); | 633 | qApp->processEvents(); |
660 | QApplication::flushX(); | 634 | QApplication::flushX(); |
661 | // pid_t id = | 635 | // pid_t id = |
662 | execute_command(PPPData::data()->command_before_disconnect()); | 636 | execute_command(PPPData::data()->command_before_disconnect()); |
663 | // int i, status; | 637 | // int i, status; |
664 | 638 | ||
665 | // do { | 639 | // do { |
666 | // kapp->processEvents(); | 640 | // kapp->processEvents(); |
667 | // i = waitpid(id, &status, WNOHANG); | 641 | // i = waitpid(id, &status, WNOHANG); |
668 | // usleep(500000); | 642 | // usleep(500000); |
669 | // } while (i == 0 && errno == 0); | 643 | // } while (i == 0 && errno == 0); |
670 | 644 | ||
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.h b/noncore/settings/networksettings/ppp/kpppwidget.h index 266d829..d7e74af 100644 --- a/noncore/settings/networksettings/ppp/kpppwidget.h +++ b/noncore/settings/networksettings/ppp/kpppwidget.h | |||
@@ -8,150 +8,107 @@ | |||
8 | * wuebben@math.cornell.edu | 8 | * wuebben@math.cornell.edu |
9 | * | 9 | * |
10 | * Copyright (C) 1998-2002 Harri Porten <porten@kde.org> | 10 | * Copyright (C) 1998-2002 Harri Porten <porten@kde.org> |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU Library General Public | 13 | * modify it under the terms of the GNU Library General Public |
14 | * License as published by the Free Software Foundation; either | 14 | * License as published by the Free Software Foundation; either |
15 | * version 2 of the License, or (at your option) any later version. | 15 | * version 2 of the License, or (at your option) any later version. |
16 | * | 16 | * |
17 | * This program is distributed in the hope that it will be useful, | 17 | * This program is distributed in the hope that it will be useful, |
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
20 | * Library General Public License for more details. | 20 | * Library General Public License for more details. |
21 | * | 21 | * |
22 | * You should have received a copy of the GNU Library General Public | 22 | * You should have received a copy of the GNU Library General Public |
23 | * License along with this program; if not, write to the Free | 23 | * License along with this program; if not, write to the Free |
24 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #ifndef __KPPPWIDGET_H__ | 27 | #ifndef __KPPPWIDGET_H__ |
28 | #define __KPPPWIDGET_H__ | 28 | #define __KPPPWIDGET_H__ |
29 | 29 | ||
30 | #include <qstring.h> | 30 | #include <qstring.h> |
31 | 31 | ||
32 | //#include "accounting.h" | ||
33 | #include "conwindow.h" | 32 | #include "conwindow.h" |
34 | #include "accounts.h" | 33 | #include "accounts.h" |
35 | #include "connect.h" | 34 | #include "connect.h" |
36 | #include "debug.h" | ||
37 | //#include "pppstatdlg.h" | ||
38 | 35 | ||
39 | //class GraphSetup; | ||
40 | //class AboutWidget; | ||
41 | //class PPPStats; | ||
42 | class QDialog; | ||
43 | class QPushButton; | 36 | class QPushButton; |
44 | 37 | ||
45 | /* class SignalEvent : public QEvent { */ | ||
46 | /* public: */ | ||
47 | /* SignalEvent(int s) : QEvent(User), sig(s) { } */ | ||
48 | /* int sigType() const { return sig; } */ | ||
49 | /* private: */ | ||
50 | /* int sig; */ | ||
51 | /* }; */ | ||
52 | |||
53 | 38 | ||
54 | class KPPPWidget : public QDialog { | 39 | class KPPPWidget : public QDialog { |
55 | Q_OBJECT | 40 | Q_OBJECT |
56 | public: | 41 | public: |
57 | 42 | ||
58 | KPPPWidget( QWidget *parent=0, const char *name=0, bool modal = false, WFlags fl = 0 ); | 43 | KPPPWidget( QWidget *parent=0, const char *name=0, bool modal = false, WFlags fl = 0 ); |
59 | ~KPPPWidget(); | 44 | ~KPPPWidget(); |
60 | 45 | ||
61 | void setPW_Edit(const QString &); | 46 | void setPW_Edit(const QString &); |
62 | // virtual bool eventFilter(QObject *, QEvent *); | ||
63 | 47 | ||
64 | void setQuitOnDisconnect (bool b); | ||
65 | // bool quitOnDisconnect () {return m_bQuitOnDisconnect;}; | ||
66 | 48 | ||
67 | private slots: | 49 | private slots: |
68 | void newdefaultaccount(int); | 50 | void newdefaultaccount(int); |
69 | // void expandbutton(); | ||
70 | void beginConnect(); | 51 | void beginConnect(); |
71 | void quitbutton(); | 52 | void quitbutton(); |
72 | // void helpbutton(); | ||
73 | // void setup(); | ||
74 | // void rulesetLoadError(); | ||
75 | void usernameChanged(const QString &); | 53 | void usernameChanged(const QString &); |
76 | void passwordChanged(const QString &); | 54 | void passwordChanged(const QString &); |
77 | void enterPressedInID(); | 55 | void enterPressedInID(); |
78 | void enterPressedInPW(); | 56 | void enterPressedInPW(); |
79 | void saveMyself(); | 57 | void saveMyself(); |
80 | void shutDown(); | 58 | void shutDown(); |
81 | 59 | ||
82 | /* protected slots: */ | ||
83 | /* virtual void accept(); */ | ||
84 | /* virtual void reject(); */ | ||
85 | 60 | ||
86 | public slots: | 61 | public slots: |
87 | // void resetaccounts(); | ||
88 | /* void resetCosts(const QString &); */ | ||
89 | /* void resetVolume(const QString &); */ | ||
90 | void disconnect(); | 62 | void disconnect(); |
91 | void log_window_toggled(bool on); | 63 | void log_window_toggled(bool on); |
92 | /* void startAccounting(); */ | ||
93 | /* void stopAccounting(); */ | ||
94 | /* void showStats(); */ | ||
95 | 64 | ||
96 | signals: | 65 | signals: |
97 | void begin_connect(); | 66 | void begin_connect(); |
98 | void cmdl_start(); | 67 | void cmdl_start(); |
99 | 68 | ||
100 | public: | 69 | public: |
101 | QCheckBox *log; | 70 | QCheckBox *log; |
102 | bool connected; | 71 | bool connected; |
103 | DebugWidget *debugwindow; | ||
104 | QString con_speed; | 72 | QString con_speed; |
105 | // ConnectWidget *con; | 73 | // ConnectWidget *con; |
106 | // ConWindow *con_win; | 74 | // ConWindow *con_win; |
107 | // PPPStatsDlg *statdlg; | 75 | // PPPStatsDlg *statdlg; |
108 | // AccountingBase *acct; | 76 | // AccountingBase *acct; |
109 | QPushButton *quit_b; | 77 | QPushButton *quit_b; |
110 | //PPPStats *stats; | 78 | //PPPStats *stats; |
111 | 79 | ||
112 | private: | 80 | private: |
113 | // void prepareSetupDialog(); | 81 | // void prepareSetupDialog(); |
114 | void interruptConnection(); | 82 | void interruptConnection(); |
115 | void sigChld(); | 83 | void sigChld(); |
116 | void sigPPPDDied(); | 84 | void sigPPPDDied(); |
117 | QString encodeWord(const QString &s); | 85 | QString encodeWord(const QString &s); |
118 | void showNews (); | 86 | void showNews (); |
119 | 87 | ||
120 | QString ruleset_load_errmsg; | 88 | QString ruleset_load_errmsg; |
121 | 89 | ||
122 | // QPushButton *help_b; | ||
123 | QPushButton *setup_b; | 90 | QPushButton *setup_b; |
124 | QFrame *fline; | 91 | QFrame *fline; |
125 | QFrame *fline1; | 92 | QFrame *fline1; |
126 | QPushButton *connect_b; | 93 | QPushButton *connect_b; |
127 | QComboBox *connectto_c; | 94 | QComboBox *connectto_c; |
128 | QLabel *ID_Label; | 95 | QLabel *ID_Label; |
129 | QLabel *PW_Label; | 96 | QLabel *PW_Label; |
130 | QLineEdit *ID_Edit; | 97 | QLineEdit *ID_Edit; |
131 | QLineEdit *PW_Edit; | 98 | QLineEdit *PW_Edit; |
132 | QLabel *label1; | 99 | QLabel *label1; |
133 | QLabel *label2; | 100 | QLabel *label2; |
134 | QLabel *label3; | 101 | QLabel *label3; |
135 | QLabel *label4; | 102 | QLabel *label4; |
136 | QLabel *label5; | 103 | QLabel *label5; |
137 | QLabel *label6; | 104 | QLabel *label6; |
138 | QLabel *radio_label; | 105 | QLabel *radio_label; |
139 | 106 | ||
140 | |||
141 | // QTabWidget *tabWindow; | ||
142 | // AccountWidget *accounts; | ||
143 | // GeneralWidget *general; | ||
144 | // ModemWidget *modem1; | ||
145 | // ModemWidget2 *modem2; | ||
146 | // GraphSetup *graph; | ||
147 | // AboutWidget *about; | ||
148 | |||
149 | |||
150 | /* QString m_strCmdlAccount; */ | 107 | /* QString m_strCmdlAccount; */ |
151 | /* bool m_bQuitOnDisconnect; */ | 108 | /* bool m_bQuitOnDisconnect; */ |
152 | /* bool m_bCmdlAccount; */ | 109 | /* bool m_bCmdlAccount; */ |
153 | }; | 110 | }; |
154 | 111 | ||
155 | 112 | ||
156 | #endif | 113 | #endif |
157 | 114 | ||
diff --git a/noncore/settings/networksettings/ppp/ppp.pro b/noncore/settings/networksettings/ppp/ppp.pro index ebfc713..a2e0118 100644 --- a/noncore/settings/networksettings/ppp/ppp.pro +++ b/noncore/settings/networksettings/ppp/ppp.pro | |||
@@ -1,18 +1,18 @@ | |||
1 | #TEMPLATE = app | 1 | #TEMPLATE = app |
2 | # | 2 | # |
3 | TEMPLATE = lib | 3 | TEMPLATE = lib |
4 | #CONFIG += qt warn_on release | 4 | #CONFIG += qt warn_on release |
5 | CONFIG += qt warn_on debug | 5 | CONFIG += qt warn_on debug |
6 | DESTDIR = $(OPIEDIR)/plugins/networksettings | 6 | DESTDIR = $(OPIEDIR)/plugins/networksettings |
7 | HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h knuminput.h knumvalidator.h kpppwidget.h conwindow.h debug.h accounts.h connect.h edit.h scriptedit.h pppdargs.h iplined.h pwentry.h pppconfig.h | 7 | HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h knuminput.h knumvalidator.h kpppwidget.h conwindow.h accounts.h connect.h edit.h scriptedit.h pppdargs.h iplined.h pwentry.h pppconfig.h |
8 | SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp knuminput.cpp knumvalidator.cpp kpppwidget.cpp conwindow.cpp debug.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp iplined.cpp pwentry.cpp pppconfig.cpp | 8 | SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp knuminput.cpp knumvalidator.cpp kpppwidget.cpp conwindow.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp iplined.cpp pwentry.cpp pppconfig.cpp |
9 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ | 9 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ |
10 | DEPENDPATH+= $(OPIEDIR)/include | 10 | DEPENDPATH+= $(OPIEDIR)/include |
11 | LIBS += -lqpe -L../interfaces/ -linterfaces | 11 | LIBS += -lqpe -L../interfaces/ -linterfaces |
12 | INTERFACES= | 12 | INTERFACES= |
13 | TARGET = pppplugin | 13 | TARGET = pppplugin |
14 | VERSION = 1.0.0 | 14 | VERSION = 1.0.0 |
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | include ( $(OPIEDIR)/include.pro ) | 18 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index e13f8c8..fb2f3e5 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp | |||
@@ -59,48 +59,49 @@ QWidget *PPPModule::configure(Interface *i){ | |||
59 | PPPConfigWidget *pppconfig = new PPPConfigWidget( 0, "PPPConfig", false, | 59 | PPPConfigWidget *pppconfig = new PPPConfigWidget( 0, "PPPConfig", false, |
60 | Qt::WDestructiveClose ); | 60 | Qt::WDestructiveClose ); |
61 | return pppconfig; | 61 | return pppconfig; |
62 | } | 62 | } |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * Create, and return the Information Module | 65 | * Create, and return the Information Module |
66 | * @return QWidget* pointer to this modules info. | 66 | * @return QWidget* pointer to this modules info. |
67 | */ | 67 | */ |
68 | QWidget *PPPModule::information(Interface *i){ | 68 | QWidget *PPPModule::information(Interface *i){ |
69 | // We don't have any advanced pppd information widget yet :-D | 69 | // We don't have any advanced pppd information widget yet :-D |
70 | // TODO ^ | 70 | // TODO ^ |
71 | qDebug("return PPPModule::information"); | 71 | qDebug("return PPPModule::information"); |
72 | InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i); | 72 | InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i); |
73 | return information; | 73 | return information; |
74 | } | 74 | } |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * Get all active (up or down) interfaces | 77 | * Get all active (up or down) interfaces |
78 | * @return QList<Interface> A list of interfaces that exsist that havn't | 78 | * @return QList<Interface> A list of interfaces that exsist that havn't |
79 | * been called by isOwner() | 79 | * been called by isOwner() |
80 | */ | 80 | */ |
81 | QList<Interface> PPPModule::getInterfaces(){ | 81 | QList<Interface> PPPModule::getInterfaces(){ |
82 | // List all of the files in the peer directory | 82 | // List all of the files in the peer directory |
83 | qDebug("PPPModule::getInterfaces"); | ||
83 | return list; | 84 | return list; |
84 | } | 85 | } |
85 | 86 | ||
86 | /** | 87 | /** |
87 | * Attempt to add a new interface as defined by name | 88 | * Attempt to add a new interface as defined by name |
88 | * @param name the name of the type of interface that should be created given | 89 | * @param name the name of the type of interface that should be created given |
89 | * by possibleNewInterfaces(); | 90 | * by possibleNewInterfaces(); |
90 | * @return Interface* NULL if it was unable to be created. | 91 | * @return Interface* NULL if it was unable to be created. |
91 | */ | 92 | */ |
92 | Interface *PPPModule::addNewInterface(const QString &newInterface){ | 93 | Interface *PPPModule::addNewInterface(const QString &newInterface){ |
93 | 94 | ||
94 | qDebug("try to add iface %s",newInterface.latin1()); | 95 | qDebug("try to add iface %s",newInterface.latin1()); |
95 | 96 | ||
96 | PPPConfigWidget imp(0, "PPPConfigImp", true); | 97 | PPPConfigWidget imp(0, "PPPConfigImp", true); |
97 | imp.showMaximized(); | 98 | imp.showMaximized(); |
98 | if(imp.exec() == QDialog::Accepted ){ | 99 | if(imp.exec() == QDialog::Accepted ){ |
99 | qDebug("ACCEPTED"); | 100 | qDebug("ACCEPTED"); |
100 | PPPData::data()->save(); | 101 | PPPData::data()->save(); |
101 | Interface *iface; | 102 | Interface *iface; |
102 | iface = new Interface( 0, PPPData::data()->modemDevice() ); | 103 | iface = new Interface( 0, PPPData::data()->modemDevice() ); |
103 | iface->setHardwareName( PPPData::data()->accname() ); | 104 | iface->setHardwareName( PPPData::data()->accname() ); |
104 | list.append( iface ); | 105 | list.append( iface ); |
105 | return iface; | 106 | return iface; |
106 | } | 107 | } |