Fix bug #5785
authorRyan Campbell <campbellr@gmail.com>
Sat, 22 May 2010 04:47:56 +0000 (22:47 -0600)
committerRyan Campbell <campbellr@gmail.com>
Sat, 22 May 2010 04:47:56 +0000 (22:47 -0600)
Fix bug "'total sp' counter seems to get messed up when switching
between characters". It seems that we were starting the timer to soon,
which caused the get_is_topmost() method return False when it shouldn't.

Moved the timer creation until after the character sheet is created.
Seems to work now.

package/src/ui/diablo/gui.py
package/src/ui/fremantle/gui.py

index a0b2131..01a00a6 100644 (file)
@@ -371,6 +371,8 @@ class CharacterSheetUI(BaseUI):
         progress_bar.set_fraction(1)
         progress_bar.destroy()
 
+        glib.timeout_add_seconds(self.UPDATE_INTERVAL, self.update_live_sp)
+
     def display_skill_in_training(self, vbox):
         skill = self.controller.get_skill_in_training(self.uid, self.char_id)
         
@@ -422,7 +424,6 @@ class CharacterSheetUI(BaseUI):
         
         self.spps = self.controller.get_spps(self.uid, self.char_id)[0]
 
-        glib.timeout_add_seconds(self.UPDATE_INTERVAL, self.update_live_sp)
 
     def fill_stats(self, box):
 
index ed15197..e887ded 100644 (file)
@@ -372,6 +372,9 @@ class CharacterSheetUI(BaseUI):
         self.win.show_all()
 
         hildon.hildon_gtk_window_set_progress_indicator(self.win, 0)
+        
+        # if we start the timer too early, get_is_topmost() returns False
+        glib.timeout_add_seconds(self.UPDATE_INTERVAL, self.update_live_sp)
 
     def display_skill_in_training(self, vbox):
         skill = self.controller.get_skill_in_training(self.uid, self.char_id)
@@ -424,7 +427,6 @@ class CharacterSheetUI(BaseUI):
         
         self.spps = self.controller.get_spps(self.uid, self.char_id)[0]
 
-        glib.timeout_add_seconds(self.UPDATE_INTERVAL, self.update_live_sp)
 
     def fill_stats(self, box):