Merge lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer into lp:~zeitgeist/zeitgeist-explorer/trunk

Proposed by dhananjaysathe
Status: Merged
Merged at revision: 14
Proposed branch: lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer
Merge into: lp:~zeitgeist/zeitgeist-explorer/trunk
Diff against target: 765 lines (+190/-264)
5 files modified
zgexplorer/eventwidgets.py (+133/-168)
zgexplorer/filtermanager.py (+18/-28)
zgexplorer/monitorviewer.py (+13/-27)
zgexplorer/templates.py (+3/-3)
zgexplorer/window.py (+23/-38)
To merge this branch: bzr merge lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer
Reviewer Review Type Date Requested Status
Manish Sinha (मनीष सिन्हा) Approve
Review via email: mp+97531@code.launchpad.net

Description of the change

Gtk3 code refactoring

To post a comment you must log in.
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

Looks excellent!

review: Approve
14. By dhananjaysathe

Modified the code to use new style Gtk3, no other changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore' (properties changed: -x to +x)
=== modified file 'zgexplorer/__init__.py' (properties changed: -x to +x)
=== modified file 'zgexplorer/eventwidgets.py' (properties changed: -x to +x)
--- zgexplorer/eventwidgets.py 2012-03-12 20:57:29 +0000
+++ zgexplorer/eventwidgets.py 2012-03-14 22:39:19 +0000
@@ -9,12 +9,12 @@
9# under the terms of the GNU Lesser General Public License as published9# under the terms of the GNU Lesser General Public License as published
10# by the Free Software Foundation, either version 2 of the License, or10# by the Free Software Foundation, either version 2 of the License, or
11# (at your option) any later version.11# (at your option) any later version.
12# 12#
13# This program is distributed in the hope that it will be useful, but13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16# See the GNU Lesser General Public License for more details.16# See the GNU Lesser General Public License for more details.
17# 17#
18# You should have received a copy of the GNU Lesser General Public License18# You should have received a copy of the GNU Lesser General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.";19# along with this program. If not, see <http://www.gnu.org/licenses/>.";
20#20#
@@ -30,59 +30,38 @@
30 super(TimeRangeViewer, self).__init__()30 super(TimeRangeViewer, self).__init__()
3131
32 timerange_label = Gtk.Label("Time Range")32 timerange_label = Gtk.Label("Time Range")
33 self.pack_start(timerange_label, False, False, 12)33 self.pack_start(timerange_label,False,False,12)
3434
35 self.always_radio = Gtk.RadioButton()35 self.always_radio = Gtk.RadioButton(label= "Always",margin_left= 24)
36 self.always_radio.set_label("Always")36 self.pack_start(self.always_radio,False,False,12)
37 self.always_radio.set_margin_left(24)37
38 self.pack_start(self.always_radio, False, False, 12)38 self.custom_radio = Gtk.RadioButton(label= "Custom",margin_left= 24)
3939 self.custom_radio.join_group(self.always_radio)
40 self.custom_radio = Gtk.RadioButton.new_from_widget(self.always_radio)40 self.pack_start(self.custom_radio,False,False,12)
41 self.custom_radio.set_label("Custom")
42 self.custom_radio.set_margin_left(24)
43 self.pack_start(self.custom_radio, False, False, 12)
44
4541
4642
47class TemplateViewer(Gtk.VBox):43class TemplateViewer(Gtk.VBox):
48 def __init__(self):44 def __init__(self):
49 super(TemplateViewer, self).__init__()45 super(TemplateViewer, self).__init__()
5046
51 self.table = Gtk.Table(10, 2, False)47 self.table = Gtk.Table(10, 2, False,border_width=1)
52 self.table.set_border_width(1)
53 self.pack_start(self.table, True, True, 0)48 self.pack_start(self.table, True, True, 0)
5449
55 event_label = Gtk.Label()50 event_label = Gtk.Label()
56 event_label.set_markup("Event")51 event_label.set_markup("Event")
57 self.table.attach(event_label, 0, 2, 0, 1, xpadding=6, ypadding=6)
5852
59 # Event Interpretation53 # Event Interpretation
60 event_inter_label = Gtk.Label("Interpretation")54 event_inter_label = Gtk.Label("Interpretation")
61 self.table.attach(event_inter_label, 0, 1, 1, 2, xpadding=6, ypadding=6)55 self.event_inter_entry = Gtk.Entry(width_chars=40)
62 self.event_inter_entry = Gtk.Entry()
63 self.event_inter_entry.set_width_chars(40)
64 self.table.attach(self.event_inter_entry, 1, 2, 1, 2, xpadding=6, ypadding=6)
6556
66 # Event Manifesation57 # Event Manifesation
67 event_manifes_label = Gtk.Label("Manifestation")58 event_manifes_label = Gtk.Label("Manifestation")
68 self.table.attach(event_manifes_label, 0, 1, 2, 3, xpadding=6, ypadding=6)59 self.event_manifes_entry = Gtk.Entry(width_chars=40)
69 self.event_manifes_entry = Gtk.Entry()
70 self.event_manifes_entry.set_width_chars(40)
71 self.table.attach(self.event_manifes_entry, 1, 2, 2, 3, xpadding=6, ypadding=6)
72
73 # Event Actor
74 #actor_hbox = Gtk.HBox()
75 #actor_hbox.set_margin_bottom(6)
76 #self.table.attach(actor_hbox, 0, 2, 3, 4)
7760
78 actor_label = Gtk.Label("Actor")61 actor_label = Gtk.Label("Actor")
79 self.table.attach(actor_label, 0, 1, 3, 4, xpadding=6, ypadding=6)62 self.actor_entry = Gtk.Entry(width_chars=40)
80 self.actor_entry = Gtk.Entry()63
81 self.table.attach(self.actor_entry, 1, 2, 3, 4, xpadding=6, ypadding=6)64 actor_hbox = Gtk.HBox(margin_bottom=6)
82
83 actor_hbox = Gtk.HBox()
84 actor_hbox.set_margin_bottom(6)
85 self.table.attach(actor_hbox, 1, 2, 4, 5, xpadding=6, ypadding=6)
86 self.actor_button = Gtk.Button()65 self.actor_button = Gtk.Button()
87 self.actor_button.set_size_request(32, 32)66 self.actor_button.set_size_request(32, 32)
88 actor_hbox.pack_start(self.actor_button, False, False, 12)67 actor_hbox.pack_start(self.actor_button, False, False, 12)
@@ -91,38 +70,46 @@
9170
92 subj_label = Gtk.Label()71 subj_label = Gtk.Label()
93 subj_label.set_markup("Subject")72 subj_label.set_markup("Subject")
94 self.table.attach(subj_label, 0, 2, 5, 6, xpadding=6, ypadding=6)
9573
9674
97 # Subject Interpretation75 # Subject Interpretation
98 subj_inter_label = Gtk.Label("Interpretation")76 subj_inter_label = Gtk.Label("Interpretation")
99 self.table.attach(subj_inter_label, 0, 1, 6, 7, xpadding=6, ypadding=6)77 self.subj_inter_entry = Gtk.Entry(width_chars=40)
100 self.subj_inter_entry = Gtk.Entry()
101 self.subj_inter_entry.set_width_chars(40)
102 self.table.attach(self.subj_inter_entry, 1, 2, 6, 7, xpadding=6, ypadding=6)
10378
104 # Subject Manifesation79 # Subject Manifesation
105 subj_manifes_label = Gtk.Label("Manifestation")80 subj_manifes_label = Gtk.Label("Manifestation")
106 self.table.attach(subj_manifes_label, 0, 1, 7, 8, xpadding=6, ypadding=6)81 self.subj_manifes_entry = Gtk.Entry(width_chars=40)
107 self.subj_manifes_entry = Gtk.Entry()
108 self.subj_manifes_entry.set_width_chars(40)
109 self.table.attach(self.subj_manifes_entry, 1, 2, 7, 8, xpadding=6, ypadding=6)
11082
111 # Mimetype83 # Mimetype
112 mimetype_label = Gtk.Label("Mimetype")84 mimetype_label = Gtk.Label("Mimetype")
113 self.table.attach(mimetype_label, 0, 1, 8, 9, xpadding=6, ypadding=6)85 self.mimetype_entry = Gtk.Entry(width_chars=40)
114 self.mimetype_entry = Gtk.Entry()86
115 self.mimetype_entry.set_width_chars(40)
116 self.table.attach(self.mimetype_entry, 1, 2, 8, 9, xpadding=6, ypadding=6)
117
118 # Storage87 # Storage
119 storage_label = Gtk.Label("Storage")88 storage_label = Gtk.Label("Storage")
120 self.table.attach(storage_label, 0, 1, 9, 10, xpadding=6, ypadding=6)89 self.storage_entry = Gtk.Entry(width_chars=40)
121 self.storage_entry = Gtk.Entry()90
122 self.storage_entry.set_width_chars(40)91 attach_list = (
123 self.table.attach(self.storage_entry, 1, 2, 9, 10, xpadding=6, ypadding=6)92 (event_label,(0, 2, 0, 1)),
124 93 (event_inter_label,(0, 1, 1, 2)),
125 self.show_all()94 (self.event_inter_entry,(1, 2, 1, 2)),
95 (event_manifes_label,(0, 1, 2, 3)),
96 (self.event_manifes_entry,(1, 2, 2, 3)),
97 (actor_label,(0, 1, 3, 4)),
98 (self.actor_entry,(1, 2, 3, 4)),
99 (actor_hbox,(1, 2, 4, 5)),
100 (subj_label,(0, 2, 5, 6)),
101 (subj_inter_label,(0, 1, 6, 7)),
102 (self.subj_inter_entry,(1, 2, 6, 7)),
103 (subj_manifes_label,(0, 1, 7, 8)),
104 (self.subj_manifes_entry,(1, 2, 7, 8)),
105 (mimetype_label,(0, 1, 8, 9)),
106 (self.mimetype_entry,(1, 2, 8, 9)),
107 (storage_label,(0, 1, 9, 10)),
108 (self.storage_entry,(1, 2, 9, 10))
109 )
110 for widget_entry in attach_list :
111 widget,pos = widget_entry
112 self.table.attach(widget,pos[0],pos[1], pos[2], pos[3], xpadding=6, ypadding=6)
126113
127 def set_fields_enable(self, enable):114 def set_fields_enable(self, enable):
128 self.event_inter_entry.set_sensitive(enable)115 self.event_inter_entry.set_sensitive(enable)
@@ -178,10 +165,10 @@
178 if type(subj_inter) is Symbol else "")165 if type(subj_inter) is Symbol else "")
179 self.subj_inter_entry.set_tooltip_text(subj_inter.doc \166 self.subj_inter_entry.set_tooltip_text(subj_inter.doc \
180 if type(subj_inter) is Symbol else "")167 if type(subj_inter) is Symbol else "")
181 168
182 # Event Manifestation169 # Event Manifestation
183 subj_manifes = subj.get_manifestation()170 subj_manifes = subj.get_manifestation()
184 self.subj_manifes_entry.set_text(subj_manifes.name 171 self.subj_manifes_entry.set_text(subj_manifes.name
185 if type(subj_manifes) is Symbol else "")172 if type(subj_manifes) is Symbol else "")
186 self.subj_manifes_entry.set_tooltip_text(subj_manifes.doc \173 self.subj_manifes_entry.set_tooltip_text(subj_manifes.doc \
187 if type(subj_manifes) is Symbol else "")174 if type(subj_manifes) is Symbol else "")
@@ -194,136 +181,114 @@
194 def __init__(self):181 def __init__(self):
195 super(EventViewer, self).__init__()182 super(EventViewer, self).__init__()
196183
197 self.table = Gtk.Table(18, 4, False)184 self.table = Gtk.Table(18, 4, False,border_width=1)
198 self.pack_start(self.table, False, False, 6)185 self.pack_start(self.table, False, False, 6)
199 self.table.set_border_width(1)
200186
201 id_label = Gtk.Label()187 id_label = Gtk.Label(xalign=0,yalign=0.5)
202 id_label.set_markup("<b>%s</b>" %("Event ID"))188 id_label.set_markup("<b>%s</b>" %("Event ID"))
203 id_label.set_alignment(0, 0.5)189
204 self.table.attach(id_label, 0, 1, 0, 1, xpadding = 6, ypadding =6 )190 self.id_entry = Gtk.Label(xalign=0,yalign=0.5)
205191
206 self.id_entry = Gtk.Label()192 time_label = Gtk.Label(xalign=0,yalign=0.5)
207 self.id_entry.set_alignment(0, 0.5)
208 self.table.attach(self.id_entry, 1, 2, 0, 1, xpadding = 6, ypadding =6)
209
210 time_label = Gtk.Label()
211 time_label.set_markup("<b>%s</b>" %("Timestamp"))193 time_label.set_markup("<b>%s</b>" %("Timestamp"))
212 time_label.set_alignment(0, 0.5)194
213 self.table.attach(time_label, 2, 3, 0, 1, xpadding = 6, ypadding = 6)195 self.time_entry = Gtk.Label(xalign=0,yalign=0.5)
214196
215 self.time_entry = Gtk.Label()197 event_int_label = Gtk.Label(xalign=0,yalign=0.5)
216 self.time_entry.set_alignment(0, 0.5)
217 self.table.attach(self.time_entry, 3, 4, 0, 1, xpadding = 6, ypadding = 6)
218
219 event_int_label = Gtk.Label()
220 event_int_label.set_markup("<b>%s</b>" %("Interpretation"))198 event_int_label.set_markup("<b>%s</b>" %("Interpretation"))
221 event_int_label.set_alignment(0, 0.5)199
222 self.table.attach(event_int_label, 0, 1, 1, 2, xpadding = 6, ypadding = 6)200 self.event_int_entry = Gtk.Label(xalign=0,yalign=0.5)
223201
224 self.event_int_entry = Gtk.Label()202 event_manifes_label = Gtk.Label(xalign=0,yalign=0.5)
225 self.event_int_entry.set_alignment(0, 0.5)
226 self.table.attach(self.event_int_entry, 1, 4, 1, 2, xpadding = 6, ypadding = 6)
227
228 event_manifes_label = Gtk.Label()
229 event_manifes_label.set_markup("<b>%s</b>" %("Manifestation"))203 event_manifes_label.set_markup("<b>%s</b>" %("Manifestation"))
230 event_manifes_label.set_alignment(0, 0.5)204
231 self.table.attach(event_manifes_label, 0, 1, 2, 3, xpadding = 6, ypadding = 6)205 self.event_manifes_entry = Gtk.Label(xalign=0,yalign=0.5)
232206
233 self.event_manifes_entry = Gtk.Label()207 actor_label = Gtk.Label(xalign=0,yalign=0.5)
234 self.event_manifes_entry.set_alignment(0, 0.5)
235 self.table.attach(self.event_manifes_entry, 1, 4, 2, 3, xpadding = 6, ypadding = 6)
236
237 actor_label = Gtk.Label()
238 actor_label.set_markup("<b>%s</b>" %("Actor"))208 actor_label.set_markup("<b>%s</b>" %("Actor"))
239 actor_label.set_alignment(0, 0.5)
240 self.table.attach(actor_label, 0, 1, 3, 4, xpadding = 6, ypadding = 6)
241209
242 self.actor_entry = Gtk.Label()210 self.actor_entry = Gtk.Label(xalign=0,yalign=0.5)
243 self.actor_entry.set_alignment(0, 0.5)
244 self.table.attach(self.actor_entry, 1, 2, 3, 4, xpadding = 6, ypadding =6)
245211
246 actor_box = Gtk.HBox()212 actor_box = Gtk.HBox()
247 self.table.attach(actor_box, 2, 4, 3, 4, xpadding = 6, ypadding = 6)213 self.image_entry = Gtk.Image(xalign=0,yalign=0.5)
248 self.image_entry = Gtk.Image()
249 self.image_entry.set_alignment(0, 0.5)
250 actor_box.pack_start(self.image_entry, False, False, 6)214 actor_box.pack_start(self.image_entry, False, False, 6)
251 self.actor_name_entry = Gtk.Label()215 self.actor_name_entry = Gtk.Label(xalign=0,yalign=0.5)
252 self.actor_name_entry.set_alignment(0, 0.5)
253 actor_box.pack_start(self.actor_name_entry, False, False, 6)216 actor_box.pack_start(self.actor_name_entry, False, False, 6)
254217
255 uri_label = Gtk.Label()218 uri_label = Gtk.Label(xalign=0,yalign=0.5)
256 uri_label.set_markup("<b>%s</b>" %("URI"))219 uri_label.set_markup("<b>%s</b>" %("URI"))
257 uri_label.set_alignment(0, 0.5)220
258 self.table.attach(uri_label, 0, 1, 4, 5, xpadding = 6, ypadding = 6)221 self.uri_entry = Gtk.Label(xalign=0,yalign=0.5)
259222
260 self.uri_entry = Gtk.Label()223 current_uri_label = Gtk.Label(xalign=0,yalign=0.5)
261 self.uri_entry.set_alignment(0, 0.5)
262 self.table.attach(self.uri_entry, 1, 4, 4, 5, xpadding = 6, ypadding = 6)
263
264 current_uri_label = Gtk.Label()
265 current_uri_label.set_markup("<b>%s</b>" %("Current URI"))224 current_uri_label.set_markup("<b>%s</b>" %("Current URI"))
266 current_uri_label.set_alignment(0, 0.5)225
267 self.table.attach(current_uri_label, 0, 1, 5, 6, xpadding = 6, ypadding = 6)226 self.current_uri_entry = Gtk.Label(xalign=0,yalign=0.5)
268 227
269 self.current_uri_entry = Gtk.Label()228 subj_int_label = Gtk.Label(xalign=0,yalign=0.5)
270 self.current_uri_entry.set_alignment(0, 0.5)
271 self.table.attach(self.current_uri_entry, 1, 4, 5, 6, xpadding = 6, ypadding = 6)
272
273 subj_int_label = Gtk.Label()
274 subj_int_label.set_markup("<b>%s</b>" %("Interpretation"))229 subj_int_label.set_markup("<b>%s</b>" %("Interpretation"))
275 subj_int_label.set_alignment(0, 0.5)230
276 self.table.attach(subj_int_label, 0, 1, 6, 7, xpadding = 6, ypadding = 6)231 self.subj_int_entry = Gtk.Label(xalign=0,yalign=0.5)
277232
278 self.subj_int_entry = Gtk.Label()233 subj_manifes_label = Gtk.Label(xalign=0,yalign=0.5)
279 self.subj_int_entry.set_alignment(0, 0.5)
280 self.table.attach(self.subj_int_entry, 1, 4, 6, 7, xpadding = 6, ypadding = 6)
281
282 subj_manifes_label = Gtk.Label()
283 subj_manifes_label.set_markup("<b>%s</b>" %("Manifestation"))234 subj_manifes_label.set_markup("<b>%s</b>" %("Manifestation"))
284 subj_manifes_label.set_alignment(0, 0.5)235
285 self.table.attach(subj_manifes_label, 0, 1, 7, 8, xpadding = 6, ypadding = 6)236 self.subj_manifes_entry = Gtk.Label(xalign=0,yalign=0.5)
286237
287 self.subj_manifes_entry = Gtk.Label()238
288 self.subj_manifes_entry.set_alignment(0, 0.5)239 origin_label = Gtk.Label(xalign=0,yalign=0.5)
289 self.table.attach(self.subj_manifes_entry, 1, 4, 7, 8, xpadding = 6, ypadding = 6)
290
291
292 origin_label = Gtk.Label()
293 origin_label.set_markup("<b>%s</b>" %("Origin"))240 origin_label.set_markup("<b>%s</b>" %("Origin"))
294 origin_label.set_alignment(0, 0.5)241
295 self.table.attach(origin_label, 0, 1, 8, 9, xpadding = 6, ypadding = 6)242 self.origin_entry = Gtk.Label(xalign=0,yalign=0.5)
296243
297 self.origin_entry = Gtk.Label()244 mimetype_label = Gtk.Label(xalign=0,yalign=0.5)
298 self.origin_entry.set_alignment(0, 0.5)
299 self.table.attach(self.origin_entry, 1, 2, 8, 9, xpadding = 6, ypadding =6)
300
301 mimetype_label = Gtk.Label()
302 mimetype_label.set_markup("<b>%s</b>" %("Mimetype"))245 mimetype_label.set_markup("<b>%s</b>" %("Mimetype"))
303 mimetype_label.set_alignment(0, 0.5)246
304 self.table.attach(mimetype_label, 2, 3, 8, 9, xpadding = 6, ypadding = 6)247 self.mime_entry = Gtk.Label(xalign=0,yalign=0.5)
305248
306 self.mime_entry = Gtk.Label()249 text_label = Gtk.Label(xalign=0,yalign=0.5)
307 self.mime_entry.set_alignment(0, 0.5)
308 self.table.attach(self.mime_entry, 3, 4, 8, 9, xpadding = 6, ypadding = 6)
309
310 text_label = Gtk.Label()
311 text_label.set_markup("<b>%s</b>" %("Text"))250 text_label.set_markup("<b>%s</b>" %("Text"))
312 text_label.set_alignment(0, 0.5)251
313 self.table.attach(text_label, 0, 1, 9, 10, xpadding = 6, ypadding = 6)252 self.text_entry = Gtk.Label(xalign=0,yalign=0.5)
314253
315 self.text_entry = Gtk.Label()254 storage_label = Gtk.Label(xalign=0,yalign=0.5)
316 self.text_entry.set_alignment(0, 0.5)
317 self.table.attach(self.text_entry, 1, 2, 9, 10, xpadding = 6, ypadding =6)
318
319 storage_label = Gtk.Label()
320 storage_label.set_markup("<b>%s</b>" %("Storage"))255 storage_label.set_markup("<b>%s</b>" %("Storage"))
321 storage_label.set_alignment(0, 0.5)256
322 self.table.attach(storage_label, 2, 3, 9, 10, xpadding = 6, ypadding = 6)257 self.storage_entry = Gtk.Label(xalign=0,yalign=0.5)
323 258
324 self.storage_entry = Gtk.Label()259 attach_list = (
325 self.storage_entry.set_alignment(0, 0.5)260 (id_label,(0, 1, 0, 1)),
326 self.table.attach(self.storage_entry, 3, 4, 9, 10, xpadding = 6, ypadding = 6)261 (self.id_entry,(1, 2, 0, 1)),
262 (time_label,(2, 3, 0, 1)),
263 (self.time_entry,(3, 4, 0, 1)),
264 (event_int_label,(0, 1, 1, 2)),
265 (self.event_int_entry,(1, 4, 1, 2)),
266 (event_manifes_label,(0, 1, 2, 3)),
267 (self.event_manifes_entry,(1, 4, 2, 3)),
268 (actor_label,(0, 1, 3, 4)),
269 (self.actor_entry,(1, 2, 3, 4)),
270 (actor_box,(2, 4, 3, 4)),
271 (uri_label,(0, 1, 4, 5)),
272 (self.uri_entry,(1, 4, 4, 5)),
273 (current_uri_label,(0, 1, 5, 6)),
274 (self.current_uri_entry,(1, 4, 5, 6)),
275 (subj_int_label,(0, 1, 6, 7)),
276 (self.subj_int_entry,(1, 4, 6, 7)),
277 (subj_manifes_label,(0, 1, 7, 8)),
278 (self.subj_manifes_entry,(1, 4, 7, 8)),
279 (origin_label,(0, 1, 8, 9)),
280 (self.origin_entry,(1, 2, 8, 9)),
281 (mimetype_label,(2, 3, 8, 9)),
282 (self.mime_entry,(3, 4, 8, 9)),
283 (text_label,(0, 1, 9, 10)),
284 (self.text_entry,(1, 2, 9, 10)),
285 (storage_label,(2, 3, 9, 10)),
286 (self.storage_entry,(3, 4, 9, 10))
287 )
288 for widget_entry in attach_list :
289 widget,pos = widget_entry
290 self.table.attach(widget,pos[0],pos[1], pos[2], pos[3], xpadding=6, ypadding=6)
291
327292
328293
329 def map(self, event):294 def map(self, event):
330295
=== modified file 'zgexplorer/filtermanager.py' (properties changed: -x to +x)
--- zgexplorer/filtermanager.py 2012-03-13 20:59:11 +0000
+++ zgexplorer/filtermanager.py 2012-03-14 22:39:19 +0000
@@ -9,12 +9,12 @@
9# under the terms of the GNU Lesser General Public License as published9# under the terms of the GNU Lesser General Public License as published
10# by the Free Software Foundation, either version 2 of the License, or10# by the Free Software Foundation, either version 2 of the License, or
11# (at your option) any later version.11# (at your option) any later version.
12# 12#
13# This program is distributed in the hope that it will be useful, but13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16# See the GNU Lesser General Public License for more details.16# See the GNU Lesser General Public License for more details.
17# 17#
18# You should have received a copy of the GNU Lesser General Public License18# You should have received a copy of the GNU Lesser General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.";19# along with this program. If not, see <http://www.gnu.org/licenses/>.";
20#20#
@@ -29,15 +29,13 @@
29 def __init__(self):29 def __init__(self):
30 super(FilterManagerDialog, self).__init__()30 super(FilterManagerDialog, self).__init__()
31 self.set_destroy_with_parent(True)31 self.set_destroy_with_parent(True)
32 self.set_title("Filter Manager")32 self.set_properties('title',"Filter Manager",'margin',12,'content-area-spacing',6) #Check Value
33 self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)33 self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
34 self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)34 self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
35 self.set_size_request(600, 700)35 self.set_size_request(600, 700)
36 self.spacing = 636
37 self.margin = 1237 box = self.get_content_area()
3838
39 box = self.get_content_area()
40
41 self.notebook = Gtk.Notebook()39 self.notebook = Gtk.Notebook()
42 box.pack_start(self.notebook, True, True, 0)40 box.pack_start(self.notebook, True, True, 0)
4341
@@ -49,7 +47,7 @@
49 def add_predefined_tab(self):47 def add_predefined_tab(self):
50 self.predefined_box = Gtk.VBox()48 self.predefined_box = Gtk.VBox()
51 self.notebook.append_page(self.predefined_box, Gtk.Label("Predefined Filter"))49 self.notebook.append_page(self.predefined_box, Gtk.Label("Predefined Filter"))
52 50
53 self.predefined_store = Gtk.ListStore(int, str)51 self.predefined_store = Gtk.ListStore(int, str)
54 self.builtin = BuiltInFilters()52 self.builtin = BuiltInFilters()
55 for i in self.builtin:53 for i in self.builtin:
@@ -59,22 +57,18 @@
59 self.predefined_view.connect("cursor-changed", self.on_cursor_changed)57 self.predefined_view.connect("cursor-changed", self.on_cursor_changed)
60 column_pix_name = Gtk.TreeViewColumn(_('Name'))58 column_pix_name = Gtk.TreeViewColumn(_('Name'))
61 self.predefined_view.append_column(column_pix_name)59 self.predefined_view.append_column(column_pix_name)
62 name_rend = Gtk.CellRendererText()60 name_rend = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
63 name_rend.set_property("ellipsize", Pango.EllipsizeMode.END)
64 column_pix_name.pack_start(name_rend, False)61 column_pix_name.pack_start(name_rend, False)
65 column_pix_name.add_attribute(name_rend, "markup", 1)62 column_pix_name.add_attribute(name_rend, "markup", 1)
66 column_pix_name.set_resizable(True)63 column_pix_name.set_resizable(True)
6764
68 self.predefined_view.set_headers_visible(False)65 self.predefined_view.set_properties('headers-visible',False,'rules-hint',True)
69 self.predefined_view.set_rules_hint(True)66
70 67 self.predefined_scroll = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN,border_width=1)
71 self.predefined_scroll = Gtk.ScrolledWindow()
72 self.predefined_scroll.add(self.predefined_view)68 self.predefined_scroll.add(self.predefined_view)
73 self.predefined_scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)69 self.predefined_scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
74 self.predefined_scroll.set_shadow_type(Gtk.ShadowType.IN)
75 self.predefined_scroll.set_border_width(1)
76 self.predefined_box.pack_start(self.predefined_scroll, True, True, 6)70 self.predefined_box.pack_start(self.predefined_scroll, True, True, 6)
77 71
78 # See the Template values72 # See the Template values
79 self.predefined_viewer = TemplateViewer()73 self.predefined_viewer = TemplateViewer()
80 self.predefined_viewer.set_fields_enable(False)74 self.predefined_viewer.set_fields_enable(False)
@@ -91,22 +85,18 @@
9185
92 column_pix_name = Gtk.TreeViewColumn(_('Name'))86 column_pix_name = Gtk.TreeViewColumn(_('Name'))
93 self.custom_view.append_column(column_pix_name)87 self.custom_view.append_column(column_pix_name)
94 name_rend = Gtk.CellRendererText()88 name_rend = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
95 name_rend.set_property("ellipsize", Pango.EllipsizeMode.END)
96 column_pix_name.pack_start(name_rend, False)89 column_pix_name.pack_start(name_rend, False)
97 column_pix_name.add_attribute(name_rend, "markup", 1)90 column_pix_name.add_attribute(name_rend, "markup", 1)
98 column_pix_name.set_resizable(True)91 column_pix_name.set_resizable(True)
9992
100 self.custom_view.set_headers_visible(False)93 self.custom_view.set_properties('headers-visible',False,'rules-hint',True)
101 self.custom_view.set_rules_hint(True)94
102 95 self.custom_scroll = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN,border_width=1)
103 self.custom_scroll = Gtk.ScrolledWindow()
104 self.custom_scroll.add(self.custom_view)96 self.custom_scroll.add(self.custom_view)
105 self.custom_scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)97 self.custom_scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
106 self.custom_scroll.set_shadow_type(Gtk.ShadowType.IN)
107 self.custom_scroll.set_border_width(1)
108 self.custom_box.pack_start(self.custom_scroll, True, True, 6)98 self.custom_box.pack_start(self.custom_scroll, True, True, 6)
109 99
110 # See the Template values100 # See the Template values
111 self.custom_viewer = TemplateViewer()101 self.custom_viewer = TemplateViewer()
112 self.custom_viewer.set_fields_enable(False)102 self.custom_viewer.set_fields_enable(False)
@@ -140,7 +130,7 @@
140 def on_cursor_changed(self, treeview):130 def on_cursor_changed(self, treeview):
141 index = self.get_selected_index()131 index = self.get_selected_index()
142 if index is not None:132 if index is not None:
143 self.predefined_viewer.set_values(self.builtin[index]) 133 self.predefined_viewer.set_values(self.builtin[index])
144134
145 def on_custom_cursor_changed(self, treeview):135 def on_custom_cursor_changed(self, treeview):
146 pass136 pass
147137
=== modified file 'zgexplorer/monitorviewer.py' (properties changed: -x to +x)
--- zgexplorer/monitorviewer.py 2012-03-12 20:57:29 +0000
+++ zgexplorer/monitorviewer.py 2012-03-14 22:39:19 +0000
@@ -9,12 +9,12 @@
9# under the terms of the GNU Lesser General Public License as published9# under the terms of the GNU Lesser General Public License as published
10# by the Free Software Foundation, either version 2 of the License, or10# by the Free Software Foundation, either version 2 of the License, or
11# (at your option) any later version.11# (at your option) any later version.
12# 12#
13# This program is distributed in the hope that it will be useful, but13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16# See the GNU Lesser General Public License for more details.16# See the GNU Lesser General Public License for more details.
17# 17#
18# You should have received a copy of the GNU Lesser General Public License18# You should have received a copy of the GNU Lesser General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.";19# along with this program. If not, see <http://www.gnu.org/licenses/>.";
20#20#
@@ -45,50 +45,36 @@
4545
46 self.spacing = 646 self.spacing = 6
47 self.margin = 1247 self.margin = 12
48 48
49 self.builtin = BuiltInFilters()49 self.builtin = BuiltInFilters()
5050
51 #desc_label = Gtk.Label()51 self.desc_entry = Gtk.Label(xalign=0,yalign=0,wrap=True)
52 #desc_label.set_alignment(0, 0)
53 #desc_label.set_markup("<b>%s</b>" %("Description"))
54 #self.pack_start(desc_label, False, False, 6)
55
56 self.desc_entry = Gtk.Label()
57 self.desc_entry.set_alignment(0, 0)
58 self.desc_entry.set_line_wrap(True)
59 self.desc_entry.set_line_wrap_mode(Pango.WrapMode.WORD)
60 self.pack_start(self.desc_entry, False, False, 6)52 self.pack_start(self.desc_entry, False, False, 6)
6153
6254
63 # ButtonBox55 # ButtonBox
64 self.button_box = Gtk.HButtonBox()56 self.button_box = Gtk.HButtonBox(False)
65 self.button_box.set_homogeneous(False)
66 self.button_box.set_layout(Gtk.ButtonBoxStyle.START)57 self.button_box.set_layout(Gtk.ButtonBoxStyle.START)
67 self.pack_start(self.button_box, False, False, 6)58 self.pack_start(self.button_box, False, False, 6)
6859
69 self.start = Gtk.Button()60 self.start = Gtk.Button(image=Gtk.Image.new_from_stock(
70 self.start.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_PLAY, 61 Gtk.STOCK_MEDIA_PLAY,Gtk.IconSize.BUTTON))
71 Gtk.IconSize.BUTTON))
72 self.start.connect("clicked", self.start_monitor)62 self.start.connect("clicked", self.start_monitor)
73 self.button_box.pack_start(self.start, False, False, 6)63 self.button_box.pack_start(self.start, False, False, 6)
7464
75 self.stop = Gtk.Button()65 self.stop = Gtk.Button(image= Gtk.Image.new_from_stock(
76 self.stop.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_STOP,66 Gtk.STOCK_MEDIA_STOP,Gtk.IconSize.BUTTON))
77 Gtk.IconSize.BUTTON))
78 self.stop.connect("clicked", self.stop_monitor)67 self.stop.connect("clicked", self.stop_monitor)
79 self.stop.set_sensitive(False)68 self.stop.set_sensitive(False)
80 self.button_box.pack_start(self.stop, False, False, 6)69 self.button_box.pack_start(self.stop, False, False, 6)
8170
82 self.clear = Gtk.Button()71 self.clear = Gtk.Button(image=Gtk.Image.new_from_stock(
83 self.clear.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_CLEAR,72 Gtk.STOCK_CLEAR,Gtk.IconSize.BUTTON))
84 Gtk.IconSize.BUTTON))
85 self.clear.connect("clicked", self.clear_events)73 self.clear.connect("clicked", self.clear_events)
86 self.button_box.pack_start(self.clear, False, False, 6)74 self.button_box.pack_start(self.clear, False, False, 6)
8775
88 self.scroll = Gtk.ScrolledWindow(None, None)76 self.scroll = Gtk.ScrolledWindow(None, None,border_width=1,shadow_type=Gtk.ShadowType.IN)
89 self.scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)77 self.scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
90 self.scroll.set_shadow_type(Gtk.ShadowType.IN)
91 self.scroll.set_border_width(1)
92 self.pack_start(self.scroll, True, True, 6)78 self.pack_start(self.scroll, True, True, 6)
9379
94 # Event Id, TimeStamp, Interpretation, Manifestation, Actor80 # Event Id, TimeStamp, Interpretation, Manifestation, Actor
@@ -156,7 +142,7 @@
156142
157 timestamp = int(str(event.get_timestamp()))143 timestamp = int(str(event.get_timestamp()))
158 time = datetime.fromtimestamp(timestamp/1000).strftime("%Y-%m-%d %I:%M:%S %p")144 time = datetime.fromtimestamp(timestamp/1000).strftime("%Y-%m-%d %I:%M:%S %p")
159 145
160 actor = event.get_actor()146 actor = event.get_actor()
161147
162 event_inter = str(event.get_interpretation())148 event_inter = str(event.get_interpretation())
163149
=== modified file 'zgexplorer/templates.py' (properties changed: -x to +x)
--- zgexplorer/templates.py 2012-03-10 13:39:20 +0000
+++ zgexplorer/templates.py 2012-03-14 22:39:19 +0000
@@ -9,12 +9,12 @@
9# under the terms of the GNU Lesser General Public License as published9# under the terms of the GNU Lesser General Public License as published
10# by the Free Software Foundation, either version 2 of the License, or10# by the Free Software Foundation, either version 2 of the License, or
11# (at your option) any later version.11# (at your option) any later version.
12# 12#
13# This program is distributed in the hope that it will be useful, but13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16# See the GNU Lesser General Public License for more details.16# See the GNU Lesser General Public License for more details.
17# 17#
18# You should have received a copy of the GNU Lesser General Public License18# You should have received a copy of the GNU Lesser General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.";19# along with this program. If not, see <http://www.gnu.org/licenses/>.";
20#20#
@@ -31,7 +31,7 @@
31 template1,\31 template1,\
32 TimeRange.always(), \32 TimeRange.always(), \
33 ResultType.MostRecentEvents]33 ResultType.MostRecentEvents]
34 34
35 template2 = Event.new_for_values(interpretation = \35 template2 = Event.new_for_values(interpretation = \
36 Interpretation.ACCESS_EVENT)36 Interpretation.ACCESS_EVENT)
37 self[1] = ["Access Events", \37 self[1] = ["Access Events", \
3838
=== modified file 'zgexplorer/window.py' (properties changed: -x to +x)
--- zgexplorer/window.py 2012-03-13 20:59:11 +0000
+++ zgexplorer/window.py 2012-03-14 22:39:19 +0000
@@ -9,12 +9,12 @@
9# under the terms of the GNU Lesser General Public License as published9# under the terms of the GNU Lesser General Public License as published
10# by the Free Software Foundation, either version 2 of the License, or10# by the Free Software Foundation, either version 2 of the License, or
11# (at your option) any later version.11# (at your option) any later version.
12# 12#
13# This program is distributed in the hope that it will be useful, but13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16# See the GNU Lesser General Public License for more details.16# See the GNU Lesser General Public License for more details.
17# 17#
18# You should have received a copy of the GNU Lesser General Public License18# You should have received a copy of the GNU Lesser General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.";19# along with this program. If not, see <http://www.gnu.org/licenses/>.";
20#20#
@@ -34,7 +34,7 @@
34 self.connect("destroy", Gtk.main_quit)34 self.connect("destroy", Gtk.main_quit)
35 self.set_title("Zeitgeist Explorer")35 self.set_title("Zeitgeist Explorer")
36 self.set_size_request(1400, 900)36 self.set_size_request(1400, 900)
37 37
38 self.client = ZeitgeistClient()38 self.client = ZeitgeistClient()
3939
40 main_box = Gtk.VBox()40 main_box = Gtk.VBox()
@@ -45,19 +45,15 @@
45 toolbar = Gtk.Toolbar()45 toolbar = Gtk.Toolbar()
4646
47 # New Tool Item47 # New Tool Item
48 toolitem_new = Gtk.ToolButton()48 toolitem_new = Gtk.ToolButton(label="New",icon_name="add")
49 toolitem_new.set_label("New")
50 toolitem_new.set_icon_name("add")
51 toolitem_new.connect("clicked", self.toolitem_new_clicked)49 toolitem_new.connect("clicked", self.toolitem_new_clicked)
52 toolbar.insert(toolitem_new, -1)50 toolbar.insert(toolitem_new, -1)
5351
54 # Load Tool Item52 # Load Tool Item
55 toolitem_load = Gtk.ToolButton()53 toolitem_load = Gtk.ToolButton(stock_id=Gtk.STOCK_OPEN,label="Load")
56 toolitem_load.set_stock_id(Gtk.STOCK_OPEN)54 toolitem_load.connect("clicked", self.toolitem_load_clicked)
57 toolitem_load.set_label("Load")
58 toolitem_load.connect("clicked", self.toolitem_load_clicked)
59 toolbar.insert(toolitem_load, -1)55 toolbar.insert(toolitem_load, -1)
60 56
61 #main_box.pack_start(toolbar, False, True, 0)57 #main_box.pack_start(toolbar, False, True, 0)
6258
63 self.filter_manager = FilterManagerDialog()59 self.filter_manager = FilterManagerDialog()
@@ -84,7 +80,7 @@
8480
8581
86class MonitorWindow(Gtk.VBox):82class MonitorWindow(Gtk.VBox):
87 83
88 monitor_builtin = {}84 monitor_builtin = {}
89 monitor_custom = {}85 monitor_custom = {}
90 selected_monitor_view = None86 selected_monitor_view = None
@@ -107,10 +103,8 @@
107 self.monitor_tree = Gtk.TreeView(self.monitors)103 self.monitor_tree = Gtk.TreeView(self.monitors)
108 self.monitor_tree.connect("cursor-changed", self.on_treeview_selected)104 self.monitor_tree.connect("cursor-changed", self.on_treeview_selected)
109 self.monitor_tree.set_size_request(200, 600)105 self.monitor_tree.set_size_request(200, 600)
110 self.monitor_tree.set_border_width(1)106 self.monitor_tree.set_properties('border_width',1,'visible',True
111 self.monitor_tree.set_visible(True)107 ,'rules_hint',True,'headers_visible',False)
112 self.monitor_tree.set_rules_hint(True)
113 self.monitor_tree.set_headers_visible(False)
114108
115 scroll = Gtk.ScrolledWindow(None, None)109 scroll = Gtk.ScrolledWindow(None, None)
116 scroll.add(self.monitor_tree)110 scroll.add(self.monitor_tree)
@@ -121,15 +115,13 @@
121115
122 column_pix_name = Gtk.TreeViewColumn(_('Name'))116 column_pix_name = Gtk.TreeViewColumn(_('Name'))
123 self.monitor_tree.append_column(column_pix_name)117 self.monitor_tree.append_column(column_pix_name)
124 name_rend = Gtk.CellRendererText()118 name_rend = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
125 name_rend.set_property("ellipsize", Pango.EllipsizeMode.END)
126 column_pix_name.pack_start(name_rend, False)119 column_pix_name.pack_start(name_rend, False)
127 column_pix_name.add_attribute(name_rend, "markup", 1)120 column_pix_name.add_attribute(name_rend, "markup", 1)
128 column_pix_name.set_resizable(True)121 column_pix_name.set_resizable(True)
129122
130 self.toolbar = Gtk.Toolbar()123 self.toolbar = Gtk.Toolbar(icon_size=1)
131 self.toolbar.set_style(Gtk.ToolbarStyle.ICONS)124 self.toolbar.set_style(Gtk.ToolbarStyle.ICONS)
132 self.toolbar.set_icon_size(1)
133 self.toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)125 self.toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
134 self.toolbar.get_style_context().set_junction_sides(Gtk.JunctionSides.TOP)126 self.toolbar.get_style_context().set_junction_sides(Gtk.JunctionSides.TOP)
135 list_vbox.pack_start(self.toolbar, False, False, 0)127 list_vbox.pack_start(self.toolbar, False, False, 0)
@@ -221,34 +213,27 @@
221 super(ExplorerWindow, self).__init__()213 super(ExplorerWindow, self).__init__()
222214
223class ConfirmMonitorStop(Gtk.Dialog):215class ConfirmMonitorStop(Gtk.Dialog):
224 216
225 def __init__(self):217 def __init__(self):
226 super(ConfirmMonitorStop, self).__init__()218 super(ConfirmMonitorStop, self).__init__()
227 self.margin = 6219 self.set_properties('margin',6,'padding',12,'title',
228 self.padding = 12220 "Confirm Monitor Stop",'resizable',False,'modal',True,'decorated',False)
229 self.set_title("Confirm Monitor Stop")
230 self.set_resizable(False)
231 self.set_modal(True)
232 self.set_decorated(False)
233 self.set_size_request(100, 50)221 self.set_size_request(100, 50)
234222
235 self.add_button(Gtk.STOCK_YES, Gtk.ResponseType.YES)223 self.add_button(Gtk.STOCK_YES, Gtk.ResponseType.YES)
236 self.add_button(Gtk.STOCK_NO, Gtk.ResponseType.NO)224 self.add_button(Gtk.STOCK_NO, Gtk.ResponseType.NO)
237225
238 box = self.get_content_area()226 box = self.get_content_area()
239 227
240 label1 = Gtk.Label()228 label1 = Gtk.Label(xalign=0,yalign=0.5,margin_top=12,
241 label1.set_markup("<b>%s</b>" 229 margin_right=12,margin_left=12)
230 label1.set_markup("<b>%s</b>"
242 %("The monitor which you are trying to remove is still running"))231 %("The monitor which you are trying to remove is still running"))
243 label1.set_alignment(0, 0.5)232
244 label1.set_margin_top(12)233 label2 = Gtk.Label(xalign=0,yalign=0.5,margin_top=12,
245 label1.set_margin_left(12)234 margin_right=12,margin_left=12)
246 label1.set_margin_right(12)
247 label2 = Gtk.Label()
248 label2.set_markup("Going ahead will stop the monitor before removing it")235 label2.set_markup("Going ahead will stop the monitor before removing it")
249 label2.set_alignment(0, 0.5)236
250 label2.set_margin_left(12)
251 label2.set_margin_right(12)
252 box.pack_start(label1, False, False, 6)237 box.pack_start(label1, False, False, 6)
253 box.pack_start(label2, False, False, 6)238 box.pack_start(label2, False, False, 6)
254239

Subscribers

People subscribed via source and target branches