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

Proposed by dhananjaysathe on 2012-03-14
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
To merge this branch: bzr merge lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer
Reviewer Review Type Date Requested Status
Manish Sinha (मनीष सिन्हा) 2012-03-14 Approve on 2012-03-15
Review via email: mp+97531@code.launchpad.net

Description of the Change

Gtk3 code refactoring

To post a comment you must log in.

Looks excellent!

review: Approve
14. By dhananjaysathe on 2012-03-15

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

Preview Diff

1=== modified file '.bzrignore' (properties changed: -x to +x)
2=== modified file 'zgexplorer/__init__.py' (properties changed: -x to +x)
3=== modified file 'zgexplorer/eventwidgets.py' (properties changed: -x to +x)
4--- zgexplorer/eventwidgets.py 2012-03-12 20:57:29 +0000
5+++ zgexplorer/eventwidgets.py 2012-03-14 22:39:19 +0000
6@@ -9,12 +9,12 @@
7 # under the terms of the GNU Lesser General Public License as published
8 # by the Free Software Foundation, either version 2 of the License, or
9 # (at your option) any later version.
10-#
11+#
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 # See the GNU Lesser General Public License for more details.
16-#
17+#
18 # 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/>.";
20 #
21@@ -30,59 +30,38 @@
22 super(TimeRangeViewer, self).__init__()
23
24 timerange_label = Gtk.Label("Time Range")
25- self.pack_start(timerange_label, False, False, 12)
26-
27- self.always_radio = Gtk.RadioButton()
28- self.always_radio.set_label("Always")
29- self.always_radio.set_margin_left(24)
30- self.pack_start(self.always_radio, False, False, 12)
31-
32- self.custom_radio = Gtk.RadioButton.new_from_widget(self.always_radio)
33- self.custom_radio.set_label("Custom")
34- self.custom_radio.set_margin_left(24)
35- self.pack_start(self.custom_radio, False, False, 12)
36-
37+ self.pack_start(timerange_label,False,False,12)
38+
39+ self.always_radio = Gtk.RadioButton(label= "Always",margin_left= 24)
40+ self.pack_start(self.always_radio,False,False,12)
41+
42+ self.custom_radio = Gtk.RadioButton(label= "Custom",margin_left= 24)
43+ self.custom_radio.join_group(self.always_radio)
44+ self.pack_start(self.custom_radio,False,False,12)
45
46
47 class TemplateViewer(Gtk.VBox):
48 def __init__(self):
49 super(TemplateViewer, self).__init__()
50
51- self.table = Gtk.Table(10, 2, False)
52- self.table.set_border_width(1)
53+ self.table = Gtk.Table(10, 2, False,border_width=1)
54 self.pack_start(self.table, True, True, 0)
55
56 event_label = Gtk.Label()
57 event_label.set_markup("Event")
58- self.table.attach(event_label, 0, 2, 0, 1, xpadding=6, ypadding=6)
59
60 # Event Interpretation
61 event_inter_label = Gtk.Label("Interpretation")
62- self.table.attach(event_inter_label, 0, 1, 1, 2, xpadding=6, ypadding=6)
63- self.event_inter_entry = Gtk.Entry()
64- self.event_inter_entry.set_width_chars(40)
65- self.table.attach(self.event_inter_entry, 1, 2, 1, 2, xpadding=6, ypadding=6)
66+ self.event_inter_entry = Gtk.Entry(width_chars=40)
67
68 # Event Manifesation
69 event_manifes_label = Gtk.Label("Manifestation")
70- self.table.attach(event_manifes_label, 0, 1, 2, 3, xpadding=6, ypadding=6)
71- self.event_manifes_entry = Gtk.Entry()
72- self.event_manifes_entry.set_width_chars(40)
73- self.table.attach(self.event_manifes_entry, 1, 2, 2, 3, xpadding=6, ypadding=6)
74-
75- # Event Actor
76- #actor_hbox = Gtk.HBox()
77- #actor_hbox.set_margin_bottom(6)
78- #self.table.attach(actor_hbox, 0, 2, 3, 4)
79+ self.event_manifes_entry = Gtk.Entry(width_chars=40)
80
81 actor_label = Gtk.Label("Actor")
82- self.table.attach(actor_label, 0, 1, 3, 4, xpadding=6, ypadding=6)
83- self.actor_entry = Gtk.Entry()
84- self.table.attach(self.actor_entry, 1, 2, 3, 4, xpadding=6, ypadding=6)
85-
86- actor_hbox = Gtk.HBox()
87- actor_hbox.set_margin_bottom(6)
88- self.table.attach(actor_hbox, 1, 2, 4, 5, xpadding=6, ypadding=6)
89+ self.actor_entry = Gtk.Entry(width_chars=40)
90+
91+ actor_hbox = Gtk.HBox(margin_bottom=6)
92 self.actor_button = Gtk.Button()
93 self.actor_button.set_size_request(32, 32)
94 actor_hbox.pack_start(self.actor_button, False, False, 12)
95@@ -91,38 +70,46 @@
96
97 subj_label = Gtk.Label()
98 subj_label.set_markup("Subject")
99- self.table.attach(subj_label, 0, 2, 5, 6, xpadding=6, ypadding=6)
100
101
102 # Subject Interpretation
103 subj_inter_label = Gtk.Label("Interpretation")
104- self.table.attach(subj_inter_label, 0, 1, 6, 7, xpadding=6, ypadding=6)
105- self.subj_inter_entry = Gtk.Entry()
106- self.subj_inter_entry.set_width_chars(40)
107- self.table.attach(self.subj_inter_entry, 1, 2, 6, 7, xpadding=6, ypadding=6)
108+ self.subj_inter_entry = Gtk.Entry(width_chars=40)
109
110 # Subject Manifesation
111 subj_manifes_label = Gtk.Label("Manifestation")
112- self.table.attach(subj_manifes_label, 0, 1, 7, 8, xpadding=6, ypadding=6)
113- self.subj_manifes_entry = Gtk.Entry()
114- self.subj_manifes_entry.set_width_chars(40)
115- self.table.attach(self.subj_manifes_entry, 1, 2, 7, 8, xpadding=6, ypadding=6)
116+ self.subj_manifes_entry = Gtk.Entry(width_chars=40)
117
118 # Mimetype
119 mimetype_label = Gtk.Label("Mimetype")
120- self.table.attach(mimetype_label, 0, 1, 8, 9, xpadding=6, ypadding=6)
121- self.mimetype_entry = Gtk.Entry()
122- self.mimetype_entry.set_width_chars(40)
123- self.table.attach(self.mimetype_entry, 1, 2, 8, 9, xpadding=6, ypadding=6)
124-
125+ self.mimetype_entry = Gtk.Entry(width_chars=40)
126+
127 # Storage
128 storage_label = Gtk.Label("Storage")
129- self.table.attach(storage_label, 0, 1, 9, 10, xpadding=6, ypadding=6)
130- self.storage_entry = Gtk.Entry()
131- self.storage_entry.set_width_chars(40)
132- self.table.attach(self.storage_entry, 1, 2, 9, 10, xpadding=6, ypadding=6)
133-
134- self.show_all()
135+ self.storage_entry = Gtk.Entry(width_chars=40)
136+
137+ attach_list = (
138+ (event_label,(0, 2, 0, 1)),
139+ (event_inter_label,(0, 1, 1, 2)),
140+ (self.event_inter_entry,(1, 2, 1, 2)),
141+ (event_manifes_label,(0, 1, 2, 3)),
142+ (self.event_manifes_entry,(1, 2, 2, 3)),
143+ (actor_label,(0, 1, 3, 4)),
144+ (self.actor_entry,(1, 2, 3, 4)),
145+ (actor_hbox,(1, 2, 4, 5)),
146+ (subj_label,(0, 2, 5, 6)),
147+ (subj_inter_label,(0, 1, 6, 7)),
148+ (self.subj_inter_entry,(1, 2, 6, 7)),
149+ (subj_manifes_label,(0, 1, 7, 8)),
150+ (self.subj_manifes_entry,(1, 2, 7, 8)),
151+ (mimetype_label,(0, 1, 8, 9)),
152+ (self.mimetype_entry,(1, 2, 8, 9)),
153+ (storage_label,(0, 1, 9, 10)),
154+ (self.storage_entry,(1, 2, 9, 10))
155+ )
156+ for widget_entry in attach_list :
157+ widget,pos = widget_entry
158+ self.table.attach(widget,pos[0],pos[1], pos[2], pos[3], xpadding=6, ypadding=6)
159
160 def set_fields_enable(self, enable):
161 self.event_inter_entry.set_sensitive(enable)
162@@ -178,10 +165,10 @@
163 if type(subj_inter) is Symbol else "")
164 self.subj_inter_entry.set_tooltip_text(subj_inter.doc \
165 if type(subj_inter) is Symbol else "")
166-
167+
168 # Event Manifestation
169 subj_manifes = subj.get_manifestation()
170- self.subj_manifes_entry.set_text(subj_manifes.name
171+ self.subj_manifes_entry.set_text(subj_manifes.name
172 if type(subj_manifes) is Symbol else "")
173 self.subj_manifes_entry.set_tooltip_text(subj_manifes.doc \
174 if type(subj_manifes) is Symbol else "")
175@@ -194,136 +181,114 @@
176 def __init__(self):
177 super(EventViewer, self).__init__()
178
179- self.table = Gtk.Table(18, 4, False)
180+ self.table = Gtk.Table(18, 4, False,border_width=1)
181 self.pack_start(self.table, False, False, 6)
182- self.table.set_border_width(1)
183
184- id_label = Gtk.Label()
185+ id_label = Gtk.Label(xalign=0,yalign=0.5)
186 id_label.set_markup("<b>%s</b>" %("Event ID"))
187- id_label.set_alignment(0, 0.5)
188- self.table.attach(id_label, 0, 1, 0, 1, xpadding = 6, ypadding =6 )
189-
190- self.id_entry = Gtk.Label()
191- self.id_entry.set_alignment(0, 0.5)
192- self.table.attach(self.id_entry, 1, 2, 0, 1, xpadding = 6, ypadding =6)
193-
194- time_label = Gtk.Label()
195+
196+ self.id_entry = Gtk.Label(xalign=0,yalign=0.5)
197+
198+ time_label = Gtk.Label(xalign=0,yalign=0.5)
199 time_label.set_markup("<b>%s</b>" %("Timestamp"))
200- time_label.set_alignment(0, 0.5)
201- self.table.attach(time_label, 2, 3, 0, 1, xpadding = 6, ypadding = 6)
202-
203- self.time_entry = Gtk.Label()
204- self.time_entry.set_alignment(0, 0.5)
205- self.table.attach(self.time_entry, 3, 4, 0, 1, xpadding = 6, ypadding = 6)
206-
207- event_int_label = Gtk.Label()
208+
209+ self.time_entry = Gtk.Label(xalign=0,yalign=0.5)
210+
211+ event_int_label = Gtk.Label(xalign=0,yalign=0.5)
212 event_int_label.set_markup("<b>%s</b>" %("Interpretation"))
213- event_int_label.set_alignment(0, 0.5)
214- self.table.attach(event_int_label, 0, 1, 1, 2, xpadding = 6, ypadding = 6)
215-
216- self.event_int_entry = Gtk.Label()
217- self.event_int_entry.set_alignment(0, 0.5)
218- self.table.attach(self.event_int_entry, 1, 4, 1, 2, xpadding = 6, ypadding = 6)
219-
220- event_manifes_label = Gtk.Label()
221+
222+ self.event_int_entry = Gtk.Label(xalign=0,yalign=0.5)
223+
224+ event_manifes_label = Gtk.Label(xalign=0,yalign=0.5)
225 event_manifes_label.set_markup("<b>%s</b>" %("Manifestation"))
226- event_manifes_label.set_alignment(0, 0.5)
227- self.table.attach(event_manifes_label, 0, 1, 2, 3, xpadding = 6, ypadding = 6)
228-
229- self.event_manifes_entry = Gtk.Label()
230- self.event_manifes_entry.set_alignment(0, 0.5)
231- self.table.attach(self.event_manifes_entry, 1, 4, 2, 3, xpadding = 6, ypadding = 6)
232-
233- actor_label = Gtk.Label()
234+
235+ self.event_manifes_entry = Gtk.Label(xalign=0,yalign=0.5)
236+
237+ actor_label = Gtk.Label(xalign=0,yalign=0.5)
238 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)
241
242- self.actor_entry = Gtk.Label()
243- self.actor_entry.set_alignment(0, 0.5)
244- self.table.attach(self.actor_entry, 1, 2, 3, 4, xpadding = 6, ypadding =6)
245+ self.actor_entry = Gtk.Label(xalign=0,yalign=0.5)
246
247 actor_box = Gtk.HBox()
248- self.table.attach(actor_box, 2, 4, 3, 4, xpadding = 6, ypadding = 6)
249- self.image_entry = Gtk.Image()
250- self.image_entry.set_alignment(0, 0.5)
251+ self.image_entry = Gtk.Image(xalign=0,yalign=0.5)
252 actor_box.pack_start(self.image_entry, False, False, 6)
253- self.actor_name_entry = Gtk.Label()
254- self.actor_name_entry.set_alignment(0, 0.5)
255+ self.actor_name_entry = Gtk.Label(xalign=0,yalign=0.5)
256 actor_box.pack_start(self.actor_name_entry, False, False, 6)
257
258- uri_label = Gtk.Label()
259+ uri_label = Gtk.Label(xalign=0,yalign=0.5)
260 uri_label.set_markup("<b>%s</b>" %("URI"))
261- uri_label.set_alignment(0, 0.5)
262- self.table.attach(uri_label, 0, 1, 4, 5, xpadding = 6, ypadding = 6)
263-
264- self.uri_entry = Gtk.Label()
265- self.uri_entry.set_alignment(0, 0.5)
266- self.table.attach(self.uri_entry, 1, 4, 4, 5, xpadding = 6, ypadding = 6)
267-
268- current_uri_label = Gtk.Label()
269+
270+ self.uri_entry = Gtk.Label(xalign=0,yalign=0.5)
271+
272+ current_uri_label = Gtk.Label(xalign=0,yalign=0.5)
273 current_uri_label.set_markup("<b>%s</b>" %("Current URI"))
274- current_uri_label.set_alignment(0, 0.5)
275- self.table.attach(current_uri_label, 0, 1, 5, 6, xpadding = 6, ypadding = 6)
276-
277- self.current_uri_entry = Gtk.Label()
278- self.current_uri_entry.set_alignment(0, 0.5)
279- self.table.attach(self.current_uri_entry, 1, 4, 5, 6, xpadding = 6, ypadding = 6)
280-
281- subj_int_label = Gtk.Label()
282+
283+ self.current_uri_entry = Gtk.Label(xalign=0,yalign=0.5)
284+
285+ subj_int_label = Gtk.Label(xalign=0,yalign=0.5)
286 subj_int_label.set_markup("<b>%s</b>" %("Interpretation"))
287- subj_int_label.set_alignment(0, 0.5)
288- self.table.attach(subj_int_label, 0, 1, 6, 7, xpadding = 6, ypadding = 6)
289-
290- self.subj_int_entry = Gtk.Label()
291- self.subj_int_entry.set_alignment(0, 0.5)
292- self.table.attach(self.subj_int_entry, 1, 4, 6, 7, xpadding = 6, ypadding = 6)
293-
294- subj_manifes_label = Gtk.Label()
295+
296+ self.subj_int_entry = Gtk.Label(xalign=0,yalign=0.5)
297+
298+ subj_manifes_label = Gtk.Label(xalign=0,yalign=0.5)
299 subj_manifes_label.set_markup("<b>%s</b>" %("Manifestation"))
300- subj_manifes_label.set_alignment(0, 0.5)
301- self.table.attach(subj_manifes_label, 0, 1, 7, 8, xpadding = 6, ypadding = 6)
302-
303- self.subj_manifes_entry = Gtk.Label()
304- self.subj_manifes_entry.set_alignment(0, 0.5)
305- self.table.attach(self.subj_manifes_entry, 1, 4, 7, 8, xpadding = 6, ypadding = 6)
306-
307-
308- origin_label = Gtk.Label()
309+
310+ self.subj_manifes_entry = Gtk.Label(xalign=0,yalign=0.5)
311+
312+
313+ origin_label = Gtk.Label(xalign=0,yalign=0.5)
314 origin_label.set_markup("<b>%s</b>" %("Origin"))
315- origin_label.set_alignment(0, 0.5)
316- self.table.attach(origin_label, 0, 1, 8, 9, xpadding = 6, ypadding = 6)
317-
318- self.origin_entry = Gtk.Label()
319- self.origin_entry.set_alignment(0, 0.5)
320- self.table.attach(self.origin_entry, 1, 2, 8, 9, xpadding = 6, ypadding =6)
321-
322- mimetype_label = Gtk.Label()
323+
324+ self.origin_entry = Gtk.Label(xalign=0,yalign=0.5)
325+
326+ mimetype_label = Gtk.Label(xalign=0,yalign=0.5)
327 mimetype_label.set_markup("<b>%s</b>" %("Mimetype"))
328- mimetype_label.set_alignment(0, 0.5)
329- self.table.attach(mimetype_label, 2, 3, 8, 9, xpadding = 6, ypadding = 6)
330-
331- self.mime_entry = Gtk.Label()
332- self.mime_entry.set_alignment(0, 0.5)
333- self.table.attach(self.mime_entry, 3, 4, 8, 9, xpadding = 6, ypadding = 6)
334-
335- text_label = Gtk.Label()
336+
337+ self.mime_entry = Gtk.Label(xalign=0,yalign=0.5)
338+
339+ text_label = Gtk.Label(xalign=0,yalign=0.5)
340 text_label.set_markup("<b>%s</b>" %("Text"))
341- text_label.set_alignment(0, 0.5)
342- self.table.attach(text_label, 0, 1, 9, 10, xpadding = 6, ypadding = 6)
343-
344- self.text_entry = Gtk.Label()
345- self.text_entry.set_alignment(0, 0.5)
346- self.table.attach(self.text_entry, 1, 2, 9, 10, xpadding = 6, ypadding =6)
347-
348- storage_label = Gtk.Label()
349+
350+ self.text_entry = Gtk.Label(xalign=0,yalign=0.5)
351+
352+ storage_label = Gtk.Label(xalign=0,yalign=0.5)
353 storage_label.set_markup("<b>%s</b>" %("Storage"))
354- storage_label.set_alignment(0, 0.5)
355- self.table.attach(storage_label, 2, 3, 9, 10, xpadding = 6, ypadding = 6)
356-
357- self.storage_entry = Gtk.Label()
358- self.storage_entry.set_alignment(0, 0.5)
359- self.table.attach(self.storage_entry, 3, 4, 9, 10, xpadding = 6, ypadding = 6)
360+
361+ self.storage_entry = Gtk.Label(xalign=0,yalign=0.5)
362+
363+ attach_list = (
364+ (id_label,(0, 1, 0, 1)),
365+ (self.id_entry,(1, 2, 0, 1)),
366+ (time_label,(2, 3, 0, 1)),
367+ (self.time_entry,(3, 4, 0, 1)),
368+ (event_int_label,(0, 1, 1, 2)),
369+ (self.event_int_entry,(1, 4, 1, 2)),
370+ (event_manifes_label,(0, 1, 2, 3)),
371+ (self.event_manifes_entry,(1, 4, 2, 3)),
372+ (actor_label,(0, 1, 3, 4)),
373+ (self.actor_entry,(1, 2, 3, 4)),
374+ (actor_box,(2, 4, 3, 4)),
375+ (uri_label,(0, 1, 4, 5)),
376+ (self.uri_entry,(1, 4, 4, 5)),
377+ (current_uri_label,(0, 1, 5, 6)),
378+ (self.current_uri_entry,(1, 4, 5, 6)),
379+ (subj_int_label,(0, 1, 6, 7)),
380+ (self.subj_int_entry,(1, 4, 6, 7)),
381+ (subj_manifes_label,(0, 1, 7, 8)),
382+ (self.subj_manifes_entry,(1, 4, 7, 8)),
383+ (origin_label,(0, 1, 8, 9)),
384+ (self.origin_entry,(1, 2, 8, 9)),
385+ (mimetype_label,(2, 3, 8, 9)),
386+ (self.mime_entry,(3, 4, 8, 9)),
387+ (text_label,(0, 1, 9, 10)),
388+ (self.text_entry,(1, 2, 9, 10)),
389+ (storage_label,(2, 3, 9, 10)),
390+ (self.storage_entry,(3, 4, 9, 10))
391+ )
392+ for widget_entry in attach_list :
393+ widget,pos = widget_entry
394+ self.table.attach(widget,pos[0],pos[1], pos[2], pos[3], xpadding=6, ypadding=6)
395+
396
397
398 def map(self, event):
399
400=== modified file 'zgexplorer/filtermanager.py' (properties changed: -x to +x)
401--- zgexplorer/filtermanager.py 2012-03-13 20:59:11 +0000
402+++ zgexplorer/filtermanager.py 2012-03-14 22:39:19 +0000
403@@ -9,12 +9,12 @@
404 # under the terms of the GNU Lesser General Public License as published
405 # by the Free Software Foundation, either version 2 of the License, or
406 # (at your option) any later version.
407-#
408+#
409 # This program is distributed in the hope that it will be useful, but
410 # WITHOUT ANY WARRANTY; without even the implied warranty of
411 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
412 # See the GNU Lesser General Public License for more details.
413-#
414+#
415 # You should have received a copy of the GNU Lesser General Public License
416 # along with this program. If not, see <http://www.gnu.org/licenses/>.";
417 #
418@@ -29,15 +29,13 @@
419 def __init__(self):
420 super(FilterManagerDialog, self).__init__()
421 self.set_destroy_with_parent(True)
422- self.set_title("Filter Manager")
423+ self.set_properties('title',"Filter Manager",'margin',12,'content-area-spacing',6) #Check Value
424 self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
425 self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
426 self.set_size_request(600, 700)
427- self.spacing = 6
428- self.margin = 12
429-
430- box = self.get_content_area()
431-
432+
433+ box = self.get_content_area()
434+
435 self.notebook = Gtk.Notebook()
436 box.pack_start(self.notebook, True, True, 0)
437
438@@ -49,7 +47,7 @@
439 def add_predefined_tab(self):
440 self.predefined_box = Gtk.VBox()
441 self.notebook.append_page(self.predefined_box, Gtk.Label("Predefined Filter"))
442-
443+
444 self.predefined_store = Gtk.ListStore(int, str)
445 self.builtin = BuiltInFilters()
446 for i in self.builtin:
447@@ -59,22 +57,18 @@
448 self.predefined_view.connect("cursor-changed", self.on_cursor_changed)
449 column_pix_name = Gtk.TreeViewColumn(_('Name'))
450 self.predefined_view.append_column(column_pix_name)
451- name_rend = Gtk.CellRendererText()
452- name_rend.set_property("ellipsize", Pango.EllipsizeMode.END)
453+ name_rend = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
454 column_pix_name.pack_start(name_rend, False)
455 column_pix_name.add_attribute(name_rend, "markup", 1)
456 column_pix_name.set_resizable(True)
457
458- self.predefined_view.set_headers_visible(False)
459- self.predefined_view.set_rules_hint(True)
460-
461- self.predefined_scroll = Gtk.ScrolledWindow()
462+ self.predefined_view.set_properties('headers-visible',False,'rules-hint',True)
463+
464+ self.predefined_scroll = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN,border_width=1)
465 self.predefined_scroll.add(self.predefined_view)
466 self.predefined_scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
467- self.predefined_scroll.set_shadow_type(Gtk.ShadowType.IN)
468- self.predefined_scroll.set_border_width(1)
469 self.predefined_box.pack_start(self.predefined_scroll, True, True, 6)
470-
471+
472 # See the Template values
473 self.predefined_viewer = TemplateViewer()
474 self.predefined_viewer.set_fields_enable(False)
475@@ -91,22 +85,18 @@
476
477 column_pix_name = Gtk.TreeViewColumn(_('Name'))
478 self.custom_view.append_column(column_pix_name)
479- name_rend = Gtk.CellRendererText()
480- name_rend.set_property("ellipsize", Pango.EllipsizeMode.END)
481+ name_rend = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
482 column_pix_name.pack_start(name_rend, False)
483 column_pix_name.add_attribute(name_rend, "markup", 1)
484 column_pix_name.set_resizable(True)
485
486- self.custom_view.set_headers_visible(False)
487- self.custom_view.set_rules_hint(True)
488-
489- self.custom_scroll = Gtk.ScrolledWindow()
490+ self.custom_view.set_properties('headers-visible',False,'rules-hint',True)
491+
492+ self.custom_scroll = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN,border_width=1)
493 self.custom_scroll.add(self.custom_view)
494 self.custom_scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
495- self.custom_scroll.set_shadow_type(Gtk.ShadowType.IN)
496- self.custom_scroll.set_border_width(1)
497 self.custom_box.pack_start(self.custom_scroll, True, True, 6)
498-
499+
500 # See the Template values
501 self.custom_viewer = TemplateViewer()
502 self.custom_viewer.set_fields_enable(False)
503@@ -140,7 +130,7 @@
504 def on_cursor_changed(self, treeview):
505 index = self.get_selected_index()
506 if index is not None:
507- self.predefined_viewer.set_values(self.builtin[index])
508+ self.predefined_viewer.set_values(self.builtin[index])
509
510 def on_custom_cursor_changed(self, treeview):
511 pass
512
513=== modified file 'zgexplorer/monitorviewer.py' (properties changed: -x to +x)
514--- zgexplorer/monitorviewer.py 2012-03-12 20:57:29 +0000
515+++ zgexplorer/monitorviewer.py 2012-03-14 22:39:19 +0000
516@@ -9,12 +9,12 @@
517 # under the terms of the GNU Lesser General Public License as published
518 # by the Free Software Foundation, either version 2 of the License, or
519 # (at your option) any later version.
520-#
521+#
522 # This program is distributed in the hope that it will be useful, but
523 # WITHOUT ANY WARRANTY; without even the implied warranty of
524 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
525 # See the GNU Lesser General Public License for more details.
526-#
527+#
528 # You should have received a copy of the GNU Lesser General Public License
529 # along with this program. If not, see <http://www.gnu.org/licenses/>.";
530 #
531@@ -45,50 +45,36 @@
532
533 self.spacing = 6
534 self.margin = 12
535-
536+
537 self.builtin = BuiltInFilters()
538
539- #desc_label = Gtk.Label()
540- #desc_label.set_alignment(0, 0)
541- #desc_label.set_markup("<b>%s</b>" %("Description"))
542- #self.pack_start(desc_label, False, False, 6)
543-
544- self.desc_entry = Gtk.Label()
545- self.desc_entry.set_alignment(0, 0)
546- self.desc_entry.set_line_wrap(True)
547- self.desc_entry.set_line_wrap_mode(Pango.WrapMode.WORD)
548+ self.desc_entry = Gtk.Label(xalign=0,yalign=0,wrap=True)
549 self.pack_start(self.desc_entry, False, False, 6)
550
551
552 # ButtonBox
553- self.button_box = Gtk.HButtonBox()
554- self.button_box.set_homogeneous(False)
555+ self.button_box = Gtk.HButtonBox(False)
556 self.button_box.set_layout(Gtk.ButtonBoxStyle.START)
557 self.pack_start(self.button_box, False, False, 6)
558
559- self.start = Gtk.Button()
560- self.start.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_PLAY,
561- Gtk.IconSize.BUTTON))
562+ self.start = Gtk.Button(image=Gtk.Image.new_from_stock(
563+ Gtk.STOCK_MEDIA_PLAY,Gtk.IconSize.BUTTON))
564 self.start.connect("clicked", self.start_monitor)
565 self.button_box.pack_start(self.start, False, False, 6)
566
567- self.stop = Gtk.Button()
568- self.stop.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_STOP,
569- Gtk.IconSize.BUTTON))
570+ self.stop = Gtk.Button(image= Gtk.Image.new_from_stock(
571+ Gtk.STOCK_MEDIA_STOP,Gtk.IconSize.BUTTON))
572 self.stop.connect("clicked", self.stop_monitor)
573 self.stop.set_sensitive(False)
574 self.button_box.pack_start(self.stop, False, False, 6)
575
576- self.clear = Gtk.Button()
577- self.clear.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_CLEAR,
578- Gtk.IconSize.BUTTON))
579+ self.clear = Gtk.Button(image=Gtk.Image.new_from_stock(
580+ Gtk.STOCK_CLEAR,Gtk.IconSize.BUTTON))
581 self.clear.connect("clicked", self.clear_events)
582 self.button_box.pack_start(self.clear, False, False, 6)
583
584- self.scroll = Gtk.ScrolledWindow(None, None)
585+ self.scroll = Gtk.ScrolledWindow(None, None,border_width=1,shadow_type=Gtk.ShadowType.IN)
586 self.scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
587- self.scroll.set_shadow_type(Gtk.ShadowType.IN)
588- self.scroll.set_border_width(1)
589 self.pack_start(self.scroll, True, True, 6)
590
591 # Event Id, TimeStamp, Interpretation, Manifestation, Actor
592@@ -156,7 +142,7 @@
593
594 timestamp = int(str(event.get_timestamp()))
595 time = datetime.fromtimestamp(timestamp/1000).strftime("%Y-%m-%d %I:%M:%S %p")
596-
597+
598 actor = event.get_actor()
599
600 event_inter = str(event.get_interpretation())
601
602=== modified file 'zgexplorer/templates.py' (properties changed: -x to +x)
603--- zgexplorer/templates.py 2012-03-10 13:39:20 +0000
604+++ zgexplorer/templates.py 2012-03-14 22:39:19 +0000
605@@ -9,12 +9,12 @@
606 # under the terms of the GNU Lesser General Public License as published
607 # by the Free Software Foundation, either version 2 of the License, or
608 # (at your option) any later version.
609-#
610+#
611 # This program is distributed in the hope that it will be useful, but
612 # WITHOUT ANY WARRANTY; without even the implied warranty of
613 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
614 # See the GNU Lesser General Public License for more details.
615-#
616+#
617 # You should have received a copy of the GNU Lesser General Public License
618 # along with this program. If not, see <http://www.gnu.org/licenses/>.";
619 #
620@@ -31,7 +31,7 @@
621 template1,\
622 TimeRange.always(), \
623 ResultType.MostRecentEvents]
624-
625+
626 template2 = Event.new_for_values(interpretation = \
627 Interpretation.ACCESS_EVENT)
628 self[1] = ["Access Events", \
629
630=== modified file 'zgexplorer/window.py' (properties changed: -x to +x)
631--- zgexplorer/window.py 2012-03-13 20:59:11 +0000
632+++ zgexplorer/window.py 2012-03-14 22:39:19 +0000
633@@ -9,12 +9,12 @@
634 # under the terms of the GNU Lesser General Public License as published
635 # by the Free Software Foundation, either version 2 of the License, or
636 # (at your option) any later version.
637-#
638+#
639 # This program is distributed in the hope that it will be useful, but
640 # WITHOUT ANY WARRANTY; without even the implied warranty of
641 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
642 # See the GNU Lesser General Public License for more details.
643-#
644+#
645 # You should have received a copy of the GNU Lesser General Public License
646 # along with this program. If not, see <http://www.gnu.org/licenses/>.";
647 #
648@@ -34,7 +34,7 @@
649 self.connect("destroy", Gtk.main_quit)
650 self.set_title("Zeitgeist Explorer")
651 self.set_size_request(1400, 900)
652-
653+
654 self.client = ZeitgeistClient()
655
656 main_box = Gtk.VBox()
657@@ -45,19 +45,15 @@
658 toolbar = Gtk.Toolbar()
659
660 # New Tool Item
661- toolitem_new = Gtk.ToolButton()
662- toolitem_new.set_label("New")
663- toolitem_new.set_icon_name("add")
664+ toolitem_new = Gtk.ToolButton(label="New",icon_name="add")
665 toolitem_new.connect("clicked", self.toolitem_new_clicked)
666 toolbar.insert(toolitem_new, -1)
667
668 # Load Tool Item
669- toolitem_load = Gtk.ToolButton()
670- toolitem_load.set_stock_id(Gtk.STOCK_OPEN)
671- toolitem_load.set_label("Load")
672- toolitem_load.connect("clicked", self.toolitem_load_clicked)
673+ toolitem_load = Gtk.ToolButton(stock_id=Gtk.STOCK_OPEN,label="Load")
674+ toolitem_load.connect("clicked", self.toolitem_load_clicked)
675 toolbar.insert(toolitem_load, -1)
676-
677+
678 #main_box.pack_start(toolbar, False, True, 0)
679
680 self.filter_manager = FilterManagerDialog()
681@@ -84,7 +80,7 @@
682
683
684 class MonitorWindow(Gtk.VBox):
685-
686+
687 monitor_builtin = {}
688 monitor_custom = {}
689 selected_monitor_view = None
690@@ -107,10 +103,8 @@
691 self.monitor_tree = Gtk.TreeView(self.monitors)
692 self.monitor_tree.connect("cursor-changed", self.on_treeview_selected)
693 self.monitor_tree.set_size_request(200, 600)
694- self.monitor_tree.set_border_width(1)
695- self.monitor_tree.set_visible(True)
696- self.monitor_tree.set_rules_hint(True)
697- self.monitor_tree.set_headers_visible(False)
698+ self.monitor_tree.set_properties('border_width',1,'visible',True
699+ ,'rules_hint',True,'headers_visible',False)
700
701 scroll = Gtk.ScrolledWindow(None, None)
702 scroll.add(self.monitor_tree)
703@@ -121,15 +115,13 @@
704
705 column_pix_name = Gtk.TreeViewColumn(_('Name'))
706 self.monitor_tree.append_column(column_pix_name)
707- name_rend = Gtk.CellRendererText()
708- name_rend.set_property("ellipsize", Pango.EllipsizeMode.END)
709+ name_rend = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
710 column_pix_name.pack_start(name_rend, False)
711 column_pix_name.add_attribute(name_rend, "markup", 1)
712 column_pix_name.set_resizable(True)
713
714- self.toolbar = Gtk.Toolbar()
715+ self.toolbar = Gtk.Toolbar(icon_size=1)
716 self.toolbar.set_style(Gtk.ToolbarStyle.ICONS)
717- self.toolbar.set_icon_size(1)
718 self.toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
719 self.toolbar.get_style_context().set_junction_sides(Gtk.JunctionSides.TOP)
720 list_vbox.pack_start(self.toolbar, False, False, 0)
721@@ -221,34 +213,27 @@
722 super(ExplorerWindow, self).__init__()
723
724 class ConfirmMonitorStop(Gtk.Dialog):
725-
726+
727 def __init__(self):
728 super(ConfirmMonitorStop, self).__init__()
729- self.margin = 6
730- self.padding = 12
731- self.set_title("Confirm Monitor Stop")
732- self.set_resizable(False)
733- self.set_modal(True)
734- self.set_decorated(False)
735+ self.set_properties('margin',6,'padding',12,'title',
736+ "Confirm Monitor Stop",'resizable',False,'modal',True,'decorated',False)
737 self.set_size_request(100, 50)
738
739 self.add_button(Gtk.STOCK_YES, Gtk.ResponseType.YES)
740 self.add_button(Gtk.STOCK_NO, Gtk.ResponseType.NO)
741
742 box = self.get_content_area()
743-
744- label1 = Gtk.Label()
745- label1.set_markup("<b>%s</b>"
746+
747+ label1 = Gtk.Label(xalign=0,yalign=0.5,margin_top=12,
748+ margin_right=12,margin_left=12)
749+ label1.set_markup("<b>%s</b>"
750 %("The monitor which you are trying to remove is still running"))
751- label1.set_alignment(0, 0.5)
752- label1.set_margin_top(12)
753- label1.set_margin_left(12)
754- label1.set_margin_right(12)
755- label2 = Gtk.Label()
756+
757+ label2 = Gtk.Label(xalign=0,yalign=0.5,margin_top=12,
758+ margin_right=12,margin_left=12)
759 label2.set_markup("Going ahead will stop the monitor before removing it")
760- label2.set_alignment(0, 0.5)
761- label2.set_margin_left(12)
762- label2.set_margin_right(12)
763+
764 box.pack_start(label1, False, False, 6)
765 box.pack_start(label2, False, False, 6)
766

Subscribers

People subscribed via source and target branches