X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2FfrmPreferences.cpp;h=03bcd5ecb2aec2c606b136ee240d3ee56077f88b;hb=4ecf020f6b1aab7c70d179826e620ad25b815810;hp=2b2f48152bcc01eb8a41a1be3e3e7ccad2e66b17;hpb=0690fc58f73ac6938d29f6df9d66ce96c43516ce;p=xestiaab%2F.git diff --git a/source/frmPreferences.cpp b/source/frmPreferences.cpp index 2b2f481..03bcd5e 100644 --- a/source/frmPreferences.cpp +++ b/source/frmPreferences.cpp @@ -145,14 +145,22 @@ void frmPreferences::ModifyABAccount( wxCommandEvent& event ) wxString AccName; wxString AccType; - wxFileConfig *cfgfile = new wxFileConfig("", "", AccFilename); + // Check if an account has been selected before continuing. - // Get the account name. - lstAccountsIndex = lstAccounts->GetNextItem(lstAccountsIndex, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); + if (lstAccountsIndex == -1){ + + // No account has been selected so exit this subroutine. + + return; + + } + + wxFileConfig *cfgfile = new wxFileConfig("", "", AccFilename); + // Check that the account type is a supported account type. AccType = preferences->accounts.GetAccountType((int)lstAccountsIndex); @@ -164,6 +172,8 @@ void frmPreferences::ModifyABAccount( wxCommandEvent& event ) return; } + + // Get the account name. AccName = preferences->accounts.GetAccountName((int)lstAccountsIndex); @@ -192,6 +202,14 @@ void frmPreferences::ModifyABAccount( wxCommandEvent& event ) } +void frmPreferences::ModifyABAccount( wxMouseEvent& event ) +{ + + wxCommandEvent NullEvent; + ModifyABAccount(NullEvent); + +} + void frmPreferences::DeleteABAccount( wxCommandEvent& event ) { // Display a confirmation dialog to confirm deletion.