Class: Alexandria::UI::KeepBadISBNDialog
- Inherits:
-
AlertDialog
- Object
- Gtk::Dialog
- AlertDialog
- Alexandria::UI::KeepBadISBNDialog
- Includes:
- GetText
- Defined in:
- lib/alexandria/ui/dialogs/new_book_dialog.rb
Instance Method Summary collapse
-
#initialize(parent, book) ⇒ KeepBadISBNDialog
constructor
A new instance of KeepBadISBNDialog.
- #keep? ⇒ Boolean
Constructor Details
#initialize(parent, book) ⇒ KeepBadISBNDialog
Returns a new instance of KeepBadISBNDialog.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/alexandria/ui/dialogs/new_book_dialog.rb', line 32 def initialize(parent, book) super(parent, _("Invalid ISBN '%s'") % book.isbn, Gtk::Stock::DIALOG_QUESTION, [[Gtk::Stock::CANCEL, :cancel], [_('_Keep'), :ok]], _("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) self.default_response = Gtk::ResponseType::OK show_all && (@response = run) destroy end |
Instance Method Details
#keep? ⇒ Boolean
45 46 47 |
# File 'lib/alexandria/ui/dialogs/new_book_dialog.rb', line 45 def keep? @response == :ok end |