mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
9af2fea710
commit
d11b9b6f29
@ -16,3 +16,9 @@ vprefs.defaults['main_window_state'] = None
|
|||||||
vprefs.defaults['main_window_geometry'] = None
|
vprefs.defaults['main_window_geometry'] = None
|
||||||
vprefs.defaults['old_prefs_migrated'] = False
|
vprefs.defaults['old_prefs_migrated'] = False
|
||||||
vprefs.defaults['bookmarks_sort'] = 'title'
|
vprefs.defaults['bookmarks_sort'] = 'title'
|
||||||
|
|
||||||
|
|
||||||
|
def get_session_pref(name, default=None, group='standalone_misc_settings'):
|
||||||
|
sd = vprefs['session_data']
|
||||||
|
g = sd.get(group, {}) if group else sd
|
||||||
|
return g.get(name, default)
|
||||||
|
@ -15,7 +15,7 @@ from calibre import as_unicode, prints
|
|||||||
from calibre.constants import FAKE_PROTOCOL, VIEWER_APP_UID, islinux, iswindows
|
from calibre.constants import FAKE_PROTOCOL, VIEWER_APP_UID, islinux, iswindows
|
||||||
from calibre.gui2 import Application, error_dialog, setup_gui_option_parser
|
from calibre.gui2 import Application, error_dialog, setup_gui_option_parser
|
||||||
from calibre.gui2.viewer.ui import EbookViewer, is_float
|
from calibre.gui2.viewer.ui import EbookViewer, is_float
|
||||||
from calibre.gui2.viewer.web_view import get_session_pref, vprefs
|
from calibre.gui2.viewer.config import get_session_pref, vprefs
|
||||||
from calibre.ptempfile import reset_base_dir
|
from calibre.ptempfile import reset_base_dir
|
||||||
from calibre.utils.config import JSONConfig
|
from calibre.utils.config import JSONConfig
|
||||||
from calibre.utils.ipc import RC, viewer_socket_address
|
from calibre.utils.ipc import RC, viewer_socket_address
|
||||||
|
@ -14,8 +14,9 @@ from PyQt5.QtWebEngineWidgets import QWebEnginePage
|
|||||||
|
|
||||||
from calibre.constants import in_develop_mode, isosx
|
from calibre.constants import in_develop_mode, isosx
|
||||||
from calibre.gui2 import elided_text
|
from calibre.gui2 import elided_text
|
||||||
|
from calibre.gui2.viewer.config import get_session_pref
|
||||||
from calibre.gui2.viewer.shortcuts import index_to_key_sequence
|
from calibre.gui2.viewer.shortcuts import index_to_key_sequence
|
||||||
from calibre.gui2.viewer.web_view import get_session_pref, set_book_path, vprefs
|
from calibre.gui2.viewer.web_view import set_book_path, vprefs
|
||||||
from calibre.gui2.widgets2 import Dialog
|
from calibre.gui2.widgets2 import Dialog
|
||||||
from calibre.utils.icu import primary_sort_key
|
from calibre.utils.icu import primary_sort_key
|
||||||
from polyglot.builtins import iteritems
|
from polyglot.builtins import iteritems
|
||||||
|
@ -28,6 +28,7 @@ from calibre.gui2.viewer.annotations import (
|
|||||||
AnnotationsSaveWorker, annotations_dir, parse_annotations
|
AnnotationsSaveWorker, annotations_dir, parse_annotations
|
||||||
)
|
)
|
||||||
from calibre.gui2.viewer.bookmarks import BookmarkManager
|
from calibre.gui2.viewer.bookmarks import BookmarkManager
|
||||||
|
from calibre.gui2.viewer.config import get_session_pref, vprefs
|
||||||
from calibre.gui2.viewer.convert_book import clean_running_workers, prepare_book
|
from calibre.gui2.viewer.convert_book import clean_running_workers, prepare_book
|
||||||
from calibre.gui2.viewer.highlights import HighlightsPanel
|
from calibre.gui2.viewer.highlights import HighlightsPanel
|
||||||
from calibre.gui2.viewer.integration import (
|
from calibre.gui2.viewer.integration import (
|
||||||
@ -38,9 +39,7 @@ from calibre.gui2.viewer.overlay import LoadingOverlay
|
|||||||
from calibre.gui2.viewer.search import SearchPanel
|
from calibre.gui2.viewer.search import SearchPanel
|
||||||
from calibre.gui2.viewer.toc import TOC, TOCSearch, TOCView
|
from calibre.gui2.viewer.toc import TOC, TOCSearch, TOCView
|
||||||
from calibre.gui2.viewer.toolbars import ActionsToolBar
|
from calibre.gui2.viewer.toolbars import ActionsToolBar
|
||||||
from calibre.gui2.viewer.web_view import (
|
from calibre.gui2.viewer.web_view import WebView, get_path_for_name, set_book_path
|
||||||
WebView, get_path_for_name, get_session_pref, set_book_path, vprefs
|
|
||||||
)
|
|
||||||
from calibre.utils.date import utcnow
|
from calibre.utils.date import utcnow
|
||||||
from calibre.utils.img import image_from_path
|
from calibre.utils.img import image_from_path
|
||||||
from calibre.utils.ipc.simple_worker import WorkerError
|
from calibre.utils.ipc.simple_worker import WorkerError
|
||||||
|
@ -200,12 +200,6 @@ class UrlSchemeHandler(QWebEngineUrlSchemeHandler):
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
def get_session_pref(name, default=None, group='standalone_misc_settings'):
|
|
||||||
sd = vprefs['session_data']
|
|
||||||
g = sd.get(group, {}) if group else sd
|
|
||||||
return g.get(name, default)
|
|
||||||
|
|
||||||
|
|
||||||
def create_profile():
|
def create_profile():
|
||||||
ans = getattr(create_profile, 'ans', None)
|
ans = getattr(create_profile, 'ans', None)
|
||||||
if ans is None:
|
if ans is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user