home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1183 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  2.4 KB  |  62 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.     
  18.     def __init__(self, parent, get_option, get_help, db = None, book_id = None):
  19.         global font_family_model
  20.         Widget.__init__(self, parent, 'lrf_output', [
  21.             'wordspace',
  22.             'header',
  23.             'header_format',
  24.             'minimum_indent',
  25.             'serif_family',
  26.             'render_tables_as_images',
  27.             'sans_family',
  28.             'mono_family',
  29.             'text_size_multiplier_for_rendered_tables',
  30.             'autorotation',
  31.             'header_separation',
  32.             'minimum_indent'])
  33.         self.db = db
  34.         self.book_id = book_id
  35.         if font_family_model is None:
  36.             font_family_model = FontFamilyModel()
  37.         
  38.         self.font_family_model = font_family_model
  39.         self.opt_serif_family.setModel(self.font_family_model)
  40.         self.opt_sans_family.setModel(self.font_family_model)
  41.         self.opt_mono_family.setModel(self.font_family_model)
  42.         self.initialize_options(get_option, get_help, db, book_id)
  43.         (self.opt_header.toggle(), self.opt_header.toggle())
  44.         self.opt_render_tables_as_images.toggle()
  45.         self.opt_render_tables_as_images.toggle()
  46.  
  47.     
  48.     def set_value_handler(self, g, val):
  49.         if unicode(g.objectName()) in ('opt_serif_family', 'opt_sans_family', 'opt_mono_family'):
  50.             idx = -1
  51.             if val:
  52.                 idx = g.findText(val, Qt.MatchFixedString)
  53.             
  54.             if idx < 0:
  55.                 idx = 0
  56.             
  57.             g.setCurrentIndex(idx)
  58.             return True
  59.         return False
  60.  
  61.  
  62.