mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
b1afe05806
@ -42,7 +42,8 @@ class Push(Command):
|
|||||||
threads = []
|
threads = []
|
||||||
for host in (
|
for host in (
|
||||||
r'Owner@winxp:/cygdrive/c/Documents\ and\ Settings/Owner/calibre',
|
r'Owner@winxp:/cygdrive/c/Documents\ and\ Settings/Owner/calibre',
|
||||||
'kovid@ox:calibre'
|
'kovid@ox:calibre',
|
||||||
|
r'kovid@win7:/cygdrive/c/Users/kovid/calibre',
|
||||||
):
|
):
|
||||||
rcmd = BASE_RSYNC + EXCLUDES + ['.', host]
|
rcmd = BASE_RSYNC + EXCLUDES + ['.', host]
|
||||||
print '\n\nPushing to:', host, '\n'
|
print '\n\nPushing to:', host, '\n'
|
||||||
|
@ -234,6 +234,7 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
ci = self.gui.library_view.model().index(dest_row, 0)
|
ci = self.gui.library_view.model().index(dest_row, 0)
|
||||||
if ci.isValid():
|
if ci.isValid():
|
||||||
self.gui.library_view.setCurrentIndex(ci)
|
self.gui.library_view.setCurrentIndex(ci)
|
||||||
|
self.gui.library_view.model().current_changed(ci, ci)
|
||||||
|
|
||||||
def add_formats(self, dest_id, src_books, replace=False):
|
def add_formats(self, dest_id, src_books, replace=False):
|
||||||
for src_book in src_books:
|
for src_book in src_books:
|
||||||
|
@ -9,8 +9,8 @@ import os, collections, sys
|
|||||||
from Queue import Queue
|
from Queue import Queue
|
||||||
|
|
||||||
from PyQt4.Qt import QPixmap, QSize, QWidget, Qt, pyqtSignal, \
|
from PyQt4.Qt import QPixmap, QSize, QWidget, Qt, pyqtSignal, \
|
||||||
QPropertyAnimation, QEasingCurve, QThread, \
|
QPropertyAnimation, QEasingCurve, QThread, QApplication, QFontInfo, \
|
||||||
QSizePolicy, QPainter, QRect, pyqtProperty, QLayout
|
QSizePolicy, QPainter, QRect, pyqtProperty, QLayout, QPalette
|
||||||
from PyQt4.QtWebKit import QWebView
|
from PyQt4.QtWebKit import QWebView
|
||||||
|
|
||||||
from calibre import fit_image, prepare_string_for_xml
|
from calibre import fit_image, prepare_string_for_xml
|
||||||
@ -210,23 +210,37 @@ class BookInfo(QWebView):
|
|||||||
|
|
||||||
|
|
||||||
def _show_data(self, rows, comments):
|
def _show_data(self, rows, comments):
|
||||||
|
f = QFontInfo(QApplication.font(self.parent())).pixelSize()
|
||||||
|
p = unicode(QApplication.palette().color(QPalette.Normal,
|
||||||
|
QPalette.Base).name())
|
||||||
|
templ = u'''\
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style type="text/css">
|
||||||
|
body, td {background-color: %s; font-size: %dpx}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
%%s
|
||||||
|
</body>
|
||||||
|
<html>
|
||||||
|
'''%(p, f)
|
||||||
if self.vertical:
|
if self.vertical:
|
||||||
if comments:
|
if comments:
|
||||||
rows += u'<tr><td colspan="2">%s</td></tr>'%comments
|
rows += u'<tr><td colspan="2">%s</td></tr>'%comments
|
||||||
self.setHtml(u'<table>%s</table>'%rows)
|
self.setHtml(templ%(u'<table>%s</table>'%rows))
|
||||||
else:
|
else:
|
||||||
left_pane = u'<table>%s</table>'%rows
|
left_pane = u'<table>%s</table>'%rows
|
||||||
right_pane = u'<div>%s</div>'%comments
|
right_pane = u'<div>%s</div>'%comments
|
||||||
self.setHtml(u'<table><tr><td valign="top" '
|
self.setHtml(templ%(u'<table><tr><td valign="top" '
|
||||||
'style="padding-right:2em">%s</td><td valign="top">%s</td></tr></table>'
|
'style="padding-right:2em">%s</td><td valign="top">%s</td></tr></table>'
|
||||||
% (left_pane, right_pane))
|
% (left_pane, right_pane)))
|
||||||
|
|
||||||
def mouseDoubleClickEvent(self, ev):
|
def mouseDoubleClickEvent(self, ev):
|
||||||
ev.ignore()
|
ev.ignore()
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
class DetailsLayout(QLayout): # {{{
|
class DetailsLayout(QLayout): # {{{
|
||||||
|
|
||||||
def __init__(self, vertical, parent):
|
def __init__(self, vertical, parent):
|
||||||
|
@ -456,7 +456,7 @@ Using this button to create author sort will change author sort from red to gree
|
|||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>130</height>
|
<height>140</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="dragDropMode">
|
<property name="dragDropMode">
|
||||||
|
@ -328,7 +328,7 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
sidx = self.db.series_index(idx)
|
sidx = self.db.series_index(idx)
|
||||||
sidx = fmt_sidx(sidx, use_roman = self.use_roman_numbers)
|
sidx = fmt_sidx(sidx, use_roman = self.use_roman_numbers)
|
||||||
data[_('Series')] = \
|
data[_('Series')] = \
|
||||||
_('Book <font face="serif">%s</font> of %s.')%\
|
_('Book %s of %s.')%\
|
||||||
(sidx, prepare_string_for_xml(series))
|
(sidx, prepare_string_for_xml(series))
|
||||||
mi = self.db.get_metadata(idx)
|
mi = self.db.get_metadata(idx)
|
||||||
for key in mi.custom_field_keys():
|
for key in mi.custom_field_keys():
|
||||||
|
@ -148,6 +148,10 @@ class SearchBox2(QComboBox):
|
|||||||
self.line_edit.setStyleSheet('QLineEdit { color: black; background-color: %s; }' % col)
|
self.line_edit.setStyleSheet('QLineEdit { color: black; background-color: %s; }' % col)
|
||||||
|
|
||||||
def key_pressed(self, event):
|
def key_pressed(self, event):
|
||||||
|
k = event.key()
|
||||||
|
if k in (Qt.Key_Left, Qt.Key_Right, Qt.Key_Up, Qt.Key_Down,
|
||||||
|
Qt.Key_Home, Qt.Key_End, Qt.Key_PageUp, Qt.Key_PageDown):
|
||||||
|
return
|
||||||
self.normalize_state()
|
self.normalize_state()
|
||||||
if self._in_a_search:
|
if self._in_a_search:
|
||||||
self.emit(SIGNAL('changed()'))
|
self.emit(SIGNAL('changed()'))
|
||||||
@ -159,8 +163,11 @@ class SearchBox2(QComboBox):
|
|||||||
|
|
||||||
def mouse_released(self, event):
|
def mouse_released(self, event):
|
||||||
self.normalize_state()
|
self.normalize_state()
|
||||||
if self.as_you_type:
|
# Dont trigger a search since it make
|
||||||
self.timer.start(1500)
|
# re-positioning the cursor using the mouse
|
||||||
|
# impossible
|
||||||
|
#if self.as_you_type:
|
||||||
|
# self.timer.start(1500)
|
||||||
|
|
||||||
def timer_event(self):
|
def timer_event(self):
|
||||||
self.do_search()
|
self.do_search()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user