diff -r bfc95e24a059 -r c9471d26c7f2 qtinternetradio/ui/src/iropenwebaddressview.cpp --- a/qtinternetradio/ui/src/iropenwebaddressview.cpp Mon Jun 21 22:33:45 2010 +0100 +++ b/qtinternetradio/ui/src/iropenwebaddressview.cpp Thu Jul 22 16:31:41 2010 +0100 @@ -34,6 +34,7 @@ #include "irqenums.h" #include "iruidefines.h" #include "irqsettings.h" +static const int MAX_URL_CHARACTOR_NUMBER = 255; IROpenWebAddressView::IROpenWebAddressView(IRApplication* aApplication, TIRViewId aViewId) : IRBaseView(aApplication, aViewId), @@ -91,9 +92,6 @@ HbStyleLoader::registerFilePath(OPEN_WEB_ADDRESS_VIEW_PUSH_BUTTON_CSS); HbStyleLoader::registerFilePath(OPEN_WEB_ADDRESS_VIEW_PUSH_BUTTON_WIDGETML); - // This view need not to be stacked. - setFlag(EViewFlag_UnStackable); - connect(iNetworkController, SIGNAL(networkRequestNotified(IRQNetworkEvent)), this, SLOT(networkRequestNotified(IRQNetworkEvent))); @@ -103,9 +101,12 @@ IROpenWebAddressView::~IROpenWebAddressView() { - iSettings->setManuallyInputtedStationUrl(iUrl->contentWidgetData(QString("text")).toString()); - iSettings->setManuallyInputtedStationName(iName->contentWidgetData(QString("text")).toString()); - iSettings->closeInstance(); + if (iSettings) + { + iSettings->setManuallyInputtedStationUrl(iUrl->contentWidgetData(QString("text")).toString()); + iSettings->setManuallyInputtedStationName(iName->contentWidgetData(QString("text")).toString()); + iSettings->closeInstance(); + } } /* @@ -166,7 +167,11 @@ if (0 == stationName.size()) { - iName->setContentWidgetData(QString("text"), hbTrId("txt_irad_info_unnamed")); +#ifdef SUBTITLE_STR_BY_LOCID + iName->setContentWidgetData(QString("text"), hbTrId("txt_irad_info_unnamed_station")); +#else + iName->setContentWidgetData(QString("text"), hbTrId("Unnamed station")); +#endif } else { @@ -188,7 +193,11 @@ temp = iName->contentWidgetData(QString("text")).toString(); if (0 == temp.size()) { - iName->setContentWidgetData(QString("text"), hbTrId("txt_irad_info_unnamed")); +#ifdef SUBTITLE_STR_BY_LOCID + iName->setContentWidgetData(QString("text"), hbTrId("txt_irad_info_unnamed_station")); +#else + iName->setContentWidgetData(QString("text"), hbTrId("Unnamed station")); +#endif } } @@ -197,12 +206,22 @@ */ void IROpenWebAddressView::initDataForm() { - iUrl = new HbDataFormModelItem( - HbDataFormModelItem::TextItem, hbTrId("txt_irad_formlabel_station_url")); +#ifdef SUBTITLE_STR_BY_LOCID + iUrl = new HbDataFormModelItem(HbDataFormModelItem::TextItem, hbTrId("txt_irad_formlabel_station_address")); +#else + iUrl = new HbDataFormModelItem(HbDataFormModelItem::TextItem, hbTrId("Station address")); +#endif + iUrl->setContentWidgetData("maxLength",MAX_URL_CHARACTOR_NUMBER); iModel->appendDataFormItem(iUrl); +#ifdef SUBTITLE_STR_BY_LOCID iName = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_irad_formlabel_station_name")); +#else + iName = new HbDataFormModelItem( + HbDataFormModelItem::TextItem, hbTrId("Station name")); +#endif + iName->setContentWidgetData("maxLength", MAX_URL_CHARACTOR_NUMBER); iModel->appendDataFormItem(iName); iForm->addConnection(iUrl, SIGNAL(textChanged(const QString&)), @@ -223,7 +242,9 @@ } setUseNetworkReason(EIR_UseNetwork_OpenWebAddress); - +#ifdef HS_WIDGET_ENABLED + iPlayController->setConnectingStationName(preset.name); +#endif // Verify the connectivity if (false == iApplication->verifyNetworkConnectivity()) { @@ -249,19 +270,17 @@ switch (aEvent) { case EIRQNetworkConnectionEstablished: - iApplication->closeConnectingDialog(); - if (EIR_UseNetwork_OpenWebAddress == getUseNetworkReason()) { play(); } - - setUseNetworkReason(EIR_UseNetwork_NoReason); break; default: break; } + + setUseNetworkReason(EIR_UseNetwork_NoReason); } /* @@ -278,7 +297,11 @@ // check the URL if (!IRQUtility::isValidUrl(server.url)) { - popupNote(hbTrId("txt_irad_info_invalid_link_please_change_it"), HbMessageBox::MessageTypeInformation); +#ifdef SUBTITLE_STR_BY_LOCID + popupNote(hbTrId("txt_irad_info_invalid_station_address"), HbMessageBox::MessageTypeInformation); +#else + popupNote(hbTrId("Invalid station address"), HbMessageBox::MessageTypeInformation); +#endif return false; } @@ -287,7 +310,11 @@ server.serverName = iName->contentWidgetData(QString("text")).toString(); if (0 == server.serverName.size()) { - server.serverName = hbTrId("txt_irad_info_unnamed"); +#ifdef SUBTITLE_STR_BY_LOCID + server.serverName = hbTrId("txt_irad_info_unnamed_station"); +#else + server.serverName = hbTrId("Unnamed station"); +#endif } aPreset.insertChannelServer(server); @@ -341,7 +368,11 @@ if( object == iNameEditorPtr && event->type() == QEvent::FocusIn ) { - if(hbTrId("txt_irad_info_unnamed") == iName->contentWidgetData(QString("text")).toString()) +#ifdef SUBTITLE_STR_BY_LOCID + if(hbTrId("txt_irad_info_unnamed_station") == iName->contentWidgetData(QString("text")).toString()) +#else + if(hbTrId("Unnamed station") == iName->contentWidgetData(QString("text")).toString()) +#endif { iName->setContentWidgetData(QString("text"), QString("")); }