165 iUrl->setContentWidgetData(QString("text"), stationUrl); |
165 iUrl->setContentWidgetData(QString("text"), stationUrl); |
166 } |
166 } |
167 |
167 |
168 if (0 == stationName.size()) |
168 if (0 == stationName.size()) |
169 { |
169 { |
170 iName->setContentWidgetData(QString("text"), hbTrId("txt_irad_info_unnamed")); |
170 #ifdef SUBTITLE_STR_BY_LOCID |
|
171 iName->setContentWidgetData(QString("text"), hbTrId("txt_irad_info_unnamed_station")); |
|
172 #else |
|
173 iName->setContentWidgetData(QString("text"), hbTrId("Unnamed station")); |
|
174 #endif |
171 } |
175 } |
172 else |
176 else |
173 { |
177 { |
174 iName->setContentWidgetData(QString("text"), stationName); |
178 iName->setContentWidgetData(QString("text"), stationName); |
175 } |
179 } |
187 } |
191 } |
188 |
192 |
189 temp = iName->contentWidgetData(QString("text")).toString(); |
193 temp = iName->contentWidgetData(QString("text")).toString(); |
190 if (0 == temp.size()) |
194 if (0 == temp.size()) |
191 { |
195 { |
192 iName->setContentWidgetData(QString("text"), hbTrId("txt_irad_info_unnamed")); |
196 #ifdef SUBTITLE_STR_BY_LOCID |
|
197 iName->setContentWidgetData(QString("text"), hbTrId("txt_irad_info_unnamed_station")); |
|
198 #else |
|
199 iName->setContentWidgetData(QString("text"), hbTrId("Unnamed station")); |
|
200 #endif |
193 } |
201 } |
194 } |
202 } |
195 |
203 |
196 /* |
204 /* |
197 * Description : initialize the details. |
205 * Description : initialize the details. |
204 iUrl = new HbDataFormModelItem(HbDataFormModelItem::TextItem, hbTrId("Station address")); |
212 iUrl = new HbDataFormModelItem(HbDataFormModelItem::TextItem, hbTrId("Station address")); |
205 #endif |
213 #endif |
206 iUrl->setContentWidgetData("maxLength",MAX_URL_CHARACTOR_NUMBER); |
214 iUrl->setContentWidgetData("maxLength",MAX_URL_CHARACTOR_NUMBER); |
207 iModel->appendDataFormItem(iUrl); |
215 iModel->appendDataFormItem(iUrl); |
208 |
216 |
|
217 #ifdef SUBTITLE_STR_BY_LOCID |
209 iName = new HbDataFormModelItem( |
218 iName = new HbDataFormModelItem( |
210 HbDataFormModelItem::TextItem, hbTrId("txt_irad_formlabel_station_name")); |
219 HbDataFormModelItem::TextItem, hbTrId("txt_irad_formlabel_station_name")); |
|
220 #else |
|
221 iName = new HbDataFormModelItem( |
|
222 HbDataFormModelItem::TextItem, hbTrId("Station name")); |
|
223 #endif |
211 iName->setContentWidgetData("maxLength", MAX_URL_CHARACTOR_NUMBER); |
224 iName->setContentWidgetData("maxLength", MAX_URL_CHARACTOR_NUMBER); |
212 iModel->appendDataFormItem(iName); |
225 iModel->appendDataFormItem(iName); |
213 |
226 |
214 iForm->addConnection(iUrl, SIGNAL(textChanged(const QString&)), |
227 iForm->addConnection(iUrl, SIGNAL(textChanged(const QString&)), |
215 this, SLOT(urlEditorTextChanged(const QString&))); |
228 this, SLOT(urlEditorTextChanged(const QString&))); |
280 server.url.remove(" "); |
295 server.url.remove(" "); |
281 |
296 |
282 // check the URL |
297 // check the URL |
283 if (!IRQUtility::isValidUrl(server.url)) |
298 if (!IRQUtility::isValidUrl(server.url)) |
284 { |
299 { |
285 popupNote(hbTrId("txt_irad_info_invalid_link_please_change_it"), HbMessageBox::MessageTypeInformation); |
300 #ifdef SUBTITLE_STR_BY_LOCID |
|
301 popupNote(hbTrId("txt_irad_info_invalid_station_address"), HbMessageBox::MessageTypeInformation); |
|
302 #else |
|
303 popupNote(hbTrId("Invalid station address"), HbMessageBox::MessageTypeInformation); |
|
304 #endif |
286 return false; |
305 return false; |
287 } |
306 } |
288 |
307 |
289 // Give it an initial value, supposed to be 32 kbps. |
308 // Give it an initial value, supposed to be 32 kbps. |
290 server.bitrate = 32; |
309 server.bitrate = 32; |
291 server.serverName = iName->contentWidgetData(QString("text")).toString(); |
310 server.serverName = iName->contentWidgetData(QString("text")).toString(); |
292 if (0 == server.serverName.size()) |
311 if (0 == server.serverName.size()) |
293 { |
312 { |
294 server.serverName = hbTrId("txt_irad_info_unnamed"); |
313 #ifdef SUBTITLE_STR_BY_LOCID |
|
314 server.serverName = hbTrId("txt_irad_info_unnamed_station"); |
|
315 #else |
|
316 server.serverName = hbTrId("Unnamed station"); |
|
317 #endif |
295 } |
318 } |
296 |
319 |
297 aPreset.insertChannelServer(server); |
320 aPreset.insertChannelServer(server); |
298 aPreset.name = server.serverName; |
321 aPreset.name = server.serverName; |
299 aPreset.description = hbTrId("txt_irad_info_added_station_description"); |
322 aPreset.description = hbTrId("txt_irad_info_added_station_description"); |
343 bool IROpenWebAddressView::eventFilter(QObject *object, QEvent *event) |
366 bool IROpenWebAddressView::eventFilter(QObject *object, QEvent *event) |
344 { |
367 { |
345 if( object == iNameEditorPtr |
368 if( object == iNameEditorPtr |
346 && event->type() == QEvent::FocusIn ) |
369 && event->type() == QEvent::FocusIn ) |
347 { |
370 { |
348 if(hbTrId("txt_irad_info_unnamed") == iName->contentWidgetData(QString("text")).toString()) |
371 #ifdef SUBTITLE_STR_BY_LOCID |
|
372 if(hbTrId("txt_irad_info_unnamed_station") == iName->contentWidgetData(QString("text")).toString()) |
|
373 #else |
|
374 if(hbTrId("Unnamed station") == iName->contentWidgetData(QString("text")).toString()) |
|
375 #endif |
349 { |
376 { |
350 iName->setContentWidgetData(QString("text"), QString("")); |
377 iName->setContentWidgetData(QString("text"), QString("")); |
351 } |
378 } |
352 } |
379 } |
353 return false; |
380 return false; |