Sha256: a1f369b205bfff89b87b18cf4fa5addc8c9d95936768c40c81d24947963c0451

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

# This file is part of Alexandria.
#
# See the file README.md for authorship and licensing information.

module Alexandria
  module UI
    class KeepBadISBNDialog < AlertDialog
      include GetText
      GetText.bindtextdomain(Alexandria::TEXTDOMAIN, charset: 'UTF-8')

      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)
        self.default_response = Gtk::ResponseType::OK
      end

      def keep?
        show_all
        @response = run
        destroy
        @response == Gtk::ResponseType::OK
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alexandria-book-collection-manager-0.7.3 lib/alexandria/ui/dialogs/keep_bad_isbn_dialog.rb