mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5341 (Bug when clicking the magic wand icon in html -> * conversion dialog.)
This commit is contained in:
parent
054c8a8e1a
commit
1fa22384c2
@ -184,6 +184,8 @@ class EbookIterator(object):
|
|||||||
|
|
||||||
if processed or plumber.input_fmt.lower() in ('pdb', 'pdf', 'rb') and \
|
if processed or plumber.input_fmt.lower() in ('pdb', 'pdf', 'rb') and \
|
||||||
not hasattr(self.pathtoopf, 'manifest'):
|
not hasattr(self.pathtoopf, 'manifest'):
|
||||||
|
if hasattr(self.pathtoopf, 'manifest'):
|
||||||
|
self.pathtoopf = write_oebbook(self.pathtoopf, self.base)
|
||||||
self.pathtoopf = create_oebbook(self.log, self.pathtoopf, plumber.opts,
|
self.pathtoopf = create_oebbook(self.log, self.pathtoopf, plumber.opts,
|
||||||
plumber.input_plugin)
|
plumber.input_plugin)
|
||||||
if hasattr(self.pathtoopf, 'manifest'):
|
if hasattr(self.pathtoopf, 'manifest'):
|
||||||
|
@ -461,7 +461,7 @@ class FileDialog(QObject):
|
|||||||
|
|
||||||
def get_files(self):
|
def get_files(self):
|
||||||
if self.selected_files is None:
|
if self.selected_files is None:
|
||||||
return tuple(os.path.abspath(qstring_to_unicode(i)) for i in self.fd.selectedFiles())
|
return tuple(os.path.abspath(unicode(i)) for i in self.fd.selectedFiles())
|
||||||
return tuple(self.selected_files)
|
return tuple(self.selected_files)
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,12 +7,12 @@ __docformat__ = 'restructuredtext en'
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from PyQt4.QtCore import SIGNAL, Qt
|
from PyQt4.QtCore import SIGNAL, Qt
|
||||||
from PyQt4.QtGui import QDialog, QWidget, QDialogButtonBox, QFileDialog, \
|
from PyQt4.QtGui import QDialog, QWidget, QDialogButtonBox, \
|
||||||
QBrush, QTextCursor, QTextEdit
|
QBrush, QTextCursor, QTextEdit
|
||||||
|
|
||||||
from calibre.gui2.convert.regex_builder_ui import Ui_RegexBuilder
|
from calibre.gui2.convert.regex_builder_ui import Ui_RegexBuilder
|
||||||
from calibre.gui2.convert.xexp_edit_ui import Ui_Form as Ui_Edit
|
from calibre.gui2.convert.xexp_edit_ui import Ui_Form as Ui_Edit
|
||||||
from calibre.gui2 import error_dialog
|
from calibre.gui2 import error_dialog, choose_files
|
||||||
from calibre.ebooks.oeb.iterator import EbookIterator
|
from calibre.ebooks.oeb.iterator import EbookIterator
|
||||||
from calibre.gui2.dialogs.choose_format import ChooseFormatDialog
|
from calibre.gui2.dialogs.choose_format import ChooseFormatDialog
|
||||||
|
|
||||||
@ -94,9 +94,10 @@ class RegexBuilder(QDialog, Ui_RegexBuilder):
|
|||||||
|
|
||||||
def button_clicked(self, button):
|
def button_clicked(self, button):
|
||||||
if button == self.button_box.button(QDialogButtonBox.Open):
|
if button == self.button_box.button(QDialogButtonBox.Open):
|
||||||
name = QFileDialog.getOpenFileName(self, _('Open book'), _('~'))
|
files = choose_files(self, 'regexp tester dialog', _('Open book'),
|
||||||
if name:
|
select_only_single_file=True)
|
||||||
self.open_book(unicode(name))
|
if files:
|
||||||
|
self.open_book(files[0])
|
||||||
if button == self.button_box.button(QDialogButtonBox.Ok):
|
if button == self.button_box.button(QDialogButtonBox.Ok):
|
||||||
self.accept()
|
self.accept()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user