def executeCapture(self): self.photoView.setHidden_(False) self.captureView.setHidden_(True) self.previewButton.setHidden_(False) self.countdownCheckbox.setHidden_(True) self.captureButton.setHidden_(True) self.useButton.setEnabled_(True) if self.captureSession is not None: self.captureImage() NSSound.soundNamed_("Grab").play() self.captureSession.stopRunning()
def executeTimerCapture_(self, timer): if self.countdown_counter == 1: self.executeCapture() self.countdownProgress.stopAnimation_(None) self.countdownCheckbox.setHidden_(True) self.countdownProgress.setHidden_(True) self.timer.invalidate() self.timer = None else: self.countdown_counter = self.countdown_counter - 1 NSSound.soundNamed_("Tink").play() self.countdownProgress.setDoubleValue_(self.countdown_counter)
def executeTimerCapture_(self, timer): if self.countdown_counter == 1: self.executeCapture() self.countdownProgress.stopAnimation_(None) self.countdownCheckbox.setHidden_(True) self.mirrorButton.setHidden_(True) self.countdownProgress.setHidden_(True) self.timer.invalidate() self.timer = None else: self.countdown_counter = self.countdown_counter - 1 NSSound.soundNamed_("Tink").play() self.countdownProgress.setDoubleValue_(self.countdown_counter)
def present(self): """Present the Alert, giving up after configured time.. Returns: Int result code, based on PyObjC enums. See NSAlert Class reference, but result should be one of: User clicked the cancel button: NSAlertFirstButtonReturn = 1000 Alert timed out: NSRunAbortedResponse = -1001 """ if self.timer: NSRunLoop.currentRunLoop().addTimer_forMode_(self.timer, NSModalPanelRunLoopMode) # Start a Cocoa application by getting the shared app object. # Make the python app the active app so alert is noticed. app = NSApplication.sharedApplication() app.activateIgnoringOtherApps_(True) if self.alert_sound: sound = NSSound.soundNamed_(self.alert_sound).play() result = self.runModal() # pylint: disable=no-member print result return result
def present(self): """Present the Alert, giving up after configured time.. Returns: Int result code, based on PyObjC enums. See NSAlert Class reference, but result should be one of: User clicked the cancel button: NSAlertFirstButtonReturn = 1000 Alert timed out: NSRunAbortedResponse = -1001 """ if self.timer: NSRunLoop.currentRunLoop().addTimer_forMode_( self.timer, NSModalPanelRunLoopMode) # Start a Cocoa application by getting the shared app object. # Make the python app the active app so alert is noticed. app = NSApplication.sharedApplication() app.activateIgnoringOtherApps_(True) if self.alert_sound: sound = NSSound.soundNamed_(self.alert_sound).play() result = self.runModal() # pylint: disable=no-member print result return result
def executeCapture(self): self.captureView.getSnapshot() NSSound.soundNamed_("Grab").play()