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
@@ -13,54 +13,54 @@ class PipeLog < Fox::FXText
13
13
 
14
14
  def initialize(parent)
15
15
  super(parent)
16
- @inputTypes = INPUT_READ|INPUT_EXCEPT
16
+ @input_types = INPUT_READ|INPUT_EXCEPT
17
17
  @pipes = Array.new
18
18
  end
19
19
 
20
- def runCommand(commandline, workingDir, spawn = false)
21
- inPath(workingDir) {
22
- runCommandAndDisplayOutput(commandline, spawn)
20
+ def run_command(commandline, working_dir, spawn = false)
21
+ in_path(working_dir) {
22
+ run_command_and_display_output(commandline, spawn)
23
23
  }
24
24
  end
25
25
 
26
- def hasOpenPipes?
26
+ def has_open_pipes?
27
27
  !@pipes.empty?
28
28
  end
29
29
 
30
30
  # This should be used explicitly before destruction
31
- def closePipes
32
- @pipes.each { |p| getApp().removeInput(p, @inputTypes) }
31
+ def close_pipes
32
+ @pipes.each { |p| getApp().removeInput(p, @input_types) }
33
33
  @pipes = Array.new
34
34
  end
35
35
 
36
36
  private
37
37
 
38
- def closePipe(aPipe)
39
- return if !aPipe
40
- getApp().removeInput(aPipe, @inputTypes)
41
- @pipes.delete(aPipe)
38
+ def close_pipe(pipe)
39
+ return if !pipe
40
+ getApp().removeInput(pipe, @input_types)
41
+ @pipes.delete(pipe)
42
42
  end
43
43
 
44
- def runCommandAndDisplayOutput(commandline, spawn)
44
+ def run_command_and_display_output(commandline, spawn)
45
45
  unless spawn && UsePipes
46
46
  system(commandline)
47
47
  msg = "#{$? != 0 ? 'Error' : 'Success'}: #{commandline}\n"
48
48
  appendText(msg)
49
49
  return
50
50
  end
51
- newPipe = IO.popen("#{commandline} 2>&1")
51
+ new_pipe = IO.popen("#{commandline} 2>&1")
52
52
  return if(spawn)
53
- getApp().addInput(newPipe, @inputTypes) { |sender, sel, ptr|
53
+ getApp().addInput(new_pipe, @input_types) { |sender, sel, ptr|
54
54
  case FXSELTYPE(sel)
55
55
  when SEL_IO_READ
56
- text = newPipe.read
56
+ text = new_pipe.read
57
57
  if text
58
58
  appendText(text)
59
59
  else
60
- closePipe(newPipe)
60
+ close_pipe(new_pipe)
61
61
  end
62
62
  when SEL_IO_EXCEPT
63
- closePipe(newPipe)
63
+ close_pipe(new_pipe)
64
64
  end
65
65
  }
66
66
  end
@@ -6,12 +6,12 @@ class ProgressWithDialog < Progress
6
6
  def initialize(client)
7
7
  super()
8
8
  @client = client
9
- newDialog
9
+ new_dialog
10
10
  end
11
11
 
12
- def newDialog
12
+ def new_dialog
13
13
  @progressDialog = Fox::FXProgressDialog.new(@client, @task, @task)
14
- @progressDialog.setMessage(ruby2Fox(@task))
14
+ @progressDialog.setMessage(ruby_2_fox(@task))
15
15
  @progressDialog.setProgress(@units)
16
16
  @progressDialog.setTotal(@numUnits)
17
17
  @progressDialog.create
@@ -19,13 +19,13 @@ class ProgressWithDialog < Progress
19
19
  @progressDialog.repaint
20
20
  end
21
21
 
22
- def logTask
22
+ def log_task
23
23
  @client.repaint
24
24
  if(@progressDialog.isCancelled)
25
25
  cancel
26
26
  else
27
- @progressDialog.setTitle(ruby2Fox(@task))
28
- @progressDialog.setMessage(ruby2Fox(@task))
27
+ @progressDialog.setTitle(ruby_2_fox(@task))
28
+ @progressDialog.setMessage(ruby_2_fox(@task))
29
29
  @progressDialog.setProgress(@units)
30
30
  @progressDialog.setTotal(@numUnits)
31
31
  @progressDialog.repaint
@@ -33,12 +33,12 @@ class ProgressWithDialog < Progress
33
33
  super
34
34
  end
35
35
 
36
- def logProgress(message, unit)
36
+ def log_progress(message, unit)
37
37
  @client.repaint
38
38
  if @progressDialog.isCancelled
39
39
  cancel
40
40
  else
41
- @progressDialog.setMessage(ruby2Fox(message))
41
+ @progressDialog.setMessage(ruby_2_fox(message))
42
42
  @progressDialog.setProgress(@units)
43
43
  @progressDialog.repaint
44
44
  end
@@ -10,7 +10,7 @@
10
10
  require 'rubygems'
11
11
  require 'piggy-core/encoding'
12
12
 
13
- def loadFox
13
+ def load_fox
14
14
  begin
15
15
  ['fox16', 'fox14', 'fox12', 'fox'].each { |v|
16
16
  begin
@@ -24,9 +24,10 @@ def loadFox
24
24
  end
25
25
  end
26
26
 
27
- FOXLIB = loadFox
27
+ FOXLIB = load_fox
28
28
 
29
29
  puts "Using FXRuby library #{FOXLIB}"
30
+ require "#{FOXLIB}/colors"
30
31
 
31
32
  FOXVERSION_GE_1_2 = (FOXLIB != 'fox')
32
33
 
@@ -42,7 +43,7 @@ if FOXVERSION_GE_1_2
42
43
 
43
44
  PIGGY_WINDOW_PLACEMENT = Fox::PLACEMENT_SCREEN
44
45
 
45
- def newCombobox(p1, p2, p3, p4, p5, p6)
46
+ def new_combobox(p1, p2, p3, p4, p5, p6)
46
47
  box = Fox::FXComboBox.new(p1, p2, p4, p5, p6)
47
48
  box.setNumVisible(p3)
48
49
  box
@@ -59,7 +60,7 @@ else
59
60
 
60
61
  PIGGY_WINDOW_PLACEMENT = Fox::PLACEMENT_DEFAULT
61
62
 
62
- def newCombobox(p1, p2, p3, p4, p5, p6)
63
+ def new_combobox(p1, p2, p3, p4, p5, p6)
63
64
  Fox::FXComboBox.new(p1, p2, p3, p4, p5, p6)
64
65
  end
65
66
  def FXSELTYPE(sel)
@@ -68,20 +69,34 @@ else
68
69
  end
69
70
 
70
71
  if ['fox14', 'fox12', 'fox'].include? FOXLIB
71
- def fox2Ruby(string)
72
+ def fox_2_ruby(string)
72
73
  string
73
74
  end
74
75
 
75
- def ruby2Fox(string)
76
+ def ruby_2_fox(string)
76
77
  string
77
78
  end
78
79
  else
79
- def fox2Ruby(string)
80
+ def fox_2_ruby(string)
80
81
  utf8_as_string(string)
81
82
  end
82
83
 
83
- def ruby2Fox(string)
84
+ def ruby_2_fox(string)
84
85
  string_as_utf8(string)
85
86
  end
86
87
  end
87
88
 
89
+ def remove_padding(frame)
90
+ frame.padLeft=0
91
+ frame.padRight=0
92
+ frame.padTop=0
93
+ frame.padBottom=0
94
+ return frame
95
+ end
96
+
97
+ def new_hframe_without_padding(parent)
98
+ f = Fox::FXHorizontalFrame.new(parent)
99
+ f.setFrameStyle(Fox::FRAME_NONE)
100
+ remove_padding(f)
101
+ return f
102
+ end
data/lib/piggy.rb CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  require 'piggy-gui/piggy_image_browser'
8
8
 
9
- def runPiggy
9
+ def run_piggy
10
10
  # Make application
11
11
  application = Fox::FXApp.new("Piggy", "Sascha D�rdelmann")
12
12
 
@@ -14,22 +14,24 @@ def runPiggy
14
14
  window = PiggyImageBrowser.new(application)
15
15
 
16
16
  # Handle interrupts to terminate program gracefully
17
- application.addSignal("SIGINT", window.method(:onTerminate))
17
+ application.addSignal("SIGINT", window.method(:on_terminate))
18
18
 
19
19
  # Create it
20
20
  application.create
21
21
  window.show
22
22
 
23
23
  # Passed image file or directory?
24
- arg = ARGV.length > 0 ? ARGV[0] : window.defaultStartupDirectory
25
- window.openFileOrLink(arg)
24
+ arg = ARGV.length > 0 ? ARGV[0] : window.default_startup_directory
25
+ window.open_file_or_link(arg)
26
26
 
27
27
  # Run
28
28
  application.run
29
29
  end
30
30
 
31
+ alias :runPiggy :run_piggy
32
+
31
33
  if $0 == __FILE__
32
- runPiggy
34
+ run_piggy
33
35
  end
34
36
 
35
37
 
@@ -1,27 +1,29 @@
1
- body.thumbs {
2
- text-align: center;
1
+ body {
2
+ text-align: center;
3
3
  }
4
4
 
5
- dl {
6
- max-width: 600px;
5
+ dl, table.table {
6
+ margin-left: auto;
7
+ margin-right: auto;
8
+ max-width: 600px;
7
9
  }
8
10
 
9
11
  /* no max-width in IE < 7 */
10
12
  * html dl {
11
- width: 600px;
13
+ width: 600px;
12
14
  }
13
15
 
14
16
  dd {
15
- margin:0;
16
- padding: 0;
17
- width: 110px;
18
- height: 114px;
19
- float: left;
20
- vertical-align: top;
21
- text-align: center;
17
+ margin:0;
18
+ padding: 0;
19
+ width: 110px;
20
+ height: 116px;
21
+ float: left;
22
+ vertical-align: top;
23
+ text-align: center;
22
24
  }
23
25
 
24
26
  td {
25
- vertical-align: top;
26
- test-align: center;
27
+ vertical-align: top;
28
+ text-align: center;
27
29
  }
@@ -1,64 +1,63 @@
1
1
  body {
2
- color: #FFFFFF;
3
- background:black;
4
- }
5
-
6
- body.thumbs {
7
- text-align: center;
2
+ color: #FFFFFF;
3
+ background:black;
4
+ text-align: center;
8
5
  }
9
6
 
10
7
  a:link {
11
- color: #FFFF00;
12
- text-decoration: underline;
8
+ color: #FFFF00;
9
+ text-decoration: underline;
13
10
  }
14
11
 
15
12
  a:visited {
16
- color: #FFFF00;
17
- text-decoration: underline;
13
+ color: #FFFF00;
14
+ text-decoration: underline;
18
15
  }
19
16
 
20
17
  a:hover {
21
- color: #AAAAAA;
22
- text-decoration: underline;
18
+ color: #AAAAAA;
19
+ text-decoration: underline;
23
20
  }
24
21
 
25
22
  a:active {
26
- color: #FFFF00;
27
- text-decoration: none;
23
+ color: #FFFF00;
24
+ text-decoration: none;
28
25
  }
29
26
 
30
- dl {
31
- max-width: 600px;
27
+ dl, table.table {
28
+ margin-left: auto;
29
+ margin-right: auto;
30
+ max-width: 600px;
32
31
  }
33
32
 
34
33
  /* no max-width in IE < 7 */
35
34
  * html dl {
36
- width: 600px;
35
+ width: 600px;
37
36
  }
38
37
 
39
38
  dd {
40
- margin:0;
41
- padding: 0;
42
- width: 110px;
43
- height: 114px;
44
- float: left;
45
- vertical-align: top;
46
- text-align: center;
39
+ margin:0;
40
+ padding: 0;
41
+ width: 110px;
42
+ height: 114px;
43
+ float: left;
44
+ vertical-align: top;
45
+ text-align: center;
47
46
  }
48
47
 
49
48
  img {
50
- border-style: none
49
+ border-style: none
51
50
  }
52
51
 
53
52
  div {
54
- margin:0;
53
+ margin:0;
55
54
  }
56
55
 
57
56
  .thumb {
58
- margin:0;
57
+ margin:0;
59
58
  }
60
59
 
61
60
  .thumb p {
62
- margin:0;
63
- padding:0;
61
+ margin:0;
62
+ padding:0;
64
63
  }
@@ -1,70 +1,67 @@
1
1
  body {
2
- background-color:#F1EDCF;
3
- }
4
-
5
- body.thumbs {
6
- text-align: center;
2
+ background-color:#F1EDCF;
3
+ text-align: center;
7
4
  }
8
5
 
9
6
  h1,h2,h3 {
10
- color:#667553;
7
+ color:#667553;
11
8
  }
12
9
 
13
- dl {
14
- margin-left: auto;
15
- margin-right: auto;
16
- max-width: 600px;
10
+ dl, table.table {
11
+ margin-left: auto;
12
+ margin-right: auto;
13
+ max-width: 600px;
17
14
  }
18
15
 
19
16
  /* no max-width in IE < 7 */
20
17
  * html dl {
21
- width: 600px;
18
+ width: 600px;
22
19
  }
23
20
 
24
21
  dd {
25
- margin:0;
26
- padding: 0;
27
- width: 130px;
28
- height: 130px;
29
- float: left;
30
- vertical-align: top;
31
- text-align: center;
22
+ margin:0;
23
+ padding: 0;
24
+ width: 130px;
25
+ height: 130px;
26
+ float: left;
27
+ vertical-align: top;
28
+ text-align: center;
32
29
  }
33
30
 
34
31
  div {
35
- margin:0;
32
+ margin:0;
36
33
  }
37
34
 
38
35
  .preview {
39
- background:url(roundedbox_ro.gif) top right no-repeat;
36
+ background:url(roundedbox_ro.gif) top right no-repeat;
40
37
  }
41
38
 
42
39
  .thumb {
43
- margin:0;
44
- background:url(roundedbox_lo.gif) top left no-repeat;
40
+ margin:0;
41
+ background:url(roundedbox_lo.gif) top left no-repeat;
45
42
  }
46
43
 
47
44
  .thumb p {
48
- margin:0;
49
- padding:0;
50
- background:url(roundedbox_ru.gif) bottom right no-repeat;
45
+ margin:0;
46
+ padding:0;
47
+ background:url(roundedbox_ru.gif) bottom right no-repeat;
51
48
  }
52
49
 
53
50
  .thumb p a {
54
- display: block;
55
- background:url(roundedbox_lu.gif) bottom left no-repeat;
56
- padding: 6px 20px 20px 6px;
51
+ display: block;
52
+ background:url(roundedbox_lu.gif) bottom left no-repeat;
53
+ padding: 6px 20px 20px 6px;
57
54
  }
58
55
 
59
56
  img {
60
- border:none;
57
+ border:none;
61
58
  }
62
59
 
63
60
  .image_page img {
64
- max-width: 100%;
61
+ max-width: 100%;
65
62
  }
66
63
 
67
64
  /* IE 6 image height */
68
65
  * html .thumb p a {
69
- padding-bottom: 16px;
66
+ padding-bottom: 16px;
70
67
  }
@@ -1,63 +1,63 @@
1
- body.thumbs {
2
- text-align: center;
1
+ body {
2
+ text-align: center;
3
3
  }
4
4
 
5
5
  div {
6
- margin:0;
6
+ margin:0;
7
7
  }
8
8
 
9
- dl {
10
- margin-left: auto;
11
- margin-right: auto;
12
- max-width: 600px;
9
+ dl, table.table {
10
+ margin-left: auto;
11
+ margin-right: auto;
12
+ max-width: 600px;
13
13
  }
14
14
 
15
15
  /* no max-width in IE < 7 */
16
16
  * html dl {
17
- width: 600px;
17
+ width: 600px;
18
18
  }
19
19
 
20
20
  dd {
21
- margin:0;
22
- padding: 0;
23
- width: 110px;
24
- height: 114px;
25
- float: left;
26
- vertical-align: top;
27
- text-align: center;
21
+ margin:0;
22
+ padding: 0;
23
+ width: 110px;
24
+ height: 114px;
25
+ float: left;
26
+ vertical-align: top;
27
+ text-align: center;
28
28
  }
29
29
 
30
30
  .preview {
31
- background:url(ro.gif) top right no-repeat;
31
+ background:url(ro.gif) top right no-repeat;
32
32
  }
33
33
 
34
34
  .thumb {
35
- background:url(lo.gif) top left no-repeat;
35
+ background:url(lo.gif) top left no-repeat;
36
36
  }
37
37
 
38
38
  .thumb p {
39
- margin:0;
40
- padding:0;
41
- background:url(ru.gif) bottom right no-repeat;
39
+ margin:0;
40
+ padding:0;
41
+ background:url(ru.gif) bottom right no-repeat;
42
42
  }
43
43
 
44
44
  .thumb p a {
45
- display: block;
46
- background: url(lu.gif) bottom left no-repeat;
47
- padding: 0px 9px 9px 0px;
45
+ display: block;
46
+ background: url(lu.gif) bottom left no-repeat;
47
+ padding: 0px 9px 9px 0px;
48
48
  }
49
49
 
50
50
  .thumb p a img {
51
- border:none;
51
+ border:none;
52
52
  }
53
53
 
54
54
  .image_page img {
55
- max-width: 100%;
55
+ max-width: 100%;
56
56
  }
57
57
 
58
58
  /* IE 6 image height */
59
59
  * html .thumb p a {
60
- padding-bottom: 5px;
60
+ padding-bottom: 5px;
61
61
  }
62
62
 
63
63
 
@@ -16,7 +16,7 @@ div {
16
16
  padding:0;
17
17
  }
18
18
 
19
- dl {
19
+ dl, table.table {
20
20
  margin-left: auto;
21
21
  margin-right: auto;
22
22
  max-width: 600px;
@@ -0,0 +1,78 @@
1
+ body {
2
+ text-align: center;
3
+ color:white;
4
+ background: black;
5
+ }
6
+
7
+ a {
8
+ color:yellow;
9
+ }
10
+
11
+ .image_page a {
12
+ margin: 10px;
13
+ }
14
+
15
+ .thumbs dl.table {
16
+ padding-left: 84px;
17
+ }
18
+
19
+ div {
20
+ margin:0;
21
+ padding:0;
22
+ }
23
+
24
+ dl, table.table {
25
+ margin-left: auto;
26
+ margin-right: auto;
27
+ max-width: 600px;
28
+ }
29
+
30
+ /* no max-width in IE < 7 */
31
+ * html dl {
32
+ width: 600px;
33
+ }
34
+
35
+ dd {
36
+ margin: 0px;
37
+ padding: 0;
38
+ width: 128px;
39
+ height: 128px;
40
+ float: left;
41
+ vertical-align: middle;
42
+ text-align: center;
43
+ }
44
+
45
+ .preview {
46
+ background:url(ro.jpg) top right no-repeat;
47
+ }
48
+
49
+ .thumb {
50
+ background:url(lo.jpg) top left no-repeat;
51
+ }
52
+
53
+ .thumb p {
54
+ margin:0;
55
+ padding:0;
56
+ background:url(ru.jpg) bottom right no-repeat;
57
+ }
58
+
59
+ .thumb p a {
60
+ display: block;
61
+ background: url(lu.jpg) bottom left no-repeat;
62
+ padding: 0px;
63
+ padding-right: 28px;
64
+ padding-bottom: 28px;
65
+ }
66
+
67
+ .thumb p a img {
68
+ border:none;
69
+ }
70
+
71
+ .image_page img {
72
+ max-width: 100%;
73
+ }
74
+
75
+ /* IE 6 image height */
76
+ * html .thumb p a {
77
+ padding-bottom: 24px;
78
+ }