X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorIM.cpp;h=dba7cba180bf4647c126e56b73e32080ddbb25a4;hb=bfe817b5bfae33a1eb666c463643ec119cd1d66d;hp=40bfef1485d94b68b51da11012ede86e00283ca7;hpb=d4a3b50aae4237e9b5a0f4b3bd0a2eb4e8b69c3c;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorIM.cpp b/source/contacteditor/frmContactEditorIM.cpp index 40bfef1..dba7cba 100644 --- a/source/contacteditor/frmContactEditorIM.cpp +++ b/source/contacteditor/frmContactEditorIM.cpp @@ -26,6 +26,9 @@ frmContactEditorIM::frmContactEditorIM( wxWindow* parent ) : frmContactEditorIMADT( parent ) { + + // Setup the window. + EditorMode = FALSE; sliPriority->Disable(); @@ -43,16 +46,22 @@ frmContactEditorIMADT( parent ) void frmContactEditorIM::EnablePriority( wxCommandEvent& event ) { + + // Enable/disable the priority setting. + if (chkUsePref->IsChecked()){ sliPriority->Enable(); } else { sliPriority->Disable(); } + } void frmContactEditorIM::ProcessAction( wxCommandEvent& event ) { + // Process the action. + long ListCtrlIndex; // Check if IM type is empty and if it is then @@ -263,11 +272,18 @@ void frmContactEditorIM::ProcessAction( wxCommandEvent& event ) void frmContactEditorIM::CloseWindow( wxCommandEvent& event ) { + + // Close the window. + this->Close(); + } void frmContactEditorIM::SetEditorMode(bool EditMode, SectionType SectType) { + + // Set the editor mode. + // Set if the editor is adding or editing an address. // FALSE = Add // TRUE = Edit @@ -300,8 +316,17 @@ void frmContactEditorIM::SetEditorMode(bool EditMode, SectionType SectType) } - strIMUser = IMListPtr->find(IMListIndex)->second; - strIMType = IMListTypeInfoPtr->find(IMListIndex)->second; + if (IMListPtr->find(IMListIndex) != IMListPtr->end()){ + + strIMUser = IMListPtr->find(IMListIndex)->second; + + } + + if (IMListTypeInfoPtr->find(IMListIndex) != IMListTypeInfoPtr->end()){ + + strIMType = IMListTypeInfoPtr->find(IMListIndex)->second; + + } if (strIMType == wxT("aim")){ @@ -348,7 +373,8 @@ void frmContactEditorIM::SetEditorMode(bool EditMode, SectionType SectType) intiter = IMListPrefPtr->find(IMListIndex); - if (intiter->first == IMListIndex && intiter->second > 0){ + if (intiter->first == IMListIndex && intiter->second > 0 && + intiter != IMListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); @@ -374,6 +400,8 @@ void frmContactEditorIM::SetupPointers( std::map *IMList, int IMIndex ) { + // Setup the pointers. + IMListPtr = IMList; IMListAltIDPtr = IMListAltID; IMListPIDPtr = IMListPID;