--- a/controls/FolderTree.py Tue Jun 04 09:56:03 2013 +0200
+++ b/controls/FolderTree.py Tue Jun 04 17:29:31 2013 +0200
@@ -203,19 +203,23 @@
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)
- message = wx.MessageDialog(self,
- _("File '%s' already exists!") % event.GetLabel(),
- _("Error"), wx.OK|wx.ICON_ERROR)
+ new_name = event.GetLabel() + 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) + message = wx.MessageDialog(self, + _("File '%s' already exists!") % new_name, + _("Error"), wx.OK|wx.ICON_ERROR) def OnFilterChanged(self, event):
self.CurrentFilter = self.Filters[self.Filter.GetStringSelection()]