X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2FfrmPreferences.cpp;h=03bcd5ecb2aec2c606b136ee240d3ee56077f88b;hp=2b2f48152bcc01eb8a41a1be3e3e7ccad2e66b17;hb=176323555ae58da5fec1ac843e0c613a0b9dabba;hpb=458cff8813367583466a3d208140573ce9d9c561 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.