ClickSpotter 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ #
2
+ # BrowserLauncher.rb - ClickSpotter
3
+ #
4
+ # Copyright (c) 2005, 2006 by Chris Schlaeger <cs@kde.org>
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of version 2 of the GNU General Public License as
7
+ # published by the Free Software Foundation.
8
+ #
9
+ # $Id: BrowserLauncher.rb 13 2006-01-23 20:50:55Z cs $
10
+ #
11
+
12
+ module BrowserLauncher
13
+
14
+ def browseURL(url)
15
+ if url[0, 1] == "/"
16
+ url = $globals.defaultServerURL + url
17
+ end
18
+ system($globals.browserCmd + " '" + url + "' &")
19
+ end
20
+
21
+ end
22
+
23
+
@@ -0,0 +1,118 @@
1
+ #
2
+ # CSListView.rb - ClickSpotter
3
+ #
4
+ # Copyright (c) 2005, 2006 by Chris Schlaeger <cs@kde.org>
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of version 2 of the GNU General Public License as
7
+ # published by the Free Software Foundation.
8
+ #
9
+ # $Id: CSListView.rb 8 2006-01-22 15:19:51Z cs $
10
+ #
11
+
12
+ require 'CSListViewItem'
13
+
14
+ class CSListView < Qt::Object
15
+
16
+ slots 'selectionChanged()'
17
+
18
+ attr_reader :selectedItems
19
+
20
+ def initialize(qlv)
21
+ super
22
+ @qlv = qlv
23
+ @state = nil
24
+ @selectedItems = {}
25
+ @itemDict = {}
26
+
27
+ connect(@qlv, SIGNAL('selectionChanged()'), SLOT('selectionChanged()'))
28
+ end
29
+
30
+ def setColumnWidth(col, val)
31
+ @qlv.setColumnWidth(col, val)
32
+ @qlv.setColumnWidthMode(col, 0)
33
+ end
34
+
35
+ def insertItem(itemObj, *entries)
36
+ item = CSListViewItem.new(@qlv)
37
+ item.insert(entries)
38
+
39
+ # Add item to translation dictonary
40
+ @itemDict[item] = itemObj
41
+ if @selectedItems[itemObj] != nil
42
+ item.setSelected(true)
43
+ @selectedItems[itemObj] = true
44
+ end
45
+ end
46
+
47
+ def deleteItem(itemObj)
48
+ @itemDict.delete_if do |key, value|
49
+ if value == itemObj
50
+ key.dispose
51
+ true
52
+ end
53
+ false
54
+ end
55
+ end
56
+
57
+ def startUpdate
58
+ raise "State has not yet been restored" if @state
59
+ @qlv.setUpdatesEnabled(false)
60
+ @qlv.viewport().setUpdatesEnabled(false)
61
+ vPos = @qlv.verticalScrollBar().value()
62
+ hPos = @qlv.horizontalScrollBar().value()
63
+ # Mark all selected items as 'false'. Then we clear the list view and add
64
+ # all items again. The items in the selection lists are then set to
65
+ # 'true'. In finishUpdate() the items that are still false will be removed
66
+ # from the selection list as they are no longer in the list.
67
+ @selectedItems.each { |key, value| @selectedItems[key] = false }
68
+ @itemDict.clear()
69
+ @qlv.clear()
70
+ GC.disable
71
+ @state = [ vPos, hPos ]
72
+ #@start = Time.now()
73
+ end
74
+
75
+ def finishUpdate
76
+ raise "State has not been saved" unless @state
77
+ #puts "Duration: #{Time.now() - @start}"
78
+ GC.enable
79
+ @selectedItems.delete_if { |key, value| !value }
80
+ @qlv.verticalScrollBar().setValue(@state[0])
81
+ @qlv.horizontalScrollBar().setValue(@state[1])
82
+ @qlv.viewport().setUpdatesEnabled(true)
83
+ @qlv.setUpdatesEnabled(true)
84
+ @qlv.triggerUpdate()
85
+ @state = nil
86
+ end
87
+
88
+ def item(qlvItem)
89
+ @itemDict[qlvItem]
90
+ end
91
+
92
+ def items
93
+ @itemDict.values
94
+ end
95
+
96
+ def selectedItemList
97
+ @selectedItems.keys
98
+ end
99
+
100
+ def selectedItem
101
+ return nil if @selectedItems.empty?
102
+ @selectedItems.keys[0]
103
+ end
104
+
105
+ def selectionChanged
106
+ @selectedItems = {}
107
+ if @qlv.selectionMode == Qt::ListView.Single
108
+ @selectedItems = { @itemDict[@qlv.selectedItem] => true }
109
+ else
110
+ it = Qt::ListViewItemIterator.new(@qlv)
111
+ while it.current
112
+ @selectedItems[@itemDict[it.current]] = true if it.current.selected?
113
+ it += 1
114
+ end
115
+ end
116
+ end
117
+
118
+ end
@@ -0,0 +1,49 @@
1
+ #
2
+ # CSListViewItem.rb - ClickSpotter
3
+ #
4
+ # Copyright (c) 2005, 2006 by Chris Schlaeger <cs@kde.org>
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of version 2 of the GNU General Public License as
7
+ # published by the Free Software Foundation.
8
+ #
9
+ # $Id: CSListViewItem.rb 8 2006-01-22 15:19:51Z cs $
10
+ #
11
+
12
+ class CSListViewItem < Qt::ListViewItem
13
+
14
+ attr_reader :values
15
+
16
+ def initialize(parent = nil)
17
+ super
18
+ @values = []
19
+ end
20
+
21
+ def compare(lvi, col, ascending)
22
+ # Workaround for a Qt bug. It seems like it even compares non-existing
23
+ # columns.
24
+ return 0 if col >= @values.size
25
+
26
+ @values[col] <=> lvi.values[col]
27
+ end
28
+
29
+ def insert(entries)
30
+ @values = entries
31
+ 0.upto(entries.size - 1) do |i|
32
+ if entries[i].class == String
33
+ text = entries[i]
34
+ elsif entries[i].class == Fixnum || i.class == Bignum
35
+ text = "%8d" % entries[i]
36
+ elsif entries[i].class == Float
37
+ text = "%5.1f" % entries[i]
38
+ elsif entries[i].class == Time
39
+ text = entries[i].strftime("%H:%M:%S %Y/%m/%d")
40
+ else
41
+ raise "Unsupported type #{entries[i].class} of value #{i}:#{entries[i]}"
42
+ end
43
+ setText(i, text)
44
+ end
45
+ end
46
+
47
+ end
48
+
49
+
@@ -0,0 +1,24 @@
1
+ #
2
+ # ClickableCanvasView.rb - ClickSpotter
3
+ #
4
+ # Copyright (c) 2005, 2006 by Chris Schlaeger <cs@kde.org>
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of version 2 of the GNU General Public License as
7
+ # published by the Free Software Foundation.
8
+ #
9
+ # $Id: ClickableCanvasView.rb 8 2006-01-22 15:19:51Z cs $
10
+ #
11
+
12
+ class ClickableCanvasView < Qt::CanvasView
13
+
14
+ signals 'clicked()'
15
+
16
+ def initialize(canvas, parent = nil, name = nil, wFlags = 0)
17
+ super
18
+ end
19
+
20
+ def mouseReleaseEvent(ev)
21
+ emit clicked
22
+ end
23
+
24
+ end
@@ -0,0 +1,123 @@
1
+ #
2
+ # Configuration.rb - ClickSpotter
3
+ #
4
+ # Copyright (c) 2005, 2006 by Chris Schlaeger <cs@kde.org>
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of version 2 of the GNU General Public License as
7
+ # published by the Free Software Foundation.
8
+ #
9
+ # $Id: Configuration.rb 8 2006-01-22 15:19:51Z cs $
10
+ #
11
+
12
+ require 'ConfigurationDlg'
13
+ require 'ServerLogSettings'
14
+ require 'GlobalSettings'
15
+
16
+ class Configuration < ConfigurationDlg
17
+
18
+ slots 'selectionChanged(QListViewItem*)', 'itemClicked(QListViewItem*)'
19
+
20
+ def initialize(parent = nil, name = nil)
21
+ super(parent)
22
+
23
+ connect(@logList, SIGNAL('selectionChanged(QListViewItem*)'),
24
+ SLOT('selectionChanged(QListViewItem*)'))
25
+ connect(@logList, SIGNAL('clicked(QListViewItem*)'),
26
+ SLOT('itemClicked(QListViewItem*)'))
27
+
28
+ # Server log tab values
29
+ @logListCSLV = CSListView.new(@logList)
30
+ @logList.setSorting(1, true)
31
+
32
+ @logSettings = Array.new($globals.serverLogFiles)
33
+ @logSettings.each { |ls| @logListCSLV.insertItem(ls, ls.name ) }
34
+ enableEditButtons(false)
35
+
36
+ # Other settings
37
+ @browserCommand.text = $globals.getSetting('BrowserCommand')
38
+ @logFileDataTimeout.value = $globals.getSetting('LogFileDataTimeout')
39
+ @logFileEntries.text = "%d" % $hitRecords.size
40
+ @dnsTimeout.value = $globals.getSetting('DNSTimeout')
41
+ @dnsEntries.text = "%d" % $resolver.cacheSize
42
+ @dnsResolverCB.checked = $globals.getSetting('DNSResolver')
43
+ @geolocTimeout.value = $globals.getSetting('GeolocTimeout')
44
+ @geolocEntries.text = "%d" % $geoLocator.cacheSize
45
+ @geolocatorCB.checked = $globals.getSetting('Geolocator')
46
+ @traceRouteTimeout.value = $globals.getSetting('TracerTimeout')
47
+ @traceEntries.text = "%d" % $traceRouter.cacheSize
48
+ @traceRouterCB.checked = $globals.getSetting('TraceRouter')
49
+ @geolocHost.text = $globals.getSetting('GeolocHost')
50
+ @geolocPort.value = $globals.getSetting('GeolocPort')
51
+
52
+ show
53
+ end
54
+
55
+ def newLogBtnClicked
56
+ settings = GSServerLogSettings.new
57
+ if ServerLogSettings.new(settings, self).exec() == Qt::Dialog.Accepted
58
+ @logSettings << settings
59
+ @logListCSLV.insertItem(settings, settings.name)
60
+ end
61
+ end
62
+
63
+ def editLogBtnClicked
64
+ return unless @logList.selectedItem
65
+ settings = @logListCSLV.selectedItemList[0]
66
+ if ServerLogSettings.new(settings, self).exec() == Qt::Dialog.Accepted
67
+ @logList.selectedItem.setText(0, settings.name)
68
+ end
69
+ end
70
+
71
+ def removeLogBtnClicked
72
+ return unless @logList.selectedItem
73
+
74
+ if @logListCSLV.selectedItem == $globals.currentLogFile
75
+ Qt::MessageBox.warning(self, "Illegal action",
76
+ "You cannot remove the active log file", Qt::MessageBox.Ok, 0)
77
+ return
78
+ end
79
+
80
+ @logSettings.delete(@logListCSLV.selectedItem)
81
+ @logListCSLV.deleteItem(@logListCSLV.selectedItem)
82
+ enableEditButtons(false) unless @logList.selectedItem
83
+ end
84
+
85
+ def okBtnClicked
86
+ # Server log tab values
87
+ $globals.serverLogFiles = @logSettings
88
+
89
+ # Other settings
90
+ $globals.setSetting('BrowserCommand', @browserCommand.text)
91
+ $globals.setSetting('LogFileDataTimeout', @logFileDataTimeout.value)
92
+ $globals.setSetting('DNSTimeout', @dnsTimeout.value)
93
+ $globals.setSetting('DNSResolver', @dnsResolverCB.isChecked)
94
+ $resolver.enabled = @dnsResolverCB.isChecked
95
+ $globals.setSetting('GeolocTimeout', @geolocTimeout.value)
96
+ $globals.setSetting('Geolocator', @geolocatorCB.isChecked)
97
+ $geoLocator.enabled = @geolocatorCB.isChecked
98
+ $globals.setSetting('TracerTimeout', @traceRouteTimeout.value)
99
+ $globals.setSetting('TraceRouter', @traceRouterCB.isChecked)
100
+ $traceRouter.enabled = @traceRouterCB.isChecked
101
+ $globals.setSetting('GeolocHost', @geolocHost.text)
102
+ $globals.setSetting('GeolocPort', @geolocPort.value)
103
+
104
+ accept
105
+ end
106
+
107
+ def selectionChanged(item)
108
+ enableEditButtons(true)
109
+ end
110
+
111
+ def itemClicked(item)
112
+ enableEditButtons(false) unless item
113
+ end
114
+
115
+ private
116
+
117
+ def enableEditButtons(enable)
118
+ @editLogBtn.setEnabled(enable)
119
+ @removeLogBtn.setEnabled(enable)
120
+ end
121
+
122
+ end
123
+
@@ -0,0 +1,372 @@
1
+ # Form implementation generated from reading ui file 'ConfigurationDlg.ui'
2
+ #
3
+ # Created: Mon Jan 23 23:21:51 2006
4
+ # by: The QtRuby User Interface Compiler (rbuic)
5
+ #
6
+ # WARNING! All changes made in this file will be lost!
7
+
8
+
9
+ require 'Qt'
10
+
11
+ class ConfigurationDlg < Qt::Dialog
12
+
13
+ slots 'languageChange()',
14
+ 'newLogBtnClicked()',
15
+ 'editLogBtnClicked()',
16
+ 'removeLogBtnClicked()',
17
+ 'okBtnClicked()'
18
+
19
+ attr_reader :tabWidget
20
+ attr_reader :Widget8
21
+ attr_reader :removeLogBtn
22
+ attr_reader :editLogBtn
23
+ attr_reader :newLogBtn
24
+ attr_reader :logList
25
+ attr_reader :Widget9
26
+ attr_reader :groupBox14
27
+ attr_reader :browserCommand
28
+ attr_reader :textLabel2
29
+ attr_reader :groupBox15
30
+ attr_reader :textLabel3
31
+ attr_reader :textLabel6
32
+ attr_reader :dnsEntries
33
+ attr_reader :geolocEntries
34
+ attr_reader :textLabel10
35
+ attr_reader :textLabel8
36
+ attr_reader :textLabel17
37
+ attr_reader :textLabel18
38
+ attr_reader :traceRouteTimeout
39
+ attr_reader :logFileDataTimeout
40
+ attr_reader :textLabel7
41
+ attr_reader :textLabel9
42
+ attr_reader :traceEntries
43
+ attr_reader :logFileEntries
44
+ attr_reader :geolocTimeout
45
+ attr_reader :dnsTimeout
46
+ attr_reader :textLabel1
47
+ attr_reader :traceRouterCB
48
+ attr_reader :geolocatorCB
49
+ attr_reader :dnsResolverCB
50
+ attr_reader :textLabel1_2
51
+ attr_reader :groupBox16
52
+ attr_reader :textLabel13
53
+ attr_reader :textLabel14
54
+ attr_reader :geolocHost
55
+ attr_reader :geolocPort
56
+ attr_reader :textLabel11
57
+ attr_reader :okBtn
58
+ attr_reader :cancelBtn
59
+
60
+
61
+ def initialize(parent = nil, name = nil, modal = false, fl = 0)
62
+ super
63
+
64
+ if name.nil?
65
+ setName("ConfigurationDlg")
66
+ end
67
+ setSizeGripEnabled(true)
68
+
69
+ @ConfigurationDlgLayout = Qt::VBoxLayout.new(self, 11, 6, 'ConfigurationDlgLayout')
70
+
71
+ @tabWidget = Qt::TabWidget.new(self, "tabWidget")
72
+
73
+ @Widget8 = Qt::Widget.new(@tabWidget, "Widget8")
74
+ @Widget8Layout = Qt::GridLayout.new(@Widget8, 1, 1, 11, 6, 'Widget8Layout')
75
+
76
+ @removeLogBtn = Qt::PushButton.new(@Widget8, "removeLogBtn")
77
+
78
+ @Widget8Layout.addWidget(@removeLogBtn, 2, 1)
79
+
80
+ @editLogBtn = Qt::PushButton.new(@Widget8, "editLogBtn")
81
+
82
+ @Widget8Layout.addWidget(@editLogBtn, 1, 1)
83
+
84
+ @newLogBtn = Qt::PushButton.new(@Widget8, "newLogBtn")
85
+
86
+ @Widget8Layout.addWidget(@newLogBtn, 0, 1)
87
+
88
+ @logList = Qt::ListView.new(@Widget8, "logList")
89
+ @logList.addColumn(trUtf8("Server Log"))
90
+
91
+ @Widget8Layout.addMultiCellWidget(@logList, 0, 3, 0, 0)
92
+ @spacer5 = Qt::SpacerItem.new(31, 91, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
93
+ @Widget8Layout.addItem(@spacer5, 3, 1)
94
+ @tabWidget.insertTab(@Widget8, trUtf8("&Web Server Log Files"))
95
+
96
+ @Widget9 = Qt::Widget.new(@tabWidget, "Widget9")
97
+ @Widget9Layout = Qt::GridLayout.new(@Widget9, 1, 1, 11, 6, 'Widget9Layout')
98
+
99
+ @groupBox14 = Qt::GroupBox.new(@Widget9, "groupBox14")
100
+ @groupBox14.setColumnLayout( 0, Qt::Vertical )
101
+ @groupBox14.layout().setSpacing(6)
102
+ @groupBox14.layout().setMargin(11)
103
+ @groupBox14Layout = Qt::GridLayout.new(@groupBox14.layout() )
104
+ @groupBox14Layout.setAlignment( AlignTop )
105
+
106
+ @browserCommand = Qt::LineEdit.new(@groupBox14, "browserCommand")
107
+
108
+ @groupBox14Layout.addWidget(@browserCommand, 1, 0)
109
+
110
+ @textLabel2 = Qt::Label.new(@groupBox14, "textLabel2")
111
+ @textLabel2.setTextFormat( Qt::Label::RichText )
112
+
113
+ @groupBox14Layout.addWidget(@textLabel2, 0, 0)
114
+
115
+ @Widget9Layout.addWidget(@groupBox14, 0, 0)
116
+
117
+ @groupBox15 = Qt::GroupBox.new(@Widget9, "groupBox15")
118
+ @groupBox15.setColumnLayout( 0, Qt::Vertical )
119
+ @groupBox15.layout().setSpacing(6)
120
+ @groupBox15.layout().setMargin(11)
121
+ @groupBox15Layout = Qt::GridLayout.new(@groupBox15.layout() )
122
+ @groupBox15Layout.setAlignment( AlignTop )
123
+
124
+ @textLabel3 = Qt::Label.new(@groupBox15, "textLabel3")
125
+
126
+ @groupBox15Layout.addMultiCellWidget(@textLabel3, 1, 2, 0, 0)
127
+
128
+ @textLabel6 = Qt::Label.new(@groupBox15, "textLabel6")
129
+
130
+ @groupBox15Layout.addMultiCellWidget(@textLabel6, 1, 2, 2, 3)
131
+
132
+ @dnsEntries = Qt::LineEdit.new(@groupBox15, "dnsEntries")
133
+ @dnsEntries.setReadOnly( true )
134
+
135
+ @groupBox15Layout.addWidget(@dnsEntries, 4, 3)
136
+
137
+ @geolocEntries = Qt::LineEdit.new(@groupBox15, "geolocEntries")
138
+ @geolocEntries.setReadOnly( true )
139
+
140
+ @groupBox15Layout.addWidget(@geolocEntries, 5, 3)
141
+
142
+ @textLabel10 = Qt::Label.new(@groupBox15, "textLabel10")
143
+
144
+ @groupBox15Layout.addWidget(@textLabel10, 5, 2)
145
+
146
+ @textLabel8 = Qt::Label.new(@groupBox15, "textLabel8")
147
+
148
+ @groupBox15Layout.addWidget(@textLabel8, 4, 2)
149
+
150
+ @textLabel17 = Qt::Label.new(@groupBox15, "textLabel17")
151
+
152
+ @groupBox15Layout.addWidget(@textLabel17, 3, 0)
153
+
154
+ @textLabel18 = Qt::Label.new(@groupBox15, "textLabel18")
155
+
156
+ @groupBox15Layout.addWidget(@textLabel18, 3, 2)
157
+
158
+ @traceRouteTimeout = Qt::SpinBox.new(@groupBox15, "traceRouteTimeout")
159
+ @traceRouteTimeout.setMaxValue( 168 )
160
+ @traceRouteTimeout.setMinValue( 1 )
161
+ @traceRouteTimeout.setValue( 48 )
162
+
163
+ @groupBox15Layout.addWidget(@traceRouteTimeout, 3, 1)
164
+
165
+ @logFileDataTimeout = Qt::SpinBox.new(@groupBox15, "logFileDataTimeout")
166
+ @logFileDataTimeout.setMaxValue( 168 )
167
+ @logFileDataTimeout.setMinValue( 1 )
168
+ @logFileDataTimeout.setValue( 24 )
169
+
170
+ @groupBox15Layout.addWidget(@logFileDataTimeout, 2, 1)
171
+
172
+ @textLabel7 = Qt::Label.new(@groupBox15, "textLabel7")
173
+
174
+ @groupBox15Layout.addWidget(@textLabel7, 4, 0)
175
+
176
+ @textLabel9 = Qt::Label.new(@groupBox15, "textLabel9")
177
+
178
+ @groupBox15Layout.addWidget(@textLabel9, 5, 0)
179
+
180
+ @traceEntries = Qt::LineEdit.new(@groupBox15, "traceEntries")
181
+ @traceEntries.setReadOnly( true )
182
+
183
+ @groupBox15Layout.addWidget(@traceEntries, 3, 3)
184
+
185
+ @logFileEntries = Qt::LineEdit.new(@groupBox15, "logFileEntries")
186
+ @logFileEntries.setReadOnly( true )
187
+
188
+ @groupBox15Layout.addWidget(@logFileEntries, 2, 3)
189
+
190
+ @geolocTimeout = Qt::SpinBox.new(@groupBox15, "geolocTimeout")
191
+ @geolocTimeout.setMaxValue( 365 )
192
+ @geolocTimeout.setMinValue( 1 )
193
+ @geolocTimeout.setValue( 30 )
194
+
195
+ @groupBox15Layout.addWidget(@geolocTimeout, 5, 1)
196
+
197
+ @dnsTimeout = Qt::SpinBox.new(@groupBox15, "dnsTimeout")
198
+ @dnsTimeout.setMaxValue( 365 )
199
+ @dnsTimeout.setMinValue( 1 )
200
+ @dnsTimeout.setValue( 7 )
201
+
202
+ @groupBox15Layout.addWidget(@dnsTimeout, 4, 1)
203
+ @spacer3 = Qt::SpacerItem.new(310, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
204
+ @groupBox15Layout.addMultiCell(@spacer3, 0, 0, 0, 2)
205
+
206
+ @textLabel1 = Qt::Label.new(@groupBox15, "textLabel1")
207
+
208
+ @groupBox15Layout.addWidget(@textLabel1, 0, 3)
209
+
210
+ @traceRouterCB = Qt::CheckBox.new(@groupBox15, "traceRouterCB")
211
+
212
+ @groupBox15Layout.addWidget(@traceRouterCB, 3, 4)
213
+
214
+ @geolocatorCB = Qt::CheckBox.new(@groupBox15, "geolocatorCB")
215
+
216
+ @groupBox15Layout.addWidget(@geolocatorCB, 5, 4)
217
+
218
+ @dnsResolverCB = Qt::CheckBox.new(@groupBox15, "dnsResolverCB")
219
+
220
+ @groupBox15Layout.addWidget(@dnsResolverCB, 4, 4)
221
+
222
+ @textLabel1_2 = Qt::Label.new(@groupBox15, "textLabel1_2")
223
+
224
+ @groupBox15Layout.addWidget(@textLabel1_2, 0, 4)
225
+
226
+ @Widget9Layout.addWidget(@groupBox15, 1, 0)
227
+
228
+ @groupBox16 = Qt::GroupBox.new(@Widget9, "groupBox16")
229
+ @groupBox16.setColumnLayout( 0, Qt::Vertical )
230
+ @groupBox16.layout().setSpacing(6)
231
+ @groupBox16.layout().setMargin(11)
232
+ @groupBox16Layout = Qt::GridLayout.new(@groupBox16.layout() )
233
+ @groupBox16Layout.setAlignment( AlignTop )
234
+
235
+ @textLabel13 = Qt::Label.new(@groupBox16, "textLabel13")
236
+
237
+ @groupBox16Layout.addWidget(@textLabel13, 1, 0)
238
+
239
+ @textLabel14 = Qt::Label.new(@groupBox16, "textLabel14")
240
+
241
+ @groupBox16Layout.addWidget(@textLabel14, 1, 2)
242
+
243
+ @geolocHost = Qt::LineEdit.new(@groupBox16, "geolocHost")
244
+
245
+ @groupBox16Layout.addWidget(@geolocHost, 1, 1)
246
+
247
+ @geolocPort = Qt::SpinBox.new(@groupBox16, "geolocPort")
248
+ @geolocPort.setMaxValue( 32767 )
249
+ @geolocPort.setMinValue( 1 )
250
+ @geolocPort.setValue( 80 )
251
+
252
+ @groupBox16Layout.addWidget(@geolocPort, 1, 3)
253
+
254
+ @textLabel11 = Qt::Label.new(@groupBox16, "textLabel11")
255
+ @textLabel11.setTextFormat( Qt::Label::RichText )
256
+
257
+ @groupBox16Layout.addMultiCellWidget(@textLabel11, 0, 0, 0, 3)
258
+
259
+ @Widget9Layout.addWidget(@groupBox16, 2, 0)
260
+ @tabWidget.insertTab(@Widget9, trUtf8("&Settings"))
261
+ @ConfigurationDlgLayout.addWidget(@tabWidget)
262
+
263
+ @Layout1 = Qt::HBoxLayout.new(nil, 0, 6, 'Layout1')
264
+ @Horizontal_Spacing2 = Qt::SpacerItem.new(20, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
265
+ @Layout1.addItem(@Horizontal_Spacing2)
266
+
267
+ @okBtn = Qt::PushButton.new(self, "okBtn")
268
+ @okBtn.setAutoDefault( true )
269
+ @okBtn.setDefault( true )
270
+ @Layout1.addWidget(@okBtn)
271
+
272
+ @cancelBtn = Qt::PushButton.new(self, "cancelBtn")
273
+ @cancelBtn.setAutoDefault( true )
274
+ @Layout1.addWidget(@cancelBtn)
275
+ @ConfigurationDlgLayout.addLayout(@Layout1)
276
+ languageChange()
277
+ resize( Qt::Size.new(562, 587).expandedTo(minimumSizeHint()) )
278
+ clearWState( WState_Polished )
279
+
280
+ Qt::Object.connect(@newLogBtn, SIGNAL("clicked()"), self, SLOT("newLogBtnClicked()") )
281
+ Qt::Object.connect(@editLogBtn, SIGNAL("clicked()"), self, SLOT("editLogBtnClicked()") )
282
+ Qt::Object.connect(@removeLogBtn, SIGNAL("clicked()"), self, SLOT("removeLogBtnClicked()") )
283
+ Qt::Object.connect(@okBtn, SIGNAL("clicked()"), self, SLOT("okBtnClicked()") )
284
+ Qt::Object.connect(@cancelBtn, SIGNAL("clicked()"), self, SLOT("reject()") )
285
+
286
+ setTabOrder(@tabWidget, @logList)
287
+ setTabOrder(@logList, @newLogBtn)
288
+ setTabOrder(@newLogBtn, @editLogBtn)
289
+ setTabOrder(@editLogBtn, @removeLogBtn)
290
+ setTabOrder(@removeLogBtn, @okBtn)
291
+ setTabOrder(@okBtn, @cancelBtn)
292
+ setTabOrder(@cancelBtn, @browserCommand)
293
+ setTabOrder(@browserCommand, @logFileDataTimeout)
294
+ setTabOrder(@logFileDataTimeout, @logFileEntries)
295
+ setTabOrder(@logFileEntries, @traceRouteTimeout)
296
+ setTabOrder(@traceRouteTimeout, @traceEntries)
297
+ setTabOrder(@traceEntries, @traceRouterCB)
298
+ setTabOrder(@traceRouterCB, @dnsTimeout)
299
+ setTabOrder(@dnsTimeout, @dnsEntries)
300
+ setTabOrder(@dnsEntries, @dnsResolverCB)
301
+ setTabOrder(@dnsResolverCB, @geolocTimeout)
302
+ setTabOrder(@geolocTimeout, @geolocEntries)
303
+ setTabOrder(@geolocEntries, @geolocatorCB)
304
+ setTabOrder(@geolocatorCB, @geolocHost)
305
+ setTabOrder(@geolocHost, @geolocPort)
306
+ end
307
+
308
+ #
309
+ # Sets the strings of the subwidgets using the current
310
+ # language.
311
+ #
312
+ def languageChange()
313
+ setCaption(trUtf8("Click Spotter Configuration"))
314
+ @removeLogBtn.setText( trUtf8("&Remove") )
315
+ @removeLogBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+R")) )
316
+ @editLogBtn.setText( trUtf8("&Edit ...") )
317
+ @editLogBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+E")) )
318
+ @newLogBtn.setText( trUtf8("&New ...") )
319
+ @newLogBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+N")) )
320
+ @logList.header().setLabel( 0, trUtf8("Server Log") )
321
+ @tabWidget.changeTab( @Widget8, trUtf8("&Web Server Log Files") )
322
+ @groupBox14.setTitle( trUtf8("Browser Command") )
323
+ @textLabel2.setText( trUtf8("Click Spotter can call your browser to open pages that it has found in the\n" +
324
+ "log file. Please specify the command that is needed to open your browser.\n" +
325
+ "The URL of the page will be automatically appended to this command.") )
326
+ @groupBox15.setTitle( trUtf8("Remote Lookups and their Expiration Times") )
327
+ @textLabel3.setText( trUtf8("Log File Data") )
328
+ @textLabel6.setText( trUtf8("hours") )
329
+ @textLabel10.setText( trUtf8("days") )
330
+ @textLabel8.setText( trUtf8("days") )
331
+ @textLabel17.setText( trUtf8("Trace Route") )
332
+ @textLabel18.setText( trUtf8("hours") )
333
+ @textLabel7.setText( trUtf8("DNS Lookups") )
334
+ @textLabel9.setText( trUtf8("Geolocation Records") )
335
+ @textLabel1.setText( trUtf8("Currently Cache Entries") )
336
+ @traceRouterCB.setText( trUtf8("Enabled") )
337
+ @geolocatorCB.setText( trUtf8("Enabled") )
338
+ @dnsResolverCB.setText( trUtf8("Enabled") )
339
+ @textLabel1_2.setText( trUtf8("Remote Lookups") )
340
+ @groupBox16.setTitle( trUtf8("Geolocation Server") )
341
+ @textLabel13.setText( trUtf8("Host Name") )
342
+ @textLabel14.setText( trUtf8("Port") )
343
+ @textLabel11.setText( trUtf8("The program uses an external server to query for geolocation information\n" +
344
+ "by the IP number of the monitored visitors. The default is <u>api.hostip.info</u> but you can use any other server\n" +
345
+ "as long as it provides the same data exchange format. Please visit the hostip.info web page\n" +
346
+ "at <u>http://www.hostip.info</u> for more information about Geolocation.") )
347
+ @tabWidget.changeTab( @Widget9, trUtf8("&Settings") )
348
+ @okBtn.setText( trUtf8("&OK") )
349
+ @okBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+O")) )
350
+ @cancelBtn.setText( trUtf8("&Cancel") )
351
+ @cancelBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+C")) )
352
+ end
353
+ protected :languageChange
354
+
355
+
356
+ def newLogBtnClicked(*k)
357
+ print("ConfigurationDlg.newLogBtnClicked(): Not implemented yet.\n")
358
+ end
359
+
360
+ def editLogBtnClicked(*k)
361
+ print("ConfigurationDlg.editLogBtnClicked(): Not implemented yet.\n")
362
+ end
363
+
364
+ def removeLogBtnClicked(*k)
365
+ print("ConfigurationDlg.removeLogBtnClicked(): Not implemented yet.\n")
366
+ end
367
+
368
+ def okBtnClicked(*k)
369
+ print("ConfigurationDlg.okBtnClicked(): Not implemented yet.\n")
370
+ end
371
+
372
+ end