changeset 479:75131561d098

Add a redraw function on key Control-L.
author Magnus Schieder <mschieder@intevation.de>
date Wed, 16 May 2018 17:02:37 +0200
parents 950bfe89ec3d
children 22d21f9851f5
files CHANGES INTRODUCTION TODO doc/old_issues.txt getan/controller.py getan/states.py
diffstat 6 files changed, 29 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Fri May 11 14:27:48 2018 +0200
+++ b/CHANGES	Wed May 16 17:02:37 2018 +0200
@@ -1,5 +1,10 @@
 2.x 20xx-xx-xx UNRELEASED
 
+ * Add a redraw function on key Control-L.
+   The screen is completely redrawn. More information can be found in
+   ./doc/old_issues.txt -20180321 BER
+
+
  * Better fix for the multiple selection bug.
    The multiple selection is deleted when deleting or moving is confirmed or
    when switching to projects.
--- a/INTRODUCTION	Fri May 11 14:27:48 2018 +0200
+++ b/INTRODUCTION	Wed May 16 17:02:37 2018 +0200
@@ -30,3 +30,4 @@
                        running).
 | backspace         |  Change key and description of a Project (in ProjectList
                        if no project is running).
+| Control-L         |  Completely redraw the screen.
--- a/TODO	Fri May 11 14:27:48 2018 +0200
+++ b/TODO	Wed May 16 17:02:37 2018 +0200
@@ -1,8 +1,3 @@
-20180321 BER Add a redraw function/key, usually Control-L is used.
-    If the screen gets disorted, e.g. by a background process spilling
-    some stuff on stderror, you want a completely redrawn screen without
-    restarting getan.
-
 20180117 Magnus Schieder
 
   Creating a new database with test data:
--- a/doc/old_issues.txt	Fri May 11 14:27:48 2018 +0200
+++ b/doc/old_issues.txt	Wed May 16 17:02:37 2018 +0200
@@ -1,3 +1,8 @@
+20180321 BER Add a redraw function/key, usually Control-L is used.
+    If the screen gets disorted, e.g. by a background process spilling
+    some stuff on stderror, you want a completely redrawn screen without
+    restarting getan.
+
 20180214 Magnus Schieder
   Reproduced with getan2.1 and getan2.3dev1
 
--- a/getan/controller.py	Fri May 11 14:27:48 2018 +0200
+++ b/getan/controller.py	Wed May 16 17:02:37 2018 +0200
@@ -47,6 +47,12 @@
                                    input_filter=self.input_filter)
         self.loop.run()
 
+    def redraw(self):
+        self.loop.stop()
+        self.loop.start()
+        self.loop.screen_size = None
+        self.loop.draw_screen()
+
     def input_filter(self, input, raw_input):
         if 'window resize' in input:
             self.loop.screen_size = None
--- a/getan/states.py	Fri May 11 14:27:48 2018 +0200
+++ b/getan/states.py	Wed May 16 17:02:37 2018 +0200
@@ -83,6 +83,10 @@
             self.view.switch_project_order()
             return True
 
+        if 'ctrl l' in input:
+            self.controller.redraw()
+            return True
+
         if keys.get_switch_lists() in input:
             if not self.controller.entries_view.rows:
                 return True
@@ -183,6 +187,10 @@
                 PausedProjectsState(self.controller, self.view))
             return True
 
+        if 'ctrl l' in key:
+            self.controller.redraw()
+            return True
+
         if 'backspace' in key:
             if len(self.proj_keys) > 0:
                 self.proj_keys = self.proj_keys[:-1]
@@ -482,6 +490,10 @@
             self.controller.view.set_focus(0)
             return True
 
+        if 'ctrl l' in key:
+            self.controller.redraw()
+            return True
+
         if keys.get_enter() in key:
             return self.select()
         return False
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)