Package Gnumed :: Package wxGladeWidgets :: Module wxgUnhandledExceptionDlg
[frames] | no frames]

Source Code for Module Gnumed.wxGladeWidgets.wxgUnhandledExceptionDlg

  1  #!/usr/bin/env python 
  2  # -*- coding: UTF-8 -*- 
  3  # generated by wxGlade 0.4.1 on Mon May  7 21:06:13 2007 
  4   
  5  import wx 
  6   
7 -class wxgUnhandledExceptionDlg(wx.Dialog):
8 - def __init__(self, *args, **kwds):
9 # begin wxGlade: wxgUnhandledExceptionDlg.__init__ 10 kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME 11 wx.Dialog.__init__(self, *args, **kwds) 12 self.__szr_middle_staticbox = wx.StaticBox(self, -1, _("Details")) 13 self.__pnl_top_message = wx.Panel(self, -1, style=wx.NO_BORDER) 14 self._TCTRL_comment = wx.TextCtrl(self, -1, "") 15 self._TCTRL_sender = wx.TextCtrl(self, -1, _("<Please supply your email address here !>")) 16 self._TCTRL_helpdesk = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER) 17 self._TCTRL_logfile = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER) 18 self._TCTRL_exc_type = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER) 19 self._TCTRL_exc_value = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER) 20 self._TCTRL_traceback = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL) 21 self._BTN_ok = wx.Button(self, wx.ID_OK, _("Keep running")) 22 self._BTN_close = wx.Button(self, wx.ID_CANCEL, _("Close GNUmed")) 23 self._BTN_view_log = wx.Button(self, -1, _("View log")) 24 self._BTN_mail = wx.Button(self, -1, _("Send report")) 25 26 self.__set_properties() 27 self.__do_layout() 28 29 self.Bind(wx.EVT_BUTTON, self._on_close_gnumed_button_pressed, id=wx.ID_CANCEL) 30 self.Bind(wx.EVT_BUTTON, self._on_view_log_button_pressed, self._BTN_view_log) 31 self.Bind(wx.EVT_BUTTON, self._on_mail_button_pressed, self._BTN_mail)
32 # end wxGlade 33
34 - def __set_properties(self):
35 # begin wxGlade: wxgUnhandledExceptionDlg.__set_properties 36 self.SetTitle(_("GNUmed exception handler")) 37 self.__pnl_top_message.SetBackgroundColour(wx.Colour(255, 0, 0)) 38 self._TCTRL_comment.SetToolTipString(_("Enter any additional data or commentary you wish to provide such as what you were about to do.")) 39 self._TCTRL_comment.SetFocus() 40 self._TCTRL_sender.SetToolTipString(_("Please enter your email address so we can provide feedback directly to you. Otherwise, feedback will be given on the GNUmed mailing list (http://lists.gnu.org/mailman/listinfo/gnumed-bugs).")) 41 self._TCTRL_helpdesk.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) 42 self._TCTRL_helpdesk.SetToolTipString(_("Find help on http://wiki.gnumed.de, too.")) 43 self._TCTRL_helpdesk.Enable(False) 44 self._TCTRL_logfile.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) 45 self._TCTRL_logfile.Enable(False) 46 self._TCTRL_exc_type.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) 47 self._TCTRL_exc_type.Enable(False) 48 self._TCTRL_exc_value.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) 49 self._TCTRL_exc_value.Enable(False) 50 self._BTN_ok.SetToolTipString(_("Close this dialog but keep running GNUmed.")) 51 self._BTN_ok.SetDefault() 52 self._BTN_close.SetToolTipString(_("Close this dialog AND the GNUmed client.")) 53 self._BTN_view_log.SetToolTipString(_("View the log file.")) 54 self._BTN_mail.SetToolTipString(_("Email a bug report to the GNUmed developers.\n\nMost questions will be answered on the mailing list so you are well advised to either subscribe or check its archive (http://lists.gnu.org/mailman/listinfo/gnumed-bugs).\n\nIf you specify your address in the Sender field above the developers will be able to contact you directly for feedback."))
55 # end wxGlade 56
57 - def __do_layout(self):
58 # begin wxGlade: wxgUnhandledExceptionDlg.__do_layout 59 __szr_main = wx.BoxSizer(wx.VERTICAL) 60 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL) 61 __szr_middle = wx.StaticBoxSizer(self.__szr_middle_staticbox, wx.VERTICAL) 62 _gszr_details = wx.FlexGridSizer(6, 2, 3, 5) 63 __szr_top_inner = wx.BoxSizer(wx.VERTICAL) 64 __lbl_top_message = wx.StaticText(self.__pnl_top_message, -1, _("An unhandled exception has occurred."), style=wx.ALIGN_CENTRE) 65 __lbl_top_message.SetBackgroundColour(wx.Colour(255, 0, 0)) 66 __lbl_top_message.SetForegroundColour(wx.Colour(255, 255, 0)) 67 __lbl_top_message.SetFont(wx.Font(14, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) 68 __szr_top_inner.Add(__lbl_top_message, 0, wx.ALL|wx.EXPAND, 10) 69 self.__pnl_top_message.SetSizer(__szr_top_inner) 70 __szr_main.Add(self.__pnl_top_message, 0, wx.EXPAND, 0) 71 __lbl_explanation = wx.StaticText(self, -1, _("GNUmed detected an error for which no specific handler had been defined.\n\nDetails about the error can be found in the log file a copy of which has\nbeen saved away in your home directory (see below). It may contain\nbits of sensitive information so you may want to screen the content\nbefore handing it to IT staff for debugging.\n\nGNUmed will try to keep running. However, it is strongly advised to\nclose this GNUmed workplace as soon as possible. You can try to save\nunsaved data but don't count on it.\n\nIt should then be safe to restart GNUmed.\n\nDocumentation to be found at <http://wiki.gnumed.de>.")) 72 __szr_main.Add(__lbl_explanation, 0, wx.ALL|wx.EXPAND, 5) 73 __lbl_comment = wx.StaticText(self, -1, _("Comment")) 74 __lbl_comment.SetToolTipString(_("Enter a short comment on what you were trying to do with GNUmed. This information will be added to the logfile for easier identification later on.")) 75 _gszr_details.Add(__lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0) 76 _gszr_details.Add(self._TCTRL_comment, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 77 __lbl_sender = wx.StaticText(self, -1, _("Sender")) 78 _gszr_details.Add(__lbl_sender, 0, wx.ALIGN_CENTER_VERTICAL, 0) 79 _gszr_details.Add(self._TCTRL_sender, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 80 __lbl_helpdesk = wx.StaticText(self, -1, _("Help desk")) 81 _gszr_details.Add(__lbl_helpdesk, 0, wx.ALIGN_CENTER_VERTICAL, 0) 82 _gszr_details.Add(self._TCTRL_helpdesk, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 83 __lbl_logfile = wx.StaticText(self, -1, _("Log file")) 84 _gszr_details.Add(__lbl_logfile, 0, wx.ALIGN_CENTER_VERTICAL, 0) 85 _gszr_details.Add(self._TCTRL_logfile, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 86 __lbl_type = wx.StaticText(self, -1, _("Type")) 87 _gszr_details.Add(__lbl_type, 0, wx.ALIGN_CENTER_VERTICAL, 0) 88 _gszr_details.Add(self._TCTRL_exc_type, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 89 __lbl_value = wx.StaticText(self, -1, _("Value")) 90 _gszr_details.Add(__lbl_value, 0, wx.ALIGN_CENTER_VERTICAL, 0) 91 _gszr_details.Add(self._TCTRL_exc_value, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 92 _gszr_details.AddGrowableCol(1) 93 __szr_middle.Add(_gszr_details, 0, wx.TOP|wx.BOTTOM|wx.EXPAND, 5) 94 __szr_middle.Add(self._TCTRL_traceback, 1, wx.EXPAND, 0) 95 __szr_main.Add(__szr_middle, 1, wx.ALL|wx.EXPAND, 5) 96 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0) 97 __szr_buttons.Add(self._BTN_ok, 0, wx.RIGHT|wx.EXPAND, 3) 98 __szr_buttons.Add(self._BTN_close, 0, wx.LEFT|wx.EXPAND, 3) 99 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0) 100 __szr_buttons.Add(self._BTN_view_log, 0, wx.RIGHT|wx.EXPAND, 3) 101 __szr_buttons.Add(self._BTN_mail, 0, wx.LEFT|wx.EXPAND, 3) 102 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0) 103 __szr_main.Add(__szr_buttons, 0, wx.ALL|wx.EXPAND, 5) 104 self.SetSizer(__szr_main) 105 __szr_main.Fit(self) 106 self.Layout() 107 self.Centre()
108 # end wxGlade 109
110 - def _on_close_gnumed_button_pressed(self, event): # wxGlade: wxgUnhandledExceptionDlg.<event_handler>
111 print "Event handler `_on_close_gnumed_button_pressed' not implemented" 112 event.Skip()
113
114 - def __on_keep_running_button_pressed(self, event): # wxGlade: wxgUnhandledExceptionDlg.<event_handler>
115 print "Event handler `__on_keep_running_button_pressed' not implemented" 116 event.Skip() 117
118 - def __on_close_gnumed_button_pressed(self, event): # wxGlade: wxgUnhandledExceptionDlg.<event_handler>
119 print "Event handler `__on_close_gnumed_button_pressed' not implemented" 120 event.Skip() 121
122 - def _on_mail_button_pressed(self, event): # wxGlade: wxgUnhandledExceptionDlg.<event_handler>
123 print "Event handler `_on_mail_button_pressed' not implemented" 124 event.Skip() 125
126 - def _on_view_log_button_pressed(self, event): # wxGlade: wxgUnhandledExceptionDlg.<event_handler>
127 print "Event handler `_on_view_log_button_pressed' not implemented" 128 event.Skip() 129 130 # end of class wxgUnhandledExceptionDlg 131