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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
  6. __docformat__ = 'restructuredtext en'
  7. from calibre.gui2.preferences import ConfigWidgetBase, test_widget
  8. from calibre.gui2.preferences.look_feel_ui import Ui_Form
  9. from calibre.gui2 import config, gprefs
  10. from calibre.utils.localization import available_translations, get_language, get_lang
  11. from calibre.utils.config import prefs
  12.  
  13. class ConfigWidget(ConfigWidgetBase, Ui_Form):
  14.     
  15.     def genesis(self, gui):
  16.         self.gui = gui
  17.         r = self.register
  18.         r('gui_layout', config, restart_required = True, choices = [
  19.             (_('Wide'), 'wide'),
  20.             (_('Narrow'), 'narrow')])
  21.         r('cover_flow_queue_length', config, restart_required = True)
  22.         lang = get_lang()
  23.         if lang is None or lang not in available_translations():
  24.             lang = 'en'
  25.         
  26.         items = _[1]
  27.         items.sort(cmp = (lambda x, y: cmp(x[1].lower(), y[1].lower())))
  28.         choices = [ (y, x) for x, y in items ]
  29.         choices = [
  30.             (get_language(lang), lang)] + choices
  31.         r('language', prefs, choices = choices, restart_required = True)
  32.         r('show_avg_rating', config)
  33.         r('disable_animations', config)
  34.         r('systray_icon', config, restart_required = True)
  35.         r('show_splash_screen', gprefs)
  36.         r('disable_tray_notification', config)
  37.         r('use_roman_numerals_for_series_number', config)
  38.         r('separate_cover_flow', config, restart_required = True)
  39.         r('search_as_you_type', config)
  40.         r('show_child_bar', gprefs)
  41.         choices = [
  42.             (_('Small'), 'small'),
  43.             (_('Medium'), 'medium'),
  44.             (_('Large'), 'large')]
  45.         r('toolbar_icon_size', gprefs, choices = choices)
  46.         choices = [
  47.             (_('Automatic'), 'auto'),
  48.             (_('Always'), 'always'),
  49.             (_('Never'), 'never')]
  50.         r('toolbar_text', gprefs, choices = choices)
  51.  
  52.     
  53.     def refresh_gui(self, gui):
  54.         gui.search.search_as_you_type(config['search_as_you_type'])
  55.  
  56.  
  57. if __name__ == '__main__':
  58.     from PyQt4.Qt import QApplication
  59.     app = QApplication([])
  60.     test_widget('Interface', 'Look & Feel')
  61.  
  62.