mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1927537 [Clicking Copy in the Auto merged window copies explanation text](https://bugs.launchpad.net/calibre/+bug/1927537)
This commit is contained in:
parent
88ba140db9
commit
fabf0e621f
@ -456,10 +456,10 @@ def question_dialog(parent, title, msg, det_msg='', show_copy_button=False,
|
|||||||
|
|
||||||
|
|
||||||
def info_dialog(parent, title, msg, det_msg='', show=False,
|
def info_dialog(parent, title, msg, det_msg='', show=False,
|
||||||
show_copy_button=True):
|
show_copy_button=True, only_copy_details=False):
|
||||||
from calibre.gui2.dialogs.message_box import MessageBox
|
from calibre.gui2.dialogs.message_box import MessageBox
|
||||||
d = MessageBox(MessageBox.INFO, title, msg, det_msg, parent=parent,
|
d = MessageBox(MessageBox.INFO, title, msg, det_msg, parent=parent,
|
||||||
show_copy_button=show_copy_button)
|
show_copy_button=show_copy_button, only_copy_details=only_copy_details)
|
||||||
|
|
||||||
if show:
|
if show:
|
||||||
return d.exec_()
|
return d.exec_()
|
||||||
|
@ -585,7 +585,7 @@ class AddAction(InterfaceAction):
|
|||||||
_('Incoming book formats were processed and merged into your '
|
_('Incoming book formats were processed and merged into your '
|
||||||
'calibre database according to your auto-merge '
|
'calibre database according to your auto-merge '
|
||||||
'settings. Click "Show details" to see the list of merged books.'),
|
'settings. Click "Show details" to see the list of merged books.'),
|
||||||
det_msg='\n'.join(lines), show=True)
|
det_msg='\n'.join(lines), show=True, only_copy_details=True)
|
||||||
|
|
||||||
if adder.number_of_books_added > 0 or adder.merged_books:
|
if adder.number_of_books_added > 0 or adder.merged_books:
|
||||||
# The formats of the current book could have changed if
|
# The formats of the current book could have changed if
|
||||||
|
@ -83,9 +83,11 @@ class MessageBox(QDialog): # {{{
|
|||||||
show_copy_button=True,
|
show_copy_button=True,
|
||||||
parent=None, default_yes=True,
|
parent=None, default_yes=True,
|
||||||
yes_text=None, no_text=None, yes_icon=None, no_icon=None,
|
yes_text=None, no_text=None, yes_icon=None, no_icon=None,
|
||||||
add_abort_button=False
|
add_abort_button=False,
|
||||||
|
only_copy_details=False
|
||||||
):
|
):
|
||||||
QDialog.__init__(self, parent)
|
QDialog.__init__(self, parent)
|
||||||
|
self.only_copy_details = only_copy_details
|
||||||
self.aborted = False
|
self.aborted = False
|
||||||
if q_icon is None:
|
if q_icon is None:
|
||||||
icon = {
|
icon = {
|
||||||
@ -170,11 +172,10 @@ class MessageBox(QDialog): # {{{
|
|||||||
self.resize(self.sizeHint())
|
self.resize(self.sizeHint())
|
||||||
|
|
||||||
def copy_to_clipboard(self, *args):
|
def copy_to_clipboard(self, *args):
|
||||||
QApplication.clipboard().setText(
|
text = self.det_msg.toPlainText()
|
||||||
'calibre, version %s\n%s: %s\n\n%s' %
|
if not self.only_copy_details:
|
||||||
(__version__, unicode_type(self.windowTitle()),
|
text = f'calibre, version {__version__}\n{self.windowTitle()}: {self.msg.text()}\n\n{text}'
|
||||||
unicode_type(self.msg.text()),
|
QApplication.clipboard().setText(text)
|
||||||
unicode_type(self.det_msg.toPlainText())))
|
|
||||||
if hasattr(self, 'ctc_button'):
|
if hasattr(self, 'ctc_button'):
|
||||||
self.ctc_button.setText(_('Copied'))
|
self.ctc_button.setText(_('Copied'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user