Back to index

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

List of all members.

Public Member Functions

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

Public Attributes

 buffer
 save
 save_sigid
 troubleshooter

Detailed Description

Definition at line 23 of file Shrug.py.


Constructor & Destructor Documentation

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

Definition at line 24 of file Shrug.py.

00024 
00025     def __init__ (self, troubleshooter):
00026         Question.__init__ (self, troubleshooter, "Shrug")
00027         page = self.initial_vbox (_("Sorry!"),
00028                                   _("There is no obvious solution to this "
00029                                     "problem.  Your answers have been "
00030                                     "collected together with "
00031                                     "other useful information.  If you "
00032                                     "would like to report a bug, please "
00033                                     "include this information."))
00034 
00035         expander = gtk.Expander (_("Diagnostic Output (Advanced)"))
00036         expander.set_expanded (False)
00037         sw = gtk.ScrolledWindow ()
00038         expander.add (sw)
00039         textview = gtk.TextView ()
00040         textview.set_editable (False)
00041         sw.add (textview)
00042         page.pack_start (expander)
00043         self.buffer = textview.get_buffer ()
00044 
00045         box = gtk.HButtonBox ()
00046         box.set_border_width (0)
00047         box.set_spacing (3)
00048         box.set_layout (gtk.BUTTONBOX_END)
00049         page.pack_start (box, False, False, 0)
00050 
00051         self.save = gtk.Button (stock=gtk.STOCK_SAVE)
00052         box.pack_start (self.save, False, False, 0)
00053 
00054         troubleshooter.new_page (page, self)

Here is the call graph for this function:


Member Function Documentation

def troubleshoot.base.Question.cancel_operation (   self) [inherited]
def troubleshoot.base.Question.collect_answer (   self) [inherited]
def troubleshoot.Shrug.Shrug.connect_signals (   self,
  handler 
)

Reimplemented from troubleshoot.base.Question.

Definition at line 59 of file Shrug.py.

00059 
00060     def connect_signals (self, handler):
00061         self.save_sigid = self.save.connect ('clicked', self.on_save_clicked)

Reimplemented from troubleshoot.base.Question.

Definition at line 62 of file Shrug.py.

00062 
00063     def disconnect_signals (self):
00064         self.save.disconnect (self.save_sigid)

Returns True if this page should be displayed, or False
if it should be skipped.

Reimplemented from troubleshoot.base.Question.

Definition at line 55 of file Shrug.py.

00055 
00056     def display (self):
00057         self.buffer.set_text (self.troubleshooter.answers_as_text ())
00058         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:

def troubleshoot.Shrug.Shrug.on_save_clicked (   self,
  button 
)

Definition at line 65 of file Shrug.py.

00065 
00066     def on_save_clicked (self, button):
00067         while True:
00068             parent = self.troubleshooter.get_window()
00069             dialog = gtk.FileChooserDialog (parent=parent,
00070                                             action=gtk.FILE_CHOOSER_ACTION_SAVE,
00071                                             buttons=(gtk.STOCK_CANCEL,
00072                                                      gtk.RESPONSE_CANCEL,
00073                                                      gtk.STOCK_SAVE,
00074                                                      gtk.RESPONSE_OK))
00075             dialog.set_do_overwrite_confirmation (True)
00076             dialog.set_current_name ("troubleshoot.txt")
00077             dialog.set_default_response (gtk.RESPONSE_OK)
00078             dialog.set_local_only (True)
00079             response = dialog.run ()
00080             dialog.hide ()
00081             if response != gtk.RESPONSE_OK:
00082                 return
00083 
00084             try:
00085                 f = file (dialog.get_filename (), "w")
00086                 f.write (self.buffer.get_text (self.buffer.get_start_iter (),
00087                                                self.buffer.get_end_iter ()))
00088             except IOError, e:
00089                 err = gtk.MessageDialog (parent,
00090                                          gtk.DIALOG_MODAL |
00091                                          gtk.DIALOG_DESTROY_WITH_PARENT,
00092                                          gtk.MESSAGE_ERROR,
00093                                          gtk.BUTTONS_CLOSE,
00094                                          _("Error saving file"))
00095                 err.format_secondary_text (_("There was an error saving "
00096                                              "the file:") + "\n" +
00097                                            e.strerror)
00098                 err.run ()
00099                 err.destroy ()
00100                 continue
00101 
00102             del f
00103             break

Member Data Documentation

Definition at line 42 of file Shrug.py.

Definition at line 50 of file Shrug.py.

Definition at line 60 of file Shrug.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: