summaryrefslogtreecommitdiff
path: root/noncore/settings
authorkergoth <kergoth>2003-08-09 17:14:54 (UTC)
committer kergoth <kergoth>2003-08-09 17:14:54 (UTC)
commita7e015198a8c5ad3b6e144a9032b059086253e00 (patch) (unidiff)
treeb712b6f11310d88744fe393a92b3160b741a7efe /noncore/settings
parentbeba0e73306815337bf04dee39502233595e9739 (diff)
downloadopie-a7e015198a8c5ad3b6e144a9032b059086253e00.zip
opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.gz
opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp13
-rw-r--r--noncore/settings/appearance2/colorlistitem.h7
-rw-r--r--noncore/settings/appearance2/decolistitem.h3
-rw-r--r--noncore/settings/backup/backuprestore.cpp9
-rw-r--r--noncore/settings/language/language.cpp2
-rw-r--r--noncore/settings/mediummount/mainwindow.cc1
-rw-r--r--noncore/settings/mediummount/mediumglobal.cc2
-rw-r--r--noncore/settings/mediummount/mediumwidget.cc2
-rw-r--r--noncore/settings/networksettings/interfaces/interface.cpp68
-rw-r--r--noncore/settings/networksettings/interfaces/interface.h12
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceadvanced.ui2
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformation.ui267
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp24
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.h2
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.cpp60
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp4
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp23
-rw-r--r--noncore/settings/networksettings/mainwindowimp.h15
-rw-r--r--noncore/settings/networksettings/module.h39
-rw-r--r--noncore/settings/networksettings/ppp/TODO10
-rw-r--r--noncore/settings/networksettings/ppp/accounts.cpp158
-rw-r--r--noncore/settings/networksettings/ppp/accounts.h40
-rw-r--r--noncore/settings/networksettings/ppp/chooserwidget.cpp85
-rw-r--r--noncore/settings/networksettings/ppp/chooserwidget.h73
-rw-r--r--noncore/settings/networksettings/ppp/connect.cpp166
-rw-r--r--noncore/settings/networksettings/ppp/connect.h2
-rw-r--r--noncore/settings/networksettings/ppp/conwindow.cpp27
-rw-r--r--noncore/settings/networksettings/ppp/devices.cpp212
-rw-r--r--noncore/settings/networksettings/ppp/devices.h95
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp4
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp293
-rw-r--r--noncore/settings/networksettings/ppp/general.h34
-rw-r--r--noncore/settings/networksettings/ppp/interfaceinformationppp.cpp20
-rw-r--r--noncore/settings/networksettings/ppp/interfaceppp.cpp70
-rw-r--r--noncore/settings/networksettings/ppp/interfaceppp.h16
-rw-r--r--noncore/settings/networksettings/ppp/kpppwidget.cpp89
-rw-r--r--noncore/settings/networksettings/ppp/modem.cpp85
-rw-r--r--noncore/settings/networksettings/ppp/modem.h23
-rw-r--r--noncore/settings/networksettings/ppp/modemcmds.cpp129
-rw-r--r--noncore/settings/networksettings/ppp/modemcmds.h3
-rw-r--r--noncore/settings/networksettings/ppp/modeminfo.cpp24
-rw-r--r--noncore/settings/networksettings/ppp/ppp.pro5
-rw-r--r--noncore/settings/networksettings/ppp/pppconfig.cpp19
-rw-r--r--noncore/settings/networksettings/ppp/pppconfig.h6
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.cpp397
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.h47
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp117
-rw-r--r--noncore/settings/networksettings/ppp/runtests.cpp12
-rw-r--r--noncore/settings/networksettings/wlan/keyedit.cpp1
-rw-r--r--noncore/settings/networksettings/wlan/wlan.ui96
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp35
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp2
-rw-r--r--noncore/settings/usermanager/userdialog.cpp2
-rw-r--r--noncore/settings/usermanager/userdialog.h1
-rw-r--r--noncore/settings/usermanager/usermanager.cpp2
-rw-r--r--noncore/settings/usermanager/usermanager.pro2
56 files changed, 1971 insertions, 986 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index c376ec7..00128d3 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -86,3 +86,3 @@ public:
86 } 86 }
87 QPixmap icon() const { 87QPixmap icon() const {
88 return QPixmap(); 88 return QPixmap();
@@ -177,3 +177,3 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
177 177
178 QString s = cfg. readEntry ( "Decoration" ); 178 QString s = cfg. readEntry ( "Decoration", "libflat.so" );
179 179
@@ -404,3 +404,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
404 QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); 404 QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 );
405 405
406 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); 406 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab );
@@ -423,4 +423,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
423 m_rotdir_cw-> setPixmap( cw1 ); 423 m_rotdir_cw-> setPixmap( cw1 );
424 m_rotdir_ccw-> setPixmap( ccw1 ); 424 m_rotdir_ccw-> setPixmap( ccw1 );
425 m_rotdir_flip-> setPixmap( flip1 ); 425 m_rotdir_flip-> setPixmap( flip1 );
426 426
@@ -459,3 +459,4 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags )
459 m_sample = new SampleWindow ( this ); 459 m_sample = new SampleWindow ( this );
460 m_sample-> setDecoration ( new DefaultWindowDecoration ( )); 460
461 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) );
461 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); 462 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) );
diff --git a/noncore/settings/appearance2/colorlistitem.h b/noncore/settings/appearance2/colorlistitem.h
index 10e4468..f8d5c45 100644
--- a/noncore/settings/appearance2/colorlistitem.h
+++ b/noncore/settings/appearance2/colorlistitem.h
@@ -126,8 +126,9 @@ private:
126 126
127// from etc/colors/Liquid.scheme
127const ColorListItem::colorlut ColorListItem::s_colorlut [] = { 128const ColorListItem::colorlut ColorListItem::s_colorlut [] = {
128 { QColorGroup::Base, "Base", "#FFFFFF", QT_TRANSLATE_NOOP( "Appearance", "Base" ) }, 129 { QColorGroup::Base, "Base", "#FFFFFF", QT_TRANSLATE_NOOP( "Appearance", "Base" ) },
129 { QColorGroup::Background, "Background", "#E5E1D5", QT_TRANSLATE_NOOP( "Appearance", "Background" ) }, 130 { QColorGroup::Background, "Background", "#E0E0E0", QT_TRANSLATE_NOOP( "Appearance", "Background" ) },
130 { QColorGroup::Button, "Button", "#D6CDBB", QT_TRANSLATE_NOOP( "Appearance", "Button" ) }, 131 { QColorGroup::Button, "Button", "#96c8fa", QT_TRANSLATE_NOOP( "Appearance", "Button" ) },
131 { QColorGroup::ButtonText, "ButtonText", "#000000", QT_TRANSLATE_NOOP( "Appearance", "Button Text" ) }, 132 { QColorGroup::ButtonText, "ButtonText", "#000000", QT_TRANSLATE_NOOP( "Appearance", "Button Text" ) },
132 { QColorGroup::Highlight, "Highlight", "#800000", QT_TRANSLATE_NOOP( "Appearance", "Highlight" ) }, 133 { QColorGroup::Highlight, "Highlight", "#73adef", QT_TRANSLATE_NOOP( "Appearance", "Highlight" ) },
133 { QColorGroup::HighlightedText, "HighlightedText", "#FFFFFF", QT_TRANSLATE_NOOP( "Appearance", "Highlighted Text" ) }, 134 { QColorGroup::HighlightedText, "HighlightedText", "#FFFFFF", QT_TRANSLATE_NOOP( "Appearance", "Highlighted Text" ) },
diff --git a/noncore/settings/appearance2/decolistitem.h b/noncore/settings/appearance2/decolistitem.h
index d190ceb..da7924c 100644
--- a/noncore/settings/appearance2/decolistitem.h
+++ b/noncore/settings/appearance2/decolistitem.h
@@ -105,2 +105,3 @@ private:
105 105
106#endif \ No newline at end of file 106#endif
107
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 4ff6be1..922523b 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -73,14 +73,5 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name)
73 if(totalLocations == 0){ 73 if(totalLocations == 0){
74
75/* Ramses has a CF-Slot, but that one is internal and you have to dismount the
76 * the case. There's also almost always a WLAN card inserted there
77*/
78
79 backupLocations.insert("Documents", "/root/Documents"); 74 backupLocations.insert("Documents", "/root/Documents");
80#if defined(QT_QWS_RAMSES)
81 backupLocations.insert("MMC", "/mnt/card");
82#else
83 backupLocations.insert("CF", "/mnt/cf"); 75 backupLocations.insert("CF", "/mnt/cf");
84 backupLocations.insert("SD", "/mnt/card"); 76 backupLocations.insert("SD", "/mnt/card");
85#endif
86 } 77 }
diff --git a/noncore/settings/language/language.cpp b/noncore/settings/language/language.cpp
index 8985fd5..d30a041 100644
--- a/noncore/settings/language/language.cpp
+++ b/noncore/settings/language/language.cpp
@@ -117,5 +117,5 @@ void LanguageSettings::reset()
117 l = config.readEntry( "Language", l ); 117 l = config.readEntry( "Language", l );
118 actualLanguage = l;
118 if (l.isEmpty()) 119 if (l.isEmpty())
119 l = "en"; 120 l = "en";
120 actualLanguage = l;
121 121
diff --git a/noncore/settings/mediummount/mainwindow.cc b/noncore/settings/mediummount/mainwindow.cc
index 6b37cff..eec786c 100644
--- a/noncore/settings/mediummount/mainwindow.cc
+++ b/noncore/settings/mediummount/mainwindow.cc
@@ -16,2 +16,3 @@ using namespace MediumMountSetting;
16 16
17/* TRANSLATOR MediumMountSetting::MainWindow */
17 18
diff --git a/noncore/settings/mediummount/mediumglobal.cc b/noncore/settings/mediummount/mediumglobal.cc
index 75e3839..ab0b3af 100644
--- a/noncore/settings/mediummount/mediumglobal.cc
+++ b/noncore/settings/mediummount/mediumglobal.cc
@@ -17,2 +17,4 @@ using namespace MediumMountSetting;
17 17
18/* TRANSLATOR MediumMountSetting::MediumGlobalWidget */
19
18MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) 20MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name )
diff --git a/noncore/settings/mediummount/mediumwidget.cc b/noncore/settings/mediummount/mediumwidget.cc
index eadf502..981e1dd 100644
--- a/noncore/settings/mediummount/mediumwidget.cc
+++ b/noncore/settings/mediummount/mediumwidget.cc
@@ -24,2 +24,4 @@ using namespace MediumMountSetting;
24 24
25/* TRANSLATOR MediumMountSetting::MediumMountWidget */
26
25MediumMountWidget::MediumMountWidget(const QString &path, 27MediumMountWidget::MediumMountWidget(const QString &path,
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp
index cc45525..69b55d1 100644
--- a/noncore/settings/networksettings/interfaces/interface.cpp
+++ b/noncore/settings/networksettings/interfaces/interface.cpp
@@ -3,3 +3,3 @@
3 * $Date$ 3 * $Date$
4 */ 4 */
5 5
@@ -26,3 +26,3 @@ Interface::Interface(QObject * parent, const char * name, bool newSatus): QObjec
26 * emit updateInterface 26 * emit updateInterface
27 */ 27 */
28void Interface::setStatus(bool newStatus){ 28void Interface::setStatus(bool newStatus){
@@ -38,3 +38,3 @@ void Interface::setStatus(bool newStatus){
38 * emit updateInterface 38 * emit updateInterface
39 */ 39 */
40void Interface::setAttached(bool isAttached){ 40void Interface::setAttached(bool isAttached){
@@ -43,3 +43,3 @@ void Interface::setAttached(bool isAttached){
43}; 43};
44 44
45/** 45/**
@@ -48,3 +48,3 @@ void Interface::setAttached(bool isAttached){
48 * emit updateInterface 48 * emit updateInterface
49 */ 49 */
50void Interface::setHardwareName(const QString &name){ 50void Interface::setHardwareName(const QString &name){
@@ -53,3 +53,3 @@ void Interface::setHardwareName(const QString &name){
53}; 53};
54 54
55/** 55/**
@@ -58,3 +58,3 @@ void Interface::setHardwareName(const QString &name){
58 * emit updateInterface 58 * emit updateInterface
59 */ 59 */
60void Interface::setModuleOwner(Module *owner){ 60void Interface::setModuleOwner(Module *owner){
@@ -67,5 +67,5 @@ void Interface::setModuleOwner(Module *owner){
67 * Try to start the interface. 67 * Try to start the interface.
68 */ 68 */
69void Interface::start(){ 69void Interface::start(){
70 // check to see if we are already running. 70 // check to see if we are already running.
71 if(true == status){ 71 if(true == status){
@@ -74,3 +74,3 @@ void Interface::start(){
74 } 74 }
75 75
76 int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1()); 76 int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1());
@@ -91,3 +91,3 @@ void Interface::start(){
91void Interface::stop(){ 91void Interface::stop(){
92 // check to see if we are already stopped. 92 // check to see if we are already stopped.
93 if(false == status){ 93 if(false == status){
@@ -96,3 +96,3 @@ void Interface::stop(){
96 } 96 }
97 97
98 int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); 98 int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1());
@@ -110,3 +110,3 @@ void Interface::stop(){
110 * Try to restart the interface. 110 * Try to restart the interface.
111 */ 111 */
112void Interface::restart(){ 112void Interface::restart(){
@@ -135,5 +135,5 @@ bool Interface::refresh(){
135 } 135 }
136 136
137 QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name()); 137 QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name());
138 int ret = system(QString("%1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1()); 138 int ret = system(QString("LANG=C %1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1());
139 if(ret != 0){ 139 if(ret != 0){
@@ -142,3 +142,3 @@ bool Interface::refresh(){
142 } 142 }
143 143
144 QFile file(fileName); 144 QFile file(fileName);
@@ -154,3 +154,3 @@ bool Interface::refresh(){
154 broadcast = ""; 154 broadcast = "";
155 155
156 QTextStream stream( &file ); 156 QTextStream stream( &file );
@@ -187,3 +187,3 @@ bool Interface::refresh(){
187 dhcp = false; 187 dhcp = false;
188 188
189 QString dhcpDirectory(DHCP_INFO_DIR); 189 QString dhcpDirectory(DHCP_INFO_DIR);
@@ -192,4 +192,4 @@ bool Interface::refresh(){
192 dhcpDirectory = "/var/run"; 192 dhcpDirectory = "/var/run";
193 193
194 // See if we have 194 // See if we have
195 QString dhcpFile(QString(dhcpDirectory+"/dhcpcd-%1.info").arg(this->name())); 195 QString dhcpFile(QString(dhcpDirectory+"/dhcpcd-%1.info").arg(this->name()));
@@ -200,3 +200,3 @@ bool Interface::refresh(){
200 } 200 }
201 201
202 file.setName(dhcpFile); 202 file.setName(dhcpFile);
@@ -206,3 +206,3 @@ bool Interface::refresh(){
206 } 206 }
207 207
208 // leaseTime and renewalTime and used if pid and deamon exe can be accessed. 208 // leaseTime and renewalTime and used if pid and deamon exe can be accessed.
@@ -210,3 +210,3 @@ bool Interface::refresh(){
210 int renewalTime = 0; 210 int renewalTime = 0;
211 211
212 stream.setDevice( &file ); 212 stream.setDevice( &file );
@@ -224,3 +224,3 @@ bool Interface::refresh(){
224 //qDebug(QString("Interface: renewalTime: %1").arg(renewalTime).latin1()); 224 //qDebug(QString("Interface: renewalTime: %1").arg(renewalTime).latin1());
225 225
226 // Get the pid of the deamond 226 // Get the pid of the deamond
@@ -246,3 +246,3 @@ bool Interface::refresh(){
246 246
247 // Get the start running time of the deamon 247 // Get the start running time of the deamon
248 fileName = (QString("/proc/%1/stat").arg(pid)); 248 fileName = (QString("/proc/%1/stat").arg(pid));
@@ -259,3 +259,3 @@ bool Interface::refresh(){
259 long time = 0; 259 long time = 0;
260 // Grab the start time 260 // Grab the start time
261 // pid com state ppid pgrp session tty_nr tpgid flags 261 // pid com state ppid pgrp session tty_nr tpgid flags
@@ -267,3 +267,3 @@ bool Interface::refresh(){
267 time = time/100; 267 time = time/100;
268 268
269 QDateTime datetime(QDateTime::currentDateTime()); 269 QDateTime datetime(QDateTime::currentDateTime());
@@ -283,15 +283,15 @@ bool Interface::refresh(){
283 } 283 }
284 284
285 datetime = datetime.addSecs(time); 285 datetime = datetime.addSecs(time);
286 //qDebug(QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1()); 286 //qDebug(QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1());
287 287
288 // Calculate the start and renew times 288 // Calculate the start and renew times
289 leaseObtained= datetime.toString(); 289 leaseObtained= datetime.toString();
290 290
291 // Calculate the start and renew times 291 // Calculate the start and renew times
292 datetime = datetime.addSecs(leaseTime); 292 datetime = datetime.addSecs(leaseTime);
293 leaseExpires = datetime.toString(); 293 leaseExpires = datetime.toString();
294 294
295 dhcp = true; 295 dhcp = true;
296 296
297 emit(updateInterface(this)); 297 emit(updateInterface(this));
diff --git a/noncore/settings/networksettings/interfaces/interface.h b/noncore/settings/networksettings/interfaces/interface.h
index 7e98deb..ec82851 100644
--- a/noncore/settings/networksettings/interfaces/interface.h
+++ b/noncore/settings/networksettings/interfaces/interface.h
@@ -14,9 +14,9 @@ signals:
14 void updateMessage(const QString &message); 14 void updateMessage(const QString &message);
15 15
16public: 16public:
17 Interface(QObject * parent=0, const char * name= "unknown", bool status = false); 17 Interface(QObject * parent=0, const char * name= "unknown", bool status = false);
18 18
19 QString getInterfaceName() const { QString n(this->name()); return n; }; 19 QString getInterfaceName() const { QString n(this->name()); return n; };
20 void setInterfaceName( const QString &n ) { this->setName(n); }; 20 void setInterfaceName( const QString &n ) { this->setName(n); };
21 21
22 bool getStatus() const { return status; }; 22 bool getStatus() const { return status; };
@@ -26,6 +26,6 @@ public:
26 void setAttached(bool isAttached=false); 26 void setAttached(bool isAttached=false);
27 27
28 QString getHardwareName() const { return hardwareName; }; 28 QString getHardwareName() const { return hardwareName; };
29 void setHardwareName(const QString &name="Unknown"); 29 void setHardwareName(const QString &name="Unknown");
30 30
31 Module* getModuleOwner() const { return moduleOwner; }; 31 Module* getModuleOwner() const { return moduleOwner; };
@@ -49,3 +49,3 @@ public:
49 49
50private: 50protected:
51 // Interface information 51 // Interface information
diff --git a/noncore/settings/networksettings/interfaces/interfaceadvanced.ui b/noncore/settings/networksettings/interfaces/interfaceadvanced.ui
index 2e106cb..12dbb1d 100644
--- a/noncore/settings/networksettings/interfaces/interfaceadvanced.ui
+++ b/noncore/settings/networksettings/interfaces/interfaceadvanced.ui
@@ -20,3 +20,3 @@
20 <size> 20 <size>
21 <width>240</width> 21 <width>32767</width>
22 <height>32767</height> 22 <height>32767</height>
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformation.ui b/noncore/settings/networksettings/interfaces/interfaceinformation.ui
index 763ad90..207200e 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformation.ui
+++ b/noncore/settings/networksettings/interfaces/interfaceinformation.ui
@@ -14,3 +14,3 @@
14 <width>219</width> 14 <width>219</width>
15 <height>255</height> 15 <height>323</height>
16 </rect> 16 </rect>
@@ -21,6 +21,12 @@
21 </property> 21 </property>
22 <grid> 22 <property>
23 <name>layoutMargin</name>
24 </property>
25 <property>
26 <name>layoutSpacing</name>
27 </property>
28 <vbox>
23 <property stdset="1"> 29 <property stdset="1">
24 <name>margin</name> 30 <name>margin</name>
25 <number>11</number> 31 <number>4</number>
26 </property> 32 </property>
@@ -28,77 +34,5 @@
28 <name>spacing</name> 34 <name>spacing</name>
29 <number>6</number> 35 <number>3</number>
30 </property> 36 </property>
31 <widget row="4" column="0" rowspan="1" colspan="2" > 37 <widget>
32 <class>QLayoutWidget</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>Layout1</cstring>
36 </property>
37 <grid>
38 <property stdset="1">
39 <name>margin</name>
40 <number>0</number>
41 </property>
42 <property stdset="1">
43 <name>spacing</name>
44 <number>6</number>
45 </property>
46 <widget row="1" column="0" >
47 <class>QPushButton</class>
48 <property stdset="1">
49 <name>name</name>
50 <cstring>refreshButton</cstring>
51 </property>
52 <property stdset="1">
53 <name>text</name>
54 <string>&amp;Refresh</string>
55 </property>
56 </widget>
57 <widget row="0" column="1" >
58 <class>QPushButton</class>
59 <property stdset="1">
60 <name>name</name>
61 <cstring>stopButton</cstring>
62 </property>
63 <property stdset="1">
64 <name>text</name>
65 <string>S&amp;top</string>
66 </property>
67 </widget>
68 <widget row="1" column="1" >
69 <class>QPushButton</class>
70 <property stdset="1">
71 <name>name</name>
72 <cstring>restartButton</cstring>
73 </property>
74 <property stdset="1">
75 <name>text</name>
76 <string>R&amp;estart</string>
77 </property>
78 </widget>
79 <widget row="0" column="0" >
80 <class>QPushButton</class>
81 <property stdset="1">
82 <name>name</name>
83 <cstring>startButton</cstring>
84 </property>
85 <property stdset="1">
86 <name>text</name>
87 <string>&amp;Start</string>
88 </property>
89 </widget>
90 </grid>
91 </widget>
92 <widget row="0" column="0" >
93 <class>Line</class>
94 <property stdset="1">
95 <name>name</name>
96 <cstring>Line1</cstring>
97 </property>
98 <property stdset="1">
99 <name>orientation</name>
100 <enum>Horizontal</enum>
101 </property>
102 </widget>
103 <widget row="0" column="0" >
104 <class>QLabel</class> 38 <class>QLabel</class>
@@ -113,3 +47,3 @@
113 </widget> 47 </widget>
114 <widget row="1" column="0" > 48 <widget>
115 <class>QLabel</class> 49 <class>QLabel</class>
@@ -117,14 +51,11 @@
117 <name>name</name> 51 <name>name</name>
118 <cstring>TextLabel23</cstring> 52 <cstring>ipAddressLabel</cstring>
119 </property> 53 </property>
120 <property stdset="1"> 54 <property stdset="1">
121 <name>text</name> 55 <name>frameShape</name>
122 <string>Subnet Mask</string> 56 <enum>Panel</enum>
123 </property> 57 </property>
124 </widget>
125 <widget row="2" column="0" >
126 <class>QLabel</class>
127 <property stdset="1"> 58 <property stdset="1">
128 <name>name</name> 59 <name>frameShadow</name>
129 <cstring>TextLabel21</cstring> 60 <enum>Sunken</enum>
130 </property> 61 </property>
@@ -132,18 +63,21 @@
132 <name>text</name> 63 <name>text</name>
133 <string>MAC Address</string> 64 <string>0.0.0.0</string>
134 </property> 65 </property>
135 </widget> 66 </widget>
136 <widget row="3" column="0" > 67 <widget>
137 <class>QLabel</class> 68 <class>Line</class>
138 <property stdset="1"> 69 <property stdset="1">
139 <name>name</name> 70 <name>name</name>
140 <cstring>TextLabel24</cstring> 71 <cstring>Line1</cstring>
141 </property> 72 </property>
142 <property stdset="1"> 73 <property stdset="1">
143 <name>frameShape</name> 74 <name>orientation</name>
144 <enum>MShape</enum> 75 <enum>Horizontal</enum>
145 </property> 76 </property>
77 </widget>
78 <widget>
79 <class>QLabel</class>
146 <property stdset="1"> 80 <property stdset="1">
147 <name>frameShadow</name> 81 <name>name</name>
148 <enum>MShadow</enum> 82 <cstring>TextLabel23</cstring>
149 </property> 83 </property>
@@ -151,6 +85,6 @@
151 <name>text</name> 85 <name>text</name>
152 <string>Broadcast</string> 86 <string>Subnet Mask</string>
153 </property> 87 </property>
154 </widget> 88 </widget>
155 <widget row="1" column="1" > 89 <widget>
156 <class>QLabel</class> 90 <class>QLabel</class>
@@ -173,3 +107,3 @@
173 </widget> 107 </widget>
174 <widget row="2" column="1" > 108 <widget>
175 <class>QLabel</class> 109 <class>QLabel</class>
@@ -192,3 +126,14 @@
192 </widget> 126 </widget>
193 <widget row="3" column="1" > 127 <widget>
128 <class>QLabel</class>
129 <property stdset="1">
130 <name>name</name>
131 <cstring>TextLabel21</cstring>
132 </property>
133 <property stdset="1">
134 <name>text</name>
135 <string>MAC Address</string>
136 </property>
137 </widget>
138 <widget>
194 <class>QLabel</class> 139 <class>QLabel</class>
@@ -211,3 +156,3 @@
211 </widget> 156 </widget>
212 <widget row="0" column="1" > 157 <widget>
213 <class>QLabel</class> 158 <class>QLabel</class>
@@ -215,3 +160,3 @@
215 <name>name</name> 160 <name>name</name>
216 <cstring>ipAddressLabel</cstring> 161 <cstring>TextLabel24</cstring>
217 </property> 162 </property>
@@ -219,3 +164,3 @@
219 <name>frameShape</name> 164 <name>frameShape</name>
220 <enum>Panel</enum> 165 <enum>MShape</enum>
221 </property> 166 </property>
@@ -223,3 +168,3 @@
223 <name>frameShadow</name> 168 <name>frameShadow</name>
224 <enum>Sunken</enum> 169 <enum>MShadow</enum>
225 </property> 170 </property>
@@ -227,27 +172,78 @@
227 <name>text</name> 172 <name>text</name>
228 <string>0.0.0.0</string> 173 <string>Broadcast</string>
229 </property> 174 </property>
230 </widget> 175 </widget>
231 <spacer row="7" column="1" > 176 <widget>
232 <property> 177 <class>QLayoutWidget</class>
178 <property stdset="1">
233 <name>name</name> 179 <name>name</name>
234 <cstring>Spacer18</cstring> 180 <cstring>Layout1</cstring>
235 </property> 181 </property>
182 <grid>
183 <property stdset="1">
184 <name>margin</name>
185 <number>0</number>
186 </property>
187 <property stdset="1">
188 <name>spacing</name>
189 <number>6</number>
190 </property>
191 <widget row="1" column="0" >
192 <class>QPushButton</class>
193 <property stdset="1">
194 <name>name</name>
195 <cstring>refreshButton</cstring>
196 </property>
197 <property stdset="1">
198 <name>text</name>
199 <string>&amp;Refresh</string>
200 </property>
201 </widget>
202 <widget row="0" column="1" >
203 <class>QPushButton</class>
204 <property stdset="1">
205 <name>name</name>
206 <cstring>stopButton</cstring>
207 </property>
208 <property stdset="1">
209 <name>text</name>
210 <string>S&amp;top</string>
211 </property>
212 </widget>
213 <widget row="1" column="1" >
214 <class>QPushButton</class>
215 <property stdset="1">
216 <name>name</name>
217 <cstring>restartButton</cstring>
218 </property>
219 <property stdset="1">
220 <name>text</name>
221 <string>R&amp;estart</string>
222 </property>
223 </widget>
224 <widget row="0" column="0" >
225 <class>QPushButton</class>
226 <property stdset="1">
227 <name>name</name>
228 <cstring>startButton</cstring>
229 </property>
230 <property stdset="1">
231 <name>text</name>
232 <string>&amp;Start</string>
233 </property>
234 </widget>
235 </grid>
236 </widget>
237 <widget>
238 <class>Line</class>
236 <property stdset="1"> 239 <property stdset="1">
237 <name>orientation</name> 240 <name>name</name>
238 <enum>Vertical</enum> 241 <cstring>Line5</cstring>
239 </property> 242 </property>
240 <property stdset="1"> 243 <property stdset="1">
241 <name>sizeType</name> 244 <name>orientation</name>
242 <enum>Expanding</enum> 245 <enum>Horizontal</enum>
243 </property>
244 <property>
245 <name>sizeHint</name>
246 <size>
247 <width>20</width>
248 <height>20</height>
249 </size>
250 </property> 246 </property>
251 </spacer> 247 </widget>
252 <widget row="6" column="0" rowspan="1" colspan="2" > 248 <widget>
253 <class>QLayoutWidget</class> 249 <class>QLayoutWidget</class>
@@ -300,7 +296,6 @@
300 </widget> 296 </widget>
301 <widget row="5" column="0" rowspan="1" colspan="2" > 297 <spacer>
302 <class>Line</class> 298 <property>
303 <property stdset="1">
304 <name>name</name> 299 <name>name</name>
305 <cstring>Line5</cstring> 300 <cstring>Spacer18</cstring>
306 </property> 301 </property>
@@ -308,6 +303,28 @@
308 <name>orientation</name> 303 <name>orientation</name>
309 <enum>Horizontal</enum> 304 <enum>Vertical</enum>
305 </property>
306 <property stdset="1">
307 <name>sizeType</name>
308 <enum>Expanding</enum>
309 </property>
310 <property>
311 <name>sizeHint</name>
312 <size>
313 <width>20</width>
314 <height>20</height>
315 </size>
316 </property>
317 </spacer>
318 <widget>
319 <class>QCheckBox</class>
320 <property stdset="1">
321 <name>name</name>
322 <cstring>CheckBoxSilent</cstring>
323 </property>
324 <property stdset="1">
325 <name>text</name>
326 <string>be &amp;silent</string>
310 </property> 327 </property>
311 </widget> 328 </widget>
312 </grid> 329 </vbox>
313</widget> 330</widget>
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
index e00dcce..37c3a91 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
@@ -3,2 +3,3 @@
3 3
4#include <qcheckbox.h>
4#include <qpushbutton.h> 5#include <qpushbutton.h>
@@ -8,3 +9,5 @@
8 9
9#ifdef QWS 10#include <qpe/config.h>
11
12#ifdef QWS
10#else 13#else
@@ -16,3 +19,3 @@
16 * just display's information about the interface that is passed to it. 19 * just display's information about the interface that is passed to it.
17 */ 20 */
18InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){ 21InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){
@@ -26,2 +29,12 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na
26 connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); 29 connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced()));
30 Config cfg("networksettings", Config::User);
31 cfg.setGroup("interface");
32 CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) );
33}
34
35InterfaceInformationImp::~InterfaceInformationImp()
36{
37 Config cfg("networksettings", Config::User);
38 cfg.setGroup("interface");
39 cfg.writeEntry("silent", CheckBoxSilent->isChecked() );
27} 40}
@@ -32,3 +45,3 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na
32 * know about). 45 * know about).
33 */ 46 */
34void InterfaceInformationImp::updateInterface(Interface *){ 47void InterfaceInformationImp::updateInterface(Interface *){
@@ -53,3 +66,3 @@ void InterfaceInformationImp::updateInterface(Interface *){
53 * Display it. 66 * Display it.
54 */ 67 */
55void InterfaceInformationImp::advanced(){ 68void InterfaceInformationImp::advanced(){
@@ -72,4 +85,5 @@ void InterfaceInformationImp::advanced(){
72 * @param message the message to display. 85 * @param message the message to display.
73 */ 86 */
74void InterfaceInformationImp::showMessage(const QString &message){ 87void InterfaceInformationImp::showMessage(const QString &message){
88 if (CheckBoxSilent->isChecked()) return;
75 QMessageBox::information(this, "Message", message, QMessageBox::Ok); 89 QMessageBox::information(this, "Message", message, QMessageBox::Ok);
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.h b/noncore/settings/networksettings/interfaces/interfaceinformationimp.h
index 65cdfe0..9c93d1d 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.h
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.h
@@ -12,3 +12,3 @@ public:
12 InterfaceInformationImp(QWidget *parent=0, const char *name=0, Interface *i=0, WFlags f=0); 12 InterfaceInformationImp(QWidget *parent=0, const char *name=0, Interface *i=0, WFlags f=0);
13 ~InterfaceInformationImp(){}; 13 ~InterfaceInformationImp();
14 14
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp
index 71d0cf5..436e449 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaces.cpp
@@ -2,2 +2,3 @@
2 2
3#include <qcheckbox.h>
3#include <qfile.h> 4#include <qfile.h>
@@ -153,2 +154,3 @@ bool Interfaces::isInterfaceSet() const {
153bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ 154bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){
155 qDebug("Interfaces::addInterface(%s)",interface.latin1());
154 if(0 == acceptedFamily.contains(family)) 156 if(0 == acceptedFamily.contains(family))
@@ -168,2 +170,3 @@ bool Interfaces::addInterface(const QString &interface, const QString &family, c
168bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ 170bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){
171 qDebug("copy interface %s to %s", interface.latin1(), newInterface.latin1());
169 if(!setInterface(interface)) 172 if(!setInterface(interface))
@@ -274,2 +277,3 @@ QString Interfaces::getInterfaceMethod(bool &error){
274bool Interfaces::setInterfaceName(const QString &newName){ 277bool Interfaces::setInterfaceName(const QString &newName){
278 qDebug("setInterfaceName %s", newName.latin1());
275 if(currentIface == interfaces.end()) 279 if(currentIface == interfaces.end())
@@ -279,3 +283,6 @@ bool Interfaces::setInterfaceName(const QString &newName){
279 bool returnValue = false; 283 bool returnValue = false;
280 (*currentIface) = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); 284 QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue));
285 qDebug("setting %s",tmp.latin1());
286
287 (*currentIface) = tmp;
281 return !returnValue; 288 return !returnValue;
@@ -329,2 +336,4 @@ QString Interfaces::getInterfaceOption(const QString &option, bool &error){
329 * doesn't exist then it is added along with the value. 336 * doesn't exist then it is added along with the value.
337 * If value isEmpty() then we will remove the option
338 *
330 * @param option the options to set the value. 339 * @param option the options to set the value.
@@ -335,3 +344,7 @@ QString Interfaces::getInterfaceOption(const QString &option, bool &error){
335bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ 344bool Interfaces::setInterfaceOption(const QString &option, const QString &value){
336 return setOption(currentIface, option, value); 345 if( value.stripWhiteSpace().isEmpty() )
346 return removeInterfaceOption( option );
347
348 qDebug("iface >%s< option >%s< value >%s<", (*currentIface).latin1(), option.latin1(),value.latin1());
349 return setOption(currentIface, option, value);
337} 350}
@@ -494,15 +507,27 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op
494 return false; 507 return false;
495 508 qDebug("setting option");
496 bool found = false; 509 bool found = false;
510 bool replaced = false;
511 QStringList::Iterator insertAt = NULL;
497 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 512 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
498 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ 513 qDebug(" Interfaces::setOption got line >%s<",(*it).latin1());
499 if(!found && value != ""){ 514 // FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line
500 // Got to the end of the stanza without finding it, so append it. 515 // but since it works with an empty interfaces file I (tille) will not do anything more
501 interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); 516 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) ){
502 } 517 if (found) break;
503 found = true; 518// && it != start){
504 break; 519// if(!found && value != ""){
505 } 520// // Got to the end of the stanza without finding it, so append it.
521// qDebug(" Got to the end of the stanza without finding it, so append it.");
522// interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value));
523// }
524 qDebug("found 1");
525// interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value));
526 found = true;
527 insertAt = it;
528
529 }
506 if((*it).contains(option) && it != start && (*it).at(0) != '#'){ 530 if((*it).contains(option) && it != start && (*it).at(0) != '#'){
507 // Found it in stanza so replace it. 531 // Found it in stanza so replace it.
532 qDebug("found 2");
508 if(found) 533 if(found)
@@ -510,2 +535,3 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op
510 found = true; 535 found = true;
536 replaced = true;
511 (*it) = QString("\t%1 %2").arg(option).arg(value); 537 (*it) = QString("\t%1 %2").arg(option).arg(value);
@@ -514,2 +540,3 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op
514 if(!found){ 540 if(!found){
541 qDebug("! found insert anyway");
515 QStringList::Iterator p = start; 542 QStringList::Iterator p = start;
@@ -518,2 +545,7 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op
518 } 545 }
546
547 if(found && !replaced){
548 qDebug("found iface but not the option so insert it here...");
549 interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value));
550 }
519 return found; 551 return found;
@@ -554,3 +586,4 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString
554 found = true; 586 found = true;
555 (*it) = ""; 587 it = interfaces.remove( it ); // we really want to remove the line
588 --it; // we do ++it later in the head of the for loop
556 } 589 }
@@ -581,3 +614,4 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString
581 found = true; 614 found = true;
582 (*it) = ""; 615 it = interfaces.remove( it ); // we really want to remove the line
616 --it; // we do ++it later in the head of the for loop
583 } 617 }
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index b40d101..e844d8a 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -46,2 +46,3 @@ bool InterfaceSetupImp::saveChanges(){
46 QString iface = interfaces->getInterfaceName(error); 46 QString iface = interfaces->getInterfaceName(error);
47 qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() );
47 if(!saveSettings()) 48 if(!saveSettings())
@@ -119,2 +120,5 @@ bool InterfaceSetupImp::saveSettings(){
119 interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); 120 interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns);
121 }else{
122 interfaces->removeInterfaceOption("up "DNSSCRIPT" -a ");
123 interfaces->removeInterfaceOption("down "DNSSCRIPT" -r");
120 } 124 }
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 2d714ca..f74cf87 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -15,2 +15,3 @@
15#include <qtabwidget.h> // in order to disable the profiles tab 15#include <qtabwidget.h> // in order to disable the profiles tab
16#include <qpe/qpeapplication.h>
16 17
@@ -51,3 +52,3 @@
51 52
52MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name), advancedUserMode(true), scheme(DEFAULT_SCHEME){ 53MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME){
53 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); 54 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked()));
@@ -64,3 +65,3 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par
64 //FIXME: disable profiles for the moment: 65 //FIXME: disable profiles for the moment:
65// tabWidget->setTabEnabled( tab, false ); 66 tabWidget->setTabEnabled( tab, false );
66 67
@@ -80,2 +81,10 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par
80 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) { 81 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
82 /*
83 * we skipped it in getAllInterfaces now
84 * we need to ignore it as well
85 */
86 if (m_handledIfaces.contains( *ni) ) {
87 qDebug("Not up iface handled by module");
88 continue;
89 }
81 bool found = false; 90 bool found = false;
@@ -198,2 +207,6 @@ void MainWindowImp::getAllInterfaces(){
198 int flags = 0; 207 int flags = 0;
208 if ( m_handledIfaces.contains( (*it) ) ) {
209 qDebug(" %s is handled by a module", (*it).latin1() );
210 continue;
211 }
199// int family; 212// int family;
@@ -309,2 +322,3 @@ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &
309 322
323 m_handledIfaces += object->handledInterfaceNames();
310 // Store for deletion later 324 // Store for deletion later
@@ -428,3 +442,3 @@ void MainWindowImp::configureClicked(){
428 442
429 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WDestructiveClose ); 443 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WDestructiveClose | Qt::WStyle_ContextHelp );
430 configure->setProfile(currentProfileText); 444 configure->setProfile(currentProfileText);
@@ -461,3 +475,3 @@ void MainWindowImp::informationClicked(){
461 } 475 }
462 InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); 476 InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog | Qt::WStyle_ContextHelp);
463 information->showMaximized(); 477 information->showMaximized();
@@ -641,3 +655,2 @@ void MainWindowImp::receive(const QCString &msg, const QByteArray &arg)
641 qDebug("MainWindowImp::receive QCop msg >"+msg+"<"); 655 qDebug("MainWindowImp::receive QCop msg >"+msg+"<");
642
643 if (msg == "raise") { 656 if (msg == "raise") {
diff --git a/noncore/settings/networksettings/mainwindowimp.h b/noncore/settings/networksettings/mainwindowimp.h
index a553f75..451835b 100644
--- a/noncore/settings/networksettings/mainwindowimp.h
+++ b/noncore/settings/networksettings/mainwindowimp.h
@@ -12,3 +12,3 @@ class KProcess;
12class QCopChannel; 12class QCopChannel;
13#ifdef QWS 13#ifdef QWS
14class QLibrary; 14class QLibrary;
@@ -27,3 +27,3 @@ public:
27 ~MainWindowImp(); 27 ~MainWindowImp();
28 28
29 QCopChannel *channel; 29 QCopChannel *channel;
@@ -32,3 +32,3 @@ private slots:
32 void getAllInterfaces(); 32 void getAllInterfaces();
33 33
34 void addClicked(); 34 void addClicked();
@@ -37,3 +37,3 @@ private slots:
37 void informationClicked(); 37 void informationClicked();
38 38
39 void addProfile(); 39 void addProfile();
@@ -41,3 +41,3 @@ private slots:
41 void changeProfile(); 41 void changeProfile();
42 42
43 void updateInterface(Interface *i); 43 void updateInterface(Interface *i);
@@ -50,3 +50,3 @@ private:
50 void loadModules(const QString &path); 50 void loadModules(const QString &path);
51 51
52 Module* loadPlugin(const QString &pluginFileName, 52 Module* loadPlugin(const QString &pluginFileName,
@@ -60,3 +60,4 @@ private:
60 QMap<QListViewItem*, Interface*> interfaceItems; 60 QMap<QListViewItem*, Interface*> interfaceItems;
61 61 QStringList m_handledIfaces;
62
62 QMap<KProcess*, QString> threads; 63 QMap<KProcess*, QString> threads;
diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h
index db74394..f7d8046 100644
--- a/noncore/settings/networksettings/module.h
+++ b/noncore/settings/networksettings/module.h
@@ -20,3 +20,3 @@ signals:
20 20
21 21
22public: 22public:
@@ -34,5 +34,5 @@ public:
34 * @param newProfile what the profile should be changed to. 34 * @param newProfile what the profile should be changed to.
35 */ 35 */
36 virtual void setProfile(const QString &newProfile) = 0; 36 virtual void setProfile(const QString &newProfile) = 0;
37 37
38 /** 38 /**
@@ -40,4 +40,4 @@ public:
40 * @param Interface* can be used in determining the icon. 40 * @param Interface* can be used in determining the icon.
41 * @return QString the icon name (minus .png, .gif etc) 41 * @return QString the icon name (minus .png, .gif etc)
42 */ 42 */
43 virtual QString getPixmapName(Interface *) = 0; 43 virtual QString getPixmapName(Interface *) = 0;
@@ -50,3 +50,3 @@ public:
50 virtual bool isOwner(Interface *){ return false; }; 50 virtual bool isOwner(Interface *){ return false; };
51 51
52 /** 52 /**
@@ -57,3 +57,3 @@ public:
57 virtual QWidget *configure(Interface *){ return NULL; } ; 57 virtual QWidget *configure(Interface *){ return NULL; } ;
58 58
59 /** 59 /**
@@ -64,3 +64,3 @@ public:
64 virtual QWidget *information(Interface *){ return NULL; }; 64 virtual QWidget *information(Interface *){ return NULL; };
65 65
66 /** 66 /**
@@ -69,5 +69,5 @@ public:
69 * been called by isOwner() 69 * been called by isOwner()
70 */ 70 */
71 virtual QList<Interface> getInterfaces() = 0; 71 virtual QList<Interface> getInterfaces() = 0;
72 72
73 /** 73 /**
@@ -77,3 +77,3 @@ public:
77 virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0; 77 virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0;
78 78
79 /** 79 /**
@@ -82,5 +82,5 @@ public:
82 * @param name the type of interface to create 82 * @param name the type of interface to create
83 */ 83 */
84 virtual Interface *addNewInterface(const QString &name) = 0; 84 virtual Interface *addNewInterface(const QString &name) = 0;
85 85
86 /** 86 /**
@@ -92,3 +92,3 @@ public:
92 /** 92 /**
93 * get dcop calls 93 * get dcop calls
94 */ 94 */
@@ -96,2 +96,13 @@ public:
96 96
97 QStringList handledInterfaceNames()const { return m_inter; }
98protected:
99 /**
100 * set which interfaceNames should not be shown cause they're handled
101 * internally of this module.. An already running ppp link or
102 * a tunnel...
103 */
104 void setHandledInterfaceNames( const QStringList& in) { m_inter = in; }
105
106private:
107 QStringList m_inter;
97}; 108};
diff --git a/noncore/settings/networksettings/ppp/TODO b/noncore/settings/networksettings/ppp/TODO
index 80fc5a6..14a1b3f 100644
--- a/noncore/settings/networksettings/ppp/TODO
+++ b/noncore/settings/networksettings/ppp/TODO
@@ -1,9 +1,3 @@
1- ask for password is non is set 1- impl. PPPData::copyaccount
2
3- stop pppd, i.e. fix interfaceinformationppp
4
5- update modem attribute inputs when modem has changed
6- impl. PPPData::copyaccount & PPPData::deleteAccount
7
8- check if the same interface device combination allready exists 2- check if the same interface device combination allready exists
9- fix layout of edit account, i.e. get it shown maximised 3- check if a deleted account or device exists in a config and ask the user
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp
index fa1c43b..28d8732 100644
--- a/noncore/settings/networksettings/ppp/accounts.cpp
+++ b/noncore/settings/networksettings/ppp/accounts.cpp
@@ -46,29 +46,10 @@ void parseargs(char* buf, char** args);
46 46
47AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name ) 47
48 : QWidget( parent, name )//, _pppdata(pd) 48AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name, WFlags f )
49 : ChooserWidget( pd, parent, name, f )
49{ 50{
50 _pppdata = pd;
51 QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10);
52 accountlist_l = new QListBox(this);
53
54 connect(accountlist_l, SIGNAL(highlighted(int)),
55 this, SLOT(slotListBoxSelect(int)));
56 connect(accountlist_l, SIGNAL(selected(int)),
57 this, SLOT(editaccount()));
58 l1->addWidget(accountlist_l, 10);
59
60 edit_b = new QPushButton(tr("&Edit..."), this);
61 connect(edit_b, SIGNAL(clicked()), SLOT(editaccount()));
62 QWhatsThis::add(edit_b, tr("Allows you to modify the selected account"));
63 l1->addWidget(edit_b);
64 51
65 new_b = new QPushButton(tr("&New..."), this); 52 QWhatsThis::add(edit_b, tr("Allows you to modify the selected account"));
66 connect(new_b, SIGNAL(clicked()), SLOT(newaccount()));
67 l1->addWidget(new_b);
68 QWhatsThis::add(new_b, tr("Create a new dialup connection\n" 53 QWhatsThis::add(new_b, tr("Create a new dialup connection\n"
69 "to the Internet")); 54 "to the Internet"));
70
71 copy_b = new QPushButton(tr("Co&py"), this);
72 connect(copy_b, SIGNAL(clicked()), SLOT(copyaccount()));
73 l1->addWidget(copy_b);
74 QWhatsThis::add(copy_b, 55 QWhatsThis::add(copy_b,
@@ -78,6 +59,2 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name )
78 "needs")); 59 "needs"));
79
80 delete_b = new QPushButton(tr("De&lete"), this);
81 connect(delete_b, SIGNAL(clicked()), SLOT(deleteaccount()));
82 l1->addWidget(delete_b);
83 QWhatsThis::add(delete_b, 60 QWhatsThis::add(delete_b,
@@ -86,23 +63,13 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name )
86 63
87 QHBoxLayout *l12 = new QHBoxLayout;
88 l1->addStretch(1);
89 l1->addLayout(l12);
90 64
91 int currAccId = _pppdata->currentAccountID();
92 qDebug("currentAccountID %i", currAccId);
93 65
94 //load up account list from gppdata to the list box 66 copy_b->setEnabled( false ); //FIXME
95 if(_pppdata->count() > 0) { 67 // delete_b->setEnabled( false ); //FIXME
96 for(int i=0; i <= _pppdata->count()-1; i++) {
97 _pppdata->setAccountbyIndex(i);
98 accountlist_l->insertItem(_pppdata->accname());
99 }
100 }
101 _pppdata->setAccountbyIndex( currAccId );
102 68
103 qDebug("setting listview index to %i",_pppdata->currentAccountID() ); 69 listListbox->insertStringList(_pppdata->getAccountList());
104 accountlist_l->setCurrentItem( _pppdata->currentAccountID() );
105 slotListBoxSelect( _pppdata->currentAccountID() );
106 70
107 l1->activate(); 71 for (uint i = 0; i < listListbox->count(); i++){
72 if ( listListbox->text(i) == _pppdata->accname() )
73 listListbox->setCurrentItem( i );
74 }
108} 75}
@@ -112,14 +79,11 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name )
112void AccountWidget::slotListBoxSelect(int idx) { 79void AccountWidget::slotListBoxSelect(int idx) {
113 delete_b->setEnabled((bool)(idx != -1)); 80 bool ok = _pppdata->setAccount( listListbox->text(idx) );
114 edit_b->setEnabled((bool)(idx != -1)); 81 ok = (bool)(idx != -1);
115 copy_b->setEnabled((bool)(idx != -1)); 82 delete_b->setEnabled(ok);
116 if(idx!=-1) { 83 edit_b->setEnabled(ok);
117 qDebug("setting account to %i", idx); 84//FIXME copy_b->setEnabled(ok);
118 QString account = _pppdata->accname();
119 _pppdata->setAccountbyIndex(accountlist_l->currentItem());
120 }
121} 85}
122 86
123void AccountWidget::editaccount() { 87void AccountWidget::edit() {
124 _pppdata->setAccount(accountlist_l->text(accountlist_l->currentItem())); 88 _pppdata->setAccount(listListbox->text(listListbox->currentItem()));
125 89
@@ -128,3 +92,3 @@ void AccountWidget::editaccount() {
128 if(result == QDialog::Accepted) { 92 if(result == QDialog::Accepted) {
129 accountlist_l->changeItem(_pppdata->accname(),accountlist_l->currentItem()); 93 listListbox->changeItem(_pppdata->accname(),listListbox->currentItem());
130// emit resetaccounts(); 94// emit resetaccounts();
@@ -135,9 +99,9 @@ void AccountWidget::editaccount() {
135 99
136void AccountWidget::newaccount() { 100void AccountWidget::create() {
137 101
138 if(accountlist_l->count() == MAX_ACCOUNTS) { 102// if(listListbox->count() == MAX_ACCOUNTS) {
139 QMessageBox::information(this, "sorry", 103// QMessageBox::information(this, "sorry",
140 tr("Maximum number of accounts reached.")); 104// tr("Maximum number of accounts reached."));
141 return; 105// return;
142 } 106// }
143 107
@@ -151,4 +115,4 @@ void AccountWidget::newaccount() {
151 if(result == QDialog::Accepted) { 115 if(result == QDialog::Accepted) {
152 accountlist_l->insertItem(_pppdata->accname()); 116 listListbox->insertItem(_pppdata->accname());
153 accountlist_l->setSelected(accountlist_l->findItem(_pppdata->accname()),true); 117 listListbox->setSelected(listListbox->findItem(_pppdata->accname()),true);
154 118
@@ -160,9 +124,9 @@ void AccountWidget::newaccount() {
160 124
161void AccountWidget::copyaccount() { 125void AccountWidget::copy() {
162 if(accountlist_l->count() == MAX_ACCOUNTS) { 126// if(listListbox->count() == MAX_ACCOUNTS) {
163 QMessageBox::information(this, "sorry", tr("Maximum number of accounts reached.")); 127// QMessageBox::information(this, "sorry", tr("Maximum number of accounts reached."));
164 return; 128// return;
165 } 129// }
166 130
167 if(accountlist_l->currentItem()<0) { 131 if(listListbox->currentItem()<0) {
168 QMessageBox::information(this, "sorry", tr("No account selected.")); 132 QMessageBox::information(this, "sorry", tr("No account selected."));
@@ -171,5 +135,5 @@ void AccountWidget::copyaccount() {
171 135
172 _pppdata->copyaccount(accountlist_l->currentItem()); 136 _pppdata->copyaccount(listListbox->currentText());
173 137
174 accountlist_l->insertItem(_pppdata->accname()); 138 listListbox->insertItem(_pppdata->accname());
175// emit resetaccounts(); 139// emit resetaccounts();
@@ -179,6 +143,6 @@ void AccountWidget::copyaccount() {
179 143
180void AccountWidget::deleteaccount() { 144void AccountWidget::remove() {
181 145
182 QString s = tr("Are you sure you want to delete\nthe account \"%1\"?") 146 QString s = tr("Are you sure you want to delete\nthe account \"%1\"?")
183 .arg(accountlist_l->text(accountlist_l->currentItem())); 147 .arg(listListbox->text(listListbox->currentItem()));
184 148
@@ -189,9 +153,11 @@ void AccountWidget::deleteaccount() {
189 153
190 if(_pppdata->deleteAccount(accountlist_l->text(accountlist_l->currentItem()))) 154 if(_pppdata->deleteAccount(listListbox->text(listListbox->currentItem())))
191 accountlist_l->removeItem(accountlist_l->currentItem()); 155 listListbox->removeItem(listListbox->currentItem());
192 156
193 emit resetaccounts();
194 _pppdata->save();
195 157
196 slotListBoxSelect(accountlist_l->currentItem()); 158// emit resetaccounts();
159// _pppdata->save();
160
161
162 slotListBoxSelect(listListbox->currentItem());
197 163
@@ -201,3 +167,3 @@ void AccountWidget::deleteaccount() {
201int AccountWidget::doTab(){ 167int AccountWidget::doTab(){
202 QDialog *dlg = new QDialog( 0, "newAccount", true ); 168 QDialog *dlg = new QDialog( 0, "newAccount", true, Qt::WStyle_ContextHelp );
203 QVBoxLayout *layout = new QVBoxLayout( dlg ); 169 QVBoxLayout *layout = new QVBoxLayout( dlg );
@@ -206,3 +172,3 @@ int AccountWidget::doTab(){
206 172
207 tabWindow = new QTabWidget( dlg, "tabWindow" ); 173 QTabWidget *tabWindow = new QTabWidget( dlg, "tabWindow" );
208 layout->addWidget( tabWindow ); 174 layout->addWidget( tabWindow );
@@ -275,21 +241,21 @@ int AccountWidget::doTab(){
275 241
276QString AccountWidget::prettyPrintVolume(unsigned int n) { 242// QString AccountWidget::prettyPrintVolume(unsigned int n) {
277 int idx = 0; 243// int idx = 0;
278 const QString quant[] = {tr("Byte"), tr("KB"), 244// const QString quant[] = {tr("Byte"), tr("KB"),
279 tr("MB"), tr("GB"), QString::null}; 245 // tr("MB"), tr("GB"), QString::null};
280 246
281 float n1 = n; 247// float n1 = n;
282 while(n >= 1024 && quant[idx] != QString::null) { 248// while(n >= 1024 && quant[idx] != QString::null) {
283 idx++; 249// idx++;
284 n /= 1024; 250// n /= 1024;
285 } 251// }
286 252
287 int i = idx; 253// int i = idx;
288 while(i--) 254// while(i--)
289 n1 = n1 / 1024.0; 255// n1 = n1 / 1024.0;
290 256
291 QString s = QString::number( n1, 'f', idx==0 ? 0 : 1 ); 257// QString s = QString::number( n1, 'f', idx==0 ? 0 : 1 );
292 s += " " + quant[idx]; 258// s += " " + quant[idx];
293 return s; 259// return s;
294} 260// }
295 261
diff --git a/noncore/settings/networksettings/ppp/accounts.h b/noncore/settings/networksettings/ppp/accounts.h
index 8c16a7c..7f31513 100644
--- a/noncore/settings/networksettings/ppp/accounts.h
+++ b/noncore/settings/networksettings/ppp/accounts.h
@@ -29,3 +29,2 @@
29 29
30#include <qwidget.h>
31#include <qdialog.h> 30#include <qdialog.h>
@@ -33,5 +32,4 @@
33#include <qlistbox.h> 32#include <qlistbox.h>
34//#include "acctselect.h" 33#include "chooserwidget.h"
35 34
36class QDialog;
37class QCheckBox; 35class QCheckBox;
@@ -39,2 +37,6 @@ class QLineEdit;
39class QTabWidget; 37class QTabWidget;
38class ModemWidget;
39class ModemWidget2;
40
41
40class DialWidget; 42class DialWidget;
@@ -46,26 +48,23 @@ class PPPData;
46 48
47class AccountWidget : public QWidget { 49
50class AccountWidget : public ChooserWidget {
51
48 Q_OBJECT 52 Q_OBJECT
49public: 53public:
50 AccountWidget( PPPData *pd, QWidget *parent=0, const char *name=0 ); 54 AccountWidget( PPPData *pd, QWidget *parent=0, const char *name=0, WFlags f=0 );
51 ~AccountWidget() {} 55 ~AccountWidget() {}
52 56
53private slots:
54 void editaccount();
55 void copyaccount();
56 void newaccount();
57 void deleteaccount();
58 void slotListBoxSelect(int);
59 57
60private: 58private slots:
59 virtual void edit();
60 virtual void copy();
61 virtual void remove();
62 virtual void create();
63 virtual void slotListBoxSelect(int);
61 int doTab(); 64 int doTab();
62 65
63signals: 66 signals:
64 void resetaccounts(); 67 void resetaccounts();
65 68
66private: 69private:
67 QString prettyPrintVolume(unsigned int);
68
69 PPPData *_pppdata;
70 QTabWidget *tabWindow;
71 DialWidget *dial_w; 70 DialWidget *dial_w;
@@ -76,7 +75,2 @@ private:
76 75
77 QListBox *accountlist_l;
78 QPushButton *edit_b;
79 QPushButton *copy_b;
80 QPushButton *new_b;
81 QPushButton *delete_b;
82}; 76};
diff --git a/noncore/settings/networksettings/ppp/chooserwidget.cpp b/noncore/settings/networksettings/ppp/chooserwidget.cpp
new file mode 100644
index 0000000..a32b2b8
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/chooserwidget.cpp
@@ -0,0 +1,85 @@
1/*
2 * kPPP: A pppd front end for the KDE project
3 *
4 * $Id$
5 *
6 * Copyright (C) 1997 Bernd Johannes Wuebben
7 * wuebben@math.cornell.edu
8 *
9 * based on EzPPP:
10 * Copyright (C) 1997 Jay Painter
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU Library General Public
23 * License along with this program; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#include <qdir.h>
28#include <stdlib.h>
29#include <qlayout.h>
30#include <qtabwidget.h>
31#include <qtabdialog.h>
32#include <qwhatsthis.h>
33#include <qmessagebox.h>
34
35#include <qapplication.h>
36#include <qbuttongroup.h>
37#include <qmessagebox.h>
38#include <qvgroupbox.h>
39#include <qwidget.h>
40
41#include "accounts.h"
42#include "authwidget.h"
43#include "pppdata.h"
44#include "edit.h"
45
46void parseargs(char* buf, char** args);
47
48ChooserWidget::ChooserWidget( PPPData *pd, QWidget *parent, const char *name, WFlags f )
49 : QWidget( parent, name, f )
50{
51 _pppdata = pd;
52 QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10);
53 listListbox = new QListBox(this);
54
55 connect(listListbox, SIGNAL(highlighted(int)),
56 this, SLOT(slotListBoxSelect(int)));
57 connect(listListbox, SIGNAL(selected(int)),this, SLOT(edit()));
58 l1->addWidget(listListbox, 10);
59
60 edit_b = new QPushButton(tr("&Edit..."), this);
61 connect(edit_b, SIGNAL(clicked()), SLOT(edit()));
62 l1->addWidget(edit_b);
63
64 new_b = new QPushButton(tr("&New..."), this);
65 connect(new_b, SIGNAL(clicked()), SLOT(create()));
66 l1->addWidget(new_b);
67
68
69 copy_b = new QPushButton(tr("Co&py"), this);
70 connect(copy_b, SIGNAL(clicked()), SLOT(copy()));
71 l1->addWidget(copy_b);
72
73 delete_b = new QPushButton(tr("De&lete"), this);
74 connect(delete_b, SIGNAL(clicked()), SLOT(remove()));
75 l1->addWidget(delete_b);
76
77
78 QHBoxLayout *l12 = new QHBoxLayout;
79 l1->addStretch(1);
80 l1->addLayout(l12);
81
82 l1->activate();
83
84}
85
diff --git a/noncore/settings/networksettings/ppp/chooserwidget.h b/noncore/settings/networksettings/ppp/chooserwidget.h
new file mode 100644
index 0000000..ac3f4cb
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/chooserwidget.h
@@ -0,0 +1,73 @@
1/* -*- C++ -*-
2 * kPPP: A pppd front end for the KDE project
3 *
4 * $Id$
5 *
6 * Copyright (C) 1997 Bernd Johannes Wuebben
7 * wuebben@math.cornell.edu
8 *
9 * based on EzPPP:
10 * Copyright (C) 1997 Jay Painter
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU Library General Public
23 * License along with this program; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#ifndef _CHOOSERWIDGET_H_
28#define _CHOOSERWIDGET_H_
29
30#include <qwidget.h>
31#include <qdialog.h>
32#include <qpushbutton.h>
33#include <qlistbox.h>
34//#include "acctselect.h"
35
36class QDialog;
37class QCheckBox;
38class QLineEdit;
39class QTabWidget;
40class DialWidget;
41class AuthWidget;
42class IPWidget;
43class DNSWidget;
44class GatewayWidget;
45class PPPData;
46
47class ChooserWidget : public QWidget {
48 Q_OBJECT
49public:
50 ChooserWidget( PPPData *pd, QWidget *parent=0, const char *name=0, WFlags f=0 );
51 ~ChooserWidget() {}
52
53private slots:
54 virtual void edit() = 0;
55 virtual void copy() = 0;
56 virtual void create()= 0;
57 virtual void remove()= 0;
58 virtual void slotListBoxSelect(int) = 0;
59
60
61protected:
62 PPPData *_pppdata;
63
64 QListBox *listListbox;
65 QPushButton *edit_b;
66 QPushButton *copy_b;
67 QPushButton *new_b;
68 QPushButton *delete_b;
69};
70
71
72#endif
73
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 @@
34//#include <klocale.h> 34//#include <klocale.h>
35#define i18n QObject::tr
36#include <qmessagebox.h> 35#include <qmessagebox.h>
@@ -101,3 +100,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
101 QVBoxLayout *tl = new QVBoxLayout(this, 8, 10); 100 QVBoxLayout *tl = new QVBoxLayout(this, 8, 10);
102 QString tit = i18n("Connecting to: "); 101 QString tit = QObject::tr("Connecting to: ");
103 setCaption(tit); 102 setCaption(tit);
@@ -110,3 +109,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
110 messg->setAlignment(AlignCenter); 109 messg->setAlignment(AlignCenter);
111 messg->setText(i18n("Unable to create modem lock file.")); 110 messg->setText(QObject::tr("Unable to create modem lock file."));
112 messg->setMinimumHeight(messg->sizeHint().height() + 5); 111 messg->setMinimumHeight(messg->sizeHint().height() + 5);
@@ -116,5 +115,5 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
116 if (_ifaceppp->getStatus()) 115 if (_ifaceppp->getStatus())
117 messg->setText(i18n("Online")); 116 messg->setText(QObject::tr("Online"));
118 else 117 else
119 messg->setText(i18n("Offline")); 118 messg->setText(QObject::tr("Offline"));
120 l0->addSpacing(10); 119 l0->addSpacing(10);
@@ -127,3 +126,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
127 126
128 debug = new QPushButton(i18n("Log"), this); 127 debug = new QPushButton(QObject::tr("Log"), this);
129 debug->setToggleButton(true); 128 debug->setToggleButton(true);
@@ -132,3 +131,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam
132 131
133 cancel = new QPushButton(i18n("Cancel"), this); 132 cancel = new QPushButton(QObject::tr("Cancel"), this);
134 cancel->setFocus(); 133 cancel->setFocus();
@@ -175,3 +174,3 @@ void ConnectWidget::preinit() {
175 // you have to see to believe ... 174 // you have to see to believe ...
176 messg->setText(i18n("Looking for modem...")); 175 messg->setText(QObject::tr("Looking for modem..."));
177 inittimer->start(100); 176 inittimer->start(100);
@@ -203,3 +202,3 @@ void ConnectWidget::init() {
203 202
204 QString tit = i18n("Connecting to: %1").arg(_ifaceppp->data()->accname()); 203 QString tit = QObject::tr("Connecting to: %1").arg(_ifaceppp->data()->accname());
205 setCaption(tit); 204 setCaption(tit);
@@ -210,4 +209,4 @@ void ConnectWidget::init() {
210 if (!_ifaceppp->data()->command_before_connect().isEmpty()) { 209 if (!_ifaceppp->data()->command_before_connect().isEmpty()) {
211 messg->setText(i18n("Running pre-startup command...")); 210 messg->setText(QObject::tr("Running pre-startup command..."));
212 emit debugMessage(i18n("Running pre-startup command...")); 211 emit debugMessage(QObject::tr("Running pre-startup command..."));
213 212
@@ -228,3 +227,3 @@ void ConnectWidget::init() {
228 if (lock == 1) { 227 if (lock == 1) {
229 messg->setText(i18n("Modem device is locked.")); 228 messg->setText(QObject::tr("Modem device is locked."));
230 vmain = 20; // wait until cancel is pressed 229 vmain = 20; // wait until cancel is pressed
@@ -234,3 +233,3 @@ void ConnectWidget::init() {
234 if (lock == -1) { 233 if (lock == -1) {
235 messg->setText(i18n("Unable to create modem lock file.")); 234 messg->setText(QObject::tr("Unable to create modem lock file."));
236 vmain = 20; // wait until cancel is pressed 235 vmain = 20; // wait until cancel is pressed
@@ -281,4 +280,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
281 if(substate == -1) { 280 if(substate == -1) {
282 messg->setText(i18n("Initializing modem...")); 281 messg->setText(QObject::tr("Initializing modem..."));
283 emit debugMessage(i18n("Initializing modem...")); 282 emit debugMessage(QObject::tr("Initializing modem..."));
284 substate = 0; 283 substate = 0;
@@ -319,3 +318,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
319 QString sToneDuration = "ATS11=" + QString::number(_ifaceppp->data()->modemToneDuration()); 318 QString sToneDuration = "ATS11=" + QString::number(_ifaceppp->data()->modemToneDuration());
320 QString msg = i18n("Setting ") + sToneDuration; 319 QString msg = QObject::tr("Setting ") + sToneDuration;
321 messg->setText(msg); 320 messg->setText(msg);
@@ -342,4 +341,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
342 } 341 }
343 messg->setText(i18n("Setting speaker volume...")); 342 messg->setText(QObject::tr("Setting speaker volume..."));
344 emit debugMessage(i18n("Setting speaker volume...")); 343 emit debugMessage(QObject::tr("Setting speaker volume..."));
345 344
@@ -358,3 +357,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
358 if(!_ifaceppp->data()->waitForDialTone()) { 357 if(!_ifaceppp->data()->waitForDialTone()) {
359 QString msg = i18n("Turning off dial tone waiting..."); 358 QString msg = QObject::tr("Turning off dial tone waiting...");
360 messg->setText(msg); 359 messg->setText(msg);
@@ -379,3 +378,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
379 bmarg += *plist.at(dialnumber); 378 bmarg += *plist.at(dialnumber);
380 QString bm = i18n("Dialing %1").arg(bmarg); 379 QString bm = QObject::tr("Dialing %1").arg(bmarg);
381 messg->setText(bm); 380 messg->setText(bm);
@@ -410,3 +409,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
410 409
411 messg->setText(i18n("Line busy. Hanging up...")); 410 messg->setText(QObject::tr("Line busy. Hanging up..."));
412 emit debugPutChar('\n'); 411 emit debugPutChar('\n');
@@ -415,3 +414,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
415 if(_ifaceppp->data()->busyWait() > 0) { 414 if(_ifaceppp->data()->busyWait() > 0) {
416 QString bm = i18n("Line busy. Waiting: %1 seconds").arg(_ifaceppp->data()->busyWait()); 415 QString bm = QObject::tr("Line busy. Waiting: %1 seconds").arg(_ifaceppp->data()->busyWait());
417 messg->setText(bm); 416 messg->setText(bm);
@@ -434,3 +433,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
434 433
435 messg->setText(i18n("No Dialtone")); 434 messg->setText(QObject::tr("No Dialtone"));
436 vmain = 20; 435 vmain = 20;
@@ -443,3 +442,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
443 442
444 messg->setText(i18n("No Carrier")); 443 messg->setText(QObject::tr("No Carrier"));
445 vmain = 20; 444 vmain = 20;
@@ -481,3 +480,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
481 if (scriptCommand == "Scan") { 480 if (scriptCommand == "Scan") {
482 QString bm = i18n("Scanning %1").arg(scriptArgument); 481 QString bm = QObject::tr("Scanning %1").arg(scriptArgument);
483 messg->setText(bm); 482 messg->setText(bm);
@@ -491,3 +490,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
491 if (scriptCommand == "Save") { 490 if (scriptCommand == "Save") {
492 QString bm = i18n("Saving %1").arg(scriptArgument); 491 QString bm = QObject::tr("Saving %1").arg(scriptArgument);
493 messg->setText(bm); 492 messg->setText(bm);
@@ -509,3 +508,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
509 if (scriptCommand == "Send" || scriptCommand == "SendNoEcho") { 508 if (scriptCommand == "Send" || scriptCommand == "SendNoEcho") {
510 QString bm = i18n("Sending %1"); 509 QString bm = QObject::tr("Sending %1");
511 510
@@ -534,3 +533,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
534 if (scriptCommand == "Expect") { 533 if (scriptCommand == "Expect") {
535 QString bm = i18n("Expecting %1").arg(scriptArgument); 534 QString bm = QObject::tr("Expecting %1").arg(scriptArgument);
536 messg->setText(bm); 535 messg->setText(bm);
@@ -548,3 +547,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
548 if (scriptCommand == "Pause") { 547 if (scriptCommand == "Pause") {
549 QString bm = i18n("Pause %1 seconds").arg(scriptArgument); 548 QString bm = QObject::tr("Pause %1 seconds").arg(scriptArgument);
550 messg->setText(bm); 549 messg->setText(bm);
@@ -565,3 +564,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
565 564
566 QString bm = i18n("Timeout %1 seconds").arg(scriptArgument); 565 QString bm = QObject::tr("Timeout %1 seconds").arg(scriptArgument);
567 messg->setText(bm); 566 messg->setText(bm);
@@ -577,4 +576,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
577 if (scriptCommand == "Hangup") { 576 if (scriptCommand == "Hangup") {
578 messg->setText(i18n("Hangup")); 577 messg->setText(QObject::tr("Hangup"));
579 emit debugMessage(i18n("Hangup")); 578 emit debugMessage(QObject::tr("Hangup"));
580 579
@@ -591,4 +590,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
591 590
592 messg->setText(i18n("Answer")); 591 messg->setText(QObject::tr("Answer"));
593 emit debugMessage(i18n("Answer")); 592 emit debugMessage(QObject::tr("Answer"));
594 593
@@ -600,3 +599,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
600 if (scriptCommand == "ID") { 599 if (scriptCommand == "ID") {
601 QString bm = i18n("ID %1").arg(scriptArgument); 600 QString bm = QObject::tr("ID %1").arg(scriptArgument);
602 messg->setText(bm); 601 messg->setText(bm);
@@ -636,3 +635,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
636 if (scriptCommand == "Password") { 635 if (scriptCommand == "Password") {
637 QString bm = i18n("Password %1").arg(scriptArgument); 636 QString bm = QObject::tr("Password %1").arg(scriptArgument);
638 messg->setText(bm); 637 messg->setText(bm);
@@ -673,3 +672,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
673 if (scriptCommand == "Prompt") { 672 if (scriptCommand == "Prompt") {
674 QString bm = i18n("Prompting %1"); 673 QString bm = QObject::tr("Prompting %1");
675 674
@@ -710,3 +709,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
710 if (scriptCommand == "PWPrompt") { 709 if (scriptCommand == "PWPrompt") {
711 QString bm = i18n("PW Prompt %1").arg(scriptArgument); 710 QString bm = QObject::tr("PW Prompt %1").arg(scriptArgument);
712 messg->setText(bm); 711 messg->setText(bm);
@@ -735,3 +734,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
735 734
736 QString bm = i18n("Loop Start %1").arg(scriptArgument); 735 QString bm = QObject::tr("Loop Start %1").arg(scriptArgument);
737 736
@@ -743,6 +742,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
743 if ( loopnest > (MAXLOOPNEST-2) ) { 742 if ( loopnest > (MAXLOOPNEST-2) ) {
744 bm += i18n("ERROR: Nested too deep, ignored."); 743 bm += QObject::tr("ERROR: Nested too deep, ignored.");
745 vmain=20; 744 vmain=20;
746 cancelbutton(); 745 cancelbutton();
747 QMessageBox::critical(0, "error", i18n("Loops nested too deeply!")); 746 QMessageBox::critical(0, "error", QObject::tr("Loops nested too deeply!"));
748 } else { 747 } else {
@@ -760,5 +759,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
760 if (scriptCommand == "LoopEnd") { 759 if (scriptCommand == "LoopEnd") {
761 QString bm = i18n("Loop End %1").arg(scriptArgument); 760 QString bm = QObject::tr("Loop End %1").arg(scriptArgument);
762 if ( loopnest <= 0 ) { 761 if ( loopnest <= 0 ) {
763 bm = i18n("LoopEnd without matching Start! Line: %1").arg(bm); 762 bm = QObject::tr("LoopEnd without matching Start! Line: %1").arg(bm);
764 vmain=20; 763 vmain=20;
@@ -850,3 +849,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
850 849
851 emit debugMessage(i18n("Starting pppd...")); 850 emit debugMessage(QObject::tr("Starting pppd..."));
852 qDebug("execppp() returned with return-code %i", result ); 851 qDebug("execppp() returned with return-code %i", result );
@@ -932,3 +931,3 @@ void ConnectWidget::checkBuffers() {
932 // Show the Variabel content in the debug window 931 // Show the Variabel content in the debug window
933 QString sv = i18n("Scan Var: %1").arg(scanvar); 932 QString sv = QObject::tr("Scan Var: %1").arg(scanvar);
934 emit debugMessage(sv); 933 emit debugMessage(sv);
@@ -942,3 +941,3 @@ void ConnectWidget::checkBuffers() {
942 941
943 QString ts = i18n("Found: %1").arg(expectstr); 942 QString ts = QObject::tr("Found: %1").arg(expectstr);
944 emit debugMessage(ts); 943 emit debugMessage(ts);
@@ -953,3 +952,3 @@ void ConnectWidget::checkBuffers() {
953 readbuffer = ""; 952 readbuffer = "";
954 QString ts = i18n("Looping: %1").arg(loopstr[loopnest]); 953 QString ts = QObject::tr("Looping: %1").arg(loopstr[loopnest]);
955 emit debugMessage(ts); 954 emit debugMessage(ts);
@@ -986,3 +985,3 @@ void ConnectWidget::cancelbutton() {
986 985
987 messg->setText(i18n("One moment please...")); 986 messg->setText(QObject::tr("One moment please..."));
988 987
@@ -1008,3 +1007,3 @@ void ConnectWidget::cancelbutton() {
1008 if (prompt->isVisible()) { 1007 if (prompt->isVisible()) {
1009 prompt->hide(); 1008 prompt->hide();
1010 } 1009 }
@@ -1012,3 +1011,6 @@ void ConnectWidget::cancelbutton() {
1012 1011
1013 messg->setText(tr("offline")); 1012 _ifaceppp->setStatus( false );
1013 _ifaceppp->refresh();
1014// messg->setText(tr("offline"));
1015 refresh();
1014} 1016}
@@ -1028,3 +1030,3 @@ void ConnectWidget::script_timed_out() {
1028 prompt->setConsumed(); 1030 prompt->setConsumed();
1029 messg->setText(i18n("Script timed out!")); 1031 messg->setText(QObject::tr("Script timed out!"));
1030 _ifaceppp->modem()->hangup(); 1032 _ifaceppp->modem()->hangup();
@@ -1043,3 +1045,3 @@ void ConnectWidget::setScan(const QString &n) {
1043 1045
1044 QString ts = i18n("Scanning: %1").arg(n); 1046 QString ts = QObject::tr("Scanning: %1").arg(n);
1045 emit debugMessage(ts); 1047 emit debugMessage(ts);
@@ -1052,3 +1054,3 @@ void ConnectWidget::setExpect(const QString &n) {
1052 1054
1053 QString ts = i18n("Expecting: %1").arg(n); 1055 QString ts = QObject::tr("Expecting: %1").arg(n);
1054 ts.replace(QRegExp("\n"), "<LF>"); 1056 ts.replace(QRegExp("\n"), "<LF>");
@@ -1087,3 +1089,3 @@ void ConnectWidget::pppdDied()
1087void ConnectWidget::if_waiting_slot() { 1089void ConnectWidget::if_waiting_slot() {
1088 messg->setText(i18n("Logging on to network...")); 1090 messg->setText(QObject::tr("Logging on to network..."));
1089 1091
@@ -1118,3 +1120,3 @@ void ConnectWidget::if_waiting_slot() {
1118 if(!_ifaceppp->data()->command_on_connect().isEmpty()) { 1120 if(!_ifaceppp->data()->command_on_connect().isEmpty()) {
1119 messg->setText(i18n("Running startup command...")); 1121 messg->setText(QObject::tr("Running startup command..."));
1120 1122
@@ -1123,3 +1125,3 @@ void ConnectWidget::if_waiting_slot() {
1123 execute_command(_ifaceppp->data()->command_on_connect()); 1125 execute_command(_ifaceppp->data()->command_on_connect());
1124 messg->setText(i18n("Done")); 1126 messg->setText(QObject::tr("Done"));
1125 } 1127 }
@@ -1130,3 +1132,3 @@ void ConnectWidget::if_waiting_slot() {
1130 1132
1131 emit debugMessage(i18n("Done")); 1133 emit debugMessage(QObject::tr("Done"));
1132 set_con_speed_string(); 1134 set_con_speed_string();
@@ -1134,6 +1136,11 @@ void ConnectWidget::if_waiting_slot() {
1134// p_kppp->con_win->setConnectionSpeed(p_kppp->con_speed); 1136// p_kppp->con_win->setConnectionSpeed(p_kppp->con_speed);
1135 this->hide(); 1137// this->hide();
1136 messg->setText(""); 1138// messg->setText("");
1137 1139
1138 _ifaceppp->setStatus( true ); 1140 _ifaceppp->setStatus( true );
1141
1142 m_refreshTimer = new QTimer( this );
1143 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
1144 m_refreshTimer->start( 3000 );
1145 //_ifaceppp->refresh();
1139 // emit _ifaceppp->updateInterface(_ifaceppp); 1146 // emit _ifaceppp->updateInterface(_ifaceppp);
@@ -1163,2 +1170,11 @@ void ConnectWidget::if_waiting_slot() {
1163 1170
1171void ConnectWidget::refresh() {
1172 _ifaceppp->refresh();
1173 if ( _ifaceppp->getStatus() ) {
1174 messg->setText(QObject::tr("Online"));
1175 } else {
1176 messg->setText(QObject::tr("Offline"));
1177 }
1178}
1179
1164 1180
@@ -1212,9 +1228,2 @@ bool ConnectWidget::execppp() {
1212 1228
1213 QStringList &arglist = _ifaceppp->data()->pppdArgument();
1214 for ( QStringList::Iterator it = arglist.begin();
1215 it != arglist.end();
1216 ++it )
1217 {
1218 command += " " + *it;
1219 }
1220 1229
@@ -1223,3 +1232,3 @@ bool ConnectWidget::execppp() {
1223 command += " -chap user "; 1232 command += " -chap user ";
1224 command = command + "\"" + _ifaceppp->data()->storedUsername() + "\""; 1233 command = command + _ifaceppp->data()->storedUsername();
1225 } 1234 }
@@ -1229,3 +1238,3 @@ bool ConnectWidget::execppp() {
1229 command += " -pap user "; 1238 command += " -pap user ";
1230 command = command + "\"" + _ifaceppp->data()->storedUsername() + "\""; 1239 command = command + _ifaceppp->data()->storedUsername();
1231 } 1240 }
@@ -1234,4 +1243,7 @@ bool ConnectWidget::execppp() {
1234 if(_ifaceppp->data()->authMethod() == AUTH_PAPCHAP) { 1243 if(_ifaceppp->data()->authMethod() == AUTH_PAPCHAP) {
1235 command += " user "; 1244 QString tmpName = _ifaceppp->data()->storedUsername();
1236 command = command + "\"" + _ifaceppp->data()->storedUsername() + "\""; 1245 if ( !tmpName.isEmpty() ) {
1246 command += " user ";
1247 command = command + tmpName;
1248 }
1237 } 1249 }
@@ -1242,4 +1254,14 @@ bool ConnectWidget::execppp() {
1242 1254
1255 QStringList &arglist = _ifaceppp->data()->pppdArgument();
1256 for ( QStringList::Iterator it = arglist.begin();
1257 it != arglist.end();
1258 ++it )
1259 {
1260 command += " " + *it;
1261 }
1262
1263 command += " call opie-kppp logfd 11";
1264
1243 if (command.length() > MAX_CMDLEN) { 1265 if (command.length() > MAX_CMDLEN) {
1244 QMessageBox::critical(this, "error", i18n( 1266 QMessageBox::critical(this, "error", QObject::tr(
1245 "pppd command + command-line arguments exceed " 1267 "pppd command + command-line arguments exceed "
@@ -1251,2 +1273,4 @@ bool ConnectWidget::execppp() {
1251 1273
1274 qWarning("Command IS: %s",command.latin1() );
1275
1252 qApp->flushX(); 1276 qApp->flushX();
diff --git a/noncore/settings/networksettings/ppp/connect.h b/noncore/settings/networksettings/ppp/connect.h
index e7ae5e0..b225ff5 100644
--- a/noncore/settings/networksettings/ppp/connect.h
+++ b/noncore/settings/networksettings/ppp/connect.h
@@ -64,2 +64,3 @@ private slots:
64 void if_waiting_slot(); 64 void if_waiting_slot();
65 void refresh();
65 66
@@ -129,2 +130,3 @@ private:
129 QTimer *if_timeout_timer; 130 QTimer *if_timeout_timer;
131 QTimer *m_refreshTimer;
130 132
diff --git a/noncore/settings/networksettings/ppp/conwindow.cpp b/noncore/settings/networksettings/ppp/conwindow.cpp
index 9136ca0..7641bbe 100644
--- a/noncore/settings/networksettings/ppp/conwindow.cpp
+++ b/noncore/settings/networksettings/ppp/conwindow.cpp
@@ -26,8 +26,3 @@
26#include "conwindow.h" 26#include "conwindow.h"
27//#include "docking.h"
28#include "pppdata.h" 27#include "pppdata.h"
29// #include "pppstats.h"
30// #include <klocale.h>
31#define i18n QObject::tr
32// #include <kglobal.h>
33 28
@@ -44,9 +39,9 @@ ConWindow::ConWindow(PPPData *pd, QWidget *parent, const char *name,
44{ 39{
45 info1 = new QLabel(i18n("Connected at:"), this); 40 info1 = new QLabel(QObject::tr("Connected at:"), this);
46 info2 = new QLabel("", this); 41 info2 = new QLabel("", this);
47 42
48 timelabel1 = new QLabel(i18n("Time connected:"), this); 43 timelabel1 = new QLabel(QObject::tr("Time connected:"), this);
49 timelabel2 = new QLabel("000:00:00", this); 44 timelabel2 = new QLabel("000:00:00", this);
50 45
51 vollabel = new QLabel(i18n("Volume:"), this); 46 vollabel = new QLabel(QObject::tr("Volume:"), this);
52 volinfo = new QLabel("", this); 47 volinfo = new QLabel("", this);
@@ -54,5 +49,5 @@ ConWindow::ConWindow(PPPData *pd, QWidget *parent, const char *name,
54 // now the stuff for accounting 49 // now the stuff for accounting
55 session_bill_l = new QLabel(i18n("Session Bill:"), this); 50 session_bill_l = new QLabel(QObject::tr("Session Bill:"), this);
56 session_bill = new QLabel("", this); 51 session_bill = new QLabel("", this);
57 total_bill_l = new QLabel(i18n("Total Bill:"), this); 52 total_bill_l = new QLabel(QObject::tr("Total Bill:"), this);
58 total_bill = new QLabel("", this); 53 total_bill = new QLabel("", this);
@@ -62,3 +57,3 @@ ConWindow::ConWindow(PPPData *pd, QWidget *parent, const char *name,
62 cancelbutton = new QPushButton(this); 57 cancelbutton = new QPushButton(this);
63 cancelbutton->setText(i18n("Disconnect")); 58 cancelbutton->setText(QObject::tr("Disconnect"));
64 connect(cancelbutton, SIGNAL(clicked()), mainwidget, SLOT(disconnect())); 59 connect(cancelbutton, SIGNAL(clicked()), mainwidget, SLOT(disconnect()));
@@ -66,3 +61,3 @@ ConWindow::ConWindow(PPPData *pd, QWidget *parent, const char *name,
66 // statsbutton = new QPushButton(this); 61 // statsbutton = new QPushButton(this);
67// statsbutton->setText(i18n("Details")); 62// statsbutton->setText(QObject::tr("Details"));
68// statsbutton->setFocus(); 63// statsbutton->setFocus();
@@ -96,4 +91,4 @@ QString ConWindow::prettyPrintVolume(unsigned int n) {
96 int idx = 0; 91 int idx = 0;
97 const QString quant[] = {i18n("Byte"), i18n("KB"), 92 const QString quant[] = {QObject::tr("Byte"), QObject::tr("KB"),
98 i18n("MB"), i18n("GB"), QString::null}; 93 QObject::tr("MB"), QObject::tr("GB"), QString::null};
99 94
@@ -261,3 +256,3 @@ void ConWindow::stopClock() {
261void ConWindow::timeclick() { 256void ConWindow::timeclick() {
262// QString tooltip = i18n("Connection: %1\n" 257// QString tooltip = QObject::tr("Connection: %1\n"
263 // "Connected at: %2\n" 258 // "Connected at: %2\n"
@@ -268,3 +263,3 @@ void ConWindow::timeclick() {
268// if(accountingEnabled) 263// if(accountingEnabled)
269// tooltip += i18n("\nSession Bill: %1\nTotal Bill: %2") 264// tooltip += QObject::tr("\nSession Bill: %1\nTotal Bill: %2")
270 // .arg(session_bill->text()).arg(total_bill->text()); 265 // .arg(session_bill->text()).arg(total_bill->text());
diff --git a/noncore/settings/networksettings/ppp/devices.cpp b/noncore/settings/networksettings/ppp/devices.cpp
new file mode 100644
index 0000000..e94904b
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/devices.cpp
@@ -0,0 +1,212 @@
1/*
2 * kPPP: A pppd front end for the KDE project
3 *
4 * $Id$
5 *
6 * Copyright (C) 1997 Bernd Johannes Wuebben
7 * wuebben@math.cornell.edu
8 *
9 * based on EzPPP:
10 * Copyright (C) 1997 Jay Painter
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU Library General Public
23 * License along with this program; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#include <qdir.h>
28#include <stdlib.h>
29#include <qlayout.h>
30#include <qtabwidget.h>
31#include <qtabdialog.h>
32#include <qwhatsthis.h>
33#include <qmessagebox.h>
34
35#include <qapplication.h>
36#include <qbuttongroup.h>
37#include <qmessagebox.h>
38#include <qvgroupbox.h>
39
40#include "interfaceppp.h"
41#include "devices.h"
42#include "authwidget.h"
43#include "pppdata.h"
44#include "edit.h"
45#include "general.h"
46
47void parseargs(char* buf, char** args);
48
49DevicesWidget::DevicesWidget( InterfacePPP* ip, QWidget *parent, const char *name, WFlags f )
50 : ChooserWidget(ip->data(), parent, name, f)
51{
52 _ifaceppp = ip;
53 QWhatsThis::add(edit_b, tr("Allows you to modify the selected device"));
54 QWhatsThis::add(new_b, tr("Create a new device") );
55
56 QWhatsThis::add(copy_b,
57 tr("Makes a copy of the selected device. All\n"
58 "settings of the selected device are copied\n"
59 "to a new device, that you can modify to fit your\n"
60 "needs"));
61 QWhatsThis::add(delete_b,
62 tr("<p>Deletes the selected device\n\n"
63 "<font color=\"red\"><b>Use with care!</b></font>"));
64
65 copy_b->setEnabled( false ); //FIXME
66// delete_b->setEnabled( false ); //FIXME
67
68 QStringList tmp = _pppdata->getDevicesNamesList();
69 qDebug("DevicesWidget::DevicesWidget got devices %s",tmp.join("--").latin1());
70 listListbox->insertStringList(tmp);
71
72 for (uint i = 0; i < listListbox->count(); i++){
73 qDebug("listListbox->text(i) %s == _pppdata->devname() %s",listListbox->text(i).latin1(), _pppdata->devname().latin1());
74 if ( listListbox->text(i) == _pppdata->devname() )
75 listListbox->setCurrentItem( i );
76 }
77}
78
79
80
81void DevicesWidget::slotListBoxSelect(int idx) {
82 bool ok = _pppdata->setDevice( listListbox->text(idx) );
83 delete_b->setEnabled((bool)(idx != -1));
84 edit_b->setEnabled((bool)(idx != -1));
85//FIXME copy_b->setEnabled((bool)(idx != -1));
86}
87
88void DevicesWidget::edit() {
89 _pppdata->setDevice(listListbox->text(listListbox->currentItem()));
90
91 int result = doTab();
92
93 if(result == QDialog::Accepted) {
94 listListbox->changeItem(_pppdata->devname(),listListbox->currentItem());
95 _pppdata->save();
96 }
97}
98
99
100void DevicesWidget::create() {
101
102// if(listListbox->count() == MAX_ACCOUNTS) {
103// QMessageBox::information(this, "sorry",
104// tr("Maximum number of accounts reached."));
105// return;
106// }
107
108 int result;
109 if (_pppdata->newdevice() == -1){
110 return;
111 }
112 result = doTab();
113
114 if(result == QDialog::Accepted) {
115 listListbox->insertItem(_pppdata->devname());
116 listListbox->setSelected(listListbox->findItem(_pppdata->devname()),true );
117
118 _pppdata->save();
119 } else
120 _pppdata->deleteDevice();
121}
122
123
124void DevicesWidget::copy() {
125// if(listListbox->count() == MAX_ACCOUNTS) {
126// QMessageBox::information(this, "sorry", tr("Maximum number of accounts reached."));
127// return;
128// }
129
130 if(listListbox->currentItem()<0) {
131 QMessageBox::information(this, "sorry", tr("No devices selected."));
132 return;
133 }
134
135 _pppdata->copydevice(listListbox->currentText());
136
137 listListbox->insertItem(_pppdata->devname());
138 _pppdata->save();
139}
140
141
142void DevicesWidget::remove() {
143
144 QString s = tr("Are you sure you want to delete\nthe device \"%1\"?")
145 .arg(listListbox->text(listListbox->currentItem()));
146
147 if(QMessageBox::warning(this,tr("Confirm"),s,
148 QMessageBox::Yes,QMessageBox::No
149 ) != QMessageBox::Yes)
150 return;
151
152 if(_pppdata->deleteDevice(listListbox->text(listListbox->currentItem())))
153 listListbox->removeItem(listListbox->currentItem());
154
155
156// _pppdata->save();
157
158
159 slotListBoxSelect(listListbox->currentItem());
160
161}
162
163
164int DevicesWidget::doTab(){
165 QDialog *dlg = new QDialog( 0, "newDevice", true, Qt::WStyle_ContextHelp );
166 QVBoxLayout *layout = new QVBoxLayout( dlg );
167 layout->setSpacing( 0 );
168 layout->setMargin( 1 );
169
170 QTabWidget *tabWindow = new QTabWidget( dlg, "tabWindow" );
171 layout->addWidget( tabWindow );
172
173 bool isnew;
174
175 if(_pppdata->devname().isEmpty()) {
176 dlg->setCaption(tr("New Device"));
177 isnew = true;
178 } else {
179 QString tit = tr("Edit Device: ");
180 tit += _pppdata->devname();
181 dlg->setCaption(tit);
182 isnew = false;
183 }
184
185 modem1 = new ModemWidget( _pppdata, tabWindow, "modem1" );
186 tabWindow->addTab( modem1, tr("&Device") );
187 modem2 = new ModemWidget2( _pppdata, _ifaceppp, tabWindow, "modem2" );
188 tabWindow->addTab( modem2, tr("&Modem") );
189
190 int result = 0;
191 bool ok = false;
192
193 while (!ok){
194 dlg->showMaximized();
195 result = dlg->exec();
196 ok = true;
197
198 if(result == QDialog::Accepted) {
199 if (!modem1->save()){
200 QMessageBox::critical(this, "error", tr( "You must enter a unique device name"));
201 ok = false;
202 }else{
203 modem2->save();
204 }
205 }
206 }
207
208 delete dlg;
209
210 return result;
211}
212
diff --git a/noncore/settings/networksettings/ppp/devices.h b/noncore/settings/networksettings/ppp/devices.h
index d46d5b4..c2679c8 100644
--- a/noncore/settings/networksettings/ppp/devices.h
+++ b/noncore/settings/networksettings/ppp/devices.h
@@ -5,55 +5,46 @@
5 5
6static const char *devices[] = { 6#include <qwidget.h>
7#ifdef __FreeBSD__ 7#include <qdialog.h>
8 "/dev/cuaa0", 8#include <qpushbutton.h>
9 "/dev/cuaa1", 9#include <qlistbox.h>
10 "/dev/cuaa2", 10#include "chooserwidget.h"
11 "/dev/cuaa3", 11
12 "/dev/cuaa4", 12class QCheckBox;
13#elif defined(__NetBSD__) 13class QLineEdit;
14 "/dev/tty00", /* "normal" modem lines */ 14class QTabWidget;
15 "/dev/tty01", 15class DialWidget;
16 "/dev/tty02", 16class AuthWidget;
17 "/dev/tty03", 17class IPWidget;
18 "/dev/dty00", /* Dial out devices */ 18class DNSWidget;
19 "/dev/dty01", 19class GatewayWidget;
20 "/dev/dty02", 20class InterfacePPP;
21 "/dev/dty03", 21class PPPData;
22 "/dev/ttyU0", /* USB stuff modems */ 22class ModemWidget;
23 "/dev/ttyU1", 23class ModemWidget2;
24 "/dev/ttyU2", 24
25 "/dev/ttyU3", 25class DevicesWidget : public ChooserWidget {
26 "/dev/dtyU0", /* USB stuff, too (dial out device) */ 26 Q_OBJECT
27 "/dev/dtyU1", 27public:
28 "/dev/dtyU2", 28 DevicesWidget( InterfacePPP* ip, QWidget *parent=0, const char *name=0, WFlags f=0 );
29 "/dev/dtyU3", 29 ~DevicesWidget() {}
30#elif defined (__linux__) 30
31 "/dev/modem", 31
32 "/dev/ttyS0", 32private slots:
33 "/dev/ttyS1", 33 virtual void edit();
34 "/dev/ttyS2", 34 virtual void copy();
35 "/dev/ttyS3", 35 virtual void remove();
36#ifdef ISDNSUPPORT 36 virtual void create();
37 "/dev/ttyI0", 37 virtual void slotListBoxSelect(int);
38 "/dev/ttyI1", 38 int doTab();
39 "/dev/ttyI2", 39
40 "/dev/ttyI3", 40// signals:
41#endif 41// void resetaccounts();
42 "/dev/usb/ttyACM0", /* USB stuff modems */ 42
43 "/dev/usb/ttyACM1", 43private:
44 "/dev/usb/ttyACM2", 44 ModemWidget *modem1;
45 "/dev/usb/ttyACM3", 45 ModemWidget2 *modem2;
46 "/dev/ircomm0", 46 InterfacePPP *_ifaceppp;
47 "/dev/rfcomm0", 47
48 "/dev/rfcomm1", 48};
49#elif defined(__svr4__)
50 "/dev/cua/a",
51 "/dev/cua/b",
52 "/dev/ttya",
53 "/dev/ttyb",
54#endif
55 0};
56 49
57// default device number from the list above
58const int DEV_DEFAULT = 0;
59 50
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp
index 0c96253..ceac90c 100644
--- a/noncore/settings/networksettings/ppp/edit.cpp
+++ b/noncore/settings/networksettings/ppp/edit.cpp
@@ -78,5 +78,5 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
78 up = new QPushButton(this); 78 up = new QPushButton(this);
79 up->setPixmap( Resource::loadPixmap("inline/up") ); 79 up->setPixmap( Resource::loadPixmap("up") );
80 down = new QPushButton(this); 80 down = new QPushButton(this);
81 down->setPixmap( Resource::loadPixmap("inline/down") ); 81 down->setPixmap( Resource::loadPixmap("down") );
82 lpn1->addWidget(add); 82 lpn1->addWidget(add);
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp
index f735e49..5540946 100644
--- a/noncore/settings/networksettings/ppp/general.cpp
+++ b/noncore/settings/networksettings/ppp/general.cpp
@@ -37,5 +37,6 @@
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38 38#include <qpe/config.h>
39// #include <qgroupbox.h> 39// #include <qgroupbox.h>
40 40
41
41#include "general.h" 42#include "general.h"
@@ -45,6 +46,5 @@
45#include "modemcmds.h" 46#include "modemcmds.h"
46#include "devices.h" 47//#include "devices.h"
47#include "pppdata.h" 48#include "pppdata.h"
48//#include <klocale.h> 49//#include <klocale.h>
49#define i18n QObject::tr
50 50
@@ -52,4 +52,5 @@
52 52
53ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name ) 53
54 : QWidget(parent, name), _ifaceppp(ifppp) 54ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
55 : QWidget(parent, name), _pppdata(pd)
55{ 56{
@@ -60,15 +61,33 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
60 QLabel *label1; 61 QLabel *label1;
61 label1 = new QLabel(i18n("Modem de&vice:"), this); 62
63 label1 = new QLabel(tr("Modem &name:"), this);
62 tl->addWidget(label1, 0, 0); 64 tl->addWidget(label1, 0, 0);
63 65
66 modemname = new QLineEdit(this, "modemName");
67 modemname->setText( _pppdata->devname() );
68 label1->setBuddy(modemname);
69 tl->addWidget(modemname, 0, 1);
70
71 label1 = new QLabel(tr("Modem de&vice:"), this);
72 tl->addWidget(label1, 1, 0);
73
64 modemdevice = new QComboBox(false, this); 74 modemdevice = new QComboBox(false, this);
75 modemdevice->setEditable( true );
76 modemdevice->setDuplicatesEnabled ( false );
77 modemdevice->setInsertionPolicy( QComboBox::AtTop );
65 label1->setBuddy(modemdevice); 78 label1->setBuddy(modemdevice);
66 79
67 for(k = 0; devices[k]; k++) 80 Config cfg("NetworkSetupPPP");
68 modemdevice->insertItem(devices[k]); 81 cfg.setGroup("Devices_General");
82 QStringList devs = cfg.readListEntry("devices",',');
83 if (devs.isEmpty()) devs << "/dev/modem" << "/dev/ircomm0" << "/dev/ttyS0";
84 modemdevice->insertStringList( devs );
85 tl->addWidget(modemdevice, 1, 1);
86
87// connect(modemdevice, SIGNAL(activated(int)),
88 // SLOT(setmodemdc(int)));
89// connect(modemdevice, SIGNAL(textChanged( const QString & ) ),
90// SLOT( setmodemdc( const QString &) ) );
69 91
70 tl->addWidget(modemdevice, 0, 1); 92 QString tmp = tr("This specifies the serial port your modem is attached \n"
71 connect(modemdevice, SIGNAL(activated(int)),
72 SLOT(setmodemdc(int)));
73 QString tmp = i18n("This specifies the serial port your modem is attached \n"
74 "to. On Linux/x86, typically this is either /dev/ttyS0 \n" 93 "to. On Linux/x86, typically this is either /dev/ttyS0 \n"
@@ -84,4 +103,4 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
84 103
85 label1 = new QLabel(i18n("&Flow control:"), this); 104 label1 = new QLabel(tr("&Flow control:"), this);
86 tl->addWidget(label1, 1, 0); 105 tl->addWidget(label1, 2, 0);
87 106
@@ -89,10 +108,10 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
89 label1->setBuddy(flowcontrol); 108 label1->setBuddy(flowcontrol);
90 flowcontrol->insertItem(i18n("Hardware [CRTSCTS]")); 109 flowcontrol->insertItem(tr("Hardware [CRTSCTS]"));
91 flowcontrol->insertItem(i18n("Software [XON/XOFF]")); 110 flowcontrol->insertItem(tr("Software [XON/XOFF]"));
92 flowcontrol->insertItem(i18n("None")); 111 flowcontrol->insertItem(tr("None"));
93 tl->addWidget(flowcontrol, 1, 1); 112 tl->addWidget(flowcontrol, 2, 1);
94 connect(flowcontrol, SIGNAL(activated(int)), 113// connect(flowcontrol, SIGNAL(activated(int)),
95 SLOT(setflowcontrol(int))); 114 // SLOT(setflowcontrol(int)));
96 115
97 tmp = i18n("<p>Specifies how the serial port and modem\n" 116 tmp = tr("<p>Specifies how the serial port and modem\n"
98 "communicate. You should not change this unless\n" 117 "communicate. You should not change this unless\n"
@@ -105,4 +124,4 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
105 124
106 QLabel *labelenter = new QLabel(i18n("&Line termination:"), this); 125 QLabel *labelenter = new QLabel(tr("&Line termination:"), this);
107 tl->addWidget(labelenter, 2, 0); 126 tl->addWidget(labelenter, 3, 0);
108 127
@@ -113,5 +132,5 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
113 enter->insertItem("CR/LF"); 132 enter->insertItem("CR/LF");
114 tl->addWidget(enter, 2, 1); 133 tl->addWidget(enter, 3, 1);
115 connect(enter, SIGNAL(activated(int)), SLOT(setenter(int))); 134// connect(enter, SIGNAL(activated(int)), SLOT(setenter(int)));
116 tmp = i18n("<p>Specifies how AT commands are sent to your\n" 135 tmp = tr("<p>Specifies how AT commands are sent to your\n"
117 "modem. Most modems will work fine with the\n" 136 "modem. Most modems will work fine with the\n"
@@ -126,4 +145,4 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
126 145
127 QLabel *baud_label = new QLabel(i18n("Co&nnection speed:"), this); 146 QLabel *baud_label = new QLabel(tr("Co&nnection speed:"), this);
128 tl->addWidget(baud_label, 3, 0); 147 tl->addWidget(baud_label, 4, 0);
129 baud_c = new QComboBox(this); 148 baud_c = new QComboBox(this);
@@ -159,7 +178,7 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
159 baud_c->setCurrentItem(3); 178 baud_c->setCurrentItem(3);
160 connect(baud_c, SIGNAL(activated(int)), 179// connect(baud_c, SIGNAL(activated(int)),
161 this, SLOT(speed_selection(int))); 180 // this, SLOT(speed_selection(int)));
162 tl->addWidget(baud_c, 3, 1); 181 tl->addWidget(baud_c, 4, 1);
163 182
164 tmp = i18n("Specifies the speed your modem and the serial\n" 183 tmp = tr("Specifies the speed your modem and the serial\n"
165 "port talk to each other. You should begin with\n" 184 "port talk to each other. You should begin with\n"
@@ -174,3 +193,3 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
174 for(int i=0; i <= enter->count()-1; i++) { 193 for(int i=0; i <= enter->count()-1; i++) {
175 if(_ifaceppp->data()->enter() == enter->text(i)) 194 if(_pppdata->enter() == enter->text(i))
176 enter->setCurrentItem(i); 195 enter->setCurrentItem(i);
@@ -178,14 +197,14 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
178 197
179 tl->addRowSpacing(4, 10); 198 tl->addRowSpacing(5, 10);
180 199
181 //Modem Lock File 200 //Modem Lock File
182 modemlockfile = new QCheckBox(i18n("&Use lock file"), this); 201 modemlockfile = new QCheckBox(tr("&Use lock file"), this);
183 202
184 modemlockfile->setChecked(_ifaceppp->data()->modemLockFile()); 203 modemlockfile->setChecked(_pppdata->modemLockFile());
185 connect(modemlockfile, SIGNAL(toggled(bool)), 204// connect(modemlockfile, SIGNAL(toggled(bool)),
186 SLOT(modemlockfilechanged(bool))); 205// SLOT(modemlockfilechanged(bool)));
187 tl->addMultiCellWidget(modemlockfile, 5, 5, 0, 1); 206 tl->addMultiCellWidget(modemlockfile, 6, 6, 0, 1);
188 // l12->addStretch(1); 207 // l12->addStretch(1);
189 QWhatsThis::add(modemlockfile, 208 QWhatsThis::add(modemlockfile,
190 i18n("<p>To prevent other programs from accessing the\n" 209 tr("<p>To prevent other programs from accessing the\n"
191 "modem while a connection is established, a\n" 210 "modem while a connection is established, a\n"
@@ -204,14 +223,14 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
204// modemtimeout = new KIntNumInput(_pppdata->modemTimeout(), this); 223// modemtimeout = new KIntNumInput(_pppdata->modemTimeout(), this);
205// modemtimeout->setLabel(i18n("Modem &timeout:")); 224// modemtimeout->setLabel(tr("Modem &timeout:"));
206// modemtimeout->setRange(1, 120, 1); 225// modemtimeout->setRange(1, 120, 1);
207 modemtimeout->setSuffix(i18n(" sec")); 226 modemtimeout->setSuffix(tr(" sec"));
208 modemtimeout->setValue( _ifaceppp->data()->modemTimeout() ); 227 modemtimeout->setValue( _pppdata->modemTimeout() );
209 connect(modemtimeout, SIGNAL(valueChanged(int)), 228// connect(modemtimeout, SIGNAL(valueChanged(int)),
210 SLOT(modemtimeoutchanged(int))); 229 // SLOT(modemtimeoutchanged(int)));
211 timeoutLayout->addWidget(timeoutlabel); 230 timeoutLayout->addWidget(timeoutlabel);
212 timeoutLayout->addWidget(modemtimeout); 231 timeoutLayout->addWidget(modemtimeout);
213 tl->addMultiCellLayout(timeoutLayout, 6, 6, 0, 1); 232 tl->addMultiCellLayout(timeoutLayout, 7, 7, 0, 1);
214 233
215 QWhatsThis::add(modemtimeout, 234 QWhatsThis::add(modemtimeout,
216 i18n("This specifies how long <i>kppp</i> waits for a\n" 235 tr("This specifies how long <i>kppp</i> waits for a\n"
217 "<i>CONNECT</i> response from your modem. The\n" 236 "<i>CONNECT</i> response from your modem. The\n"
@@ -221,3 +240,3 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
221 for(int i=0; i <= enter->count()-1; i++) { 240 for(int i=0; i <= enter->count()-1; i++) {
222 if(_ifaceppp->data()->enter() == enter->text(i)) 241 if(_pppdata->enter() == enter->text(i))
223 enter->setCurrentItem(i); 242 enter->setCurrentItem(i);
@@ -226,3 +245,3 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
226 for(int i=0; i <= modemdevice->count()-1; i++) { 245 for(int i=0; i <= modemdevice->count()-1; i++) {
227 if(_ifaceppp->data()->modemDevice() == modemdevice->text(i)) 246 if(_pppdata->modemDevice() == modemdevice->text(i))
228 modemdevice->setCurrentItem(i); 247 modemdevice->setCurrentItem(i);
@@ -231,3 +250,3 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
231 for(int i=0; i <= flowcontrol->count()-1; i++) { 250 for(int i=0; i <= flowcontrol->count()-1; i++) {
232 if(_ifaceppp->data()->flowcontrol() == flowcontrol->text(i)) 251 if(_pppdata->flowcontrol() == flowcontrol->text(i))
233 flowcontrol->setCurrentItem(i); 252 flowcontrol->setCurrentItem(i);
@@ -237,42 +256,92 @@ ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name
237 for(int i=0; i < baud_c->count(); i++) 256 for(int i=0; i < baud_c->count(); i++)
238 if(baud_c->text(i) == _ifaceppp->data()->speed()) 257 if(baud_c->text(i) == _pppdata->speed())
239 baud_c->setCurrentItem(i); 258 baud_c->setCurrentItem(i);
240 259
241 tl->setRowStretch(7, 1); 260 tl->setRowStretch(1, 1);
242} 261}
243 262
263ModemWidget::~ModemWidget()
264{
265 QStringList devs;
244 266
245void ModemWidget::speed_selection(int) { 267 for (int i=0;i<modemdevice->count();i++)
246 _ifaceppp->data()->setSpeed(baud_c->text(baud_c->currentItem())); 268 {
247} 269 QString s = modemdevice->text(i);
270 s.simplifyWhiteSpace();
271 if (! s.isEmpty() ) devs << s;
272 }
248 273
249 274
250void ModemWidget::setenter(int ) { 275 QString edited = modemdevice->currentText();
251 _ifaceppp->data()->setEnter(enter->text(enter->currentItem())); 276 if ( !( edited ).isEmpty() ) {
252} 277 edited.simplifyWhiteSpace();
278 if ( devs.contains( edited ) == 0 ) {
279 devs << edited;
280 }
281 _pppdata->setModemDevice( edited );
282 }
283
253 284
285 Config cfg("NetworkSetupPPP");
286 cfg.setGroup("Devices_General");
287 cfg.writeEntry("devices",devs,',');
254 288
255void ModemWidget::setmodemdc(int i) {
256 _ifaceppp->data()->setModemDevice(modemdevice->text(i));
257} 289}
258 290
291// void ModemWidget::speed_selection(int) {
292// _pppdata->setSpeed(baud_c->text(baud_c->currentItem()));
293// }
259 294
260void ModemWidget::setflowcontrol(int i) {
261 _ifaceppp->data()->setFlowcontrol(flowcontrol->text(i));
262}
263 295
296// void ModemWidget::setenter(int ) {
297// _pppdata->setEnter(enter->text(enter->currentItem()));
298// }
264 299
265void ModemWidget::modemlockfilechanged(bool set) {
266 _ifaceppp->data()->setModemLockFile(set);
267}
268 300
301// void ModemWidget::setmodemdc(int i) {
302// _pppdata->setModemDevice(modemdevice->text(i));
303// }
269 304
270void ModemWidget::modemtimeoutchanged(int n) { 305// void ModemWidget::setmodemdc( const QString &string ) {
271 _ifaceppp->data()->setModemTimeout(n); 306// _pppdata->setModemDevice( string );
272} 307// }
308
309// void ModemWidget::setflowcontrol(int i) {
310// _pppdata->setFlowcontrol(flowcontrol->text(i));
311// }
273 312
274 313
275ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent, 314// void ModemWidget::modemlockfilechanged(bool set) {
315// _pppdata->setModemLockFile(set);
316// }
317
318
319// void ModemWidget::modemtimeoutchanged(int n) {
320// _pppdata->setModemTimeout(n);
321// }
322
323
324
325bool ModemWidget::save()
326{
327 //first check to make sure that the device name is unique!
328 if(modemname->text().isEmpty() ||
329 !_pppdata->isUniqueDevname(modemname->text()))
330 return false;
331
332 qDebug("ModemWidget::save saving modem1 data");
333 _pppdata->setDevname( modemname->text() );
334 _pppdata->setModemDevice( modemdevice->currentText() );
335 _pppdata->setFlowcontrol(flowcontrol->currentText());
336 _pppdata->setFlowcontrol(flowcontrol->currentText());
337 _pppdata->setSpeed(baud_c->currentText());
338 _pppdata->setModemLockFile( modemlockfile->isChecked());
339 _pppdata->setModemTimeout( modemtimeout->value() );
340 return true;
341
342}
343
344ModemWidget2::ModemWidget2( PPPData *pd, InterfacePPP *ip, QWidget *parent,
276 const char *name) 345 const char *name)
277 : QWidget(parent, name), _ifaceppp(ifp) 346 : QWidget(parent, name), _pppdata(pd), _ifaceppp(ip)
278{ 347{
@@ -281,8 +350,8 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
281 350
282 waitfordt = new QCheckBox(i18n("&Wait for dial tone before dialing"), this); 351 waitfordt = new QCheckBox(tr("&Wait for dial tone before dialing"), this);
283 waitfordt->setChecked(_ifaceppp->data()->waitForDialTone()); 352 waitfordt->setChecked(_pppdata->waitForDialTone());
284 connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool))); 353// connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool)));
285 l1->addWidget(waitfordt); 354 l1->addWidget(waitfordt);
286 QWhatsThis::add(waitfordt, 355 QWhatsThis::add(waitfordt,
287 i18n("<p>Normally the modem waits for a dial tone\n" 356 tr("<p>Normally the modem waits for a dial tone\n"
288 "from your phone line, indicating that it can\n" 357 "from your phone line, indicating that it can\n"
@@ -298,6 +367,6 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
298// busywait = new KIntNumInput(_pppdata->busyWait(), this); 367// busywait = new KIntNumInput(_pppdata->busyWait(), this);
299// busywait->setLabel(i18n("B&usy wait:")); 368// busywait->setLabel(tr("B&usy wait:"));
300// busywait->setRange(0, 300, 5, true); 369// busywait->setRange(0, 300, 5, true);
301 busywait->setSuffix(i18n(" sec")); 370 busywait->setSuffix(tr(" sec"));
302 connect(busywait, SIGNAL(valueChanged(int)), SLOT(busywaitchanged(int))); 371// connect(busywait, SIGNAL(valueChanged(int)), SLOT(busywaitchanged(int)));
303 waitLayout->addWidget(waitLabel); 372 waitLayout->addWidget(waitLabel);
@@ -307,3 +376,3 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
307 QWhatsThis::add(busywait, 376 QWhatsThis::add(busywait,
308 i18n("Specifies the number of seconds to wait before\n" 377 tr("Specifies the number of seconds to wait before\n"
309 "redial if all dialed numbers are busy. This is\n" 378 "redial if all dialed numbers are busy. This is\n"
@@ -320,5 +389,5 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
320 389
321 QLabel *volumeLabel = new QLabel(i18n("Modem &volume:"), this); 390 QLabel *volumeLabel = new QLabel(tr("Modem &volume:"), this);
322 hbl->addWidget(volumeLabel); 391 hbl->addWidget(volumeLabel);
323 volume = new QSlider(0, 2, 1, _ifaceppp->data()->volume(), 392 volume = new QSlider(0, 2, 1, _pppdata->volume(),
324 QSlider::Horizontal, this); 393 QSlider::Horizontal, this);
@@ -330,5 +399,5 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
330 399
331 connect(volume, SIGNAL(valueChanged(int)), 400// connect(volume, SIGNAL(valueChanged(int)),
332 this, SLOT(volumeChanged(int))); 401 // this, SLOT(volumeChanged(int)));
333 QString tmp = i18n("Most modems have a speaker which makes\n" 402 QString tmp = tr("Most modems have a speaker which makes\n"
334 "a lot of noise when dialing. Here you can\n" 403 "a lot of noise when dialing. Here you can\n"
@@ -346,4 +415,4 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
346#if 0 415#if 0
347 chkbox1 = new QCheckBox(i18n("Modem asserts CD line"), this); 416 chkbox1 = new QCheckBox(tr("Modem asserts CD line"), this);
348 chkbox1->setChecked(_ifaceppp->data()->UseCDLine()); 417 chkbox1->setChecked(_pppdata->UseCDLine());
349 connect(chkbox1,SIGNAL(toggled(bool)), 418 connect(chkbox1,SIGNAL(toggled(bool)),
@@ -354,3 +423,3 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
354 QWhatsThis::add(chkbox1, 423 QWhatsThis::add(chkbox1,
355 i18n("This controls how <i>kppp</i> detects that the modem\n" 424 tr("This controls how <i>kppp</i> detects that the modem\n"
356 "is not responding. Unless you are having\n" 425 "is not responding. Unless you are having\n"
@@ -361,10 +430,10 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
361 430
362 modemcmds = new QPushButton(i18n("Mod&em Commands..."), this); 431 modemcmds = new QPushButton(tr("Mod&em Commands..."), this);
363 QWhatsThis::add(modemcmds, 432 QWhatsThis::add(modemcmds,
364 i18n("Allows you to change the AT command for\n" 433 tr("Allows you to change the AT command for\n"
365 "your modem.")); 434 "your modem."));
366 435
367 modeminfo_button = new QPushButton(i18n("&Query Modem..."), this); 436 modeminfo_button = new QPushButton(tr("&Query Modem..."), this);
368 QWhatsThis::add(modeminfo_button, 437 QWhatsThis::add(modeminfo_button,
369 i18n("Most modems support the ATI command set to\n" 438 tr("Most modems support the ATI command set to\n"
370 "find out vendor and revision of your modem.\n" 439 "find out vendor and revision of your modem.\n"
@@ -375,5 +444,5 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
375 444
376// terminal_button = new QPushButton(i18n("&Terminal..."), this); 445// terminal_button = new QPushButton(tr("&Terminal..."), this);
377// QWhatsThis::add(terminal_button, 446// QWhatsThis::add(terminal_button,
378 // i18n("Opens the built-in terminal program. You\n" 447 // tr("Opens the built-in terminal program. You\n"
379 // "can use this if you want to play around\n" 448 // "can use this if you want to play around\n"
@@ -404,3 +473,3 @@ ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
404void ModemWidget2::modemcmdsbutton() { 473void ModemWidget2::modemcmdsbutton() {
405 ModemCommands mc(_ifaceppp->data(), this); 474 ModemCommands mc(_ifaceppp->data(), this, "commands" , true, Qt::WStyle_ContextHelp);
406 mc.showMaximized(); 475 mc.showMaximized();
@@ -422,19 +491,27 @@ void ModemWidget2::query_modem() {
422 491
423#if 0 492// #if 0
424void ModemWidget2::use_cdline_toggled(bool on) { 493// void ModemWidget2::use_cdline_toggled(bool on) {
425 _ifaceppp->data()->setUseCDLine(on); 494// _pppdata->setUseCDLine(on);
426} 495// }
427#endif 496// #endif
428 497
429void ModemWidget2::waitfordtchanged(bool b) { 498// void ModemWidget2::waitfordtchanged(bool b) {
430 _ifaceppp->data()->setWaitForDialTone((int)b); 499// _pppdata->setWaitForDialTone((int)b);
431} 500// }
432 501
433void ModemWidget2::busywaitchanged(int n) { 502// void ModemWidget2::busywaitchanged(int n) {
434 _ifaceppp->data()->setbusyWait(n); 503// _pppdata->setbusyWait(n);
435} 504// }
436 505
437 506
438void ModemWidget2::volumeChanged(int v) { 507// void ModemWidget2::volumeChanged(int v) {
439 _ifaceppp->data()->setVolume(v); 508// _pppdata->setVolume(v);
509// }
510
511bool ModemWidget2::save()
512{
513 _pppdata->setWaitForDialTone(waitfordt->isChecked());
514 _pppdata->setbusyWait(busywait->value());
515 _pppdata->setVolume(volume->value());
516 return true;
440} 517}
diff --git a/noncore/settings/networksettings/ppp/general.h b/noncore/settings/networksettings/ppp/general.h
index 3e59b46..f43f241 100644
--- a/noncore/settings/networksettings/ppp/general.h
+++ b/noncore/settings/networksettings/ppp/general.h
@@ -38,2 +38,3 @@ class PPPData;
38class InterfacePPP; 38class InterfacePPP;
39class QLineEdit;
39 40
@@ -42,11 +43,15 @@ class ModemWidget : public QWidget {
42public: 43public:
43 ModemWidget( InterfacePPP*, QWidget *parent=0, const char *name=0 ); 44 ModemWidget(PPPData*, QWidget *parent=0, const char *name=0 );
45 ~ModemWidget();
44 46
45private slots: 47 bool save();
46 void setmodemdc(int); 48
47 void setflowcontrol(int); 49/* private slots: */
48 void modemtimeoutchanged(int); 50 /* void setmodemdc(int); */
49 void modemlockfilechanged(bool); 51/* void setmodemdc(const QString &); */
50 void setenter(int); 52 /* void setflowcontrol(int); */
51 void speed_selection(int); 53 /* void modemtimeoutchanged(int); */
54 /* void modemlockfilechanged(bool); */
55 /* void setenter(int); */
56/* void speed_selection(int); */
52 57
@@ -58,2 +63,3 @@ private:
58 /* QLabel *labelenter; */ 63 /* QLabel *labelenter; */
64 QLineEdit *modemname;
59 QComboBox *modemdevice; 65 QComboBox *modemdevice;
@@ -66,3 +72,3 @@ private:
66 QCheckBox *modemlockfile; 72 QCheckBox *modemlockfile;
67 InterfacePPP *_ifaceppp; 73 PPPData *_pppdata;
68}; 74};
@@ -73,7 +79,8 @@ class ModemWidget2 : public QWidget {
73public: 79public:
74 ModemWidget2( InterfacePPP*, QWidget *parent=0, const char *name=0 ); 80 ModemWidget2( PPPData*, InterfacePPP*, QWidget *parent=0, const char *name=0 );
81 bool save();
75 82
76private slots: 83private slots:
77 void waitfordtchanged(bool); 84/* void waitfordtchanged(bool); */
78 void busywaitchanged(int); 85 /* void busywaitchanged(int); */
79 // void use_cdline_toggled(bool); 86 // void use_cdline_toggled(bool);
@@ -82,3 +89,3 @@ private slots:
82 void query_modem(); 89 void query_modem();
83 void volumeChanged(int); 90 // void volumeChanged(int);
84 91
@@ -94,2 +101,3 @@ private:
94 QSlider *volume; 101 QSlider *volume;
102 PPPData *_pppdata;
95 InterfacePPP *_ifaceppp; 103 InterfacePPP *_ifaceppp;
diff --git a/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp b/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp
index 553daa2..6b158b9 100644
--- a/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp
+++ b/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp
@@ -2,6 +2,4 @@
2 2
3
4#include <qpushbutton.h> 3#include <qpushbutton.h>
5#include <qlabel.h> 4#include <qlabel.h>
6//#include <qgroupbox.h>
7#include <qmessagebox.h> 5#include <qmessagebox.h>
@@ -22,5 +20,5 @@
22InterfaceInformationPPP::InterfaceInformationPPP(QWidget *parent, const char *name, Interface *i, WFlags f) 20InterfaceInformationPPP::InterfaceInformationPPP(QWidget *parent, const char *name, Interface *i, WFlags f)
23 :InterfaceInformationImp(parent, name, i, f) 21 :InterfaceInformationImp(parent, name, i, Qt::WStyle_ContextHelp)
24{ 22{
25 qDebug("InterfaceInformationPPP::InterfaceInformationPPP"); 23 qDebug("InterfaceInformationPPP::InterfaceInformationPPP %s", name);
26 con = new ConnectWidget( (InterfacePPP*)i, this, "con" ); 24 con = new ConnectWidget( (InterfacePPP*)i, this, "con" );
@@ -28,7 +26,13 @@ InterfaceInformationPPP::InterfaceInformationPPP(QWidget *parent, const char *na
28 QSizePolicy::Fixed) ); 26 QSizePolicy::Fixed) );
29 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); 27
30 InterfaceInformationLayout->addItem( spacer, 7, 0 ); 28 macAddressLabel->hide();
31 InterfaceInformationLayout->addMultiCellWidget( con, 8, 8, 0, 1 ); 29 subnetMaskLabel->hide();
32 // InterfaceInformationLayout->addWidget( con, 7, 0 ); 30 broadcastLabel->hide();
31 TextLabel23->hide();
32 TextLabel21->hide();
33 TextLabel24->hide();
34
35 InterfaceInformationLayout->addWidget( con, 1, 0 );
33 connect(i, SIGNAL(begin_connect()),con, SLOT(preinit())); 36 connect(i, SIGNAL(begin_connect()),con, SLOT(preinit()));
37 connect(i, SIGNAL(hangup_now() ), con, SLOT(cancelbutton() ) );
34} 38}
diff --git a/noncore/settings/networksettings/ppp/interfaceppp.cpp b/noncore/settings/networksettings/ppp/interfaceppp.cpp
index 9ec30bc..f443f3c 100644
--- a/noncore/settings/networksettings/ppp/interfaceppp.cpp
+++ b/noncore/settings/networksettings/ppp/interfaceppp.cpp
@@ -2,3 +2,5 @@
2#include <qmessagebox.h> 2#include <qmessagebox.h>
3#define i18n QObject::tr 3#include <qlayout.h>
4#include <qlineedit.h>
5#include <qlabel.h>
4 6
@@ -17,3 +19,3 @@ InterfacePPP::InterfacePPP(QObject *parent, const char *name, bool status)
17 19
18PPPData* InterfacePPP::data() 20PPPData* InterfacePPP::data()const
19{ 21{
@@ -22,3 +24,3 @@ PPPData* InterfacePPP::data()
22 _dataPtr = new PPPData(); 24 _dataPtr = new PPPData();
23 _dataPtr->setModemDevice( getInterfaceName() ); 25 _dataPtr->setDevice( getInterfaceName() );
24 _dataPtr->setAccount( getHardwareName() ); 26 _dataPtr->setAccount( getHardwareName() );
@@ -28,3 +30,3 @@ PPPData* InterfacePPP::data()
28 30
29Modem* InterfacePPP::modem() 31Modem* InterfacePPP::modem()const
30{ 32{
@@ -40,5 +42,11 @@ bool InterfacePPP::refresh()
40 qDebug("InterfacePPP::refresh()"); 42 qDebug("InterfacePPP::refresh()");
41 updateInterface(this); 43 QString old = getInterfaceName();
42 QMessageBox::information(0,"Not Implemented","This feature is not yet implemneted... ;-("); 44 setInterfaceName( modem()->pppDevice() );
43 return false; 45
46 (void)Interface::refresh();
47
48 setInterfaceName( old );
49 emit updateInterface(this);
50
51 return true;
44} 52}
@@ -48,9 +56,18 @@ void InterfacePPP::start()
48 qDebug("InterfacePPP::start"); 56 qDebug("InterfacePPP::start");
49// should work...
50// if (data()->password().isEmpty() ){
51// //FIXME: ask for password
52// qDebug("using dummy password");
53// QMessageBox::critical( 0, "no password", "you should be prompted for a password, but you are not! ;-)");
54// }
55 57
58 if (data()->password().isEmpty() && !data()->storedUsername().isEmpty() ) {
59
60 QDialog mb( 0, "Dialog", true );
61 mb.setCaption( tr( "No password" ) );
62 QVBoxLayout layout( &mb );
63 QLabel text ( &mb );
64 text.setText( tr("Username defined but no password\n Please enter a password") );
65 QLineEdit lineedit( &mb );
66 lineedit.setEchoMode( QLineEdit::Password );
67 layout.addWidget( &text );
68 layout.addWidget( &lineedit );
69 if ( mb.exec() == QDialog::Accepted ) {
70 data()->setPassword( lineedit.text() );
71 }
72 }
56 73
@@ -60,3 +77,3 @@ void InterfacePPP::start()
60 QMessageBox::warning(0, tr("Error"), 77 QMessageBox::warning(0, tr("Error"),
61 i18n("<qt>Cannot find the PPP daemon!<br>" 78 QObject::tr("<qt>Cannot find the PPP daemon!<br>"
62 "Make sure that pppd is installed and " 79 "Make sure that pppd is installed and "
@@ -69,3 +86,3 @@ void InterfacePPP::start()
69 QString string; 86 QString string;
70 string = i18n( "<qt>Cannot execute:<br> %1<br>" 87 string = QObject::tr( "<qt>Cannot execute:<br> %1<br>"
71 "Please make sure that you have given " 88 "Please make sure that you have given "
@@ -83,3 +100,3 @@ void InterfacePPP::start()
83 QString string; 100 QString string;
84 string = i18n( "<qt>Cannot find:<br> %1<br>" 101 string = QObject::tr( "<qt>Cannot find:<br> %1<br>"
85 "Please make sure you have setup " 102 "Please make sure you have setup "
@@ -100,3 +117,3 @@ void InterfacePPP::start()
100 QMessageBox::warning(0,tr("Error"), 117 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>")); 118 QObject::tr("<qt>You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!</qt>"));
102// FIXME: return; 119// FIXME: return;
@@ -108,3 +125,3 @@ void InterfacePPP::start()
108 QString s; 125 QString s;
109 s = i18n("<qt>Cannot create PAP/CHAP authentication<br>" 126 s = QObject::tr("<qt>Cannot create PAP/CHAP authentication<br>"
110 "file \"%1\"</qt>").arg(PAP_AUTH_FILE); 127 "file \"%1\"</qt>").arg(PAP_AUTH_FILE);
@@ -117,3 +134,3 @@ void InterfacePPP::start()
117 if (data()->phonenumber().isEmpty()) { 134 if (data()->phonenumber().isEmpty()) {
118 QString s = i18n("You must specify a telephone number!"); 135 QString s = QObject::tr("You must specify a telephone number!");
119 QMessageBox::warning(0, tr("Error"), s); 136 QMessageBox::warning(0, tr("Error"), s);
@@ -134,2 +151,7 @@ void InterfacePPP::stop()
134 qDebug("InterfacePPP::stop"); 151 qDebug("InterfacePPP::stop");
152 // emit hangup_now();
153 status = false; // not connected
154 setStatus( false );
155 emit hangup_now();
156 refresh();
135 157
@@ -142 +164,11 @@ void InterfacePPP::save()
142} 164}
165QString InterfacePPP::pppDev()const {
166 return modem()->pppDevice();
167}
168pid_t InterfacePPP::pppPID()const{
169 return modem()->pppPID();
170}
171void InterfacePPP::setPPPDpid( pid_t pid) {
172 setStatus( true );
173 modem()->setPPPDPid( pid );
174}
diff --git a/noncore/settings/networksettings/ppp/interfaceppp.h b/noncore/settings/networksettings/ppp/interfaceppp.h
index 6eb6a69..39495c2 100644
--- a/noncore/settings/networksettings/ppp/interfaceppp.h
+++ b/noncore/settings/networksettings/ppp/interfaceppp.h
@@ -1,4 +1,6 @@
1#ifndef INTERFACEPPP_H 1#ifndef INTERFACEPPP_H
2#define INTERFACEPPP_H 2#define INTERFACEPPP_H
3 3
4#include <sys/types.h>
5
4#include "interface.h" 6#include "interface.h"
@@ -15,4 +17,6 @@ public:
15 17
16 PPPData* data(); 18 PPPData* data()const;
17 Modem* modem(); 19 Modem* modem()const;
20 QString pppDev()const; // returns the ppp device.... /dev/ppp0...
21 pid_t pppPID()const;
18 22
@@ -20,2 +24,3 @@ signals:
20 void begin_connect(); 24 void begin_connect();
25 void hangup_now();
21 26
@@ -26,6 +31,7 @@ public slots:
26 void save(); 31 void save();
32 void setPPPDpid( pid_t ); // sets the pppd pid for modem...
27 33
28 private: 34 private:
29 Modem *_modemPtr; 35 mutable Modem *_modemPtr;
30 PPPData *_dataPtr; 36 mutable PPPData *_dataPtr;
31}; 37};
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp
index 7b5c74d..e466358 100644
--- a/noncore/settings/networksettings/ppp/kpppwidget.cpp
+++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp
@@ -44,15 +44,4 @@
44#include <qbuttongroup.h> 44#include <qbuttongroup.h>
45//#include <kcmdlineargs.h>
46//#include <kconfig.h>
47//#include <kdebug.h>
48#define i18n QObject::tr
49//#include <kiconloader.h> // For BarIcon
50//#include <klocale.h>
51#include <qmessagebox.h> 45#include <qmessagebox.h>
52// #include <kseparator.h>
53// #include <kstandarddirs.h>
54// #include <kwin.h>
55// #include <khelpmenu.h>
56#include <qpushbutton.h> 46#include <qpushbutton.h>
57//#include <kguiitem.h>
58 47
@@ -80,3 +69,3 @@ KPPPWidget *p_kppp = 0;
80KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl ) 69KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl )
81 : QDialog(parent, name, modal, fl), _pppdata(pd) 70 : QDialog(parent, name, modal, Qt::WStyle_ContextHelp ), _pppdata(pd)
82{ 71{
@@ -110,3 +99,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
110 99
111 label1 = new QLabel(i18n("C&onnect to: "), this); 100 label1 = new QLabel(QObject::tr("C&onnect to: "), this);
112 l1->addWidget(label1, 0, 1); 101 l1->addWidget(label1, 0, 1);
@@ -120,3 +109,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
120 109
121 ID_Label = new QLabel(i18n("&Login ID:"), this); 110 ID_Label = new QLabel(QObject::tr("&Login ID:"), this);
122 l1->addWidget(ID_Label, 1, 1); 111 l1->addWidget(ID_Label, 1, 1);
@@ -129,3 +118,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
129 this, SLOT(enterPressedInID())); 118 this, SLOT(enterPressedInID()));
130 QString tmp = i18n("<p>Type in the username that you got from your\n" 119 QString tmp = QObject::tr("<p>Type in the username that you got from your\n"
131 "ISP. This is especially important for PAP\n" 120 "ISP. This is especially important for PAP\n"
@@ -140,3 +129,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
140 129
141 PW_Label = new QLabel(i18n("&Password:"), this); 130 PW_Label = new QLabel(QObject::tr("&Password:"), this);
142 l1->addWidget(PW_Label, 2, 1); 131 l1->addWidget(PW_Label, 2, 1);
@@ -150,3 +139,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
150 139
151 tmp = i18n("<p>Type in the password that you got from your\n" 140 tmp = QObject::tr("<p>Type in the password that you got from your\n"
152 "ISP. This is especially important for PAP\n" 141 "ISP. This is especially important for PAP\n"
@@ -166,3 +155,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
166 l3->addSpacing(10); 155 l3->addSpacing(10);
167 log = new QCheckBox(i18n("Show lo&g window"), this); 156 log = new QCheckBox(QObject::tr("Show lo&g window"), this);
168 connect(log, SIGNAL(toggled(bool)), 157 connect(log, SIGNAL(toggled(bool)),
@@ -173,3 +162,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
173 QWhatsThis::add(log, 162 QWhatsThis::add(log,
174 i18n("<p>This controls whether a log window is shown.\n" 163 QObject::tr("<p>This controls whether a log window is shown.\n"
175 "A log window shows the communication between\n" 164 "A log window shows the communication between\n"
@@ -188,4 +177,4 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
188 int minw = 0; 177 int minw = 0;
189 quit_b = new QPushButton(i18n("&Quit"), this); 178 quit_b = new QPushButton(QObject::tr("&Quit"), this);
190 // quit_b-> setGuiItem (KGuiItem(i18n("&Quit"), "exit" ) ); 179 // quit_b-> setGuiItem (KGuiItem(QObject::tr("&Quit"), "exit" ) );
191 connect( quit_b, SIGNAL(clicked()), SLOT(quitbutton())); 180 connect( quit_b, SIGNAL(clicked()), SLOT(quitbutton()));
@@ -194,4 +183,4 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
194 183
195 setup_b = new QPushButton(i18n("&Setup..."), this); 184 setup_b = new QPushButton(QObject::tr("&Setup..."), this);
196// setup_b->setGuiItem (KGuiItem(i18n("&Setup...")) ); 185// setup_b->setGuiItem (KGuiItem(QObject::tr("&Setup...")) );
197 connect( setup_b, SIGNAL(clicked()), SLOT(expandbutton())); 186 connect( setup_b, SIGNAL(clicked()), SLOT(expandbutton()));
@@ -205,3 +194,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
205 194
206// help_b = new QPushButton(i18n("&Help"), this); 195// help_b = new QPushButton(QObject::tr("&Help"), this);
207// connect( help_b, SIGNAL(clicked()), SLOT(helpbutton())); 196// connect( help_b, SIGNAL(clicked()), SLOT(helpbutton()));
@@ -210,3 +199,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
210// help_b->setPopup((QPopupMenu*)helpMenu->menu()); 199// help_b->setPopup((QPopupMenu*)helpMenu->menu());
211// help_b->setGuiItem (KGuiItem(i18n("&Help"), "help" ) ); 200// help_b->setGuiItem (KGuiItem(QObject::tr("&Help"), "help" ) );
212 201
@@ -215,3 +204,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
215 204
216 connect_b = new QPushButton(i18n("&Connect"), this); 205 connect_b = new QPushButton(QObject::tr("&Connect"), this);
217 connect_b->setDefault(true); 206 connect_b->setDefault(true);
@@ -288,3 +277,3 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
288// QString string; 277// QString string;
289// string = i18n("No such Account:\n%1").arg(m_strCmdlAccount); 278// string = QObject::tr("No such Account:\n%1").arg(m_strCmdlAccount);
290// KMessageBox::error(this, string); 279// KMessageBox::error(this, string);
@@ -484,10 +473,10 @@ void KPPPWidget::sigPPPDDied() {
484 if (_pppdata->pppdError() == E_IF_TIMEOUT) 473 if (_pppdata->pppdError() == E_IF_TIMEOUT)
485 msg = i18n("Timeout expired while waiting for the PPP interface " 474 msg = QObject::tr("Timeout expired while waiting for the PPP interface "
486 "to come up!"); 475 "to come up!");
487 else { 476 else {
488 msg = i18n("<p>The pppd daemon died unexpectedly!</p>"); 477 msg = QObject::tr("<p>The pppd daemon died unexpectedly!</p>");
489 Modem::modem->pppdExitStatus(); 478 Modem::modem->pppdExitStatus();
490 if (Modem::modem->lastStatus != 99) {// more recent pppds only 479 if (Modem::modem->lastStatus != 99) {// more recent pppds only
491 msg += i18n("<p>Exit status: %1").arg(Modem::modem->lastStatus); 480 msg += QObject::tr("<p>Exit status: %1").arg(Modem::modem->lastStatus);
492 msg += i18n("</p><p>See 'man pppd' for an explanation of the error " 481 msg += QObject::tr("</p><p>See 'man pppd' for an explanation of the error "
493 "codes or take a look at the kppp FAQ on " 482 "codes or take a look at the kppp FAQ on "
@@ -498,3 +487,3 @@ void KPPPWidget::sigPPPDDied() {
498 487
499 // if(QMessageBox::warning(0, msg, i18n("Error"), i18n("&OK"), i18n("&Details...")) == QMessageBox::No) 488 // if(QMessageBox::warning(0, msg, QObject::tr("Error"), QObject::tr("&OK"), QObject::tr("&Details...")) == QMessageBox::No)
500 // // PPPL_ShowLog(); 489 // // PPPL_ShowLog();
@@ -529,3 +518,3 @@ void KPPPWidget::sigPPPDDied() {
529// // helperPid = -1; 518// // helperPid = -1;
530// QString msg = i18n("kppp's helper process just died.\n" 519// QString msg = QObject::tr("kppp's helper process just died.\n"
531// "Since a further execution would be pointless, " 520// "Since a further execution would be pointless, "
@@ -562,3 +551,3 @@ void KPPPWidget::beginConnect() {
562 if(!info.exists()){ 551 if(!info.exists()){
563 QMessageBox::warning(this, "error", i18n("Cannot find the PPP daemon!\n" 552 QMessageBox::warning(this, "error", QObject::tr("Cannot find the PPP daemon!\n"
564 "Make sure that pppd is installed and " 553 "Make sure that pppd is installed and "
@@ -571,3 +560,3 @@ void KPPPWidget::beginConnect() {
571 QString string; 560 QString string;
572 string = i18n("kppp cannot execute:\n %1\n" 561 string = QObject::tr("kppp cannot execute:\n %1\n"
573 "Please make sure that you have given kppp " 562 "Please make sure that you have given kppp "
@@ -585,3 +574,3 @@ void KPPPWidget::beginConnect() {
585 QString string; 574 QString string;
586 string = i18n("kppp can not find:\n %1\nPlease make sure you have setup " 575 string = QObject::tr("kppp can not find:\n %1\nPlease make sure you have setup "
587 "your modem device properly " 576 "your modem device properly "
@@ -601,3 +590,3 @@ void KPPPWidget::beginConnect() {
601 QMessageBox::warning(this,"error", 590 QMessageBox::warning(this,"error",
602 i18n("You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!")); 591 QObject::tr("You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!"));
603 return; 592 return;
@@ -608,3 +597,3 @@ void KPPPWidget::beginConnect() {
608 QString s; 597 QString s;
609 s = i18n("Cannot create PAP/CHAP authentication\n" 598 s = QObject::tr("Cannot create PAP/CHAP authentication\n"
610 "file \"%1\"").arg(PAP_AUTH_FILE); 599 "file \"%1\"").arg(PAP_AUTH_FILE);
@@ -617,3 +606,3 @@ void KPPPWidget::beginConnect() {
617 if (_pppdata->phonenumber().isEmpty()) { 606 if (_pppdata->phonenumber().isEmpty()) {
618 QString s = i18n("You must specify a telephone number!"); 607 QString s = QObject::tr("You must specify a telephone number!");
619 QMessageBox::warning(this, "error", s); 608 QMessageBox::warning(this, "error", s);
@@ -624,3 +613,3 @@ void KPPPWidget::beginConnect() {
624 613
625 QString tit = i18n("Connecting to: %1").arg(_pppdata->accname()); 614 QString tit = QObject::tr("Connecting to: %1").arg(_pppdata->accname());
626// con->setCaption(tit); 615// con->setCaption(tit);
@@ -638,4 +627,4 @@ void KPPPWidget::disconnect() {
638 con->show(); 627 con->show();
639 con->setCaption(i18n("Disconnecting...")); 628 con->setCaption(QObject::tr("Disconnecting..."));
640 con->setMsg(i18n("Executing command before disconnection.")); 629 con->setMsg(QObject::tr("Executing command before disconnection."));
641 630
@@ -694,4 +683,4 @@ void KPPPWidget::quitbutton() {
694 int ok = QMessageBox::warning(this, 683 int ok = QMessageBox::warning(this,
695 i18n("Exiting kPPP will close your PPP Session."), 684 QObject::tr("Exiting kPPP will close your PPP Session."),
696 i18n("Quit kPPP?")); 685 QObject::tr("Quit kPPP?"));
697 if(ok == QMessageBox::Yes) { 686 if(ok == QMessageBox::Yes) {
@@ -738,3 +727,3 @@ void KPPPWidget::quitbutton() {
738// // if(!acct->loadRuleSet(_pppdata->accountingFile())) { 727// // if(!acct->loadRuleSet(_pppdata->accountingFile())) {
739// // QString s= i18n("Can not load the accounting " 728// // QString s= QObject::tr("Can not load the accounting "
740 // // "ruleset \"%1\"!").arg(_pppdata->accountingFile()); 729 // // "ruleset \"%1\"!").arg(_pppdata->accountingFile());
@@ -828,3 +817,3 @@ void KPPPWidget::showNews() {
828 QDialog dlg(0, 0, true); 817 QDialog dlg(0, 0, true);
829 dlg.setCaption(i18n("Recent Changes in KPPP")); 818 dlg.setCaption(QObject::tr("Recent Changes in KPPP"));
830 819
@@ -841,3 +830,3 @@ void KPPPWidget::showNews() {
841 830
842 QLabel *l = new QLabel(i18n("From version 1.4.8 on, kppp has a new feature\n" 831 QLabel *l = new QLabel(QObject::tr("From version 1.4.8 on, kppp has a new feature\n"
843 "called \"Quickhelp\". It's similar to a tooltip,\n" 832 "called \"Quickhelp\". It's similar to a tooltip,\n"
@@ -853,3 +842,3 @@ void KPPPWidget::showNews() {
853 842
854 QCheckBox *cb = new QCheckBox(i18n("Don't show this hint again"), &dlg); 843 QCheckBox *cb = new QCheckBox(QObject::tr("Don't show this hint again"), &dlg);
855 cb->setFixedSize(cb->sizeHint()); 844 cb->setFixedSize(cb->sizeHint());
@@ -858,3 +847,3 @@ void KPPPWidget::showNews() {
858 bbox->addStretch(1); 847 bbox->addStretch(1);
859 QPushButton *ok = bbox->addButton(i18n("OK")); 848 QPushButton *ok = bbox->addButton(QObject::tr("OK"));
860 ok->setDefault(true); 849 ok->setDefault(true);
@@ -869,3 +858,3 @@ void KPPPWidget::showNews() {
869 858
870 QString tmp = i18n("This is an example of <b>QuickHelp</b>.\n" 859 QString tmp = QObject::tr("This is an example of <b>QuickHelp</b>.\n"
871 "This window will stay open until you\n" 860 "This window will stay open until you\n"
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp
index d23fee4..3dbc8c3 100644
--- a/noncore/settings/networksettings/ppp/modem.cpp
+++ b/noncore/settings/networksettings/ppp/modem.cpp
@@ -53,7 +53,4 @@
53#include "pppdata.h" 53#include "pppdata.h"
54//#include <klocale.h>
55#define i18n QObject::tr
56#define qError qDebug 54#define qError qDebug
57//#include <kdebug.h> 55
58//#include <config.h>
59 56
@@ -101,3 +98,3 @@ Modem::Modem( PPPData* pd )
101 pppdPid = -1; 98 pppdPid = -1;
102 sn = 0L; 99 sn = m_modemDebug = 0L;
103 data_mode = false; 100 data_mode = false;
@@ -171,3 +168,3 @@ bool Modem::opentty() {
171 qDebug("error opening modem device !"); 168 qDebug("error opening modem device !");
172 errmsg = i18n("Unable to open modem."); 169 errmsg = QObject::tr("Unable to open modem.");
173 return false; 170 return false;
@@ -180,3 +177,3 @@ bool Modem::opentty() {
180 if(ioctl(modemfd, TIOCMGET, &flags) == -1) { 177 if(ioctl(modemfd, TIOCMGET, &flags) == -1) {
181 errmsg = i18n("Unable to detect state of CD line."); 178 errmsg = QObject::tr("Unable to detect state of CD line.");
182 ::close(modemfd); 179 ::close(modemfd);
@@ -186,3 +183,3 @@ bool Modem::opentty() {
186 if ((flags&TIOCM_CD) == 0) { 183 if ((flags&TIOCM_CD) == 0) {
187 errmsg = i18n("The modem is not ready."); 184 errmsg = QObject::tr("The modem is not ready.");
188 ::close(modemfd); 185 ::close(modemfd);
@@ -202,3 +199,3 @@ bool Modem::opentty() {
202 if(tcgetattr(modemfd, &tty) < 0){ 199 if(tcgetattr(modemfd, &tty) < 0){
203 errmsg = i18n("The modem is busy."); 200 errmsg = QObject::tr("The modem is busy.");
204 ::close(modemfd); 201 ::close(modemfd);
@@ -247,3 +244,3 @@ bool Modem::opentty() {
247 if(tcsetattr(modemfd, TCSANOW, &tty) < 0){ 244 if(tcsetattr(modemfd, TCSANOW, &tty) < 0){
248 errmsg = i18n("The modem is busy."); 245 errmsg = QObject::tr("The modem is busy.");
249 ::close(modemfd); 246 ::close(modemfd);
@@ -253,3 +250,3 @@ bool Modem::opentty() {
253 250
254 errmsg = i18n("Modem Ready."); 251 errmsg = QObject::tr("Modem Ready.");
255 return true; 252 return true;
@@ -265,3 +262,3 @@ bool Modem::closetty() {
265 if(tcsetattr(modemfd, TCSANOW, &initial_tty) < 0){ 262 if(tcsetattr(modemfd, TCSANOW, &initial_tty) < 0){
266 errmsg = i18n("Can't restore tty settings: tcsetattr()\n"); 263 errmsg = QObject::tr("Can't restore tty settings: tcsetattr()\n");
267 ::close(modemfd); 264 ::close(modemfd);
@@ -415,3 +412,3 @@ bool Modem::hangup() {
415 modemfd = -1; 412 modemfd = -1;
416 errmsg = i18n("The modem does not respond."); 413 errmsg = QObject::tr("The modem does not respond.");
417 return false; 414 return false;
@@ -557,3 +554,3 @@ QString Modem::parseModemSpeed(const QString &s) {
557 if(rx == -1 && tx == -1) 554 if(rx == -1 && tx == -1)
558 result = i18n("Unknown speed"); 555 result = QObject::tr("Unknown speed");
559 else if(tx == -1) 556 else if(tx == -1)
@@ -879,2 +876,4 @@ bool Modem::execpppd(const char *arguments) {
879 876
877 (void)::pipe( m_pppdLOG );
878
880 switch(pppdPid = fork()) 879 switch(pppdPid = fork())
@@ -883,2 +882,4 @@ bool Modem::execpppd(const char *arguments) {
883 fprintf(stderr,"In parent: fork() failed\n"); 882 fprintf(stderr,"In parent: fork() failed\n");
883 ::close( m_pppdLOG[0] );
884 ::close( m_pppdLOG[1] );
884 return false; 885 return false;
@@ -904,2 +905,5 @@ bool Modem::execpppd(const char *arguments) {
904 905
906 ::close( m_pppdLOG[0] );
907 ::setenv( "LANG", "C", 1 ); // overwrite
908 dup2(m_pppdLOG[1], 11 ); // for logfd 11
905 dup2(modemfd, 0); 909 dup2(modemfd, 0);
@@ -907,2 +911,3 @@ bool Modem::execpppd(const char *arguments) {
907 911
912
908 switch (checkForInterface()) { 913 switch (checkForInterface()) {
@@ -926,3 +931,20 @@ bool Modem::execpppd(const char *arguments) {
926 close(modemfd); 931 close(modemfd);
932
933 ::close( m_pppdLOG[1] );
934 // set it to nonblocking io
935 int flag = ::fcntl( m_pppdLOG[0], F_GETFL );
936
937 if ( !(flag & O_NONBLOCK) ) {
938 qDebug("Setting nonblocking io");
939 flag |= O_NONBLOCK;
940 ::fcntl(m_pppdLOG[0], F_SETFL, flag );
941 }
942
943 delete m_modemDebug;
944 m_modemDebug = new QSocketNotifier(m_pppdLOG[0], QSocketNotifier::Read, this );
945 connect(m_modemDebug, SIGNAL(activated(int) ),
946 this, SLOT(slotModemDebug(int) ) );
947
927 modemfd = -1; 948 modemfd = -1;
949 m_pppdDev = QString::fromLatin1("ppp0");
928 return true; 950 return true;
@@ -934,3 +956,6 @@ bool Modem::execpppd(const char *arguments) {
934bool Modem::killpppd() { 956bool Modem::killpppd() {
957 qDebug("In killpppd and pid is %d", pppdPid );
935 if(pppdPid > 0) { 958 if(pppdPid > 0) {
959 delete m_modemDebug;
960 m_modemDebug = 0;
936 qDebug("In killpppd(): Sending SIGTERM to %d\n", pppdPid); 961 qDebug("In killpppd(): Sending SIGTERM to %d\n", pppdPid);
@@ -1023 +1048,33 @@ bool Modem::setHostname(const QString & name)
1023 1048
1049QString Modem::pppDevice()const {
1050 return m_pppdDev;
1051}
1052void Modem::setPPPDevice( const QString& dev ) {
1053 m_pppdDev = dev;
1054}
1055pid_t Modem::pppPID()const {
1056 return pppdPid;
1057}
1058void Modem::setPPPDPid( pid_t pid ) {
1059 qDebug("Modem setting pid");
1060 _pppdExitStatus = -1;
1061 pppdPid = pid;
1062 modemfd = -1;
1063}
1064void Modem::slotModemDebug(int fd) {
1065 char buf[2049];
1066 int len;
1067
1068 // read in pppd data look for Using interface
1069 // then read the interface
1070 // we limit to 10 device now 0-9
1071 if((len = ::read(fd, buf, 2048)) > 0) {
1072 buf[len+1] = '\0';
1073 char *found;
1074 if ( (found = ::strstr(buf, "Using interface ") ) ) {
1075 found += 16;
1076 m_pppdDev = QString::fromLatin1(found, 5 );
1077 m_pppdDev = m_pppdDev.simplifyWhiteSpace();
1078 }
1079 }
1080}
diff --git a/noncore/settings/networksettings/ppp/modem.h b/noncore/settings/networksettings/ppp/modem.h
index 103cbeb..8ecc354 100644
--- a/noncore/settings/networksettings/ppp/modem.h
+++ b/noncore/settings/networksettings/ppp/modem.h
@@ -7,3 +7,3 @@
7 * wuebben@math.cornell.edu 7 * wuebben@math.cornell.edu
8 * 8 *
9 * This file was added by Harri Porten <porten@tu-harburg.de> 9 * This file was added by Harri Porten <porten@tu-harburg.de>
@@ -49,3 +49,5 @@ public:
49 const QString getDevice() {return device;}; 49 const QString getDevice() {return device;};
50 void setDevice(const QString dev) {device = dev;}; 50 void setDevice(const QString dev) {device = dev;};
51
52 void save();
51 53
@@ -58,3 +60,3 @@ public:
58 void setDataMode(bool set) { data_mode = set; } 60 void setDataMode(bool set) { data_mode = set; }
59 const QString modemMessage(); 61 const QString modemMessage();
60 speed_t modemspeed(); 62 speed_t modemspeed();
@@ -75,3 +77,8 @@ public:
75 bool setHostname(const QString & name); 77 bool setHostname(const QString & name);
76 78
79 QString pppDevice()const;
80 void setPPPDevice( const QString& );
81 pid_t pppPID()const;
82 void setPPPDPid( pid_t );
83
77public: 84public:
@@ -87,3 +94,4 @@ private slots:
87 void stopNotifier(); 94 void stopNotifier();
88 void readtty(int); 95 void readtty(int);
96 void slotModemDebug(int);
89 97
@@ -104,3 +112,3 @@ private:
104 QString device; 112 QString device;
105 QString lockfile; 113 QString lockfile;
106 int modemfd; 114 int modemfd;
@@ -109,2 +117,3 @@ private:
109 QSocketNotifier *sn; 117 QSocketNotifier *sn;
118 QSocketNotifier *m_modemDebug;
110 bool data_mode; 119 bool data_mode;
@@ -115,2 +124,4 @@ private:
115 PPPData *_pppdata; 124 PPPData *_pppdata;
125 int m_pppdLOG[2];
126 QString m_pppdDev;
116}; 127};
diff --git a/noncore/settings/networksettings/ppp/modemcmds.cpp b/noncore/settings/networksettings/ppp/modemcmds.cpp
index 1d9db6e..e797795 100644
--- a/noncore/settings/networksettings/ppp/modemcmds.cpp
+++ b/noncore/settings/networksettings/ppp/modemcmds.cpp
@@ -29,9 +29,7 @@
29#include <qbuttongroup.h> 29#include <qbuttongroup.h>
30#include <qscrollview.h>
31#include <qapplication.h>
30#include <stdlib.h> 32#include <stdlib.h>
31//#include <kapplication.h> // for getMiniIcon()
32//#include <klocale.h>
33#define i18n QObject::tr
34#include "modemcmds.h" 33#include "modemcmds.h"
35#include "pppdata.h" 34#include "pppdata.h"
36//#include <kwin.h>
37 35
@@ -42,6 +40,6 @@
42 40
43ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) 41ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name , bool modal, WFlags f)
44 : QDialog(parent, name, true ), _pppdata(pd) 42 : QDialog( parent, name, modal, f ), _pppdata(pd)
45{ 43{
46 setCaption(i18n("Edit Modem Commands")); 44 setCaption(QObject::tr("Edit Modem Commands"));
47 45
@@ -50,4 +48,15 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
50 48
49 QVBoxLayout *main = new QVBoxLayout( this );
50 QScrollView *sv = new QScrollView( this );
51 QWidget *mainW = new QWidget( sv->viewport() );
52 sv->setResizePolicy( QScrollView::AutoOneFit );
53 sv->setHScrollBarMode( QScrollView::AlwaysOff );
54 sv->setFrameShape( QFrame::NoFrame );
55 sv->addChild( mainW );
56 main->addWidget( sv );
57 // evil hack
58 mainW->setMaximumWidth( QApplication::desktop()->width() - 10 );
59
51 // toplevel layout 60 // toplevel layout
52 QVBoxLayout *tl = new QVBoxLayout(this, 10, 4); 61 QVBoxLayout *tl = new QVBoxLayout( mainW, 10, 4);
53 62
@@ -56,3 +65,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
56 tl->addLayout(l1); 65 tl->addLayout(l1);
57 box = new QGroupBox(this, "box"); 66 box = new QGroupBox(mainW, "box");
67 box->setMargin( 0 );
58 l1->addMultiCellWidget(box, row++, GRIDROWS, 0, 3); 68 l1->addMultiCellWidget(box, row++, GRIDROWS, 0, 3);
@@ -62,3 +72,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
62 l1->addLayout(l2, row, 2); 72 l1->addLayout(l2, row, 2);
63 lpreinitslider = new QLabel("MMMM", this); 73 lpreinitslider = new QLabel("MMMM", mainW);
64 FORMATSLIDERLABEL(lpreinitslider); 74 FORMATSLIDERLABEL(lpreinitslider);
@@ -66,3 +76,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
66 QSlider *preinitslider = new QSlider(0, 300, 1, 0, 76 QSlider *preinitslider = new QSlider(0, 300, 1, 0,
67 QSlider::Horizontal, this); 77 QSlider::Horizontal, mainW);
68// preinitslider->setFixedHeight(preinitslider->sizeHint().height()); 78// preinitslider->setFixedHeight(preinitslider->sizeHint().height());
@@ -73,3 +83,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
73 83
74 lpreinit = new QLabel(i18n("Pre-init delay (sec/100):"), this); 84 lpreinit = new QLabel(QObject::tr("Pre-init delay (sec/100):"), mainW);
75 l1->addWidget(lpreinit, row++, 1); 85 l1->addWidget(lpreinit, row++, 1);
@@ -77,5 +87,5 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
77 for(int i = 0; i < PPPData::NumInitStrings; i++) { 87 for(int i = 0; i < PPPData::NumInitStrings; i++) {
78 initstr[i] = new QLineEdit(this); 88 initstr[i] = new QLineEdit(mainW);
79 QLabel *initLabel = new QLabel(i18n("Initialization string %1:").arg(i + 1), 89 QLabel *initLabel = new QLabel(QObject::tr("Initialization string %1:").arg(i + 1),
80 this); 90 mainW);
81 ADJUSTEDIT(initstr[i]); 91 ADJUSTEDIT(initstr[i]);
@@ -87,6 +97,6 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
87 l1->addLayout(l3, row, 2); 97 l1->addLayout(l3, row, 2);
88 linitslider = new QLabel("MMMM", this); 98 linitslider = new QLabel("MMMM", mainW);
89 FORMATSLIDERLABEL(linitslider); 99 FORMATSLIDERLABEL(linitslider);
90 QSlider *initslider = new QSlider(1, 300, 1, 0, 100 QSlider *initslider = new QSlider(1, 300, 1, 0,
91 QSlider::Horizontal, this); 101 QSlider::Horizontal, mainW);
92// initslider->setFixedHeight(initslider->sizeHint().height()); 102// initslider->setFixedHeight(initslider->sizeHint().height());
@@ -97,3 +107,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
97 107
98 label3 = new QLabel(i18n("Post-init delay (sec/100):"), this); 108 label3 = new QLabel(QObject::tr("Post-init delay (sec/100):"), mainW);
99 l1->addWidget(label3, row++, 1); 109 l1->addWidget(label3, row++, 1);
@@ -103,6 +113,6 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
103 l1->addLayout(l4, row, 2); 113 l1->addLayout(l4, row, 2);
104 ldurationslider = new QLabel("MMMM", this); 114 ldurationslider = new QLabel("MMMM", mainW);
105 FORMATSLIDERLABEL(ldurationslider); 115 FORMATSLIDERLABEL(ldurationslider);
106 QSlider *durationslider = new QSlider(1, 255, 1, 0, 116 QSlider *durationslider = new QSlider(1, 255, 1, 0,
107 QSlider::Horizontal, this); 117 QSlider::Horizontal, mainW);
108// durationslider->setFixedHeight(durationslider->sizeHint().height()); 118// durationslider->setFixedHeight(durationslider->sizeHint().height());
@@ -113,3 +123,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
113 123
114 lduration = new QLabel(i18n("Dialing speed (sec/100):"), this); 124 lduration = new QLabel(QObject::tr("Dialing speed (sec/100):"), mainW);
115 l1->addWidget(lduration, row++, 1); 125 l1->addWidget(lduration, row++, 1);
@@ -117,4 +127,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
117 127
118 initresp = new QLineEdit(this); 128 initresp = new QLineEdit(mainW);
119 label2 = new QLabel(i18n("Init response:"), this); 129 label2 = new QLabel(QObject::tr("Init response:"), mainW);
120 ADJUSTEDIT(initresp); 130 ADJUSTEDIT(initresp);
@@ -123,4 +133,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
123 133
124 nodetectdialtone = new QLineEdit(this); 134 nodetectdialtone = new QLineEdit(mainW);
125 lnodetectdialtone = new QLabel(i18n("No dial tone detection:"), this); 135 lnodetectdialtone = new QLabel(QObject::tr("No dial tone detection:"), mainW);
126 ADJUSTEDIT(nodetectdialtone); 136 ADJUSTEDIT(nodetectdialtone);
@@ -129,4 +139,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
129 139
130 dialstr = new QLineEdit(this); 140 dialstr = new QLineEdit(mainW);
131 label4 = new QLabel(i18n("Dial string:"),this); 141 label4 = new QLabel(QObject::tr("Dial string:"),mainW);
132 ADJUSTEDIT(dialstr); 142 ADJUSTEDIT(dialstr);
@@ -135,4 +145,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
135 145
136 connectresp = new QLineEdit(this); 146 connectresp = new QLineEdit(mainW);
137 label5 = new QLabel(i18n("Connect response:"), this); 147 label5 = new QLabel(QObject::tr("Connect response:"), mainW);
138 ADJUSTEDIT(connectresp); 148 ADJUSTEDIT(connectresp);
@@ -141,4 +151,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
141 151
142 busyresp = new QLineEdit(this); 152 busyresp = new QLineEdit(mainW);
143 label6 = new QLabel(i18n("Busy response:"), this); 153 label6 = new QLabel(QObject::tr("Busy response:"), mainW);
144 ADJUSTEDIT(busyresp); 154 ADJUSTEDIT(busyresp);
@@ -147,4 +157,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
147 157
148 nocarrierresp = new QLineEdit(this); 158 nocarrierresp = new QLineEdit(mainW);
149 label7 = new QLabel(i18n("No carrier response:"), this); 159 label7 = new QLabel(QObject::tr("No carrier response:"), mainW);
150 ADJUSTEDIT(nocarrierresp); 160 ADJUSTEDIT(nocarrierresp);
@@ -153,4 +163,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
153 163
154 nodialtoneresp = new QLineEdit(this); 164 nodialtoneresp = new QLineEdit(mainW);
155 label8 = new QLabel(i18n("No dial tone response:"), this); 165 label8 = new QLabel(QObject::tr("No dial tone response:"), mainW);
156 ADJUSTEDIT(nodialtoneresp); 166 ADJUSTEDIT(nodialtoneresp);
@@ -159,4 +169,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
159 169
160 hangupstr = new QLineEdit(this); 170 hangupstr = new QLineEdit(mainW);
161 label9 = new QLabel(i18n("Hangup string:"), this); 171 label9 = new QLabel(QObject::tr("Hangup string:"), mainW);
162 ADJUSTEDIT(hangupstr); 172 ADJUSTEDIT(hangupstr);
@@ -165,4 +175,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
165 175
166 hangupresp = new QLineEdit(this); 176 hangupresp = new QLineEdit(mainW);
167 label10 = new QLabel(i18n("Hangup response:"), this); 177 label10 = new QLabel(QObject::tr("Hangup response:"), mainW);
168 ADJUSTEDIT(hangupresp); 178 ADJUSTEDIT(hangupresp);
@@ -171,4 +181,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
171 181
172 answerstr = new QLineEdit(this); 182 answerstr = new QLineEdit(mainW);
173 label11 = new QLabel(i18n("Answer string:"), this); 183 label11 = new QLabel(QObject::tr("Answer string:"), mainW);
174 ADJUSTEDIT(answerstr); 184 ADJUSTEDIT(answerstr);
@@ -177,4 +187,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
177 187
178 ringresp = new QLineEdit(this); 188 ringresp = new QLineEdit(mainW);
179 label12 = new QLabel(i18n("Ring response:"), this); 189 label12 = new QLabel(QObject::tr("Ring response:"), mainW);
180 ADJUSTEDIT(ringresp); 190 ADJUSTEDIT(ringresp);
@@ -183,4 +193,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
183 193
184 answerresp = new QLineEdit(this); 194 answerresp = new QLineEdit(mainW);
185 label13 = new QLabel(i18n("Answer response:"), this); 195 label13 = new QLabel(QObject::tr("Answer response:"), mainW);
186 ADJUSTEDIT(answerresp); 196 ADJUSTEDIT(answerresp);
@@ -189,4 +199,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
189 199
190 escapestr = new QLineEdit(this); 200 escapestr = new QLineEdit(mainW);
191 label14 = new QLabel(i18n("Escape string:"), this); 201 label14 = new QLabel(QObject::tr("Escape string:"), mainW);
192 ADJUSTEDIT(escapestr); 202 ADJUSTEDIT(escapestr);
@@ -195,4 +205,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
195 205
196 escaperesp = new QLineEdit(this); 206 escaperesp = new QLineEdit(mainW);
197 label15 = new QLabel(i18n("Escape response:"), this); 207 label15 = new QLabel(QObject::tr("Escape response:"), mainW);
198 ADJUSTEDIT(escaperesp); 208 ADJUSTEDIT(escaperesp);
@@ -203,3 +213,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
203 l1->addLayout(l5, row, 2); 213 l1->addLayout(l5, row, 2);
204 lslider = new QLabel("MMMM", this); 214 lslider = new QLabel("MMMM", mainW);
205 FORMATSLIDERLABEL(lslider); 215 FORMATSLIDERLABEL(lslider);
@@ -207,3 +217,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
207 QSlider *slider = new QSlider(0, 255, 1, 0, 217 QSlider *slider = new QSlider(0, 255, 1, 0,
208 QSlider::Horizontal, this); 218 QSlider::Horizontal, mainW);
209// slider->setFixedHeight(slider->sizeHint().height()); 219// slider->setFixedHeight(slider->sizeHint().height());
@@ -214,6 +224,6 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
214 224
215 label16 = new QLabel(i18n("Guard time (sec/50):"), this); 225 label16 = new QLabel(QObject::tr("Guard time (sec/50):"), mainW);
216 l1->addWidget(label16, row++, 1); 226 l1->addWidget(label16, row++, 1);
217 227
218 QLabel *l = new QLabel(i18n("Volume off/low/high:"), this); 228 QLabel *l = new QLabel(QObject::tr("Volume off/low/high:"), mainW);
219 l1->addWidget(l, row, 1); 229 l1->addWidget(l, row, 1);
@@ -221,9 +231,9 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name)
221 l1->addLayout(l6, row++, 2); 231 l1->addLayout(l6, row++, 2);
222 volume_off = new QLineEdit(this); 232 volume_off = new QLineEdit(mainW);
223// volume_off->setFixedHeight(volume_off->sizeHint().height()); 233// volume_off->setFixedHeight(volume_off->sizeHint().height());
224 // volume_off->setMinimumWidth((int)(volume_off->sizeHint().width() / 2)); 234 // volume_off->setMinimumWidth((int)(volume_off->sizeHint().width() / 2));
225 volume_medium = new QLineEdit(this); 235 volume_medium = new QLineEdit(mainW);
226// volume_medium->setFixedHeight(volume_medium->sizeHint().height()); 236// volume_medium->setFixedHeight(volume_medium->sizeHint().height());
227 // volume_medium->setMinimumWidth((int)(volume_medium->sizeHint().width() / 2)); 237 // volume_medium->setMinimumWidth((int)(volume_medium->sizeHint().width() / 2));
228 volume_high = new QLineEdit(this); 238 volume_high = new QLineEdit(mainW);
229 // volume_high->setFixedHeight(volume_high->sizeHint().height()); 239 // volume_high->setFixedHeight(volume_high->sizeHint().height());
@@ -309,3 +319,8 @@ void ModemCommands::slotOk() {
309 _pppdata->save(); 319 _pppdata->save();
310 accept(); 320 QDialog::accept();
321}
322
323void ModemCommands::accept()
324{
325 slotOk();
311} 326}
diff --git a/noncore/settings/networksettings/ppp/modemcmds.h b/noncore/settings/networksettings/ppp/modemcmds.h
index ef69fec..81d67f4 100644
--- a/noncore/settings/networksettings/ppp/modemcmds.h
+++ b/noncore/settings/networksettings/ppp/modemcmds.h
@@ -46,3 +46,3 @@ public:
46 46
47 ModemCommands(PPPData*, QWidget *parent=0, const char *name=0); 47 ModemCommands(PPPData*, QWidget *parent=0, const char *name=0, bool modal=0, WFlags f = 0);
48 ~ModemCommands() {} 48 ~ModemCommands() {}
@@ -50,2 +50,3 @@ public:
50private slots: 50private slots:
51 virtual void accept();
51 void slotCancel(); 52 void slotCancel();
diff --git a/noncore/settings/networksettings/ppp/modeminfo.cpp b/noncore/settings/networksettings/ppp/modeminfo.cpp
index 0bec186..dbb26db 100644
--- a/noncore/settings/networksettings/ppp/modeminfo.cpp
+++ b/noncore/settings/networksettings/ppp/modeminfo.cpp
@@ -36,4 +36,2 @@
36#include "modem.h" 36#include "modem.h"
37//#include <klocale.h>
38#define i18n QObject::tr
39 37
@@ -43,3 +41,3 @@ ModemTransfer::ModemTransfer(Modem *mo, QWidget *parent, const char *name)
43{ 41{
44 setCaption(i18n("ATI Query")); 42 setCaption(QObject::tr("ATI Query"));
45// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); 43// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
@@ -60,3 +58,3 @@ ModemTransfer::ModemTransfer(Modem *mo, QWidget *parent, const char *name)
60 // 20 percent space. Hope this is enough. 58 // 20 percent space. Hope this is enough.
61 statusBar->setText(i18n("Unable to create modem lock file.")); 59 statusBar->setText(QObject::tr("Unable to create modem lock file."));
62 statusBar->setFixedWidth((statusBar->sizeHint().width() * 12) / 10); 60 statusBar->setFixedWidth((statusBar->sizeHint().width() * 12) / 10);
@@ -65,3 +63,3 @@ ModemTransfer::ModemTransfer(Modem *mo, QWidget *parent, const char *name)
65 // set original text 63 // set original text
66 statusBar->setText(i18n("Looking for modem...")); 64 statusBar->setText(QObject::tr("Looking for modem..."));
67 progressBar->setFixedHeight(statusBar->minimumSize().height()); 65 progressBar->setFixedHeight(statusBar->minimumSize().height());
@@ -70,3 +68,3 @@ ModemTransfer::ModemTransfer(Modem *mo, QWidget *parent, const char *name)
70 68
71 cancel = new QPushButton(i18n("Cancel"), this); 69 cancel = new QPushButton(QObject::tr("Cancel"), this);
72 cancel->setFocus(); 70 cancel->setFocus();
@@ -120,3 +118,3 @@ void ModemTransfer::time_out_slot() {
120 118
121 QMessageBox::warning(this, tr("Error"), i18n("Modem Query timed out.")); 119 QMessageBox::warning(this, tr("Error"), QObject::tr("Modem Query timed out."));
122 reject(); 120 reject();
@@ -132,3 +130,3 @@ void ModemTransfer::init() {
132 130
133 statusBar->setText(i18n("Modem device is locked.")); 131 statusBar->setText(QObject::tr("Modem device is locked."));
134 return; 132 return;
@@ -138,3 +136,3 @@ void ModemTransfer::init() {
138 136
139 statusBar->setText(i18n("Unable to create modem lock file.")); 137 statusBar->setText(QObject::tr("Unable to create modem lock file."));
140 return; 138 return;
@@ -148,3 +146,3 @@ void ModemTransfer::init() {
148 146
149 statusBar->setText(i18n("Modem Ready")); 147 statusBar->setText(QObject::tr("Modem Ready"));
150 qApp->processEvents(); 148 qApp->processEvents();
@@ -229,3 +227,3 @@ void ModemTransfer::cancelbutton() {
229 227
230 statusBar->setText(i18n("One moment please...")); 228 statusBar->setText(QObject::tr("One moment please..."));
231 qApp->processEvents(); 229 qApp->processEvents();
@@ -251,3 +249,3 @@ ModemInfo::ModemInfo(QWidget *parent, const char* name)
251 249
252 setCaption(i18n("Modem Query Results")); 250 setCaption(QObject::tr("Modem Query Results"));
253 // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); 251 // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
@@ -276,3 +274,3 @@ ModemInfo::ModemInfo(QWidget *parent, const char* name)
276 QHBoxLayout *l2 = new QHBoxLayout; 274 QHBoxLayout *l2 = new QHBoxLayout;
277 QPushButton *ok = new QPushButton(i18n("Close"), this); 275 QPushButton *ok = new QPushButton(QObject::tr("Close"), this);
278 ok->setDefault(TRUE); 276 ok->setDefault(TRUE);
diff --git a/noncore/settings/networksettings/ppp/ppp.pro b/noncore/settings/networksettings/ppp/ppp.pro
index fc89f35..84acd0e 100644
--- a/noncore/settings/networksettings/ppp/ppp.pro
+++ b/noncore/settings/networksettings/ppp/ppp.pro
@@ -6,4 +6,4 @@ CONFIG += qt warn_on debug
6DESTDIR = $(OPIEDIR)/plugins/networksettings 6DESTDIR = $(OPIEDIR)/plugins/networksettings
7 HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h conwindow.h accounts.h connect.h edit.h scriptedit.h pppdargs.h iplined.h pwentry.h pppconfig.h interfaceinformationppp.h interfaceppp.h authwidget.h 7 HEADERS = pppmodule.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h conwindow.h accounts.h connect.h edit.h scriptedit.h pppdargs.h iplined.h pwentry.h pppconfig.h interfaceinformationppp.h interfaceppp.h authwidget.h chooserwidget.h devices.h
8 SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp conwindow.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp iplined.cpp pwentry.cpp pppconfig.cpp interfaceinformationppp.cpp interfaceppp.cpp authwidget.cpp 8 SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp conwindow.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp iplined.cpp pwentry.cpp pppconfig.cpp interfaceinformationppp.cpp interfaceppp.cpp authwidget.cpp chooserwidget.cpp devices.cpp
9 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ 9 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/
@@ -11,3 +11,2 @@ DEPENDPATH += $(OPIEDIR)/include
11LIBS += -lqpe -L../interfaces/ -linterfaces 11LIBS += -lqpe -L../interfaces/ -linterfaces
12 INTERFACES=
13 TARGET = kppp 12 TARGET = kppp
diff --git a/noncore/settings/networksettings/ppp/pppconfig.cpp b/noncore/settings/networksettings/ppp/pppconfig.cpp
index 5fa7d3f..97baf31 100644
--- a/noncore/settings/networksettings/ppp/pppconfig.cpp
+++ b/noncore/settings/networksettings/ppp/pppconfig.cpp
@@ -6,2 +6,3 @@
6#include "accounts.h" 6#include "accounts.h"
7#include "devices.h"
7#include "general.h" 8#include "general.h"
@@ -30,3 +31,3 @@ PPPConfigWidget::PPPConfigWidget( InterfacePPP* iface, QWidget *parent,
30 qDebug(" _pppdata->accname >%s<",interface->data()->accname().latin1()); 31 qDebug(" _pppdata->accname >%s<",interface->data()->accname().latin1());
31 qDebug(" _pppdata->currentAccountID() >%i<",interface->data()->currentAccountID()); 32
32 33
@@ -38,8 +39,12 @@ PPPConfigWidget::PPPConfigWidget( InterfacePPP* iface, QWidget *parent,
38 39
39 accounts = new AccountWidget( interface->data(), tabWindow, "accounts" ); 40 accounts = new AccountWidget( interface->data(), tabWindow, "accounts", Qt::WStyle_ContextHelp );
40 tabWindow->addTab( accounts, tr("&Accounts") ); 41 tabWindow->addTab( accounts, tr("&Accounts") );
41 modem1 = new ModemWidget( interface, tabWindow, "modem1" ); 42 devices = new DevicesWidget( interface, tabWindow, "devices", Qt::WStyle_ContextHelp );
42 tabWindow->addTab( modem1, tr("&Device") ); 43 tabWindow->addTab( devices, tr("&Devices") );
43 modem2 = new ModemWidget2( interface, tabWindow, "modem2" ); 44
44 tabWindow->addTab( modem2, tr("&Modem") ); 45//OLD:
46// modem1 = new ModemWidget( interface, tabWindow, "modem1" );
47// tabWindow->addTab( modem1, tr("&Device") );
48// modem2 = new ModemWidget2( interface, tabWindow, "modem2" );
49// tabWindow->addTab( modem2, tr("&Modem") );
45 50
@@ -58,3 +63,3 @@ void PPPConfigWidget::accept()
58 qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1()); 63 qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1());
59 interface->setInterfaceName( interface->data()->modemDevice() ); 64 interface->setInterfaceName( interface->data()->devname() );
60 interface->setHardwareName( interface->data()->accname() ); 65 interface->setHardwareName( interface->data()->accname() );
diff --git a/noncore/settings/networksettings/ppp/pppconfig.h b/noncore/settings/networksettings/ppp/pppconfig.h
index 9bab6fe..4d7912f 100644
--- a/noncore/settings/networksettings/ppp/pppconfig.h
+++ b/noncore/settings/networksettings/ppp/pppconfig.h
@@ -10,2 +10,5 @@ class AccountWidget;
10class GeneralWidget; 10class GeneralWidget;
11class DevicesWidget;
12
13//OLD:
11class ModemWidget; 14class ModemWidget;
@@ -31,2 +34,5 @@ protected slots:
31 GeneralWidget *general; 34 GeneralWidget *general;
35 DevicesWidget* devices;
36
37 //OLD:
32 ModemWidget *modem1; 38 ModemWidget *modem1;
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp
index 8f45e54..f4727c1 100644
--- a/noncore/settings/networksettings/ppp/pppdata.cpp
+++ b/noncore/settings/networksettings/ppp/pppdata.cpp
@@ -28,5 +28,4 @@
28#include "runtests.h" 28#include "runtests.h"
29#include "devices.h" 29//#include "devices.h"
30//#include <klocale.h> 30//#include <klocale.h>
31#define i18n QObject::tr
32#include <qpe/config.h> 31#include <qpe/config.h>
@@ -44,6 +43,7 @@
44PPPData::PPPData() 43PPPData::PPPData()
45 : modemDeviceGroup(-1), 44 : passwd(""),
46 passwd(""), 45 _modemName(""),
47 highcount(-1), // start out with no entries 46 highcount(-1), // start out with no entries
48 caccount(-1), // set the current account index also 47 highcountdev(-1), // start out with no entries
48// caccount(-1), // set the current account index also
49 suidprocessid(-1), // process ID of setuid child 49 suidprocessid(-1), // process ID of setuid child
@@ -52,12 +52,19 @@ PPPData::PPPData()
52{ 52{
53 highcount = readNumConfig(GENERAL_GRP, NUMACCOUNTS_KEY, 0) - 1; 53 highcount = readNumConfig(GENERAL_GRP, NUMACCOUNTS_KEY, 0) - 1;
54 highcountdev = readNumConfig(GENERAL_GRP, NUMDEVICES_KEY, 0) - 1;
55 Config cfg = config();
56 cfg.setGroup(GENERAL_GRP);
57 accountList = cfg.readListEntry(ACCOUNT_LIST, ',' );
58 deviceList = cfg.readListEntry(DEVICESNAMES_LIST, ',' );
59 qDebug("PPPData::PPPData has a accountList %s", accountList.join("---").latin1());
60 qDebug("PPPData::PPPData has a deviceList %s", deviceList.join("---").latin1());
54 61
55 if (highcount > MAX_ACCOUNTS) 62// if (highcount > MAX_ACCOUNTS)
56 highcount = MAX_ACCOUNTS; 63// highcount = MAX_ACCOUNTS;
57 64
58 if(highcount >= 0 && defaultAccount().isEmpty()) { 65 // if(highcount >= 0 && defaultAccount().isEmpty()) {
59 setAccountbyIndex(0); 66// setAccountbyIndex(0);
60 setDefaultAccount(accname()); 67// setDefaultAccount(accname());
61 } else if(!setAccount(defaultAccount())) 68// } else if(!setAccount(defaultAccount()))
62 setDefaultAccount(accname()); 69 setDefaultAccount(accname());
63 70
@@ -83,2 +90,3 @@ void PPPData::save()
83 writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count()); 90 writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count());
91 writeConfig(GENERAL_GRP, NUMDEVICES_KEY, highcountdev + 1);
84 QString key; 92 QString key;
@@ -86,2 +94,6 @@ void PPPData::save()
86 Config cfg = config(); 94 Config cfg = config();
95 cfg.setGroup(GENERAL_GRP);
96 cfg.writeEntry(ACCOUNT_LIST, accountList, ',' );
97 cfg.writeEntry(DEVICESNAMES_LIST, deviceList, ',' );
98
87 for( QMap<QString,QString>::Iterator it = stringEntries.begin(); 99 for( QMap<QString,QString>::Iterator it = stringEntries.begin();
@@ -92,6 +104,6 @@ void PPPData::save()
92 keys = QStringList::split( "SEPARATOR", key ); 104 keys = QStringList::split( "SEPARATOR", key );
93 qDebug("group >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() ); 105 //qDebug("group >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() );
94 cfg.setGroup(keys[0]); 106 cfg.setGroup(keys[0]);
95 cfg.writeEntry(keys[1], val); 107 cfg.writeEntry(keys[1], val);
96 } 108 }
97 for( QMap<QString,int>::Iterator it = intEntries.begin(); 109 for( QMap<QString,int>::Iterator it = intEntries.begin();
@@ -102,6 +114,6 @@ void PPPData::save()
102 keys = QStringList::split( "SEPARATOR", key ); 114 keys = QStringList::split( "SEPARATOR", key );
103 qDebug("group >%s< key >%s< val %i", keys[0].latin1(), keys[1].latin1(), val ); 115 //qDebug("group >%s< key >%s< val %i", keys[0].latin1(), keys[1].latin1(), val );
104 cfg.setGroup(keys[0]); 116 cfg.setGroup(keys[0]);
105 cfg.writeEntry(keys[1], val); 117 cfg.writeEntry(keys[1], val);
106 } 118 }
107 for( QMap<QString,QStringList>::Iterator it = listEntries.begin(); 119 for( QMap<QString,QStringList>::Iterator it = listEntries.begin();
@@ -113,6 +125,5 @@ void PPPData::save()
113 keys = QStringList::split( "SEPARATOR", key ); 125 keys = QStringList::split( "SEPARATOR", key );
114 qDebug("group >%s< key >%s<values >%s<", keys[0].latin1(), keys[1].latin1(), val.join(sep).latin1() );
115 cfg.setGroup(keys[0]); 126 cfg.setGroup(keys[0]);
116 cfg.writeEntry(keys[1], val, sep); 127 cfg.writeEntry(keys[1], val, sep);
117 } 128 }
118} 129}
@@ -346,3 +357,3 @@ void PPPData::setpppdTimeout(int n) {
346const QString PPPData::modemDevice() { 357const QString PPPData::modemDevice() {
347 return readConfig (modemGroup(), MODEMDEV_KEY, devices[DEV_DEFAULT]); 358 return readConfig (modemGroup(), MODEMDEV_KEY, "/dev/modem" );
348} 359}
@@ -350,13 +361,25 @@ const QString PPPData::modemDevice() {
350 361
362// const QString PPPData::modemName()
363// {
364// return readConfig(modemGroup(), MODEMNAME_KEY);
365// }
366
367// bool PPPData::setModemName(const QString &n) {
368// qDebug("Setting modem name to >%s<", n.latin1());
369// _modemName = n;
370// writeConfig(cgroup, MODEMNAME_KEY, n);
371// return true; //FIXME
372// }
373
374// bool PPPData::changeModemName(const QString &n) {
375// qDebug("Setting modem name to >%s<", n.latin1());
376// _modemName = n;
377// writeConfig(modemGroup(), MODEMNAME_KEY, n);
378// return true; //FIXME
379// }
380
351bool PPPData::setModemDevice(const QString &n) { 381bool PPPData::setModemDevice(const QString &n) {
352 qDebug("Setting modem dev to >%s<", n.latin1()); 382 qDebug("Setting modem dev to >%s<", n.latin1());
353 bool ret = false; 383 writeConfig(modemGroup(), MODEMDEV_KEY, n);
354 for (int i = 0; devices[i]; i++) 384 return true; //FIXME
355 if (devices[i] == n){
356 modemDeviceGroup = i;
357 writeConfig(modemGroup(), MODEMDEV_KEY, n);
358 ret = true;
359 }
360 qDebug(ret?"SUCCESS":"FAILURE");
361 return ret;
362} 385}
@@ -719,19 +742,24 @@ bool PPPData::setAccount(const QString &aname) {
719 qDebug("setting account to >%s<", aname.latin1()); 742 qDebug("setting account to >%s<", aname.latin1());
720 for(int i = 0; i <= highcount; i++) { 743 for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) {
721 setAccountbyIndex(i); 744 cgroup = *it;
722 if(accname() == aname) { 745 qDebug("PPPData::setAccount %s", cgroup.latin1());
723 caccount = i; 746 qDebug( "iterator %s", (*it).latin1() );
724 qDebug("SUCCESS"); 747 if(accname() == aname) {
725 return true; 748 qDebug("SUCCESS");
749 return true;
750 }
751
726 } 752 }
727 } 753 qDebug("FAILURE");
728 qDebug("FAILURE"); 754 return false;
729 return false;
730} 755}
731 756
732 757/*
733bool PPPData::setAccountbyIndex(int i) { 758bool PPPData::setAccountbyIndex(int i) {
734 if(i >= 0 && i <= highcount) { 759 if(i >= 0 && i <= highcount) {
760 QString tmp;
761 tmp.sprintf("%s%i", ACCOUNT_GRP, i);
762 if (_deleted.find(tmp)!=_deleted.end()) return false;
735 caccount = i; 763 caccount = i;
736 cgroup.sprintf("%s%i", ACCOUNT_GRP, i); 764 cgroup = tmp;
737 return true; 765 return true;
@@ -740,14 +768,18 @@ bool PPPData::setAccountbyIndex(int i) {
740} 768}
741 769*/
742 770
743bool PPPData::isUniqueAccname(const QString &n) { 771bool PPPData::isUniqueAccname(const QString &n) {
744 int current = caccount; 772 QString save_cgroup = cgroup;
745 for(int i=0; i <= highcount; i++) { 773 for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) {
746 setAccountbyIndex(i); 774 cgroup = *it;
747 if(accname() == n && i != current) { 775 qDebug("PPPData::setAccount %s", cgroup.latin1());
748 setAccountbyIndex(current); 776 qDebug( "%s \n", (*it).latin1() );
749 return false; 777 if(accname() == n && cgroup != save_cgroup) {
750 } 778 cgroup = save_cgroup;
779 qDebug("SUCCESS");
780 return false;
781 }
782
751 } 783 }
752 setAccountbyIndex(current); 784 cgroup = save_cgroup;
753 return true; 785 return true;
@@ -756,48 +788,61 @@ bool PPPData::isUniqueAccname(const QString &n) {
756 788
757bool PPPData::deleteAccount() { 789bool PPPData::isUniqueDevname(const QString &n) {
758 //FIXME: PPPData::deleteAccount 790 QString save_mName = _modemName;
759// if(caccount < 0) 791 qDebug("PPPData::isUniqueDevname checking if %s is unique", n.latin1());
760 return false; 792 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) {
761 793 _modemName = *it;
762// QMap <QString, QString> map; 794 qDebug("PPPData::isUniqueDevname %s == %s", n.latin1() , devname().latin1());
763// QMap <QString, QString>::Iterator it; 795 if(devname() == n && _modemName != save_mName) {
764 796 _modemName = save_mName;
765// // set all entries of the current account to "" 797 qDebug("NOT UNIQUE");
766// map = config->entryMap(cgroup); 798 return false;
767// it = map.begin(); 799 }
768// while (it != map.end()) {
769// config->writeEntry(it.key(), "");
770// it++;
771// }
772 800
773// // shift the succeeding accounts 801 }
774// for(int i = caccount+1; i <= highcount; i++) { 802 _modemName = save_mName;
775// setAccountbyIndex(i); 803 return true;
776// map = config->entryMap(cgroup); 804}
777// it = map.begin();
778// setAccountbyIndex(i-1);
779// config->setGroup(cgroup);
780// while (it != map.end()) {
781// config->writeEntry(it.key(), *it);
782// it++;
783// }
784// }
785 805
786// // make sure the top account is cleared
787// setAccountbyIndex(highcount);
788// map = config->entryMap(cgroup);
789// it = map.begin();
790// config->setGroup(cgroup);
791// while (it.key() != QString::null) {
792// config->writeEntry(it.key(), "");
793// it++;
794// }
795 806
796// highcount--; 807bool PPPData::deleteAccount() {
797// if(caccount > highcount) 808 // FIXME: check if this account exists in a config...
798// caccount = highcount; 809 Config cfg = PPPData::config();
810 cfg.setGroup(cgroup);
811 cfg.clearGroup();
812 accountList.remove(cgroup);
799 813
800// setAccountbyIndex(caccount); 814 QString key;
815 QStringList keys;
816 for( QMap<QString,QString>::Iterator it = stringEntries.begin();
817 it != stringEntries.end(); ++it ){
818 QString val = it.data();
819 key = it.key();
820 keys = QStringList::split( "SEPARATOR", key );
821 if(keys[0]==cgroup){
822 stringEntries.remove( it );
823 qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() );
824 }
825 }
826 for( QMap<QString,int>::Iterator it = intEntries.begin();
827 it != intEntries.end(); ++it ){
828 int val = it.data();
829 key = it.key();
830 keys = QStringList::split( "SEPARATOR", key );
831 if(keys[0]==cgroup){
832 intEntries.remove( it );
833 qDebug("deleting >%s< key >%s< value >%i<", keys[0].latin1(), keys[1].latin1(), val );
834 }
835 }
836 for( QMap<QString,QStringList>::Iterator it = listEntries.begin();
837 it != listEntries.end(); ++it ){
838 QStringList val = it.data();
839 key = it.key();
840 if(keys[0]==cgroup){
841 listEntries.remove( it );
842 sepEntries.remove( key );
843 qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.join("").latin1() );
844 }
845 }
801 846
802// return true; 847 return true;
803} 848}
@@ -819,13 +864,15 @@ int PPPData::newaccount() {
819// if(!config) open(); 864// if(!config) open();
820 if (highcount >= MAX_ACCOUNTS) return -1; 865// if (highcount >= MAX_ACCOUNTS) return -1;
821 866
822 highcount++;
823 setAccountbyIndex(highcount);
824 867
868 QString tmp;
869 tmp.sprintf("%s%i", ACCOUNT_GRP, ++highcount);
870 cgroup = QString(tmp);
871 accountList << tmp;
872 qDebug("PPPData::newaccount() Group: >%s<",cgroup.latin1());
825 setpppdArgumentDefaults(); 873 setpppdArgumentDefaults();
826 qDebug("PPPData::newaccount -> %i",caccount); 874 return highcount;
827 return caccount;
828} 875}
829 876
830int PPPData::copyaccount(int i) { 877int PPPData::copyaccount(const QString&) {
831// FIXME: PPPData::copyaccount 878// FIXME: PPPData::copyaccount
@@ -839,3 +886,3 @@ int PPPData::copyaccount(int i) {
839 886
840// QString newname = i18n("%1_copy").arg(accname()); 887// QString newname = QObject::tr("%1_copy").arg(accname());
841 888
@@ -866,2 +913,3 @@ void PPPData::setAccname(const QString &n) {
866 } 913 }
914 writeConfig(cgroup, NAME_KEY, n);
867} 915}
@@ -1178,2 +1226,3 @@ void PPPData::setpppdArgumentDefaults() {
1178 QStringList arg; 1226 QStringList arg;
1227 arg << "lcp-echo-failure 0";
1179 setpppdArgument(arg); 1228 setpppdArgument(arg);
@@ -1249,7 +1298,5 @@ QString PPPData::modemGroup()
1249{ 1298{
1250 if (modemDeviceGroup<0){ 1299 if (_modemName.isEmpty())
1251 qDebug("wrong modem %i\n using 0",modemDeviceGroup); 1300 _modemName = deviceList[0];
1252 modemDeviceGroup = 0; //FIXME! 1301 return _modemName;
1253 }
1254 return QString("%1_%1").arg(MODEM_GRP).arg(modemDeviceGroup);
1255} 1302}
@@ -1302 +1349,147 @@ QString PPPData::encodeWord(const QString &s) {
1302} 1349}
1350
1351QStringList PPPData::getDevicesList()
1352{
1353 Config cfg("NetworkSetupPPP");
1354 cfg.setGroup("Devices_General");
1355 return cfg.readListEntry(DEVICES_LIST,DEVICES_LIST_SEP);
1356}
1357
1358QStringList PPPData::getAccountList()
1359{
1360 QStringList list;
1361 QString save_cgroup;
1362 save_cgroup = cgroup;
1363 for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) {
1364 cgroup = *it;
1365 list << accname();
1366 }
1367 cgroup = save_cgroup;
1368 return list;
1369};
1370
1371
1372const QString PPPData::devname()
1373{
1374 QString tmp = readConfig(modemGroup(), MODEMNAME_KEY );
1375 qDebug("PPPData::devname() of %s is %s", modemGroup().latin1(), tmp.latin1());
1376 return tmp;
1377}
1378
1379void PPPData::setDevname(const QString &n) {
1380 // if(!cgroup.isNull()) {
1381// // are we manipulating the default account's name ? then change it, too.
1382// bool def = accname() == defaultAccount();
1383// writeConfig(cgroup, NAME_KEY, n);
1384// if (def)
1385// setDefaultAccount(n);
1386// }
1387 writeConfig(modemGroup(), MODEMNAME_KEY, n );
1388}
1389
1390
1391bool PPPData::setDevice(const QString &dev )
1392{
1393 qDebug("setting device to >%s<", dev.latin1());
1394 QString save_mName = _modemName;
1395 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) {
1396 _modemName = *it;
1397 qDebug("PPPData::setDevice %s is named %s", _modemName.latin1(), devname().latin1() );
1398 qDebug( "iterator %s", (*it).latin1() );
1399 if(devname() == dev) {
1400 qDebug("SUCCESS");
1401 return true;
1402 }
1403
1404 }
1405 _modemName = save_mName;
1406 qDebug("FAILURE");
1407 return false;
1408}
1409
1410bool PPPData::deleteDevice()
1411{
1412 // FIXME: check if this account exists in a config...
1413 Config cfg = PPPData::config();
1414 cfg.setGroup(modemGroup());
1415 cfg.clearGroup();
1416 deviceList.remove(modemGroup());
1417
1418 QString key;
1419 QStringList keys;
1420 for( QMap<QString,QString>::Iterator it = stringEntries.begin();
1421 it != stringEntries.end(); ++it ){
1422 QString val = it.data();
1423 key = it.key();
1424 keys = QStringList::split( "SEPARATOR", key );
1425 if(keys[0]==modemGroup()){
1426 stringEntries.remove( it );
1427 qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() );
1428 }
1429 }
1430 for( QMap<QString,int>::Iterator it = intEntries.begin();
1431 it != intEntries.end(); ++it ){
1432 int val = it.data();
1433 key = it.key();
1434 keys = QStringList::split( "SEPARATOR", key );
1435 if(keys[0]==modemGroup()){
1436 intEntries.remove( it );
1437 qDebug("deleting >%s< key >%s< value >%i<", keys[0].latin1(), keys[1].latin1(), val );
1438 }
1439 }
1440 for( QMap<QString,QStringList>::Iterator it = listEntries.begin();
1441 it != listEntries.end(); ++it ){
1442 QStringList val = it.data();
1443 key = it.key();
1444 if(keys[0]==modemGroup()){
1445 listEntries.remove( it );
1446 sepEntries.remove( key );
1447 qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.join("").latin1() );
1448 }
1449 }
1450
1451 return true;
1452
1453}
1454
1455bool PPPData::deleteDevice(const QString &dev)
1456{
1457 if(!setDevice(dev))
1458 return false;
1459
1460 return deleteDevice();
1461}
1462
1463int PPPData::newdevice()
1464{
1465
1466 qDebug("PPPData::newdevice highcount %i",highcountdev);
1467
1468
1469 QString tmp;
1470 tmp.sprintf("%s%i", MODEM_GRP, ++highcountdev);
1471 _modemName = QString(tmp);
1472 deviceList << tmp;
1473 qDebug("PPPData::newdevice() Group: >%s<",cgroup.latin1());
1474 return highcountdev;
1475}
1476
1477int PPPData::copydevice(const QString&)
1478{
1479 return false;
1480}
1481
1482
1483QStringList PPPData::getDevicesNamesList()
1484{
1485 QStringList list;
1486 QString save_mName = _modemName;
1487 qDebug("PPPData::getDevicesNamesList has %s", deviceList.join("---").latin1());
1488 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) {
1489 _modemName = *it;
1490 qDebug("PPPData::getDevicesNamesList adding %s as %s",_modemName.latin1(), devname().latin1());
1491 list << devname();
1492 }
1493 _modemName = save_mName;
1494 return list;
1495};
diff --git a/noncore/settings/networksettings/ppp/pppdata.h b/noncore/settings/networksettings/ppp/pppdata.h
index 6e1379d..d1cbeb5 100644
--- a/noncore/settings/networksettings/ppp/pppdata.h
+++ b/noncore/settings/networksettings/ppp/pppdata.h
@@ -66,2 +66,4 @@ class Config;
66// general 66// general
67#define ACCOUNT_LIST "AccountList"
68#define DEVICE_LIST "DeviceList"
67#define DEFAULTACCOUNT_KEY "DefaultAccount" 69#define DEFAULTACCOUNT_KEY "DefaultAccount"
@@ -74,3 +76,4 @@ class Config;
74#define QUITONDISCONNECT_KEY "QuitOnDisconnect" 76#define QUITONDISCONNECT_KEY "QuitOnDisconnect"
75#define NUMACCOUNTS_KEY "NumberOfAccounts" 77#define NUMACCOUNTS_KEY "HighcountAccounts"
78#define NUMDEVICES_KEY "HighcountDevices"
76 #define ID_KEY "ID" 79 #define ID_KEY "ID"
@@ -78,2 +81,3 @@ class Config;
78// modem 81// modem
82#define MODEMNAME_KEY "Modem_Name"
79#define MODEMDEV_KEY "Device" 83#define MODEMDEV_KEY "Device"
@@ -153,2 +157,6 @@ class Config;
153 157
158#define DEVICESNAMES_LIST "DevicesNames_List"
159#define DEVICES_LIST "Devices_List"
160#define DEVICES_LIST_SEP ','
161
154class PPPData { 162class PPPData {
@@ -164,2 +172,4 @@ public:
164 172
173 QStringList getAccountList();
174
165 static QMap<QString,QString> getConfiguredInterfaces(); 175 static QMap<QString,QString> getConfiguredInterfaces();
@@ -186,3 +196,3 @@ public:
186 196
187 int currentAccountID() { return caccount; }; 197// int currentAccountID() { return caccount; };
188 const QString defaultAccount(); 198 const QString defaultAccount();
@@ -238,4 +248,8 @@ public:
238 248
239 const QString modemDevice(); 249// const QString modemName();
240 bool setModemDevice(const QString &); 250// bool setModemName(const QString &);
251// bool changeModemName(const QString &);
252
253 const QString modemDevice();
254 bool setModemDevice(const QString &);
241 255
@@ -315,5 +329,6 @@ public:
315 bool setAccount(const QString &); 329 bool setAccount(const QString &);
316 bool setAccountbyIndex(int); 330// bool setAccountbyIndex(int);
317 331
318 bool isUniqueAccname(const QString &); 332 bool isUniqueAccname(const QString &);
333 bool isUniqueDevname(const QString &);
319 334
@@ -322,3 +337,3 @@ public:
322 int newaccount(); 337 int newaccount();
323 int copyaccount(int i); 338 int copyaccount(const QString&);
324 339
@@ -411,2 +426,3 @@ public:
411 426
427 QStringList getDevicesList();
412 428
@@ -414,2 +430,11 @@ public:
414 430
431 const QString devname();
432 void setDevname(const QString &);
433 bool setDevice(const QString& );
434 bool deleteDevice();
435 bool deleteDevice(const QString &);
436 int newdevice();
437 int copydevice(const QString&);
438 QStringList getDevicesNamesList();
439
415private: 440private:
@@ -417,7 +442,8 @@ private:
417 //static PPPData *_data; 442 //static PPPData *_data;
418 int modemDeviceGroup; 443// int modemDeviceGroup;
419 QString passwd; 444 QString passwd;
420 // static Config* config; // configuration object 445 QString _modemName;
421 int highcount; // index of highest account 446 int highcount; // index of highest account
422 int caccount; // index of the current account 447 int highcountdev; // index of highest device
448// int caccount; // index of the current account
423 QString cgroup; // name of current config group 449 QString cgroup; // name of current config group
@@ -429,3 +455,6 @@ private:
429 455
456
430 QStringList phonelist; 457 QStringList phonelist;
458 QStringList accountList;
459 QStringList deviceList;
431 QMap<QString,QString> stringEntries; 460 QMap<QString,QString> stringEntries;
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index d4c137b..af05eb7 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -1,2 +1,8 @@
1#include <errno.h>
2#include <signal.h>
1 3
4
5#include <qpe/config.h>
6
7#include "modem.h"
2#include "pppconfig.h" 8#include "pppconfig.h"
@@ -7,2 +13,27 @@
7 13
14// don't polute global namespace
15namespace {
16 /*
17 * If network settings is qutting and we've ppp
18 * devices open we need to save the pid_t the PPData
19 * and the interface number
20 */
21 struct Connection {
22 pid_t pid;
23 QString device;
24 QString name;
25 };
26 class InterfaceKeeper {
27 public:
28 InterfaceKeeper();
29 ~InterfaceKeeper();
30
31 void addInterface( pid_t, const QString& pppDev, const QString& name );
32 QMap<QString, Connection> interfaces()const; // will check if still available
33 private:
34 bool isAvailable( pid_t )const;
35 QMap<QString, Connection> m_interfaces;
36 };
37}
38
8 39
@@ -10,2 +41,5 @@
10 * Constructor, find all of the possible interfaces 41 * Constructor, find all of the possible interfaces
42 * We also need to restore the state.. it could be that
43 * an interface was up while closing the application
44 * we need to be able to shut it down...
11 */ 45 */
@@ -13,2 +47,6 @@ PPPModule::PPPModule() : Module()
13{ 47{
48 InterfaceKeeper inFace;
49 QMap<QString,Connection> running = inFace.interfaces();
50 QStringList handledInterfaceNames;
51
14 QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces(); 52 QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces();
@@ -18,3 +56,3 @@ PPPModule::PPPModule() : Module()
18 for( it = ifaces.begin(); it != ifaces.end(); ++it ){ 56 for( it = ifaces.begin(); it != ifaces.end(); ++it ){
19 qDebug("ifaces %s", it.key().latin1()); 57 qDebug("ifaces %s %s", it.key().latin1(), it.data().latin1() );
20 iface = new InterfacePPP( 0, it.key() ); 58 iface = new InterfacePPP( 0, it.key() );
@@ -22,3 +60,15 @@ PPPModule::PPPModule() : Module()
22 list.append( (Interface*)iface ); 60 list.append( (Interface*)iface );
61
62 // check if (*it) is one of the running ifaces
63 if ( running.contains( it.data() ) ) {
64 qDebug("iface is running %s", it.key().latin1() );
65 handledInterfaceNames << running[it.data()].device;
66 iface->setStatus( true );
67 iface->setPPPDpid( running[it.data()].pid );
68 iface->modem()->setPPPDevice( running[it.data()].device );
69 iface->refresh();
70 }
23 } 71 }
72
73 setHandledInterfaceNames( handledInterfaceNames );
24} 74}
@@ -29,5 +79,13 @@ PPPModule::PPPModule() : Module()
29PPPModule::~PPPModule(){ 79PPPModule::~PPPModule(){
80 qDebug("PPPModule::~PPPModule() " );
30 QMap<QString,QString> ifaces; 81 QMap<QString,QString> ifaces;
82 InterfaceKeeper keeper;
31 Interface *i; 83 Interface *i;
32 for ( i=list.first(); i != 0; i=list.next() ){ 84 for ( i=list.first(); i != 0; i=list.next() ){
85 /* if online save the state */
86 if ( i->getStatus() ) {
87 qDebug("Iface %s is still up", i->getHardwareName().latin1() );
88 InterfacePPP* ppp = static_cast<InterfacePPP*>(i);
89 keeper.addInterface( ppp->pppPID(), ppp->pppDev(), ppp->getHardwareName() );
90 }
33 ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); 91 ifaces.insert( i->getInterfaceName(), i->getHardwareName() );
@@ -71,3 +129,3 @@ QWidget *PPPModule::configure(Interface *i){
71 0, "PPPConfig", false, 129 0, "PPPConfig", false,
72 Qt::WDestructiveClose ); 130 Qt::WDestructiveClose | Qt::WStyle_ContextHelp);
73 return pppconfig; 131 return pppconfig;
@@ -137 +195,56 @@ void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces)
137 195
196
197namespace {
198 InterfaceKeeper::InterfaceKeeper( ) {
199 }
200 InterfaceKeeper::~InterfaceKeeper() {
201 Config cfg("ppp_plugin_keeper");
202 QStringList lst = cfg.groupList();
203 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
204 Connection con;
205 cfg.setGroup( (*it) );
206 cfg.clearGroup();
207 }
208
209 for (QMap<QString, Connection>::Iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it ) {
210 Connection con = it.data();
211 cfg.setGroup( con.name );
212 cfg.writeEntry( "pid", con.pid );
213 cfg.writeEntry( "device", con.device );
214 }
215 }
216 void InterfaceKeeper::addInterface(pid_t pid, const QString& dev, const QString& name ) {
217 Connection con;
218 con.pid = pid;
219 con.device = dev;
220 con.name = name;
221 m_interfaces.insert( name, con );
222 }
223 QMap<QString, Connection> InterfaceKeeper::interfaces()const {
224 Config cfg("ppp_plugin_keeper");
225 QMap<QString, Connection> ifaces;
226 QStringList lst = cfg.groupList();
227 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
228 Connection con;
229 cfg.setGroup( (*it) );
230 con.name = (*it);
231 con.pid = cfg.readNumEntry("pid");
232 con.device = cfg.readEntry("device");
233 qDebug(" %s %s %d", con.name.latin1(), con.device.latin1(), con.pid );
234
235 if ( con.pid != -1 && isAvailable( con.pid ) )
236 ifaces.insert( con.name, con );
237 }
238 return ifaces;
239 }
240 bool InterfaceKeeper::isAvailable( pid_t p)const {
241 if (::kill(p, 0 ) == 0 || errno != ESRCH ) {
242 qDebug("isAvailable %d", p);
243 return true;
244 }
245
246 qDebug("notAvailable %d", p);
247 return false;
248 }
249
250}
diff --git a/noncore/settings/networksettings/ppp/runtests.cpp b/noncore/settings/networksettings/ppp/runtests.cpp
index 83ef2ea..5548601 100644
--- a/noncore/settings/networksettings/ppp/runtests.cpp
+++ b/noncore/settings/networksettings/ppp/runtests.cpp
@@ -46,4 +46,2 @@
46 46
47//#include <klocale.h>
48#define i18n QObject::tr
49#include "pppdata.h" 47#include "pppdata.h"
@@ -219,3 +217,3 @@ int runTests() {
219 QMessageBox::warning(0,"error", 217 QMessageBox::warning(0,"error",
220 i18n("You're not allowed to dial out with " 218 QObject::tr("You're not allowed to dial out with "
221 "kppp.\nContact your system administrator.")); 219 "kppp.\nContact your system administrator."));
@@ -230,3 +228,3 @@ int runTests() {
230 QMessageBox::warning(0,"error", 228 QMessageBox::warning(0,"error",
231 i18n("Cannot find the PPP daemon!\n" 229 QObject::tr("Cannot find the PPP daemon!\n"
232 "Make sure that pppd is installed.")); 230 "Make sure that pppd is installed."));
@@ -240,3 +238,3 @@ int runTests() {
240 KMessageBox::warning(0, 238 KMessageBox::warning(0,
241 i18n("You do not have the permission " 239 QObject::tr("You do not have the permission "
242 "to start pppd!\n" 240 "to start pppd!\n"
@@ -253,3 +251,3 @@ int runTests() {
253 QMessageBox::warning(0,"error", 251 QMessageBox::warning(0,"error",
254 i18n("You don't have sufficient permission to run\n" 252 QObject::tr("You don't have sufficient permission to run\n"
255 "%1\n" 253 "%1\n"
@@ -265,3 +263,3 @@ int runTests() {
265 QString file = _PATH_RESCONF" "; 263 QString file = _PATH_RESCONF" ";
266 QString msgstr = i18n("%1 is missing or can't be read!\n" 264 QString msgstr = QObject::tr("%1 is missing or can't be read!\n"
267 "Ask your system administrator to create " 265 "Ask your system administrator to create "
diff --git a/noncore/settings/networksettings/wlan/keyedit.cpp b/noncore/settings/networksettings/wlan/keyedit.cpp
index ad9ecae..13a1c3b 100644
--- a/noncore/settings/networksettings/wlan/keyedit.cpp
+++ b/noncore/settings/networksettings/wlan/keyedit.cpp
@@ -6,2 +6,3 @@ KeyEdit::KeyEdit(QWidget* parent, const char* name) :
6{ 6{
7 setEchoMode(Password);
7} 8}
diff --git a/noncore/settings/networksettings/wlan/wlan.ui b/noncore/settings/networksettings/wlan/wlan.ui
index 7932445..7e39e23 100644
--- a/noncore/settings/networksettings/wlan/wlan.ui
+++ b/noncore/settings/networksettings/wlan/wlan.ui
@@ -13,3 +13,3 @@
13 <y>0</y> 13 <y>0</y>
14 <width>251</width> 14 <width>247</width>
15 <height>299</height> 15 <height>299</height>
@@ -289,15 +289,3 @@
289 <name>text</name> 289 <name>text</name>
290 <string>Auto</string> 290 <string>any</string>
291 </property>
292 </item>
293 <item>
294 <property>
295 <name>text</name>
296 <string>Managed</string>
297 </property>
298 </item>
299 <item>
300 <property>
301 <name>text</name>
302 <string>Ad-Hoc</string>
303 </property> 291 </property>
@@ -306,7 +294,3 @@
306 <name>name</name> 294 <name>name</name>
307 <cstring>mode</cstring> 295 <cstring>essid</cstring>
308 </property>
309 <property stdset="1">
310 <name>enabled</name>
311 <bool>true</bool>
312 </property> 296 </property>
@@ -316,3 +300,3 @@
316 <x>101</x> 300 <x>101</x>
317 <y>11</y> 301 <y>46</y>
318 <width>103</width> 302 <width>103</width>
@@ -324,3 +308,3 @@
324 <sizepolicy> 308 <sizepolicy>
325 <hsizetype>1</hsizetype> 309 <hsizetype>7</hsizetype>
326 <vsizetype>0</vsizetype> 310 <vsizetype>0</vsizetype>
@@ -328,2 +312,22 @@
328 </property> 312 </property>
313 <property stdset="1">
314 <name>editable</name>
315 <bool>true</bool>
316 </property>
317 <property stdset="1">
318 <name>currentItem</name>
319 <number>0</number>
320 </property>
321 <property stdset="1">
322 <name>sizeLimit</name>
323 <number>5</number>
324 </property>
325 <property stdset="1">
326 <name>autoCompletion</name>
327 <bool>true</bool>
328 </property>
329 <property stdset="1">
330 <name>duplicatesEnabled</name>
331 <bool>false</bool>
332 </property>
329 </widget> 333 </widget>
@@ -334,3 +338,21 @@
334 <name>text</name> 338 <name>text</name>
335 <string>any</string> 339 <string>Infrastructure</string>
340 </property>
341 </item>
342 <item>
343 <property>
344 <name>text</name>
345 <string>Auto</string>
346 </property>
347 </item>
348 <item>
349 <property>
350 <name>text</name>
351 <string>Managed</string>
352 </property>
353 </item>
354 <item>
355 <property>
356 <name>text</name>
357 <string>Ad-Hoc</string>
336 </property> 358 </property>
@@ -339,3 +361,7 @@
339 <name>name</name> 361 <name>name</name>
340 <cstring>essid</cstring> 362 <cstring>mode</cstring>
363 </property>
364 <property stdset="1">
365 <name>enabled</name>
366 <bool>true</bool>
341 </property> 367 </property>
@@ -345,3 +371,3 @@
345 <x>101</x> 371 <x>101</x>
346 <y>46</y> 372 <y>11</y>
347 <width>103</width> 373 <width>103</width>
@@ -353,3 +379,3 @@
353 <sizepolicy> 379 <sizepolicy>
354 <hsizetype>7</hsizetype> 380 <hsizetype>1</hsizetype>
355 <vsizetype>0</vsizetype> 381 <vsizetype>0</vsizetype>
@@ -357,22 +383,2 @@
357 </property> 383 </property>
358 <property stdset="1">
359 <name>editable</name>
360 <bool>true</bool>
361 </property>
362 <property stdset="1">
363 <name>currentItem</name>
364 <number>0</number>
365 </property>
366 <property stdset="1">
367 <name>sizeLimit</name>
368 <number>5</number>
369 </property>
370 <property stdset="1">
371 <name>autoCompletion</name>
372 <bool>true</bool>
373 </property>
374 <property stdset="1">
375 <name>duplicatesEnabled</name>
376 <bool>false</bool>
377 </property>
378 </widget> 384 </widget>
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp
index cdafb4d..26e3aa9 100644
--- a/noncore/settings/networksettings/wlan/wlanimp2.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp
@@ -29,3 +29,3 @@
29 */ 29 */
30WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) { 30WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") {
31 interfaces = new Interfaces(); 31 interfaces = new Interfaces();
@@ -69,10 +69,5 @@ void WLANImp::parseOpts() {
69 opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace(); 69 opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace();
70 if (opt == "Auto") { 70
71 mode->setCurrentItem(0); 71 for ( int i = 0; i < mode->count(); i++)
72 } else if (opt == "Ad-Hoc") { 72 if ( mode->text( i ) == opt ) mode->setCurrentItem( i );
73 mode->setCurrentItem(2);
74 } else {
75 // Managed/Infrastructure mode
76 mode->setCurrentItem(1);
77 }
78 73
@@ -205,3 +200,3 @@ void WLANImp::accept() {
205 // Close out the dialog 200 // Close out the dialog
206 QDialog::accept(); 201// FIXME: QDialog::accept();
207} 202}
@@ -209,3 +204,12 @@ void WLANImp::accept() {
209void WLANImp::writeOpts() { 204void WLANImp::writeOpts() {
210 bool error = false; 205 // eh can't really do anything about it other then return. :-D
206 if(!interfaces->isInterfaceSet()){
207 QMessageBox::warning(0,"Inface not set","should not happen!!!");
208 return;
209 }
210 bool error = false;
211
212 qDebug("setting wlan interface %s", interfaces->getInterfaceName( error ).latin1() );
213
214 if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!");
211 215
@@ -232,9 +236,12 @@ void WLANImp::writeOpts() {
232 keyList += "[1]"; 236 keyList += "[1]";
233 } else if (! keyLineEdit1->text().isNull()) { 237 } //else
238 if (! keyLineEdit1->text().isNull()) {
234 keyList += keyLineEdit1->text(); 239 keyList += keyLineEdit1->text();
235 keyList += "[2]"; 240 keyList += "[2]";
236 } else if (! keyLineEdit2->text().isNull()) { 241 } //else
242 if (! keyLineEdit2->text().isNull()) {
237 keyList += keyLineEdit2->text(); 243 keyList += keyLineEdit2->text();
238 keyList += "[3]"; 244 keyList += "[3]";
239 } else if (! keyLineEdit3->text().isNull()) { 245 } //else
246 if (! keyLineEdit3->text().isNull()) {
240 keyList += keyLineEdit3->text(); 247 keyList += keyLineEdit3->text();
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index a4488f9..b4c3509 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -1,3 +1,3 @@
1#include "wlanmodule.h" 1#include "wlanmodule.h"
2#include "wlanimp.h" 2#include "wlanimp2.h"
3#include "infoimp.h" 3#include "infoimp.h"
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index c06f639..19b0e84 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -427,3 +427,3 @@ void UserDialog::accept() {
427void UserDialog::clickedPicture() { 427void UserDialog::clickedPicture() {
428 QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED,"/opt/QtPalmtop/pics"); 428 QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED, QString::null);
429 if(!(filename.isEmpty())) { 429 if(!(filename.isEmpty())) {
diff --git a/noncore/settings/usermanager/userdialog.h b/noncore/settings/usermanager/userdialog.h
index b7b925d..3272afc 100644
--- a/noncore/settings/usermanager/userdialog.h
+++ b/noncore/settings/usermanager/userdialog.h
@@ -18,2 +18,3 @@
18#include <qcheckbox.h> 18#include <qcheckbox.h>
19#include <qlabel.h>
19 20
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp
index 1946013..65bbd8b 100644
--- a/noncore/settings/usermanager/usermanager.cpp
+++ b/noncore/settings/usermanager/usermanager.cpp
@@ -29,3 +29,3 @@
29UserConfig::UserConfig(QWidget* parent, const char* name, WFlags fl) : QMainWindow(parent, name, fl) { 29UserConfig::UserConfig(QWidget* parent, const char* name, WFlags fl) : QMainWindow(parent, name, fl) {
30 setCaption(tr("OPIE User Manager")); 30 setCaption(tr("Opie User Manager"));
31 31
diff --git a/noncore/settings/usermanager/usermanager.pro b/noncore/settings/usermanager/usermanager.pro
index 576a233..1baccb6 100644
--- a/noncore/settings/usermanager/usermanager.pro
+++ b/noncore/settings/usermanager/usermanager.pro
@@ -4,3 +4,3 @@ CONFIG = qt warn_on release
4 HEADERS = usermanager.h userdialog.h groupdialog.h passwd.h 4 HEADERS = usermanager.h userdialog.h groupdialog.h passwd.h
5 SOURCES = usermanager.cpp userdialog.cpp groupdialog.cpp passwd.cpp main.cpp 5 SOURCES = usermanager.cpp userdialog.cpp groupdialog.cpp passwd.h main.cpp
6 INCLUDEPATH+= $(OPIEDIR)/include 6 INCLUDEPATH+= $(OPIEDIR)/include