Class: PiggyOptions
- Inherits:
-
Object
- Object
- PiggyOptions
- 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'
- SortByTime =
possible values for @sort_order
'time'
- SortByName =
'name'
Instance Attribute Summary collapse
-
#addJavaFxSlideshow ⇒ Object
(also: #addJavaFxSlideshow?)
Returns the value of attribute addJavaFxSlideshow.
-
#addSlideshow ⇒ Object
(also: #addSlideshow?)
Returns the value of attribute addSlideshow.
-
#addZip ⇒ Object
(also: #addZip?)
Returns the value of attribute addZip.
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#debug ⇒ Object
(also: #debug?)
Returns the value of attribute debug.
-
#excludeFilters ⇒ Object
Returns the value of attribute excludeFilters.
-
#ftpConnectionTimeout ⇒ Object
Returns the value of attribute ftpConnectionTimeout.
-
#ftpHasLocaltime ⇒ Object
(also: #ftpHasLocaltime?)
Returns the value of attribute ftpHasLocaltime.
-
#ftpHost ⇒ Object
Returns the value of attribute ftpHost.
-
#ftpTransferTimeout ⇒ Object
Returns the value of attribute ftpTransferTimeout.
-
#ftpUser ⇒ Object
Returns the value of attribute ftpUser.
-
#generateFramePage ⇒ Object
(also: #generateFramePage?)
Returns the value of attribute generateFramePage.
-
#imageHeight ⇒ Object
Returns the value of attribute imageHeight.
-
#imageWidth ⇒ Object
Returns the value of attribute imageWidth.
-
#localDestinationPath ⇒ Object
Returns the value of attribute localDestinationPath.
-
#namingPatterns ⇒ Object
Returns the value of attribute namingPatterns.
-
#preselectDirectories ⇒ Object
(also: #preselectDirectories?)
Returns the value of attribute preselectDirectories.
-
#remoteDestinationPath ⇒ Object
Returns the value of attribute remoteDestinationPath.
-
#skipImageProcessing ⇒ Object
Returns the value of attribute skipImageProcessing.
-
#slideshowDelay ⇒ Object
Returns the value of attribute slideshowDelay.
-
#sortOrder ⇒ Object
Returns the value of attribute sortOrder.
-
#style ⇒ Object
Returns the value of attribute style.
-
#stylesSample ⇒ Object
(also: #stylesSample?)
Returns the value of attribute stylesSample.
-
#thumbHeight ⇒ Object
Returns the value of attribute thumbHeight.
-
#thumbWidth ⇒ Object
Returns the value of attribute thumbWidth.
-
#useExifComments ⇒ Object
(also: #useExifComments?)
Returns the value of attribute useExifComments.
-
#useLog ⇒ Object
(also: #useLog?)
Returns the value of attribute useLog.
-
#usePreview ⇒ Object
(also: #usePreview?)
Returns the value of attribute usePreview.
-
#useTable ⇒ Object
(also: #useTable?)
Returns the value of attribute useTable.
-
#widescreenWidth ⇒ Object
Returns the value of attribute widescreenWidth.
Instance Method Summary collapse
- #browser? ⇒ Boolean
-
#initialize ⇒ PiggyOptions
constructor
A new instance of PiggyOptions.
-
#initialize_nils_with_default ⇒ Object
(also: #initializeNilsWithDefault)
Public init e.
- #sort_by_time? ⇒ Boolean
- #use_fxruby! ⇒ Object
- #use_fxruby? ⇒ Boolean
- #use_nconvert! ⇒ Object
- #use_nconvert? ⇒ Boolean
- #use_rmagick! ⇒ Object
- #use_rmagick? ⇒ Boolean
Constructor Details
#initialize ⇒ PiggyOptions
Returns a new instance of PiggyOptions.
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 57 58 59 60 61 62 63 64 65 |
# File 'lib/piggy-core/options.rb', line 32 def initialize @usePreview = nil @useLog = nil @useNconvert = nil @imageProcessor = nil @thumbWidth = nil @thumbHeight = nil @imageWidth = nil @widescreenWidth = 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 @useExifComments = nil @excludeFilters = nil @namingPatterns = nil @sortOrder = nil initialize_nils_with_default end |
Instance Attribute Details
#addJavaFxSlideshow ⇒ Object 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 |
#addSlideshow ⇒ Object 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 |
#addZip ⇒ Object 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 |
#browser ⇒ Object
Returns the value of attribute browser.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def browser @browser end |
#debug ⇒ Object 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 |
#excludeFilters ⇒ Object
Returns the value of attribute excludeFilters.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def excludeFilters @excludeFilters end |
#ftpConnectionTimeout ⇒ Object
Returns the value of attribute ftpConnectionTimeout.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def ftpConnectionTimeout @ftpConnectionTimeout end |
#ftpHasLocaltime ⇒ Object 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 |
#ftpHost ⇒ Object
Returns the value of attribute ftpHost.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def ftpHost @ftpHost end |
#ftpTransferTimeout ⇒ Object
Returns the value of attribute ftpTransferTimeout.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def ftpTransferTimeout @ftpTransferTimeout end |
#ftpUser ⇒ Object
Returns the value of attribute ftpUser.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def ftpUser @ftpUser end |
#generateFramePage ⇒ Object 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 |
#imageHeight ⇒ Object
Returns the value of attribute imageHeight.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def imageHeight @imageHeight end |
#imageWidth ⇒ Object
Returns the value of attribute imageWidth.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def imageWidth @imageWidth end |
#localDestinationPath ⇒ Object
Returns the value of attribute localDestinationPath.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def localDestinationPath @localDestinationPath end |
#namingPatterns ⇒ Object
Returns the value of attribute namingPatterns.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def namingPatterns @namingPatterns end |
#preselectDirectories ⇒ Object 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 |
#remoteDestinationPath ⇒ Object
Returns the value of attribute remoteDestinationPath.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def remoteDestinationPath @remoteDestinationPath end |
#skipImageProcessing ⇒ Object
Returns the value of attribute skipImageProcessing.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def skipImageProcessing @skipImageProcessing end |
#slideshowDelay ⇒ Object
Returns the value of attribute slideshowDelay.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def @slideshowDelay end |
#sortOrder ⇒ Object
Returns the value of attribute sortOrder.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def sortOrder @sortOrder end |
#style ⇒ Object
Returns the value of attribute style.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def style @style end |
#stylesSample ⇒ Object 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 |
#thumbHeight ⇒ Object
Returns the value of attribute thumbHeight.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def thumbHeight @thumbHeight end |
#thumbWidth ⇒ Object
Returns the value of attribute thumbWidth.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def thumbWidth @thumbWidth end |
#useExifComments ⇒ Object Also known as: useExifComments?
Returns the value of attribute useExifComments.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def useExifComments @useExifComments end |
#useLog ⇒ Object 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 |
#usePreview ⇒ Object 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 |
#useTable ⇒ Object 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 |
#widescreenWidth ⇒ Object
Returns the value of attribute widescreenWidth.
8 9 10 |
# File 'lib/piggy-core/options.rb', line 8 def widescreenWidth @widescreenWidth end |
Instance Method Details
#browser? ⇒ Boolean
129 130 131 |
# File 'lib/piggy-core/options.rb', line 129 def browser? !@browser.nil? && !@browser.empty? end |
#initialize_nils_with_default ⇒ Object Also known as: initializeNilsWithDefault
Public init e. g. after reading some entries from an older config file.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/piggy-core/options.rb', line 69 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? @widescreenWidth = 700 if @widescreenWidth.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? @useExifComments = false if @useExifComments.nil? @excludeFilters = ['~$', '#$', '^\.'] if @excludeFilters.nil? @namingPatterns = ['IMG_.*', 'DSC.*'] if @namingPatterns.nil? @sortOrder = SortByName if @sortOrder.nil? end |
#sort_by_time? ⇒ Boolean
133 134 135 |
# File 'lib/piggy-core/options.rb', line 133 def sort_by_time? @sortOrder == SortByTime end |
#use_fxruby! ⇒ Object
105 106 107 |
# File 'lib/piggy-core/options.rb', line 105 def use_fxruby! @imageProcessor = ProcessorFxruby end |
#use_fxruby? ⇒ Boolean
109 110 111 |
# File 'lib/piggy-core/options.rb', line 109 def use_fxruby? @imageProcessor == ProcessorFxruby end |
#use_nconvert! ⇒ Object
113 114 115 |
# File 'lib/piggy-core/options.rb', line 113 def use_nconvert! @imageProcessor = ProcessorNconvert end |
#use_nconvert? ⇒ Boolean
117 118 119 |
# File 'lib/piggy-core/options.rb', line 117 def use_nconvert? @imageProcessor == ProcessorNconvert end |
#use_rmagick! ⇒ Object
121 122 123 |
# File 'lib/piggy-core/options.rb', line 121 def use_rmagick! @imageProcessor = ProcessorRmagick end |
#use_rmagick? ⇒ Boolean
125 126 127 |
# File 'lib/piggy-core/options.rb', line 125 def use_rmagick? @imageProcessor == ProcessorRmagick end |