def _layout_update_states(self): if not self._widgets['state'] and self.unit.STATE: statenav = ListNavigator() statenav.set_tooltips_text( _("Move one step back in the workflow (Ctrl+Shift+Enter)"), \ _("Click to move to a specific state in the workflow"), \ _("Move one step forward in the workflow (Ctrl+Enter)") ) statenav.connect('selection-changed', self._on_state_changed) self._widgets['vbox_right'].pack_end(statenav, expand=False, fill=False) self._widgets['state'] = statenav state_names = self.controller.get_unit_state_names() if not state_names or not self.unit.STATE: widget = self._widgets['state'] if widget: widget.hide() return state_name = state_names[self.unit.get_state_id()] unselectable = state_names.get(0, None) if unselectable: unselectable = [unselectable] self._widgets['state'].set_model( self._create_workflow_liststore(), unselectable=unselectable, select_name=state_name, ) self._widgets['state'].show_all()
def _layout_update_states(self): if not self._widgets['state']: statenav = ListNavigator() statenav.connect('selection-changed', self._on_state_changed) self._widgets['vbox_right'].pack_end(statenav, expand=False, fill=False) self._widgets['state'] = statenav if self.unit is not None: state_names = self.controller.get_unit_state_names() if not state_names: self._widgets['state'].hide() return state_name = state_names[self.unit.get_state_id()] self._widgets['state'].set_model( self._create_workflow_liststore(), select_name=state_name, ) self._widgets['state'].show_all()