mirror of
https://github.com/ciromattia/kcc
synced 2026-01-27 23:47:41 +00:00
Added profile: Kindle for Android
This commit is contained in:
@@ -70,7 +70,7 @@ Options:
|
||||
--version show program's version number and exit
|
||||
-h, --help show this help message and exit
|
||||
-p PROFILE, --profile=PROFILE
|
||||
Device profile (Choose one among K1, K2, K3, K4NT, K4T, KDX, KDXG, KHD, KF, KFHD, KFHD8) [Default=KHD]
|
||||
Device profile (Choose one among K1, K2, K3, K4NT, K4T, KDX, KDXG, KHD, KF, KFHD, KFHD8, KFA) [Default=KHD]
|
||||
-t TITLE, --title=TITLE
|
||||
Comic title [Default=filename]
|
||||
-m, --manga-style Manga style (Right-to-left reading and splitting) [Default=False]
|
||||
|
||||
@@ -287,15 +287,21 @@ class Ui_KCC(object):
|
||||
GUI.OptionsExpert.setEnabled(False)
|
||||
GUI.MangaBox.setEnabled(True)
|
||||
|
||||
def modeExpert(self):
|
||||
def modeExpert(self, KFA=False):
|
||||
self.modeAdvanced()
|
||||
self.currentMode = 3
|
||||
MainWindow.setMinimumSize(QtCore.QSize(420, 380))
|
||||
MainWindow.setMaximumSize(QtCore.QSize(420, 380))
|
||||
MainWindow.resize(420, 380)
|
||||
GUI.OptionsExpert.setEnabled(True)
|
||||
GUI.MangaBox.setCheckState(0)
|
||||
GUI.MangaBox.setEnabled(False)
|
||||
if KFA:
|
||||
GUI.ColorBox.setCheckState(2)
|
||||
GUI.FormatBox.setCurrentIndex(0)
|
||||
GUI.FormatBox.setEnabled(False)
|
||||
else:
|
||||
GUI.FormatBox.setEnabled(True)
|
||||
GUI.MangaBox.setCheckState(0)
|
||||
GUI.MangaBox.setEnabled(False)
|
||||
|
||||
def modeConvert(self, enable):
|
||||
if self.currentMode != 3:
|
||||
@@ -343,18 +349,22 @@ class Ui_KCC(object):
|
||||
if value:
|
||||
GUI.UpscaleBox.setChecked(False)
|
||||
|
||||
def changeDevice(self, value, start=False):
|
||||
if value == 11 and (start or self.currentMode != 3):
|
||||
def changeDevice(self, value):
|
||||
if value == 12:
|
||||
GUI.BasicModeButton.setEnabled(False)
|
||||
GUI.AdvModeButton.setEnabled(False)
|
||||
self.addMessage('<a href="https://github.com/ciromattia/kcc/wiki/NonKindle-devices">'
|
||||
'List of supported Non-Kindle devices</a>', 'info')
|
||||
self.modeExpert()
|
||||
elif value == 11:
|
||||
GUI.BasicModeButton.setEnabled(False)
|
||||
GUI.AdvModeButton.setEnabled(False)
|
||||
self.modeExpert(True)
|
||||
elif self.currentMode == 3:
|
||||
GUI.BasicModeButton.setEnabled(True)
|
||||
GUI.AdvModeButton.setEnabled(True)
|
||||
self.modeBasic()
|
||||
if value in [0, 1, 5, 6, 7, 8, 9, 11]:
|
||||
if value in [0, 1, 5, 6, 7, 8, 9, 12]:
|
||||
GUI.QualityBox.setCheckState(0)
|
||||
GUI.QualityBox.setEnabled(False)
|
||||
else:
|
||||
@@ -534,4 +544,4 @@ class Ui_KCC(object):
|
||||
self.modeExpert()
|
||||
self.versionCheck.start()
|
||||
self.hideProgressBar()
|
||||
self.changeDevice(self.lastDevice, True)
|
||||
self.changeDevice(self.lastDevice)
|
||||
|
||||
@@ -685,8 +685,8 @@ def main(argv=None, qtGUI=None):
|
||||
usage = "Usage: %prog [options] comic_file|comic_folder"
|
||||
parser = OptionParser(usage=usage, version=__version__)
|
||||
parser.add_option("-p", "--profile", action="store", dest="profile", default="KHD",
|
||||
help="Device profile (Choose one among K1, K2, K3, K4NT, K4T, KDX, KDXG, KHD, KF, KFHD, KFHD8) "
|
||||
"[Default=KHD]")
|
||||
help="Device profile (Choose one among K1, K2, K3, K4NT, K4T, KDX, KDXG, KHD, KF, KFHD, KFHD8,"
|
||||
" KFA) [Default=KHD]")
|
||||
parser.add_option("-t", "--title", action="store", dest="title", default="defaulttitle",
|
||||
help="Comic title [Default=filename]")
|
||||
parser.add_option("-m", "--manga-style", action="store_true", dest="righttoleft", default=False,
|
||||
@@ -819,6 +819,10 @@ def checkOptions():
|
||||
options.landscapemode = False
|
||||
options.panelview = False
|
||||
options.quality = 0
|
||||
# Kindle for Android profile require target resolution.
|
||||
if options.profile == 'KFA' and (options.customwidth == 0 or options.customheight == 0):
|
||||
print "ERROR: Kindle for Android profile require --customwidth and --customheight options!"
|
||||
sys.exit(1)
|
||||
# Override profile data
|
||||
if options.customwidth != 0 or options.customheight != 0:
|
||||
X = image.ProfileData.Profiles[options.profile][1][0]
|
||||
|
||||
@@ -85,6 +85,7 @@ class ProfileData:
|
||||
'KF': ("Kindle Fire", (600, 1024), Palette16, 1.0, (900, 1536)),
|
||||
'KFHD': ("Kindle Fire HD 7\"", (800, 1280), Palette16, 1.0, (1200, 1920)),
|
||||
'KFHD8': ("Kindle Fire HD 8.9\"", (1200, 1920), Palette16, 1.0, (1800, 2880)),
|
||||
'KFA': ("Kindle for Android", (0, 0), Palette16, 1.0, (0, 0)),
|
||||
'OTHER': ("Other", (0, 0), Palette16, 1.8, (0, 0)),
|
||||
}
|
||||
|
||||
@@ -100,6 +101,7 @@ class ProfileData:
|
||||
"Kindle Fire": 'KF',
|
||||
"Kindle Fire HD 7\"": 'KFHD',
|
||||
"Kindle Fire HD 8.9\"": 'KFHD8',
|
||||
"Kindle for Android": 'KFA',
|
||||
"Other": 'OTHER'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user