alexandria-book-collection-manager 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +31 -6
- data/.rubocop_todo.yml +33 -33
- data/.travis.yml +39 -0
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/Rakefile +4 -2
- data/alexandria-book-collection-manager.gemspec +2 -1
- data/bin/alexandria +0 -10
- data/doc/FAQ +1 -2
- data/doc/dependency_decisions.yml +5 -5
- data/lib/alexandria.rb +3 -1
- data/lib/alexandria/book_providers.rb +1 -4
- data/lib/alexandria/book_providers/adlibris.rb +4 -20
- data/lib/alexandria/book_providers/amazon_aws.rb +15 -8
- data/lib/alexandria/book_providers/amazon_ecs_util.rb +16 -10
- data/lib/alexandria/book_providers/barnes_and_noble.rb +1 -1
- data/lib/alexandria/book_providers/douban.rb +2 -2
- data/lib/alexandria/book_providers/proxis.rb +6 -2
- data/lib/alexandria/book_providers/pseudomarc.rb +3 -1
- data/lib/alexandria/book_providers/siciliano.rb +24 -27
- data/lib/alexandria/book_providers/thalia.rb +1 -1
- data/lib/alexandria/book_providers/worldcat.rb +5 -3
- data/lib/alexandria/book_providers/z3950.rb +20 -14
- data/lib/alexandria/export_library.rb +15 -12
- data/lib/alexandria/import_library.rb +65 -65
- data/lib/alexandria/library_collection.rb +2 -1
- data/lib/alexandria/library_store.rb +18 -7
- data/lib/alexandria/models/book.rb +2 -1
- data/lib/alexandria/models/library.rb +9 -3
- data/lib/alexandria/preferences.rb +13 -6
- data/lib/alexandria/scanners/keyboard.rb +2 -2
- data/lib/alexandria/smart_library.rb +41 -39
- data/lib/alexandria/ui/acquire_dialog.rb +47 -48
- data/lib/alexandria/ui/alert_dialog.rb +2 -1
- data/lib/alexandria/ui/barcode_animation.rb +6 -5
- data/lib/alexandria/ui/book_properties_dialog_base.rb +7 -3
- data/lib/alexandria/ui/callbacks.rb +14 -7
- data/lib/alexandria/ui/dndable.rb +1 -1
- data/lib/alexandria/ui/export_dialog.rb +0 -2
- data/lib/alexandria/ui/icons.rb +2 -1
- data/lib/alexandria/ui/iconview.rb +5 -3
- data/lib/alexandria/ui/import_dialog.rb +6 -8
- data/lib/alexandria/ui/keep_bad_isbn_dialog.rb +4 -3
- data/lib/alexandria/ui/listview.rb +34 -31
- data/lib/alexandria/ui/multi_drag_treeview.rb +3 -2
- data/lib/alexandria/ui/new_book_dialog.rb +28 -30
- data/lib/alexandria/ui/new_book_dialog_manual.rb +3 -1
- data/lib/alexandria/ui/provider_preferences_base_dialog.rb +2 -1
- data/lib/alexandria/ui/sidepane_manager.rb +6 -3
- data/lib/alexandria/ui/smart_library_properties_dialog_base.rb +5 -3
- data/lib/alexandria/ui/ui_manager.rb +22 -12
- data/lib/alexandria/version.rb +2 -2
- data/po/Makefile +2 -2
- data/share/alexandria/glade/acquire_dialog__builder.glade +1 -1
- data/share/alexandria/glade/book_properties_dialog__builder.glade +1 -1
- data/share/alexandria/glade/new_book_dialog__builder.glade +1 -1
- data/share/alexandria/glade/preferences_dialog__builder.glade +1 -1
- data/share/gnome/help/alexandria/C/introduction.xml +0 -4
- data/share/gnome/help/alexandria/C/searching.xml +1 -1
- data/share/gnome/help/alexandria/ja/introduction.xml +0 -4
- data/spec/alexandria/book_providers_spec.rb +12 -16
- data/spec/alexandria/console_spec.rb +1 -1
- data/spec/alexandria/ui/main_app_spec.rb +4 -31
- data/spec/alexandria/ui/really_delete_dialog_spec.rb +2 -1
- data/tasks/spec.rake +6 -4
- data/util/rake/fileinstall.rb +3 -1
- metadata +19 -7
- data/dogtail/basic_run_test.py +0 -9
- data/lib/alexandria/book_providers/renaud.rb +0 -142
- data/tasks/dogtail.rake +0 -6
@@ -80,80 +80,80 @@ module Alexandria
|
|
80
80
|
FileUtils.rm_rf(tmpdir) if File.exist?(tmpdir)
|
81
81
|
Dir.mkdir(tmpdir)
|
82
82
|
Dir.chdir(tmpdir) do
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
raise unless xml.root.elements.size == 1
|
83
|
+
system("unzip -qq \"#{filename}\"")
|
84
|
+
file = File.exist?("bookcase.xml") ? "bookcase.xml" : "tellico.xml"
|
85
|
+
xml = REXML::Document.new(File.open(file))
|
86
|
+
raise unless ["bookcase", "tellico"].include? xml.root.name
|
87
|
+
# FIXME: handle multiple collections
|
88
|
+
raise unless xml.root.elements.size == 1
|
90
89
|
|
91
|
-
|
92
|
-
|
90
|
+
collection = xml.root.elements[1]
|
91
|
+
raise unless collection.name == "collection"
|
93
92
|
|
94
|
-
|
95
|
-
|
93
|
+
type = collection.attribute("type").value.to_i
|
94
|
+
raise unless (type == 2) || (type == 5)
|
96
95
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
96
|
+
content = []
|
97
|
+
entries = collection.elements.to_a("entry")
|
98
|
+
(total = entries.size).times do |n|
|
99
|
+
entry = entries[n]
|
100
|
+
elements = entry.elements
|
101
|
+
# Feed an array in here, tomorrow.
|
102
|
+
keys = ["isbn", "publisher", "pub_year", "binding"]
|
104
103
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
end
|
128
|
-
end
|
129
|
-
book_elements[4] = book_elements[4].to_i unless book_elements[4].nil? # publishing_year
|
130
|
-
puts book_elements.inspect
|
131
|
-
cover = (neaten(elements["cover"].text) if elements["cover"])
|
132
|
-
puts cover
|
133
|
-
book = Book.new(*book_elements)
|
134
|
-
if elements["rating"] && Book::VALID_RATINGS.member?(elements["rating"].text.to_i)
|
135
|
-
book.rating = elements["rating"].text.to_i
|
104
|
+
book_elements = [neaten(elements["title"].text)]
|
105
|
+
book_elements += if !elements["authors"].nil?
|
106
|
+
[elements["authors"].elements.to_a.map \
|
107
|
+
{ |x| neaten(x.text) }]
|
108
|
+
else
|
109
|
+
[[]]
|
110
|
+
end
|
111
|
+
book_elements += keys.map do |key|
|
112
|
+
neaten(elements[key].text) if elements[key]
|
113
|
+
end
|
114
|
+
# isbn
|
115
|
+
if book_elements[2].nil? || book_elements[2].strip.empty?
|
116
|
+
book_elements[2] = nil
|
117
|
+
else
|
118
|
+
begin
|
119
|
+
book_elements[2] = book_elements[2].strip
|
120
|
+
book_elements[2] = Library.canonicalise_ean(book_elements[2])
|
121
|
+
rescue StandardError => ex
|
122
|
+
puts book_elements[2]
|
123
|
+
puts ex.message
|
124
|
+
puts ex.backtrace.join("\n> ")
|
125
|
+
raise ex
|
136
126
|
end
|
137
|
-
book.notes = neaten(elements["comments"].text) if elements["comments"]
|
138
|
-
content << [book, cover]
|
139
|
-
on_iterate_cb&.call(n + 1, total)
|
140
127
|
end
|
128
|
+
# publishing_year
|
129
|
+
book_elements[4] = book_elements[4].to_i unless book_elements[4].nil?
|
130
|
+
puts book_elements.inspect
|
131
|
+
cover = (neaten(elements["cover"].text) if elements["cover"])
|
132
|
+
puts cover
|
133
|
+
book = Book.new(*book_elements)
|
134
|
+
if elements["rating"]
|
135
|
+
rating = elements["rating"].text.to_i
|
136
|
+
book.rating = rating if Book::VALID_RATINGS.member? rating
|
137
|
+
end
|
138
|
+
book.notes = neaten(elements["comments"].text) if elements["comments"]
|
139
|
+
content << [book, cover]
|
140
|
+
on_iterate_cb&.call(n + 1, total)
|
141
|
+
end
|
141
142
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
end
|
149
|
-
library << book
|
150
|
-
library.save(book)
|
143
|
+
library = Library.load(name)
|
144
|
+
content.each do |book, cover|
|
145
|
+
unless cover.nil?
|
146
|
+
library.save_cover(book,
|
147
|
+
File.join(Dir.pwd, "images",
|
148
|
+
cover))
|
151
149
|
end
|
152
|
-
|
153
|
-
|
154
|
-
puts ex.message
|
155
|
-
return nil
|
150
|
+
library << book
|
151
|
+
library.save(book)
|
156
152
|
end
|
153
|
+
return [library, []]
|
154
|
+
rescue StandardError => ex
|
155
|
+
puts ex.message
|
156
|
+
return nil
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
@@ -24,7 +24,8 @@ module Alexandria
|
|
24
24
|
deleted = []
|
25
25
|
all_regular_libraries.each do |library|
|
26
26
|
ruined += library.ruined_books
|
27
|
-
# make deleted books from each library accessible so we don't crash on
|
27
|
+
# make deleted books from each library accessible so we don't crash on
|
28
|
+
# smart libraries
|
28
29
|
deleted += library.deleted_books
|
29
30
|
end
|
30
31
|
@ruined_books = ruined
|
@@ -45,7 +45,7 @@ module Alexandria
|
|
45
45
|
library = Library.new(name, self)
|
46
46
|
FileUtils.mkdir_p(library.path) unless File.exist?(library.path)
|
47
47
|
Dir.chdir(library.path) do
|
48
|
-
Dir["*" + Library::EXT[:book]].each do |filename|
|
48
|
+
Dir["*" + Library::EXT[:book]].sort.each do |filename|
|
49
49
|
test[1] = filename if (test[0]).zero?
|
50
50
|
|
51
51
|
unless File.size? test[1]
|
@@ -69,25 +69,34 @@ module Alexandria
|
|
69
69
|
ean = Library.canonicalise_ean(book.isbn)
|
70
70
|
book.isbn = ean if ean
|
71
71
|
|
72
|
-
|
72
|
+
unless book.publishing_year.nil?
|
73
|
+
book.publishing_year = book.publishing_year.to_i
|
74
|
+
end
|
73
75
|
|
74
76
|
# Or if isbn has changed
|
75
77
|
raise "#{test[1]} isbn is not okay" unless book.isbn == old_isbn
|
76
78
|
|
77
79
|
# Re-save book if Alexandria::DATA_VERSION changes
|
78
|
-
|
80
|
+
unless book.version == Alexandria::DATA_VERSION
|
81
|
+
raise "#{test[1]} version is not okay"
|
82
|
+
end
|
79
83
|
|
80
84
|
# Or if publishing year has changed
|
81
|
-
|
85
|
+
unless book.publishing_year == old_pub_year
|
86
|
+
raise "#{test[1]} pub year is not okay"
|
87
|
+
end
|
82
88
|
|
83
89
|
# ruined_books << [book, book.isbn, library]
|
84
90
|
book.library = library.name
|
85
91
|
|
86
92
|
## TODO copy cover image file, if necessary
|
87
|
-
# due to #26909 cover files for books without ISBN are re-saved as
|
93
|
+
# due to #26909 cover files for books without ISBN are re-saved as
|
94
|
+
# "g#{ident}.cover"
|
88
95
|
if book.isbn.nil? || book.isbn.empty?
|
89
96
|
if File.exist? library.old_cover(book)
|
90
|
-
log.debug
|
97
|
+
log.debug do
|
98
|
+
"#{library.name}; book #{book.title} has no ISBN, fixing cover image"
|
99
|
+
end
|
91
100
|
FileUtils::Verbose.mv(library.old_cover(book), library.cover(book))
|
92
101
|
end
|
93
102
|
end
|
@@ -122,7 +131,9 @@ module Alexandria
|
|
122
131
|
|
123
132
|
md = /(.+)\.cover/.match(cover)
|
124
133
|
ean = Library.canonicalise_ean(md[1]) || md[1]
|
125
|
-
|
134
|
+
unless cover == ean + Library::EXT[:cover]
|
135
|
+
FileUtils.mv(cover, ean + Library::EXT[:cover])
|
136
|
+
end
|
126
137
|
end
|
127
138
|
|
128
139
|
FileUtils.rm_f(Dir["*_small.jpg"])
|
@@ -8,7 +8,8 @@ module Alexandria
|
|
8
8
|
class Book
|
9
9
|
attr_accessor :title, :authors, :isbn, :publisher, :publishing_year,
|
10
10
|
:edition, :notes, :loaned, :loaned_since,
|
11
|
-
:loaned_to, :saved_ident, :redd, :redd_when, :own, :want,
|
11
|
+
:loaned_to, :saved_ident, :redd, :redd_when, :own, :want,
|
12
|
+
:tags, :version, :library
|
12
13
|
|
13
14
|
attr_reader :rating
|
14
15
|
|
@@ -53,7 +53,9 @@ module Alexandria
|
|
53
53
|
dest = dest_library.path
|
54
54
|
books.each do |book|
|
55
55
|
FileUtils.mv(source_library.yaml(book), dest)
|
56
|
-
|
56
|
+
if File.exist?(source_library.cover(book))
|
57
|
+
FileUtils.mv(source_library.cover(book), dest)
|
58
|
+
end
|
57
59
|
|
58
60
|
source_library.changed
|
59
61
|
source_library.old_delete(book)
|
@@ -181,7 +183,9 @@ module Alexandria
|
|
181
183
|
book.saved_ident = book.ident if book.saved_ident.nil? || book.saved_ident.empty?
|
182
184
|
if book.ident != book.saved_ident
|
183
185
|
FileUtils.rm(yaml(book.saved_ident))
|
184
|
-
|
186
|
+
if File.exist?(cover(book.saved_ident))
|
187
|
+
FileUtils.mv(cover(book.saved_ident), cover(book.ident))
|
188
|
+
end
|
185
189
|
end
|
186
190
|
book.saved_ident = book.ident
|
187
191
|
|
@@ -199,7 +203,9 @@ module Alexandria
|
|
199
203
|
|
200
204
|
if book.ident != book.saved_ident
|
201
205
|
FileUtils.rm(yaml(book.saved_ident))
|
202
|
-
|
206
|
+
if File.exist?(cover(book.saved_ident))
|
207
|
+
FileUtils.mv(cover(book.saved_ident), cover(book.ident))
|
208
|
+
end
|
203
209
|
|
204
210
|
# Notify before updating the saved identifier, so the views
|
205
211
|
# can still use the old one to update their models.
|
@@ -48,7 +48,10 @@ module Alexandria
|
|
48
48
|
def save!
|
49
49
|
log.debug { "preferences save!" }
|
50
50
|
@changed_settings.each do |variable_name|
|
51
|
-
log.debug
|
51
|
+
log.debug do
|
52
|
+
klass = @alexandria_settings[variable_name].class
|
53
|
+
"saving preference #{variable_name} / #{klass}"
|
54
|
+
end
|
52
55
|
generic_save_setting(variable_name, @alexandria_settings[variable_name])
|
53
56
|
end
|
54
57
|
@changed_settings.clear
|
@@ -125,7 +128,9 @@ module Alexandria
|
|
125
128
|
end
|
126
129
|
rescue StandardError => ex
|
127
130
|
log.debug { new_value.inspect }
|
128
|
-
log.error
|
131
|
+
log.error do
|
132
|
+
"Could not set GConf setting #{variable_name} to value: #{new_value.inspect}"
|
133
|
+
end
|
129
134
|
log << ex.message
|
130
135
|
log << ex
|
131
136
|
end
|
@@ -177,7 +182,7 @@ module Alexandria
|
|
177
182
|
type = get_gconf_type(new_value)
|
178
183
|
value_str = new_value
|
179
184
|
if new_value.is_a? String
|
180
|
-
new_value.gsub
|
185
|
+
new_value = new_value.gsub(/\"/, '\\"')
|
181
186
|
value_str = "\"#{new_value}\""
|
182
187
|
end
|
183
188
|
puts value_str if /cols_width/.match?(var_path)
|
@@ -226,7 +231,9 @@ module Alexandria
|
|
226
231
|
hash = {}
|
227
232
|
vals = all_vals.split(/$/)
|
228
233
|
vals.each do |val|
|
229
|
-
|
234
|
+
if /([a-z_]+) = (.*)/ =~ val
|
235
|
+
hash[Regexp.last_match[1]] = discriminate(Regexp.last_match[2])
|
236
|
+
end
|
230
237
|
end
|
231
238
|
hash
|
232
239
|
end
|
@@ -246,9 +253,9 @@ module Alexandria
|
|
246
253
|
elsif value =~ /^\((.*)\)$/ # pair (assume of type int)
|
247
254
|
begin
|
248
255
|
pair = Regexp.last_match[1].split(",")
|
249
|
-
|
256
|
+
[discriminate(pair.first), discriminate(pair.last)]
|
250
257
|
rescue StandardError
|
251
|
-
|
258
|
+
[0, 0]
|
252
259
|
end
|
253
260
|
else
|
254
261
|
value # string
|
@@ -359,45 +359,47 @@ module Alexandria
|
|
359
359
|
IS_BEFORE = Operator.new(:is_before,
|
360
360
|
_("is before"),
|
361
361
|
proc { |x, y| x.to_i < y.to_i && !x.nil? })
|
362
|
-
IS_IN_LAST =
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
362
|
+
IS_IN_LAST =
|
363
|
+
Operator.new(:is_in_last_days,
|
364
|
+
_("is in last"),
|
365
|
+
proc { |x, y|
|
366
|
+
begin
|
367
|
+
if x.nil? || x.empty?
|
368
|
+
false
|
369
|
+
else
|
370
|
+
log.debug { "Given Date: #{x.inspect} #{x.class}" }
|
371
|
+
given_date = Time.parse(x)
|
372
|
+
days = y.to_i * (24 * 60 * 60)
|
373
|
+
|
374
|
+
Time.now - given_date <= days
|
375
|
+
end
|
376
|
+
rescue StandardError => ex
|
377
|
+
trace = ex.backtrace.join("\n >")
|
378
|
+
log.warn { "Date matching failed #{ex} #{trace}" }
|
379
|
+
false
|
380
|
+
end
|
381
|
+
})
|
382
|
+
IS_NOT_IN_LAST =
|
383
|
+
Operator.new(:is_not_in_last_days,
|
384
|
+
_("is not in last"),
|
385
|
+
proc { |x, y|
|
386
|
+
begin
|
387
|
+
if x.nil? || x.empty?
|
388
|
+
false
|
389
|
+
else
|
390
|
+
log.debug { "Given Date: #{x.inspect} #{x.class}" }
|
391
|
+
given_date = Time.parse(x)
|
392
|
+
days = y.to_i * (24 * 60 * 60)
|
393
|
+
|
394
|
+
Time.now - given_date > days
|
395
|
+
end
|
396
|
+
rescue StandardError => ex
|
397
|
+
trace = ex.backtrace.join("\n >")
|
398
|
+
log.warn { "Date matching failed #{ex} #{trace}" }
|
399
|
+
false
|
400
|
+
end
|
401
|
+
# Time.now - x > 3600*24*y
|
402
|
+
})
|
401
403
|
|
402
404
|
ALL = constants.map \
|
403
405
|
{ |x| module_eval(x.to_s) }.select \
|
@@ -329,67 +329,63 @@ module Alexandria
|
|
329
329
|
|
330
330
|
def lookup_book(isbn)
|
331
331
|
Thread.new do
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
@barcodes_treeview.model.
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
model.row_changed(path, iter)
|
345
|
-
end
|
332
|
+
start_search
|
333
|
+
results = Alexandria::BookProviders.isbn_search(isbn)
|
334
|
+
book = results[0]
|
335
|
+
cover_uri = results[1]
|
336
|
+
@book_results[isbn] = results
|
337
|
+
set_cover_image_async(isbn, cover_uri)
|
338
|
+
|
339
|
+
@barcodes_treeview.model.freeze_notify do
|
340
|
+
@barcodes_treeview.model.each do |model, path, iter|
|
341
|
+
if iter[0] == isbn
|
342
|
+
iter[2] = book.title
|
343
|
+
model.row_changed(path, iter)
|
346
344
|
end
|
347
345
|
end
|
348
|
-
|
349
|
-
@add_button.sensitive = true
|
350
|
-
rescue StandardError => ex
|
351
|
-
log.error { "Book Search failed: #{ex.message}" }
|
352
|
-
log << ex if log.error?
|
353
|
-
ensure
|
354
|
-
stop_search
|
355
346
|
end
|
347
|
+
|
348
|
+
@add_button.sensitive = true
|
349
|
+
rescue StandardError => ex
|
350
|
+
log.error { "Book Search failed: #{ex.message}" }
|
351
|
+
log << ex if log.error?
|
352
|
+
ensure
|
353
|
+
stop_search
|
356
354
|
end
|
357
355
|
end
|
358
356
|
|
359
357
|
def set_cover_image_async(isbn, cover_uri)
|
360
358
|
Thread.new do
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
image_data = io.read
|
368
|
-
end
|
369
|
-
else
|
370
|
-
image_data = URI.parse(cover_uri).read
|
359
|
+
pixbuf = nil
|
360
|
+
if cover_uri
|
361
|
+
image_data = nil
|
362
|
+
if URI.parse(cover_uri).scheme.nil?
|
363
|
+
File.open(cover_uri, "r") do |io|
|
364
|
+
image_data = io.read
|
371
365
|
end
|
372
|
-
loader = GdkPixbuf::PixbufLoader.new
|
373
|
-
loader.last_write(image_data)
|
374
|
-
pixbuf = loader.pixbuf
|
375
366
|
else
|
376
|
-
|
367
|
+
image_data = URI.parse(cover_uri).read
|
377
368
|
end
|
369
|
+
loader = GdkPixbuf::PixbufLoader.new
|
370
|
+
loader.last_write(image_data)
|
371
|
+
pixbuf = loader.pixbuf
|
372
|
+
else
|
373
|
+
pixbuf = Icons::BOOK
|
374
|
+
end
|
378
375
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
end
|
376
|
+
@barcodes_treeview.model.freeze_notify do
|
377
|
+
@barcodes_treeview.model.each do |model, path, iter|
|
378
|
+
if iter[0] == isbn
|
379
|
+
iter[1] = pixbuf
|
380
|
+
model.row_changed(path, iter)
|
385
381
|
end
|
386
382
|
end
|
387
|
-
rescue StandardError => ex
|
388
|
-
log.error do
|
389
|
-
"Failed to load cover image icon: #{ex.message}"
|
390
|
-
end
|
391
|
-
log << ex if log.error?
|
392
383
|
end
|
384
|
+
rescue StandardError => ex
|
385
|
+
log.error do
|
386
|
+
"Failed to load cover image icon: #{ex.message}"
|
387
|
+
end
|
388
|
+
log << ex if log.error?
|
393
389
|
end
|
394
390
|
end
|
395
391
|
|
@@ -422,7 +418,8 @@ module Alexandria
|
|
422
418
|
@scan_area.grab_focus
|
423
419
|
end
|
424
420
|
@scan_area.signal_connect("focus-in-event") do |_widget, _event|
|
425
|
-
@barcode_label.label =
|
421
|
+
@barcode_label.label =
|
422
|
+
_(format("%s _Barcode Scanner Ready", _(@scanner.display_name)))
|
426
423
|
@scanner_buffer = ""
|
427
424
|
begin
|
428
425
|
@animation.set_active
|
@@ -494,7 +491,9 @@ module Alexandria
|
|
494
491
|
@interval = 0
|
495
492
|
|
496
493
|
else
|
497
|
-
log.debug
|
494
|
+
log.debug do
|
495
|
+
"Buffer has changed while waiting, reading more characters..."
|
496
|
+
end
|
498
497
|
end
|
499
498
|
end
|
500
499
|
|