Diffstat (limited to 'noncore/settings/networksettings/ppp/interfaceppp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/interfaceppp.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/noncore/settings/networksettings/ppp/interfaceppp.cpp b/noncore/settings/networksettings/ppp/interfaceppp.cpp index dc24824..98bb4da 100644 --- a/noncore/settings/networksettings/ppp/interfaceppp.cpp +++ b/noncore/settings/networksettings/ppp/interfaceppp.cpp | |||
@@ -36,30 +36,28 @@ Modem* InterfacePPP::modem() | |||
36 | } | 36 | } |
37 | 37 | ||
38 | bool InterfacePPP::refresh() | 38 | bool 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 | ||
45 | void InterfacePPP::start() | 45 | void InterfacePPP::start() |
46 | { | 46 | { |
47 | qDebug("InterfacePPP::start"); | 47 | qDebug("InterfacePPP::start"); |
48 | if (data()->storedPassword() != "" ){ | 48 | if (data()->password().isEmpty() ){ |
49 | data()->setPassword(data()->storedPassword()); | 49 | //FIXME: ask for password |
50 | }else{ | ||
51 | //FIXME: | ||
52 | qDebug("using dummy password"); | 50 | qDebug("using dummy password"); |
53 | data()->setPassword( "dummy" ); | 51 | QMessageBox::critical( 0, "no password", "you should be prompted for a password, but you are not! ;-)"); |
54 | } | 52 | } |
55 | 53 | ||
56 | 54 | ||
57 | QFileInfo info(pppdPath()); | 55 | QFileInfo info(pppdPath()); |
58 | 56 | ||
59 | if(!info.exists()){ | 57 | if(!info.exists()){ |
60 | QMessageBox::warning(0, tr("Error"), | 58 | QMessageBox::warning(0, tr("Error"), |
61 | i18n("<qt>Cannot find the PPP daemon!<br>" | 59 | i18n("<qt>Cannot find the PPP daemon!<br>" |
62 | "Make sure that pppd is installed and " | 60 | "Make sure that pppd is installed and " |
63 | "that you have entered the correct path.</qt>")); | 61 | "that you have entered the correct path.</qt>")); |
64 | return; | 62 | return; |
65 | } | 63 | } |
@@ -87,55 +85,56 @@ void InterfacePPP::start() | |||
87 | "and/or adjust the location of the modem device on " | 85 | "and/or adjust the location of the modem device on " |
88 | "the modem tab of " | 86 | "the modem tab of " |
89 | "the setup dialog.</qt>").arg(data()->modemDevice()); | 87 | "the setup dialog.</qt>").arg(data()->modemDevice()); |
90 | QMessageBox::warning(0, tr("Error"), string); | 88 | QMessageBox::warning(0, tr("Error"), string); |
91 | return; | 89 | return; |
92 | } | 90 | } |
93 | 91 | ||
94 | // if this is a PAP or CHAP account, ensure that username is | 92 | // if this is a PAP or CHAP account, ensure that username is |
95 | // supplied | 93 | // supplied |
96 | if(data()->authMethod() == AUTH_PAP || | 94 | if(data()->authMethod() == AUTH_PAP || |
97 | data()->authMethod() == AUTH_CHAP || | 95 | data()->authMethod() == AUTH_CHAP || |
98 | data()->authMethod() == AUTH_PAPCHAP ) { | 96 | data()->authMethod() == AUTH_PAPCHAP ) { |
99 | if(false){ //ID_Edit->text().isEmpty()) { | 97 | if(false){ //FIXME: ID_Edit->text().isEmpty()) { |
100 | QMessageBox::warning(0,tr("Error"), | 98 | QMessageBox::warning(0,tr("Error"), |
101 | i18n("<qt>You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!</qt>")); | 99 | i18n("<qt>You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!</qt>")); |
102 | // FIXME: return; | 100 | // FIXME: return; |
103 | } else { | 101 | } else { |
104 | if(!modem()->setSecret(data()->authMethod(), | 102 | if(!modem()->setSecret(data()->authMethod(), |
105 | PPPData::encodeWord(data()->storedUsername()), | 103 | PPPData::encodeWord(data()->storedUsername()), |
106 | PPPData::encodeWord(data()->password())) | 104 | PPPData::encodeWord(data()->password())) |
107 | ) { | 105 | ) { |
108 | QString s; | 106 | QString s; |
109 | s = i18n("<qt>Cannot create PAP/CHAP authentication<br>" | 107 | s = i18n("<qt>Cannot create PAP/CHAP authentication<br>" |
110 | "file \"%1\"</qt>").arg(PAP_AUTH_FILE); | 108 | "file \"%1\"</qt>").arg(PAP_AUTH_FILE); |
111 | QMessageBox::warning(0, tr("Error"), s); | 109 | QMessageBox::warning(0, tr("Error"), s); |
112 | return; | 110 | return; |
113 | } | 111 | } |
114 | } | 112 | } |
115 | } | 113 | } |
116 | 114 | ||
117 | if (data()->phonenumber().isEmpty()) { | 115 | if (data()->phonenumber().isEmpty()) { |
118 | QString s = i18n("You must specify a telephone number!"); | 116 | QString s = i18n("You must specify a telephone number!"); |
119 | QMessageBox::warning(0, tr("Error"), s); | 117 | QMessageBox::warning(0, tr("Error"), s); |
120 | return; | 118 | return; |
121 | } | 119 | } |
122 | 120 | ||
123 | // this->hide(); | 121 | // SEGFAULTS: |
124 | 122 | // setStatus( true ); | |
125 | QString tit = i18n("Connecting to: %1").arg(data()->accname()); | 123 | // emit updateInterface((Interface*) this); |
126 | // con->setCaption(tit); | ||
127 | |||
128 | // con->show(); | ||
129 | |||
130 | 124 | ||
131 | emit begin_connect(); | 125 | emit begin_connect(); |
132 | 126 | ||
133 | qDebug("InterfacePPP::start END"); | 127 | qDebug("InterfacePPP::start END"); |
134 | } | 128 | } |
135 | 129 | ||
136 | void InterfacePPP::stop() | 130 | void InterfacePPP::stop() |
137 | { | 131 | { |
138 | qDebug("InterfacePPP::stop"); | 132 | qDebug("InterfacePPP::stop"); |
139 | 133 | ||
140 | } | 134 | } |
141 | 135 | ||
136 | void InterfacePPP::save() | ||
137 | { | ||
138 | data()->save(); | ||
139 | emit updateInterface((Interface*) this); | ||
140 | } | ||