mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More GUI refactoring
This commit is contained in:
parent
dc33b96554
commit
bb81c3e2dd
1197
src/calibre/gui2/actions.py
Normal file
1197
src/calibre/gui2/actions.py
Normal file
File diff suppressed because it is too large
Load Diff
@ -10,7 +10,8 @@ from functools import partial
|
|||||||
from binascii import unhexlify
|
from binascii import unhexlify
|
||||||
|
|
||||||
from PyQt4.Qt import QMenu, QAction, QActionGroup, QIcon, SIGNAL, QPixmap, \
|
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, \
|
from calibre.customize.ui import available_input_formats, available_output_formats, \
|
||||||
device_plugins
|
device_plugins
|
||||||
@ -612,6 +613,16 @@ class DeviceMixin(object): # {{{
|
|||||||
self.job_manager, Dispatcher(self.status_bar.show_message))
|
self.job_manager, Dispatcher(self.status_bar.show_message))
|
||||||
self.device_manager.start()
|
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):
|
def connect_to_folder(self):
|
||||||
dir = choose_dir(self, 'Select Device Folder',
|
dir = choose_dir(self, 'Select Device Folder',
|
||||||
_('Select folder to open as device'))
|
_('Select folder to open as device'))
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@ class CheckForUpdates(QThread):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
self.sleep(self.INTERVAL)
|
self.sleep(self.INTERVAL)
|
||||||
|
|
||||||
def UpdateMixin(object):
|
class UpdateMixin(object):
|
||||||
|
|
||||||
def __init__(self, opts):
|
def __init__(self, opts):
|
||||||
if not opts.no_update_check:
|
if not opts.no_update_check:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user