Back to index

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

List of all members.

Public Member Functions

def __init__
def get_current_value
def is_changed
def changed
def get_default

Public Attributes

 selector
 name
 value
 supported
 on_change
 is_new
 label

Static Public Attributes

 conflicts = None

Detailed Description

Definition at line 383 of file options.py.


Constructor & Destructor Documentation

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

Reimplemented from options.Option.

Reimplemented in options.OptionSelectOneResolution.

Definition at line 385 of file options.py.

00385 
00386     def __init__(self, name, value, supported, on_change):
00387         Option.__init__(self, name, value, supported, on_change)
00388 
00389         self.selector = gtk.combo_box_new_text()
00390         
00391         selected = None
00392         for nr, choice in enumerate(supported):
00393             self.selector.append_text(str(choice))
00394             if str (value) == str (choice):
00395                 selected = nr
00396         if selected is not None:
00397             self.selector.set_active(selected)
00398         else:
00399             print "Unknown value for %s: %s" % (name, value)
00400             print "Choices:", supported
00401             if len(supported) > 0:
00402                 print "Selecting from choices:", supported[0]
00403                 self.selector.set_active(0)
00404         self.selector.connect("changed", self.changed)


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.Option.

Reimplemented in options.OptionSelectOneNumber, and options.OptionSelectOneResolution.

Definition at line 405 of file options.py.

00405 
00406     def get_current_value(self):
00407         return self.selector.get_active_text()
00408 
00409 # ---------------------------------------------------------------------------

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:


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.

options.Option.value [inherited]

Definition at line 360 of file options.py.


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