43 mNetConfigurationManager(new QNetworkConfigurationManager(this)), |
43 mNetConfigurationManager(new QNetworkConfigurationManager(this)), |
44 mSettingsManager(new XQSettingsManager(this)), |
44 mSettingsManager(new XQSettingsManager(this)), |
45 mActiveCellularConfigurations(new QList<QNetworkConfiguration>), |
45 mActiveCellularConfigurations(new QList<QNetworkConfiguration>), |
46 mActiveWlanConfigurations(new QList<QNetworkConfiguration>), |
46 mActiveWlanConfigurations(new QList<QNetworkConfiguration>), |
47 mWlanEnabled(0), |
47 mWlanEnabled(0), |
|
48 mWlanForceDisabled(0), |
48 mWlanIndicatorIsActivated(false), |
49 mWlanIndicatorIsActivated(false), |
49 mCellularIndicatorIsActivated(false) |
50 mCellularIndicatorIsActivated(false) |
50 |
51 |
51 { |
52 { |
52 OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CONSTRUCTOR_ENTRY, "-->"); |
53 OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CONSTRUCTOR_ENTRY, "-->"); |
77 XQSettingsKey wlanKey( |
78 XQSettingsKey wlanKey( |
78 XQSettingsKey::TargetCentralRepository, |
79 XQSettingsKey::TargetCentralRepository, |
79 KCRUidWlanDeviceSettingsRegistryId.iUid, |
80 KCRUidWlanDeviceSettingsRegistryId.iUid, |
80 KWlanOnOff); |
81 KWlanOnOff); |
81 |
82 |
|
83 // Also subscribe for KForceDisableWlan change indications |
|
84 XQSettingsKey wlanForceKey( |
|
85 XQSettingsKey::TargetCentralRepository, |
|
86 KCRUidWlanDeviceSettingsRegistryId.iUid, |
|
87 KWlanForceDisable); |
|
88 |
82 //Read current status of WLAN radio |
89 //Read current status of WLAN radio |
83 mWlanEnabled = mSettingsManager->readItemValue(wlanKey).toInt() ? true : false; |
90 mWlanEnabled = mSettingsManager->readItemValue(wlanKey).toInt() ? true : false; |
|
91 mWlanForceDisabled = mSettingsManager->readItemValue(wlanForceKey).toInt() ? true : false; |
84 |
92 |
85 mSettingsManager->startMonitoring(wlanKey); |
93 mSettingsManager->startMonitoring(wlanKey); |
|
94 mSettingsManager->startMonitoring(wlanForceKey); |
86 |
95 |
87 initializeIndicators(); |
96 initializeIndicators(); |
88 |
97 |
89 OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CONSTRUCTOR_EXIT, "<--"); |
98 OstTrace0(TRACE_FLOW, INDICATOROBSERVER_CONSTRUCTOR_EXIT, "<--"); |
90 } |
99 } |
138 */ |
147 */ |
139 void IndicatorObserver::updateWlanRadioStatus(const XQSettingsKey &key, const QVariant &value) |
148 void IndicatorObserver::updateWlanRadioStatus(const XQSettingsKey &key, const QVariant &value) |
140 { |
149 { |
141 OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATEWLANRADIOSTATUS_ENTRY, "-->"); |
150 OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATEWLANRADIOSTATUS_ENTRY, "-->"); |
142 |
151 |
143 // The key parameter is not used, since only WLAN ON/OFF setting is connected to this slot |
152 // The change notification is received either for the WlanOnoff key, or the |
144 Q_UNUSED(key); |
153 // ForceDisableWlan key |
145 |
154 if (KWlanOnOff == key.key()) { |
146 // Inform about WLAN ON/OFF status change |
155 mWlanEnabled = value.toInt() ? true : false; |
147 mWlanEnabled = value.toInt() ? true : false; |
156 } else { |
148 |
157 mWlanForceDisabled = value.toInt() ? true : false; |
149 if (mWlanEnabled == false) { |
158 } |
|
159 |
|
160 if (mWlanEnabled == false || mWlanForceDisabled == true) { |
150 deactivateWlanIndicatorPlugin(); |
161 deactivateWlanIndicatorPlugin(); |
151 } else { |
162 } else { |
152 updateWlanIndicator(); |
163 updateWlanIndicator(); |
153 } |
164 } |
154 OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATEWLANRADIOSTATUS_EXIT, "<--"); |
165 OstTrace0(TRACE_FLOW, INDICATOROBSERVER_UPDATEWLANRADIOSTATUS_EXIT, "<--"); |
196 |
207 |
197 int count = mActiveWlanConfigurations->count(); |
208 int count = mActiveWlanConfigurations->count(); |
198 |
209 |
199 //We do not deactivate WlanIndicator plugin here as it is done in updateWlanRadioStatus method |
210 //We do not deactivate WlanIndicator plugin here as it is done in updateWlanRadioStatus method |
200 //as WLAN radio status determines whether to show indicator or not |
211 //as WLAN radio status determines whether to show indicator or not |
201 if ( mWlanEnabled ) { |
212 if ( mWlanEnabled && !mWlanForceDisabled) { |
202 if(count == 0) { |
213 if(count == 0) { |
203 list.insert(0, wlanNotConnected); |
214 list.insert(0, wlanNotConnected); |
204 activateWlanIndicatorPlugin(list); |
215 activateWlanIndicatorPlugin(list); |
205 } else { |
216 } else { |
206 list.insert(0, wlanConnected); |
217 list.insert(0, wlanConnected); |