Merge lp:~fraser-waters08/spud/statusbar-loading into lp:spud

Proposed by Fraser Waters
Status: Merged
Approved by: Patrick Farrell
Approved revision: 401
Merged at revision: 403
Proposed branch: lp:~fraser-waters08/spud/statusbar-loading
Merge into: lp:spud
Diff against target: 57 lines (+7/-8)
2 files modified
diamond/bin/diamond (+2/-7)
diamond/diamond/interface.py (+5/-1)
To merge this branch: bzr merge lp:~fraser-waters08/spud/statusbar-loading
Reviewer Review Type Date Requested Status
Patrick Farrell Pending
Review via email: mp+66787@code.launchpad.net

Description of the change

Loading a schema shows its location on the status bar.

Two points to be reviewed:
1) Is the change to the main diamond file OK? The removal of statusbar_clear is needed to stop the schema location being cleared, but what about in lining the initialize function.
2) Is the removal of statusbar_clear from on_select_row OK? The update of the treeview after loading a schema always seems to select no row, and thus trigger the clearing of the status bar.

To post a comment you must log in.
Revision history for this message
Patrick Farrell (pefarrell) wrote :

Very nice!

The inlining of the initialise function is fine: it was originally split out so that it could be threaded, but threading it caused all sorts of bizarre behaviour, and I abandoned the idea.

One minor quibble: can you get rid of the '.' at the end of 'Schema ' + schemafile + ' already loaded.'? None of the other messages end in punctuation.

Other than that, it's perfect, I think!

402. By Fraser Waters

Removed full stop from status bar message.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'diamond/bin/diamond'
2--- diamond/bin/diamond 2011-04-02 09:20:50 +0000
3+++ diamond/bin/diamond 2011-07-04 13:59:33 +0000
4@@ -206,14 +206,9 @@
5
6 i = interface.Diamond(gladefile = gladefile, logofile = logofile, suffix = suffix)
7
8- def initialise(i, s, f):
9- i.open_file(schemafile = s, filename = f)
10- i.main_window.window.set_cursor(None)
11- i.statusbar.clear_statusbar()
12-
13- i.statusbar.set_statusbar("Loading ...")
14 i.main_window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
15- initialise(i, input_schemafile, input_filename)
16+ i.open_file(schemafile = input_schemafile, filename = input_filename)
17+ i.main_window.window.set_cursor(None)
18
19 gtk.main()
20
21
22=== modified file 'diamond/diamond/interface.py'
23--- diamond/diamond/interface.py 2011-07-04 09:57:05 +0000
24+++ diamond/diamond/interface.py 2011-07-04 13:59:33 +0000
25@@ -224,6 +224,7 @@
26 def load_schema(self, schemafile):
27 # so, if the schemafile has already been opened, then ..
28 if schemafile == self.schemafile:
29+ self.statusbar.set_statusbar('Schema ' + schemafile + ' already loaded')
30 return
31
32 # if we aren't using a http schema, and we're passed a relative filename, we
33@@ -231,12 +232,16 @@
34 if 'http' not in schemafile:
35 schemafile = os.path.abspath(schemafile)
36
37+ self.statusbar.set_statusbar('Loading schema from ' + schemafile)
38+
39 # now, let's try and read the schema.
40 try:
41 s_read = schema.Schema(schemafile)
42 self.s = s_read
43+ self.statusbar.set_statusbar('Loaded schema from ' + schemafile)
44 except:
45 dialogs.error_tb(self.main_window, "Unable to open schema file \"" + schemafile + "\"")
46+ self.statusbar.clear_statusbar()
47 return
48
49 self.schemafile = schemafile
50@@ -1175,7 +1180,6 @@
51
52 path = self.get_selected_row(self.treeview.get_selection())
53 if path is None:
54- self.statusbar.clear_statusbar()
55 return
56 iter = self.treestore.get_iter(path)
57 choice_or_tree = self.treestore.get_value(iter, 2)

Subscribers

People subscribed via source and target branches