Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@QtCore.pyqtSlot(int)
@catch_all
def switch_album(self, index):
self.select_album.emit(self.albums.itemData(index))
@QtCore.pyqtSlot()
@catch_all
def _clicked(self):
self.new_link.emit(self.name)
@QtCore.pyqtSlot()
@catch_all
def editing_finished(self):
self.new_value.emit(self, self.get_value())
@QtCore.pyqtSlot(float, six.text_type)
@catch_all
def upload_progress(self, value, format_):
self.total_progress.setValue(value)
if format_:
self.total_progress.setFormat(format_)
@QtCore.pyqtSlot()
@catch_all
def save(self):
super(ConfigStore, self).save()
@QtCore.pyqtSlot(QtCore.QUrl)
@catch_all
def link_clicked(self, url):
if url.isLocalFile():
url.setScheme('http')
QtGui.QDesktopServices.openUrl(url)
@QtCore.pyqtSlot()
@catch_all
def path_format_finished(self):
if self.source:
self.config_store.set(
self.config_section, 'path_format', self.nm.format_string)
self.show_file_list()
@QtCore.pyqtSlot()
@catch_all
def selection_changed(self):
count = len(self.file_list_widget.selectedItems())
self.selected_count.setText(
translate('ImporterTab', '%n file(s)\nselected', '', count))
if not self.file_copier:
self.move_button.setEnabled(count > 0)
self.copy_button.setEnabled(count > 0)
@QtCore.pyqtSlot()
def get_address(self):
latlng = self.coords.get_value()
self.JavaScript('reverseGeocode({})'.format(latlng))
@QtCore.pyqtSlot()
@catch_all
def auto_creator(self):
name = self.config_store.get('user', 'creator_name')
if not name:
name, OK = QtWidgets.QInputDialog.getText(
self, translate('DescriptiveTab', 'Photini: input name'),
translate('DescriptiveTab', "Please type in the creator's name"),
text=self.config_store.get('user', 'copyright_name', ''))
if OK and name:
self.config_store.set('user', 'creator_name', name)
else:
name = ''
for image in self.image_list.get_selected_images():
image.metadata.creator = name
self._update_widget('creator')