home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / hplip / ui / align10form.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-08-31  |  2.0 KB  |  73 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. from base.g import *
  5. import os.path as os
  6. from qt import *
  7. from align10form_base import Align10Form_Base
  8.  
  9. class Align10Form(Align10Form_Base):
  10.     
  11.     def __init__(self, pattern, parent = None, name = None, modal = 0, fl = 0):
  12.         Align10Form_Base.__init__(self, parent, name, modal, fl)
  13.         self.Icon.setPixmap(QPixmap(os.path.join(prop.image_dir, 'align10.png')))
  14.         if pattern == 1:
  15.             self.controls = {
  16.                 'A': (True, 23),
  17.                 'B': (True, 9),
  18.                 'C': (True, 9),
  19.                 'D': (False, 0),
  20.                 'E': (False, 0),
  21.                 'F': (False, 0),
  22.                 'G': (False, 0),
  23.                 'H': (False, 0) }
  24.         elif pattern == 2:
  25.             self.controls = {
  26.                 'A': (True, 23),
  27.                 'B': (True, 17),
  28.                 'C': (True, 23),
  29.                 'D': (True, 23),
  30.                 'E': (True, 9),
  31.                 'F': (True, 9),
  32.                 'G': (True, 9),
  33.                 'H': (True, 9) }
  34.         elif pattern == 3:
  35.             self.controls = {
  36.                 'A': (True, 23),
  37.                 'B': (True, 9),
  38.                 'C': (True, 23),
  39.                 'D': (True, 23),
  40.                 'E': (True, 9),
  41.                 'F': (True, 9),
  42.                 'G': (True, 9),
  43.                 'H': (True, 9) }
  44.         
  45.         for line in self.controls:
  46.             if not self.controls[line][0]:
  47.                 eval('self.comboBox%s.setEnabled(False)' % line)
  48.                 continue
  49.             for x in range(self.controls[line][1]):
  50.                 eval('self.comboBox%s.insertItem("%s%d")' % (line, line, x + 1))
  51.             
  52.         
  53.  
  54.     
  55.     def getValues(self):
  56.         ret = []
  57.         for line in self.controls:
  58.             if not self.controls[line][0]:
  59.                 ret.append(0)
  60.                 continue
  61.             exec 'selected = str(self.comboBox%s.currentText())' % line
  62.             
  63.             try:
  64.                 selected = int(selected[1:])
  65.             except ValueError:
  66.                 selected = 0
  67.  
  68.             ret.append(selected)
  69.         
  70.         return ret
  71.  
  72.  
  73.