X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Save.cpp;h=0ca9cb0d199a84fc71bd25ce1cd90a4b3fdc3e2e;hb=a73019906500e3a0fc306a61e4b7975f79725866;hp=dd3851c1d047286434962e218efb34b6f76f144d;hpb=5b2b2bcea1ab1dfd2b74589573cd16ee9326c4b9;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Save.cpp b/source/contacteditor/frmContactEditor-Save.cpp index dd3851c..0ca9cb0 100644 --- a/source/contacteditor/frmContactEditor-Save.cpp +++ b/source/contacteditor/frmContactEditor-Save.cpp @@ -29,54 +29,60 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) wxString FilenameFinal; bool ReplaceContact = FALSE; - if (cmbType->GetCurrentSelection() == 1 || - cmbType->GetCurrentSelection() == 3 || - cmbType->GetCurrentSelection() == 4){ + if (StartupEditMode == TRUE){ + + if (cmbType->GetCurrentSelection() == 1 || + cmbType->GetCurrentSelection() == 3 || + cmbType->GetCurrentSelection() == 4){ - if (IsGroup == TRUE){ - - // Mark contact for replacing. + if (IsGroup == TRUE){ - ReplaceContact = TRUE; + // Mark contact for replacing. - } + ReplaceContact = TRUE; + IsGroup = FALSE; + + } - } else if (cmbType->GetCurrentSelection() == 2){ + } else if (cmbType->GetCurrentSelection() == 2){ - if (IsGroup == TRUE){ - - // Mark contact for replacing. + if (IsGroup == FALSE){ - ReplaceContact = TRUE; + // Mark contact for replacing. - } + ReplaceContact = TRUE; + IsGroup = TRUE; + + } - } + } - if (ReplaceContact == TRUE){ + if (ReplaceContact == TRUE){ - wxString wxDelSplitFilename; - wxString wxDelFinalFilename; - wxString wxSDelDataURL; - wxStringTokenizer wSTDelFilename(wxSContactFilename, wxT("/")); - while(wSTDelFilename.HasMoreTokens()){ + wxString wxDelSplitFilename; + wxString wxDelFinalFilename; + wxString wxSDelDataURL; + wxStringTokenizer wSTDelFilename(wxSContactFilename, wxT("/")); + while(wSTDelFilename.HasMoreTokens()){ - wxDelSplitFilename = wSTDelFilename.GetNextToken(); + wxDelSplitFilename = wSTDelFilename.GetNextToken(); - } + } - wxSDelDataURL = wxDelSplitFilename; + wxSDelDataURL = wxDelSplitFilename; - // Delete the contact from the server as it will be useless in certain - // address book clients. + // Delete the contact from the server as it will be useless in certain + // address book clients. - ActMgrPtr->AddTask(2, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDelDataURL, wxDelSplitFilename, wxSContactFilename, wxT("")); + ActMgrPtr->AddTask(2, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDelDataURL, wxDelSplitFilename, wxSContactFilename, wxT("")); - // Clear the filename so the trigger to recreate the UID is done. + // Clear the filename so the trigger to recreate the UID is done. - wxSContactFilename.Clear(); - EditMode = FALSE; + wxSContactFilename.Clear(); + EditMode = FALSE; + } + } if (wxSContactFilename.IsEmpty()){ @@ -2301,4 +2307,8 @@ void frmContactEditor::SaveCloseContact( wxCommandEvent& event ) // Save the updated contact data and close the form. + wxCommandEvent NullEvent; + this->SaveContact(NullEvent); + this->Close(); + } \ No newline at end of file