mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit metadata dialog: When pasting into the identifiers field if the clipboard contains a URL paste it directly as a URL identifier. Fixes #1938752 [Pasting url identifiers results in Invalid ISBN dialog](https://bugs.launchpad.net/calibre/+bug/1938752)
This commit is contained in:
parent
eb91289242
commit
e208909664
@ -1642,6 +1642,9 @@ class IdentifiersEdit(QLineEdit, ToMetadataMixin):
|
|||||||
identifier_found = self.parse_clipboard_for_identifier()
|
identifier_found = self.parse_clipboard_for_identifier()
|
||||||
if identifier_found:
|
if identifier_found:
|
||||||
return
|
return
|
||||||
|
text = unicode_type(QApplication.clipboard().text()).strip()
|
||||||
|
if text.startswith('http://') or text.startswith('https://'):
|
||||||
|
return self.paste_prefix('url')
|
||||||
try:
|
try:
|
||||||
prefix = gprefs['paste_isbn_prefixes'][0]
|
prefix = gprefs['paste_isbn_prefixes'][0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
@ -251,7 +251,7 @@ class MetadataSingleDialogBase(QDialog):
|
|||||||
self.paste_isbn_button = b = RightClickButton(self)
|
self.paste_isbn_button = b = RightClickButton(self)
|
||||||
b.setToolTip('<p>' +
|
b.setToolTip('<p>' +
|
||||||
_('Paste the contents of the clipboard into the '
|
_('Paste the contents of the clipboard into the '
|
||||||
'identifiers prefixed with isbn:. Or right click, '
|
'identifiers prefixed with isbn: or url:. Or right click, '
|
||||||
'to choose a different prefix.') + '</p>')
|
'to choose a different prefix.') + '</p>')
|
||||||
b.setIcon(QIcon(I('edit-paste.png')))
|
b.setIcon(QIcon(I('edit-paste.png')))
|
||||||
b.clicked.connect(self.identifiers.paste_identifier)
|
b.clicked.connect(self.identifiers.paste_identifier)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user