class MetaRuby::GUI::ExceptionView
Widget that allows to display a list of exceptions
@deprecated use {HTML::Page} and {HTML::Page#push_exception} directly instead
Constants
- TEMPLATE
Attributes
displayed_exceptions[R]
exception_rendering[R]
@return [#head,#scripts,#render] an object that allows to render
exceptions in HTML
metaruby_page[R]
@return [HTML::Page] the page object that allows to infer
Public Class Methods
new(parent = nil)
click to toggle source
Calls superclass method
# File lib/metaruby/gui/exception_view.rb, line 20 def initialize(parent = nil) super @displayed_exceptions = [] self.focus_policy = Qt::NoFocus @metaruby_page = HTML::Page.new(self.page) connect(@metaruby_page, SIGNAL('fileOpenClicked(const QUrl&)'), self, SLOT('fileOpenClicked(const QUrl&)')) @exception_rendering = ExceptionRendering.new(metaruby_page) if ENV['METARUBY_GUI_DEBUG_HTML'] page.settings.setAttribute(Qt::WebSettings::DeveloperExtrasEnabled, true) @inspector = Qt::WebInspector.new @inspector.page = page @inspector.show end end
Public Instance Methods
clear()
click to toggle source
# File lib/metaruby/gui/exception_view.rb, line 48 def clear @displayed_exceptions.clear update_html end
contents_height()
click to toggle source
# File lib/metaruby/gui/exception_view.rb, line 80 def contents_height self.page.main_frame.contents_size.height end
each_exception(&block)
click to toggle source
# File lib/metaruby/gui/exception_view.rb, line 53 def each_exception(&block) @displayed_exceptions.each(&block) end
exceptions=(list)
click to toggle source
# File lib/metaruby/gui/exception_view.rb, line 75 def exceptions=(list) @displayed_exceptions = list.dup update_html end
push(exception, reason = nil)
click to toggle source
# File lib/metaruby/gui/exception_view.rb, line 43 def push(exception, reason = nil) @displayed_exceptions << [exception, reason] update_html end
update_html()
click to toggle source
# File lib/metaruby/gui/exception_view.rb, line 71 def update_html self.html = ERB.new(TEMPLATE).result(binding) end
user_file_filter=(filter)
click to toggle source
# File lib/metaruby/gui/exception_view.rb, line 39 def user_file_filter=(filter) exception_rendering.user_file_filter = filter end