class Alexandria::UI::KeepBadISBNDialog
Public Class Methods
new(parent, book)
click to toggle source
Calls superclass method
Alexandria::UI::AlertDialog::new
# File lib/alexandria/ui/keep_bad_isbn_dialog.rb, line 15 def initialize(parent, book) title = _("Invalid ISBN '%s'") % book.isbn message = _("The book titled '%s' has an invalid ISBN, but still " \ "exists in the providers libraries. Do you want to " \ "keep the book but change the ISBN or cancel the addition?") % book.title super(parent, title, Gtk::Stock::DIALOG_QUESTION, [[Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL], [_("_Keep"), Gtk::ResponseType::OK]], message) dialog.default_response = Gtk::ResponseType::OK end
Public Instance Methods
keep?()
click to toggle source
# File lib/alexandria/ui/keep_bad_isbn_dialog.rb, line 28 def keep? show_all @response = run destroy @response == Gtk::ResponseType::OK end