43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
# File 'lib/watobo/gui/quick_scan_dialog.rb', line 43
def initialize(owner, prefs = {} )
super(owner, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
@csrf_ids = []
@csrf_patterns = []
@target_chat = prefs[:target_chat]
@useOriginalRequest = FXCheckButton.new(self, "Use original request", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
@useOriginalRequest.checkState = true
@followRedirects = FXCheckButton.new(self, "Follow redirects", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
@followRedirects.checkState = false
@detectLogout = FXCheckButton.new(self, "Autom. login when logged out", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
@detectLogout.checkState = false
frame = FXGroupBox.new(self, "Logging", LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
@logScanChats = FXCheckButton.new(frame, "Log Scan", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
@logScanChats.checkState = false
@logScanChats.connect(SEL_COMMAND) do |sender, sel, item|
if @logScanChats.checked? then
@scanlog_name_text.enabled = true
@scanlog_dir_label.enabled = true
else
@scanlog_name_text.enabled = false
@scanlog_dir_label.enabled = false
end
end
@scanlog_name_dt = FXDataTarget.new('')
@scanlog_dir_label = FXLabel.new(frame, "Scan-Name:" )
scanlog_frame = FXHorizontalFrame.new(frame,:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
@scanlog_name_text = FXTextField.new(scanlog_frame, 20,
:target => @scanlog_name_dt, :selector => FXDataTarget::ID_VALUE,
:opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN|LAYOUT_FILL_X)
@scanlog_name_text.handle(self, FXSEL(SEL_UPDATE, 0), nil)
@scanlog_name_text.enabled = false
@scanlog_dir_label.enabled = false
frame = FXGroupBox.new(self, "One-Time-Token Settings", LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
csrf_frame = FXHorizontalFrame.new(frame,:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP, :padding => 0)
@csrfToken = FXCheckButton.new(csrf_frame, "Update One-Time-Tokens", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
@csrfToken.checkState = prefs.has_key?(:enable_one_time_tokens) ? prefs[:enable_one_time_tokens] : false
@csrfToken.connect(SEL_COMMAND) do |sender, sel, item|
if @csrfToken.checked? then
@csrf_dialog_btn.enable
else
@csrf_dialog_btn.disable
end
end
@csrf_dialog_btn = FXButton.new(csrf_frame, "O-T-T Settings")
@csrf_dialog_btn.connect(SEL_COMMAND, method(:openCSRFTokenDialog))
@csrf_dialog_btn.disable
@csrf_dialog_btn.enable if @csrfToken.checked?
end
|