mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion dialog now saves the preferred input format when it is accepted so subsequent re-conversions of the same book will use the same input format
This commit is contained in:
parent
3f0e2c389c
commit
5cd88d2602
@ -11,7 +11,8 @@ import sys, cPickle
|
|||||||
from PyQt4.Qt import QString, SIGNAL, QAbstractListModel, Qt, QVariant, QFont
|
from PyQt4.Qt import QString, SIGNAL, QAbstractListModel, Qt, QVariant, QFont
|
||||||
|
|
||||||
from calibre.gui2 import ResizableDialog, NONE
|
from calibre.gui2 import ResizableDialog, NONE
|
||||||
from calibre.gui2.convert import GuiRecommendations, save_specifics
|
from calibre.gui2.convert import GuiRecommendations, save_specifics, \
|
||||||
|
load_specifics
|
||||||
from calibre.gui2.convert.single_ui import Ui_Dialog
|
from calibre.gui2.convert.single_ui import Ui_Dialog
|
||||||
from calibre.gui2.convert.metadata import MetadataWidget
|
from calibre.gui2.convert.metadata import MetadataWidget
|
||||||
from calibre.gui2.convert.look_and_feel import LookAndFeelWidget
|
from calibre.gui2.convert.look_and_feel import LookAndFeelWidget
|
||||||
@ -80,6 +81,12 @@ class Config(ResizableDialog, Ui_Dialog):
|
|||||||
preferred_input_format=None, preferred_output_format=None):
|
preferred_input_format=None, preferred_output_format=None):
|
||||||
ResizableDialog.__init__(self, parent)
|
ResizableDialog.__init__(self, parent)
|
||||||
|
|
||||||
|
if preferred_input_format is None and db is not None:
|
||||||
|
recs = load_specifics(db, book_id)
|
||||||
|
if recs:
|
||||||
|
preferred_input_format = recs.get('gui_preferred_input_format',
|
||||||
|
None)
|
||||||
|
|
||||||
self.setup_input_output_formats(db, book_id, preferred_input_format,
|
self.setup_input_output_formats(db, book_id, preferred_input_format,
|
||||||
preferred_input_format)
|
preferred_input_format)
|
||||||
self.db, self.book_id = db, book_id
|
self.db, self.book_id = db, book_id
|
||||||
@ -208,6 +215,7 @@ class Config(ResizableDialog, Ui_Dialog):
|
|||||||
self.opf_path, self.cover_path = self.mw.opf_file, self.mw.cover_file
|
self.opf_path, self.cover_path = self.mw.opf_file, self.mw.cover_file
|
||||||
self._recommendations = recs
|
self._recommendations = recs
|
||||||
if self.db is not None:
|
if self.db is not None:
|
||||||
|
recs['gui_preferred_input_format'] = self.input_format
|
||||||
save_specifics(self.db, self.book_id, recs)
|
save_specifics(self.db, self.book_id, recs)
|
||||||
ResizableDialog.accept(self)
|
ResizableDialog.accept(self)
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ class gui(OptionlessCommand):
|
|||||||
with open('images.qrc', 'wb') as f:
|
with open('images.qrc', 'wb') as f:
|
||||||
f.write(manifest)
|
f.write(manifest)
|
||||||
try:
|
try:
|
||||||
check_call(['pyrcc4', '-o', images, 'images.qrc'])
|
check_call(['pyrcc4', '-py2', '-o', images, 'images.qrc'])
|
||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user