This commit is contained in:
Kovid Goyal 2012-09-20 13:08:41 +05:30
parent fa026406bb
commit 8b845d4dca
4 changed files with 5 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -27,7 +27,7 @@ def synchronous(func):
class MTPDeviceBase(DevicePlugin): class MTPDeviceBase(DevicePlugin):
name = 'MTP Device Interface' name = 'MTP Device Interface'
gui_name = _('MTP Device') gui_name = _('MTP Device')
icon = I('devices/galaxy_s3.png') icon = I('devices/tablet.png')
description = _('Communicate with MTP devices') description = _('Communicate with MTP devices')
author = 'Kovid Goyal' author = 'Kovid Goyal'
version = (1, 0, 0) version = (1, 0, 0)

View File

@ -201,7 +201,7 @@ class DeviceManager(Thread): # {{{
uid = None uid = None
asked = gprefs.get('ask_to_manage_device', []) asked = gprefs.get('ask_to_manage_device', [])
if (dev.ASK_TO_ALLOW_CONNECT and uid and uid not in asked): if (dev.ASK_TO_ALLOW_CONNECT and uid and uid not in asked):
if not self.allow_connect_slot(dev.get_gui_name()): if not self.allow_connect_slot(dev.get_gui_name(), dev.icon):
allow_connect = False allow_connect = False
asked.append(uid) asked.append(uid)
gprefs.set('ask_to_manage_device', asked) gprefs.set('ask_to_manage_device', asked)
@ -852,11 +852,11 @@ class DeviceMixin(object): # {{{
if tweaks['auto_connect_to_folder']: if tweaks['auto_connect_to_folder']:
self.connect_to_folder_named(tweaks['auto_connect_to_folder']) self.connect_to_folder_named(tweaks['auto_connect_to_folder'])
def allow_connect(self, name): def allow_connect(self, name, icon):
return question_dialog(self, _('Mange the %s?')%name, return question_dialog(self, _('Mange the %s?')%name,
_('Detected the <b>%s</b>. Do you want calibre to manage it?')% _('Detected the <b>%s</b>. Do you want calibre to manage it?')%
name, show_copy_button=False, name, show_copy_button=False,
override_icon=QIcon(I('reader.png'))) override_icon=QIcon(icon))
def debug_detection(self, done): def debug_detection(self, done):
self.debug_detection_callback = weakref.ref(done) self.debug_detection_callback = weakref.ref(done)

View File

@ -415,6 +415,7 @@ class MTPConfig(QTabWidget):
return True return True
def commit(self): def commit(self):
self.device.prefs['blacklist'] = self.igntab.blacklist
p = self.device.prefs.get(self.current_device_key, {}) p = self.device.prefs.get(self.current_device_key, {})
if hasattr(self, 'formats'): if hasattr(self, 'formats'):
@ -440,7 +441,6 @@ class MTPConfig(QTabWidget):
self.device.prefs[self.current_device_key] = p self.device.prefs[self.current_device_key] = p
self.device.prefs['blacklist'] = self.igntab.blacklist
if __name__ == '__main__': if __name__ == '__main__':
from calibre.gui2 import Application from calibre.gui2 import Application