def _showFileSelector(self, response_cb, path, directoryOnly=False): def deleteEvent(fs, event): pass fs = FileSelectorDialog(self.wizard.window, self.wizard.getAdminModel()) fs.connect('response', response_cb) fs.connect('delete-event', deleteEvent) fs.selector.setWorkerName(self.model.worker) fs.selector.setOnlyDirectoriesMode(directoryOnly) fs.setDirectory(path) fs.show_all()
def _select(self): def response(fs, response): fs.hide() if response == gtk.RESPONSE_OK: self.model.properties.directory = fs.getFilename() self._proxy.update("directory") def deleteEvent(fs, event): pass fs = FileSelectorDialog(self.wizard.window, self.wizard.getAdminModel()) fs.connect("response", response) fs.connect("delete-event", deleteEvent) fs.selector.setWorkerName(self.model.worker) fs.setDirectory(self.model.properties.directory) fs.show_all()
def on_select_logfile_clicked(self, button): def response(fs, response): fs.hide() if response == gtk.RESPONSE_OK: filename = os.path.join(fs.getFilename(), 'access.log') self.model.properties.logfile = filename self._proxy.update('logfile') fs = FileSelectorDialog(self.wizard.window, self.wizard.getAdminModel()) fs.connect('response', response) fs.selector.setOnlyDirectoriesMode(True) fs.selector.setWorkerName(self.model.component.worker) directory = os.path.dirname(self.model.properties.logfile) fs.setDirectory(directory) fs.show_all()
def _select(self): def response(fs, response): fs.hide() if response == gtk.RESPONSE_OK: self.model.properties.directory = fs.getFilename() self._proxy.update('directory') def deleteEvent(fs, event): pass fs = FileSelectorDialog(self.wizard.window, self.wizard.getAdminModel()) fs.connect('response', response) fs.connect('delete-event', deleteEvent) fs.selector.setWorkerName(self.model.worker) fs.setDirectory(self.model.properties.directory) fs.show_all()
def _showFileSelector(self, response_cb, location): def deleteEvent(fs, event): pass fs = FileSelectorDialog(self.wizard.window, self.wizard.getAdminModel()) fs.connect('response', response_cb) fs.connect('delete-event', deleteEvent) fs.selector.setWorkerName(self.model.worker) fs.selector.setOnlyDirectoriesMode(False) if location: directory = os.path.dirname(location) else: directory = '/' fs.selector.setDirectory(directory) fs.show_all()