mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sync to trunk
This commit is contained in:
commit
381b5a0607
@ -22,7 +22,7 @@ def string_to_authors(raw):
|
|||||||
|
|
||||||
def authors_to_string(authors):
|
def authors_to_string(authors):
|
||||||
if authors is not None:
|
if authors is not None:
|
||||||
return ' & '.join([a.replace('&', '&&') for a in authors])
|
return ' & '.join([a.replace('&', '&&') for a in authors if a])
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ def get_metadata(stream, stream_type='lrf', use_libprs_metadata=False):
|
|||||||
# The regex is meant to match the standard format filenames are written
|
# The regex is meant to match the standard format filenames are written
|
||||||
# in: title_-_author_number.extension
|
# in: title_-_author_number.extension
|
||||||
base.smart_update(metadata_from_filename(name, re.compile(
|
base.smart_update(metadata_from_filename(name, re.compile(
|
||||||
'^(?P<title>[^\s]+?)_-_(?P<author>[^\s]+?)_+\d+')))
|
r'^(?P<title>\S+?)_-_(?P<author>\S+?)_+\d+')))
|
||||||
if base.title:
|
if base.title:
|
||||||
base.title = base.title.replace('_', ' ')
|
base.title = base.title.replace('_', ' ')
|
||||||
if base.authors:
|
if base.authors:
|
||||||
|
@ -23,7 +23,6 @@ from calibre import LoggingInterface
|
|||||||
from calibre.translations.dynamic import translate
|
from calibre.translations.dynamic import translate
|
||||||
from calibre.startup import get_lang
|
from calibre.startup import get_lang
|
||||||
|
|
||||||
XML_PARSER = etree.XMLParser(recover=True)
|
|
||||||
XML_NS = 'http://www.w3.org/XML/1998/namespace'
|
XML_NS = 'http://www.w3.org/XML/1998/namespace'
|
||||||
XHTML_NS = 'http://www.w3.org/1999/xhtml'
|
XHTML_NS = 'http://www.w3.org/1999/xhtml'
|
||||||
OPF1_NS = 'http://openebook.org/namespaces/oeb-package/1.0/'
|
OPF1_NS = 'http://openebook.org/namespaces/oeb-package/1.0/'
|
||||||
@ -140,8 +139,7 @@ class Logger(LoggingInterface, object):
|
|||||||
class AbstractContainer(object):
|
class AbstractContainer(object):
|
||||||
def read_xml(self, path):
|
def read_xml(self, path):
|
||||||
return etree.fromstring(
|
return etree.fromstring(
|
||||||
self.read(path), parser=XML_PARSER,
|
self.read(path), base_url=os.path.dirname(path))
|
||||||
base_url=os.path.dirname(path))
|
|
||||||
|
|
||||||
class DirContainer(AbstractContainer):
|
class DirContainer(AbstractContainer):
|
||||||
def __init__(self, rootdir):
|
def __init__(self, rootdir):
|
||||||
@ -334,15 +332,15 @@ class Manifest(object):
|
|||||||
if self.oeb.encoding is not None:
|
if self.oeb.encoding is not None:
|
||||||
data = data.decode(self.oeb.encoding, 'replace')
|
data = data.decode(self.oeb.encoding, 'replace')
|
||||||
try:
|
try:
|
||||||
data = etree.fromstring(data, parser=XML_PARSER)
|
data = etree.fromstring(data)
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
data = html.fromstring(data)
|
data = html.fromstring(data)
|
||||||
data = etree.tostring(data, encoding=unicode)
|
data = etree.tostring(data, encoding=unicode)
|
||||||
data = etree.fromstring(data, parser=XML_PARSER)
|
data = etree.fromstring(data)
|
||||||
if namespace(data.tag) != XHTML_NS:
|
if namespace(data.tag) != XHTML_NS:
|
||||||
data.attrib['xmlns'] = XHTML_NS
|
data.attrib['xmlns'] = XHTML_NS
|
||||||
data = etree.tostring(data, encoding=unicode)
|
data = etree.tostring(data, encoding=unicode)
|
||||||
data = etree.fromstring(data, parser=XML_PARSER)
|
data = etree.fromstring(data)
|
||||||
for meta in self.META_XP(data):
|
for meta in self.META_XP(data):
|
||||||
meta.getparent().remove(meta)
|
meta.getparent().remove(meta)
|
||||||
return data
|
return data
|
||||||
@ -355,7 +353,7 @@ class Manifest(object):
|
|||||||
if self.media_type in OEB_DOCS:
|
if self.media_type in OEB_DOCS:
|
||||||
data = self._force_xhtml(data)
|
data = self._force_xhtml(data)
|
||||||
elif self.media_type[-4:] in ('+xml', '/xml'):
|
elif self.media_type[-4:] in ('+xml', '/xml'):
|
||||||
data = etree.fromstring(data, parser=XML_PARSER)
|
data = etree.fromstring(data)
|
||||||
self._data = data
|
self._data = data
|
||||||
return data
|
return data
|
||||||
def fset(self, value):
|
def fset(self, value):
|
||||||
@ -788,7 +786,7 @@ class OEBBook(object):
|
|||||||
for tag in ('manifest', 'spine', 'tours', 'guide'):
|
for tag in ('manifest', 'spine', 'tours', 'guide'):
|
||||||
for element in opf.xpath(tag):
|
for element in opf.xpath(tag):
|
||||||
nroot.append(element)
|
nroot.append(element)
|
||||||
return etree.fromstring(etree.tostring(nroot), parser=XML_PARSER)
|
return etree.fromstring(etree.tostring(nroot))
|
||||||
|
|
||||||
def _read_opf(self, opfpath):
|
def _read_opf(self, opfpath):
|
||||||
opf = self.container.read_xml(opfpath)
|
opf = self.container.read_xml(opfpath)
|
||||||
|
@ -277,7 +277,10 @@ class Style(object):
|
|||||||
def _apply_style_attr(self):
|
def _apply_style_attr(self):
|
||||||
attrib = self._element.attrib
|
attrib = self._element.attrib
|
||||||
if 'style' in attrib:
|
if 'style' in attrib:
|
||||||
style = CSSStyleDeclaration(attrib['style'])
|
css = attrib['style'].strip()
|
||||||
|
if css.startswith(';'):
|
||||||
|
css = css[1:]
|
||||||
|
style = CSSStyleDeclaration(css)
|
||||||
self._style.update(self._stylizer.flatten_style(style))
|
self._style.update(self._stylizer.flatten_style(style))
|
||||||
|
|
||||||
def _has_parent(self):
|
def _has_parent(self):
|
||||||
|
@ -6,7 +6,7 @@ from PyQt4.QtCore import QVariant, QFileInfo, QObject, SIGNAL, QBuffer, Qt, QSiz
|
|||||||
QByteArray, QLocale, QUrl, QTranslator, QCoreApplication, \
|
QByteArray, QLocale, QUrl, QTranslator, QCoreApplication, \
|
||||||
QModelIndex
|
QModelIndex
|
||||||
from PyQt4.QtGui import QFileDialog, QMessageBox, QPixmap, QFileIconProvider, \
|
from PyQt4.QtGui import QFileDialog, QMessageBox, QPixmap, QFileIconProvider, \
|
||||||
QIcon, QTableView, QDialogButtonBox, QApplication
|
QIcon, QTableView, QDialogButtonBox, QApplication, QDialog
|
||||||
|
|
||||||
ORG_NAME = 'KovidsBrain'
|
ORG_NAME = 'KovidsBrain'
|
||||||
APP_UID = 'libprs500'
|
APP_UID = 'libprs500'
|
||||||
@ -394,6 +394,19 @@ def pixmap_to_data(pixmap, format='JPEG'):
|
|||||||
pixmap.save(buf, format)
|
pixmap.save(buf, format)
|
||||||
return str(ba.data())
|
return str(ba.data())
|
||||||
|
|
||||||
|
class ResizableDialog(QDialog):
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
QDialog.__init__(self, *args)
|
||||||
|
self.setupUi(self)
|
||||||
|
nh, nw = min_available_height()-25, available_width()-10
|
||||||
|
if nh < 0:
|
||||||
|
nh = 800
|
||||||
|
if nw < 0:
|
||||||
|
nw = 600
|
||||||
|
nh = min(self.height(), nh)
|
||||||
|
nw = min(self.width(), nw)
|
||||||
|
self.resize(nw, nh)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from calibre.utils.single_qt_application import SingleApplication
|
from calibre.utils.single_qt_application import SingleApplication
|
||||||
|
@ -14,7 +14,7 @@ from lxml.etree import XPath
|
|||||||
|
|
||||||
from calibre.gui2.dialogs.choose_format import ChooseFormatDialog
|
from calibre.gui2.dialogs.choose_format import ChooseFormatDialog
|
||||||
from calibre.gui2.dialogs.epub_ui import Ui_Dialog
|
from calibre.gui2.dialogs.epub_ui import Ui_Dialog
|
||||||
from calibre.gui2 import error_dialog, choose_images, pixmap_to_data
|
from calibre.gui2 import error_dialog, choose_images, pixmap_to_data, ResizableDialog
|
||||||
from calibre.ebooks.epub.from_any import SOURCE_FORMATS, config as epubconfig
|
from calibre.ebooks.epub.from_any import SOURCE_FORMATS, config as epubconfig
|
||||||
from calibre.ebooks.metadata import MetaInformation
|
from calibre.ebooks.metadata import MetaInformation
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
from calibre.ptempfile import PersistentTemporaryFile
|
||||||
@ -22,13 +22,12 @@ from calibre.ebooks.metadata.opf import OPFCreator
|
|||||||
from calibre.ebooks.metadata import authors_to_string, string_to_authors
|
from calibre.ebooks.metadata import authors_to_string, string_to_authors
|
||||||
|
|
||||||
|
|
||||||
class Config(QDialog, Ui_Dialog):
|
class Config(ResizableDialog, Ui_Dialog):
|
||||||
|
|
||||||
OUTPUT = 'EPUB'
|
OUTPUT = 'EPUB'
|
||||||
|
|
||||||
def __init__(self, parent, db, row=None, config=epubconfig):
|
def __init__(self, parent, db, row=None, config=epubconfig):
|
||||||
QDialog.__init__(self, parent)
|
ResizableDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
|
||||||
self.hide_controls()
|
self.hide_controls()
|
||||||
self.connect(self.category_list, SIGNAL('itemEntered(QListWidgetItem *)'),
|
self.connect(self.category_list, SIGNAL('itemEntered(QListWidgetItem *)'),
|
||||||
self.show_category_help)
|
self.show_category_help)
|
||||||
@ -68,11 +67,11 @@ class Config(QDialog, Ui_Dialog):
|
|||||||
self.__w.append(QIcon(':/images/dialog_information.svg'))
|
self.__w.append(QIcon(':/images/dialog_information.svg'))
|
||||||
self.item1 = QListWidgetItem(self.__w[-1], _('Metadata'), self.category_list)
|
self.item1 = QListWidgetItem(self.__w[-1], _('Metadata'), self.category_list)
|
||||||
self.__w.append(QIcon(':/images/lookfeel.svg'))
|
self.__w.append(QIcon(':/images/lookfeel.svg'))
|
||||||
self.item2 = QListWidgetItem(self.__w[-1], _('Look & Feel'), self.category_list)
|
self.item2 = QListWidgetItem(self.__w[-1], _('Look & Feel').replace(' ','\n'), self.category_list)
|
||||||
self.__w.append(QIcon(':/images/page.svg'))
|
self.__w.append(QIcon(':/images/page.svg'))
|
||||||
self.item3 = QListWidgetItem(self.__w[-1], _('Page Setup'), self.category_list)
|
self.item3 = QListWidgetItem(self.__w[-1], _('Page Setup').replace(' ','\n'), self.category_list)
|
||||||
self.__w.append(QIcon(':/images/chapters.svg'))
|
self.__w.append(QIcon(':/images/chapters.svg'))
|
||||||
self.item4 = QListWidgetItem(self.__w[-1], _('Chapter Detection'), self.category_list)
|
self.item4 = QListWidgetItem(self.__w[-1], _('Chapter Detection').replace(' ','\n'), self.category_list)
|
||||||
self.setup_tooltips()
|
self.setup_tooltips()
|
||||||
self.initialize_options()
|
self.initialize_options()
|
||||||
|
|
||||||
@ -98,7 +97,7 @@ class Config(QDialog, Ui_Dialog):
|
|||||||
_('Page Setup') : _('Specify the page layout settings like margins.'),
|
_('Page Setup') : _('Specify the page layout settings like margins.'),
|
||||||
_('Chapter Detection') : _('Fine tune the detection of chapter and section headings.'),
|
_('Chapter Detection') : _('Fine tune the detection of chapter and section headings.'),
|
||||||
}
|
}
|
||||||
self.set_help(help[text])
|
self.set_help(help[text.replace('\n', ' ')])
|
||||||
|
|
||||||
def select_cover(self):
|
def select_cover(self):
|
||||||
files = choose_images(self, 'change cover dialog',
|
files = choose_images(self, 'change cover dialog',
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>868</width>
|
<width>965</width>
|
||||||
<height>670</height>
|
<height>698</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@ -21,14 +21,12 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2" >
|
<layout class="QGridLayout" name="gridLayout_2" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" >
|
|
||||||
<item>
|
|
||||||
<widget class="QListWidget" name="category_list" >
|
<widget class="QListWidget" name="category_list" >
|
||||||
<property name="maximumSize" >
|
<property name="sizePolicy" >
|
||||||
<size>
|
<sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
|
||||||
<width>172</width>
|
<horstretch>0</horstretch>
|
||||||
<height>16777215</height>
|
<verstretch>0</verstretch>
|
||||||
</size>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="font" >
|
<property name="font" >
|
||||||
<font>
|
<font>
|
||||||
@ -42,9 +40,6 @@
|
|||||||
<property name="verticalScrollBarPolicy" >
|
<property name="verticalScrollBarPolicy" >
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="horizontalScrollBarPolicy" >
|
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
|
||||||
</property>
|
|
||||||
<property name="tabKeyNavigation" >
|
<property name="tabKeyNavigation" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -54,26 +49,47 @@
|
|||||||
<height>48</height>
|
<height>48</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="flow" >
|
|
||||||
<enum>QListView::TopToBottom</enum>
|
|
||||||
</property>
|
|
||||||
<property name="isWrapping" stdset="0" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>10</number>
|
<number>20</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="viewMode" >
|
<property name="wordWrap" >
|
||||||
<enum>QListView::IconMode</enum>
|
|
||||||
</property>
|
|
||||||
<property name="uniformItemSizes" >
|
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentRow" >
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1" >
|
||||||
|
<widget class="QScrollArea" name="scrollArea" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
|
<horstretch>10</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape" >
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="widgetResizable" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>697</width>
|
||||||
|
<height>554</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize" >
|
||||||
|
<size>
|
||||||
|
<width>680</width>
|
||||||
|
<height>520</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stack" >
|
<widget class="QStackedWidget" name="stack" >
|
||||||
<property name="currentIndex" >
|
<property name="currentIndex" >
|
||||||
@ -775,18 +791,10 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</widget>
|
||||||
<item row="2" column="0" >
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons" >
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" colspan="2" >
|
||||||
<widget class="QTextBrowser" name="help_view" >
|
<widget class="QTextBrowser" name="help_view" >
|
||||||
<property name="maximumSize" >
|
<property name="maximumSize" >
|
||||||
<size>
|
<size>
|
||||||
@ -799,6 +807,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2" >
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons" >
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
@ -820,8 +838,8 @@ p, li { white-space: pre-wrap; }
|
|||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel" >
|
||||||
<x>222</x>
|
<x>226</x>
|
||||||
<y>652</y>
|
<y>684</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel" >
|
||||||
<x>157</x>
|
<x>157</x>
|
||||||
@ -852,12 +870,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<slot>setCurrentIndex(int)</slot>
|
<slot>setCurrentIndex(int)</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel" >
|
||||||
<x>88</x>
|
<x>81</x>
|
||||||
<y>42</y>
|
<y>118</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel" >
|
||||||
<x>659</x>
|
<x>866</x>
|
||||||
<y>12</y>
|
<y>11</y>
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
<iconset resource="../images.qrc" >
|
<iconset resource="../images.qrc" >
|
||||||
<normaloff>:/images/convert.svg</normaloff>:/images/convert.svg</iconset>
|
<normaloff>:/images/convert.svg</normaloff>:/images/convert.svg</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QGridLayout" name="gridLayout_2" >
|
||||||
<item>
|
<item rowspan="3" row="0" column="0" >
|
||||||
<widget class="QGroupBox" name="category" >
|
<widget class="QGroupBox" name="category" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
|
<sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
|
||||||
@ -96,37 +96,42 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="1" >
|
||||||
<layout class="QVBoxLayout" >
|
<widget class="QScrollArea" name="scrollArea" >
|
||||||
<item>
|
<property name="frameShape" >
|
||||||
<layout class="QVBoxLayout" >
|
<enum>QFrame::NoFrame</enum>
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_3" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
|
||||||
<horstretch>10</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="title" >
|
<property name="widgetResizable" >
|
||||||
<string>Options</string>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<widget class="QWidget" name="scrollAreaWidgetContents" >
|
||||||
<item row="0" column="0" >
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>664</width>
|
||||||
|
<height>515</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
<widget class="QStackedWidget" name="stack" >
|
<widget class="QStackedWidget" name="stack" >
|
||||||
<property name="currentIndex" >
|
<property name="currentIndex" >
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="metadata_page" >
|
<widget class="QWidget" name="metadata_page" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" name="_2" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_4" >
|
<widget class="QGroupBox" name="groupBox_4" >
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Book Cover</string>
|
<string>Book Cover</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_3" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" name="_4" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="ImageView" name="cover" >
|
<widget class="ImageView" name="cover" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -146,7 +151,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="_5" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
@ -164,7 +169,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" name="_6" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
@ -210,9 +215,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="_7" >
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_8" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QLabel" name="label" >
|
<widget class="QLabel" name="label" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -395,25 +400,12 @@
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>110</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Comments</string>
|
<string>Comments</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_9" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QTextEdit" name="gui_comment" >
|
<widget class="QTextEdit" name="gui_comment" />
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>60</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -423,7 +415,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="lookandfeel_page" >
|
<widget class="QWidget" name="lookandfeel_page" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_10" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QLabel" name="label_8" >
|
<widget class="QLabel" name="label_8" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -464,7 +456,7 @@
|
|||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Embedded Fonts</string>
|
<string>Embedded Fonts</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_11" >
|
||||||
<item row="0" column="0" colspan="2" >
|
<item row="0" column="0" colspan="2" >
|
||||||
<widget class="QLabel" name="label_22" >
|
<widget class="QLabel" name="label_22" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -589,7 +581,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="4" >
|
<item row="3" column="0" colspan="4" >
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="_12" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="gui_autorotation" >
|
<widget class="QCheckBox" name="gui_autorotation" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -644,7 +636,7 @@
|
|||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Header</string>
|
<string>Header</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_13" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QCheckBox" name="gui_header" >
|
<widget class="QCheckBox" name="gui_header" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -698,7 +690,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="pagesetup_page" >
|
<widget class="QWidget" name="pagesetup_page" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_14" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QLabel" name="label_11" >
|
<widget class="QLabel" name="label_11" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -847,7 +839,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="chapterdetection_page" >
|
<widget class="QWidget" name="chapterdetection_page" >
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="_15" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_6" >
|
<widget class="QGroupBox" name="groupBox_6" >
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
@ -896,7 +888,7 @@
|
|||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Tag based detection</string>
|
<string>Tag based detection</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_16" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QLabel" name="label_18" >
|
<widget class="QLabel" name="label_18" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -956,29 +948,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="1" >
|
||||||
<widget class="QGroupBox" name="groupBox" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>Help on item</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<widget class="QTextBrowser" name="help_view" >
|
<widget class="QTextBrowser" name="help_view" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||||
@ -995,24 +969,19 @@
|
|||||||
<property name="maximumSize" >
|
<property name="maximumSize" >
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>150</height>
|
<height>120</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="html" >
|
<property name="html" >
|
||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans';"></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="2" column="1" >
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -1026,8 +995,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
@ -1079,108 +1046,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<slot>setCurrentIndex(int)</slot>
|
<slot>setCurrentIndex(int)</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel" >
|
||||||
<x>184</x>
|
<x>96</x>
|
||||||
<y>279</y>
|
<y>120</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel" >
|
||||||
<x>368</x>
|
<x>539</x>
|
||||||
<y>185</y>
|
<y>220</y>
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>gui_disable_chapter_detection</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>gui_chapter_regex</receiver>
|
|
||||||
<slot>setDisabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel" >
|
|
||||||
<x>308</x>
|
|
||||||
<y>74</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel" >
|
|
||||||
<x>308</x>
|
|
||||||
<y>74</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>gui_disable_chapter_detection</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>gui_add_chapters_to_toc</receiver>
|
|
||||||
<slot>setDisabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel" >
|
|
||||||
<x>308</x>
|
|
||||||
<y>74</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel" >
|
|
||||||
<x>308</x>
|
|
||||||
<y>74</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>gui_render_tables_as_images</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>gui_text_size_multiplier_for_rendered_tables</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel" >
|
|
||||||
<x>308</x>
|
|
||||||
<y>74</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel" >
|
|
||||||
<x>308</x>
|
|
||||||
<y>74</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>gui_header</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>gui_headerformat</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel" >
|
|
||||||
<x>345</x>
|
|
||||||
<y>363</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel" >
|
|
||||||
<x>837</x>
|
|
||||||
<y>435</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</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>308</x>
|
|
||||||
<y>74</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel" >
|
|
||||||
<x>308</x>
|
|
||||||
<y>74</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>gui_header</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>gui_header_separation</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel" >
|
|
||||||
<x>261</x>
|
|
||||||
<y>346</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel" >
|
|
||||||
<x>379</x>
|
|
||||||
<y>378</y>
|
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
@ -11,7 +11,7 @@ from PyQt4.QtGui import QPixmap, QListWidgetItem, QErrorMessage, QDialog, QCompl
|
|||||||
|
|
||||||
|
|
||||||
from calibre.gui2 import qstring_to_unicode, error_dialog, file_icon_provider, \
|
from calibre.gui2 import qstring_to_unicode, error_dialog, file_icon_provider, \
|
||||||
choose_files, pixmap_to_data, choose_images
|
choose_files, pixmap_to_data, choose_images, ResizableDialog
|
||||||
from calibre.gui2.dialogs.metadata_single_ui import Ui_MetadataSingleDialog
|
from calibre.gui2.dialogs.metadata_single_ui import Ui_MetadataSingleDialog
|
||||||
from calibre.gui2.dialogs.fetch_metadata import FetchMetadata
|
from calibre.gui2.dialogs.fetch_metadata import FetchMetadata
|
||||||
from calibre.gui2.dialogs.tag_editor import TagEditor
|
from calibre.gui2.dialogs.tag_editor import TagEditor
|
||||||
@ -40,7 +40,7 @@ class AuthorCompleter(QCompleter):
|
|||||||
all_authors.sort(cmp=lambda x, y : cmp(x[1], y[1]))
|
all_authors.sort(cmp=lambda x, y : cmp(x[1], y[1]))
|
||||||
QCompleter.__init__(self, [x[1] for x in all_authors])
|
QCompleter.__init__(self, [x[1] for x in all_authors])
|
||||||
|
|
||||||
class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
|
class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
||||||
|
|
||||||
def do_reset_cover(self, *args):
|
def do_reset_cover(self, *args):
|
||||||
pix = QPixmap(':/images/book.svg')
|
pix = QPixmap(':/images/book.svg')
|
||||||
@ -164,9 +164,7 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
|
|||||||
self.db.remove_format(self.row, ext, notify=False)
|
self.db.remove_format(self.row, ext, notify=False)
|
||||||
|
|
||||||
def __init__(self, window, row, db, accepted_callback=None):
|
def __init__(self, window, row, db, accepted_callback=None):
|
||||||
QDialog.__init__(self, window)
|
ResizableDialog.__init__(self, window)
|
||||||
Ui_MetadataSingleDialog.__init__(self)
|
|
||||||
self.setupUi(self)
|
|
||||||
self.bc_box.layout().setAlignment(self.cover, Qt.AlignCenter|Qt.AlignHCenter)
|
self.bc_box.layout().setAlignment(self.cover, Qt.AlignCenter|Qt.AlignHCenter)
|
||||||
self.splitter.setStretchFactor(100, 1)
|
self.splitter.setStretchFactor(100, 1)
|
||||||
self.db = db
|
self.db = db
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>923</width>
|
<width>887</width>
|
||||||
<height>715</height>
|
<height>740</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
@ -28,6 +28,36 @@
|
|||||||
<property name="modal" >
|
<property name="modal" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_6" >
|
||||||
|
<item>
|
||||||
|
<widget class="QScrollArea" name="scrollArea" >
|
||||||
|
<property name="frameShape" >
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="widgetResizable" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>879</width>
|
||||||
|
<height>700</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" native="1" name="central_widget" >
|
||||||
|
<property name="minimumSize" >
|
||||||
|
<size>
|
||||||
|
<width>800</width>
|
||||||
|
<height>685</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3" >
|
<layout class="QVBoxLayout" name="verticalLayout_3" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSplitter" name="splitter" >
|
<widget class="QSplitter" name="splitter" >
|
||||||
@ -192,7 +222,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1" colspan="2" >
|
<item row="5" column="1" colspan="2" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" name="_2" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="tags" >
|
<widget class="QLineEdit" name="tags" >
|
||||||
<property name="toolTip" >
|
<property name="toolTip" >
|
||||||
@ -233,7 +263,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1" colspan="2" >
|
<item row="6" column="1" colspan="2" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" name="_3" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
@ -350,7 +380,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="layoutWidget" >
|
<widget class="QWidget" name="layoutWidget_2" >
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="af_group_box" >
|
<widget class="QGroupBox" name="af_group_box" >
|
||||||
@ -486,7 +516,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="_4" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
@ -507,7 +537,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" name="_5" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
@ -554,7 +584,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" name="_6" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="fetch_cover_button" >
|
<widget class="QPushButton" name="fetch_cover_button" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -581,6 +611,13 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="button_box" >
|
<widget class="QDialogButtonBox" name="button_box" >
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
@ -601,30 +638,6 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>title</tabstop>
|
|
||||||
<tabstop>swap_button</tabstop>
|
|
||||||
<tabstop>authors</tabstop>
|
|
||||||
<tabstop>author_sort</tabstop>
|
|
||||||
<tabstop>auto_author_sort</tabstop>
|
|
||||||
<tabstop>rating</tabstop>
|
|
||||||
<tabstop>publisher</tabstop>
|
|
||||||
<tabstop>tags</tabstop>
|
|
||||||
<tabstop>tag_editor_button</tabstop>
|
|
||||||
<tabstop>series</tabstop>
|
|
||||||
<tabstop>remove_series_button</tabstop>
|
|
||||||
<tabstop>series_index</tabstop>
|
|
||||||
<tabstop>isbn</tabstop>
|
|
||||||
<tabstop>comments</tabstop>
|
|
||||||
<tabstop>fetch_metadata_button</tabstop>
|
|
||||||
<tabstop>fetch_cover_button</tabstop>
|
|
||||||
<tabstop>password_button</tabstop>
|
|
||||||
<tabstop>cover_button</tabstop>
|
|
||||||
<tabstop>reset_cover</tabstop>
|
|
||||||
<tabstop>cover_path</tabstop>
|
|
||||||
<tabstop>add_format_button</tabstop>
|
|
||||||
<tabstop>button_set_cover</tabstop>
|
|
||||||
<tabstop>remove_format_button</tabstop>
|
|
||||||
<tabstop>formats</tabstop>
|
|
||||||
<tabstop>button_box</tabstop>
|
<tabstop>button_box</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
|
@ -3,21 +3,20 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|||||||
import time, os
|
import time, os
|
||||||
|
|
||||||
from PyQt4.QtCore import SIGNAL, QUrl
|
from PyQt4.QtCore import SIGNAL, QUrl
|
||||||
from PyQt4.QtGui import QDialog, QMessageBox, QDesktopServices
|
from PyQt4.QtGui import QMessageBox, QDesktopServices
|
||||||
|
|
||||||
from calibre.web.feeds.recipes import compile_recipe
|
from calibre.web.feeds.recipes import compile_recipe
|
||||||
from calibre.web.feeds.news import AutomaticNewsRecipe
|
from calibre.web.feeds.news import AutomaticNewsRecipe
|
||||||
from calibre.gui2.dialogs.user_profiles_ui import Ui_Dialog
|
from calibre.gui2.dialogs.user_profiles_ui import Ui_Dialog
|
||||||
from calibre.gui2 import qstring_to_unicode, error_dialog, question_dialog, choose_files
|
from calibre.gui2 import qstring_to_unicode, error_dialog, question_dialog, \
|
||||||
|
choose_files, ResizableDialog
|
||||||
from calibre.gui2.widgets import PythonHighlighter
|
from calibre.gui2.widgets import PythonHighlighter
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
from calibre.ptempfile import PersistentTemporaryFile
|
||||||
|
|
||||||
class UserProfiles(QDialog, Ui_Dialog):
|
class UserProfiles(ResizableDialog, Ui_Dialog):
|
||||||
|
|
||||||
def __init__(self, parent, feeds):
|
def __init__(self, parent, feeds):
|
||||||
QDialog.__init__(self, parent)
|
ResizableDialog.__init__(self, parent)
|
||||||
Ui_Dialog.__init__(self)
|
|
||||||
self.setupUi(self)
|
|
||||||
|
|
||||||
self.connect(self.remove_feed_button, SIGNAL('clicked(bool)'),
|
self.connect(self.remove_feed_button, SIGNAL('clicked(bool)'),
|
||||||
self.added_feeds.remove_selected_items)
|
self.added_feeds.remove_selected_items)
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>744</width>
|
<width>719</width>
|
||||||
<height>633</height>
|
<height>612</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@ -16,22 +16,44 @@
|
|||||||
<iconset resource="../images.qrc" >
|
<iconset resource="../images.qrc" >
|
||||||
<normaloff>:/images/user_profile.svg</normaloff>:/images/user_profile.svg</iconset>
|
<normaloff>:/images/user_profile.svg</normaloff>:/images/user_profile.svg</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QVBoxLayout" name="verticalLayout_4" >
|
||||||
<item row="1" column="0" >
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
<widget class="QScrollArea" name="scrollArea" >
|
||||||
<property name="orientation" >
|
<property name="frameShape" >
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons" >
|
<property name="lineWidth" >
|
||||||
<set>QDialogButtonBox::Close</set>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="widgetResizable" >
|
||||||
</item>
|
<bool>true</bool>
|
||||||
<item row="0" column="0" >
|
|
||||||
<widget class="QSplitter" name="splitter" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>711</width>
|
||||||
|
<height>572</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" native="1" name="central_widget" >
|
||||||
|
<property name="minimumSize" >
|
||||||
|
<size>
|
||||||
|
<width>680</width>
|
||||||
|
<height>550</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox" >
|
<widget class="QGroupBox" name="groupBox" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
|
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
|
||||||
@ -39,16 +61,10 @@
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>215</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Available user recipes</string>
|
<string>Available user recipes</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="BasicList" name="available_profiles" >
|
<widget class="BasicList" name="available_profiles" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
@ -116,8 +132,16 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="layoutWidget" >
|
</item>
|
||||||
<layout class="QVBoxLayout" >
|
<item>
|
||||||
|
<widget class="QFrame" name="frame" >
|
||||||
|
<property name="frameShape" >
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow" >
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="toggle_mode_button" >
|
<widget class="QPushButton" name="toggle_mode_button" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -131,7 +155,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page" >
|
<widget class="QWidget" name="page" >
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="verticalLayout_5" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label" >
|
<widget class="QLabel" name="label" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -229,12 +253,24 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_2" >
|
<widget class="QGroupBox" name="groupBox_2" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||||
|
<horstretch>100</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Feeds in recipe</string>
|
<string>Feeds in recipe</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="BasicList" name="added_feeds" >
|
<widget class="BasicList" name="added_feeds" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
|
<horstretch>100</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="selectionMode" >
|
<property name="selectionMode" >
|
||||||
<enum>QAbstractItemView::MultiSelection</enum>
|
<enum>QAbstractItemView::MultiSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -357,6 +393,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="source_code" >
|
<widget class="QTextEdit" name="source_code" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
|
<horstretch>100</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="font" >
|
<property name="font" >
|
||||||
<font>
|
<font>
|
||||||
<family>DejaVu Sans Mono</family>
|
<family>DejaVu Sans Mono</family>
|
||||||
@ -379,6 +421,22 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons" >
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -134,16 +134,8 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
for f in self.output_formats:
|
for f in self.output_formats:
|
||||||
self.output_format.addItem(f)
|
self.output_format.addItem(f)
|
||||||
self.output_format.setCurrentIndex(self.output_formats.index(prefs['output_format']))
|
self.output_format.setCurrentIndex(self.output_formats.index(prefs['output_format']))
|
||||||
def change_output_format(x):
|
|
||||||
of = unicode(x).strip()
|
|
||||||
if of != prefs['output_format']:
|
|
||||||
if of not in ('LRF',):
|
|
||||||
warning_dialog(self, 'Warning',
|
|
||||||
'<p>%s support is still in beta. If you find bugs, please report them by opening a <a href="http://calibre.kovidgoyal.net">ticket</a>.'%of).exec_()
|
|
||||||
prefs.set('output_format', of)
|
|
||||||
|
|
||||||
self.connect(self.output_format, SIGNAL('currentIndexChanged(QString)'),
|
self.connect(self.output_format, SIGNAL('currentIndexChanged(QString)'),
|
||||||
change_output_format)
|
self.change_output_format, Qt.QueuedConnection)
|
||||||
|
|
||||||
####################### Vanity ########################
|
####################### Vanity ########################
|
||||||
self.vanity_template = _('<p>For help visit <a href="http://%s.kovidgoyal.net/user_manual">%s.kovidgoyal.net</a><br>')%(__appname__, __appname__)
|
self.vanity_template = _('<p>For help visit <a href="http://%s.kovidgoyal.net/user_manual">%s.kovidgoyal.net</a><br>')%(__appname__, __appname__)
|
||||||
@ -377,6 +369,15 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
self.connect(self.action_news, SIGNAL('triggered(bool)'), self.scheduler.show_dialog)
|
self.connect(self.action_news, SIGNAL('triggered(bool)'), self.scheduler.show_dialog)
|
||||||
self.location_view.setCurrentIndex(self.location_view.model().index(0))
|
self.location_view.setCurrentIndex(self.location_view.model().index(0))
|
||||||
|
|
||||||
|
def change_output_format(self, x):
|
||||||
|
of = unicode(x).strip()
|
||||||
|
if of != prefs['output_format']:
|
||||||
|
if of not in ('LRF',):
|
||||||
|
warning_dialog(self, 'Warning',
|
||||||
|
'<p>%s support is still in beta. If you find bugs, please report them by opening a <a href="http://calibre.kovidgoyal.net">ticket</a>.'%of).exec_()
|
||||||
|
prefs.set('output_format', of)
|
||||||
|
|
||||||
|
|
||||||
def test_server(self, *args):
|
def test_server(self, *args):
|
||||||
if self.content_server.exception is not None:
|
if self.content_server.exception is not None:
|
||||||
error_dialog(self, _('Failed to start content server'),
|
error_dialog(self, _('Failed to start content server'),
|
||||||
|
@ -11,7 +11,7 @@ class FazNet(BasicNewsRecipe):
|
|||||||
|
|
||||||
title = 'FAZ NET'
|
title = 'FAZ NET'
|
||||||
__author__ = 'Kovid Goyal'
|
__author__ = 'Kovid Goyal'
|
||||||
description = 'News from Germany'
|
description = '"Frankfurter Allgemeine Zeitung'
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
max_articles_per_feed = 30
|
max_articles_per_feed = 30
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
|||||||
class SpeigelOnline(BasicNewsRecipe):
|
class SpeigelOnline(BasicNewsRecipe):
|
||||||
|
|
||||||
title = 'Spiegel Online'
|
title = 'Spiegel Online'
|
||||||
description = 'News from Germany'
|
description = 'Nachrichten des Magazins Der Spiegel'
|
||||||
__author__ = 'Kovid Goyal'
|
__author__ = 'Kovid Goyal'
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
timefmt = ' [ %Y-%m-%d %a]'
|
timefmt = ' [ %Y-%m-%d %a]'
|
||||||
|
@ -11,7 +11,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
|||||||
class ZeitDe(BasicNewsRecipe):
|
class ZeitDe(BasicNewsRecipe):
|
||||||
|
|
||||||
title = 'Die Zeit Nachrichten'
|
title = 'Die Zeit Nachrichten'
|
||||||
description = 'News from Germany'
|
description = 'Die Zeit - Online Nachrichten'
|
||||||
__author__ = 'Kovid Goyal'
|
__author__ = 'Kovid Goyal'
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
timefmt = ' [%d %b %Y]'
|
timefmt = ' [%d %b %Y]'
|
||||||
|
@ -407,6 +407,7 @@ class RecursiveFetcher(object, LoggingInterface):
|
|||||||
if not isinstance(_fname, unicode):
|
if not isinstance(_fname, unicode):
|
||||||
_fname.decode('latin1', 'replace')
|
_fname.decode('latin1', 'replace')
|
||||||
_fname = _fname.encode('ascii', 'replace').replace('%', '').replace(os.sep, '')
|
_fname = _fname.encode('ascii', 'replace').replace('%', '').replace(os.sep, '')
|
||||||
|
_fname = sanitize_file_name(_fname)
|
||||||
res = os.path.join(linkdiskpath, _fname)
|
res = os.path.join(linkdiskpath, _fname)
|
||||||
self.downloaded_paths.append(res)
|
self.downloaded_paths.append(res)
|
||||||
self.filemap[nurl] = res
|
self.filemap[nurl] = res
|
||||||
|
Loading…
x
Reference in New Issue
Block a user