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.
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 144 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[:method] = { :label => "Method", :pos => 0, :width => 50 } @columns[:algo] = { :label => "Cipher", :pos => 1, :width => 250 } @columns[:bits] = { :label => "Bits", :pos => 2, :width => 100 } @columns[:support] = { :label => "Result", :pos => 3, :width => 50 } @filter = CTF_ALL init_icons initColumns() adjustCellWidth end |
Instance Attribute Details
#ciphers ⇒ Object (readonly)
Returns the value of attribute ciphers.
78 79 80 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 78 def ciphers @ciphers end |
#filter ⇒ Object
Returns the value of attribute filter.
80 81 82 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 80 def filter @filter end |
#min_bit_length ⇒ Object
Returns the value of attribute min_bit_length.
79 80 81 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 79 def min_bit_length @min_bit_length end |
Instance Method Details
#add_cipher(cipher) ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 113 def add_cipher( cipher ) [ :method, :algo, :bits, :support ].each do |k| return false unless cipher.has_key? k end @ciphers.push cipher add_cipher_row(cipher) true end |
#clear_ciphers ⇒ Object
138 139 140 141 142 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 138 def clear_ciphers self.clearItems initColumns @ciphers.clear end |
#setNewFont(font_type = nil, size = nil) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 94 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
125 126 127 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 125 def show_all @filter = CTF_ALL end |
#to_csv ⇒ Object
this returns a comma seperated list of the table [string]
83 84 85 86 87 88 89 90 91 92 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 83 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
129 130 131 132 133 134 135 136 |
# File 'plugins/sslchecker/gui/cipher_table.rb', line 129 def update_table # puts "update table: #{filter}" self.clearItems initColumns @ciphers.each do |c| add_cipher_row c end end |