if grab_focus
entry.button.grab_focus
end
+ update_visibility(entry)
})
end
end
def update_visibility(entry)
+ if ! entry.button
+ #- not yet loaded
+ return
+ end
if entry.labeled
if entry.labeled.button.active?
entry.button.show
else
entry.button.hide
end
+ else
+ if $unlabelled_button.active?
+ entry.button.show
+ else
+ entry.button.hide
+ end
end
end
update_visibility(entry)
}
shown = $mainview.get_shown_entry
- while ! shown.button.visible? && shown != $allentries.last
- $mainview.show_next_entry(shown)
- shown = $mainview.get_shown_entry
+ while shown.button && ! shown.button.visible? && shown != $allentries.last
+ shown = $allentries[$allentries.index(shown) + 1]
end
- if shown && shown.button.visible?
+ if shown.button && shown.button.visible?
shown.button.grab_focus
return
end
$allentries.reverse.each { |entry|
- if entry.button.visible?
+ if entry.button && entry.button.visible?
entry.button.grab_focus
return
end
end
$labels_vbox.pack_start(Gtk::Label.new(utf8(_("Labels list:"))).set_justify(Gtk::Justification::CENTER), false, false).show_all
$labels = {}
+ lbl = Gtk::Label.new.set_markup(utf8(_("<i>unlabelled</i>")))
+ $labels_vbox.pack_start($unlabelled_button = Gtk::CheckButton.new.add(Gtk::EventBox.new.add(lbl)).show_all)
+ $unlabelled_button.active = true
+ $unlabelled_button.signal_connect('toggled') { update_all_visibilities }
lbl = Gtk::Label.new.set_markup(utf8(_("<i>to remove</i>")))
$labels_vbox.pack_start($toremove_button = Gtk::CheckButton.new.add(evt = Gtk::EventBox.new.add(lbl)).show_all)
$toremove_button.active = true