mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix settings in the ToC Editor tool being forgotten when calibre is closed
This commit is contained in:
parent
69c8b3eddb
commit
865447c071
@ -8,10 +8,11 @@ import sys
|
|||||||
import textwrap
|
import textwrap
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from qt.core import (
|
from qt.core import (
|
||||||
QApplication, QCheckBox, QCursor, QDialog, QDialogButtonBox, QFrame, QGridLayout,
|
QAbstractItemView, QApplication, QCheckBox, QCursor, QDialog, QDialogButtonBox,
|
||||||
QIcon, QInputDialog, QItemSelectionModel, QKeySequence, QLabel, QMenu,
|
QEvent, QFrame, QGridLayout, QIcon, QInputDialog, QItemSelectionModel,
|
||||||
QPushButton, QScrollArea, QSize, QSizePolicy, QStackedWidget, Qt, QAbstractItemView,
|
QKeySequence, QLabel, QMenu, QPushButton, QScrollArea, QSize, QSizePolicy,
|
||||||
QToolButton, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget, pyqtSignal, QEvent
|
QStackedWidget, Qt, QToolButton, QTreeWidget, QTreeWidgetItem, QVBoxLayout,
|
||||||
|
QWidget, pyqtSignal
|
||||||
)
|
)
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
@ -21,12 +22,13 @@ from calibre.ebooks.oeb.polish.toc import (
|
|||||||
TOC, add_id, commit_toc, from_files, from_links, from_xpaths, get_toc
|
TOC, add_id, commit_toc, from_files, from_links, from_xpaths, get_toc
|
||||||
)
|
)
|
||||||
from calibre.gui2 import (
|
from calibre.gui2 import (
|
||||||
Application, error_dialog, gprefs, info_dialog, question_dialog, set_app_uid
|
Application, error_dialog, info_dialog, question_dialog, set_app_uid
|
||||||
)
|
)
|
||||||
from calibre.gui2.convert.xpath_wizard import XPathEdit
|
from calibre.gui2.convert.xpath_wizard import XPathEdit
|
||||||
from calibre.gui2.progress_indicator import ProgressIndicator
|
from calibre.gui2.progress_indicator import ProgressIndicator
|
||||||
from calibre.gui2.toc.location import ItemEdit
|
from calibre.gui2.toc.location import ItemEdit
|
||||||
from calibre.ptempfile import reset_base_dir
|
from calibre.ptempfile import reset_base_dir
|
||||||
|
from calibre.utils.config import JSONConfig
|
||||||
from calibre.utils.lock import ExclusiveFile
|
from calibre.utils.lock import ExclusiveFile
|
||||||
from calibre.utils.logging import GUILog
|
from calibre.utils.logging import GUILog
|
||||||
from polyglot.builtins import map, range, unicode_type
|
from polyglot.builtins import map, range, unicode_type
|
||||||
@ -974,6 +976,10 @@ class TOCView(QWidget): # {{{
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
|
te_prefs = JSONConfig('toc-editor')
|
||||||
|
|
||||||
|
|
||||||
class TOCEditor(QDialog): # {{{
|
class TOCEditor(QDialog): # {{{
|
||||||
|
|
||||||
explode_done = pyqtSignal(object)
|
explode_done = pyqtSignal(object)
|
||||||
@ -981,7 +987,7 @@ class TOCEditor(QDialog): # {{{
|
|||||||
|
|
||||||
def __init__(self, pathtobook, title=None, parent=None, prefs=None):
|
def __init__(self, pathtobook, title=None, parent=None, prefs=None):
|
||||||
QDialog.__init__(self, parent)
|
QDialog.__init__(self, parent)
|
||||||
self.prefs = prefs or gprefs
|
self.prefs = prefs or te_prefs
|
||||||
self.pathtobook = pathtobook
|
self.pathtobook = pathtobook
|
||||||
self.working = True
|
self.working = True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user