Bug fix: Turn on/off individual quirks on pressing OK
This commit is contained in:
parent
641673fb6c
commit
5b3d6e2570
2 changed files with 3 additions and 8 deletions
8
menus.py
8
menus.py
|
@ -39,8 +39,6 @@ class PesterQuirkList(QtGui.QListWidget):
|
||||||
self.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
|
self.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
|
||||||
|
|
||||||
def addItem(self, item):
|
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)
|
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled)
|
||||||
if item.quirk.on:
|
if item.quirk.on:
|
||||||
item.setCheckState(2)
|
item.setCheckState(2)
|
||||||
|
@ -48,12 +46,6 @@ class PesterQuirkList(QtGui.QListWidget):
|
||||||
item.setCheckState(0)
|
item.setCheckState(0)
|
||||||
QtGui.QListWidget.addItem(self, item)
|
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):
|
def currentQuirk(self):
|
||||||
return self.item(self.currentRow())
|
return self.item(self.currentRow())
|
||||||
|
|
||||||
|
|
|
@ -2290,6 +2290,9 @@ class PesterWindow(MovingWindow):
|
||||||
self.quirkmenu.activateWindow()
|
self.quirkmenu.activateWindow()
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def updateQuirks(self):
|
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())
|
quirks = pesterQuirks(self.quirkmenu.quirks())
|
||||||
self.userprofile.setQuirks(quirks)
|
self.userprofile.setQuirks(quirks)
|
||||||
self.quirkmenu = None
|
self.quirkmenu = None
|
||||||
|
|
Loading…
Reference in a new issue