home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_1223 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  2.1 KB  |  59 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.     COMMIT_NAME = 'pdf_output'
  18.     ICON = I('mimetypes/pdf.png')
  19.     
  20.     def __init__(self, parent, get_option, get_help, db = None, book_id = None):
  21.         global paper_size_model, orientation_model
  22.         Widget.__init__(self, parent, [
  23.             'paper_size',
  24.             'orientation',
  25.             'preserve_cover_aspect_ratio'])
  26.         self.db = db
  27.         self.book_id = book_id
  28.         self.initialize_options(get_option, get_help, db, book_id)
  29.         default_paper_size = self.opt_paper_size.currentText()
  30.         default_orientation = self.opt_orientation.currentText()
  31.         if paper_size_model is None:
  32.             paper_size_model = BasicComboModel(PAPER_SIZES.keys())
  33.         
  34.         self.paper_size_model = paper_size_model
  35.         self.opt_paper_size.setModel(self.paper_size_model)
  36.         default_paper_size_index = self.opt_paper_size.findText(default_paper_size)
  37.         letter_index = self.opt_paper_size.findText('letter')
  38.         if default_paper_size_index != -1:
  39.             pass
  40.         elif letter_index != -1:
  41.             pass
  42.         
  43.         self.opt_paper_size.setCurrentIndex(0)
  44.         if orientation_model is None:
  45.             orientation_model = BasicComboModel(ORIENTATIONS.keys())
  46.         
  47.         self.orientation_model = orientation_model
  48.         self.opt_orientation.setModel(self.orientation_model)
  49.         default_orientation_index = self.opt_orientation.findText(default_orientation)
  50.         orientation_index = self.opt_orientation.findText('portrait')
  51.         if default_orientation_index != -1:
  52.             pass
  53.         elif orientation_index != -1:
  54.             pass
  55.         
  56.         self.opt_orientation.setCurrentIndex(0)
  57.  
  58.  
  59.