Sync to trunk

This commit is contained in:
John Schember 2009-06-07 07:15:36 -04:00
commit 1698ebaa5b
36 changed files with 107116 additions and 79015 deletions

View File

@ -232,7 +232,7 @@ _check_symlinks_prescript()
all_functions = main_functions['console'] + main_functions['gui']
print
print 'Adding PoDoFo'
pdf = glob.glob(os.path.expanduser('/Volumes/sw/podofo/libpodofo.0.7.00.dylib'))[0]
pdf = glob.glob(os.path.expanduser('/Volumes/sw/podofo/libpodofo*.dylib'))[0]
shutil.copyfile(pdf, os.path.join(frameworks_dir, os.path.basename(pdf)))

View File

@ -22,7 +22,7 @@ class BEBOOK(USBMS):
VENDOR_NAME = 'LINUX'
WINDOWS_MAIN_MEM = 'FILE-STOR_GADGET'
WINDOWS_CARD_MEM = 'FILE-STOR_GADGET'
WINDOWS_CARD_A_MEM = 'FILE-STOR_GADGET'
OSX_MAIN_MEM = 'BeBook Internal Memory'
OSX_CARD_A_MEM = 'BeBook Storage Card'

View File

@ -216,13 +216,12 @@ class Device(DeviceConfig, DevicePlugin):
wmi = __import__('wmi', globals(), locals(), [], -1)
c = wmi.WMI(find_classes=False)
for drive in c.Win32_DiskDrive():
if self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_MAIN_MEM):
drives['main'] = self.windows_get_drive_prefix(drive)
elif self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_CARD_A_MEM):
if self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_CARD_A_MEM):
drives['carda'] = self.windows_get_drive_prefix(drive)
elif self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_CARD_B_MEM):
drives['cardb'] = self.windows_get_drive_prefix(drive)
elif self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_MAIN_MEM):
drives['main'] = self.windows_get_drive_prefix(drive)
if 'main' in drives.keys() and 'carda' in drives.keys() and 'cardb' in drives.keys():
break

View File

@ -92,6 +92,6 @@ class Jacket(object):
def __call__(self, oeb, opts, metadata):
self.oeb, self.opts, self.log = oeb, opts, oeb.log
if opts.remove_first_image:
self.remove_fisrt_image()
self.remove_first_image()
if opts.insert_metadata:
self.insert_metadata(metadata)

View File

@ -249,6 +249,8 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
self.remove_unused_series)
QObject.connect(self.auto_author_sort, SIGNAL('clicked()'),
self.deduce_author_sort)
self.connect(self.formats, SIGNAL('itemDoubleClicked(QListWidgetItem*)'),
self.show_format)
self.connect(self.button_set_cover, SIGNAL('clicked()'), self.set_cover)
self.connect(self.reset_cover, SIGNAL('clicked()'), self.do_reset_cover)
self.connect(self.swap_button, SIGNAL('clicked()'), self.swap_title_author)
@ -303,6 +305,10 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
if not pm.isNull():
self.cover.setPixmap(pm)
def show_format(self, item, *args):
fmt = item.ext
self.emit(SIGNAL('view_format(PyQt_PyObject)'), fmt)
def deduce_author_sort(self):
au = unicode(self.authors.text())
authors = string_to_authors(au)

View File

@ -953,9 +953,12 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
self.library_view.model().refresh_ids([id])
for row in rows:
self._metadata_view_id = self.library_view.model().db.id(row.row())
d = MetadataSingleDialog(self, row.row(),
self.library_view.model().db,
accepted_callback=accepted)
self.connect(d, SIGNAL('view_format(PyQt_PyObject)'),
self.metadata_view_format)
d.exec_()
if rows:
current = self.library_view.currentIndex()
@ -1269,6 +1272,14 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
if fmt_path:
self._view_file(fmt_path)
def metadata_view_format(self, fmt):
fmt_path = self.library_view.model().db.\
format_abspath(self._metadata_view_id,
fmt, index_is_id=True)
if fmt_path:
self._view_file(fmt_path)
def book_downloaded_for_viewing(self, job):
if job.failed:
self.device_job_exception(job)

View File

@ -28,11 +28,6 @@
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QWebView" name="view" >
<property name="url" >
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
<item row="0" column="1" >

View File

@ -171,10 +171,10 @@ class LocationModel(QAbstractListModel):
self.count = 0
self.highlight_row = 0
self.tooltips = [
_('Click to see the list of books available on your computer'),
_('Click to see the list of books in the main memory of your reader'),
_('Click to see the list of books on storage card A in your reader'),
_('Click to see the list of books on storage card B in your reader')
_('Click to see the books available on your computer'),
_('Click to see the books in the main memory of your reader'),
_('Click to see the books on storage card A in your reader'),
_('Click to see the books on storage card B in your reader')
]
def rowCount(self, *args):
@ -209,15 +209,15 @@ class LocationModel(QAbstractListModel):
def headerData(self, section, orientation, role):
return NONE
def update_devices(self, cp=None, fs=[-1, -1, -1]):
def update_devices(self, cp=(None, None), fs=[-1, -1, -1]):
self.free[0] = fs[0]
self.free[1] = fs[1]
self.free[2] = fs[2]
if cp != None:
self.free[1] = fs[1] if fs[1] else -1
self.free[2] = fs[2] if fs[2] else -1
else:
self.free[1] = -1
cpa, cpb = cp
self.free[1] = fs[1] if fs[1] is not None and cpa is not None else -1
self.free[2] = fs[2] if fs[2] is not None and cpb is not None else -1
if self.free[1] < 0 and self.free[2] >= 0:
self.free[1] = self.free[2]
self.free[2] = -1
self.reset()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff