All pastes #637038 Raw Edit

ahigerd

public python v1 · immutable
#637038 ·published 2007-07-28 13:50 UTC
rendered paste body
class Options(QtGui.QMainWindow):    def toggleOP(self, str):        if int(get_setting(str)):            print '* disabling %s...' % str            set_setting(str, '0')        else:            print '* enabling  %s...' % str            set_setting(str, '1')    SysTray.optionsMenu = QtGui.QMenu()    signalMapper = QtCore.QSignalMapper()    QtCore.QObject.connect(signalMapper, QtCore.SIGNAL("mapped(const QString &)"), self, QtCore.SIGNAL("toggleOP(const QString &)"));    for option in options:        actionOP = SysTray.optionsMenu.addAction(options[option][2])        QtCore.QObject.connect(actionOP, QtCore.SIGNAL("triggered()"), signalMapper, QtCore.SLOT("map()"))        signalMapper.setMapping(actionOP, options[option][0])