C0 code coverage information
Generated on Tue Oct 16 11:40:51 -0400 2007 with rcov 0.8.0
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
1 # Copyright (C) 2004-2006 Laurent Sansonetti
2 #
3 # Alexandria is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License as
5 # published by the Free Software Foundation; either version 2 of the
6 # License, or (at your option) any later version.
7 #
8 # Alexandria is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public
14 # License along with Alexandria; see the file COPYING. If not,
15 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 # Boston, MA 02111-1307, USA.
17
18 module Alexandria
19 module UI
20 class SmartLibraryPropertiesDialog < SmartLibraryPropertiesDialogBase
21 include GetText
22 GetText.bindtextdomain(Alexandria::TEXTDOMAIN, nil, nil, "UTF-8")
23
24 def initialize(parent, smart_library, &block)
25 super(parent)
26
27 add_buttons([Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL],
28 [Gtk::Stock::SAVE, Gtk::Dialog::RESPONSE_OK])
29
30 self.title = _("Properties for '%s'") % smart_library.name
31 self.default_response = Gtk::Dialog::RESPONSE_CANCEL
32
33 show_all
34 smart_library.rules.each { |x| insert_new_rule(x) }
35 update_rules_header_box(smart_library.predicate_operator_rule)
36
37 while (response = run) != Gtk::Dialog::RESPONSE_CANCEL
38 if response == Gtk::Dialog::RESPONSE_HELP
39 begin
40 # TODO: write manual
41 #Gnome::Help.display('alexandria', 'edit-smart-library')
42 rescue => e
43 ErrorDialog.new(self, e.message)
44 end
45 elsif response == Gtk::Dialog::RESPONSE_OK
46 if user_confirms_possible_weirdnesses_before_saving?
47 smart_library.rules = self.smart_library_rules
48 smart_library.predicate_operator_rule =
49 self.predicate_operator_rule
50 smart_library.save
51 block.call(smart_library)
52 break
53 end
54 end
55 end
56
57 destroy
58 end
59 end
60 end
61 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.