def updateControlStates(self): """Updates states of buttons, command entry, destination selector, etc...""" apiAccessible = self.bot.get_property('apiAccessible') isRunning = self.bot.get_property('isRunning') self.commandEntry.set_sensitive(isRunning and apiAccessible) self.destinationSelector.set_sensitive(isRunning and apiAccessible) self.startButton.set_sensitive(not isRunning) self.restartButton.set_sensitive(isRunning and apiAccessible) self.shutdownButton.set_sensitive(isRunning and apiAccessible) self.terminateButton.set_sensitive(isRunning) # set bot status indicator status = getBotUIStatus(self.bot) self.statusLabel.set_label(status[0]) self.statusImage.set_property('icon-name', status[1])
def botStatusSetter(column, cell, model, iter): bot = model[iter][BotModel.COLUMN_BOTOBJECT] status = getBotUIStatus(bot) cell.set_property('icon-name', status[1])