X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2FfrmMain.cpp;h=228c7a6c28bb1c9493af3a4fd55afeba761db1df;hp=bcbad5c1f484ad2a196b66fb4b5bf4dd2978b7e2;hb=555c893cfd58230b494c33bbfedc1daaf9ca3a77;hpb=d71757f322746223ba535a9b04239541c81e3da3 diff --git a/source/frmMain.cpp b/source/frmMain.cpp index bcbad5c..228c7a6 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -737,8 +737,6 @@ void frmMain::LoadContactList( wxTreeEvent& event ) // Split the name into sections. - vCardDataString = Person.Get(wxT("N")); - vCardName NameData = Person.GetName(); vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname; @@ -1108,7 +1106,7 @@ void frmMain::ShowContactInfo( wxListEvent& event ) OldSessionID = SessionID; SessionID = wxString::Format(wxT("%i"), rand() % 32768); - LoadContactData(&Person, htmContactData, SessionID, OldSessionID, &MemoryFileList, ContactBackgroundColour.GetAsString(wxC2S_CSS_SYNTAX)); + LoadContactData(&Person, htmContactData, SessionID, OldSessionID, &MemoryFileList, ContactBackgroundColour); ActiveFilename = ContactsFileIndex[ContactSeekNum]; } @@ -1438,6 +1436,13 @@ void frmMain::LoadPreferences(bool skipWindowSizeReload){ XABPreferences preferences(preffilename); + // Clear the active account/filename information and account list. + + ActiveAccount = ""; + ActiveAccountType = ""; + ActiveFilename = ""; + lstContacts->DeleteAllItems(); + // Setup the main window position (if needed). bool SaveWindowPos = preferences.GetBoolData(wxT("SaveWindowPosition")); @@ -1708,19 +1713,40 @@ void frmMain::UpdateContactList(wxCommandEvent& event){ // First Name, Last Name. - lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Forename + wxT(" ") + ucd->ContactNameArray.Surname); + if (ucd->ContactNameArray.Forename == wxT("") && ucd->ContactNameArray.Surname == wxT("")) + { + lstContacts->SetItem(longSelected, 0, ucd->ContactName); + } + else + { + lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Forename + wxT(" ") + ucd->ContactNameArray.Surname); + } } else if (SortMode == 2){ // Last Name, First Name. - - lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Surname + wxT(", ") + ucd->ContactNameArray.Forename); + + if (ucd->ContactNameArray.Forename == wxT("") && ucd->ContactNameArray.Surname == wxT("")) + { + lstContacts->SetItem(longSelected, 0, wxT(", ") + ucd->ContactName); + } + else + { + lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Surname + wxT(", ") + ucd->ContactNameArray.Forename); + } } else if (SortMode == 3){ // Nickname. - lstContacts->SetItem(longSelected, 0, ucd->ContactNickname); + if (ucd->ContactNickname == wxT("")) + { + lstContacts->SetItem(longSelected, 0, _("(no nickname)")); + } + else + { + lstContacts->SetItem(longSelected, 0, ucd->ContactNickname); + } } else if (SortMode == 4){