def browseFile_(self, sender): panel = NSOpenPanel.openPanel() panel.setTitle_(NSLocalizedString("Select a Picture", "Label")) if panel.runModalForTypes_(NSArray.arrayWithObjects_("png", "tiff", "jpeg", "jpg", "tif")) == NSOKButton: path = unicode(panel.filename()) self.cropAndAddImage(path)
def browseFile_(self, sender): panel = NSOpenPanel.openPanel() panel.setTitle_(NSLocalizedString("Select a Picture", "Label")) if panel.runModalForTypes_( NSArray.arrayWithObjects_("png", "tiff", "jpeg", "jpg", "tif")) == NSOKButton: path = str(panel.filename()) self.cropAndAddImage(path)
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 awakeFromNib(self): self.participantsTable.registerForDraggedTypes_(NSArray.arrayWithObjects_("x-blink-sip-uri"))
def awakeFromNib(self): self.registerForDraggedTypes_( NSArray.arrayWithObjects_("x-blink-audio-session", "x-blink-sip-uri", NSFilenamesPboardType))
def awakeFromNib(self): self.registerForDraggedTypes_(NSArray.arrayWithObjects_("x-blink-audio-session", "x-blink-sip-uri", NSFilenamesPboardType))