Fixed renaming in results.

This commit is contained in:
Virgil Dupras 2010-02-12 13:52:40 +01:00
parent 33d44d4d24
commit c3a972d39b
3 changed files with 19 additions and 1 deletions

View File

@ -98,6 +98,9 @@ http://www.hardcoded.net/licenses/hs_license
if (!renamed) {
[Dialogs showMessage:[NSString stringWithFormat:@"The name '%@' already exists.", newName]];
}
else {
[self refreshItemAtPath:path];
}
}
}
else {
@ -139,6 +142,15 @@ http://www.hardcoded.net/licenses/hs_license
}
}
/* don't calls saveEdits and cancelEdits */
- (void)outlineViewDidEndEditing:(HSOutlineView *)outlineView
{
}
- (void)outlineViewCancelsEdition:(HSOutlineView *)outlineView
{
}
/* Python --> Cocoa */
- (void)refresh /* Override */
{

View File

@ -173,7 +173,7 @@ class PyResultOutline(PyOutline):
@signature('c@:@')
def renameSelected_(self, newname):
return self.py.app.rename_selected(newname)
return self.py.rename_selected(newname)
@signature('v@:ic')
def sortBy_ascending_(self, key, asc):

View File

@ -92,6 +92,12 @@ class ResultTree(GUIObject, Tree):
else:
return node.data[column]
def rename_selected(self, newname):
node = self.selected_node
node._data = None
node._data_delta = None
return self.app.rename_selected(newname)
def root_children_counts(self):
# This is a speed optimization for cases where there's a lot of results so that there is
# not thousands of children_count queries when expandAll is called.