|
|
QString script = "rppppoek.sh"; | QString script = "rppppoek.sh"; |
KActionCollection* actionCollection = new KActionCollection(this); | KActionCollection* actionCollection = new KActionCollection(this); |
| |
|
stat = new KProcess; |
|
*stat << "/sbin/ifconfig" << "ppp0"; |
|
stat->start(KProcess::Block, KProcess::Stdout); |
|
if (stat->exitStatus()) { |
|
setPixmap(Icon("connect_no")); |
|
} else { |
|
setPixmap(Icon("connect_established")); |
|
} |
|
|
start = new KProcess; | start = new KProcess; |
*start << script << "connect"; | *start << script << "connect"; |
| |
|
|
*stop << script << "dconnect"; | *stop << script << "dconnect"; |
| |
ipFound=false; | ipFound=false; |
setPixmap(Icon("kppp")); |
/* setPixmap(Icon("kppp")); */ |
| |
KAction* about = KStdAction::aboutApp(this, SLOT (showAbout()), actionCollection); | KAction* about = KStdAction::aboutApp(this, SLOT (showAbout()), actionCollection); |
conToProv = new KAction(i18n("Connect"), Icon("connect_established"), 0, 0, 0, actionCollection, 0); | conToProv = new KAction(i18n("Connect"), Icon("connect_established"), 0, 0, 0, actionCollection, 0); |
|
|
void RPPPPoEK::connected(void){ | void RPPPPoEK::connected(void){ |
if (start->normalExit()){ | if (start->normalExit()){ |
if (start->exitStatus() == 0) | if (start->exitStatus() == 0) |
KMessageBox::information(this, i18n("Connected successfully")); |
setPixmap(Icon("connect_established")); |
|
/* KMessageBox::information(this, i18n("Connected successfully")); */ |
else | else |
KMessageBox::sorry(this, i18n("Couldn't connect")); | KMessageBox::sorry(this, i18n("Couldn't connect")); |
} | } |
|
|
void RPPPPoEK::disconnected(void){ | void RPPPPoEK::disconnected(void){ |
if (stop->normalExit()){ | if (stop->normalExit()){ |
if (stop->exitStatus() == 0) | if (stop->exitStatus() == 0) |
KMessageBox::information(this, i18n("Disconnected successfully")); |
setPixmap(Icon("connect_no")); |
|
/* KMessageBox::information(this, i18n("Disconnected successfully")); */ |
else | else |
KMessageBox::sorry(this, i18n("Couldn't disconnect")); | KMessageBox::sorry(this, i18n("Couldn't disconnect")); |
} | } |