diff --git a/src/calibre/ebooks/metadata/__init__.py b/src/calibre/ebooks/metadata/__init__.py index 856133d1ce..c7d667c831 100644 --- a/src/calibre/ebooks/metadata/__init__.py +++ b/src/calibre/ebooks/metadata/__init__.py @@ -22,7 +22,7 @@ def string_to_authors(raw): def authors_to_string(authors): if authors is not None: - return ' & '.join([a.replace('&', '&&') for a in authors]) + return ' & '.join([a.replace('&', '&&') for a in authors if a]) else: return '' diff --git a/src/calibre/ebooks/metadata/meta.py b/src/calibre/ebooks/metadata/meta.py index a65d55a63d..d8116b33d3 100644 --- a/src/calibre/ebooks/metadata/meta.py +++ b/src/calibre/ebooks/metadata/meta.py @@ -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 # in: title_-_author_number.extension base.smart_update(metadata_from_filename(name, re.compile( - '^(?P[^\s]+?)_-_(?P<author>[^\s]+?)_+\d+'))) + r'^(?P<title>\S+?)_-_(?P<author>\S+?)_+\d+'))) if base.title: base.title = base.title.replace('_', ' ') if base.authors: diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 3336391a38..2bc898748d 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -23,7 +23,6 @@ from calibre import LoggingInterface from calibre.translations.dynamic import translate from calibre.startup import get_lang -XML_PARSER = etree.XMLParser(recover=True) XML_NS = 'http://www.w3.org/XML/1998/namespace' XHTML_NS = 'http://www.w3.org/1999/xhtml' OPF1_NS = 'http://openebook.org/namespaces/oeb-package/1.0/' @@ -140,8 +139,7 @@ class Logger(LoggingInterface, object): class AbstractContainer(object): def read_xml(self, path): return etree.fromstring( - self.read(path), parser=XML_PARSER, - base_url=os.path.dirname(path)) + self.read(path), base_url=os.path.dirname(path)) class DirContainer(AbstractContainer): def __init__(self, rootdir): @@ -334,15 +332,15 @@ class Manifest(object): if self.oeb.encoding is not None: data = data.decode(self.oeb.encoding, 'replace') try: - data = etree.fromstring(data, parser=XML_PARSER) + data = etree.fromstring(data) except etree.XMLSyntaxError: data = html.fromstring(data) data = etree.tostring(data, encoding=unicode) - data = etree.fromstring(data, parser=XML_PARSER) + data = etree.fromstring(data) if namespace(data.tag) != XHTML_NS: data.attrib['xmlns'] = XHTML_NS data = etree.tostring(data, encoding=unicode) - data = etree.fromstring(data, parser=XML_PARSER) + data = etree.fromstring(data) for meta in self.META_XP(data): meta.getparent().remove(meta) return data @@ -355,7 +353,7 @@ class Manifest(object): if self.media_type in OEB_DOCS: data = self._force_xhtml(data) elif self.media_type[-4:] in ('+xml', '/xml'): - data = etree.fromstring(data, parser=XML_PARSER) + data = etree.fromstring(data) self._data = data return data def fset(self, value): @@ -788,7 +786,7 @@ class OEBBook(object): for tag in ('manifest', 'spine', 'tours', 'guide'): for element in opf.xpath(tag): nroot.append(element) - return etree.fromstring(etree.tostring(nroot), parser=XML_PARSER) + return etree.fromstring(etree.tostring(nroot)) def _read_opf(self, opfpath): opf = self.container.read_xml(opfpath) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 6549c8eccd..bf04133254 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -277,7 +277,10 @@ class Style(object): def _apply_style_attr(self): attrib = self._element.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)) def _has_parent(self): diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index a3388a3c29..084b352f48 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -6,7 +6,7 @@ from PyQt4.QtCore import QVariant, QFileInfo, QObject, SIGNAL, QBuffer, Qt, QSiz QByteArray, QLocale, QUrl, QTranslator, QCoreApplication, \ QModelIndex from PyQt4.QtGui import QFileDialog, QMessageBox, QPixmap, QFileIconProvider, \ - QIcon, QTableView, QDialogButtonBox, QApplication + QIcon, QTableView, QDialogButtonBox, QApplication, QDialog ORG_NAME = 'KovidsBrain' APP_UID = 'libprs500' @@ -394,7 +394,20 @@ def pixmap_to_data(pixmap, format='JPEG'): pixmap.save(buf, format) 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: from calibre.utils.single_qt_application import SingleApplication except: diff --git a/src/calibre/gui2/dialogs/epub.py b/src/calibre/gui2/dialogs/epub.py index af5622169a..c9bd3e6c46 100644 --- a/src/calibre/gui2/dialogs/epub.py +++ b/src/calibre/gui2/dialogs/epub.py @@ -14,7 +14,7 @@ from lxml.etree import XPath from calibre.gui2.dialogs.choose_format import ChooseFormatDialog 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.metadata import MetaInformation 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 -class Config(QDialog, Ui_Dialog): +class Config(ResizableDialog, Ui_Dialog): OUTPUT = 'EPUB' def __init__(self, parent, db, row=None, config=epubconfig): - QDialog.__init__(self, parent) - self.setupUi(self) + ResizableDialog.__init__(self, parent) self.hide_controls() self.connect(self.category_list, SIGNAL('itemEntered(QListWidgetItem *)'), self.show_category_help) @@ -68,11 +67,11 @@ class Config(QDialog, Ui_Dialog): self.__w.append(QIcon(':/images/dialog_information.svg')) self.item1 = QListWidgetItem(self.__w[-1], _('Metadata'), self.category_list) 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.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.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.initialize_options() @@ -98,7 +97,7 @@ class Config(QDialog, Ui_Dialog): _('Page Setup') : _('Specify the page layout settings like margins.'), _('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): files = choose_images(self, 'change cover dialog', diff --git a/src/calibre/gui2/dialogs/epub.ui b/src/calibre/gui2/dialogs/epub.ui index 7e3ad344ce..27627cccf8 100644 --- a/src/calibre/gui2/dialogs/epub.ui +++ b/src/calibre/gui2/dialogs/epub.ui @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>868</width> - <height>670</height> + <width>965</width> + <height>698</height> </rect> </property> <property name="windowTitle" > @@ -21,94 +21,92 @@ </property> <layout class="QGridLayout" name="gridLayout_2" > <item row="0" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="QListWidget" name="category_list" > - <property name="maximumSize" > - <size> - <width>172</width> - <height>16777215</height> - </size> - </property> - <property name="font" > - <font> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - <property name="mouseTracking" > - <bool>true</bool> - </property> - <property name="verticalScrollBarPolicy" > - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="horizontalScrollBarPolicy" > - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="tabKeyNavigation" > - <bool>true</bool> - </property> - <property name="iconSize" > - <size> - <width>48</width> - <height>48</height> - </size> - </property> - <property name="flow" > - <enum>QListView::TopToBottom</enum> - </property> - <property name="isWrapping" stdset="0" > - <bool>false</bool> - </property> - <property name="spacing" > - <number>10</number> - </property> - <property name="viewMode" > - <enum>QListView::IconMode</enum> - </property> - <property name="uniformItemSizes" > - <bool>true</bool> - </property> - <property name="currentRow" > - <number>-1</number> - </property> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="stack" > - <property name="currentIndex" > + <widget class="QListWidget" name="category_list" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="mouseTracking" > + <bool>true</bool> + </property> + <property name="verticalScrollBarPolicy" > + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="tabKeyNavigation" > + <bool>true</bool> + </property> + <property name="iconSize" > + <size> + <width>48</width> + <height>48</height> + </size> + </property> + <property name="spacing" > + <number>20</number> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + </widget> + </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> - <widget class="QWidget" name="metadata_page" > - <layout class="QGridLayout" name="gridLayout_4" > - <item row="0" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <widget class="QGroupBox" name="groupBox_4" > - <property name="title" > - <string>Book Cover</string> - </property> - <layout class="QGridLayout" name="_2" > - <item row="1" column="0" > - <layout class="QVBoxLayout" name="_4" > - <property name="spacing" > - <number>6</number> - </property> - <property name="margin" > - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_5" > - <property name="text" > - <string>Change &cover image:</string> - </property> - <property name="buddy" > - <cstring>cover_path</cstring> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="_5" > + <item> + <widget class="QStackedWidget" name="stack" > + <property name="currentIndex" > + <number>0</number> + </property> + <widget class="QWidget" name="metadata_page" > + <layout class="QGridLayout" name="gridLayout_4" > + <item row="0" column="0" > + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <widget class="QGroupBox" name="groupBox_4" > + <property name="title" > + <string>Book Cover</string> + </property> + <layout class="QGridLayout" name="_2" > + <item row="1" column="0" > + <layout class="QVBoxLayout" name="_4" > <property name="spacing" > <number>6</number> </property> @@ -116,677 +114,687 @@ <number>0</number> </property> <item> - <widget class="QLineEdit" name="cover_path" > - <property name="readOnly" > - <bool>true</bool> + <widget class="QLabel" name="label_5" > + <property name="text" > + <string>Change &cover image:</string> + </property> + <property name="buddy" > + <cstring>cover_path</cstring> </property> </widget> </item> <item> - <widget class="QToolButton" name="cover_button" > - <property name="toolTip" > - <string>Browse for an image to use as the cover of this book.</string> + <layout class="QHBoxLayout" name="_5" > + <property name="spacing" > + <number>6</number> </property> + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="cover_path" > + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="cover_button" > + <property name="toolTip" > + <string>Browse for an image to use as the cover of this book.</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/document_open.svg</normaloff>:/images/document_open.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item row="2" column="0" > + <widget class="QCheckBox" name="opt_prefer_metadata_cover" > + <property name="text" > + <string>Use cover from &source file</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="0" > + <layout class="QHBoxLayout" name="_3" > + <item> + <widget class="ImageView" name="cover" > <property name="text" > - <string>...</string> + <string/> </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/document_open.svg</normaloff>:/images/document_open.svg</iconset> + <property name="pixmap" > + <pixmap resource="../images.qrc" >:/images/book.svg</pixmap> + </property> + <property name="scaledContents" > + <bool>true</bool> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> </property> </widget> </item> </layout> </item> </layout> - </item> - <item row="2" column="0" > - <widget class="QCheckBox" name="opt_prefer_metadata_cover" > - <property name="text" > - <string>Use cover from &source file</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="0" > - <layout class="QHBoxLayout" name="_3" > - <item> - <widget class="ImageView" name="cover" > - <property name="text" > - <string/> - </property> - <property name="pixmap" > - <pixmap resource="../images.qrc" >:/images/book.svg</pixmap> - </property> - <property name="scaledContents" > - <bool>true</bool> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </item> - </layout> - <zorder>opt_prefer_metadata_cover</zorder> - <zorder></zorder> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2" > + <zorder>opt_prefer_metadata_cover</zorder> + <zorder></zorder> + </widget> + </item> <item> - <layout class="QGridLayout" name="_7" > - <item row="0" column="0" > - <widget class="QLabel" name="label" > - <property name="text" > - <string>&Title: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>title</cstring> - </property> - </widget> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <layout class="QGridLayout" name="_7" > + <item row="0" column="0" > + <widget class="QLabel" name="label" > + <property name="text" > + <string>&Title: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>title</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="title" > + <property name="toolTip" > + <string>Change the title of this book</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>&Author(s): </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>author</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QLineEdit" name="author" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip" > + <string>Change the author(s) of this book. Multiple authors should be separated by an &. If the author name contains an &, use && to represent it.</string> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_6" > + <property name="text" > + <string>Author So&rt:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>author_sort</cstring> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QLineEdit" name="author_sort" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip" > + <string>Change the author(s) of this book. Multiple authors should be separated by a comma</string> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_3" > + <property name="text" > + <string>&Publisher: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>publisher</cstring> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QLineEdit" name="publisher" > + <property name="toolTip" > + <string>Change the publisher of this book</string> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="label_4" > + <property name="text" > + <string>Ta&gs: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>tags</cstring> + </property> + </widget> + </item> + <item row="4" column="1" > + <widget class="QLineEdit" name="tags" > + <property name="toolTip" > + <string>Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas.</string> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="label_7" > + <property name="text" > + <string>&Series:</string> + </property> + <property name="textFormat" > + <enum>Qt::PlainText</enum> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>series</cstring> + </property> + </widget> + </item> + <item row="5" column="1" > + <widget class="QComboBox" name="series" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>10</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip" > + <string>List of known series. You can add new series.</string> + </property> + <property name="whatsThis" > + <string>List of known series. You can add new series.</string> + </property> + <property name="editable" > + <bool>true</bool> + </property> + <property name="insertPolicy" > + <enum>QComboBox::InsertAlphabetically</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item row="6" column="1" > + <widget class="QSpinBox" name="series_index" > + <property name="enabled" > + <bool>true</bool> + </property> + <property name="toolTip" > + <string>Series index.</string> + </property> + <property name="whatsThis" > + <string>Series index.</string> + </property> + <property name="prefix" > + <string>Book </string> + </property> + <property name="minimum" > + <number>1</number> + </property> + <property name="maximum" > + <number>10000</number> + </property> + </widget> + </item> + </layout> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="title" > - <property name="toolTip" > - <string>Change the title of this book</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_2" > - <property name="text" > - <string>&Author(s): </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>author</cstring> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="author" > + <item> + <widget class="QGroupBox" name="groupBox_2" > <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip" > - <string>Change the author(s) of this book. Multiple authors should be separated by an &. If the author name contains an &, use && to represent it.</string> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_6" > - <property name="text" > - <string>Author So&rt:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>author_sort</cstring> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="author_sort" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip" > - <string>Change the author(s) of this book. Multiple authors should be separated by a comma</string> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>200</height> + </size> </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_3" > - <property name="text" > - <string>&Publisher: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>publisher</cstring> - </property> - </widget> - </item> - <item row="3" column="1" > - <widget class="QLineEdit" name="publisher" > - <property name="toolTip" > - <string>Change the publisher of this book</string> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_4" > - <property name="text" > - <string>Ta&gs: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>tags</cstring> - </property> - </widget> - </item> - <item row="4" column="1" > - <widget class="QLineEdit" name="tags" > - <property name="toolTip" > - <string>Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas.</string> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="label_7" > - <property name="text" > - <string>&Series:</string> - </property> - <property name="textFormat" > - <enum>Qt::PlainText</enum> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>series</cstring> - </property> - </widget> - </item> - <item row="5" column="1" > - <widget class="QComboBox" name="series" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > - <horstretch>10</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip" > - <string>List of known series. You can add new series.</string> - </property> - <property name="whatsThis" > - <string>List of known series. You can add new series.</string> - </property> - <property name="editable" > - <bool>true</bool> - </property> - <property name="insertPolicy" > - <enum>QComboBox::InsertAlphabetically</enum> - </property> - <property name="sizeAdjustPolicy" > - <enum>QComboBox::AdjustToContents</enum> - </property> - </widget> - </item> - <item row="6" column="1" > - <widget class="QSpinBox" name="series_index" > - <property name="enabled" > - <bool>true</bool> - </property> - <property name="toolTip" > - <string>Series index.</string> - </property> - <property name="whatsThis" > - <string>Series index.</string> - </property> - <property name="prefix" > - <string>Book </string> - </property> - <property name="minimum" > - <number>1</number> - </property> - <property name="maximum" > - <number>10000</number> + <property name="title" > + <string>Comments</string> </property> + <layout class="QGridLayout" name="_8" > + <item row="0" column="0" > + <widget class="QTextEdit" name="comment" > + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>180</height> + </size> + </property> + </widget> + </item> + </layout> </widget> </item> </layout> </item> - <item> - <widget class="QGroupBox" name="groupBox_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="lookandfeel_page" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <layout class="QGridLayout" name="gridLayout_6" > + <item row="0" column="0" > + <widget class="QLabel" name="label_26" > + <property name="text" > + <string>Source en&coding:</string> </property> - <property name="maximumSize" > - <size> - <width>16777215</width> - <height>200</height> - </size> + <property name="buddy" > + <cstring>opt_encoding</cstring> </property> - <property name="title" > - <string>Comments</string> + </widget> + </item> + <item row="0" column="1" colspan="2" > + <widget class="QLineEdit" name="opt_encoding" /> + </item> + <item row="1" column="0" colspan="2" > + <widget class="QLabel" name="label_18" > + <property name="text" > + <string>Base &font size:</string> + </property> + <property name="buddy" > + <cstring>opt_base_font_size2</cstring> + </property> + </widget> + </item> + <item row="1" column="2" > + <widget class="QDoubleSpinBox" name="opt_base_font_size2" > + <property name="suffix" > + <string> pt</string> + </property> + <property name="decimals" > + <number>0</number> + </property> + <property name="minimum" > + <double>0.000000000000000</double> + </property> + <property name="maximum" > + <double>30.000000000000000</double> + </property> + <property name="singleStep" > + <double>1.000000000000000</double> + </property> + <property name="value" > + <double>30.000000000000000</double> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QCheckBox" name="opt_remove_paragraph_spacing" > + <property name="text" > + <string>Remove &spacing between paragraphs</string> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QCheckBox" name="opt_preserve_tag_structure" > + <property name="text" > + <string>Preserve &tag structure when splitting</string> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QCheckBox" name="opt_rescale_images" > + <property name="text" > + <string>&Rescale images</string> </property> - <layout class="QGridLayout" name="_8" > - <item row="0" column="0" > - <widget class="QTextEdit" name="comment" > - <property name="maximumSize" > - <size> - <width>16777215</width> - <height>180</height> - </size> - </property> - </widget> - </item> - </layout> </widget> </item> </layout> </item> + <item> + <widget class="QGroupBox" name="groupBox" > + <property name="title" > + <string>Override &CSS</string> + </property> + <layout class="QGridLayout" name="gridLayout_3" > + <item row="0" column="0" > + <widget class="QTextEdit" name="opt_override_css" /> + </item> + </layout> + </widget> + </item> </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="lookandfeel_page" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <layout class="QGridLayout" name="gridLayout_6" > + </widget> + <widget class="QWidget" name="pagesetup_page" > + <layout class="QGridLayout" name="_13" > <item row="0" column="0" > - <widget class="QLabel" name="label_26" > + <widget class="QLabel" name="profile_label" > <property name="text" > - <string>Source en&coding:</string> + <string>&Profile:</string> </property> <property name="buddy" > - <cstring>opt_encoding</cstring> + <cstring>opt_profile</cstring> </property> </widget> </item> - <item row="0" column="1" colspan="2" > - <widget class="QLineEdit" name="opt_encoding" /> - </item> - <item row="1" column="0" colspan="2" > - <widget class="QLabel" name="label_18" > - <property name="text" > - <string>Base &font size:</string> + <item row="0" column="1" > + <widget class="QComboBox" name="opt_profile" > + <property name="currentIndex" > + <number>-1</number> </property> - <property name="buddy" > - <cstring>opt_base_font_size2</cstring> - </property> - </widget> - </item> - <item row="1" column="2" > - <widget class="QDoubleSpinBox" name="opt_base_font_size2" > - <property name="suffix" > - <string> pt</string> - </property> - <property name="decimals" > - <number>0</number> - </property> - <property name="minimum" > - <double>0.000000000000000</double> - </property> - <property name="maximum" > - <double>30.000000000000000</double> - </property> - <property name="singleStep" > - <double>1.000000000000000</double> - </property> - <property name="value" > - <double>30.000000000000000</double> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QCheckBox" name="opt_remove_paragraph_spacing" > - <property name="text" > - <string>Remove &spacing between paragraphs</string> + <property name="minimumContentsLength" > + <number>1</number> </property> </widget> </item> <item row="3" column="0" > - <widget class="QCheckBox" name="opt_preserve_tag_structure" > + <widget class="QLabel" name="label_12" > <property name="text" > - <string>Preserve &tag structure when splitting</string> + <string>&Left Margin:</string> + </property> + <property name="buddy" > + <cstring>opt_margin_left</cstring> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QSpinBox" name="opt_margin_left" > + <property name="suffix" > + <string> pt</string> + </property> + <property name="maximum" > + <number>200</number> + </property> + <property name="value" > + <number>20</number> </property> </widget> </item> <item row="4" column="0" > - <widget class="QCheckBox" name="opt_rescale_images" > + <widget class="QLabel" name="label_13" > <property name="text" > - <string>&Rescale images</string> + <string>&Right Margin:</string> + </property> + <property name="buddy" > + <cstring>opt_margin_right</cstring> </property> </widget> </item> + <item row="4" column="1" > + <widget class="QSpinBox" name="opt_margin_right" > + <property name="suffix" > + <string> pt</string> + </property> + <property name="maximum" > + <number>200</number> + </property> + <property name="value" > + <number>20</number> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="label_14" > + <property name="text" > + <string>&Top Margin:</string> + </property> + <property name="buddy" > + <cstring>opt_margin_top</cstring> + </property> + </widget> + </item> + <item row="5" column="1" > + <widget class="QSpinBox" name="opt_margin_top" > + <property name="suffix" > + <string> pt</string> + </property> + <property name="maximum" > + <number>200</number> + </property> + <property name="value" > + <number>10</number> + </property> + </widget> + </item> + <item row="6" column="0" > + <widget class="QLabel" name="label_15" > + <property name="text" > + <string>&Bottom Margin:</string> + </property> + <property name="buddy" > + <cstring>opt_margin_bottom</cstring> + </property> + </widget> + </item> + <item row="6" column="1" > + <widget class="QSpinBox" name="opt_margin_bottom" > + <property name="suffix" > + <string> pt</string> + </property> + <property name="maximum" > + <number>200</number> + </property> + <property name="value" > + <number>0</number> + </property> + </widget> + </item> + <item row="7" column="0" > + <widget class="QCheckBox" name="opt_dont_split_on_page_breaks" > + <property name="text" > + <string>Do not &split on page breaks</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="source_profile_label" > + <property name="text" > + <string>&Source profile:</string> + </property> + <property name="buddy" > + <cstring>opt_source_profile</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QComboBox" name="opt_source_profile" /> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="dest_profile_label" > + <property name="text" > + <string>&Destination profile:</string> + </property> + <property name="buddy" > + <cstring>opt_dest_profile</cstring> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QComboBox" name="opt_dest_profile" /> + </item> </layout> - </item> - <item> - <widget class="QGroupBox" name="groupBox" > - <property name="title" > - <string>Override &CSS</string> - </property> - <layout class="QGridLayout" name="gridLayout_3" > - <item row="0" column="0" > - <widget class="QTextEdit" name="opt_override_css" /> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="pagesetup_page" > - <layout class="QGridLayout" name="_13" > - <item row="0" column="0" > - <widget class="QLabel" name="profile_label" > - <property name="text" > - <string>&Profile:</string> - </property> - <property name="buddy" > - <cstring>opt_profile</cstring> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QComboBox" name="opt_profile" > - <property name="currentIndex" > - <number>-1</number> - </property> - <property name="minimumContentsLength" > - <number>1</number> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_12" > - <property name="text" > - <string>&Left Margin:</string> - </property> - <property name="buddy" > - <cstring>opt_margin_left</cstring> - </property> - </widget> - </item> - <item row="3" column="1" > - <widget class="QSpinBox" name="opt_margin_left" > - <property name="suffix" > - <string> pt</string> - </property> - <property name="maximum" > - <number>200</number> - </property> - <property name="value" > - <number>20</number> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_13" > - <property name="text" > - <string>&Right Margin:</string> - </property> - <property name="buddy" > - <cstring>opt_margin_right</cstring> - </property> - </widget> - </item> - <item row="4" column="1" > - <widget class="QSpinBox" name="opt_margin_right" > - <property name="suffix" > - <string> pt</string> - </property> - <property name="maximum" > - <number>200</number> - </property> - <property name="value" > - <number>20</number> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="label_14" > - <property name="text" > - <string>&Top Margin:</string> - </property> - <property name="buddy" > - <cstring>opt_margin_top</cstring> - </property> - </widget> - </item> - <item row="5" column="1" > - <widget class="QSpinBox" name="opt_margin_top" > - <property name="suffix" > - <string> pt</string> - </property> - <property name="maximum" > - <number>200</number> - </property> - <property name="value" > - <number>10</number> - </property> - </widget> - </item> - <item row="6" column="0" > - <widget class="QLabel" name="label_15" > - <property name="text" > - <string>&Bottom Margin:</string> - </property> - <property name="buddy" > - <cstring>opt_margin_bottom</cstring> - </property> - </widget> - </item> - <item row="6" column="1" > - <widget class="QSpinBox" name="opt_margin_bottom" > - <property name="suffix" > - <string> pt</string> - </property> - <property name="maximum" > - <number>200</number> - </property> - <property name="value" > - <number>0</number> - </property> - </widget> - </item> - <item row="7" column="0" > - <widget class="QCheckBox" name="opt_dont_split_on_page_breaks" > - <property name="text" > - <string>Do not &split on page breaks</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="source_profile_label" > - <property name="text" > - <string>&Source profile:</string> - </property> - <property name="buddy" > - <cstring>opt_source_profile</cstring> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QComboBox" name="opt_source_profile" /> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="dest_profile_label" > - <property name="text" > - <string>&Destination profile:</string> - </property> - <property name="buddy" > - <cstring>opt_dest_profile</cstring> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QComboBox" name="opt_dest_profile" /> - </item> - </layout> - </widget> - <widget class="QWidget" name="chapterdetection_page" > - <layout class="QVBoxLayout" name="_14" > - <item> - <widget class="QGroupBox" name="groupBox_6" > - <property name="title" > - <string>Automatic &chapter detection</string> - </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="1" column="0" > - <widget class="QLabel" name="label_17" > - <property name="text" > - <string>&XPath:</string> - </property> - <property name="buddy" > - <cstring>opt_chapter</cstring> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="opt_chapter" /> - </item> - <item row="0" column="0" colspan="2" > - <widget class="QLabel" name="label_8" > - <property name="text" > - <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + </widget> + <widget class="QWidget" name="chapterdetection_page" > + <layout class="QVBoxLayout" name="_14" > + <item> + <widget class="QGroupBox" name="groupBox_6" > + <property name="title" > + <string>Automatic &chapter detection</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="1" column="0" > + <widget class="QLabel" name="label_17" > + <property name="text" > + <string>&XPath:</string> + </property> + <property name="buddy" > + <cstring>opt_chapter</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QLineEdit" name="opt_chapter" /> + </item> + <item row="0" column="0" colspan="2" > + <widget class="QLabel" name="label_8" > + <property name="text" > + <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"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You can control how calibre detects chapters using a XPath expression. To learn how to use XPath expressions see the <a href="https://calibre.kovidgoyal.net/user_manual/xpath.html"><span style=" text-decoration: underline; color:#0000ff;">XPath tutorial</span></a></p></body></html></string> - </property> - <property name="textFormat" > - <enum>Qt::RichText</enum> - </property> - <property name="wordWrap" > - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QComboBox" name="opt_chapter_mark" /> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_9" > - <property name="text" > - <string>Chapter &mark:</string> - </property> - <property name="buddy" > - <cstring>opt_chapter_mark</cstring> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_7" > - <property name="title" > - <string>Automatic &Table of Contents</string> - </property> - <layout class="QGridLayout" name="gridLayout_5" > - <item row="2" column="1" > - <widget class="QSpinBox" name="opt_max_toc_links" /> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_10" > - <property name="text" > - <string>Number of &links to add to Table of Contents</string> - </property> - <property name="buddy" > - <cstring>opt_max_toc_links</cstring> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QCheckBox" name="opt_no_chapters_in_toc" > - <property name="text" > - <string>Do not add &detected chapters to the Table of Contents</string> - </property> - </widget> - </item> - <item row="3" column="1" > - <widget class="QSpinBox" name="opt_toc_threshold" /> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_16" > - <property name="text" > - <string>Chapter &threshold</string> - </property> - <property name="buddy" > - <cstring>opt_toc_threshold</cstring> - </property> - </widget> - </item> - <item row="0" column="0" > - <widget class="QCheckBox" name="opt_use_auto_toc" > - <property name="text" > - <string>&Force use of auto-generated Table of Contents</string> - </property> - </widget> - </item> - <item row="4" column="1" > - <widget class="QLineEdit" name="opt_level1_toc" /> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_19" > - <property name="text" > - <string>Level &1 TOC</string> - </property> - <property name="buddy" > - <cstring>opt_level1_toc</cstring> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="label_20" > - <property name="text" > - <string>Level &2 TOC</string> - </property> - <property name="buddy" > - <cstring>opt_level2_toc</cstring> - </property> - </widget> - </item> - <item row="5" column="1" > - <widget class="QLineEdit" name="opt_level2_toc" /> - </item> - <item row="6" column="1" > - <widget class="QLineEdit" name="opt_toc_title" /> - </item> - <item row="6" column="0" > - <widget class="QLabel" name="toc_title_label" > - <property name="text" > - <string>&Title for generated TOC</string> - </property> - <property name="buddy" > - <cstring>opt_toc_title</cstring> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </item> - <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> + </property> + <property name="textFormat" > + <enum>Qt::RichText</enum> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QComboBox" name="opt_chapter_mark" /> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_9" > + <property name="text" > + <string>Chapter &mark:</string> + </property> + <property name="buddy" > + <cstring>opt_chapter_mark</cstring> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_7" > + <property name="title" > + <string>Automatic &Table of Contents</string> + </property> + <layout class="QGridLayout" name="gridLayout_5" > + <item row="2" column="1" > + <widget class="QSpinBox" name="opt_max_toc_links" /> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_10" > + <property name="text" > + <string>Number of &links to add to Table of Contents</string> + </property> + <property name="buddy" > + <cstring>opt_max_toc_links</cstring> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QCheckBox" name="opt_no_chapters_in_toc" > + <property name="text" > + <string>Do not add &detected chapters to the Table of Contents</string> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QSpinBox" name="opt_toc_threshold" /> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_16" > + <property name="text" > + <string>Chapter &threshold</string> + </property> + <property name="buddy" > + <cstring>opt_toc_threshold</cstring> + </property> + </widget> + </item> + <item row="0" column="0" > + <widget class="QCheckBox" name="opt_use_auto_toc" > + <property name="text" > + <string>&Force use of auto-generated Table of Contents</string> + </property> + </widget> + </item> + <item row="4" column="1" > + <widget class="QLineEdit" name="opt_level1_toc" /> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="label_19" > + <property name="text" > + <string>Level &1 TOC</string> + </property> + <property name="buddy" > + <cstring>opt_level1_toc</cstring> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="label_20" > + <property name="text" > + <string>Level &2 TOC</string> + </property> + <property name="buddy" > + <cstring>opt_level2_toc</cstring> + </property> + </widget> + </item> + <item row="5" column="1" > + <widget class="QLineEdit" name="opt_level2_toc" /> + </item> + <item row="6" column="1" > + <widget class="QLineEdit" name="opt_toc_title" /> + </item> + <item row="6" column="0" > + <widget class="QLabel" name="toc_title_label" > + <property name="text" > + <string>&Title for generated TOC</string> + </property> + <property name="buddy" > + <cstring>opt_toc_title</cstring> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> </widget> </item> - <item row="1" column="0" > + <item row="1" column="0" colspan="2" > <widget class="QTextBrowser" name="help_view" > <property name="maximumSize" > <size> @@ -799,6 +807,16 @@ p, li { white-space: pre-wrap; } </property> </widget> </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> </widget> <customwidgets> @@ -820,8 +838,8 @@ p, li { white-space: pre-wrap; } <slot>accept()</slot> <hints> <hint type="sourcelabel" > - <x>222</x> - <y>652</y> + <x>226</x> + <y>684</y> </hint> <hint type="destinationlabel" > <x>157</x> @@ -852,12 +870,12 @@ p, li { white-space: pre-wrap; } <slot>setCurrentIndex(int)</slot> <hints> <hint type="sourcelabel" > - <x>88</x> - <y>42</y> + <x>81</x> + <y>118</y> </hint> <hint type="destinationlabel" > - <x>659</x> - <y>12</y> + <x>866</x> + <y>11</y> </hint> </hints> </connection> diff --git a/src/calibre/gui2/dialogs/lrf_single.ui b/src/calibre/gui2/dialogs/lrf_single.ui index 8ed4799342..12b7bb44f5 100644 --- a/src/calibre/gui2/dialogs/lrf_single.ui +++ b/src/calibre/gui2/dialogs/lrf_single.ui @@ -16,8 +16,8 @@ <iconset resource="../images.qrc" > <normaloff>:/images/convert.svg</normaloff>:/images/convert.svg</iconset> </property> - <layout class="QHBoxLayout" > - <item> + <layout class="QGridLayout" name="gridLayout_2" > + <item rowspan="3" row="0" column="0" > <widget class="QGroupBox" name="category" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > @@ -96,936 +96,903 @@ </layout> </widget> </item> - <item> - <layout class="QVBoxLayout" > - <item> - <layout class="QVBoxLayout" > + <item row="0" column="1" > + <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>664</width> + <height>515</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout" > + <property name="margin" > + <number>0</number> + </property> <item> - <widget class="QGroupBox" name="groupBox_3" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>10</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <widget class="QStackedWidget" name="stack" > + <property name="currentIndex" > + <number>0</number> </property> - <property name="title" > - <string>Options</string> - </property> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QStackedWidget" name="stack" > - <property name="currentIndex" > - <number>1</number> - </property> - <widget class="QWidget" name="metadata_page" > - <layout class="QHBoxLayout" > - <item> - <widget class="QGroupBox" name="groupBox_4" > - <property name="title" > - <string>Book Cover</string> - </property> - <layout class="QGridLayout" > - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <item> - <widget class="ImageView" name="cover" > - <property name="text" > - <string/> - </property> - <property name="pixmap" > - <pixmap resource="../images.qrc" >:/images/book.svg</pixmap> - </property> - <property name="scaledContents" > - <bool>true</bool> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QVBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="margin" > - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_5" > - <property name="text" > - <string>Change &cover image:</string> - </property> - <property name="buddy" > - <cstring>cover_path</cstring> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="margin" > - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="cover_path" > - <property name="readOnly" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="cover_button" > - <property name="toolTip" > - <string>Browse for an image to use as the cover of this book.</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/document_open.svg</normaloff>:/images/document_open.svg</iconset> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item row="2" column="0" > - <widget class="QCheckBox" name="gui_use_metadata_cover" > - <property name="text" > - <string>Use cover from &source file</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <layout class="QVBoxLayout" > + <widget class="QWidget" name="metadata_page" > + <layout class="QHBoxLayout" name="_2" > + <item> + <widget class="QGroupBox" name="groupBox_4" > + <property name="title" > + <string>Book Cover</string> + </property> + <layout class="QGridLayout" name="_3" > + <item row="0" column="0" > + <layout class="QHBoxLayout" name="_4" > <item> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="label" > - <property name="text" > - <string>&Title: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>gui_title</cstring> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="gui_title" > - <property name="toolTip" > - <string>Change the title of this book</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_2" > - <property name="text" > - <string>&Author(s): </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>gui_author</cstring> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="gui_author" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip" > - <string>Change the author(s) of this book. Multiple authors should be separated by an &. If the author name contains an &, use && to represent it.</string> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_6" > - <property name="text" > - <string>Author So&rt:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>gui_author_sort</cstring> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="gui_author_sort" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip" > - <string>Change the author(s) of this book. Multiple authors should be separated by a comma</string> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_3" > - <property name="text" > - <string>&Publisher: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>gui_publisher</cstring> - </property> - </widget> - </item> - <item row="3" column="1" > - <widget class="QLineEdit" name="gui_publisher" > - <property name="toolTip" > - <string>Change the publisher of this book</string> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_4" > - <property name="text" > - <string>Ta&gs: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>tags</cstring> - </property> - </widget> - </item> - <item row="4" column="1" > - <widget class="QLineEdit" name="tags" > - <property name="toolTip" > - <string>Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas.</string> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="label_7" > - <property name="text" > - <string>&Series:</string> - </property> - <property name="textFormat" > - <enum>Qt::PlainText</enum> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>series</cstring> - </property> - </widget> - </item> - <item row="5" column="1" > - <widget class="QComboBox" name="series" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > - <horstretch>10</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip" > - <string>List of known series. You can add new series.</string> - </property> - <property name="whatsThis" > - <string>List of known series. You can add new series.</string> - </property> - <property name="editable" > + <widget class="ImageView" name="cover" > + <property name="text" > + <string/> + </property> + <property name="pixmap" > + <pixmap resource="../images.qrc" >:/images/book.svg</pixmap> + </property> + <property name="scaledContents" > + <bool>true</bool> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + </layout> + </item> + <item row="1" column="0" > + <layout class="QVBoxLayout" name="_5" > + <property name="spacing" > + <number>6</number> + </property> + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_5" > + <property name="text" > + <string>Change &cover image:</string> + </property> + <property name="buddy" > + <cstring>cover_path</cstring> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="_6" > + <property name="spacing" > + <number>6</number> + </property> + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="cover_path" > + <property name="readOnly" > <bool>true</bool> </property> - <property name="insertPolicy" > - <enum>QComboBox::InsertAlphabetically</enum> - </property> - <property name="sizeAdjustPolicy" > - <enum>QComboBox::AdjustToContents</enum> - </property> </widget> </item> - <item row="6" column="1" > - <widget class="QSpinBox" name="series_index" > + <item> + <widget class="QToolButton" name="cover_button" > <property name="toolTip" > - <string>Series index.</string> + <string>Browse for an image to use as the cover of this book.</string> </property> - <property name="whatsThis" > - <string>Series index.</string> + <property name="text" > + <string>...</string> </property> - <property name="prefix" > - <string>Book </string> - </property> - <property name="minimum" > - <number>1</number> - </property> - <property name="maximum" > - <number>10000</number> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/document_open.svg</normaloff>:/images/document_open.svg</iconset> </property> </widget> </item> </layout> </item> - <item> - <widget class="QGroupBox" name="groupBox_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize" > - <size> - <width>16777215</width> - <height>110</height> - </size> - </property> - <property name="title" > - <string>Comments</string> - </property> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QTextEdit" name="gui_comment" > - <property name="maximumSize" > - <size> - <width>16777215</width> - <height>60</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> </layout> </item> + <item row="2" column="0" > + <widget class="QCheckBox" name="gui_use_metadata_cover" > + <property name="text" > + <string>Use cover from &source file</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> </layout> </widget> - <widget class="QWidget" name="lookandfeel_page" > - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="label_8" > - <property name="text" > - <string>Base &font size:</string> - </property> - <property name="buddy" > - <cstring>gui_base_font_size</cstring> - </property> - </widget> - </item> - <item row="0" column="1" colspan="2" > - <widget class="QDoubleSpinBox" name="gui_base_font_size" > - <property name="buttonSymbols" > - <enum>QAbstractSpinBox::PlusMinus</enum> - </property> - <property name="suffix" > - <string> pts</string> - </property> - <property name="decimals" > - <number>1</number> - </property> - <property name="minimum" > - <double>2.000000000000000</double> - </property> - <property name="maximum" > - <double>20.000000000000000</double> - </property> - <property name="singleStep" > - <double>0.100000000000000</double> - </property> - <property name="value" > - <double>10.000000000000000</double> - </property> - </widget> - </item> - <item rowspan="4" row="0" column="4" > - <widget class="QGroupBox" name="groupBox_8" > - <property name="title" > - <string>Embedded Fonts</string> - </property> - <layout class="QGridLayout" > - <item row="0" column="0" colspan="2" > - <widget class="QLabel" name="label_22" > - <property name="text" > - <string>&Serif:</string> - </property> - <property name="buddy" > - <cstring>gui_serif_family</cstring> - </property> - </widget> - </item> - <item row="0" column="2" > - <widget class="QComboBox" name="gui_serif_family" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_23" > - <property name="text" > - <string>S&ans-serif:</string> - </property> - <property name="buddy" > - <cstring>gui_sans_family</cstring> - </property> - </widget> - </item> - <item row="1" column="1" colspan="2" > - <widget class="QComboBox" name="gui_sans_family" /> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_24" > - <property name="text" > - <string>&Monospace:</string> - </property> - <property name="buddy" > - <cstring>gui_mono_family</cstring> - </property> - </widget> - </item> - <item row="2" column="1" colspan="2" > - <widget class="QComboBox" name="gui_mono_family" /> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_26" > - <property name="text" > - <string>Source en&coding:</string> - </property> - <property name="buddy" > - <cstring>gui_encoding</cstring> - </property> - </widget> - </item> - <item row="3" column="1" colspan="2" > - <widget class="QLineEdit" name="gui_encoding" /> - </item> - </layout> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_25" > - <property name="text" > - <string>Minimum &indent:</string> - </property> - <property name="buddy" > - <cstring>gui_minimum_indent</cstring> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QDoubleSpinBox" name="gui_minimum_indent" > - <property name="buttonSymbols" > - <enum>QAbstractSpinBox::PlusMinus</enum> - </property> - <property name="suffix" > - <string> pts</string> - </property> - <property name="decimals" > - <number>1</number> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_9" > - <property name="text" > - <string>&Word spacing:</string> - </property> - <property name="textFormat" > - <enum>Qt::PlainText</enum> - </property> - <property name="buddy" > - <cstring>gui_wordspace</cstring> - </property> - </widget> - </item> - <item row="2" column="1" colspan="2" > - <widget class="QDoubleSpinBox" name="gui_wordspace" > - <property name="buttonSymbols" > - <enum>QAbstractSpinBox::PlusMinus</enum> - </property> - <property name="suffix" > - <string> pts</string> - </property> - <property name="decimals" > - <number>1</number> - </property> - <property name="minimum" > - <double>0.000000000000000</double> - </property> - <property name="maximum" > - <double>10.000000000000000</double> - </property> - <property name="singleStep" > - <double>0.100000000000000</double> - </property> - <property name="value" > - <double>2.500000000000000</double> - </property> - </widget> - </item> - <item row="3" column="0" colspan="4" > - <layout class="QVBoxLayout" > - <item> - <widget class="QCheckBox" name="gui_autorotation" > - <property name="text" > - <string>Enable auto &rotation of images</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="gui_blank_after_para" > - <property name="text" > - <string>Insert &blank lines between paragraphs</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="gui_ignore_tables" > - <property name="text" > - <string>Ignore &tables</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="gui_ignore_colors" > - <property name="text" > - <string>Ignore &colors</string> - </property> - </widget> + </item> + <item> + <layout class="QVBoxLayout" name="_7" > + <item> + <layout class="QGridLayout" name="_8" > + <item row="0" column="0" > + <widget class="QLabel" name="label" > + <property name="text" > + <string>&Title: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>gui_title</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="gui_title" > + <property name="toolTip" > + <string>Change the title of this book</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>&Author(s): </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>gui_author</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QLineEdit" name="gui_author" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip" > + <string>Change the author(s) of this book. Multiple authors should be separated by an &. If the author name contains an &, use && to represent it.</string> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_6" > + <property name="text" > + <string>Author So&rt:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>gui_author_sort</cstring> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QLineEdit" name="gui_author_sort" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip" > + <string>Change the author(s) of this book. Multiple authors should be separated by a comma</string> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_3" > + <property name="text" > + <string>&Publisher: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>gui_publisher</cstring> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QLineEdit" name="gui_publisher" > + <property name="toolTip" > + <string>Change the publisher of this book</string> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="label_4" > + <property name="text" > + <string>Ta&gs: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>tags</cstring> + </property> + </widget> + </item> + <item row="4" column="1" > + <widget class="QLineEdit" name="tags" > + <property name="toolTip" > + <string>Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas.</string> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="label_7" > + <property name="text" > + <string>&Series:</string> + </property> + <property name="textFormat" > + <enum>Qt::PlainText</enum> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>series</cstring> + </property> + </widget> + </item> + <item row="5" column="1" > + <widget class="QComboBox" name="series" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>10</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip" > + <string>List of known series. You can add new series.</string> + </property> + <property name="whatsThis" > + <string>List of known series. You can add new series.</string> + </property> + <property name="editable" > + <bool>true</bool> + </property> + <property name="insertPolicy" > + <enum>QComboBox::InsertAlphabetically</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item row="6" column="1" > + <widget class="QSpinBox" name="series_index" > + <property name="toolTip" > + <string>Series index.</string> + </property> + <property name="whatsThis" > + <string>Series index.</string> + </property> + <property name="prefix" > + <string>Book </string> + </property> + <property name="minimum" > + <number>1</number> + </property> + <property name="maximum" > + <number>10000</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Comments</string> + </property> + <layout class="QGridLayout" name="_9" > + <item row="0" column="0" > + <widget class="QTextEdit" name="gui_comment" /> </item> </layout> - </item> - <item row="4" column="0" colspan="2" > - <widget class="QLabel" name="label_16" > + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="lookandfeel_page" > + <layout class="QGridLayout" name="_10" > + <item row="0" column="0" > + <widget class="QLabel" name="label_8" > + <property name="text" > + <string>Base &font size:</string> + </property> + <property name="buddy" > + <cstring>gui_base_font_size</cstring> + </property> + </widget> + </item> + <item row="0" column="1" colspan="2" > + <widget class="QDoubleSpinBox" name="gui_base_font_size" > + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::PlusMinus</enum> + </property> + <property name="suffix" > + <string> pts</string> + </property> + <property name="decimals" > + <number>1</number> + </property> + <property name="minimum" > + <double>2.000000000000000</double> + </property> + <property name="maximum" > + <double>20.000000000000000</double> + </property> + <property name="singleStep" > + <double>0.100000000000000</double> + </property> + <property name="value" > + <double>10.000000000000000</double> + </property> + </widget> + </item> + <item rowspan="4" row="0" column="4" > + <widget class="QGroupBox" name="groupBox_8" > + <property name="title" > + <string>Embedded Fonts</string> + </property> + <layout class="QGridLayout" name="_11" > + <item row="0" column="0" colspan="2" > + <widget class="QLabel" name="label_22" > <property name="text" > - <string>&Preprocess:</string> + <string>&Serif:</string> </property> <property name="buddy" > - <cstring>preprocess</cstring> + <cstring>gui_serif_family</cstring> </property> </widget> </item> - <item row="4" column="3" colspan="2" > - <widget class="QComboBox" name="preprocess" /> - </item> - <item row="5" column="0" colspan="5" > - <widget class="QGroupBox" name="groupBox_5" > + <item row="0" column="2" > + <widget class="QComboBox" name="gui_serif_family" > <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="title" > - <string>Header</string> - </property> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QCheckBox" name="gui_header" > - <property name="text" > - <string>&Show header</string> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_10" > - <property name="text" > - <string>&Header format:</string> - </property> - <property name="buddy" > - <cstring>gui_headerformat</cstring> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="gui_headerformat" /> - </item> - <item row="1" column="1" > - <widget class="QSpinBox" name="gui_header_separation" > - <property name="suffix" > - <string> px</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_29" > - <property name="text" > - <string>Header &separation:</string> - </property> - <property name="buddy" > - <cstring>gui_header_separation</cstring> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="6" column="0" colspan="2" > - <widget class="QLabel" name="label_21" > - <property name="text" > - <string>Override<br>CSS</string> - </property> - </widget> - </item> - <item row="6" column="2" colspan="3" > - <widget class="QTextEdit" name="gui_override_css" /> - </item> - </layout> - </widget> - <widget class="QWidget" name="pagesetup_page" > - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="label_11" > - <property name="text" > - <string>&Profile:</string> - </property> - <property name="buddy" > - <cstring>gui_profile</cstring> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QComboBox" name="gui_profile" > - <property name="currentIndex" > - <number>-1</number> - </property> - <property name="minimumContentsLength" > - <number>1</number> - </property> </widget> </item> <item row="1" column="0" > - <widget class="QLabel" name="label_12" > + <widget class="QLabel" name="label_23" > <property name="text" > - <string>&Left Margin:</string> + <string>S&ans-serif:</string> </property> <property name="buddy" > - <cstring>gui_left_margin</cstring> + <cstring>gui_sans_family</cstring> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QSpinBox" name="gui_left_margin" > - <property name="suffix" > - <string> px</string> + <item row="1" column="1" colspan="2" > + <widget class="QComboBox" name="gui_sans_family" /> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_24" > + <property name="text" > + <string>&Monospace:</string> </property> - <property name="maximum" > - <number>200</number> + <property name="buddy" > + <cstring>gui_mono_family</cstring> </property> - <property name="value" > - <number>20</number> + </widget> + </item> + <item row="2" column="1" colspan="2" > + <widget class="QComboBox" name="gui_mono_family" /> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_26" > + <property name="text" > + <string>Source en&coding:</string> + </property> + <property name="buddy" > + <cstring>gui_encoding</cstring> + </property> + </widget> + </item> + <item row="3" column="1" colspan="2" > + <widget class="QLineEdit" name="gui_encoding" /> + </item> + </layout> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_25" > + <property name="text" > + <string>Minimum &indent:</string> + </property> + <property name="buddy" > + <cstring>gui_minimum_indent</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QDoubleSpinBox" name="gui_minimum_indent" > + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::PlusMinus</enum> + </property> + <property name="suffix" > + <string> pts</string> + </property> + <property name="decimals" > + <number>1</number> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_9" > + <property name="text" > + <string>&Word spacing:</string> + </property> + <property name="textFormat" > + <enum>Qt::PlainText</enum> + </property> + <property name="buddy" > + <cstring>gui_wordspace</cstring> + </property> + </widget> + </item> + <item row="2" column="1" colspan="2" > + <widget class="QDoubleSpinBox" name="gui_wordspace" > + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::PlusMinus</enum> + </property> + <property name="suffix" > + <string> pts</string> + </property> + <property name="decimals" > + <number>1</number> + </property> + <property name="minimum" > + <double>0.000000000000000</double> + </property> + <property name="maximum" > + <double>10.000000000000000</double> + </property> + <property name="singleStep" > + <double>0.100000000000000</double> + </property> + <property name="value" > + <double>2.500000000000000</double> + </property> + </widget> + </item> + <item row="3" column="0" colspan="4" > + <layout class="QVBoxLayout" name="_12" > + <item> + <widget class="QCheckBox" name="gui_autorotation" > + <property name="text" > + <string>Enable auto &rotation of images</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="gui_blank_after_para" > + <property name="text" > + <string>Insert &blank lines between paragraphs</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="gui_ignore_tables" > + <property name="text" > + <string>Ignore &tables</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="gui_ignore_colors" > + <property name="text" > + <string>Ignore &colors</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="4" column="0" colspan="2" > + <widget class="QLabel" name="label_16" > + <property name="text" > + <string>&Preprocess:</string> + </property> + <property name="buddy" > + <cstring>preprocess</cstring> + </property> + </widget> + </item> + <item row="4" column="3" colspan="2" > + <widget class="QComboBox" name="preprocess" /> + </item> + <item row="5" column="0" colspan="5" > + <widget class="QGroupBox" name="groupBox_5" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Header</string> + </property> + <layout class="QGridLayout" name="_13" > + <item row="0" column="0" > + <widget class="QCheckBox" name="gui_header" > + <property name="text" > + <string>&Show header</string> </property> </widget> </item> <item row="2" column="0" > - <widget class="QLabel" name="label_13" > + <widget class="QLabel" name="label_10" > <property name="text" > - <string>&Right Margin:</string> + <string>&Header format:</string> </property> <property name="buddy" > - <cstring>gui_right_margin</cstring> + <cstring>gui_headerformat</cstring> </property> </widget> </item> <item row="2" column="1" > - <widget class="QSpinBox" name="gui_right_margin" > + <widget class="QLineEdit" name="gui_headerformat" /> + </item> + <item row="1" column="1" > + <widget class="QSpinBox" name="gui_header_separation" > <property name="suffix" > <string> px</string> </property> - <property name="maximum" > - <number>200</number> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_29" > + <property name="text" > + <string>Header &separation:</string> </property> - <property name="value" > - <number>20</number> + <property name="buddy" > + <cstring>gui_header_separation</cstring> </property> </widget> </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_14" > + </layout> + </widget> + </item> + <item row="6" column="0" colspan="2" > + <widget class="QLabel" name="label_21" > + <property name="text" > + <string>Override<br>CSS</string> + </property> + </widget> + </item> + <item row="6" column="2" colspan="3" > + <widget class="QTextEdit" name="gui_override_css" /> + </item> + </layout> + </widget> + <widget class="QWidget" name="pagesetup_page" > + <layout class="QGridLayout" name="_14" > + <item row="0" column="0" > + <widget class="QLabel" name="label_11" > + <property name="text" > + <string>&Profile:</string> + </property> + <property name="buddy" > + <cstring>gui_profile</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QComboBox" name="gui_profile" > + <property name="currentIndex" > + <number>-1</number> + </property> + <property name="minimumContentsLength" > + <number>1</number> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_12" > + <property name="text" > + <string>&Left Margin:</string> + </property> + <property name="buddy" > + <cstring>gui_left_margin</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QSpinBox" name="gui_left_margin" > + <property name="suffix" > + <string> px</string> + </property> + <property name="maximum" > + <number>200</number> + </property> + <property name="value" > + <number>20</number> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_13" > + <property name="text" > + <string>&Right Margin:</string> + </property> + <property name="buddy" > + <cstring>gui_right_margin</cstring> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QSpinBox" name="gui_right_margin" > + <property name="suffix" > + <string> px</string> + </property> + <property name="maximum" > + <number>200</number> + </property> + <property name="value" > + <number>20</number> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_14" > + <property name="text" > + <string>&Top Margin:</string> + </property> + <property name="buddy" > + <cstring>gui_top_margin</cstring> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QSpinBox" name="gui_top_margin" > + <property name="suffix" > + <string> px</string> + </property> + <property name="maximum" > + <number>200</number> + </property> + <property name="value" > + <number>10</number> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="label_15" > + <property name="text" > + <string>&Bottom Margin:</string> + </property> + <property name="buddy" > + <cstring>gui_bottom_margin</cstring> + </property> + </widget> + </item> + <item row="4" column="1" > + <widget class="QSpinBox" name="gui_bottom_margin" > + <property name="suffix" > + <string> px</string> + </property> + <property name="maximum" > + <number>200</number> + </property> + <property name="value" > + <number>0</number> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QCheckBox" name="gui_render_tables_as_images" > + <property name="text" > + <string>&Convert tables to images (good for large/complex tables)</string> + </property> + </widget> + </item> + <item row="6" column="0" > + <widget class="QLabel" name="label_27" > + <property name="text" > + <string>&Multiplier for text size in rendered tables:</string> + </property> + <property name="buddy" > + <cstring>gui_text_size_multiplier_for_rendered_tables</cstring> + </property> + </widget> + </item> + <item row="6" column="1" > + <widget class="QDoubleSpinBox" name="gui_text_size_multiplier_for_rendered_tables" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="decimals" > + <number>2</number> + </property> + <property name="minimum" > + <double>0.100000000000000</double> + </property> + <property name="value" > + <double>1.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="chapterdetection_page" > + <layout class="QVBoxLayout" name="_15" > + <item> + <widget class="QGroupBox" name="groupBox_6" > + <property name="title" > + <string>Title based detection</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" colspan="2" > + <widget class="QCheckBox" name="gui_disable_chapter_detection" > <property name="text" > - <string>&Top Margin:</string> + <string>&Disable chapter detection</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_17" > + <property name="text" > + <string>&Regular expression:</string> </property> <property name="buddy" > - <cstring>gui_top_margin</cstring> + <cstring>gui_chapter_regex</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QLineEdit" name="gui_chapter_regex" /> + </item> + <item row="2" column="0" colspan="2" > + <widget class="QCheckBox" name="gui_add_chapters_to_toc" > + <property name="text" > + <string>Add &chapters to table of contents</string> + </property> + </widget> + </item> + <item row="3" column="0" colspan="2" > + <widget class="QCheckBox" name="gui_no_links_in_toc" > + <property name="text" > + <string>Don't add &links to the table of contents</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_7" > + <property name="title" > + <string>Tag based detection</string> + </property> + <layout class="QGridLayout" name="_16" > + <item row="0" column="0" > + <widget class="QLabel" name="label_18" > + <property name="text" > + <string>&Page break before tag:</string> + </property> + <property name="buddy" > + <cstring>gui_page_break_before_tag</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="gui_page_break_before_tag" /> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_19" > + <property name="text" > + <string>&Force page break before tag:</string> + </property> + <property name="buddy" > + <cstring>gui_force_page_break_before_tag</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QLineEdit" name="gui_force_page_break_before_tag" /> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_20" > + <property name="text" > + <string>Force page break before &attribute:</string> + </property> + <property name="buddy" > + <cstring>gui_force_page_break_before_attr</cstring> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QLineEdit" name="gui_force_page_break_before_attr" /> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_28" > + <property name="text" > + <string>Detect chapter &at tag:</string> + </property> + <property name="buddy" > + <cstring>gui_chapter_attr</cstring> </property> </widget> </item> <item row="3" column="1" > - <widget class="QSpinBox" name="gui_top_margin" > - <property name="suffix" > - <string> px</string> - </property> - <property name="maximum" > - <number>200</number> - </property> - <property name="value" > - <number>10</number> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_15" > - <property name="text" > - <string>&Bottom Margin:</string> - </property> - <property name="buddy" > - <cstring>gui_bottom_margin</cstring> - </property> - </widget> - </item> - <item row="4" column="1" > - <widget class="QSpinBox" name="gui_bottom_margin" > - <property name="suffix" > - <string> px</string> - </property> - <property name="maximum" > - <number>200</number> - </property> - <property name="value" > - <number>0</number> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QCheckBox" name="gui_render_tables_as_images" > - <property name="text" > - <string>&Convert tables to images (good for large/complex tables)</string> - </property> - </widget> - </item> - <item row="6" column="0" > - <widget class="QLabel" name="label_27" > - <property name="text" > - <string>&Multiplier for text size in rendered tables:</string> - </property> - <property name="buddy" > - <cstring>gui_text_size_multiplier_for_rendered_tables</cstring> - </property> - </widget> - </item> - <item row="6" column="1" > - <widget class="QDoubleSpinBox" name="gui_text_size_multiplier_for_rendered_tables" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="decimals" > - <number>2</number> - </property> - <property name="minimum" > - <double>0.100000000000000</double> - </property> - <property name="value" > - <double>1.000000000000000</double> - </property> - </widget> + <widget class="QLineEdit" name="gui_chapter_attr" /> </item> </layout> </widget> - <widget class="QWidget" name="chapterdetection_page" > - <layout class="QVBoxLayout" > - <item> - <widget class="QGroupBox" name="groupBox_6" > - <property name="title" > - <string>Title based detection</string> - </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" colspan="2" > - <widget class="QCheckBox" name="gui_disable_chapter_detection" > - <property name="text" > - <string>&Disable chapter detection</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_17" > - <property name="text" > - <string>&Regular expression:</string> - </property> - <property name="buddy" > - <cstring>gui_chapter_regex</cstring> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="gui_chapter_regex" /> - </item> - <item row="2" column="0" colspan="2" > - <widget class="QCheckBox" name="gui_add_chapters_to_toc" > - <property name="text" > - <string>Add &chapters to table of contents</string> - </property> - </widget> - </item> - <item row="3" column="0" colspan="2" > - <widget class="QCheckBox" name="gui_no_links_in_toc" > - <property name="text" > - <string>Don't add &links to the table of contents</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_7" > - <property name="title" > - <string>Tag based detection</string> - </property> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="label_18" > - <property name="text" > - <string>&Page break before tag:</string> - </property> - <property name="buddy" > - <cstring>gui_page_break_before_tag</cstring> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="gui_page_break_before_tag" /> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_19" > - <property name="text" > - <string>&Force page break before tag:</string> - </property> - <property name="buddy" > - <cstring>gui_force_page_break_before_tag</cstring> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="gui_force_page_break_before_tag" /> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_20" > - <property name="text" > - <string>Force page break before &attribute:</string> - </property> - <property name="buddy" > - <cstring>gui_force_page_break_before_attr</cstring> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="gui_force_page_break_before_attr" /> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_28" > - <property name="text" > - <string>Detect chapter &at tag:</string> - </property> - <property name="buddy" > - <cstring>gui_chapter_attr</cstring> - </property> - </widget> - </item> - <item row="3" column="1" > - <widget class="QLineEdit" name="gui_chapter_attr" /> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </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> - </widget> - </item> - <item> - <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" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize" > - <size> - <width>0</width> - <height>60</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>16777215</width> - <height>150</height> - </size> - </property> - <property name="html" > - <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"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; 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> - </property> - </widget> - </item> - </layout> + </item> + </layout> + </widget> </widget> </item> </layout> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - <property name="centerButtons" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> + </widget> + </widget> + </item> + <item row="1" column="1" > + <widget class="QTextBrowser" name="help_view" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>60</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>120</height> + </size> + </property> + <property name="html" > + <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"> +p, li { white-space: pre-wrap; } +</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;"></p></body></html></string> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + <property name="centerButtons" > + <bool>false</bool> + </property> + </widget> </item> </layout> </widget> @@ -1079,108 +1046,12 @@ p, li { white-space: pre-wrap; } <slot>setCurrentIndex(int)</slot> <hints> <hint type="sourcelabel" > - <x>184</x> - <y>279</y> + <x>96</x> + <y>120</y> </hint> <hint type="destinationlabel" > - <x>368</x> - <y>185</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> + <x>539</x> + <y>220</y> </hint> </hints> </connection> diff --git a/src/calibre/gui2/dialogs/metadata_single.py b/src/calibre/gui2/dialogs/metadata_single.py index 4915c87e7d..385e105c3a 100644 --- a/src/calibre/gui2/dialogs/metadata_single.py +++ b/src/calibre/gui2/dialogs/metadata_single.py @@ -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, \ - 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.fetch_metadata import FetchMetadata 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])) 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): pix = QPixmap(':/images/book.svg') @@ -164,9 +164,7 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog): self.db.remove_format(self.row, ext, notify=False) def __init__(self, window, row, db, accepted_callback=None): - QDialog.__init__(self, window) - Ui_MetadataSingleDialog.__init__(self) - self.setupUi(self) + ResizableDialog.__init__(self, window) self.bc_box.layout().setAlignment(self.cover, Qt.AlignCenter|Qt.AlignHCenter) self.splitter.setStretchFactor(100, 1) self.db = db diff --git a/src/calibre/gui2/dialogs/metadata_single.ui b/src/calibre/gui2/dialogs/metadata_single.ui index b2e2108ec3..7f3a8465a0 100644 --- a/src/calibre/gui2/dialogs/metadata_single.ui +++ b/src/calibre/gui2/dialogs/metadata_single.ui @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>923</width> - <height>715</height> + <width>887</width> + <height>740</height> </rect> </property> <property name="sizePolicy" > @@ -28,551 +28,588 @@ <property name="modal" > <bool>true</bool> </property> - <layout class="QVBoxLayout" name="verticalLayout_3" > + <layout class="QVBoxLayout" name="verticalLayout_6" > <item> - <widget class="QSplitter" name="splitter" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> + <widget class="QScrollArea" name="scrollArea" > + <property name="frameShape" > + <enum>QFrame::NoFrame</enum> </property> - <widget class="QWidget" name="layoutWidget" > - <layout class="QVBoxLayout" > + <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="QGroupBox" name="meta_box" > - <property name="title" > - <string>Meta information</string> + <widget class="QWidget" native="1" name="central_widget" > + <property name="minimumSize" > + <size> + <width>800</width> + <height>685</height> + </size> </property> - <layout class="QGridLayout" name="gridLayout_3" > - <item row="0" column="0" > - <widget class="QLabel" name="label" > - <property name="text" > - <string>&Title: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>title</cstring> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="title" > - <property name="toolTip" > - <string>Change the title of this book</string> - </property> - </widget> - </item> - <item rowspan="2" row="0" column="2" > - <widget class="QToolButton" name="swap_button" > - <property name="toolTip" > - <string>Swap the author and title</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/swap.svg</normaloff>:/images/swap.svg</iconset> - </property> - <property name="iconSize" > - <size> - <width>16</width> - <height>16</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_2" > - <property name="text" > - <string>&Author(s): </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>authors</cstring> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_8" > - <property name="text" > - <string>Author S&ort: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>author_sort</cstring> - </property> - </widget> - </item> - <item row="2" column="1" colspan="2" > - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="QLineEdit" name="author_sort" > - <property name="toolTip" > - <string>Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles.</string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="auto_author_sort" > - <property name="toolTip" > - <string>Automatically create the author sort entry based on the current author entry</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/auto_author_sort.svg</normaloff>:/images/auto_author_sort.svg</iconset> - </property> - </widget> - </item> - </layout> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_6" > - <property name="text" > - <string>&Rating:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>rating</cstring> - </property> - </widget> - </item> - <item row="3" column="1" colspan="2" > - <widget class="QSpinBox" name="rating" > - <property name="toolTip" > - <string>Rating of this book. 0-5 stars</string> - </property> - <property name="whatsThis" > - <string>Rating of this book. 0-5 stars</string> - </property> - <property name="buttonSymbols" > - <enum>QAbstractSpinBox::PlusMinus</enum> - </property> - <property name="suffix" > - <string> stars</string> - </property> - <property name="maximum" > - <number>5</number> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_3" > - <property name="text" > - <string>&Publisher: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>publisher</cstring> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="label_4" > - <property name="text" > - <string>Ta&gs: </string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>tags</cstring> - </property> - </widget> - </item> - <item row="5" column="1" colspan="2" > - <layout class="QHBoxLayout" > - <item> - <widget class="QLineEdit" name="tags" > - <property name="toolTip" > - <string>Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas.</string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tag_editor_button" > - <property name="toolTip" > - <string>Open Tag Editor</string> - </property> - <property name="text" > - <string>Open Tag Editor</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/chapters.svg</normaloff>:/images/chapters.svg</iconset> - </property> - </widget> - </item> - </layout> - </item> - <item row="6" column="0" > - <widget class="QLabel" name="label_7" > - <property name="text" > - <string>&Series:</string> - </property> - <property name="textFormat" > - <enum>Qt::PlainText</enum> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>series</cstring> - </property> - </widget> - </item> - <item row="6" column="1" colspan="2" > - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>5</number> - </property> - <item> - <widget class="QComboBox" name="series" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip" > - <string>List of known series. You can add new series.</string> - </property> - <property name="whatsThis" > - <string>List of known series. You can add new series.</string> - </property> - <property name="editable" > - <bool>true</bool> - </property> - <property name="insertPolicy" > - <enum>QComboBox::InsertAlphabetically</enum> - </property> - <property name="sizeAdjustPolicy" > - <enum>QComboBox::AdjustToContents</enum> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="remove_series_button" > - <property name="toolTip" > - <string>Remove unused series (Series that have no books)</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/trash.svg</normaloff>:/images/trash.svg</iconset> - </property> - </widget> - </item> - </layout> - </item> - <item row="7" column="1" colspan="2" > - <widget class="QSpinBox" name="series_index" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="toolTip" > - <string>Series index.</string> - </property> - <property name="whatsThis" > - <string>Series index.</string> - </property> - <property name="prefix" > - <string>Book </string> - </property> - <property name="minimum" > - <number>1</number> - </property> - <property name="maximum" > - <number>10000</number> - </property> - </widget> - </item> - <item row="8" column="0" > - <widget class="QLabel" name="label_9" > - <property name="text" > - <string>IS&BN:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy" > - <cstring>isbn</cstring> - </property> - </widget> - </item> - <item row="8" column="1" colspan="2" > - <widget class="QLineEdit" name="isbn" /> - </item> - <item row="4" column="1" > - <widget class="QComboBox" name="publisher" > - <property name="editable" > - <bool>true</bool> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="authors" /> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_2" > - <property name="title" > - <string>Comments</string> - </property> - <layout class="QGridLayout" name="gridLayout_4" > - <item row="0" column="0" > - <widget class="QTextEdit" name="comments" /> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QPushButton" name="fetch_metadata_button" > - <property name="text" > - <string>Fetch metadata from server</string> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="layoutWidget" > - <layout class="QVBoxLayout" name="verticalLayout_2" > - <item> - <widget class="QGroupBox" name="af_group_box" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title" > - <string>Available Formats</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout" > + <layout class="QVBoxLayout" name="verticalLayout_3" > <item> - <layout class="QGridLayout" name="gridLayout" > - <item rowspan="3" row="0" column="0" > - <widget class="QListWidget" name="formats" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize" > - <size> - <width>16777215</width> - <height>130</height> - </size> - </property> - <property name="iconSize" > - <size> - <width>64</width> - <height>64</height> - </size> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QToolButton" name="add_format_button" > - <property name="toolTip" > - <string>Add a new format for this book to the database</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/add_book.svg</normaloff>:/images/add_book.svg</iconset> - </property> - <property name="iconSize" > - <size> - <width>32</width> - <height>32</height> - </size> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QToolButton" name="remove_format_button" > - <property name="toolTip" > - <string>Remove the selected formats for this book from the database.</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/trash.svg</normaloff>:/images/trash.svg</iconset> - </property> - <property name="iconSize" > - <size> - <width>32</width> - <height>32</height> - </size> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QToolButton" name="button_set_cover" > - <property name="toolTip" > - <string>Set the cover for the book from the selected format</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/book.svg</normaloff>:/images/book.svg</iconset> - </property> - <property name="iconSize" > - <size> - <width>32</width> - <height>32</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - </layout> - <zorder></zorder> - </widget> - </item> - <item> - <widget class="QGroupBox" name="bc_box" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > - <horstretch>0</horstretch> - <verstretch>10</verstretch> - </sizepolicy> - </property> - <property name="title" > - <string>Book Cover</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4" > - <item> - <widget class="ImageView" name="cover" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <widget class="QSplitter" name="splitter" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> </property> - <property name="text" > - <string/> - </property> - <property name="pixmap" > - <pixmap resource="../images.qrc" >:/images/book.svg</pixmap> - </property> - <property name="scaledContents" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="sizeConstraint" > - <enum>QLayout::SetMaximumSize</enum> - </property> - <property name="margin" > - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_5" > - <property name="text" > - <string>Change &cover image:</string> - </property> - <property name="buddy" > - <cstring>cover_path</cstring> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="margin" > - <number>0</number> - </property> + <widget class="QWidget" name="layoutWidget" > + <layout class="QVBoxLayout" > <item> - <widget class="QLineEdit" name="cover_path" > - <property name="readOnly" > - <bool>true</bool> + <widget class="QGroupBox" name="meta_box" > + <property name="title" > + <string>Meta information</string> </property> + <layout class="QGridLayout" name="gridLayout_3" > + <item row="0" column="0" > + <widget class="QLabel" name="label" > + <property name="text" > + <string>&Title: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>title</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="title" > + <property name="toolTip" > + <string>Change the title of this book</string> + </property> + </widget> + </item> + <item rowspan="2" row="0" column="2" > + <widget class="QToolButton" name="swap_button" > + <property name="toolTip" > + <string>Swap the author and title</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/swap.svg</normaloff>:/images/swap.svg</iconset> + </property> + <property name="iconSize" > + <size> + <width>16</width> + <height>16</height> + </size> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>&Author(s): </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>authors</cstring> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_8" > + <property name="text" > + <string>Author S&ort: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>author_sort</cstring> + </property> + </widget> + </item> + <item row="2" column="1" colspan="2" > + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="QLineEdit" name="author_sort" > + <property name="toolTip" > + <string>Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles.</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="auto_author_sort" > + <property name="toolTip" > + <string>Automatically create the author sort entry based on the current author entry</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/auto_author_sort.svg</normaloff>:/images/auto_author_sort.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_6" > + <property name="text" > + <string>&Rating:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>rating</cstring> + </property> + </widget> + </item> + <item row="3" column="1" colspan="2" > + <widget class="QSpinBox" name="rating" > + <property name="toolTip" > + <string>Rating of this book. 0-5 stars</string> + </property> + <property name="whatsThis" > + <string>Rating of this book. 0-5 stars</string> + </property> + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::PlusMinus</enum> + </property> + <property name="suffix" > + <string> stars</string> + </property> + <property name="maximum" > + <number>5</number> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="label_3" > + <property name="text" > + <string>&Publisher: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>publisher</cstring> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="label_4" > + <property name="text" > + <string>Ta&gs: </string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>tags</cstring> + </property> + </widget> + </item> + <item row="5" column="1" colspan="2" > + <layout class="QHBoxLayout" name="_2" > + <item> + <widget class="QLineEdit" name="tags" > + <property name="toolTip" > + <string>Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas.</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="tag_editor_button" > + <property name="toolTip" > + <string>Open Tag Editor</string> + </property> + <property name="text" > + <string>Open Tag Editor</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/chapters.svg</normaloff>:/images/chapters.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + <item row="6" column="0" > + <widget class="QLabel" name="label_7" > + <property name="text" > + <string>&Series:</string> + </property> + <property name="textFormat" > + <enum>Qt::PlainText</enum> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>series</cstring> + </property> + </widget> + </item> + <item row="6" column="1" colspan="2" > + <layout class="QHBoxLayout" name="_3" > + <property name="spacing" > + <number>5</number> + </property> + <item> + <widget class="QComboBox" name="series" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip" > + <string>List of known series. You can add new series.</string> + </property> + <property name="whatsThis" > + <string>List of known series. You can add new series.</string> + </property> + <property name="editable" > + <bool>true</bool> + </property> + <property name="insertPolicy" > + <enum>QComboBox::InsertAlphabetically</enum> + </property> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="remove_series_button" > + <property name="toolTip" > + <string>Remove unused series (Series that have no books)</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/trash.svg</normaloff>:/images/trash.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + <item row="7" column="1" colspan="2" > + <widget class="QSpinBox" name="series_index" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="toolTip" > + <string>Series index.</string> + </property> + <property name="whatsThis" > + <string>Series index.</string> + </property> + <property name="prefix" > + <string>Book </string> + </property> + <property name="minimum" > + <number>1</number> + </property> + <property name="maximum" > + <number>10000</number> + </property> + </widget> + </item> + <item row="8" column="0" > + <widget class="QLabel" name="label_9" > + <property name="text" > + <string>IS&BN:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>isbn</cstring> + </property> + </widget> + </item> + <item row="8" column="1" colspan="2" > + <widget class="QLineEdit" name="isbn" /> + </item> + <item row="4" column="1" > + <widget class="QComboBox" name="publisher" > + <property name="editable" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QLineEdit" name="authors" /> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="cover_button" > - <property name="toolTip" > - <string>Browse for an image to use as the cover of this book.</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/document_open.svg</normaloff>:/images/document_open.svg</iconset> + <widget class="QGroupBox" name="groupBox_2" > + <property name="title" > + <string>Comments</string> </property> + <layout class="QGridLayout" name="gridLayout_4" > + <item row="0" column="0" > + <widget class="QTextEdit" name="comments" /> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="reset_cover" > - <property name="toolTip" > - <string>Reset cover to default</string> - </property> + <widget class="QPushButton" name="fetch_metadata_button" > <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/trash.svg</normaloff>:/images/trash.svg</iconset> + <string>Fetch metadata from server</string> </property> </widget> </item> </layout> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <item> - <widget class="QPushButton" name="fetch_cover_button" > - <property name="text" > - <string>Fetch cover image from server</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="password_button" > - <property name="toolTip" > - <string>Change the username and/or password for your account at LibraryThing.com</string> - </property> - <property name="text" > - <string>Change password</string> - </property> - </widget> - </item> - </layout> + </widget> + <widget class="QWidget" name="layoutWidget_2" > + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="QGroupBox" name="af_group_box" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Available Formats</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <layout class="QGridLayout" name="gridLayout" > + <item rowspan="3" row="0" column="0" > + <widget class="QListWidget" name="formats" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>130</height> + </size> + </property> + <property name="iconSize" > + <size> + <width>64</width> + <height>64</height> + </size> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QToolButton" name="add_format_button" > + <property name="toolTip" > + <string>Add a new format for this book to the database</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/add_book.svg</normaloff>:/images/add_book.svg</iconset> + </property> + <property name="iconSize" > + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QToolButton" name="remove_format_button" > + <property name="toolTip" > + <string>Remove the selected formats for this book from the database.</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/trash.svg</normaloff>:/images/trash.svg</iconset> + </property> + <property name="iconSize" > + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QToolButton" name="button_set_cover" > + <property name="toolTip" > + <string>Set the cover for the book from the selected format</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/book.svg</normaloff>:/images/book.svg</iconset> + </property> + <property name="iconSize" > + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> + <zorder></zorder> + </widget> + </item> + <item> + <widget class="QGroupBox" name="bc_box" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>10</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Book Cover</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_4" > + <item> + <widget class="ImageView" name="cover" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string/> + </property> + <property name="pixmap" > + <pixmap resource="../images.qrc" >:/images/book.svg</pixmap> + </property> + <property name="scaledContents" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="_4" > + <property name="spacing" > + <number>6</number> + </property> + <property name="sizeConstraint" > + <enum>QLayout::SetMaximumSize</enum> + </property> + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_5" > + <property name="text" > + <string>Change &cover image:</string> + </property> + <property name="buddy" > + <cstring>cover_path</cstring> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="_5" > + <property name="spacing" > + <number>6</number> + </property> + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="cover_path" > + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="cover_button" > + <property name="toolTip" > + <string>Browse for an image to use as the cover of this book.</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/document_open.svg</normaloff>:/images/document_open.svg</iconset> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="reset_cover" > + <property name="toolTip" > + <string>Reset cover to default</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/trash.svg</normaloff>:/images/trash.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="_6" > + <item> + <widget class="QPushButton" name="fetch_cover_button" > + <property name="text" > + <string>Fetch cover image from server</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="password_button" > + <property name="toolTip" > + <string>Change the username and/or password for your account at LibraryThing.com</string> + </property> + <property name="text" > + <string>Change password</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> </item> </layout> </widget> @@ -601,30 +638,6 @@ </customwidget> </customwidgets> <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> </tabstops> <resources> diff --git a/src/calibre/gui2/dialogs/user_profiles.py b/src/calibre/gui2/dialogs/user_profiles.py index 5da604c04a..030b924211 100644 --- a/src/calibre/gui2/dialogs/user_profiles.py +++ b/src/calibre/gui2/dialogs/user_profiles.py @@ -3,21 +3,20 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import time, os 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.news import AutomaticNewsRecipe 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.ptempfile import PersistentTemporaryFile -class UserProfiles(QDialog, Ui_Dialog): +class UserProfiles(ResizableDialog, Ui_Dialog): def __init__(self, parent, feeds): - QDialog.__init__(self, parent) - Ui_Dialog.__init__(self) - self.setupUi(self) + ResizableDialog.__init__(self, parent) self.connect(self.remove_feed_button, SIGNAL('clicked(bool)'), self.added_feeds.remove_selected_items) diff --git a/src/calibre/gui2/dialogs/user_profiles.ui b/src/calibre/gui2/dialogs/user_profiles.ui index 44662e75a2..8177e6f3dd 100644 --- a/src/calibre/gui2/dialogs/user_profiles.ui +++ b/src/calibre/gui2/dialogs/user_profiles.ui @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>744</width> - <height>633</height> + <width>719</width> + <height>612</height> </rect> </property> <property name="windowTitle" > @@ -16,8 +16,420 @@ <iconset resource="../images.qrc" > <normaloff>:/images/user_profile.svg</normaloff>:/images/user_profile.svg</iconset> </property> - <layout class="QGridLayout" > - <item row="1" column="0" > + <layout class="QVBoxLayout" name="verticalLayout_4" > + <item> + <widget class="QScrollArea" name="scrollArea" > + <property name="frameShape" > + <enum>QFrame::NoFrame</enum> + </property> + <property name="lineWidth" > + <number>0</number> + </property> + <property name="widgetResizable" > + <bool>true</bool> + </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" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Available user recipes</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="BasicList" name="available_profiles" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="add_profile_button" > + <property name="text" > + <string>Add/Update &recipe</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/plus.svg</normaloff>:/images/plus.svg</iconset> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="remove_profile_button" > + <property name="text" > + <string>&Remove recipe</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/list_remove.svg</normaloff>:/images/list_remove.svg</iconset> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="share_button" > + <property name="text" > + <string>&Share recipe</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/forward.svg</normaloff>:/images/forward.svg</iconset> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="builtin_recipe_button" > + <property name="text" > + <string>Customize &builtin recipe</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/news.svg</normaloff>:/images/news.svg</iconset> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="load_button" > + <property name="text" > + <string>&Load recipe from file</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/chapters.svg</normaloff>:/images/chapters.svg</iconset> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <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> + <widget class="QPushButton" name="toggle_mode_button" > + <property name="text" > + <string>Switch to Advanced mode</string> + </property> + </widget> + </item> + <item> + <widget class="QStackedWidget" name="stacks" > + <property name="currentIndex" > + <number>0</number> + </property> + <widget class="QWidget" name="page" > + <layout class="QVBoxLayout" name="verticalLayout_5" > + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Create a basic news recipe, by adding RSS feeds to it. <br />For most feeds, you will have to use the "Advanced mode" to further customize the fetch process.</p></body></html></string> + </property> + <property name="textFormat" > + <enum>Qt::RichText</enum> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QGridLayout" > + <item row="0" column="0" > + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>Recipe &title:</string> + </property> + <property name="buddy" > + <cstring>profile_title</cstring> + </property> + </widget> + </item> + <item row="0" column="1" colspan="2" > + <widget class="QLineEdit" name="profile_title" > + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_6" > + <property name="text" > + <string>&Oldest article:</string> + </property> + <property name="buddy" > + <cstring>oldest_article</cstring> + </property> + </widget> + </item> + <item row="2" column="2" > + <widget class="QSpinBox" name="oldest_article" > + <property name="toolTip" > + <string>The oldest article to download</string> + </property> + <property name="suffix" > + <string> days</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + <property name="maximum" > + <number>365</number> + </property> + <property name="value" > + <number>7</number> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_7" > + <property name="text" > + <string>&Max. number of articles per feed:</string> + </property> + <property name="buddy" > + <cstring>max_articles</cstring> + </property> + </widget> + </item> + <item row="3" column="2" > + <widget class="QSpinBox" name="max_articles" > + <property name="toolTip" > + <string>Maximum number of articles to download per feed.</string> + </property> + <property name="minimum" > + <number>5</number> + </property> + <property name="maximum" > + <number>100</number> + </property> + <property name="value" > + <number>10</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <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" > + <string>Feeds in recipe</string> + </property> + <layout class="QHBoxLayout" > + <item> + <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" > + <enum>QAbstractItemView::MultiSelection</enum> + </property> + </widget> + </item> + <item> + <layout class="QVBoxLayout" > + <item> + <widget class="QToolButton" name="up_button" > + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/arrow-up.svg</normaloff>:/images/arrow-up.svg</iconset> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="remove_feed_button" > + <property name="toolTip" > + <string>Remove feed from recipe</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/list_remove.svg</normaloff>:/images/list_remove.svg</iconset> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="down_button" > + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/arrow-down.svg</normaloff>:/images/arrow-down.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_3" > + <property name="title" > + <string>Add feed to recipe</string> + </property> + <layout class="QGridLayout" > + <item row="0" column="0" > + <widget class="QLabel" name="label_4" > + <property name="text" > + <string>&Feed title:</string> + </property> + <property name="buddy" > + <cstring>feed_title</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="feed_title" /> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="label_5" > + <property name="text" > + <string>Feed &URL:</string> + </property> + <property name="buddy" > + <cstring>feed_url</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QLineEdit" name="feed_url" /> + </item> + <item row="2" column="0" colspan="2" > + <widget class="QPushButton" name="add_feed_button" > + <property name="toolTip" > + <string>Add feed to recipe</string> + </property> + <property name="text" > + <string>&Add feed</string> + </property> + <property name="icon" > + <iconset resource="../images.qrc" > + <normaloff>:/images/plus.svg</normaloff>:/images/plus.svg</iconset> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="page_2" > + <layout class="QVBoxLayout" > + <item> + <widget class="QLabel" name="label_8" > + <property name="text" > + <string>For help with writing advanced news recipes, please visit <a href="http://__appname__.kovidgoyal.net/user_manual/news.html">User Recipes</a></string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="openExternalLinks" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_4" > + <property name="title" > + <string>Recipe source code (python)</string> + </property> + <layout class="QVBoxLayout" > + <item> + <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" > + <font> + <family>DejaVu Sans Mono</family> + </font> + </property> + <property name="lineWrapMode" > + <enum>QTextEdit::NoWrap</enum> + </property> + <property name="acceptRichText" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + <item> <widget class="QDialogButtonBox" name="buttonBox" > <property name="orientation" > <enum>Qt::Horizontal</enum> @@ -27,360 +439,6 @@ </property> </widget> </item> - <item row="0" column="0" > - <widget class="QSplitter" name="splitter" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <widget class="QGroupBox" name="groupBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize" > - <size> - <width>215</width> - <height>16777215</height> - </size> - </property> - <property name="title" > - <string>Available user recipes</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="BasicList" name="available_profiles" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Expanding" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="add_profile_button" > - <property name="text" > - <string>Add/Update &recipe</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/plus.svg</normaloff>:/images/plus.svg</iconset> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="remove_profile_button" > - <property name="text" > - <string>&Remove recipe</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/list_remove.svg</normaloff>:/images/list_remove.svg</iconset> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="share_button" > - <property name="text" > - <string>&Share recipe</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/forward.svg</normaloff>:/images/forward.svg</iconset> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="builtin_recipe_button" > - <property name="text" > - <string>Customize &builtin recipe</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/news.svg</normaloff>:/images/news.svg</iconset> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="load_button" > - <property name="text" > - <string>&Load recipe from file</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/chapters.svg</normaloff>:/images/chapters.svg</iconset> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="layoutWidget" > - <layout class="QVBoxLayout" > - <item> - <widget class="QPushButton" name="toggle_mode_button" > - <property name="text" > - <string>Switch to Advanced mode</string> - </property> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="stacks" > - <property name="currentIndex" > - <number>0</number> - </property> - <widget class="QWidget" name="page" > - <layout class="QVBoxLayout" > - <item> - <widget class="QLabel" name="label" > - <property name="text" > - <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Create a basic news recipe, by adding RSS feeds to it. <br />For most feeds, you will have to use the "Advanced mode" to further customize the fetch process.</p></body></html></string> - </property> - <property name="textFormat" > - <enum>Qt::RichText</enum> - </property> - <property name="wordWrap" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="label_2" > - <property name="text" > - <string>Recipe &title:</string> - </property> - <property name="buddy" > - <cstring>profile_title</cstring> - </property> - </widget> - </item> - <item row="0" column="1" colspan="2" > - <widget class="QLineEdit" name="profile_title" > - <property name="font" > - <font> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_6" > - <property name="text" > - <string>&Oldest article:</string> - </property> - <property name="buddy" > - <cstring>oldest_article</cstring> - </property> - </widget> - </item> - <item row="2" column="2" > - <widget class="QSpinBox" name="oldest_article" > - <property name="toolTip" > - <string>The oldest article to download</string> - </property> - <property name="suffix" > - <string> days</string> - </property> - <property name="minimum" > - <number>1</number> - </property> - <property name="maximum" > - <number>365</number> - </property> - <property name="value" > - <number>7</number> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_7" > - <property name="text" > - <string>&Max. number of articles per feed:</string> - </property> - <property name="buddy" > - <cstring>max_articles</cstring> - </property> - </widget> - </item> - <item row="3" column="2" > - <widget class="QSpinBox" name="max_articles" > - <property name="toolTip" > - <string>Maximum number of articles to download per feed.</string> - </property> - <property name="minimum" > - <number>5</number> - </property> - <property name="maximum" > - <number>100</number> - </property> - <property name="value" > - <number>10</number> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QGroupBox" name="groupBox_2" > - <property name="title" > - <string>Feeds in recipe</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="BasicList" name="added_feeds" > - <property name="selectionMode" > - <enum>QAbstractItemView::MultiSelection</enum> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" > - <item> - <widget class="QToolButton" name="up_button" > - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/arrow-up.svg</normaloff>:/images/arrow-up.svg</iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="remove_feed_button" > - <property name="toolTip" > - <string>Remove feed from recipe</string> - </property> - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/list_remove.svg</normaloff>:/images/list_remove.svg</iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="down_button" > - <property name="text" > - <string>...</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/arrow-down.svg</normaloff>:/images/arrow-down.svg</iconset> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_3" > - <property name="title" > - <string>Add feed to recipe</string> - </property> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="label_4" > - <property name="text" > - <string>&Feed title:</string> - </property> - <property name="buddy" > - <cstring>feed_title</cstring> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="feed_title" /> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_5" > - <property name="text" > - <string>Feed &URL:</string> - </property> - <property name="buddy" > - <cstring>feed_url</cstring> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="feed_url" /> - </item> - <item row="2" column="0" colspan="2" > - <widget class="QPushButton" name="add_feed_button" > - <property name="toolTip" > - <string>Add feed to recipe</string> - </property> - <property name="text" > - <string>&Add feed</string> - </property> - <property name="icon" > - <iconset resource="../images.qrc" > - <normaloff>:/images/plus.svg</normaloff>:/images/plus.svg</iconset> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_2" > - <layout class="QVBoxLayout" > - <item> - <widget class="QLabel" name="label_8" > - <property name="text" > - <string>For help with writing advanced news recipes, please visit <a href="http://__appname__.kovidgoyal.net/user_manual/news.html">User Recipes</a></string> - </property> - <property name="wordWrap" > - <bool>true</bool> - </property> - <property name="openExternalLinks" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_4" > - <property name="title" > - <string>Recipe source code (python)</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="QTextEdit" name="source_code" > - <property name="font" > - <font> - <family>DejaVu Sans Mono</family> - </font> - </property> - <property name="lineWrapMode" > - <enum>QTextEdit::NoWrap</enum> - </property> - <property name="acceptRichText" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - </widget> - </item> </layout> </widget> <customwidgets> diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index ba59908c9f..63aec8521e 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -134,16 +134,8 @@ class Main(MainWindow, Ui_MainWindow): for f in self.output_formats: self.output_format.addItem(f) 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)'), - change_output_format) + self.change_output_format, Qt.QueuedConnection) ####################### Vanity ######################## self.vanity_template = _('<p>For help visit <a href="http://%s.kovidgoyal.net/user_manual">%s.kovidgoyal.net</a><br>')%(__appname__, __appname__) @@ -376,6 +368,15 @@ class Main(MainWindow, Ui_MainWindow): self.action_news.setMenu(self.scheduler.news_menu) self.connect(self.action_news, SIGNAL('triggered(bool)'), self.scheduler.show_dialog) 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): if self.content_server.exception is not None: diff --git a/src/calibre/web/feeds/recipes/recipe_faznet.py b/src/calibre/web/feeds/recipes/recipe_faznet.py index 0bd4a38d14..5efe7ec9e6 100644 --- a/src/calibre/web/feeds/recipes/recipe_faznet.py +++ b/src/calibre/web/feeds/recipes/recipe_faznet.py @@ -11,7 +11,7 @@ class FazNet(BasicNewsRecipe): title = 'FAZ NET' __author__ = 'Kovid Goyal' - description = 'News from Germany' + description = '"Frankfurter Allgemeine Zeitung' use_embedded_content = False max_articles_per_feed = 30 diff --git a/src/calibre/web/feeds/recipes/recipe_spiegelde.py b/src/calibre/web/feeds/recipes/recipe_spiegelde.py index fe4de53364..f13c76639a 100644 --- a/src/calibre/web/feeds/recipes/recipe_spiegelde.py +++ b/src/calibre/web/feeds/recipes/recipe_spiegelde.py @@ -13,7 +13,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class SpeigelOnline(BasicNewsRecipe): title = 'Spiegel Online' - description = 'News from Germany' + description = 'Nachrichten des Magazins Der Spiegel' __author__ = 'Kovid Goyal' use_embedded_content = False timefmt = ' [ %Y-%m-%d %a]' diff --git a/src/calibre/web/feeds/recipes/recipe_zeitde.py b/src/calibre/web/feeds/recipes/recipe_zeitde.py index 892d748465..c37a487153 100644 --- a/src/calibre/web/feeds/recipes/recipe_zeitde.py +++ b/src/calibre/web/feeds/recipes/recipe_zeitde.py @@ -11,7 +11,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class ZeitDe(BasicNewsRecipe): title = 'Die Zeit Nachrichten' - description = 'News from Germany' + description = 'Die Zeit - Online Nachrichten' __author__ = 'Kovid Goyal' use_embedded_content = False timefmt = ' [%d %b %Y]' diff --git a/src/calibre/web/fetch/simple.py b/src/calibre/web/fetch/simple.py index 8d6301ada4..8dee540e01 100644 --- a/src/calibre/web/fetch/simple.py +++ b/src/calibre/web/fetch/simple.py @@ -407,6 +407,7 @@ class RecursiveFetcher(object, LoggingInterface): if not isinstance(_fname, unicode): _fname.decode('latin1', 'replace') _fname = _fname.encode('ascii', 'replace').replace('%', '').replace(os.sep, '') + _fname = sanitize_file_name(_fname) res = os.path.join(linkdiskpath, _fname) self.downloaded_paths.append(res) self.filemap[nurl] = res