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.
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
@@ -16,8 +16,8 @@ class FtpBrowserDialog < Fox::FXDialogBox
16
16
  @frame = FXVerticalFrame.new(self)
17
17
  @frame.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_Y)
18
18
  @browser = FtpBrowserWidget.new(@frame, options)
19
- connect(SEL_CLOSE, method(:onCmdClose))
20
- @browser.quitButton.connect(SEL_COMMAND, method(:onQuitButton))
19
+ connect(SEL_CLOSE, method(:on_cmd_close))
20
+ @browser.quitButton.connect(SEL_COMMAND, method(:on_quit_button))
21
21
  end
22
22
 
23
23
  def options
@@ -25,18 +25,18 @@ class FtpBrowserDialog < Fox::FXDialogBox
25
25
  end
26
26
 
27
27
  def create
28
- resize(800, 600)
28
+ resize(@browser.preferred_width + 20, 600)
29
29
  place(PIGGY_WINDOW_PLACEMENT)
30
30
  super
31
31
  end
32
32
 
33
33
  # Send whenever this window is about to close
34
- def onCmdClose(sender, sel, ptr)
35
- @browser.prepareClosure
34
+ def on_cmd_close(sender, sel, ptr)
35
+ @browser.prepare_closure
36
36
  return 0
37
37
  end
38
38
 
39
- def onQuitButton(sender, sel, ptr)
39
+ def on_quit_button(sender, sel, ptr)
40
40
  handle(sender, MKUINT(ID_ACCEPT, SEL_COMMAND), nil)
41
41
  end
42
42
  end
@@ -48,11 +48,11 @@ class FtpBrowserMainWindow < DirectoryDiffMainWindow
48
48
  super(app, options)
49
49
  end
50
50
 
51
- def titleString
51
+ def title_string
52
52
  "Piggy FTP Browser"
53
53
  end
54
54
 
55
- def setMainWidget(options)
55
+ def set_main_widget(options)
56
56
  @browser = FtpBrowserWidget.new(@frame, options)
57
57
  end
58
58
  end
@@ -66,139 +66,192 @@ class FtpBrowserWidget < DirectoryDiffWidget
66
66
  super(window, options)
67
67
  end
68
68
 
69
- def loadIcons
69
+ def load_icons
70
70
  super
71
- @reloadIcon = basicLoadIcon('reload.ico')
72
- @autoSelectForDelIco = basicLoadIcon('auto-select-for-del.ico')
73
- @removeSelectedIco = basicLoadIcon('remove-selected.ico')
74
- @autoSelectRightIcon = basicLoadIcon('auto-select-right.ico')
75
- @uploadIcon = basicLoadIcon('auto-upload-right.ico')
76
- @moveRightDirIcon = basicLoadIcon('move-right-dir.ico')
77
- @moveRightFileIcon = basicLoadIcon('move-right-file.ico')
71
+ @reloadIcon = basic_load_icon('reload.ico')
72
+ @autoSelectForDelIco = basic_load_icon('auto-select-for-del.ico')
73
+ @removeSelectedIco = basic_load_icon('remove-selected.ico')
74
+ @autoSelectRightIcon = basic_load_icon('auto-select-right.ico')
75
+ @uploadIcon = basic_load_icon('auto-upload-right.ico')
76
+ @moveRightDirIcon = basic_load_icon('move-right-dir.ico')
77
+ @moveRightFileIcon = basic_load_icon('move-right-file.ico')
78
+ @connectIcon = basic_load_icon('connect.ico')
79
+ @showDetailsIcon = basic_load_icon('show_details.ico')
80
+ @hideDetailsIcon = basic_load_icon('hide_details.ico')
78
81
  end
79
82
 
80
- def initializeControlsOL
83
+ def initialize_controls_top_left
81
84
  @labels.push(FXLabel.new(@leftListPropFrame, "FTP server:"))
82
- @serverField = FXTextField.new(@leftListPropFrame, 32)
85
+ @serverField = FXTextField.new(@leftListPropFrame, txt_field_num_chars)
83
86
  @serverField.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
84
87
  @labels.push(FXLabel.new(@leftListPropFrame, "User:"))
85
- @userField = FXTextField.new(@leftListPropFrame, 32)
88
+ @userField = FXTextField.new(@leftListPropFrame, txt_field_num_chars)
86
89
  @userField.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
87
90
  @labels.push(FXLabel.new(@leftListPropFrame, "Password:"))
88
- @passwordField = FXTextField.new(@leftListPropFrame, 32)
91
+ pw_frame = new_hframe_without_padding(@leftListPropFrame)
92
+ @passwordField = FXTextField.new(pw_frame, txt_field_num_chars)
89
93
  @passwordField.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
90
94
  @passwordField.setTextStyle(TEXTFIELD_PASSWD)
95
+ @connect_button = FXButton.new(pw_frame, "\tConnect", @connectIcon)
91
96
  @labels.push(FXLabel.new(@leftListPropFrame, "Destination path:"))
92
- @leftPathField = FXTextField.new(@leftListPropFrame, 32)
93
- @leftPathField.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
97
+ left_path_frame = new_hframe_without_padding(@leftListPropFrame)
98
+ @leftPathField = FXTextField.new(left_path_frame, txt_field_num_chars)
99
+ @leftPathField.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
100
+ @details_button = FXButton.new(left_path_frame,
101
+ "\tShow connection details", @hideDetailsIcon)
102
+ @details_button.setFrameStyle(FRAME_NONE)
103
+ @details_button.disable
94
104
  end
95
105
 
96
- def initializeControlsUL
106
+ def details_shown?
107
+ @passwordField.visible?
108
+ end
109
+
110
+ def initialize_controls_bottom_left
97
111
  @updateButton = FXButton.new(@leftButtonsFrame,
98
- "\tUpdate list",
99
- @reloadIcon)
112
+ "\tUpdate list",
113
+ @reloadIcon)
100
114
  super
101
115
  @autoSelectForDelButton = FXButton.new(@leftButtonsFrame,
102
- "\tChoose files automatically",
103
- @autoSelectForDelIco)
116
+ "\tChoose files automatically",
117
+ @autoSelectForDelIco)
104
118
  @removeSelectedLeftButton = FXButton.new(@leftButtonsFrame,
105
- "\tRemove selected files",
106
- @removeSelectedIco)
119
+ "\tRemove selected files",
120
+ @removeSelectedIco)
107
121
  end
108
122
 
109
- def initializeControlsUR
123
+ def initialize_controls_bottom_right
110
124
  super
111
125
  @autoSelectRightButton = FXButton.new(@rightButtonsFrame,
112
- "\tChoose files automatically",
113
- @autoSelectRightIcon)
126
+ "\tChoose files automatically",
127
+ @autoSelectRightIcon)
114
128
  @uploadSelectedButton = FXButton.new(@rightButtonsFrame,
115
- "\tUpload selected",
116
- @uploadIcon)
129
+ "\tUpload selected",
130
+ @uploadIcon)
117
131
  end
118
-
119
- def connectEvents
132
+
133
+ def connect_events
120
134
  super
121
135
  @serverField.connect(SEL_COMMAND) {
122
- @options.ftpHost = @serverField.getText
136
+ @options.ftpHost = fox_2_ruby(@serverField.getText)
137
+ @connect_button.setState(STATE_UP)
123
138
  }
124
139
  @userField.connect(SEL_COMMAND) {
125
- @options.ftpUser = @userField.getText
140
+ @options.ftpUser = fox_2_ruby(@userField.getText)
141
+ @connect_button.setState(STATE_UP)
142
+ }
143
+ @passwordField.connect(SEL_COMMAND) {
144
+ @connect_button.setState(STATE_UP)
145
+ }
146
+ [@connect_button, @updateButton].each { |b|
147
+ b.connect(SEL_COMMAND, method(:on_cmd_update))
148
+ }
149
+ @autoSelectForDelButton.connect(SEL_COMMAND, method(:on_cmd_auto_select_left))
150
+ @removeSelectedLeftButton.connect(SEL_COMMAND, method(:on_cmd_remove_selected_left))
151
+ @autoSelectRightButton.connect(SEL_COMMAND, method(:on_cmd_auto_select_right))
152
+ @uploadSelectedButton.connect(SEL_COMMAND, method(:on_cmd_upload))
153
+ @details_button.connect(SEL_COMMAND) {
154
+ if(details_shown?)
155
+ hide_connection_details
156
+ else
157
+ show_connection_details
158
+ end
126
159
  }
127
- @updateButton.connect(SEL_COMMAND, method(:onCmdUpdate))
128
- @autoSelectForDelButton.connect(SEL_COMMAND, method(:onCmdAutoSelectLeft))
129
- @removeSelectedLeftButton.connect(SEL_COMMAND, method(:onCmdRemoveSelectedLeft))
130
- @autoSelectRightButton.connect(SEL_COMMAND, method(:onCmdAutoSelectRight))
131
- @uploadSelectedButton.connect(SEL_COMMAND, method(:onCmdUpload))
132
160
  end
133
-
134
- def setDefaults
135
- @serverField.setText(@options.ftpHost)
136
- @userField.setText(@options.ftpUser)
137
- @rightPathField.setText(@options.localDestinationPath)
138
- @leftPathField.setText(@options.remoteDestinationPath)
161
+
162
+ def set_defaults
163
+ @serverField.setText(ruby_2_fox(@options.ftpHost))
164
+ @userField.setText(ruby_2_fox(@options.ftpUser))
165
+ @rightPathField.setText(fox_pah(@options.localDestinationPath))
166
+ @leftPathField.setText(ruby_2_fox(@options.remoteDestinationPath))
139
167
  end
140
168
 
141
169
  # accessing
142
170
 
143
- def leftPath
171
+ def left_path
144
172
  @options.remoteDestinationPath
145
173
  end
146
174
 
147
- def setLeftPath(p)
148
- @options.remoteDestinationPath = FilePath.internPath(p)
149
- @leftPathField.setText(leftPath) #fixme winpath
175
+ def set_left_path(p)
176
+ @options.remoteDestinationPath = FilePath.intern_path(p)
177
+ @leftPathField.setText(left_path)
150
178
  end
151
179
 
152
180
  def password
153
- @passwordField.getText
181
+ fox_2_ruby(@passwordField.getText)
154
182
  end
155
183
 
156
184
  def host
157
- @serverField.getText
185
+ fox_2_ruby(@serverField.getText)
158
186
  end
159
187
 
160
188
  def user
161
- @userField.getText
189
+ fox_2_ruby(@userField.getText)
162
190
  end
163
-
191
+
192
+ def connection_details_fields
193
+ [ @passwordField, @serverField, @userField, @connect_button ] +
194
+ @labels.slice(0..2)
195
+ end
196
+
164
197
  # update
198
+
199
+ def hide_connection_details
200
+ fields = connection_details_fields
201
+ fields.each { |f| f.hide }
202
+ @details_button.enable
203
+ @details_button.setIcon(@showDetailsIcon)
204
+ @left_frame.recalc
205
+ end
206
+
207
+ def show_connection_details
208
+ fields = connection_details_fields
209
+ fields.each { |f| f.show }
210
+ @details_button.setIcon(@hideDetailsIcon)
211
+ @left_frame.recalc
212
+ end
165
213
 
166
- def updateStatusIconsRight
214
+ def update_status_icons_right
167
215
  (0..@rightFileList.getNumItems - 1).each do
168
216
  |index|
169
- file = itemFilename(@rightFileList, index)
217
+ file = item_filename(@rightFileList, index)
170
218
  myInfo = @rightContents[file]
171
219
  otherInfo = @leftContents[file]
172
220
  icon = if myInfo.directory?
173
- otherInfo ? @dirIcon : @moveRightDirIcon
174
- else
175
- if otherInfo
176
- otherInfo.mtime < myInfo.mtime ? @newerFileIcon : @fileIcon
177
- else
178
- @moveRightFileIcon
179
- end
180
- end
221
+ otherInfo ? @dirIcon : @moveRightDirIcon
222
+ else
223
+ if otherInfo
224
+ otherInfo.mtime < myInfo.mtime ? @newerFileIcon : @fileIcon
225
+ else
226
+ @moveRightFileIcon
227
+ end
228
+ end
181
229
  @rightFileList.setItemMiniIcon(index, icon)
182
230
  end
183
231
  end
184
232
 
185
- def updateLeftList
186
- updateFtpList if @connectionDataVerified
233
+ def update_left_list
234
+ if @connectionDataVerified
235
+ update_ftp_list
236
+ else
237
+ show_connection_details
238
+ end
187
239
  end
188
240
 
189
- def ftpDo(&block) # don't chdir in block
241
+ def ftp_do(&block) # don't chdir in block
190
242
  getApp.beginWaitCursor
191
243
  @leftFileList.clearItems
192
- @leftContents = DirectoryContents.new(leftPath)
244
+ @leftContents = DirectoryContents.new(left_path)
193
245
  begin
194
246
  @connectionDataVerified = false
195
247
  @ftpAdapter.connect(host, user, password)
196
248
  @connectionDataVerified = true
197
- @ftpAdapter.chdir(leftPath)
249
+ @connect_button.setState(STATE_DOWN)
250
+ @ftpAdapter.chdir(left_path)
198
251
  block.call # <------ the call
199
- updateList(@ftpAdapter.nlst, @leftFileList, @leftContents) do
200
- |file, path|
201
- @ftpAdapter.info(file, path)
252
+ update_list(@ftpAdapter.nlst, @leftFileList, @leftContents) do
253
+ |file, path|
254
+ @ftpAdapter.info(file, path)
202
255
  end
203
256
  rescue SocketError => ex
204
257
  error(ex.message)
@@ -210,109 +263,110 @@ class FtpBrowserWidget < DirectoryDiffWidget
210
263
  error("Timeout - operation took longer than expected. \nCheck network connection and try again.")
211
264
  ensure
212
265
  @ftpAdapter.close
266
+ @connect_button.setState(STATE_UP) unless @connectionDataVerified
213
267
  end
214
268
  getApp.endWaitCursor
215
269
  end
216
270
 
217
- def updateFtpList
218
- ftpDo {} # every ftp action includes an update :-)
271
+ def update_ftp_list
272
+ ftp_do {} # every ftp action includes an update :-)
219
273
  end
220
274
 
221
275
  # actions
222
276
 
223
- def autoSelectLeft
277
+ def auto_select_left
224
278
  list = @leftFileList
225
279
  list.killSelection
226
280
  (0..list.getNumItems-1).each do
227
281
  |index|
228
- file = itemFilename(list, index)
282
+ file = item_filename(list, index)
229
283
  myInfo = @leftContents[file]
230
284
  otherInfo = @rightContents[file]
231
285
  select = if myInfo.directory?
232
- false
233
- elsif otherInfo
234
- false
235
- else
236
- true
237
- end
286
+ false
287
+ elsif otherInfo
288
+ false
289
+ else
290
+ true
291
+ end
238
292
  list.selectItem(index) if select
239
293
  end
240
294
  end
241
295
 
242
- def autoSelectRight
296
+ def auto_select_right
243
297
  list = @rightFileList
244
298
  list.killSelection
245
299
  (0..list.getNumItems-1).each do
246
300
  |index|
247
- file = itemFilename(list, index)
301
+ file = item_filename(list, index)
248
302
  myInfo = @rightContents[file]
249
303
  otherInfo = @leftContents[file]
250
304
  select = if myInfo.directory?
251
- false
252
- elsif otherInfo && otherInfo.directory?
253
- false
254
- elsif !otherInfo || otherInfo.mtime < myInfo.mtime
255
- true
256
- else
257
- false
258
- end
305
+ false
306
+ elsif otherInfo && otherInfo.directory?
307
+ false
308
+ elsif !otherInfo || otherInfo.mtime < myInfo.mtime
309
+ true
310
+ else
311
+ false
312
+ end
259
313
  list.selectItem(index) if select
260
314
  end
261
315
  end
262
316
 
263
- def ftpDeleteLeft(files)
264
- ftpDo {
317
+ def ftp_delete_left(files)
318
+ ftp_do do
265
319
  files.each { |file|
266
- @ftpAdapter.delete(file)
320
+ @ftpAdapter.delete(file)
267
321
  }
268
- }
269
- updateStatusIcons
322
+ end
323
+ update_status_icons
270
324
  end
271
325
 
272
- def ftpUploadRight(hash, totalSize)
273
- ftpDo do
326
+ def ftp_upload_right(hash, totalSize)
327
+ ftp_do do
274
328
  progressDialog = FXProgressDialog.new(self,
275
- 'Transferring data',
276
- 'Transferring data')
329
+ 'Transferring data',
330
+ 'Transferring data')
277
331
  begin
278
- progressDialog.setProgress(1)
279
- progressDialog.setTotal(totalSize)
280
- progressDialog.create
281
- progressDialog.show
282
- progressDialog.repaint
283
- hash.keys.sort.each do
284
- |file|
285
- @ftpAdapter.upload(rightPath, file) { |data|
286
- progressDialog.setMessage(ruby2Fox("Transferring #{File.basename(file)}"))
287
- progressDialog.increment(data.size)
288
- progressDialog.repaint
289
- }
290
- end
332
+ progressDialog.setProgress(1)
333
+ progressDialog.setTotal(totalSize)
334
+ progressDialog.create
335
+ progressDialog.show
336
+ progressDialog.repaint
337
+ hash.keys.sort.each do
338
+ |file|
339
+ @ftpAdapter.upload(right_path, file) { |data|
340
+ progressDialog.setMessage(ruby_2_fox("Transferring #{File.basename(file)}"))
341
+ progressDialog.increment(data.size)
342
+ progressDialog.repaint
343
+ }
344
+ end
291
345
  ensure
292
- progressDialog.hide
346
+ progressDialog.hide
293
347
  end
294
348
  end
295
- updateStatusIcons
349
+ update_status_icons
296
350
  end
297
351
 
298
- def askAndUploadSelection
299
- sel = selectionInList(@rightFileList)
300
- return false if sel.empty?
301
- files = sel.collect { |e| FilePath.join(rightPath, e) }
302
- uploadInfo = UploadInfo.new(files)
303
- num = uploadInfo.numFiles
352
+ def ask_and_upload_selection
353
+ sel = selection_in_list(@rightFileList)
354
+ return false if !sel || sel.empty?
355
+ files = sel.collect { |e| FilePath.join(right_path, e) }
356
+ upload_info = UploadInfo.new(files)
357
+ num = upload_info.num_files
304
358
  if(num < 1)
305
359
  FXMessageBox.information(self, MBOX_OK, 'No files',
306
- 'No files found in selected directories!')
360
+ 'No files found in selected directories!')
307
361
  return false
308
362
  end
309
363
  answer = FXMessageBox.question(self, MBOX_YES_NO, 'Really upload?',
310
- "Upload #{num} fil#{num == 1 ? 'e' : 'es'}?")
311
- ftpUploadRight(uploadInfo.bytesHash, uploadInfo.bytes) if answer == MBOX_CLICKED_YES
364
+ "Upload #{num} fil#{num == 1 ? 'e' : 'es'}?")
365
+ ftp_upload_right(upload_info.bytes_hash, upload_info.bytes) if answer == MBOX_CLICKED_YES
312
366
  end
313
367
 
314
- def askAndFtpDeleteSelection
315
- sel = selectionInList(@leftFileList)
368
+ def ask_and_ftp_delete_selection
369
+ sel = selection_in_list(@leftFileList)
316
370
  dirs = sel.select { |file|
317
371
  @leftContents[file].directory?
318
372
  }
@@ -320,35 +374,36 @@ class FtpBrowserWidget < DirectoryDiffWidget
320
374
  return false if sel.empty?
321
375
  num = sel.size
322
376
  answer = FXMessageBox.question(self, MBOX_YES_NO, 'Really delete?',
323
- "Delete #{num} fil#{num == 1 ? 'e' : 'es'}?")
324
- ftpDeleteLeft(sel) if answer == MBOX_CLICKED_YES
377
+ "Delete #{num} fil#{num == 1 ? 'e' : 'es'}?")
378
+ ftp_delete_left(sel) if answer == MBOX_CLICKED_YES
325
379
  end
326
380
 
327
381
  # events
328
382
 
329
- def onCmdUpdate(sender, sel, ptr)
330
- updateFtpList
331
- updateStatusIcons
383
+ def on_cmd_update(sender, sel, ptr)
384
+ update_ftp_list
385
+ update_status_icons
386
+ hide_connection_details if @connectionDataVerified
332
387
  end
333
388
 
334
- def onCmdAutoSelectLeft(sender, sel, ptr)
335
- autoSelectLeft
389
+ def on_cmd_auto_select_left(sender, sel, ptr)
390
+ auto_select_left
336
391
  end
337
392
 
338
- def onCmdRemoveSelectedLeft(sender, sel, ptr)
339
- askAndFtpDeleteSelection
393
+ def on_cmd_remove_selected_left(sender, sel, ptr)
394
+ ask_and_ftp_delete_selection
340
395
  end
341
396
 
342
- def onCmdAutoSelectRight(sender, sel, ptr)
343
- autoSelectRight
397
+ def on_cmd_auto_select_right(sender, sel, ptr)
398
+ auto_select_right
344
399
  end
345
400
 
346
- def onCmdUpload(sender, sel, event)
347
- askAndUploadSelection
401
+ def on_cmd_upload(sender, sel, event)
402
+ ask_and_upload_selection
348
403
  end
349
404
 
350
- def onMenuLeftList(sender, sel, event)
351
- selection = selectionInList(@leftFileList)
405
+ def on_menu_left_list(sender, sel, event)
406
+ selection = selection_in_list(@leftFileList)
352
407
  pane = FXMenuPane.new(self)
353
408
  # FXMenuSeparator.new(pane)
354
409
  item = FXMenuCommand.new(pane, "&Remove selected")
@@ -356,7 +411,7 @@ class FtpBrowserWidget < DirectoryDiffWidget
356
411
  item.disable
357
412
  else
358
413
  item.connect(SEL_COMMAND){ |sender, sel, event|
359
- askAndFtpDeleteSelection
414
+ ask_and_ftp_delete_selection
360
415
  }
361
416
  end
362
417
  pane.create
@@ -365,15 +420,15 @@ class FtpBrowserWidget < DirectoryDiffWidget
365
420
  return 1
366
421
  end
367
422
 
368
- def onMenuRightList(sender, sel, event)
369
- selection = selectionInList(@rightFileList)
423
+ def on_menu_right_list(sender, sel, event)
424
+ selection = selection_in_list(@rightFileList)
370
425
  pane = FXMenuPane.new(self)
371
426
  item = FXMenuCommand.new(pane, "&Upload selected")
372
427
  if(selection.empty?)
373
428
  item.disable
374
429
  else
375
430
  item.connect(SEL_COMMAND){ |sender, sel, event|
376
- askAndUploadSelection
431
+ ask_and_upload_selection
377
432
  }
378
433
  end
379
434
  # FXMenuSeparator.new(pane)
@@ -384,14 +439,15 @@ class FtpBrowserWidget < DirectoryDiffWidget
384
439
  end
385
440
 
386
441
  # open/close
387
-
388
- def inCreate
389
- updateRightList
390
- updateStatusIcons
391
- @fourSplitter.setVSplit(2050)
442
+
443
+ def in_create
444
+ update_right_list
445
+ update_status_icons
446
+ puts preferred_width.to_s
447
+ @horizontal_splitter.setSplit(0, preferred_width/2)
392
448
  end
393
449
 
394
- def prepareClosure
450
+ def prepare_closures
395
451
  @ftpAdapter.close
396
452
  super
397
453
  end
@@ -10,15 +10,15 @@ class Fullscreen < Fox::FXMainWindow
10
10
 
11
11
  def initialize(*args)
12
12
  super(*args)
13
- FXMAPFUNC(SEL_KEYPRESS, 0, :onKeyPress)
13
+ FXMAPFUNC(SEL_KEYPRESS, 0, :on_key_press)
14
14
  end
15
15
 
16
- def onKeyPress(sender, sel, event)
16
+ def on_key_press(sender, sel, event)
17
17
  if event.code == KEY_Escape
18
18
  if FOXVERSION_GE_1_2
19
- close(true)
19
+ close(true)
20
20
  else
21
- hide()
21
+ hide()
22
22
  end
23
23
  return 1
24
24
  end