Method: Ruber::ExceptionDialog#initialize
- Defined in:
- lib/ruber/exception_widgets.rb
permalink #initialize(ex, parent = nil, out = true, msg = 'Ruber raised the following exception:') ⇒ ExceptionDialog
Returns a new instance of ExceptionDialog.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/ruber/exception_widgets.rb', line 92 def initialize ex, parent = nil, out = true, msg = 'Ruber raised the following exception:' super parent self.caption = KDE::Dialog.make_standard_caption "Exception" self. = Ok | Details Ok, 'Quit Ruber' Details, 'Backtrace' error = ex..gsub(/\n/, '<br/>') error.gsub!(/[<>]/){|s| s == '<' ? '<' : '>'} text = (!msg.empty? ? msg + '<br/>' : '') + '<tt>' + error + '</tt>' self. = Qt::Label.new text, self @backtrace_widget = ExceptionBacktraceWidget.new ex, self self. = @backtrace_widget @out = out end |