Back to index

system-config-printer  1.3.9+20120706
Public Member Functions | Public Attributes | Static Public Attributes
options.OptionSelectOneResolution Class Reference
Inheritance diagram for options.OptionSelectOneResolution:
Inheritance graph
[legend]
Collaboration diagram for options.OptionSelectOneResolution:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def string
def value
def get_current_value
def is_changed
def changed
def get_default

Public Attributes

 UNITS_BY_VAL
 UNITS_DEFAULT
 UNITS_BY_STR
 selector
 name
 value
 supported
 on_change
 is_new
 label

Static Public Attributes

 conflicts = None

Detailed Description

Definition at line 410 of file options.py.


Constructor & Destructor Documentation

def options.OptionSelectOneResolution.__init__ (   self,
  name,
  value,
  supported,
  on_change 
)

Reimplemented from options.OptionSelectOne.

Definition at line 411 of file options.py.

00411 
00412     def __init__(self, name, value, supported, on_change):
00413         self.UNITS_BY_VAL = { cups.IPP_RES_PER_INCH: "dpi",
00414                               cups.IPP_RES_PER_CM: "dpc" }
00415         self.UNITS_DEFAULT = cups.IPP_RES_PER_INCH
00416         self.UNITS_BY_STR = {}
00417         for v, s in self.UNITS_BY_VAL.iteritems ():
00418             self.UNITS_BY_STR[s] = v
00419 
00420         value = self.string (value)
00421         supported = map (self.string, supported)
00422         OptionSelectOne.__init__ (self, name, value, supported, on_change)


Member Function Documentation

def options.Option.changed (   self,
  widget,
  args 
) [inherited]

Definition at line 378 of file options.py.

00378 
00379     def changed(self, widget, *args):
00380         self.on_change(self)
00381     
00382 # ---------------------------------------------------------------------------

Reimplemented from options.OptionSelectOne.

Definition at line 432 of file options.py.

00432 
00433     def get_current_value(self):
00434         return self.value (self.selector.get_active_text())
00435 
00436 # ---------------------------------------------------------------------------

Here is the caller graph for this function:

def options.OptionInterface.get_default (   self) [inherited]

Reimplemented in options.OptionAlwaysShown.

Definition at line 109 of file options.py.

00109 
00110     def get_default(self):
00111         return None

def options.Option.is_changed (   self) [inherited]

Reimplemented from options.OptionInterface.

Definition at line 374 of file options.py.

00374 
00375     def is_changed(self):
00376         return (self.is_new or
00377                 str (self.get_current_value()) != str (self.value))

Here is the call graph for this function:

def options.OptionSelectOneResolution.string (   self,
  value 
)

Definition at line 423 of file options.py.

00423 
00424     def string(self, value):
00425         return "%sx%s%s" % (value[0], value[1],
00426                             self.UNITS_BY_VAL.get (value[2], ""))

def options.OptionSelectOneResolution.value (   self,
  string 
)

Definition at line 427 of file options.py.

00427 
00428     def value(self, string):
00429         matches = re.match ("(\d+)\D+(\d+)(.*)", string).groups ()
00430         return (int (matches[0]), int (matches[1]),
00431                 self.UNITS_BY_STR.get (matches[2], self.UNITS_DEFAULT))


Member Data Documentation

options.Option.conflicts = None [static, inherited]

Definition at line 356 of file options.py.

options.Option.is_new [inherited]

Definition at line 363 of file options.py.

options.Option.label [inherited]

Definition at line 368 of file options.py.

options.Option.name [inherited]

Definition at line 359 of file options.py.

Definition at line 362 of file options.py.

Definition at line 388 of file options.py.

Definition at line 361 of file options.py.

Definition at line 415 of file options.py.

Definition at line 412 of file options.py.

Definition at line 414 of file options.py.

options.Option.value [inherited]

Definition at line 360 of file options.py.


The documentation for this class was generated from the following file: