def on_remove_thing_i_dislike(self, widget): thing = self.tidl_popup_menu.get_user() if thing not in self.np.config.sections["interests"]["dislikes"]: return self.dislikes_model.remove(self.dislikes[thing]) del self.dislikes[thing] self.np.config.sections["interests"]["dislikes"].remove(thing) self.np.config.write_configuration() self.np.queue.put(slskmessages.RemoveThingIHate(thing))
def remove_thing_i_hate(self, item): if not item and not isinstance(item, str): return False if item not in self.config.sections["interests"]["dislikes"]: return False self.config.sections["interests"]["dislikes"].remove(item) self.config.write_configuration() self.queue.append(slskmessages.RemoveThingIHate(item)) return True
def on_dislike_recommendation(self, widget): thing = widget.get_parent().get_user() if widget.get_active() and thing not in self.np.config.sections["interests"]["dislikes"]: self.np.config.sections["interests"]["dislikes"].append(thing) self.dislikes[thing] = self.dislikes_model.append([thing]) self.np.config.write_configuration() self.np.queue.put(slskmessages.AddThingIHate(thing)) elif not widget.get_active() and thing in self.np.config.sections["interests"]["dislikes"]: self.dislikes_model.remove(self.dislikes[thing]) del self.dislikes[thing] self.np.config.sections["interests"]["dislikes"].remove(thing) self.np.config.write_configuration() self.np.queue.put(slskmessages.RemoveThingIHate(thing))
def on_dislike_recommendation(self, action, state, thing=None): if thing is None: thing = self.r_popup_menu.get_user() if state.get_boolean() and \ thing and thing not in config.sections["interests"]["dislikes"]: config.sections["interests"]["dislikes"].append(thing) self.dislikes[thing] = self.dislikes_model.insert_with_valuesv( -1, self.dislikes_column_numbers, [thing]) config.write_configuration() self.np.queue.append(slskmessages.AddThingIHate(thing)) elif not state and \ thing and thing in config.sections["interests"]["dislikes"]: self.dislikes_model.remove(self.dislikes[thing]) del self.dislikes[thing] config.sections["interests"]["dislikes"].remove(thing) config.write_configuration() self.np.queue.append(slskmessages.RemoveThingIHate(thing)) action.set_state(state)