Piggy 0.4.2.4 → 0.4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/CHANGES.txt +15 -0
  2. data/INSTALL.txt +9 -4
  3. data/README.txt +8 -6
  4. data/bin/directory_diff +1 -1
  5. data/bin/ftp_browser +1 -1
  6. data/bin/piggy +1 -1
  7. data/lib/directory_diff.rb +8 -6
  8. data/lib/ftp_browser.rb +8 -6
  9. data/lib/icons/connect.ico +0 -0
  10. data/lib/icons/hide_details.ico +0 -0
  11. data/lib/icons/show_details.ico +0 -0
  12. data/lib/piggy-core/alive_check.rb +4 -4
  13. data/lib/piggy-core/debug.rb +4 -4
  14. data/lib/piggy-core/environment.rb +24 -26
  15. data/lib/piggy-core/exifr_adapter.rb +11 -11
  16. data/lib/piggy-core/file_info.rb +61 -61
  17. data/lib/piggy-core/ftp_adapter.rb +24 -24
  18. data/lib/piggy-core/htmlgen.rb +41 -45
  19. data/lib/piggy-core/nconvert_thumbsgen.rb +22 -22
  20. data/lib/piggy-core/options.rb +25 -19
  21. data/lib/piggy-core/options_persistence.rb +8 -8
  22. data/lib/piggy-core/progress.rb +7 -7
  23. data/lib/piggy-core/rmagick_thumbnail_page_generator.rb +14 -14
  24. data/lib/piggy-core/thumbnail_generator.rb +26 -26
  25. data/lib/piggy-core/thumbnail_page_generator.rb +234 -230
  26. data/lib/piggy-core/upload_info.rb +22 -22
  27. data/lib/piggy-core/version.rb +7 -7
  28. data/lib/piggy-core/winshell.rb +136 -80
  29. data/lib/piggy-gui/dir_chooser.rb +14 -14
  30. data/lib/piggy-gui/directory_diff_widget.rb +177 -160
  31. data/lib/piggy-gui/filtered_file_list.rb +87 -87
  32. data/lib/piggy-gui/fox_thumbsgen.rb +4 -4
  33. data/lib/piggy-gui/ftp_browser_widget.rb +211 -155
  34. data/lib/piggy-gui/fullscreen.rb +4 -4
  35. data/lib/piggy-gui/html_generation_dialog.rb +42 -115
  36. data/lib/piggy-gui/html_options_widget.rb +97 -0
  37. data/lib/piggy-gui/image_processor.rb +58 -58
  38. data/lib/piggy-gui/modal_dialog.rb +11 -5
  39. data/lib/piggy-gui/multiimagecanvas.rb +59 -59
  40. data/lib/piggy-gui/options_dialog.rb +170 -48
  41. data/lib/piggy-gui/piggy_image_browser.rb +382 -340
  42. data/lib/piggy-gui/pipe_log.rb +17 -17
  43. data/lib/piggy-gui/progress_with_dialog.rb +8 -8
  44. data/lib/piggy-gui/require-fox.rb +23 -8
  45. data/lib/piggy.rb +7 -5
  46. data/lib/templates/styles/basic/style.css +16 -14
  47. data/lib/templates/styles/black/style.css +28 -29
  48. data/lib/templates/styles/roundedbox/style.css +28 -31
  49. data/lib/templates/styles/shadow/style.css +26 -26
  50. data/lib/templates/styles/shadow_D9F5F3/style.css +1 -1
  51. data/lib/templates/styles/shadow_black/lo.jpg +0 -0
  52. data/lib/templates/styles/shadow_black/lu.jpg +0 -0
  53. data/lib/templates/styles/shadow_black/ro.jpg +0 -0
  54. data/lib/templates/styles/shadow_black/ru.jpg +0 -0
  55. data/lib/templates/styles/shadow_black/style.css +78 -0
  56. data/lib/templates/styles/shadow_bowers/style.css +48 -51
  57. data/lib/templates/styles/sylvester/sh.png +0 -0
  58. data/lib/templates/styles/sylvester/style.css +74 -0
  59. data/lib/templates/styles/sylvester/wunderkerze.jpg +0 -0
  60. data/test/file_info_test.rb +29 -29
  61. 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
- initIcons
22
+ init_icons
23
23
  end
24
24
 
25
- def initIcons
26
- @checkedIcon = getIcon("checked.ico")
27
- @uncheckedIcon = getIcon("unchecked.ico")
25
+ def init_icons
26
+ @checkedIcon = get_icon("checked.ico")
27
+ @uncheckedIcon = get_icon("unchecked.ico")
28
28
  end
29
29
 
30
- def getIcon(filename)
31
- iconPath = File.join(PIGGY_PATH, 'icons', filename)
32
- @imageProcessor.loadIcon(iconPath)
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 getItemRubyFilename(index)
36
- fox2Ruby(getItemFilename(index))
35
+ def get_item_ruby_filename(index)
36
+ fox_2_ruby(getItemFilename(index))
37
37
  end
38
38
 
39
- def getItemRubyPathname(index)
40
- fox2Ruby(getItemPathname(index))
39
+ def get_item_ruby_pathname(index)
40
+ fox_2_ruby(getItemPathname(index))
41
41
  end
42
42
 
43
- def replaceFileIcon(index, rubyfile, modus)
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 = ruby2Fox(rubyfile)
49
+ file = ruby_2_fox(rubyfile)
50
50
  replaceItem(index, file, icon, icon)
51
51
  end
52
52
  end
53
53
 
54
- def chooseAllInFilelist
55
- (0..getNumItems-1).each do
54
+ def choose_all_in_filelist
55
+ (0..getNumItems-1).each do
56
56
  |i|
57
- if(isItemFile(i) && supports(getItemRubyFilename(i)))
58
- shortName = getItemRubyFilename(i)
59
- longName = getItemRubyPathname(i)
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
- replaceFileIcon(i, shortName, 'add')
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 getSelectedImageFiles(fullPath = false, modus = nil)
71
- selectedInd = (0..getNumItems-1).select do
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
- isItemFile(i) and
75
- supports(getItemRubyFilename(i))
74
+ isItemFile(i) and
75
+ supports(get_item_ruby_filename(i))
76
76
  end
77
- selectedFiles = selectedInd.collect do
77
+ selected_files = selected_ind.collect do
78
78
  |i|
79
- shortName = getItemRubyFilename(i)
80
- longName = getItemRubyPathname(i)
81
- replaceFileIcon(i, shortName, modus)
82
- fullPath ? longName : shortName
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 selectedFiles
84
+ return selected_files
85
85
  end
86
86
 
87
- def addSelectedFiles
88
- getSelectedImageFiles(true, 'add').each { |file|
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 removeSelectedFiles
94
- getSelectedImageFiles(true, 'remove').each { |file|
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 updateFileList
99
+ def update_file_list
100
100
  scan(true)
101
- (0..getNumItems-1).each do
101
+ (0..getNumItems-1).each do
102
102
  |i|
103
103
  if(isItemFile(i))
104
- shortName = getItemRubyFilename(i)
104
+ shortName = get_item_ruby_filename(i)
105
105
  if(supports(shortName))
106
- longName = getItemRubyPathname(i)
106
+ longName = get_item_ruby_pathname(i)
107
107
  if(@chosenFiles.include?(longName))
108
- replaceFileIcon(i, shortName, 'add')
108
+ replace_file_icon(i, shortName, 'add')
109
109
  else
110
- replaceFileIcon(i, shortName, 'remove')
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 addIndex(i)
118
- longName = getItemRubyPathname(i)
119
- shortName = getItemRubyFilename(i)
120
- @chosenFiles.add(longName)
121
- replaceFileIcon(i, shortName, 'add')
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 removeIndex(i)
125
- longName = getItemRubyPathname(i)
126
- shortName = getItemRubyFilename(i)
127
- @chosenFiles.delete(longName)
128
- replaceFileIcon(i, shortName, 'remove')
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 chooseSavedInstead(original, saved)
132
- originalIndex = getIndex(original)
133
- savedIndex = getIndex(saved)
134
- removeIndex(originalIndex) unless originalIndex < 0
135
- unless savedIndex < 0
136
- addIndex(savedIndex)
137
- selectIndex(savedIndex)
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 getIndex(path)
142
- rubyPath = rubyPath(path)
143
- (0..getNumItems-1).each do
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 = getItemRubyPathname(i)
147
- if(rubyPath(longName) == rubyPath)
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 rubyPath(path)
156
- @shell.rubyPath(path)
155
+ def ruby_path(path)
156
+ @shell.ruby_path(path)
157
157
  end
158
158
 
159
- def assumeSelected(path)
160
- index = getIndex(path)
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 chosenSequence
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 goToDirectory(dirname)
174
- self.directory = ruby2Fox(rubyPath(dirname))
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 getCurrentDirectory
179
- fox2Ruby(self.directory)
178
+ def get_current_directory
179
+ fox_2_ruby(self.directory)
180
180
  end
181
181
 
182
182
  # Return index or -1
183
- def selectNextChosen
183
+ def select_next_chosen
184
184
  block = proc { |i|
185
185
  if(isItemFile(i) &&
186
- @chosenFiles.include?(getItemRubyPathname(i)))
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
- startingPoint = lastSelectedIndex + 1
194
- (startingPoint..getNumItems-1).each(&block)
195
- (0..startingPoint-1).each(&block)
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 selectPreviousChosen
199
+ def select_previous_chosen
200
200
  max = getNumItems - 1
201
- startingPoint = firstSelectedIndex
202
- startingPoint = max+1 if(startingPoint < 0 || startingPoint > max)
203
- (0..max).each do
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 + startingPoint) % (max + 1)
205
+ i = (max - index + starting_point) % (max + 1)
206
206
  if(isItemFile(i) &&
207
- @chosenFiles.include?(getItemRubyPathname(i)))
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 firstSelectedIndex
217
+ def first_selected_index
218
218
  max = getNumItems-1
219
- (0..max).each do
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 lastSelectedIndex
226
+ def last_selected_index
227
227
  max = getNumItems-1
228
- (0..max).each do
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 anyFilesChosen?
236
+ def any_files_chosen?
237
237
  return !@chosenFiles.empty?
238
238
  end
239
239
 
240
- def numFilesChosen
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 imageProcessing(progress)
13
- imageProcessor = ImageProcessor.new(client.getApp)
14
- @imageGenerator = ThumbnailGenerator.new(imageProcessor, @options)
15
- @imageGenerator.setOutputDirectory(imageOutputPath)
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