Class: Watobo::Plugin::Sslchecker::Gui::CipherTable
- Inherits:
-
FXTable
- Object
- FXTable
- Watobo::Plugin::Sslchecker::Gui::CipherTable
- Defined in:
- plugins/sslchecker/gui/cipher_table.rb
Constant Summary collapse
- CTF_NONE =
0x00
- CTF_GOOD =
0x01
- CTF_BAD =
0x02
- CTF_NA =
0x04
- CTF_ALL =
0x07
Instance Attribute Summary collapse
-
#ciphers ⇒ Object
readonly
Returns the value of attribute ciphers.
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#min_bit_length ⇒ Object
Returns the value of attribute min_bit_length.
Instance Method Summary collapse
- #add_cipher(cipher) ⇒ Object
- #clear_ciphers ⇒ Object
-
#initialize(owner, opts) ⇒ CipherTable
constructor
A new instance of CipherTable.
- #setNewFont(font_type = nil, size = nil) ⇒ Object
- #show_all ⇒ Object
-
#to_csv ⇒ Object
this returns a comma seperated list of the table [string].
- #update_table ⇒ Object
Constructor Details
#initialize(owner, opts) ⇒ CipherTable
Returns a new instance of CipherTable.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 143 def initialize(owner, opts) super(owner, :opts => TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y|TABLE_READONLY|LAYOUT_SIDE_TOP, :padding => 2) @ciphers = [] @min_bit_length = 128 @columns = Hash.new @columns[:cipher] = { :label => "Cipher", :pos => 0, :width => 250 } @columns[:bits] = { :label => "Bits", :pos => 1, :width => 100 } @columns[:result] = { :label => "Result", :pos => 2, :width => 50 } @filter = CTF_ALL init_icons initColumns() adjustCellWidth end |
Instance Attribute Details
#ciphers ⇒ Object (readonly)
Returns the value of attribute ciphers.
77 78 79 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 77 def ciphers @ciphers end |
#filter ⇒ Object
Returns the value of attribute filter.
79 80 81 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 79 def filter @filter end |
#min_bit_length ⇒ Object
Returns the value of attribute min_bit_length.
78 79 80 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 78 def min_bit_length @min_bit_length end |
Instance Method Details
#add_cipher(cipher) ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 112 def add_cipher( cipher ) [ :name, :bits, :result ].each do |k| return false unless cipher.has_key? k end @ciphers.push cipher add_cipher_row(cipher) true end |
#clear_ciphers ⇒ Object
137 138 139 140 141 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 137 def clear_ciphers self.clearItems initColumns @ciphers.clear end |
#setNewFont(font_type = nil, size = nil) ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 93 def setNewFont(font_type=nil, size=nil) begin new_size = size.nil? ? GUI_REGULAR_FONT_SIZE : size new_font_type = font_type.nil? ? "helvetica" : font_type new_font = FXFont.new(getApp(), new_font_type, new_size) new_font.create self.font = new_font self.rowHeader.font = new_font self.defRowHeight = new_size+10 updateTable() rescue => bang puts bang puts bang.backtrace if $DEBUG end end |
#show_all ⇒ Object
124 125 126 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 124 def show_all @filter = CTF_ALL end |
#to_csv ⇒ Object
this returns a comma seperated list of the table [string]
82 83 84 85 86 87 88 89 90 91 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 82 def to_csv csv = "" self.each_row do |c,b,r| csv << c.text.strip << ";" csv << b.text.strip << ";" csv << r.text.strip csv << "\n" end csv end |
#update_table ⇒ Object
128 129 130 131 132 133 134 135 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 128 def update_table # puts "update table: #{filter}" self.clearItems initColumns @ciphers.each do |c| add_cipher_row c end end |