author | tille <tille> | 2003-05-30 15:06:17 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-30 15:06:17 (UTC) |
commit | 8699d02f6c152afed9490e7e7a4315044261e6e8 (patch) (unidiff) | |
tree | d2ee2ba401c7a9db0e33beaf0617a1456fe01d50 /noncore/settings/networksettings/ppp/kpppwidget.cpp | |
parent | d8cec07fe5e54a68afe4feca574f9f4d2433e0c1 (diff) | |
download | opie-8699d02f6c152afed9490e7e7a4315044261e6e8.zip opie-8699d02f6c152afed9490e7e7a4315044261e6e8.tar.gz opie-8699d02f6c152afed9490e7e7a4315044261e6e8.tar.bz2 |
modem and pppdata is now member of interfaceppp
Diffstat (limited to 'noncore/settings/networksettings/ppp/kpppwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/kpppwidget.cpp | 461 |
1 files changed, 235 insertions, 226 deletions
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp index f8a8dc3..289e9f5 100644 --- a/noncore/settings/networksettings/ppp/kpppwidget.cpp +++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp | |||
@@ -39,2 +39,3 @@ | |||
39 | #include <qwhatsthis.h> | 39 | #include <qwhatsthis.h> |
40 | #include <qcheckbox.h> | ||
40 | 41 | ||
@@ -72,2 +73,3 @@ | |||
72 | #include "general.h" | 73 | #include "general.h" |
74 | #include "interface.h" | ||
73 | 75 | ||
@@ -77,6 +79,4 @@ KPPPWidget *p_kppp = 0; | |||
77 | 79 | ||
78 | KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl ) | 80 | KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl ) |
79 | : QDialog(parent, name, modal, fl) | 81 | : QDialog(parent, name, modal, fl), _pppdata(pd) |
80 | // , acct(0) | ||
81 | // , m_bCmdlAccount (false) | ||
82 | { | 82 | { |
@@ -85,2 +85,11 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
85 | // before doing anything else, run a few tests | 85 | // before doing anything else, run a few tests |
86 | if (!_pppdata->setModemDevice( i->getInterfaceName() )) | ||
87 | _pppdata->setModemDevice("/dev/modem"); | ||
88 | qDebug("PPPConfigWidget::PPPConfigWidget"); | ||
89 | qDebug(" interface->getHardwareName >%s<", i->getHardwareName().latin1()); | ||
90 | if (!_pppdata->setAccount( i->getHardwareName() )) | ||
91 | _pppdata->setAccount( 0 ); | ||
92 | |||
93 | qDebug(" _pppdata->accname >%s<",_pppdata->accname().latin1()); | ||
94 | qDebug(" _pppdata->currentAccountID() >%i<",_pppdata->currentAccountID()); | ||
86 | 95 | ||
@@ -92,104 +101,104 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
92 | 101 | ||
93 | // QVBoxLayout *tl = new QVBoxLayout(this, 10, 10); | 102 | QVBoxLayout *tl = new QVBoxLayout(this, 10, 10); |
94 | 103 | ||
95 | // QGridLayout *l1 = new QGridLayout(3, 4); | 104 | QGridLayout *l1 = new QGridLayout(3, 4); |
96 | // tl->addLayout(l1); | 105 | tl->addLayout(l1); |
97 | // l1->addColSpacing(0, 10); | 106 | l1->addColSpacing(0, 10); |
98 | // l1->addColSpacing(3, 10); | 107 | l1->addColSpacing(3, 10); |
99 | // l1->setColStretch(1, 3); | 108 | l1->setColStretch(1, 3); |
100 | // l1->setColStretch(2, 4); | 109 | l1->setColStretch(2, 4); |
101 | 110 | ||
102 | // label1 = new QLabel(i18n("C&onnect to: "), this); | 111 | label1 = new QLabel(i18n("C&onnect to: "), this); |
103 | // l1->addWidget(label1, 0, 1); | 112 | l1->addWidget(label1, 0, 1); |
104 | 113 | ||
105 | // connectto_c = new QComboBox(false, this); | 114 | connectto_c = new QComboBox(false, this); |
106 | // label1->setBuddy(connectto_c); | 115 | label1->setBuddy(connectto_c); |
107 | 116 | ||
108 | // connect(connectto_c, SIGNAL(activated(int)), | 117 | connect(connectto_c, SIGNAL(activated(int)), |
109 | // SLOT(newdefaultaccount(int))); | 118 | SLOT(newdefaultaccount(int))); |
110 | // l1->addWidget(connectto_c, 0, 2); | 119 | l1->addWidget(connectto_c, 0, 2); |
111 | 120 | ||
112 | // ID_Label = new QLabel(i18n("&Login ID:"), this); | 121 | ID_Label = new QLabel(i18n("&Login ID:"), this); |
113 | // l1->addWidget(ID_Label, 1, 1); | 122 | l1->addWidget(ID_Label, 1, 1); |
114 | 123 | ||
115 | // // the entry line for usernames | 124 | // the entry line for usernames |
116 | // ID_Edit = new QLineEdit(this); | 125 | ID_Edit = new QLineEdit(this); |
117 | // ID_Label->setBuddy(ID_Edit); | 126 | ID_Label->setBuddy(ID_Edit); |
118 | // l1->addWidget(ID_Edit, 1, 2); | 127 | l1->addWidget(ID_Edit, 1, 2); |
119 | // connect(ID_Edit, SIGNAL(returnPressed()), | 128 | connect(ID_Edit, SIGNAL(returnPressed()), |
120 | // this, SLOT(enterPressedInID())); | 129 | this, SLOT(enterPressedInID())); |
121 | // QString tmp = i18n("<p>Type in the username that you got from your\n" | 130 | QString tmp = i18n("<p>Type in the username that you got from your\n" |
122 | // "ISP. This is especially important for PAP\n" | 131 | "ISP. This is especially important for PAP\n" |
123 | // "and CHAP. You may omit this when you use\n" | 132 | "and CHAP. You may omit this when you use\n" |
124 | // "terminal-based or script-based authentication.\n" | 133 | "terminal-based or script-based authentication.\n" |
125 | // "\n" | 134 | "\n" |
126 | // "<b>Important</b>: case is important here:\n" | 135 | "<b>Important</b>: case is important here:\n" |
127 | // "<i>myusername</i> is not the same as <i>MyUserName</i>!"); | 136 | "<i>myusername</i> is not the same as <i>MyUserName</i>!"); |
128 | 137 | ||
129 | // QWhatsThis::add(ID_Label,tmp); | 138 | QWhatsThis::add(ID_Label,tmp); |
130 | // QWhatsThis::add(ID_Edit,tmp); | 139 | QWhatsThis::add(ID_Edit,tmp); |
131 | 140 | ||
132 | // PW_Label = new QLabel(i18n("&Password:"), this); | 141 | PW_Label = new QLabel(i18n("&Password:"), this); |
133 | // l1->addWidget(PW_Label, 2, 1); | 142 | l1->addWidget(PW_Label, 2, 1); |
134 | 143 | ||
135 | // PW_Edit= new QLineEdit(this); | 144 | PW_Edit= new QLineEdit(this); |
136 | // PW_Label->setBuddy(PW_Edit); | 145 | PW_Label->setBuddy(PW_Edit); |
137 | // PW_Edit->setEchoMode(QLineEdit::Password); | 146 | PW_Edit->setEchoMode(QLineEdit::Password); |
138 | // l1->addWidget(PW_Edit, 2, 2); | 147 | l1->addWidget(PW_Edit, 2, 2); |
139 | // connect(PW_Edit, SIGNAL(returnPressed()), | 148 | connect(PW_Edit, SIGNAL(returnPressed()), |
140 | // this, SLOT(enterPressedInPW())); | 149 | this, SLOT(enterPressedInPW())); |
141 | 150 | ||
142 | // tmp = i18n("<p>Type in the password that you got from your\n" | 151 | tmp = i18n("<p>Type in the password that you got from your\n" |
143 | // "ISP. This is especially important for PAP\n" | 152 | "ISP. This is especially important for PAP\n" |
144 | // "and CHAP. You may omit this when you use\n" | 153 | "and CHAP. You may omit this when you use\n" |
145 | // "terminal-based or script-based authentication.\n" | 154 | "terminal-based or script-based authentication.\n" |
146 | // "\n" | 155 | "\n" |
147 | // "<b>Important</b>: case is important here:\n" | 156 | "<b>Important</b>: case is important here:\n" |
148 | // "<i>mypassword</i> is not the same as <i>MyPassword</i>!"); | 157 | "<i>mypassword</i> is not the same as <i>MyPassword</i>!"); |
149 | 158 | ||
150 | // QWhatsThis::add(PW_Label,tmp); | 159 | QWhatsThis::add(PW_Label,tmp); |
151 | // QWhatsThis::add(PW_Edit,tmp); | 160 | QWhatsThis::add(PW_Edit,tmp); |
152 | 161 | ||
153 | // QHBoxLayout *l3 = new QHBoxLayout; | 162 | QHBoxLayout *l3 = new QHBoxLayout; |
154 | // tl->addSpacing(5); | 163 | tl->addSpacing(5); |
155 | // tl->addLayout(l3); | 164 | tl->addLayout(l3); |
156 | // tl->addSpacing(5); | 165 | tl->addSpacing(5); |
157 | // l3->addSpacing(10); | 166 | l3->addSpacing(10); |
158 | // log = new QCheckBox(i18n("Show lo&g window"), this); | 167 | log = new QCheckBox(i18n("Show lo&g window"), this); |
159 | // connect(log, SIGNAL(toggled(bool)), | 168 | connect(log, SIGNAL(toggled(bool)), |
160 | // this, SLOT(log_window_toggled(bool))); | 169 | this, SLOT(log_window_toggled(bool))); |
161 | // log->setChecked(PPPData::data()->get_show_log_window()); | 170 | log->setChecked(_pppdata->get_show_log_window()); |
162 | // l3->addWidget(log); | 171 | l3->addWidget(log); |
163 | 172 | ||
164 | // QWhatsThis::add(log, | 173 | QWhatsThis::add(log, |
165 | // i18n("<p>This controls whether a log window is shown.\n" | 174 | i18n("<p>This controls whether a log window is shown.\n" |
166 | // "A log window shows the communication between\n" | 175 | "A log window shows the communication between\n" |
167 | // "<i>kppp</i> and your modem. This will help you\n" | 176 | "<i>kppp</i> and your modem. This will help you\n" |
168 | // "in tracking down problems.\n" | 177 | "in tracking down problems.\n" |
169 | // "\n" | 178 | "\n" |
170 | // "Turn it off if <i>kppp</i> routinely connects without\n" | 179 | "Turn it off if <i>kppp</i> routinely connects without\n" |
171 | // "problems")); | 180 | "problems")); |
172 | 181 | ||
173 | // // fline = new QSeparator( KSeparator::HLine, this); | 182 | // fline = new QSeparator( KSeparator::HLine, this); |
174 | // // tl->addWidget(fline); | 183 | // tl->addWidget(fline); |
175 | 184 | ||
176 | // QHBoxLayout *l2 = new QHBoxLayout(this); | 185 | QHBoxLayout *l2 = new QHBoxLayout(this); |
177 | // tl->addLayout(l2); | 186 | tl->addLayout(l2); |
178 | 187 | ||
179 | // int minw = 0; | 188 | int minw = 0; |
180 | // quit_b = new QPushButton(i18n("&Quit"), this); | 189 | quit_b = new QPushButton(i18n("&Quit"), this); |
181 | // // quit_b-> setGuiItem (KGuiItem(i18n("&Quit"), "exit" ) ); | 190 | // quit_b-> setGuiItem (KGuiItem(i18n("&Quit"), "exit" ) ); |
182 | // connect( quit_b, SIGNAL(clicked()), SLOT(quitbutton())); | 191 | connect( quit_b, SIGNAL(clicked()), SLOT(quitbutton())); |
183 | // if(quit_b->sizeHint().width() > minw) | 192 | if(quit_b->sizeHint().width() > minw) |
184 | // minw = quit_b->sizeHint().width(); | 193 | minw = quit_b->sizeHint().width(); |
185 | 194 | ||
186 | // setup_b = new QPushButton(i18n("&Setup..."), this); | 195 | setup_b = new QPushButton(i18n("&Setup..."), this); |
187 | // // setup_b->setGuiItem (KGuiItem(i18n("&Setup...")) ); | 196 | // setup_b->setGuiItem (KGuiItem(i18n("&Setup...")) ); |
188 | // connect( setup_b, SIGNAL(clicked()), SLOT(expandbutton())); | 197 | connect( setup_b, SIGNAL(clicked()), SLOT(expandbutton())); |
189 | // if(setup_b->sizeHint().width() > minw) | 198 | if(setup_b->sizeHint().width() > minw) |
190 | // minw = setup_b->sizeHint().width(); | 199 | minw = setup_b->sizeHint().width(); |
191 | 200 | ||
192 | 201 | ||
193 | 202 | ||
194 | // if(PPPData::data()->access() != KConfig::ReadWrite) | 203 | // if(_pppdata->access() != KConfig::ReadWrite) |
195 | // setup_b->setEnabled(false); | 204 | // setup_b->setEnabled(false); |
@@ -206,19 +215,19 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
206 | 215 | ||
207 | // connect_b = new QPushButton(i18n("&Connect"), this); | 216 | connect_b = new QPushButton(i18n("&Connect"), this); |
208 | // connect_b->setDefault(true); | 217 | connect_b->setDefault(true); |
209 | // connect_b->setFocus(); | 218 | connect_b->setFocus(); |
210 | // connect(connect_b, SIGNAL(clicked()), SLOT(beginConnect())); | 219 | connect(connect_b, SIGNAL(clicked()), SLOT(beginConnect())); |
211 | // if(connect_b->sizeHint().width() > minw) | 220 | if(connect_b->sizeHint().width() > minw) |
212 | // minw = connect_b->sizeHint().width(); | 221 | minw = connect_b->sizeHint().width(); |
213 | 222 | ||
214 | // quit_b->setFixedWidth(minw); | 223 | quit_b->setFixedWidth(minw); |
215 | // setup_b->setFixedWidth(minw); | 224 | setup_b->setFixedWidth(minw); |
216 | // // help_b->setFixedWidth(help_b->sizeHint().width()); | 225 | // help_b->setFixedWidth(help_b->sizeHint().width()); |
217 | // connect_b->setFixedWidth(minw); | 226 | connect_b->setFixedWidth(minw); |
218 | 227 | ||
219 | // l2->addWidget(quit_b); | 228 | l2->addWidget(quit_b); |
220 | // l2->addWidget(setup_b); | 229 | l2->addWidget(setup_b); |
221 | // // l2->addWidget(help_b); | 230 | // l2->addWidget(help_b); |
222 | // l2->addSpacing(20); | 231 | l2->addSpacing(20); |
223 | // l2->addWidget(connect_b); | 232 | l2->addWidget(connect_b); |
224 | 233 | ||
@@ -226,3 +235,3 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
226 | 235 | ||
227 | (void)new Modem; | 236 | (void)new Modem(_pppdata); |
228 | 237 | ||
@@ -237,3 +246,3 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
237 | // constructor of con_win reads position from config file | 246 | // constructor of con_win reads position from config file |
238 | // con_win = new ConWindow(0, "conw", this); | 247 | con_win = new ConWindow(_pppdata, 0, "conw", this); |
239 | // KWin::setIcons(con_win->winId(), kapp->icon(), kapp->miniIcon()); | 248 | // KWin::setIcons(con_win->winId(), kapp->icon(), kapp->miniIcon()); |
@@ -246,5 +255,5 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
246 | // resetaccounts(); | 255 | // resetaccounts(); |
247 | // con = new ConnectWidget(0, "con"); | 256 | con = new ConnectWidget(_pppdata, 0, "con"); |
248 | //KWin::setIcons(con->winId(), kapp->icon(), kapp->miniIcon() ); | 257 | //KWin::setIcons(con->winId(), kapp->icon(), kapp->miniIcon() ); |
249 | // connect(this, SIGNAL(begin_connect()),con, SLOT(preinit())); | 258 | connect(this, SIGNAL(begin_connect()),con, SLOT(preinit())); |
250 | // Is this the best we can do here? it's not right. | 259 | // Is this the best we can do here? it's not right. |
@@ -255,10 +264,10 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
255 | // connect the ConnectWidgets various signals | 264 | // connect the ConnectWidgets various signals |
256 | // // connect(con, SIGNAL(startAccounting()), | 265 | connect(con, SIGNAL(startAccounting()), |
257 | // // this, SLOT(startAccounting())); | 266 | this, SLOT(startAccounting())); |
258 | // // connect(con, SIGNAL(stopAccounting()), | 267 | connect(con, SIGNAL(stopAccounting()), |
259 | // // this, SLOT(stopAccounting())); | 268 | this, SLOT(stopAccounting())); |
260 | // connect(qApp, SIGNAL(saveYourself()), | 269 | connect(qApp, SIGNAL(saveYourself()), |
261 | // this, SLOT(saveMyself())); | 270 | this, SLOT(saveMyself())); |
262 | // connect(qApp, SIGNAL(shutDown()), | 271 | connect(qApp, SIGNAL(shutDown()), |
263 | // this, SLOT(shutDown())); | 272 | this, SLOT(shutDown())); |
264 | 273 | ||
@@ -276,3 +285,3 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
276 | // if(m_bCmdlAccount){ | 285 | // if(m_bCmdlAccount){ |
277 | // bool result = PPPData::data()->setAccount(m_strCmdlAccount); | 286 | // bool result = _pppdata->setAccount(m_strCmdlAccount); |
278 | // if (!result){ | 287 | // if (!result){ |
@@ -348,3 +357,3 @@ void KPPPWidget::enterPressedInPW() { | |||
348 | void KPPPWidget::saveMyself() { | 357 | void KPPPWidget::saveMyself() { |
349 | PPPData::data()->save(); | 358 | _pppdata->save(); |
350 | } | 359 | } |
@@ -357,3 +366,3 @@ void KPPPWidget::shutDown() { | |||
357 | void KPPPWidget::log_window_toggled(bool on) { | 366 | void KPPPWidget::log_window_toggled(bool on) { |
358 | PPPData::data()->set_show_log_window(on); | 367 | _pppdata->set_show_log_window(on); |
359 | } | 368 | } |
@@ -366,3 +375,3 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
366 | 375 | ||
367 | // int count = PPPData::data()->count(); | 376 | // int count = _pppdata->count(); |
368 | 377 | ||
@@ -377,4 +386,4 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
377 | // for(int i=0; i < count; i++) { | 386 | // for(int i=0; i < count; i++) { |
378 | // PPPData::data()->setAccountbyIndex(i); | 387 | // _pppdata->setAccountbyIndex(i); |
379 | // connectto_c->insertItem(PPPData::data()->accname()); | 388 | // connectto_c->insertItem(_pppdata->accname()); |
380 | // } | 389 | // } |
@@ -382,10 +391,10 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
382 | // //set the default account | 391 | // //set the default account |
383 | // if(!PPPData::data()->defaultAccount().isEmpty()) { | 392 | // if(!_pppdata->defaultAccount().isEmpty()) { |
384 | // for(int i=0; i < count; i++) | 393 | // for(int i=0; i < count; i++) |
385 | // if(PPPData::data()->defaultAccount() == connectto_c->text(i)) { | 394 | // if(_pppdata->defaultAccount() == connectto_c->text(i)) { |
386 | // connectto_c->setCurrentItem(i); | 395 | // connectto_c->setCurrentItem(i); |
387 | // PPPData::data()->setAccountbyIndex(i); | 396 | // _pppdata->setAccountbyIndex(i); |
388 | 397 | ||
389 | // ID_Edit->setText(PPPData::data()->storedUsername()); | 398 | // ID_Edit->setText(_pppdata->storedUsername()); |
390 | // PW_Edit->setText(PPPData::data()->storedPassword()); | 399 | // PW_Edit->setText(_pppdata->storedPassword()); |
391 | // } | 400 | // } |
@@ -394,6 +403,6 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
394 | // if(count > 0) { | 403 | // if(count > 0) { |
395 | // PPPData::data()->setDefaultAccount(connectto_c->text(0)); | 404 | // _pppdata->setDefaultAccount(connectto_c->text(0)); |
396 | // PPPData::data()->save(); | 405 | // _pppdata->save(); |
397 | // ID_Edit->setText(PPPData::data()->storedUsername()); | 406 | // ID_Edit->setText(_pppdata->storedUsername()); |
398 | // PW_Edit->setText(PPPData::data()->storedPassword()); | 407 | // PW_Edit->setText(_pppdata->storedPassword()); |
399 | // } | 408 | // } |
@@ -415,7 +424,9 @@ void KPPPWidget::interruptConnection() { | |||
415 | // interrupt dial up | 424 | // interrupt dial up |
416 | // if (con->isVisible()) | 425 | // |
417 | // emit con->cancelbutton(); | 426 | |
427 | if (con->isVisible()) | ||
428 | emit con->cancelbutton(); | ||
418 | 429 | ||
419 | // disconnect if online | 430 | // disconnect if online |
420 | if (PPPData::data()->pppdRunning()) | 431 | if (_pppdata->pppdRunning()) |
421 | emit disconnect(); | 432 | emit disconnect(); |
@@ -430,3 +441,3 @@ void KPPPWidget::sigPPPDDied() { | |||
430 | // such as would be the case when the log file viewer exits. | 441 | // such as would be the case when the log file viewer exits. |
431 | if(PPPData::data()->pppdRunning() || PPPData::data()->pppdError()) { | 442 | if(_pppdata->pppdRunning() || _pppdata->pppdError()) { |
432 | qDebug( "It was pppd that died" ); | 443 | qDebug( "It was pppd that died" ); |
@@ -442,3 +453,3 @@ void KPPPWidget::sigPPPDDied() { | |||
442 | 453 | ||
443 | PPPData::data()->setpppdRunning(false); | 454 | _pppdata->setpppdRunning(false); |
444 | 455 | ||
@@ -446,3 +457,3 @@ void KPPPWidget::sigPPPDDied() { | |||
446 | QApplication::flushX(); | 457 | QApplication::flushX(); |
447 | execute_command(PPPData::data()->command_on_disconnect()); | 458 | execute_command(_pppdata->command_on_disconnect()); |
448 | 459 | ||
@@ -450,3 +461,3 @@ void KPPPWidget::sigPPPDDied() { | |||
450 | 461 | ||
451 | // con_win->stopClock(); | 462 | con_win->stopClock(); |
452 | // DockWidget::dock_widget->stop_stats(); | 463 | // DockWidget::dock_widget->stop_stats(); |
@@ -454,20 +465,21 @@ void KPPPWidget::sigPPPDDied() { | |||
454 | 465 | ||
455 | if(!PPPData::data()->pppdError()) | 466 | if(!_pppdata->pppdError()) |
456 | PPPData::data()->setpppdError(E_PPPD_DIED); | 467 | _pppdata->setpppdError(E_PPPD_DIED); |
457 | removedns(); | 468 | removedns(); |
458 | Modem::modem->unlockdevice(); | 469 | Modem::modem->unlockdevice(); |
459 | // con->pppdDied(); | 470 | // |
471 | con->pppdDied(); | ||
460 | 472 | ||
461 | if(!PPPData::data()->automatic_redial()) { | 473 | if(!_pppdata->automatic_redial()) { |
462 | quit_b->setFocus(); | 474 | quit_b->setFocus(); |
463 | show(); | 475 | show(); |
464 | // con_win->stopClock(); | 476 | con_win->stopClock(); |
465 | //stopAccounting(); | 477 | //stopAccounting(); |
466 | // con_win->hide(); | 478 | con_win->hide(); |
467 | // con->hide(); | 479 | con->hide(); |
468 | 480 | ||
469 | PPPData::data()->setpppdRunning(false); | 481 | _pppdata->setpppdRunning(false); |
470 | // // not in a signal handler !!! KNotifyClient::beep(); | 482 | // // not in a signal handler !!! KNotifyClient::beep(); |
471 | QString msg; | 483 | QString msg; |
472 | if (PPPData::data()->pppdError() == E_IF_TIMEOUT) | 484 | if (_pppdata->pppdError() == E_IF_TIMEOUT) |
473 | msg = i18n("Timeout expired while waiting for the PPP interface " | 485 | msg = i18n("Timeout expired while waiting for the PPP interface " |
@@ -492,13 +504,13 @@ void KPPPWidget::sigPPPDDied() { | |||
492 | 504 | ||
493 | if(PPPData::data()->authMethod() == AUTH_PAP || | 505 | if(_pppdata->authMethod() == AUTH_PAP || |
494 | PPPData::data()->authMethod() == AUTH_CHAP || | 506 | _pppdata->authMethod() == AUTH_CHAP || |
495 | PPPData::data()->authMethod() == AUTH_PAPCHAP) | 507 | _pppdata->authMethod() == AUTH_PAPCHAP) |
496 | Modem::modem->setSecret(PPPData::data()->authMethod(), | 508 | Modem::modem->setSecret(_pppdata->authMethod(), |
497 | encodeWord(PPPData::data()->storedUsername()), | 509 | encodeWord(_pppdata->storedUsername()), |
498 | encodeWord(PPPData::data()->password())); | 510 | encodeWord(_pppdata->password())); |
499 | 511 | ||
500 | // con_win->hide(); | 512 | con_win->hide(); |
501 | // con_win->stopClock(); | 513 | con_win->stopClock(); |
502 | //stopAccounting(); | 514 | //stopAccounting(); |
503 | PPPData::data()->setpppdRunning(false); | 515 | _pppdata->setpppdRunning(false); |
504 | // not in a signal handler !!!KNotifyClient::beep(); | 516 | // not in a signal handler !!!KNotifyClient::beep(); |
@@ -507,3 +519,3 @@ void KPPPWidget::sigPPPDDied() { | |||
507 | } | 519 | } |
508 | PPPData::data()->setpppdError(0); | 520 | _pppdata->setpppdError(0); |
509 | } | 521 | } |
@@ -528,6 +540,6 @@ void KPPPWidget::sigPPPDDied() { | |||
528 | void KPPPWidget::newdefaultaccount(int i) { | 540 | void KPPPWidget::newdefaultaccount(int i) { |
529 | PPPData::data()->setDefaultAccount(connectto_c->text(i)); | 541 | _pppdata->setDefaultAccount(connectto_c->text(i)); |
530 | PPPData::data()->save(); | 542 | _pppdata->save(); |
531 | ID_Edit->setText(PPPData::data()->storedUsername()); | 543 | ID_Edit->setText(_pppdata->storedUsername()); |
532 | PW_Edit->setText(PPPData::data()->storedPassword()); | 544 | PW_Edit->setText(_pppdata->storedPassword()); |
533 | } | 545 | } |
@@ -541,6 +553,6 @@ void KPPPWidget::beginConnect() { | |||
541 | // if(!m_bCmdlAccount) { | 553 | // if(!m_bCmdlAccount) { |
542 | // PPPData::data()->setAccount(connectto_c->currentText()); | 554 | // _pppdata->setAccount(connectto_c->currentText()); |
543 | // PPPData::data()->setPassword(PW_Edit->text()); | 555 | // _pppdata->setPassword(PW_Edit->text()); |
544 | // } else { | 556 | // } else { |
545 | PPPData::data()->setPassword(PPPData::data()->storedPassword()); | 557 | _pppdata->setPassword(_pppdata->storedPassword()); |
546 | // } | 558 | // } |
@@ -562,3 +574,3 @@ void KPPPWidget::beginConnect() { | |||
562 | "setuid permission and that " | 574 | "setuid permission and that " |
563 | "pppd is executable.").arg(PPPData::data()->pppdPath()); | 575 | "pppd is executable.").arg(_pppdata->pppdPath()); |
564 | KMessageBox::error(this, string); | 576 | KMessageBox::error(this, string); |
@@ -569,3 +581,3 @@ void KPPPWidget::beginConnect() { | |||
569 | 581 | ||
570 | QFileInfo info2(PPPData::data()->modemDevice()); | 582 | QFileInfo info2(_pppdata->modemDevice()); |
571 | 583 | ||
@@ -577,3 +589,3 @@ void KPPPWidget::beginConnect() { | |||
577 | "the modem tab of " | 589 | "the modem tab of " |
578 | "the setup dialog.").arg(PPPData::data()->modemDevice()); | 590 | "the setup dialog.").arg(_pppdata->modemDevice()); |
579 | QMessageBox::warning(this, "error", string); | 591 | QMessageBox::warning(this, "error", string); |
@@ -584,16 +596,13 @@ void KPPPWidget::beginConnect() { | |||
584 | // supplied | 596 | // supplied |
585 | if(PPPData::data()->authMethod() == AUTH_PAP || | 597 | if(_pppdata->authMethod() == AUTH_PAP || |
586 | PPPData::data()->authMethod() == AUTH_CHAP || | 598 | _pppdata->authMethod() == AUTH_CHAP || |
587 | PPPData::data()->authMethod() == AUTH_PAPCHAP ) { | 599 | _pppdata->authMethod() == AUTH_PAPCHAP ) { |
588 | if(ID_Edit->text().isEmpty()) { | 600 | if(ID_Edit->text().isEmpty()) { |
589 | QMessageBox::warning(this,"error", | 601 | QMessageBox::warning(this,"error", |
590 | i18n( | 602 | i18n("You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!")); |
591 | "You have selected the authentication " | 603 | // FIXME: return; |
592 | "method PAP or CHAP. This requires that you " | ||
593 | "supply a username and a password!")); | ||
594 | return; | ||
595 | } else { | 604 | } else { |
596 | if(!Modem::modem->setSecret(PPPData::data()->authMethod(), | 605 | if(!Modem::modem->setSecret(_pppdata->authMethod(), |
597 | encodeWord(PPPData::data()->storedUsername()), | 606 | encodeWord(_pppdata->storedUsername()), |
598 | encodeWord(PPPData::data()->password()))) { | 607 | encodeWord(_pppdata->password()))) { |
599 | QString s; | 608 | QString s; |
@@ -607,3 +616,3 @@ void KPPPWidget::beginConnect() { | |||
607 | 616 | ||
608 | if (PPPData::data()->phonenumber().isEmpty()) { | 617 | if (_pppdata->phonenumber().isEmpty()) { |
609 | QString s = i18n("You must specify a telephone number!"); | 618 | QString s = i18n("You must specify a telephone number!"); |
@@ -615,3 +624,3 @@ void KPPPWidget::beginConnect() { | |||
615 | 624 | ||
616 | QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname()); | 625 | QString tit = i18n("Connecting to: %1").arg(_pppdata->accname()); |
617 | // con->setCaption(tit); | 626 | // con->setCaption(tit); |
@@ -626,7 +635,7 @@ void KPPPWidget::beginConnect() { | |||
626 | void KPPPWidget::disconnect() { | 635 | void KPPPWidget::disconnect() { |
627 | if (!PPPData::data()->command_before_disconnect().isEmpty()) { | 636 | if (!_pppdata->command_before_disconnect().isEmpty()) { |
628 | // con_win->hide(); | 637 | con_win->hide(); |
629 | // con->show(); | 638 | con->show(); |
630 | // con->setCaption(i18n("Disconnecting...")); | 639 | con->setCaption(i18n("Disconnecting...")); |
631 | // con->setMsg(i18n("Executing command before disconnection.")); | 640 | con->setMsg(i18n("Executing command before disconnection.")); |
632 | 641 | ||
@@ -635,3 +644,3 @@ void KPPPWidget::disconnect() { | |||
635 | // pid_t id = | 644 | // pid_t id = |
636 | execute_command(PPPData::data()->command_before_disconnect()); | 645 | execute_command(_pppdata->command_before_disconnect()); |
637 | // int i, status; | 646 | // int i, status; |
@@ -644,3 +653,3 @@ void KPPPWidget::disconnect() { | |||
644 | 653 | ||
645 | // con->hide(); | 654 | con->hide(); |
646 | } | 655 | } |
@@ -653,3 +662,3 @@ void KPPPWidget::disconnect() { | |||
653 | QApplication::flushX(); | 662 | QApplication::flushX(); |
654 | execute_command(PPPData::data()->command_on_disconnect()); | 663 | execute_command(_pppdata->command_on_disconnect()); |
655 | 664 | ||
@@ -661,5 +670,5 @@ void KPPPWidget::disconnect() { | |||
661 | 670 | ||
662 | // con_win->stopClock(); | 671 | con_win->stopClock(); |
663 | // p_kppp->stopAccounting(); | 672 | // p_kppp->stopAccounting(); |
664 | // con_win->hide(); | 673 | con_win->hide(); |
665 | 674 | ||
@@ -683,3 +692,3 @@ void KPPPWidget::disconnect() { | |||
683 | void KPPPWidget::quitbutton() { | 692 | void KPPPWidget::quitbutton() { |
684 | if(PPPData::data()->pppdRunning()) { | 693 | if(_pppdata->pppdRunning()) { |
685 | int ok = QMessageBox::warning(this, | 694 | int ok = QMessageBox::warning(this, |
@@ -690,3 +699,3 @@ void KPPPWidget::quitbutton() { | |||
690 | QApplication::flushX(); | 699 | QApplication::flushX(); |
691 | execute_command(PPPData::data()->command_on_disconnect()); | 700 | execute_command(_pppdata->command_on_disconnect()); |
692 | removedns(); | 701 | removedns(); |
@@ -695,6 +704,6 @@ void KPPPWidget::quitbutton() { | |||
695 | } else { | 704 | } else { |
696 | if (!PPPData::data()->accname().isEmpty() && !PPPData::data()->storePassword()) | 705 | if (!_pppdata->accname().isEmpty() && !_pppdata->storePassword()) |
697 | PPPData::data()->setStoredPassword(""); | 706 | _pppdata->setStoredPassword(""); |
698 | } | 707 | } |
699 | PPPData::data()->save(); | 708 | _pppdata->save(); |
700 | qApp->quit(); | 709 | qApp->quit(); |
@@ -712,9 +721,9 @@ void KPPPWidget::quitbutton() { | |||
712 | 721 | ||
713 | // kdDebug() << "AcctEnabled: " << PPPData::data()->AcctEnabled() << endl; | 722 | // kdDebug() << "AcctEnabled: " << _pppdata->AcctEnabled() << endl; |
714 | 723 | ||
715 | // // load the ruleset | 724 | // // load the ruleset |
716 | // if(!PPPData::data()->AcctEnabled()) | 725 | // if(!_pppdata->AcctEnabled()) |
717 | // return; | 726 | // return; |
718 | 727 | ||
719 | // QString d = AccountingBase::getAccountingFile(PPPData::data()->accountingFile()); | 728 | // QString d = AccountingBase::getAccountingFile(_pppdata->accountingFile()); |
720 | // // if(::access(d.data(), X_OK) != 0) | 729 | // // if(::access(d.data(), X_OK) != 0) |
@@ -728,5 +737,5 @@ void KPPPWidget::quitbutton() { | |||
728 | 737 | ||
729 | // // if(!acct->loadRuleSet(PPPData::data()->accountingFile())) { | 738 | // // if(!acct->loadRuleSet(_pppdata->accountingFile())) { |
730 | // // QString s= i18n("Can not load the accounting " | 739 | // // QString s= i18n("Can not load the accounting " |
731 | // // "ruleset \"%1\"!").arg(PPPData::data()->accountingFile()); | 740 | // // "ruleset \"%1\"!").arg(_pppdata->accountingFile()); |
732 | 741 | ||
@@ -745,5 +754,5 @@ void KPPPWidget::quitbutton() { | |||
745 | // // if(stats->totalbytes != 0) | 754 | // // if(stats->totalbytes != 0) |
746 | // // PPPData::data()->setTotalBytes(stats->totalbytes); | 755 | // // _pppdata->setTotalBytes(stats->totalbytes); |
747 | 756 | ||
748 | // if(!PPPData::data()->AcctEnabled()) | 757 | // if(!_pppdata->AcctEnabled()) |
749 | // return; | 758 | // return; |
@@ -768,3 +777,3 @@ void KPPPWidget::usernameChanged(const QString &) { | |||
768 | // store username for later use | 777 | // store username for later use |
769 | PPPData::data()->setStoredUsername(ID_Edit->text()); | 778 | _pppdata->setStoredUsername(ID_Edit->text()); |
770 | } | 779 | } |
@@ -774,6 +783,6 @@ void KPPPWidget::passwordChanged(const QString &) { | |||
774 | // store the password if so requested | 783 | // store the password if so requested |
775 | if(PPPData::data()->storePassword()) | 784 | if(_pppdata->storePassword()) |
776 | PPPData::data()->setStoredPassword(PW_Edit->text()); | 785 | _pppdata->setStoredPassword(PW_Edit->text()); |
777 | else | 786 | else |
778 | PPPData::data()->setStoredPassword(""); | 787 | _pppdata->setStoredPassword(""); |
779 | } | 788 | } |
@@ -817,3 +826,3 @@ void KPPPWidget::showNews() { | |||
817 | #define QUICKHELP_HINT "Hint_QuickHelp" | 826 | #define QUICKHELP_HINT "Hint_QuickHelp" |
818 | if(PPPData::data()->readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { | 827 | if(_pppdata->readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { |
819 | QDialog dlg(0, 0, true); | 828 | QDialog dlg(0, 0, true); |
@@ -869,4 +878,4 @@ void KPPPWidget::showNews() { | |||
869 | if(cb->isChecked()) { | 878 | if(cb->isChecked()) { |
870 | PPPData::data()->writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); | 879 | _pppdata->writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); |
871 | PPPData::data()->save(); | 880 | _pppdata->save(); |
872 | } | 881 | } |