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
@@ -4,6 +4,7 @@
4
4
  require 'piggy-core/environment'
5
5
  require 'piggy-core/options'
6
6
  require 'piggy-core/file_info'
7
+ require 'piggy-core/winshell'
7
8
  require 'piggy-gui/require-fox'
8
9
  require 'piggy-gui/image_processor'
9
10
 
@@ -11,30 +12,30 @@ require 'piggy-gui/image_processor'
11
12
  class DirectoryDiffMainWindow < Fox::FXMainWindow
12
13
  include Fox
13
14
  def initialize(app, options = PiggyOptions.new)
14
- super(app, titleString, nil, nil, DECOR_ALL,
15
- 0, 0, 200, 700, 0, 0)
15
+ super(app, title_string, nil, nil, DECOR_ALL,
16
+ 0, 0, 200, 700, 0, 0)
16
17
  @frame = FXVerticalFrame.new(self)
17
18
  @frame.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_Y)
18
- setMainWidget(options)
19
- @browser.quitButton.connect(SEL_COMMAND, method(:onTerminate))
19
+ set_main_widget(options)
20
+ @browser.quitButton.connect(SEL_COMMAND, method(:on_terminate))
20
21
  end
21
22
 
22
- def titleString
23
+ def title_string
23
24
  "Piggy Directory Diff"
24
25
  end
25
26
 
26
- def setMainWidget(options)
27
+ def set_main_widget(options)
27
28
  @browser = DirectoryDiffWidget.new(@frame, options)
28
29
  end
29
30
 
30
31
  def create
31
- resize(800, 600)
32
+ resize(@browser.preferred_width + 20, 600)
32
33
  place(PIGGY_WINDOW_PLACEMENT)
33
34
  super
34
35
  end
35
36
 
36
- def onTerminate(sender, sel, ptr)
37
- @browser.prepareClosure
37
+ def on_terminate(sender, sel, ptr)
38
+ @browser.prepare_closure
38
39
  getApp.exit(0)
39
40
  end
40
41
  end
@@ -50,48 +51,50 @@ class DirectoryDiffWidget < Fox::FXScrollWindow
50
51
  super(window)
51
52
  @options = options
52
53
  @iconLoader = ImageProcessor.new(getApp)
53
- loadIcons
54
- initializeFrames
55
- initializeControls
56
- initializeLayout
57
- setDefaults
58
- connectEvents
59
- @rightContents = DirectoryContents.new(rightPath)
60
- @leftContents = DirectoryContents.new(leftPath)
61
- @excludeFilters = ['~$', '#$', '^\.']
54
+ load_icons
55
+ initialize_frames
56
+ initialize_controls
57
+ initialize_layout
58
+ set_defaults
59
+ connect_events
60
+ @rightContents = DirectoryContents.new(right_path)
61
+ @leftContents = DirectoryContents.new(left_path)
62
+ @excludeFilters = @options.excludeFilters
62
63
  end
63
64
 
64
- def loadIcons
65
- @dirIcon = basicLoadIcon('dir.ico')
66
- @fileIcon = basicLoadIcon('file.ico')
67
- @dirupIcon = basicLoadIcon('dirup.ico')
68
- @fileAbsentIcon = basicLoadIcon('unchecked.ico')
69
- @dirAbsentIcon = basicLoadIcon('unchecked-dir.ico')
70
- @newerFileIcon = basicLoadIcon('newer-file.ico')
65
+ def load_icons
66
+ @dirIcon = basic_load_icon('dir.ico')
67
+ @fileIcon = basic_load_icon('file.ico')
68
+ @dirupIcon = basic_load_icon('dirup.ico')
69
+ @fileAbsentIcon = basic_load_icon('unchecked.ico')
70
+ @dirAbsentIcon = basic_load_icon('unchecked-dir.ico')
71
+ @newerFileIcon = basic_load_icon('newer-file.ico')
71
72
  end
72
73
 
73
- def basicLoadIcon(filename)
74
- fileWithPath = File.join(PIGGY_PATH, 'icons', filename)
75
- @iconLoader.loadIcon(fileWithPath)
74
+ def basic_load_icon(filename)
75
+ file_with_path = File.join(PIGGY_PATH, 'icons', filename)
76
+ @iconLoader.load_icon(file_with_path)
76
77
  end
77
78
 
78
- def spaceInto(frame)
79
+ def space_into(frame)
79
80
  space = FXHorizontalFrame.new(frame)
80
81
  space.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_Y)
81
82
  end
82
83
 
83
- def hSepInto(frame)
84
+ def h_sep_into(frame)
84
85
  sep = FXHorizontalSeparator.new(frame, SEPARATOR_GROOVE)
85
86
  sep.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_Y)
86
87
  end
87
88
 
88
- def initializeFrames
89
+ def initialize_frames
89
90
  @frame = FXVerticalFrame.new(self)
90
- @fourSplitter = FX4Splitter.new(@frame, FOURSPLITTER_TRACKING)
91
- @splitOL = FXVerticalFrame.new(@fourSplitter)
92
- @splitOR = FXVerticalFrame.new(@fourSplitter)
93
- @splitUL = FXVerticalFrame.new(@fourSplitter)
94
- @splitUR = FXVerticalFrame.new(@fourSplitter)
91
+ @horizontal_splitter = FXSplitter.new(@frame, SPLITTER_HORIZONTAL)
92
+ @left_frame = FXVerticalFrame.new(@horizontal_splitter)
93
+ @right_frame = FXVerticalFrame.new(@horizontal_splitter)
94
+ @splitOL = FXVerticalFrame.new(@left_frame)
95
+ @splitOR = FXVerticalFrame.new(@right_frame)
96
+ @splitUL = FXVerticalFrame.new(@left_frame)
97
+ @splitUR = FXVerticalFrame.new(@right_frame)
95
98
  @leftListPropFrame = FXMatrix.new(@splitOL, 2, MATRIX_BY_COLUMNS|LAYOUT_FILL_X)
96
99
  @rightListPropFrame = FXMatrix.new(@splitOR, 2, MATRIX_BY_COLUMNS|LAYOUT_FILL_X)
97
100
  @leftButtonsFrame = FXHorizontalFrame.new(@splitUL)
@@ -102,76 +105,80 @@ class DirectoryDiffWidget < Fox::FXScrollWindow
102
105
  @buttonsFrame = FXHorizontalFrame.new(@frame)
103
106
  end
104
107
 
105
- def initializeControls
108
+ def initialize_controls
106
109
  @labels = Array.new
107
- initializeControlsOL
108
- initializeControlsOR
109
- initializeControlsUL
110
- initializeControlsUR
111
- initializeButtons
110
+ initialize_controls_top_left
111
+ initialize_controls_top_right
112
+ initialize_controls_bottom_left
113
+ initialize_controls_bottom_right
114
+ initialize_buttons
112
115
  end
113
-
114
- def initializeControlsOL
116
+
117
+ def txt_field_num_chars
118
+ 32
119
+ end
120
+
121
+ def initialize_controls_top_left
115
122
  @labels.push(FXLabel.new(@leftListPropFrame, "Dir:"))
116
- combo = FXHorizontalFrame.new(@leftListPropFrame)
123
+ combo = new_hframe_without_padding(@leftListPropFrame)
117
124
  combo.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
118
- @leftPathField = FXTextField.new(combo, 32)
125
+ @leftPathField = FXTextField.new(combo, txt_field_num_chars)
119
126
  @leftPathField.setLayoutHints(LAYOUT_FILL_X)
120
- dirChooserForField(@leftPathField, 'left')
127
+ dir_chooser_for_field(@leftPathField, 'left')
121
128
  end
122
129
 
123
- def initializeControlsOR
130
+ def initialize_controls_top_right
124
131
  @labels.push(FXLabel.new(@rightListPropFrame, "Dir:"))
125
- combo = FXHorizontalFrame.new(@rightListPropFrame)
126
- combo.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
127
- @rightPathField = FXTextField.new(combo, 32)
132
+ combo = new_hframe_without_padding(@rightListPropFrame)
133
+ combo.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
134
+ @rightPathField = FXTextField.new(combo, txt_field_num_chars)
128
135
  @rightPathField.setLayoutHints(LAYOUT_FILL_X)
129
- dirChooserForField(@rightPathField, 'right')
136
+ dir_chooser_for_field(@rightPathField, 'right')
130
137
  end
131
138
 
132
- def dirChooserForField(field, side)
133
- chooserButton = FXButton.new(field.parent, '...')
134
- chooserButton.connect(SEL_COMMAND) {
139
+ def dir_chooser_for_field(field, side)
140
+ chooser_button = FXButton.new(field.parent, '...')
141
+ chooser_button.connect(SEL_COMMAND) {
135
142
  dialog = FXDirDialog.new(self, "Choose directory")
136
143
  dialog.directory = field.getText
137
144
  unless dialog.execute == 0
138
- field.setText(dialog.directory)
139
- dirChanged(side)
145
+ field.setText(dialog.directory)
146
+ dir_changed(side)
140
147
  end
141
148
  }
142
149
  end
143
150
 
144
- def initializeControlsUL
151
+ def initialize_controls_bottom_left
145
152
  @dirLeftUpButton = FXButton.new(@leftButtonsFrame,
146
- "\tGo up to higher directory",
147
- @dirupIcon)
153
+ "\tGo up to higher directory",
154
+ @dirupIcon)
148
155
  @leftFileList = FXIconList.new(@leftListFrame)
149
156
  @leftFileList.setListStyle(ICONLIST_DETAILED)
150
157
  @leftFileList.appendHeader("Name", nil, 200)
151
158
  @leftFileList.appendHeader("Date", nil, 200)
152
159
  end
153
160
 
154
- def initializeControlsUR
161
+ def initialize_controls_bottom_right
155
162
  @dirRightUpButton = FXButton.new(@rightButtonsFrame,
156
- "\tGo up to higher directory",
157
- @dirupIcon)
163
+ "\tGo up to higher directory",
164
+ @dirupIcon)
158
165
  @rightFileList = FXIconList.new(@rightListFrame)
159
166
  @rightFileList.setListStyle(ICONLIST_DETAILED)
160
167
  @rightFileList.appendHeader("Name", nil, 200)
161
168
  @rightFileList.appendHeader("Date", nil, 200)
162
169
  end
163
170
 
164
- def initializeButtons
171
+ def initialize_buttons
165
172
  @quitButton = FXButton.new(@buttonsFrame, "&Quit")
166
173
  end
167
174
 
168
- def initializeLayout
175
+ def initialize_layout
169
176
  @labels.each { |label| label.setLayoutHints LAYOUT_CENTER_Y }
170
177
  [
171
178
  self, @frame,
172
- @fourSplitter,
179
+ @horizontal_splitter, @left_frame, @right_frame,
173
180
  # @leftListPropFrame, @rightListPropFrame,
174
- # @splitUL, @splitUR,
181
+ @splitUL, @splitUR,
175
182
  # @leftButtonsFrame, @rightButtonsFrame,
176
183
  @leftListFrame, @rightListFrame,
177
184
  # @serverField, @userField, @passwordField, @leftPathField,
@@ -179,6 +186,7 @@ class DirectoryDiffWidget < Fox::FXScrollWindow
179
186
  @leftFileList, @rightFileList
180
187
  ].each { |w| w.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_Y) }
181
188
  [
189
+ @left_frame, @right_frame,
182
190
  @splitOL, @splitOR, @splitUL, @splitUR,
183
191
  @leftButtonsFrame, @rightButtonsFrame,
184
192
  @leftListFrame, @rightListFrame
@@ -188,95 +196,100 @@ class DirectoryDiffWidget < Fox::FXScrollWindow
188
196
  @quitButton.setLayoutHints(LAYOUT_RIGHT)
189
197
  end
190
198
 
191
- def dirChanged(side)
199
+ def dir_changed(side)
192
200
  if(side == 'right')
193
- setRightPath(@rightPathField.getText)
194
- updateRightList
195
- updateStatusIcons
201
+ set_right_path(@rightPathField.getText)
202
+ update_right_list
203
+ update_status_icons
196
204
  else
197
- setLeftPath(@leftPathField.getText)
198
- updateLeftList
199
- updateStatusIcons
205
+ set_left_path(@leftPathField.getText)
206
+ update_left_list
207
+ update_status_icons
200
208
  end
201
209
  end
202
210
 
203
- def connectEvents
211
+ def connect_events
204
212
  @rightPathField.connect(SEL_COMMAND) {
205
- dirChanged('right')
213
+ dir_changed('right')
206
214
  }
207
215
  @leftPathField.connect(SEL_COMMAND) {
208
- dirChanged('left')
216
+ dir_changed('left')
209
217
  }
210
- @dirLeftUpButton.connect(SEL_COMMAND, method(:onDirUpLeftList))
211
- @dirRightUpButton.connect(SEL_COMMAND, method(:onDirUpRightList))
218
+ @dirLeftUpButton.connect(SEL_COMMAND, method(:on_dir_up_lef_list))
219
+ @dirRightUpButton.connect(SEL_COMMAND, method(:on_dir_up_right_list))
212
220
 
213
221
  @leftFileList.connect(SEL_DOUBLECLICKED,
214
- method(:onDoubleclickLeftFileList))
222
+ method(:on_doubleclick_left_file_list))
215
223
  @rightFileList.connect(SEL_DOUBLECLICKED,
216
- method(:onDoubleclickRightFileList))
224
+ method(:on_doubleclick_right_file_list))
217
225
  @leftFileList.connect(SEL_RIGHTBUTTONRELEASE,
218
- method(:onMenuLeftList))
226
+ method(:on_menu_left_list))
219
227
  @rightFileList.connect(SEL_RIGHTBUTTONRELEASE,
220
- method(:onMenuRightList))
228
+ method(:on_menu_right_list))
221
229
  end
222
-
223
- def setDefaults
230
+
231
+ def fox_pah(ruby_path)
232
+ ruby_2_fox(WinShell.instance.os_path(ruby_path))
233
+ end
234
+
235
+ def set_defaults
236
+ p = fox_pah(@options.localDestinationPath)
224
237
  @rightPathField.setText(@options.localDestinationPath)
225
238
  @leftPathField.setText(@options.localDestinationPath)
226
239
  end
227
240
 
228
241
  # accessing
229
242
 
230
- def rightPath
243
+ def right_path
231
244
  @options.localDestinationPath
232
245
  end
233
246
 
234
- def setRightPath(p)
235
- @options.localDestinationPath = FilePath.internPath(p)
247
+ def set_right_path(p)
248
+ @options.localDestinationPath = FilePath.intern_path(p)
236
249
  @rightPathField.setText(p) # fixme winpath
237
250
  end
238
251
 
239
- def leftPath
240
- FilePath.internPath(@leftPathField.getText)
252
+ def left_path
253
+ FilePath.intern_path(@leftPathField.getText)
241
254
  end
242
255
 
243
- def setLeftPath(p)
256
+ def set_left_path(p)
244
257
  @leftPathField.setText(p) # fixme winpath
245
258
  end
246
259
 
247
- def selectionInList(list)
248
- selectedInd = (0..list.getNumItems-1).select { |i|
260
+ def selection_in_list(list)
261
+ selected_ind = (0..list.getNumItems-1).select { |i|
249
262
  list.isItemSelected(i)
250
263
  }
251
- return selectedInd.collect { |i| itemFilename(list, i) }
264
+ return selected_ind.collect { |i| item_filename(list, i) }
252
265
  end
253
266
 
254
- def itemFilename(list, index)
255
- txt = fox2Ruby(list.getItemText(index))
267
+ def item_filename(list, index)
268
+ txt = fox_2_ruby(list.getItemText(index))
256
269
  return txt.split(Regexp.compile("\t"))[0]
257
270
  end
258
271
 
259
272
  # update
260
273
 
261
- def updateLeftList
262
- @leftContents = updateLocalList(@leftFileList, leftPath)
274
+ def update_left_list
275
+ @leftContents = update_local_list(@leftFileList, left_path)
263
276
  end
264
277
 
265
- def updateRightList
266
- @rightContents = updateLocalList(@rightFileList, rightPath)
278
+ def update_right_list
279
+ @rightContents = update_local_list(@rightFileList, right_path)
267
280
  end
268
281
 
269
- def updateLocalList(listWidget, newPath)
282
+ def update_local_list(listWidget, newPath)
270
283
  listWidget.clearItems
271
284
  contents = DirectoryContents.new(newPath)
272
285
  return contents unless newPath && File.directory?(newPath)
273
286
  getApp.beginWaitCursor
274
287
  begin
275
- updateList(Dir.entries(newPath), listWidget, contents) do
288
+ update_list(Dir.entries(newPath), listWidget, contents) do
276
289
  |file, path|
277
290
  info = FileInfo.new(file, path)
278
- info.mtime = File.stat(info.nameWithPath).mtime
279
- info.directory! if File.directory?(info.nameWithPath)
291
+ info.mtime = File.stat(info.name_with_path).mtime
292
+ info.directory! if File.directory?(info.name_with_path)
280
293
  info
281
294
  end
282
295
  rescue StandardError => ex
@@ -286,20 +299,20 @@ class DirectoryDiffWidget < Fox::FXScrollWindow
286
299
  return contents
287
300
  end
288
301
 
289
- def includeFile?(filename)
302
+ def include_file?(filename)
290
303
  @excludeFilters.select { |pattern|
291
304
  Regexp.compile(pattern) =~ filename
292
305
  }.empty?
293
306
  end
294
307
 
295
- def updateList(dirEntries, listWidget, contents, &getInfoblock)
296
- listWidget.clearItems
308
+ def update_list(dir_entries, list_widget, contents, &get_info_block)
309
+ list_widget.clearItems
297
310
  items = Hash.new
298
- dirEntries.each do
311
+ dir_entries.each do
299
312
  |file|
300
- if includeFile?(file)
301
- info = getInfoblock.call(file, contents.path)
302
- text = ruby2Fox("#{info.name}\t#{info.mtimeString}")
313
+ if include_file?(file)
314
+ info = get_info_block.call(file, contents.path)
315
+ text = ruby_2_fox("#{info.name}\t#{info.mtime_string}")
303
316
  if info.directory?
304
317
  items[file] = FXIconItem.new(text, nil, @dirIcon)
305
318
  else
@@ -308,14 +321,14 @@ class DirectoryDiffWidget < Fox::FXScrollWindow
308
321
  contents.add(info)
309
322
  end
310
323
  end
311
- contents.directories.each { |n| listWidget.appendItem(items[n]) }
312
- contents.files.each { |n| listWidget.appendItem(items[n]) }
324
+ contents.directories.each { |n| list_widget.appendItem(items[n]) }
325
+ contents.files.each { |n| list_widget.appendItem(items[n]) }
313
326
  end
314
327
 
315
- def updateStatusIconsFor(listWidget, myContents, otherContents)
316
- (0..listWidget.getNumItems - 1).each do
328
+ def update_status_icons_for(listWidget, myContents, otherContents)
329
+ (0..listWidget.getNumItems - 1).each do
317
330
  |index|
318
- file = itemFilename(listWidget, index)
331
+ file = item_filename(listWidget, index)
319
332
  myInfo = myContents[file]
320
333
  otherInfo = otherContents[file]
321
334
  icon = if myInfo.directory?
@@ -331,17 +344,17 @@ class DirectoryDiffWidget < Fox::FXScrollWindow
331
344
  end
332
345
  end
333
346
 
334
- def updateStatusIconsLeft
335
- updateStatusIconsFor(@leftFileList, @leftContents, @rightContents)
347
+ def update_status_icons_left
348
+ update_status_icons_for(@leftFileList, @leftContents, @rightContents)
336
349
  end
337
350
 
338
- def updateStatusIconsRight
339
- updateStatusIconsFor(@rightFileList, @rightContents, @leftContents)
351
+ def update_status_icons_right
352
+ update_status_icons_for(@rightFileList, @rightContents, @leftContents)
340
353
  end
341
354
 
342
- def updateStatusIcons
343
- updateStatusIconsLeft
344
- updateStatusIconsRight
355
+ def update_status_icons
356
+ update_status_icons_left
357
+ update_status_icons_right
345
358
  end
346
359
 
347
360
  # messages
@@ -355,71 +368,75 @@ class DirectoryDiffWidget < Fox::FXScrollWindow
355
368
 
356
369
  # events
357
370
 
358
- def onDirUpLeftList(sender, sel, ptr)
359
- return false unless leftPath
360
- suggestion = FilePath.oneDirUp(leftPath)
361
- return false if leftPath == suggestion
362
- setLeftPath(suggestion)
363
- updateLeftList
364
- updateStatusIcons
371
+ def on_dir_up_lef_list(sender, sel, ptr)
372
+ return false unless left_path
373
+ suggestion = FilePath.one_dir_up(left_path)
374
+ return false if left_path == suggestion
375
+ set_left_path(suggestion)
376
+ update_left_list
377
+ update_status_icons
365
378
  return true
366
379
  end
367
380
 
368
- def onDirUpRightList(sender, sel, ptr)
369
- return false unless rightPath
370
- suggestion = FilePath.oneDirUp(rightPath)
371
- return false if rightPath == suggestion
372
- setRightPath(suggestion)
373
- updateRightList
374
- updateStatusIcons
381
+ def on_dir_up_right_list(sender, sel, ptr)
382
+ return false unless right_path
383
+ suggestion = FilePath.one_dir_up(right_path)
384
+ return false if right_path == suggestion
385
+ set_right_path(suggestion)
386
+ update_right_list
387
+ update_status_icons
375
388
  return true
376
389
  end
377
390
 
378
- def onDoubleclickLeftFileList(sender, sel, index)
379
- fileOrFolder = @leftFileList.getItemText(index)
380
- file = fileOrFolder.split(Regexp.compile("\t"))[0]
391
+ def on_doubleclick_left_file_list(sender, sel, index)
392
+ file_or_folder = @leftFileList.getItemText(index)
393
+ file = file_or_folder.split(Regexp.compile("\t"))[0]
381
394
  info = @leftContents[file]
382
395
  return false unless info && info.directory?
383
- fileWithPath = FilePath.join(leftPath, file)
384
- setLeftPath(fileWithPath)
385
- updateLeftList
386
- updateStatusIcons
396
+ file_with_path = FilePath.join(left_path, file)
397
+ set_left_path(file_with_path)
398
+ update_left_list
399
+ update_status_icons
387
400
  return true
388
401
  end
389
402
 
390
- def onDoubleclickRightFileList(sender, sel, index)
391
- fileOrFolder = @rightFileList.getItemText(index)
392
- file = fileOrFolder.split(Regexp.compile("\t"))[0]
403
+ def on_doubleclick_right_file_list(sender, sel, index)
404
+ file_or_folder = @rightFileList.getItemText(index)
405
+ file = file_or_folder.split(Regexp.compile("\t"))[0]
393
406
  info = @rightContents[file]
394
407
  return false unless info && info.directory?
395
- fileWithPath = FilePath.join(rightPath, file)
396
- setRightPath(fileWithPath)
397
- updateRightList
398
- updateStatusIcons
408
+ file_with_path = FilePath.join(right_path, file)
409
+ set_right_path(file_with_path)
410
+ update_right_list
411
+ update_status_icons
399
412
  return true
400
413
  end
401
414
 
402
- def onMenuLeftList(sender, sel, event)
415
+ def on_menu_left_list(sender, sel, event)
403
416
  end
404
417
 
405
- def onMenuRightList(sender, sel, event)
418
+ def on_menu_right_list(sender, sel, event)
406
419
  end
407
420
 
408
421
  # open/close
422
+
423
+ def preferred_width
424
+ 780
425
+ end
409
426
 
410
- def inCreate
411
- updateLeftList
412
- updateRightList
413
- updateStatusIcons
414
- @fourSplitter.setVSplit(660)
427
+ def in_create
428
+ update_left_list
429
+ update_right_list
430
+ update_status_icons
431
+ @horizontal_splitter.setSplit(0, preferred_width/2)
415
432
  end
416
433
 
417
434
  def create
418
- inCreate
435
+ in_create
419
436
  super
420
437
  end
421
438
 
422
- def prepareClosure
439
+ def prepare_closure
423
440
  end
424
441
  end
425
442