1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

[#179] Pushed the delete-or-exclude folder down from GUI layers to the core.

This commit is contained in:
Virgil Dupras
2011-11-28 14:52:48 -05:00
parent 3342b32882
commit 756190cb8e
3 changed files with 12 additions and 22 deletions

View File

@@ -77,9 +77,15 @@ class DirectoryTree(GUIObject, Tree):
self.app.add_directory(path)
def remove_selected(self):
assert len(self.selected_path) == 1
root_index = self.selected_path[0]
self.app.remove_directory(root_index)
selected_node = self.selected_node
if selected_node is None:
return
if selected_node.parent is self and selected_node.state != DirectoryState.Excluded:
root_index = self.selected_path[0]
self.app.remove_directory(root_index)
else:
newstate = DirectoryState.Normal if selected_node.state == DirectoryState.Excluded else DirectoryState.Excluded
selected_node.state = newstate
def update_all_states(self):
for node in self: