X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=tree.py;h=0c58824f898504d4d2315aca8ca79e28c5156a27;hp=3d8196c6ac18bba2b70567aa76904637da9fdea5;hb=3da59380dc0b7589b4302a5f3fe9e31ce6362039;hpb=a8c7144718828c3f7745c054d1e16c100734d9d5 diff --git a/tree.py b/tree.py index 3d8196c..0c58824 100644 --- a/tree.py +++ b/tree.py @@ -750,7 +750,25 @@ class LeftTree(CT.CustomTreeCtrl): def OnRename(self, event): pydata = self.itemdict['pydata'] - print pydata + if 'matrix_name' in pydata : + name = 'matrix_name' + elif 'corpus_name' in pydata : + name = 'corpus_name' + else : + name = 'name' + oldname = pydata[name] + dlg = wx.TextEntryDialog(self, "Please Enter The New Item Name", 'Item Naming', oldname) + if dlg.ShowModal() == wx.ID_OK: + newname = dlg.GetValue() + dlg.Destroy() + pydata[name] = newname + Totconf = DoConf(configfile=pydata['ira']) + conf = Totconf.getoptions() + conf[name] = newname + Totconf.makeoptions(Totconf.getsections(), [conf]) + self.history.update(pydata) + self.SetItemText(self.current, newname) + self.EnsureVisible(self.current) def OnItemBackground(self, event):