mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #797
This commit is contained in:
parent
b5b6f10c48
commit
37cc4b13ea
@ -48,10 +48,7 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
|
|||||||
self.gui_mono_family.setModel(self.font_family_model)
|
self.gui_mono_family.setModel(self.font_family_model)
|
||||||
self.load_saved_global_defaults()
|
self.load_saved_global_defaults()
|
||||||
|
|
||||||
def __init__(self, window, db, row):
|
def populate_list(self):
|
||||||
QDialog.__init__(self, window)
|
|
||||||
Ui_LRFSingleDialog.__init__(self)
|
|
||||||
self.setupUi(self)
|
|
||||||
self.__w = []
|
self.__w = []
|
||||||
self.__w.append(QIcon(':/images/dialog_information.svg'))
|
self.__w.append(QIcon(':/images/dialog_information.svg'))
|
||||||
self.item1 = QListWidgetItem(self.__w[-1], _("Metadata"), self.categoryList)
|
self.item1 = QListWidgetItem(self.__w[-1], _("Metadata"), self.categoryList)
|
||||||
@ -61,6 +58,12 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
|
|||||||
self.item3 = QListWidgetItem(self.__w[-1], _('Page Setup'), self.categoryList)
|
self.item3 = QListWidgetItem(self.__w[-1], _('Page Setup'), self.categoryList)
|
||||||
self.__w.append(QIcon(':/images/chapters.svg'))
|
self.__w.append(QIcon(':/images/chapters.svg'))
|
||||||
self.item4 = QListWidgetItem(self.__w[-1], _('Chapter Detection'), self.categoryList)
|
self.item4 = QListWidgetItem(self.__w[-1], _('Chapter Detection'), self.categoryList)
|
||||||
|
|
||||||
|
def __init__(self, window, db, row):
|
||||||
|
QDialog.__init__(self, window)
|
||||||
|
Ui_LRFSingleDialog.__init__(self)
|
||||||
|
self.setupUi(self)
|
||||||
|
self.populate_list()
|
||||||
self.categoryList.setCurrentRow(0)
|
self.categoryList.setCurrentRow(0)
|
||||||
QObject.connect(self.categoryList, SIGNAL('itemEntered(QListWidgetItem *)'),
|
QObject.connect(self.categoryList, SIGNAL('itemEntered(QListWidgetItem *)'),
|
||||||
self.show_category_help)
|
self.show_category_help)
|
||||||
@ -383,15 +386,15 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
|
|||||||
self.cmdline = [unicode(i) for i in cmdline]
|
self.cmdline = [unicode(i) for i in cmdline]
|
||||||
else:
|
else:
|
||||||
Settings().set('LRF conversion defaults', cmdline)
|
Settings().set('LRF conversion defaults', cmdline)
|
||||||
print self.cmdline
|
|
||||||
QDialog.accept(self)
|
QDialog.accept(self)
|
||||||
|
|
||||||
class LRFBulkDialog(LRFSingleDialog):
|
class LRFBulkDialog(LRFSingleDialog):
|
||||||
|
|
||||||
def __init__(self, window):
|
def __init__(self, window):
|
||||||
QDialog.__init__(self, window)
|
QDialog.__init__(self, window)
|
||||||
Ui_LRFSingleDialog.__init__(self)
|
Ui_LRFSingleDialog.__init__(self)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
self.populate_list()
|
||||||
|
|
||||||
self.categoryList.takeItem(0)
|
self.categoryList.takeItem(0)
|
||||||
self.stack.removeWidget(self.stack.widget(0))
|
self.stack.removeWidget(self.stack.widget(0))
|
||||||
@ -401,7 +404,14 @@ class LRFBulkDialog(LRFSingleDialog):
|
|||||||
self.setWindowTitle(_('Bulk convert ebooks to LRF'))
|
self.setWindowTitle(_('Bulk convert ebooks to LRF'))
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
self.cmdline = self.cmdline = [unicode(i) for i in self.build_commandline()]
|
self.cmdline = [unicode(i) for i in self.build_commandline()]
|
||||||
|
for meta in ('--title', '--author', '--publisher', '--comment'):
|
||||||
|
try:
|
||||||
|
index = self.cmdline.index(meta)
|
||||||
|
self.cmdline[index:index+2] = []
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
|
|
||||||
self.cover_file = None
|
self.cover_file = None
|
||||||
QDialog.accept(self)
|
QDialog.accept(self)
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QStackedWidget" name="stack" >
|
<widget class="QStackedWidget" name="stack" >
|
||||||
<property name="currentIndex" >
|
<property name="currentIndex" >
|
||||||
<number>0</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="metadata_page" >
|
<widget class="QWidget" name="metadata_page" >
|
||||||
<property name="geometry" >
|
<property name="geometry" >
|
||||||
@ -1167,5 +1167,21 @@ p, li { white-space: pre-wrap; }
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>gui_disable_chapter_detection</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>gui_chapter_attr</receiver>
|
||||||
|
<slot>setDisabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel" >
|
||||||
|
<x>344</x>
|
||||||
|
<y>107</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel" >
|
||||||
|
<x>489</x>
|
||||||
|
<y>465</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -746,6 +746,15 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
for i, row in enumerate([r.row() for r in rows]):
|
for i, row in enumerate([r.row() for r in rows]):
|
||||||
cmdline = list(d.cmdline)
|
cmdline = list(d.cmdline)
|
||||||
|
mi = self.library_view.model().db.get_metadata(row)
|
||||||
|
if mi.title:
|
||||||
|
cmdline.extend(['--title', mi.title])
|
||||||
|
if mi.authors:
|
||||||
|
cmdline.extend(['--author', ','.join(mi.authors)])
|
||||||
|
if mi.publisher:
|
||||||
|
cmdline.extend(['--publisher', mi.publisher])
|
||||||
|
if mi.comments:
|
||||||
|
cmdline.extend(['--comment', mi.comments])
|
||||||
data = None
|
data = None
|
||||||
for fmt in LRF_PREFERRED_SOURCE_FORMATS:
|
for fmt in LRF_PREFERRED_SOURCE_FORMATS:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user