summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/authwidget.cpp2
-rw-r--r--noncore/settings/networksettings/ppp/connect.cpp2
-rw-r--r--noncore/settings/networksettings/ppp/interfaceppp.cpp11
3 files changed, 9 insertions, 6 deletions
diff --git a/noncore/settings/networksettings/ppp/authwidget.cpp b/noncore/settings/networksettings/ppp/authwidget.cpp
index 86bea98..fa2b164 100644
--- a/noncore/settings/networksettings/ppp/authwidget.cpp
+++ b/noncore/settings/networksettings/ppp/authwidget.cpp
@@ -137,59 +137,61 @@ void AuthWidget::save()
137 _pppdata->setStoredUsername( userName->text() ); 137 _pppdata->setStoredUsername( userName->text() );
138 _pppdata->setStorePassword(store_password->isChecked()); 138 _pppdata->setStorePassword(store_password->isChecked());
139 if (store_password->isChecked()) 139 if (store_password->isChecked())
140 _pppdata->setStoredPassword( passWord->text() ); 140 _pppdata->setStoredPassword( passWord->text() );
141} 141}
142 142
143void AuthWidget::authChanged( const QString &authStr ) 143void AuthWidget::authChanged( const QString &authStr )
144{ 144{
145 qDebug("AuthWidget::authChanged( %s )", authStr.latin1() ); 145 qDebug("AuthWidget::authChanged( %s )", authStr.latin1() );
146 if ( authStr.contains( tr("Script-based") ) ){ 146 if ( authStr.contains( tr("Script-based") ) ){
147 showUsernamePassword( false ); 147 showUsernamePassword( false );
148 showScriptWindow( true ); 148 showScriptWindow( true );
149 } else if ( authStr.contains( tr("PAP") ) || 149 } else if ( authStr.contains( tr("PAP") ) ||
150 authStr.contains( tr("CHAP") ) ){ 150 authStr.contains( tr("CHAP") ) ){
151 showUsernamePassword( true ); 151 showUsernamePassword( true );
152 showScriptWindow( false ); 152 showScriptWindow( false );
153 } else { 153 } else {
154 qDebug("do not really know how to handle"); 154 qDebug("do not really know how to handle");
155 showUsernamePassword( false ); 155 showUsernamePassword( false );
156 showScriptWindow( false ); 156 showScriptWindow( false );
157 } 157 }
158} 158}
159 159
160 160
161void AuthWidget::showUsernamePassword( bool show ) 161void AuthWidget::showUsernamePassword( bool show )
162{ 162{
163 if (show){ 163 if (show){
164 user_l->show(); 164 user_l->show();
165 userName->show(); 165 userName->show();
166 pw_l->show(); 166 pw_l->show();
167 passWord->show(); 167 passWord->show();
168 store_password->show(); 168 store_password->show();
169 hidePw->show();
169 }else{//!show 170 }else{//!show
170 user_l->hide(); 171 user_l->hide();
171 userName->hide(); 172 userName->hide();
172 pw_l->hide(); 173 pw_l->hide();
173 passWord->hide(); 174 passWord->hide();
174 store_password->hide(); 175 store_password->hide();
176 hidePw->hide();
175 } 177 }
176} 178}
177 179
178void AuthWidget::showScriptWindow( bool show ) 180void AuthWidget::showScriptWindow( bool show )
179{ 181{
180 if (show){ 182 if (show){
181 if (!scriptWidget){ 183 if (!scriptWidget){
182 scriptWidget = new ScriptWidget( _pppdata, this, isNewAccount, "scriptWid"); 184 scriptWidget = new ScriptWidget( _pppdata, this, isNewAccount, "scriptWid");
183 layout->addMultiCellWidget( scriptWidget, 1, 4, 0, 1 ); 185 layout->addMultiCellWidget( scriptWidget, 1, 4, 0, 1 );
184 } 186 }
185 scriptWidget->show(); 187 scriptWidget->show();
186 }else{ // !show 188 }else{ // !show
187 if (scriptWidget) scriptWidget->hide(); 189 if (scriptWidget) scriptWidget->hide();
188 } 190 }
189} 191}
190 192
191void AuthWidget::toggleEchoMode( bool t ) 193void AuthWidget::toggleEchoMode( bool t )
192{ 194{
193 passWord->setEchoMode( t ? QLineEdit::Normal : QLineEdit::Password ); 195 passWord->setEchoMode( t ? QLineEdit::Normal : QLineEdit::Password );
194} 196}
195 197
diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp
index a93f93d..798431b 100644
--- a/noncore/settings/networksettings/ppp/connect.cpp
+++ b/noncore/settings/networksettings/ppp/connect.cpp
@@ -570,65 +570,65 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
570 scriptindex++; 570 scriptindex++;
571 return; 571 return;
572 } 572 }
573 573
574 if (scriptCommand == "Hangup") { 574 if (scriptCommand == "Hangup") {
575 messg->setText(i18n("Hangup")); 575 messg->setText(i18n("Hangup"));
576 emit debugMessage(i18n("Hangup")); 576 emit debugMessage(i18n("Hangup"));
577 577
578 writeline(_ifaceppp->data()->modemHangupStr()); 578 writeline(_ifaceppp->data()->modemHangupStr());
579 setExpect(_ifaceppp->data()->modemHangupResp()); 579 setExpect(_ifaceppp->data()->modemHangupResp());
580 580
581 scriptindex++; 581 scriptindex++;
582 return; 582 return;
583 } 583 }
584 584
585 if (scriptCommand == "Answer") { 585 if (scriptCommand == "Answer") {
586 586
587 timeout_timer->stop(); 587 timeout_timer->stop();
588 588
589 messg->setText(i18n("Answer")); 589 messg->setText(i18n("Answer"));
590 emit debugMessage(i18n("Answer")); 590 emit debugMessage(i18n("Answer"));
591 591
592 setExpect(_ifaceppp->data()->modemRingResp()); 592 setExpect(_ifaceppp->data()->modemRingResp());
593 vmain = 150; 593 vmain = 150;
594 return; 594 return;
595 } 595 }
596 596
597 if (scriptCommand == "ID") { 597 if (scriptCommand == "ID") {
598 QString bm = i18n("ID %1").arg(scriptArgument); 598 QString bm = i18n("ID %1").arg(scriptArgument);
599 messg->setText(bm); 599 messg->setText(bm);
600 emit debugMessage(bm); 600 emit debugMessage(bm);
601 601
602 QString idstring = _ifaceppp->data()->storedUsername(); 602 QString idstring = _ifaceppp->data()->password();
603 603
604 if(!idstring.isEmpty() && firstrunID) { 604 if(!idstring.isEmpty() && firstrunID) {
605 // the user entered an Id on the main kppp dialog 605 // the user entered an Id on the main kppp dialog
606 writeline(idstring); 606 writeline(idstring);
607 firstrunID = false; 607 firstrunID = false;
608 scriptindex++; 608 scriptindex++;
609 } 609 }
610 else { 610 else {
611 // the user didn't enter and Id on the main kppp dialog 611 // the user didn't enter and Id on the main kppp dialog
612 // let's query for an ID 612 // let's query for an ID
613 /* if not around yet, then post window... */ 613 /* if not around yet, then post window... */
614 if (prompt->Consumed()) { 614 if (prompt->Consumed()) {
615 if (!(prompt->isVisible())) { 615 if (!(prompt->isVisible())) {
616 prompt->setPrompt(scriptArgument); 616 prompt->setPrompt(scriptArgument);
617 prompt->setEchoModeNormal(); 617 prompt->setEchoModeNormal();
618 prompt->show(); 618 prompt->show();
619 } 619 }
620 } else { 620 } else {
621 /* if prompt withdrawn ... then, */ 621 /* if prompt withdrawn ... then, */
622 if(!(prompt->isVisible())) { 622 if(!(prompt->isVisible())) {
623 writeline(prompt->text()); 623 writeline(prompt->text());
624 prompt->setConsumed(); 624 prompt->setConsumed();
625 scriptindex++; 625 scriptindex++;
626 return; 626 return;
627 } 627 }
628 /* replace timeout value */ 628 /* replace timeout value */
629 } 629 }
630 } 630 }
631 } 631 }
632 632
633 if (scriptCommand == "Password") { 633 if (scriptCommand == "Password") {
634 QString bm = i18n("Password %1").arg(scriptArgument); 634 QString bm = i18n("Password %1").arg(scriptArgument);
diff --git a/noncore/settings/networksettings/ppp/interfaceppp.cpp b/noncore/settings/networksettings/ppp/interfaceppp.cpp
index 98bb4da..85ddbee 100644
--- a/noncore/settings/networksettings/ppp/interfaceppp.cpp
+++ b/noncore/settings/networksettings/ppp/interfaceppp.cpp
@@ -16,69 +16,70 @@ InterfacePPP::InterfacePPP(QObject *parent, const char *name, bool status)
16} 16}
17 17
18PPPData* InterfacePPP::data() 18PPPData* InterfacePPP::data()
19{ 19{
20 if (!_dataPtr){ 20 if (!_dataPtr){
21 qDebug("creating new Data obj"); 21 qDebug("creating new Data obj");
22 _dataPtr = new PPPData(); 22 _dataPtr = new PPPData();
23 _dataPtr->setModemDevice( getInterfaceName() ); 23 _dataPtr->setModemDevice( getInterfaceName() );
24 _dataPtr->setAccount( getHardwareName() ); 24 _dataPtr->setAccount( getHardwareName() );
25 } 25 }
26 return _dataPtr; 26 return _dataPtr;
27} 27}
28 28
29Modem* InterfacePPP::modem() 29Modem* InterfacePPP::modem()
30{ 30{
31 if (!_modemPtr){ 31 if (!_modemPtr){
32 qDebug("creating new modem obj"); 32 qDebug("creating new modem obj");
33 _modemPtr = new Modem( data() ); 33 _modemPtr = new Modem( data() );
34 } 34 }
35 return _modemPtr; 35 return _modemPtr;
36} 36}
37 37
38bool InterfacePPP::refresh() 38bool InterfacePPP::refresh()
39{ 39{
40 qDebug("InterfacePPP::refresh()"); 40 qDebug("InterfacePPP::refresh()");
41 QMessageBox::information(0,"Not Implemented","This feature is not yet implemneted... ;-("); 41 QMessageBox::information(0,"Not Implemented","This feature is not yet implemneted... ;-(");
42 return false; 42 return false;
43} 43}
44 44
45void InterfacePPP::start() 45void InterfacePPP::start()
46{ 46{
47 qDebug("InterfacePPP::start"); 47 qDebug("InterfacePPP::start");
48 if (data()->password().isEmpty() ){ 48// should work...
49//FIXME: ask for password 49// if (data()->password().isEmpty() ){
50 qDebug("using dummy password"); 50// //FIXME: ask for password
51 QMessageBox::critical( 0, "no password", "you should be prompted for a password, but you are not! ;-)"); 51// qDebug("using dummy password");
52 } 52// QMessageBox::critical( 0, "no password", "you should be prompted for a password, but you are not! ;-)");
53// }
53 54
54 55
55 QFileInfo info(pppdPath()); 56 QFileInfo info(pppdPath());
56 57
57 if(!info.exists()){ 58 if(!info.exists()){
58 QMessageBox::warning(0, tr("Error"), 59 QMessageBox::warning(0, tr("Error"),
59 i18n("<qt>Cannot find the PPP daemon!<br>" 60 i18n("<qt>Cannot find the PPP daemon!<br>"
60 "Make sure that pppd is installed and " 61 "Make sure that pppd is installed and "
61 "that you have entered the correct path.</qt>")); 62 "that you have entered the correct path.</qt>"));
62 return; 63 return;
63 } 64 }
64//#if 0 65//#if 0
65 if(!info.isExecutable()){ 66 if(!info.isExecutable()){
66 67
67 QString string; 68 QString string;
68 string = i18n( "<qt>Cannot execute:<br> %1<br>" 69 string = i18n( "<qt>Cannot execute:<br> %1<br>"
69 "Please make sure that you have given " 70 "Please make sure that you have given "
70 "setuid permission and that " 71 "setuid permission and that "
71 "pppd is executable.<br>").arg(pppdPath()); 72 "pppd is executable.<br>").arg(pppdPath());
72 QMessageBox::warning(0, tr("Error"), string); 73 QMessageBox::warning(0, tr("Error"), string);
73 return; 74 return;
74 75
75 } 76 }
76//#endif 77//#endif
77 78
78 QFileInfo info2(data()->modemDevice()); 79 QFileInfo info2(data()->modemDevice());
79 80
80 if(!info2.exists()){ 81 if(!info2.exists()){
81 QString string; 82 QString string;
82 string = i18n( "<qt>Cannot find:<br> %1<br>" 83 string = i18n( "<qt>Cannot find:<br> %1<br>"
83 "Please make sure you have setup " 84 "Please make sure you have setup "
84 "your modem device properly " 85 "your modem device properly "