GwR patches supporting dynamic disabling of Apple driver V2

This commit is contained in:
GRiker 2011-03-28 16:03:30 -07:00
parent 171897529e
commit 4952ef92ec
2 changed files with 8 additions and 8 deletions

View File

@ -38,9 +38,9 @@ class AppleOpenFeedback(OpenFeedback):
class Dialog(QDialog): class Dialog(QDialog):
def __init__(self, p, pixmap='dialog_information.png'): def __init__(self, p, cd, pixmap='dialog_information.png'):
QDialog.__init__(self, p) QDialog.__init__(self, p)
self.cd = cd
self.setWindowTitle("Apple iDevice detected") self.setWindowTitle("Apple iDevice detected")
self.l = l = QVBoxLayout() self.l = l = QVBoxLayout()
self.setLayout(l) self.setLayout(l)
@ -80,14 +80,14 @@ class AppleOpenFeedback(OpenFeedback):
def do_it(self, return_code): def do_it(self, return_code):
if return_code == self.Accepted: if return_code == self.Accepted:
self.log.info(" Apple driver ENABLED") self.cd.log.info(" Apple driver ENABLED")
dynamic[config_name(self.plugin.DISPLAY_DISABLE_DIALOG)] = False dynamic[config_name(self.cd.plugin.DISPLAY_DISABLE_DIALOG)] = False
else: else:
from calibre.customize.ui import disable_plugin from calibre.customize.ui import disable_plugin
self.log.info(" Apple driver DISABLED") self.cd.log.info(" Apple driver DISABLED")
disable_plugin(self.plugin) disable_plugin(self.cd.plugin)
return Dialog(parent) return Dialog(parent, self)
from PIL import Image as PILImage from PIL import Image as PILImage

View File

@ -43,7 +43,7 @@ class OpenFeedback(DeviceError):
def custom_dialog(self, parent): def custom_dialog(self, parent):
''' '''
If you need to show the user a custom dialog, instead if just If you need to show the user a custom dialog, instead of just
displaying the feedback_msg, create and return it here. displaying the feedback_msg, create and return it here.
''' '''
raise NotImplementedError raise NotImplementedError