More GUI refactoring

This commit is contained in:
Kovid Goyal 2010-06-12 09:54:58 -06:00
parent dc33b96554
commit bb81c3e2dd
4 changed files with 1230 additions and 1222 deletions

1197
src/calibre/gui2/actions.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,8 @@ from functools import partial
from binascii import unhexlify
from PyQt4.Qt import QMenu, QAction, QActionGroup, QIcon, SIGNAL, QPixmap, \
Qt, pyqtSignal
Qt, pyqtSignal, QColor, QPainter
from PyQt4.QtSvg import QSvgRenderer
from calibre.customize.ui import available_input_formats, available_output_formats, \
device_plugins
@ -612,6 +613,16 @@ class DeviceMixin(object): # {{{
self.job_manager, Dispatcher(self.status_bar.show_message))
self.device_manager.start()
def set_default_thumbnail(self, height):
r = QSvgRenderer(I('book.svg'))
pixmap = QPixmap(height, height)
pixmap.fill(QColor(255,255,255))
p = QPainter(pixmap)
r.render(p)
p.end()
self.default_thumbnail = (pixmap.width(), pixmap.height(),
pixmap_to_data(pixmap))
def connect_to_folder(self):
dir = choose_dir(self, 'Select Device Folder',
_('Select folder to open as device'))

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@ class CheckForUpdates(QThread):
traceback.print_exc()
self.sleep(self.INTERVAL)
def UpdateMixin(object):
class UpdateMixin(object):
def __init__(self, opts):
if not opts.no_update_check: