def update_collections(self): self.clear() for id_, collection in sorted( user_collections.items(), key=lambda k_v: (locale.strxfrm(string_(k_v[1])), k_v[0])): action = QtWidgets.QWidgetAction(self) action.setDefaultWidget(CollectionCheckBox(self, collection)) self.addAction(action) self.addSeparator() self.refresh_action = self.addAction(_("Refresh List"))
def update_collections(self): self.clear() for id_, collection in sorted(user_collections.items(), key=lambda k_v: (locale.strxfrm(string_(k_v[1])), k_v[0])): action = QtWidgets.QWidgetAction(self) action.setDefaultWidget(CollectionCheckBox(self, collection)) self.addAction(action) self.addSeparator() self.refresh_action = self.addAction(_("Refresh List"))
def update_collections(self): self._ignore_update = True self.clear() self.actions = [] for id_, collection in sorted(user_collections.items(), key=lambda k_v: (locale.strxfrm(str(k_v[1])), k_v[0])): action = QtWidgets.QWidgetAction(self) action.setDefaultWidget(CollectionMenuItem(self, collection)) self.addAction(action) self.actions.append(action) self._ignore_update = False self.addSeparator() self.refresh_action = self.addAction(_("Refresh List")) self.hovered.connect(self.update_highlight)