Back to index

system-config-printer  1.3.9+20120706
Functions
errordialogs Namespace Reference

Functions

def show_dialog
def show_info_dialog
def show_error_dialog
def show_IPP_Error
def show_HTTP_Error

Function Documentation

def errordialogs.show_dialog (   title,
  text,
  type,
  parent = None 
)

Definition at line 28 of file errordialogs.py.

00028 
00029 def show_dialog (title, text, type, parent=None):
00030     dialog = gtk.MessageDialog (parent,
00031                                 gtk.DIALOG_MODAL |
00032                                 gtk.DIALOG_DESTROY_WITH_PARENT,
00033                                 type,
00034                                 gtk.BUTTONS_OK,
00035                                 title)
00036     dialog.format_secondary_text (text)
00037     dialog.run ()
00038     dialog.destroy ()

def errordialogs.show_error_dialog (   title,
  text,
  parent = None 
)

Definition at line 42 of file errordialogs.py.

00042 
00043 def show_error_dialog (title, text, parent=None):
00044     return show_dialog (title, text, gtk.MESSAGE_ERROR, parent=parent)

def errordialogs.show_HTTP_Error (   status,
  parent = None 
)

Definition at line 59 of file errordialogs.py.

00059 
00060 def show_HTTP_Error(status, parent=None):
00061     if (status == cups.HTTP_UNAUTHORIZED or
00062         status == cups.HTTP_FORBIDDEN):
00063         title = _('Not authorized')
00064         text = (_('The password may be incorrect, or the '
00065                   'server may be configured to deny '
00066                   'remote administration.'))
00067     else:
00068         title = _('CUPS server error')
00069         if status == cups.HTTP_BAD_REQUEST:
00070             msg = _("Bad request")
00071         elif status == cups.HTTP_NOT_FOUND:
00072             msg = _("Not found")
00073         elif status == cups.HTTP_REQUEST_TIMEOUT:
00074             msg = _("Request timeout")
00075         elif status == cups.HTTP_UPGRADE_REQUIRED:
00076             msg = _("Upgrade required")
00077         elif status == cups.HTTP_SERVER_ERROR:
00078             msg = _("Server error")
00079         elif status == -1:
00080             msg = _("Not connected")
00081         else:
00082             msg = _("status %s") % status
00083 
00084         text = _("There was an HTTP error: %s.") % msg
00085 
00086     show_error_dialog (title, text, parent)

Here is the caller graph for this function:

def errordialogs.show_info_dialog (   title,
  text,
  parent = None 
)

Definition at line 39 of file errordialogs.py.

00039 
00040 def show_info_dialog (title, text, parent=None):
00041     return show_dialog (title, text, gtk.MESSAGE_INFO, parent=parent)

def errordialogs.show_IPP_Error (   exception,
  message,
  parent = None 
)

Definition at line 45 of file errordialogs.py.

00045 
00046 def show_IPP_Error(exception, message, parent=None):
00047     if exception == 0:
00048         # In this case, the user has canceled an authentication dialog.
00049         return
00050     elif exception == cups.IPP_SERVICE_UNAVAILABLE:
00051         # In this case, the user has canceled a retry dialog.
00052         return
00053     else:
00054         title = _("CUPS server error")
00055         text = (_("There was an error during the CUPS "
00056                   "operation: '%s'.")) % message
00057 
00058     show_error_dialog (title, text, parent)

Here is the caller graph for this function: