--- a/locationsystemui/locationsysui/locsuplsettingsui/src/locsuplservereditor.cpp Wed Sep 15 12:40:28 2010 +0300
+++ b/locationsystemui/locationsysui/locsuplsettingsui/src/locsuplservereditor.cpp Wed Oct 13 15:01:35 2010 +0300
@@ -69,7 +69,7 @@
TBool aIsEditable,
CLocSUPLSettingsUiEngine& aEngine,
TInt64 aSlpId
- ):iIsEditMode( aIsEditable ), iEngine( aEngine ), iSlpId( aSlpId ), iIsAccessPointDefined(EFalse)
+ ):iIsEditMode( aIsEditable ), iEngine( aEngine ), iSlpId( aSlpId )
{
if( aIsEditable )
{
@@ -184,10 +184,28 @@
case ELocSuplServerIdServerAddr:
{
aMenuPane->SetItemDimmed( ELocServerEditorDefine, ETrue );
+ aMenuPane->SetItemDimmed( ELocServerEditorChange, ETrue );
break;
}
case ELocSuplServerIdAccessPoint:
{
+ TInt isIapChanged = EFalse;
+ CEikEdwin* apSelector =
+ static_cast < CEikEdwin* > ( ControlOrNull( IdOfFocusControl() ) );
+ if( apSelector )
+ {
+ if( iIap->Length() > 0 )
+ isIapChanged = ETrue;
+ }
+
+ if( isIapChanged )
+ {
+ aMenuPane->SetItemDimmed( ELocServerEditorDefine, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( ELocServerEditorChange, ETrue );
+ }
break;
}
case ELocSuplServerIdUsageInHomeNw:
@@ -197,6 +215,8 @@
TBool editableFlag = ETrue;
if( iSlpId )
TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) );
+ if( editableFlag == EFalse )
+ aMenuPane->SetItemDimmed( ELocServerEditorChange, ETrue );
break;
}
@@ -234,6 +254,7 @@
}
aMenuPane->SetItemDimmed( ELocServerEditorDefine, ETrue );
+ aMenuPane->SetItemDimmed( ELocServerEditorChange, ETrue );
aMenuPane->SetItemDimmed( ELocServerEditorRemove, ETrue );
}
}
@@ -279,10 +300,22 @@
TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, ETrue ) );
break;
}
+ case ELocServerEditorDefine:
+ {
+ TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) );
+ break;
+ }
+ case ELocServerEditorChange:
case ELocServerEditorMSKChange:
{
CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control(
ELocSuplServerIdUsageInHomeNw);
+ if (IdOfFocusControl() == ELocSuplServerIdAccessPoint)
+ {
+ TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) );
+ }
+ else
+ {
HBufC* string;
string = StringLoader::LoadLC(
R_LOC_SERVER_USAGEINHOMENETWORK_NO, iCoeEnv);
@@ -316,8 +349,9 @@
SetUsageinHomeNetwork(EFalse);
}
}
+ }
CleanupStack::PopAndDestroy(string);
- }
+ }
break;
}
case EAknCmdHelp:
@@ -429,6 +463,13 @@
retVal = EFalse;
break;
}
+ case ELocServerEditorMSKDefine:
+ {
+ TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) );
+ //dont close editor
+ retVal = EFalse;
+ break;
+ }
case ELocServerEditorMSKChange:
{
ProcessCommandL( ELocServerEditorMSKChange );
@@ -454,11 +495,9 @@
{
if( iIsNewServer )
{
- // iap name is always set as KNullDesC since defining the access point is
- // not allowed while creating a new server manually
TRAPD( err, iEngine.AddNewServerL(
iServerAddress->Des(),
- KNullDesC,
+ iIap->Des(),
iUsageInHomeNw ) );
if( err == KErrNone )
{
@@ -611,11 +650,11 @@
usageInHomeNWPopupFieldText->GetText(des);
if (!des.CompareC(string->Des()))
{
- iUsageInHomeNw = EFalse;
+ iUsageInHomeNw = ETrue;
}
else
{
- iUsageInHomeNw = ETrue;
+ iUsageInHomeNw = EFalse;
}
CleanupStack::PopAndDestroy(string);
}
@@ -721,18 +760,10 @@
// -----------------------------------------------------------------------------
//
TInt CLocSUPLServerEditor::ExecuteLD()
- {
- if (!iIsAccessPointDefined)
- {
- return CAknForm::ExecuteLD(R_SUPLSERVER_EDITOR_FORM_DIALOG_NOAP);
- }
- else
- {
- return CAknForm::ExecuteLD(R_SUPLSERVER_EDITOR_FORM_DIALOG);
- }
+ {
+ return CAknForm::ExecuteLD( R_SUPLSERVER_EDITOR_FORM_DIALOG );
}
-
// -----------------------------------------------------------------------------
// CLocSUPLServerEditor::HandleControlStateChangeL
// -----------------------------------------------------------------------------
@@ -785,6 +816,15 @@
DEBUG( + CLocSUPLServerEditor::LoadFormValuesFromDataL );
if( IsEditable() && iIsNewServer ) //if create new server
{
+ CEikEdwin* apSelector =
+ static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdAccessPoint ) );
+ if( apSelector )
+ {
+ HBufC* apString = StringLoader::LoadL( R_LOC_SERVER_NONE );
+ apSelector->SetTextL( apString );
+ delete apString;
+ }
+ apSelector->DrawNow();
CEikEdwin* usageInHNWPopupFieldText = (CEikEdwin*) Control(
ELocSuplServerIdUsageInHomeNw);
@@ -830,7 +870,7 @@
{
// Error has occured
}
-
+
CEikEdwin* serverAddress =
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdServerAddr ) );
if( serverAddress )
@@ -841,24 +881,31 @@
serverAddress->DrawDeferred();
iServerAddress->Des().Copy( hslpAddr->Des() );
}
-
- if (iIsAccessPointDefined)
- {
- CEikEdwin* apSelector = static_cast<CEikEdwin*> (ControlOrNull(
- ELocSuplServerIdAccessPoint));
- if (apSelector)
- {
- apSelector->SetTextL(iapName);
- apSelector->DrawNow();
- iIap->Des().Copy(iapName->Des());
- }
- }
-
+
+ CEikEdwin* apSelector =
+ static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdAccessPoint ) );
+ if( apSelector )
+ {
+ if( iapName->Length() > 0 )
+ {
+ apSelector->SetTextL( iapName );
+ }
+ else
+ {
+ HBufC* apString = StringLoader::LoadL( R_LOC_SERVER_NONE );
+ apSelector->SetTextL( apString );
+ delete apString;
+ }
+
+ apSelector->DrawNow();
+ iIap->Des().Copy( iapName->Des() );
+ }
+
CEikEdwin* usageInHNWPopupFieldText = (CEikEdwin*) Control(
ELocSuplServerIdUsageInHomeNw);
if (usageInHNWPopupFieldText)
{
- if (!usageInHomeNwFlag)
+ if (usageInHomeNwFlag)
SetUsageinHomeNetwork(EFalse);
else
SetUsageinHomeNetwork(ETrue);
@@ -943,6 +990,22 @@
}
case ELocSuplServerIdAccessPoint:
{
+ TInt isIapChanged = EFalse;
+ CEikEdwin* apSelector =
+ static_cast < CEikEdwin* > ( ControlOrNull( IdOfFocusControl() ) );
+ if( apSelector && iIap )
+ {
+ if( iIap->Length() > 0 )
+ isIapChanged = ETrue;
+ }
+ if( isIapChanged )
+ {
+ cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_CHANGE_DONE );
+ }
+ else
+ {
+ cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_DEFINE_DONE );
+ }
break;
}
case ELocSuplServerIdUsageInHomeNw:
@@ -1084,12 +1147,10 @@
if (!IsEditable())
{
if (focusControl == ELocSuplServerIdUsageInHomeNw
- || focusControl == ELocSuplServerIdServerAddr)
+ || ELocSuplServerIdServerAddr || ELocSuplServerIdAccessPoint)
{
ProcessCommandL(EAknFormCmdEdit);
}
- else
- return;
}
else if (aEventID == MEikDialogPageObserver::EDialogPageTapped)
{
@@ -1118,6 +1179,14 @@
}
return;
}
+ if (focusControl == ELocSuplServerIdAccessPoint)
+ {
+ if (iapEditor)
+ {
+ //Launch IAP Dialog
+ TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) );
+ }
+ }
}DEBUG( -CLocSUPLServerEditor::HandleDialogPageEventL );
}
@@ -1148,15 +1217,4 @@
CleanupStack::PopAndDestroy(string);
}
-// -----------------------------------------------------------------------------
-// CLocSUPLServerEditor::SetAccessPointEnabled
-//
-// -----------------------------------------------------------------------------
-//
-void CLocSUPLServerEditor::SetAccessPointEnabled (TBool aEnabled)
- {
- iIsAccessPointDefined = aEnabled;
- }
-
-
// End of file