summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/kpppwidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/ppp/kpppwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/kpppwidget.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp
index e21bbc7..fd09332 100644
--- a/noncore/settings/networksettings/ppp/kpppwidget.cpp
+++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp
@@ -53,55 +53,55 @@
//#include "main.h"
#include "auth.h"
#include "modem.h"
//#include "ppplog.h"
//#include "opener.h"
//#include "requester.h"
//#include "pppstats.h"
#include "pppdata.h"
#include "general.h"
#include "interface.h"
#define execute_command system
KPPPWidget *p_kppp = 0;
KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl )
: QDialog(parent, name, modal, Qt::WStyle_ContextHelp ), _pppdata(pd)
{
// tabWindow = 0;
p_kppp = this;
// before doing anything else, run a few tests
if (!_pppdata->setModemDevice( i->getInterfaceName() ))
_pppdata->setModemDevice("/dev/modem");
- qDebug("PPPConfigWidget::PPPConfigWidget");
- qDebug(" interface->getHardwareName >%s<", i->getHardwareName().latin1());
+ odebug << "PPPConfigWidget::PPPConfigWidget" << oendl;
+ odebug << " interface->getHardwareName >" << i->getHardwareName().latin1() << "<" << oendl;
if (!_pppdata->setAccount( i->getHardwareName() ))
_pppdata->setAccount( 0 );
- qDebug(" _pppdata->accname >%s<",_pppdata->accname().latin1());
- qDebug(" _pppdata->currentAccountID() >%i<",_pppdata->currentAccountID());
+ odebug << " _pppdata->accname >" << _pppdata->accname().latin1() << "<" << oendl;
+ odebug << " _pppdata->currentAccountID() >" << _pppdata->currentAccountID() << "<" << oendl;
int result = runTests();
if(result == TEST_CRITICAL)
exit(4);
// installEventFilter(this);
QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
QGridLayout *l1 = new QGridLayout(3, 4);
tl->addLayout(l1);
l1->addColSpacing(0, 10);
l1->addColSpacing(3, 10);
l1->setColStretch(1, 3);
l1->setColStretch(2, 4);
label1 = new QLabel(QObject::tr("C&onnect to: "), this);
l1->addWidget(label1, 0, 1);
connectto_c = new QComboBox(false, this);
label1->setBuddy(connectto_c);
connect(connectto_c, SIGNAL(activated(int)),
SLOT(newdefaultaccount(int)));
@@ -284,49 +284,49 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
// }
// } else
// expandbutton();
// show();
//#define KPPP_SHOW_NEWS
#ifdef KPPP_SHOW_NEWS
// keep user informed about recent changes
if(!m_bCmdlAccount)
showNews();
#endif
}
KPPPWidget::~KPPPWidget()
{
p_kppp = 0;
// delete stats;
}
// bool KPPPWidget::eventFilter(QObject *o, QEvent *e) {
// if(e->type() == QEvent::User) {
// switch(((SignalEvent*)e)->sigType()) {
// case SIGINT:
-// qDebug( "Received a SIGINT" );
+// odebug << "Received a SIGINT" << oendl;
// interruptConnection();
// break;
// case SIGCHLD:
// sigChld();
// break;
// case SIGUSR1:
// sigPPPDDied();
// break;
// }
// return true;
// }
// if(o == connect_b) {
// if(e->type() == QEvent::KeyPress) {
// if(connect_b->hasFocus() && ((QKeyEvent *)e)->key() == Qt::Key_Return) {
// beginConnect();
// return true;
// }
// }
// }
// return false;
// }
@@ -402,137 +402,137 @@ void KPPPWidget::log_window_toggled(bool on) {
// connect(PW_Edit, SIGNAL(textChanged(const QString&)),
// this, SLOT(passwordChanged(const QString&)));
// if (ID_Edit->text().isEmpty())
// ID_Edit->setFocus();
// else if (PW_Edit->text().isEmpty())
// PW_Edit->setFocus();
// }
void KPPPWidget::interruptConnection() {
// interrupt dial up
//
if (con->isVisible())
emit con->cancelbutton();
// disconnect if online
if (_pppdata->pppdRunning())
emit disconnect();
}
void KPPPWidget::sigPPPDDied() {
- qDebug( "Received a SIGUSR1" );
+ odebug << "Received a SIGUSR1" << oendl;
// if we are not connected pppdpid is -1 so have have to check for that
// in the followin line to make sure that we don't raise a false alarm
// such as would be the case when the log file viewer exits.
if(_pppdata->pppdRunning() || _pppdata->pppdError()) {
- qDebug( "It was pppd that died" );
+ odebug << "It was pppd that died" << oendl;
// when we killpppd() on Cancel in ConnectWidget
// we set pppid to -1 so we won't
// enter this block
// just to be sure
Modem::modem->removeSecret(AUTH_PAP);
Modem::modem->removeSecret(AUTH_CHAP);
_pppdata->setpppdRunning(false);
- qDebug( "Executing command on disconnect since pppd has died." );
+ odebug << "Executing command on disconnect since pppd has died." << oendl;
QApplication::flushX();
execute_command(_pppdata->command_on_disconnect());
// stopAccounting();
con_win->stopClock();
// DockWidget::dock_widget->stop_stats();
// DockWidget::dock_widget->hide();
if(!_pppdata->pppdError())
_pppdata->setpppdError(E_PPPD_DIED);
removedns();
Modem::modem->unlockdevice();
//
con->pppdDied();
if(!_pppdata->automatic_redial()) {
quit_b->setFocus();
show();
con_win->stopClock();
// stopAccounting();
con_win->hide();
con->hide();
_pppdata->setpppdRunning(false);
// // not in a signal handler !!! KNotifyClient::beep();
QString msg;
if (_pppdata->pppdError() == E_IF_TIMEOUT)
msg = QObject::tr("Timeout expired while waiting for the PPP interface "
"to come up!");
else {
msg = QObject::tr("<p>The pppd daemon died unexpectedly!</p>");
Modem::modem->pppdExitStatus();
if (Modem::modem->lastStatus != 99) { // more recent pppds only
msg += QObject::tr("<p>Exit status: %1").arg(Modem::modem->lastStatus);
msg += QObject::tr("</p><p>See 'man pppd' for an explanation of the error "
"codes or take a look at the kppp FAQ on "
" <a href=http://devel-home.kde.org/~kppp/index.html>"
"http://devel-home.kde.org/~kppp/index.html</a></p>");
}
}
// if(QMessageBox::warning(0, msg, QObject::tr("Error"), QObject::tr("&OK"), QObject::tr("&Details...")) == QMessageBox::No)
// // PPPL_ShowLog();
// } else { /* reconnect on disconnect */
if (false){
- qDebug( "Trying to reconnect... " );
+ odebug << "Trying to reconnect... " << oendl;
if(_pppdata->authMethod() == AUTH_PAP ||
_pppdata->authMethod() == AUTH_CHAP ||
_pppdata->authMethod() == AUTH_PAPCHAP)
Modem::modem->setSecret(_pppdata->authMethod(),
encodeWord(_pppdata->storedUsername()),
encodeWord(_pppdata->password()));
con_win->hide();
con_win->stopClock();
// stopAccounting();
_pppdata->setpppdRunning(false);
// not in a signal handler !!! KNotifyClient::beep();
emit cmdl_start();
}
}
_pppdata->setpppdError(0);
}
}
// void KPPPWidget::sigChld() {
-// qDebug( "sigchld()" );
+// odebug << "sigchld()" << oendl;
// // pid_t id = wait(0L);
// // if(id == helperPid && helperPid != -1) {
// // kdDebug(5002) << "It was the setuid child that died" << endl;
// // helperPid = -1;
// QString msg = QObject::tr("kppp's helper process just died.\n"
// "Since a further execution would be pointless, "
// "kppp will shut down now.");
// QMessageBox::warning(0L,"error", msg);
// //remove_pidfile();
// exit(1);
// // }
// }
void KPPPWidget::newdefaultaccount(int i) {
_pppdata->setDefaultAccount(connectto_c->text(i));
_pppdata->save();
ID_Edit->setText(_pppdata->storedUsername());
PW_Edit->setText(_pppdata->storedPassword());
}