X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2FfrmMain.cpp;h=c32e61dca8975ce2dc1ad5f5437fabe7392a7dc7;hp=e9ce30477bc121d14b98ef591b3f4684a882de40;hb=7f33f83780a10b4f4083f5950412f1924f3639a6;hpb=974a0d586c5480559439d4756c3ce5fb3876da0c diff --git a/source/frmMain.cpp b/source/frmMain.cpp index e9ce304..c32e61d 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -428,7 +428,7 @@ void frmMain::QuitApp() if (SaveWindowPos == TRUE){ - wxRect frmMainPos = this->GetRect(); + wxRect frmMainPos = GetRect(); cfgfile->Write(wxT("WindowPositionX"), frmMainPos.GetX()); cfgfile->Write(wxT("WindowPositionY"), frmMainPos.GetY()); @@ -440,7 +440,7 @@ void frmMain::QuitApp() delete cfgfile; cfgfile = NULL; - //Everything closed... exit. + // Everything closed... exit. std::exit(0); @@ -497,7 +497,7 @@ void frmMain::OpenPreferences( wxCommandEvent& event) // Reload the accounts as a change has been made within // the application and clear the current contact information. - this->LoadPreferences(); + this->LoadPreferences(true); this->ResetContactInfo(); } @@ -522,7 +522,7 @@ void frmMain::OpenNewABDialog( wxCommandEvent& event) // Reload the accounts as a change has been made within // the application. - this->LoadPreferences(); + this->LoadPreferences(true); } @@ -1108,7 +1108,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]; } @@ -1426,11 +1426,11 @@ void frmMain::LoadPreferences( wxActivateEvent& event) // Load the preferences. - this->LoadPreferences(); + this->LoadPreferences(true); } -void frmMain::LoadPreferences(){ +void frmMain::LoadPreferences(bool skipWindowSizeReload){ // Load the preferences. @@ -1438,13 +1438,20 @@ void frmMain::LoadPreferences(){ 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")); bool HideLocalABs = preferences.GetBoolData(wxT("HideLocalAddressBooks")); bool UseBackgroundContactColour = preferences.GetBoolData(wxT("UseBackgroundContactColour")); - if (SaveWindowPos == true){ + if (SaveWindowPos == true && skipWindowSizeReload == false){ this->SetSize(preferences.GetMainWindowData()); @@ -1830,7 +1837,7 @@ void frmMain::SetupForm(){ ciicon_png.LoadFile(ciextstream, wxBITMAP_TYPE_PNG); wxMemoryFSHandler::AddFile(wxT("ciext.png"), ciicon_png, wxBITMAP_TYPE_PNG); - LoadPreferences(); + LoadPreferences(false); } @@ -1955,8 +1962,8 @@ void frmMain::RevealContact(wxCommandEvent& event){ if (uc->ContactAccount == AccountAccDirList[i]){ - treAccounts->SelectItem(nextChild, TRUE); - AccCtrl->SetText(treAccounts->GetItemText(nextChild)); + treAccounts->SelectItem(nextChild, TRUE); + AccCtrl->SetText(treAccounts->GetItemText(nextChild)); }