summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp42
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NNI.cpp5
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NNI.h3
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp2
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp7
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.h10
-rw-r--r--noncore/settings/networksettings2/nsdata.cpp55
-rw-r--r--noncore/settings/networksettings2/nsdata.h1
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.cpp10
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.cpp4
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.h2
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.cpp5
12 files changed, 121 insertions, 25 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
index cd7bb4a..63b214e 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
@@ -2,4 +2,14 @@
2#include <resources.h> 2#include <resources.h>
3
4#include <OTPeer.h>
3#include <OTDevice.h> 5#include <OTDevice.h>
4#include <OTGateway.h> 6#include <OTGateway.h>
7#include <Opietooth.h>
8
9#include <qlistbox.h>
10#include <qframe.h>
11#include <qlabel.h>
12#include <qlayout.h>
13#include <qdialog.h>
14
5#include "bluetoothRFCOMMrun.h" 15#include "bluetoothRFCOMMrun.h"
@@ -9,2 +19,4 @@ using Opietooth2::OTDevice;
9using Opietooth2::OTDeviceAddress; 19using Opietooth2::OTDeviceAddress;
20using Opietooth2::OTScan;
21using Opietooth2::OTPeer;
10 22
@@ -57,2 +69,5 @@ QString BluetoothRFCOMMRun::setMyState( NetworkSetup *,
57 69
70 // no longer needed
71 delete Ch;
72
58 if( Sys.runAsRoot( S ) ) { 73 if( Sys.runAsRoot( S ) ) {
@@ -80,8 +95,2 @@ QString BluetoothRFCOMMRun::setMyState( NetworkSetup *,
80 95
81#include <qlistbox.h>
82#include <qframe.h>
83#include <qlabel.h>
84#include <qlayout.h>
85#include <qdialog.h>
86
87RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) { 96RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) {
@@ -94,2 +103,18 @@ RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) {
94 RFCOMMChannel * Ch = 0; 103 RFCOMMChannel * Ch = 0;
104
105 if( Data->Devices.count() == 0 ) {
106 OTPeer * Peer;
107 int Channel;
108
109 if( OTScan::getDevice( Peer, Channel, OT ) == QDialog::Accepted ) {
110 Ch = new RFCOMMChannel;
111 Ch->BDAddress = Peer->address().toString();
112 Ch->Name = Peer->name();
113 Ch->Channel = Channel;
114 return Ch;
115 }
116
117 return 0;
118 }
119
95 QDialog * Dlg = new QDialog( qApp->mainWidget(), 0, TRUE ); 120 QDialog * Dlg = new QDialog( qApp->mainWidget(), 0, TRUE );
@@ -122,3 +147,6 @@ RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) {
122 odebug << "Selected " << Data->Devices[i]->Name << oendl; 147 odebug << "Selected " << Data->Devices[i]->Name << oendl;
123 Ch = Data->Devices[i]; 148 Ch = new RFCOMMChannel;
149 Ch->BDAddress = Data->Devices[i]->BDAddress;
150 Ch->Name = Data->Devices[i]->Name;
151 Ch->Channel = Data->Devices[i]->Channel;
124 break; 152 break;
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp b/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp
index bf8cc59..2dd54ff 100644
--- a/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp
+++ b/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp
@@ -209,4 +209,5 @@ short AGPRSDevice::generateFile( SystemFile & SF,
209 209
210bool AGPRSDevice::openFile( SystemFile & SF ) { 210bool AGPRSDevice::openFile( SystemFile & SF, QStringList & SL ) {
211 if( SF.name() == "peers" ) { 211 if( SF.name() == "peers" ) {
212 SL << "/etc" << "ppp" << "peers";
212 SF.setPath( 213 SF.setPath(
@@ -217,2 +218,3 @@ bool AGPRSDevice::openFile( SystemFile & SF ) {
217 } else if ( SF.name() == "chatscripts" ) { 218 } else if ( SF.name() == "chatscripts" ) {
219 SL << "/etc" << "chatscripts";
218 SF.setPath( 220 SF.setPath(
@@ -222,2 +224,3 @@ bool AGPRSDevice::openFile( SystemFile & SF ) {
222 return 1; 224 return 1;
225 SL << "/etc" << "ppp";
223 } else if ( SF.name() == "extra" ) { 226 } else if ( SF.name() == "extra" ) {
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NNI.h b/noncore/settings/networksettings2/gprs/GPRS_NNI.h
index 1060a6e..b5bf1b9 100644
--- a/noncore/settings/networksettings2/gprs/GPRS_NNI.h
+++ b/noncore/settings/networksettings2/gprs/GPRS_NNI.h
@@ -26,3 +26,4 @@ public :
26 26
27 virtual bool openFile( SystemFile & SF ); 27 virtual bool openFile( SystemFile & SF,
28 QStringList & SL );
28 29
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index 80dcb3d..2714dd5 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -253,3 +253,3 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
253 } 253 }
254 updateProfileState( LBI ); 254 SLOT_RefreshStates();
255 } 255 }
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
index 0ab0e5b..1bcd95c 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.cpp
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -91,4 +91,5 @@ bool ANetNode::isToplevel( void ) {
91bool ANetNode::openFile( SystemFile & SF, 91bool ANetNode::openFile( SystemFile & SF,
92 ANetNodeInstance * NNI ) { 92 ANetNodeInstance * NNI,
93 return (NNI ) ? NNI->openFile( SF ) : 0 ; 93 QStringList & SL ) {
94 return (NNI ) ? NNI->openFile( SF, SL ) : 0 ;
94} 95}
@@ -408,2 +409,3 @@ QString NetworkSetup::setState( Action_t A, bool Force ) {
408 case Disable : 409 case Disable :
410 /*
409 if( CurrentState < Disabled ) { 411 if( CurrentState < Disabled ) {
@@ -413,2 +415,3 @@ QString NetworkSetup::setState( Action_t A, bool Force ) {
413 } 415 }
416 */
414 417
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h
index 8aebdc0..fa4ab70 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.h
+++ b/noncore/settings/networksettings2/networksettings2/netnode.h
@@ -123,2 +123,6 @@ public:
123 // 123 //
124 // the function can return a set of folders that should
125 // be created (or perhaps already exist) prior to opening
126 // the file
127 //
124 // if this is the case the file should be (re)opened in append 128 // if this is the case the file should be (re)opened in append
@@ -126,3 +130,4 @@ public:
126 virtual bool openFile( SystemFile &SF, 130 virtual bool openFile( SystemFile &SF,
127 ANetNodeInstance * NNI ); 131 ANetNodeInstance * NNI,
132 QStringList & PathToCreate );
128 133
@@ -261,3 +266,4 @@ public:
261 // open proper file identified by S 266 // open proper file identified by S
262 virtual bool openFile( SystemFile & ) 267 virtual bool openFile( SystemFile &,
268 QStringList & )
263 { return 0; } 269 { return 0; }
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp
index 835c7c3..6b87399 100644
--- a/noncore/settings/networksettings2/nsdata.cpp
+++ b/noncore/settings/networksettings2/nsdata.cpp
@@ -338,8 +338,19 @@ QString NetworkSettingsData::generateSettings( void ) {
338 { SystemFile SF( (*it) ); 338 { SystemFile SF( (*it) );
339 QStringList SL;
339 340
340 if( ! CurDevNN->openFile( SF, nniit.current()) ) { 341 if( ! CurDevNN->openFile( SF, nniit.current(), SL) ) {
341 // cannot open 342 // cannot open
342 S = qApp->translate( "NetworkSettings", 343 S = qApp->translate( "NetworkSettings",
343 "<p>Cannot open proper file \"%1\" for node \"%2\"</p>" ). 344 "<p>Cannot build proper file \"%1\" for node \"%2\"</p>" ).
344 arg( (*it) ).arg( CurDevNN->name() ); 345 arg( (*it) ).
346 arg( CurDevNN->name() );
347 return S;
348 }
349
350 if( ! createPath( SL ) ) {
351 S = qApp->translate( "NetworkSettings",
352 "<p>Cannot create path \"%1\" for proper file \"%2\" for node \"%3\"</p>" ).
353 arg( SL.join("/") ).
354 arg( (*it) ).
355 arg( CurDevNN->name() );
345 return S; 356 return S;
@@ -381,4 +392,5 @@ QString NetworkSettingsData::generateSettings( void ) {
381 SystemFile SF( (*it) ); 392 SystemFile SF( (*it) );
393 QStringList SL;
382 394
383 if( CurDevNN->openFile( SF, 0 ) && 395 if( CurDevNN->openFile( SF, 0, SL ) &&
384 ! SF.path().isEmpty() 396 ! SF.path().isEmpty()
@@ -386,2 +398,11 @@ QString NetworkSettingsData::generateSettings( void ) {
386 398
399 if( ! createPath( SL ) ) {
400 S = qApp->translate( "NetworkSettings",
401 "<p>Cannot create path \"%1\" for proper file \"%2\" for node \"%3\"</p>" ).
402 arg( SL.join("/") ).
403 arg( (*it) ).
404 arg( CurDevNN->name() );
405 return S;
406 }
407
387 if( ! SF.open() ) { 408 if( ! SF.open() ) {
@@ -389,3 +410,4 @@ QString NetworkSettingsData::generateSettings( void ) {
389 "<p>Cannot open proper file \"%1\" for node \"%2\"</p>" ). 410 "<p>Cannot open proper file \"%1\" for node \"%2\"</p>" ).
390 arg( (*it) ).arg( CurDevNN->name() ); 411 arg( (*it) ).
412 arg( CurDevNN->name() );
391 return S; 413 return S;
@@ -787 +809,24 @@ QList<NetworkSetup> NetworkSettingsData::collectTriggered(
787 809
810bool NetworkSettingsData::createPath( const QStringList & SL ) {
811
812 QDir D( SL[0] );
813
814 for ( QStringList::ConstIterator it = SL.begin();
815 it != SL.end();
816 ++it ) {
817
818 printf( "Create %s\n", (*it).latin1() );
819 if( it == SL.begin() )
820 continue;
821
822 if( ! D.exists( *it ) ) {
823 if( ! D.mkdir( *it ) ) {
824 printf( "Failed %s %s\n", D.path().latin1(), (*it).latin1() );
825 return 0;
826 }
827 }
828
829 D.cd( *it );
830 }
831 return 1;
832}
diff --git a/noncore/settings/networksettings2/nsdata.h b/noncore/settings/networksettings2/nsdata.h
index b9c216d..65b61a3 100644
--- a/noncore/settings/networksettings2/nsdata.h
+++ b/noncore/settings/networksettings2/nsdata.h
@@ -31,2 +31,3 @@ private :
31 QList<NetworkSetup> collectTriggered( const QString &Interface ); 31 QList<NetworkSetup> collectTriggered( const QString &Interface );
32 bool createPath( const QStringList & SL );
32 bool ForceModified; 33 bool ForceModified;
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
index 8323549..fc30bf8 100644
--- a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
+++ b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
@@ -186,3 +186,2 @@ void OTSniffing::SLOT_Trace( bool Run ) {
186void OTSniffing::SLOT_Show( const QString & S ) { 186void OTSniffing::SLOT_Show( const QString & S ) {
187 printf( "%s\n", S.latin1() );
188 Output_TV->setText( Output_TV->text() + S + "\n" ); 187 Output_TV->setText( Output_TV->text() + S + "\n" );
@@ -379,2 +378,3 @@ OTScan::OTScan( QWidget * parent, OTIcons * _IC ) :
379 OT = OTGateway::getOTGateway(); 378 OT = OTGateway::getOTGateway();
379
380 Icons = (_IC ) ? _IC : new OTIcons(); 380 Icons = (_IC ) ? _IC : new OTIcons();
@@ -446,2 +446,10 @@ int OTScan::getDevice( OTPeer *& Peer,
446 446
447 if( ! OT->isEnabled() ) {
448 QMessageBox::warning( 0,
449 tr("Scanning problem"),
450 tr("Bluetooth not enabled" )
451 );
452 return QDialog::Rejected;
453 }
454
447 // check if bluetooth is up 455 // check if bluetooth is up
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
index 7286d96..9cdd51e 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
@@ -148,4 +148,5 @@ void APPP::commit( void ) {
148 148
149bool APPP::openFile( SystemFile & SF ) { 149bool APPP::openFile( SystemFile & SF, QStringList & SL ) {
150 if( SF.name() == "peers" ) { 150 if( SF.name() == "peers" ) {
151 SL << "/tmp/ppp" << "peers" ;
151 SF.setPath( removeSpaces( 152 SF.setPath( removeSpaces(
@@ -154,2 +155,3 @@ bool APPP::openFile( SystemFile & SF ) {
154 } else if ( SF.name() == "chatscripts" ) { 155 } else if ( SF.name() == "chatscripts" ) {
156 SL << "/tmp/chatscripts";
155 SF.setPath( removeSpaces( 157 SF.setPath( removeSpaces(
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.h b/noncore/settings/networksettings2/ppp/ppp_NNI.h
index 76afb21..7830a4a 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.h
@@ -27,3 +27,3 @@ public :
27 27
28 virtual bool openFile( SystemFile & Sf ); 28 virtual bool openFile( SystemFile & Sf, QStringList &SL );
29 short generateFile( SystemFile & TS, 29 short generateFile( SystemFile & TS,
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp
index 48011ea..77bf9ac 100644
--- a/noncore/settings/networksettings2/profile/profilerun.cpp
+++ b/noncore/settings/networksettings2/profile/profilerun.cpp
@@ -5,6 +5,5 @@
5State_t ProfileRun::detectState( void ) { 5State_t ProfileRun::detectState( void ) {
6 InterfaceInfo * II = networkSetup()->assignedInterface();
7 6
8 Log(( "Interface %p %p %p: %d\n", II, 7 Log(( "Profile %sabled\n", (Data->Disabled) ? "dis" : "en" ));
9 netNode(), netNode()->networkSetup(), (II) ? II->IsUp : 0 )); 8
10 if( Data->Disabled ) { 9 if( Data->Disabled ) {