GUI for comic input

This commit is contained in:
Kovid Goyal 2009-05-04 19:19:47 -07:00
parent a8b7cc4af8
commit 3f0e2c389c
3 changed files with 334 additions and 2 deletions

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.convert.comic_input_ui import Ui_Form
from calibre.gui2.convert import Widget
class PluginWidget(Widget, Ui_Form):
TITLE = _('Comic Input')
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
Widget.__init__(self, parent, 'comic_input',
['colors', 'dont_normalize', 'keep_aspect_ratio', 'right2left',
'despeckle', 'no_sort', 'no_process', 'landscape',
'dont_sharpen', 'disable_trim', 'wide']
)
self.db, self.book_id = db, book_id
self.initialize_options(get_option, get_help, db, book_id)
self.opt_no_process.toggle()
self.opt_no_process.toggle()

View File

@ -0,0 +1,304 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>599</width>
<height>305</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&amp;Number of Colors:</string>
</property>
<property name="buddy">
<cstring>opt_colors</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="opt_colors">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>3200000</number>
</property>
<property name="singleStep">
<number>8</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="opt_dont_normalize">
<property name="text">
<string>Disable &amp;normalize</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="opt_keep_aspect_ratio">
<property name="text">
<string>Keep &amp;aspect ratio</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="opt_dont_sharpen">
<property name="text">
<string>Disable &amp;Sharpening</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="opt_disable_trim">
<property name="text">
<string>Disable &amp;Trimming</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="opt_wide">
<property name="text">
<string>&amp;Wide</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="opt_landscape">
<property name="text">
<string>&amp;Landscape</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="opt_right2left">
<property name="text">
<string>&amp;Right to left</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="opt_no_sort">
<property name="text">
<string>Don't so&amp;rt</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QCheckBox" name="opt_despeckle">
<property name="text">
<string>De&amp;speckle</string>
</property>
</widget>
</item>
<item row="11" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="opt_no_process">
<property name="text">
<string>&amp;Disable comic processing</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>label_3</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>184</x>
<y>11</y>
</hint>
<hint type="destinationlabel">
<x>210</x>
<y>44</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_colors</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>284</x>
<y>17</y>
</hint>
<hint type="destinationlabel">
<x>371</x>
<y>39</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_dont_normalize</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>107</x>
<y>15</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>67</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_keep_aspect_ratio</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>171</x>
<y>11</y>
</hint>
<hint type="destinationlabel">
<x>38</x>
<y>98</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_dont_sharpen</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>126</x>
<y>12</y>
</hint>
<hint type="destinationlabel">
<x>110</x>
<y>124</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_disable_trim</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>153</x>
<y>5</y>
</hint>
<hint type="destinationlabel">
<x>67</x>
<y>155</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_wide</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>164</x>
<y>13</y>
</hint>
<hint type="destinationlabel">
<x>84</x>
<y>180</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_landscape</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>129</x>
<y>11</y>
</hint>
<hint type="destinationlabel">
<x>145</x>
<y>209</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_right2left</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>183</x>
<y>15</y>
</hint>
<hint type="destinationlabel">
<x>52</x>
<y>225</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_no_sort</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>162</x>
<y>11</y>
</hint>
<hint type="destinationlabel">
<x>105</x>
<y>256</y>
</hint>
</hints>
</connection>
<connection>
<sender>opt_no_process</sender>
<signal>toggled(bool)</signal>
<receiver>opt_despeckle</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>254</x>
<y>19</y>
</hint>
<hint type="destinationlabel">
<x>180</x>
<y>296</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -131,7 +131,7 @@ class Config(ResizableDialog, Ui_Dialog):
try:
output_widget = __import__(name)
pw = output_widget.PluginWidget
pw.ICON = ':/images/forward.svg'
pw.ICON = ':/images/back.svg'
pw.HELP = _('Options specific to the output format.')
output_widget = widget_factory(pw)
except ImportError:
@ -228,7 +228,7 @@ if __name__ == '__main__':
images_rc
a=Application([])
db = LibraryDatabase2('/home/kovid/documents/library')
d = Config(None, db, 998)
d = Config(None, db, 594)
d.show()
a.exec_()