70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
# File 'lib/application.rb', line 70
def reload_css_config
= nil
bad_css = nil
css_file = check_css_file_path
if css_file
@provider.signal_connect "parsing-error" do |css_provider, section, error|
buf = Gtk::TextBuffer.new
buf.text = @css_content
start_i = buf.get_iter_at(:line => section.start_line,
:index => section.start_position)
end_i = buf.get_iter_at(:line => section.start_line + 10,
:index => section.end_position)
bad_css = ""
buf.get_text(start_i, end_i, true).lines.each_with_index do |line, i|
bad_css += "#{section.start_line + 1 + i} #{line}"
end
end
begin
load_custom_css(css_file)
rescue => e
self.windows.first.exit_overlay_mode
= .new(self.windows.first)
.transient_for = self.windows.first
.message = e.message + "\n\n" + bad_css
.show_all
end
end
end
|