alexandria-book-collection-manager 0.6.9 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +34 -30
- data/.rubocop_todo.yml +139 -54
- data/CHANGELOG.md +10 -0
- data/Gemfile +1 -0
- data/Rakefile +10 -11
- data/alexandria-book-collection-manager.gemspec +3 -2
- data/bin/alexandria +1 -1
- data/lib/alexandria.rb +3 -6
- data/lib/alexandria/about.rb +9 -9
- data/lib/alexandria/book_providers.rb +12 -12
- data/lib/alexandria/book_providers/adlibris.rb +14 -18
- data/lib/alexandria/book_providers/amazon_aws.rb +17 -31
- data/lib/alexandria/book_providers/amazon_ecs_util.rb +5 -6
- data/lib/alexandria/book_providers/barnes_and_noble.rb +51 -76
- data/lib/alexandria/book_providers/bol_it.rb +12 -12
- data/lib/alexandria/book_providers/deastore.rb +27 -31
- data/lib/alexandria/book_providers/douban.rb +9 -13
- data/lib/alexandria/book_providers/ibs_it.rb +10 -10
- data/lib/alexandria/book_providers/mcu.rb +12 -18
- data/lib/alexandria/book_providers/proxis.rb +14 -22
- data/lib/alexandria/book_providers/pseudomarc.rb +8 -18
- data/lib/alexandria/book_providers/renaud.rb +16 -16
- data/lib/alexandria/book_providers/siciliano.rb +25 -38
- data/lib/alexandria/book_providers/thalia.rb +13 -16
- data/lib/alexandria/book_providers/webster_it.rb +14 -18
- data/lib/alexandria/book_providers/worldcat.rb +21 -25
- data/lib/alexandria/book_providers/z3950.rb +19 -23
- data/lib/alexandria/config.rb +2 -2
- data/lib/alexandria/execution_queue.rb +3 -1
- data/lib/alexandria/export_library.rb +19 -22
- data/lib/alexandria/import_library.rb +14 -18
- data/lib/alexandria/import_library_csv.rb +12 -30
- data/lib/alexandria/models/book.rb +7 -9
- data/lib/alexandria/models/library.rb +44 -44
- data/lib/alexandria/net.rb +1 -1
- data/lib/alexandria/preferences.rb +12 -57
- data/lib/alexandria/scanners.rb +10 -6
- data/lib/alexandria/scanners/cuecat.rb +2 -2
- data/lib/alexandria/smart_library.rb +12 -12
- data/lib/alexandria/ui.rb +5 -2
- data/lib/alexandria/ui/callbacks.rb +106 -65
- data/lib/alexandria/ui/completion_models.rb +55 -51
- data/lib/alexandria/ui/dialogs/about_dialog.rb +1 -1
- data/lib/alexandria/ui/dialogs/acquire_dialog.rb +25 -51
- data/lib/alexandria/ui/dialogs/alert_dialog.rb +13 -11
- data/lib/alexandria/ui/dialogs/bad_isbns_dialog.rb +2 -2
- data/lib/alexandria/ui/dialogs/barcode_animation.rb +39 -23
- data/lib/alexandria/ui/dialogs/book_properties_dialog.rb +16 -21
- data/lib/alexandria/ui/dialogs/book_properties_dialog_base.rb +23 -24
- data/lib/alexandria/ui/dialogs/export_dialog.rb +46 -45
- data/lib/alexandria/ui/dialogs/import_dialog.rb +26 -35
- data/lib/alexandria/ui/dialogs/misc_dialogs.rb +11 -11
- data/lib/alexandria/ui/dialogs/new_book_dialog.rb +47 -59
- data/lib/alexandria/ui/dialogs/new_book_dialog_manual.rb +14 -13
- data/lib/alexandria/ui/dialogs/new_smart_library_dialog.rb +12 -11
- data/lib/alexandria/ui/dialogs/preferences_dialog.rb +37 -43
- data/lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb +9 -8
- data/lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb +47 -53
- data/lib/alexandria/ui/dndable.rb +5 -4
- data/lib/alexandria/ui/icons.rb +19 -19
- data/lib/alexandria/ui/iconview.rb +7 -12
- data/lib/alexandria/ui/iconview_tooltips.rb +22 -109
- data/lib/alexandria/ui/init.rb +7 -15
- data/lib/alexandria/ui/libraries_combo.rb +54 -48
- data/lib/alexandria/ui/listview.rb +30 -85
- data/lib/alexandria/ui/multi_drag_treeview.rb +110 -107
- data/lib/alexandria/ui/sidepane.rb +23 -25
- data/lib/alexandria/ui/sound.rb +18 -27
- data/lib/alexandria/ui/ui_manager.rb +126 -204
- data/lib/alexandria/undo_manager.rb +2 -2
- data/lib/alexandria/version.rb +4 -4
- data/spec/alexandria/book_providers_spec.rb +7 -4
- data/spec/alexandria/library_spec.rb +13 -16
- data/spec/alexandria/scanners/cuecat_spec.rb +1 -2
- data/spec/alexandria/ui/dialogs_spec.rb +5 -1
- data/spec/alexandria/ui/main_app_spec.rb +3 -3
- data/{lib/alexandria/utils.rb → spec/alexandria/ui/sound_spec.rb} +6 -11
- data/spec/alexandria/ui/ui_utilities_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -2
- data/util/rake/fileinstall.rb +17 -33
- data/util/rake/gettextgenerate.rb +2 -4
- data/util/rake/omfgenerate.rb +1 -3
- metadata +23 -11
- data/lib/alexandria/ui/gtk_thread_help.rb +0 -89
@@ -1,89 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
#--
|
3
|
-
# Copyright (C) 2010 Cathal Mc Ginley
|
4
|
-
# Copyright (C) 2011 Matijs van Zuijlen
|
5
|
-
#
|
6
|
-
# This file is part of Alexandria, a GNOME book collection manager.
|
7
|
-
#
|
8
|
-
# Alexandria is free software; you can redistribute it and/or modify it
|
9
|
-
# under the terms of the GNU General Public License as published by
|
10
|
-
# the Free Software Foundation; either version 2 of the License, or
|
11
|
-
# (at your option) any later version.
|
12
|
-
#
|
13
|
-
# Alexandria is distributed in the hope that it will be useful, but
|
14
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16
|
-
# General Public License for more details.
|
17
|
-
#
|
18
|
-
# You should have received a copy of the GNU General Public License
|
19
|
-
# along with Alexandria; see the file COPYING. If not, write to the Free
|
20
|
-
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
21
|
-
# MA 02110-1301 USA.
|
22
|
-
#++
|
23
|
-
|
24
|
-
# Taken from a tip on the ruby-gnome2 website
|
25
|
-
# http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_threads
|
26
|
-
|
27
|
-
# First, force all your your Ruby threads to start from within the
|
28
|
-
# main loop using the standard Gtk.init method. You can call Gtk.init
|
29
|
-
# as many times as necessary. For example:
|
30
|
-
#
|
31
|
-
# Gtk.init_add do
|
32
|
-
# DBus.start_listener
|
33
|
-
# false
|
34
|
-
# end
|
35
|
-
|
36
|
-
require 'cairo'
|
37
|
-
require 'gtk2'
|
38
|
-
require 'monitor'
|
39
|
-
|
40
|
-
module Gtk
|
41
|
-
GTK_PENDING_BLOCKS = []
|
42
|
-
GTK_PENDING_BLOCKS_LOCK = Monitor.new
|
43
|
-
|
44
|
-
def self.queue(&block)
|
45
|
-
if Thread.current == Thread.main
|
46
|
-
block.call
|
47
|
-
else
|
48
|
-
GTK_PENDING_BLOCKS_LOCK.synchronize do
|
49
|
-
GTK_PENDING_BLOCKS << block
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
# an optional addition from http://www.ruby-forum.com/topic/125038
|
55
|
-
# "I call Gtk.thread_flush right after killing a thread when I ever
|
56
|
-
# happen to need kill a thread" -- Mathieu Blondel
|
57
|
-
|
58
|
-
# def self.thread_flush
|
59
|
-
# if PENDING_CALLS_MUTEX.try_lock
|
60
|
-
# for closure in PENDING_CALLS
|
61
|
-
# closure.call
|
62
|
-
# end
|
63
|
-
# PENDING_CALLS.clear
|
64
|
-
# PENDING_CALLS_MUTEX.unlock
|
65
|
-
# end
|
66
|
-
# end
|
67
|
-
|
68
|
-
def self.main_with_queue(timeout = 100) # millis
|
69
|
-
Gtk.timeout_add(timeout) do
|
70
|
-
GTK_PENDING_BLOCKS_LOCK.synchronize do
|
71
|
-
for block in GTK_PENDING_BLOCKS
|
72
|
-
block.call
|
73
|
-
end
|
74
|
-
GTK_PENDING_BLOCKS.clear
|
75
|
-
end
|
76
|
-
true
|
77
|
-
end
|
78
|
-
Gtk.main
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
# Usage is very simple:
|
83
|
-
|
84
|
-
# Start your Gtk application by calling Gtk.main_with_queue rather
|
85
|
-
# than Gtk.main. The "timeout" argument is in milliseconds, and it is
|
86
|
-
# the maximum time that can pass until queued blocks get called: 100
|
87
|
-
# should be fine.
|
88
|
-
|
89
|
-
# Whenever you need to queue a call, use Gtk.queue. For example:
|