diff --git a/menus.py b/menus.py index 723a8e4..8015a44 100644 --- a/menus.py +++ b/menus.py @@ -39,8 +39,6 @@ class PesterQuirkList(QtGui.QListWidget): self.setDragDropMode(QtGui.QAbstractItemView.InternalMove) def addItem(self, item): - self.connect(self, QtCore.SIGNAL('itemChanged(QListWidgetItem *)'), - self, QtCore.SLOT('changeCheckState()')) item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled) if item.quirk.on: item.setCheckState(2) @@ -48,12 +46,6 @@ class PesterQuirkList(QtGui.QListWidget): item.setCheckState(0) QtGui.QListWidget.addItem(self, item) - @QtCore.pyqtSlot() - def changeCheckState(self): - item = self.currentItem() - if not item: return - item.quirk.quirk["on"] = item.quirk.on = (item.checkState() == QtCore.Qt.Checked) - def currentQuirk(self): return self.item(self.currentRow()) diff --git a/pesterchum.py b/pesterchum.py index d3264f6..f60db5a 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -2290,6 +2290,9 @@ class PesterWindow(MovingWindow): self.quirkmenu.activateWindow() @QtCore.pyqtSlot() def updateQuirks(self): + for i in range(self.quirkmenu.quirkList.count()): + item = self.quirkmenu.quirkList.item(i) + item.quirk.quirk["on"] = item.quirk.on = (item.checkState() == QtCore.Qt.Checked) quirks = pesterQuirks(self.quirkmenu.quirks()) self.userprofile.setQuirks(quirks) self.quirkmenu = None