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.
- data/README +167 -0
- data/bin/clickspotter +4 -0
- data/data/worldmap-large.jpg +0 -0
- data/data/worldmap.png +0 -0
- data/lib/About.rb +22 -0
- data/lib/AboutDlg.rb +169 -0
- data/lib/AppConfig.rb +68 -0
- data/lib/AsyncResolverWithCache.rb +207 -0
- data/lib/BrowserLauncher.rb +23 -0
- data/lib/CSListView.rb +118 -0
- data/lib/CSListViewItem.rb +49 -0
- data/lib/ClickableCanvasView.rb +24 -0
- data/lib/Configuration.rb +123 -0
- data/lib/ConfigurationDlg.rb +372 -0
- data/lib/DNSResolver.rb +53 -0
- data/lib/GSServerLogSettings.rb +24 -0
- data/lib/GeoDistView.rb +351 -0
- data/lib/GeoLocator.rb +91 -0
- data/lib/GlobalSettings.rb +237 -0
- data/lib/HitRecord.rb +39 -0
- data/lib/HostNameDlg.rb +83 -0
- data/lib/LogFileSelector.rb +65 -0
- data/lib/LogFileSelectorDlg.rb +97 -0
- data/lib/LogParser.rb +120 -0
- data/lib/MainWindow.rb +627 -0
- data/lib/MainWindowDlg.rb +1054 -0
- data/lib/OccurenceCounter.rb +65 -0
- data/lib/PageInformation.rb +147 -0
- data/lib/PageInformationDlg.rb +159 -0
- data/lib/PageRecord.rb +77 -0
- data/lib/RefererInformation.rb +114 -0
- data/lib/RefererInformationDlg.rb +106 -0
- data/lib/RefererRecord.rb +51 -0
- data/lib/ServerLogSettings.rb +152 -0
- data/lib/ServerLogSettingsDlg.rb +202 -0
- data/lib/StatusCode.rb +72 -0
- data/lib/TraceRouter.rb +53 -0
- data/lib/VisitorInformation.rb +132 -0
- data/lib/VisitorInformationDlg.rb +351 -0
- data/lib/VisitorRecord.rb +94 -0
- data/lib/WorldMap.rb +93 -0
- data/lib/WorldMapDlg.rb +166 -0
- data/lib/clickspotter.rb +38 -0
- metadata +87 -0
@@ -0,0 +1,114 @@
|
|
1
|
+
#
|
2
|
+
# RefererInformation.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: RefererInformation.rb 8 2006-01-22 15:19:51Z cs $
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'RefererInformationDlg'
|
13
|
+
require 'BrowserLauncher'
|
14
|
+
|
15
|
+
class RefererInformation < RefererInformationDlg
|
16
|
+
|
17
|
+
include BrowserLauncher
|
18
|
+
|
19
|
+
slots 'hostClicked(QListViewItem*)',
|
20
|
+
'hitClicked(QListViewItem*)',
|
21
|
+
'openPage()'
|
22
|
+
|
23
|
+
def initialize(referer, parent = nil, name = nil)
|
24
|
+
super(parent, name)
|
25
|
+
|
26
|
+
@referer = referer
|
27
|
+
|
28
|
+
$windowList.push(self)
|
29
|
+
|
30
|
+
setCaption("Referer Information - %s" % referer.url)
|
31
|
+
|
32
|
+
@hostListCSLV = CSListView.new(@hostList)
|
33
|
+
@hostListCSLV.setColumnWidth(0, 400)
|
34
|
+
@hostList.setSorting(1, false)
|
35
|
+
|
36
|
+
@hitListCSLV = CSListView.new(@hitList)
|
37
|
+
@hitListCSLV.setColumnWidth(0, 400)
|
38
|
+
@hitList.setSorting(1, false)
|
39
|
+
|
40
|
+
connect(@hostList, SIGNAL('clicked(QListViewItem*)'),
|
41
|
+
SLOT('hostClicked(QListViewItem*)'))
|
42
|
+
connect(@hitList, SIGNAL('clicked(QListViewItem*)'),
|
43
|
+
SLOT('hitClicked(QListViewItem*)'))
|
44
|
+
connect(@openButton, SIGNAL('clicked()'), SLOT('openPage()'))
|
45
|
+
|
46
|
+
if $globals.getSetting("RefererWindowW") > 0 &&
|
47
|
+
$globals.getSetting("RefererWindowH") > 0
|
48
|
+
resize($globals.getSetting("RefererWindowW"),
|
49
|
+
$globals.getSetting("RefererWindowH"))
|
50
|
+
end
|
51
|
+
|
52
|
+
updateWindow
|
53
|
+
show
|
54
|
+
end
|
55
|
+
|
56
|
+
def updateWindow
|
57
|
+
unless $referers.values.include?(@referer)
|
58
|
+
close(true)
|
59
|
+
return
|
60
|
+
end
|
61
|
+
|
62
|
+
@url.setText(@referer.url)
|
63
|
+
|
64
|
+
visitors = {}
|
65
|
+
hits = {}
|
66
|
+
@referer.hits.each do |h|
|
67
|
+
visitors[h.visitor] = true
|
68
|
+
if not hits.has_key?(h.url)
|
69
|
+
hits[h.url] = 1
|
70
|
+
else
|
71
|
+
hits[h.url] += 1
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Update host list
|
76
|
+
@hostListCSLV.startUpdate
|
77
|
+
visitors.each_key do |v|
|
78
|
+
@hostListCSLV.insertItem(v, v.host, v.pageCount, v.ip, v.browser)
|
79
|
+
end
|
80
|
+
@hostListCSLV.finishUpdate
|
81
|
+
|
82
|
+
# Update hit list
|
83
|
+
@hitListCSLV.startUpdate
|
84
|
+
hits.each do |url, count|
|
85
|
+
@hitListCSLV.insertItem(url, url, count)
|
86
|
+
end
|
87
|
+
@hitListCSLV.finishUpdate
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
def close(dummy)
|
92
|
+
$globals.setSetting("RefererWindowW", width())
|
93
|
+
$globals.setSetting("RefererWindowH", height())
|
94
|
+
$windowList.delete(self)
|
95
|
+
super(true)
|
96
|
+
end
|
97
|
+
|
98
|
+
def hostClicked(item)
|
99
|
+
return if item == nil
|
100
|
+
VisitorInformation.new($visitors[item.text(2) + "|" + item.text(3)])
|
101
|
+
end
|
102
|
+
|
103
|
+
def hitClicked(item)
|
104
|
+
return if item == nil
|
105
|
+
return if !$pages.has_key?(item.text(0))
|
106
|
+
PageInformation.new($pages[item.text(0)])
|
107
|
+
end
|
108
|
+
|
109
|
+
def openPage
|
110
|
+
browseURL(@referer.url)
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
114
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# Form implementation generated from reading ui file 'RefererInformationDlg.ui'
|
2
|
+
#
|
3
|
+
# Created: Mon Jan 23 23:21:52 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 RefererInformationDlg < Qt::Widget
|
12
|
+
|
13
|
+
attr_reader :textLabel1
|
14
|
+
attr_reader :splitter6
|
15
|
+
attr_reader :groupBox7
|
16
|
+
attr_reader :hostList
|
17
|
+
attr_reader :groupBox8
|
18
|
+
attr_reader :hitList
|
19
|
+
attr_reader :url
|
20
|
+
attr_reader :openButton
|
21
|
+
|
22
|
+
|
23
|
+
def initialize(parent = nil, name = nil, fl = 0)
|
24
|
+
super
|
25
|
+
|
26
|
+
if name.nil?
|
27
|
+
setName("RefererInformationDlg")
|
28
|
+
end
|
29
|
+
|
30
|
+
@RefererInformationDlgLayout = Qt::GridLayout.new(self, 1, 1, 11, 6, 'RefererInformationDlgLayout')
|
31
|
+
|
32
|
+
@textLabel1 = Qt::Label.new(self, "textLabel1")
|
33
|
+
|
34
|
+
@RefererInformationDlgLayout.addWidget(@textLabel1, 0, 0)
|
35
|
+
|
36
|
+
@splitter6 = Qt::Splitter.new(self, "splitter6")
|
37
|
+
@splitter6.setOrientation( Qt::Splitter::Vertical )
|
38
|
+
|
39
|
+
@groupBox7 = Qt::GroupBox.new(@splitter6, "groupBox7")
|
40
|
+
@groupBox7.setSizePolicy( Qt::SizePolicy.new(5, 5, 0, 60, @groupBox7.sizePolicy().hasHeightForWidth()) )
|
41
|
+
@groupBox7.setColumnLayout( 0, Qt::Vertical )
|
42
|
+
@groupBox7.layout().setSpacing(6)
|
43
|
+
@groupBox7.layout().setMargin(11)
|
44
|
+
@groupBox7Layout = Qt::GridLayout.new(@groupBox7.layout() )
|
45
|
+
@groupBox7Layout.setAlignment( AlignTop )
|
46
|
+
|
47
|
+
@hostList = Qt::ListView.new(@groupBox7, "hostList")
|
48
|
+
@hostList.addColumn(trUtf8("Host"))
|
49
|
+
@hostList.addColumn(trUtf8("Count"))
|
50
|
+
@hostList.addColumn(trUtf8("IP"))
|
51
|
+
@hostList.addColumn(trUtf8("Browser"))
|
52
|
+
@hostList.setSizePolicy( Qt::SizePolicy.new(7, 7, 0, 0, @hostList.sizePolicy().hasHeightForWidth()) )
|
53
|
+
|
54
|
+
@groupBox7Layout.addWidget(@hostList, 0, 0)
|
55
|
+
|
56
|
+
@groupBox8 = Qt::GroupBox.new(@splitter6, "groupBox8")
|
57
|
+
@groupBox8.setSizePolicy( Qt::SizePolicy.new(5, 5, 0, 40, @groupBox8.sizePolicy().hasHeightForWidth()) )
|
58
|
+
@groupBox8.setColumnLayout( 0, Qt::Vertical )
|
59
|
+
@groupBox8.layout().setSpacing(6)
|
60
|
+
@groupBox8.layout().setMargin(11)
|
61
|
+
@groupBox8Layout = Qt::GridLayout.new(@groupBox8.layout() )
|
62
|
+
@groupBox8Layout.setAlignment( AlignTop )
|
63
|
+
|
64
|
+
@hitList = Qt::ListView.new(@groupBox8, "hitList")
|
65
|
+
@hitList.addColumn(trUtf8("URL"))
|
66
|
+
@hitList.addColumn(trUtf8("Count"))
|
67
|
+
@hitList.setSizePolicy( Qt::SizePolicy.new(7, 7, 0, 0, @hitList.sizePolicy().hasHeightForWidth()) )
|
68
|
+
|
69
|
+
@groupBox8Layout.addWidget(@hitList, 0, 0)
|
70
|
+
|
71
|
+
@RefererInformationDlgLayout.addMultiCellWidget(@splitter6, 1, 1, 0, 2)
|
72
|
+
|
73
|
+
@url = Qt::LineEdit.new(self, "url")
|
74
|
+
@url.setReadOnly( true )
|
75
|
+
|
76
|
+
@RefererInformationDlgLayout.addWidget(@url, 0, 1)
|
77
|
+
|
78
|
+
@openButton = Qt::PushButton.new(self, "openButton")
|
79
|
+
|
80
|
+
@RefererInformationDlgLayout.addWidget(@openButton, 0, 2)
|
81
|
+
languageChange()
|
82
|
+
resize( Qt::Size.new(600, 480).expandedTo(minimumSizeHint()) )
|
83
|
+
clearWState( WState_Polished )
|
84
|
+
end
|
85
|
+
|
86
|
+
#
|
87
|
+
# Sets the strings of the subwidgets using the current
|
88
|
+
# language.
|
89
|
+
#
|
90
|
+
def languageChange()
|
91
|
+
setCaption(trUtf8("Referer Information"))
|
92
|
+
@textLabel1.setText( trUtf8("<b>URL:</b>") )
|
93
|
+
@groupBox7.setTitle( trUtf8("Hosts") )
|
94
|
+
@hostList.header().setLabel( 0, trUtf8("Host") )
|
95
|
+
@hostList.header().setLabel( 1, trUtf8("Count") )
|
96
|
+
@hostList.header().setLabel( 2, trUtf8("IP") )
|
97
|
+
@hostList.header().setLabel( 3, trUtf8("Browser") )
|
98
|
+
@groupBox8.setTitle( trUtf8("Hits") )
|
99
|
+
@hitList.header().setLabel( 0, trUtf8("URL") )
|
100
|
+
@hitList.header().setLabel( 1, trUtf8("Count") )
|
101
|
+
@openButton.setText( trUtf8("Open") )
|
102
|
+
end
|
103
|
+
protected :languageChange
|
104
|
+
|
105
|
+
|
106
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#
|
2
|
+
# RefererRecord.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: RefererRecord.rb 8 2006-01-22 15:19:51Z cs $
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'HitRecord'
|
13
|
+
|
14
|
+
class RefererRecord
|
15
|
+
|
16
|
+
attr_reader :hits, :url
|
17
|
+
|
18
|
+
def initialize(url)
|
19
|
+
@hits = []
|
20
|
+
@url = url
|
21
|
+
end
|
22
|
+
|
23
|
+
def addHit(hit)
|
24
|
+
@hits.push(hit)
|
25
|
+
hit.referer = self
|
26
|
+
end
|
27
|
+
|
28
|
+
def purge(deadline)
|
29
|
+
@hits.each do |h|
|
30
|
+
if h.timeStamp < deadline
|
31
|
+
@hits.delete(h)
|
32
|
+
else
|
33
|
+
return false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
@hits.empty?
|
37
|
+
end
|
38
|
+
|
39
|
+
def hitCount
|
40
|
+
return @hits.length()
|
41
|
+
end
|
42
|
+
|
43
|
+
def external?
|
44
|
+
return @url[0, 1] != '/'
|
45
|
+
end
|
46
|
+
|
47
|
+
def lastHit
|
48
|
+
return @hits[-1]
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
#
|
2
|
+
# ServerLogSettings.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: ServerLogSettings.rb 8 2006-01-22 15:19:51Z cs $
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'ServerLogSettingsDlg'
|
13
|
+
require 'HostNameDlg'
|
14
|
+
|
15
|
+
class ServerLogSettings < ServerLogSettingsDlg
|
16
|
+
|
17
|
+
slots 'selectionChanged(QListViewItem*)'
|
18
|
+
slots 'itemClicked(QListViewItem*)'
|
19
|
+
|
20
|
+
def initialize(settings, parent = nil, name = nil)
|
21
|
+
super(parent, name)
|
22
|
+
|
23
|
+
connect(@hostNameList, SIGNAL('selectionChanged(QListViewItem*)'),
|
24
|
+
SLOT('selectionChanged(QListViewItem*)'))
|
25
|
+
connect(@hostNameList, SIGNAL('clicked(QListViewItem*)'),
|
26
|
+
SLOT('itemClicked(QListViewItem*)'))
|
27
|
+
|
28
|
+
@settings = settings
|
29
|
+
@name.text = settings.name
|
30
|
+
@logFile.text = settings.logFile
|
31
|
+
settings.hostNames.each do |hostName|
|
32
|
+
item = Qt::ListViewItem.new(@hostNameList)
|
33
|
+
item.setText(0, hostName)
|
34
|
+
item.setText(1, settings.default == hostName ? '<-' : '')
|
35
|
+
end
|
36
|
+
|
37
|
+
enableListEditButtons(false)
|
38
|
+
|
39
|
+
show
|
40
|
+
end
|
41
|
+
|
42
|
+
def askForHostName(oldName = nil)
|
43
|
+
dlg = HostNameDlg.new(self)
|
44
|
+
dlg.hostName.text = oldName if oldName
|
45
|
+
dlg.show
|
46
|
+
dlg.exec == Qt::Dialog.Accepted ? dlg.hostName.text : nil
|
47
|
+
end
|
48
|
+
|
49
|
+
def searchBtnClicked
|
50
|
+
fileName = Qt::FileDialog.getOpenFileName("", "", self, "Select Log File",
|
51
|
+
"Choose an Apache Log File");
|
52
|
+
@logFile.setText(fileName)
|
53
|
+
end
|
54
|
+
|
55
|
+
def newBtnClicked
|
56
|
+
if hostName = askForHostName
|
57
|
+
noDefaultYet = hostNameList.firstChild == nil
|
58
|
+
item = Qt::ListViewItem.new(@hostNameList)
|
59
|
+
item.setText(0, hostName)
|
60
|
+
item.setText(1, noDefaultYet ? '<-' : '')
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def editBtnClicked
|
65
|
+
return if !@hostNameList.selectedItem
|
66
|
+
if hostName = askForHostName(@hostNameList.selectedItem.text(0))
|
67
|
+
@hostNameList.selectedItem.setText(0, hostName)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def removeBtnClicked
|
72
|
+
@hostNameList.selectedItem.dispose if @hostNameList.selectedItem
|
73
|
+
enableListEditButtons(false) unless hostNameList.selectedItem
|
74
|
+
end
|
75
|
+
|
76
|
+
def setAsDefaultBtnClicked
|
77
|
+
return if !@hostNameList.selectedItem
|
78
|
+
it = Qt::ListViewItemIterator.new(@hostNameList)
|
79
|
+
while (it.current)
|
80
|
+
it.current.setText(1, it.current == @hostNameList.selectedItem ?
|
81
|
+
'<-' : '')
|
82
|
+
it += 1
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def okBtnClicked
|
87
|
+
# Make sure the selected name is ok
|
88
|
+
if @name.text.empty?
|
89
|
+
Qt::MessageBox.warning(self, "No name set",
|
90
|
+
"You must specify a name.", Qt::MessageBox.Ok, 0)
|
91
|
+
return
|
92
|
+
end
|
93
|
+
$globals.serverLogFiles.each do |slf|
|
94
|
+
if slf.name == @name.text && slf != @settings
|
95
|
+
Qt::MessageBox.warning(self, "Name Conflict",
|
96
|
+
"There is already another log with this name\n" +
|
97
|
+
"Please choose a different name.", Qt::MessageBox.Ok, 0)
|
98
|
+
return
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Check the log file
|
103
|
+
if @logFile.text.empty?
|
104
|
+
Qt::MessageBox.warning(self, "No file set",
|
105
|
+
"You must specify a log file.", Qt::MessageBox.Ok, 0)
|
106
|
+
return
|
107
|
+
end
|
108
|
+
unless File.exist?(@logFile.text)
|
109
|
+
Qt::MessageBox.warning(self, "Invalid log file",
|
110
|
+
"The specified log file does not exist.", Qt::MessageBox.Ok, 0)
|
111
|
+
return
|
112
|
+
end
|
113
|
+
|
114
|
+
# There must be at least one server URL
|
115
|
+
unless @hostNameList.firstChild
|
116
|
+
Qt::MessageBox.warning(self, "No URL defined",
|
117
|
+
"You must specify at least one base URL of the server.",
|
118
|
+
Qt::MessageBox.Ok, 0)
|
119
|
+
return
|
120
|
+
end
|
121
|
+
|
122
|
+
@settings.name = @name.text
|
123
|
+
@settings.logFile = @logFile.text
|
124
|
+
hostNames = []
|
125
|
+
it = Qt::ListViewItemIterator.new(@hostNameList)
|
126
|
+
while (it.current)
|
127
|
+
hostNames << it.current.text(0)
|
128
|
+
@settings.default = it.current.text(0) if it.current.text(1) == '<-'
|
129
|
+
it += 1
|
130
|
+
end
|
131
|
+
@settings.hostNames = hostNames
|
132
|
+
accept
|
133
|
+
end
|
134
|
+
|
135
|
+
def selectionChanged(item)
|
136
|
+
enableListEditButtons(true)
|
137
|
+
end
|
138
|
+
|
139
|
+
def itemClicked(item)
|
140
|
+
enableListEditButtons(false) unless item
|
141
|
+
end
|
142
|
+
|
143
|
+
private
|
144
|
+
|
145
|
+
def enableListEditButtons(enable)
|
146
|
+
@editBtn.setEnabled(enable)
|
147
|
+
@removeBtn.setEnabled(enable)
|
148
|
+
@setAsDefaultBtn.setEnabled(enable)
|
149
|
+
end
|
150
|
+
|
151
|
+
end
|
152
|
+
|
@@ -0,0 +1,202 @@
|
|
1
|
+
# Form implementation generated from reading ui file 'ServerLogSettingsDlg.ui'
|
2
|
+
#
|
3
|
+
# Created: Mon Jan 23 23:21:52 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 ServerLogSettingsDlg < Qt::Dialog
|
12
|
+
|
13
|
+
slots 'languageChange()',
|
14
|
+
'okBtnClicked()',
|
15
|
+
'cancelBtnClicked()',
|
16
|
+
'newBtnClicked()',
|
17
|
+
'editBtnClicked()',
|
18
|
+
'removeBtnClicked()',
|
19
|
+
'searchBtnClicked()',
|
20
|
+
'setAsDefaultBtnClicked()'
|
21
|
+
|
22
|
+
attr_reader :okBtn
|
23
|
+
attr_reader :cancelBtn
|
24
|
+
attr_reader :groupBox3
|
25
|
+
attr_reader :hostNameList
|
26
|
+
attr_reader :textLabel4
|
27
|
+
attr_reader :removeBtn
|
28
|
+
attr_reader :editBtn
|
29
|
+
attr_reader :newBtn
|
30
|
+
attr_reader :setAsDefaultBtn
|
31
|
+
attr_reader :textLabel1
|
32
|
+
attr_reader :logFile
|
33
|
+
attr_reader :searchBtn
|
34
|
+
attr_reader :name
|
35
|
+
attr_reader :textLabel2
|
36
|
+
|
37
|
+
|
38
|
+
def initialize(parent = nil, name = nil, modal = false, fl = 0)
|
39
|
+
super
|
40
|
+
|
41
|
+
if name.nil?
|
42
|
+
setName("ServerLogSettingsDlg")
|
43
|
+
end
|
44
|
+
setSizeGripEnabled(true)
|
45
|
+
|
46
|
+
@ServerLogSettingsDlgLayout = Qt::GridLayout.new(self, 1, 1, 11, 6, 'ServerLogSettingsDlgLayout')
|
47
|
+
|
48
|
+
@Layout1 = Qt::HBoxLayout.new(nil, 0, 6, 'Layout1')
|
49
|
+
@Horizontal_Spacing2 = Qt::SpacerItem.new(20, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
|
50
|
+
@Layout1.addItem(@Horizontal_Spacing2)
|
51
|
+
|
52
|
+
@okBtn = Qt::PushButton.new(self, "okBtn")
|
53
|
+
@okBtn.setAutoDefault( true )
|
54
|
+
@okBtn.setDefault( true )
|
55
|
+
@Layout1.addWidget(@okBtn)
|
56
|
+
|
57
|
+
@cancelBtn = Qt::PushButton.new(self, "cancelBtn")
|
58
|
+
@cancelBtn.setAutoDefault( true )
|
59
|
+
@Layout1.addWidget(@cancelBtn)
|
60
|
+
|
61
|
+
@ServerLogSettingsDlgLayout.addMultiCellLayout(@Layout1, 3, 3, 0, 2)
|
62
|
+
|
63
|
+
@groupBox3 = Qt::GroupBox.new(self, "groupBox3")
|
64
|
+
@groupBox3.setSizePolicy( Qt::SizePolicy.new(5, 3, 0, 0, @groupBox3.sizePolicy().hasHeightForWidth()) )
|
65
|
+
@groupBox3.setColumnLayout( 0, Qt::Vertical )
|
66
|
+
@groupBox3.layout().setSpacing(6)
|
67
|
+
@groupBox3.layout().setMargin(11)
|
68
|
+
@groupBox3Layout = Qt::GridLayout.new(@groupBox3.layout() )
|
69
|
+
@groupBox3Layout.setAlignment( AlignTop )
|
70
|
+
|
71
|
+
@hostNameList = Qt::ListView.new(@groupBox3, "hostNameList")
|
72
|
+
@hostNameList.addColumn(trUtf8("Base URL"))
|
73
|
+
@hostNameList.addColumn(trUtf8("Default"))
|
74
|
+
@hostNameList.setSizePolicy( Qt::SizePolicy.new(7, 7, 0, 100, @hostNameList.sizePolicy().hasHeightForWidth()) )
|
75
|
+
|
76
|
+
@groupBox3Layout.addMultiCellWidget(@hostNameList, 1, 5, 0, 0)
|
77
|
+
|
78
|
+
@textLabel4 = Qt::Label.new(@groupBox3, "textLabel4")
|
79
|
+
|
80
|
+
@groupBox3Layout.addMultiCellWidget(@textLabel4, 0, 0, 0, 1)
|
81
|
+
@spacer4 = Qt::SpacerItem.new(31, 60, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
|
82
|
+
@groupBox3Layout.addItem(@spacer4, 5, 1)
|
83
|
+
|
84
|
+
@removeBtn = Qt::PushButton.new(@groupBox3, "removeBtn")
|
85
|
+
|
86
|
+
@groupBox3Layout.addWidget(@removeBtn, 3, 1)
|
87
|
+
|
88
|
+
@editBtn = Qt::PushButton.new(@groupBox3, "editBtn")
|
89
|
+
|
90
|
+
@groupBox3Layout.addWidget(@editBtn, 2, 1)
|
91
|
+
|
92
|
+
@newBtn = Qt::PushButton.new(@groupBox3, "newBtn")
|
93
|
+
|
94
|
+
@groupBox3Layout.addWidget(@newBtn, 1, 1)
|
95
|
+
|
96
|
+
@setAsDefaultBtn = Qt::PushButton.new(@groupBox3, "setAsDefaultBtn")
|
97
|
+
|
98
|
+
@groupBox3Layout.addWidget(@setAsDefaultBtn, 4, 1)
|
99
|
+
|
100
|
+
@ServerLogSettingsDlgLayout.addMultiCellWidget(@groupBox3, 2, 2, 0, 2)
|
101
|
+
|
102
|
+
@textLabel1 = Qt::Label.new(self, "textLabel1")
|
103
|
+
|
104
|
+
@ServerLogSettingsDlgLayout.addWidget(@textLabel1, 0, 0)
|
105
|
+
|
106
|
+
@logFile = Qt::LineEdit.new(self, "logFile")
|
107
|
+
|
108
|
+
@ServerLogSettingsDlgLayout.addWidget(@logFile, 1, 1)
|
109
|
+
|
110
|
+
@searchBtn = Qt::ToolButton.new(self, "searchBtn")
|
111
|
+
|
112
|
+
@ServerLogSettingsDlgLayout.addWidget(@searchBtn, 1, 2)
|
113
|
+
|
114
|
+
@name = Qt::LineEdit.new(self, "name")
|
115
|
+
|
116
|
+
@ServerLogSettingsDlgLayout.addWidget(@name, 0, 1)
|
117
|
+
|
118
|
+
@textLabel2 = Qt::Label.new(self, "textLabel2")
|
119
|
+
|
120
|
+
@ServerLogSettingsDlgLayout.addWidget(@textLabel2, 1, 0)
|
121
|
+
languageChange()
|
122
|
+
resize( Qt::Size.new(582, 413).expandedTo(minimumSizeHint()) )
|
123
|
+
clearWState( WState_Polished )
|
124
|
+
|
125
|
+
Qt::Object.connect(@okBtn, SIGNAL("clicked()"), self, SLOT("okBtnClicked()") )
|
126
|
+
Qt::Object.connect(@newBtn, SIGNAL("clicked()"), self, SLOT("newBtnClicked()") )
|
127
|
+
Qt::Object.connect(@editBtn, SIGNAL("clicked()"), self, SLOT("editBtnClicked()") )
|
128
|
+
Qt::Object.connect(@removeBtn, SIGNAL("clicked()"), self, SLOT("removeBtnClicked()") )
|
129
|
+
Qt::Object.connect(@searchBtn, SIGNAL("clicked()"), self, SLOT("searchBtnClicked()") )
|
130
|
+
Qt::Object.connect(@setAsDefaultBtn, SIGNAL("clicked()"), self, SLOT("setAsDefaultBtnClicked()") )
|
131
|
+
Qt::Object.connect(@cancelBtn, SIGNAL("clicked()"), self, SLOT("reject()") )
|
132
|
+
|
133
|
+
setTabOrder(@name, @logFile)
|
134
|
+
setTabOrder(@logFile, @hostNameList)
|
135
|
+
setTabOrder(@hostNameList, @newBtn)
|
136
|
+
setTabOrder(@newBtn, @editBtn)
|
137
|
+
setTabOrder(@editBtn, @removeBtn)
|
138
|
+
setTabOrder(@removeBtn, @okBtn)
|
139
|
+
setTabOrder(@okBtn, @cancelBtn)
|
140
|
+
end
|
141
|
+
|
142
|
+
#
|
143
|
+
# Sets the strings of the subwidgets using the current
|
144
|
+
# language.
|
145
|
+
#
|
146
|
+
def languageChange()
|
147
|
+
setCaption(trUtf8("Server Log Settings"))
|
148
|
+
@okBtn.setText( trUtf8("&OK") )
|
149
|
+
@okBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+O")) )
|
150
|
+
@cancelBtn.setText( trUtf8("&Cancel") )
|
151
|
+
@cancelBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+C")) )
|
152
|
+
@groupBox3.setTitle( trUtf8("Base URLs") )
|
153
|
+
@hostNameList.header().setLabel( 0, trUtf8("Base URL") )
|
154
|
+
@hostNameList.header().setLabel( 1, trUtf8("Default") )
|
155
|
+
@textLabel4.setText( trUtf8("The log analyzer needs to know all base URLs of your webserver.\n" +
|
156
|
+
"This is used to differentiate between internal and external referrals.") )
|
157
|
+
@removeBtn.setText( trUtf8("&Remove") )
|
158
|
+
@removeBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+R")) )
|
159
|
+
@editBtn.setText( trUtf8("&Edit ...") )
|
160
|
+
@editBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+E")) )
|
161
|
+
@newBtn.setText( trUtf8("&New ...") )
|
162
|
+
@newBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+N")) )
|
163
|
+
@setAsDefaultBtn.setText( trUtf8("Set as Default") )
|
164
|
+
Qt::ToolTip.add( @setAsDefaultBtn, trUtf8("The default URL will be used when you try to open a local page.") )
|
165
|
+
@textLabel1.setText( trUtf8("Name") )
|
166
|
+
@searchBtn.setText( trUtf8("&Search ...") )
|
167
|
+
@searchBtn.setAccel( Qt::KeySequence.new(trUtf8("Alt+S")) )
|
168
|
+
Qt::ToolTip.add( @name, trUtf8("The name is used to identify each server log. Please use only characters and number, no whitespaces or special characters.") )
|
169
|
+
@textLabel2.setText( trUtf8("Log File") )
|
170
|
+
end
|
171
|
+
protected :languageChange
|
172
|
+
|
173
|
+
|
174
|
+
def okBtnClicked(*k)
|
175
|
+
print("ServerLogSettingsDlg.okBtnClicked(): Not implemented yet.\n")
|
176
|
+
end
|
177
|
+
|
178
|
+
def cancelBtnClicked(*k)
|
179
|
+
print("ServerLogSettingsDlg.cancelBtnClicked(): Not implemented yet.\n")
|
180
|
+
end
|
181
|
+
|
182
|
+
def newBtnClicked(*k)
|
183
|
+
print("ServerLogSettingsDlg.newBtnClicked(): Not implemented yet.\n")
|
184
|
+
end
|
185
|
+
|
186
|
+
def editBtnClicked(*k)
|
187
|
+
print("ServerLogSettingsDlg.editBtnClicked(): Not implemented yet.\n")
|
188
|
+
end
|
189
|
+
|
190
|
+
def removeBtnClicked(*k)
|
191
|
+
print("ServerLogSettingsDlg.removeBtnClicked(): Not implemented yet.\n")
|
192
|
+
end
|
193
|
+
|
194
|
+
def searchBtnClicked(*k)
|
195
|
+
print("ServerLogSettingsDlg.searchBtnClicked(): Not implemented yet.\n")
|
196
|
+
end
|
197
|
+
|
198
|
+
def setAsDefaultBtnClicked(*k)
|
199
|
+
print("ServerLogSettingsDlg.setAsDefaultBtnClicked(): Not implemented yet.\n")
|
200
|
+
end
|
201
|
+
|
202
|
+
end
|