Logo Search packages:      
Sourcecode: jockey version File versions  Download package

def jockey::ui::AbstractUI::toggle_handler (   self,
  handler 
)

Callback for toggling the handler enable/disable state in the UI.

After this, you need to refresh the UI's handler tree view if this
method returns True.

Definition at line 443 of file ui.py.

00443                                      :
        '''Callback for toggling the handler enable/disable state in the UI.
        
        After this, you need to refresh the UI's handler tree view if this
        method returns True.
        '''
        # check if we can change at all
        ch = handler.can_change()
        if ch:
            self.error_message(self._('Cannot change driver'), ch)
            return False

        en = handler.enabled()

        # construct and ask confirmation question
        if en:
            title = self._('Disable driver?')
            action = self._('_Disable', True)
        else:
            title = self._('Enable driver?')
            action = self._('_Enable', True)

        d = handler.description() or ''
        r = handler.rationale() or ''
        if d and r:
            subtext = d.strip() + '\n\n' + r
        elif d:
            subtext = d
        elif r:
            subtext = r
        else:
            subtext = None
        if not self.confirm_action(title, handler.name(), subtext, action):
            return False

        # go
        if en:
            handler.disable()
        else:
            handler.enable()

        return True

    def install_package(self, package):


Generated by  Doxygen 1.6.0   Back to index