commit/nvda: norrumar: Prevent empty symbols can be added. Fixed index error when removing non last symbols.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Tue, 11 Nov 2014 06:21:50 -0000

1 new commit in nvda:

https://bitbucket.org/nvdaaddonteam/nvda/commits/275b0b0a1851/
Changeset:   275b0b0a1851
Branch:      t4354
User:        norrumar
Date:        2014-11-11 06:21:11+00:00
Summary:     Prevent empty symbols can be added. Fixed index error when 
removing non last symbols.

Affected #:  1 file

diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
index a7fcce6..bbcb809 100644
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -1601,6 +1601,10 @@ class SpeechSymbolsDialog(SettingsDialog):
                entryDialog=AddSymbolDialog(self)
                if entryDialog.ShowModal()==wx.ID_OK:
                        identifier = entryDialog.identifierTextCtrl.GetValue()
+                       if len(identifier) == 0:
+                               self.symbolsList.SetFocus()
+                               entryDialog.Destroy()
+                               return
                        for index, symbol in enumerate(self.symbols):
                                if identifier == symbol.identifier:
                                        wx.CallAfter(gui.messageBox,_('Symbol 
"%s" is already in customized symbols')%identifier,_("Symbol 
Error"),wx.OK|wx.ICON_ERROR)
@@ -1628,8 +1632,8 @@ class SpeechSymbolsDialog(SettingsDialog):
                index=self.symbolsList.GetFirstSelected()
                symbol = self.symbols[index]
                self.pendingRemovals.append(symbol)
-               del self.symbols[index]
                self.symbolsList.DeleteItem(index)
+               del self.symbols[index]
                self.symbolsList.SetFocus()
 
        def onOk(self, evt):

Repository URL: https://bitbucket.org/nvdaaddonteam/nvda/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

Other related posts:

  • » commit/nvda: norrumar: Prevent empty symbols can be added. Fixed index error when removing non last symbols. - commits-noreply