~moovida-developers/moovida/account_uuid

« back to all changes in this revision

Viewing changes to elisa-plugins/elisa/plugins/poblesec/main.py

  • Committer: Philippe Normand
  • Date: 2009-09-16 13:19:24 UTC
  • mfrom: (1518.1.6 account)
  • Revision ID: philippe@fluendo.com-20090916131924-ub2t2os3n2poihlr
merge with account

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
        def intro_created(intro):
191
191
            self.intro = intro
192
192
            self.widget.add(intro.widget, layer=pgm.DRAWABLE_NEAR)
193
 
            self.focused_controller = intro
 
193
            self._set_focused_controller(intro)
194
194
            intro.prepare()
195
195
            intro.deferred.addCallback(self._intro_done)
196
196
            return intro.deferred
348
348
            self._create_background(browser.widget)
349
349
            self._load_startup_background()
350
350
 
351
 
            self.focused_controller = browser
 
351
            self._set_focused_controller(browser)
352
352
 
353
353
            self._new_controller_pushed(browser.history.current, None)
354
354
            browser.history.connect('push_controller', self._on_push_controller)
364
364
        dfr.addCallbacks(browser_created, browser_creation_failed)
365
365
        return dfr
366
366
 
 
367
    def _set_focused_controller(self, controller):
 
368
        self.focused_controller = controller
 
369
        self.widget.set_focus_proxy(controller.widget)
 
370
        if self.widget.focus:
 
371
            controller.widget.set_focus()
 
372
 
367
373
    def _handle_win32_copydata(self, result):
368
374
        # On windows, set up a handler for the copydata message
369
375
        # (http://msdn.microsoft.com/en-us/library/ms649011(VS.85).aspx),
1067
1073
        self._overlay_out.apply(self.browser)
1068
1074
        self._background_in.apply(self.current_player)
1069
1075
 
1070
 
        self.focused_controller = self.current_player
1071
 
        self.focused_controller.widget.focus = True
 
1076
        self._set_focused_controller(self.current_player)
1072
1077
 
1073
1078
    def hide_current_player(self):
1074
1079
        self._overlay_in.apply(self.browser)
1075
1080
        self._background_out.apply(self.current_player)
1076
 
        self.focused_controller = self.browser
1077
 
        self.focused_controller.widget.focus = True
 
1081
        self._set_focused_controller(self.browser)
1078
1082
 
1079
1083
    def enable_popups(self, enabled):
1080
1084
        """
1133
1137
            self.widget.add(controller.widget, layer=pgm.DRAWABLE_NEAR)
1134
1138
            controller.widget.regenerate()
1135
1139
            self._background_in.apply(controller)
1136
 
            self.focused_controller = controller
1137
 
            self.focused_controller.widget.focus = True
 
1140
            self._set_focused_controller(controller)
1138
1141
            return controller
1139
1142
 
1140
1143
        dfr = self.frontend.create_controller('/poblesec/modal_popup',
1159
1162
            return defer.fail(AssertionError('No popup to hide.'))
1160
1163
 
1161
1164
        def faded(controller):
1162
 
            self.focused_controller = self.current_controller
1163
 
            self.focused_controller.widget.focus = True
 
1165
            self._set_focused_controller(self.current_controller)
1164
1166
            self.widget.remove(controller.widget)
1165
1167
            self._popup_visible = False
1166
1168
            return controller