home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1197 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  2.1 KB  |  57 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL 3'
  5. __copyright__ = '2009, John Schember <john@nachtimwald.com>'
  6. __docformat__ = 'restructuredtext en'
  7. from calibre.gui2.convert.pdf_output_ui import Ui_Form
  8. from calibre.gui2.convert import Widget
  9. from calibre.ebooks.pdf.pageoptions import PAPER_SIZES, ORIENTATIONS
  10. from calibre.gui2.widgets import BasicComboModel
  11. paper_size_model = None
  12. orientation_model = None
  13.  
  14. class PluginWidget(Widget, Ui_Form):
  15.     TITLE = _('PDF Output')
  16.     HELP = _('Options specific to') + ' PDF ' + _('output')
  17.     
  18.     def __init__(self, parent, get_option, get_help, db = None, book_id = None):
  19.         global paper_size_model, orientation_model
  20.         Widget.__init__(self, parent, 'pdf_output', [
  21.             'paper_size',
  22.             'orientation',
  23.             'preserve_cover_aspect_ratio'])
  24.         self.db = db
  25.         self.book_id = book_id
  26.         self.initialize_options(get_option, get_help, db, book_id)
  27.         default_paper_size = self.opt_paper_size.currentText()
  28.         default_orientation = self.opt_orientation.currentText()
  29.         if paper_size_model is None:
  30.             paper_size_model = BasicComboModel(PAPER_SIZES.keys())
  31.         
  32.         self.paper_size_model = paper_size_model
  33.         self.opt_paper_size.setModel(self.paper_size_model)
  34.         default_paper_size_index = self.opt_paper_size.findText(default_paper_size)
  35.         letter_index = self.opt_paper_size.findText('letter')
  36.         if default_paper_size_index != -1:
  37.             pass
  38.         elif letter_index != -1:
  39.             pass
  40.         
  41.         self.opt_paper_size.setCurrentIndex(0)
  42.         if orientation_model is None:
  43.             orientation_model = BasicComboModel(ORIENTATIONS.keys())
  44.         
  45.         self.orientation_model = orientation_model
  46.         self.opt_orientation.setModel(self.orientation_model)
  47.         default_orientation_index = self.opt_orientation.findText(default_orientation)
  48.         orientation_index = self.opt_orientation.findText('portrait')
  49.         if default_orientation_index != -1:
  50.             pass
  51.         elif orientation_index != -1:
  52.             pass
  53.         
  54.         self.opt_orientation.setCurrentIndex(0)
  55.  
  56.  
  57.