\r
class DictionaryEntryDialog(wx.Dialog):\r
\r
- def __init__(self,parent):\r
- super(DictionaryEntryDialog,self).__init__(parent,title=_("Edit dictionary entry"))\r
+ def __init__(self,parent,title=_("Edit dictionary entry")):\r
+ super(DictionaryEntryDialog,self).__init__(parent,title=title)\r
mainSizer=wx.BoxSizer(wx.VERTICAL)\r
settingsSizer=wx.BoxSizer(wx.VERTICAL)\r
settingsSizer.Add(wx.StaticText(self,-1,label=_("&Pattern")))\r
self.dictList.InsertColumn(2,_("Replacement"))\r
self.dictList.InsertColumn(3,_("case sensitive"))\r
self.dictList.InsertColumn(4,_("Regular expression"))\r
+ self.offOn = (_("off"),_("on"))\r
for entry in self.tempSpeechDict:\r
- self.dictList.Append((entry.comment,entry.pattern,entry.replacement,str(entry.caseSensitive),str(entry.regexp)))\r
+ self.dictList.Append((entry.comment,entry.pattern,entry.replacement,self.offOn[int(entry.caseSensitive)],self.offOn[int(entry.regexp)]))\r
self.editingIndex=-1\r
entriesSizer.Add(self.dictList)\r
settingsSizer.Add(entriesSizer)\r
super(DictionaryDialog, self).onOk(evt)\r
\r
def OnAddClick(self,evt):\r
- entryDialog=DictionaryEntryDialog(self)\r
+ entryDialog=DictionaryEntryDialog(self,title=_("Add Dictionary Entry"))\r
if entryDialog.ShowModal()==wx.ID_OK:\r
self.tempSpeechDict.append(speechDictHandler.SpeechDictEntry(entryDialog.patternTextCtrl.GetValue(),entryDialog.replacementTextCtrl.GetValue(),entryDialog.commentTextCtrl.GetValue(),bool(entryDialog.caseSensitiveCheckBox.GetValue()),bool(entryDialog.regexpCheckBox.GetValue())))\r
- self.dictList.Append((entryDialog.commentTextCtrl.GetValue(),entryDialog.patternTextCtrl.GetValue(),entryDialog.replacementTextCtrl.GetValue(),str(bool(entryDialog.caseSensitiveCheckBox.GetValue())),str(bool(entryDialog.regexpCheckBox.GetValue()))))\r
+ self.dictList.Append((entryDialog.commentTextCtrl.GetValue(),entryDialog.patternTextCtrl.GetValue(),entryDialog.replacementTextCtrl.GetValue(),self.offOn[int(entryDialog.caseSensitiveCheckBox.GetValue())],self.offOn[int(entryDialog.regexpCheckBox.GetValue())]))\r
index=self.dictList.GetFirstSelected()\r
while index>=0:\r
self.dictList.Select(index,on=0)\r
self.dictList.SetStringItem(editIndex,0,entryDialog.commentTextCtrl.GetValue())\r
self.dictList.SetStringItem(editIndex,1,entryDialog.patternTextCtrl.GetValue())\r
self.dictList.SetStringItem(editIndex,2,entryDialog.replacementTextCtrl.GetValue())\r
- self.dictList.SetStringItem(editIndex,3,str(bool(entryDialog.caseSensitiveCheckBox.GetValue())))\r
- self.dictList.SetStringItem(editIndex,4,str(bool(entryDialog.regexpCheckBox.GetValue())))\r
+ self.dictList.SetStringItem(editIndex,3,self.offOn[int(entryDialog.caseSensitiveCheckBox.GetValue())])\r
+ self.dictList.SetStringItem(editIndex,4,self.offOn[int(entryDialog.regexpCheckBox.GetValue())])\r
self.dictList.SetFocus()\r
entryDialog.Destroy()\r
\r