Merge from trunk

This commit is contained in:
Charles Haley 2010-11-05 20:07:12 +00:00
commit b1afe05806
6 changed files with 34 additions and 11 deletions

View File

@ -42,7 +42,8 @@ class Push(Command):
threads = []
for host in (
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]
print '\n\nPushing to:', host, '\n'

View File

@ -234,6 +234,7 @@ class EditMetadataAction(InterfaceAction):
ci = self.gui.library_view.model().index(dest_row, 0)
if ci.isValid():
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):
for src_book in src_books:

View File

@ -9,8 +9,8 @@ import os, collections, sys
from Queue import Queue
from PyQt4.Qt import QPixmap, QSize, QWidget, Qt, pyqtSignal, \
QPropertyAnimation, QEasingCurve, QThread, \
QSizePolicy, QPainter, QRect, pyqtProperty, QLayout
QPropertyAnimation, QEasingCurve, QThread, QApplication, QFontInfo, \
QSizePolicy, QPainter, QRect, pyqtProperty, QLayout, QPalette
from PyQt4.QtWebKit import QWebView
from calibre import fit_image, prepare_string_for_xml
@ -210,23 +210,37 @@ class BookInfo(QWebView):
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 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:
left_pane = u'<table>%s</table>'%rows
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>'
% (left_pane, right_pane))
% (left_pane, right_pane)))
def mouseDoubleClickEvent(self, ev):
ev.ignore()
# }}}
class DetailsLayout(QLayout): # {{{
def __init__(self, vertical, parent):

View File

@ -456,7 +456,7 @@ Using this button to create author sort will change author sort from red to gree
<property name="maximumSize">
<size>
<width>16777215</width>
<height>130</height>
<height>140</height>
</size>
</property>
<property name="dragDropMode">

View File

@ -328,7 +328,7 @@ class BooksModel(QAbstractTableModel): # {{{
sidx = self.db.series_index(idx)
sidx = fmt_sidx(sidx, use_roman = self.use_roman_numbers)
data[_('Series')] = \
_('Book <font face="serif">%s</font> of %s.')%\
_('Book %s of %s.')%\
(sidx, prepare_string_for_xml(series))
mi = self.db.get_metadata(idx)
for key in mi.custom_field_keys():

View File

@ -148,6 +148,10 @@ class SearchBox2(QComboBox):
self.line_edit.setStyleSheet('QLineEdit { color: black; background-color: %s; }' % col)
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()
if self._in_a_search:
self.emit(SIGNAL('changed()'))
@ -159,8 +163,11 @@ class SearchBox2(QComboBox):
def mouse_released(self, event):
self.normalize_state()
if self.as_you_type:
self.timer.start(1500)
# Dont trigger a search since it make
# re-positioning the cursor using the mouse
# impossible
#if self.as_you_type:
# self.timer.start(1500)
def timer_event(self):
self.do_search()