Removes the selected elements in the IconView
(self, add_to_undomanager=True)
| 1642 | chooser.destroy() |
| 1643 | |
| 1644 | def clear_selected(self, add_to_undomanager=True): |
| 1645 | """Removes the selected elements in the IconView""" |
| 1646 | if add_to_undomanager: |
| 1647 | self.undomanager.commit("Delete") |
| 1648 | model = self.iconview.get_model() |
| 1649 | selection = self.iconview.get_selected_items() |
| 1650 | selection.sort(reverse=True) |
| 1651 | self.set_unsaved(True) |
| 1652 | with self.render_lock(): |
| 1653 | for path in selection: |
| 1654 | model.remove(model.get_iter(path)) |
| 1655 | path = selection[-1] |
| 1656 | self.iconview.select_path(path) |
| 1657 | if not self.iconview.path_is_selected(path): |
| 1658 | if len(model) > 0: # select the last row |
| 1659 | row = model[-1] |
| 1660 | path = row.path |
| 1661 | self.iconview.select_path(path) |
| 1662 | self.scroll_path = path |
| 1663 | self.update_iconview_geometry() |
| 1664 | self.iv_selection_changed() |
| 1665 | self.iconview.grab_focus() |
| 1666 | self.silent_render() |
| 1667 | self.update_max_zoom_level() |
| 1668 | malloc_trim() |
| 1669 | |
| 1670 | def scroll_to_path2(self, path): |
| 1671 | """scroll_to_path() with modifications. |
no test coverage detected