Merge from trunk

This commit is contained in:
Charles Haley 2010-06-11 18:20:24 +01:00
commit 8eec754ca8
10 changed files with 929 additions and 377 deletions

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ class Book(MetaInformation):
def __eq__(self, other):
# use lpath because the prefix can change, changing path
return self.path == getattr(other, 'lpath', None)
return self.lpath == getattr(other, 'lpath', None)
@dynamic_property
def db_id(self):

View File

@ -127,10 +127,16 @@ def available_width():
desktop = QCoreApplication.instance().desktop()
return desktop.availableGeometry().width()
_is_widescreen = None
def is_widescreen():
global _is_widescreen
if _is_widescreen is None:
try:
is_widescreen = float(available_width())/available_height() > 1.4
_is_widescreen = float(available_width())/available_height() > 1.4
except:
is_widescreen = True
_is_widescreen = False
return _is_widescreen
def extension(path):
return os.path.splitext(path)[1][1:].lower()

View File

@ -101,6 +101,11 @@ class Float(Int):
w.setSpecialValueText(_('Undefined'))
w.setSingleStep(1)
def setter(self, val):
if val is None:
val = self.widgets[1].minimum()
self.widgets[1].setValue(val)
class Rating(Int):
def setup_ui(self, parent):

View File

@ -290,14 +290,15 @@ class LibraryWidget(Splitter): # {{{
def __init__(self, parent):
orientation = Qt.Vertical if config['gui_layout'] == 'narrow' and \
not is_widescreen else Qt.Horizontal
not is_widescreen() else Qt.Horizontal
#orientation = Qt.Vertical
idx = 0 if orientation == Qt.Vertical else 1
size = 300 if orientation == Qt.Vertical else 550
Splitter.__init__(self, 'cover_browser_splitter', _('Cover Browser'),
I('cover_flow.svg'),
orientation=orientation, parent=parent,
connect_button=not config['separate_cover_flow'],
side_index=idx, initial_side_size=400, initial_show=False)
side_index=idx, initial_side_size=size, initial_show=False)
parent.library_view = BooksView(parent)
parent.library_view.setObjectName('library_view')
self.addWidget(parent.library_view)

View File

@ -73,7 +73,7 @@ class SearchBox2(QComboBox):
self.connect(self.line_edit, SIGNAL('mouse_released(PyQt_PyObject)'),
self.mouse_released, Qt.DirectConnection)
self.setEditable(True)
self.help_state = True
self.help_state = False
self.as_you_type = True
self.prev_search = ''
self.timer = None
@ -100,6 +100,9 @@ class SearchBox2(QComboBox):
self.help_state = False
def clear_to_help(self):
if self.help_state:
return
self.help_state = True
self.search.emit('')
self._in_a_search = False
self.setEditText(self.help_text)
@ -107,7 +110,6 @@ class SearchBox2(QComboBox):
self.killTimer(self.timer)
self.timer = None
self.line_edit.home(False)
self.help_state = True
self.line_edit.setStyleSheet(
'QLineEdit { color: gray; background-color: %s; }' %
self.normal_background)

View File

@ -229,9 +229,9 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
self.connect(self.action_previous_page, SIGNAL('triggered(bool)'),
lambda x:self.view.previous_page())
self.connect(self.action_find_next, SIGNAL('triggered(bool)'),
lambda x:self.find(self.search.smart_text, True, repeat=True))
lambda x:self.find(self.search.smart_text, repeat=True))
self.connect(self.action_find_previous, SIGNAL('triggered(bool)'),
lambda x:self.find(self.search.smart_text, True,
lambda x:self.find(self.search.smart_text,
repeat=True, backwards=True))
self.connect(self.action_full_screen, SIGNAL('triggered(bool)'),

View File

@ -83,7 +83,7 @@ class CSV_XML(CatalogPlugin):
if not len(data):
log.error("\nNo matching database entries for search criteria '%s'" % opts.search_text)
raise SystemExit(1)
#raise SystemExit(1)
# Get the requested output fields as a list
fields = self.get_output_fields(opts)

View File

@ -1307,12 +1307,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
aid = self.conn.execute('INSERT INTO series(name) VALUES (?)', (series,)).lastrowid
self.conn.execute('INSERT INTO books_series_link(book, series) VALUES (?,?)', (id, aid))
self.conn.commit()
try:
row = self.row(id)
if row is not None:
self.data.set(row, 9, series)
except ValueError:
pass
self.data.set(id, self.FIELD_MAP['series'], series, row_is_id=True)
if notify:
self.notify('metadata', [id])

View File

@ -159,7 +159,8 @@ Alternative for the iPad
As of |app| version 0.7.0, you can plugin your iPad into the computer using its charging cable, and |app| will detect it and show you a list of books on the iPad. You can then use the Send to device button to send books directly to iBooks on the iPad.
This method only works on Windows XP and higher and OS X 10.5 and higher. Linux is not supported (iTunes is not available in linux) and OS X 10.4 is not supported.
This method only works on Windows XP and higher and OS X 10.5 and higher. Linux is not supported (iTunes is not available in linux) and OS X 10.4 is not supported. For more details, see
`this forum post http://www.mobileread.com/forums/showpost.php?p=944079&postcount=1`_.
How do I use |app| with my Android phone?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~