Sha256: 71efb8db9cddb574384fff66a2c64e62a6dd17583c4faaa5071a3f97c916d5e1

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

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

require "alexandria/ui/alert_dialog"

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

      def initialize(parent, library, book)
        super(parent,
              format(_("The book '%s' already exists in '%s'. Would you like " \
                "to replace it?"), book.title, library.name),
              Gtk::Stock::DIALOG_QUESTION,
              [[_("_Skip"), Gtk::ResponseType::CANCEL],
               [_("_Replace"), Gtk::ResponseType::OK]],
              _("If you replace the existing book, its contents will " \
                "be overwritten."))
        self.default_response = Gtk::ResponseType::CANCEL
      end

      def replace?
        show_all && (@response = run)
        destroy
        @response == Gtk::ResponseType::OK
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alexandria-book-collection-manager-0.7.5 lib/alexandria/ui/conflict_while_copying_dialog.rb
alexandria-book-collection-manager-0.7.4 lib/alexandria/ui/conflict_while_copying_dialog.rb