diff --git a/.bzrignore b/.bzrignore index 444b169850..aa6f0da3a9 100644 --- a/.bzrignore +++ b/.bzrignore @@ -13,3 +13,9 @@ src/calibre/manual/cli/ build dist docs +src/calibre/gui2/pictureflow/Makefile.Debug +src/calibre/gui2/pictureflow/Makefile.Release +src/calibre/gui2/pictureflow/debug/ +src/calibre/gui2/pictureflow/pictureflow_resource.rc +src/calibre/gui2/pictureflow/release/ + diff --git a/setup.py b/setup.py index f446b34222..7019e0179c 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,8 @@ if __name__ == '__main__': author='Kovid Goyal', author_email='kovid@kovidgoyal.net', url = 'http://%s.kovidgoyal.net'%APPNAME, - package_data = {'': ['*.so.*', '*.so']}, + package_data = {'calibre':['plugins/*']}, + include_package_data=True, entry_points = entry_points, zip_safe = False, options = { 'bdist_egg' : {'exclude_source_files': True,}, }, diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index 1d26f3667d..231f6636ea 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -1,7 +1,7 @@ ''' E-book management software''' __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal ' -__version__ = '0.4.54' +__version__ = '0.4.55' __docformat__ = "epytext" __author__ = "Kovid Goyal " __appname__ = 'calibre' @@ -552,10 +552,10 @@ if islinux: os.chdir(plugins) try: import pictureflow -except: - import traceback - traceback.print_exc() + pictureflowerror = '' +except Exception, err: pictureflow = None + pictureflowerror = str(err) if islinux: os.chdir(cwd) diff --git a/src/calibre/gui2/dialogs/book_info.py b/src/calibre/gui2/dialogs/book_info.py index 311b254cce..7bdc9563f6 100644 --- a/src/calibre/gui2/dialogs/book_info.py +++ b/src/calibre/gui2/dialogs/book_info.py @@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en' ''' import textwrap -from PyQt4.QtCore import Qt +from PyQt4.QtCore import Qt, QCoreApplication from PyQt4.QtGui import QDialog, QPixmap, QGraphicsScene, QIcon from calibre.gui2.dialogs.book_info_ui import Ui_BookInfo @@ -25,6 +25,9 @@ class BookInfo(QDialog, Ui_BookInfo): Qt.SmoothTransformation) self.setWindowTitle(info[_('Title')]) + desktop = QCoreApplication.instance().desktop() + screen_height = desktop.availableGeometry().height() - 100 + self.resize(self.size().width(), screen_height) self.title.setText(''+info.pop(_('Title'))) self.comments.setText(info.pop(_('Comments'), '')) diff --git a/src/calibre/gui2/pictureflow/PyQt/configure.py b/src/calibre/gui2/pictureflow/PyQt/configure.py index 22424b724f..ef88ec7d2c 100644 --- a/src/calibre/gui2/pictureflow/PyQt/configure.py +++ b/src/calibre/gui2/pictureflow/PyQt/configure.py @@ -1,4 +1,4 @@ -import os +import os, sys import sipconfig from PyQt4 import pyqtconfig @@ -30,9 +30,10 @@ makefile = pyqtconfig.QtGuiModuleMakefile ( # Add the library we are wrapping. The name doesn't include any platform # specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the # ".dll" extension on Windows). -makefile.extra_lib_dirs = ['../../.build'] -makefile.extra_libs = ["pictureflow"] -makefile.extra_lflags = ['-Wl,--rpath=.'] +makefile.extra_lib_dirs = ['../../.build', '..\\..\\release'] +makefile.extra_libs = ['pictureflow0' if 'win' in sys.platform else "pictureflow"] +if 'linux' in sys.platform: + makefile.extra_lflags = ['-Wl,--rpath=.'] # Generate the Makefile itself. makefile.generate() diff --git a/src/calibre/gui2/pictureflow/pictureflow.h b/src/calibre/gui2/pictureflow/pictureflow.h index 579e1208f3..f733d58697 100644 --- a/src/calibre/gui2/pictureflow/pictureflow.h +++ b/src/calibre/gui2/pictureflow/pictureflow.h @@ -35,7 +35,7 @@ class AbstractDelayedImage { public: AbstractDelayedImage() : imageptr(0) {}; - ~AbstractDelayedImage() { free(); } + virtual ~AbstractDelayedImage() { free(); } virtual bool load(); virtual void unload(); diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index fd8a80e2a5..d3a594dc82 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -105,9 +105,12 @@ class LocationDelegate(QAbstractItemDelegate): font.setPointSize(8) mode = QIcon.Active if active else QIcon.Selected if selected else QIcon.Normal icon = QIcon(index.model().data(index, Qt.DecorationRole)) + highlight = getattr(index.model(), 'highlight_row', -1) == index.row() text = index.model().data(index, Qt.DisplayRole).toString() painter.save() irect, trect = self.get_rects(index, option) + if highlight: + font.setItalic(True) painter.setFont(font) icon.paint(painter, irect, Qt.AlignHCenter|Qt.AlignTop, mode, QIcon.On) if selected: @@ -121,7 +124,7 @@ class LocationDelegate(QAbstractItemDelegate): painter.setBrush(option.palette.highlightedText()) else: painter.setBrush(option.palette.text()) - + painter.drawText(QRectF(trect), Qt.AlignTop|Qt.AlignHCenter, text) painter.restore() diff --git a/windows_installer.py b/windows_installer.py index b6484b510b..110899e8af 100644 --- a/windows_installer.py +++ b/windows_installer.py @@ -357,7 +357,7 @@ r''' class BuildEXE(build_exe): manifest_resource_id = 0 - QT_PREFIX = r'C:\\Qt\\4.3.3' + QT_PREFIX = r'C:\\Qt\\4.4.0' MANIFEST_TEMPLATE = ''' @@ -379,7 +379,32 @@ class BuildEXE(build_exe): ''' + def build_plugins(self): + cwd = os.getcwd() + try: + os.chdir(os.path.join('src', 'calibre', 'gui2', 'pictureflow')) + subprocess.check_call(['qmake', 'pictureflow-lib.pro']) + subprocess.check_call(['mingw32-make', '-f', 'Makefile.Release']) + os.chdir('PyQt') + if not os.path.exists('.build'): + os.mkdir('.build') + os.chdir('.build') + subprocess.check_call(['python', '..\\configure.py']) + subprocess.check_call(['mingw32-make', '-f', 'Makefile']) + dd = os.path.join(cwd, self.dist_dir) + shutil.copyfile('pictureflow.pyd', os.path.join(dd, 'pictureflow.pyd')) + os.chdir('..\\..') + shutil.copyfile('release\\pictureflow0.dll', os.path.join(dd, 'pictureflow0.dll')) + shutil.rmtree('Release', True) + shutil.rmtree('Debug', True) + finally: + os.chdir(cwd) + def run(self): + if not os.path.exists(self.dist_dir): + os.makedirs(self.dist_dir) + print 'Building custom plugins...' + self.build_plugins() build_exe.run(self) qtsvgdll = None for other in self.other_depends: @@ -407,6 +432,8 @@ class BuildEXE(build_exe): if os.path.exists(tg): shutil.rmtree(tg) shutil.copytree(imfd, tg) + + print print