C0 code coverage information
Generated on Tue Oct 16 11:40:50 -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 NewSmartLibraryDialog < SmartLibraryPropertiesDialogBase
21 include GetText
22 GetText.bindtextdomain(Alexandria::TEXTDOMAIN, nil, nil, "UTF-8")
23
24 def initialize(parent, &block)
25 super(parent)
26
27 add_buttons([Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL],
28 [Gtk::Stock::NEW, Gtk::Dialog::RESPONSE_OK])
29
30 self.title = _('New Smart Library')
31 self.default_response = Gtk::Dialog::RESPONSE_CANCEL
32
33 show_all
34 insert_new_rule
35
36 while (response = run) != Gtk::Dialog::RESPONSE_CANCEL and
37 response != Gtk::Dialog::RESPONSE_DELETE_EVENT
38
39 if response == Gtk::Dialog::RESPONSE_HELP
40 begin
41 # TODO: write manual
42 #Gnome::Help.display('alexandria', 'new-smart-library')
43 rescue => e
44 ErrorDialog.new(self, e.message)
45 end
46 elsif response == Gtk::Dialog::RESPONSE_OK
47 if user_confirms_possible_weirdnesses_before_saving?
48 rules = smart_library_rules
49 basename = if rules.length == 1 and
50 rules.first.value.is_a?(String) and
51 not rules.first.value.strip.empty?
52 rules.first.value
53 else
54 _('Smart Library')
55 end
56 name = Library.generate_new_name(
57 Libraries.instance.all_libraries,
58 basename)
59 library = SmartLibrary.new(name,
60 rules,
61 predicate_operator_rule)
62 block.call(library)
63 break
64 end
65 end
66 end
67
68 destroy
69 end
70 end
71 end
72 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.