summaryrefslogtreecommitdiff
path: root/noncore
authormickeyl <mickeyl>2005-05-17 16:57:08 (UTC)
committer mickeyl <mickeyl>2005-05-17 16:57:08 (UTC)
commitd2ae68c413873e234b34f733818427902e738948 (patch) (unidiff)
treef5748014d7b1785302c167c6f43fbd0622bf1019 /noncore
parentcce15d6b9a27880df72ea2638f9295900ea6c21e (diff)
downloadopie-d2ae68c413873e234b34f733818427902e738948.zip
opie-d2ae68c413873e234b34f733818427902e738948.tar.gz
opie-d2ae68c413873e234b34f733818427902e738948.tar.bz2
libopienet API cleanups
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/networkapplet/networkapplet.cpp6
-rw-r--r--noncore/net/opiestumbler/opiestumbler.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp
index 534a8d0..bd6ca66 100644
--- a/noncore/applets/networkapplet/networkapplet.cpp
+++ b/noncore/applets/networkapplet/networkapplet.cpp
@@ -62,67 +62,67 @@ IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name )
62 //setFixedWidth( 16 ); 62 //setFixedWidth( 16 );
63 connect( this, SIGNAL( clicked() ), this, SLOT( clicked() ) ); 63 connect( this, SIGNAL( clicked() ), this, SLOT( clicked() ) );
64} 64}
65 65
66 66
67IfaceUpDownButton::~IfaceUpDownButton() 67IfaceUpDownButton::~IfaceUpDownButton()
68{ 68{
69} 69}
70 70
71 71
72void IfaceUpDownButton::clicked() 72void IfaceUpDownButton::clicked()
73{ 73{
74 _iface->setUp( isOn() ); 74 _iface->setUp( isOn() );
75 setOn( _iface->isUp() ); // it might not have worked... 75 setOn( _iface->isUp() ); // it might not have worked...
76 repaint(); 76 repaint();
77} 77}
78 78
79 79
80IfaceIPAddress::IfaceIPAddress( QWidget* parent, const char* name ) 80IfaceIPAddress::IfaceIPAddress( QWidget* parent, const char* name )
81 :QLineEdit( parent, name ) 81 :QLineEdit( parent, name )
82{ 82{
83 setFont( QFont( "fixed" ) ); 83 setFont( QFont( "fixed" ) );
84 _iface = ONetwork::instance()->interface( name ); 84 _iface = ONetwork::instance()->interface( name );
85 setFixedWidth( 105 ); 85 setFixedWidth( 105 );
86 setText( _iface->ipV4Address() ); 86 setText( _iface->ipV4Address().toString() );
87 connect( this, SIGNAL( returnPressed() ), this, SLOT( returnPressed() ) ); 87 connect( this, SIGNAL( returnPressed() ), this, SLOT( returnPressed() ) );
88} 88}
89 89
90 90
91IfaceIPAddress::~IfaceIPAddress() 91IfaceIPAddress::~IfaceIPAddress()
92{ 92{
93} 93}
94 94
95 95
96void IfaceIPAddress::returnPressed() 96void IfaceIPAddress::returnPressed()
97{ 97{
98 QHostAddress a; 98 QHostAddress a;
99 a.setAddress( text() ); 99 a.setAddress( text() );
100 QHostAddress mask; 100 QHostAddress mask;
101 mask.setAddress( _iface->ipV4Netmask() ); // setIPV4Address destroys the netmask... 101 mask.setAddress( _iface->ipV4Netmask().toString() ); // setIPV4Address destroys the netmask...
102 _iface->setIPV4Address( a ); 102 _iface->setIPV4Address( a );
103 _iface->setIPV4Netmask( mask ); // recover the old netmask 103 _iface->setIPV4Netmask( mask ); // recover the old netmask
104 setText( _iface->ipV4Address() ); 104 setText( _iface->ipV4Address().toString() );
105 repaint(); 105 repaint();
106} 106}
107 107
108 108
109NetworkAppletControl::NetworkAppletControl( OTaskbarApplet* parent, const char* name ) 109NetworkAppletControl::NetworkAppletControl( OTaskbarApplet* parent, const char* name )
110 :QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), l(0) 110 :QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), l(0)
111{ 111{
112 setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); 112 setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
113 l = new QVBoxLayout( this, 4, 2 ); 113 l = new QVBoxLayout( this, 4, 2 );
114} 114}
115 115
116 116
117void NetworkAppletControl::build() 117void NetworkAppletControl::build()
118{ 118{
119 ONetwork::InterfaceIterator it = ONetwork::instance()->iterator(); 119 ONetwork::InterfaceIterator it = ONetwork::instance()->iterator();
120 while ( it.current() ) 120 while ( it.current() )
121 { 121 {
122 QHBoxLayout* h = new QHBoxLayout( l ); 122 QHBoxLayout* h = new QHBoxLayout( l );
123 QLabel* symbol = new QLabel( this ); 123 QLabel* symbol = new QLabel( this );
124 symbol->setPixmap( Resource::loadPixmap( guessDevice( it.current() ) ) ); 124 symbol->setPixmap( Resource::loadPixmap( guessDevice( it.current() ) ) );
125 h->addWidget( symbol ); 125 h->addWidget( symbol );
126 symbol->show(); 126 symbol->show();
127 127
128 QLabel* name = new QLabel( it.current()->name(), this ); 128 QLabel* name = new QLabel( it.current()->name(), this );
diff --git a/noncore/net/opiestumbler/opiestumbler.cpp b/noncore/net/opiestumbler/opiestumbler.cpp
index 8dedd67..f231fca 100644
--- a/noncore/net/opiestumbler/opiestumbler.cpp
+++ b/noncore/net/opiestumbler/opiestumbler.cpp
@@ -315,34 +315,34 @@ void OpieStumbler::slotAssociated()
315 if(m_proc) { 315 if(m_proc) {
316 m_proc->kill(); 316 m_proc->kill();
317 delete m_proc; 317 delete m_proc;
318 } 318 }
319 319
320 m_proc = new Opie::Core::OProcess(this); 320 m_proc = new Opie::Core::OProcess(this);
321 321
322 *m_proc << "udhcpc" << "-f" << "-n" << "-i" << m_interface; 322 *m_proc << "udhcpc" << "-f" << "-n" << "-i" << m_interface;
323 m_proc->start(Opie::Core::OProcess::DontCare); 323 m_proc->start(Opie::Core::OProcess::DontCare);
324 QTimer::singleShot(5000, this, SLOT(slotCheckDHCP())); 324 QTimer::singleShot(5000, this, SLOT(slotCheckDHCP()));
325} 325}
326 326
327void OpieStumbler::slotCheckDHCP() 327void OpieStumbler::slotCheckDHCP()
328{ 328{
329 if(!m_proc->isRunning()) { 329 if(!m_proc->isRunning()) {
330 Global::statusMessage(tr("Could not Obtain an Address")); 330 Global::statusMessage(tr("Could not Obtain an Address"));
331 delete m_proc; 331 delete m_proc;
332 m_proc = NULL; 332 m_proc = NULL;
333 return; 333 return;
334 } 334 }
335 m_listCurrent->show(); 335 m_listCurrent->show();
336 336
337 337
338 OWirelessNetworkInterface *wiface = static_cast<OWirelessNetworkInterface*>(ONetwork::instance()->interface(m_interface)); 338 OWirelessNetworkInterface *wiface = static_cast<OWirelessNetworkInterface*>(ONetwork::instance()->interface(m_interface));
339 Global::statusMessage(tr("Obtained IP ") + wiface->ipV4Address()); 339 Global::statusMessage(tr("Obtained IP ") + wiface->ipV4Address().toString());
340} 340}
341 341
342 342
343 343
344 344
345 345
346 346
347 347
348 348