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.
- 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
@@ -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,
|
15
|
-
|
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
|
-
|
19
|
-
@browser.quitButton.connect(SEL_COMMAND, method(:
|
19
|
+
set_main_widget(options)
|
20
|
+
@browser.quitButton.connect(SEL_COMMAND, method(:on_terminate))
|
20
21
|
end
|
21
22
|
|
22
|
-
def
|
23
|
+
def title_string
|
23
24
|
"Piggy Directory Diff"
|
24
25
|
end
|
25
26
|
|
26
|
-
def
|
27
|
+
def set_main_widget(options)
|
27
28
|
@browser = DirectoryDiffWidget.new(@frame, options)
|
28
29
|
end
|
29
30
|
|
30
31
|
def create
|
31
|
-
resize(
|
32
|
+
resize(@browser.preferred_width + 20, 600)
|
32
33
|
place(PIGGY_WINDOW_PLACEMENT)
|
33
34
|
super
|
34
35
|
end
|
35
36
|
|
36
|
-
def
|
37
|
-
@browser.
|
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
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
@rightContents = DirectoryContents.new(
|
60
|
-
@leftContents = DirectoryContents.new(
|
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
|
65
|
-
@dirIcon =
|
66
|
-
@fileIcon =
|
67
|
-
@dirupIcon =
|
68
|
-
@fileAbsentIcon =
|
69
|
-
@dirAbsentIcon =
|
70
|
-
@newerFileIcon =
|
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
|
74
|
-
|
75
|
-
@iconLoader.
|
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
|
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
|
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
|
89
|
+
def initialize_frames
|
89
90
|
@frame = FXVerticalFrame.new(self)
|
90
|
-
@
|
91
|
-
@
|
92
|
-
@
|
93
|
-
@
|
94
|
-
@
|
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
|
108
|
+
def initialize_controls
|
106
109
|
@labels = Array.new
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
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
|
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 =
|
123
|
+
combo = new_hframe_without_padding(@leftListPropFrame)
|
117
124
|
combo.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
|
118
|
-
@leftPathField = FXTextField.new(combo,
|
125
|
+
@leftPathField = FXTextField.new(combo, txt_field_num_chars)
|
119
126
|
@leftPathField.setLayoutHints(LAYOUT_FILL_X)
|
120
|
-
|
127
|
+
dir_chooser_for_field(@leftPathField, 'left')
|
121
128
|
end
|
122
129
|
|
123
|
-
def
|
130
|
+
def initialize_controls_top_right
|
124
131
|
@labels.push(FXLabel.new(@rightListPropFrame, "Dir:"))
|
125
|
-
combo =
|
126
|
-
combo.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
|
127
|
-
@rightPathField = FXTextField.new(combo,
|
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
|
-
|
136
|
+
dir_chooser_for_field(@rightPathField, 'right')
|
130
137
|
end
|
131
138
|
|
132
|
-
def
|
133
|
-
|
134
|
-
|
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
|
-
|
139
|
-
|
145
|
+
field.setText(dialog.directory)
|
146
|
+
dir_changed(side)
|
140
147
|
end
|
141
148
|
}
|
142
149
|
end
|
143
150
|
|
144
|
-
def
|
151
|
+
def initialize_controls_bottom_left
|
145
152
|
@dirLeftUpButton = FXButton.new(@leftButtonsFrame,
|
146
|
-
|
147
|
-
|
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
|
161
|
+
def initialize_controls_bottom_right
|
155
162
|
@dirRightUpButton = FXButton.new(@rightButtonsFrame,
|
156
|
-
|
157
|
-
|
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
|
171
|
+
def initialize_buttons
|
165
172
|
@quitButton = FXButton.new(@buttonsFrame, "&Quit")
|
166
173
|
end
|
167
174
|
|
168
|
-
def
|
175
|
+
def initialize_layout
|
169
176
|
@labels.each { |label| label.setLayoutHints LAYOUT_CENTER_Y }
|
170
177
|
[
|
171
178
|
self, @frame,
|
172
|
-
@
|
179
|
+
@horizontal_splitter, @left_frame, @right_frame,
|
173
180
|
# @leftListPropFrame, @rightListPropFrame,
|
174
|
-
|
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
|
199
|
+
def dir_changed(side)
|
192
200
|
if(side == 'right')
|
193
|
-
|
194
|
-
|
195
|
-
|
201
|
+
set_right_path(@rightPathField.getText)
|
202
|
+
update_right_list
|
203
|
+
update_status_icons
|
196
204
|
else
|
197
|
-
|
198
|
-
|
199
|
-
|
205
|
+
set_left_path(@leftPathField.getText)
|
206
|
+
update_left_list
|
207
|
+
update_status_icons
|
200
208
|
end
|
201
209
|
end
|
202
210
|
|
203
|
-
def
|
211
|
+
def connect_events
|
204
212
|
@rightPathField.connect(SEL_COMMAND) {
|
205
|
-
|
213
|
+
dir_changed('right')
|
206
214
|
}
|
207
215
|
@leftPathField.connect(SEL_COMMAND) {
|
208
|
-
|
216
|
+
dir_changed('left')
|
209
217
|
}
|
210
|
-
@dirLeftUpButton.connect(SEL_COMMAND, method(:
|
211
|
-
@dirRightUpButton.connect(SEL_COMMAND, method(:
|
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
|
-
|
222
|
+
method(:on_doubleclick_left_file_list))
|
215
223
|
@rightFileList.connect(SEL_DOUBLECLICKED,
|
216
|
-
|
224
|
+
method(:on_doubleclick_right_file_list))
|
217
225
|
@leftFileList.connect(SEL_RIGHTBUTTONRELEASE,
|
218
|
-
|
226
|
+
method(:on_menu_left_list))
|
219
227
|
@rightFileList.connect(SEL_RIGHTBUTTONRELEASE,
|
220
|
-
|
228
|
+
method(:on_menu_right_list))
|
221
229
|
end
|
222
|
-
|
223
|
-
def
|
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
|
243
|
+
def right_path
|
231
244
|
@options.localDestinationPath
|
232
245
|
end
|
233
246
|
|
234
|
-
def
|
235
|
-
@options.localDestinationPath = FilePath.
|
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
|
240
|
-
FilePath.
|
252
|
+
def left_path
|
253
|
+
FilePath.intern_path(@leftPathField.getText)
|
241
254
|
end
|
242
255
|
|
243
|
-
def
|
256
|
+
def set_left_path(p)
|
244
257
|
@leftPathField.setText(p) # fixme winpath
|
245
258
|
end
|
246
259
|
|
247
|
-
def
|
248
|
-
|
260
|
+
def selection_in_list(list)
|
261
|
+
selected_ind = (0..list.getNumItems-1).select { |i|
|
249
262
|
list.isItemSelected(i)
|
250
263
|
}
|
251
|
-
return
|
264
|
+
return selected_ind.collect { |i| item_filename(list, i) }
|
252
265
|
end
|
253
266
|
|
254
|
-
def
|
255
|
-
txt =
|
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
|
262
|
-
@leftContents =
|
274
|
+
def update_left_list
|
275
|
+
@leftContents = update_local_list(@leftFileList, left_path)
|
263
276
|
end
|
264
277
|
|
265
|
-
def
|
266
|
-
@rightContents =
|
278
|
+
def update_right_list
|
279
|
+
@rightContents = update_local_list(@rightFileList, right_path)
|
267
280
|
end
|
268
281
|
|
269
|
-
def
|
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
|
-
|
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.
|
279
|
-
info.directory! if File.directory?(info.
|
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
|
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
|
296
|
-
|
308
|
+
def update_list(dir_entries, list_widget, contents, &get_info_block)
|
309
|
+
list_widget.clearItems
|
297
310
|
items = Hash.new
|
298
|
-
|
311
|
+
dir_entries.each do
|
299
312
|
|file|
|
300
|
-
if
|
301
|
-
info =
|
302
|
-
text =
|
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|
|
312
|
-
contents.files.each { |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
|
316
|
-
|
328
|
+
def update_status_icons_for(listWidget, myContents, otherContents)
|
329
|
+
(0..listWidget.getNumItems - 1).each do
|
317
330
|
|index|
|
318
|
-
file =
|
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
|
335
|
-
|
347
|
+
def update_status_icons_left
|
348
|
+
update_status_icons_for(@leftFileList, @leftContents, @rightContents)
|
336
349
|
end
|
337
350
|
|
338
|
-
def
|
339
|
-
|
351
|
+
def update_status_icons_right
|
352
|
+
update_status_icons_for(@rightFileList, @rightContents, @leftContents)
|
340
353
|
end
|
341
354
|
|
342
|
-
def
|
343
|
-
|
344
|
-
|
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
|
359
|
-
return false unless
|
360
|
-
suggestion = FilePath.
|
361
|
-
return false if
|
362
|
-
|
363
|
-
|
364
|
-
|
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
|
369
|
-
return false unless
|
370
|
-
suggestion = FilePath.
|
371
|
-
return false if
|
372
|
-
|
373
|
-
|
374
|
-
|
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
|
379
|
-
|
380
|
-
file =
|
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
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
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
|
391
|
-
|
392
|
-
file =
|
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
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
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
|
415
|
+
def on_menu_left_list(sender, sel, event)
|
403
416
|
end
|
404
417
|
|
405
|
-
def
|
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
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
@
|
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
|
-
|
435
|
+
in_create
|
419
436
|
super
|
420
437
|
end
|
421
438
|
|
422
|
-
def
|
439
|
+
def prepare_closure
|
423
440
|
end
|
424
441
|
end
|
425
442
|
|