From 77b9956953d1e3abb804d6c266c2c64e7b50d9d2 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 24 Feb 2016 19:58:29 +0000 Subject: [PATCH] Clear frmMain when reloading the list of accounts. --- source/frmMain.cpp | 17 +++++++++++++---- source/frmMain.h | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/source/frmMain.cpp b/source/frmMain.cpp index f7026d8..25cb191 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -464,9 +464,10 @@ void frmMain::OpenPreferences( wxCommandEvent& event) if (ReloadAccounts == TRUE){ // Reload the accounts as a change has been made within - // the application. + // the application and clear the current contact information. this->LoadPreferences(); + this->ResetContactInfo(); } @@ -488,14 +489,14 @@ void frmMain::OpenNewABDialog( wxCommandEvent& event) frameNewAccount->ShowModal(); delete frameNewAccount; frameNewAccount = NULL; - + if (ReloadAccounts == TRUE){ - + // Reload the accounts as a change has been made within // the application. this->LoadPreferences(); - + } } @@ -2820,4 +2821,12 @@ void frmMain::ShowContactMenu( wxMouseEvent& event ){ this->PopupMenu(ContactMenu->MenuPointer(), wxDefaultPosition); +} + +void frmMain::ResetContactInfo(){ + + wxString EmptyPage = wxT(""); + htmContactData->SetPage(EmptyPage); + AccCtrl->SetValue(""); + } \ No newline at end of file diff --git a/source/frmMain.h b/source/frmMain.h index b9ce739..6ae03ea 100644 --- a/source/frmMain.h +++ b/source/frmMain.h @@ -177,6 +177,7 @@ class frmMain : public frmMainADT int ContactEditorUID = 0; int WindowMenuItemID = 0; XABContactMenu *ContactMenu = new XABContactMenu(XABCONTACTMENU_MAIN); + void ResetContactInfo(); protected: // Handlers for frmMainADT events. void QuitApp( wxCloseEvent& event ); -- 2.39.2