Merge lp:~janos-gyerik/ubuntu-accomplishments-viewer/show-examples-in-identity-screen into lp:ubuntu-accomplishments-viewer

Proposed by Janos Gyerik
Status: Merged
Merged at revision: 118
Proposed branch: lp:~janos-gyerik/ubuntu-accomplishments-viewer/show-examples-in-identity-screen
Merge into: lp:ubuntu-accomplishments-viewer
Diff against target: 54 lines (+15/-6)
1 file modified
accomplishments_viewer/EditExtrainfoDialog.py (+15/-6)
To merge this branch: bzr merge lp:~janos-gyerik/ubuntu-accomplishments-viewer/show-examples-in-identity-screen
Reviewer Review Type Date Requested Status
Ubuntu Accomplishments Viewer Developers Pending
Review via email: mp+111722@code.launchpad.net

Description of the change

Show the [example] in the identity screen (the one opened with ctrl-i) if there is any.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'accomplishments_viewer/EditExtrainfoDialog.py'
2--- accomplishments_viewer/EditExtrainfoDialog.py 2012-05-17 21:12:19 +0000
3+++ accomplishments_viewer/EditExtrainfoDialog.py 2012-06-23 18:46:17 +0000
4@@ -79,10 +79,10 @@
5 for i in infoneeded:
6 if i["needs-information"] not in section_dict:
7 section_dict[i["needs-information"]] = list([i["collection"]])
8- extrainfo_dict[i["needs-information"]] = [i["label"],i["description"],i["value"]]
9+ extrainfo_dict[i["needs-information"]] = i
10 else:
11 section_dict[i["needs-information"]].append(i["collection"])
12- extrainfo_dict[i["needs-information"]] = [i["label"],i["description"],i["value"]]
13+ extrainfo_dict[i["needs-information"]] = i
14 for a in section_dict:
15 section_dict[a] = tuple(section_dict[a])
16
17@@ -148,12 +148,13 @@
18
19 for f in d:
20 #for each information field in the group...
21- extrainfolist = extrainfo_dict[f]
22- label = extrainfolist[0]
23+ extrainfo = extrainfo_dict[f]
24+ label = extrainfo['label']
25 label = label.replace("&","&") #pango would complain on that
26- description = extrainfolist[1]
27+ description = extrainfo['description']
28 description = description.replace("&","&") #pango would complain on that
29- value = extrainfolist[2]
30+ value = extrainfo['value']
31+ example = extrainfo.get('example')
32
33 g_entrybox = Gtk.HBox()
34 g_mainlabel = Gtk.Label(label)
35@@ -166,12 +167,20 @@
36 g_desclabel = Gtk.Label("<small><small><b>" + description + "</b></small></small>")
37 g_desclabel.set_use_markup(True)
38 g_desclabel.set_alignment(1,0)
39+
40+ if example:
41+ g_example = Gtk.Label("<small><small><b>Example: " + example + "</b></small></small>")
42+ g_example.set_use_markup(True)
43+ g_example.set_alignment(1,0)
44+ g_example.set_margin_right(20)
45
46 g_entrybox.set_margin_right(20)
47 g_desclabel.set_margin_right(20)
48
49 g_box.pack_start(g_entrybox,True,False,0)
50 g_box.pack_start(g_desclabel,True,False,0)
51+ if example:
52+ g_box.pack_start(g_example,True,False,0)
53 g_entrybox.pack_end(g_entry,False,False,0)
54 g_entrybox.pack_end(g_mainlabel,False,False,0)
55

Subscribers

People subscribed via source and target branches

to all changes: