summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/connect.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/ppp/connect.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/connect.cpp166
1 files changed, 95 insertions, 71 deletions
diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp
index 2400d7b..e3fab24 100644
--- a/noncore/settings/networksettings/ppp/connect.cpp
+++ b/noncore/settings/networksettings/ppp/connect.cpp
@@ -34,3 +34,2 @@
//#include <klocale.h>
-#define i18n QObject::tr
#include <qmessagebox.h>
@@ -101,3 +100,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
QVBoxLayout *tl = new QVBoxLayout(this, 8, 10);
- QString tit = i18n("Connecting to: ");
+ QString tit = QObject::tr("Connecting to: ");
setCaption(tit);
@@ -110,3 +109,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
messg->setAlignment(AlignCenter);
- messg->setText(i18n("Unable to create modem lock file."));
+ messg->setText(QObject::tr("Unable to create modem lock file."));
messg->setMinimumHeight(messg->sizeHint().height() + 5);
@@ -116,5 +115,5 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
if (_ifaceppp->getStatus())
- messg->setText(i18n("Online"));
+ messg->setText(QObject::tr("Online"));
else
- messg->setText(i18n("Offline"));
+ messg->setText(QObject::tr("Offline"));
l0->addSpacing(10);
@@ -127,3 +126,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
- debug = new QPushButton(i18n("Log"), this);
+ debug = new QPushButton(QObject::tr("Log"), this);
debug->setToggleButton(true);
@@ -132,3 +131,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
- cancel = new QPushButton(i18n("Cancel"), this);
+ cancel = new QPushButton(QObject::tr("Cancel"), this);
cancel->setFocus();
@@ -175,3 +174,3 @@ void ConnectWidget::preinit() {
// you have to see to believe ...
- messg->setText(i18n("Looking for modem..."));
+ messg->setText(QObject::tr("Looking for modem..."));
inittimer->start(100);
@@ -203,3 +202,3 @@ void ConnectWidget::init() {
- QString tit = i18n("Connecting to: %1").arg(_ifaceppp->data()->accname());
+ QString tit = QObject::tr("Connecting to: %1").arg(_ifaceppp->data()->accname());
setCaption(tit);
@@ -210,4 +209,4 @@ void ConnectWidget::init() {
if (!_ifaceppp->data()->command_before_connect().isEmpty()) {
- messg->setText(i18n("Running pre-startup command..."));
- emit debugMessage(i18n("Running pre-startup command..."));
+ messg->setText(QObject::tr("Running pre-startup command..."));
+ emit debugMessage(QObject::tr("Running pre-startup command..."));
@@ -228,3 +227,3 @@ void ConnectWidget::init() {
if (lock == 1) {
- messg->setText(i18n("Modem device is locked."));
+ messg->setText(QObject::tr("Modem device is locked."));
vmain = 20; // wait until cancel is pressed
@@ -234,3 +233,3 @@ void ConnectWidget::init() {
if (lock == -1) {
- messg->setText(i18n("Unable to create modem lock file."));
+ messg->setText(QObject::tr("Unable to create modem lock file."));
vmain = 20; // wait until cancel is pressed
@@ -281,4 +280,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if(substate == -1) {
- messg->setText(i18n("Initializing modem..."));
- emit debugMessage(i18n("Initializing modem..."));
+ messg->setText(QObject::tr("Initializing modem..."));
+ emit debugMessage(QObject::tr("Initializing modem..."));
substate = 0;
@@ -319,3 +318,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
QString sToneDuration = "ATS11=" + QString::number(_ifaceppp->data()->modemToneDuration());
- QString msg = i18n("Setting ") + sToneDuration;
+ QString msg = QObject::tr("Setting ") + sToneDuration;
messg->setText(msg);
@@ -342,4 +341,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
}
- messg->setText(i18n("Setting speaker volume..."));
- emit debugMessage(i18n("Setting speaker volume..."));
+ messg->setText(QObject::tr("Setting speaker volume..."));
+ emit debugMessage(QObject::tr("Setting speaker volume..."));
@@ -358,3 +357,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if(!_ifaceppp->data()->waitForDialTone()) {
- QString msg = i18n("Turning off dial tone waiting...");
+ QString msg = QObject::tr("Turning off dial tone waiting...");
messg->setText(msg);
@@ -379,3 +378,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
bmarg += *plist.at(dialnumber);
- QString bm = i18n("Dialing %1").arg(bmarg);
+ QString bm = QObject::tr("Dialing %1").arg(bmarg);
messg->setText(bm);
@@ -410,3 +409,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- messg->setText(i18n("Line busy. Hanging up..."));
+ messg->setText(QObject::tr("Line busy. Hanging up..."));
emit debugPutChar('\n');
@@ -415,3 +414,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if(_ifaceppp->data()->busyWait() > 0) {
- QString bm = i18n("Line busy. Waiting: %1 seconds").arg(_ifaceppp->data()->busyWait());
+ QString bm = QObject::tr("Line busy. Waiting: %1 seconds").arg(_ifaceppp->data()->busyWait());
messg->setText(bm);
@@ -434,3 +433,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- messg->setText(i18n("No Dialtone"));
+ messg->setText(QObject::tr("No Dialtone"));
vmain = 20;
@@ -443,3 +442,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- messg->setText(i18n("No Carrier"));
+ messg->setText(QObject::tr("No Carrier"));
vmain = 20;
@@ -481,3 +480,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "Scan") {
- QString bm = i18n("Scanning %1").arg(scriptArgument);
+ QString bm = QObject::tr("Scanning %1").arg(scriptArgument);
messg->setText(bm);
@@ -491,3 +490,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "Save") {
- QString bm = i18n("Saving %1").arg(scriptArgument);
+ QString bm = QObject::tr("Saving %1").arg(scriptArgument);
messg->setText(bm);
@@ -509,3 +508,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "Send" || scriptCommand == "SendNoEcho") {
- QString bm = i18n("Sending %1");
+ QString bm = QObject::tr("Sending %1");
@@ -534,3 +533,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "Expect") {
- QString bm = i18n("Expecting %1").arg(scriptArgument);
+ QString bm = QObject::tr("Expecting %1").arg(scriptArgument);
messg->setText(bm);
@@ -548,3 +547,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "Pause") {
- QString bm = i18n("Pause %1 seconds").arg(scriptArgument);
+ QString bm = QObject::tr("Pause %1 seconds").arg(scriptArgument);
messg->setText(bm);
@@ -565,3 +564,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- QString bm = i18n("Timeout %1 seconds").arg(scriptArgument);
+ QString bm = QObject::tr("Timeout %1 seconds").arg(scriptArgument);
messg->setText(bm);
@@ -577,4 +576,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "Hangup") {
- messg->setText(i18n("Hangup"));
- emit debugMessage(i18n("Hangup"));
+ messg->setText(QObject::tr("Hangup"));
+ emit debugMessage(QObject::tr("Hangup"));
@@ -591,4 +590,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- messg->setText(i18n("Answer"));
- emit debugMessage(i18n("Answer"));
+ messg->setText(QObject::tr("Answer"));
+ emit debugMessage(QObject::tr("Answer"));
@@ -600,3 +599,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "ID") {
- QString bm = i18n("ID %1").arg(scriptArgument);
+ QString bm = QObject::tr("ID %1").arg(scriptArgument);
messg->setText(bm);
@@ -636,3 +635,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "Password") {
- QString bm = i18n("Password %1").arg(scriptArgument);
+ QString bm = QObject::tr("Password %1").arg(scriptArgument);
messg->setText(bm);
@@ -673,3 +672,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "Prompt") {
- QString bm = i18n("Prompting %1");
+ QString bm = QObject::tr("Prompting %1");
@@ -710,3 +709,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "PWPrompt") {
- QString bm = i18n("PW Prompt %1").arg(scriptArgument);
+ QString bm = QObject::tr("PW Prompt %1").arg(scriptArgument);
messg->setText(bm);
@@ -735,3 +734,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- QString bm = i18n("Loop Start %1").arg(scriptArgument);
+ QString bm = QObject::tr("Loop Start %1").arg(scriptArgument);
@@ -743,6 +742,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if ( loopnest > (MAXLOOPNEST-2) ) {
- bm += i18n("ERROR: Nested too deep, ignored.");
+ bm += QObject::tr("ERROR: Nested too deep, ignored.");
vmain=20;
cancelbutton();
- QMessageBox::critical(0, "error", i18n("Loops nested too deeply!"));
+ QMessageBox::critical(0, "error", QObject::tr("Loops nested too deeply!"));
} else {
@@ -760,5 +759,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptCommand == "LoopEnd") {
- QString bm = i18n("Loop End %1").arg(scriptArgument);
+ QString bm = QObject::tr("Loop End %1").arg(scriptArgument);
if ( loopnest <= 0 ) {
- bm = i18n("LoopEnd without matching Start! Line: %1").arg(bm);
+ bm = QObject::tr("LoopEnd without matching Start! Line: %1").arg(bm);
vmain=20;
@@ -850,3 +849,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- emit debugMessage(i18n("Starting pppd..."));
+ emit debugMessage(QObject::tr("Starting pppd..."));
qDebug("execppp() returned with return-code %i", result );
@@ -932,3 +931,3 @@ void ConnectWidget::checkBuffers() {
// Show the Variabel content in the debug window
- QString sv = i18n("Scan Var: %1").arg(scanvar);
+ QString sv = QObject::tr("Scan Var: %1").arg(scanvar);
emit debugMessage(sv);
@@ -942,3 +941,3 @@ void ConnectWidget::checkBuffers() {
- QString ts = i18n("Found: %1").arg(expectstr);
+ QString ts = QObject::tr("Found: %1").arg(expectstr);
emit debugMessage(ts);
@@ -953,3 +952,3 @@ void ConnectWidget::checkBuffers() {
readbuffer = "";
- QString ts = i18n("Looping: %1").arg(loopstr[loopnest]);
+ QString ts = QObject::tr("Looping: %1").arg(loopstr[loopnest]);
emit debugMessage(ts);
@@ -986,3 +985,3 @@ void ConnectWidget::cancelbutton() {
- messg->setText(i18n("One moment please..."));
+ messg->setText(QObject::tr("One moment please..."));
@@ -1008,3 +1007,3 @@ void ConnectWidget::cancelbutton() {
if (prompt->isVisible()) {
- prompt->hide();
+ prompt->hide();
}
@@ -1012,3 +1011,6 @@ void ConnectWidget::cancelbutton() {
- messg->setText(tr("offline"));
+ _ifaceppp->setStatus( false );
+ _ifaceppp->refresh();
+// messg->setText(tr("offline"));
+ refresh();
}
@@ -1028,3 +1030,3 @@ void ConnectWidget::script_timed_out() {
prompt->setConsumed();
- messg->setText(i18n("Script timed out!"));
+ messg->setText(QObject::tr("Script timed out!"));
_ifaceppp->modem()->hangup();
@@ -1043,3 +1045,3 @@ void ConnectWidget::setScan(const QString &n) {
- QString ts = i18n("Scanning: %1").arg(n);
+ QString ts = QObject::tr("Scanning: %1").arg(n);
emit debugMessage(ts);
@@ -1052,3 +1054,3 @@ void ConnectWidget::setExpect(const QString &n) {
- QString ts = i18n("Expecting: %1").arg(n);
+ QString ts = QObject::tr("Expecting: %1").arg(n);
ts.replace(QRegExp("\n"), "<LF>");
@@ -1087,3 +1089,3 @@ void ConnectWidget::pppdDied()
void ConnectWidget::if_waiting_slot() {
- messg->setText(i18n("Logging on to network..."));
+ messg->setText(QObject::tr("Logging on to network..."));
@@ -1118,3 +1120,3 @@ void ConnectWidget::if_waiting_slot() {
if(!_ifaceppp->data()->command_on_connect().isEmpty()) {
- messg->setText(i18n("Running startup command..."));
+ messg->setText(QObject::tr("Running startup command..."));
@@ -1123,3 +1125,3 @@ void ConnectWidget::if_waiting_slot() {
execute_command(_ifaceppp->data()->command_on_connect());
- messg->setText(i18n("Done"));
+ messg->setText(QObject::tr("Done"));
}
@@ -1130,3 +1132,3 @@ void ConnectWidget::if_waiting_slot() {
- emit debugMessage(i18n("Done"));
+ emit debugMessage(QObject::tr("Done"));
set_con_speed_string();
@@ -1134,6 +1136,11 @@ void ConnectWidget::if_waiting_slot() {
// p_kppp->con_win->setConnectionSpeed(p_kppp->con_speed);
- this->hide();
- messg->setText("");
+// this->hide();
+// messg->setText("");
_ifaceppp->setStatus( true );
+
+ m_refreshTimer = new QTimer( this );
+ connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
+ m_refreshTimer->start( 3000 );
+ //_ifaceppp->refresh();
// emit _ifaceppp->updateInterface(_ifaceppp);
@@ -1163,2 +1170,11 @@ void ConnectWidget::if_waiting_slot() {
+void ConnectWidget::refresh() {
+ _ifaceppp->refresh();
+ if ( _ifaceppp->getStatus() ) {
+ messg->setText(QObject::tr("Online"));
+ } else {
+ messg->setText(QObject::tr("Offline"));
+ }
+}
+
@@ -1212,9 +1228,2 @@ bool ConnectWidget::execppp() {
- QStringList &arglist = _ifaceppp->data()->pppdArgument();
- for ( QStringList::Iterator it = arglist.begin();
- it != arglist.end();
- ++it )
- {
- command += " " + *it;
- }
@@ -1223,3 +1232,3 @@ bool ConnectWidget::execppp() {
command += " -chap user ";
- command = command + "\"" + _ifaceppp->data()->storedUsername() + "\"";
+ command = command + _ifaceppp->data()->storedUsername();
}
@@ -1229,3 +1238,3 @@ bool ConnectWidget::execppp() {
command += " -pap user ";
- command = command + "\"" + _ifaceppp->data()->storedUsername() + "\"";
+ command = command + _ifaceppp->data()->storedUsername();
}
@@ -1234,4 +1243,7 @@ bool ConnectWidget::execppp() {
if(_ifaceppp->data()->authMethod() == AUTH_PAPCHAP) {
- command += " user ";
- command = command + "\"" + _ifaceppp->data()->storedUsername() + "\"";
+ QString tmpName = _ifaceppp->data()->storedUsername();
+ if ( !tmpName.isEmpty() ) {
+ command += " user ";
+ command = command + tmpName;
+ }
}
@@ -1242,4 +1254,14 @@ bool ConnectWidget::execppp() {
+ QStringList &arglist = _ifaceppp->data()->pppdArgument();
+ for ( QStringList::Iterator it = arglist.begin();
+ it != arglist.end();
+ ++it )
+ {
+ command += " " + *it;
+ }
+
+ command += " call opie-kppp logfd 11";
+
if (command.length() > MAX_CMDLEN) {
- QMessageBox::critical(this, "error", i18n(
+ QMessageBox::critical(this, "error", QObject::tr(
"pppd command + command-line arguments exceed "
@@ -1251,2 +1273,4 @@ bool ConnectWidget::execppp() {
+ qWarning("Command IS: %s",command.latin1() );
+
qApp->flushX();