summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index ba89fa4..7953f7c 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -30,116 +30,116 @@ WLANModule::WLANModule()
30} 30}
31 31
32/** 32/**
33 * Delete any interfaces that we own. 33 * Delete any interfaces that we own.
34 */ 34 */
35WLANModule::~WLANModule(){ 35WLANModule::~WLANModule(){
36 Interface *i; 36 Interface *i;
37 for ( i=list.first(); i != 0; i=list.next() ) 37 for ( i=list.first(); i != 0; i=list.next() )
38 delete i; 38 delete i;
39 39
40} 40}
41 41
42/** 42/**
43 * Change the current profile 43 * Change the current profile
44 */ 44 */
45void WLANModule::setProfile(const QString &newProfile){ 45void WLANModule::setProfile(const QString &newProfile){
46 profile = newProfile; 46 profile = newProfile;
47} 47}
48 48
49/** 49/**
50 * get the icon name for this device. 50 * get the icon name for this device.
51 * @param Interface* can be used in determining the icon. 51 * @param Interface* can be used in determining the icon.
52 * @return QString the icon name (minus .png, .gif etc) 52 * @return QString the icon name (minus .png, .gif etc)
53 */ 53 */
54QString WLANModule::getPixmapName(Interface* ){ 54QString WLANModule::getPixmapName(Interface* ){
55 return "wlan"; 55 return "wlan";
56} 56}
57 57
58/** 58/**
59 * Check to see if the interface i is owned by this module. 59 * Check to see if the interface i is owned by this module.
60 * @param Interface* interface to check against 60 * @param Interface* interface to check against
61 * @return bool true if i is owned by this module, false otherwise. 61 * @return bool true if i is owned by this module, false otherwise.
62 */ 62 */
63bool WLANModule::isOwner(Interface *i){ 63bool WLANModule::isOwner(Interface *i){
64 WExtensions we(i->getInterfaceName()); 64 WExtensions we(i->getInterfaceName());
65 if(!we.doesHaveWirelessExtensions()) 65 if(!we.doesHaveWirelessExtensions())
66 return false; 66 return false;
67 67
68 i->setHardwareName("802.11b"); 68 i->setHardwareName("802.11b");
69 list.append(i); 69 list.append(i);
70 return true; 70 return true;
71} 71}
72 72
73/** 73/**
74 * Create, and return the WLANConfigure Module 74 * Create, and return the WLANConfigure Module
75 * @return QWidget* pointer to this modules configure. 75 * @return QWidget* pointer to this modules configure.
76 */ 76 */
77QWidget *WLANModule::configure(Interface *i){ 77QWidget *WLANModule::configure(Interface *i){
78 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose); 78 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, ::Qt::WDestructiveClose);
79 wlanconfig->setProfile(profile); 79 wlanconfig->setProfile(profile);
80 return wlanconfig; 80 return wlanconfig;
81} 81}
82 82
83/** 83/**
84 * Create, and return the Information Module 84 * Create, and return the Information Module
85 * @return QWidget* pointer to this modules info. 85 * @return QWidget* pointer to this modules info.
86 */ 86 */
87QWidget *WLANModule::information(Interface *i){ 87QWidget *WLANModule::information(Interface *i){
88 WExtensions we(i->getInterfaceName()); 88 WExtensions we(i->getInterfaceName());
89 if(!we.doesHaveWirelessExtensions()) 89 if(!we.doesHaveWirelessExtensions())
90 return NULL; 90 return NULL;
91 91
92 return getInfo( i ); 92 return getInfo( i );
93} 93}
94 94
95/** 95/**
96 * Get all active (up or down) interfaces 96 * Get all active (up or down) interfaces
97 * @return QList<Interface> A list of interfaces that exsist that havn't 97 * @return QList<Interface> A list of interfaces that exist that havn't
98 * been called by isOwner() 98 * been called by isOwner()
99 */ 99 */
100QList<Interface> WLANModule::getInterfaces(){ 100QList<Interface> WLANModule::getInterfaces(){
101 return list; 101 return list;
102} 102}
103 103
104/** 104/**
105 * Attempt to add a new interface as defined by name 105 * Attempt to add a new interface as defined by name
106 * @param name the name of the type of interface that should be created given 106 * @param name the name of the type of interface that should be created given
107 * by possibleNewInterfaces(); 107 * by possibleNewInterfaces();
108 * @return Interface* NULL if it was unable to be created. 108 * @return Interface* NULL if it was unable to be created.
109 */ 109 */
110Interface *WLANModule::addNewInterface(const QString &){ 110Interface *WLANModule::addNewInterface(const QString &){
111 // We can't add a 802.11 interface, either the hardware will be there 111 // We can't add a 802.11 interface, either the hardware will be there
112 // or it wont. 112 // or it wont.
113 return NULL; 113 return NULL;
114} 114}
115 115
116/** 116/**
117 * Attempts to remove the interface, doesn't delete i 117 * Attempts to remove the interface, doesn't delete i
118 * @return bool true if successful, false otherwise. 118 * @return bool true if successful, false otherwise.
119 */ 119 */
120bool WLANModule::remove(Interface*){ 120bool WLANModule::remove(Interface*){
121 // Can't remove a hardware device, you can stop it though. 121 // Can't remove a hardware device, you can stop it though.
122 return false; 122 return false;
123} 123}
124 124
125void WLANModule::receive(const QCString &param, const QByteArray &arg) 125void WLANModule::receive(const QCString &param, const QByteArray &arg)
126{ 126{
127 odebug << "WLANModule::receive "+param << oendl; 127 odebug << "WLANModule::receive "+param << oendl;
128 QStringList params = QStringList::split(",",param); 128 QStringList params = QStringList::split(",",param);
129 int count = params.count(); 129 int count = params.count();
130 odebug << "WLANModule got " << count << " params" << oendl; 130 odebug << "WLANModule got " << count << " params" << oendl;
131 if (count < 2){ 131 if (count < 2){
132 odebug << "Erorr less than 2 parameter" << oendl; 132 odebug << "Erorr less than 2 parameter" << oendl;
133 odebug << "RETURNING" << oendl; 133 odebug << "RETURNING" << oendl;
134 return; 134 return;
135 } 135 }
136 136
137 QDataStream stream(arg,IO_ReadOnly); 137 QDataStream stream(arg,IO_ReadOnly);
138 QString interface; 138 QString interface;
139 QString action; 139 QString action;
140 int countMsgs = 0; 140 int countMsgs = 0;
141 stream >> interface; 141 stream >> interface;
142 odebug << "got count? >" << interface.latin1() << "<" << oendl; 142 odebug << "got count? >" << interface.latin1() << "<" << oendl;
143 if (interface == "count"){ 143 if (interface == "count"){
144 odebug << "got count" << oendl; 144 odebug << "got count" << oendl;
145 stream >> action; 145 stream >> action;
@@ -198,60 +198,60 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
198 QPEApplication::showWidget( wlanconfigWiget ); 198 QPEApplication::showWidget( wlanconfigWiget );
199 stream >> value; 199 stream >> value;
200 odebug << "WLANModule (build 4) is setting " << action.latin1() << " of " << interface.latin1() << " to " << value.latin1() << "" << oendl; 200 odebug << "WLANModule (build 4) is setting " << action.latin1() << " of " << interface.latin1() << " to " << value.latin1() << "" << oendl;
201 if (value.isEmpty()){ 201 if (value.isEmpty()){
202 odebug << "value is empty!!!\nreturning" << oendl; 202 odebug << "value is empty!!!\nreturning" << oendl;
203 return; 203 return;
204 } 204 }
205 if ( action.contains("ESSID") ){ 205 if ( action.contains("ESSID") ){
206 QComboBox *combo = wlanconfigWiget->essid; 206 QComboBox *combo = wlanconfigWiget->essid;
207 bool found = false; 207 bool found = false;
208 for ( int i = 0; i < combo->count(); i++) 208 for ( int i = 0; i < combo->count(); i++)
209 if ( combo->text( i ) == value ){ 209 if ( combo->text( i ) == value ){
210 combo->setCurrentItem( i ); 210 combo->setCurrentItem( i );
211 found = true; 211 found = true;
212 } 212 }
213 if (!found) combo->insertItem( value, 0 ); 213 if (!found) combo->insertItem( value, 0 );
214 }else if ( action.contains("Mode") ){ 214 }else if ( action.contains("Mode") ){
215 QComboBox *combo = wlanconfigWiget->mode; 215 QComboBox *combo = wlanconfigWiget->mode;
216 for ( int i = 0; i < combo->count(); i++) 216 for ( int i = 0; i < combo->count(); i++)
217 if ( combo->text( i ) == value ){ 217 if ( combo->text( i ) == value ){
218 combo->setCurrentItem( i ); 218 combo->setCurrentItem( i );
219 } 219 }
220 220
221 }else if (action.contains("Channel")){ 221 }else if (action.contains("Channel")){
222 bool ok; 222 bool ok;
223 odebug << "converting channel" << oendl; 223 odebug << "converting channel" << oendl;
224 int chan = value.toInt( &ok ); 224 int chan = value.toInt( &ok );
225 if (ok){ 225 if (ok){
226 odebug << "ok setting channel" << oendl; 226 odebug << "ok setting channel" << oendl;
227 wlanconfigWiget->specifyChan->setChecked( true ); 227 wlanconfigWiget->specifyChan->setChecked( true );
228 wlanconfigWiget->networkChannel->setValue( chan ); 228 wlanconfigWiget->networkChannel->setValue( chan );
229 } 229 }
230 }else if (action.contains("MacAddr")){ 230 }else if (action.contains("MacAddr")){
231 wlanconfigWiget->specifyAp->setChecked( true ); 231 wlanconfigWiget->specifyAp->setChecked( true );
232 wlanconfigWiget->macEdit->setText( value ); 232 wlanconfigWiget->macEdit->setText( value );
233 }else 233 }else
234 odebug << "wlan plugin has no clue" << oendl; 234 odebug << "wlan plugin has no clue" << oendl;
235 } 235 }
236 odebug << "next stream" << oendl; 236 odebug << "next stream" << oendl;
237 }// while stream 237 }// while stream
238 odebug << "end of stream" << oendl; 238 odebug << "end of stream" << oendl;
239 if (toShow) toShow->exec(); 239 if (toShow) toShow->exec();
240 odebug << "returning" << oendl; 240 odebug << "returning" << oendl;
241} 241}
242 242
243QWidget *WLANModule::getInfo( Interface *i) 243QWidget *WLANModule::getInfo( Interface *i)
244{ 244{
245 odebug << "WLANModule::getInfo start" << oendl; 245 odebug << "WLANModule::getInfo start" << oendl;
246 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); 246 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), ::Qt::WDestructiveClose);
247 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); 247 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i);
248 info->tabWidget->insertTab(information, "TCP/IP", 0); 248 info->tabWidget->insertTab(information, "TCP/IP", 0);
249 info->tabWidget->setCurrentPage( 0 ); 249 info->tabWidget->setCurrentPage( 0 );
250 info->tabWidget->showPage( information ); 250 info->tabWidget->showPage( information );
251 if (info->tabWidget->currentPage() == information ) odebug << "infotab OK" << oendl; 251 if (info->tabWidget->currentPage() == information ) odebug << "infotab OK" << oendl;
252 else odebug << "infotab NOT OK" << oendl; 252 else odebug << "infotab NOT OK" << oendl;
253 odebug << "current idx " << info->tabWidget->currentPageIndex() << "" << oendl; 253 odebug << "current idx " << info->tabWidget->currentPageIndex() << "" << oendl;
254 odebug << "WLANModule::getInfo return" << oendl; 254 odebug << "WLANModule::getInfo return" << oendl;
255 return info; 255 return info;
256} 256}
257 257