Example #1
0
 def startNewGame(self):
     self.cleanup()
     setupDialog = SetupDialog(self)
     setupDialog.exec_()
     self.scenarioId = setupDialog.selectedScenarioId()
     self.playerDeckId = setupDialog.selectedDeckId()
     self.setup()
     
     self.prisonAct.setEnabled(self.scenarioId == 2)  # is it Escape From Dol Guldur?
 def startNewGame(self):
     self.cleanup()
     
     if self.isServer:
         setupDialog = SetupDialog(self)
         setupDialog.startButton.setText(QCoreApplication.translate('QObject', 'Ready!'))
         setupDialog.exec_()
         self.scenarioId = setupDialog.selectedScenarioId()
         self.playerDeckId = setupDialog.selectedDeckId()
     else:
         setupDialog = ClientSetupDialog(self)
         setupDialog.exec_()
         self.playerDeckId = setupDialog.selectedDeckId()
     
     data = 'CLIENT:READY\n'
     self.client.sendData(data)
     
     self.changeWindowTitleToWaiting()
Example #3
0
    def showDialog(self, parent):
        
        global currentResolution
        
        self.__parentWindow = parent

        self.__setupDialog = SetupDialog.SetupDialog(parent)
        dlg = self.__setupDialog

        #set values to UI parts
        dlg.buttonOK.Bind(wx.EVT_BUTTON, self.__onClickedOK)
        dlg.buttonCancel.Bind(wx.EVT_BUTTON, self.__onClickedCancel)
        dlg.checkThresAuto.Bind(wx.EVT_CHECKBOX, self.__onThresCheckBoxChanged)
        dlg.buttonChangeResolution.Bind(wx.EVT_BUTTON, self.__onClickResChange)

        dlg.checkboxDutyAuto.Bind(wx.EVT_CHECKBOX, self.__onIsDutyAutoCheckBoxChanged)
        dlg.checkboxDutyAuto.SetValue(isDutyAuto)
        
        
        dlg.checkIsCalibSpeedHigh.SetValue(isCalibSpeedHigh)
        dlg.spinCalibLength.SetValue(calibLength)
        
        dlg.sliderAutoMag.SetValue(dutyAutoMag)
        dlg.spinPWMCapCount.SetValue(pwmCapCount)
        dlg.sliderPWMFreq.SetValue(pwmFreq)
        
        dlg.sliderDutyRa.SetValue(dutyRa)
        dlg.sliderDutyDec.SetValue(dutyDec)

        self.__setupPWMUIVisibility(isDutyAuto)
        

        dlg.spinInitWindowSize.SetValue(searchWindowSizeInit)
        dlg.spinTrackWindowSize.SetValue(searchWindowSizeTrack)
        dlg.checkThresAuto.SetValue(isThresAuto)
        dlg.spinThresValue.SetValue(thresValue)
        dlg.checkResize.SetValue(resizeResolution)
        
        dlg.checkReturnRa.SetValue(ret2OrgPosRa)
        dlg.checkReturnDec.SetValue(ret2OrgPosDec)
        
        
        if currentResolution == None:
            f = self.__availableFormat[0]
            currentResolution = (f.get("WIDTH"), f.get("HEIGHT"))
            
        dlg.textResolution.SetValue(self.__convRes2Text(currentResolution))
        
        if isThresAuto:
            dlg.spinThresValue.Disable()
        else:
            dlg.spinThresValue.Enable()
        
        
            
        dlg.showPreviewBinary.SetValue(isShowPreviewBinary)
        
        self.__isOKClicked = False
        self.__setupDialog.ShowModal()
        if self.__isOKClicked:
            return wx.ID_OK
        else:
            return wx.ID_CANCEL