[Getan-commits] [PATCH] Better multi-selection bugfix. Solves mistakes from the old fix. (ca6d11781e2f)

Wald Commits scm-commit at wald.intevation.org
Wed May 9 16:14:28 CEST 2018


# HG changeset patch
# User Magnus Schieder <mschieder at intevation.de>
# Date 1525875136 -7200
# Node ID 0d831a9f547ba5f3ce57f5fffe1a8b7616986191
# Parent  b9e30e55684481d0c9f5d16c959856092f04119f
Better multi-selection bugfix. Solves mistakes from the old fix. (ca6d11781e2f)

 * Moves the deletion of the selection in view.clear().

diff -r b9e30e556844 -r 0d831a9f547b CHANGES
--- 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
diff -r b9e30e556844 -r 0d831a9f547b getan/states.py
--- 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:
diff -r b9e30e556844 -r 0d831a9f547b getan/view.py
--- 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):


More information about the Getan-commits mailing list