diff --git a/src/calibre/ebooks/metadata/book/base.py b/src/calibre/ebooks/metadata/book/base.py index 5f1841d518..6c360bad96 100644 --- a/src/calibre/ebooks/metadata/book/base.py +++ b/src/calibre/ebooks/metadata/book/base.py @@ -631,7 +631,7 @@ class Metadata(object): res = format_date(res, fmeta['display'].get('date_format','dd MMM yyyy')) elif datatype == 'rating': res = res/2.0 - elif key in ('book_size', 'size'): + elif key == 'size': res = human_readable(res) return (name, unicode(res), orig_res, fmeta) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index f1357728ec..60d2a0a7dd 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -739,12 +739,6 @@ def build_forms(srcdir, info=None): dat = dat.replace('from QtWebKit.QWebView import QWebView', 'from PyQt4 import QtWebKit\nfrom PyQt4.QtWebKit import QWebView') - if form.endswith('viewer%smain.ui'%os.sep): - info('\t\tPromoting WebView') - dat = dat.replace('self.view = QtWebKit.QWebView(', 'self.view = DocumentView(') - dat = dat.replace('self.view = QWebView(', 'self.view = DocumentView(') - dat += '\n\nfrom calibre.gui2.viewer.documentview import DocumentView' - open(compiled_form, 'wb').write(dat) _df = os.environ.get('CALIBRE_DEVELOP_FROM', None) diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index a2ee6d343b..2eefe3cb54 100644 --- a/src/calibre/gui2/book_details.py +++ b/src/calibre/gui2/book_details.py @@ -121,10 +121,7 @@ def render_data(mi, use_roman_numbers=True, all_fields=False): continue val = prepare_string_for_xml(val) if metadata['datatype'] == 'series': - if metadata['is_custom']: - sidx = mi.get_extra(field) - else: - sidx = getattr(mi, field+'_index') + sidx = getattr(mi, field+'_index') if sidx is None: sidx = 1.0 val = _('Book %s of %s')%(fmt_sidx(sidx, diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index d34be6c564..f7872b94b9 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -18,11 +18,11 @@ from calibre.gui2.widgets import EnLineEdit, FormatList, ImageView from calibre.gui2.complete import MultiCompleteLineEdit, MultiCompleteComboBox from calibre.utils.icu import sort_key from calibre.utils.config import tweaks, prefs -from calibre.ebooks.metadata import title_sort, authors_to_string, \ - string_to_authors, check_isbn +from calibre.ebooks.metadata import (title_sort, authors_to_string, + string_to_authors, check_isbn) from calibre.ebooks.metadata.meta import get_metadata -from calibre.gui2 import file_icon_provider, UNDEFINED_QDATE, UNDEFINED_DATE, \ - choose_files, error_dialog, choose_images, question_dialog +from calibre.gui2 import (file_icon_provider, UNDEFINED_QDATE, UNDEFINED_DATE, + choose_files, error_dialog, choose_images, question_dialog) from calibre.utils.date import local_tz, qt_to_dt from calibre import strftime from calibre.ebooks import BOOK_EXTENSIONS @@ -805,6 +805,7 @@ class CommentsEdit(Editor): # {{{ else: val = comments_to_html(val) self.html = val + self.wyswyg_dirtied() return property(fget=fget, fset=fset) def initialize(self, db, id_): diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index bae08f5455..620113cc3f 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -235,6 +235,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): gui.library_view.refresh_book_details() if __name__ == '__main__': - app = QApplication([]) + from calibre.gui2 import Application + app = Application([]) test_widget('Interface', 'Look & Feel') diff --git a/src/calibre/gui2/preferences/look_feel.ui b/src/calibre/gui2/preferences/look_feel.ui index 3d8a818e1e..244b811cbd 100644 --- a/src/calibre/gui2/preferences/look_feel.ui +++ b/src/calibre/gui2/preferences/look_feel.ui @@ -7,28 +7,27 @@ 0 0 717 - 444 + 390 Form - - - - - - 0 - 0 - 699 - 306 - - - - Main interface + + + + 0 + + + + + :/images/lt.png:/images/lt.png - + + Main Interface + + @@ -75,6 +74,13 @@ + + + + Enable system &tray icon (needs restart) + + + @@ -85,6 +91,13 @@ + + + + Disable &notifications in system tray + + + @@ -97,12 +110,12 @@ &Toolbar - + - + &Icon size: @@ -115,7 +128,7 @@ - + Show &text under icons: @@ -127,20 +140,7 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - - + @@ -161,135 +161,15 @@ - + Change &font (needs restart) - - - - Enable system &tray icon (needs restart) - - - - - - - Disable &notifications in system tray - - - - - - - - - 0 - 0 - 649 - 96 - - - - Tag Browser - - - - - - Show &average ratings in the tags browser - - - true - - - - - - - - - Tags browser category &partitioning method: - - - opt_tags_browser_partition_method - - - - - - - Choose how tag browser subcategories are displayed when -there are more items than the limit. Select by first -letter to see an A, B, C list. Choose partitioned to -have a list of fixed-sized groups. Set to disabled -if you never want subcategories - - - - - - - &Collapse when more items than: - - - opt_tags_browser_collapse_at - - - - - - - If a Tag Browser category has more than this number of items, it is divided -up into sub-categories. If the partition method is set to disable, this value is ignored. - - - 10000 - - - - - - - Qt::Horizontal - - - - 20 - 5 - - - - - - - - - - Categories with &hierarchical items: - - - opt_categories_using_hierarchy - - - - - - - A comma-separated list of columns in which items containing -periods are displayed in the tag browser trees. For example, if -this box contains 'tags' then tags of the form 'Mystery.English' -and 'Mystery.Thriller' will be displayed with English and Thriller -both under 'Mystery'. If 'tags' is not in this box, -then the tags will be displayed each on their own line. - - - - - + + Qt::Vertical @@ -303,77 +183,15 @@ then the tags will be displayed each on their own line. - - - - 0 - 0 - 429 - 63 - - - - Cover Browser + + + + :/images/book.png:/images/book.png - - - - - Show cover &browser in a separate window (needs restart) - - - - - - - &Number of covers to show in browse mode (needs restart): - - - opt_cover_flow_queue_length - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - 0 - 0 - 699 - 306 - - - + Book Details - - - - - Use &Roman numerals for series - - - true - - - + @@ -425,6 +243,16 @@ then the tags will be displayed each on their own line. + + + + Use &Roman numerals for series + + + true + + + @@ -437,6 +265,148 @@ then the tags will be displayed each on their own line. + + + + :/images/tags.png:/images/tags.png + + + Tag Browser + + + + + + Tags browser category &partitioning method: + + + opt_tags_browser_partition_method + + + + + + + Choose how tag browser subcategories are displayed when +there are more items than the limit. Select by first +letter to see an A, B, C list. Choose partitioned to +have a list of fixed-sized groups. Set to disabled +if you never want subcategories + + + + + + + &Collapse when more items than: + + + opt_tags_browser_collapse_at + + + + + + + If a Tag Browser category has more than this number of items, it is divided +up into sub-categories. If the partition method is set to disable, this value is ignored. + + + 10000 + + + + + + + Show &average ratings in the tags browser + + + true + + + + + + + Categories with &hierarchical items: + + + opt_categories_using_hierarchy + + + + + + + Qt::Vertical + + + + 690 + 252 + + + + + + + + A comma-separated list of columns in which items containing +periods are displayed in the tag browser trees. For example, if +this box contains 'tags' then tags of the form 'Mystery.English' +and 'Mystery.Thriller' will be displayed with English and Thriller +both under 'Mystery'. If 'tags' is not in this box, +then the tags will be displayed each on their own line. + + + + + + + + + :/images/cover_flow.png:/images/cover_flow.png + + + Cover Browser + + + + + + Show cover &browser in a separate window (needs restart) + + + + + + + &Number of covers to show in browse mode (needs restart): + + + opt_cover_flow_queue_length + + + + + + + + + + Qt::Vertical + + + + 690 + 283 + + + + + + diff --git a/src/calibre/gui2/preferences/main.py b/src/calibre/gui2/preferences/main.py index e760aa018a..c5f9a11d16 100644 --- a/src/calibre/gui2/preferences/main.py +++ b/src/calibre/gui2/preferences/main.py @@ -89,7 +89,7 @@ class Category(QWidget): # {{{ self.bar = QToolBar(self) self.bar.setStyleSheet( 'QToolBar { border: none; background: none }') - self.bar.setIconSize(QSize(48, 48)) + self.bar.setIconSize(QSize(32, 32)) self.bar.setMovable(False) self.bar.setFloatable(False) self.bar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) diff --git a/src/calibre/gui2/viewer/main.ui b/src/calibre/gui2/viewer/main.ui index 04166fe2cf..3137ad2e07 100644 --- a/src/calibre/gui2/viewer/main.ui +++ b/src/calibre/gui2/viewer/main.ui @@ -33,24 +33,21 @@ QFrame::Raised - - - - + Qt::Vertical - + Qt::Horizontal - + QFrame::StyledPanel @@ -91,6 +88,9 @@ + + + @@ -108,7 +108,7 @@ - Qt::LeftToolBarArea + LeftToolBarArea false @@ -136,7 +136,7 @@ - Qt::TopToolBarArea + TopToolBarArea false @@ -316,6 +316,12 @@ QWidget
QtWebKit/QWebView
+ + DocumentView + QWidget +
calibre/gui2/viewer/documentview.h
+ 1 +