more changes and fixes

This commit is contained in:
Tim Bentley 2009-05-22 20:36:16 +01:00
parent 8acc980ce4
commit d0bcc06d35
3 changed files with 7 additions and 3 deletions

View File

@ -202,6 +202,7 @@ class Renderer:
bboxes = [] bboxes = []
for line in lines: for line in lines:
bboxes.append(self._render_single_line(line, footer)) bboxes.append(self._render_single_line(line, footer))
print line, bboxes
numlines = len(lines) numlines = len(lines)
bottom = self._rect.bottom() bottom = self._rect.bottom()
@ -214,6 +215,8 @@ class Renderer:
by = 0 by = 0
for (x, y) in bboxes[startline:endline]: for (x, y) in bboxes[startline:endline]:
by += y by += y
print by
print by , bottom
if by > bottom: if by > bottom:
good=0 good=0
break break
@ -221,6 +224,7 @@ class Renderer:
endline = startline+ratio endline = startline+ratio
# if good == 1: # if good == 1:
# break # break
print "---------"
retval = [] retval = []
numlines_per_page = ratio numlines_per_page = ratio

View File

@ -54,7 +54,7 @@ class BibleMediaItem(MediaManagerItem):
This is the custom media manager item for Bibles. This is the custom media manager item for Bibles.
""" """
global log global log
log=logging.getLogger(u'BibleMediaItem') log = logging.getLogger(u'BibleMediaItem')
log.info(u'Bible Media Item loaded') log.info(u'Bible Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
@ -204,7 +204,7 @@ class BibleMediaItem(MediaManagerItem):
self.BibleListView.setAlternatingRowColors(True) self.BibleListView.setAlternatingRowColors(True)
self.BibleListData = TextListData() self.BibleListData = TextListData()
self.BibleListView.setModel(self.BibleListData) self.BibleListView.setModel(self.BibleListData)
self.BibleListView.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) self.BibleListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.BibleListView.setDragEnabled(True) self.BibleListView.setDragEnabled(True)
self.PageLayout.addWidget(self.BibleListView) self.PageLayout.addWidget(self.BibleListView)

View File

@ -89,7 +89,7 @@ class ListWithPreviews(QtCore.QAbstractListModel):
else: else:
retval = QtCore.QVariant() retval = QtCore.QVariant()
if type(retval) is not type(QtCore.QVariant): if type(retval) is not type(QtCore.QVariant):
return QVariant(retval) return QtCore.QVariant(retval)
else: else:
return retval return retval