changeset 474:0d831a9f547b

Better multi-selection bugfix. Solves mistakes from the old fix. (ca6d11781e2f) * Moves the deletion of the selection in view.clear().
author Magnus Schieder <mschieder@intevation.de>
date Wed, 09 May 2018 16:12:16 +0200
parents b9e30e556844
children 1855b1ef2834
files CHANGES getan/states.py getan/view.py
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Wed May 09 15:13:36 2018 +0200
+++ b/CHANGES	Wed May 09 16:12:16 2018 +0200
@@ -1,7 +1,8 @@
 2.x 20xx-xx-xx UNRELEASED
 
  * Better fix for the multiple selection bug.
-   The multi-selection is deleted when deleting or moving is confirmed.
+   The multiple selection is deleted when deleting or moving is confirmed or
+   when switching to projects.
 
  * Better control of the walker.
    If you move entries and switch back to the projects you get to the project
--- a/getan/states.py	Wed May 09 15:13:36 2018 +0200
+++ b/getan/states.py	Wed May 09 16:12:16 2018 +0200
@@ -592,8 +592,7 @@
                 self.controller.delete_entries(self.entries)
                 new_focus =  self.renew_focus()
                 self.projectlist_state.view.update_rows()
-                # Deletes the selection of entries
-                self.view.selection = []
+                self.view.clear()
             self.view.set_footer_text("", 'entry_footer')
             # avoid creating new DefaultEntryListState and setting focus
             if new_focus:
@@ -660,8 +659,7 @@
             logger.debug("MoveEntryState: move selected entries.")
             self.controller.move_entries(self.entries, self.proj)
             new_focus =  self.renew_focus()
-            # Deletes the selection of entries
-            self.view.selection = []
+            self.view.clear()
             self.view.set_footer_text('', 'entry_footer')
             self.proj = None
             if new_focus:
--- a/getan/view.py	Wed May 09 15:13:36 2018 +0200
+++ b/getan/view.py	Wed May 09 16:12:16 2018 +0200
@@ -141,6 +141,7 @@
         for node in self.selection:
             if node.selected:
                 node.select()
+        self.selection = []
         self.set_focus(0)
 
     def content_focus_changed(self):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)