mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
more lambda slots
This commit is contained in:
parent
be77554adb
commit
c695f695bc
@ -7,7 +7,6 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from functools import partial
|
|
||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
QWidget, QHBoxLayout, QTabWidget, QLabel, QSizePolicy, QSize, QFormLayout,
|
QWidget, QHBoxLayout, QTabWidget, QLabel, QSizePolicy, QSize, QFormLayout,
|
||||||
@ -243,7 +242,7 @@ class CoverSettingsWidget(QWidget):
|
|||||||
la.setWordWrap(True)
|
la.setWordWrap(True)
|
||||||
b = QPushButton(button)
|
b = QPushButton(button)
|
||||||
b.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
b.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
||||||
b.clicked.connect(partial(self.change_template, which))
|
connect_lambda(b.clicked, self, lambda self: self.change_template(which))
|
||||||
setattr(self, attr + '_button', b)
|
setattr(self, attr + '_button', b)
|
||||||
l.addWidget(b)
|
l.addWidget(b)
|
||||||
if which != 'footer':
|
if which != 'footer':
|
||||||
|
@ -8,7 +8,6 @@ __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
|||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os, time, shutil
|
import os, time, shutil
|
||||||
from functools import partial
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
from PyQt5.Qt import (QIcon, QDialog,
|
from PyQt5.Qt import (QIcon, QDialog,
|
||||||
@ -45,10 +44,11 @@ class Job(ThreadedJob):
|
|||||||
return open(self.download_debug_log, 'rb')
|
return open(self.download_debug_log, 'rb')
|
||||||
|
|
||||||
|
|
||||||
def show_config(gui, parent):
|
def show_config(parent):
|
||||||
from calibre.gui2.preferences import show_config_widget
|
from calibre.gui2.preferences import show_config_widget
|
||||||
|
from calibre.gui2.ui import get_gui
|
||||||
show_config_widget('Sharing', 'Metadata download', parent=parent,
|
show_config_widget('Sharing', 'Metadata download', parent=parent,
|
||||||
gui=gui, never_shutdown=True)
|
gui=get_gui(), never_shutdown=True)
|
||||||
|
|
||||||
|
|
||||||
class ConfirmDialog(QDialog):
|
class ConfirmDialog(QDialog):
|
||||||
@ -95,7 +95,7 @@ class ConfirmDialog(QDialog):
|
|||||||
b.setIcon(QIcon(I('default_cover.png')))
|
b.setIcon(QIcon(I('default_cover.png')))
|
||||||
b = self.b = self.bb.addButton(_('&Configure download'), self.bb.ActionRole)
|
b = self.b = self.bb.addButton(_('&Configure download'), self.bb.ActionRole)
|
||||||
b.setIcon(QIcon(I('config.png')))
|
b.setIcon(QIcon(I('config.png')))
|
||||||
b.clicked.connect(partial(show_config, parent, self))
|
connect_lambda(b.clicked, self, lambda self: show_config(self))
|
||||||
l.addWidget(self.bb, 1, 0, 1, 2)
|
l.addWidget(self.bb, 1, 0, 1, 2)
|
||||||
b = self.bb.addButton(_('Download &both'),
|
b = self.bb.addButton(_('Download &both'),
|
||||||
self.bb.AcceptRole)
|
self.bb.AcceptRole)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user