Class: PiggyOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/piggy-core/options.rb

Overview

Provide Piggy with user defined settings.

Constant Summary collapse

ProcessorNconvert =

possible values for @image_processor

'nconvert'
ProcessorFxruby =
'fxruby'
ProcessorRmagick =
'rmagick'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePiggyOptions

Returns a new instance of PiggyOptions.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/piggy-core/options.rb', line 27

def initialize
  @usePreview = nil
  @useLog = nil
  @useNconvert = nil
  @imageProcessor = nil
  @thumbWidth = nil
  @thumbHeight = nil
  @imageWidth = nil
  @imageHeight = nil
  @generateFramePage = nil
  @useTable = nil
  @localDestinationPath = nil
  @remoteDestinationPath = nil
  @ftpUser = nil
  @ftpHost = nil
  @ftpHasLocaltime = nil
  @ftpConnectionTimeout = nil
  @ftpTransferTimeout = nil
  @addZip = nil
  @addSlideshow = nil
  @addJavaFxSlideshow = nil
  @preselectDirectories = nil
  @slideshowDelay = nil
  @style = nil
  @debug = nil
  @browser = nil
  @stylesSample = nil
  @excludeFilters = nil
  initialize_nils_with_default
end

Instance Attribute Details

#addJavaFxSlideshowObject Also known as: addJavaFxSlideshow?

Returns the value of attribute addJavaFxSlideshow.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def addJavaFxSlideshow
  @addJavaFxSlideshow
end

#addSlideshowObject Also known as: addSlideshow?

Returns the value of attribute addSlideshow.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def addSlideshow
  @addSlideshow
end

#addZipObject Also known as: addZip?

Returns the value of attribute addZip.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def addZip
  @addZip
end

#browserObject

Returns the value of attribute browser.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def browser
  @browser
end

#debugObject Also known as: debug?

Returns the value of attribute debug.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def debug
  @debug
end

#excludeFiltersObject

Returns the value of attribute excludeFilters.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def excludeFilters
  @excludeFilters
end

#ftpConnectionTimeoutObject

Returns the value of attribute ftpConnectionTimeout.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def ftpConnectionTimeout
  @ftpConnectionTimeout
end

#ftpHasLocaltimeObject Also known as: ftpHasLocaltime?

Returns the value of attribute ftpHasLocaltime.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def ftpHasLocaltime
  @ftpHasLocaltime
end

#ftpHostObject

Returns the value of attribute ftpHost.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def ftpHost
  @ftpHost
end

#ftpTransferTimeoutObject

Returns the value of attribute ftpTransferTimeout.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def ftpTransferTimeout
  @ftpTransferTimeout
end

#ftpUserObject

Returns the value of attribute ftpUser.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def ftpUser
  @ftpUser
end

#generateFramePageObject Also known as: generateFramePage?

Returns the value of attribute generateFramePage.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def generateFramePage
  @generateFramePage
end

#imageHeightObject

Returns the value of attribute imageHeight.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def imageHeight
  @imageHeight
end

#imageWidthObject

Returns the value of attribute imageWidth.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def imageWidth
  @imageWidth
end

#localDestinationPathObject

Returns the value of attribute localDestinationPath.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def localDestinationPath
  @localDestinationPath
end

#preselectDirectoriesObject Also known as: preselectDirectories?

Returns the value of attribute preselectDirectories.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def preselectDirectories
  @preselectDirectories
end

#remoteDestinationPathObject

Returns the value of attribute remoteDestinationPath.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def remoteDestinationPath
  @remoteDestinationPath
end

#skipImageProcessingObject

Returns the value of attribute skipImageProcessing.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def skipImageProcessing
  @skipImageProcessing
end

#slideshowDelayObject

Returns the value of attribute slideshowDelay.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def slideshowDelay
  @slideshowDelay
end

#styleObject

Returns the value of attribute style.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def style
  @style
end

#stylesSampleObject Also known as: stylesSample?

Returns the value of attribute stylesSample.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def stylesSample
  @stylesSample
end

#thumbHeightObject

Returns the value of attribute thumbHeight.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def thumbHeight
  @thumbHeight
end

#thumbWidthObject

Returns the value of attribute thumbWidth.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def thumbWidth
  @thumbWidth
end

#useLogObject Also known as: useLog?

Returns the value of attribute useLog.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def useLog
  @useLog
end

#usePreviewObject Also known as: usePreview?

Returns the value of attribute usePreview.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def usePreview
  @usePreview
end

#useTableObject Also known as: useTable?

Returns the value of attribute useTable.



8
9
10
# File 'lib/piggy-core/options.rb', line 8

def useTable
  @useTable
end

Instance Method Details

#browser?Boolean

Returns:

  • (Boolean)


116
117
118
# File 'lib/piggy-core/options.rb', line 116

def browser?
  !@browser.nil? && !@browser.empty?
end

#initialize_nils_with_defaultObject Also known as: initializeNilsWithDefault

Public init e. g. after reading some entries from an older config file.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/piggy-core/options.rb', line 60

def initialize_nils_with_default
  @usePreview = false if @usePreview.nil?
  @useLog = false if @useLog.nil?
  @useNconvert = false if @useNconvert.nil?
  if @imageProcessor.nil?
    @imageProcessor = (@useNconvert ? ProcessorNconvert : ProcessorFxruby)
  end
  @thumbWidth = 100 if @thumbWidth.nil?
  @thumbHeight = 100 if @thumbHeight.nil?
  @imageWidth = 600 if @imageWidth.nil?
  @imageHeight = 520 if @imageHeight.nil?
  @generateFramePage = false if @generateFramePage.nil?
  @useTable = generateFramePage? if @uosPathseTable.nil?
  @localDestinationPath = WinShell.instance.picture_directory if @localDestinationPath.nil?
  @remoteDestinationPath = '' if @remoteDestinationPath.nil?
  @ftpUser = 'anonymous' if @ftpUser.nil?
  @ftpHost = 'ftp.blablabla.de' if @ftpHost.nil?
  @ftpHasLocaltime = false if @ftpHasLocaltime.nil?
  @ftpConnectionTimeout = 10 if @ftpConnectionTimeout.nil?
  @ftpTransferTimeout = 30 if @ftpTransferTimeout.nil?
  @addZip = true if @addZip.nil?
  @addSlideshow = true if @addSlideshow.nil?
  @addJavaFxSlideshow = false if @addJavaFxSlideshow.nil?
  @preselectDirectories = true if @preselectDirectories.nil?
  @slideshowDelay = 5 if @slideshowDelay.nil?
  @style = 'shadow' if @style.nil?
  @debug = false if @debug.nil?
  @browser = '' if @browser.nil?
  @stylesSample = false if @stylesSample.nil?
  @excludeFilters = ['~$', '#$', '^\.'] if @excludeFilters.nil?
end

#use_fxruby!Object



92
93
94
# File 'lib/piggy-core/options.rb', line 92

def use_fxruby!
  @imageProcessor = ProcessorFxruby
end

#use_fxruby?Boolean

Returns:

  • (Boolean)


96
97
98
# File 'lib/piggy-core/options.rb', line 96

def use_fxruby?
  @imageProcessor == ProcessorFxruby
end

#use_nconvert!Object



100
101
102
# File 'lib/piggy-core/options.rb', line 100

def use_nconvert!
  @imageProcessor = ProcessorNconvert
end

#use_nconvert?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/piggy-core/options.rb', line 104

def use_nconvert?
  @imageProcessor == ProcessorNconvert
end

#use_rmagick!Object



108
109
110
# File 'lib/piggy-core/options.rb', line 108

def use_rmagick!
  @imageProcessor = ProcessorRmagick
end

#use_rmagick?Boolean

Returns:

  • (Boolean)


112
113
114
# File 'lib/piggy-core/options.rb', line 112

def use_rmagick?
  @imageProcessor == ProcessorRmagick
end