コード例 #1
0
ファイル: PhotoPicker.py プロジェクト: uditha-atukorala/blink
    def userButtonClicked_(self, sender):
        self.window.close()

        if sender.tag() == 1:
            NSApp.stopModalWithCode_(1)
        else:
            NSApp.stopModalWithCode_(0)
コード例 #2
0
    def windowWillClose_(self, notification):
        self.captureView.hide()
        NSApp.stopModalWithCode_(0)

        settings = SIPSimpleSettings()
        try:
            settings.video.auto_rotate_cameras = self.previous_auto_rotate_cameras
            settings.save()
        except AttributeError:
            pass
コード例 #3
0
 def okClicked_(self, sender):
     if not len(self._participants):
         NSRunAlertPanel(
             NSLocalizedString("Add Participants to the Conference",
                               "Window title"),
             NSLocalizedString("Please add at least one participant. ",
                               "Label"),
             NSLocalizedString("OK", "Button title"), None, None)
     else:
         NSApp.stopModalWithCode_(NSOKButton)
コード例 #4
0
 def buttonClicked_(self, sender):
     if sender.tag() == 20: # ch icon
         panel = NSOpenPanel.openPanel()
         panel.setTitle_(NSLocalizedString("Select Contact Icon", "Window title"))
         if panel.runModalForTypes_(NSArray.arrayWithObjects_("tiff", "png", "jpeg", "jpg")) == NSFileHandlingPanelOKButton:
             path = panel.filename()
             image = NSImage.alloc().initWithContentsOfFile_(path)
             self.photoImage.setImage_(image)
     elif sender.tag() == 21: # clear icon
         self.photoImage.setImage_(self.defaultPhotoImage)
     elif sender.tag() == 10:
         self.startDeallocTimer()
         NSApp.stopModalWithCode_(NSOKButton)
     else:
         self.startDeallocTimer()
         NSApp.stopModalWithCode_(NSCancelButton)
コード例 #5
0
    def windowWillClose_(self, notification):
        if self.captureDecompressedVideoOutput != None:
            self.captureDecompressedVideoOutput.setDelegate_(None)
            self.captureDecompressedVideoOutput = None

        if self.captureSession is not None:
            self.captureSession.stopRunning()
            self.captureSession = None

        if self.captureDeviceInput:
            device = self.captureDeviceInput.device()
            if device.isOpen():
                device.close()
            self.captureDeviceInput = None

        NSApp.stopModalWithCode_(0)
コード例 #6
0
 def buttonClicked_(self, sender):
     if sender.tag() == 20: # ch icon
         panel = NSOpenPanel.openPanel()
         panel.setTitle_(NSLocalizedString("Select Contact Icon", "Window title"))
         if panel.runModalForTypes_(NSArray.arrayWithObjects_("tiff", "png", "jpeg", "jpg")) == NSFileHandlingPanelOKButton:
             path = panel.filename()
             image = NSImage.alloc().initWithContentsOfFile_(path)
             self.photoImage.setImage_(image)
     elif sender.tag() == 21: # clear icon
         self.photoImage.setImage_(self.defaultPhotoImage)
     elif sender.tag() == 10:
         self.startDeallocTimer()
         NSApp.stopModalWithCode_(NSOKButton)
     else:
         self.startDeallocTimer()
         NSApp.stopModalWithCode_(NSCancelButton)
コード例 #7
0
 def buttonClicked_(self, sender):
     if sender == self.nextButton:
         if self.validate():
             if self.radioMatrix.selectedCell().tag() == 1:
                 if self.addExistingAccount():
                     NSApp.stopModalWithCode_(NSOKButton)
             else:
                 if self.createNewAccount():
                     NSApp.stopModalWithCode_(NSOKButton)
     else:
         NSApp.stopModalWithCode_(NSCancelButton)
コード例 #8
0
 def buttonClicked_(self, sender):
     if sender == self.nextButton:
         if self.validate():
             if self.radioMatrix.selectedCell().tag() == 1:
                 if self.addExistingAccount():
                     NSApp.stopModalWithCode_(NSOKButton)
             else:
                 if self.createNewAccount():
                     NSApp.stopModalWithCode_(NSOKButton)
     else:
         NSApp.stopModalWithCode_(NSCancelButton)
コード例 #9
0
 def CancelButtonClicked_(self, sender):
     if self.timer is not None and self.timer.isValid():
         self.timer.invalidate()
         self.timer = None
     self.window.close()
     NSApp.stopModalWithCode_(0)
コード例 #10
0
 def UseButtonClicked_(self, sender):
     self.window.close()
     NSApp.stopModalWithCode_(1)
コード例 #11
0
 def cropWindowButtonClicked_(self, sender):
     if sender.tag() == 1: # cancel
         NSApp.stopModalWithCode_(NSCancelButton)
     elif sender.tag() == 2: # crop
         NSApp.stopModalWithCode_(NSOKButton)
コード例 #12
0
 def cancelClicked_(self, sender):
     self._participants = []
     self.participantsTable.reloadData()
     NSApp.stopModalWithCode_(NSCancelButton)
コード例 #13
0
 def windowShouldClose_(self, sender):
     NSApp.stopModalWithCode_(NSCancelButton)
     return True
コード例 #14
0
 def okClicked_(self, sender):
     NSApp.stopModalWithCode_(NSOKButton)
コード例 #15
0
 def cancelClicked_(self, sender):
     self._participants = []
     self.participantsTable.reloadData()
     self.removeAllParticipants.setHidden_(True)
     NSApp.stopModalWithCode_(NSCancelButton)
コード例 #16
0
 def cancelClicked_(self, sender):
     NSApp.stopModalWithCode_(NSCancelButton)
コード例 #17
0
 def CancelButtonClicked_(self, sender):
     if self.timer is not None and self.timer.isValid():
         self.timer.invalidate()
         self.timer = None
     self.window.close()
     NSApp.stopModalWithCode_(0)
コード例 #18
0
 def UseButtonClicked_(self, sender):
     self.window.close()
     NSApp.stopModalWithCode_(1)
コード例 #19
0
 def cropWindowButtonClicked_(self, sender):
     if sender.tag() == 1:  # cancel
         NSApp.stopModalWithCode_(NSCancelButton)
     elif sender.tag() == 2:  # crop
         NSApp.stopModalWithCode_(NSOKButton)
コード例 #20
0
 def _NH_SIPAccountManagerDidAddAccount(self, sender, data):
     NotificationCenter().remove_observer(self, name='SIPAccountManagerDidAddAccount')
     if self.window.isVisible():
         self.window.makeKeyAndOrderFront_(None)
         NSApp.stopModalWithCode_(NSCancelButton)
コード例 #21
0
 def windowShouldClose_(self, sender):
     self.startDeallocTimer()
     NSApp.stopModalWithCode_(NSCancelButton)
     return True
コード例 #22
0
 def textView_doCommandBySelector_(self, textView, selector):
     if selector == "insertNewline:" and self.inputText == textView:
         NSApp.stopModalWithCode_(NSOKButton)
コード例 #23
0
 def okClicked_(self, sender):
     if self.validateConference():
         NSApp.stopModalWithCode_(NSOKButton)
コード例 #24
0
 def okClicked_(self, sender):
     if self.validateConference():
         NSApp.stopModalWithCode_(NSOKButton)
コード例 #25
0
 def cancelClicked_(self, sender):
     self._participants = []
     self.participantsTable.reloadData()
     self.removeAllParticipants.setHidden_(True)
     NSApp.stopModalWithCode_(NSCancelButton)
コード例 #26
0
 def cancelClicked_(self, sender):
     self._participants = []
     self.participantsTable.reloadData()
     NSApp.stopModalWithCode_(NSCancelButton)
コード例 #27
0
 def textView_doCommandBySelector_(self, textView, selector):
     if selector == "insertNewline:" and self.inputText == textView:
         NSApp.stopModalWithCode_(NSOKButton)
コード例 #28
0
 def cancelClicked_(self, sender):
     NSApp.stopModalWithCode_(NSCancelButton)
コード例 #29
0
 def _NH_SIPAccountManagerDidAddAccount(self, sender, data):
     NotificationCenter().remove_observer(self, name='SIPAccountManagerDidAddAccount')
     if self.window.isVisible():
         self.window.makeKeyAndOrderFront_(None)
         NSApp.stopModalWithCode_(NSCancelButton)
コード例 #30
0
 def okClicked_(self, sender):
     NSApp.stopModalWithCode_(NSOKButton)
コード例 #31
0
 def okClicked_(self, sender):
     if not len(self._participants):
         NSRunAlertPanel("Add Participants to the Conference", "Please add at least one participant.",
             "OK", None, None)
     else:
         NSApp.stopModalWithCode_(NSOKButton)
コード例 #32
0
 def windowShouldClose_(self, sender):
     NSApp.stopModalWithCode_(NSCancelButton)
     return True
コード例 #33
0
 def windowShouldClose_(self, sender):
     self.startDeallocTimer()
     NSApp.stopModalWithCode_(NSCancelButton)
     return True