changeset 478:950bfe89ec3d

Updates "All project" time when the entrie time is adjusted. Displays the correct total time.
author Magnus Schieder <mschieder@intevation.de>
date Fri, 11 May 2018 14:27:48 +0200
parents 217630a03b58
children 75131561d098
files getan/nodes.py getan/project.py getan/states.py
diffstat 3 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/getan/nodes.py	Wed May 09 19:06:20 2018 +0200
+++ b/getan/nodes.py	Fri May 11 14:27:48 2018 +0200
@@ -118,6 +118,7 @@
 
     def _get_time(self):
         if self.mode == self.MODES[0]:
+            self.item.update_total()
             return self.item.total
         if self.mode == self.MODES[1]:
             return self.item.year()
--- a/getan/project.py	Wed May 09 19:06:20 2018 +0200
+++ b/getan/project.py	Fri May 11 14:27:48 2018 +0200
@@ -32,6 +32,12 @@
         self.stop = None
         self.open= None
 
+    def update_total(self):
+        total = 0
+        for entry in self.entries:
+            total += (entry.end - entry.start).seconds
+        self.total = total
+
     def year(self):
         total = 0
         now = datetime.now()
--- a/getan/states.py	Wed May 09 19:06:20 2018 +0200
+++ b/getan/states.py	Fri May 11 14:27:48 2018 +0200
@@ -921,6 +921,7 @@
         self.controller.update_entry(entry)
         self.view.node_in_focus().update()
         self.controller.view.proj_list.update_rows()
+        self.controller.project_view.show_total_time()
         return self.exit()
 
     def exit(self):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)