MCPcopy
hub / github.com/pdfarranger/pdfarranger / clear_selected

Method clear_selected

pdfarranger/pdfarranger.py:1644–1668  ·  view source on GitHub ↗

Removes the selected elements in the IconView

(self, add_to_undomanager=True)

Source from the content-addressed store, hash-verified

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.

Callers 4

generate_bookletMethod · 0.95
on_action_deleteMethod · 0.95
on_action_cutMethod · 0.95
merge_pagesMethod · 0.95

Calls 8

set_unsavedMethod · 0.95
render_lockMethod · 0.95
iv_selection_changedMethod · 0.95
silent_renderMethod · 0.95
update_max_zoom_levelMethod · 0.95
malloc_trimFunction · 0.85
commitMethod · 0.45

Tested by

no test coverage detected