Example #1
0
    def userButtonClicked_(self, sender):
        self.window.close()

        if sender.tag() == 1:
            NSApp.stopModalWithCode_(1)
        else:
            NSApp.stopModalWithCode_(0)
Example #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
 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)
 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)
Example #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)
 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)
 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)
 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)
Example #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)
Example #10
0
 def UseButtonClicked_(self, sender):
     self.window.close()
     NSApp.stopModalWithCode_(1)
Example #11
0
 def cropWindowButtonClicked_(self, sender):
     if sender.tag() == 1: # cancel
         NSApp.stopModalWithCode_(NSCancelButton)
     elif sender.tag() == 2: # crop
         NSApp.stopModalWithCode_(NSOKButton)
 def cancelClicked_(self, sender):
     self._participants = []
     self.participantsTable.reloadData()
     NSApp.stopModalWithCode_(NSCancelButton)
 def windowShouldClose_(self, sender):
     NSApp.stopModalWithCode_(NSCancelButton)
     return True
 def okClicked_(self, sender):
     NSApp.stopModalWithCode_(NSOKButton)
 def cancelClicked_(self, sender):
     self._participants = []
     self.participantsTable.reloadData()
     self.removeAllParticipants.setHidden_(True)
     NSApp.stopModalWithCode_(NSCancelButton)
Example #16
0
 def cancelClicked_(self, sender):
     NSApp.stopModalWithCode_(NSCancelButton)
Example #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)
Example #18
0
 def UseButtonClicked_(self, sender):
     self.window.close()
     NSApp.stopModalWithCode_(1)
Example #19
0
 def cropWindowButtonClicked_(self, sender):
     if sender.tag() == 1:  # cancel
         NSApp.stopModalWithCode_(NSCancelButton)
     elif sender.tag() == 2:  # crop
         NSApp.stopModalWithCode_(NSOKButton)
 def _NH_SIPAccountManagerDidAddAccount(self, sender, data):
     NotificationCenter().remove_observer(self, name='SIPAccountManagerDidAddAccount')
     if self.window.isVisible():
         self.window.makeKeyAndOrderFront_(None)
         NSApp.stopModalWithCode_(NSCancelButton)
 def windowShouldClose_(self, sender):
     self.startDeallocTimer()
     NSApp.stopModalWithCode_(NSCancelButton)
     return True
 def textView_doCommandBySelector_(self, textView, selector):
     if selector == "insertNewline:" and self.inputText == textView:
         NSApp.stopModalWithCode_(NSOKButton)
 def okClicked_(self, sender):
     if self.validateConference():
         NSApp.stopModalWithCode_(NSOKButton)
 def okClicked_(self, sender):
     if self.validateConference():
         NSApp.stopModalWithCode_(NSOKButton)
 def cancelClicked_(self, sender):
     self._participants = []
     self.participantsTable.reloadData()
     self.removeAllParticipants.setHidden_(True)
     NSApp.stopModalWithCode_(NSCancelButton)
 def cancelClicked_(self, sender):
     self._participants = []
     self.participantsTable.reloadData()
     NSApp.stopModalWithCode_(NSCancelButton)
 def textView_doCommandBySelector_(self, textView, selector):
     if selector == "insertNewline:" and self.inputText == textView:
         NSApp.stopModalWithCode_(NSOKButton)
 def cancelClicked_(self, sender):
     NSApp.stopModalWithCode_(NSCancelButton)
 def _NH_SIPAccountManagerDidAddAccount(self, sender, data):
     NotificationCenter().remove_observer(self, name='SIPAccountManagerDidAddAccount')
     if self.window.isVisible():
         self.window.makeKeyAndOrderFront_(None)
         NSApp.stopModalWithCode_(NSCancelButton)
Example #30
0
 def okClicked_(self, sender):
     NSApp.stopModalWithCode_(NSOKButton)
 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)
Example #32
0
 def windowShouldClose_(self, sender):
     NSApp.stopModalWithCode_(NSCancelButton)
     return True
 def windowShouldClose_(self, sender):
     self.startDeallocTimer()
     NSApp.stopModalWithCode_(NSCancelButton)
     return True