lib/alexandria/ui/dialogs/book_properties_dialog.rb in alexandria-book-collection-manager-0.7.1 vs lib/alexandria/ui/dialogs/book_properties_dialog.rb in alexandria-book-collection-manager-0.7.2
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
# Copyright (C) 2004-2006 Laurent Sansonetti
# Copyright (C) 2016 Matijs van Zuijlen
#
# Alexandria is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -104,13 +106,11 @@
else
@redd_date.sensitive = false
end
@checkbutton_want.active = book.want?
- if (@checkbutton_own.active = book.own?)
- @checkbutton_want.inconsistent = true
- end
+ @checkbutton_want.inconsistent = true if (@checkbutton_own.active = book.own?)
end
private
def on_close
@@ -176,22 +176,18 @@
@book.want = @checkbutton_want.active?
@book.tags = @entry_tags.text.split(',') # tags are comma separated
FileUtils.rm_f(@cover_file) if @delete_cover_file
- if @original_cover_file
- FileUtils.rm_f(@original_cover_file)
- end
+ FileUtils.rm_f(@original_cover_file) if @original_cover_file
@library.save(@book)
# @on_close_cb.call(@book)
@book_properties_dialog.destroy
end
def on_cancel
- if @original_cover_file
- FileUtils.mv(@original_cover_file, @cover_file)
- end
+ FileUtils.mv(@original_cover_file, @cover_file) if @original_cover_file
@book_properties_dialog.destroy
end
def on_help
Alexandria::UI.display_help(@preferences_dialog,