mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Create 'generic' output profiles and generic devices in the welcome wizard
This commit is contained in:
parent
d251703ee4
commit
2c993c83ab
@ -495,6 +495,22 @@ class SonyReader900Output(SonyReaderOutput):
|
|||||||
screen_size = (600, 999)
|
screen_size = (600, 999)
|
||||||
comic_screen_size = screen_size
|
comic_screen_size = screen_size
|
||||||
|
|
||||||
|
class GenericEink(SonyReaderOutput):
|
||||||
|
|
||||||
|
name = 'Generic e-ink'
|
||||||
|
short_name = 'generic_eink'
|
||||||
|
description = _('Suitable for use with any e-ink device')
|
||||||
|
epub_periodical_format = None
|
||||||
|
|
||||||
|
class GenericEinkLarge(GenericEink):
|
||||||
|
|
||||||
|
name = 'Generic e-ink large'
|
||||||
|
short_name = 'generic_eink_large'
|
||||||
|
description = _('Suitable for use with any large screen e-ink device')
|
||||||
|
|
||||||
|
screen_size = (600, 999)
|
||||||
|
comic_screen_size = screen_size
|
||||||
|
|
||||||
class JetBook5Output(OutputProfile):
|
class JetBook5Output(OutputProfile):
|
||||||
|
|
||||||
name = 'JetBook 5-inch'
|
name = 'JetBook 5-inch'
|
||||||
@ -719,6 +735,6 @@ output_profiles = [OutputProfile, SonyReaderOutput, SonyReader300Output,
|
|||||||
iPadOutput, KoboReaderOutput, TabletOutput, SamsungGalaxy,
|
iPadOutput, KoboReaderOutput, TabletOutput, SamsungGalaxy,
|
||||||
SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput,
|
SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput,
|
||||||
IRexDR1000Output, IRexDR800Output, JetBook5Output, NookOutput,
|
IRexDR1000Output, IRexDR800Output, JetBook5Output, NookOutput,
|
||||||
BambookOutput, NookColorOutput]
|
BambookOutput, NookColorOutput, GenericEink, GenericEinkLarge]
|
||||||
|
|
||||||
output_profiles.sort(cmp=lambda x,y:cmp(x.name.lower(), y.name.lower()))
|
output_profiles.sort(cmp=lambda x,y:cmp(x.name.lower(), y.name.lower()))
|
||||||
|
@ -33,10 +33,10 @@ from calibre.gui2.dialogs.progress import ProgressDialog
|
|||||||
|
|
||||||
class Device(object):
|
class Device(object):
|
||||||
|
|
||||||
output_profile = 'default'
|
output_profile = 'generic_eink'
|
||||||
output_format = 'EPUB'
|
output_format = 'EPUB'
|
||||||
name = 'Default'
|
name = 'Generic e-ink device'
|
||||||
manufacturer = 'Default'
|
manufacturer = 'Generic'
|
||||||
id = 'default'
|
id = 'default'
|
||||||
supports_color = False
|
supports_color = False
|
||||||
|
|
||||||
@ -63,6 +63,18 @@ class Device(object):
|
|||||||
recs['dont_grayscale'] = True
|
recs['dont_grayscale'] = True
|
||||||
save_defaults('comic_input', recs)
|
save_defaults('comic_input', recs)
|
||||||
|
|
||||||
|
class Smartphone(Device):
|
||||||
|
|
||||||
|
id = 'smartphone'
|
||||||
|
name = 'Smartphone'
|
||||||
|
supports_color = True
|
||||||
|
|
||||||
|
class Tablet(Device):
|
||||||
|
|
||||||
|
id = 'tablet'
|
||||||
|
name = 'iPad like tablet'
|
||||||
|
output_profile = 'tablet'
|
||||||
|
supports_color = True
|
||||||
|
|
||||||
class Kindle(Device):
|
class Kindle(Device):
|
||||||
|
|
||||||
@ -206,12 +218,21 @@ class iPhone(Device):
|
|||||||
|
|
||||||
class Android(Device):
|
class Android(Device):
|
||||||
|
|
||||||
name = 'Adroid phone + WordPlayer/Aldiko'
|
name = 'Android phone'
|
||||||
output_format = 'EPUB'
|
output_format = 'EPUB'
|
||||||
manufacturer = 'Android'
|
manufacturer = 'Android'
|
||||||
id = 'android'
|
id = 'android'
|
||||||
supports_color = True
|
supports_color = True
|
||||||
|
|
||||||
|
class AndroidTablet(Device):
|
||||||
|
|
||||||
|
name = 'Android tablet'
|
||||||
|
output_format = 'EPUB'
|
||||||
|
manufacturer = 'Android'
|
||||||
|
id = 'android_tablet'
|
||||||
|
supports_color = True
|
||||||
|
output_profile = 'tablet'
|
||||||
|
|
||||||
class HanlinV3(Device):
|
class HanlinV3(Device):
|
||||||
|
|
||||||
name = 'Hanlin V3'
|
name = 'Hanlin V3'
|
||||||
@ -268,9 +289,9 @@ def get_manufacturers():
|
|||||||
mans = set([])
|
mans = set([])
|
||||||
for x in get_devices():
|
for x in get_devices():
|
||||||
mans.add(x.manufacturer)
|
mans.add(x.manufacturer)
|
||||||
if 'Default' in mans:
|
if Device.manufacturer in mans:
|
||||||
mans.remove('Default')
|
mans.remove(Device.manufacturer)
|
||||||
return ['Default'] + sorted(mans)
|
return [Device.manufacturer] + sorted(mans)
|
||||||
|
|
||||||
def get_devices_of(manufacturer):
|
def get_devices_of(manufacturer):
|
||||||
ans = [d for d in get_devices() if d.manufacturer == manufacturer]
|
ans = [d for d in get_devices() if d.manufacturer == manufacturer]
|
||||||
@ -402,22 +423,6 @@ class StanzaPage(QWizardPage, StanzaUI):
|
|||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
class WordPlayerPage(StanzaPage):
|
|
||||||
|
|
||||||
ID = 6
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
StanzaPage.__init__(self)
|
|
||||||
self.label.setText('<p>'+_('If you use the WordPlayer e-book app on '
|
|
||||||
'your Android phone, you can access your calibre book collection '
|
|
||||||
'directly on the device. To do this you have to turn on the '
|
|
||||||
'content server.'))
|
|
||||||
self.instructions.setText('<p>'+_('Remember to leave calibre running '
|
|
||||||
'as the server only runs as long as calibre is running.')+'<br><br>'
|
|
||||||
+ _('You have to add the URL http://myhostname:8080 as your '
|
|
||||||
'calibre library in WordPlayer. Here myhostname should be the fully '
|
|
||||||
'qualified hostname or the IP address of the computer calibre is running on.'))
|
|
||||||
|
|
||||||
|
|
||||||
class DevicePage(QWizardPage, DeviceUI):
|
class DevicePage(QWizardPage, DeviceUI):
|
||||||
|
|
||||||
@ -430,6 +435,8 @@ class DevicePage(QWizardPage, DeviceUI):
|
|||||||
self.registerField("device", self.device_view)
|
self.registerField("device", self.device_view)
|
||||||
|
|
||||||
def initializePage(self):
|
def initializePage(self):
|
||||||
|
self.label.setText(_('Choose you e-book device. If your device is'
|
||||||
|
' not in the list, choose a "%s" device.')%Device.manufacturer)
|
||||||
self.man_model = ManufacturerModel()
|
self.man_model = ManufacturerModel()
|
||||||
self.manufacturer_view.setModel(self.man_model)
|
self.manufacturer_view.setModel(self.man_model)
|
||||||
previous = dynamic.get('welcome_wizard_device', False)
|
previous = dynamic.get('welcome_wizard_device', False)
|
||||||
@ -477,8 +484,6 @@ class DevicePage(QWizardPage, DeviceUI):
|
|||||||
return KindlePage.ID
|
return KindlePage.ID
|
||||||
if dev is iPhone:
|
if dev is iPhone:
|
||||||
return StanzaPage.ID
|
return StanzaPage.ID
|
||||||
if dev is Android:
|
|
||||||
return WordPlayerPage.ID
|
|
||||||
return FinishPage.ID
|
return FinishPage.ID
|
||||||
|
|
||||||
class MoveMonitor(QObject):
|
class MoveMonitor(QObject):
|
||||||
@ -753,13 +758,11 @@ class Wizard(QWizard):
|
|||||||
self.set_finish_text()
|
self.set_finish_text()
|
||||||
self.kindle_page = KindlePage()
|
self.kindle_page = KindlePage()
|
||||||
self.stanza_page = StanzaPage()
|
self.stanza_page = StanzaPage()
|
||||||
self.word_player_page = WordPlayerPage()
|
|
||||||
self.setPage(self.library_page.ID, self.library_page)
|
self.setPage(self.library_page.ID, self.library_page)
|
||||||
self.setPage(self.device_page.ID, self.device_page)
|
self.setPage(self.device_page.ID, self.device_page)
|
||||||
self.setPage(self.finish_page.ID, self.finish_page)
|
self.setPage(self.finish_page.ID, self.finish_page)
|
||||||
self.setPage(self.kindle_page.ID, self.kindle_page)
|
self.setPage(self.kindle_page.ID, self.kindle_page)
|
||||||
self.setPage(self.stanza_page.ID, self.stanza_page)
|
self.setPage(self.stanza_page.ID, self.stanza_page)
|
||||||
self.setPage(self.word_player_page.ID, self.word_player_page)
|
|
||||||
|
|
||||||
self.device_extra_page = None
|
self.device_extra_page = None
|
||||||
nh, nw = min_available_height()-75, available_width()-30
|
nh, nw = min_available_height()-75, available_width()-30
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Choose your book reader. This will set the conversion options to produce books optimized for your device.</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user