Back to index

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

List of all members.

Public Member Functions

def __init__
def display
def can_click_forward
def connect_signals
def disconnect_signals
def collect_answer
def cancel_operation
def initial_vbox
 Helper functions.

Public Attributes

 label
 troubleshooter

Detailed Description

Definition at line 24 of file QueueNotEnabled.py.


Constructor & Destructor Documentation

def troubleshoot.QueueNotEnabled.QueueNotEnabled.__init__ (   self,
  troubleshooter 
)

Definition at line 25 of file QueueNotEnabled.py.

00025 
00026     def __init__ (self, troubleshooter):
00027         Question.__init__ (self, troubleshooter, "Queue not enabled?")
00028         self.label = gtk.Label ()
00029         solution = gtk.VBox ()
00030         self.label.set_line_wrap (True)
00031         self.label.set_alignment (0, 0)
00032         solution.pack_start (self.label, False, False, 0)
00033         solution.set_border_width (12)
00034         troubleshooter.new_page (solution, self)


Member Function Documentation

Reimplemented from troubleshoot.base.Question.

Definition at line 79 of file QueueNotEnabled.py.

00079 
00080     def can_click_forward (self):
00081         return False
def troubleshoot.base.Question.cancel_operation (   self) [inherited]
def troubleshoot.base.Question.collect_answer (   self) [inherited]
def troubleshoot.base.Question.connect_signals (   self,
  handler 
) [inherited]
Returns True if this page should be displayed, or False
if it should be skipped.

Reimplemented from troubleshoot.base.Question.

Definition at line 35 of file QueueNotEnabled.py.

00035 
00036     def display (self):
00037         answers =  self.troubleshooter.answers
00038         if not answers['cups_queue_listed']:
00039             return False
00040 
00041         if answers['is_cups_class']:
00042             queue = answers['cups_class_dict']
00043         else:
00044             queue = answers['cups_printer_dict']
00045 
00046         enabled = queue['printer-state'] != cups.IPP_PRINTER_STOPPED
00047         if enabled:
00048             return False
00049 
00050         if answers['cups_printer_remote']:
00051             attrs = answers['remote_cups_queue_attributes']
00052             reason = attrs['printer-state-message']
00053         else:
00054             reason = queue['printer-state-message']
00055 
00056         if reason:
00057             reason = _("The reason given is: '%s'.") % reason
00058         else:
00059             reason = _("This may be due to the printer being disconnected or "
00060                        "switched off.")
00061 
00062         text = ('<span weight="bold" size="larger">' +
00063                 _("Queue Not Enabled") + '</span>\n\n' +
00064                 _("The queue '%s' is not enabled.") %
00065                 answers['cups_queue'])
00066 
00067         if reason:
00068             text += ' ' + reason
00069 
00070         if not answers['cups_printer_remote']:
00071             text += '\n\n'
00072             text += _("To enable it, select the 'Enabled' checkbox in the "
00073                       "'Policies' tab for the printer in the printer "
00074                       "administration tool.")
00075             text += ' ' + _(TEXT_start_print_admin_tool)
00076 
00077         self.label.set_markup (text)
00078         return True

def troubleshoot.base.Question.initial_vbox (   self,
  title = '',
  text = '' 
) [inherited]

Helper functions.

Definition at line 66 of file base.py.

00066 
00067     def initial_vbox (self, title='', text=''):
00068         vbox = gtk.VBox ()
00069         vbox.set_border_width (12)
00070         vbox.set_spacing (12)
00071         if title:
00072             s = '<span weight="bold" size="larger">' + title + '</span>\n\n'
00073         else:
00074             s = ''
00075         s += text
00076         label = gtk.Label (s)
00077         label.set_alignment (0, 0)
00078         label.set_line_wrap (True)
00079         label.set_use_markup (True)
00080         vbox.pack_start (label, False, False, 0)
00081         return vbox

Here is the caller graph for this function:


Member Data Documentation

Definition at line 27 of file QueueNotEnabled.py.

Reimplemented in troubleshoot.CheckPrinterSanity.CheckPrinterSanity.

Definition at line 41 of file base.py.


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