def startMonitor():
  camera = Camera()
  actionDict = ActionDict(camera)
  config = Config(
    actionDict,
    getButtons().keys(),
    getClickTypes())
  camera.setConfig(config)

  config.checkConfigFile()

  app = QApplication([])
  camera.initCamera()
  keys = QmKeys()
  buttonTimers = dict()
  for b in getButtons().values():
    buttonTimers[b] = ClickTimer(b, config)
  keys.keyEvent.connect(lambda k, s:
    (k in buttonTimers and buttonTimers[k].keyEvent(s)))
  config.dbusButton.setHandler(
    lambda button: dbusBtnClicked(config, button))
  config.dbusButton.connectButtonDbus()
  config.proximityButton.setHandler(
    lambda state: prxBtnClicked(config, state))
  config.proximityButton.connectProximityButton()
  app.exec_()
 def __init__(self, actionDict,
              actionName, actionParam,
              condName, condParam,
              button, buttonParam, clickType):
   self.actionName = actionName
   self.actionParam = actionParam
   self.condName = condName
   self.condParam = condParam
   self.button = button
   self.buttonParam = buttonParam
   self.key = getButtons()[button]
   self.clickType = clickType
   
   self.actionLambda = self.getLambda(actionDict.getActionLambdaDict(),
     self.actionName, self.actionParam)
   self.condLambda = self.getLambda(actionDict.getConditionLambdaDict(),
     self.condName, self.condParam)
  def __init__(self, actionDict):
    self.actionDict = actionDict

    self.buttonBox = self.makeComboBox(getButtons().keys())
    self.buttonParamBox = QLineEdit()
    self.clickTypeBox = self.makeComboBox(getClickTypes())
    self.actionNameBox = self.makeComboBox(
      self.actionDict.getActionLambdaDict().keys())
    self.actionParamBox = QLineEdit()
    self.conditionNameBox = self.makeComboBox(
      self.actionDict.getConditionLambdaDict().keys())
    self.conditionParamBox = QLineEdit()

    self.connectComboBox(self.buttonBox, self.setButtonIndex)
    self.connectComboBox(self.clickTypeBox, self.setClickTypeIndex)
    self.connectComboBox(self.actionNameBox, self.setActionNameIndex)
    self.connectComboBox(self.conditionNameBox, self.setConditionNameIndex)

    self.setButtonIndex(0)
    self.setClickTypeIndex(0)
    self.setActionNameIndex(0)
    self.setConditionNameIndex(0)
 def __init__(self):
   self.actionDict = ActionDict(None)
   self.config = Config(self.actionDict, getButtons().keys(), getClickTypes())
   self.configPanel = ConfigPanel(self.actionDict)