~ubuntu-branches/ubuntu/lucid/hamster-applet/lucid-proposed

« back to all changes in this revision

Viewing changes to src/hamster/widgets/activityentry.py

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2010-09-06 01:31:34 UTC
  • mfrom: (1.2.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100906013134-wtzn81wdx5en03cn
Tags: 2.30.2-0ubuntu1
* New upstream release. (LP: #629609)
* Fixes a bug that made hamster-applet always use some of the CPU,
  draining battery. (LP: #620113)

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
        self.connect("focus-out-event", self._on_focus_out_event)
93
93
        self.connect("changed", self._on_text_changed)
94
94
        self.connect("parent-set", self._on_parent_set)
 
95
        self._parent_click_watcher = None # bit lame but works
95
96
 
96
97
        runtime.dispatcher.add_handler('activity_updated', self.after_activity_update)
97
98
 
99
100
        self.populate_suggestions()
100
101
 
101
102
    def hide_popup(self):
 
103
        if self._parent_click_watcher and self.get_toplevel().handler_is_connected(self._parent_click_watcher):
 
104
            self.get_toplevel().disconnect(self._parent_click_watcher)
 
105
            self._parent_click_watcher = None
102
106
        self.popup.hide()
103
107
 
104
108
    def show_popup(self):
107
111
            self.hide_popup()
108
112
            return
109
113
 
 
114
        if not self._parent_click_watcher:
 
115
            self._parent_click_watcher = self.get_toplevel().connect("button-press-event", self._on_focus_out_event)
 
116
 
110
117
        activity = stuff.parse_activity_input(self.filter)
111
118
        time = ''
112
119
        if activity.start_time: