Piggy 0.4.2.4 → 0.4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES.txt +15 -0
- data/INSTALL.txt +9 -4
- data/README.txt +8 -6
- data/bin/directory_diff +1 -1
- data/bin/ftp_browser +1 -1
- data/bin/piggy +1 -1
- data/lib/directory_diff.rb +8 -6
- data/lib/ftp_browser.rb +8 -6
- data/lib/icons/connect.ico +0 -0
- data/lib/icons/hide_details.ico +0 -0
- data/lib/icons/show_details.ico +0 -0
- data/lib/piggy-core/alive_check.rb +4 -4
- data/lib/piggy-core/debug.rb +4 -4
- data/lib/piggy-core/environment.rb +24 -26
- data/lib/piggy-core/exifr_adapter.rb +11 -11
- data/lib/piggy-core/file_info.rb +61 -61
- data/lib/piggy-core/ftp_adapter.rb +24 -24
- data/lib/piggy-core/htmlgen.rb +41 -45
- data/lib/piggy-core/nconvert_thumbsgen.rb +22 -22
- data/lib/piggy-core/options.rb +25 -19
- data/lib/piggy-core/options_persistence.rb +8 -8
- data/lib/piggy-core/progress.rb +7 -7
- data/lib/piggy-core/rmagick_thumbnail_page_generator.rb +14 -14
- data/lib/piggy-core/thumbnail_generator.rb +26 -26
- data/lib/piggy-core/thumbnail_page_generator.rb +234 -230
- data/lib/piggy-core/upload_info.rb +22 -22
- data/lib/piggy-core/version.rb +7 -7
- data/lib/piggy-core/winshell.rb +136 -80
- data/lib/piggy-gui/dir_chooser.rb +14 -14
- data/lib/piggy-gui/directory_diff_widget.rb +177 -160
- data/lib/piggy-gui/filtered_file_list.rb +87 -87
- data/lib/piggy-gui/fox_thumbsgen.rb +4 -4
- data/lib/piggy-gui/ftp_browser_widget.rb +211 -155
- data/lib/piggy-gui/fullscreen.rb +4 -4
- data/lib/piggy-gui/html_generation_dialog.rb +42 -115
- data/lib/piggy-gui/html_options_widget.rb +97 -0
- data/lib/piggy-gui/image_processor.rb +58 -58
- data/lib/piggy-gui/modal_dialog.rb +11 -5
- data/lib/piggy-gui/multiimagecanvas.rb +59 -59
- data/lib/piggy-gui/options_dialog.rb +170 -48
- data/lib/piggy-gui/piggy_image_browser.rb +382 -340
- data/lib/piggy-gui/pipe_log.rb +17 -17
- data/lib/piggy-gui/progress_with_dialog.rb +8 -8
- data/lib/piggy-gui/require-fox.rb +23 -8
- data/lib/piggy.rb +7 -5
- data/lib/templates/styles/basic/style.css +16 -14
- data/lib/templates/styles/black/style.css +28 -29
- data/lib/templates/styles/roundedbox/style.css +28 -31
- data/lib/templates/styles/shadow/style.css +26 -26
- data/lib/templates/styles/shadow_D9F5F3/style.css +1 -1
- data/lib/templates/styles/shadow_black/lo.jpg +0 -0
- data/lib/templates/styles/shadow_black/lu.jpg +0 -0
- data/lib/templates/styles/shadow_black/ro.jpg +0 -0
- data/lib/templates/styles/shadow_black/ru.jpg +0 -0
- data/lib/templates/styles/shadow_black/style.css +78 -0
- data/lib/templates/styles/shadow_bowers/style.css +48 -51
- data/lib/templates/styles/sylvester/sh.png +0 -0
- data/lib/templates/styles/sylvester/style.css +74 -0
- data/lib/templates/styles/sylvester/wunderkerze.jpg +0 -0
- data/test/file_info_test.rb +29 -29
- metadata +52 -38
@@ -19,46 +19,46 @@ class FilteredFileList < Fox::FXFileList
|
|
19
19
|
@chosenFiles = Set.new
|
20
20
|
@choosable = proc { |file| true }
|
21
21
|
@shell = WinShell.instance
|
22
|
-
|
22
|
+
init_icons
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
@checkedIcon =
|
27
|
-
@uncheckedIcon =
|
25
|
+
def init_icons
|
26
|
+
@checkedIcon = get_icon("checked.ico")
|
27
|
+
@uncheckedIcon = get_icon("unchecked.ico")
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
31
|
-
|
32
|
-
@imageProcessor.
|
30
|
+
def get_icon(filename)
|
31
|
+
icon_path = File.join(PIGGY_PATH, 'icons', filename)
|
32
|
+
@imageProcessor.load_icon(icon_path)
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
36
|
-
|
35
|
+
def get_item_ruby_filename(index)
|
36
|
+
fox_2_ruby(getItemFilename(index))
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
|
39
|
+
def get_item_ruby_pathname(index)
|
40
|
+
fox_2_ruby(getItemPathname(index))
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
43
|
+
def replace_file_icon(index, rubyfile, modus)
|
44
44
|
return nil if modus == nil
|
45
45
|
icon = (modus == 'add' ? @checkedIcon : @uncheckedIcon)
|
46
46
|
if FOXVERSION_GE_1_2
|
47
47
|
setItemMiniIcon(index, icon)
|
48
48
|
else
|
49
|
-
file =
|
49
|
+
file = ruby_2_fox(rubyfile)
|
50
50
|
replaceItem(index, file, icon, icon)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
55
|
-
|
54
|
+
def choose_all_in_filelist
|
55
|
+
(0..getNumItems-1).each do
|
56
56
|
|i|
|
57
|
-
if(isItemFile(i) && supports(
|
58
|
-
shortName =
|
59
|
-
longName =
|
57
|
+
if(isItemFile(i) && supports(get_item_ruby_filename(i)))
|
58
|
+
shortName = get_item_ruby_filename(i)
|
59
|
+
longName = get_item_ruby_pathname(i)
|
60
60
|
@chosenFiles.add(longName)
|
61
|
-
|
61
|
+
replace_file_icon(i, shortName, 'add')
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -67,84 +67,84 @@ class FilteredFileList < Fox::FXFileList
|
|
67
67
|
return @choosable.call(filename)
|
68
68
|
end
|
69
69
|
|
70
|
-
def
|
71
|
-
|
70
|
+
def get_selected_image_files(full_path = false, modus = nil)
|
71
|
+
selected_ind = (0..getNumItems-1).select do
|
72
72
|
|i|
|
73
73
|
isItemSelected(i) and
|
74
|
-
|
75
|
-
|
74
|
+
isItemFile(i) and
|
75
|
+
supports(get_item_ruby_filename(i))
|
76
76
|
end
|
77
|
-
|
77
|
+
selected_files = selected_ind.collect do
|
78
78
|
|i|
|
79
|
-
shortName =
|
80
|
-
longName =
|
81
|
-
|
82
|
-
|
79
|
+
shortName = get_item_ruby_filename(i)
|
80
|
+
longName = get_item_ruby_pathname(i)
|
81
|
+
replace_file_icon(i, shortName, modus)
|
82
|
+
full_path ? longName : shortName
|
83
83
|
end
|
84
|
-
return
|
84
|
+
return selected_files
|
85
85
|
end
|
86
86
|
|
87
|
-
def
|
88
|
-
|
87
|
+
def add_selected_files
|
88
|
+
get_selected_image_files(true, 'add').each { |file|
|
89
89
|
@chosenFiles.add(file)
|
90
90
|
}
|
91
91
|
end
|
92
92
|
|
93
|
-
def
|
94
|
-
|
93
|
+
def remove_selected_files
|
94
|
+
get_selected_image_files(true, 'remove').each { |file|
|
95
95
|
@chosenFiles.delete(file)
|
96
96
|
}
|
97
97
|
end
|
98
98
|
|
99
|
-
def
|
99
|
+
def update_file_list
|
100
100
|
scan(true)
|
101
|
-
|
101
|
+
(0..getNumItems-1).each do
|
102
102
|
|i|
|
103
103
|
if(isItemFile(i))
|
104
|
-
shortName =
|
104
|
+
shortName = get_item_ruby_filename(i)
|
105
105
|
if(supports(shortName))
|
106
|
-
longName =
|
106
|
+
longName = get_item_ruby_pathname(i)
|
107
107
|
if(@chosenFiles.include?(longName))
|
108
|
-
|
108
|
+
replace_file_icon(i, shortName, 'add')
|
109
109
|
else
|
110
|
-
|
110
|
+
replace_file_icon(i, shortName, 'remove')
|
111
111
|
end
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
117
|
-
def
|
118
|
-
|
119
|
-
|
120
|
-
@chosenFiles.add(
|
121
|
-
|
117
|
+
def add_index(i)
|
118
|
+
long_name = get_item_ruby_pathname(i)
|
119
|
+
short_name = get_item_ruby_filename(i)
|
120
|
+
@chosenFiles.add(long_name)
|
121
|
+
replace_file_icon(i, short_name, 'add')
|
122
122
|
end
|
123
123
|
|
124
|
-
def
|
125
|
-
|
126
|
-
|
127
|
-
@chosenFiles.delete(
|
128
|
-
|
124
|
+
def remove_index(i)
|
125
|
+
long_name = get_item_ruby_pathname(i)
|
126
|
+
short_name = get_item_ruby_filename(i)
|
127
|
+
@chosenFiles.delete(long_name)
|
128
|
+
replace_file_icon(i, short_name, 'remove')
|
129
129
|
end
|
130
130
|
|
131
|
-
def
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
unless
|
136
|
-
|
137
|
-
|
131
|
+
def choose_saved_instead(original, saved)
|
132
|
+
original_index = get_index(original)
|
133
|
+
saved_index = get_index(saved)
|
134
|
+
remove_index(original_index) unless original_index < 0
|
135
|
+
unless saved_index < 0
|
136
|
+
add_index(saved_index)
|
137
|
+
select_index(saved_index)
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
141
|
-
def
|
142
|
-
|
143
|
-
|
141
|
+
def get_index(path)
|
142
|
+
ruby_path = ruby_path(path)
|
143
|
+
(0..getNumItems-1).each do
|
144
144
|
|i|
|
145
145
|
if(isItemFile(i))
|
146
|
-
longName =
|
147
|
-
if(
|
146
|
+
longName = get_item_ruby_pathname(i)
|
147
|
+
if(ruby_path(longName) == ruby_path)
|
148
148
|
return i
|
149
149
|
end
|
150
150
|
end
|
@@ -152,59 +152,59 @@ class FilteredFileList < Fox::FXFileList
|
|
152
152
|
return -1
|
153
153
|
end
|
154
154
|
|
155
|
-
def
|
156
|
-
@shell.
|
155
|
+
def ruby_path(path)
|
156
|
+
@shell.ruby_path(path)
|
157
157
|
end
|
158
158
|
|
159
|
-
def
|
160
|
-
index =
|
159
|
+
def assume_selected(path)
|
160
|
+
index = get_index(path)
|
161
161
|
unless index < 0 || itemSelected?(index)
|
162
162
|
killSelection()
|
163
163
|
selectItem(index)
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
167
|
-
def
|
167
|
+
def chosen_sequence
|
168
168
|
seq = Array.new
|
169
169
|
@chosenFiles.each { |file| seq.push(file) }
|
170
170
|
seq.sort! { |x, y| x <=> y }
|
171
171
|
end
|
172
172
|
|
173
|
-
def
|
174
|
-
self.directory =
|
173
|
+
def go_to_directory(dirname)
|
174
|
+
self.directory = ruby_2_fox(ruby_path(dirname))
|
175
175
|
@chosenFiles = Set.new
|
176
176
|
end
|
177
177
|
|
178
|
-
def
|
179
|
-
|
178
|
+
def get_current_directory
|
179
|
+
fox_2_ruby(self.directory)
|
180
180
|
end
|
181
181
|
|
182
182
|
# Return index or -1
|
183
|
-
def
|
183
|
+
def select_next_chosen
|
184
184
|
block = proc { |i|
|
185
185
|
if(isItemFile(i) &&
|
186
|
-
|
186
|
+
@chosenFiles.include?(get_item_ruby_pathname(i)))
|
187
187
|
killSelection
|
188
188
|
makeItemVisible(i)
|
189
189
|
selectItem(i)
|
190
190
|
return i
|
191
191
|
end
|
192
192
|
}
|
193
|
-
|
194
|
-
|
195
|
-
|
193
|
+
starting_point = last_selected_index + 1
|
194
|
+
(starting_point..getNumItems-1).each(&block)
|
195
|
+
(0..starting_point-1).each(&block)
|
196
196
|
return -1
|
197
197
|
end
|
198
198
|
|
199
|
-
def
|
199
|
+
def select_previous_chosen
|
200
200
|
max = getNumItems - 1
|
201
|
-
|
202
|
-
|
203
|
-
|
201
|
+
starting_point = first_selected_index
|
202
|
+
starting_point = max+1 if(starting_point < 0 || starting_point > max)
|
203
|
+
(0..max).each do
|
204
204
|
|index|
|
205
|
-
i = (max - index +
|
205
|
+
i = (max - index + starting_point) % (max + 1)
|
206
206
|
if(isItemFile(i) &&
|
207
|
-
|
207
|
+
@chosenFiles.include?(get_item_ruby_pathname(i)))
|
208
208
|
killSelection
|
209
209
|
makeItemVisible(i)
|
210
210
|
selectItem(i)
|
@@ -214,18 +214,18 @@ class FilteredFileList < Fox::FXFileList
|
|
214
214
|
return -1
|
215
215
|
end
|
216
216
|
|
217
|
-
def
|
217
|
+
def first_selected_index
|
218
218
|
max = getNumItems-1
|
219
|
-
|
219
|
+
(0..max).each do
|
220
220
|
|i|
|
221
221
|
return i if(isItemSelected(i))
|
222
222
|
end
|
223
223
|
-1
|
224
224
|
end
|
225
225
|
|
226
|
-
def
|
226
|
+
def last_selected_index
|
227
227
|
max = getNumItems-1
|
228
|
-
|
228
|
+
(0..max).each do
|
229
229
|
|i|
|
230
230
|
r = max - i
|
231
231
|
return r if(isItemSelected(r))
|
@@ -233,11 +233,11 @@ class FilteredFileList < Fox::FXFileList
|
|
233
233
|
-1
|
234
234
|
end
|
235
235
|
|
236
|
-
def
|
236
|
+
def any_files_chosen?
|
237
237
|
return !@chosenFiles.empty?
|
238
238
|
end
|
239
239
|
|
240
|
-
def
|
240
|
+
def num_files_chosen
|
241
241
|
return @chosenFiles.size
|
242
242
|
end
|
243
243
|
end
|
@@ -9,10 +9,10 @@ class FoxThumbnailPageGenerator < ThumbnailPageGenerator
|
|
9
9
|
|
10
10
|
protected
|
11
11
|
|
12
|
-
def
|
13
|
-
|
14
|
-
@imageGenerator = ThumbnailGenerator.new(
|
15
|
-
@imageGenerator.
|
12
|
+
def image_processing(progress)
|
13
|
+
image_processor = ImageProcessor.new(client.getApp)
|
14
|
+
@imageGenerator = ThumbnailGenerator.new(image_processor, @options)
|
15
|
+
@imageGenerator.set_output_directory(imageOutputPath)
|
16
16
|
@imageGenerator.generate(@inputFilenames, progress)
|
17
17
|
end
|
18
18
|
end
|