mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Disable hyphenation on windows xp as Qt WebKit barfs on soft hyphens on windows XP
This commit is contained in:
parent
d670183073
commit
3ba2bdd0e1
@ -34,6 +34,7 @@ isfrozen = hasattr(sys, 'frozen')
|
||||
isunix = isosx or islinux
|
||||
isportable = os.environ.get('CALIBRE_PORTABLE_BUILD', None) is not None
|
||||
ispy3 = sys.version_info.major > 2
|
||||
isxp = iswindows and sys.getwindowsversion().major < 6
|
||||
|
||||
try:
|
||||
preferred_encoding = locale.getpreferredencoding()
|
||||
|
@ -11,7 +11,7 @@ import zipfile
|
||||
|
||||
from PyQt4.Qt import QFont, QVariant, QDialog
|
||||
|
||||
from calibre.constants import iswindows
|
||||
from calibre.constants import iswindows, isxp
|
||||
from calibre.utils.config import Config, StringConfig
|
||||
from calibre.gui2.shortcuts import ShortcutConfig
|
||||
from calibre.gui2.viewer.config_ui import Ui_Dialog
|
||||
@ -113,7 +113,10 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
||||
p = self.tabs.widget(1)
|
||||
p.layout().addWidget(self.shortcut_config)
|
||||
self.opt_fit_images.setChecked(opts.fit_images)
|
||||
|
||||
if isxp:
|
||||
self.hyphenate.setVisible(False)
|
||||
self.hyphenate_default_lang.setVisible(False)
|
||||
self.hyphenate_label.setVisible(False)
|
||||
|
||||
def accept(self, *args):
|
||||
if self.shortcut_config.is_editing:
|
||||
|
@ -196,7 +196,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<widget class="QLabel" name="hyphenate_label">
|
||||
<property name="text">
|
||||
<string>Default &language for hyphenation:</string>
|
||||
</property>
|
||||
|
@ -23,6 +23,7 @@ from calibre.gui2.viewer.position import PagePosition
|
||||
from calibre.gui2.viewer.config import config, ConfigDialog
|
||||
from calibre.ebooks.oeb.display.webview import load_html
|
||||
from calibre.utils.config import tweaks
|
||||
from calibre.constants import isxp
|
||||
# }}}
|
||||
|
||||
def load_builtin_fonts():
|
||||
@ -163,7 +164,8 @@ class Document(QWebPage): # {{{
|
||||
|
||||
@pyqtSignature("")
|
||||
def init_hyphenate(self):
|
||||
if self.hyphenate and getattr(self, 'loaded_lang', ''):
|
||||
# Qt fails to render soft hyphens correctly on windows xp
|
||||
if not isxp and self.hyphenate and getattr(self, 'loaded_lang', ''):
|
||||
self.javascript('do_hyphenation("%s")'%self.loaded_lang)
|
||||
|
||||
def _pass_json_value_getter(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user