home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_1209 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  2.4 KB  |  64 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from __future__ import with_statement
  5. __license__ = 'GPL v3'
  6. __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
  7. __docformat__ = 'restructuredtext en'
  8. from PyQt4.Qt import Qt
  9. from calibre.gui2.convert.lrf_output_ui import Ui_Form
  10. from calibre.gui2.convert import Widget
  11. from calibre.gui2.widgets import FontFamilyModel
  12. font_family_model = None
  13.  
  14. class PluginWidget(Widget, Ui_Form):
  15.     TITLE = _('LRF Output')
  16.     HELP = _('Options specific to') + ' LRF ' + _('output')
  17.     COMMIT_NAME = 'lrf_output'
  18.     ICON = I('mimetypes/lrf.png')
  19.     
  20.     def __init__(self, parent, get_option, get_help, db = None, book_id = None):
  21.         global font_family_model
  22.         Widget.__init__(self, parent, [
  23.             'wordspace',
  24.             'header',
  25.             'header_format',
  26.             'minimum_indent',
  27.             'serif_family',
  28.             'render_tables_as_images',
  29.             'sans_family',
  30.             'mono_family',
  31.             'text_size_multiplier_for_rendered_tables',
  32.             'autorotation',
  33.             'header_separation',
  34.             'minimum_indent'])
  35.         self.db = db
  36.         self.book_id = book_id
  37.         if font_family_model is None:
  38.             font_family_model = FontFamilyModel()
  39.         
  40.         self.font_family_model = font_family_model
  41.         self.opt_serif_family.setModel(self.font_family_model)
  42.         self.opt_sans_family.setModel(self.font_family_model)
  43.         self.opt_mono_family.setModel(self.font_family_model)
  44.         self.initialize_options(get_option, get_help, db, book_id)
  45.         (self.opt_header.toggle(), self.opt_header.toggle())
  46.         self.opt_render_tables_as_images.toggle()
  47.         self.opt_render_tables_as_images.toggle()
  48.  
  49.     
  50.     def set_value_handler(self, g, val):
  51.         if unicode(g.objectName()) in ('opt_serif_family', 'opt_sans_family', 'opt_mono_family'):
  52.             idx = -1
  53.             if val:
  54.                 idx = g.findText(val, Qt.MatchFixedString)
  55.             
  56.             if idx < 0:
  57.                 idx = 0
  58.             
  59.             g.setCurrentIndex(idx)
  60.             return True
  61.         return False
  62.  
  63.  
  64.