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
0db589afc4
@ -40,6 +40,7 @@ class LinuxFreeze(Command):
|
|||||||
'/usr/bin/pdftohtml',
|
'/usr/bin/pdftohtml',
|
||||||
'/usr/lib/libwmflite-0.2.so.7',
|
'/usr/lib/libwmflite-0.2.so.7',
|
||||||
'/usr/lib/liblcms.so.1',
|
'/usr/lib/liblcms.so.1',
|
||||||
|
'/usr/lib/liblcms2.so.2',
|
||||||
'/usr/lib/libstlport.so.5.1',
|
'/usr/lib/libstlport.so.5.1',
|
||||||
'/tmp/calibre-mount-helper',
|
'/tmp/calibre-mount-helper',
|
||||||
'/usr/lib/libunrar.so',
|
'/usr/lib/libunrar.so',
|
||||||
@ -50,10 +51,9 @@ class LinuxFreeze(Command):
|
|||||||
'/usr/lib/libpodofo.so.0.8.1',
|
'/usr/lib/libpodofo.so.0.8.1',
|
||||||
'/lib/libz.so.1',
|
'/lib/libz.so.1',
|
||||||
'/lib/libuuid.so.1',
|
'/lib/libuuid.so.1',
|
||||||
'/usr/lib/libtiff.so.3',
|
'/usr/lib/libtiff.so.5',
|
||||||
'/lib/libbz2.so.1',
|
'/lib/libbz2.so.1',
|
||||||
'/usr/lib/libpoppler.so.5',
|
'/usr/lib/libpoppler.so.6',
|
||||||
'/usr/lib/libpoppler-qt4.so.3',
|
|
||||||
'/usr/lib/libxml2.so.2',
|
'/usr/lib/libxml2.so.2',
|
||||||
'/usr/lib/libopenjpeg.so.2',
|
'/usr/lib/libopenjpeg.so.2',
|
||||||
'/usr/lib/libxslt.so.1',
|
'/usr/lib/libxslt.so.1',
|
||||||
@ -62,10 +62,10 @@ class LinuxFreeze(Command):
|
|||||||
'/usr/lib/libgthread-2.0.so.0',
|
'/usr/lib/libgthread-2.0.so.0',
|
||||||
stdcpp,
|
stdcpp,
|
||||||
ffi,
|
ffi,
|
||||||
'/usr/lib/libpng12.so.0',
|
'/usr/lib/libpng14.so.14',
|
||||||
'/usr/lib/libexslt.so.0',
|
'/usr/lib/libexslt.so.0',
|
||||||
'/usr/lib/libMagickWand.so.2',
|
'/usr/lib/libMagickWand.so.3',
|
||||||
'/usr/lib/libMagickCore.so.2',
|
'/usr/lib/libMagickCore.so.3',
|
||||||
'/usr/lib/libgcrypt.so.11',
|
'/usr/lib/libgcrypt.so.11',
|
||||||
'/usr/lib/libgpg-error.so.0',
|
'/usr/lib/libgpg-error.so.0',
|
||||||
'/usr/lib/libphonon.so.4',
|
'/usr/lib/libphonon.so.4',
|
||||||
|
@ -70,6 +70,16 @@ class ANDROID(USBMS):
|
|||||||
dirs = [x.strip() for x in dirs.split(',')]
|
dirs = [x.strip() for x in dirs.split(',')]
|
||||||
self.EBOOK_DIR_MAIN = dirs
|
self.EBOOK_DIR_MAIN = dirs
|
||||||
|
|
||||||
|
def get_main_ebook_dir(self, for_upload=False):
|
||||||
|
dirs = self.EBOOK_DIR_MAIN
|
||||||
|
if not for_upload:
|
||||||
|
def aldiko_tweak(x):
|
||||||
|
return 'eBooks' if x == 'eBooks/import' else x
|
||||||
|
if isinstance(dirs, basestring):
|
||||||
|
dirs = [dirs]
|
||||||
|
dirs = list(map(aldiko_tweak, dirs))
|
||||||
|
return dirs
|
||||||
|
|
||||||
class S60(USBMS):
|
class S60(USBMS):
|
||||||
|
|
||||||
name = 'S60 driver'
|
name = 'S60 driver'
|
||||||
|
@ -732,7 +732,7 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
self._main_prefix = self._card_a_prefix = self._card_b_prefix = None
|
self._main_prefix = self._card_a_prefix = self._card_b_prefix = None
|
||||||
|
|
||||||
def get_main_ebook_dir(self):
|
def get_main_ebook_dir(self, for_upload=False):
|
||||||
return self.EBOOK_DIR_MAIN
|
return self.EBOOK_DIR_MAIN
|
||||||
|
|
||||||
def _sanity_check(self, on_card, files):
|
def _sanity_check(self, on_card, files):
|
||||||
@ -750,7 +750,7 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
path = os.path.join(self._card_b_prefix,
|
path = os.path.join(self._card_b_prefix,
|
||||||
*(self.EBOOK_DIR_CARD_B.split('/')))
|
*(self.EBOOK_DIR_CARD_B.split('/')))
|
||||||
else:
|
else:
|
||||||
candidates = self.get_main_ebook_dir()
|
candidates = self.get_main_ebook_dir(for_upload=True)
|
||||||
if isinstance(candidates, basestring):
|
if isinstance(candidates, basestring):
|
||||||
candidates = [candidates]
|
candidates = [candidates]
|
||||||
candidates = [
|
candidates = [
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="opt_chapter_mark"/>
|
<widget class="QComboBox" name="opt_chapter_mark">
|
||||||
|
<property name="minimumContentsLength">
|
||||||
|
<number>20</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="opt_remove_first_image">
|
<widget class="QCheckBox" name="opt_remove_first_image">
|
||||||
|
@ -43,6 +43,15 @@
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>500</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="minimumContentsLength">
|
||||||
|
<number>30</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -133,11 +133,9 @@ class DateEdit(QDateEdit):
|
|||||||
|
|
||||||
def focusInEvent(self, x):
|
def focusInEvent(self, x):
|
||||||
self.setSpecialValueText('')
|
self.setSpecialValueText('')
|
||||||
QDateEdit.focusInEvent(self, x)
|
|
||||||
|
|
||||||
def focusOutEvent(self, x):
|
def focusOutEvent(self, x):
|
||||||
self.setSpecialValueText(_('Undefined'))
|
self.setSpecialValueText(_('Undefined'))
|
||||||
QDateEdit.focusOutEvent(self, x)
|
|
||||||
|
|
||||||
def set_to_today(self):
|
def set_to_today(self):
|
||||||
self.setDate(now())
|
self.setDate(now())
|
||||||
@ -167,7 +165,7 @@ class DateTime(Base):
|
|||||||
|
|
||||||
def getter(self):
|
def getter(self):
|
||||||
val = self.widgets[1].date()
|
val = self.widgets[1].date()
|
||||||
if val <= UNDEFINED_QDATE:
|
if val == UNDEFINED_QDATE:
|
||||||
val = None
|
val = None
|
||||||
else:
|
else:
|
||||||
val = qt_to_dt(val)
|
val = qt_to_dt(val)
|
||||||
|
@ -96,7 +96,7 @@ class DateDelegate(QStyledItemDelegate): # {{{
|
|||||||
|
|
||||||
def displayText(self, val, locale):
|
def displayText(self, val, locale):
|
||||||
d = val.toDate()
|
d = val.toDate()
|
||||||
if d <= UNDEFINED_QDATE:
|
if d == UNDEFINED_QDATE:
|
||||||
return ''
|
return ''
|
||||||
return format_date(d.toPyDate(), 'dd MMM yyyy')
|
return format_date(d.toPyDate(), 'dd MMM yyyy')
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ class PubDateDelegate(QStyledItemDelegate): # {{{
|
|||||||
|
|
||||||
def displayText(self, val, locale):
|
def displayText(self, val, locale):
|
||||||
d = val.toDate()
|
d = val.toDate()
|
||||||
if d <= UNDEFINED_QDATE:
|
if d == UNDEFINED_QDATE:
|
||||||
return ''
|
return ''
|
||||||
format = tweaks['gui_pubdate_display_format']
|
format = tweaks['gui_pubdate_display_format']
|
||||||
if format is None:
|
if format is None:
|
||||||
@ -194,7 +194,7 @@ class CcDateDelegate(QStyledItemDelegate): # {{{
|
|||||||
|
|
||||||
def displayText(self, val, locale):
|
def displayText(self, val, locale):
|
||||||
d = val.toDate()
|
d = val.toDate()
|
||||||
if d <= UNDEFINED_QDATE:
|
if d == UNDEFINED_QDATE:
|
||||||
return ''
|
return ''
|
||||||
return format_date(d.toPyDate(), self.format)
|
return format_date(d.toPyDate(), self.format)
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ class CcDateDelegate(QStyledItemDelegate): # {{{
|
|||||||
|
|
||||||
def setModelData(self, editor, model, index):
|
def setModelData(self, editor, model, index):
|
||||||
val = editor.date()
|
val = editor.date()
|
||||||
if val <= UNDEFINED_QDATE:
|
if val == UNDEFINED_QDATE:
|
||||||
val = None
|
val = None
|
||||||
model.setData(index, QVariant(val), Qt.EditRole)
|
model.setData(index, QVariant(val), Qt.EditRole)
|
||||||
|
|
||||||
|
@ -1216,9 +1216,7 @@ class DeviceBooksModel(BooksModel): # {{{
|
|||||||
return done
|
return done
|
||||||
|
|
||||||
def set_editable(self, editable):
|
def set_editable(self, editable):
|
||||||
# Cannot edit if metadata is sent on connect. Reason: changes will
|
self.editable = editable
|
||||||
# revert to what is in the library on next connect.
|
|
||||||
self.editable = editable and prefs['manage_device_metadata']!='on_connect'
|
|
||||||
|
|
||||||
def set_search_restriction(self, s):
|
def set_search_restriction(self, s):
|
||||||
pass
|
pass
|
||||||
|
@ -209,13 +209,13 @@ class ResultCache(SearchQueryParser):
|
|||||||
if query == 'false':
|
if query == 'false':
|
||||||
for item in self._data:
|
for item in self._data:
|
||||||
if item is None: continue
|
if item is None: continue
|
||||||
if item[loc] is None or item[loc] <= UNDEFINED_DATE:
|
if item[loc] is None or item[loc] == UNDEFINED_DATE:
|
||||||
matches.add(item[0])
|
matches.add(item[0])
|
||||||
return matches
|
return matches
|
||||||
if query == 'true':
|
if query == 'true':
|
||||||
for item in self._data:
|
for item in self._data:
|
||||||
if item is None: continue
|
if item is None: continue
|
||||||
if item[loc] is not None and item[loc] > UNDEFINED_DATE:
|
if item[loc] is not None and item[loc] != UNDEFINED_DATE:
|
||||||
matches.add(item[0])
|
matches.add(item[0])
|
||||||
return matches
|
return matches
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user