diff -r c8e008b8cefe -r 72a826dfcfbb controls/FolderTree.py --- a/controls/FolderTree.py Wed Mar 13 12:34:55 2013 +0900 +++ b/controls/FolderTree.py Wed Jul 31 10:45:07 2013 +0900 @@ -203,19 +203,23 @@ event.Veto() def OnTreeEndLabelEdit(self, event): - old_filepath = self.GetPath(event.GetItem()) - new_filepath = os.path.join(os.path.split(old_filepath)[0], event.GetLabel()) - if new_filepath != old_filepath: - if not os.path.exists(new_filepath): - os.rename(old_filepath, new_filepath) - event.Skip() - else: - message = wx.MessageDialog(self, - _("File '%s' already exists!") % event.GetLabel(), - _("Error"), wx.OK|wx.ICON_ERROR) - message.ShowModal() - message.Destroy() - event.Veto() + new_name = event.GetLabel() + if new_name != "": + old_filepath = self.GetPath(event.GetItem()) + new_filepath = os.path.join(os.path.split(old_filepath)[0], new_name) + if new_filepath != old_filepath: + if not os.path.exists(new_filepath): + os.rename(old_filepath, new_filepath) + event.Skip() + else: + message = wx.MessageDialog(self, + _("File '%s' already exists!") % new_name, + _("Error"), wx.OK|wx.ICON_ERROR) + message.ShowModal() + message.Destroy() + event.Veto() + else: + event.Skip() def OnFilterChanged(self, event): self.CurrentFilter = self.Filters[self.Filter.GetStringSelection()]